1

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 ?

maxshuty
  • 9,708
  • 13
  • 64
  • 77
sumesh
  • 2,179
  • 2
  • 21
  • 37

1 Answers1

3

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()
Unheilig
  • 16,196
  • 193
  • 68
  • 98