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
struct ContentView: View { | |
let urls: [URL] = [ | |
.init(string: "https://webcg.ismcdn.jp/mwimgs/0/f/640wm/img_0f0ccf94fbdcfab41992550a42460808110746.jpg")!, | |
.init(string: "https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Tour_Eiffel_Wikimedia_Commons_%28cropped%29.jpg/640px-Tour_Eiffel_Wikimedia_Commons_%28cropped%29.jpg")!, | |
] | |
var body: some View { | |
ScrollView { | |
LazyVStack(spacing: 40) { | |
ForEach(urls, id: \.self) { url in |
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
// 1. Add Person | |
// 2. Add Car | |
// 3. Delete Person(or Car) | |
import SwiftUI | |
import SwiftData | |
@main | |
struct Xcode17_SampleApp: App { | |
var body: some Scene { |
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
// Previewだと動くがシミュレーターだと動かない | |
// 原因? Environment(\.openURL), NavigationLink | |
struct ContentView: View { | |
let urls: [URL] = [ | |
URL(string: "https://github.com")!, | |
URL(string: "https://github.com")!, | |
URL(string: "https://github.com")!, | |
] | |
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
struct ContentView: View { | |
@State var text = "" | |
var body: some View { | |
NavigationStack { | |
List { | |
TextField("Text", text: $text) | |
} | |
//.padding(.top, 10) | |
.toolbarBackground(.visible, for: .navigationBar) |
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 | |
import CoreLocationUI | |
struct ContentView: View { | |
let colors: [Color] = [ | |
.white, | |
Color(.secondarySystemGroupedBackground), | |
Color(.lightText), | |
Color(.systemBackground), | |
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
// | |
// ContentView.swift | |
// | |
import SwiftUI | |
struct AppInfo: Identifiable, Equatable { | |
let id = UUID() | |
let color: Color | |
let name: String |
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
// | |
// ContentView.swift | |
// | |
import SwiftUI | |
struct ContentView: View { | |
@State var path = NavigationPath() | |
var body: some View { |
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 var searchText: String = "" | |
@State var dogType: DogType = .all | |
@State var searchHistory: [String] = ["choco", "kinako", "malon"] | |
let dogs: [Dog] = [ | |
.init(name: "mugi", color: .orange, type: .poodle), | |
.init(name: "mugi", color: .red, type: .chihuahua), |
NewerOlder