u/Good-Confusion-8315

Scaffolding 3.4.0 - simple coordinator SPM
▲ 9 r/SwiftUI+1 crossposts

Scaffolding 3.4.0 - simple coordinator SPM

Hey!

Scaffolding 3.4.0 got released. It's a SwiftUI coordinator pattern navigation library for iOS 18+ that allows creating modular navigation flows through linked list structure, allowing easy syntax and modularization - macro powered, with easy setup and rapid prototyping capabilities.

This is pretty much QOL version, which adds easier way to fully test the navigation, debugging options, async/await syntax and simple complete state restoration (some limitations apply).

Updated demo is in Example/ directory and docs (dotaeva.github.io/scaffolding/) now include more cases.

For those who used Stinsen, this is very similar in use. Feel free to submit other QOL ideas.

github.com
u/Good-Confusion-8315 — 8 days ago
▲ 10 r/SwiftUI

Hey, for those familiar with coordinator pattern or Stinsen, I published new version of Scaffolding SPM, which eases up setting up complex flows and navigations within the app by modularizing the flow patterns, achievable in plain SwiftUI with lots of boilerplate that you don't need to write each time using this.

Alongside has been published new website which explains coordinator concepts in depth alongside a interactive simulator and flow graphs.

Build fully on SwiftUI, one macro and linked list allows to create flows outside of view-layer and State dependent with minimal boilerplate and already known API.

Be sure to check it out and leave comments! Any additions, improvements or critics are welcome

Example

@Scaffoldable
final class HomeCoordinator: @MainActor FlowCoordinatable {
    var stack = FlowStack<HomeCoordinator>(root: .home)

    func home() -> some View { HomeView() }
    func detail(item: Item) -> some View { DetailView(item: item) }
    func settings() -> any Coordinatable { SettingsCoordinator() }
}

...

// Instantiate the flow in the root of the app, nowhere else, that's the setup. The SPM handles everything

@State private var coordinator: HomeCoordinator = .init()

// in body
coordinator.view

coordinator.route(to: .detail(item: selectedItem))   // push
coordinator.present(.settings, as: .sheet)           // sheet (sub-flow)
coordinator.pop()

https://dotaeva.github.io/scaffolding/
https://github.com/dotaeva/scaffolding

reddit.com
u/Good-Confusion-8315 — 4 months ago