So far I edited the code and just added two constants image and descriptions. I want to use them in my custom table view cell.
class Artwork: NSObject, MKAnnotation {
let title: String?
let locationName: String
let discipline: String
let descriptions: String
let coordinate: CLLocationCoordinate2D
let image: String
class func fromJSON(_ json: [JSONValue]) ā Artwork? {
// 1
var title: String
if let titleOrNil = json[16].string {
title = titleOrNil
} else {
title = āā
}
let locationName = json[12].string
let discipline = json[15].string
let descriptions = json[11].string
let image = json[13].string
let latitude = (json[18].string! as NSString).doubleValue
let longitude = (json[19].string! as NSString).doubleValue
let coordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
Is it possible to change the name of a sea in mapkit. Above UAE the sea name they use is Arabian Sea, but in ios mapkit it is persian gulf,which my client is not accepting.
You could switch to Google Maps? although they have (Arabian Gulf) in parentheses, under Persian Gulf, only if you zoom in. Possibly they show only Arabian Gulf if accessed from an Arab country, like Google Earth.
Hey there! I have a basic question about MapKit. Can I build an app via MapKit that will give me userās driving directions natively without having to switch to the Maps app?
I havenāt used the Siri Maps feature. From whatās written online, it seems to originate from Siri, that is, you ask Siri to ātake me homeā or to guide you to a cafe or some other place that Siri can ask Maps to look for, then it brings up some map route options, you pick one, and Siri talks you there.
I think SiriKit is still limited in what you can use it for, but some of the āIntentsā involve Maps, so one of them might fit your app.
Great tutorial!
But Iām all new to swift programming, and kinda lost. Iāve followed every step, and adjusted changes which you have commented on here. I have no errors in my project, but the pins are not showing. I have included the 2 files in the project, and i have called loadInitialData.
Is there any dummy mistake you could think of, i could have made?
hi Lise: the most up to date code is in the Swift 3 link ā download that and compare it with your code. Look especially at anything that looks like a delegate: make sure youāve added the right protocols (they might be different from the original tutorial) and have set the delegate correctly. Basically, search for delegate in my final Swift 3 code and see if yours matches.
No i know it is an impossible question without code, but since i do not have any errors i donāt know where it fails - and i guess youāre not interested in my entire project ;b
I have mapView.delegate = self in my viewDidLoad
And yes, the single pin was working fine