AlertKit is a customizable alert and action sheet UI framework like UIAlertController,but we changed present and dismiss animator to raise user experience , also you can customize text attributes for yourself.
AlertKit Version | Minimum iOS Target | Descriptions |
---|---|---|
1.0.0 | iOS 8 | |
1.1.0 | iOS 7 | add UITextField support |
2.0.0 | iOS 11 |
AlertKit can be added to a project using CocoaPods、Cathage, One may also use source files included in the project.
CocoaPods is the recommended way to add AlertKit to your project.
- Add a pod entry for AlertKit to your Podfile
pod 'AlertKit', '~> 2.0.0'
orpod 'AlertKit'
- Install the pod(s) by running
pod install
or update by runningpod update
- Include AlertKit wherever you need it with
import AlertKit
.
Alternatively you can directly add the source files to your project.
- Download the latest code version or add the repository as a git submodule to your git-tracked project.
- Open your project in Xcode, then drag and drop all source files onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
You can present the alert from any UIViewController like UIAlertController.
let alert = AlertController(title: "Remind !!" message: "Support is on Github" preferredStyle:.alert)
let cancel = AlertAction(title: "Cancel" style: .cancel) { action in
// ...
}
alert.addAction(cancel)
self.present(alert, animated: true, completion:nil)
Add UITextFiels using the reference that:
UIAlarmer.addTextField(withConfiguration:)
If you need to configure the attributes you can do this by using the AlertController reference that:
AlertController(attributedTitle:message:preferredStyle:)
AlertAction(attributedTitle:style:handler:)
AlertKit is released under the MIT license. See LICENSE for details.