How To Switch To Dark Mode Using Picker and @AppStorage In SwiftUI (Dark Mode In SwiftUI)

Опубликовано: 25 Май 2022
на канале: tundsdev
4,101
119

How To Switch To Dark Mode Using Picker and @AppStorage In SwiftUI (Dark Mode In SwiftUI)

🤙🏾 Subscribe to the tundsdev YouTube channel
https://www.youtube.com/c/tundsdev?su...

⏭ Next Video
My Top 5 iOS Development Tools (Best iOS development tools)
   • My Top 5 iOS Development Tools (Best ...  

⏮ Previous Video
Intro to MVVM with Example Refactor And Passing Data Between Views In SwiftUI
   • SwiftUI MVVM Example | See How To Ref...  

Ready to level up your SwiftUI skills?🚀

Learn how to tackle take-home projects in SwiftUI, nail interviews, and more with this FREE course!📚

This YouTube playlist teaches you everything you need know to land your first iOS role 🫂

📹    • SwiftUI Take Home Project (Beginner L...  

In this video, we're going to take a look at how we can adjust for dark mode in swiftui project. We're first of all going to discuss the different possible ways to provide our SwiftUI Color and Image assets with Light and Dark Mode variants. So we can see how to set up dark mode for images and how to set up dark mode for colors, so the system can handle this for us. By toggling the simulator's appearance which allows us in SwiftUI adapting for dark mode to switch between light and dark mode in our SwiftUI app.

Then after looking into that we'll see how we will look at how we can change between light and dark mode in a SwiftUI app programmatically by using the colorScheme Environment value in SwiftUI and also prefferedColorScheme in SwiftUI. Which allows us to adjust to SwiftUI Dark Mode in a SwiftUI app.

Finally, we'll look at adding in a SwiftUI Picker, which allows us to save the user's SwiftUI preferred color scheme in @AppStorage so that we can see how to save a dark mode setting in user defaults in our SwiftUI app, so that when it closes and reopens our preferred color scheme remains the same in this SwiftUI Dark Mode tutorial.

How to manage colors in Xcode (Xcode Color Management, SwiftUI Color, Manage Colors In Xcode)
   • How to manage colors in Xcode (Xcode ...  

GitHub link:
https://github.com/tunds?tab=reposito...

SwiftUI Sessions Playlist:
   • Learn SwiftUI From Scratch In This Fr...