Skip to content

5.3.1

Compare
Choose a tag to compare
@SwiftfulThinking SwiftfulThinking released this 02 Mar 03:23
· 18 commits to main since this release
dc16487

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()