summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers')
-rw-r--r--Juick/ViewControllers/DialogsViewController.m9
-rw-r--r--Juick/ViewControllers/DiscoverViewController.m10
-rw-r--r--Juick/ViewControllers/LoginViewController.m3
3 files changed, 9 insertions, 13 deletions
diff --git a/Juick/ViewControllers/DialogsViewController.m b/Juick/ViewControllers/DialogsViewController.m
index 05f0958..c4ace7f 100644
--- a/Juick/ViewControllers/DialogsViewController.m
+++ b/Juick/ViewControllers/DialogsViewController.m
@@ -66,11 +66,10 @@
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"chatSegue"]) {
NSString *uname;
- AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
- if ([appDelegate.pushedUname length] > 0) {
- uname = [appDelegate.pushedUname copy];
- appDelegate.pushedThread = nil;
- appDelegate.pushedUname = nil;
+ if ([[AppDelegate shared].pushedUname length] > 0) {
+ uname = [[AppDelegate shared].pushedUname copy];
+ [AppDelegate shared].pushedThread = nil;
+ [AppDelegate shared].pushedUname = nil;
} else {
Chat *chat = [self.chats objectAtIndex:[self.tableView indexPathForSelectedRow].row];
uname = chat.uname;
diff --git a/Juick/ViewControllers/DiscoverViewController.m b/Juick/ViewControllers/DiscoverViewController.m
index 092c19c..27b273b 100644
--- a/Juick/ViewControllers/DiscoverViewController.m
+++ b/Juick/ViewControllers/DiscoverViewController.m
@@ -16,7 +16,6 @@
@interface DiscoverViewController ()
-@property(nonatomic, strong) AppDelegate *appDelegate;
@property NSString *selectedUser;
@end
@@ -49,7 +48,6 @@
[self refreshData];
}
[super viewDidLoad];
- self.appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
}
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -76,10 +74,10 @@
if ([segue.identifier isEqual: @"threadViewSegue"]) {
NSNumber *mid;
BOOL scrollToEnd = NO;
- if (self.appDelegate.pushedThread != nil) {
- mid = [self.appDelegate.pushedThread copy];
- self.appDelegate.pushedThread = nil;
- self.appDelegate.pushedUname = nil;
+ if ([AppDelegate shared].pushedThread != nil) {
+ mid = [[AppDelegate shared].pushedThread copy];
+ [AppDelegate shared].pushedThread = nil;
+ [AppDelegate shared].pushedUname = nil;
scrollToEnd = YES;
} else {
Message *msg = [self.messages objectAtIndex:[self.tableView indexPathForSelectedRow].row];
diff --git a/Juick/ViewControllers/LoginViewController.m b/Juick/ViewControllers/LoginViewController.m
index c0b1a0d..e1b12f2 100644
--- a/Juick/ViewControllers/LoginViewController.m
+++ b/Juick/ViewControllers/LoginViewController.m
@@ -62,8 +62,7 @@
NSString *password = [SAMKeychain passwordForService:[[NSBundle mainBundle] bundleIdentifier] account:@"com.juick.password"];
[[APIClient sharedClient].manager.requestSerializer setAuthorizationHeaderFieldWithUsername:username password:password];
- AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication] delegate];
- [app registerForRemoteNotifications];
+ [[AppDelegate shared] registerForRemoteNotifications];
CATransition* transition = [CATransition animation];
transition.duration = 0.3;
transition.type = kCATransitionFade;