From 48234265991dd8ba8e26bd1fa7ea296a9f192ce9 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Wed, 6 Dec 2017 23:31:30 +0300
Subject: refactor
---
Juick/AppDelegate.m | 2 ++
Juick/Supporting Files/Juick-Info.plist | 2 +-
Juick/ViewControllers/DiscoverViewController.m | 14 ++------------
3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m
index 04a441c..93c6b5b 100644
--- a/Juick/AppDelegate.m
+++ b/Juick/AppDelegate.m
@@ -32,6 +32,8 @@
NSDictionary *userInfo = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
if (userInfo != nil) {
self.pushedThread = [userInfo objectForKey:@"mid"];
+ UINavigationController *main = (UINavigationController *) self.window.rootViewController;
+ [main performSegueWithIdentifier:@"threadViewSegue" sender:main];
}
return YES;
}
diff --git a/Juick/Supporting Files/Juick-Info.plist b/Juick/Supporting Files/Juick-Info.plist
index a4a2a4f..f25b2bc 100644
--- a/Juick/Supporting Files/Juick-Info.plist
+++ b/Juick/Supporting Files/Juick-Info.plist
@@ -21,7 +21,7 @@
CFBundleSignature
????
CFBundleVersion
- 1.0.25
+ 1.0.26
ITSAppUsesNonExemptEncryption
LSApplicationCategoryType
diff --git a/Juick/ViewControllers/DiscoverViewController.m b/Juick/ViewControllers/DiscoverViewController.m
index 3c473d5..f5d362f 100644
--- a/Juick/ViewControllers/DiscoverViewController.m
+++ b/Juick/ViewControllers/DiscoverViewController.m
@@ -18,17 +18,6 @@
@implementation DiscoverViewController
-AppDelegate *appDelegate;
-
--(void) awakeFromNib {
- [super awakeFromNib];
- appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
- if (appDelegate.pushedThread != nil) {
- [self performSegueWithIdentifier:@"threadViewSegue" sender:self];
- }
-}
-
-
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString * cellIdentifier = @"messageCell";
MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
@@ -38,6 +27,7 @@ AppDelegate *appDelegate;
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqual: @"threadViewSegue"]) {
NSNumber *mid;
+ AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
if (appDelegate.pushedThread != nil) {
mid = appDelegate.pushedThread;
} else {
@@ -46,7 +36,7 @@ AppDelegate *appDelegate;
}
ThreadViewController *threadVC = (ThreadViewController *)segue.destinationViewController;
[threadVC setPath:[APIClient threadUrl]];
- [threadVC setParams:[NSMutableDictionary dictionaryWithObjectsAndKeys:mid, @"mid", nil]];
+ [threadVC setParams:[@{@"mid": mid } mutableCopy]];
}
}
--
cgit v1.2.3