diff --git a/Example/Classes/Controllers/RDVFirstViewController.m b/Example/Classes/Controllers/RDVFirstViewController.m index e858f1e..689062b 100644 --- a/Example/Classes/Controllers/RDVFirstViewController.m +++ b/Example/Classes/Controllers/RDVFirstViewController.m @@ -90,7 +90,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 15; + return 30; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { diff --git a/LICENSE b/LICENSE index 3931e5a..db4db4f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013 Robert Dimitrov +Copyright (c) 2013-2014 Robert Dimitrov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, diff --git a/RDVTabBarController.podspec b/RDVTabBarController.podspec index 3de6f56..aa06cf6 100644 --- a/RDVTabBarController.podspec +++ b/RDVTabBarController.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = "RDVTabBarController" - s.version = "1.1.6" + s.version = "1.1.7" 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.6" } + s.source = { :git => "https://github.com/robbdimitrov/RDVTabBarController.git", :tag => "v1.1.7" } s.source_files = 'RDVTabBarController', 'RDVTabBarController/**/*.{h,m}' s.framework = 'UIKit', 'CoreGraphics', 'Foundation' s.requires_arc = true diff --git a/RDVTabBarController/RDVTabBar.h b/RDVTabBarController/RDVTabBar.h index 6c24067..bd5480b 100755 --- a/RDVTabBarController/RDVTabBar.h +++ b/RDVTabBarController/RDVTabBar.h @@ -44,7 +44,7 @@ /** * The tab bar’s delegate object. */ -@property id delegate; +@property (nonatomic, weak) id delegate; /** * The items displayed on the tab bar. diff --git a/RDVTabBarController/RDVTabBarController.m b/RDVTabBarController/RDVTabBarController.m index dbe8406..a72e450 100755 --- a/RDVTabBarController/RDVTabBarController.m +++ b/RDVTabBarController/RDVTabBarController.m @@ -148,7 +148,8 @@ - (RDVTabBar *)tabBar { _tabBar = [[RDVTabBar alloc] init]; [_tabBar setBackgroundColor:[UIColor clearColor]]; [_tabBar setAutoresizingMask:UIViewAutoresizingFlexibleWidth| - UIViewAutoresizingFlexibleTopMargin]; + UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleLeftMargin| + UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleBottomMargin]; [_tabBar setDelegate:self]; } return _tabBar; @@ -159,7 +160,8 @@ - (UIView *)contentView { _contentView = [[UIView alloc] init]; [_contentView setBackgroundColor:[UIColor whiteColor]]; [_contentView setAutoresizingMask:UIViewAutoresizingFlexibleWidth| - UIViewAutoresizingFlexibleHeight]; + UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleLeftMargin| + UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleBottomMargin]; } return _contentView; } @@ -170,21 +172,17 @@ - (void)setTabBarHidden:(BOOL)hidden animated:(BOOL)animated { __weak RDVTabBarController *weakSelf = self; void (^block)() = ^{ - CGSize viewSize = weakSelf.view.frame.size; + CGSize viewSize = weakSelf.view.bounds.size; CGFloat tabBarStartingY = viewSize.height; CGFloat contentViewHeight = viewSize.height; CGFloat tabBarHeight = CGRectGetHeight([[weakSelf tabBar] frame]); + NSLog(@"viewSize = %@", NSStringFromCGSize(viewSize)); + if (!tabBarHeight) { tabBarHeight = 49; } - if (![weakSelf parentViewController]) { - if (UIInterfaceOrientationIsLandscape([weakSelf interfaceOrientation])) { - viewSize = CGSizeMake(viewSize.height, viewSize.width); - } - } - if (!hidden) { tabBarStartingY = viewSize.height - tabBarHeight; if (![[weakSelf tabBar] isTranslucent]) {