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
UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(40, 50, 180, 180)]; | |
view1.backgroundColor = [UIColor redColor]; | |
[self.view addSubview:view1]; | |
UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(70, 90, 180, 200)]; | |
view2.backgroundColor = [UIColor yellowColor]; | |
[self.view addSubview:view2]; | |
CGRect unionRect = CGRectUnion(view1.frame, view2.frame); | |
NSLog(@"unionRect:%@", NSStringFromCGRect(unionRect)); | |
UIView *unionView = [[UIView alloc] initWithFrame:unionRect]; | |
unionView.backgroundColor = [UIColor clearColor]; |
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
//ローカルな定数 | |
static NSString * const kFirstName = @"hachinobu"; | |
//グローバルな定数 | |
//ヘッダーファイル内で宣言 | |
extern NSString * const FirstName; | |
//実装ファイルで定義 | |
NSString *const FirstName = @"hachinobu"; |
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
NSNumber *intNum = @1; | |
NSNumber *floatNum = @1.23f; | |
NSNumber *doubleNum = @1.2345; | |
NSNumber *boolNum = @YES; | |
NSNumber *charNum = @'a'; | |
int numInt = [intNum intValue]; | |
float numFloat = [floatNum floatValue]; | |
double numDouble = [doubleNum doubleValue]; | |
BOOL numBool = [boolNum boolValue]; |
NewerOlder