|
@ -10,28 +10,18 @@ import SwiftUI |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct ContentView: View { |
|
|
struct ContentView: View { |
|
|
@State private var score = 0 |
|
|
@State private var fullScreen = false |
|
|
|
|
|
|
|
|
var body: some View { |
|
|
var body: some View { |
|
|
NavigationView{ |
|
|
NavigationView{ |
|
|
|
|
|
|
|
|
Text("Score: \(score)") |
|
|
Button("Toogle full screen"){ |
|
|
.navigationTitle("Menu principal") |
|
|
self.fullScreen.toggle() |
|
|
.navigationBarItems( |
|
|
|
|
|
|
|
|
|
|
|
trailing: |
|
|
|
|
|
HStack{ |
|
|
|
|
|
Button("Add"){ |
|
|
|
|
|
self.score += 1 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Button("Sub"){ |
|
|
|
|
|
self.score -= 1 |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
.navigationBarTitle("Full Screen") |
|
|
|
|
|
.navigationBarHidden(fullScreen) |
|
|
} |
|
|
} |
|
|
|
|
|
.statusBar(hidden: fullScreen) |
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|