2番目のVCのラベルにデータをfunc mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView)
で渡そうとしています。Swift:定数 ''を初期化する前に使用
定数 'destVC' 初期化される前に使用:私は
annotation.title
へshopName.text
を設定は、私はというエラーを取得します。func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) { print("Annotation selected") if let annotation = view.annotation as? POIAnnotations { let destVC : ShopDetailViewController destVC.shopName.text = annotation.title! print("Your annotation title is: \(annotation.title!)") } }
何が問題になるのかよく分かりません。
は 'destVCはできないだろうか?どのように私はそれを初期化するだろうか? – daanyyaal
@daanyyaal storyboardのviewControllerの識別子を設定する方法がわからない場合は、これをチェックしてください。http://stackoverflow.com/a/15478575/6433023 –