ios8

Open URL scheme from iOS extension

◇◆丶佛笑我妖孽 提交于 2019-12-06 16:12:11
问题 I have this code that return success = NO [self.extensionContext openURL:[NSURL URLWithString:@"URLApp://"] completionHandler:^(BOOL success) { [self.extensionContext completeRequestReturningItems:nil completionHandler:nil]; }]; So and I can't open containing app from my share extension when I debug it. I've configured main target of contained app like this: I've tested open URLApp:// from safari and it works for me. I also used some examples provided here to understand how to open containing

How to get listed in the iOS 8 system wide share menu?

眉间皱痕 提交于 2019-12-06 16:02:18
问题 I'm trying to get my iOS 8 app listed in the iOS 8 system wide share menu for the image extensions .png, .jpg (.jpeg), .gif (static). What do I need to add to the info.plist file? I tried the code below from the iOS docs example but that didn't work, my app isn't showing up in the share list. <key>NSExtension</key> <dict> <key>NSExtensionAttributes</key> <dict> <key>NSExtensionServiceRoleType</key> <string>NSExtensionServiceRoleTypeEditor</string> </dict> <key>NSExtensionPointIdentifier</key>

iOS share extension dismiss keyboard

耗尽温柔 提交于 2019-12-06 15:43:34
I'm implementing a share extension for my app, so far everything is going good except I can't seem to dismiss the keyboard that automatically opens using the default layout/storyboard. I'm keeping the default design/layout (SLComposeServiceViewController) which includes the preview image and UITextview, the UITextview automatically gets in focus which opens the keyboard. Normally this is fine, but if you're not logged in my app I display an UIAlertController saying you need to login to share. The problem is the keyboard opens at the same time as the alert. I've tried [self.view endEditing:YES]

iOS 8 Action Extension for selected text in Safari

旧时模样 提交于 2019-12-06 15:09:25
问题 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. 回答1: 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() 来源:

SpriteKit - Mouse Snaps to Center On Sprite Drag

吃可爱长大的小学妹 提交于 2019-12-06 14:51:04
I'm trying to create an iOS game and I have it so that when the item is touched and moved it is dragged. When it is dragged the mouse is snapped to the center of the sprite. How could I make it so that this wouldn't happen? Here is an example of what is happening. Here are the functions dealing with touch input override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) { var papers = 0 for touch in (touches as! Set<UITouch>) { let location = touch.locationInNode(self) let touchedNode = nodeAtPoint(location) if ((touchedNode.name?.contains("paper")) != nil) { touchedNode

saving image to documents directory no longer works iOS8

。_饼干妹妹 提交于 2019-12-06 14:26:45
Saving images to the documents directory does not seem to working anymore in iOS8. I had hear that there was Changes To App Containers In iOS 8 . But I still cant seem to get my code to work. I save an image to the documents directory, and retrieve it later to use. Here is my code for saving the image in the documents directory; -(void) simpleCam:(SimpleCam *)simpleCam didFinishWithImage:(UIImage *)image { if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { //choose Photo }else{ if (image) { //save the image to photos library

openURL in APPDelegate conversion error NSString -> String (Swift & iOS8)

给你一囗甜甜゛ 提交于 2019-12-06 14:19:48
问题 I'm currently developing an iOS application that integrates Facebook and I'm having a bit of a problem while investigating this with Swift (with ObjC I have no problems). The thing is, this is the method that gets executed in the appDelegate when coming from another APP (in this case FB in a WebBrowser): func application( application: UIApplication, openURL url: NSURL, sourceApplication: NSString, annotation: AnyObject) -> Bool { let appString : String = sourceApplication as String // Try to

NSExtension Share Extension limit Photos count

故事扮演 提交于 2019-12-06 14:17:40
问题 I have developed a Share Extension and import Photos and Notes from Photos and Notes App. I want to limit the count of Photos which can be import to only 10 but for Photos i am able to select unlimited photos. Below is the query from info.plist of extension. Can anyone look into it and guide me to correct query. <key>NSExtension</key> <dict> <key>NSExtensionAttributes</key> <dict> <key>NSExtensionActivationRule</key> <string>SUBQUERY ( extensionItems, $extensionItem, SUBQUERY ( $extensionItem

Swift 1.2 and Parse: Issue with retrieving images to populate PFQueryCollectionViewController

試著忘記壹切 提交于 2019-12-06 13:39:11
问题 I'm currently working on an application that displays images at certain locations. The issue is the following: When the user clicks on the location in the MapView it goes to an empty collection view. If the user pulls to refresh, the spinner is active but the images do not load. However, if the user goes back to the MapView and then clicks on the location again, the images are loaded in the collection view. Of course we are trying to get the images loaded when the user first goes to the

Determine if a copy to UIPasteboard was successful or not

别等时光非礼了梦想. 提交于 2019-12-06 12:35:51
问题 I'm programmatically copying an image to the UIPasteboard, and I want to determine if the copy was successful or not. Specifically, I'm creating an custom keyboard on iOS 8, where some of the keys will copy an image to the pasteboard for the user to paste in a textfield. UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard]; [pasteBoard setImage:[UIImage imageNamed:anImage]]; To do this, the user must allow "Full Access" on the keyboard. So I either have to have a way to determine if