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
}
source
share