presentmodalviewcontroller

orientation issue in ios6

爱⌒轻易说出口 提交于 2019-12-11 11:40:51
问题 I am using UINavigationController in my application and my first controller called A and it is strict to portrite only and there is a button in my A controller.Once I click on the button I am creating instance to the another view controller called B . After creating the instance for B I am presenting modally using below method [self presentViewController:BInstance animated:YES completion:^{ NSLog(@"completed"); }]; My B controller can able will support all the orientations, this is expected,

How to call presentViewController?

坚强是说给别人听的谎言 提交于 2019-12-11 06:23:41
问题 Here is the situation: I have a class MainView (which is a UIViewController) and call from it an UIActionSheetDelegate class. I want to use the method presentViewController, but the following code does not work (currently being called in the ActionSheet class): [self presentViewController:myViewController animated:YES]; I am a little confused regarding where I should call the method from (MainView or the ActionSheetDelegate). Thanks in advance. 回答1: You call the method on the UIViewController

How to add an UINavigationController to an UIViewController presented as Modal

萝らか妹 提交于 2019-12-11 05:23:25
问题 I have an alternative flow in my app. This flow starts in my firstViewController, then in this view a call my secondViewController like this: - (IBAction)PressButton:(id)sender { SecondViewController *second = [[SecondViewController alloc] init]; second.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; UINavigationController *nav = self.navigationController; [nav presentViewController:second animated:YES completion:nil]; } In my secondViewController I want to push my

Present a UIViewController from an NSObject

我是研究僧i 提交于 2019-12-11 04:47:23
问题 Something happens in my datamodel, and I need to present a modal viewcontroller instantiated through the storyboard. How can I do this? I need to present a modal VC from an NSObject, and obviously presentViewController is a UIViewController method. What's the best way to do this? UIStoryboard *mainStoryboard = [(AppDelegate *) [[UIApplication sharedApplication] delegate] storyboard]; NewMessageListenPopupVC *popupVC = [mainStoryboard instantiateViewControllerWithIdentifier:@

Parent UIViewController Orientation Shouldn't Change After Dismissing the Child

独自空忆成欢 提交于 2019-12-10 18:29:51
问题 Lets say I have three UI Controllers (A,B,C). A is my root controller and inside the ShouldAutoRotate method I return YES. I do presentModalView from A to B (B=>inside the ShouldAutoRotate method I return Portrait) then from B I do presentModal to C (C should be able to rotate to any orientation). Now inside C I'm able to rotate the simulator to any orientation, and the whole View rotates perfectly.Here is the problem, when C is Landscape and I dismiss it, all the objects inside B will become

Partial page curl by pan gesture like in UIPageViewController

廉价感情. 提交于 2019-12-10 16:07:47
问题 I would like to partly display a view controller exactly like UIModalTransitionStylePartialCurl , but instead of the curling animation i want to curl the view by a pan gesture My goal is to get the same affect like when using UIPageViewController to switch between ViewControllers by dragging\curling the page according to the user touches (not a swipe gesture). Any help will be appreciated. 来源: https://stackoverflow.com/questions/10880031/partial-page-curl-by-pan-gesture-like-in

How to ensure completion of a async operation before continuing with execution

青春壹個敷衍的年華 提交于 2019-12-10 11:57:36
问题 I am building an iOS app and some part of its code relies on the success/failure value returned from a particular task.This tasks involves callbacks from a library. I want the return value from this task to be returned only after the callback has returned either success/failure. But since I wrote a sequential code the return value is returned even before the callback returns a success/failure. I looked into using modal view controllers and from what I understand I can make the task execute

How to prevent present modally an active controller?

女生的网名这么多〃 提交于 2019-12-09 02:56:36
问题 We have 2 controllers: MainVC and ProfileVC. From MainVC we go to ProfileVC with profileButton press (left item on navigation bar). In Profile VC we have 2 buttons on navigation bar : back to main (leftItem) and open an alertView (rightItem). So there is simple KIF test (just eternal left-right taps on navigation bar): - (void)testProfileButtons { [tester waitForAnimationsToFinishWithTimeout:0.3]; while (true) { [tester tapScreenAtPoint:CGPointMake(20, 20)]; [tester waitForTimeInterval:0.1];

UINavigationController with presentModalViewController

走远了吗. 提交于 2019-12-09 01:30:05
问题 I have a menu screen that implements UINavigationController and on top of that screen, using presentModalViewController , I place another screen on which I want to have another UINavigationController . I have tried to implement another navigation controller to handle the new screen but I either get a navbar 1/8th the way down the screen and it crashes or nothing at all. I have tried [[UINavigationController alloc] initWithRootViewController:navigationConroller] with no success as well. I'm

Presenting a view controller of custom size with navigation

☆樱花仙子☆ 提交于 2019-12-08 13:29:00
问题 I want to present a view controller of custom size say (500,500). I try to do that with the below code, it works fine with a semi transparent light gray background if I present the view controller alone but when i put the view controller in a navigation controller (which I want to do) there is a black background that comes up, I dont want this and I want the gray one. I did the following code with the help of this question: iOS -- how do you control the size of a modal view controller?