Class 'ViewController' Has No Initializers In Swift
Answer : The error could be improved, but the problem with your first version is you have a member variable, delegate , that does not have a default value. All variables in Swift must always have a value. That means that you have to set it up in an initializer which you do not have or you could provide it a default value in-line. When you make it optional, you allow it to be nil by default, removing the need to explicitly give it a value or initialize it. The Swift Programming Language states: Classes and structures must set all of their stored properties to an appropriate initial value by the time an instance of that class or structure is created. Stored properties cannot be left in an indeterminate state. You can set an initial value for a stored property within an initializer, or by assigning a default property value as part of the property’s definition. Therefore, you can write: class myClass { var delegate: AppDelegate //non-optional variable...