I am migrating an iOS app to XCode9 from 8. I'm not sure what's causing but it seems like either Swift 3.2/Xcode 9 is behaving badly.
So this app I'm developing has Status bar on all the view controllers and so has it been, but after migrating this started showing only the home view. Changing view by tab button it becomes blank like the following screenshots.
View controller-based status bar appearance
is NO
and Hide Status Bar
is OFF
I added setNeedsStatusBarAppearanceUpdate()
and its parameters but still not working.
Here's code of ViewController of "Another View"
import UIKit
class InfoViewController: UITableViewController {
private var threads: [Info] = []
private var loading: Bool = false
private var hasNext: Bool = true
private var selectedThread: Info?
private var noInfoView: UIView?
internal var shouldRefresh: Bool = true
private var pagingIndicatorView: UIActivityIndicatorView!
private var timer: Timer?
private var poolingInterval: TimeInterval = 60 * 3
private var shouldClearThread: Bool = false
private var nextViewController: InfoDetailViewController?
let RequireCheckStatusForMessagesNotificationKey = "RequireCheckStatusForMessagesNotificationKey"
deinit {
NotificationCenter.default.removeObserver(self)
stopPooling()
}
override func viewDidLoad() {
super.viewDidLoad()
setNeedsStatusBarAppearanceUpdate()
tableView.contentInset.bottom = 40
pagingIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.gray)
pagingIndicatorView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 50)
pagingIndicatorView.hidesWhenStopped = true
NotificationCenter.default.addObserver(self, selector: #selector(InfoViewController.requireCheckInfosForMessagesNotificationHandler(notif:)), name: NSNotification.Name(rawValue: RequireCheckStatusForMessagesNotificationKey), object: nil)
}
var statusBarStyle : UIStatusBarStyle = .lightContent
override var preferredStatusBarStyle: UIStatusBarStyle {
get {
return statusBarStyle
}
}
var statusBarStatus : Bool = false
override var prefersStatusBarHidden: Bool {
get {
return statusBarStatus
}
}