Update 3D Touch Fast Header

I want to show the date in the 3D Touch quick action item. Is there any way to update the data if the user did not open the application?

At the moment, a quick action will only show the date the application was last opened, not the current date.

Is it possible to show current information or that some background process is not allowed?

Appdelegate

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    let dateVariable = Date()
    let dateFormatter = DateFormatter()
    dateFormatter.dateStyle = .short
    let dateString = dateFormatter.string(from: dateVariable)

    let shortcut4 = UIMutableApplicationShortcutItem(type: "GetDate",
                                                     localizedTitle: dateString,
                                                     localizedSubtitle: "Get Today Date in subtitle",
                                                     icon: UIApplicationShortcutIcon(type: .date),
                                                     userInfo: nil)

    application.shortcutItems = [shortcut4]
    return true
}
+4
source share
1 answer

You can update the shortcuts in Background. But without proper reason, you cannot turn on the background for the application. Apple will reject the application during the review process.

Update:

, . iOS 10 Apple "" forceTouch ( 3D). Today , forceTouch. ,

+2

Source: https://habr.com/ru/post/1658105/


All Articles