Swiftpack.co - bullinnyc/PopUpSwift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by bullinnyc.
bullinnyc/PopUpSwift 2.1.1
Beautiful PopUpView for your SwiftUI project that supports portrait and landscape orientation, with flexible view settings.
⭐️ 0
🕓 21 hours ago
iOS
.package(url: "https://github.com/bullinnyc/PopUpSwift.git", from: "2.1.1")

PopUpSwift

Swift Package Manager compatible

Beautiful PopUpView for your SwiftUI project that supports portrait and landscape orientation, with flexible view settings.

Screenshots

Installation

Swift Package Manager

Going to Xcode File > Add Packages... and add the repository by giving the URL of this GitHub.

Usage

Single line text example

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

Multiline text example

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

Sets the style of PopUpView

Note: Default PopUp style is set to light.

DarkPopUpStyle()
ColorPopUpStyle(popUpColor: Color, textColor: Color)

Requirements

License

  • PopUpSwift is distributed under the MIT License.

GitHub

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

Release Notes

2.1.1
22 hours ago

Added

  • Added ScrollView. The scroll is activated if the popup frame goes beyond the screen frame.

Updated

  • Property imageSize renamed to imageHeight.
  • Updated README.md

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