Created
August 9, 2017 08:17
-
-
Save Oni-zerone/8dd5f0f18af3d8723ae48f7275afbecd to your computer and use it in GitHub Desktop.
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
// | |
// TouchLayerView.swift | |
// | |
// | |
// Created by Oni_01 on 04/01/15. | |
// Copyright (c) 2015 Andrea Altea. All rights reserved. | |
// | |
import UIKit | |
class TouchLayerView: UIView { | |
weak var transparentLayer:UIView? | |
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { | |
let hitView = super.hitTest(point, with:event)! | |
if let layer = transparentLayer { | |
if hitView != layer && hitView.isDescendant(of: layer) { | |
return hitView | |
} | |
} | |
return nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment