Where to find iOS 8 variable touch API information

According to MacRumor ( http://www.macrumors.com/2014/06/17/pencil-stylus-pressure-ios-8/ ), iOS 8 will support a variable touch that simulates surface pressure. Where can I find its API? I searched the Apple Developer iOS Dev Center online library but could not find it.

+4
source share
2 answers

iOS 8 adds two new features to UITouch: majorRadius and majorRadiusTolerance. They work as follows:

override func touchesMoved(touches: NSSet!, withEvent event: UIEvent!) {
    var touch : UITouch = touches.anyObject() as UITouch
    var lowerBound = touch.majorRadius - touch.majorRadiusTolerance
    var upperBound = touch.majorRadius + touch.majorRadiusTolerance
    var average = (lowerBound + upperBound) / 2.0
    println("touch was between \(lowerBound)pt and \(upperBound)pt in size (avg \(average)")
}

Here you can find docs (you must be logged in from the moment of its preliminary release).

+5
source

( "!" )

override func touchesMoved(touches: NSSet, withEvent event: UIEvent) 

XCode Beta 1 SpriteKit. , Beta 2. (: ).

0

Source: https://habr.com/ru/post/1545914/


All Articles