쉬운 peasy. 그것은 모두 당신이 그것을 시작하는 방법, 네비게이션 컨트롤러, 스 와이프 제스처, 툴바 항목 또는 그냥 일반 버튼에 달려 있습니까? 어느 쪽이든 상관 없지만 특정 답변을 원하면 특정 질문을해야합니다.
-(IBAction) moreActions:(id)sender {
UIActionSheet *moreActions = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Add To Favorites", @"Download For Offline View",@"Open Document In :", nil];
[moreActions showInView:self.view];
}
: 여기
는 addToFav 및 다운로드, 당신의 목표는 스토리 보드 인터페이스에 연결되어있는 북마크 버튼을 사용하여 구매하는 인터페이스를 그러나 IBActions을하지 않는 수행 할 필요가 없습니다 방법 예입니다
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0: [self addToFav:self]; //See IBAction below
break;
case 1: [self download:self]; //See IBAction below
break;
case 2: {
//UIDocumentInteractionController:
NSURL *docURL = [NSURL URLWithString:@"filePathStringHere"];
documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:docURL];
[documentInteractionController setDelegate:self];
[documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}
break;
}
}
- (IBAction)download:(id)sender {
//enter your download code here
}
- (IBAction)addToFav:(id)sender {
//Code to add to your favorites
}
: 당신이 작업을 수행
그리고 그 방법은 아래의 메소드를 호출하는 것입니다