We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 107b8e5 commit def5c35Copy full SHA for def5c35
‎SwiftUI2048/SwiftUIExtensions.swift‎
@@ -15,3 +15,8 @@ extension View {
15
}
16
17
18
+
19
+postfix operator >*
20
+postfix func >*<V>(lhs: V) -> AnyView where V: View {
21
+ return lhs.eraseToAnyView()
22
+}
‎SwiftUI2048/Views/GameView.swift‎
@@ -115,12 +115,10 @@ struct GameView : View {
115
116
117
var body: AnyView {
118
- if gestureEnabled {
119
- return content
120
- .gesture(gesture, including: .all)
121
- .eraseToAnyView()
122
- }
123
- return content.eraseToAnyView()
+ return gestureEnabled ? (
+ content
+ .gesture(gesture, including: .all)>*
+ ) : content>*
124
125
126
0 commit comments