Releases: SwiftfulThinking/SwiftfulRouting
6.1.0
Complete refactor of entire framework. Tons of new features. Major upgrade 🥳
Highlights:
- Segue to multiple screens at once
- Add option to segue without animation
- Dismiss screens by screen id
- Dismiss screens up to screen id
- Dismiss screens by count
- Remove "Screen Flows" and implement "Screen Queue" (easier API)
- Additional configurations for resizable sheets (background color, corner radius, etc.)
- Additional configurations for modals (background colors, blurred backgrounds, etc.)
- Add Transition support!
- Transitions replace the current screen without performing a segue
- Add Transition Queue
- Add Module support!
- Modules replace the entire screen hierarchy
- Add Logging and Analytics support!
- Swift 6 support
- Drop support for iOS 15
See Readme for updated documentation.
New Contributors
Full Changelog: 5.3.6...6.1.0
Beta 6.1
Complete refactor of entire framework. Tons of new features 🥳
Checkout "development" branch.
Highlights:
- Segue to multiple screens at once
- Add option to segue without animation
- Dismiss screens by screen id
- Dismiss screens up to screen id
- Dismiss screens by count
- Remove "Screen Flows" and implement "Screen Queue" (easier API)
- Additional configurations for resizable sheets (background color, corner radius, etc.)
- Additional configurations for modals (background colors, blurred backgrounds, etc.)
- Add Transition support!
- Transitions replace the current screen without performing a segue
- Add Transition Queue
- Add Module support!
- Modules replace the entire screen hierarchy
- Add Logging and Analytics support!
- Swift 6 support
- Drop support for iOS 15
See Readme for updated documentation.
Full Changelog: 5.3.6...beta-6.1
5.3.6
Fix a crash within TransitionSupportViewBuilder
when dismissTransition
is called multiple times in immediate succession
Full Changelog: 5.3.5...5.3.6
5.3.5
- Fixing bug where calling dismissScreenStack multiple on an app's Root View didn't work.
What's Changed
- Dismiss push stack bug by @SwiftfulThinking in #66
Full Changelog: 5.3.4...5.3.5
5.3.4
- Add dismissOnBackgroundTap to modal configuration, to disable taps on background layer. Default value remains TRUE.
5.3.3
- Fix bug: dismissModal did not work when accessed through Environment variables
- Fix bug: when displaying multiple modals with background layers, each background was behind all of the modals. Now they are stacked where the background of the top-most modal is above the 2nd-highest modal.
- Update Readme: include code for adding swipe-back gesture support within Dismiss section
5.3.2
Fix bug from 5.3.1 where swipe-back gesture doesn't render on TransitionSupportViewBuilder
5.3.1
Minor updates. Compiler breaking changes:
- showModal no longer supports BackgroundEffect
- showModal useDeviceBounds has been renamed ignoreSafeArea
- AlertOption has been renamed DialogOption
Multiple Modals
Details (Click to expand)
You can now display multiple modals simultaneously (previously 1). Modals have an optional ID field, which can later be used to dismiss the modal.
router.showModal(id: "top1") {
Text("Sample")
}
// Dismiss top-most modal
router.dismissModal()
// Dismiss modal by ID
router.dismissModal(id: "top1")
// Dismiss all modals
router.dismissAllModules()
Transition View Builder
Details (Click to expand)
Wrap your view in a TransitionViewBuilder to transition the current screen's context. This will change the content without changing the parent View hierarchy (ie. using transitions and not traditional segues).
Set allowsSwipeBack to FALSE disable swipe-back behavior on the transitioned screen.
Set allowSimultaneous to FALSE to render only one view at a time.
TransitionSupportViewBuilder(router: router, allowsSwipeBack: Bool, allowSimultaneous: Bool) { transitionRouter in
Text("Hello, world!")
.onTapGesture {
transitionRouter.showTransition(transition: .trailing) { _ in
Rectangle()
}
}
}
// Dismiss current transition
transitionRouter.dismissTransition()
Beta 6.0
Transition Screen
Details (Click to expand)
Use a screen transition to replace the current screen with a new one. This is not the same as a segue and will deallocate the first screen entirely. This changes the current view without affecting the surrounding view hierarchy.
router.transitionScreen(.leading) { router in
Text("Screen1.1")
}
router.transitionScreen(.trailing) { router in
Text("Screen1.2")
}
Dismiss most recent transition.
router.dismissTransition()
Dismiss all transitions to root.
router.dismissAllTransitions()
Transition Module
Details (Click to expand)
Modules are high-level containers for your app, where each module has it's own View hierarchy. This will change the entire hierarchy in your app, dismissing the root NavigationView as well as all screens displayed on top. Use this for things like "show onboarding" vs "show tabbar".
router.transitionModule(id: "onboarding", .leading) { router in
Text("Onboarding View")
}
router.transitionModule(id: "home", .trailing) { router in
Text("Home View")
}
The user's last module ID will persist across app sessions. This is returned when creating a RouterView
and can be used to restore the user's previous module.
RouterView(addNavigationView: true) { (router, lastModuleId) in
if lastModuleId == "home" {
Text("Home View")
} else {
Text("Onboarding View")
}
}
Multiple Modals
Details (Click to expand)
You can now display multiple modals simultaneously (previously 1). Modals have an optional ID, which can later be used to dismiss the modal.
router.showModal(id: "top1") {
Text("Sample")
}
// Dismiss top-most modal
router.dismissModal()
// Dismiss modal by ID
router.dismissModdal(id: String)
// Dismiss all modals
router.dismissAllModules()
5.1.0
Major release. See updated ReadMe.
- Add Router to SwiftUI Environment
- Add Screen Flow support
- Add onDismiss to all segues
- Various code tweaks & refactoring
What's Changed
- Feature/push screens by @SwiftfulThinking in #35
- Feature/ondismiss by @SwiftfulThinking in #36
- Nds/clean by @SwiftfulThinking in #37
- Routerview internal by @SwiftfulThinking in #38
- Development by @SwiftfulThinking in #39
Full Changelog: 4.0.3...5.1.0