{"id":20492560,"url":"https://github.com/redmadrobot/navidux","last_synced_at":"2025-04-13T17:05:37.036Z","repository":{"id":75660681,"uuid":"554796847","full_name":"RedMadRobot/navidux","owner":"RedMadRobot","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-27T16:09:54.000Z","size":164,"stargazers_count":10,"open_issues_count":12,"forks_count":6,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-03-28T13:03:01.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedMadRobot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-10-20T12:12:49.000Z","updated_at":"2024-02-21T10:06:13.000Z","dependencies_parsed_at":"2023-06-07T07:00:20.983Z","dependency_job_id":"14c46fb9-7303-4df7-923b-74d883d69f1d","html_url":"https://github.com/RedMadRobot/navidux","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fnavidux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fnavidux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fnavidux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMadRobot%2Fnavidux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedMadRobot","download_url":"https://codeload.github.com/RedMadRobot/navidux/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224819488,"owners_count":17375275,"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":[],"created_at":"2024-11-15T17:29:38.166Z","updated_at":"2024-11-15T17:29:39.169Z","avatar_url":"https://github.com/RedMadRobot.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Navidux \n\n[![SPM compatible](https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager)\n[![Swift 5.7](https://img.shields.io/badge/swift-5.7-red.svg?style=flat)](https://developer.apple.com/swift)\n\nNavidux is easy and simple module to build your navigation without thinking about complicated routes in factories.\n\n## Table of Contents\n- [Navidux](#navidux)\n  - [Table of Contents](#contents)\n  - [About Navidux](#about-navidux)\n  - [Requirements](#requirements)\n  - [Installation](#installation)\n    - [Preparation](#preparation)\n  - [Usage](#usage)\n    - [Initialisation phase](#initialisation-phase)\n    - [Using phase](#using-phase)\n  - [Roadmap](#roadmap)\n\n## About Navidux\nWe create this package with router to facilitate routing duties and improve reading in complicated projects. Analyzing previous project give us idea of creating independently navigation. It's did not depend on your project and may use in different combination and variations. Of course it can uses with Storyboard, UIKit and SwiftUI screens. \nThe goals we want to achieve:\n- Easy using and create routes in screen modules.\n- Use with most architectual approaches (MVVM, MVC, VIPER, MVI, MVP etc).\n- Not complicated logic of library engine.\n\n![Navidux scheme](readme/Navidux_scheme.png)\n\nNavigationCoordinator core consists from: \n- Reducer function - ``actionReducer(action:)``; \n- ScreenAssembler - that implements in navigation depended module; \n- State - contains important properties for better functionality;\n- NavigationController - component that directry implements routing and hold some important information, like Screen Stack.\nMost core components have documentation on the spot with some examples.\n\n## Requirements\n- iOS 13.0+\n\n## Installation\nSwift Package Manager\n\nSwift 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\nXcode 11+ is required to build Navidux using Swift Package Manager.\nTo integrate Navidux into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:\n``` swift\ndependencies: [\n    .package(url: \"https://github.com/RedMadRobot/navidux.git\")\n]\n```\n\n### Preparation\nNext you have to extends 2 object and implement 1 to use Navidux at maximum. Some were in your APP module extends:\n``` swift\nextension NaviduxScreen {\n    static let newScreen = NaviduxScreen(\n        description: \"someDescription\",\n        screenClass: YourScreenTypeInheritedFromUIViewController.self\n    )\n}\n```\n``` swift\nextension Navidux.ScreenFactory {\npublic var someScreenFactory: (NavigationCoordinator?, ScreenConfig) -\u003e any NavigationScreen {\n    { coordinator, config\n        return MyViewControllerConformedNavigationScreen()\n    }\n}\n```\n\nAnd implement Navidux.ScreenAssembler protocol.\n\n## Usage\n### Initialisation phase\nTo set Navidux as initial navigation controller. You need do installation and preparation phases.  After you may initialise NavigationCoordinator like example below. \n``` swift\nlet navigationController = NavigationControllerImpl()\nlet screenFactory: ScreenFactory = NaviduxScreenFactory()\nlet alertFactory: AlertFactory = AlertFactoryImpl()\nlet navigationCoordinatorProxy = NavigationCoordinatorProxy()\nlet screenAssembler = NaviduxScreenAssembler(\n    screenFactory: screenFactory,\n    alertFactory: alertFactory,\n    screenCoordinator: navigationCoordinatorProxy\n)\n\nlet navigationCoordinator = NavigationCoordinator(\n    navigationController,\n    screenAssembler: screenAssembler\n)\nnavigationCoordinatorProxy.subject = navigationCoordinator\nnavigationCoordinator.actionReducer(\n    action: .push(.firstScreen, .init(navigationTitle: \"\"), .fullscreen)\n)\n\nwindow?.rootViewController = navigationController\n```\n\n### Using phase\nFor example in your UIViewController you may call NavigationCoordinator and ask it for action: \n``` swift\nnavigation?.actionReducer(\n    action: .push(.nextScreen, .init(navigationTitle: \"My title\"), .fullscreen)\n)\n```\n\n## Roadmap\n![Roadmap there](readme/Roadmap.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredmadrobot%2Fnavidux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredmadrobot%2Fnavidux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredmadrobot%2Fnavidux/lists"}