|
1 | | -SIAlertView |
2 | | -============= |
3 | 1 |
|
4 | | -An UIAlertView replacement with block syntax and fancy transition styles. As seen in [Grid Diary](http://griddiaryapp.com/). |
5 | | - |
6 | | -[](https://flattr.com/submit/auto?user_id=Sumi-Interactive&url=https://github.com/Sumi-Interactive/SIAlertView&title=SIAlertView&tags=github&category=software) |
7 | | - |
8 | | -## Preview |
9 | | - |
10 | | - |
11 | | - |
12 | | -## Features |
13 | | - |
14 | | -- use window to present |
15 | | -- happy with rotation |
16 | | -- block syntax |
17 | | -- styled transitions |
18 | | -- queue support |
19 | | -- UIAppearance support |
20 | | - |
21 | | -## Installation |
22 | | - |
23 | | -### Cocoapods(Recommended) |
24 | | - |
25 | | -1. Add `pod 'SIAlertView'` to your Podfile. |
26 | | -2. Run `pod install` |
27 | | - |
28 | | -### Manual |
29 | | - |
30 | | -1. Add all files under `SIAlertView/SIAlertView` to your project |
31 | | -2. Add `QuartzCore.framework` to your project |
32 | | - |
33 | | -## Requirements |
34 | | - |
35 | | -- iOS 5.0 and greater |
36 | | -- ARC |
37 | | - |
38 | | -(If you are having any problems, just select your project -> Build Phases -> Compile Sources, double-click the SIAlertView and add `-fobjc-arc`) |
39 | | - |
40 | | -## Examples |
41 | | - |
42 | | -**Code:** |
43 | | - |
44 | | -```objc |
45 | | -SIAlertView *alertView = [[SIAlertView alloc] initWithTitle:@"SIAlertView" andMessage:@"Sumi Interactive"]; |
46 | | - |
47 | | -[alertView addButtonWithTitle:@"Button1" |
48 | | - type:SIAlertViewButtonTypeDefault |
49 | | - handler:^(SIAlertView *alert) { |
50 | | - NSLog(@"Button1 Clicked"); |
51 | | - }]; |
52 | | -[alertView addButtonWithTitle:@"Button2" |
53 | | - type:SIAlertViewButtonTypeDestructive |
54 | | - handler:^(SIAlertView *alert) { |
55 | | - NSLog(@"Button2 Clicked"); |
56 | | - }]; |
57 | | -[alertView addButtonWithTitle:@"Button3" |
58 | | - type:SIAlertViewButtonTypeCancel |
59 | | - handler:^(SIAlertView *alert) { |
60 | | - NSLog(@"Button3 Clicked"); |
61 | | - }]; |
62 | | - |
63 | | -alertView.willShowHandler = ^(SIAlertView *alertView) { |
64 | | - NSLog(@"%@, willShowHandler", alertView); |
65 | | -}; |
66 | | -alertView.didShowHandler = ^(SIAlertView *alertView) { |
67 | | - NSLog(@"%@, didShowHandler", alertView); |
68 | | -}; |
69 | | -alertView.willDismissHandler = ^(SIAlertView *alertView) { |
70 | | - NSLog(@"%@, willDismissHandler", alertView); |
71 | | -}; |
72 | | -alertView.didDismissHandler = ^(SIAlertView *alertView) { |
73 | | - NSLog(@"%@, didDismissHandler", alertView); |
74 | | -}; |
75 | | - |
76 | | -alertView.transitionStyle = SIAlertViewTransitionStyleBounce; |
77 | | - |
78 | | -[alertView show]; |
79 | | -``` |
80 | | -
|
81 | | -## Credits |
82 | | -
|
83 | | -SIAlertView was created by [Sumi Interactive](https://github.com/Sumi-Interactive) in the development of [Grid Diary](http://griddiaryapp.com/). |
84 | | -
|
85 | | -## License |
86 | | -
|
87 | | -SIAlertView is available under the MIT license. See the LICENSE file for more info. |
0 commit comments