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
| //: [Previous](@previous) | |
| import SwiftUI | |
| import PlaygroundSupport | |
| enum AlertTypes: String, Identifiable { | |
| case simple = "A Simple Alert" | |
| case complex = "A Complex Alert" |
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 PlaygroundSupport | |
| struct Name: Identifiable, ExpressibleByStringLiteral { | |
| var name: String | |
| public init(stringLiteral value: Swift.StringLiteralType) { | |
| self.name = value | |
| } | |
| var id: String { return 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
| public struct List<SelectionValue, Content> : View where SelectionValue : Hashable, Content : View { | |
| public init(selection: Binding<Set<SelectionValue>>?, @ViewBuilder content: () -> Content) | |
| } |
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
| struct NameHolder: Nameable { | |
| var id: String { return name } | |
| var name: String | |
| init<U>(nameable name: U) where U: Nameable { | |
| self.name = name.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
| // | |
| // ListOfAnimals.swift | |
| // AnimalList | |
| // | |
| // Created by Paul Wood on 8/4/19. | |
| // Copyright © 2019 Paul Wood. All rights reserved. | |
| // | |
| import SwiftUI |
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
| struct Item: View, Identifiable { | |
| let forInt: Int | |
| var id: String { | |
| return "\(forInt)" | |
| } | |
| var body : some View { | |
| //: Make this view more complex | |
| HStack{ | |
| Text("\(forInt)") | |
| } |
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
| @Environment(\.managedObjectContext) var managedObjectContext | |
| @FetchRequest(fetchRequest: YearOfBirth.allFetchRequest()) var years: FetchedResults<YearOfBirth> |
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
| // | |
| // NamesByYearView.swift | |
| // NameList | |
| // | |
| // Created by Paul Wood on 7/31/19. | |
| // Copyright © 2019 Paul Wood. All rights reserved. | |
| // | |
| import SwiftUI | |
| import CoreData |
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
| // | |
| // NamesByYearView.swift | |
| // NameList | |
| // | |
| // Created by Paul Wood on 7/31/19. | |
| // Copyright © 2019 Paul Wood. All rights reserved. | |
| // | |
| import SwiftUI | |
| import CoreData |
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 CoreData | |
| import Combine | |
| struct NamesByYearView: View { | |
| @EnvironmentObject var coreDataStack: CoreDataStack | |
| @Environment(\.managedObjectContext) var managedObjectContext | |
| @EnvironmentObject var importer: NameDatabaseImporter | |