일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- xcode
- Android O
- Unchecked Exception
- android studio
- 카카오톡
- AccountManager
- gradle
- 데이터 공유
- Activity 수명 주기
- Android O Preview
- service
- BLOCK
- ios
- unreal
- 안드로이드 개발 레벨업 교과서
- signing
- HTTP
- 배포
- Google Cloud Messasing
- Android
- ios9
- 페이스북
- Google Cloud Messasging
- contentprovider
- 다른 앱에서 열기
- Push
- 트위터
- In-app Billing
- NSURLConnection
- GCM
- 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 |