Apologies
You must be signed in to watch this lesson.
Settings Header Image Buttons
Tinder Firestore Swipe and Match
With our user signed in, we can now present a page where they can edit specific profile settings for the application. In this lesson, we'll simple knock out the UI first and make sure everything is in working order. Presenting all of this information in a UITableViewController is very efficient and we get keyboard management for free. I'll present some tricks to easily set up our image selecting buttons in the header using a CustomImagePickerController.

Comments (14)
st4n
5 years ago
"..let's pop that sucker in here..." :)
flashtrend
5 years ago
Hey Brain, awesome videos, really enjoying them. Can you please show us how to swipe between pages like how the actual Tinder app works rather then tapping the profile button.
ayon
5 years ago
Hey brain, just wanted to ask was there any special reason to use tableView.tableFooterView = UiView() instead of tableView.separatorStype = .none to get rid of the separators. And would it be any different if I use ImageViews instead of buttons to show the selected photos in the settings Controller?
Brian Voong
5 years ago
ayon
5 years ago
Tx for the feedback, Brian!
benpalmer661
5 years ago
Hi Brian i'm getting the error UIImage?' is not convertible to 'UIImage' on the line let selectedImage = info[.originalImage] as? UIImage
johnrm9
5 years ago
Hi Brian Another way to get rid of the separator lines (like tableView.tableFooterView = UIView()) in viewDidLoad ... is tableView.separatorStyle = .none
tennydesign
5 years ago
Ha! No wonder you are feeling the burn man, this thing is two times faster than your early work. Mind-bending coding speed. =)
dtb_100
5 years ago
Where did you get the anchor function for the image1Button.anchor
aroland
5 years ago
Second lecture (07:35) or https://www.youtube.com/watch?v=iqpAP7s3b-8
Kimleng Hor
5 years ago
Hello Brian, would you mind explaining me about the lazy var?
Brian Voong
5 years ago
aroland
5 years ago
What exactly would you like to know? "lazy var" is the beginning of the lazy stored property declaration. This is a kind of property that is not initialized during object creation process but rather when it is needed for the first time. This behavior is useful for example in case of UIViewController when you would like to create in code a button and store it as an instance property: class ViewController: UIViewController { lazy var button: UIButton = { let button = UIButton(type: .system) button.addTarget(self, action: #selector(handleTap), for: .touchUpInside) return button }() @objc func handleTap() {} } If you try to run this code as a regular let/var property, there will be compilation error, because "self" in (button.addTarget method call) hasn't been created yet. When "self" may be considered as created? - during initialization process (init() call) And now... regular stored properties are initialized first. Even prior to initializers ("self" doesn't exist - compilation error). Whereas lazy properties, as I said, are initialized when needed for the very first time. This can be at least in initializer or anytime later ("self" exists - no compilation errors). I hope this helped. Brian, could you add some code formatting / syntax highlighting options to this message boxes? :D
Brian Voong
5 years ago
Cinquain
5 years ago
Fire!
Cinquain
5 years ago
That video is fire!
Kenny Ho
5 years ago
So many cool tips! That helper function to create multiple buttons with the same style saved me so many lines of code.
pushkar
5 years ago
Hi Brian, What's best practice to setup UI? init block for vc? or viewDidLoad block of vc?
Brian Voong
5 years ago
Zach Wilcox
5 years ago
Is there a way to use imageviews instead of buttons when selecting multiple images? Asking for a friend
majdjamaleddine@gmail.com
4 years ago
Hi Brian, It might seem obvious but how does handleSelectPhoto(button: UIButton) recognizes that this is image1Button or image2Button or image3Button? Is it the selector that identifies the button from which the handleSelectPhoto is called from? Thank you
aymather
3 years ago
In case anybody runs into the problem of your `present()` function displaying your SettingsViewController() as a modal, instead of presenting it full screen, you can change the setting like this. ``` let vc = SettingsViewController() vc.modalPresentationStyle = .fullScreen present(vc, animated: true) ```
HELP & SUPPORT