- July 11, 2025
- Mins Read
StatusBarOverlay will automatically show a “No Internet Connection” bar when your app loses connection, and hide it again. It supports apps which hide the status bar and The Notch
Add this to your CocoaPods Podfile
pod ‘StatusBarOverlay’
In your Info.plist
file set UIViewControllerBasedStatusBarAppearance = true
In your AppDelegate.didFinishLaunchingWithOptions()
method set StatusBarOverlay.host
to your server domain. StatusBarOverlay will use this to check connectivity
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
StatusBarOverlay.host = “example.com”
return true
}
If you use a common UIViewController subclass, add the following to it. All of view controllers show override these methods, so its best to use a common UIViewController subclass
import StatusBarOverlay // if StatusBarOverlay is in CocoaPod
extension CommonViewController {
override var preferredStatusBarStyle: UIStatusBarStyle {
return StatusBarOverlay.preferredStatusBarStyle
}
override var prefersStatusBarHidden: Bool {
return StatusBarOverlay.prefersStatusBarHidden
}
override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
return StatusBarOverlay.preferredStatusBarUpdateAnimation
}
}
Thats it. Run your app, try turning on and off airplane mode and the No Internet Connection bar will show and hide. On the simulator sometimes the hiding event isnt fired. All devices work normally
A SwiftUI View that emits confetti with user-defined shapes, images, and text.
A colour wheel made all in SwiftUI. There are 2 different colour wheels to choose from. The first main one ...
A color picker implementation with color wheel appearance written in plain SwiftUI. It is compatible with UIColor and NSColor.
This repository is no longer maintained. Here's why: with the release of iOS 16 SwiftUI now enables most of the ...