I hereby claim:
- I am sanekgusev on github.
- I am sanekgusev (https://keybase.io/sanekgusev) on keybase.
- I have a public key ASA6pUUO04wDkVzDocxv9k0dlBlgt-CKiFaQ3DD_-GbImwo
To claim this, I am signing this object:
import UIKit | |
import ObjectiveC.runtime | |
private class TargetActionClosureAdapter<T : AnyObject> { | |
typealias Closure = (sender: T!) -> Void | |
private let closure: Closure | |
private init() { |
.section __TEXT,__cstring,cstring_literals | |
L_.super_ivar_name: | |
.ascii "_super" | |
.byte 0 | |
.section __TEXT,__text,regular,pure_instructions | |
.globl _SGVObjcMsgSendSuperTrampolineNew | |
.align 2 | |
; This function will be used as an IMP for a runtime-added method in the super-forwarding proxy. | |
; The goal is to keep all arguments intact and only modify the first argument (in x0) | |
; to point to an 'objc_super' struct instead of proxy instance, and then simply tail-call to objc_msgSendSuper |
// this method ensures that blocks enqueued onto global GCD queues by the previous test method | |
// have finished executing and can have no side effects on the following test methods | |
// NOTE: This does not affect any private queues: any queued, but unfinished blocks may still be running off those | |
// unless properly cancelled by the code managing those queues | |
func ensureGlobalQueuesDrained() { | |
// all of the below only makes sense if we're running on the main thread | |
assert(NSThread.isMainThread()) | |
// construct an array of all concurrent global queues |
// MARK: Interface | |
public protocol ConnectionState: RawRepresentable { | |
var rawValue: String { get } | |
init?(rawValue: String) | |
} | |
public struct SensorReading<U: Unit> { | |
let name: String | |
let measurement: Measurement<U> |
import UIKit | |
extension NSLayoutXAxisAnchor { | |
func constraint(equalTo anchor: NSLayoutXAxisAnchor, | |
multiplier m: CGFloat, | |
constant c: CGFloat = 0.0) -> NSLayoutConstraint { | |
let constraint = self.constraint(equalTo: anchor, constant: c) | |
return constraint.constraint(multiplier: m) | |
} |
I hereby claim:
To claim this, I am signing this object:
import Foundation | |
func asynchronousFunction(with completion: @escaping () -> Void) { | |
DispatchQueue.global().async { | |
Thread.sleep(forTimeInterval: 1) | |
DispatchQueue.main.async { | |
print("running callback on main thread") | |
completion() | |
} | |
} |