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
#pragma mark - Security | |
- (void)applicationDidEnterBackground:(UIApplication *)application { | |
RootViewController *rootVC = (RootViewController *)self.window.rootViewController; | |
UIViewController *viewController = (UIViewController *)[rootVC.presentedViewControllers lastObject]; | |
/** | |
If the last presented view controller is a SplashViewController we must not present the splash | |
screen again. | |
*/ | |
if (![viewController isKindOfClass:[SplashViewController class]]) { | |
/** |
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_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON ) | |
//get ios verison | |
[[[UIDevice currentDevice] systemVersion] floatValue] | |
#define isIPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad | |
// Logging | |
// DLog will output like NSLog only when the DEBUG variable is set | |
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
+ (BOOL)isIOS7 | |
{ | |
static BOOL isIOS7 = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
NSInteger deviceSystemMajorVersion = [[[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."] objectAtIndex:0] integerValue]; | |
if (deviceSystemMajorVersion >= 7) { | |
isIOS7 = YES; | |
} | |
else { |
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
/* | |
Then just to use somehow like this (if array) | |
NSMutableArray *parsedPlist = [[NSMutableArray alloc] initWithContentsOfFile:[PlistReader copyFileToDocumentDirectory:%"filename.plist"]]; | |
*/ | |
+ (NSString *)copyFileToDocumentDirectory:(NSString *)fileName | |
{ | |
NSError *error; |
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
CGRect frame = [segmentControl frame]; | |
frame =CGRectMake((frame.size.width/No. of segments * [segmentControl selectedSegmentIndex]), 0, frame.size.width/No. of segments, segmentControl.bounds.size.height); | |
[m_PopOver presentPopoverFromRect:frame inView:segmentControl permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; |
NewerOlder