2015-12-22 79 views
-2
ActionsViewController *actionsViewController = [AppLibrary createActionsViewController]; 
actionsViewController.actionDelegate = self; 
actionsViewController.supportedActionTypes = @[[[SupportedAction alloc] initWithActionType:ActionTypeEdit mediaTypes:@[kTypePNG]]]; 

[actionsViewController setWhitelistedSubTypes:@[@"adjust", @"filter", @"healing"]]; 

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { 
    self.actionsNavigationController = [[UINavigationController alloc] initWithRootViewController:actionsViewController]; 
    [self presentViewController:self.actionsNavigationController animated:YES completion:nil]; 
} 
+1

- (IBAction为)去:(ID)发送; – alideny

+1

只是如何从按钮调用此代码? – alideny

+0

这可能有所帮助:http://stackoverflow.com/questions/5843427/how-do-you-add-an-action-to-a-button-programmatically-in-xcode。在按钮事件中,您可以粘贴您所需的功能代码。 – Mrunal

回答

1

只是

-(IBAction)go:(id)sender 
{ 
ActionsViewController *actionsViewController = [AppLibrary createActionsViewController]; 
actionsViewController.actionDelegate = self; 
actionsViewController.supportedActionTypes = @[[[SupportedAction alloc] initWithActionType:ActionTypeEdit mediaTypes:@[kTypePNG]]]; 

[actionsViewController setWhitelistedSubTypes:@[@"adjust", @"filter", @"healing"]]; 

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { 
    self.actionsNavigationController = [[UINavigationController alloc] initWithRootViewController:actionsViewController]; 
    [self presentViewController:self.actionsNavigationController animated:YES completion:nil]; 
} 
} 

添加此请检查以下文件: Apple Doc

+0

谢谢。有用) – alideny