diff options
author | Vitaly Takmazov | 2019-03-21 23:39:03 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-03-21 23:39:03 +0300 |
commit | 6e49fc5c4273e7597925c133c3a6985b6ad85ecc (patch) | |
tree | ca5c8bac8e6bbe73d28db597be38840a4e88deca /Juick/ViewControllers/DiscoverViewController.m | |
parent | 31cee12a4f5c2733965e99e2fa9add28fee266c2 (diff) |
First RC
Diffstat (limited to 'Juick/ViewControllers/DiscoverViewController.m')
-rw-r--r-- | Juick/ViewControllers/DiscoverViewController.m | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Juick/ViewControllers/DiscoverViewController.m b/Juick/ViewControllers/DiscoverViewController.m new file mode 100644 index 0000000..cba3ca2 --- /dev/null +++ b/Juick/ViewControllers/DiscoverViewController.m @@ -0,0 +1,34 @@ +// +// DiscoverViewController.m +// Juick +// +// Created by Vitaly Takmazov on 21/03/2019. +// Copyright © 2019 com.juick. All rights reserved. +// + +#import "DiscoverViewController.h" +#import "APIClient.h" + +@interface DiscoverViewController () + +@end + +@implementation DiscoverViewController +- (void)viewDidLoad { + self.messagesDelegate = self; + self.title = @"Discover"; + self.path = [APIClient messagesUrl]; + [self setShouldScrollToBottomOnRefresh:NO]; + [super viewDidLoad]; +} + +- (void)loadMore { + Message *lastMsg = [self.messages lastObject]; + if (lastMsg != nil) { + NSDate *msgDate = [[APIClient sharedClient].dateFormatter dateFromString:lastMsg.timestamp]; + self.params = [@{@"to" : [NSString stringWithFormat:@"%.0f", [msgDate timeIntervalSince1970] * 1000]} mutableCopy]; + [self setShouldScrollToBottomOnRefresh:NO]; + } +} + +@end |