Комментарии:
Thank you, Brian, for your great work!
ОтветитьI am using xcode8.1 and swift 3 and self.dismiss(animated: true, completion: nil) method is not working in handleLogin() and handleRegister() methods . Can you tell me what will be the problem?
ОтветитьI still do not get it why we need lazy var for loginRegisterSegmentedControl variable in the code after seeing the video for lazy var explanation. Would you give me a brief explanation that why we need lazy var in this case? Thank you!
Ответить// user is not logged in
if Auth.auth().currentUser?.uid == nil {
logOut()
}
what are all these things mean? guys? It's in the viewDidLoad()
Dude thank you for explaining it all in code. It shows me that doing it in code is much less daunting than I thought. I appreciate all your help
ОтветитьHi, Great Video!!! If I switch to my iPad Pro, and even iphone 7 plus, my subviews all collide together, how can I keep that from happening? Or How can I keep it so that it looks similar on other device sizes? Thank you!
ОтветитьCan someone plz help me? When I try to run the app i get the message of "unable to simultaneously satisfy constraints"
ОтветитьHI Brian I have 11 uitextfield I am trying to add a scrollview like this
let scrollView: UIScrollView = {
let pantalla : CGRect = UIScreen.main.bounds
let pw = pantalla.width
let ph = pantalla.height
let sv = UIScrollView(frame: CGRect(x: 0, y: 120, width: pw, height: ph))//I don't know if it is good
sv.translatesAutoresizingMaskIntoConstraints = false
return sv
}()
and after that I do this:
view.addSubview(scrollView)
let pantalla : CGRect = UIScreen.main.bounds
let pw = pantalla.width
let ph = pantalla.height
scrollView.isScrollEnabled = true
scrollView.contentSize = CGSize(width: pw, height: ph)
scrollView.addSubview(inputContainer)
scrollView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
scrollView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
scrollView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true
scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
But I can't scroll How can I fix this?
Lets Build That App 1 year has passed since this video tutorial and most of the code no longer works.
This is a good reason to use the storyboard
Here is the solution for the nameTextField still showing for Swift 3:
replace nameTextField Code with this:
nameTextFieldHeightAnchor?.isActive = false
nameTextFieldHeightAnchor = nameTextField.heightAnchor.constraint(equalTo: inputsContainerView.heightAnchor, multiplier: loginRegisterSegmentedControl.selectedSegmentIndex == 0 ? 0 : 1/3)
nameTextFieldHeightAnchor?.isActive = true
nameTextField.alpha = loginRegisterSegmentedControl.selectedSegmentIndex == 0 ? 0 : 1
Seeing a small glimpse of the main screen before the login screen is shown seems a little tacky. Is there not a better way to do this from AppDelegate?
ОтветитьCan you show us some advices to increase the speed of compiling and build process please ? Think you for the great videos. Best
ОтветитьIt's such a great tutorial. I really like your style. Thanks!
ОтветитьCan I get your number?
Ответитьcan you please help me with sendUser email verification
ОтветитьPeople if you want to do it programmatically (trust me after couple of apps you will), then use SnapKit for constraints
.
I like your style of coding. Support 100%
Ответитьcan you provide the complete source code for chatapp?
Ответить“But just because you are doing something faster doesn't necessarily mean it's better” -- Brian Voong, great quote, and No, I don't seem to follow, LOL
ОтветитьI have a question regarding logging in and fetching the current users data. I watched one of your other videos on singletons and the gap I see is fetching a user, and setting their properties in your singleton once, but then being able to access that current users data anywhere from the app. With the fetch user being asyc how do ensure that fetch user is only ran once at the beginning of the application and set the object to all the users properties. The problem I am facing is that I would rather run make the fetch user function private and call it within the singleton and then set the instance, however this doesn't work do it being async, I need the app to wait until that current user singleton is loaded before proceeding.
ОтветитьHey Brian! What's up? I was wondering if you have though of doing a PhoneAuth firebase swift 4 video?
Thanks for your awesome vids,
Nerdie
Hello Brain, thanks to your great tutorial Video.
I made Login View by Interface Builder and i saw your UITextView auto sizing video
and i combine these together.
I wrote this code for change Login / Register TextField
@objc func segmentedIndexChanged(){
if segmentControl.selectedSegmentIndex == 0 {
registerBtn.setTitle("Login", for: .normal)
textFieldStackView.removeArrangedSubview(nameTextField)
textFieldStackView.removeArrangedSubview(nameSeparator)
stackViewBackgroundView.constraints.forEach({
if $0.firstAttribute == .height {
$0.constant = 101
}
})
textFieldStackView.distribution = .fill
}else if segmentControl.selectedSegmentIndex == 1 {
registerBtn.setTitle("Register", for: .normal)
stackViewBackgroundView.constraints.forEach({
if $0.firstAttribute == .height {
$0.constant = 152
}
})
textFieldStackView.insertArrangedSubview(nameTextField, at: 0)
textFieldStackView.insertArrangedSubview(nameSeparator, at: 1)
textFieldStackView.distribution = .fill
}
}
Is this fine? or is this totally wrong code?
Hi man! Thanks for the videos. I am currently working on my dissertation and i find your videos veeeery helpful because i also want to implement such Login/Register functionality in my app. Thanks again!
Ответитьhow to login with data from database? like in my project i want to make user login with username not email
ОтветитьI started off in storyboards and they drove me nuts. Not to mention they worked really slowly on my computers. Watching your videos I have started rewriting my current apps programmatically and I am not looking back. So much faster.
ОтветитьGreat that you can code interface elements -- always nice to know what is going on under the hood; however, Storyboards are the way to go. Just like nobody expects people to manually code PDFs when they can use a tool with a GUI like Illustrator, Storyboards are the present and future of interface development in Xcode. Further, if you are working on a team, it is much easier to demonstrate the UI and tweak it live based on feedback using storyboards.
ОтветитьIt would have been better to set the height constraint of inputsContentView on it's contents, rather than the other way around.
And of course now you wouldn't do any of that, you'd use a stack view.
great video
ОтветитьCode is better in this case, clearly.
Ответитьyour All video on Firebase very Good ..2 good.....please upload video on Slidebar without using Segues.......... Thank you:)
ОтветитьThe UI button on the login page stops working after I toggle the segmented control to "login", any suggestions on a fix? common problem?
ОтветитьI support programmatic UI! Programmatic UI rocks, Brian!
Ответитьi think it would be better with a vertical stackview. it is only neccassery to set the nametextfield height.
ОтветитьBasically, I made the Login & Register on 2 different views, I didn't use the segmented control, upon clicking on a button on RegisterVC , doing "self.present(loginVC....etc", I manage to get to LoginVC, while Logging in the user, when I try do dismiss, it takes me back to the RegisterVC, what should I do to get in the chat? Please help!
Ответитьin handleRegister, you use self.dismissViewController instead of present to show ViewController.swift on the screen. I tried the present method and its just a blank tableview (the user's name is not at the top and the "Logout" is not at the top left. How come that does not work?
let vc = ViewController()
present(vc, animated: true, completion: nil)
Using code to design interface is really pain in the a** ! by the way nice tutorial.
Ответитьwhen I login in the app it give a blink at the login page and then comes to the activity page
ОтветитьLooks like quite a lot of people are encountering this similar issue with Login/Sign-in error "email already in use" caused by outdated code, presented in this tutorial. How do we get a hold of the updated swift 4.2 code? Do we have to pay?
ОтветитьYour videos are great! Doing things programmatically should always be where to start. It gives a vital understanding of the basics you might miss using storyboards from the off + as an engineer code is <3
ОтветитьI am a big fan of doing pragmatically for UI. Its more accurate
and professional and easy too modified. I say goodbye for good to storyboard.
hello, Brian.
Thanks a lot for the tutorials. You are awesome!!
But is there any way to implement Secure Password policy into your code?
For example I want my users to have at least 8 characters long password.
Thanks you again.
I thought it would be a fun challenge to try to follow this tutorial on the newest version of Xcode. It's driving me nuts though. The dismiss doesn't work.
instead of that im using navigationController.pushViewController .... but the logout button goes away after registering!!!! I might have to create a button manually
Please help
How do you make session last forever so no multiple logins ?
ОтветитьFor whose are using swift 5.x, you must use viewDidAppear :
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(true)
if Auth.auth().currentUser?.uid == nil {
handleLogout()
}else{
setupNavigationItem()
}
}
In this episode, Brian explains why programmatic code is better than storyboards.
ОтветитьHey man, using the programmatic user interface, I feel the boundary between the View and the Controller is discreet, unnoticeable. Because using storyboard, it is very easy to separate the .storyboard files from the .swift files, and therefore the MVC ideal becomes clearer. But I love making the interfaces programmatically!
ОтветитьPutting handleLogout in Delay is a good trick, but do you think you could have also used dispatchQueue.main.async? But great tutorial.. I always learn something new when I see your videos. I hope you live another 100 years and keep doing these tutorials. Thanks.
Ответить