Skip to content

Instantly share code, notes, and snippets.

@bradtheappguy
Created September 30, 2013 22:07
Show Gist options
  • Save bradtheappguy/6771016 to your computer and use it in GitHub Desktop.
Save bradtheappguy/6771016 to your computer and use it in GitHub Desktop.
iOS Effects SDK customization
Exclusive Crop Mode
Using NSUserDefaults, setting the R1ExclusiveCropMode key to one of the following values prior to the display of the R1 EffectsSDK screens has the effect of locking the crop behavior in one mode and hiding the user interface that allows for the various default cropping methods.
static const NSUInteger R1CropModeSquare = 0;
static const NSUInteger R1CropModeCustom = 1;
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:R1CropModeCustom] forKey:@"R1ExclusiveCropMode"];
Customized Effect tabs setup
Again, using NSUserDefaults, setting the R1TabSetupList with an array of predefined R1Tab key values allows you to re-order as well as remove effect tabs from the R1 Effects interface. Set this array to the NSUserDefaults prior to display of the user interface to affect the tab setup. The defined keys are:
static const NSUInteger R1TabEffects = 0;
static const NSUInteger R1TabBorders = 1;
static const NSUInteger R1TabStickers = 2;
static const NSUInteger R1TabText = 3;
static const NSUInteger R1TabDraw = 4;
NSArray *customTabs = @[R1TabBorders, R1TabStickers, R1TabText, R1TabDraw];
[[NSUserDefaults standardUserDefaults] setObject:customTabs forKey:@"R1TabSetupList"];
These defined keys may occupy one or zero entries in the submitted array - it is an error to include the same key more than once. Adding zero keys to the array will result in the user interface displaying the default tabs in the default order.
These customization to the R1 Effects user interface can be reverted by simply removing the desired key from NSUserDefaults system:
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"R1TabSetupList"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment