-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWord.m
33 lines (27 loc) · 825 Bytes
/
Word.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Word.m
// Words
//
// Created by Егор Иванов on 14/02/15.
// Copyright (c) 2015 hey. All rights reserved.
//
#import "Word.h"
@implementation Word
-(void)setLearned:(BOOL)learned{
_learned = learned;
[[NSNotificationCenter defaultCenter] postNotificationName:@"saveFolders" object:nil];
}
- (void)encodeWithCoder:(NSCoder *)encoder {
[encoder encodeObject:_wordText forKey:@"wordText"];
[encoder encodeObject:_hintText forKey:@"hintText"];
[encoder encodeObject:@(_learned) forKey:@"learned"];
}
- (id)initWithCoder:(NSCoder *)decoder {
if((self = [super init])) {
self.hintText = [decoder decodeObjectForKey:@"hintText"];
self.wordText = [decoder decodeObjectForKey:@"wordText"];
self.learned = [[decoder decodeObjectForKey:@"learned"] boolValue];
}
return self;
}
@end