I have an Objective-C class which looks like this:
@interface CustomObjectHavingData : NSObject
@property (nonatomic, strong) NSData *objWithData;
- (instancetype)initWithObjHavingData;
@end
and implementation like this
@implementation CustomObjectHavingData
- (instancetype)initWithObjHavingData{
if (self = [super init]) {
NSString *str = @"This is simple string.";
self.objWithData = [str dataUsingEncoding:NSUTF8StringEncoding];
}
return self;
}
@end
Now I want to call this initWithObjHavingData in Swift
var objData = CustomObjectHavingData()
This returns nil to me. Please help how I can call the above init method here.