I want to have a custom UITableViewCell with the number of vertically arranged UILabel , all of which can contain text that wraps multiple lines. With the new UIStackView in iOS9 and the cell self-tuning mechanism, I thought it would be easy, but I can't get it to work. I am using Xcode 7beta3.

I created a simple test application. This is the setting in IB:

UIStackView is vertical with UIStackViewDistribution.Fill and UIStackViewAlignment.Fill , but I basically tried all the combinations without success.
UILabel have numberOfLines = 0 and lineBreakMode = .ByWordWrapping .
The code:
class Cell: UITableViewCell { @IBOutlet var label1: UILabel! @IBOutlet var label2: UILabel! } class MasterViewController: UITableViewController { struct Data { let label1: String let label2: String } var objects = [Data]() override func viewDidLoad() { super.viewDidLoad() tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 60 createData() } private func createData() { for ii in 0 ..< 20 { let data = Data(label1: "\(ii): hello world this is a longer string that should wrap without going weird", label2: "label2 has lots of writing as well and so should wrap onto multiple lines") objects.append(data) } }
I wonder if there is a bug in the beta version, because sometimes one of the tags is wrapped, and the other is not.
For example, I tried to insert a UIStackView into another UIStackView as follows:

I have not made any code changes. Now one shortcut is wrapped, and the other is not:

Any help would be greatly appreciated!
source share