Swiftpack.co - BokaTano/SwiftUIPopUp as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by BokaTano.
BokaTano/SwiftUIPopUp 0.0.4
SwiftUI popup custom popups
⭐️ 0
🕓 1 week ago
iOS
.package(url: "https://github.com/BokaTano/SwiftUIPopUp.git", from: "0.0.4")

SwiftUIPopUp

SwiftUIPopUp is a the SwiftUI way to implement pop ups in your app. Credits go to PartialSheet for great deal of inspiration.

Features

  • Custom popup content
  • Popup grows with content size
  • The popup can be moved with an offset

Manual

  1. Step: Register the PopUpManager on your root view

1a. Standard way

@main
struct YourApp: App {
    var body: some Scene {
        MainView()
            .attachPopupToRoot()
    }
}

1b. If you you want real time updates in the background of the popup, made through your popup content UI, for examble by using a @Binding in your popup content.

@main
struct YourApp: App {
    @StateObject var popupManager = PopUpManager()

    var body: some Scene {
        MainView()
            .attachPopupToRoot(popupManager)
    }
}
  1. Step: Add the method popup() {...} to your SwiftUI View
@State var timerPopUpIsPresented = false
...
LowLevelView()
    .popup(isPresented: $isPresented,
               offset: (x: x, y: y)) {
            YourCustomPopupView()
        }

GitHub

link
Stars: 0
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v0.0.1
1 week ago

First Release with Core Functionality

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics