Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ericlewis/swiftui-viewmodifierbuilder
A result builder for ViewModifiers.
https://github.com/ericlewis/swiftui-viewmodifierbuilder
helper ios macos resultbuilder swift swiftui tvos utility viewmodifier watchos
Last synced: 2 months ago
JSON representation
A result builder for ViewModifiers.
- Host: GitHub
- URL: https://github.com/ericlewis/swiftui-viewmodifierbuilder
- Owner: ericlewis
- Created: 2022-02-02T00:02:04.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-22T19:29:47.000Z (almost 3 years ago)
- Last Synced: 2024-09-16T05:21:30.519Z (3 months ago)
- Topics: helper, ios, macos, resultbuilder, swift, swiftui, tvos, utility, viewmodifier, watchos
- Language: Swift
- Homepage:
- Size: 10.7 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ViewModifierBuilder
[![](https://img.shields.io/badge/Swift_Package_Manager-compatible-ed702d.svg?style=flat)](https://github.com/apple/swift-package-manager)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fericlewis%2Fswiftui-viewmodifierbuilder%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/ericlewis/ViewModifierBuilder)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fericlewis%2Fswiftui-viewmodifierbuilder%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/ericlewis/ViewModifierBuilder)A [result builder](https://github.com/apple/swift-evolution/blob/main/proposals/0289-result-builders.md) for [ViewModifiers](https://developer.apple.com/documentation/swiftui/viewmodifier/).
## Example
```swift
import SwiftUI
import ViewModifierBuilderstruct ContentView: View {
@State
private var toggler = false
var body: some View {
VStack {
Button("Toggle Modifier") {
toggler.toggle()
}
}
.modifiers {
CustomModifier1()
CustomModifier2()
if toggler {
CustomModifier3()
}
}
}
}```