Lesson12 - 3DTouch

效果图

3DTouch.gif

项目代码地址

代码块

info.plist中添加,最多四个选项,及时添加超过四个也只会显示四个

UIApplicationShortcutItems
    
        
            UIApplicationShortcutItemIconType
            UIApplicationShortcutIconTypeShare
            UIApplicationShortcutItemTitle
            Share
            UIApplicationShortcutItemType
            Share
        
        
            UIApplicationShortcutItemIconType
            UIApplicationShortcutIconTypeShare
            UIApplicationShortcutItemTitle
            Share0
            UIApplicationShortcutItemType
            Share0
        
        
            UIApplicationShortcutItemIconType
            UIApplicationShortcutIconTypeShare
            UIApplicationShortcutItemTitle
            Share1
            UIApplicationShortcutItemType
            Share1
        
        
            UIApplicationShortcutItemIconType
            UIApplicationShortcutIconTypeShare
            UIApplicationShortcutItemTitle
            Share2
            UIApplicationShortcutItemType
            Share2
        
        
            UIApplicationShortcutItemIconType
            UIApplicationShortcutIconTypeShare
            UIApplicationShortcutItemTitle
            Share3
            UIApplicationShortcutItemType
            Share3
        
    

3DTouch回调方法

//
func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
}

你可能感兴趣的:(Lesson12 - 3DTouch)