Swiftpack.co - Package - swiftuilib/modal

Modal

Full-screen modals with classic Swift UI API

Demo

Quickstart

Top level view

import UILib_Modal // Import the module once to get the extensions
…
SomeContainer {
  …
}
.hostModal() // indicate that this is the modals' host

Any descendant view

  @State var showModal = false
  
  var body: some View {
    SomeContainer {
      …
    }
    .modal(isPresented: $showModal) {
      // Modal contents
      SomeContainer {
        …
      }.onTapGesture {
        self.showModal.toggle()
      }
    }
  }
}

More info in the docs.

Installation via SPM

In XCode add the following URL to your project's Swift Package dependencies:

https://github.com/swiftuilib/modal

Development

To modify the package contents while still being able to see SwiftUI Previews use the provided sandbox.xcodeproj.

Github

link
Stars: 0
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

1.0.0-rc.1 - Nov 26, 2019

Introducing SwiftUILib Modal: Full-screen modals with classic Swift UI API