I want to store my CGPoint to the NSMutable Array, so , I have method like this:
[self.points addObject:CGPointMake(x, y)];
But I got the error
Swift 3.x // Convert CGPoint to NSValue
let cgPoint = CGPoint(x: 101.4, y: 101.0) let nsValue = NSValue(cgPoint: cgPoint) var array = NSArray(object: nsValue)
// Restore it again
var cgPoint : CGPoint! for i in array { cgPoint = i as? CGPoint }