4

I just update to Xcode 8 beta 6 and got an overload of errors (no surprise), I got most of them sorted out, but there are two errors which I am unsure of how to fix.

For this I get this error Method does not override any method from its superclass

override func prepare(for segue: UIStoryboardSegue, sender: AnyObject?) {
    if(segue.identifier == "***"){

    }
}

And for this I get this error init has been renamed to init(describing:)

return String(self.type)
anonymous
  • 371
  • 1
  • 3
  • 12
  • See [SE-0116](https://github.com/apple/swift-evolution/blob/master/proposals/0116-id-as-any.md) & [SE-0089](https://github.com/apple/swift-evolution/blob/master/proposals/0089-rename-string-reflection-init.md) – Hamish Aug 18 '16 at 18:55

3 Answers3

11

The method signature has changed in Xcode 8 now it is the following:

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
   // Code here
}
darren102
  • 2,830
  • 1
  • 22
  • 24
  • 1
    I believe ```fun``` above should be ```func```. Just in case someone is cutting and pasting this code. Thanks for the answer; I'll remember to check the method signature in the future for changes. – liquidki Aug 29 '16 at 00:04
9

You should use

String(describing: self.type)

instead of

String(self.type)

3

Basically AnyObject is now Any in most functions

Greg Robertson
  • 2,317
  • 1
  • 16
  • 30