-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.m
More file actions
56 lines (41 loc) · 1.61 KB
/
Copy pathViewController.m
File metadata and controls
56 lines (41 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// ViewController.m
// UIAlertController
//
// Created by linghang on 2017/3/30.
// Copyright © 2017年 wangjian. All rights reserved.
//
#import "ViewController.h"
#import "AlertControllerView.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)present:(id)sender {
AlertControllerView *alertOn = [[AlertControllerView alloc] initStyle:UIAlertControllerStyleAlert andTitle:@"title" andContent:@"你好" andConfirm:^(id confirmBlock) {
NSLog(@"点击放弃");
} andConfirmTitle:@"放弃" andCancelBlock:^(id cacel) {
NSLog(@"点击结束");
} andCancelTitle:@"结束" andSheetArr:nil andDestructiveIndex:0 andClickIndexBlock:^(id clickIndexBlock) {
}];
[self presentViewController:alertOn animated:YES completion:^{
}];
}
- (IBAction)sheet:(id)sender {
NSArray *arr = @[@"1",@"2",@"3"];
AlertControllerView *sheet = [[AlertControllerView alloc] initStyle:UIAlertControllerStyleActionSheet andTitle:nil andContent:nil andConfirm:nil andConfirmTitle:nil andCancelBlock:^(id cacel) {
NSLog(@"点击取消");
} andCancelTitle:@"放弃" andSheetArr:arr andDestructiveIndex:2 andClickIndexBlock:^(id clickIndexBlock) {
NSLog(@"点击%ld",[clickIndexBlock integerValue]);
}];
[self presentViewController:sheet animated:YES completion:^{
}];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end