 
 class FrameBasedLayoutViewController: UIViewController {
     
-    let button = UIButton(type: .System)
-    let secondButton = UIButton(type: .System)
-    let bodyText = UILabel()
-    let profile = UIImageView()
+    let userNameLabel = UILabel()
+    let commentLabel = UILabel()
+    let profileImage = UIImageView()
+    let infoButton = UIButton(type: UIButtonType.InfoLight)
     
     override func loadView() {
         self.view = UIView(frame: UIScreen.mainScreen().bounds)

    
    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
        setupSubviews(size)
    }
    
    override func viewDidLoad() {
        self.navigationItem.title = "Frames"
        super.viewDidLoad()
        
        button.setTitle("Alfinator hello", forState: .Normal)
        secondButton.setTitle("Strange Things", forState: .Normal)
        bodyText.text = "What if UILabel decides to add support for special borders, or configurable line heights, or some other visual effects."
        bodyText.numberOfLines = 0
        profile.backgroundColor = UIColor.blackColor()
        
        view.addSubview(button)
        view.addSubview(secondButton)
        view.addSubview(bodyText)
        view.addSubview(profile)
        
        view.backgroundColor = UIColor.whiteColor()
        
        setupSubviews(view.bounds.size)
        
        print(view.bounds.size)
    }

        super.viewDidAppear(animated)
    }
    
    func configureView(size: CGSize) {
        
        let imageSideLength: CGFloat = 48
        let margin: CGFloat = 8
        let availableTextWidth: CGFloat = size.width - (margin * 3) - imageSideLength
        let commentLabelSize = commentLabel.sizeThatFits(CGSize(width: availableTextWidth, height: CGFloat.max))
        let userNameLabelSize = userNameLabel.sizeThatFits(CGSize(width: availableTextWidth, height: CGFloat.max))
        
        profileImage.frame = CGRect(
            x: margin,
            y: 64 + margin,
            width: imageSideLength,
            height: imageSideLength)
        
        userNameLabel.frame = CGRect(
            x: profileImage.frame.maxX + margin,
            y: profileImage.frame.minY,
            width: ceil(userNameLabelSize.width),
            height: ceil(userNameLabelSize.height))
        
        commentLabel.frame = CGRect(
            x: profileImage.frame.maxX + margin,
            y: userNameLabel.frame.maxY + 4,
            width: ceil(commentLabelSize.width),
            height: ceil(commentLabelSize.height))
        
        infoButton.frame = CGRect(
            x: profileImage.frame.maxX + margin,
            y: commentLabel.frame.maxY + margin,
            width: infoButton.frame.width,
            height: infoButton.frame.height)
    }

    override func didReceiveMemoryWarning() {
