diff --git a/RKSwipeBetweenViewControllers.h b/RKSwipeBetweenViewControllers.h index a2220ea..26b1d80 100644 --- a/RKSwipeBetweenViewControllers.h +++ b/RKSwipeBetweenViewControllers.h @@ -171,5 +171,7 @@ @property (nonatomic, strong) UIView *selectionBar; @property (nonatomic, strong) UIView *manualSelectionBar; @property (nonatomic, strong)UIPanGestureRecognizer *panGestureRecognizer; +@property (nonatomic, strong)UIPageViewController *pageController; +@property (nonatomic, strong)UIView *navigationView; @end diff --git a/RKSwipeBetweenViewControllers.m b/RKSwipeBetweenViewControllers.m index ac2ecd8..c67f6e6 100644 --- a/RKSwipeBetweenViewControllers.m +++ b/RKSwipeBetweenViewControllers.m @@ -18,8 +18,9 @@ #define SELECTOR_Y_BUFFER 40 //%%% the y-value of the bar that shows what page you are on (0 is the top) #define SELECTOR_HEIGHT 4 //%%% thickness of the selector bar +#define X_OFFSET 8 //%%% for some reason there's a little bit of a glitchy offset. I'm going to look for a better workaround in the future + @interface RKSwipeBetweenViewControllers () { - UIPageViewController *pageController; UIScrollView *pageScrollView; NSInteger currentPageIndex; } @@ -31,6 +32,8 @@ @implementation RKSwipeBetweenViewControllers @synthesize selectionBar; @synthesize panGestureRecognizer; @synthesize manualSelectionBar; +@synthesize pageController; +@synthesize navigationView; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { @@ -44,6 +47,9 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil - (void)viewDidLoad { [super viewDidLoad]; + UISegmentedControl *blah = [[UISegmentedControl alloc]initWithItems:@[@"blah",@"blahblah"]]; + + self.navigationItem.titleView = blah; self.navigationBar.barTintColor = [UIColor colorWithRed:0.01 green:0.05 blue:0.06 alpha:1]; //%%% bartint self.navigationBar.translucent = NO; viewControllerArray = [[NSMutableArray alloc]init]; @@ -67,14 +73,15 @@ -(UIStatusBarStyle)preferredStatusBarStyle{ //%%% sets up the tabs using a loop. You can take apart the loop to customize individual buttons, but remember to tag the buttons. (button.tag=0 and the second button.tag=1, etc) -(void)setupSegmentButtons { + navigationView = [[UIView alloc]initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.navigationBar.frame.size.height)]; + NSInteger numControllers = [viewControllerArray count]; NSArray *buttonText = [[NSArray alloc]initWithObjects: @"first",@"second",@"third",@"fourth",@"etc",@"etc",@"etc",@"etc",nil]; //%%%buttontitle - for (int i = 0; i