optimize direction pad haptic feedback
This commit is contained in:
1 parent
e7132e3371
commit
644687a50c
1 file changed
+7
-8
@@ -914,19 +914,18 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func showLrudDirectionIndicator(with indicatorLayer:CAShapeLayer){
|
private func showLrudDirectionIndicator(with indicatorLayer:CAShapeLayer){
|
||||||
// Add the border layer below the super layer
|
|
||||||
indicatorLayer.isHidden = false
|
|
||||||
|
|
||||||
// show the indicator based on the touchBeganLocation
|
// show the indicator based on the touchBeganLocation
|
||||||
// indicatorLayer.position = CGPointMake(CGRectGetMinX(self.frame)+touchBeganLocation.x, CGRectGetMinY(self.frame)+touchBeganLocation.y)
|
|
||||||
indicatorLayer.position = touchBeganLocation
|
indicatorLayer.position = touchBeganLocation
|
||||||
|
|
||||||
if vibrationOn {
|
if indicatorLayer.isHidden {
|
||||||
vibrationGenerator.prepare()
|
indicatorLayer.isHidden = false
|
||||||
vibrationGenerator.impactOccurred()
|
if vibrationOn {
|
||||||
|
vibrationGenerator.prepare()
|
||||||
|
vibrationGenerator.impactOccurred()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func handleLrudTouchMove(){
|
private func handleLrudTouchMove(){
|
||||||
CATransaction.begin()
|
CATransaction.begin()
|
||||||
CATransaction.setDisableActions(true)
|
CATransaction.setDisableActions(true)
|
||||||
|
|||||||
Reference in new issue
Block a user