The Status Bar - method does not override any method from its superclass

I just reached the part with the status bar. In each to the new files that I created (MyTabBarController, MyNavigationController, and MyImagePickerController), I am getting an error:

method does not override any method from its superclass. I am using Swift 3.0 with Xcode 8 beta 4.

import UIKit

class MyTabBarController: UITabBarController {
override func preferredStatusBarStyle() → UIStatusBarStyle {
return .lightContent
}

override func childViewControllerForStatusBarStyle() -> UIViewController? {
    return nil
}

}

It looks like it changed to a “Get ONLY variable” in Swift 3, so if anyone else runs into this issue, you can fix it by using:

override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}

1 Like

Yep, lots of stuff has changed in Swift 3. An update to the book will be available when Xcode 8 and Swift 3 are out of beta.