Subclassing UINavigationBar in Swift
I'm trying to create a custom UINavigationBar class and then use the Storyboard to set it as the class of my UINavigationController 's NavigationBar. Here's the code of my UINavigationBar class: class CustomNavBar: UINavigationBar { override func drawRect(rect: CGRect) { super.drawRect(rect) // Drawing code self.backgroundColor = UIColor.orangeColor() let myLabel = UILabel(frame: CGRect(x: 0, y: 4, width: 600, height: 36)) myLabel.backgroundColor = UIColor.purpleColor() myLabel.textColor = UIColor.yellowColor() myLabel.text = "Custom NavBar!" self.addSubview(myLabel) } } Then, in Interface