Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyMapAnnotation : NSObject, MKAnnotation {
- let title: String
- let subtitle: String
- let coordinate: CLLocationCoordinate2D
- init(title: String, subtitle: String, coordinate: CLLocationCoordinate2D) {
- self.title = title
- self.subtitle = subtitle
- self.coordinate = coordinate
- }
- }
- let coordinate = CLLocationCoordinate2D(latitude: 46.830930, longitude: 7.705106)
- let annotation = MyMapAnnotation(title: "Title", subtitle: "Subtitle", coordinate: coordinate)
- if CLLocationCoordinate2DIsValid(coordinate) {
- map.addAnnotation(annotation)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement