Last active
May 25, 2017 03:58
-
-
Save sahara-ooga/fd69e201f3211bd4e803a8dbeb7f7326 to your computer and use it in GitHub Desktop.
Objective-Cとswiftのイニシャライザの関係
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
#import "Person.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
let person = Person(name:"Bob", age:27) | |
print(type(of:person)) |
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
#import <Foundation/Foundation.h> | |
@interface Person:NSObject | |
-(instancetype)initWithName:(NSString*)name age:(NSInteger)age; | |
@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
#import "Person.h" | |
@implementation Person | |
-(instancetype)initWithName:(NSString *)name age:(NSInteger)age{ | |
if(self = [super init]){} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment