Change storyboard UIImageView to own class with backgroundcolor
- by Thomas
I want to draw the background image on my own, so I decided to implement a UIImageView class and connect it in the Storyboard.
As first task I just want to set the backgroundcolor of the image on my own, but it's never shown. Image just stays blank.
That's the class:
class FirstBackgroundImage : UIImageView {
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.backgroundColor = UIColor.redColor()
}
override init() {
super.init()
self.backgroundColor = UIColor.redColor()
}
override required init(image: UIImage!) {
super.init(image: image)
self.backgroundColor = UIColor.redColor()
}
}
That's how i connected it: