This file contains 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 | |
struct ContentView: View { | |
var body: some View { | |
Button("Open Secondary Window") { | |
openSecond() | |
} | |
.frame(width: 400, height: 150) | |
} |
This file contains 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 | |
struct ContentView: View { | |
@State private var selectedRow: Int? | |
@State private var resultText = "" | |
var body: some View { | |
VStack { | |
List(0 ..< 5, selection: $selectedRow) { item in | |
HStack { |
This file contains 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 | |
struct ContentView: View { | |
@State private var showingSheet = false | |
@State private var counter = 0 | |
var body: some View { | |
VStack(spacing: 50.0) { | |
Text("Sheet has been shown \(counter) times.") |
This file contains 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
// https://eval.weheartswift.com/eval/playground/swift-sandbox | |
// https://swift.sandbox.bluemix.net/#/repl | |
// VARIABLES | |
//////////// | |
var hitPoints = 29 | |
print(hitPoints) | |
hitPoints = 12 |