How To Pass Data Between View Controllers in Swift (Xcode 11) | iOS for Beginners

  Рет қаралды 56,898

iOS Academy

iOS Academy

Күн бұрын

Пікірлер: 92
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Enjoy my teaching style? Learn to build the TikTok App from scratch with my course! ios-academy.teachable.com/p/building-tiktok-for-ios
@BranGaming20
@BranGaming20 3 жыл бұрын
i love how you explain those different method, not just like showing only the code, thanks a lot
@BranGaming20
@BranGaming20 3 жыл бұрын
but please help me how to pass multiple data
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Youre welcome
@BranGaming20
@BranGaming20 3 жыл бұрын
@@iOSAcademy its works on do single data, but i dont know how to do with 2 or more data to pass
@mahmutyazar6976
@mahmutyazar6976 2 жыл бұрын
You're amazing. Thanks a lot!
@iOSAcademy
@iOSAcademy 2 жыл бұрын
You're more amazing! thank YOU
@arijitganguly83
@arijitganguly83 2 жыл бұрын
thanks... this one helped a lot
@tahevol
@tahevol 4 жыл бұрын
Thank you. This helped me a lot with NC. The concept is simple, but I was hung up for a long time getting text out of a function on one VC and into a labels on other VCs. You made the components of the NC Post and Observer system clear.
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Thanks!
@yototoTororo
@yototoTororo 3 жыл бұрын
very thank you!!!!!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
You’re welcome
@volodya-nrg
@volodya-nrg 4 жыл бұрын
Thanks for the video tutorial. The Observer was the most interesting place.
@mehradt8129
@mehradt8129 3 жыл бұрын
once again, thank you!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Youre welcome
@deluxe092
@deluxe092 Жыл бұрын
Thanks a lot!
@iOSAcademy
@iOSAcademy Жыл бұрын
You're welcome!
@chho2612
@chho2612 4 жыл бұрын
both method are super advanced, to be honest not suitable for newbie , only for swift experts. but thanks for share anyway
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Thanks for the feedback
@МагжанБекетов-л6е
@МагжанБекетов-л6е 4 жыл бұрын
Very well job man :D ty
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Thanks!
@chillyo5920
@chillyo5920 5 жыл бұрын
Thank you! I appreciate the tips!
@iOSAcademy
@iOSAcademy 5 жыл бұрын
YOu're very welcome
@BalaaLyf
@BalaaLyf 4 жыл бұрын
Please upload one more video for this pass data.. Multiple labels and multiple textfields.. Data transfer and save it
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Sure!
@GG-hk5iz
@GG-hk5iz 4 жыл бұрын
How do you manage to explain any concept with such a simplicity?
@rafatwasef8518
@rafatwasef8518 3 жыл бұрын
Thanks A lot that is great I have a question how to switch to other story board from NSObject class I used what you wrote but it said no present in NSObject please help me
@heliumstein1
@heliumstein1 2 жыл бұрын
helpful but the zoom in feature you have when presenting is disorientating
@asherazeem3282
@asherazeem3282 4 жыл бұрын
That a lot bro, it is a good way for moving data from A-> B or B->A Controller.
@hiwottesfaye8710
@hiwottesfaye8710 4 жыл бұрын
Thank you
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Youre welcome!
@LeagueRandomPlayer
@LeagueRandomPlayer 2 жыл бұрын
Great Video!!! saved me, but how do you manage to do all zooms while recording? its so epic since i have bad sight, which software do you use?
@Christian031780
@Christian031780 4 жыл бұрын
Your videos are great, but zooming so often might be little bit distracting and hard to follow. You might want to stick with one view and make the font size bigger and it will be fine. Thank you for your videos.
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Thanks for the feedback :) And thanks for watching!
@maryannadelman4438
@maryannadelman4438 Жыл бұрын
Good tutorial! Question: using the completionHandler version, would it be possible to have the save button on vc2 make an image on vc1 switch to another image?
@shoilett1
@shoilett1 3 жыл бұрын
What about using segues? Are segues considered outdated?
@GG-hk5iz
@GG-hk5iz 4 жыл бұрын
@iOS Academy , Really looking forward to see Swift UI stuff from your side
@vspianist
@vspianist 3 жыл бұрын
i tested this on my iPhone and the keyboard doesn't dismiss, how do i dismiss the keyboard
@iOSAcademy
@iOSAcademy 3 жыл бұрын
ResignFirstResponder
@PFSGMBH
@PFSGMBH 4 жыл бұрын
Thanks for the excellent tutorial. I have used the notification solution to send an object from the second to the first viewController. But what about sending an object from the first to the second. I was setting the observer and a different notification name and pushed the second viewController on the stack by navigationController?.pushViewController() . But the notification does not get noted . Any idea how to get the object to the second ViewController ?
@lokeshchinatatareddy1069
@lokeshchinatatareddy1069 4 жыл бұрын
Can you say how to do in MVVM
@leninvladimirpacas6211
@leninvladimirpacas6211 4 жыл бұрын
Thank you so much for the tutorial, it was excellent. I love it
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Your welcome! Make sure to subscribe for more :)
@supertonyxd
@supertonyxd 3 жыл бұрын
Thank you for the tutorial. I got one question as I am not using storyboard but XIB to do. So for the line "let vc = storyboard?.instantiateViewController(identifier: "other") as! OtherViewController" should not work for me... What should I do with this? Thanks
@dugrut1325
@dugrut1325 2 жыл бұрын
when you messed up with the button, on the OtherViewController, at first I thought I'm really lost, how is then actually possible....?
@AviationMaster
@AviationMaster 4 жыл бұрын
Hello! Is it possible to copy and paste code from one cocoa touch class view controller.swift to another view controller.swift?
@hulkxp3020
@hulkxp3020 3 жыл бұрын
how can I do this with a switch?
@bearishlilly4703
@bearishlilly4703 3 жыл бұрын
how does one capture a global variable data from one view controller to another without using segue or moving to a new viewcontroller?
@ananyousef889
@ananyousef889 3 жыл бұрын
really thank you so much for the valuable information , I am an iOS Development student , I am on my final project and I am trying to send data from a viewController (textfield and label) to a uiTabelView , can you please let me know what is the best way to do so ?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
You are most welcome - closure sounds like the approach you want
@RyeGuyWpg74
@RyeGuyWpg74 3 жыл бұрын
This doesn't seem to be working when I try to do it the other way. Push data from the first vc to the second. I am posting the notification but I have to do it before pushing the second view controller and the second vc never receives the notification.
@PutraTrie
@PutraTrie 4 жыл бұрын
how to show data from login user by json ?
@balakrishnasalla
@balakrishnasalla 2 жыл бұрын
notification center not working
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Check your observer
@sharkcraft384
@sharkcraft384 4 жыл бұрын
Where is the github repo? Btw I love ur vids
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Thanks, I dont think I mmade one for this one
@vspianist
@vspianist 3 жыл бұрын
how do you store the text value in a double and pass that between view controlers
@iOSAcademy
@iOSAcademy 3 жыл бұрын
You can just pass a string
@SSQMinky
@SSQMinky 4 жыл бұрын
Is there a way to do this on a macOS app, where a vc1 button can change text on vc1 and vc2? Basically like a text display for extended view, where vc1 controls what the text is, and it displays on vc1 and vc2. Once a button on vc1 is pressed, it changes the text on vc1 and vc2. How to make this work?
@Tenkai165
@Tenkai165 4 жыл бұрын
For me, I am still unable to see the completionHandler in my initial viewcontroller. The error says "Value type of 'ViewController' has no member 'completionHandler' " I have added public in front of the variable
@theevanator9252
@theevanator9252 4 жыл бұрын
One question I have is how to save information in your app so that when you renter the app it’s still there
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Hi there, to do this you can use User Defaults or a Database. I recently published two videos explaining each of these topics - cheers!
@cem890
@cem890 4 жыл бұрын
Hi. I have 3 view controllers.First home, second login and third about news. They are connected with segues. And I use unwind segue for third viewController. Because when I hit back button it returns to login screen. When I use unwind segue it was working good but one problem is my login screen is still seen about 1 second. How can I solve that. Thank you.
@Beebreloaded
@Beebreloaded 4 жыл бұрын
Am I the only one getting UIRESPONDER in my assistant editor even after I create a new class for my View Controller ??
@TomGalland
@TomGalland 4 жыл бұрын
Followed and finished this tutorial today! Thank you! I'm struggling with the next step to Passing data. If I wanted to collect data from Two View Controllers, say "Other" & "More", and then bring it back into noteViewController. How would I do that? Example, 1. User clicks "OtherScreen" from note. 2. Types in to the "OtherViewController" and clicks a "Next Page" Button 3. Types in to the "MoreViewController" and clicks "Save"
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Thanks for watching. To do what you described you have several options. You can retain the data somewhere and use closures to pass the data back like completion Handlers. You can use the delegate / datasource pattern. Or you can use the notification center pattern.
@BranGaming20
@BranGaming20 3 жыл бұрын
@@iOSAcademy can you make the video please
@mdhosnemobarok2293
@mdhosnemobarok2293 2 жыл бұрын
Hey Brother what is your problem? whay your video screen zoom in and zoom out more and more!???
@iOSAcademy
@iOSAcademy 2 жыл бұрын
New videos have no zoom
@mdhosnemobarok2293
@mdhosnemobarok2293 2 жыл бұрын
@@iOSAcademy Thank you bro.
@Potato-ff9ms
@Potato-ff9ms 3 жыл бұрын
how do I do a conditional statement? i have a code that does something like this: input(text field) < 5 { (sends me to view controller2) } if-else input(text field) > 5{ (sends me view controller1)
@stefvanzwienen608
@stefvanzwienen608 4 жыл бұрын
Man, I really don't get it. I followed about 10 tutorials but I never get the option 'present'. I just don't know how to change the current viewcontroller programmatically.. I just don't know what i'm doing wrong. Could you help me?
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Hey, sometimes Xcode autocomplete just sucks. Try typing it in your self: self.present(, animated: true)
@stefvanzwienen608
@stefvanzwienen608 4 жыл бұрын
iOS Academy That actually worked 😅 thank you!!!
@viswaprasad9412
@viswaprasad9412 3 жыл бұрын
please stop zooming in and out it is highly visible when you keep it in a normal angel
@iOSAcademy
@iOSAcademy 3 жыл бұрын
New videos have no zoom
@Spham99
@Spham99 3 жыл бұрын
I wished you didn't zoom in as much ... It made things harder to see which file you were in, or which tab you were in etc ... Really dizzy too.
@iOSAcademy
@iOSAcademy 3 жыл бұрын
New videos have no zoom
@richard12345789
@richard12345789 4 жыл бұрын
I got motion sickness!! son of a gun
@iOSAcademy
@iOSAcademy 4 жыл бұрын
haha new videos have less zoom :)
@AayamS
@AayamS 3 жыл бұрын
Anyone else find the constant zooming in to be super frustrating?
@matthewreid5467
@matthewreid5467 4 жыл бұрын
this didn't work for me
@matthewreid5467
@matthewreid5467 4 жыл бұрын
never mind, I made a mistake lol
@iOSAcademy
@iOSAcademy 4 жыл бұрын
No prob!
@furmeldahyde
@furmeldahyde 2 жыл бұрын
I had to stop watching because your constant zooming in and out was very jarring. Other than that it seemed like you were doing well explaining it.
@Natena
@Natena 2 жыл бұрын
Stop Zooming please.. It hurts our eyes
@iOSAcademy
@iOSAcademy 2 жыл бұрын
New videos have no zoom
@nikolaykondratyev1391
@nikolaykondratyev1391 2 жыл бұрын
OMG stop zooming !!! =)) vomit is coming out
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
SwiftData Basics in 15 minutes
15:18
CodeWithChris
Рет қаралды 56 М.
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 230 М.
Introduction to SwiftData - iOS Development
12:51
iOS Academy
Рет қаралды 11 М.
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 68 МЛН
31 Xcode Tips & Tricks - 2023
17:45
Sean Allen
Рет қаралды 43 М.
Swift Tutorial: Save & Get Data with User Defaults
19:42
iOS Academy
Рет қаралды 29 М.
TableView With Custom Cells In Swift - Tutorial
16:40
iOS Academy
Рет қаралды 56 М.