ios-app-extension

Proper implementation of handleInputModeList in Custom Keyboard

↘锁芯ラ 提交于 2019-12-07 09:18:27
A new API has been added in iOS 10 to present the list of other keyboards the user can switch to - the same list that appears when users long press the globe on a system keyboard. The declaration of the function is as follows: func handleInputModeList(from view: UIView, with event: UIEvent) My question is, what's the proper way to generate a UIEvent to supply? I was planning to call this function using a UILongPressGestureRecognizer but this API doesn't reveal UIEvent s. I was going about this the wrong way. No need for custom gesture handling. As noted in the headers, one should add a target

openURL doesn't work in Share extension

最后都变了- 提交于 2019-12-07 02:32:07
问题 Trying to use [self.extensionContext openURL:... completionHandler:...]; in an iOS 8 Share extension to open the containing app never opens the app, and always calls the completion handler with success = NO. Here is the same issue with Action extensions, but I think it is more reasonable for Share extensions to be able to open the containing app than Action extensions. The point of a Share extension is to upload a potentially large piece of data, and the only way to do that without opening

iOS AlertView App Extension

假如想象 提交于 2019-12-06 21:46:32
I'm working in a custom keyboard (iOS App Extension) . I have a UICollectionView in my Keyboard Layout , so when one item is selected I want to show a message ( UIAlerView for example). Here is my code: - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ ... UIAlertController * alert= [UIAlertController alertControllerWithTitle:@"My Title" message:@"Enter User Credentials" preferredStyle:UIAlertControllerStyleAlert]; [self presentViewController:alert animated:YES completion:nil]; } I get this error: 'Feature not available in extensions

How to display an image from Asset Catalog in Today Extension?

混江龙づ霸主 提交于 2019-12-06 17:24:13
问题 I'm working on a Today Extension for iOS8. My App Group is set up correctly and I can successfully use NSUserDefaults to send simple bits of data to my extension (using this tutorial). In the storyboard for my extension, I've placed an image onto the storyboard and set the image to be an asset I have in my Asset Catalog. Even though it appears in Interface Builder, when I run the app on a device and simulator the image doesn't display. What am I missing? 回答1: Make sure the asset catalog is

How to add toolbar above iOS8 custom keyboard?

…衆ロ難τιáo~ 提交于 2019-12-06 14:29:28
My problem is write picture. I really need you help. Maybe inputAccessoryView, inputAccessoryViwController can be used, but I really have no idea. Thanks so much! You can adjust the height of your custom keyboard’s primary view using Auto Layout. By default, a custom keyboard is sized to match the system keyboard, according to screen size and device orientation. A custom keyboard’s width is always set by the system to equal the current screen width. To adjust a custom keyboard’s height, change its primary view's height constraint. The following code lines show how you might define and add such

How to programmatically disable predictive view in WebView of iOS 8

纵然是瞬间 提交于 2019-12-06 10:47:37
问题 I'm designing a custom keyboard for iOS 8. It works fine on any UITextField but when it's in UIWebView, it shows predictions. Since it's allowed to have custom keyboard in iOS 8 I assume there should be a way to disable this view. Any help would be appreciated. Red area of the following picture: 回答1: I found a workaround solution for this problem. If you add type="email" instead of type="text" in your HTML file like bellow, iOS keyboard won't show the predictive view :) <input type="email"/>

Share Extension not uploading full size images

你离开我真会死。 提交于 2019-12-06 07:28:19
问题 i am developeing share extension for my iOS application. i had really done every thing but the problem is that my code is only working for small images but when i upload image taken from device camer then uploading fails and only text get uploded. - (void)performUploadWith:(NSDictionary *)parameters imageFile:(UIImage *)image{ NSString *boundary = @"SportuondoFormBoundary"; // NSURLSessionConfiguration *configuration= [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier

Correct way to display today view widget content

十年热恋 提交于 2019-12-06 06:36:45
问题 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

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

限于喜欢 提交于 2019-12-05 23:41:14
问题 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 ? 回答1: 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

Why Photos app is NOT showing in the Document Provider extensions on the device?

两盒软妹~` 提交于 2019-12-05 21:27:59
I'm working in app to pick photo, I have used UIDocumentMenuViewController to display list of extensions for document provider. This list shows Dropbox, iCloud, GoogleDrive but not the native Photos app, why? Sample of my code: UIDocumentMenuViewController *menuVC = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[@"public.image"] inMode:UIDocumentPickerModeImport]; I'm not sure if there is another way natively to do this, but I came up with a solution to add a custom option with handler. I added "Photos" option and in the handler I use UIImagePickerViewController :