Skip to content

Instantly share code, notes, and snippets.

@alexandreraulin
Forked from JeOam/FLEX.md
Created March 8, 2017 13:15
Show Gist options
  • Save alexandreraulin/5b174c7096a29dae4f42750e0fd6fa25 to your computer and use it in GitHub Desktop.
Save alexandreraulin/5b174c7096a29dae4f42750e0fd6fa25 to your computer and use it in GitHub Desktop.
Flipboard FLEX: An in-app debugging and exploration tool for iOS

FLEX (Flipboard Explorer) is a set of in-app debugging and exploration tools for iOS development. When presented, FLEX shows a toolbar that lives in a window above your application. From this toolbar, you can view and modify nearly every piece of state in your running application.

Installation via Cocoapods

pod 'FLEX', '~> 1.1'

Setup in project: AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    .....
    [self addFlexTapGestureIfNeed];
    .....
}

#pragma mark -
#pragma mark -------------------- About Tweak & FLEX ---------------------
- (void)addFlexTapGestureIfNeed{
#ifdef DEBUG
    UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapFlex:)];
    tapGR.numberOfTapsRequired = 2;
    tapGR.numberOfTouchesRequired = 2;
    [self.window addGestureRecognizer:tapGR];
#endif
}

- (void)didTapFlex:(UITapGestureRecognizer*)tapGR
{
    if (tapGR.state == UIGestureRecognizerStateRecognized) {
#if DEBUG
        [[FLEXManager sharedManager] showExplorer];
#endif
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment