Skip to content

A customizable alert and action sheet UI framework

License

Notifications You must be signed in to change notification settings

hdtls/swift-alertkit

Repository files navigation

AlertKit

Platform CocoaPods Carthage compatible License Twitter

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.

example

Requirements

AlertKit Version Minimum iOS Target Descriptions
1.0.0 iOS 8
1.1.0 iOS 7 add UITextField support
2.0.0 iOS 11

Installation

AlertKit can be added to a project using CocoaPods、Cathage, One may also use source files included in the project.

CocoaPods

CocoaPods is the recommended way to add AlertKit to your project.

  1. Add a pod entry for AlertKit to your Podfile pod 'AlertKit', '~> 2.0.0' or pod 'AlertKit'
  2. Install the pod(s) by running pod install or update by running pod update
  3. Include AlertKit wherever you need it with import AlertKit.

Source files

Alternatively you can directly add the source files to your project.

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. 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.

Usage

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

License

AlertKit is released under the MIT license. See LICENSE for details.

About

A customizable alert and action sheet UI framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published