summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/DiscoverViewController.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-12-10 11:09:42 +0300
committerGravatar Vitaly Takmazov2017-12-10 11:09:42 +0300
commit2d2bedd9499ba3c9ac64408d60f96c7c6fd9ce8d (patch)
tree011a6391073b7535d1116b1fc1ef98b6f4f863a9 /Juick/ViewControllers/DiscoverViewController.m
parente6a11f68a2aab6c2578529694cf426749f8846ab (diff)
action sheet
Diffstat (limited to 'Juick/ViewControllers/DiscoverViewController.m')
-rw-r--r--Juick/ViewControllers/DiscoverViewController.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/Juick/ViewControllers/DiscoverViewController.m b/Juick/ViewControllers/DiscoverViewController.m
index 9d7c43b..b0d965c 100644
--- a/Juick/ViewControllers/DiscoverViewController.m
+++ b/Juick/ViewControllers/DiscoverViewController.m
@@ -55,5 +55,22 @@ AppDelegate *appDelegate;
[threadVC setParams:[@{@"mid": mid } mutableCopy]];
}
}
+- (IBAction)filterAction:(id)sender {
+ UIAlertController *filterAlert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
+ [filterAlert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
+ [filterAlert addAction:[UIAlertAction actionWithTitle:@"My feed" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+ self.path = [APIClient feedUrl];
+ [self.messages removeAllObjects];
+ [self.tableView reloadData];
+ [self refreshData:NO];
+ }]];
+ [filterAlert addAction:[UIAlertAction actionWithTitle:@"Discover" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+ self.path = [APIClient messagesUrl];
+ [self.messages removeAllObjects];
+ [self.tableView reloadData];
+ [self refreshData:NO];
+ }]];
+ [self presentViewController:filterAlert animated:YES completion:nil];
+}
@end