1
1
mirror of https://github.com/VKCOM/vk-ios-sdk.git synced 2024-09-11 06:45:37 +03:00

Custom UINavigationController subclass for status bar styling instead of using a category

This commit is contained in:
Francisco Javier Saorín 2017-01-19 11:54:21 +01:00
parent a6810119a0
commit 97530cc6db
2 changed files with 7 additions and 3 deletions

View File

@ -30,6 +30,10 @@ typedef NS_ENUM(NSInteger, VKAuthorizationType) {
VKAuthorizationTypeApp
};
@interface VKNavigationController : UINavigationController
@end
@interface VKAuthorizationContext : VKObject
@property (nonatomic, readonly, strong) NSString *clientId;
@property (nonatomic, readonly, strong) NSString *displayType;

View File

@ -37,7 +37,7 @@ NSString *VK_AUTHORIZE_URL_STRING = @"vkauthorize://authorize";
@property (nonatomic, assign) BOOL usingVkApp;
@end
@implementation UINavigationController (LastControllerBar)
@implementation VKNavigationController
- (UIStatusBarStyle)preferredStatusBarStyle {
if (self.viewControllers.count)
@ -60,7 +60,7 @@ NSString *VK_AUTHORIZE_URL_STRING = @"vkauthorize://authorize";
@property(nonatomic, strong) UILabel *statusBar;
@property(nonatomic, strong) VKError *validationError;
@property(nonatomic, strong) NSURLRequest *lastRequest;
@property(nonatomic, weak) UINavigationController *internalNavigationController;
@property(nonatomic, weak) VKNavigationController *internalNavigationController;
@property(nonatomic, assign) BOOL finished;
@end
@ -82,7 +82,7 @@ NSString *VK_AUTHORIZE_URL_STRING = @"vkauthorize://authorize";
}
+ (void)presentThisController:(VKAuthorizeController *)controller {
UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:controller];
VKNavigationController *navigation = [[VKNavigationController alloc] initWithRootViewController:controller];
if ([VKUtil isOperatingSystemAtLeastIOS7]) {
navigation.navigationBar.barTintColor = VK_COLOR;