You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- One thing you can do is add a stackView in your cell, then add your text label inside said stackView, just pin everything to the edges and DON'T set the height constraint in neither of the elements, that should auto resize the cell accordingly, also I don't see it in your code, but I assume you are implementing the tableView.rowHeight = UITableViewAutomaticDimension in your didload() right?Samuel Chavez– Samuel Chavez2019-07-17 15:06:11 +00:00Commented Jul 17, 2019 at 15:06
- stackoverflow.com/questions/44766814/…Nathan– Nathan2019-07-17 15:08:06 +00:00Commented Jul 17, 2019 at 15:08
- I actually didn't, however, my 3 labels are in a stack view. I apologize for not adding that in the initial question. Also, the Automatic Dimension is not found on my XCode is this something new to swift 5? I'm currently using swift 4. Apologies again long time lurker first time actually answering a question I will edit the question to reflect this. @SamuelChavezHunter A.– Hunter A.2019-07-17 15:09:12 +00:00Commented Jul 17, 2019 at 15:09
- @HunterA. no automatic dimension it's not new to swift 5, you should be able to implement it, just change the "tableView" to the actual name of the tableView in your code and that should work, aside from that you just need to check your constraints the, as I said for automatic dimension to work you need to NOT set height constraints on the cells, here is a link that you'll find helpful raywenderlich.com/8549-self-sizing-table-view-cellsSamuel Chavez– Samuel Chavez2019-07-17 15:12:55 +00:00Commented Jul 17, 2019 at 15:12
- I've added tableView.estimatedRowheight as well as tableView.rowHeight = UITableView.automaticDimension and removed the Row Heights from the cells in the storyboard.Hunter A.– Hunter A.2019-07-17 15:13:08 +00:00Commented Jul 17, 2019 at 15:13
| Show 2 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. python-3.x), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-swift