Custom Cell Background
Twitter Slide Out Menu
We're almost at the end of the course here, so why don't we wrap it up by performing the customization to our ChatroomMenuCell. We'll go ahead and change the background color when these cells are selected by add a custom background view. During selection, we can toggle the hidden property to make it show or hide. Enjoy.

Comments (4)
Dennisvm82
4 years ago
Hey Brian, do you know why adding "tableView.isScrollEnabled = false" affects the layout of the menu? It pushes the whole view up. I had the same problem last time, so the only solution for me was to increase the distance between the header and the tableView. Is there some kind of extra spacing somewhere when you set scrolling to false?
Brian Voong
4 years ago
jefflai
4 years ago
Hi Brian, If I had a set of background colors that I wanted to make for the overall app. Could I create a class GlobalColors as a separate file, then create a static variable in the MainController as a "Global" variable overside of the view controller and use that throughout the entire app so that I can always have the same colors easily accessible? So that means it would be accessible and easy to change. If I wanted to change to a new set of colors, I can just edit it from that one class. Would that be a bad idea? I know global variables are not to be used frequently. Thanks Brian! Jeff
Brian Voong
4 years ago
pawelcichonski
4 years ago
Before I used: class IndentedLabel: UILabel { override func drawText(in rect: CGRect) { let insets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16) super.drawText(in: rect.inset(by: insets)) } } Nice to know it can be in just one line: super.drawText(in: rect.insetBy(dx: 16, dy: 0) There isn't ever a day when I will ever finish learning this language.
romer_96p@hotmail.com
3 years ago
Is it possible to right align that hashtag?
romer_96p@hotmail.com
3 years ago
Instead of being at the left side of the cell
Brian Voong
3 years ago
romer_96p@hotmail.com
3 years ago
Cool thanks
HELP & SUPPORT