Beautiful PopUpView
for your SwiftUI
project that supports portrait and landscape orientation, with flexible view settings.
Going to Xcode File
> Add Packages...
and add the repository by giving the URL of this GitHub.
The text will wrap to a new line automatically depending on the number of characters per line.
import PopUpSwift
let singleLineExampleText = "Life is like a box of chocolates, you never know what you’re gonna get."
// PopUp with light style (default).
PopUpView(text: singleLineExampleText) {
print("Do something on tapped on the popup.")
}
// PopUp with dark style.
PopUpView(text: singleLineExampleText)
.popUpStyle(DarkPopUpStyle())
// PopUp with color style.
PopUpView(
text: singleLineExampleText,
minCharactersPerLine: 25,
popUpBorderColor: .white,
image: UIImage(named: "BrooklynBridge"),
imageHeight: 80
) {
print("Do something on tapped on the popup.")
}
.popUpStyle(ColorPopUpStyle(popUpColor: .secondary, textColor: .white))
Customize text wrapping to a new line as you like.
import PopUpSwift
let multiLineExampleText = """
Life is like a box of
chocolates,
you never know what you’re gonna
get.
"""
// PopUp with light style (default).
PopUpView(text: multiLineExampleText) {
print("Do something on tapped on the popup.")
}
// PopUp with dark style.
PopUpView(text: multiLineExampleText)
.popUpStyle(DarkPopUpStyle())
// PopUp with color style.
PopUpView(
text: multiLineExampleText,
popUpBorderColor: .white,
image: UIImage(named: "BrooklynBridge"),
imageHeight: 80
) {
print("Do something on tapped on the popup.")
}
.popUpStyle(ColorPopUpStyle(popUpColor: .secondary, textColor: .white))
PopUpView
Note: Default PopUp style is set to light.
DarkPopUpStyle()
ColorPopUpStyle(popUpColor: Color, textColor: Color)
link |
Stars: 0 |
Last commit: 22 hours ago |
Added
ScrollView
. The scroll is activated if the popup frame goes beyond the screen frame.Updated
imageSize
renamed to imageHeight
.Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics