Izzy
Izzy

Reputation: 192

XCode 6 storyboards - how do I create a header for every scene?

In XCode 6, how do I create a 'header' that will place a logo in the same position on each new scene that I create, that I can re-use across different scenes? I only want to place the header on some of my scenes but not others.

Upvotes: 0

Views: 139

Answers (2)

larva
larva

Reputation: 5148

create a BaseViewController and customize a 'header' in viewDidLoad. Every scene need a 'header' will inherit from BaseViewController, other scenes are not

Upvotes: 1

Brian Daneshgar
Brian Daneshgar

Reputation: 343

You can create a UIImageView programmatically:

let logo = UIImage(named: "logo.png")
let header = UIImageView(image: logo!)
header.frame = CGRect(x: 0, y: 0, width: 100, height: 200)
view.addSubview(header)

Upvotes: 0

Related Questions