3dtouch

3D Touch Shortcut Widget

心不动则不痛 提交于 2019-12-23 07:04:56
问题 i'm trying to implement new "quick menu widget" in iOS 10 available with 3dtouch. My app has multiple today extension and apple guidelines report 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. I don't understand where i can "change" that! With only one widget all works as well. 回答1: There is a new Info.plist key UIApplicationShortcutWidget which you need to set to the

swift check if 3D Touch is possible

元气小坏坏 提交于 2019-12-22 18:32:48
问题 In my app I will show settings, which only should be visible, if the device can 3D Touch. at the moment I check, if the device has ios9. if #available(iOS 9.0, *) problem is, for example the iPhone 6 have iOS 9 but no 3D Touch. how can I check the possibility of 3D Touch with swift? i found this post, but no swift solution: Check if 3D touch is supported and enabled on the iOS9 device One more Question. now i want to check if iOS 9 AND 3D Touch is available. i try this: if (#available(iOS 9.0

Peek/Pop preview ignores cell corner radius in collection view

我与影子孤独终老i 提交于 2019-12-22 10:07:11
问题 I have added 3D Touch Peek/Pop functionality to my collection view cells and it works great, however I've noticed that the preview frame does not respect the corner radius of the cells. Here's my previewing function: func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { let viewController = storyboard?.instantiateViewControllerWithIdentifier("scholarDetailViewController") as? ScholarDetailViewController let

Refresh 3D Touch Quick Action title

混江龙づ霸主 提交于 2019-12-22 09:39:25
问题 I want to show the date in a 3D Touch Quick Action item. Is there any way for the data to refresh if the user has not opened the app? Right now, the quick action will only show the date of the last time the app was opened, rather than the current date. Is it possible to show current info or is that some background process that is not allowed? AppDelegate : func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool

3D Touch Home Shortcuts In Obj-C

落爺英雄遲暮 提交于 2019-12-20 08:35:31
问题 All of my apps are currently written in Obj-C. The link https://developer.apple.com/library/content/samplecode/ApplicationShortcuts/Introduction/Intro.html#//apple_ref/doc/uid/TP40016545 for the sample code of implementing Home Screen Shortcuts with 3D Touch is completely compiled in Swift. Anyone come across documentation for Obj-C, so I don't have to go through my AppDelegate and translate it all? UPDATE: After adding in all the shortcuts in Info.plist, I added in the AppDelegate.m: - (void

Make XCUIElement perform 3D touch for Automate UITest?

狂风中的少年 提交于 2019-12-18 20:12:36
问题 I'm creating Automate UITest test case where I'd like to test the scenario when users make 3D Touch interaction with an element, then shows them Peek and Pop view. I can't seem to find any possible ways to simulate 3D Touch on an element and continue. Anyone has any idea about this, or 3D Touch is still unavailable to test? Thanks 回答1: I was able to execute a force press / 3D Touch on an app icon on an iPhone 7 running iOS 10.3. It was not possible on 10.2. Objective-C First you have to

Testing 3D touch with iOS Simulator

天大地大妈咪最大 提交于 2019-12-18 20:05:23
问题 Questions: I was wondering if anyone has tried 3D touch feature on a simulator or rather anyone know whether it actually works there or not. I know it's a hardware based feature and support is there only for latest iPhone 6S & iPhone 6S Plus models. On an iPhone 6S simulator, I have tried with Hardware --> Force Touch Pressure --> Deep Press but no gain. 回答1: you must develop on a device that supports 3D Touch. Simulator does not support 3D Touch,the documentation from apple, if you need the

iOS 9 selecting tabbar index with quick actions, performActionForShortcutItem

此生再无相见时 提交于 2019-12-12 06:06:37
问题 I have 5 tabs and want to go to a specific tab when user select a certain Quick Action. However, I've tried using notification center, referencing the master viewcontroller and referencing the tab in app delegate but none seems to work. The tabbar.selectedIndex method does get called but for some reasons the tab isn't changing when using quick action. @available(iOS 9.0, *) func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem,

Implement peek and pop to multiple UITableView in one UIViewController

匆匆过客 提交于 2019-12-12 04:43:30
问题 I have two UITableView in one ViewController and a UIView , and I'm trying to implement Peek and Pop but every time I register both the tables, it only works for the first table. Following is where I'm registering the UITableViews : if traitCollection.forceTouchCapability == UIForceTouchCapability.available { registerForPreviewing(with: self, sourceView: self.tableView2) registerForPreviewing(with: self, sourceView: self.tableView) } My viewControllerForLocation : if tableView.point(inside:

How to add custom images as UIApplicationShortcutIcon for UIApplicationShortcutItem?

谁说我不能喝 提交于 2019-12-10 19:08:43
问题 How to add custom images as UIApplicationShortcutIcon for UIApplicationShortcutItem ? which is similar like photos UIApplicationShortcutItem in Photos/Message app for most recent.Because all icon are Created an icon from a custom image.The provided image named will be loaded from the app's bundle and will be masked to conform to the system-defined icon style.So how can i get color image as UIApplicationShortcutIcon programmatically? 回答1: You can add short cut icons from app delegate also.Here