I have two view controllers. In the first one I have a button and when it is clicked I want to show the other view controller in the right of the screen to login like modal present form sheet.
For the moment I have the second view controller with a label but when I click it appears empty, I don't know way because I put a label inside, and of course in the middle of the screen.
LoginViewController *loginController = [[LoginViewController alloc] init];
loginController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:loginController animated:YES completion:nil];
loginController.view.superview.frame = CGRectMake(0, 0, 300, 1000);
loginController.view.superview.center = self.view.center;
Any suggestion to see the label? To change the position?
I think it would be best to use the custom container controller methods to do this. In the example code I have below, I made a login controller that was the size of a form sheet (540 x 600) and slid it in from the right onto the main view of ViewController so that it was centered vertically, and up against the right side.
In ViewController.m, I have this:
And to remove the view, I have this in the LoginController.m:
After Edit:
If you want to remove the login controller from a button in ViewController, you can do it like this: