Created
November 6, 2015 10:17
-
-
Save lexrus/f8656a99818528f45551 to your computer and use it in GitHub Desktop.
Toggle FLEX explorer with multi touch
This file contains hidden or 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
// | |
// UIWindow+FLEX.swift | |
// | |
// Created by Lex on 11/6/15. | |
// Copyright © 2015 lexrus.com. All rights reserved. | |
// | |
import UIKit | |
#if DEBUG | |
import FLEX | |
#endif | |
class LTWindow : UIWindow { | |
#if DEBUG | |
override func sendEvent(event: UIEvent) { | |
super.sendEvent(event) | |
if (event.allTouches()?.filter { $0.phase == .Began })?.count < 2 { | |
return | |
} | |
if FLEXManager.sharedManager().isHidden { | |
FLEXManager.sharedManager().showExplorer() | |
} else { | |
FLEXManager.sharedManager().hideExplorer() | |
} | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment