summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/DiscoverViewController.m
blob: 10185ef2ff56bf08f6640d1b3b879a00f7e40eae (plain) (blame)
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
34
//
//  DiscoverViewController.m
//  Juick
//
//  Created by Vitaly Takmazov on 21/03/2019.
//  Copyright © 2019 com.juick. All rights reserved.
//

#import "DiscoverViewController.h"

@interface DiscoverViewController ()

@end

@implementation DiscoverViewController
- (void)viewDidLoad {
    self.messagesDelegate = self;
    self.title = @"Discover";
    self.path = [API messagesUrl];
    [self setShouldScrollToUnreadOnRefresh:NO];
    [super viewDidLoad];
}

- (void)loadMore {
    Message *lastMsg = [self.messages lastObject];
    if (lastMsg != nil) {
        NSNumber *lastMid = lastMsg.mid;
        self.params = [@{@"before_mid":lastMid} mutableCopy];
        [self setShouldScrollToUnreadOnRefresh:NO];
        [self refreshData];
    }
}

@end