Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我第一次使用 Swift 的 stride。然而,第一个即将成为最后一个,因为我无法让它工作:
let boundingBox = createdShape.frame //=SKShapeNode stride(from: Int(boundingBox.minX), to: Int(boundingBox.maxX), by: 10) {
结果是:
无法使用类型为“(来自:Int,to:Int,by:Int,()->())”的参数列表调用“stride”
我究竟做错了什么?
语法应该是:
let boundingBox = createdShape.frame //=SKShapeNode for x in stride(from: Int(boundingBox.minX), to: Int(boundingBox.maxX), by: 10) { // TODO: Use x here. }