I hereby claim:
- I am 0xLeif on github.
- I am l_eif (https://keybase.io/l_eif) on keybase.
- I have a public key ASDxGDsRglqF5yBeAx4l6hLrEzjDrk6kVIz4S44CQ_GU4wo
To claim this, I am signing this object:
import UIKit | |
import RxSwift | |
class TFObservable<E> { | |
var disposable: Disposable | |
private var trueBlock: ((E) -> Void)? | |
private var falseBlock: ((E) -> Void)? | |
init() { |
import Foundation | |
protocol Buildable { | |
init() | |
init(_ build: (inout Self) -> Self) | |
} | |
extension Buildable { | |
init(_ build: (inout Self) -> Self) { | |
var s = Self() |
extension Bool { | |
func `if`(_ block: () -> Bool) -> Bool { | |
return self ? block() : self | |
} | |
func `true`(_ block: () -> Void) -> Bool { | |
if self { | |
block() | |
} |
import UIKit | |
precedencegroup KeyPathPrecedence { | |
associativity: right | |
higherThan: MultiplicationPrecedence | |
} | |
infix operator ...: KeyPathPrecedence |
import UIKit | |
postfix operator ... | |
protocol UIConfigurable { | |
func configure<T>(_ configure: (inout T) -> Void) -> T | |
static func ...<T>(_ lhs: Self, _ block: (inout T) -> Void) -> T | |
} | |
extension UIView: UIConfigurable { |
I hereby claim:
To claim this, I am signing this object:
import Foundation | |
public extension Optional { | |
func use(_ closure: (Wrapped) -> Void) { | |
guard let unwrappedSelf = self else { | |
return | |
} | |
closure(unwrappedSelf) | |
} | |
} |
// | |
// NSObjectProtocol+Swift.swift | |
// | |
// | |
// Created by Zach Eriksen on 10/30/19. | |
// | |
import Foundation | |
public extension NSObjectProtocol { | |
@discardableResult |
// | |
// NSMutableAttributedString+Swift.swift | |
// | |
// | |
// Created by Zach Eriksen on 12/11/19. | |
// | |
import Foundation | |
public typealias AttributedString = NSMutableAttributedString | |
public typealias AttributedStringKey = NSAttributedString.Key |
class LazyTable: UITableView { | |
fileprivate var loadThreshold: CGFloat = 0.75 // 75% | |
fileprivate var loadAmount: Int = 25 | |
fileprivate var loadCount: Int = 1 | |
fileprivate var batchCount: Int { | |
return loadAmount * loadCount | |
} | |
fileprivate var elements: [UIView] = [] { | |
didSet { |