Skip to content

Instantly share code, notes, and snippets.

@iampaul83
Created April 22, 2015 14:40
Show Gist options
  • Save iampaul83/25b3895bf70dfc3e7d97 to your computer and use it in GitHub Desktop.
Save iampaul83/25b3895bf70dfc3e7d97 to your computer and use it in GitHub Desktop.
copy
#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
#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