Custom Popup in SwiftUI, can support multi-level effects and multiple custom parameter configurations.
- Xcode 12.x
- Swift 5.x
- File -> Swift Packages -> Add Package Dependency...
- Enter package URL : https://github.com/sandsn123/LSPopup.git, choose the latest release
// <dependent swiftui view>
.lspopup(isPresent: $isPresent, attributes: {
$0.cornerRadius = 10.0
$0.anchor = .absolute(originAnchor: .topRight, popoverAnchor: .topLeft)
$0.padding = EdgeInsets(top: 0, leading: 20, bottom: 0, trailing: 0)
$0.bgOpacity = 0
$0.transitions = [.scale, .opacity]
// $0.tapDismiss = false
}) {
Rectangle().fill(.blue).frame(width: 300, height: 300)
}