Giter VIP home page Giter VIP logo

weblineindia / swiftui-coordinator Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.73 MB

This SwiftUI app is a demo app that follows a centralized coordinator and view model architecture. The app incorporates different navigation patterns such as a navigation stack and path, along with the implementation of custom navigation modifiers and a navigation configuration. Furthermore, it includes a demo showcasing a tab bar feature.

Home Page: https://www.weblineindia.com/software-development-resources.html

License: MIT License

Swift 100.00%
coordinator-ios coordinator-simple-demo ios navigation reusable-code reusable-components reusable-library swift swiftui ui-components

swiftui-coordinator's Introduction

SwiftUI Coordinator Master Example

This is a documentation file for a SwiftUI app that follows a centralised coordinator and view model based demo. The demo utilizes various navigation patterns, including a navigation stack and path. Additionally, custom navigation modifiers have been implemented, and a navigation configuration has been added. The app also includes a demo for a tab bar.

Table of Contents

Demo ๐Ÿ“ฑ

Demo Preview

Features ๐Ÿฅณ

Briefly describe the main features of your SwiftUI project. For example:

  • Centralised Coordinator Pattern
  • Navigation Pattern with navigation stack and path
  • More custom navigation modifiers
  • Navigation Helper for the app
  • Demo based on Tabbar and View model
  • Minimum iOS Target 16.0

Installation ๐Ÿ’พ

Provide instructions on how to install or integrate your project. For example: * Clone the repository. * Open the project in Xcode. * Build and run the project.

Usage ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿ”ฌ

Once the app is running, you can explore complete navigation concept.

Centralised Coordinator Pattern

The app utilises a centralised navigation communicator and view model. This demo ensures that the navigation logic is separated from the views and handled by a dedicated communicator and view model. This allows for a more organised and modular structure, making it easier to manage the app's navigation. This allows to reuse easy way in any project. Just drag and drop the folder AppCoordinator into your project and use as per your requirement.

Defining the coordinator

Example using a Navigation Stack.

 struct AppContentView: App {
    @ObservedObject var coordinator = BaseCoordinator()
    var body: some Scene {
        WindowGroup {
            NavigationStack(path: $coordinator.path) {
                ZStack {
                    appContent()
                        .sheet(item: $coordinator.presentSheetItem) { present in
                            ViewFactory.viewForDestination(present)
                        }
                        .fullScreenCover(item: $coordinator.fullCoverItem) { present in
                            ViewFactory.viewForDestination(present)
                        }
                }
                .navigationDestination(for: DestinationFlowPage.self) { destination in
                    ViewFactory.viewForDestination(destination)
                }
            }
            .environmentObject(coordinator)
        }
    }

Coordinator Accessibility:

Can able to access anywhere and use that properties.

 @EnvironmentObject var coordinator: BaseCoordinator

Navigation Pattern with Navigation Stack and Path

The navigation pattern used in the app incorporates a navigation stack and path. The navigation stack keeps track of the view hierarchy, allowing for seamless navigation between screens. The path represents the current navigation state and is used to control the flow of the app.

Custom Navigation Modifiers

Custom navigation modifiers have been implemented in the app to provide additional functionality and customisation options for navigation. These modifiers can be applied to SwiftUI views to modify their navigation behavior, appearance, and transitions.

Navigation Helper

The app includes a navigation configuration feature that allows for customisation of the navigation experience. The configuration options include setting the navigation bar style, defining the navigation stack behavior, and configuring other navigation-related settings.

Tab Bar Demo

The app provides a tab bar demo, showcasing the use of a tab bar interface. The demo includes multiple tabs, each representing a different section or feature of the app. You can switch between tabs to explore the different parts of the application.

Contributing

  • Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
  • Fork it.
  • Create new branch to contribute your changes.
  • Commit all your changes to your branch.
  • Submit a pull request.

Need Help?

We also provide a free, basic support for all users who want to use this coordinator master demo in project. In case you want to customize this demo input to suit your development needs, then feel free to contact our iOS SwiftUI Developers.

Collection of Components

We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.

Changelog

Detailed changes for each release are documented in CHANGELOG.

License ๐Ÿ“ƒ

This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as permitted by the license.

Acknowledgements

This app was created using SwiftUI and leverages various libraries and resources. We would like to acknowledge and express our gratitude to the following:

  • SwiftUI: Apple's declarative framework for building user interfaces.
  • Xcode: Integrated development environment (IDE) provided by Apple.
  • Open-source libraries: Various open-source libraries and frameworks used in the project.
  • Community contributors: Contributors who have provided support, bug fixes, and enhancements.

Keywords

Coordinator Master, SwiftUI, Coordinator-ViewModel Pattern, Coordinator Pattern, Centralise Coordinator, Navigation Patten, Navigation Master, Navigation Stack, Navigation Reusable Component, SwiftUI Tabbar, Swift5, iOS 16, WeblineIndia

swiftui-coordinator's People

Contributors

partners-wli avatar

Stargazers

 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.