ios8-today-widget

Finding out if the device is locked, from a Notification Widget

本秂侑毒 提交于 2019-11-28 04:15:22
问题 I'd like to know if the device is locked when I'm loading my Notification/Today widget, so I can show the widget appropriately. (it's financial, and we don't want to show balances on a locked phone) On devices with TouchID, I can just try to access the Keychain, and if I get errSecInteractionNotAllowed back, it's locked. All good. This doesn't work on devices without touchID (but with a PIN). I've found a few things, which recommend using [[UIApplication sharedApplication]

Debug info when run today extension

拟墨画扇 提交于 2019-11-27 23:25:51
问题 Got this debug info when debug a today extension app "host connection < NSXPCConnection: 0x170113560 > connection from pid 53 invalidated" does anyone know what this means? it shows almost every time when "widgetPerformUpdateWithCompletionHandler" called. 回答1: NSXPCConnection API is used to perform interprocess connection between Xcode client and your app on iPhone. So you do not need to worry about this one. Link: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual

weird crash when launching app from Notification Center

空扰寡人 提交于 2019-11-27 16:39:58
问题 I'm at my wits end, I'm getting a weird crash that only happens when the app is launched from Notification Center. Either tapping on a local notification (in the notification side) or a call to extensionContext:openURL:completionHandler (from my Today widget) will launch the app with a customURL scheme. When the app is running (warm boot), no issues, works just as advertised. When I kill the app (in task switcher) and then try to launch it through Notification Center (cold boot), I get the

coredata - move to app group target

﹥>﹥吖頭↗ 提交于 2019-11-27 16:20:37
问题 I am new to the Today extension and using an embedded framework. Our app currently uses core data backed by sqlite. If I want to share this between the app and the today extension, should I move this to a framework to be shared by both? How can I migrate our current version in the app store to be able to upgrade to a new structure? 回答1: In case someone wants the solution in swift just add below function in didFinishLaunchingWithOptions. func migratePersistentStore(){ let coordinator =

Today Extension view flashes when redrawing

北城以北 提交于 2019-11-27 02:15:45
问题 According to Apple documentation, "To help your widget look up to date, the system occasionally captures snapshots of your widget’s view. When the widget becomes visible again, the most recent snapshot is displayed until the system replaces it with a live version of the view." What I am seeing, however, is that the snapshot is removed from screen before the live view is prepared. This results in a flash effect where the old snapshot is taken off screen, the view is blank for a split second,