Your Second iOS & SwiftUI App

Nov 4 2021 Swift 5.5, iOS 15, Xcode 13

Part 2: Data Flow

13. Color Schemes

Lesson Complete

Play Next Lesson
Next
Save for later
About this episode
See versions

See course reviews

See forum comments
Cinema mode Mark as Complete Download course materials
Previous episode: 12. Image Binding Next episode: 14. Confirmation Dialogs

This video was last updated on Nov 4 2021

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

In iOS, you can easily set a color for your app that will be applied to certain views, like button labels, to achieve a desired theme.

    self.init(systemName: symbolName)
  }
}

extension View {

}
extension View {
  var previewedInAllColorSchemes: some View {

  }
}
  var previewedInAllColorSchemes: some View {
    ColorScheme
  }
  var previewedInAllColorSchemes: some View {
    ForEach(<#T##data: _##_#>, id: <#T##KeyPath<_.Element, _>#>, content: <#T##(_.Element) -> _#>)
    ColorScheme
  }
    ForEach(
      ColorScheme.allCases, id: <#T##KeyPath<_.Element, _>#>, content: <#T##(_.Element) -> _#>)

  }
      ColorScheme.allCases, id: \.self,
      content: <#T##(_.Element) -> _#>)
  }
      ColorScheme.allCases, id: \.self,
      content: preferredColorScheme
    )
      Book.Image(title: "📖")
    }
    .previewedInAllColorSchemes
  }
  static var previews: some View {
    ContentView()
      .previewedInAllColorSchemes
  }
  static var previews: some View {
    DetailView(book: .init(), image: .constant(nil))
      .previewedInAllColorSchemes
  }