-4
=ピン は私を助けてください{スウィフト}ピンをリンクさせますか?私は私のletのリンク方法が見つからない
私の最初のコード:
@IBOutlet weak var Point1S: MKMapView!
override func viewDidLoad() {
super.viewDidLoad()
let location = CLLocationCoordinate2DMake(43.429837, 5.434837)
Point1S.setRegion(MKCoordinateRegionMakeWithDistance(location, 500, 500), animated: true)
let pin = here
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
セカンドコード:
import MapKit
class MKPinAnnotationView : NSObject , MKAnnotation {
var title: String?
var subtitle: String?
var coordinate: CLLocationCoordinate2D
init(title : String , subtitle : String , coordinate : CLLocationCoordinate2D) {
self.title = title
self.subtitle = subtitle
self.coordinate = coordinate
}
}
私は私の上に置く方法がわかりませんletピンの第1コード=第2コード
ありがとう
あなたの 'MKPinAnnotationView'クラスをどのようにインスタンス化するか尋ねていますか? –