ios-app-extension

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

跟風遠走 提交于 2019-11-27 22:56:13
问题 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? 回答1: 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

Sharing code between original iOS App and App Extension

狂风中的少年 提交于 2019-11-27 22:44:11
Sharing class between iOS app and extension app I want to use a custom class in both my app and the extension app. If I just have the class in the main app folder, the extension doesn't pick up on it. I tried making a copy of it and putting it into the extension folder, but I of course get a invalid redeclaration of [my class] error. What's the best solution for this? It's just one class, not multiple resources. Nothing should be copied. Just add required files to compile sources for your extension: Just make sure that the files you want to share gets a tick in the section Target Membership .

openURL from App Extension

独自空忆成欢 提交于 2019-11-27 22:11:35
On iOS 8 beta 2 it should be possible to use openUrl from app extension as written into the release notes: however when I try to use this API (on Xcode 6 beta 2) I get the following error: Beta 2 really fixed this issue or not? Laurence Fan you may use this code: [self.extensionContext openURL:url completionHandler:^(BOOL success) { NSLog(@"fun=%s after completion. success=%d", __func__, success); }]; the API document: openURL:completionHandler: you could also refer to this question: openURL not work in Action Extension Accepted solution only works in Today extensions , a working solution in

Why won't app groups work inside my WatchKit extension?

拈花ヽ惹草 提交于 2019-11-27 21:36:34
问题 I've seen all the other posts of SO about sharing NSUserDefaults data between host apps and app extensions, but mine still doesn't work. Here's everything I've done: Enable App Groups on Xcode's "Capabilities" tab for the extension and host app. Set the group name to "group.com.mycompany.foo" and confirmed the extension and host app are added to the group. Confirmed an entitlements file exists for both with the "com.apple.security.application-groups" key set to my app group name. (For what it

Installation Failed “Invalid argument” when trying to run Today application extension

痞子三分冷 提交于 2019-11-27 19:00:17
I added a vanilla Today Application Extension and run with the new scheme created by XCode. After it finishes building ("Build Succeeded" pops up), it failed straight away with this error: Installation Failed Invalid argument I've been trying to find answers for 6 hours now, no luck so far. Please help! Check if the Bundle Identifier isn't empty in the Info.plist Try this: Quit Xcode Clean out ~/Library/Developer/Xcode/DerivedData manually rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" iOS Simulator > Reset Content and Settings Maybe you are bundling a conflicting

Open My application from my keyboard extension in swift 3.0

你。 提交于 2019-11-27 18:55:09
问题 I am trying to open from my keyboard extension. I am having custom keyboard and I have add that keyboard from setting. On my custom keyboard there is one button “Show More”, and I want to open my app on this button click. So I have tried following code : let context = NSExtensionContext() context.open(url! as URL, completionHandler: nil) var responder = self as UIResponder? while (responder != nil) { if responder?.responds(to: Selector("openURL:")) == true { responder?.perform(Selector(

How to detect Orientation Change in Custom Keyboard Extension in iOS 8?

拟墨画扇 提交于 2019-11-27 18:07:57
In Custom Keyboard Extension , we can't use `didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation` and sharedApplication . I need to detect portrait or landscape in keyboard when rotate. How can i detect when orientation change in Custom Keyboard extension? Matt In order to update your custom keyboard when the orientation changes, override viewDidLayoutSubviews in the UIInputViewController . As far as I can tell, when a rotation occurs this method is always called. Additionally, as the traditional [UIApplication sharedApplication] statusBarOrientation] doesn't

iOS 8 Beta Today extension widget not showing in a Swift app?

流过昼夜 提交于 2019-11-27 17:24:43
问题 Today extension doesn't show up in a Swift app, but it does in a Objective C app. What I did was to add a UILabel with some content on the storyboard for the swift and objective c apps. It showed up when I ran the Objective C app, but not when I executed the Swift app. Am I missing something here? 回答1: You can comment out the supplied init method. // init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { // super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) // //

iOS 8 Share Extension custom view controller size

為{幸葍}努か 提交于 2019-11-27 11:09:51
问题 I'm building a share extension for my iOS app and I can't use the default SLComposeServiceViewController , so I created (in the storyboard) a basic UIViewController and embedded in a navigation controller. I get to present it, dismiss it etc but it's always full screen. I would like to make it look more like a dialog. I have tried using self.preferredContentSize on my view controller, tried Use Preferred Explicit Size on the navigation controller in Interface Builder, but it doesn't work. 回答1

Use Cocoapods with an App Extension

泄露秘密 提交于 2019-11-27 10:09:27
I'm trying to build a photo App Extension in Xcode 6 Beta-6 that uses cocoapods libraries. The bridging header that Xcode creates for the photo extension can't see anything from cocoapods. For example: #import <GPUImage/GPUImage.h> results in the error "GPUImage/GPUImage.h" file not found . I've tried every conceivable path for the import (with brackets and quotes) and have had almost no success. The exception is that for simple pods like SVProgressHUD , the following ugly terrible hack works: #import "../Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.h" . But for GPUImage, it walks into the