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 | |
@_functionBuilder | |
public struct StringBuilder { | |
public static func buildBlock(_ string: String) -> String { string } | |
public static func buildBlock(_ strings: String...) -> String { | |
strings.joined(separator: "") | |
} |
// | |
// DynamicTable.swift | |
// SwiftUIKit | |
// | |
// Created by Zach Eriksen on 1/19/20. | |
// | |
import UIKit | |
@available(iOS 9.0, *) |
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 { |
// | |
// NSMutableAttributedString+Swift.swift | |
// | |
// | |
// Created by Zach Eriksen on 12/11/19. | |
// | |
import Foundation | |
public typealias AttributedString = NSMutableAttributedString | |
public typealias AttributedStringKey = NSAttributedString.Key |
// | |
// NSObjectProtocol+Swift.swift | |
// | |
// | |
// Created by Zach Eriksen on 10/30/19. | |
// | |
import Foundation | |
public extension NSObjectProtocol { | |
@discardableResult |
import Foundation | |
public extension Optional { | |
func use(_ closure: (Wrapped) -> Void) { | |
guard let unwrappedSelf = self else { | |
return | |
} | |
closure(unwrappedSelf) | |
} | |
} |
I hereby claim:
To claim this, I am signing this object:
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 { |
import UIKit | |
precedencegroup KeyPathPrecedence { | |
associativity: right | |
higherThan: MultiplicationPrecedence | |
} | |
infix operator ...: KeyPathPrecedence |
extension Bool { | |
func `if`(_ block: () -> Bool) -> Bool { | |
return self ? block() : self | |
} | |
func `true`(_ block: () -> Void) -> Bool { | |
if self { | |
block() | |
} |