{"id":2661,"url":"https://github.com/MoZhouqi/KMNavigationBarTransition","last_synced_at":"2025-08-06T15:30:33.262Z","repository":{"id":42078297,"uuid":"48980651","full_name":"MoZhouqi/KMNavigationBarTransition","owner":"MoZhouqi","description":"A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.","archived":false,"fork":false,"pushed_at":"2023-10-02T12:35:41.000Z","size":3995,"stargazers_count":3377,"open_issues_count":41,"forks_count":457,"subscribers_count":63,"default_branch":"master","last_synced_at":"2024-11-27T10:11:56.375Z","etag":null,"topics":["kmnavigationbartransition","navigationbar","navigationbar-transition","transition","transition-animations"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoZhouqi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-01-04T07:10:06.000Z","updated_at":"2024-11-18T12:14:00.000Z","dependencies_parsed_at":"2022-07-17T10:16:22.576Z","dependency_job_id":"9ae20486-3cb3-429d-b139-3279df98baec","html_url":"https://github.com/MoZhouqi/KMNavigationBarTransition","commit_stats":{"total_commits":67,"total_committers":9,"mean_commits":7.444444444444445,"dds":"0.14925373134328357","last_synced_commit":"ccb7eede443be14880586035b13f6e03112c71be"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoZhouqi%2FKMNavigationBarTransition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoZhouqi%2FKMNavigationBarTransition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoZhouqi%2FKMNavigationBarTransition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoZhouqi%2FKMNavigationBarTransition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoZhouqi","download_url":"https://codeload.github.com/MoZhouqi/KMNavigationBarTransition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227668105,"owners_count":17801503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kmnavigationbartransition","navigationbar","navigationbar-transition","transition","transition-animations"],"created_at":"2024-01-05T20:16:19.524Z","updated_at":"2024-12-09T15:30:50.976Z","avatar_url":"https://github.com/MoZhouqi.png","language":"Objective-C","funding_links":[],"categories":["UI","Libs","Objective-C","Objective-C  Stars 1000以内排名整理","UI Effects","UI [🔝](#readme)"],"sub_categories":["Navigation Bar","UI","Layout","Other free courses"],"readme":"KMNavigationBarTransition [中文介绍](https://github.com/MoZhouqi/KMNavigationBarTransition/blob/master/README_CN.md)\n============\n\nA drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.\n\n## Screenshots\n\n### Now\n\n![KMNavigationBarTransition](https://raw.githubusercontent.com/MoZhouqi/KMNavigationBarTransition/master/Screenshots/Now1.gif)\n![KMNavigationBarTransition](https://raw.githubusercontent.com/MoZhouqi/KMNavigationBarTransition/master/Screenshots/Now2.gif)\n\n### Before\n\n![KMNavigationBarTransition](https://raw.githubusercontent.com/MoZhouqi/KMNavigationBarTransition/master/Screenshots/Before1.gif)\n![KMNavigationBarTransition](https://raw.githubusercontent.com/MoZhouqi/KMNavigationBarTransition/master/Screenshots/Before2.gif)\n\n## Introduction\n\nThe design concept of the library is that what you only need to care about is the background style of the navigation bar in the *current* view controller, without handling the various background styles while pushing or popping.\n\nThe library can capture the background style of the navigation bar in the disappearing view controller when pushing, and when you pop back to the view controller, the navigation bar will restore the previous style, so you don't need to consider the background style after popping. And you also don't need to consider it after pushing, because it is the view controller to be pushed that needs to be considered.\n\n## Usage\n\nYou don't need to import any header file when using this library, the library uses [Method Swizzling](http://nshipster.com/method-swizzling/) to achieve the effect.\n\nIt is recommended to set the default background style of the navigation bar in the `viewDidLoad` method of the base view controller. When you need to change it, generally, you only need to do it in the `viewDidLoad` method of the *current* view controller, but if you need to support peek and pop on 3D Touch, you can do it in the `viewWillAppear:` method.\n\nThe following are some suggestions to set the background style of the navigation bar, and you can see the Example for details.\n\n- There are two methods to set the background style of the navigation bar, `setBackgroundImage:forBarMetrics:` and `setBarTintColor:`. It is recommended to use the former, you can see [Known Issues](#known-issues) for the details.\n\n- It is better not to change the value of the `translucent` property arbitrarily after initialization, otherwise the interface layout would be prone to confusion.\n\n- When the value of the `translucent` property is `true`, you can use the following mehod to make the navigation bar transparent:\n\n  ```swift\n  navigationController?.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default)\n  navigationController?.navigationBar.shadowImage = UIImage() // shadowImage is the 1px line\n  ```\n\n- You can change the alpha value of the background color of the navigaiton bar by changing the alpha value of the image in the `setBackgroundImage:forBarMetrics:` method.\n\n- You can use the following method to show or hide the navigation bar in `viewWillAppear:`:\n\n  ```swift\n  override func viewWillAppear(animated: Bool) {\n      super.viewWillAppear(animated)\n      navigationController?.setNavigationBarHidden(hidden, animated: animated)\n  }\n  ```\n\n  You'd better not do it in neither `viewWillDisappear:` nor other methods performing transitions, because it is not easy to manage. Again, what you only need to care about is the style of the navigation bar in the *current* view controller.\n\n  Of course, you'd better not hide the navigaion bar, it might triggers some apple's bug with interactive pop gesture.\n\n## Installation\n\n### CocoaPods\n\nYou can install the latest release version of CocoaPods with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nSimply add the following line to your Podfile:\n\n```ruby\npod 'KMNavigationBarTransition'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate KMNavigationBarTransition into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"MoZhouqi/KMNavigationBarTransition\"\n```\n\nRun `carthage update` to build the framework and drag the built `KMNavigationBarTransition.framework` into your Xcode project.\n\n## Requirements\n\n- iOS 7.0+\n\n## Known Issues\n\nOn iOS 8.2 or below, if you set the value of the `translucent` property to `true` and set the `barTintColor` for the background color, and then change the `barTintColor`, the background color of the navigation bar will flash when the interactive transition is cancelled.\n\nTo avoid this from happening, it is recommended to use `setBackgroundImage:forBarMetrics:` instead of `setBarTintColor:` to change the background color of the navigation bar. \n\n## License\n\nKMNavigationBarTransition is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMoZhouqi%2FKMNavigationBarTransition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMoZhouqi%2FKMNavigationBarTransition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMoZhouqi%2FKMNavigationBarTransition/lists"}