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
| // MARK: - TCAView | |
| public protocol TCAView: View where Body == WithViewStore<ScopedState, ScopedAction, Content> { | |
| associatedtype ViewState | |
| associatedtype ViewAction | |
| associatedtype ScopedState | |
| associatedtype ScopedAction | |
| associatedtype 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 PredicateSet<Element: Equatable> { | |
| var contains: (Element) -> Bool | |
| init(_ contains: @escaping (Element) -> Bool) { | |
| self.contains = contains | |
| } | |
| } | |
| extension PredicateSet: SetAlgebra { | |
| init() { |
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 Fluent | |
| import Vapor | |
| func routes(_ app: Application) throws { | |
| app.post("users") { req -> EventLoopFuture<User> in | |
| try User.Create.validate(req) | |
| let create = try req.content.decode(User.Create.self) | |
| guard create.password == create.confirmPassword else { | |
| throw Abort(.badRequest, reason: "Passwords did not match") | |
| } |
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
| // | |
| // Diagrams.swift | |
| // DiagramsSample | |
| // | |
| // Created by Chris Eidhof on 16.12.19. | |
| // Copyright © 2019 objc.io. 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
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| HStack { | |
| Text("Hello") | |
| .padding() | |
| .background(.blue) | |
| .overlay { | |
| Color.yellow |
NewerOlder