Here's some sample code in Swift that seems to mimic the Things 3 status bar effect pretty closely. In essence you're creating another window to place directly over the status bar that will mute the color slightly.
Important things to note in this example:
- We assign the new
UIWindow
to a property, otherwise it will be released as soon as we leave the scope.
- We set the
windowLevel
to UIWindowLevelStatusBar
- We set
isHidden
to false
instead of calling makeKeyAndVisible
, since we still want the normal window to be the key window
AppDelegate.swift
:
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var overlayWindow = UIWindow()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
overlayWindow.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 20)
overlayWindow.windowLevel = UIWindowLevelStatusBar
overlayWindow.backgroundColor = UIColor(white: 1, alpha: 0.4)
overlayWindow.rootViewController = UIViewController()
overlayWindow.isHidden = false
return true
}
}