-
-
Save tobiastom/475878 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)openMoreAfterDelay:(id)sender { | |
UIMenuController *menuController = [UIMenuController sharedMenuController]; | |
[self becomeFirstResponder]; | |
NSMutableArray *menuItems = [[NSMutableArray alloc] init]; | |
for (SquaceMLAction *action in [[dataSource.squaceML.squaregrid.squares objectAtIndex:activeIndex] actions]) { | |
SquaceMenuItem *item = [[SquaceMenuItem alloc] initWithTitle:action.text action:didSelectMenuItem:)]; | |
item.squaceAction = action; | |
[menuItems addObject:item]; | |
[item release]; | |
} | |
menuController.menuItems = menuItems; | |
[menuItems release]; | |
[menuController update]; | |
[menuController setMenuVisible:YES animated:YES]; | |
} | |
- (IBAction)didSelectMenuItem:(SquaceMenuItem *)menuItem { | |
NSLog(@"Do frakking magic with: %@", menuItem.squaceAction); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment