Skip to content

Instantly share code, notes, and snippets.

@andreyz
andreyz / UIEdgeInsets+Extension.swift
Last active February 17, 2018 21:59
Initialisers through key paths
public extension UIEdgeInsets {
public var vertical: CGFloat {
get { return 0 } // meaningless but not fatal
set { (top, bottom) = (newValue, newValue) }
}
public var horizontal: CGFloat {
get { return 0 } // meaningless but not fatal
set { (left, right) = (newValue, newValue) }
}
import UIKit
class TouchForwardingView: UIView {
var passthroughViews: [UIView] = []
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
guard let hitView = super.hitTest(point, with: event) else { return nil }
guard hitView == self else { return hitView }

Keybase proof

I hereby claim:

  • I am andreyz on github.
  • I am andreyz (https://keybase.io/andreyz) on keybase.
  • I have a public key whose fingerprint is C8AA 43DE 0B55 A0B6 6F25 A6A9 52BA F05C 980F 07B3

To claim this, I am signing this object:

@andreyz
andreyz / about.md
Created August 10, 2011 19:57 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer