Загрузка...

Preferred ColorScheme in SwiftUI

In this video, I am going to show you how you can give your users the ability to choose whether or not they want to have your app displayed in dark or light mode, or let it be applied as per the system settings.

We will be looking at the colorScheme environment variable as well as the SwiftUI preferredColorScheme view modifier, as well as the UIWindow's overrideUserInterfaceStyle property.

If you want to support my work, you can buy me a coffee :)
https://ko-fi.com/stewartlynch

******** Download my StewartLynch YouTube Channel Application - Free ***********
https://stewartlynch.gumroad.com/l/obsjz

Table of Contents:
0:00 Introduction
2:09 ColorScheme Environment variable
3:22 PreferredColorScheme
6:57 OverrideUserInterfaceStyle

Starter Project Files:
http://www.createchsol.com/StarterProjects/LightOrDark-Starter.zip

Completed Project:
https://github.com/StewartLynch/LightOrDark

References mentioned in video:
Gavin Jerman's Gist
https://gist.github.com/gavinjerman/a862e3dffa03468b8d1a5cf14e1c1f4f
WriteFreely:
https://github.com/writefreely/writefreely-swiftui-multiplatform

Other References:
Stewart Lynch's YouTube Channel:
https://youtube.com/StewartLynch
Stewart Lynch on Twitter:
https://twitter.com/StewartLynch

Видео Preferred ColorScheme in SwiftUI канала Stewart Lynch
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять