Skip to content

Instantly share code, notes, and snippets.

@lexrus
Created November 6, 2015 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lexrus/f8656a99818528f45551 to your computer and use it in GitHub Desktop.
Save lexrus/f8656a99818528f45551 to your computer and use it in GitHub Desktop.
Toggle FLEX explorer with multi touch
//
// 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