IvanPavliuk IvanPavliuk - 2 months ago 25
Swift Question

Hello! I want to create constructor for my class and I have an error: Super.init isn't called on all paths before returning from initializer swift

class MyPicker: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource {

var pickerContent: [String] = [""]
var textField = UITextField()

var form: Form!

init(form: Form, content: [String]) {
self.form = form
self.pickerContent = content

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


Lu_ Lu_


super.init(frame: CGRectZero)

in your init, class need to init it's super class