diff options
author | Vitaly Takmazov | 2017-12-10 13:58:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-12-10 13:58:30 +0300 |
commit | 693e30fcd120b7c803d849b1b313c77eceee8c42 (patch) | |
tree | 265551088c0e7152133975150d8e9b94aa5d75a5 /Juick/AppDelegate.m | |
parent | fe136b8c6b1e97fbc08f50265d41e1280c94afe3 (diff) |
random fixes
Diffstat (limited to 'Juick/AppDelegate.m')
-rw-r--r-- | Juick/AppDelegate.m | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index 43494cf..4cd7f2d 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -28,7 +28,10 @@ [[UINavigationBar appearance] setTintColor:[ColorScheme linkColor]]; //[[UINavigationBar appearance] setBarTintColor:[ColorScheme headerBackground]]; [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorScheme linkColor]}]; - [[UINavigationBar appearance] setLargeTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorScheme linkColor]}]; + UIFont *defaultLargeFont = [UIFont preferredFontForTextStyle: UIFontTextStyleLargeTitle]; + [[UINavigationBar appearance] setLargeTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorScheme linkColor], + NSFontAttributeName:[UIFont fontWithName:@"Serpentine-BoldItalic" size:defaultLargeFont.pointSize] + }]; [[UIToolbar appearance] setTintColor:[ColorScheme linkColor]]; [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault; @@ -39,15 +42,6 @@ return YES; } --(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { - [self parseNotificationPayload:userInfo]; - if (application.applicationState == UIApplicationStateActive) { - UIStoryboard *main = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; - [main instantiateInitialViewController]; - } - completionHandler(UIBackgroundFetchResultNewData); -} - - (void)registerForRemoteNotifications { UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self; @@ -80,15 +74,15 @@ //Called when a notification is delivered to a foreground app. -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler{ - NSDictionary *userInfo = notification.request.content.userInfo; - NSLog(@"User Info : %@", userInfo); - [self parseNotificationPayload:userInfo]; completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge); } //Called to let your app know which action was selected by the user for a given notification. -(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler{ - NSLog(@"User Info : %@",response.notification.request.content.userInfo); + NSDictionary *userInfo = response.notification.request.content.userInfo; + NSLog(@"User Info : %@", userInfo); + [self parseNotificationPayload:userInfo]; + [self.window.rootViewController performSegueWithIdentifier:@"threadSegue" sender:self.window.rootViewController]; completionHandler(); } |