-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{// Override point for customization after application launch.// 主界面入口ViewController*vc=[[ViewControlleralloc]init];self.mainNav=[[UINavigationControlleralloc]initWithRootViewController:vc];self.window.rootViewController=self.mainNav;// 创建快捷访问ItemsUIApplicationShortcutIcon*icon1=[UIApplicationShortcutIconiconWithType:UIApplicationShortcutIconTypeTask];UIApplicationShortcutItem*item1=[[UIApplicationShortcutItemalloc]initWithType:@"item1"localizedTitle:@"item1"localizedSubtitle:@"1"icon:icon1userInfo:nil];UIApplicationShortcutIcon*icon2=[UIApplicationShortcutIconiconWithType:UIApplicationShortcutIconTypeMail];UIApplicationShortcutItem*item2=[[UIApplicationShortcutItemalloc]initWithType:@"item2"localizedTitle:@"item2"localizedSubtitle:@"2"icon:icon2userInfo:nil];// 添加快捷访问Itemsapplication.shortcutItems=@[item1,item2];returnYES;}
-(NSArray<id<UIPreviewActionItem>>*)previewActionItems{// setup a list of preview actionsUIPreviewAction*action1=[UIPreviewActionactionWithTitle:@"Aciton1"style:UIPreviewActionStyleDefaulthandler:^(UIPreviewAction*_Nonnullaction,UIViewController*_NonnullpreviewViewController){NSLog(@"Aciton1");}];UIPreviewAction*action2=[UIPreviewActionactionWithTitle:@"Aciton2"style:UIPreviewActionStyleDefaulthandler:^(UIPreviewAction*_Nonnullaction,UIViewController*_NonnullpreviewViewController){NSLog(@"Aciton2");}];UIPreviewAction*action3=[UIPreviewActionactionWithTitle:@"Aciton3"style:UIPreviewActionStyleDefaulthandler:^(UIPreviewAction*_Nonnullaction,UIViewController*_NonnullpreviewViewController){NSLog(@"Aciton3");}];NSArray*actions=@[action1,action2,action3];returnactions;}