ios-app-extension

iOS 8 beta 5 Today view extension (widget) stuck at Waiting to Attach

跟風遠走 提交于 2019-12-04 21:37:55
问题 I want to debug a today view extension (widget) in iOS 8, so I select the widget under "Scheme" in Xcode, and select my iPhone as the device and hit run. It says "running today-view on iPhone" and on the side bar on the left it says "Waiting to attach". It gets tuck at the "waiting to attach" phase forever and never shows me any debugging info on my iPhone. However this works fine if I select the simulator as my device. After a few seconds of "waiting to attach" in the simulator, the widget

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];

Correct way to display today view widget content

。_饼干妹妹 提交于 2019-12-04 14:57:28
I'm working on a today view extension with some custom view elements which I don't set up in interface builder. Now I'm wondering where the right point in the lifecycle is to init the widget content. I read about updating the content in widgetPerformUpdateWithCompletionHandler so I implemented a check for new updates which should about the view. But my observations showed me that the method is called before viewDidAppear and so there is no view to update. Also I tought the widget stays in memory for a while so that I can have a certain object in widgetPerformUpdateWithCompletionHandler whose

Today Extension height for iPad much larger than specified

霸气de小男生 提交于 2019-12-04 14:55:55
问题 My Today extension needs to have a dynamic height based on the contents the widget is displaying. I was able to achieve this by adding a constraint on my bottom-most element: bottom layout guide's top is less than or equal to the bottom most element's bottom, with a constant of 0, priority 999, multiplier 1. This works exactly as expected on iPhones - the widget height fits all content plus the default bottom margin is applied before the next widget is shown. But on iPad it seems to be

Launch app from INExtension in SiriKit

和自甴很熟 提交于 2019-12-04 07:34:37
I want to use SiriKit to start a workout. Starting the workout requires opening the main app from the app extension. The boilerplate that Apple provides for the INStartWorkoutIntentHandling handler is func handle(startWorkout startWorkoutIntent: INStartWorkoutIntent, completion: (INStartWorkoutIntentResponse) -> Void) { let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartWorkoutIntent)) let response = INStartWorkoutIntentResponse(code: .success, userActivity: userActivity) completion(response) } How can I open my own app from here? Something like myapp://workout?action

How to detect an app extension is enabled in containing app on iOS 8?

寵の児 提交于 2019-12-04 05:08:49
I am developing a custom keyboard on iOS 8 beta, and I want to tell the user that how to enabled it in containing app if my custom keyboard is not enabled, is there any way to detect an app extension is enabled ? nurxyz 1) first of all let's set some constants to make it easy to understand each other: containing app = the app that installs the extension and holds the extension binary and target host app = the app that the extension is running inside (other party) extension = any of iOS8's new components/modules that we can now build into system-wide use: custom keyboards, today widgets, photo

iOS 8 custom keyboard crash when debugging

狂风中的少年 提交于 2019-12-04 04:13:57
Issue Most times, when I try to debug my custom keyboard extension, I receive the following error and then the keyboard disappears (presumably crashes, so the system removes it from screen and replaces it with the standard keyboard) plugin com.db.Trype.TrypeKeyboard interrupted (Note: Trype is the name of my keyboard.) Process I am debugging the keyboard the following way: I have the keyboard extension as a target. I've modified the TrypeKeyboard scheme to run my app executable on launch. The keyboard has been added in the Simulator's Settings App. I've tried different version of Xcode-Beta

How to add images as text attachment in Swift using nsattributedstring

五迷三道 提交于 2019-12-04 02:45:47
I'm trying to build a custom keyboard for iOS using images which I've put in as buttons. When I press a button, the image linked to the button is put into an attributed string which is loaded into an UiTextView inside the custom keyboard view. That is working. The problem is that when I append a new image to the attributed string both the old and new images in the string are changing to the image I currently pressed on. I can't understand why the old images in the string are changing. Any suggestions? I've tried using replaceCharactersInRange and insertAttributedString but can't get it to work

iOS 8 Today Extension not working on device

二次信任 提交于 2019-12-04 01:13:35
When I run my Today Extension on the simulator everything works fine and it displays the following as expected: However when I run it on my devices (iPod touch and iPhone 5s) the body won't show (don't mind the title and icon, that was changed) I attached the debugger to my extension and I got this: I have no idea what all of this means... I removed all code for the Today Extension to check if there was a problem with my code and nothing changed so I doubt theres a problem with my code. Any suggestions on how to fix this would be greatly appreciated. (I do have app groups enabled if thats of

Today Extension Not Positioned Correctly

醉酒当歌 提交于 2019-12-03 22:30:25
I'm developing a Bitcoin Today Extension and for some reason, the control has an offset. Here's what it currently looks like: http://i.imgur.com/KxeXePS.png As you can see, the button is barely on the screen, and the label isn't on the left side. My storyboard looks like: http://i.imgur.com/6vtfNGJ.png I've tried settings multiple kinds of constraints, and none of them seem to fix the issue. I'm not sure what other information I can add, but if you have any questions about the project, I can answer them. To disable the margin you have to use the function