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

  • Home
  • SEARCH
  • 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 9153967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:21:27+00:00 2026-06-17T12:21:27+00:00

So I have a Custom Container View Controller that I’m setting up and I

  • 0

So I have a Custom Container View Controller that I’m setting up and I have a custom animation that is suppose to happen when you swipe between the children view controllers that was working perfectly up until I took the temp UILabels out of the placeholder view and added the view from the child view controller to the place holder. If I comment out the “addSubview” lines then the animation works perfectly again, but obvious I don’t have any children which is kinda the point…

Now I say that the animation doesn’t work, but that’s not entirely true because anything linked to something that I added at init (ie the notify and user placeholders and children) animate perfectly. The feed view is visable under them though and the header and footer bars only budge sometimes. The will randomly twitch if I move the touch the y axis as well as the x… it’s weird.

init code for setting up and adding the child VCs:

UIStoryboard* sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    self.feedVC = (NiTActionFeedViewController*)[sb instantiateViewControllerWithIdentifier:@"Feed"];
    self.feedVC.delegate = self;
    [self addChildViewController:self.feedVC];
    self.feedVC.view.frame = self.mainPage.bounds;//mainPage view is the only UIView that is placed in the IB as template for the other views (so I don't have to worry about resizing for 4" retina^^;)
    [self.mainPage addSubview:self.feedVC.view];
    [self.feedVC didMoveToParentViewController:self];

    //notify
    self.notifyPage = [[UIView alloc] initWithFrame:CGRectOffset(self.mainPage.frame, -kPageShift, 0)];// this is one of the placeholder views
    [self.notifyPage setClipsToBounds:YES];

    self.notifyVC = (NiTNotificationViewController*)[sb instantiateViewControllerWithIdentifier:@"Notify"];
    self.notifyVC.delegate = self;
    [self addChildViewController:self.notifyVC];
    self.notifyVC.view.frame = self.notifyPage.bounds;
    [self.notifyPage addSubview:self.notifyVC.view];
    [self.notifyVC didMoveToParentViewController:self];

    //user
    self.userPage = [[UIView alloc] initWithFrame:CGRectOffset(self.mainPage.frame, kPageShift, 0)];
    [self.userPage setClipsToBounds:YES];

    self.userVC = (NiTUserViewController*)[sb instantiateViewControllerWithIdentifier:@"UserScreen"];
    self.userVC.delegate = self;
    [self addChildViewController:self.userVC];
    self.userVC.view.frame = self.userPage.bounds;
    [self.userPage addSubview:self.userVC.view];
    [self.userVC didMoveToParentViewController:self];

    [self.view addSubview:self.notifyPage];
    [self.view addSubview:self.userPage];

     //and then re-add the header and footer views so that the children don't cover them^^
    [self.view addSubview:self.headerbar];
    [self.view addSubview:self.headerButton];
    [self.view addSubview:self.footerbar];
    [self.view addSubview:self.footerButton];
    [self.view addSubview:self.rightPageIndicator];
    [self.view addSubview:self.leftPageIndicator];

and here is the touchesMoved code(if you need more then this let me know, but even on end they don’t budge):

if (touches.count > 0) {
        UITouch* touch = [touches anyObject];
        CGPoint currentPoint = [touch locationInView:self.view];
        float diff = currentPoint.x - startingPoint.x;

        //currentScreen is an enum that I set on load and on trigger of the screen change so I always know what screen is showing and it is always accurate
        //this line is just to make sure we don't go past the "edge" of the screen and is working perfectly
        if ((self.currentScreen - (diff<0?-1:1)) > userScreen||(self.currentScreen - (diff<0?-1:1)) < notifScreen) {
            return;
        }


            self.headerbar.frame = CGRectOffset(initheaderbar, (int)(kHeaderBarShift * (diff/kPageShift)), 0);
            self.headerButton.frame = CGRectOffset(initheaderButton, kHeaderButtonShift * (diff/kPageShift), 0);
            self.footerbar.frame = CGRectOffset(initfooterbar, kFooterBarShift * (diff/kPageShift), 0);
            self.mainPage.frame = CGRectOffset(initmainPage, kPageShift * (diff/kPageShift), 0);
            self.userPage.frame = CGRectOffset(inituserPage, kPageShift * (diff/kPageShift), 0);
            self.notifyPage.frame = CGRectOffset(initnotifyPage, kPageShift * (diff/kPageShift), 0);

        //this always updates and looks right even though nothing changes on the screen
            NSLog(@"move main:%@(%@)\nnotify:%@\nuser:  %@",NSStringFromCGRect(CGRectOffset(initmainPage, kPageShift * (diff/kPageShift), 0)),NSStringFromCGRect(self.mainPage.frame),NSStringFromCGRect(CGRectOffset(initnotifyPage, kPageShift * (diff/kPageShift), 0)),NSStringFromCGRect(CGRectOffset(inituserPage, kPageShift * (diff/kPageShift), 0)));

            lastPoint = currentPoint;
    }else{
        //never seen this called thus why I have it here so I know if something mind blowing has happened
        NSLog(@"W.T.F");
    }

Now, the last piece you probably need to know is that I have a “touchController” protocol set up that can have “touchDelegates” set up in all the children that point to the parent so that any touches that they receive get forwarded to the Container VC and they are all forwarding properly so that’s not it (and the animations wouldn’t work at all if that was the case)…

Help me Obi Wan Kenobi, you’re my only hope! Seriously, could use any help that anyone could give^^;

REQUESTED INFO
I am pretty much animating everything on the screen. I can not post screenshots or a video because of the nature of the project, but hopefully you will be able to flow along with me with the diagram below(sorry, I’m not photoshop expect =P). The only thing not shown in the diagram is the headerButton, but basically it’s just on top of the headerBar and moves at a slightly slower pace as it doesn’t move as far. The idea of the design is that if you swipe in a direction it slides the screen in the opposite direction (like you would expect) and the header and footer bars slide at a different speed because they are shorter so the items on them are always visible, but have a “cool” effect in showing which side/page you are on. (neither bar ever shows an “end” on the screen, the “end” gets right to the edge of the screen, but never comes onto it) All of the constants are just that. kPageShift is the screen width (320). The rest are how far they need to move between screens, since they are all different sizes besides the pages. If you need more info please let me know!

enter image description here

  • 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-17T12:21:28+00:00Added an answer on June 17, 2026 at 12:21 pm

    Turn off AutoLayout in your Storyboard file.

    The constraints which have been setup are causing that random twitch which you talked about.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test app that uses a custom container controller to switch between
I have an app with a custom UITabBarController that contains five view controllers. Within
I have a view controller (EmbeddedMenuView) that uses a custom view (HorizontalMenuView). The Embedded
I have a working view animation, that curls up a container view, while the
I have a custom container view controller with 4 buttons. My goal is to
I am currently making an application that uses a custom View Controller container. Multiple
I am using the containment API to create a custom container view controller Creation
I have a class called Chair. I have a view controller that contains an
I have two UIViewControllers that are contained in a navigatoin view controller and both
I have a custom container UIViewController that has six child UIViewControllers, and a set

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.