Kirinriki
Kirinriki

Reputation: 875

XCode/Storyboard:Creating a Modal View

I'm reading through the apple developer library and would like to use a submenu like apple shows in a picture:

enter image description here

First question: Is that a modal view? And if yes, how to create something like that? Does this submenu has its own controller and view or is all that declared in the view above? I'm using storyboard.

Upvotes: 0

Views: 658

Answers (1)

Omar Abdelhafith
Omar Abdelhafith

Reputation: 21221

Nope this is an UIActionSheet, it does not have a nib file or a class file, you use it like this

UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Title" 
                                                   delegate:self 
                                          cancelButtonTitle:@"cancel"
                                     destructiveButtonTitle:nil
                                          otherButtonTitles: nil];
[sheet showInView:self.view];

//Function gets called when user taps on a button
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{

}

Upvotes: 2

Related Questions