Last active
August 29, 2015 14:03
-
-
Save Appletone/fd325de154b57a61b261 to your computer and use it in GitHub Desktop.
How to use Facebook Tweaks (FBTweak)
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
// app delegate | |
#import <FBTweak.h> | |
#import <FBTweakShakeWindow.h> | |
#import <FBTweakInline.h> | |
#import <FBTweakViewController.h> | |
#ifdef DEBUG | |
BOOL static const IS_DEBUG = YES; | |
#else | |
BOOL static const IS_DEBUG = NO; | |
#endif | |
#pragma mark - Tweaks | |
@synthesize window = _window; | |
- (UIWindow *)window | |
{ | |
if (!_window) { | |
if (IS_DEBUG) { | |
_window = [[FBTweakShakeWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
} | |
else { | |
_window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; | |
} | |
} | |
return _window; | |
} | |
// How to use | |
FBTweakBind(sharedInstance, jpgQuality, | |
@"Image", @"Quality", @"JPG Quality", 0.9); | |
FBTweakBind(self, isHinet, @"System", @"Params", @"isHinet", YES); | |
NSOperationQueue *serviceQueue = [NSOperationQueue new]; | |
FBTweakBind(serviceQueue, maxConcurrentOperationCount, | |
@"NSOperationQueue", @"Web Service Queue", @"Concurrent", 1); | |
// and shake your device |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment