ios-extensions

How to pick one from multiply widgets for home screen using 3d touch?

人走茶凉 提交于 2019-12-19 18:28:34
问题 When I was using only one today widget it was very simple and was like this: Now I added a second today widget to my app, and it is like this: Why it disappeared? What is wrong? Shouldnt be there two today widgets? Can I decide what widget should be preferred here? Apple says: Choose a widget for the quick action list . If your app has multiple widgets, pick one to appear in the quick action menu that appears when someone applies pressure to your app icon on the Home screen using 3D Touch.

Accessing Realm from an iOS Extension while using Realm Mobile Platform

。_饼干妹妹 提交于 2019-12-13 08:39:59
问题 I would like to access my Realm from an iOS extension however the realm path is unavailable when using the Realm Mobile Platform. I've received advice from realm to hold a cloned copy and keep it in sync. How can that be achieved? ...and is it considered a "clean" solution? (there could be multiple realms) 回答1: You should just open the synced Realm from your extension by creating a Realm configuration with a proper sync configuration (specifying user and remote Realm URL), like usual. This is

iOS implementing NETunnelProviderProtocol with no remote server

隐身守侯 提交于 2019-12-12 23:22:15
问题 I'm trying to implement a packet sniffer similar to Charles for iOS using iOS's NetworkExtension framework. Objective So, that's a big goal and I'm breaking it down into a tiny piece right now: I want to see the os_log from my NEPacketTunnelProvider (bottom box in diagram) What I have done so far I have created a NetworkExtension target on type PacketTunnel. This is the code snippet in the 3rd box in the diagram titled "NEPacketTunnelProvider". I have included the "app groups", "personal VPN"

Swift override protocol methods in sub classes

混江龙づ霸主 提交于 2019-12-12 07:47:09
问题 I've a base class that implements an extension that conforms to a protocol as below: protocol OptionsDelegate { func handleSortAndFilter(opt: Options) } extension BaseViewController: OptionsDelegate { func handleSortAndFilter(opt: Options) { print("Base class implementation") } } I've a subclass "InspirationsViewController" that inherits from BaseViewController. And I'm overriding protocol method in the extension as below: extension InspirationsViewController { override func

Action Extension activation rule predicate doesn't hide the action when multiple of the same type is selected

限于喜欢 提交于 2019-12-11 14:12:46
问题 Hello I am trying to make action extension to only work with a single GIF file. Here is my code (created using the snippet provided in Apple's documentation: SUBQUERY ( extensionItems, $extensionItem, SUBQUERY ( $extensionItem.attachments, $attachment, ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.compuserve.gif" ).@count == $extensionItem.attachments.@count ).@count == 1 This extension is supposed to work inside Photos app and I have tried multiple scenarios: Single GIF file

Access the keychain from iOS keyboard extension

孤街浪徒 提交于 2019-12-11 13:42:38
问题 I wrote some code to share data between an application and an extension. The code works perfectly with "Action Extension" while it fails with "Custom keyboard" extension. Each access to the keychain from the "Custom keyboard" extension ends with the same error status: -25291, errSecNotAvailable, "Key Chain not available" or "Keychain Manager was not loaded". Is there a known limitation on accessing the keychain from a custom keyboard extension ? I did not find anything about that. Regards.

Can I access healthkit data from iWatch extension?

假如想象 提交于 2019-12-11 04:49:12
问题 I am making a iWatch app where I need to show data from healthkit. is it possible to access healthkit APIs from iWatch extension? 回答1: No. It's mentioned specifically in the HealthKit Framework Reference: "You cannot access HealthKit from extensions (like the Today view) or from a WatchKit app." What you can do is call openParentApplication:reply: to talk to the iPhone app itself and retrieve that data. Search around for that method name and you'll find some examples on how to call it and get

App icon of Share extension is not updating in device even with updating app icon

自古美人都是妖i 提交于 2019-12-11 03:24:47
问题 In my iOS application, I have a share extension. Initially we were using the different app icons. Later we changed the app icons for the application. The old icon has got replaced from everywhere, but for Share extension, it is not getting replaced with the new icon. Following are ways we tried out but it has not getting changed: Delete the application and reinstalling. -- Did not work Removing the derived data and rebuilding the app and reinstalling -- Did not work. If anybody has faced the

Update UIApplicationShortcutItem from extension

送分小仙女□ 提交于 2019-12-11 00:15:12
问题 I am building a Today Extension to an app, and it works great to modify my application data. But now my dynamic UIApplicationShortcutItems are out of sync. I can't access UIApplication.shared from my extension. Is there a way to ask the app to update UIApplication.shared.shortcutItems without bringing it to the foreground? 回答1: I have found that MMWormhole is a good solution to this problem. It acts somewhat like an NSNotificationCenter notification between the app extension and its host

iOS Share Extension flow

微笑、不失礼 提交于 2019-12-10 19:54:01
问题 I have problems with creating share extension like share extension of the Pinterest app. When user is not logged to the containing app the share extension only presents alert with an option to log in and cancel . Where in code decide which view controller to show in my shared extension. I see this like I need to check authorization status from shared container and if this status is not logged I need to present alert controller. If status is logged I need to show my main view controller