| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- Activity 수명 주기
- NSURLConnection
- signing
- AccountManager
- ios9
- 다른 앱에서 열기
- service
- 안드로이드 개발 레벨업 교과서
- contentprovider
- Android O
- Android O Preview
- 배포
- HTTP
- Push
- 페이스북
- Android
- Google Cloud Messasing
- GCM
- Unchecked Exception
- BLOCK
- unreal
- xcode
- In-app Billing
- gradle
- 카카오톡
- ios
- 트위터
- 데이터 공유
- Google Cloud Messasging
- android studio
- Today
- Total
노블의 개발이야기
[iOS] UIActionSheet 본문
UIActionSheet
UIActionSheet is deprecated in iOS 8.
(Note that UIActionSheetDelegate is also deprecated.)
To create and manage action sheets in iOS 8 and later, instead use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet.
- (IBAction)showActionSheet:(id)sender {
UIActionSheet *actionSheet =
[[UIActionSheet alloc] initWithTitle:@"Select the operation to proceed?"
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"Delete"
otherButtonTitles:@"Create", @"Update", @"Duplicate", nil];
[actionSheet showInView:self.view];
}
<Delegate>
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == [actionSheet cancelButtonIndex]) {
NSLog(@"ActionSheet : Cancel Button Clicked");
return;
}
else if (buttonIndex == [actionSheet destructiveButtonIndex]) {
NSLog(@"ActionSheet(%ld) : Delete Button Clicked", buttonIndex);
}
else if (buttonIndex == [actionSheet firstOtherButtonIndex]) {
NSLog(@"ActionSheet(%ld) : Create Button Clicked", buttonIndex);
}
else if (buttonIndex == [actionSheet firstOtherButtonIndex] + 1) {
NSLog(@"ActionSheet(%ld) : Update Button Clicked", buttonIndex);
}
else {
NSLog(@"ActionSheet(%ld) : Duplicate Button Clicked", buttonIndex);
}
}
'iOS' 카테고리의 다른 글
| [iOS] UIView에서 상위 UIVewController 가져오기 (0) | 2015.07.13 |
|---|---|
| [iOS] UIActivityViewController (0) | 2015.07.13 |
| [iOS] UIWebView 웹페이지 너비 맞추기 (0) | 2015.05.14 |
| [iOS] XML Parser (0) | 2015.05.06 |
| [iOS] GCD(Grand Central Dispatch) 사용하기 (0) | 2015.04.23 |
UIActionSheetSample.zip