I hereby claim:
- I am banjun on github.
- I am banjun (https://keybase.io/banjun) on keybase.
- I have a public key ASCKLh62-ATKJawCqVs88yAl7RXvjVxgeGpW0T1LsZnF8Ao
To claim this, I am signing this object:
| import Cocoa | |
| class ViewController: NSViewController { | |
| let model = NSMutableDictionary() | |
| private(set) lazy var controller: NSObjectController = .init(content: model) | |
| let textView1 = NSTextView() | |
| let textView2 = NSTextView() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() |
| import Cocoa | |
| import CoreGraphics | |
| import Vision | |
| struct TargetWindow { | |
| let id: CGWindowID | |
| let bounds: CGRect | |
| init?(appName: String, windowTitle: String) { | |
| guard let windows = CGWindowListCopyWindowInfo(.optionAll, kCGNullWindowID) as? [[String: Any]] else { return nil } |
| // inspection whether repdocuces or not, SR-2750 | |
| // devxoul/Then a.k.a. `.then` | |
| // banjun/ikemen a.k.a. `※` | |
| func testWithTypeAnnotation() { | |
| let user = User().then { | |
| $0. // success completion | |
| } | |
| } |
| extension SignalProducer { | |
| // create SignalProducer that create Future with the autoclosure on start and send a result to the inner observer | |
| init(_ future: @escaping @autoclosure () -> Future<Value, Error>) { | |
| self.init { observer, _ in | |
| future() | |
| .onSuccess { | |
| observer.send(value: $0) | |
| observer.sendCompleted()} | |
| .onFailure { | |
| observer.send(error: $0)} |
I hereby claim:
To claim this, I am signing this object:
| import Cocoa | |
| import CoreMediaIO | |
| import AVFoundation | |
| class ViewController: NSViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| var prop = CMIOObjectPropertyAddress( | |
| mSelector: CMIOObjectPropertySelector(kCMIOHardwarePropertyAllowScreenCaptureDevices), |
| override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { | |
| guard let v = self.tableView(tableView, viewForHeaderInSection: section) else { return 0 } | |
| guard #available(iOS 11, *) else { | |
| let h = v.bounds.height | |
| return h > 0 ? h : UITableViewAutomaticDimension | |
| } | |
| return UITableViewAutomaticDimension // super call returns 0 on UITableViewController, though not overriding this cause behaviors like automatic. | |
| } | |
| override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { |
| LEGACY_SWIFT_PODS = [] # set all the derived pods initially. e.g. %w(BrightFutures JetToTheFuture) | |
| def set_legacy_swift(installer) | |
| UI.warn "#{LEGACY_SWIFT_PODS.count} pods are marked as legacy swift: #{LEGACY_SWIFT_PODS}" | |
| installer.pods_project.targets.select {|t| LEGACY_SWIFT_PODS.include? t.name}.each do |target| | |
| pod_target = installer.pod_targets.find {|t| t.name == target.name} | |
| unless pod_target.uses_swift? | |
| UI.warn "#{target.name} does not use Swift." |
| extension AVCaptureDevice { | |
| class func swizzle() { | |
| [(#selector(AVCaptureDevice.defaultDevice(withMediaType:)), #selector(AVCaptureDevice.mockDefaultDevice(withMediaType:)))].forEach { | |
| let original = class_getClassMethod(self, $0) | |
| let mock = class_getClassMethod(self, $1) | |
| method_exchangeImplementations(original, mock) | |
| } | |
| [(#selector(AVCaptureDevice.hasMediaType(_:)), #selector(AVCaptureDevice.mockHasMediaType(_:))), | |
| (#selector(AVCaptureDevice.supportsAVCaptureSessionPreset(_:)), #selector(AVCaptureDevice.mockSupportsAVCaptureSessionPreset)), | |
| (#selector(AVCaptureDevice.isTorchModeSupported(_:)), #selector(AVCaptureDevice.mockIsTorchModeSupported)), |
| <div class="mermaid"> | |
| graph LR | |
| subgraph ReactiveSwift | |
| Signal("Signal#lt;Value, Error#gt;(state = not completed)") | |
| Completed("(state = completed)") | |
| Signal -- "Signal.Event.value(Value)" --> Signal | |
| Signal -- "Signal.Event.failed(Error)" --> Completed | |
| Signal -- "Signal.Event.completed" --> Completed | |
| Signal -- "Signal.Event.interrupted" --> Completed | |
| end |