I'm trying to display rows containing a thumbnail and a title.
It works great for short title strings, but for long strings, it breaks. Rather than expanding horizontally, I would prefer it to expand vertically. Checkout the screenshot below to see what happens when a long string is used. I'm using PureLayout to manage Auto Layout:
thumbnailView.autoSetDimensions(to:CGSize(width: 75, height: 75))
thumbnailView.autoPinEdge(toSuperviewEdge: .leading, withInset: kLabelHorizontalInsets)
thumbnailView.autoPinEdge(toSuperviewEdge: .top, withInset: kLabelVerticalInsets)
thumbnailView.autoPinEdge(toSuperviewEdge: .bottom, withInset: kLabelVerticalInsets, relation: .greaterThanOrEqual)
titleLabel.autoPinEdge(.leading, to: .trailing, of: thumbnailView, withOffset: kLabelHorizontalInsets, relation: .lessThanOrEqual)
titleLabel.autoPinEdge(toSuperviewEdge: .top, withInset: kLabelVerticalInsets)
titleLabel.autoPinEdge(toSuperviewEdge: .trailing, withInset: kLabelHorizontalInsets)
titleLabel.autoPinEdge(toSuperviewEdge: .bottom, withInset: kLabelVerticalInsets)
The appropriate settings on the UITextLabel are also set:
titleLabel.lineBreakMode = .byWordWrapping
titleLabel.numberOfLines = 0
titleLabel.textAlignment = .left