I have a TabBarApplication for an iPad App, which is switching between two ModalViews (LoginForm / Memberarea) in one of the Tabs by checking Loginstatus. All works fine, but when I switch to another Tab of the Application and then switch back, no modal view is shown and the view don't refresh to check for status again.
Is there any way to keep the modal view on the TabView, even if user switches to another tab?
Or is it possible to refresh the View when its tab becomes active?
Would be great if someone can help me with this problem!
EDIT: Problem solved!
I solved it on my own. =)
The problem was: After switching to another TabView the modal don't show up, but is not dismissed. There was a error in my log displaying that the modal can't be viewed.
So to solve it I used the "viewWillDissapear" method and dismiss my modalView before switching Tabs, like this:
[self dismissModalViewControllerAnimated:YES];
The Modal is dismissed, and after switching the View loads again and displays the deserved modalView. =)
Thanks for your answers.
You can do the refresh code you were talking about by implementing viewWillAppear in your view controller
Call your code which clls modalview controller in viewwillappear method.
Related
I am using SWRevealViewController for an app. Before the main storyboard, I have another storyboard where I am logging in the user and setting him up for use. Once the user is logged in, I present the reveal view controller, which has the proper segues to show my dashboard view controller.
SWRevealViewController works perfectly, except for one specific problem: On initial load to my dashboard view controller, there is a 10 second delay before my navigation button shows on the navigation bar. If you wait for it and click the navigation button and go to another screen and then back to the dashboard view controller, the navigation would be there instantly.
What could cause this delay? It is almost as if it needs a dispatch_async on SWRevealViewController. Any thoughts?
From the description you gave, it seems to me that the display of the navigation buttons is not happening in the main thread. I would agree that dispatch_async might be needed here. I do find it strange that this is happening since navigation itself happens in the main thread.
I have a UIMenuController which is presented when a UIView is tapped. I have implemented the canPerformAction and canBecomeFirstResponder methods, and it works when the view is first loaded. The app is navigated by a tab view, and if a user is to switch to another view and then back to the first (although the same issue occurs if a modal view is presented from the first view), the UIMenuController will no longer show up. Any ideas as to why this could be?
I just worked out the answer: I have to manually call becomeFirstResponder on my view in order for it to work.
I have a modal view controller and a master view controller. When I open the modal view controller, everything works fine. But when I press the back button, the Master View Controller isn't loaded and loads itself immediately after the transition is done. Is there anyway I can fix this issue? Would I use prepareforsegue? A point in the right direction would be greatly appreciated!
If you're using presentModalViewController (or the storyboard equivalent) all you have to do is have the modal view controller call [self dismissModalViewControllerAnimated:YES]. The master view controller will not have been removed from memory, so no setup is necessary.
try to do everything in your viewWillApear: cause when it when modelViewController got dismiss viewWillApear: will call and load the load functionality there only :
Hey guys, just wondering if this one is possible
I have an app that posts to tumblr, and the posting function is within a modal view of the main view. I have a connection listener that stops displaying an activity indicator in the status bar when the app gets a response from tumblr's servers. I want to display a message saying that it was posted successfully in the main window, outside of the modal view..is this possible?
Yes of course, you can add a subview to the UIWindow. In the app delegate make the window a property, if it isn't alreay. Now you can access the window with
((YourAppDelegate *)[[UIApplication sharedApplication] delegate]).window
Don't forget to cast, else window will give you a warning.
Adding a subview to the parentViewController while showing a modal view controller won't show it, it's behind the modal view controller.
Have you tried accessing the outside view via the parentViewController property on your modal view controller?
i have an application based on an navigation controller. At first, it presents a Modal View with the Log In interface. After the user logs in, i dismiss this view and present the rootViewController.
Then, in the nav bar i have a button in order to show the Profile view in wich i can log out.
The problem is the following. When i press log out in the Profile View i do two things:
Present a new Modal View with the log in screen.
Pop the profile view controller.
But for a moment, i can see the pop action and the RootViewController before the Log In View is shown.
How can avoid this behavior?
Thanks
You need to specify that you do not want to see the animation. Where are you popping the last view controller from?
It should probably be something like this
[navController popViewControllerAnimated:NO];
Hey,
I think you must have the animated flag either on - (void)dismissModalViewControllerAnimated:(BOOL)animated or
on - (UIViewController *)popViewControllerAnimated:(BOOL)animated set to YES so you are actually able to see it switching views. If you change them to NO the "Log in" view will come up right away.
I hope this is useful for you.
Regards