YPNavigationBarTransition: per screen navigation bar styling for iOS
A Full functional UINavigationBar framework for making bar transition more natural! You don't need to call any UINavigationBar api, implementing YPNavigationBarConfigureStyle protocol for your view controller instead. (类似微信 iOS Navigation Bar 的切换方案)
At a glance
- What is it?
- YPNavigationBarTransition is an Objective-C framework that replaces UINavigationController with its own container so each view controller declares its navigation bar style instead of poking at UINavigationBar APIs. It solves one narrow problem well, and it is worth knowing what it leaves untouched.
- Who is it for?
- YPNavigationBarTransition suits apps that push screens with different bar appearances, transparent or image backgrounds, and it is unnecessary for a single fixed bar style, where the stock UINavigationController already covers the need.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Activity is slowing. The repository last received commits 6 months ago.
- What is it written in?
- Mainly Objective-C, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 25, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The problem is a bar that must look different on every screen
Every iOS app with more than one screen has to answer a question that the stock navigation bar leaves open: what happens to the bar as the user pushes a new view controller? When a screen needs an opaque bar and the next one needs a translucent bar with a photo behind it, the usual answers are to write a pile of code in viewWillAppear or to rebuild the navigation bar by hand. YPNavigationBarTransition exists to remove that pile.
The framing in the repository description is a WeChat style bar transition, where the bar blends into the content and the colors shift as screens change. The promised mechanism is that you never call a UINavigationBar API at all. Instead, a view controller declares what its bar should look like, and the framework applies it. That is a narrow target, and narrow is fine here, because the alternative is well known to be annoying: view controller lifecycle callbacks that fight each other over a single shared bar.
The audience is an iOS team that already has a UINavigationController stack and a pile of ad hoc bar styling, and wants that styling expressed once per screen instead. The library is Objective-C with Swift interop, it requires Xcode 9.0 or later, and it supports iOS 8.0 and above.
YPNavigationController owns the bar, the protocol describes it
The mechanism has two halves. The first is a container: the getting started guide tells you to replace UINavigationController with YPNavigationController, and the examples directory holds separate demo projects for Objective-C and Swift, plus a share extension example.
The second half is a style contract. A view controller conforms to a configure style protocol and returns two things: a YPNavigationBarConfigurations value and a navigation bar tint color. The framework reads that when the bar is about to appear and updates the bar accordingly. The feature list describes the supported appearances as transparent and translucent, pure color, and background image, and it claims the style can be adjusted dynamically rather than only set once at launch.
Because the configuration is returned per view controller rather than mutated in place, the styles you can express are whatever the framework's flag set allows. The documentation does not enumerate the full flag list, which matters more than it sounds, since a missing flag can only be discovered by reading the header.
Two install paths, both pinned to the 2.0 line
CocoaPods is the preferred route. The Podfile needs two lines, and the comment in the sample makes clear why the first one matters:
# use_frameworks! is needed for swift projects
use_frameworks!
pod 'YPNavigationBarTransition', '~> 2.0'If you prefer Carthage, the Cartfile entry is a single line:
github "yiplee/YPNavigationBarTransition" ~> 2.0Both paths pin the same 2.0 line with the ~> operator, so a minor or patch release inside 2.x arrives without a change to your manifest, and anything outside that line needs an edit. There is no version argument in the code itself and no runtime configuration to set, so the install is the whole setup step.
After installation, importing the framework is all the plumbing there is. In Objective-C the import is the umbrella header, and in Swift it is a plain module import:
#import <YPNavigationBarTransition/YPNavigationBarTransition.h>import YPNavigationBarTransitionThe guide and the Swift sample name two different protocols
Here is where a careful reader will hesitate. The repository description tells you to implement YPNavigationBarConfigureStyle for your view controller, and the getting started section repeats that name. The Swift example, however, declares the conformance as NavigationBarConfigureStyle:
extension YPNavigationController : NavigationBarConfigureStyle {
public func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
return [.styleBlack]
}
public func yp_navigationBarTintColor() -> UIColor! {
return UIColor.white
}
}The two names are not the same string, and the documentation does not explain the difference or say whether one is a Swift-renamed variant of the other. The same sample spells the configuration method yp_navigtionBarConfiguration, with the letters transposed, while the tint method is spelled correctly. The Objective-C category in the guide uses the same transposed spelling.
None of this is fatal, but it is a real cost for an adopter: the two names have to be reconciled against the actual header of the version you install, and the documentation does not say which spelling that header expects.
The configuration is a bitmask and the two samples set different flags
The Objective-C sample shows the return value that carries real information:
@implementation YPNavigationController (Configure)
- (YPNavigationBarConfigurations) yp_navigtionBarConfiguration {
return YPNavigationBarStyleBlack | YPNavigationBarBackgroundStyleTranslucent | YPNavigationBarBackgroundStyleNone;
}
- (UIColor *) yp_navigationBarTintColor {
return [UIColor whiteColor];
}Three flags are combined with the bitwise or operator: a style flag, a translucent background flag, and a background style flag. The Swift sample returns only [.styleBlack], with no background flags at all. So the two samples are not equivalent, and the Swift one is a starting point rather than a full configuration.
The important detail is that the configuration is an or-ed bitmask rather than a set of independent properties. That shape is what lets a single integer describe transparent, translucent, color, and image backgrounds, and it is also what makes the missing flag list in the documentation awkward. A developer who guesses a flag name gets a compile error rather than a silent wrong result, which is the better failure, but it still costs a trip to the header.
No releases, an MIT licence, and a last push in April 2026
The repository publishes no GitHub releases, so the version you consume comes from CocoaPods or Carthage rather than from a tag list you can browse. The last push was on 2026-04-10, and the podspec constraint of ~> 2.0 is the practical ceiling on what you can pick up. There is a Podfile and Podfile.lock in the tree, a Gemfile, a run_unit_test.sh script, and a .travis.yml configuration, so the repository does carry the scaffolding for tests and continuous integration, but the release trail itself is thin.
The licence is MIT, with the details in the LICENSE file. That is a permissive licence with no licensing friction for commercial apps, and the Objective-C source with Swift interop is the only notable obligation worth checking, which is the one thing the licence file itself is for.
Upgrade cost is therefore low but manual: you change the constraint in your manifest, you let the package manager resolve, and you re-run your own build. There is no changelog in the repository, so what changed between the version you have and the one you move to is not recorded anywhere in the tree.
What the framework does not cover, and when it is the wrong tool
The honest scope of this library is one view. The repository topics include statusbar, but the documentation describes navigation bar appearance only and says nothing about status bar style, so treating this as a complete chrome solution would be a mistake. Nor is it a general navigation framework: the guide never discusses replacing the navigation stack, custom transitions, swipe-back gestures, or the bar behaviour of a modal presentation.
If your app uses one bar style for every screen, this library solves a problem you do not have, and the stock UINavigationController with its appearance is enough. The overhead is a container you must swap in, a protocol to conform to, and a configuration vocabulary to learn.
The alternative approach is worth stating plainly, because it is the one this library displaces. A team can hand-roll the same effect by subclassing or configuring the bar directly in each view controller, in lifecycle callbacks, in a shared base class, or in a custom transition animator. That route costs more code and more coupling to view controller lifecycle, but it keeps the control in the app and needs no third party dependency. The trade is straightforward: this framework buys you a per screen style declaration at the price of an extra container class and a dependency pinned to a 2.0 line that has not moved since April 2026.
Editorial conclusion
YPNavigationBarTransition suits apps that push screens with different bar appearances, transparent or image backgrounds, and it is unnecessary for a single fixed bar style, where the stock UINavigationController already covers the need. Before adopting it, check that the protocol name and the method signatures in the Swift sample match the version you pull, since the guide and the Swift example do not use the same protocol name, and confirm the pod version against the last push of 2026-04-10, because the repository publishes no releases to upgrade to.
Frequently asked questions
How do I install YPNavigationBarTransition in an iOS project?
With CocoaPods, add use_frameworks! and pod 'YPNavigationBarTransition', '~> 2.0' to your Podfile, the first line being required for Swift projects. With Carthage, add github "yiplee/YPNavigationBarTransition" ~> 2.0 to your Cartfile. The requirements are Xcode 9.0 or later and iOS 8.0 or later.
How do I set the navigation bar style with YPNavigationBarTransition?
Replace UINavigationController with YPNavigationController, then implement the configure style protocol for it in a category. Your view controller returns a YPNavigationBarConfigurations value built from or-ed style flags plus a navigation bar tint color, and the framework applies that when the bar appears.
Does YPNavigationBarTransition work with Swift?
Yes. It is written in Objective-C with full Swift interop support, so a Swift app adds import YPNavigationBarTransition and can extend YPNavigationController with the style protocol. The Podfile needs use_frameworks! for Swift projects.
What licence is YPNavigationBarTransition released under?
MIT, with the full text in the LICENSE file in the repository root.
Is YPNavigationBarTransition still receiving updates?
The last push was on 2026-04-10 and the repository publishes no GitHub releases, so there is no release list to track. The CocoaPods and Carthage constraints are both pinned to the 2.0 line.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/yiplee-ypnavigationbartransition)Was this useful?