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 | |
let buildLog = """ | |
""" | |
let regex = try! NSRegularExpression(pattern: "(\\d*.\\d*)ms.*/(.*\\.swift)*", options: []) | |
let range = NSRange(location: 0, length: (buildLog as NSString).length) | |
let results = regex.matches(in: buildLog, options: [], range: range) |
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
@testable import 'Your Target Name' | |
import UIKit | |
import Foundation | |
/// Define this protocol in your target | |
// protocol AutoPrivatePropertyAccessible {} | |
// MARK: - PrivatePropertyAccessible | |
protocol PrivatePropertyAccessible { | |
associatedtype PrivatePropertiesCompatible |
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
@testable import 'Your Target Name' | |
import UIKit | |
import Foundation | |
/// Define this protocol in your target | |
// protocol AutoPrivatePropertyAccessible {} | |
// MARK: - PrivatePropertyAccessible | |
protocol PrivatePropertyAccessible { | |
associatedtype PrivatePropertiesCompatible |
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
// This sample works on Swift4.2 and Swift5! | |
// Let's try to execute this sample with Playground! | |
import Foundation | |
// - MARK: Artificially RxSwift classes | |
public enum Rx { | |
public final class Observable<E> {} |
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 RxCocoa | |
import RxSwift | |
public protocol RxDUCValueType { | |
associatedtype E | |
var rawValue: E { get } | |
init(_ value: E, equals: @escaping (E, E) -> Bool) |
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 | |
// - MRAK: Constraint | |
struct Constraint { | |
private let _constraint: (UIView, UIView) -> NSLayoutConstraint | |
init(_ constraint: @escaping (UIView, UIView) -> NSLayoutConstraint) { | |
self._constraint = constraint |
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 | |
@dynamicMemberLookup | |
final class DynamicUserDefaults { | |
static var standard: DynamicUserDefaults { | |
return DynamicUserDefaults(.standard) | |
} | |
private let keys = Keys() |
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
struct Weak<T: AnyObject> { | |
private let o: () -> T? | |
init(_ o: T) { | |
self.o = { [weak o] in o } | |
} | |
} | |
extension Weak { | |
func `do`<U>(execute: (T) -> U?) -> U? { |
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 Combine | |
import FirebaseAuth | |
public struct CombineAuth { | |
fileprivate let auth: Auth | |
} | |
extension CombineAuth { | |
public enum Error: Swift.Error { |
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 UIKit | |
@_functionBuilder struct ConstraintBuilder { | |
static func buildBlock<T, U>(_ from: NSLayoutAnchor<T>, | |
_ relation: Relation<U>, | |
_ to: NSLayoutAnchor<T>) -> NSLayoutConstraint { | |
return U.constraint(from: from, to: to, constant: relation.constant) | |
} | |
} |