Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView initializer swift Xcode 6 beta 5 [duplicate]

Tags:

ios

swift

xcode6

xcode 6 beta 5

Error:

Class 'ClassName' does not implement its superclass's required members

on

    class ClassName:UIView

also showing an error

on

        init(frame: CGRect) {
            super.init(frame: frame)
            // Initialization code
            self.backgroundColor = UIColor.clearColor()
        }

Overriding declaration required an 'ovveride' keyword

I placed override before init, ovveride error was remove but superclass error was not

thanks in advance

like image 480
Muhammad Raza Avatar asked Feb 07 '26 17:02

Muhammad Raza


1 Answers

in Xcode6 beta5 the -init(coder:) has became a required method to be overridden:

 class ClassName: UIView {

    required init(coder aDecoder: NSCoder!) {
        super.init(coder: aDecoder)
        // ...
    }

    //

    override init(frame: CGRect) {
        super.init(frame: frame)
        // ...
    }

}
like image 155
holex Avatar answered Feb 09 '26 08:02

holex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!