0

Totally i have 5 view controllers and i have fixed one button as Account Button in all 5 view controllers, once i clicked the Account button it need to show the tablewView like below image,first i tried the one table view to show hide in first view controller i want to show the table view for all five view controller when i clicked the account button,

This i want to show in all view controllers,

enter image description here

When i click any option it navigate to

My Account -> AccountVC,
Track Order -> TrackOrderVC,
Customer Services ->CusServicesVC
iOSDev
  • 61
  • 4

1 Answers1

0

same thing i implemented in one of my project.create subclass of uiview and in .h file write this two method

      - (void)showMenuViewAnimatedWithFrame:(CGRect)rect;
      - (void)hideMenuViewAnimated;

and in .m file create a object of table view implement it's delegate and datasource method and write this code as

- (void)showMenuViewAnimatedWithFrame:(CGRect)rect{

  listTableView.frame = CGRectMake(0, 10, rect.size.width, rect.size.height - 10);
[UIView animateWithDuration:0.3f animations:^{
    self.frame = rect;

    }];
 }

 - (void)hideMenuViewAnimated{
[UIView animateWithDuration:0.3f animations:^{

    self.frame = preViewframe;//set your view frame to preViewframe
   }];
 }

finally call this methods in your view controller where you want to show a dropdown picker by creating its views object.if you set correctly i will look like:

enter image description here