In CABasicAnimation.fromValue
I want to convert a CGPoint
to a \"class\" so I used NSValue
valueWithPoint
but in device m
If you are using a recent-ish version of Xcode (post 2015), you can adopt the modern Objective-C syntax for this. You just need to wrap your CGPoint in @()
:
CGPoint primitivePoint = CGPointMake(4, 6);
NSValue *wrappedPoint = @(primitivePoint);
Under the hood the compiler will call +[NSValue valueWithCGPoint:]
for you.
https://developer.apple.com/library/archive/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObjective-C/AdoptingModernObjective-C.html