From a beginners perspective, this video has been the best explanation of this basic activity I have watched. Thanks for making it, and I look forward to all the rest!
@1TheSwiftGuy8 жыл бұрын
Glad that you liked it!
@mikkatunes8 жыл бұрын
Best explanation video of view controller switching I have found yet. Subscribing for sure.
@1TheSwiftGuy8 жыл бұрын
Thank you!:)
@jeanjean67397 жыл бұрын
Just watched a few seconds and I already love the explanations. I like the simple metaphors that make it much easier to integrate information, like: "Imagine the View Controller being a car without an engine. The engine is the view controller.swift file that gets the view controller to do something". Keep up the good work !
@henryqng7 жыл бұрын
This tutorial is short, sweet, and to the point. I like it a lot! Keep up the good work.
@1TheSwiftGuy7 жыл бұрын
Thank you!
@eshwarenm91118 жыл бұрын
SUMBIT. Best Swift teacher on KZbin.
@1TheSwiftGuy8 жыл бұрын
haha, thanks man!;)
@sigmundavila72528 жыл бұрын
Your The Man.. Im just a beginner but I'm learning a lot from your videos.
@1TheSwiftGuy8 жыл бұрын
Awesome! Glad to hear that:)
@papanoob88 жыл бұрын
I learn a lot of basic stuffs from your channel, thanks dude!
@1TheSwiftGuy8 жыл бұрын
Glad to hear that!;)
@henryqng7 жыл бұрын
This tutorial is very practical and easy to follow. Keep up the good work! Cheers.
@1TheSwiftGuy7 жыл бұрын
Glad to hear that!:)
@jean-francoisgouhier25917 жыл бұрын
Excellent pedagogy... suffisamment rare pour être souligné ! Good job M. Swift Guy !
@1TheSwiftGuy7 жыл бұрын
Haha, merci monsieur - thank you for the compliment! Glad you enjoyed the video:)
@CatCurless7 жыл бұрын
Helpful yet again, thank you for sharing your skills in an easy to understand manner!
@MBlacklaw6 жыл бұрын
Dude, you rock! I've been a web dev for a while, and I'm just getting into xcode. Love your vids - great stuff, well presented and extremely useful!
@PrazereS117 жыл бұрын
Good video. Clean explanation. even english not being my native language, I could understand perfectly the explanation.
@1TheSwiftGuy7 жыл бұрын
So glad to hear that:)
@hugeturnip35206 жыл бұрын
Thank you so much I've been looking for how to do this for hours now and you just explained everything i need to know fast and clearly, thanks so muchh
@asjasmulders86176 жыл бұрын
Your videos are of great help!! Especially very clear! Thanks
@indiajackson59594 жыл бұрын
I know this video is old but OMG I have been trying to code all of my view controllers in the same viewcontroller.swift !! I had no idea that we have to manually create new ones!! Thanks for this video!!
@robertflores87897 жыл бұрын
buddy your videos are so very helpful! you are my go to Guy! great work!
@1TheSwiftGuy7 жыл бұрын
Awesome! thanks for watchinG!:)
@valanchan8 жыл бұрын
Very clear video that helped me tremendously. Cheers.
@1TheSwiftGuy8 жыл бұрын
Awesome! Glad to hear that!
@vbnet2008net7 жыл бұрын
Thank you very much, you are very good, I watch all your teaching clips. I learned swift language from your clip very well.
@andreamanful5 жыл бұрын
thank you so much I spent two hours trying to figure this out omgggggggg
@SamanthaLynn428 жыл бұрын
Thank you! This was so helpful.
@1TheSwiftGuy8 жыл бұрын
Glad to hear that!:)
@estiamaliqari53936 жыл бұрын
Thank you, loved the tutorial! Very informative
@kdspland7 жыл бұрын
Thanks!!! I was wondering how to to this with view controllers.
@matthewfeatherston89825 жыл бұрын
Awesome video!! Thanks!!!
@LlamaFN7 жыл бұрын
Awesome video!! Taught me a lot
@1TheSwiftGuy7 жыл бұрын
Glad to hear that!:)
@j.clinton33247 жыл бұрын
Awesome tutorial, thank you so much!
@1TheSwiftGuy7 жыл бұрын
You are so welcome:)
@christo-j55076 жыл бұрын
Bro this is very helpful! Thank you!
@biswa123412346 жыл бұрын
Very good n precise
@annwang43577 жыл бұрын
So helpful, thank you so much!
@arnoczkyzoltan61587 жыл бұрын
Really good tutorial, thank you! :)
@rhidlor85777 жыл бұрын
Very helpful, thank you!
@keenanbrown17597 жыл бұрын
Great Video!
@SameerRazaKhan7927 жыл бұрын
love ur vids!
@1TheSwiftGuy7 жыл бұрын
Glad to hear that!;)
@SameerRazaKhan7927 жыл бұрын
Have you got any videos on reading CSV files and displaying on tableview on Xcode?
@markhermens11747 жыл бұрын
thanks for all these video, your the man! Do you live on a Ferry? XD
@1TheSwiftGuy7 жыл бұрын
Haha, needed to get some videos out while traveling;)
@richardgomez90938 жыл бұрын
hi i love your tutorial very clear and simple explination i have a question why use this command if it does it any way performSegue(withIdentifier: "segue", sender: self) if i dont use this line it still work can you tell me the deference and why should we use it thanks
@1TheSwiftGuy8 жыл бұрын
That is when you want to trigger a segue programatically. If you for example first want to perform the segue after you have completed a certain task
@richardgomez90938 жыл бұрын
The Swift Guy thanks for clearing that up for me
@hassanduhair51808 жыл бұрын
you are the best >trust me!!
@1TheSwiftGuy8 жыл бұрын
haha, thank you!:)
@SrithanSavela8 жыл бұрын
Thank you so much for this video
@1TheSwiftGuy8 жыл бұрын
Your welcome;)
@akhilnair16627 жыл бұрын
amazing buddy!!!
@1TheSwiftGuy7 жыл бұрын
thanks!;)
@westfield908 жыл бұрын
This was superb. Only question is when do you use this method and when do you use a navigation controller instead?
@1TheSwiftGuy8 жыл бұрын
You use whatever you want to use - what gives the user the best experience/makes the most sense;)
@BN-xt8em6 жыл бұрын
Are you on the Oslo ferry?
@familiarny6 жыл бұрын
thank you dude! it's crystal material.
@warmachine30717 жыл бұрын
Thanks bro very helpful!!!!
@1TheSwiftGuy7 жыл бұрын
Awesome! Glad to hear that:)
@christianbabin5274 жыл бұрын
If you keep running through this app with many names, aren't you building a stack in the background which will eventually slow the app? Shouldn't the back button be closing the view as it does in Android Studio rather than opening a copy of the previous one? Or does iOS do this automatically?
@alishanchi7 жыл бұрын
Thanks a lot man
@SeoulMetropolitan7 жыл бұрын
Thanks for the video. Is there any other way of animating other than the bottom up animation? (Screen switching animation)
@chriskasteler20688 жыл бұрын
Great videos. Learning a lot. Brand new to this. I'm having a ton of trouble (been searching for over a week for answer) passing data from table view to new detail VC. I figured out how to do it for one label, but can't figure out how to do it with multiple labels -- for example, if I had a title and a blog preview in the tableview and then a user would click the cell to go to new VC to read the entire post. Any help pointing me in right direction would be greatly appreciated. Thanks!
@eVilbUnny7776 жыл бұрын
Learned!
@deanlowney55788 жыл бұрын
Thanks for the great video. I am trying to write an app which uses 2 view controllers. In the first view controller I input my data using uitextfields. I do some calculations in the second view controller. The problem is when I segue back from the second view controller to the first view controller my data is lost. What is the best way to to keep the initial data when I segue back? (In your video this would be the equivalent to keeping your name in the first view controller after you segue back from the second view controller) Many thanks
@1TheSwiftGuy8 жыл бұрын
Take a look at my video on how to use User Defaults. That will solve everything
@TheAircraftKing6 жыл бұрын
Thanks for this awesome video! I just had one quick question: I did everything you did but when I built the program to run I got this error in my AppDelegate class: "Thread 1: signal SIGABRT", what does this mean. People on google have said that this means that there is a faulty connection somewhere but I am seriously failing to understand where that issue arises. Thanks!
@cascasanova6 жыл бұрын
I got the same error, not sure what it means?
@philipcaceres22847 жыл бұрын
can you tell me what the use of the segue is?
@mananmanwani66477 жыл бұрын
Awesome video!....Just a small question, when the label gets updated, it takes some time to change its value i.e. its not dynamic and instant.Is there any way to correct that? something similar happened in your video as well when the label changed its text.Thanks a lot!
@robertflores87897 жыл бұрын
it might be because he ran it on the simulator...thats just a guess...hardware performance should be a lot better i think...i'm new to all of this...
@donk72837 жыл бұрын
remove "label" text from the label and keep it empty so when it does load you won't see the word label first before it updates to the text that will appear
@brianpluhar86257 жыл бұрын
That doesn't change the fact that there's a delay when updating the label.text, it's due to him running it in a simulator which is software emulated. Using hardware (i.e. your actual iPhone) will not have a delay.
@Jamilkhan147 жыл бұрын
Come on guys, its not a simulator issue. This is because 2nd VC is showing before the IBAction calls. Just remove the segue from storyboard and do "performSegue" in IBAction after updating text. It will be all fine then
@aprimic6 жыл бұрын
@Jamil You can't? It's a different view controller. How can you update the second view controller text before you switch to it and use it's code?
@louissrestha85237 жыл бұрын
Nice video :)
@1TheSwiftGuy7 жыл бұрын
Thank you!:)
@Chfr988 жыл бұрын
I am making a BMI app for a school project, and was wondering whether this would work out the same way when the button as an action is a formula of inputs from two text field variables (height and weight). Could you perhaps explain that to me how to store the result calculated as a global variable meant to be shown on another view controller?
@phokeybladewar8 жыл бұрын
Hi. I have too many view controllers is there a way to hide the view controllers and make the main story board look cleaner?
@Applest2oApples8 жыл бұрын
Global variables are generally a bad idea. You should really design your objects to be self-contained and pass information back and forth between them. For example, if you need to access a property of your view controller, you just put in: ViewController.name. Remember you can pass an object (button, view, even a view controller) as an argument into a function or the method of a *different* object. This will allow you to access that object, meaning you can access the variables inside of that object via .
@1TheSwiftGuy8 жыл бұрын
I wouldn't say global variables are a bad idea. They are just a different way of doing what you are talking about. Yes, I agree that the way you suggest to do it is in most cases the most optimal way of doing it. However global variables are an easy way to achieve the same effect with less coding. For beginners who are just starting out, and are making less comprehensive apps, global variables will work just fine. Thanks for reminding me to do a video on the alternative approach as well;)
@Maxschellenberg8 жыл бұрын
Is this alternate video out yet? Because I would very much like to see how to do what Ryan described :) thanks for this video as well it helped a lot!
@richardgomez90938 жыл бұрын
im a beginner and that the kind of explanation i was looking to learn to have a concept on how this is done
@QATARI52327 жыл бұрын
Can you give us an example for what you say
@RedDeadKid76 жыл бұрын
Is there a way to not have button perform a segue when touched if it doesn’t meet the if statement?
@RedDeadKid76 жыл бұрын
leumasdiderot I appreciate it
@destrosnake8 жыл бұрын
excelente!!!
@1TheSwiftGuy8 жыл бұрын
Gracias! ;)
@ThinkCleverAndSmart6 жыл бұрын
Filmed on Viking Line. Nice! XD
@yamanfarid63797 жыл бұрын
ur the best
@1TheSwiftGuy7 жыл бұрын
haha, thanks;)
@philm88918 жыл бұрын
Your vids are great, I'm new to SWIFT so this is very helpful. Can you combine this with your "How to store data permanently" video? I understand the concept of global variables and the concept of storing data permanently, but I'd like to see how to store global variables permanently. My app will load to the main menu with a "settings" button to take me to a settings menu. I want to store data in the settings menu as global variables.
@TheSanket23117 жыл бұрын
Nice video, i am facing one problem if you help that would be great, i am making app and everything is working fine like data transfer from one VC to another VC properly so my problem is when im going to 1 VC to my 2 VC ,completing task in 2 VC and after that i made one popup on 3 VC those will show task on 2 VC is completed so you want to continue or back? these are two options in 3 VC popup VC so i want when user hit "back" button so they directly go to my 1 VC not to my 2 VC but my 3 popvc not connected to my first so how could i do that ? i have to connect 1 VC and 3 VC ?
@sehejsingh37918 жыл бұрын
Hello, I am trying to make an app such that when the user clicks the button on the first View Controller, they go to another view controller and do your quiz app and then they go to another view controller that says thanks. How would I link the first two view Controllers?
@1TheSwiftGuy8 жыл бұрын
Take a look at my video on how to work with multiple view controllers + how to use segues - they will show you how:)
@sehejsingh37918 жыл бұрын
But what if the view controller in front is the secondviewcontroller? Does anything change? Or do the view controllers switch?
@1TheSwiftGuy8 жыл бұрын
Same thing, just drag the segue the other way
@mkhasson978 жыл бұрын
Thank you 😇
@1TheSwiftGuy8 жыл бұрын
Glad it helped!:)
@markiyanpryssiaznuk45786 жыл бұрын
Hey i have a problem when i created secondViewController the xcode doesn't see it idkn why cause i followed all instructions>I mean when i am creating the UIView and trying to set the class of this uiview xcode doesn't see my custom class at all. Could you help ?
@everforexcanada56635 жыл бұрын
great vids! but as a new learner for ios dev, I am really confused by the way you guys name a vairiable. as a old school developer I am always use something like: lblInfo, btnSubmit, and never name a vaiable like "name", "data", "lable". i wondering if that is a swift thing?
@cgroovy7 жыл бұрын
SUMBIT
@605dave6 жыл бұрын
It's great to have a button that returns a random bit
@gordonkwok64618 жыл бұрын
Hi guy, thank you for your video, but i got some questions. if I want to show string and picture in second view controller, how can i do this? how to use perform segue once time then can show string and picture in second view controller? Thanks a lot!
@holliesimpson60247 жыл бұрын
On your video 'How to make a quiz in Xcode8' at the end it says about creating about point system and then suggests this video, how would i do this?
@1TheSwiftGuy7 жыл бұрын
Hi, have you watched the whole video? You would just have to set the text of the label on the second view controller, equal to the amount of points that the user has:) label.text = String(yourPoints)
@ricardocarcamo50177 жыл бұрын
What would the global variable be in terms of the points system?
@ricardocarcamo50177 жыл бұрын
christian vila Thanks for the reply. So if I have my variables "var currentQuestion = 0" "var rightAnswerPlacement:UInt32 = 0" and "var points = 0;" What would my global variable be and which would I assign the int to?
@sehejsingh37918 жыл бұрын
How do you control which view controller appears first in the simulator?
@1TheSwiftGuy8 жыл бұрын
This is done by setting the viewController that you want to appear first as the initial viewController.
@sehejsingh37918 жыл бұрын
So then, do the next two that I want to appear get named second and third view controller?
@1TheSwiftGuy8 жыл бұрын
I would take a look at my video on how to work with multiple view controllers and how to perform segues. Then you should learn everything you need to know!
@jordanbaron43417 жыл бұрын
Why did you drag SecondViewController.swift above Main.storyboard?
@1TheSwiftGuy7 жыл бұрын
No other reason than I think it looks more clean:) I like to have all my ViewControllers beside each other, and ordered.
@breakthruuent98747 жыл бұрын
when i run the app and try to write in the text field it crashes. But when i dont try to write in the text field and push the submit button it goes to second viewcontroller with no update on the name. Why is that?
@1TheSwiftGuy7 жыл бұрын
There is probably an error with the force unwrapping. You are trying to force unwrapp a value that is equal to nil. I would take a close look at those lines that are responsible for that
@aren37767 жыл бұрын
In this tutorial can I make a button to switch between storyboards? Because I have 2 boards and I need a button on the second one to switch to the 1st board. Please Help.
@heyblazyboygaming98068 жыл бұрын
so i want to carry the data from a ui label in my 1st view controller how would i do that?
@1TheSwiftGuy8 жыл бұрын
1st view controller: Extract the text from the label and place it in a global variable. Perform the segue. 2nd view controller set the text of your label equal to the variable
@heyblazyboygaming98068 жыл бұрын
sorry I'm new to this to extract the text what code would i use?
@1TheSwiftGuy8 жыл бұрын
hi like this: myVariable = label.text
@MaazFz7 жыл бұрын
mine doesn't work when i try to put second view controller on my class it doesn't give me the option to do it
@raghavpoluri65638 жыл бұрын
Thank you for this Video. Can you make a video about snapchat like camera
@lakshinkarunaratne42617 жыл бұрын
In the tutorial segue triggers even if the text field is empty. Seems like performSegue(withIdentifier: "segue", sender: self) code doesn't make sense how its used in the tutorial. Could you please explain how to properly trigger segue only if the validation passes?
@lakshinkarunaratne42617 жыл бұрын
source : stackoverflow.com/questions/28883050/swift-prepareforsegue-cancel override func shouldPerformSegue(withIdentifier identifier: String?, sender: Any?) -> Bool { if let ident = identifier { if ident == "YourIdentifier" { if outlet.text == ""{ return false } } } return true } You need to override this function and return true or false according to your own logic. This method will be called before triggering segue.
@1TheSwiftGuy7 жыл бұрын
Hi, I would replace all of that code with a simple if statement. You do not need the rest;)
@lakshinkarunaratne42617 жыл бұрын
Hi, Without overriding shouldPerformSegue function?
@1TheSwiftGuy7 жыл бұрын
Yes, if you have a button, you can add an if-statement within that button in order to check if a condition is met. If it is, perform the segue:)
@lakshinkarunaratne42617 жыл бұрын
Like mentioned in the tutorial? I already tried that. still it triggered when the text field was empty :/
@zerocel7 жыл бұрын
NICE!
@1TheSwiftGuy7 жыл бұрын
:)
@lukassvoboda17258 жыл бұрын
Please, how can I do this with numbers? I want to type a number to outlet and save it into var. But it just says: Cannot assign value of type UITextField to type int. Thanks for answer
@1TheSwiftGuy8 жыл бұрын
You can do it like this: Int(textField.text)
@lukassvoboda17258 жыл бұрын
Thanks. 👍
@MuhammadAli-zv5vz8 жыл бұрын
i think navigation controller is best option rather than put a back button.is i am right??
@Rolfadinho8 жыл бұрын
Is there a way to get data from multiple view controllers to be accessible on one? I'm creating an app where people input data on 4 different controllers (in consecutive order) and I want the data to be access on the 5th so I could do a math problem on it.
@1TheSwiftGuy8 жыл бұрын
Definitely possible. The easiest way is to simply store all of the values in global variables, just like displayed on the video;)
@Rolfadinho8 жыл бұрын
How would I then pull these variables together on one? I figured out the storing part, but can't get the getting part.
@1TheSwiftGuy8 жыл бұрын
If the variables are global, you just have to access them like you would access any variable. If you for example have variables that are named v1, v2, v3, v4, v5, you make them global and assign each a value, you can then use them on your last ViewController however you like.
@Rolfadinho8 жыл бұрын
What would I code then on the last view controller to import the data?
@Rolfadinho8 жыл бұрын
Another question: how can I code in so that a math equation in my app cannot equal anything less than nil?
@keremyokuva51855 жыл бұрын
Awesome.
@tiberiust44748 жыл бұрын
can you make a video about visual recognition ?)
@alexanderaltshuller42028 жыл бұрын
i remember my teacher was doing something like that but he created "Swift File" not "Cocoa Touch Class" just a bit confused what is the difference and what is better ?
@1TheSwiftGuy8 жыл бұрын
I would do as your teacher told you and just go with cocoa touch class. No major differences:)
@aleksandarvolkanovski45655 жыл бұрын
I came here because of the quiz app, I did everything but making the ‘’points’’ variable global, which I am struggling with significantly. Can you please help me, Swift guy? By the way, love your vids.
@willpinkley13827 жыл бұрын
Xcode has a problem with the var name = "" saying that is an "Invalid redeclaration of 'name'" any help plz?
@짱구짱아짱주제니애기7 жыл бұрын
잘보고 있어요 강의가 너무 괜찮네요
@falkson106 жыл бұрын
How to I make more text fields say like five and then when I press submit it will randomly generate one of the name on the next screen? Feel free to answer here or in a private message. Thanks a lot in advance and have a great day and a good start of the new week. Regards Andreas Falk
@Notj967 жыл бұрын
Hi i have done everything just as you've done but when i run the app in the simulator it works just fine untill i press submit then the app crashes and i have tryed to put the label to the first view controller and the label wors just fine it only crashes when i want to go to the second view controller do you or anyone knows why it happens? i also get a message from xcode that says "could not attach to pid: "51396" " and sometimes it says "could not connect to simulator" but everything works untill i press the button to second view controller
@michaelskalecki30737 жыл бұрын
The segue back to main instantiates a new view controller.... this causes us to use more memory... how do we destroy the old view controllers?
@QATARI52327 жыл бұрын
thanks alot
@1TheSwiftGuy7 жыл бұрын
You are welcome!:)
@bilgekaan60747 жыл бұрын
how can i display an image at another view controller with button ??
@emeraldeye85817 жыл бұрын
mines not changing from label - it throws this error - libc++abi.dylib: terminating with uncaught exception of type NSException
@rakeshmaurya94047 жыл бұрын
Hi, Did you find solution to this error?
@trcrawford457 жыл бұрын
I want my view controller to change automatically after 3 seconds. I'm having a lot of trouble figuring out how to do this
@1TheSwiftGuy7 жыл бұрын
Hi, have you taken a look at my video on how to create a timer? You simply use a timer, and perform a segue when the timer is up
@trcrawford457 жыл бұрын
Thanks to you I got it to work. Thanks for the reply and all the videos.
@krpcannon1237 жыл бұрын
why not use optional instead of "if nil" test...
@1TheSwiftGuy7 жыл бұрын
haha, I dont remember what I did in they video, but I guess you could use both:)
@perezwillie-nwobu32698 жыл бұрын
What if you just want to slide right and left like snapchat, how can you do the and can you make a video on that?
@Jamilkhan147 жыл бұрын
Its default behavior when views are made in storyboard.
@robj74815 жыл бұрын
When I move variables outside of the View class, all that happens is the methods within the View give errors because they can no longer find the variables
@McStroke238 жыл бұрын
hey guys i been searching forever and i need some help. i just want to know what type of view is used to make the instagram style homepage. More specifically i just want to know how they made the grid view for photos, the singal view for photos and the location view all in one view. thank you to anyone that can help.
@1TheSwiftGuy8 жыл бұрын
You could use a combination of tableviews (with custom table view cells) and scroll views. Got video on both of them
@McStroke238 жыл бұрын
ok thank you. will check it out
@OkLetsPlayTv7 жыл бұрын
Helped alot but i managed to just connect them to the same view controller so all my code is in one place. But you did help
@heyblazyboygaming98068 жыл бұрын
the command preformSegue(withIdentifier: "segue", sender: self) isn't working. it says "! use of unresolved identifier 'preformSegue' " I'm really getting irritated with Xcode when it doesn't work like everyone else's.
@1TheSwiftGuy8 жыл бұрын
haha, I get you:) Just make sure that you write perform instead of preform ;)
@heyblazyboygaming98068 жыл бұрын
thanks so much i can be blind a times lol!
@oefzdegoeggl5 жыл бұрын
hmm ... why not use dismiss() in the back button? this will just destroy the second one and bring you back to the first. the fact that your input box content is empty each time you "go back" (what you actually don't do) indicates that a new instance is created each time.
@nafisurahmed50157 жыл бұрын
awesome video. subscribed :).. Plz make a video on how to use the authentication token for handling login/logout & requesting new data from api using that token using alamofire. Searched a lot in google & youtube but couldn't find anything helpful. Thank you.