SwiftUI Environment Values - What are they? Code Examples | Xcode 13

  Переглядів 14,837

Sean Allen

Sean Allen

День тому

In today's video I explain what EnvironmentValues in SwiftUI are and how to use them. EnvironmentValues are a way for the device to communicate some of it's system-wide settings with your SwiftUI app. In the code examples I show you have to use a couple of these EnvironmentValues to adjust your UI to settings like Dark Mode and Dynamic Type.
This video was created on Xcode 13 (beta 5) and macOS Monterey (beta).
Environment Values Documentation:
developer.apple.com/documenta...
If you like my teaching or presentation style, I've started creating my own courses:
seanallen.teachable.com/
Timestamps
0:00 - What is @Environment?
2:20 - Code Example - Dynamic Type Size
7:05 - Code Example - Color Scheme
Twitter:
/ seanallen_dev
Link to my book - How I Became an iOS Developer:
gumroad.com/l/sean-allen-origin
Hired.com:
hired.com/x/1n01g
Check out my podcast, iOS Dev Discussions:
itunes.apple.com/us/podcast/i...
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Paul Hudson's Hacking With Swift:
gumroad.com/a/762098803
Donny Wals - Combine:
gumroad.com/a/909014131
Mark Moeyken’s SwiftUI Books:
www.bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
gumroad.com/a/656585843
Ray Wenderlich Books:
store.raywenderlich.com/a/208...
Links to my iOS Dev Setup & iOS Dev Book Recommendations
www.amazon.com/shop/seanallen
#swift #softwaredeveloper #iosdeveloper

КОМЕНТАРІ: 24
@seanallen
@seanallen 2 роки тому
If you enjoy my teaching/presentation style I've created my own iOS development courses at seanallen.teachable.com. You can watch the first ~10% of each one for free to get a feel for them.
@Omeir34
@Omeir34 2 роки тому
Always up to watch your videos, Sean!
@seanallen
@seanallen 2 роки тому
Thanks for the support, Omair!
@prachibile2798
@prachibile2798 4 місяці тому
I've started learning SwiftUI recently and for that I would like to thank you for teaching in a nice way :) Amazing Content😌
@seanallen
@seanallen 4 місяці тому
Glad you enjoy it!
@andrepaesh
@andrepaesh 2 роки тому
Thanks for the video, Sean!
@seanallen
@seanallen 2 роки тому
No problem, Andre. Happy to help.
@rahuljamba5846
@rahuljamba5846 Рік тому
Really Enjoyed Your Video Thanks a lot Allen
@mysysd2915
@mysysd2915 Рік тому
Thanks a lot ! 👍
@lembani
@lembani 2 роки тому
Great content Sean!
@seanallen
@seanallen 2 роки тому
Thanks for the kind words, Lembani!
@cristopherescorcia3276
@cristopherescorcia3276 2 роки тому
Great video as always Sean, but for the colorScheme isn't it better to create Color asset with light and dark mode options and let SwiftUI handle it itself?
@judy8821
@judy8821 2 роки тому
Great explanation
@seanallen
@seanallen 2 роки тому
Glad you liked it
@MarvelousLXVII
@MarvelousLXVII 2 роки тому
Pretty cool stuff. Nice video.
@seanallen
@seanallen 2 роки тому
Thanks Marvelous 👍
@davidjimenezquiroga5638
@davidjimenezquiroga5638 2 роки тому
Great video Sean thank you it helped a lot. Do you think one day you could a video about core data and environmentObject?
@seanallen
@seanallen 2 роки тому
I'm using Core Data in the app I'm currently building, so future videos on that topic are likely.
@peerview
@peerview 2 роки тому
Hey Sean! I started to learn coding with Swift and I look a lot at your videos, any recommendation or future videos coming about coding practices when using sensors (cameras, LiDAR). Thanks for your videos they are really helpful
@seanallen
@seanallen 2 роки тому
To be honest, I've haven't worked with camera sensors or LiDAR, so I'm probably not the best person to teach that.
@nileshjdarji
@nileshjdarji Рік тому
@Environment gives the access of a variable to entire app but during runtime. where actually does it store. For example once I toggle to dark mode, killing the app in app switcher and coming back, will this retain the dark mode settings?
@MohammedMisselmany
@MohammedMisselmany 26 днів тому
Do you do BJJ or some form of MMA
@ncba
@ncba 2 роки тому
wait, is that how you pronounce deprecated?
@Joshua-tg6hj
@Joshua-tg6hj 2 роки тому
Yep :)
SwiftUI Page View | Onboard Flow
5:40
Sean Allen
Переглядів 17 тис.
Size Classes - SwiftUI - Adopt Landscape Example
6:58
Sean Allen
Переглядів 10 тис.
C in 100 Seconds
2:25
Fireship
Переглядів 2,8 млн
Swift Access Control Explained
9:44
Sean Allen
Переглядів 32 тис.
How I Went From ZERO to iOS Dev in 7 Months
10:13
Sean Allen
Переглядів 156 тис.
How to use @EnvironmentObject in SwiftUI Tutorial 2022 (Xcode)
6:43
Swift - What is "self"?
2:40
Sean Allen
Переглядів 16 тис.
Environment Variables in SwiftUI
21:05
Stewart Lynch
Переглядів 4,8 тис.
SwiftUI Pie & Donut Charts - New in iOS 17
9:55
Sean Allen
Переглядів 3,8 тис.
New UIKit Button System - iOS 15 - Code & Storyboard
9:51
Sean Allen
Переглядів 25 тис.
Subscribe for more!! #procreate #logoanimation #roblox
0:11
Animations by danny
Переглядів 4 млн
САМЫЙ дешевый ПК с OZON на RTX 4070
16:16
Мой Компьютер
Переглядів 88 тис.