33

I use Xcode 8.0 beta to test my app, but after it convert my code 2.2 to 3.0, came out many unsolved bugs. Below the demo, Xcode8.0 appear the error message

1. Expected "{" after "if" condition...

    if annotation.isKindof: (MKUserLocation) {
        return nil
    } 

Second error is the map kit...I use iskind(of: MKUserLocation) still not work out, it will appear another error message

2.Braced block of statements is an unused closure

    if annotation.isKindof: (MKUserLocation) {
        return nil
    }

3. Missing argument label 'of:' in call

    if annotation.isKind(of: MKUserLocation) {
        return nil
    }
Sahil Kapoor
  • 11,183
  • 13
  • 64
  • 87
Wangdu Lin
  • 913
  • 1
  • 9
  • 19

1 Answers1

172

The substitute for isKindOf in Swift3 is:

if annotation is MKUserLocation {
    return nil
}
Machado
  • 14,105
  • 13
  • 56
  • 97
Sahil Kapoor
  • 11,183
  • 13
  • 64
  • 87