ios – CGPointMake in Swift

前端之家收集整理的这篇文章主要介绍了ios – CGPointMake in Swift前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何在 Swift中使用CGPointMake?有相当的吗?我收到一个错误

Use of unresolved identifier ‘CGPointMake’

基本上,我正在为Sprite Kit节点分配一个位置,并且无法弄清楚如何在Swift中执行此操作.

class PlayerSpaceship: Spaceship {

    func launchMissile() {

        var missile = Missile.playerMissile()

        // This line gives above mentioned error.    
        missile.position = CGPointMake(0.0,0.0) 
    }
}

解决方法

使用CGPoint(x:Float,y:Float)
原文链接:https://www.f2er.com/iOS/335495.html

猜你在找的iOS相关文章