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
#define RGB(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1] | |
#define RGBA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)] | |
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) | |
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
#define IS_RETINA [[UIScreen mainScreen] scale] > 1.0 | |
#define LANGUAGE ([NSLocale preferredLanguages][0]) | |
#define SCREEN_BOUNDS ([UIScreen mainScreen].bounds) |
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
/*! | |
// cite: http://m.designbits.jp/12101514/ | |
// Icon | |
Icon.png 57 x 57 for non-retina iPhone/iPod touch (3/3G/3GS) | |
[email protected] 114 x 114 for retina iPhone/iPod touch | |
Icon-72.png 72 x 72 for non-retina iPad | |
[email protected] 144 x 144 for retina iPad | |
Icon-Small.png 29 x 29 for non-retina iPhone/iPod touch Spotlight and Settings (optional) | |
[email protected] 58 x 58 for retina iPhone/iPod touch Spotlight and Settings (optional) |
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
@implementation SomeUtils | |
static NSString * const kPlistName = @"MySettings"; | |
static NSString * const kExtention = @"plist"; | |
+ (NSDictionary*) launchSetting | |
{ | |
NSString* path = [[NSBundle mainBundle] pathForResource:kPlistName ofType:kExtention]; | |
NSDictionary* plist = [NSDictionary dictionaryWithContentsOfFile:path]; | |
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
@implementation MyView | |
- (id)init | |
{ | |
self = [super init]; | |
if (self) | |
{ | |
UINib *nib = [UINib nibWithNibName:@"SettingView" bundle:nil]; | |
UIView *settingView = [[nib instantiateWithOwner:self options:nil] objectAtIndex:0]; |
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
@implementation Test | |
static Test *singleton_ = nil; | |
+ (Test*)singleton | |
{ | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
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
static NSString * const kPlistName = @"ZeroCameraSettings"; | |
static NSString * const kExtention = @"plist"; | |
/*! | |
plist utils | |
*/ | |
+ (NSMutableDictionary*)getPlist |
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
- (id)init{ | |
self = [super init]; | |
if (self) | |
{ | |
self.frame = CGRectMake(0, 0, 100, 100); | |
self.backgroundColor = [UIColor clearColor]; | |
self.opaque = NO; | |
} |
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
int main(int argc, char *argv[]) | |
{ | |
@try { | |
@autoreleasepool { | |
return UIApplicationMain(argc, argv, nil, NSStringFromClass([MyAppDelegate class])); | |
} | |
} | |
@catch (NSException *exception) { | |
NSLog(@"%@", exception.callStackSymbols); | |
} |
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
- (UIImage *)resize:(UIImage *)src | |
{ | |
UIImage *newImage; | |
CGFloat width = 0.0; | |
CGFloat height = 0.0; | |
if (src.size.width > SCREEN_BOUNDS.size.width) | |
{ | |
width = SCREEN_BOUNDS.size.width; |
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
#include "ofMain.h" | |
class ofApp : public ofBaseApp | |
{ | |
public: | |
void setup(); | |
void update(); | |
void draw(); | |
void keyPressed(int key); |