UIApplicationShortcutItem works like NSArray in that they both immutable but provide mutable subclasses (ie UIMutableApplicationShortcutItem and NSMutableArray). Therefore if you want to set the targetContentIdentifier for a shortcut item you have to do something like the following:
let shortcutItem = UIMutableApplicationShortcutItem(type: "com.myapp.shortcut", localizedTitle: "Shortcut")
shortcutItem.targetContentIdentifier = "myapp://shortcut"
UIApplication.shared.shortcutItems = [shortcutItem]
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: