ios - how can i change the statusbar color in specifi view using swift? -


inviewdidload     uiapplication.sharedapplication().statusbarstyle = .lightcontent   override func viewwilldisappear(animated: bool) {         super.viewwilldisappear(animated)          uiapplication.sharedapplication().statusbarstyle = uistatusbarstyle.default      } 

by taking reference of above link have implemented.but statusbar color not changing text on statusbar changing. changing status bar color specific viewcontrollers using swift in ios8

if app using navigation bar, status bar color changed match color of navigation bar.

without navigation bar, can place 20 point tall view (e.g. view filled color) behind status bar , that's color appear user.

i found above information in article

to in swift, maybe like:

// make view tall enough fit under status bar var statusbarview: uiview = uiview(frame: cgrectmake(0.0, 0.0, 320.0, 20.0))  // give color statusbarview.backgroundcolor = uicolor.redcolor()  // , add view controller's view view.addsubview(statusbarview)  

Comments