Created
January 31, 2015 07:09
-
-
Save kutschenator/17945454447c7ae766cb to your computer and use it in GitHub Desktop.
Implementation of PassThroughView in Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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