I want to show the date in a 3D Touch Quick Action item. Is there any way for the data to refresh if the user has not opened the app?
Right now, the quick action will only show the date of the last time the app was opened, rather than the current date.
Is it possible to show current info or is that some background process that 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's Date in subtitle",
icon: UIApplicationShortcutIcon(type: .date),
userInfo: nil)
application.shortcutItems = [shortcut4]
return true
}