Search code examples
iosobjective-cuinavigationcontrollerecslidingviewcontroller

Sidebar menu with indicate navigationbar on iOS


I want to create sidebar menu with indicate UINavigationBar like below mention image.

enter image description here

By using ECSlidingviewController library i have done side menu. But thing is i need to display Navigation Indicator when user slide on menu.

How can i create? Any one having idea?


Solution

  • There is nothing special to do here. Simply create your view and add it as a subview of the navigationBar in your controller (not the menu controller).

    Here is a simple demonstration:

    CGFloat desiredWidth = x;<----replace x.
    UIView *testView = [[UIView alloc]initWithFrame:CGRectMake(-desiredWidth,0,desiredWidth,44)];
    [testView setBackgroundColor:[UIColor blackColor]];
    
    [self.navigationController.navigationBar addSubview:testView];