Dynamically changes status bar style depending on content behind it
Switch branches/tags
Nothing to show
Clone or download
Latest commit 5a93e31 Sep 7, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Bartinter.xcodeproj Deployment target changed to iOS 9 Jun 25, 2018
Bartinter.xcworkspace Pod initialized Jun 19, 2018
Bartinter Pod version bump Sep 7, 2018
BartinterTests UI Tests added, Unit tests added Jun 25, 2018
BartinterUITests UI test update. Sep 7, 2018
Pods Pod initialized Jun 19, 2018
.gitignore Initial commit Jun 19, 2018
Bartinter.podspec Pod version bump Sep 7, 2018
LICENSE Initial commit Jun 19, 2018
Podfile Pod initialized Jun 19, 2018
Podfile.lock Pod initialized Jun 19, 2018
README.md Update README.md Jun 30, 2018
demo.gif add demo gif Jun 25, 2018

README.md

Awesome Version License Platform

Bartinter

Status bar apperance manager that make your status bar readable by dynamically changing it's color depending on content behind.

Installation

Add

pod 'Bartinter'

to your podfile, and run pod install

Usage

Set "View controller-based status bar appearance" (UIViewControllerBasedStatusBarAppearance) to YES in your Info.plist. Set ViewController's updatesStatusBarAppearanceAutomatically = true

That's it.

Swizzling

By default, bartinter swizzles a couple methods for your convenience. (see: UIKitSwizzling.swift) If you are not ok with method swizzling, you can disable it by following line:

Bartinter.isSwizzlingEnabled = false

Without swizzling you need to do some things manually:

Firstly, you need to provide childViewControllerForStatusBarStyle, in your ViewController subclass just add following:

override var childViewControllerForStatusBarStyle: UIViewController? {
    return statusBarUpdater
}

Secondly, you need to decide, when you need to refresh status bar style, for example on tableView scroll, so add:

func scrollViewDidScroll(_ scrollView: UIScrollView) {
    statusBarUpdater?.refreshStatusBarStyle()
}