I am trying to add an init() ins swift so I can allocate PTKView at the top of the class so I can use it throughout my code.
I can create var PAymentVIew : PTKView in a function and it works fine but obviously not global.
So I created this at the top of the class :
class PaymentViewController: UIViewController , PTKViewDelegate {
var PaymentView : PTKView
var button = UIButton.buttonWithType(UIButtonType.System) as UIButton
init(PaymentView : PTKView , button : UIButton) {
self.PaymentView = PaymentView
self.button = button
}
All I get at the moment is an horrible error saying :
required initialiser 'init(coder)' must be provided by subclass of UIViewController.
Any ideas at all would be brilliant.