Skip to content

Instantly share code, notes, and snippets.

@Appletone
Last active August 29, 2015 14:03
Show Gist options
  • Save Appletone/fd325de154b57a61b261 to your computer and use it in GitHub Desktop.
Save Appletone/fd325de154b57a61b261 to your computer and use it in GitHub Desktop.
How to use Facebook Tweaks (FBTweak)
// 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