ClutchEngineering / ClutchEngineering/slipstream

Implement EmptyModifier

Open
#28 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Swift
Stars
74
Forks
3
PR merge metrics
No merged PRs in 30d

Description

SwiftUI documentation for the same type: https://developer.apple.com/documentation/swiftui/emptymodifier:

> Use the empty modifier to switch modifiers at compile time during development. In the example below, in a debug build the [Text](https://developer.apple.com/documentation/swiftui/text) view inside ContentView has a yellow background and a red border. A non-debug build reflects the default system, or container supplied appearance.
>
> ```swift
> struct EmphasizedLayout: ViewModifier {
> func body(content: Content) -> some View {
> content
> .background(Color.yellow)
> .border(Color.red)
> }
> }
>
>
> struct ContentView: View {
> var body: some View {
> Text("Hello, World!")
> .modifier(modifier)
> }
>
>
> var modifier: some ViewModifier {
> #if DEBUG
> return EmphasizedLayout()
> #else
> return EmptyModifier()
> #endif
> }
> }
> ```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.