override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
var p = touches.anyObject().locationInview(self)
}
很多老教材都是这个方法来获取,touches.anyObject(), 可是最新的版本提示touches根本没有anyObject()这个方法了,怎么办呢?
1 | let p = (touches as NSSet).anyObject()?.locationInview(self) |
---|
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/164166.html原文链接:https://javaforall.cn