swift3.0 给app图标添加 3D touch

swift3.0 给app图标添加 3D touch_第1张图片
image.png

1.在 info.plist文件中添加

UIApplicationShortcutItems
    
        
            UIApplicationShortcutItemIconType
            UIApplicationShortcutIconTypeShare
            UIApplicationShortcutItemTitle
            My MemberShip
            UIApplicationShortcutItemType
            Share17Hi
        
    
    func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
        
        switch shortcutItem.type {
        case "Share17Hi":
            print("Do what u want")
        default:
            break
        }
    }

你可能感兴趣的:(swift3.0 给app图标添加 3D touch)