Change storyboard UIImageView to own class with backgroundcolor
Posted
by
Thomas
on Stack Overflow
See other posts from Stack Overflow
or by Thomas
Published on 2014-08-25T10:16:08Z
Indexed on
2014/08/25
10:19 UTC
Read the original article
Hit count: 268
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:
© Stack Overflow or respective owner