ios-app-extension

Does iOS 8 support dynamic linking?

[亡魂溺海] 提交于 2019-12-03 10:50:01
问题 Up until iOS7, Apple did not support dynamic linking due to security concerns. Code reuse between developers usually relied on static libraries, which were built as part of the executable of the app. Introducing extensions in iOS8 seems to change this a bit, because extensions are separate executables. Sharing code between an extension and its containing app is done via a framework. Apple is saying this in their release notes: Frameworks for iOS. iOS developers can now create dynamic

iOS App Extension with xib instead of storyboard

假如想象 提交于 2019-12-03 10:48:24
问题 I'm writing an iOS 8 App Extension (widget) for the Today view. The default template in xcode comes with a storyboard. How can I use an xib file instead of an storyboard? The documentation says this is possible, but I can't seem to figure out how to change the info.plist file to get the xib loaded. 回答1: all you need to do is add "NSExtensionPrincipalClass" and the classname which you want. 回答2: As I recently discovered the hard way - notice that the 'NSExtensionPrincipalClass' must be

Today Extension height for iPad much larger than specified

此生再无相见时 提交于 2019-12-03 09:17:59
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 setting my widget's height equal to the max height Notification Center will allow a widget to be - there's a

What is the preprocessor macro to test whether an application extension is being built?

冷暖自知 提交于 2019-12-03 08:53:53
问题 This question is based purely on publicly released documents regarding the introduction of application extensions in iOS. With the introduction of app extensions in iOS 8, it is now possible to "extend custom functionality and content beyond your app and make it available to users while they’re using other apps". In my implementation of my extension, I am including some classes from my actual app in my extension (models, etc). The problem is that these classes make calls to UIApplication ,

Can't use keyboard extension in Spotlight after 8.3

本秂侑毒 提交于 2019-12-03 08:36:37
Since I updated my keyboard extension project to Swift 1.2 and my devices to iOS 8.3, I am no longer able to use my extension in Spotlight search. My extension is not in the list if I press and hold the "globe" key, and if it's the active keyboard when entering Spotlight the system keyboard is used instead. Other 3'rd party keyboards seems to work in Spotlight - and my own keyboard works in any other app I've tried it in (Notes, Mailbox, Safari etc). It used to work in Spotlight in all iOS 8.X versions up to 8.3. Did anything change in 8.3 that I need to handle to be able to use my keyboard in

ios 8 how to debug Custom Keyboard?

痴心易碎 提交于 2019-12-03 07:19:41
I have successfully created a Custom Keyboard with Swift on iOS 8 simulator. Although it worked well, but I could not debug it. It is a contained target and was installed through Settings->General. Placing a bookmark in XCode not work. I am able to debug a custom keyboard using the simulator via Xcode 6. Select the keyboard (and not it's container) as the scheme. "Run" and then select on of the apps on your simulator to debug the extension with. imDeveloper It seems as of now apple didn't get support for debugging extension into simulator. I was having same issue but I observe that We can

How can app extension access files in containing app Documents/ folder

拥有回忆 提交于 2019-12-03 06:29:45
In the app extension is there a way to get images generated from the containing app which is store in /var/mobile/Containers/Data/Application//Documents// folder? iphonic In order to make files available to app extension you have to use Group Path , as App Extension can't access app's Document Folder, for that you have follow these steps, Enable App Groups from Project Settings-> Capabilities . Add a group extension something like group.yourappid . Then use following code. NSString *docPath=[self groupPath]; NSArray *contents=[[NSFileManager defaultManager] contentsOfDirectoryAtPath:docPath

How to create a Today widget programmatically without storyboard on iOS8?

本小妞迷上赌 提交于 2019-12-03 05:59:18
问题 I tried to delete the storyboard file and related Info.plist entry but this time extension stopped working; it doesn't even launch from XCode. The operation couldn’t be completed. (LaunchServicesError error 0.) It is easy on the regular app (containing app) as we see it's entry point and application delegate, but how to do it on extensions too? 回答1: I did the following steps: Delete the storyboard file from your project Modify the info.plist: Go to the NSExtension Dictionary, remove this key:

What is the purpose of widgetPerformUpdateWithCompletionHandler in iOS 8 Today Widget?

爱⌒轻易说出口 提交于 2019-12-03 05:38:22
问题 Been looking around for an answer but everything seems vague or unclear. Anyways, just want to know what the purpose of the function: widgetPerformUpdateWithCompletionHandler does in the today widget. According to Apple: This method is called to give a widget an opportunity to update its contents and redraw its view prior to an operation such as a snapshot. When the widget is finished updating its contents (and redrawing, if necessary), the widget should call the completion handler block,

nil object in iOS8 delegate methods - custom keyboards

徘徊边缘 提交于 2019-12-03 05:33:44
问题 I'm building a custom keyboard and I'm implementing the following delegate methods in my InputViewController . But I always get _textInput = nil_ - (void)textWillChange:(id<UITextInput>)textInput - (void)textDidChange:(id<UITextInput>)textInput - (void) selectionWillChange:(id<UITextInput>)textInput - (void) selectionDidChange:(id<UITextInput>)textInput Does anybody know how to fix it? Is it nil for a reason? Do I need to implement something by myself? 回答1: Good question. But it seems that