使って創ってApp

ソフトウェアを使ったり作ったりするブログです

iOSアプリ開発で、アプリ全体でstatusBarのスタイルを変更する

iOSアプリ開発で、アプリ全体でstatusBar のスタイルを変更する方法のメモです。

開発環境

アプリ全体でstatusBar のスタイルを変更する

AppDelegate.swift のアプリケーションが起動するときに呼び出される関数で、statusBar のスタイルを指定します。

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent
}

これでアプリ全体で時間などの表示が、白い文字や白いアイコンになります。

f:id:hitxutokun:20160110235020p:plain