Skip to content

Instantly share code, notes, and snippets.

@kutschenator
Created January 31, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kutschenator/17945454447c7ae766cb to your computer and use it in GitHub Desktop.
Save kutschenator/17945454447c7ae766cb to your computer and use it in GitHub Desktop.
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
}
}
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment