diff options
author | Vitaly Takmazov | 2021-12-01 22:14:43 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-12-01 22:14:43 +0300 |
commit | 5325cf1ceaccc26091e196b62d76ba2d2efce2da (patch) | |
tree | 4490f6ada31b35d8121747102c2406ee83fd7f8c /Juick | |
parent | 2c046a01003665aa78ca8f069c215ba1420c76cc (diff) |
Fix navigation issues
Diffstat (limited to 'Juick')
-rw-r--r-- | Juick/AppDelegate.h | 3 | ||||
-rw-r--r-- | Juick/AppDelegate.m | 5 | ||||
-rw-r--r-- | 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]; |