I have a UIScrollView. Right now I'm just setting it to double the height of the screen (the frame in this case is just UIScreen.mainScreen().bounds ):
class VenueDetailView: UIScrollView { required init?(coder aDecoder: NSCoder) { fatalError("Storyboard makes me sad.") } override init(frame: CGRect) { super.init(frame: frame) contentSize = CGSize(width: frame.width, height: frame.height*2) <---------------- backgroundColor = UIColor.greenColor() } func addBannerImage(imageUrl: NSURL) { let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: 300))
However, I just want it to be the size of all the contents inside it. How can I do it? Does this mean that I have to set contentSize after adding all subzones?
source share