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
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0]; | |
if([language isEqualToString:@"fr"]){//...} |
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
Fragment frag; | |
//ajout d'un fragment | |
TonFragment newFragment = new TonFragment(); | |
android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); | |
transaction.add(R.id.fragment_container, newFragment).addToBackStack("A_B_TAG"); | |
transaction.commit(); | |
//remplacement d'un fragment |
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
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) { | |
// Load resources for iOS 6.1 or earlier | |
} else { | |
// Load resources for iOS 7 or later | |
} |
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 screenWidth = 0; | |
int screenHeight = 0; | |
if(android.os.Build.VERSION.SDK_INT < 10) { | |
Display display = getWindowManager().getDefaultDisplay(); | |
screenWidth = display.getWidth(); | |
screenHeight = display.getHeight(); | |
} else { | |
DisplayMetrics metrics = new DisplayMetrics(); | |
getWindowManager().getDefaultDisplay().getMetrics(metrics); | |
screenWidth = metrics.heightPixels; |
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
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) | |
{ | |
[locationManager requestAlwaysAuthorization]; | |
} | |
// auth needed before start method | |
[locationManager startUpdatingLocation]; | |
// in plist file : (Boolean value) NSLocationAlwaysUsageDescription : 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
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) | |
{ | |
[application registerUserNotificationSettings: | |
[UIUserNotificationSettings settingsForTypes: | |
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil]]; | |
[[UIApplication sharedApplication] registerForRemoteNotifications]; | |
} | |
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
BOOL linkedInIsInstalled = | |
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"linkedin:#profile/9999"]]; | |
if(linkedInIsInstalled) | |
{ | |
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"linkedin:#profile/9999"]]; | |
} | |
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
=> Error : | |
duplicate simbols $viewController.variable in .o ..... | |
=> Solution : | |
check import if .m is included | |
=> Source : | |
http://stackoverflow.com/questions/3231948/duplicate-symbol-issues | |
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
@interface GalleryImageViewCell : UICollectionViewCell <UIScrollViewDelegate> | |
@property (weak, nonatomic) IBOutlet UIScrollView *scrollContainer; | |
@property (weak, nonatomic) IBOutlet UIImageView *imageView; | |
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollHeightLayoutConstraint; | |
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollWidthLayoutConstraint; | |
@end |
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
# excludes this file from merges | |
# treats it like binary file | |
*.pbxproj -crlf -diff -merge |