This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generic version of https://gist.github.com/chriseidhof/5ff6ef8786f5635c18b20304ab9d9b01 | |
extension View { | |
/// Convenience for setting a `_ViewTraitKey` | |
func withTrait<Trait, Value>(_: Trait.Type, value: Value) -> some View | |
where Trait: _ViewTraitKey, Value == Trait.Value | |
{ | |
_trait(Trait.self, value) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
@main | |
struct BrushedMetalDemoApp: App { | |
var body: some Scene { | |
WindowGroup { | |
BrushedMetalView { | |
ContentView() | |
} | |
} |
OlderNewer