Closed appleios closed 8 years ago
In swift we can create structs:
struct Person { var name: String var familyName: String }
and get an initilizer for free:
let adam = Person(name: "Adam", familyName: "Smith")
In objc we have to create a class of kind:
@interface Person : NSObject @property (strong, nonatomic) NSString *name; @property (strong, nonatomic) NSString *familyName; - (instancetype)initWithName:(NSString*)name familyName:(NSString*)familyName; @end @implementation Person - (instancetype)initWithName:(NSString*)name familyName:(NSString*)familyName; { self = [super init]; if(self) { _name = name; _familyName = familyName; } } @end
Is it possible to create a template for generamba for generation of this kind of swift-struct like classes for ObjC, for example, like this:
generamba gen objcstruct Person name:String familyName:String
@appleios Yes, it's possible.
In swift we can create structs:
and get an initilizer for free:
In objc we have to create a class of kind:
Is it possible to create a template for generamba for generation of this kind of swift-struct like classes for ObjC, for example, like this: