Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • PopOverView

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 408
    Comment on it


    PopOverView is used to show the pop up menu. To implement PopOverView first we have to embed navigation to the view controller and take one another Content view controller to show the popup data. Take one button in view controller and give action to it i.e popUpButtonAction. Give storyboard Id to the Content view controller i.e "ContentController”. Add one view or label in contentController and give some color or text to it.

    From Button to Content Controller give one segue of type "Present as popover."

    In button action add following code.
     

    - (IBAction)popUpButtonAction:(id)sender {
        
        ContentController *contentVc = [self.storyboard instantiateViewControllerWithIdentifier:@"ContentController"];
        UINavigationController *destNav = [[UINavigationController alloc] initWithRootViewController:contentVc];/*Here contentVc is controller you want to show in popover*/
        contentVc.preferredContentSize = CGSizeMake(280,200);
        destNav.modalPresentationStyle = UIModalPresentationPopover;
        popOver = destNav.popoverPresentationController;
        popOver.delegate = self;
        popOver.sourceView = self.view;
        popOver.sourceRect = ((UIButton*)sender).frame;
        destNav.navigationBarHidden = YES;
        [self presentViewController:destNav animated:YES completion:nil];
        
    
    }
    
    
    - (UIModalPresentationStyle) adaptivePresentationStyleForPresentationController: (UIPresentationController * ) controller {
        return UIModalPresentationNone;
    }
    
    

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: