How to implement the below objective-c init method in swift
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil withName:(NSString *)name {
if (self = [self initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
self.name = name;
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]];
}
return self;
}