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 GitHubData: Codable { | |
var items: [Item] | |
} | |
struct Item: Codable, Identifiable { | |
var id: Int | |
var fullName: String | |
var description: 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
import SwiftUI | |
struct GitHubData: Codable { | |
var items: [Item] | |
} | |
struct Item: Codable, Identifiable { | |
var id: Int | |
var fullName: String | |
var description: 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
import SwiftUI | |
struct GitHubData: Codable, Identifiable { | |
var id: Int | |
var fullName: String | |
var description: String? | |
var stargazersCount: Int | |
enum CodingKeys: String, CodingKey { | |
case id = "id" |
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 CoreData | |
struct ContentView: View { | |
@State private var taskName: String = "" | |
@Environment(\.managedObjectContext) var context | |
@FetchRequest( | |
entity: Task.entity(), | |
sortDescriptors: [NSSortDescriptor(keyPath: \Task.dateAdded, ascending: true)], | |
predicate: NSPredicate(format: "isComplete == %@", NSNumber(value: false)) |
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 SDWebImage | |
import SDWebImageSwiftUI | |
struct Dog: Codable, Identifiable { | |
public var id: String | |
public var status: String | |
enum CodingKeys: String, CodingKey { | |
case id = "message" |
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 SDWebImage | |
import SDWebImageSwiftUI | |
struct ContentView: View { | |
var body: some View { | |
// add process | |
} | |
} |
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 Dog: Codable, Identifiable { | |
public var id: String | |
public var status: String | |
enum CodingKeys: String, CodingKey { | |
case id = "message" | |
case status = "status" | |
} |
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 | |
class ImageDownloader : ObservableObject { | |
@Published var downloadData: Data? = nil | |
func downloadImage(url: String) { | |
guard let imageURL = URL(string: url) else { return } | |
DispatchQueue.global().async { |
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 Combine | |
struct Movie: Codable, Identifiable { | |
public var id: Int | |
public var name: String | |
public var released: String | |
enum CodingKeys: String, CodingKey { | |
case id = "id" |
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 { | |
List { | |
Section(header: Text("Section1"), footer: Text("Footer")) { | |
Text("row1") | |
Text("row2") | |
Text("row3") | |
} |