As far as iOS languages go I really only know Swift, but I'm trying to learn how to translate from Objective C. I'm doing ok at it (helps that I know C#) and using this as a guide for translation but I'm getting stumped at certain points that aren't in the guide.
For instance, from this tutorial, trying to translate these instructions makes absolutely no sense to me:
Open up the newly added header CERangeSliderKnobLayer.h and replace its contents with the following:
#import <QuartzCore/QuartzCore.h>
@class CERangeSlider;
@interface CERangeSliderKnobLayer : CALayer
@property BOOL highlighted;
@property (weak) CERangeSlider* slider;
@end
What would this look like in Swift?
I know how to import QuartzCore
but the rest...
What is @Class
in Swift?
What is @interface?
I kind of get what @property
is now, I'm guessing for that I just do this:
var highlighted: bool
weak var slider: CERangeSlider
I mean, currently my newly created class looks like this:
import UIKit
import QuartzCore
class CERangeSliderKnobLayer: CALayer {
}
Where would all that go? Inside the class I assume. Especially the property settings.