UmaBasicAlertKit
UmaBasicAlertKit is a Swift UI library for iOS. This library allows user to use variations of Apple's default pop up alert with one line of code.
Installation
UmaBasicAlertKit can be installed with Swift Package Manager.
Swift Package Manager (Xcode 12 or higher) The preferred way of installing KatKit is via the Swift Package Manager.
In Xcode, open your project and navigate to File β Swift Packages β Add Package Dependency... Paste the repository URL (https://github.com/umaKim/UmaBasicAlertKit.git) and click Next. For Rules, select Version (Up to Next Major) and click Next. Click Finish.
Usage
presentUmaDefaultAlert
presentUmaDefaultAlert(title: "Title")
presentUmaDefaultAlert(title: "Tile", message: "Message")
presentUmaDefaultAlert(title: "Cancel Button Pop up", isCancelActionIncluded: true)
presentUmaDefaultAlert(title: "Pop up with completion", message: "press ok ", isCancelActionIncluded: true, actionCancelButtonTitle: "Cancel") { action in
self.view.backgroundColor = .yellow
}
presentUmaActionAlert
let action = UIAlertAction(title: "change background to Red", style: .default) { action in
self.view.backgroundColor = .red
}
presentUmaActionAlert(title: "You can add custom alert action", isCancelActionIncluded: true, with: action)
let actionR = UIAlertAction(title: "change background color to Red", style: .default) { action in
self.view.backgroundColor = .red
}
let actionG = UIAlertAction(title: "change background color to Green", style: .default) { action in
self.view.backgroundColor = .green
}
let actionB = UIAlertAction(title: "change background color to Blue", style: .default) { action in
self.view.backgroundColor = .blue
}
let cancelAction = UIAlertAction(title: "change background color to White", style: .cancel) { action in
self.view.backgroundColor = .white
}
presentUmaActionAlert(
title: "You can add custom alert action",
with: actionR, actionG, actionB, cancelAction
)
presentUmaBottomAlert
presentUmaBottomAlert(message: "Bottom Alert Message")
Requirements
iOS 14.0+ Swift 5+
Author
Uma Kim