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

  Рет қаралды 15,899

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 3 жыл бұрын
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 3 жыл бұрын
Always up to watch your videos, Sean!
@seanallen
@seanallen 3 жыл бұрын
Thanks for the support, Omair!
@rahuljamba5846
@rahuljamba5846 Жыл бұрын
Really Enjoyed Your Video Thanks a lot Allen
@prachibile2798
@prachibile2798 7 ай бұрын
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 7 ай бұрын
Glad you enjoy it!
@andrepaesh
@andrepaesh 3 жыл бұрын
Thanks for the video, Sean!
@seanallen
@seanallen 2 жыл бұрын
No problem, Andre. Happy to help.
@lembani
@lembani 3 жыл бұрын
Great content Sean!
@seanallen
@seanallen 3 жыл бұрын
Thanks for the kind words, Lembani!
@mysysd2915
@mysysd2915 Жыл бұрын
Thanks a lot ! 👍
@MarvelousLXVII
@MarvelousLXVII 3 жыл бұрын
Pretty cool stuff. Nice video.
@seanallen
@seanallen 3 жыл бұрын
Thanks Marvelous 👍
@judy8821
@judy8821 3 жыл бұрын
Great explanation
@seanallen
@seanallen 2 жыл бұрын
Glad you liked it
@cristopherescorcia3276
@cristopherescorcia3276 3 жыл бұрын
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?
@peerview
@peerview 3 жыл бұрын
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 3 жыл бұрын
To be honest, I've haven't worked with camera sensors or LiDAR, so I'm probably not the best person to teach that.
@davidjimenezquiroga5638
@davidjimenezquiroga5638 3 жыл бұрын
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 3 жыл бұрын
I'm using Core Data in the app I'm currently building, so future videos on that topic are likely.
@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 3 ай бұрын
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
Рет қаралды 18 М.
NavigationStack - SwiftUI Programmatic Navigation - iOS 16
20:20
Box jumping challenge, who stepped on the trap? #FunnyFamily #PartyGames
00:31
Family Games Media
Рет қаралды 18 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 10 МЛН
@EnvironmentObject Explained in SwiftUI | iOS 17
21:16
AppStuff
Рет қаралды 5 М.
Your App Will Get Rejected | New Privacy Rules - 2024
11:26
Sean Allen
Рет қаралды 35 М.
How to use @ViewBuilder in SwiftUI | Advanced Learning #9
24:01
Swiftful Thinking
Рет қаралды 25 М.
CloudKit - Intro, Pricing, Terms, & Definitions
17:26
Sean Allen
Рет қаралды 22 М.
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
The Story of Next.js
12:13
uidotdev
Рет қаралды 560 М.
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 43 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 8 МЛН
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 7 МЛН
Сколько реально стоит ПК Величайшего?
0:37