I am moving from objective-C to Swift.
Header file:
@interface RegisterType : NSObject
{
Class type;
NSString *typeName;
NSString *namespace;
int typeId;
}
@property (nonatomic,retain) Class type;
@property (nonatomic,retain) NSString *typeName;
@property (nonatomic,retain) NSString *namespace;
@property (nonatomic) int typeId;
@end
and the implementation was:
@implementation RegisterType
@synthesize type;
@synthesize typeName;
@synthesize namespace;
@synthesize typeId;
Now Swift is my code:
class RegisterType {
var typeName: String = ""
var namespace: String = ""
var typeId: Int = 0
}
My main problem is that I want to replace the generic type โclassโ that I used in objective-C. How to replace it in Swift? Do I need an init method?
source
share