What is @EnvironmentObject property wrapper in combine SwiftUI Hindi tutorial

preview_player
Показать описание
EnvironmentObject property wrapper in swiftui is used to store an observable object into the global scope of the application, by doing this all our views in the view hierarchy will have access to those observable objects. Environment object property wrappers are perfect to use if we want to share data across multiple views in our application.

Given are the chapters covered in today's session
0:00 introduction
0:38 question from observable object video
1:37 environment object is not a singleton
2:00 @environmentObject demo
3:37 environmentObject and parent view
4:57 avoid setting environmentObject in the child view
6:26 setting multiple objects in environment
13:21 summary
14:30 share like and subscribe

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✅ Subscribe to the channel and stay ahead of everyone by following the right way for writing clean code in swift. 🔥🔥🔥🔥🔥

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----------------------------------------------------------------------------------------------------------------------
📥 Download the source code from

-----------------------------------------------------------------------------------------------------------------------

############################################

Connect with me on social media
Instagram: @codecat15

###########################################
#environmentObject #swiftUIHindiTutorial #swiftUIForBeginners
Рекомендации по теме
Комментарии
Автор

Code Cat channel is the synonym of Simplicity. Content jitna simple hoga usko banane me mehnat unti hi zada lagti h. Kudos to Ravi bhai.

theishuboy
Автор

I learn a lot from this channel simple easy to understand. Thanks for all videos.

explorebeauty
Автор

Always the best, thanks a lot bhaiya!

yashr
Автор

Thanks for the useful Video.. Great explanation ... 👍🏻

rachitsharma
Автор

Thanks Ravi for amezing knowledge sharing.

akashkhedekar
Автор

Your examples are very good brother . Really helpful, please keep up the good work . Thanks !

ahmedla
Автор

This video was so helpful to me. Thanks for making every topic easily understandable.

Rasikabharati
Автор

if there is a case where what a sub view that is deep in hierarchy of the main view and we want to inform the main of some changes done in it, what is best way to do the same?
@state or @environmentObject?

anishagarwal-ejsu
Автор

my application is working fine, without the use of Stepper. as you explained..

MadhursAyurvedicTips
Автор

One question is that, if we have to define every environment object in the root view, than that will make it ugly in this where the root view is holding the value of unnessasary objects? how can we resolve this? also was not the single ton and user defaults better as we only have to use or change there value where they are needed? not like everything in the root view like here?

anishagarwal-ejsu
Автор

Hi Ravi, Thanks for the useful videos

1) Can we use struct instead of class to use Environment Object?

2) Can we pass array of environment objets?

3) can you make video to store and retrieve custom data in User defaults in swift/swiftUI?

Shade_with_me_
Автор

0:39 - this problem is called props drilling

sanatandharmaurham
Автор

please make a video on appstorage and scenestorage.

Rasikabharati
Автор

Hi Ravi, my one doubt is that how to store global data in the case of struct, do we need to make the model always as a class for swiftui, or how to achieve the same functionality for the struct model?

ayushgarg
Автор

Bhaiya, when you cover core data, multiple screens se core data update karne ka video kare.

nagarajvrao
Автор

Hi Ravi, I have one doubt, why we need to set .environmentOnject(User()) and Account() in ThirdView_Previews? I can access data without this step.

sachinpatil
Автор

Hello, my question is like can we create new observable property for every view so that we don't need to maintain that environment property 😬. for example -> @ObservedObject private var user: UserModel = UserModel() | this line of code can be used on every view. Correct me if i m wrong 🥺

ashishprajapati
Автор

Thanks a lot for great How can I use Environment Object with struct?

piyushagrawal
Автор

Please use some settings to avoid keyboard keys sounds....🙏

arjunhanswal
Автор

Environment object me stepper use nai karna to kese kare agar muje multiple environment object pass karene pade to ?

piyushselarka
join shbcf.ru