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
| 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]; |
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
| /* | |
| 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 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
| + (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 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 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 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
| #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 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
| Delete .svn files using bash | |
| find . -name .svn -exec rm -rf '{}' \; |
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
| // | |
| // main.cpp | |
| // OpenGL-examples | |
| // | |
| // Created by Alexey Potapov on 27.09.14. | |
| // Copyright (c) 2014 none. All rights reserved. | |
| // | |
| #include <stdlib.h> | |
| #include <stdio.h> |
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
| DirectorySlash Off | |
| Options +FollowSymlinks -Indexes -MultiViews | |
| AddDefaultCharset utf-8 | |
| DirectoryIndex /public/index.php | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{REQUEST_FILENAME} !-f |
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
| NSLog(@"Documents Directory: %@", | |
| [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory | |
| inDomains:NSUserDomainMask] lastObject]); |
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
| NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
| NSString *documentsDirectory = [paths objectAtIndex:0]; | |
| NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent: | |
| [NSString stringWithFormat:@"savedImage%lu.png",arrayOfImages.count]]; | |
| NSData *imageData = UIImagePNGRepresentation(imageObject); | |
| [imageData writeToFile:savedImagePath atomically:NO]; |
OlderNewer