presentviewcontroller

Dismiss and present modal view controller with one animation

那年仲夏 提交于 2019-12-05 11:34:57
The problem is that I don't know how to dismiss and present a view controller with only one transition animation. My storyboard structure is: We can say that A controller is what follows the NavigationController, B is the Startup reference and C is the TabBar ViewController. Both B and C are presented modally with a Cross Dissolve transition. When a user logins into the app (from B ), C controller is presented modally with a Flip horizontal transition. And when a user logouts (from C ), B is presented in the same way. On A controller I perform a direct segue to B or C depending on if user is

Presenting a View Controller with a button in a UITableViewCell programmatically (Swift)

南楼画角 提交于 2019-12-05 00:26:27
I am trying to make it where when a user clicks on a table view cell in my table view it takes them to a new view controller. More specifically, when a user clicks on a persons username it should take them to that users profile. the username being the table view cell and the profile being the new view controller. I thought the way to do this was to use the ".presentViewController(vc, animated: true, completion: nil) however when i do this it says "myCell does not have a member named .presentViewController" If anyone could help me solve this problem it'd be greatly appreciated Bannings The

push view controller after dismissing presented view controller

蹲街弑〆低调 提交于 2019-12-04 23:14:34
I have this navigation stack RootVC ---> VC1 --> (presenting)-> ModalVC and I have VC2 (not in navigation stack). When presenting ModalVC , I want to click on button in my ModalVC to dismiss ModalVC, then push VC2 into the navigation stack after VC1 at one click. It should look like this: RootVC ---> VC1 ---> VC2 I tried a lot of methods to make it, but pushing event fire only, when I return to my RootVC . I tried to make it with delegates: In ModalVC on click: [self dismissViewControllerAnimated:YES completion:^{ if ([self.delegate respondsToSelector:@selector(dismissAndPush:)]) { [self

How to present a view controller with smaller size

点点圈 提交于 2019-12-04 10:40:15
I want presented view controller vc2 in smaller size than the screen, how to do that in Swift 3 ?? Thanks for help. This is my code: @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "Controller2") as! ViewController2 vc2.modalPresentationStyle = .currentContext present(vc2, animated: true, completion: nil) } Try this.. @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "Controller2") as! ViewController vc2.providesPresentationContextTransitionStyle

Present View Controller not working with ios 9

两盒软妹~` 提交于 2019-12-04 10:23:22
Present view controller is not working with ios 9, when I press the button it not redirected to present view controller. Why this happens ? I had tried the below code RegistrationViewController * viewController =[[UIStoryboard storyboardWithName:@"Registration" bundle:nil] instantiateViewControllerWithIdentifier:@"RegistrationViewController"]; [self presentViewController:viewController animated:YES completion:nil]; I had also tried the below code UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Registration" bundle:nil]; RegistrationViewController *add = [storyboard

Slow presentViewController performance

♀尐吖头ヾ 提交于 2019-12-04 08:59:31
I am using UIViewControllerTransitioningDelegate to build custom transitions between two view controllers (from a MKMapView ) to a custom Camera built on ( AVFoundation ). Everything goes well until I call the presentViewController and the phone seems to hang for about 1 second (when I log everything out). This even seems to happen when I am transitioning to a much simpler view (I have a view controller that only displays a UITextview and even with that there appears to be about a .4 - .5 second delay before the transition is actually called). This is currently how I am calling the transition

Refreshing Parent ViewController after dismissing ModalViewController

余生颓废 提交于 2019-12-04 07:59:48
问题 In my iOS app, a user can select an image from a list, upon which they are presented with a modal that contains the image and options to delete the image. If the user chooses to delete the image, she is returned to the original viewController containing the list of images. I need to then refresh the original ViewController to take into account the deleted image. I tried using NSNotificationCenter to broadcast when an image is deleted to the parent View Controller. However, it seems like the

iOS 8: Presenting a modal view controller in portrait causes resize of the navigation bar of the underlying landscape navigation controller

北城余情 提交于 2019-12-03 03:02:01
On iOS 8 I have a strange behavior regarding the navigation bar and orientation changes. I have a navigation controller which reports a supported interface orientation UIInterfaceOrientationMaskLandscapeRight . The navigation bar has the expected height for landscape orientation (sadly I am not entitled to post screenshots). Then I initiate a modal presentation of a view controller that only supports UIInterfaceOrientationMaskPortrait . When the presentation animation starts, it seems that the metrics of the underlying navigation controller are changed to a portrait presentation, as the height

presentViewController in AppDelegate with delay in iOS8

本小妞迷上赌 提交于 2019-12-02 21:17:21
So I had a full working solution in iOS7 that displays a LoginViewController via presentViewController in the AppDelegate's didFinishLaunching. Basically I am doing something like this: UIViewController *backgroundViewController = ... self.window.rootViewController = backgroundViewController; [self.window makeKeyAndVisible]; [self.window.rootViewController presentViewController:loginViewController animated:NO ...] In iOS8 I see a jump. First I see the backgroundViewController then after about 1 second or so the login appears. So, how can I prevent this jump in iOS8? I am seeing that are a ton

Refreshing Parent ViewController after dismissing ModalViewController

戏子无情 提交于 2019-12-02 19:35:22
In my iOS app, a user can select an image from a list, upon which they are presented with a modal that contains the image and options to delete the image. If the user chooses to delete the image, she is returned to the original viewController containing the list of images. I need to then refresh the original ViewController to take into account the deleted image. I tried using NSNotificationCenter to broadcast when an image is deleted to the parent View Controller. However, it seems like the broadcast is never received. Is there some other way to send data back to the parent ViewController