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 UIKit | |
protocol Identifiable: class { | |
static var identifier: String { get } | |
} | |
extension Identifiable { | |
static var identifier: String { | |
return String(describing: self) | |
} |
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 Foundation | |
import XCTest | |
public enum MockError: Error { | |
case error | |
} | |
public class Mock<T> { | |
public enum Count { | |
case toBeZero |
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 Foundation | |
import RxSwift | |
import Action | |
struct Alert { | |
struct Option { | |
enum Style { | |
case cancel | |
case destructive | |
case `default` |
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 Foundation | |
import Action | |
protocol ClosableView: class { | |
var closeBarButtonItem: UIBarButtonItem? { get set } | |
func setCloseAction(_ action: CocoaAction) | |
func setCloseTitle(_ title: String) | |
} | |
private struct AssociatedKeys { |
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 UIKit | |
protocol TitlableView { | |
func setTitle(_ title: String) | |
} | |
extension TitlableView where Self: UIViewController { | |
func setTitle(_ title: String) { | |
navigationItem.title = title | |
} |
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 UIKit | |
import RxSwift | |
struct AppState { | |
let countState: CountState | |
} | |
struct AppReducer: Reducible { | |
let countReducer = CountReducer() | |
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 FBSnapshotTestCase | |
import UIKit | |
protocol SnapshotView { | |
var view: UIView! { get } | |
} | |
extension UIView: SnapshotView { | |
var view: UIView! { return self } | |
} |
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 UIKit | |
import SnapKit | |
extension UIView { | |
func addSubview(_ child: UIView, constraints: (ConstraintMaker) -> ()) { | |
addSubview(child) | |
child.snp.makeConstraints(constraints) | |
} | |
} |
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 Initializable { | |
init() | |
} | |
func createInstance<T>(_ type: T.Type) -> T where T: Initializable { | |
return type.init() | |
} | |
extension UIView: Initializable { } |