From 5325cf1ceaccc26091e196b62d76ba2d2efce2da Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 1 Dec 2021 22:14:43 +0300 Subject: Fix navigation issues --- Juick/AppDelegate.h | 3 +++ Juick/AppDelegate.m | 5 ----- Juick/ViewControllers/JuickNavigationController.m | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Juick/AppDelegate.h b/Juick/AppDelegate.h index 6c277a9..1cc8650 100644 --- a/Juick/AppDelegate.h +++ b/Juick/AppDelegate.h @@ -10,6 +10,7 @@ #import "ThreadViewController.h" #import "User.h" #import "API.h" +#import "JuickNavigationController.h" extern NSString * const UserUpdatedNotificationName; @@ -35,4 +36,6 @@ extern NSString * const UserUpdatedNotificationName; @property (strong, nonatomic) NSDateFormatter *sharedDateFormatter; +@property (strong, nonatomic) JuickNavigationController *navigator; + @end diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index 51e5df1..dbd7734 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -165,11 +165,6 @@ return (AppDelegate *)[UIApplication sharedApplication].delegate; } -- (UINavigationController *) navigator { - UINavigationController *secondaryNavigationController = [(UISplitViewController *)self.window.rootViewController viewControllers][1]; - return [[secondaryNavigationController viewControllers] firstObject]; -} - - (void)presentThread:(UIViewController *)vc { [[self navigator] performSegueWithIdentifier:@"threadSegue" sender:vc]; } diff --git a/Juick/ViewControllers/JuickNavigationController.m b/Juick/ViewControllers/JuickNavigationController.m index 13838d1..9e51c9f 100644 --- a/Juick/ViewControllers/JuickNavigationController.m +++ b/Juick/ViewControllers/JuickNavigationController.m @@ -52,6 +52,7 @@ - (void)viewDidLoad { [super viewDidLoad]; + [AppDelegate shared].navigator = self; [self refreshStatus]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidSignedIn:) name:UserChangedNotificationName object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationActivated) name:UIApplicationDidBecomeActiveNotification object:nil]; -- cgit v1.2.3