ios8-extension

iOS 8 extension dependencies issues. Importing one project file to extension view controller

只愿长相守 提交于 2019-12-07 03:39:00
问题 I am working on iOS 8 extension. I read many manuals and all of them just show how simple add extension to your app, and seems that's enough. But here are many pitfalls: After adding your extension you will need to import some of your classes to view controller that were created when you added new extension target. The big use here that you will need add all of them and if you have huge project it's not a simple task. Solution can be select extension target then in Build Phases -> Compile

Swift: Missing argument in call to argumentless extension of SequenceOf

孤人 提交于 2019-12-07 02:36:28
Can anybody see light on this bug? The playground insists that argument #2 is missing, but there is no argument #1! The intention of the code to to count the number of runs of a equatable value, and return a sequence of tuples consisting of the values and their counts. I've worked on this code extensively, optimising it and refining it until I'm pretty sure that it should work… but although it compiles, I cannot call it the way it was intended. The error i get from calling the code below is missing argument for parameter #2 in call extension SequenceOf { func CountRuns<T: Equatable>() ->

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

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() 来源:

How to add the project prefix file to photo extension target?

一个人想着一个人 提交于 2019-12-06 05:18:44
The main target typically contains a -Prefix.pch file where all the convenience imports are defined. E.g when using opencv with c++ there is #ifdef __cplusplus #import <opencv2/opencv.hpp> #endif #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #endif Unfortunately when using the new Photo Extension target in iOS 8, this file gets ignored making it a hassle to add all the files required in the extension target. Is there a way to make this Prefix file work also for the new target? thx You can change your extension's prefix header by changing your project's build

Using categories in iOS 8 frameworks

只愿长相守 提交于 2019-12-06 04:24:36
I am trying to share some code between an app and an extension, using a framework. Mostly this works, but I have several categories that do not seem to load correctly in the extension. For example, I have a category on NSString to reverse the target string, but when I try to use that selector within the extension my code traps with an "unrecognized selector" exception. I tried adding the "-all_load" linker flag, first to just the framework, and then to the extension, to try and force load all the classes implemented in the framework, but this does not seem to work. Any suggestions would be

Google plus sign-in for xcode share extension

让人想犯罪 __ 提交于 2019-12-05 21:46:30
I’m writing an iOS app to share web page links by email, and as part of it I want users to be able to sign in to google plus. I’ve got the containing app working fine using the instructions from here: https://developers.google.com/+/mobile/ios/sign-in and now I’m trying to add a share extension that can also access the user’s google+ profile. I started off by trying to add the sign in button in to the share extension, but I don’t think that’s going to work because after clicking the button you’re taken out of the app to the browser to accept permissions, and then there’s no way to redirect

iOS 8 share extension and authentication flows

给你一囗甜甜゛ 提交于 2019-12-05 11:06:27
问题 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

iOS 8 extension dependencies issues. Importing one project file to extension view controller

你。 提交于 2019-12-05 06:38:23
I am working on iOS 8 extension. I read many manuals and all of them just show how simple add extension to your app, and seems that's enough. But here are many pitfalls: After adding your extension you will need to import some of your classes to view controller that were created when you added new extension target. The big use here that you will need add all of them and if you have huge project it's not a simple task. Solution can be select extension target then in Build Phases -> Compile Sources press plus button and add all .m files to your target using hot key CMD+A. After adding all files