Reputation: 105
I try desperately to get the MKMapSnapshotter running on the simulator. However it works without issues on real devices, but not on the simulator which brings some trouble for me now with different iOS versions I do not have as hardware.
Is it by purpose to not work on the simulator? I did not found anything about this.
Here the code that works obviously only on real devices:
@IBAction func buttonPressed(_ sender: Any) {
let loc = CLLocationCoordinate2D(latitude: 48.0, longitude: 11.3)
let region = MKCoordinateRegionMakeWithDistance(loc, 100.0, 100.0)
let options = MKMapSnapshotOptions()
options.region = region
options.scale = 2.0
options.size = CGSize(width: 1024.0, height: 768.0)
let snapshotter = MKMapSnapshotter(options: options)
snapshotter.start(completionHandler: (
{(snapshot, error) in
print ("I am never called in simulator")
})
)
}
PS: tried in XCode 9.4.1
Upvotes: 1
Views: 202