From c45394c17dd11de72f2ebdae6e5a2296029069ff Mon Sep 17 00:00:00 2001 From: Robert Dimitrov Date: Sat, 10 May 2014 00:08:30 +0300 Subject: [PATCH] Move loadView code to viewDidLoad, use tabBarHeight if minimumContentHeight is not set. --- RDVTabBarController.podspec | 4 ++-- RDVTabBarController/RDVTabBarController.m | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/RDVTabBarController.podspec b/RDVTabBarController.podspec index 4337951..ac400e5 100644 --- a/RDVTabBarController.podspec +++ b/RDVTabBarController.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = "RDVTabBarController" - s.version = "1.1.4" + s.version = "1.1.5" s.summary = "Highly customizable tabBar and tabBarController for iOS" s.description = "RDVTabBarController is iPad and iPhone compatible. Supports landscape and portrait orientations and can be used inside UINavigationController." s.homepage = "https://github.com/robbdimitrov/RDVTabBarController" s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { "Robert Dimitrov" => "robert_dimitrov@me.com" } s.platform = :ios, '5.0' - s.source = { :git => "https://github.com/robbdimitrov/RDVTabBarController.git", :tag => "v1.1.4" } + s.source = { :git => "https://github.com/robbdimitrov/RDVTabBarController.git", :tag => "v1.1.5" } s.source_files = 'RDVTabBarController', 'RDVTabBarController/**/*.{h,m}' s.framework = 'UIKit', 'CoreGraphics', 'Foundation' s.requires_arc = true diff --git a/RDVTabBarController/RDVTabBarController.m b/RDVTabBarController/RDVTabBarController.m index d594ca8..5cbba47 100755 --- a/RDVTabBarController/RDVTabBarController.m +++ b/RDVTabBarController/RDVTabBarController.m @@ -43,16 +43,11 @@ @implementation RDVTabBarController #pragma mark - View lifecycle -- (void)loadView { - CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame]; +- (void)viewDidLoad { + [super viewDidLoad]; - UIView *view = [[UIView alloc] initWithFrame:applicationFrame]; - [view setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight]; - [view setBackgroundColor:[UIColor whiteColor]]; - self.view = view; - - [view addSubview:[self contentView]]; - [view addSubview:[self tabBar]]; + [self.view addSubview:[self contentView]]; + [self.view addSubview:[self tabBar]]; } - (void)viewWillAppear:(BOOL)animated { @@ -68,7 +63,7 @@ - (void)viewWillAppear:(BOOL)animated { if (![self isTabBarHidden]) { tabBarStartingY = viewSize.height - tabBarHeight; - contentViewHeight = viewSize.height - tabBarHeight; + contentViewHeight = viewSize.height - ([[self tabBar] minimumContentHeight] ?: tabBarHeight); } [[self tabBar] setFrame:CGRectMake(0, tabBarStartingY, viewSize.width, tabBarHeight)];