私の「共有場所」機能内で、ユーザーが現在の場所を経度/緯度座標の形式で共有するテキストを送信できるようにしたいと考えています。私が実装したもので発生するエラーは、「コンテキスト型 "string" は配列リテラルでは使用できません」です。実装する正しいコードは何ですか?
これが私のコードです
@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)
}
}