Creating a Registration Page
Tinder Firestore Swipe and Match
Let's spend this entire lesson dedicating our time to building out the registration page. We'll be using a stack view again to make sure this page is perfectly centered into our screen. I'll show you a few tricks that help make our UITextField components align the left edge with certain padding. There's also a nice gradient that we can render as the background of this page.

Comments (13)
st4n
4 years ago
remember to override viewDidLayoutSubviews to handle device rotation :)
st4n
4 years ago
I just got an idea: maybe slightly different screen when the device is in landscape: selectPhotoButton on the left, and stackView with other fields on the right some kind of adaptive layout
Brian Voong
4 years ago
Paweł Liczmański
4 years ago
nice idea, that should looks very nice
Robin Bindewald
4 years ago
Hi Brian, i have a litten off Topic Question is there any disadvantage if i setup my UIElements in a separate class an call the like this: var fullNameTextField = AuthTextField() { didSet { fullNameTextField.placeholder = "Enter full Name" } } Is this fine or is there a more elegante way. Thank you in Advance.
Brian Voong
4 years ago
Robin Bindewald
4 years ago
Ok cool, thank you for your feedback and your help :)
Dennisvm82
4 years ago
Hey Brian, I have been using the generic object function you once mentioned on Twitter, but this won't let me initialize padding for any of the textfields in the custom textfield class. It's complaining about "Use of unimplemented initializer 'init(frame:)' for class". func createObject<T>(_ setup: ((T) -> Void)) -> T where T: NSObject { let object = T() setup(object) return object } let fullNameTextField: CustomTextField = createObject() { $0.placeholder = "Enter full name" $0.backgroundColor = .white $0.layer.cornerRadius = 25 }
Brian Voong
4 years ago
Paweł Liczmański
4 years ago
I really like the solution for textfield edge insets
Cinquain
4 years ago
Fire!
stonypig1
4 years ago
here we have select photo option same as inside for users, user can have multi photos to show, would you teach us how to select multi photos and upload them simultaneously to firestore ? (outside most tutors only show case one at a time, but in real app, it always multiple) thanks
李承諴
4 years ago
hi Brain Why we don't need to set .clipsToBounds or .maskToBounds to "true" when we set the .cornerRadius in this video
pushkar
4 years ago
Hey Brian, If we move super.init(frame: .zero) at the start of init block in CustomTextField class, then we run into compile time error. I was wondering why is that.. Xcode compile time errors are these: - Property 'self.padding' not initialized at super.init call - Immutable value 'self.padding' may only be initialized once
Brian Voong
4 years ago
pushkar
4 years ago
Oh alright
pushkar
4 years ago
Thanks!
simran5590
4 years ago
For People who are following this course on XCode 11 beta or XCode 11 and getting the new transition on RegistrationController you gotta set the `modalPresentationStyle' explicitly from now to get the old behaviour. ``` @objc func handleSettings(_ sender: UIButton) { print("Show registration Page") let registrationController = RegistrationViewController() registrationController.modalPresentationStyle = .fullScreen present(registrationController, animated: true) } ```
David Guarino
3 years ago
Thanks!
scholarDev
4 years ago
Here in intrinsicContentSize, the width is set to be 0. Then why is the width not 0 when the app is executed?
Brian Voong
4 years ago
majdjamaleddine@gmail.com
3 years ago
Hello Brian, a quick question, do you recommend declaring the the different text field views of the registration page in a separate RegistrationView file rather than in the RegistrationController file? thanks.
Brian Voong
3 years ago
buk
3 years ago
Hi Brian, are you talking about the App Store JSON API course? I am interested to learn how to hook up a view model with a seperate view file.
Omran_K
3 years ago
In Xcode 11, the AppDelegate trick to manually set the window and root view controller to has been moved to SceneDelegate.swift under func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let _ = (scene as? UIWindowScene) else { return } } Change _ to windowScene then add the following code after the guard statement window = UIWindow(frame: windowScene.coordinateSpace.bounds) window?.windowScene = windowScene window?.rootViewController = RegistrationController() window?.makeKeyAndVisible()
schmidtfx
3 years ago
Works fine with you solution, thank you Omran_K!
Guala
3 years ago
Thank you!
Michael Fitzgerald
2 years ago
Thanks, Omran I was confused on that
partha
2 years ago
Works great! Thank you
HELP & SUPPORT