{"action":"closed","issue":{"url":"https://api.github.com/repos/smileyborg/TableViewCellWithAutoLayoutiOS8/issues/22","labels_url":"https://api.github.com/repos/smileyborg/TableViewCellWithAutoLayoutiOS8/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/smileyborg/TableViewCellWithAutoLayoutiOS8/issues/22/comments","events_url":"https://api.github.com/repos/smileyborg/TableViewCellWithAutoLayoutiOS8/issues/22/events","html_url":"https://github.com/smileyborg/TableViewCellWithAutoLayoutiOS8/issues/22","id":66324921,"number":22,"title":"Two multi-line labels","user":{"login":"Isuru-Nanayakkara","id":2551877,"avatar_url":"https://avatars.githubusercontent.com/u/2551877?v=3","gravatar_id":"","url":"https://api.github.com/users/Isuru-Nanayakkara","html_url":"https://github.com/Isuru-Nanayakkara","followers_url":"https://api.github.com/users/Isuru-Nanayakkara/followers","following_url":"https://api.github.com/users/Isuru-Nanayakkara/following{/other_user}","gists_url":"https://api.github.com/users/Isuru-Nanayakkara/gists{/gist_id}","starred_url":"https://api.github.com/users/Isuru-Nanayakkara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isuru-Nanayakkara/subscriptions","organizations_url":"https://api.github.com/users/Isuru-Nanayakkara/orgs","repos_url":"https://api.github.com/users/Isuru-Nanayakkara/repos","events_url":"https://api.github.com/users/Isuru-Nanayakkara/events{/privacy}","received_events_url":"https://api.github.com/users/Isuru-Nanayakkara/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-04T14:19:28Z","updated_at":"2015-04-05T21:15:42Z","closed_at":"2015-04-05T21:15:42Z","body":"Hi,\r\n\r\nI'm faced with this strange issue. I have a prototype UITableViewCell with two UILabels with both of their no. of lines set to 0 and all the necessary constraints are added .\r\n\r\n![screen shot 2015-04-04 at 7 35 09 pm](https://cloud.githubusercontent.com/assets/2551877/6992945/bf9a2d60-db01-11e4-8a09-8324fa5d571c.png)\r\n\r\nHere are the Content hugging and content compression resistance priorities.\r\n\r\n* Top label\r\n\r\n![screen shot 2015-04-04 at 7 36 03 pm](https://cloud.githubusercontent.com/assets/2551877/6992948/fb9312a0-db01-11e4-9326-7597cd0ffa29.png)\r\n\r\n* Bottom label\r\n\r\n![screen shot 2015-04-04 at 7 37 52 pm](https://cloud.githubusercontent.com/assets/2551877/6992953/20349b4c-db02-11e4-9e05-593065b907ae.png)\r\n\r\nAnd here is the code.\r\n\r\n```\r\nimport UIKit\r\n\r\nclass TableViewController: UITableViewController {\r\n\r\n    override func viewDidLoad() {\r\n        super.viewDidLoad()\r\n        configureTableView()\r\n    }\r\n    \r\n    private func configureTableView() {\r\n        tableView.rowHeight = UITableViewAutomaticDimension\r\n        tableView.estimatedRowHeight = 90\r\n    }\r\n    \r\n    private func eventCellAtIndexPath(indexPath: NSIndexPath) -> EventCell {\r\n        let cell = tableView.dequeueReusableCellWithIdentifier(\"EventCell\") as EventCell\r\n        cell.nameLabel.text = \"(Monrovia) Brennan, Cathleen Andresson Carlsson\"\r\n        cell.addressLabel.text = \"176 N, Sunset Pl, Monrovia, CA, United States 91016\"\r\n\r\n        return cell\r\n    }\r\n    \r\n    // MARK: - Table view data source\r\n    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {\r\n        return 10\r\n    }\r\n\r\n    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {\r\n        return 1\r\n    }\r\n    \r\n    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {\r\n        return eventCellAtIndexPath(indexPath)\r\n    }\r\n}\r\n```\r\n\r\nEven though their is no auto layout issue, when I run the app this is how the content is displayed. \r\n\r\n![1](https://cloud.githubusercontent.com/assets/2551877/6992980/6f4c0930-db03-11e4-83ce-3079069a46fb.png)\r\n\r\nAs you can see the first label is getting cropped!\r\n\r\nI faced this same issue a few months back and your [answer](http://stackoverflow.com/a/25967370/1077789) helped me to resolve it. But doing the same here doesn't seem to work.\r\n\r\n```\r\nprivate func eventCellAtIndexPath(indexPath: NSIndexPath) -> EventCell {\r\n    let cell = tableView.dequeueReusableCellWithIdentifier(\"EventCell\") as EventCell\r\n    cell.nameLabel.text = \"(Monrovia) Brennan, Cathleen Andresson Carlsson\"\r\n    cell.addressLabel.text = \"176 N, Sunset Pl, Monrovia, CA, United States 91016\"\r\n    \r\n    cell.nameLabel.preferredMaxLayoutWidth = CGRectGetWidth(cell.nameLabel.frame)\r\n    cell.addressLabel.preferredMaxLayoutWidth = CGRectGetWidth(cell.addressLabel.frame)\r\n    return cell\r\n}\r\n```\r\n![2](https://cloud.githubusercontent.com/assets/2551877/6992984/78e072e2-db03-11e4-8d17-fd1d1a787424.png)\r\n\r\nWhy do you think this is happening? \r\n\r\nI uploaded a demo project to my [Dropbox](https://www.dropbox.com/s/h1ibimtsmkg80ik/DynamicCellHeight.zip?dl=0)."}}