Skip to content

Instantly share code, notes, and snippets.

@kutschenator
kutschenator / StaticallyAccessible.swift
Last active September 4, 2017 13:36
StaticallyAccessible
postfix operator ~
protocol StaticallyAccessible { }
extension StaticallyAccessible {
static postfix func ~ (c: Self) -> Self.Type {
return type(of: c)
}
var 🌩: Self.Type {
return type(of: self)
}
@kutschenator
kutschenator / PassThroughView.swift
Created January 31, 2015 07:09
Implementation of PassThroughView in Swift
import Foundation
import UIKit
class PassThroughView: UIView {
override func pointInside(point: CGPoint, withEvent event: UIEvent?) -> Bool {
for subview in subviews as [UIView] {
if !subview.hidden && subview.alpha > 0 && subview.userInteractionEnabled && subview.pointInside(convertPoint(point, toView: subview), withEvent: event) {
return true
}
}