This file contains 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
// add child view | |
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; | |
[self addChildViewController:controller]; | |
controller.view.frame = CGRectMake(0, 44, 320, 320); | |
[self.view addSubview:controller.view]; | |
[controller didMoveToParentViewController:self]; | |
// remove child view | |
UIViewController *vc = [self.childViewControllers lastObject]; | |
[vc willMoveToParentViewController:nil]; |
This file contains 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 IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) | |
#define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0) | |
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width) | |
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height) | |
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT)) | |
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT)) | |
#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0) |
This file contains 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
// Encode a string to embed in an URL. | |
+(NSString *)encodeString:(NSString *)string { | |
return CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(nil, (CFStringRef)string, nil, (CFStringRef)@"!*'();:@&=+$,/?%#[]", kCFStringEncodingUTF8)); | |
} | |
// Decode a percent escape encoded string. | |
+(NSString *)decodeString:(NSString *)string { | |
return CFBridgingRelease(CFURLCreateStringByReplacingPercentEscapesUsingEncoding(nil, (CFStringRef)string, CFSTR(""), kCFStringEncodingUTF8)); | |
} |
This file contains 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 | |
# Pico+ | |
DialerFramework # Install Dialer Framework | |
CalSync # Install Google Calendar Sync (except if Google Calendar is being installed) | |
GoogleTTS # Install Google Text-to-Speech (Micro+ on 5.0-, Pico+ on 6.0+) | |
PackageInstallerGoogle # Install Google Package Installer | |
# Nano+ | |
BatteryUsage # Install Device Health Services (7.1+) |