How to convert CGPoint in NSValue in swift?

前端 未结 5 1690
北海茫月
北海茫月 2020-12-11 00:34

As my question title says how can I convert CGPoint into NSValues so I can store then Into array In swift.

In objective-C

5条回答
  •  悲&欢浪女
    2020-12-11 01:00

    swift 3

    let pointObj =  NSValue(cgPoint: CGPoint(x:9, y:9))
    

    https://developer.apple.com/reference/foundation/nsvalue/1624531-init

提交回复
热议问题