Environment Variables in SwiftUI

In this tutorial I explore Environment Variables in SwiftUI and use the documentation to learn what they are and how to use them. I will be exploring the @Environment propertyWrapper and will read the documentation to learn how to apply it. In the process I’ll explore some practical examples of both reading the current environment, but also be able to change certain environment values for specific views. Table of Contents: 0:00 Introduction 3:22 Our First Environment Variables 11:46 Environment Modifiers 16:57 PresentationMode, bindings and Wrapped values Starter Project Files: Completed Project: Video References: Big Nerd Range Blog on Class Sizes Property Wrappers Video SwiftUI Toolbar Video Other References: Stewart Lynch’s YouTube Channe
Back to Top