3dtouch

How do you localize static UIApplicationShortcutItems?

烈酒焚心 提交于 2019-12-03 08:16:38
问题 I have an application and I want to add a mix of static and dynamic app shortcut items. Localizing for dynamic items is pretty straightforward, using NSLocalizedString , but not so much with the items in your info.plist. I already have an InfoPlist.strings file for localizing the name of my application, but I am less sure about how static UIApplicationShortcutItems would work since these items do not have a unique key. How do you localize static UIApplicationShortcutItems? 回答1: Turns out that

Launching with UIApplicationShortcutItem

情到浓时终转凉″ 提交于 2019-12-03 06:28:08
问题 I'm implementing some 3D touch quick actions for my iOS 9 app in swift, and I have a curious issue. When my app is in the background and I launch with the quick action, everything goes as planned. When my app is totally dead (i.e. I killed it from the multitasking menu), and I launch with the quick action, the app crashes. I'm having trouble debugging this as once I kill the app, the debug session in Xcode gets detached. Is there a way for me to connect to the app to debug like normal, or is

3D touch/Force touch implementation

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 06:18:57
问题 How can we implement 3D touch to check if the user taps on UIView or force touch on UIView ? Is there a way to do this with UIGestureRecognize or only with UITouch ? 回答1: You can do it without a designated gesture recognizer. You do not need to adjust the touchesEnded and touchesBegan method, but simply the touchesMoved to obtain the correct values. getting the force of a uitouch from began/ended will return weird values. UITouch *touch = [touches anyObject]; CGFloat maximumPossibleForce =

How do you localize static UIApplicationShortcutItems?

橙三吉。 提交于 2019-12-02 21:56:37
I have an application and I want to add a mix of static and dynamic app shortcut items. Localizing for dynamic items is pretty straightforward, using NSLocalizedString , but not so much with the items in your info.plist. I already have an InfoPlist.strings file for localizing the name of my application, but I am less sure about how static UIApplicationShortcutItems would work since these items do not have a unique key. How do you localize static UIApplicationShortcutItems? Turns out that the app will search the InfoPlist.strings file for a corresponding key matching the value in the Info.plist

3D touch/Force touch implementation

不打扰是莪最后的温柔 提交于 2019-12-02 19:57:22
How can we implement 3D touch to check if the user taps on UIView or force touch on UIView ? Is there a way to do this with UIGestureRecognize or only with UITouch ? You can do it without a designated gesture recognizer. You do not need to adjust the touchesEnded and touchesBegan method, but simply the touchesMoved to obtain the correct values. getting the force of a uitouch from began/ended will return weird values. UITouch *touch = [touches anyObject]; CGFloat maximumPossibleForce = touch.maximumPossibleForce; CGFloat force = touch.force; CGFloat normalizedForce = force/maximumPossibleForce;

3D Touch Home Shortcuts In Obj-C

╄→尐↘猪︶ㄣ 提交于 2019-12-02 14:42:23
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)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *

iOS 3D Touch API using Javascript for Web App

限于喜欢 提交于 2019-12-02 04:41:46
The iPhones 6s has 3D touch API for native apps. I was wondering if Apple has enabled 3D touch access from Javascript for a web app? Just like we use standard touch events element.addEventListener("touchstart", handleStart, false); Safari 9 supports it on desktop. See Responding to Force Touch Events from JavaScript in Apple's WebKit DOM Programming Topics. I can't find any documentation on using it from Safari 9 on iOS, though. You CAN use force touch on BOTH iPhone and Mac. You can use the the JS library Pressure.js . It makes it really easy to get Force and 3D Touch values on iOS and OSX if

Swift SpriteKit 3D Touch and touches moved

僤鯓⒐⒋嵵緔 提交于 2019-12-02 00:49:27
I have recently send out a version of my game to TestFlight for internal testing. My friend noticed that on his iPhone 6S Plus the controls to shoot do not work correctly. The controls are as follow 1) left half of screen = jump 2) right half of screen = shoot 3) Slide and hold on right half of screen = start slow motion Now in my touches began method I have a slight delay for the shooting, so if touches moved is called it cancels the shooting and starts slow mo. This seems to be causing the problem on 3D Touch enabled phones. Digging further into this I came across this post iOS 9 Spritekit

iOS9系列专题一——3D Touch

拜拜、爱过 提交于 2019-12-02 00:44:40
新的触摸体验——iOS9的3D Touch 一、引言 在iphone6s问世之后,很多果粉都争先要体验3D Touch给用户带来的额外维度上的交互,这个设计之所以叫做3D Touch,其原理上是增加了一个压力的感触,通过区分轻按和重按来进行不同的用户交互。 二、在模拟器上学习和测试3D Touch 3D Touch是一个很新颖的设计,可是苹果文档有言: With Xcode 7.0 you must develop on a device that supports 3D Touch. Simulator in Xcode 7.0 does not support 3D Touch. 看到这句话心是不是凉了一半,是的,xcode7是支持3D Touch开发的,可是模拟器并不支持这个手势,我们只能在真机上进行学习与测试,但是在IT的世界,从来都不缺拯救世界的人物,github上有人为我们提供了这样的一个插件,可以让我们在模拟器上进行3D Touch的效果测试: git地址: https://github.com/DeskConnect/SBShortcutMenuSimulator 。 附.SBShortcutMenuSimulator的安装和使用 其实安装和使用并不需要怎么介绍,git主页里介绍的很清楚,这里在记录一遍,其中只有一点需要注意,如果你像我一样

3D Touch freezes my APP

早过忘川 提交于 2019-12-01 21:33:33
Maybe my problema is equals to: Force Touch animation freezes if gently touched App is freezing in 'peek and pop' implementation in iPhone 6s 1) Forces-touches without "bug": An UITransitionView layer is created to preview my View Controller. It works perfectly. 2) Forces-touches with "bug": When I gently tap over the button, the UITransitionView layer is created but its transparent (without content) and at this point I can't interact with my app (because the top layer is "empty"). UPDATE: Code: HomeViewController extension HomeViewController: UIViewControllerPreviewingDelegate { func