swift怎么重写父类的init方法

我想重写UITextFiled的方法,在init(frame)上加一个参数,init(frame:CGRECT,uiviewcontroller:UIViewController)请问如何重写

重写是相同方法的不同实现,参数不同方法就不同了,楼主是想重载,如下两个例子可以清晰表现用法和区别:

例如UIView重写父类的init(frame: CGRect)方法:
override init(frame: CGRect) {
super.init(frame: frame)
//do something what you want
}
重写的话swift规定不可以缺少这个request init方法:(编译器会自动提示)
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
fatalError("init(coder:) has not been implemented")
}

重载父类的init(frame: GCRect),增加一个新参数:
init(frame: CGRect, type: String) {
super.init(frame: frame)
//do something what you want
print(type)
}

最后附上截图:
图片说明

init(参数) {
super.init(nibName: nil, bundle: nil)
// TODO
}

required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}

    Swfit 4