ios8 - Where to find information on iOS 8 variable touch sizing API -
according macrumor (http://www.macrumors.com/2014/06/17/pencil-stylus-pressure-ios-8/) ios 8 back upwards variable touch sizing simulating surface pressure. can find api? searched apple developer ios dev center online library, couldn't find it.
ios 8 adds 2 new properties on uitouch: majorradius , majorradiustolerance. work this:
override func touchesmoved(touches: nsset!, withevent event: uievent!) { var touch : uitouch = touches.anyobject() uitouch var lowerbound = touch.majorradius - touch.majorradiustolerance var upperbound = touch.majorradius + touch.majorradiustolerance var average = (lowerbound + upperbound) / 2.0 println("touch between \(lowerbound)pt , \(upperbound)pt in size (avg \(average)") }
you can find docs here (need logged in since it's pre-release).
ios ios8
No comments:
Post a Comment