ios-extensions

How to suppress `warning: linking against dylib not safe for use in application extensions`?

雨燕双飞 提交于 2019-11-30 07:50:46
I have a dynamic framework that is shared between an iOS application and an extension. There is some code in that framework that references UIApplication , that is of course, not usable in an extension. Those calls are completely isolated and so I am not worried about them causing problems with my extension. Since there isn't a flag specified in the warning message, perhaps there isn't way to do it, but how do I suppress warning: linking against dylib not safe for use in application extensions when building my project? For your watch/today-widget extension target (so not your app or libray

iOs Widget background update

江枫思渺然 提交于 2019-11-29 18:43:23
问题 According to what apple says about widgetPerformUpdateWithCompletionHandler:, the iOs Widget can update his content also when the widget is not visible. In my debug session i've noted that the todayViewController is deallocated everytime the notification center view disappear, so my questions are: How my todayViewController can respond to widgetPerfomrUpdateWithComplationHandler if it is deallocated ? I need that every hour the widget update his content also if it is not visible, how can i do

How to suppress `warning: linking against dylib not safe for use in application extensions`?

喜欢而已 提交于 2019-11-29 10:36:41
问题 I have a dynamic framework that is shared between an iOS application and an extension. There is some code in that framework that references UIApplication , that is of course, not usable in an extension. Those calls are completely isolated and so I am not worried about them causing problems with my extension. Since there isn't a flag specified in the warning message, perhaps there isn't way to do it, but how do I suppress warning: linking against dylib not safe for use in application

How do I set NSExtensionActivationRule predicates?

最后都变了- 提交于 2019-11-29 09:48:03
问题 Even people far smarter than I am find the syntax for NSExtensionActivationRule arcane, but even a fool like me should be able to copy/paste examples, no? Unfortunately I can't even get Apple's examples to work. The host app for my action extension crashes when you hit the share sheet button (stack trace below). You should be able to just set NSExtensionActivationRule as a string, right? It works fine when I set it to TRUEPREDICATE for debugging purposes. But if I take this simple example

NSUserDefaults(suiteName:) on iOS 9 and WatchOS 2 - not working?

烂漫一生 提交于 2019-11-29 07:16:17
I've done this before but nothing seems to be working. Here's my code: Saving in the iOS App let groupDefaults = NSUserDefaults(suiteName: "group.company.appSharedDefaults") groupDefaults?.setObject(theArray, forKey: "theKey") groupDefaults?.synchronize() Reading (works on iOS but not WatchOS 2) let groupDefaults = NSUserDefaults(suiteName: "group.company.appSharedDefaults") if groupDefaults!.objectForKey("theKey") != nil { textEmojiArray = NSMutableArray(array: groupDefaults!.objectForKey("theKey") as! NSArray) } else { //error } Both .entitlements files contain group.company

How do i add this sharing button? IOS8 with swift

喜欢而已 提交于 2019-11-29 00:42:57
I want there to be a button in my app, that when it is pressed, this(See image below) Pops up. How do i do that? I don't want to create a custom sharing extion, i just want the default one? What code do i use? All the tutorials online are in objective-c. Please give an answer in swift. Image: http://9to5mac.com/2014/06/30/hands-on-1password-beta-shows-off-ios-8s-touch-id-extensions-apis-video/#jp-carousel-330420 Here is my code so far, but i get an error that UIBarButtonItem Is not convetable to UIVIew Why? The action is connected to a navigation bar button item? @IBAction func ActionButton

How to use Notification service extension with UNNotification in iOS10

独自空忆成欢 提交于 2019-11-28 23:42:36
Apple introduce new extension names "UNNotificationServiceExtension" , but how to launch it from push notification ? I read that service extension provide end to end encryption for payload. Which key is required to set payload of push notification ? How to identify payload and how to launch service extension from push notification ? Let me take it step by step. UNNotificationServiceExtension - What it is? UNNotificationServiceExtension is an App Extenstion target that you bundle along with your app aiming to modify the push notifications as and when they are delivered to the device before

Retrieve ALAsset or PHAsset from file URL

人盡茶涼 提交于 2019-11-28 12:13:34
Selecting images in Photos.app to pass to an action extension seems to yield paths to images on disk (e.g.: file:///var/mobile/Media/DCIM/109APPLE/IMG_9417.JPG ). Is there a way to get the corresponding ALAsset or PHAsset? The URL looks like it corresponds to the PHImageFileURLKey entry you get from calling PHImageManager.requestImageDataForAsset . I'd hate to have to iterate through all PHAssets to find it. I did what I didn't want to do and threw this dumb search approach together. It works, although it's horrible, slow and gives me memory issues when the photo library is large. As a noob to

How to paste image from pasteboard on UITextView?

前提是你 提交于 2019-11-28 11:42:49
I have the following code on a keyboard extensión let pasteboard = UIPasteboard.generalPasteboard() var image = UIImage(named: "myimage"); pasteboard.image = image; This doesn't work on a UITextView I have on my container application, paste context menu never shows up. It works on other applications like "messages" but not on mine. My code works if I try to paste text instead of an image using string property so I'm quite near. I could need to set up my text view different but I don't know how. I've changed "Text" from "Plain" to "Attributed" but still not working. Aaron Brager UITextView only

iOS8 extension : share images between container and extension

[亡魂溺海] 提交于 2019-11-28 08:55:29
问题 I'm making an iOS 8 extension. Here's what I'm trying to do: Users select images from the photo library in the container app, and these images will be shared with the extension and for the further use. Right now I'm doing it in this way (If you don't want to read this part, please skip below to read the actual codes): Use App Group and NSUserDefaults to share datas . Convert UIImage into NSData and then save all the images in a NSArray, then save the array into a NSDictionary (I have many