Skip to content
Browse files

compatible with storyboard

  • Loading branch information...
1 parent d9d72fc commit 31a4d3ceebfe2b9e51e792fd82ec3fb8878272a9 @luosky committed Oct 31, 2012
Showing with 16 additions and 6 deletions.
  1. +16 −6 NGTabBarController/NGTabBarController.m
View
22 NGTabBarController/NGTabBarController.m
@@ -67,15 +67,18 @@ @implementation NGTabBarController
////////////////////////////////////////////////////////////////////////
#pragma mark - Lifecycle
////////////////////////////////////////////////////////////////////////
+- (void)configTabBar{
+ _selectedIndex = NSNotFound;
+ _oldSelectedIndex = NSNotFound;
+ _animation = NGTabBarControllerAnimationNone;
+ _animationDuration = kNGDefaultAnimationDuration;
+ _animationActive = NO;
+ _tabBarPosition = kNGTabBarPositionDefault;
+}
- (id)initWithDelegate:(id<NGTabBarControllerDelegate>)delegate {
if ((self = [super initWithNibName:nil bundle:nil])) {
- _selectedIndex = NSNotFound;
- _oldSelectedIndex = NSNotFound;
- _animation = NGTabBarControllerAnimationNone;
- _animationDuration = kNGDefaultAnimationDuration;
- _animationActive = NO;
- _tabBarPosition = kNGTabBarPositionDefault;
+ [self configTabBar];
// need to call setter here
self.delegate = delegate;
@@ -88,6 +91,13 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
return [self init];
}
+- (id)initWithCoder:(NSCoder *)aDecoder{
+ if ((self = [super initWithNibName:nil bundle:nil])) {
+ [self configTabBar];
+ }
+ return self;
+}
+
////////////////////////////////////////////////////////////////////////
#pragma mark - UIViewController
////////////////////////////////////////////////////////////////////////

0 comments on commit 31a4d3c

Please sign in to comment.
Something went wrong with that request. Please try again.