Giter Site home page Giter Site logo

tca-navigation-stack-poc's Introduction

Navigation Stack PoC

Swift v5.2 platforms iOS

Navigation stack component for The Composable Architecture - proof of concept

๐Ÿ›  Tech stack

๐Ÿ“ Description

Proof of concept of navigation stack component that can be used along with The Composable Architecture library.

NavigationStackView is a wrapper on UINavigationController. Its logic is powered by Store that takes [NavigationStackItemState] as the state. The NavigationStackItemState protocol should be applied to each state that represents a single screen which can be pushed onto the stack. Navigation stack updates (push, pop etc) are performed by modifying the array of stack item states in navigation stack reducer.

Thanks to bidirectional communication between the store and UINavigationController, the component allows complex navigation stack manipulations (like pop-to-root or replacing already presented stack with a completely different one) that would be hard to implement with SwiftUI's NavigationLink views. Moreover, it fully supports navigation state restoration. Because under the hood it uses UINavigationController, overall user experience, navigation animations, gestures, etc. are native to iOS.

Check out included demo project that showcases a simple application containing a navigation controller and two kinds of screens. Root screen is presented as an initial screen of the app. It allows to push a counter screen. The counter screen contains simple counter label with "increment" / "decrement" buttons. It also allows to push another counter on the navigation stack or navigate back to the root of the stack.

Related resources:

๐Ÿ“„ License

Copyright ยฉ 2020 Dariusz Rybicki Darrarski

License: GNU GPLv3

tca-navigation-stack-poc's People

Contributors

darrarski avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.