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