samedi 25 avril 2015

UIBezierPath Subclass Initaliser


I'm trying to create a subclass of UIBezierPath to add some properties that are useful to me.

class MyUIBezierPath : UIBezierPath {
   var selectedForLazo : Bool! = false

   override init(){
       super.init()
   }

   /* This doesn't work */
   init(rect: CGRect){
       super.init(rect: rect)
   }

   /* This doesn't work */
   init(roundedRect: CGRect, cornerRadius: CGFloat) {
       super.init(roundedRect: roundedRect, cornerRadius: cornerRadius)
   }

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

I don't understand how to call a designated initializer without losing information ( e.g call every time super.init() )

Can you help me please?


Aucun commentaire:

Enregistrer un commentaire