0
在我的「共享位置」功能中,我希望用戶能夠發送以長/緯度座標形式共享其當前位置的文本。我用我實現的錯誤是「上下文類型」字符串「不能用於數組文字」。如何或者什麼是正確的代碼來實現?如何通過短信文本發送用戶的經度和緯度座標
這裏是我的代碼
@IBAction func shareLocation(sender: AnyObject) {
// Send user coordinates through text
if !MFMessageComposeViewController.canSendText() {
print("SMS services are not available")
var coordinate: CLLocationCoordinate2D
messageVC!.body = [coordinate.latitude, coordinate.longitude];
messageVC!.recipients = [LookoutCell.description()];
messageVC!.messageComposeDelegate = self;
self.presentViewController(messageVC!, animated: false, completion: nil)
}
}
哇,我不知道這麼多是不正確的。我還會檢查格式指南以獲取更多幫助。 – jonB22