다른 UiView/페이지를 열려면 단추 ("계속")를 만들어야합니다. 나는 아주 새로운 것을 개발하고 있습니다. 누군가 나를 걸어 주실 수 있습니까? 고마워, 너희들은 나를 위해 큰 도움이된다.Storyboard에서 UiActionSheet 사용 하시겠습니까?
코드 :
- (IBAction)OpenActionSheetButton:(id)sender {
UIActionSheet *actionsheet = [[UIActionSheet alloc]initWithTitle:@"There is no going back, are you sure???" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Continue" otherButtonTitles:nil, nil];
[actionsheet showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0)
{
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"storyboardViewIdentifier"];
//storyboardViewIdentifier is the ViewController identifier you specify in the storyboard
//PUSH
[self.navigationController pushViewController:controller animated:YES];
//Modal
[self presentViewController:controller animated:YES completion:Nil];
}
}
이 내가 코드와 함께했던 것입니다 :
- (IBAction)OpenActionSheetButton:(id)sender {
UIActionSheet *actionsheet = [[UIActionSheet alloc]initWithTitle:@"There is no going back, are you sure???" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Continue" otherButtonTitles:nil, nil];
[actionsheet showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0)
{
if(buttonIndex == 0)
[self performSegueWithIdentifier:@"openView" sender:self];
UIViewController *controller = [self.storyboard
instantiateViewControllerWithIdentifier:@"storyboardViewIdentifier"];
//storyboardViewIdentifier is the ViewController identifier you specify in the storyboard
//PUSH
[self.navigationController pushViewController:controller animated:YES];
//Modal
[self presentViewController:controller animated:YES completion:Nil];
}
}
당신의 다음 뷰 컨트롤러를 제기하는 제시의 SEGUE을 수행하지 않는 이유는
은 위아래 시트가 표시됩니까? – ApolloSoftware
네 그렇습니다 :) 그냥 "계속"을 클릭하면, 강제 종료됩니다. – user212803
왜보기 컨트롤러와 현재보기 컨트롤러를 동시에 모달로 밀어야합니까? 하나만 선택해야합니다. –