diff --git a/Blog/Base.lproj/Main.storyboard b/Blog/Base.lproj/Main.storyboard index b9f2b7e..d1ece41 100644 --- a/Blog/Base.lproj/Main.storyboard +++ b/Blog/Base.lproj/Main.storyboard @@ -1,12 +1,12 @@ - + - + - + FontAwesome FontAwesome diff --git a/Blog/Post.h b/Blog/Post.h index 8b2e0c1..570627a 100644 --- a/Blog/Post.h +++ b/Blog/Post.h @@ -23,7 +23,6 @@ @property (nonatomic, readonly, getter=isDraft) BOOL draft; @property (nonatomic, readonly, getter=isLink) BOOL link; @property (nonatomic, readonly, getter=isNew) BOOL new; -@property (nonatomic, readonly) NSString *formattedDate; + (instancetype)newDraftWithTitle:(NSString *)title body:(NSString *)body url:(NSURL *)url; - (instancetype)copyWithBody:(NSString *)body; diff --git a/Blog/Post.m b/Blog/Post.m index 4b655ea..af7f539 100644 --- a/Blog/Post.m +++ b/Blog/Post.m @@ -18,7 +18,6 @@ @synthesize author = _author; @synthesize time = _time; @synthesize path = _path; -@synthesize formattedDate = _formattedDate; + (NSDictionary *)JSONKeyPathsByPropertyKey { return @{ @@ -146,13 +145,6 @@ return _time; } -- (NSString *)formattedDate { - if (!_formattedDate && self.time) { - _formattedDate = [NSString stringWithFormat:@"%ld-%02ld-%02ld", (long)self.time.mm_year, (long)self.time.mm_month, (long)self.time.mm_day]; - } - return _formattedDate; -} - - (NSString *)path { if (!_path) { if (self.draft) { diff --git a/Blog/PostsViewController.m b/Blog/PostsViewController.m index 9618063..d95aec9 100644 --- a/Blog/PostsViewController.m +++ b/Blog/PostsViewController.m @@ -547,8 +547,9 @@ static NSString *const StateRestorationBlogStatusTextKey = @"blogStatusText"; - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { PostCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; Post *post = [self postForIndexPath:indexPath]; - NSString *title = post.title.length ? post.title : @"Untitled"; - NSString *date = post.draft ? @"" : post.formattedDate; + NSString *prefix = post.link ? @"→ " : @""; + NSString *title = [NSString stringWithFormat:@"%@%@", prefix, post.title.length ? post.title : @"Untitled"]; + NSString *date = post.draft ? @"" : post.date; [cell configureWithTitle:title date:date]; return cell; }