let address = UITextView(frame: CGRectZero) address.text = restaurant.address let sizeThatFits = address.sizeThatFits(CGSize(width: view.frame.width, height: CGFloat(MAXFLOAT))) mainView.addSubview(address) address.snp_makeConstraints { (make) -> Void in let superview = mainView make.top.equalTo(superview.snp_top) make.left.equalTo(superview.snp_left) make.right.equalTo(superview.snp_right) make.height.equalTo(sizeThatFits) }