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 UIKit | |
@main | |
final class AppDelegate: UIResponder, UIApplicationDelegate { | |
private let testService: TestService = .init() | |
func application( | |
_ application: UIApplication, | |
configurationForConnecting connectingSceneSession: UISceneSession, | |
options: UIScene.ConnectionOptions) -> UISceneConfiguration |
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 Foundation | |
struct Route<T: PartialConvertible> { | |
let components: [Component] | |
enum Component { | |
case literal(String) | |
case component( | |
parse: (String, inout Partial<T>) -> Bool, | |
resolve: (T) -> 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
// | |
// DZKeyboardLayoutProxyView.swift | |
// | |
// Created by Davide De Franceschi on 25/02/2015. | |
// | |
import UIKit | |
final class DZKeyboardLayoutProxyView: UIView { | |
private var keyboardObserver: NSObjectProtocol? |
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
//MARK: - ??= | |
infix operator ??= { | |
associativity right | |
precedence 90 | |
assignment | |
} | |
func ??= <Wrapped> (inout optional: Wrapped?, @autoclosure defaultValue: () throws -> Wrapped?) rethrows { | |
optional = try optional ?? defaultValue() | |
} |
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
protocol Foo: Hashable { | |
var id: Int { get } | |
} | |
extension Foo { | |
var hashValue: Int { return id } | |
} | |
extension Int: Foo { | |
var id: Int { return self } | |
} |
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
// Copyright (c) 2014 Rob Rix. All rights reserved. | |
// MARK: BoxType | |
/// The type conformed to by all boxes. | |
public protocol BoxType { | |
/// The type of the wrapped value. | |
typealias Value | |
/// Initializes an intance of the type with a value. |
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
// Playground - noun: a place where people can play | |
import Swift | |
struct Yield2Generator<S: SequenceType, C: CollectionType>: GeneratorType { | |
var sequenceGenerator: S.Generator | |
var sequenceElement: S.Generator.Element? | |
let collection: C | |
var collectionGenerator: C.Generator | |
init(_ sequenceGenerator : S.Generator, _ collection : C) { |
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
// | |
// JSON.swift | |
// Boppl | |
// | |
// Created by Davide De Franceschi on 26/06/2015. | |
// Copyright (c) 2015 Boppl. All rights reserved. | |
// | |
import Foundation |
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
// | |
// FSLVExample.swift | |
// FSLVExample | |
// | |
// Created by Davide De Franceschi on 16/11/14. | |
// Copyright (c) 2014 Davide De Franceschi. All rights reserved. | |
// | |
import UIKit |