https://github.com/douking/lvmalerthud
An alert/action-sheet control.
https://github.com/douking/lvmalerthud
actionsheet alert chainable-methods dialog dsl oc tost
Last synced: 18 days ago
JSON representation
An alert/action-sheet control.
- Host: GitHub
- URL: https://github.com/douking/lvmalerthud
- Owner: DouKing
- License: mit
- Created: 2016-06-01T10:42:49.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-12-27T02:44:51.000Z (over 5 years ago)
- Last Synced: 2025-03-10T07:17:44.243Z (about 1 month ago)
- Topics: actionsheet, alert, chainable-methods, dialog, dsl, oc, tost
- Language: Objective-C
- Homepage:
- Size: 88.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

## LVMAlertController
> An alert control that follows the system's API.

## Usage
- The basic
```objc
LVMAlertController *alertController = [LVMAlertController alertControllerWithTitle:@"TITLE" message:@"some message" preferredStyle:LVMAlertControllerStyleAlert];
LVMAlertAction *action = [LVMAlertAction actionWithTitle:@"OK" style:LVMAlertActionStyleDefault handler:nil];
[alertController addAction:action];action = [LVMAlertAction actionWithTitle:@"Cancel" style:LVMAlertActionStyleCancel handler:^(LVMAlertAction * _Nonnull action) {
NSLog(@"%@", action.title);
}];
[alertController addAction:action];[alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"A text field placeholder";
}];[self presentViewController:alertController animated:YES completion:nil];
```
- support for DSL
```objc
LVMAlertController.alert
.setupTitle(@"Title")
.setupMessage(@"message")
.addActionsWithTitles(@"ok", @"later", @"know", nil)
.addCancelActionWithTitle(@"cancel")
.actionsHandler(^(NSInteger index, LVMAlertAction *action) {
NSLog(@"click %ld, %@", index, action.title);
})
.show(^{
NSLog(@"show");
});```
## The other UI controls contain
- LVMStatusBarHUD
- LVMToastHUD## Install with CocoaPods
Add the following content to your Podfile.
```ruby
pod 'LVMAlertHUD'
```OR
```ruby
pod 'LVMAlertHUD/AlertController'
pod 'LVMAlertHUD/StatusBarHUD'
pod 'LVMAlertHUD/Toast'
```
#### Compatibility- iOS 8.0+
- Xcode 9.4## License
See LICENSE.