ios-app-extension

iOS extensions with multiple targets

馋奶兔 提交于 2019-11-29 23:40:08
In iOS 8, when we create a new extension, we have to decide which target it is attached to. The extension will have the same bundle ID's prefix as the target. Is there any way to change the target afterward? If my project contains 2 (or more) targets (for example one for debug/simulator, one for production/device), what's the best way to work with extensions? Do I need to create another extension and duplicate the code (very bothersome to keep the same code for both targets)? To share one widget among a lot of targets one should only add widget.appex target to Embedded Binaries for every

How to detect if code is running in Main App or App Extension Target?

南笙酒味 提交于 2019-11-29 21:23:11
Does anyone know how you detect from within your code if you're running inside an App Extension? I have an app which shares classes between an app and an extension. The app code uses [UIApplication sharedApplication] but this isn't available from within an extension, so it won't compile saying: 'sharedApplication' is unavailable: not available iOS (App Extension) So I need a way to detect that I'm in the extension and use an alternative to sharedApplication if that's the case. You can use a preprocessor macro: In the project settings use the dropdown in the topbar to select your extension

Forcing app to use Apple Keyboard in iOS 8

落花浮王杯 提交于 2019-11-29 14:19:09
问题 How can I get my app's UITextfields to only use the Apple keyboard in iOS 8? I do not want to allow third party keyboards, period. I understand it may be bad user experience so please don't discuss that point with me :) I know I can set the securedEntry property to true to force the Apple keyboard (http://www.imore.com/custom-keyboards-ios-8-explained). Maybe iOS 8 will let me set this property and NOT mask the text? 回答1: By setting a UITextView or UITextField's property of Secure Text Entry

UITextInputDelegate methods not functioning correctly

帅比萌擦擦* 提交于 2019-11-29 12:41:57
问题 I'm working on iOS 8 custom keyboard extension right now, and there are some issues in using UITextInputDelegate Methods. Does this right: selectionWillChange: and selectionDidChange: methods should be called when user long-presses typing area? And textWillChange: and textDidChange: methods should be called whenever the text is literally changing? Actually, what I observed is that, when I changed selection in text input area, textWillChange: and textDidChange: are called, and I cannot get a

Uninstalling app not delete app group data .Do I have to remove app group container and it's content manually?

百般思念 提交于 2019-11-29 11:21:29
问题 I created a Today Extension that is introduced in iOS 8 first time. To share data between Today extension and it's container App , I defined an app group , and bind them to this group. (Actually I added an embedded framework also to re-use code in both side.) Details of this method is described in Apple's document. I created some core data model and store it as sqlite on group container. Then everything works as I thought. However, when I uninstall container app, There are still shared

Save and Load Data on Today Extensions (iOS 8)

ⅰ亾dé卋堺 提交于 2019-11-29 10:18:14
Is it possible to save and load data on Today Extension using NSUserDefaults? After closing the Notification Center, the widget behaves like an app which is terminated, so any data results lost. How could I solve this issue? This is my code: NSUserDefaults *defaults; - (void)viewDidLoad { [super viewDidLoad]; defaults = [NSUserDefaults standardUserDefaults]; NSArray *loadStrings = [defaults stringArrayForKey:@"savedStrings"]; if ([loadStrings objectAtIndex:0] != nil) { [display setText:[NSString stringWithFormat:@"%@", [loadStrings objectAtIndex:0]]]; } if ([loadStrings objectAtIndex:1] != nil

iOS9 Share Extension can not debug on Xcode

和自甴很熟 提交于 2019-11-29 06:30:14
When I build share extension from Xcode for the real device, Xcode arbitrarily stop debug. But when I launch for simulator, the problem does not occur. Environment Xcode 7.1.1 iOS 9.1 Details When I build share extension, Xcode shows "Finished running MobileSafari.app on iPhone", but Safari does not run. And, The square stop button is arbitrarily gray. So, I launch Safari by myself and choose my extension and post. The debug section does not show anything. Also, URL request is not sent Rails server. This is the picture when I build the share extension for the real device. I do not know why the

Extension project templates not appearing in Xcode 6

心不动则不痛 提交于 2019-11-29 05:28:48
I'm not sure if I am the only one experiencing this program, but I have tried searching and have not been able to find anyone in my current situation. I downloaded Xcode 6 beta and was interested in Extension programming for iOS 8. However, I have been unable to locate the extensions in my project templates when creating a new project in Xcode, I saw a YouTube video (unrelated to extension programming) but I did notice that the option was not there for the said video. Now, I have had a look through the contents of the Xcode 6 beta package and have been able to locate the actual templates

What does the “Embedded Content Contains Swift Code” build setting in Xcode 6 do?

梦想与她 提交于 2019-11-29 05:25:16
It's a new setting under "Build Options". What does it do? I can't seem to find any documentation about it. My guess is this: Does it have to be set to YES in a mixed Objective-C/Swift app to tell Xcode to link against the Swift Runtime? It does not need to be Yes for linking. This setting is only for when you have a pure Objective-C target that depends on a mixed-source or pure Swift target. Description: Enable this setting to indicate that content embedded in a target's product contains Swift code, so that the standard Swift libraries can be included in the product. Also in the release note

How to play tock sound when tapping custom keyboard buttons

不羁的心 提交于 2019-11-29 05:04:35
问题 I've been working on a custom keyboard for iOS 8 for some time and everything went fine so far, but I still couldn't get my head around this tapping sound stuff. I searched high and low for this issue and tried several approaches including Using AudioToolbox Using AVFoundation Put the tock.caf inside my bundle and just play it Some of them works, in the simulators but none of them works in my devices. Could anyone who has successfully played sound when tapping on custom keyboard buttons care