Created
April 22, 2015 14:40
-
-
Save iampaul83/25b3895bf70dfc3e7d97 to your computer and use it in GitHub Desktop.
copy
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
#import <Foundation/Foundation.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface Person : NSObject | |
@property (copy, readonly) NSString *firstName; | |
@property (copy, readonly) NSString *lastName; | |
-(instancetype)initWithFirstName:(NSString *)firstName lastName:(NSString *)lastName NS_DESIGNATED_INITIALIZER; | |
@end | |
NS_ASSUME_NONNULL_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
#import "Person.h" | |
@interface Person () | |
@property (copy, readwrite) NSString *firstName; | |
@property (copy, readwrite) NSString *lastName; | |
@end | |
@implementation Person | |
-(instancetype)initWithFirstName:(NSString *)firstName lastName:(NSString *)lastName { | |
if (self = [super init]) { | |
self.firstName = firstName; | |
self.lastName = lastName; | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment