Skip to content

Commit

Permalink
Convince Initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakr233 committed Sep 11, 2024
1 parent 33682de commit 1ba1eed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Example/ColorfulApp/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ enum CompilerCheck {
let view = AnimatedMulticolorGradientView()
view.setColors(.appleIntelligence)
view.setColors(MyPresets.white)

_ = MulticolorGradientView()
}
}
8 changes: 8 additions & 0 deletions Sources/ColorfulX/MulticolorGradientView+SwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ public struct MulticolorGradient: View {
_parameters = parameters
}

public init(parameters: MulticolorGradientView.Parameters) {
self.init(parameters: .init(get: {
parameters
}, set: { _ in
assertionFailure()
}))
}

public var body: some View {
MulticolorGradientViewRepresentable(parameters: $parameters)
}
Expand Down

0 comments on commit 1ba1eed

Please sign in to comment.