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 | |
| @State var year = "1880" | |
| @State var ascending = true | |
| @State var someValue = "value" | |
| @FetchRequest( | |
| entity: YearOfBirth.entity(), | |
| sortDescriptors: [NSSortDescriptor(key: "year", ascending: ascending.wrappedValue)], | |
| predicate: NSPredicate(format: "%K = %@", “someAttributeKey”, someValue.wrappedValue) | |
| ) 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
| //: [Previous](@previous) | |
| import SwiftUI | |
| import PlaygroundSupport | |
| struct PillTextView<U>: View where U : StringProtocol{ | |
| let action: () -> () | |
| let label: U | |
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 | |
| struct ExampleView: View { | |
| @ObservedObject var fetcher: ImageFetcher | |
| init(fetcher: ImageFetcher) { | |
| self.fetcher = fetcher |
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 | |
| struct SiriShortcutsActionCard<U>: View where U : StringProtocol { | |
| let action: () -> () | |
| let onMore:() -> () | |
| let iconImage: AnyView |
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 | |
| struct PhotoPickerDisplayer: View { | |
| @State var presentation: Bool = false | |
| @State var selectedImage: UIImage? = nil | |
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 BoolHolder: View { | |
| @State var boolProperty: Bool = false | |
| var body: some View { | |
| VStack{ | |
| if boolProperty { |
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 Foundation | |
| import SwiftUI | |
| import Combine | |
| //: Current Value Subject is a value, a publisher and a subscriber all in one | |
| let currentValueSubject = CurrentValueSubject<Bool, Never>(true) | |
| print(currentValueSubject.value) |
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
| // | |
| // ContentView.swift | |
| // FakeOvercast WatchKit Extension | |
| // | |
| // Created by Paul Wood on 8/8/19. | |
| // Copyright © 2019 Paul Wood. All rights reserved. | |
| // | |
| import SwiftUI | |
| import SFSafeSymbols |
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
| /// Just a Holder for a persistentContainer that is lazily loaded | |
| class TestPersistentContainer { | |
| lazy var persistentContainer: NSPersistentContainer = { | |
| let bundle = Bundle(for: CoreDataService.self) | |
| let modelURL = bundle.url(forResource: CoreDataModelName, withExtension: "momd")! | |
| let mom = NSManagedObjectModel(contentsOf: modelURL)! | |
| let container = NSPersistentContainer(name: "LateralModel", | |
| managedObjectModel: mom) | |
| let description = container.persistentStoreDescriptions.first! | |
| description.url = URL(fileURLWithPath: "/dev/null") |
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
| // | |
| // ContentView.swift | |
| // OrderedList | |
| // | |
| // Created by Paul Wood on 8/18/19. | |
| // Copyright © 2019 Paul Wood. All rights reserved. | |
| // | |
| import SwiftUI | |
| import Combine |