today-extension

MagicalRecord (CoreData) + Today Extension (iOS8)… Will They Play?

浪子不回头ぞ 提交于 2019-12-09 16:12:09
问题 Hoping you can help. I'm adding Today support to my app, which uses MagicalRecord https://github.com/magicalpanda/MagicalRecord to managing all my CoreData stuff. I'm tearing my hair out trying to understand how to surface my data into the Today extension. I have enabled app groups as outlined here http://blog.sam-oakley.co.uk/post/92323630293/sharing-core-data-between-app-and-extension-in-ios-8 however all the documentation and StackOverflow posts I'm reading relate to using CoreData

Is it possible to refresh a timer in a Today Widget?

回眸只為那壹抹淺笑 提交于 2019-12-09 12:48:30
问题 I was wondering is it possible to update the text label of a timer in a today widget. I took a look around but nothing helped me. 回答1: Yes you can. I have just tested and it works. You just have to add your timer to the main run loop NSRunLoopCommonModes: RunLoop.main.add(yourTimerName, forMode: .commonModes) import NotificationCenter class TodayViewController: UIViewController, NCWidgetProviding { @IBOutlet weak var strTimer: UILabel! var timer = Timer() func updateInfo() { strTimer.text =

iOS Today Extension created as .app rather than .appex

霸气de小男生 提交于 2019-12-08 06:32:13
问题 I'm trying to add a Today Extension to a project I've been working on for quite some time. In fact the app is in the AppStore already and I'm looking to enhance it with a Today Extension. The problem is that the Extension won't launch at all. Not on the device nor on the simulator. EDIT: just skip the next sections and read on at the last EDIT as I think I found the problem. I just not sure how to fix it. I've done a test project following a tutorial and it works just fine. The environment

Custom button not displaying in Today Extension

[亡魂溺海] 提交于 2019-12-08 05:04:32
问题 I have some custom buttons in my host app that I'd like to use in the Today Extension. They work just fine in the app but do not display in the widget. The button on the left is my custom button class, the one on the right is a UIButton. If I change it to my custom class it too disappears. Any thoughts why this might be happening? ----------------------EDIT------------------------ Well, somehow I managed to get it to display but sometimes it's not drawing the whole button and sometimes it's

Custom button not displaying in Today Extension

随声附和 提交于 2019-12-07 02:45:25
I have some custom buttons in my host app that I'd like to use in the Today Extension. They work just fine in the app but do not display in the widget. The button on the left is my custom button class, the one on the right is a UIButton. If I change it to my custom class it too disappears. Any thoughts why this might be happening? ----------------------EDIT------------------------ Well, somehow I managed to get it to display but sometimes it's not drawing the whole button and sometimes it's drawing the button incorrectly. Any help would be appreciated! Thanks 来源: https://stackoverflow.com

iOS Today Extension created as .app rather than .appex

我的未来我决定 提交于 2019-12-06 14:48:22
I'm trying to add a Today Extension to a project I've been working on for quite some time. In fact the app is in the AppStore already and I'm looking to enhance it with a Today Extension. The problem is that the Extension won't launch at all. Not on the device nor on the simulator. EDIT: just skip the next sections and read on at the last EDIT as I think I found the problem. I just not sure how to fix it. I've done a test project following a tutorial and it works just fine. The environment seem(!) to be identical. Xcode 6.1.1, iOS 8.1 on the device and simulator. My project is Objective-C

Change NCWidgetDisplayMode programmatically in IOS10 Widget

泪湿孤枕 提交于 2019-12-06 03:20:18
问题 I am looking to programmatically change the height of a today extension. As the iOS10 SDSK introduced NCWidgetDisplayMode I am trying to use it to programmatically change the height of my preferredContentSize . I have implemented widgetActiveDisplayModeDidChange : @available(iOSApplicationExtension 10.0, *) func widgetActiveDisplayModeDidChange(activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) { if (activeDisplayMode == NCWidgetDisplayMode.Compact) { self

NSExtensionContext openURL not working on Mac OS X Today Widget

北城余情 提交于 2019-12-06 02:36:59
No matter what I do, the following code just returns 'Success: 0' (i.e., it won't launch the hosting app): NSURL *url = [NSURL URLWithString:@"myapp://launch"]; [[self extensionContext] openURL:url completionHandler:^(BOOL success) { NSLog(@"Success? %i", success); }]; If I try the myapp://launch URL directly in Safari, it works and launches my app. However the Today Widget refuses to launch it. It's sandboxed and I've checked 'Outgoing Connections' capabilities ON as well, but no luck. Anything I need to do to get it to work? Strangely I got it working only if I used NSWorkspace. To ensure

How to launch a parent iOS App from its App Extension

独自空忆成欢 提交于 2019-12-04 17:19:17
问题 Does any one know how to launch the parent app from the app extension's view controller? I just want to launch the main app from its app extension. 回答1: In the WWDC session Creating Extensions for iOS and OS X, Part 1 around the 22 minute mark the say to use the openURL:completionHandler: method from the UIViewController's extensionContext to open a custom URL scheme [self.extensionContext openURL:[NSURL URLWithString:@"your-app-custom-url-scheme://your-internal-url"] completionHandler:nil];

Today Widget Extension Height - iOS10

青春壹個敷衍的年華 提交于 2019-12-04 16:40:13
问题 The height for the Today's widget view mode cannot be set for compact Mode. No matter whatever value I set. It sets the height of the widget to a default value. The expanded mode works perfect and the value is properly set and reflected in the widget. I have already added this line in my viewDidLoad() method. self.extensionContext?.widgetLargestAvailableDisplayMode = .expanded Here is the code. The value of maxSize cannot be changed too as its a constant. func widgetActiveDisplayModeDidChange