In Objective-C, NSObject
had a class method called load
that gets called when the class is loaded for the first time. What is the equivalent in Swift?
@implementation MyClass
+ (void)load
{
[self registerClass];
}
@end
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…