Silver Challenge: Long Item Names

Currently, if the item’s name is long it will overlap with the value label (Figure 10.11). This will be more important in Chapter 11 and Chapter 12 when you will add the ability for the user to edit an item. To see this for now, update Item’s initializer in Item.swift to have an extra-long name.

Figure 10.11  Labels overlapping on the cell

Labels overlapping on the cell

Fix this problem by allowing the nameLabel to wrap to multiple lines if the name gets too long (Figure 10.12). You will need to add at least one new constraint and allow the label to wrap multiple lines as you did in Chapter 7.

Figure 10.12  Cell with wrapping item name

Cell with wrapping item name
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset