Unable to initialize


#1

i added an initializer in a class similar to below

class myClass: NSObject, KeychainStorable{

public init? (param1 : Object1){
}

public init? (param2 : Object2){
}

public init? (param1 : Object3, param2 String){
}

}

class UVContorller: UIViewController{
init(){
object2 = Object2
let myclass = myClass(param2: object2 )
}
}

I get the error

Argument labels ‘(param2:)’ do not match any available overloads

Id like to know why this is happening since the initializer was present


#2

Hi can you make the code complete so I can get a better understanding :slight_smile:


#3

I think you didn’t call super.init() in the UVController at the end of the init()


#4

Unfortunately i cannot send the whole code because it contains very sensitive information.


#5

The work around I did used a func instead of an init.


#6

Maybe you need to call the super initializer of the class KeychainStorable