Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

compatible with storyboard

  • Loading branch information...
commit 31a4d3ceebfe2b9e51e792fd82ec3fb8878272a9 1 parent d9d72fc
@luosky authored
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
////////////////////////////////////////////////////////////////////////
Please sign in to comment.
Something went wrong with that request. Please try again.