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 | |
| struct ContentView: View { | |
| @State var alertMessage: String = "" | |
| @State var showingAlert: Bool = false | |
| var body: some View { | |
| HStack(spacing: 20) { | |
| Button { | |
| alertMessage = "This is Ditto!!!" |
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 | |
| struct ContentView: View { | |
| var body: some View { | |
| VStack { | |
| Button { | |
| requestAuthorization() | |
| } label: { | |
| Text("Request Authorization") | |
| .font(Font.system(size: 24).bold()) |
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 | |
| struct ContentView: View { | |
| @State var numberString = "" | |
| @State var result = "" | |
| var body: some View { | |
| VStack { | |
| Text("Decimal Number -> Binary Number") | |
| TextField("Input Number", text: $numberString) |
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 | |
| struct ContentView: View { | |
| @State var pokemon = "" | |
| var body: some View { | |
| VStack { | |
| Text("Pokemon Name is \(pokemon)") | |
| Button { | |
| UserDefaults().setValue("Pikachu", forKey: "POKEMON") |
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 | |
| import Charts | |
| struct ContentView: View { | |
| var body: some View { | |
| ScrollView { | |
| VStack { | |
| // Vertical Graph | |
| Chart { | |
| BarMark( |
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 | |
| struct ContentView: View, MyProtocol { | |
| @State var text: String = "My Text" | |
| var body: some View { | |
| NavigationView { | |
| VStack { | |
| Text(text) | |
| NavigationLink(destination: SecondView(delegate: self)) { | |
| Text("2nd View") |
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 | |
| import AVFoundation | |
| struct ContentView: View { | |
| @State var player: AVAudioPlayer? | |
| var body: some View { | |
| VStack { | |
| Button { | |
| let url = Bundle.main.url(forResource: "drum", withExtension: "mp3")! | |
| do { |
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 | |
| struct ContentView: View { | |
| let pokemonData = [ | |
| Column( | |
| title: "No", | |
| rows: ["143", "1", "7", "50", "143", "1", "7", "50", "143", "1", "7", "50", "143", "1", "7", "50", "143", "1", "7", "50", "143", "1", "7", "50"] | |
| ), | |
| Column( | |
| title: "Name", |
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 | |
| struct ContentView: View { | |
| @State var path: [ViewPath] = [] | |
| var body: some View { | |
| NavigationStack(path: $path) { | |
| VStack { | |
| Text("ContentView") | |
| .font(.title) |
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 | |
| struct ContentView: View { | |
| @State var message = "" | |
| @State var showingAlert = false | |
| var body: some View{ | |
| VStack { | |
| Button { | |
| Task { | |
| do { |