- (void)viewDidLoad
{
PagedImageScrollView *pageScrollView = [[PagedImageScrollView alloc] initWithFrame:CGRectMake(0, 32, 320, 165)];
[pageScrollView setScrollViewContents:@[[UIImage imageNamed:@"slider1"], [UIImage imageNamed:@"slider2"],[UIImage imageNamed:@"slider3"]]];
pageScrollView.pageControlPos = PageControlPositionCenterBottom;
[self.view addSubview:pageScrollView];
pageScrollView.delegate1 = self;
self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageViewController"];
self.pageViewController.dataSource = self;
PageContentViewController *startingViewController = [self secondviewcontrollerAtIndex:0];
//secondviewcontroller *startingViewController = [self secondviewcontrollerAtIndex:0];
//
NSArray *viewControllers = @[startingViewController];
[self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
// PageContentViewController2 *startingViewController2 = [self secondviewcontrollerAtIndex:0];
// NSArray *viewControllers2 = @[startingViewController2];
// [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
// Change the size of page view controller
self.pageViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height + 40);
[self addChildViewController:_pageViewController];
[self.view addSubview:_pageViewController.view];
[self.pageViewController didMoveToParentViewController:self];
}
- (IBAction)buttonLeague:(id)sender {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
LeaguesViewController* Leagues = [storyboard instantiateViewControllerWithIdentifier:@"Leagues"];
// Leagues.imageFile = @"slider1";
[self presentViewController:Leagues animated:YES completion:nil];
- (IBAction)sportsBtn:(id)sender {
Leagues.navTitle = @"sports";
Leagues.pageName = @"second";
- (IBAction)Event:(id)sender {
Leagues.navTitle = @"event";
- (IBAction)Location:(id)sender {
- (IBAction)MenuClicked:(id)sender {
[self.view endEditing:YES];
[self.frostedViewController.view endEditing:YES];
// Present the view controller
[self.frostedViewController presentMenuViewController];
- (IBAction)Tournament:(id)sender {
-(void)buttonWasPressed
NSLog(@"First image tapped");
- (IBAction)startWalkthrough:(id)sender {
- (PageContentViewController *)secondviewcontrollerAtIndex:(NSUInteger)index
// if (([self.pageTitles count] == 0) || (index >= [self.pageTitles count])) {
PageContentViewController *pageContentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageContentViewController"];
// pageContentViewController.imageFile = self.pageImages[index];
// pageContentViewController.titleText = self.pageTitles[index];
pageContentViewController.pageIndex = index;
return pageContentViewController;
#pragma mark - Page View Controller Data Source
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)secondviewcontroller
NSUInteger index = ((PageContentViewController*) secondviewcontroller).pageIndex;
if ((index == 0) || (index == NSNotFound)) {
return nil;
index++;
return [self secondviewcontrollerAtIndex:index];
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)PageContentViewController
NSUInteger index = ((PageContentViewController2*) PageContentViewController).pageIndex;
if (index == NSNotFound) {
index--;
// if (index == [self.pageTitles count]) {
// return nil;
// }
- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController
// return [self.pageTitles count];
return 2;
- (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController
return 0;
@end