Please help! I don't find any information about passing data of Custom Point Annotation. How to prepare information of annotation for another view controller.? Thanks!
You did not provide much information about your problem but since you mention a view controller I assume its connected with iOS.
iOS development specific questions are better asked on Stack Overflow or Apple dev forums. This forum is focused around the Swift language.
If you still think your question is specific to the Swift language, please provide more context on what you are trying to do.
When creating a Custom Point Annotation, you can use the MKAnnotation
protocol to define the coordinate, title, and subtitle of the annotation. Additionally, you can define your own properties to store custom data.
import MapKit
class CustomAnnotation: NSObject, MKAnnotation {
var coordinate: CLLocationCoordinate2D
var title: String?
var subtitle: String?
var identifier: String
init(coordinate: CLLocationCoordinate2D, title: String?, subtitle: String?, identifier: String) {
self.coordinate = coordinate
self.title = title
self.subtitle = subtitle
self.identifier = identifier
}
}
For More Details visit : subul