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 7564229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:51:31+00:00 2026-05-30T13:51:31+00:00

I’m going for a Facebook-esque slide-over UITableView. I’ve accomplished that, animation and drop shadow

  • 0

I’m going for a Facebook-esque slide-over UITableView.

enter image description here

I’ve accomplished that, animation and drop shadow and everything. My worry is that I’m doing it the the completely wrong way, and that come things don’t work completely right.

The application has a rootViewController (of the UIWindow) that is a UINavigationController. A view inside the UINavigationController (its root view controller) has its leftBarButtonItem property set. Here is the code that runs when the button is pressed.

- (void)showFeedList {
    //set the feed list as showing even before it is
    feedListShowing = YES;
    //to show the feed list, we need to instanciate one
    feedSelectionListViewController = [[FeedSelectionListViewController alloc] initWithNibName: @"FeedSelectionListViewController" bundle: nil];
    //set the frame to 200 points to the left of the screen
    feedSelectionListViewController.view.frame = CGRectOffset(feedSelectionListViewController.view.frame, -200, 20);

    NSInteger offset = feedSelectionListViewController.view.frame.size.width;

    //store a pointer to the root navigation controller, and add the list view controller's view to the navigation controller's view
    UINavigationController *navigationController = (UINavigationController *)UIApplication.sharedApplication.delegate.window.rootViewController;
    [navigationController.view addSubview: feedSelectionListViewController.view];

    //animate the navigation bar, feed selection list, and this view controller's view to the right
    [UIView animateWithDuration: LIST_SHOW_TRANSITION_TIME animations: ^{
        self.view.frame = CGRectOffset(self.view.frame, offset, 0);
        navigationController.navigationBar.frame = CGRectOffset(navigationController.navigationBar.frame, offset, 0);
        feedSelectionListViewController.view.frame = CGRectOffset(feedSelectionListViewController.view.frame, offset, 0);
    }];
}

This is really messy, and not everything about it works right. First, when the user leaves and comes back to the application, the UINavigationBar seems to have reset it’s frame. This also happens when the in-call status bar is toggled on and off. Secondly, any views inside the view on the right do not move to the right as they should. I do not know why this is.

However, if I replace the animation block with

    navigationController.view.frame = CGRectOffset(navigationController.view.frame, 200, 0);

It works fine. The subviews of the view currently displayed by the navigation controller move accordingly, and everything is in the right place when the application is resumed. However, the sidebar view is not receiving touch events, touches that are made over the sidebar are now handled by the AppDelegate. I’m suspecting this is because the frame of the UIView has an origin of {-200, 0}, though I cannot be certain.

I don’t think I’m understanding something. Is this even the right way to be doing this? I can’t think of any other ways to be doing it. Anyway, super thanks in advance for any guidance or suggestions.

-matt

  • 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-05-30T13:51:31+00:00Added an answer on May 30, 2026 at 1:51 pm

    What you’re looking for is already provided with this library of mine https://github.com/pkluz/PKRevealController

    Does exactly what you’re trying to do. It’s slim and ready to use. Implementing it by yourself over again would just prevent you from working on your actual app 🙂

    Problems I encountered during implementation as well as what I can tell from skimming over your code are various. Primarily it’s the fact that you’ll have problems because you’re abusing the view hierarchy.

    You basically now have two UIViewControllers taking care of your iPhones screen. That wasn’t intended by Apple at first as it was thought that at any point in time there’d only be a single ViewController present. – This changed with the iPad, and the UISplitViewController. And just recently in iOS 5 the new API made it possible to add your own ViewControllers to the heirarchy.

    The problem you’ll be having is that your FeedSelectionListViewController will have difficulties receiving viewWill/Did/Appear/Disappear and/or rotation calls as it’s not actually part of the chain.

    So my answer is to either check out the library I provide or look into UIViewController Containment first, because your code isn’t exactly fixable seeing how it’s generally not the right approach, even though it might work under certain conditions.

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

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
i want to parse a xhtml file and display in UITableView. what is the
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post

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.