Skip to content

Instantly share code, notes, and snippets.

Why is this even a feature?

Zachary Waldowski zwaldowski

Why is this even a feature?
View GitHub Profile
View NavigationPopTransitionController.swift
final class NavigationPopTransitionController: UIPercentDrivenInteractiveTransition {
let navigationController: UINavigationController
private lazy var interactivePopGestureRecognizer = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(handle))
var ifInteractive: Self? {
interactivePopGestureRecognizer.state == .began ? self : nil
View OrString.swift
import Foundation
struct OrString<Wrapped>: Decodable where Wrapped: Decodable, Wrapped: LosslessStringConvertible {
var wrappedValue: Wrapped
init(wrappedValue: Wrapped) {
self.wrappedValue = wrappedValue
zwaldowski / AtGlobalVisitor.swift
Last active Apr 13, 2020
SwiftSyntax: Scanning for property wrappers
View AtGlobalVisitor.swift
import Foundation
import SwiftSyntax
class AtGlobalVisitor: SyntaxVisitor {
struct Result {
let name: String
let type: String
let location: SourceRange
let url: URL
View ffmpeg-lite.rb
class FfmpegLite < Formula
desc "Play, record, convert, and stream audio and video"
homepage ""
url ""
sha256 "1d0ad06484f44bcb97eba5e93c40bcb893890f9f64aeb43e46cd9bb4cbd6795d"
head ""
depends_on "nasm" => :build
depends_on "pkg-config" => :build
View workflow-release-pr.yml
name: Release checks
- master
- opened
- labeled
- unlabeled
View test.adoc

A [term]_method is like a function; you will learn more about them later.

A [term]_method_ is like a function; you will learn more about them later.

A [term]_method is like a function; you will learn more about them later.

zwaldowski / EventGenerator.swift
Created Apr 26, 2019
UIKit Touch Synthesis (Hacks! Hacks hacks! Hacks!)
View EventGenerator.swift
import UIKit
import ObjectiveC.runtime
// MARK: - IOKit
@objc private protocol IOHIDEvent: NSObjectProtocol {}
private struct IOHIDDigitizerEventMask: OptionSet {
let rawValue: UInt32
init(rawValue: UInt32) { self.rawValue = rawValue }
zwaldowski / DoneAccessoryView.swift
Created Feb 11, 2019
iOS Done Accessory Bar — The two versions below are mutually exclusive
View DoneAccessoryView.swift
import UIKit
class DoneAccessoryView: UIInputView {
private let toolbar = UIToolbar()
init() {
super.init(frame: .zero, inputViewStyle: .default)
translatesAutoresizingMaskIntoConstraints = false
allowsSelfSizing = true
You can’t perform that action at this time.