Download test.csv from MCES10-Software/SwiftUI-Code-Examples: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/datasets/MCES10-Software/SwiftUI-Code-Examples/resolve/main/test.csv
- Command line
-
hf download hf://datasets/MCES10-Software/SwiftUI-Code-Examples/test.csv
-
curl -L -o test.csv https://huggingface.co/datasets/MCES10-Software/SwiftUI-Code-Examples/resolve/main/test.csv
1.49 kB
| prompt,output | |
| Create a SwiftUI view with a button that changes text on tap,"import SwiftUI | |
| struct ContentView: View { | |
| @State private var text = ""Hello, World!"" | |
| var body: some View { | |
| VStack { | |
| Text(text) | |
| .font(.largeTitle) | |
| Button(""Tap me"") { | |
| text = ""Button Tapped!"" | |
| } | |
| .padding() | |
| } | |
| } | |
| }" | |
| Create a SwiftUI view with a TextField and a Text showing its value,"import SwiftUI | |
| struct ContentView: View { | |
| @State private var name = """" | |
| var body: some View { | |
| VStack { | |
| TextField(""Enter your name"", text: $name) | |
| .textFieldStyle(RoundedBorderTextFieldStyle()) | |
| .padding() | |
| Text(""Hello, \(name)!"") | |
| .font(.title) | |
| } | |
| .padding() | |
| } | |
| }" | |
| Create a SwiftUI List with 5 items,"import SwiftUI | |
| struct ContentView: View { | |
| let items = [""Item 1"", ""Item 2"", ""Item 3"", ""Item 4"", ""Item 5""] | |
| var body: some View { | |
| List(items, id: \ .self) { item in | |
| Text(item) | |
| } | |
| } | |
| }" | |
| Create a SwiftUI view with a toggle switch,"import SwiftUI | |
| struct ContentView: View { | |
| @State private var isOn = false | |
| var body: some View { | |
| VStack { | |
| Toggle(""Enable Feature"", isOn: $isOn) | |
| .padding() | |
| Text(isOn ? ""Feature is ON"" : ""Feature is OFF"") | |
| .font(.title) | |
| } | |
| .padding() | |
| } | |
| }" | |