Last active
October 12, 2017 22:20
-
-
Save paulw11/b192855bea5d260dfe75c22eec036130 to your computer and use it in GitHub Desktop.
GroupClassModel
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
// | |
// GroupClassModel.h | |
// GCM | |
// | |
// Created by Paul Wilkinson on 13/10/17. | |
#import <Foundation/Foundation.h> | |
@interface GroupClassModel: NSObject | |
@property (strong, nonatomic) NSString *id; | |
-(NSArray<NSString *> *)names; | |
-(void)addName:(NSString *)name; | |
@end | |
@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
// | |
// GroupClassModel.m | |
// GCM | |
// | |
// Created by Paul Wilkinson on 13/10/17. | |
// | |
#import "GroupClassModel.h" | |
@interface GroupClassModel () | |
@property (strong, nonatomic) NSMutableArray<NSString *> *groupNames; | |
@end | |
@implementation GroupClassModel | |
-(instancetype) init:(NSString *)id { | |
if (self = [super init]) { | |
self.id =id; | |
self.groupNames = [NSMutableArray<NSString *> new]; | |
} | |
return self; | |
} | |
-(void) addName:(NSString *) name { | |
[self.groupNames addObject: name]; | |
} | |
-(NSArray<NSString *> *)names { | |
return [self.groupNames copy]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment