1
votes
override func supportedInterfaceOrientations() -> Int {
    if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
        return Int(UIInterfaceOrientationMask.AllButUpsideDown.rawValue)
    } else {
        return Int(UIInterfaceOrientationMask.All.rawValue)
    }
}

So I was working on a tutorial and I had completed it and when I updated to xcode 7 all my code got littered with bugs.

In the piece above I'm getting the error "method does not override any method from its super class" but when I remove override I get this error : Method 'supportedInterfaceOrientations()' with Objective-C selector 'supportedInterfaceOrientations' conflicts with method 'supportedInterfaceOrientations()' from superclass 'UIViewController' with the same Objective-C selector

I've been researching but I'm quite new to programming and a lot of the answers on here I don't understand well enough to apply to my situation.

Thank You

1

1 Answers

3
votes

It no longer returns an Int. The new method signature wants a UIInterfaceOrientationMask returned.

override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
    if UIDevice.currentDevice().userInterfaceIdiom == .phone {
        return UIInterfaceOrientationMask.allButUpsideDown
    } else {
        return UIInterfaceOrientationMask.all
    }
}