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 private var fileUrl: URL? | |
| @State private var showingPicker = false | |
| var body: some View { | |
| VStack { | |
| Button { | |
| let documentDirectoryUrl = FileManager.default.urls( for: .documentDirectory, in: .userDomainMask ).first! |
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 ActivityViewController: UIViewControllerRepresentable { | |
| var activityItems: [Any] | |
| var applicationActivities: [UIActivity]? = nil | |
| func makeUIViewController(context: UIViewControllerRepresentableContext<ActivityViewController>) -> UIActivityViewController { | |
| let controller = UIActivityViewController(activityItems: activityItems, applicationActivities: applicationActivities) | |
| return controller | |
| } |
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 scale: CGFloat = 1.0 | |
| var body: some View { | |
| Image(.icon) | |
| .resizable() | |
| .scaleEffect(scale) | |
| .frame(width: 200, height: 200) |
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 { | |
| ImageViewerView(image: UIImage(named: "icon")!) | |
| } | |
| } | |
| #Preview { | |
| ContentView() |
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 { | |
| ImageViewerView(imageName: "icon") | |
| .ignoresSafeArea(.all, edges: .all) | |
| } | |
| } | |
| #Preview { |
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 Markdown | |
| struct ContentView: View { | |
| let markdown = """ | |
| # 東京タワー | |
| 東京タワー(とうきょうタワー、英: Tokyo Tower)は、東京都港区芝公園にある総合電波塔である。日本電波塔(にっぽんでんぱとう)とも呼ばれる。 | |
| 1958年(昭和33年)12月23日竣工。東京のシンボル、観光名所である。 |
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 showingSnorlaxView = false | |
| @State var showingSlowpokeView = false | |
| var body: some View { | |
| VStack { | |
| Button(action: { | |
| showingSnorlaxView = true |
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 { | |
| List { | |
| Section("Normal") { | |
| Text("Meowth") | |
| Text("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 { | |
| @State var text = "Snorlax" | |
| var body: some View { | |
| VStack { | |
| Text(text) | |
| Button(action: { | |
| text = "Forever" |
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 { | |
| TabView { | |
| Text("First Tab") | |
| .tabItem { | |
| Image(systemName: "1.square.fill") | |
| Text("First") | |
| } |