Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. class MyMapAnnotation : NSObject, MKAnnotation {
  2.  
  3. let title: String
  4. let subtitle: String
  5. let coordinate: CLLocationCoordinate2D
  6.  
  7. init(title: String, subtitle: String, coordinate: CLLocationCoordinate2D) {
  8. self.title = title
  9. self.subtitle = subtitle
  10. self.coordinate = coordinate
  11. }
  12. }
  13.  
  14. let coordinate = CLLocationCoordinate2D(latitude: 46.830930, longitude: 7.705106)
  15. let annotation = MyMapAnnotation(title: "Title", subtitle: "Subtitle", coordinate: coordinate)
  16.  
  17. if CLLocationCoordinate2DIsValid(coordinate) {
  18. map.addAnnotation(annotation)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement