{"id":20914970,"url":"https://github.com/hhru/nivelir","last_synced_at":"2026-02-04T10:54:35.613Z","repository":{"id":37104383,"uuid":"345640506","full_name":"hhru/Nivelir","owner":"hhru","description":"A Swift DSL for navigation in iOS and tvOS apps with a simplified, chainable, and compile time safe syntax","archived":false,"fork":false,"pushed_at":"2025-02-17T15:01:34.000Z","size":17980,"stargazers_count":276,"open_issues_count":1,"forks_count":10,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-05-16T18:06:16.483Z","etag":null,"topics":["carthage","cocoapods","dsl","ios","navigation","router","routing","spm","swift","tvos","xcode"],"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/hhru.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-08T11:58:35.000Z","updated_at":"2025-05-16T10:50:33.000Z","dependencies_parsed_at":"2022-08-01T00:08:23.985Z","dependency_job_id":"bd80b71c-c982-4965-b3f9-74c0e87f8f7f","html_url":"https://github.com/hhru/Nivelir","commit_stats":{"total_commits":87,"total_committers":4,"mean_commits":21.75,"dds":"0.16091954022988508","last_synced_commit":"725713e1d231a5c92017c71eb835f708a53314e2"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FNivelir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FNivelir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FNivelir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhru%2FNivelir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hhru","download_url":"https://codeload.github.com/hhru/Nivelir/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582905,"owners_count":22095518,"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":["carthage","cocoapods","dsl","ios","navigation","router","routing","spm","swift","tvos","xcode"],"created_at":"2024-11-18T16:12:25.942Z","updated_at":"2026-02-04T10:54:35.606Z","avatar_url":"https://github.com/hhru.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nivelir\n[![Build Status](https://github.com/hhru/Nivelir/actions/workflows/swift.yml/badge.svg?branch=main)](https://github.com/hhru/Nivelir/actions)\n[![Cocoapods](https://img.shields.io/cocoapods/v/Nivelir)](http://cocoapods.org/pods/Nivelir)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen)](https://github.com/Carthage/Carthage)\n[![SPM compatible](https://img.shields.io/badge/SPM-Compatible-brightgreen)](https://swift.org/package-manager/)\n[![Platforms](https://img.shields.io/cocoapods/p/Nivelir)](https://developer.apple.com/discover/)\n[![Xcode](https://img.shields.io/badge/Xcode-14-blue)](https://developer.apple.com/xcode)\n[![Swift](https://img.shields.io/badge/Swift-5.7-orange)](https://swift.org)\n[![License](https://img.shields.io/github/license/hhru/Nivelir)](https://opensource.org/licenses/MIT)\n\nNivelir is a DSL for navigation in iOS and tvOS apps with a simplified, chainable, and compile time safe syntax.\n\n\n## Contents\n- [Requirements](#requirements)\n- [Installation](#installation)\n    - [Swift Package Manager](#swift-package-manager)\n    - [Carthage](#carthage)\n    - [CocoaPods](#cocoapods)\n- [Usage](#usage)\n    - [Quick Start](#quick-start)\n    - [Example App](#example-app)\n- [Articles and Videos](#articles-and-videos)\n- [Communication](#communication)\n- [License](#license)\n\n\n## Requirements\n- iOS 13.0+ / tvOS 13.0+\n- Xcode 14.0+\n- Swift 5.7+\n\n\n## Installation\n### Swift Package Manager\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\n\nTo integrate Nivelir into your Xcode project using Swift Package Manager,\nadd the following as a dependency to your `Package.swift`:\n``` swift\n.package(url: \"https://github.com/hhru/Nivelir.git\", from: \"1.9.12\")\n```\nThen specify `\"Nivelir\"` as a dependency of the Target in which you wish to use Nivelir.\n\nHere's an example `Package.swift`:\n``` swift\n// swift-tools-version:5.7\nimport PackageDescription\n\nlet package = Package(\n    name: \"MyPackage\",\n    products: [\n        .library(name: \"MyPackage\", targets: [\"MyPackage\"])\n    ],\n    dependencies: [\n        .package(url: \"https://github.com/hhru/Nivelir.git\", from: \"1.9.12\")\n    ],\n    targets: [\n        .target(name: \"MyPackage\", dependencies: [\"Nivelir\"])\n    ]\n)\n```\n\n\n### Carthage\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. You can install Carthage with Homebrew using the following command:\n``` sh\n$ brew update\n$ brew install carthage\n```\n\nTo integrate Nivelir into your Xcode project using Carthage, specify it in your `Cartfile`:\n``` ogdl\ngithub \"hhru/Nivelir\" ~\u003e 1.9.12\n```\n\nFinally run `carthage update` to build the framework and drag the built `Nivelir.framework` into your Xcode project.\n\n\n### CocoaPods\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n``` bash\n$ gem install cocoapods\n```\n\nTo integrate Nivelir into your Xcode project using [CocoaPods](http://cocoapods.org), specify it in your `Podfile`:\n``` ruby\nplatform :ios, '13.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'Nivelir', '~\u003e 1.9.12'\nend\n```\n\nFinally run the following command:\n``` bash\n$ pod install\n```\n\n## Usage\n[API Documentation](http://tech.hh.ru/Nivelir/documentation/nivelir)\n\n### Quick Start\nLet's implement a simple view controller that can set the background color:\n\n``` swift\nclass SomeViewController: UIViewController {\n\n    let color: UIColor\n\n    init(color: UIColor) {\n        self.color = color\n\n        super.init(nibName: nil, bundle: nil)\n    }\n\n    required init?(coder: NSCoder) {\n        fatalError(\"init(coder:) has not been implemented\")\n    }\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        view.backgroundColor = color\n    }\n}\n```\n\nNext, we need to implement a builder that creates our controller:\n\n``` swift\nstruct SomeScreen: Screen {\n\n    let color: UIColor\n\n    func build(navigator: ScreenNavigator) -\u003e UIViewController {\n        SomeViewController(color: color)\n    }\n}\n```\n\nNow we can use this screen for navigation:\n\n``` swift\nlet navigator = ScreenNavigator()\n\nnavigator.navigate { route in\n    route\n        .top(.stack)\n        .popToRoot()\n        .push(SomeScreen(color: .red))\n        .push(SomeScreen(color: .green)) { route in\n            route.present(SomeScreen(color: .blue))\n        }\n}\n```\n\nThis navigation performs the following steps:\n- Search for the topmost container of the stack (`UINavigationController`)\n- Resetting its stack to the first screen\n- Adding a red screen to the stack\n- Adding a green screen to the stack\n- Presenting a blue screen on the green screen modally\n\n### Cheat sheets\nLearn the most common use cases for Nivelir. See article in [API documentation](http://tech.hh.ru/Nivelir/documentation/nivelir/cheatsheet).\n\n### Example App\n[Example app](Example) is a simple iOS and tvOS app that demonstrates how Nivelir works in practice.\nIt's also a good place to start playing with the framework.\n\nTo install it, run these commands in a terminal:\n\n``` sh\n$ git clone https://github.com/hhru/Nivelir.git\n$ cd Nivelir/Example\n$ pod install\n$ open NivelirExample.xcworkspace\n```\n\n\n## Articles and Videos\n### Articles\n- [EN] [Nivelir: a convenient DSL for navigation](https://medium.com/hh-ru/nivelir-b6c550332971)\n- [RU] [Nivelir: Удобный DSL для навигации](https://habr.com/ru/company/hh/blog/572488/)\n\n### Videos\n- [RU] [Обзор решений для навигации в iOS. Предпосылки Nivelir](https://youtu.be/FjAwpocB6rA)\n- [RU] [Гибкая навигации в iOS. Nivelir](https://youtu.be/GcPTi8-WIn8)\n\n\n## Communication\n- If you need help, open an issue.\n- If you found a bug, open an issue.\n- If you have a feature request, open an issue.\n- If you want to contribute, submit a pull request.\n\n📬 You can also write to us in telegram, we will help you: https://t.me/hh_tech\n\n\n## License\nNivelir is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhru%2Fnivelir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhhru%2Fnivelir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhru%2Fnivelir/lists"}