A UIViewController base class to enable status bar animation.
The animation is simply done in viewWillAppear
by calling self.setNeedsStatusBarAppearanceUpdate()
in UIView.animate
. AnimatableStatusBarViewController
keeps track of the status bar hidden state.
So this should work with both present and push.
The downside of this approach is that you need to subclass from AnimatableStatusBarViewController
.
- Copy
AnimatableStatusBarViewController.swift
to your project. - Subclass a view controller with
AnimatableStatusBarViewController
to suppport status bar animation. - Just checkout the code in this repo and you'll know how to setup.