Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9096607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:53:45+00:00 2026-06-16T23:53:45+00:00

Hi there I’ve messed around with a few different ways on implementing this but

  • 0

Hi there I’ve messed around with a few different ways on implementing this but can’t seem to make anything work. What I’m looking to do is have a standard UIPageViewcontroller, with a toolbar at the top, then when a toolbarbutton on the top left is hit the PageView slides to the right (like Path or Facebook for example), revealing a tableView.

I’m able to get either one to work separately no problem, but am struggling to have these multiple view controllers work together with the appDelegate. I’ve primarily been using ViewDeck: https://github.com/Inferis/ViewDeck for the slide out implementation, but if there’s another way that would be easier to implement with a pageviewcontroller, I’m definitely open to it.

I don’t really have much for code to post since I’m still just trying to figure it out conceptually.

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:53:47+00:00Added an answer on June 16, 2026 at 11:53 pm

    After Edit:

    To do what you want to do, I think it’s best to add the next controller as a child view controller of the page view controller (which is self.parentViewController in DataViewController).

    #import "DataViewController.h"
    #import "NextController.h"
    #import "ModelController.h"
    
    @implementation DataViewController {
        BOOL viewRevealed;
        NextController *next;
    }
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        viewRevealed = NO;
    }
    
    
    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
        self.dataLabel.text = [self.dataObject description];
    }
    
    
    -(IBAction)slideInController:(UIButton *) sender {
        if (viewRevealed == NO) {
            next = [self.storyboard instantiateViewControllerWithIdentifier:@"Blue"];
            next.view.frame = self.parentViewController.view.frame;
            [self.parentViewController addChildViewController:next];
            [self.parentViewController.view insertSubview:next.view belowSubview:self.view];
            [next didMoveToParentViewController:self.parentViewController];
                [UIView animateWithDuration:.6 animations:^{
                    self.view.frame = CGRectMake(self.view.frame.origin.x + self.view.frame.size.width/2, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
                } completion:^(BOOL finished) {
                    viewRevealed = YES;
                    [(ModelController *)[(UIPageViewController *)self.parentViewController dataSource] setSlidOff:TRUE];
                }];
        }else{
            [UIView animateWithDuration:.6 animations:^{
                self.view.frame = CGRectMake(self.view.frame.origin.x -  self.view.frame.size.width/2 , self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
            } completion:^(BOOL finished) {
                [next.view removeFromSuperview];
                [next removeFromParentViewController];
                viewRevealed = NO;
                [(ModelController *)[(UIPageViewController *)self.parentViewController dataSource] setSlidOff:FALSE];
            }];
        }
    }
    

    This is all the code in the DataViewController. I added a couple of ivars that were necessary. In my test app, I connected the slideInController method to a double-tap gesture recognizer. Weird things would happen if you clicked or swiped while the DataView was partly on screen, so I added a BOOL property to the ModelController.h file (slidOff), and set it to FALSE in that class’s init method. I then added another condition to the if statements in the two page view data source methods to check that property. When slidOff is TRUE the swipe gesture recognizers won’t do anything. Here are those 2 methods in ModelController, as I modified them:

    - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
    {
        NSUInteger index = [self indexOfViewController:(DataViewController *)viewController];
        if ((index == 0) || (index == NSNotFound) || _slidOff) {
            return nil;
        }
    
        index--;
        return [self viewControllerAtIndex:index storyboard:viewController.storyboard];
    }
    
    - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
    {
        NSUInteger index = [self indexOfViewController:(DataViewController *)viewController];
        if (index == NSNotFound || _slidOff) {
            return nil;
        }
    
        index++;
        if (index == [self.pageData count]) {
            return nil;
        }
        return [self viewControllerAtIndex:index storyboard:viewController.storyboard];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's a lot of reading on self referencing problems, but I can't seem to
There is a number of topics on this problem around the web, but I
There are lots of ways to do this, but what is the current, modern,
There are nice SO question and answers about this issue, but these options didn't
There's no Sort() function for IList . Can someoene help me with this? I
There are 3 different ways to get data out of a BLOB column from
There was a thread on this in comp.lang.javascript recently where victory was announced but
There are plenty of questions and answers to this like this question but I
There is a reason why this method doesn't work? -(void)textViewDidBeginEditing:(UITextView *)textView { textView.text =
There are numerous StackOverflow questions that touch on this subject, but either aren't quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.