Apologies
You must be signed in to watch this lesson.
With our settings UI slowly starting to take form, let's now go in and add the individual rows for each item that a User can modify for their profile. This lesson will cover the basics of using Sections and Rows to layout your SettingsController views very easily. In addition, we'll go over some very useful techniques of subclassing UIKit components to suit our design needs. Enjoy.

Comments (12)
jsayer7
5 years ago
Hey Brian, it seems the chapter before this one is not yet published. It looks like it is, but the video doesn't start.
Brian Voong
5 years ago
jsayer7
5 years ago
Thank you sir! Love the content so far.
st4n
5 years ago
It would be really cool to have Bio TextField with the dynamic height :)
Brian Voong
5 years ago
st4n
5 years ago
wow, quick reply :) another question: is there a way to make this code more universal (maybe based on some kind of enum)? If i want to add for example the shoe size or whatever. Right now, we have to remember do add cases to 2 functions (what if there were more of them).
st4n
5 years ago
(after thought) ...and if it (stuff i wrote earlier) could be done universally maybe we can use MVVM - tableView with multiple cellViewModels generated "dynamically" depending on the content and content layout (textField, label - slider, maybe datePicker for the age property). Do you think you can show/teach us something like that? :)
Brian Voong
5 years ago
st4n
5 years ago
you are the Sensei here, I'm just asking questions :) ps. @dynamic height I added the textView on top of the textField, set it to hidden, then in cellForRowAt in switch I'm removing it from superview in all the cells but the last one (to be able to use custom height). But it makes the content scrollable only within the cell height...
st4n
5 years ago
I meant I am just a small, humble (most of the time) padawan, haahahahha :)
Brian Voong
5 years ago
st4n
5 years ago
ok, no problem :) maybe (as I wrote somewhere else) this kind of stuff can become the material for another course.
Tube
5 years ago
Small point: You use your switch default to show the last header value. I think the default should be used to indicate a problem, e.g. "Unknown Header Type".
Tokyojogo
5 years ago
Hi Brian, Great tutorial. I have a question though, is it good practice to just leave the custom classes inside the view/controller files? If not, are we suppose to make a file for each one? In the settingsController file, the CustomeImagePicker is outside of the main class declaration while the custom header is inside. Why and what is the difference in setting it like that? Thank you.
Brian Voong
5 years ago
Igor Tkach
5 years ago
I've just find shorter solution for textRect and editingRect! textField.fillSuperview(padding: UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 0))
Kenny Ho
5 years ago
Shifu Brian, I have a question regarding custom class. For the textfield, why did you make a custom class for the cell. Wouldnt it be the same if you just make it as tf.heightAnchor.constraint(equalToConstant:44).isActive = true. I see people do custom classes but I never fully understood why.
Brian Voong
5 years ago
Kenny Ho
5 years ago
What I mean is that you created a SettingsTextField subclass and used intrinsicContentSize. Instead of doing that, I did added a height anchor within the textField instance property. Why did you make a SettingsTextField subclass?
Kenny Ho
5 years ago
I got the same result. That's why I was curious. SettingsTextField added more lines to the code base. You must've had a reason. I just dont understand the reason yet.
Brian Voong
5 years ago
Kenny Ho
5 years ago
oh I see. Thank you for your explanation!
diegogarciar
5 years ago
Hey Brian, Why didn't you register the SettingsCell for later dequeuing?
diegogarciar
5 years ago
Is it because we have a static and small number of cells?
Brian Voong
5 years ago
max.nabokow
4 years ago
Brian, Is there a reason why you didn’t just use titleForHeaderInSection instead of creating the titleLabel header view?
Brian Voong
4 years ago
max.nabokow
4 years ago
Hm, it interestingly looks the exact same using that method. ☺️
Cinquain
4 years ago
Brian is lit!
David Guarino
4 years ago
I'm going over this lesson and converting this with your LBTA tools. So far so good just don't know if I'm going down a rabbit hole or seeing the light . Would make a great YouTube video tutorial
Brian Voong
4 years ago
David Guarino
4 years ago
Great to hear!....Suggestion if possible....You think adding "corner radius" and "content mode" in the LBTA buttons and image view as added attributes to the ones you have already in there?
Ally Makongo
4 years ago
This is nice!. I can even customise header section with the custom cell. :)
Dino32
3 years ago
Hi, Brian. I've got strange effect in Xcode 12, IOS 14. I've added text field inside the cell and see the placeholder on the screen, but I can't enter the text. Could you help and tell where is might be a problem?
Dino32
3 years ago
Hi again! I've found the problem. In new version of swift we have to add one more string of code like contentView.isUserInteractionEnabled = true in super init.
HELP & SUPPORT