Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ImKcat/CatAlertController
Use UIAlertController like a boss.
https://github.com/ImKcat/CatAlertController
ios popup swift uialertcontroller
Last synced: 6 days ago
JSON representation
Use UIAlertController like a boss.
- Host: GitHub
- URL: https://github.com/ImKcat/CatAlertController
- Owner: imkcat
- License: mit
- Created: 2018-06-26T09:21:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-07T02:06:31.000Z (about 6 years ago)
- Last Synced: 2024-11-18T03:36:51.687Z (24 days ago)
- Topics: ios, popup, swift, uialertcontroller
- Language: Swift
- Homepage:
- Size: 160 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - CatAlertController - Use UIAlertController like a boss. (UI / Alert & Action Sheet)
- awesome-ios-star - CatAlertController - Use UIAlertController like a boss. (UI / Alert & Action Sheet)
README
- [Description](#description)
- [Requirements](#requirements)
- [Installation](#installation)
- [CocoaPods](#cocoapods)
- [Carthage](#carthage)
- [Usage](#usage)
- [License](#license)## Description
CatAlertController is a high level manager object that with chaining style for UIAlertController.
## Requirements
- Swift 4+
- iOS 8.0+## Installation
CatAlertController is available through [CocoaPods](http://cocoapods.org) and [Carthage](https://github.com/Carthage/Carthage).
### CocoaPods
Add the following line to your Podfile:
```ruby
use_frameworks!pod 'CatAlertController'
```### Carthage
Add the following line to your Cartfile:
```ruby
github "ImKcat/CatAlertController"
```## Usage
Here is the alert style sample code in iPhone:
```swift
CatAlertController(title: "CatAlertController",
message: "This is CatAlertController",
preferredStyle: UIAlertControllerStyle.alert)
.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel))
.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default))
.flash(from: self, delay: 0.3)
```Here is the action sheet style sample code in iPad:
```swift
// Don't worry the action sheet style present in iPad, it won't be crash, take it easy :)
CatAlertController(title: "CatAlertController",
message: "This is CatAlertController",
preferredStyle: UIAlertControllerStyle.actionSheet)
.addAction(UIAlertAction(title: "Item 1"))
.addAction(UIAlertAction(title: "Item 2"))
.addAction(UIAlertAction(title: "Item 3"))
.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel))
.flash(from: self, delay: 1)
```## License
CatAlertController is available under the MIT license. See the LICENSE file for more info.