swiftui-viewmodifierbuilder

1.0.1

A result builder for ViewModifiers.
ericlewis/swiftui-viewmodifierbuilder

What's New

1.0.1

2022-02-18T22:04:30Z

Full Changelog: 1.0.0...1.0.1

  • Removes debug code that was left in place

ViewModifierBuilder

A result builder for ViewModifiers.

Example

import SwiftUI
import ViewModifierBuilder

struct ContentView: View {

  @State
  private var toggler = false
  
  var body: some View {
    VStack {
      Button("Toggle Modifier") {
        toggler.toggle()
      }
    }
    .modifiers {
      CustomModifier1()
      CustomModifier2()
      if toggler {
        CustomModifier3()
      }
    }
  }
}

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Oct 17 2024 18:29:38 GMT-0900 (Hawaii-Aleutian Daylight Time)