Reputation: 1
im new to Xcode and this may be s stupid question and im sorry but i dont know how to fix it, every time begin typing
.transform = CGAffineTransformMakeRotation
, nothing automatically pops up allowing me to select it. Does anyone know what this problems is or how to fix it? thanks.
Upvotes: 0
Views: 49
Reputation: 63197
For performance, CoreGraphics types (like CGAffineTransform
) were made to be C structs rather than Objective C classes. C structs can't contain methods, constructors, etc. To simulate this, raw functions were made like CGAffineTransformMakeRotation
to perform operations on these structs.
Swift supports struct methods, so in Swift, these raw functions are imported as methods on the CGAffineTransform
struct. You're looking for CGAffineTransform(rotationAngle:)
Upvotes: 2