{"id":2666,"url":"https://github.com/wilbertliu/NavKit","last_synced_at":"2025-08-03T00:32:20.363Z","repository":{"id":62448839,"uuid":"85391852","full_name":"wilbertliu/NavKit","owner":"wilbertliu","description":"Simple and integrated way to customize navigation bar experience on iOS app.","archived":false,"fork":false,"pushed_at":"2017-10-20T02:03:45.000Z","size":1218,"stargazers_count":38,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-28T22:22:31.090Z","etag":null,"topics":["abstraction","ios","navigation","swift","toolkit"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/wilbertliu.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}},"created_at":"2017-03-18T10:03:57.000Z","updated_at":"2024-09-03T15:15:08.000Z","dependencies_parsed_at":"2022-11-01T23:17:25.997Z","dependency_job_id":null,"html_url":"https://github.com/wilbertliu/NavKit","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilbertliu%2FNavKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilbertliu%2FNavKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilbertliu%2FNavKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilbertliu%2FNavKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilbertliu","download_url":"https://codeload.github.com/wilbertliu/NavKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510759,"owners_count":17931760,"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":["abstraction","ios","navigation","swift","toolkit"],"created_at":"2024-01-05T20:16:19.656Z","updated_at":"2024-12-06T18:30:39.737Z","avatar_url":"https://github.com/wilbertliu.png","language":"Swift","readme":"# NavKit\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Build Status](https://travis-ci.org/wilbertliu/NavKit.svg?branch=master)](https://travis-ci.org/wilbertliu/NavKit)\n[![Coverage Status](https://coveralls.io/repos/github/wilbertliu/NavKit/badge.svg?branch=master)](https://coveralls.io/github/wilbertliu/NavKit?branch=master)\n\nSimple and integrated way to customize navigation bar experience on iOS app.\nIt should save our time that we usually use to make abstraction of navigation bar,\nback button, and so on.\n\n## Demo\n\n![Blink Navigation Bar](Resources/Blink%20Navigation%20Bar.gif)\n![Navigation Bar with Color](Resources/Navigation%20Bar%20with%20Color.png)\n![Transition Navigation Bar](Resources/Transition%20Navigation%20Bar.gif)\n\n## Installation\n\n### Carthage \n\n```\ngithub \"wilbertliu/NavKit\"\n```\n\n### CocoaPods\n\nAdd the following line into the `Podfile` :\n\n```\npod 'NavKit'\n```\n\nAfter that, run the following command :\n\n```\n$ pod install\n```\n\n## Usage\n\nSince the release of version `0.4`, NavKit has a huge redesign of its API. It makes the switch\nof the mindset to the view controller's based navigation configuration, which means\nwe don't need additional layer to configure the navigation experience.\n\nThere are only 3 things to do in order to use NavKit :\n1. Conforms to protocol `CustomizableNavigation` **and** `UIGestureRecognizerDelegate`.\n2. Define the properties that we need to customize the navigation bar like `barBackgroundColor`, `backImage`, etc.\n3. Call `self.updateNavigation()` wherever in view controller to update the navigation bar based on the defined properties.\n\n## Global Style\n\nThere's a time when we want to make a general style because it would be used by most of the\nscreens. What we have to do is just make a protocol extension of `CustomizableNavigation`\nand define the properties that we want to make as global. And of course, if you override\nthe properties on some controller, NavKit would use what's defined at controller instead.\nCan we jump into some codes to show?\n\n```swift\nimport Foundation\nimport NavKit\n\nextension CustomizableNavigation where Self: UIViewController, Self: UIGestureRecognizerDelegate {\n    var titleColor: UIColor { return .red }\n    var titleFont: UIFont { return UIFont.systemFont(ofSize: 16, weight: UIFontWeightMedium) }\n    var backImage: UIImage? { return UIImage(named: \"something\") }\n}\n```\n\n## Example\n\nNote that this section is taken from `Example` project. Make sure to check it to add some knowledge on how to use NavKit.\n\n```swift\nimport UIKit\nimport NavKit\n\nclass DetailViewController: UIViewController, CustomizableNavigation, UIGestureRecognizerDelegate {\n    // MARK: - Navigation Config\n\n    var barBackgroundColor: UIColor = UIColor.blue.withAlphaComponent(0.5)\n    var backText: String? = \"\u003c-- Go back\"\n\n    // MARK: - Life Cycles\n\n    override func viewWillAppear(_ animated: Bool) {\n        super.viewWillAppear(animated)\n        navigationController?.navigationBar.tintColor = .white\n        self.updateNavigation()\n    }\n}\n```\n\n## Support\n\nHave any feedbacks? Feel free to submit a PR! And I'm more than happy to answer questions, or maybe just some hi?! To do that, shoot me a DM or tweet [@wilbertliu](https://twitter.com/wilbertliu)\n\n## License\n\nMIT © Wilbert Liu\n","funding_links":[],"categories":["UI"],"sub_categories":["Navigation Bar","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilbertliu%2FNavKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilbertliu%2FNavKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilbertliu%2FNavKit/lists"}