I want to port ITSwitch from obj-c to swift. https://github.com/iluuu1994/ITSwitch.git
in ITSwitch.m
@property (readonly, strong) CALayer *rootLayer;
so in swift I write:
var rootLayer:CALayer?
but code give me this error:
Use of module 'CALayer' as a type
What's the error mean? How can I solve this?
If you add import QuartzCore
at the top of your .swift
file, the error will go away. The error message itself seems like a bit of a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With