ios8-extension

iOS 8 Today widget alignment issue

不问归期 提交于 2019-12-05 02:45:36
Here is my storyboard I'm using autolayout, and NOT using size classes. When I ran it on iPhone 5s, it works fine.(both portrait and landscape) But when I ran it on iPhone 6 plus (portrait), it's not aligning properly. on iPhone 6 plus (landscape), it's worse. I know I can use -widgetMarginInsetsForProposedMarginInsets: to set the margin, but in that case I will need to customize the margin for every device. That would be horrible :( So is there a way to align the subview to the title less painfully? Looks like you have to set it manually. You can do this by creating a constraint, then

Current text selection in CustomKeyBoardExtension

余生颓废 提交于 2019-12-05 01:39:15
问题 I'm trying to write Custom Keyboard Extension . I'm looking for the way to know where the cursor is on UITextField , UITextView ...etc in CustomKeyboardExtension ... but I don't see anything like that. I saw SwiftKey app (http://swiftkey.com) can do that (or do something like that). When I change the cursor, suggestion-text will change (see below pictures). Q: How can we get current text selection? ... UPDATE: 29/09/2014 Ok, I'm so foolish. We can use documentContextBeforeInput ,

Using UILexicon to implement autocorrect in iOS 8 Keyboard Extension

北慕城南 提交于 2019-12-05 01:34:17
I've seen that this question has been asked a few times, but no one seems to have an answer. I am trying to create an autocorrect feature on a custom keyboard, but I am completely lost as to how to do so. Apple gives some documentation, but it's not very detailed. I know it has something to do with UILexicon data, but I'm not sure what to do with it and how to use it to correct strings of text the user is typing. Any help would be greatly appreciated. What I have found so far: let controller = UIInputViewController() controller.requestSupplementaryLexiconWithCompletion({ lexicon in println

iOS 8 Action Extension for selected text in Safari

核能气质少年 提交于 2019-12-04 21:01:28
I can't get Action Extensions to work with selected text in safari. Inside Activation rules there is the rule to allow text, but the extension is not available when I select the text. You need to turn on NSExtensionActivationSupportsWebURLWithMaxCount to make extension available in Safari. When you create a non-UI action extension target from the template, an Action.js file is automatically created. Edit the file to send back the selected text using document.getSelection().toString() 来源: https://stackoverflow.com/questions/26063582/ios-8-action-extension-for-selected-text-in-safari

iOS 8 share extension and authentication flows

爷,独闯天下 提交于 2019-12-03 23:19:25
I have an iOS 8 share extension for posting content from a web browser. Users need to be prompted to login if they've never logged in via the containing app. Pinterest appears to support fast-switching to the containing app (I'm assuming they've implemented a share extension). iOS documentation suggests that only Today extensions can open containing apps . Is there a way to fast-switch to the containing app via a share extension for authentication? 来源: https://stackoverflow.com/questions/26188931/ios-8-share-extension-and-authentication-flows

Current text selection in CustomKeyBoardExtension

落花浮王杯 提交于 2019-12-03 16:25:07
I'm trying to write Custom Keyboard Extension . I'm looking for the way to know where the cursor is on UITextField , UITextView ...etc in CustomKeyboardExtension ... but I don't see anything like that. I saw SwiftKey app ( http://swiftkey.com ) can do that (or do something like that). When I change the cursor, suggestion-text will change (see below pictures). Q: How can we get current text selection? ... UPDATE: 29/09/2014 Ok, I'm so foolish. We can use documentContextBeforeInput , documentContextAfterInput methods of textDocumentProxy property. I thought that "Before","After" are about the

How to detect from iOS keyboard extension that a textfield is cleared via actions like hitting “Send” in iMessage?

为君一笑 提交于 2019-12-03 06:07:39
In my iOS keyboard app, I currently have a text suggestions bar much like the default iOS 8 Keyboard's suggestion bar. I would like to clear all text on the suggestion bar whenever the user does something that clears the text field (for example, when someone hits " Send " on iMessage or Whatsapp,). As hitting "Send" is not a keystroke , I was wondering if there is way to detect from the keyboard when a textfield is cleared. I have tried detecting empty text "" or new line "\n" , but so far this has not worked. Edit: I do know that this is possible through 3rd party iOS Keyboard, as seen the

UIActivityViewController not showing my custom activity image in the “MORE” list on iOS8

时光毁灭记忆、已成空白 提交于 2019-12-03 06:02:31
问题 Here's the screenshot: In my subclass of UIActivity, I override the -activityImage method to use my own icon for the facebook share item, but it appears in the share panel but disappears in the MORE list. 回答1: Quite old question, but maybe the solution is helpful for others too! In your UIActivity subclass implement/overwrite the method - (UIImage *)activityImage { return [UIImage imageNamed:@"Activity Icon"]; } to return the image to be shown in the UIActivityViewController itself (as you've

UIActivityViewController not showing my custom activity image in the “MORE” list on iOS8

社会主义新天地 提交于 2019-12-02 20:42:01
Here's the screenshot: In my subclass of UIActivity, I override the -activityImage method to use my own icon for the facebook share item, but it appears in the share panel but disappears in the MORE list. Quite old question, but maybe the solution is helpful for others too! In your UIActivity subclass implement/overwrite the method - (UIImage *)activityImage { return [UIImage imageNamed:@"Activity Icon"]; } to return the image to be shown in the UIActivityViewController itself (as you've done). In addition to this implement/overwrite the method - (UIImage *)activitySettingsImage { return

Action Extension AND Sharing Core Data

前提是你 提交于 2019-12-02 09:17:42
问题 I am using the Action extension in my Application. Our app currently uses Core Data. I am sharing this between the app and the Action Extension using App Groups and successfully migrated the Core Data from Documents Directory to App Group. The problem which I am facing happens when importing photos or notes from Photos/Notes App into my application using the extension. The document is imported successfully but I am not able to view that document in my application. Only when I kill the