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
// ViewController.h | |
#import <UIKit/UIKit.h> | |
@interface ViewController : UIViewController <UICollectionViewDelegate, UICollectionViewDataSource> | |
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView; | |
@end |
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
// ViewController.h | |
#import <UIKit/UIKit.h> | |
@interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> | |
@property (weak, nonatomic) IBOutlet UITableView *tableView; | |
@end |
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
#if DEBUG | |
println("debug") | |
#else | |
println("Not debug") | |
#endif |
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
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 50, 50)]; | |
[view setBackgroundColor:[UIColor blackColor]]; | |
[self.view addSubview:view]; | |
CABasicAnimation *animation = [CABasicAnimation animation]; | |
animation.keyPath = @"position.x"; | |
animation.fromValue = @0; | |
animation.toValue = @(self.view.frame.size.width); | |
animation.duration = 1; | |
animation.fillMode = kCAFillModeForwards; |
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
int[] intVal = new int[1]; | |
JNIEXPORT jboolean JNICALL Java_com_test_example_ChIntVal_change_int(JNIEnv* env, jobject cls, jintArray intValArray) | |
{ | |
int testVal = -1; | |
jint *exTypeVal = env->GetIntArrayElements(intValArray, 0); | |
exTypeVal[0] = testVal; | |
env->ReleaseIntArrayElements(intValArray, exTypeVal, 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
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
{ | |
NSLog(@"iPad"); | |
} | |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) | |
{ | |
NSLog(@"iPhone"); | |
} |
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
Width x Height | |
iPhone 4: | |
320 x 480 - portrait | |
480 x 320 - landscape | |
iPhone 4s (@2x): | |
640 x 960 - portrait | |
960 x 640 - landscape |
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
NSMutableArray *countries = [[NSMutableArray alloc] init]; | |
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]; | |
NSArray *countryArray = [NSLocale ISOCountryCodes]; | |
for (NSString *countryCode in countryArray) | |
{ | |
NSString *displayName = [locale displayNameForKey:NSLocaleCountryCode value:countryCode]; | |
[countries addObject:displayName]; | |
} |
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
for (NSString* family in [UIFont familyNames]) | |
{ | |
NSLog(@"%@", family); | |
for (NSString* name in [UIFont fontNamesForFamilyName:family]) | |
{ | |
NSLog(@"- %@", name); | |
} | |
} |
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
iPhone 6 Plus (@3x) - 75 x 75 | |
iPhone 6 and iPhone 5 (@2x) - 50 x 50 | |
iPhone 4s (@2x) - 50 x 50 | |
iPad and iPad mini (@2x) - 50 x 50 | |
iPad 2 and iPad mini (@1x) - 25 x 25 |