MKMapItem error in swift 2.0

467 views Asked by At

When I run the following code, I get the error "Cannot call value of non function type 'MKMapItem?'

request.source(MKMapItem.mapItemForCurrentLocation())

It worked fine in swift 1.2 what has changed ?

1

There are 1 answers

0
Unheilig On BEST ANSWER

In Swift 2 (Xcode Beta 5), source is now a property of MKDirectionsRequest:

Hence, instead of:

request.source(MKMapItem.mapItemForCurrentLocation())

It is now:

request.source = MKMapItem.mapItemForCurrentLocation()