iOS 3D touch的实现 从零开始

[key]UIApplicationShortcutItems[/key]
    [array]
        [dict]
            [key]UIApplicationShortcutItemIconType[/key]
            [string]UIApplicationShortcutIconTypeShare[/string] //图片类型,枚举
            [key]UIApplicationShortcutItemTitle[/key]
            [string]Share[/string] //title
            [key]UIApplicationShortcutItemType[/key]
[string]-11.UITouchText.share[/string] //标示
[/dict]
[/array]
 
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(nonnull void (^)(BOOL))completionHandler{
//发需求
    if([shortcutItem.typeisEqualToString:@"-11.UITouchText.share"]){
        [self.rnav pushViewController:[[KJIssueViewController alloc]init] animated:YES];
    }
    //我的主站
    if([shortcutItem.type isEqualToString:@"-13.UITouchText.share"]){
        [RTvc setSelectedIndex:3];
        KJServerListViewController *s=[[KJServerListViewController alloc]init];
        s.providerId=[MyDefaults readKey:kProviderId];
        [self.rnav pushViewController:s animated:YES];
    }
}

 

posted on 2016-03-02 14:17  崔付亮  阅读(188)  评论(1编辑  收藏  举报