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
// swiftlint:disable line_length | |
// swiftlint:disable variable_name | |
import Foundation | |
#if os(iOS) || os(tvOS) || os(watchOS) | |
import UIKit | |
#elseif os(OSX) | |
import AppKit | |
#endif |
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
final class LockValue<T> { | |
private var value: T | |
private let lock: NSRecursiveLock | |
// MARK: - Initializer | |
init(value: T) { | |
self.value = value | |
self.lock = NSRecursiveLock() | |
} |
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
enum Either<A, B> { | |
case left(A) | |
case right(B) | |
var left: A? { | |
return fold({ $0 }, { _ in nil }) | |
} | |
var right: B? { | |
return fold({ _ in nil }, { $0 }) |
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
protocol HasNetworkDependency { | |
var networkService: NetworkServiceProtocol { get } | |
} | |
protocol HasLoggerDependency { | |
var logger: LoggerProtocol { get } | |
} | |
protocol HasAnalyticsTrackerDependency { | |
var analyticsTracker: AnalyticsProtocol { get } |
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
// | |
// UITextField+BABAdditions.h | |
// | |
// Created by Vincent Bach on 06/09/15. | |
// Copyright © 2015 Vincent Bach. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UITextField (BABAdditions) |