From 2d2bedd9499ba3c9ac64408d60f96c7c6fd9ce8d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 10 Dec 2017 11:09:42 +0300 Subject: action sheet --- Juick/Main.storyboard | 8 ++++---- Juick/Supporting Files/Juick-Info.plist | 2 +- Juick/ViewControllers/DiscoverViewController.m | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'Juick') diff --git a/Juick/Main.storyboard b/Juick/Main.storyboard index 7936373..b717079 100644 --- a/Juick/Main.storyboard +++ b/Juick/Main.storyboard @@ -92,7 +92,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -309,9 +309,9 @@ - + - + diff --git a/Juick/Supporting Files/Juick-Info.plist b/Juick/Supporting Files/Juick-Info.plist index 2eb1c21..53c5301 100644 --- a/Juick/Supporting Files/Juick-Info.plist +++ b/Juick/Supporting Files/Juick-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 1.0.33 + 1.0.34 ITSAppUsesNonExemptEncryption LSApplicationCategoryType 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 -- cgit v1.2.3