viewcontroller

ios: how to dismiss a modal view controller and then pop a pushed view controller

僤鯓⒐⒋嵵緔 提交于 2019-12-04 18:32:31
问题 I have a view controller B that is pushed onto the navigation stack by root view controller A and this view controller B needs to display an alternative view if its model is in a certain state so it is modally presenting another view controller C. When I dismiss view controller C I would also like to pop view controller B if that is also on the nav stack. I would like to do it in such a way that there is only 1 transition. Any ideas? 回答1: In the scenario you posted, the presenting view

How to Sign Out of Google After Being Authenticated

风流意气都作罢 提交于 2019-12-04 16:24:02
问题 So my app has the option to sign in with Google. Upon clicking the button that Google provides, a web view opens and has the user input their credentials. After allowing the app to access their information the app then signs the user in and changes the SignInViewController to the TabBarController (where they can now interact accordingly). When the user presses a Signout button they are directed to the login screen as one would expect. But the odd thing is, if the user presses the google

Segue from LaunchScreen to a viewController in Main.Storyboard?

只愿长相守 提交于 2019-12-04 13:48:16
I got some logic I want to do in my LaunchScreen, and if the check is alright, I want to segue to a viewController and if not I want to segue to another, is that possible? I got some logic I want to do in my LaunchScreen Now that I understand the question, I can answer it: don't. Do your time-consuming logic later. Your job is to launch fast . You need to get out of applicationDidFinishLaunchingWithOptions , get out of viewDidLoad , and launch . What you show at that point is up to you; if you have time-consuming stuff (in your case, it sounds like you're networking or doing something else

Show ViewController from XIB-file-Button - Swift

柔情痞子 提交于 2019-12-04 13:42:13
问题 is there a way how to segue from a xib-file (custom TableViewCell) to another ViewController in the Main.storyboard. There's no possibility to drag a segue, like within the main storyboard. In the cell I've got a button, from where I want to change the view. How can I solve it? Thanks! 回答1: You can always instantiate a view controller from your Storyboard and present it on button tapped: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard

A view controller is in landscape mode, but I'm getting the frame from portrait mode?

一世执手 提交于 2019-12-04 13:31:14
问题 I have a settings view controller with a table view. The table view is supposed to set its frame to be the frame of the view controller. My app only supports landscape mode, so that's the orientation I'm always in. However, when the settings view controller loads, the table view has the portrait mode frame of the view controller, even though it's in landscape (360 by 480 when it should be 480 by 360). Additionally, when I checked to see if the device thought it was in portrait mode, it

iOS Integrate PKRevealController with Storyboard & Auto Layout

可紊 提交于 2019-12-04 04:45:02
I'm trying to integrate PKRevealController into an existing project of mine. https://github.com/pkluz/PKRevealController How do I set up my left view controller, right view controller, and front view controller if I'm using storyboard? The readme says to do... PKRevealController *revealController = [PKRevealController revealControllerWithFrontViewController:frontVC leftViewController:leftVC options:options]; self.window.rootViewController = revealController; Where would I put these lines of code in my existing storyboard project? Or are there any alternatives to set this up? Thanks! Just set

How return a value from view2 to view1 when using navigation bar

99封情书 提交于 2019-12-03 20:20:19
I am New to the iPhone Development. How can i carry a string value from view2 to view1 when using navigation bar. I have no problem in carrying string values from view1 to view2 to view3 to....by using pushviewcontroller But when i come back to previous views using Back button of navigation bar, I cannot able to hold string values. I need your help in solving this issue. Thanks In Advance This thing can be done easily if the pass the reference of the current class to the next class and change the values by using this reference. Like: The class that is to be pushed. @interface B

ios - Navigation between multiple NavigationControllers

谁说胖子不能爱 提交于 2019-12-03 17:09:28
问题 I'm trying to understand a behavior of navigating between ViewControllers with (and without) using a NavigationController and I'm misunderstanding some things while reading articles and docs so I decided to ask them. Main question is: What happened if we have multiple NavigationControllers in Storyboard and want to go from one to another? (And this can be achieved just using segues as we do between common VCs, am I right?) As I understand, a NavigationController represents a stack of

Presenting a view controller programmatically in swift

谁说胖子不能爱 提交于 2019-12-03 16:38:42
问题 Hi I am trying to convert the following objective C code into swift to navigate from one view controller to another view controller when a button is clicked. any help would be much appreciated This is taken from apple's programming guide - (void)add:(id)sender { // Create the root view controller for the navigation controller // The new view controller configures a Cancel and Done button for the // navigation bar. RecipeAddViewController *addController = [[RecipeAddViewController alloc] init]

ios: how to dismiss a modal view controller and then pop a pushed view controller

[亡魂溺海] 提交于 2019-12-03 12:17:12
I have a view controller B that is pushed onto the navigation stack by root view controller A and this view controller B needs to display an alternative view if its model is in a certain state so it is modally presenting another view controller C. When I dismiss view controller C I would also like to pop view controller B if that is also on the nav stack. I would like to do it in such a way that there is only 1 transition. Any ideas? In the scenario you posted, the presenting view controller for view controller C will actually be the navigation controller, so you can ask it to pop off B, and