Swiftpack.co - mznu/BlockAlert as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by mznu.
mznu/BlockAlert 2.0.1
Alert controller extension for convenience.
⭐️ 0
🕓 1 week ago
iOS
.package(url: "https://github.com/mznu/BlockAlert.git", from: "2.0.1")

BlockAlert

Version License Platform

Alert controller extension for convenience.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

// presenting alert

let alert = UIAlertController { alert in
  alert.title = "title"
  alert.message = "message"
  
  let actions = AlertActionSet()
                  .default("default")
                  .destructive("destructive")
                  .cancel("cancel")
                  
  alert.addActions(actions)
}

present(alert, animated: true)


// presenting action sheet

let actionSheet = UIAlertController(.actionSheet) {
  $0.addAction(.default("default"))
  $0.addAction(.cancel("cancel"))
  $0.addAction(.destructive("destructive"))
}

present(actionSheet, animated: true)

Installation

CocoaPods

pod 'BlockAlert', '~> 2.0'

Swift Package Manager

Available since version 2.0.0

Author

Mujun Kim, me@mujun.kim

License

BlockAlert is available under the MIT license. See the LICENSE file for more info.

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

2.0.1
1 week ago

API Changed

  • gave default value nil to UIAlertController.addAction(_:handler:) 's handler parameter

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