Blank white screen every time I run the iOS simulator - ios

I've created a simple program where a person can log in with a username and password. Every time I attempt to run it, I simply get a blank white screen. I tried changing the background color to a dark green one in hope that it would change it in the simulator too, however I get the same white screen.
This problem arose before I got that breakpoint error, it first started happening randomly in a previous project, which makes me think something is wrong with my xcode.
See my screenshot below:

I had this same issue where I saw the app briefly, and then it went to solid white. It pays to make sure you edit the "Main" storyboard, not the "LaunchScreen" storyboard when following tutorials...
Maybe my embarrassing mistake will help someone else...

There are a few things to keep in mind here that could be causing thsi error. Firstly, as some of the comments have pointed out the first thing you should do is delete the breakpoints from all the lines. To do that, you have 3 choices:
Press the blue arrow just above the console, that you can see here:This will disable all your breakpoints, so if you are using them intentionally somewhere else, don't use this method.
You can press each breakpoint individually, simply pressing the arrows next to your code on the left-hand side. This will disable the specific breakpoint. They then will become more greyish, like the one below #IBAction func loginTapped()
Last but not least, in my opinion the best method, simply grab the blue arrow and drag it to the right or left. This will make a cloud and zishing noise, symbolizing the deletion of the breakpoint.
Once this is out of the way, let's take the second most important step. Check that the loginViewController is the initial View Controller, so that it's the first page that's displayed. To do that, simply open the file inspector on the right-hand side. You can activate it by pressing the third button here:
Then, select your viewController,, so that it light up's blue like seen below:
Then, on the 3rd tab of The file inspector, by pressing the 4th tab that looks like an arrow pointing down. Now you should see a checkbox saying "isInitialViewController". Tick that so that you get through immediately to this screen. It should look like this down below:
Lastly, I'd like to point you to some more things you should check that could cause this error:
You never actually create the UITextField and UIButton
You have a different view covering your viewController(eg, webView or view)
You are on the wrong storyboard, this could happen but is unlikely.
If all this fails, try restarting Xcode, the simulator and running again by pressing the Play Sign or CMD-R.
Hope that helps, Julian

I don't know who this might help but I solved my problem by reinstalling CocoaPods and installing everything with pod install and pod update. I reset my mac some time back because it's storage was full and I forgot CocoaPods and all the pods uninstalled. Reinstalled them and now I'm back.
Edit:
It didn't fix it but I am getting closer.

It happened to me after exiting Xcode and closing the simulator the simulator device setting changed to the default ipod, when I realized this I changed it back to iPhone11. I got the white background but after waiting a few minutes it just worked.

Related

iOS Storyboard ViewController went Blank

I'm working on the code in a project when I suddenly notice the ViewController in Storyboards is greyed out with the name of the VC in the center.
Here's a screenshot..
I was only editing some code on the right and I'm not sure exactly when, but my eyes adjusted and noticed this VC completely greyed out in Storyboards.
I tried deleting Derived Data, cleaning, quitting Xcode, building again, etc.
Nothing seems to work... ANy help with this would be super appreciated. I'm also very new to programming in general.
Well it turns out if you ever run into this problem, it's because you're not paying close attention and haven't realized you've somehow magically deleted your entire view inside the ViewController.
I did this once before by hitting something randomly on my keyboard (don't know what it was) but that time I saw it happen and just hit "undo".
This time I was passed the point of simply hitting "undo" and had to add a view again and rebuild and reconnect all the components in the view. That was basically it. Problem solved...

Xcode - How come sometimes definitions are in white and sometimes colored?

When I want to view a definition on Xcode, I would use Control + Command + Click to jump to a definition. However, sometimes the syntax will be colored, sometimes it'll be all in white. Does anyone know why that happens sometimes and how to fix it?
Here's an image of how it's supposed to look. I'm trying to recreate it where it'll show all white, but I have no clue how that happens or how to fix it when it happens other than waiting.
Why this happens or is this just a bug with Xcode?
It happens sometimes when Xcode is running the App, or indexing, or doing something else.
Just wait a little while it finish processing its current task.
By the way, you can change some Navigation options in this tab :

Unable to get navigation bar to appear in xcode, double click doesn't register

I was working through the swift tutorial:
https://www.raywenderlich.com/115279/swift-2-tutorial-part-2-a-simple-ios-app
On the section (about 1/3 way down)
But I'm noticing a problem when I attempt these steps in my xcode environment. I am able to successfully embed a navigation bar, but "double clicking" doesn't allow me to set the text at all, in fact it really doesn't let me do anything just highlighting the nav bar region:
See:
I can also put up code at request, but being this is so early in the project, I haven't coded really anything yet, it seems more like a UX challenge. Am I missing some particular setting in Xcode editor that allows the text to be highlighted, or has the guide skipped some trivial, but necessary step to making this work?
#sschale's answer is a good solution:
For user's that come across the post, it isn't obvious where that menu is. After some digging I found that you need to hit a certain middle icon (in the red box) so it is blue to find the form. Image attached:
Sometimes it can be hard for it to register there. You can edit it in the right sidebar directly, when the Navigation Item is selected:

Xcode 6.4 Bug? Source code text disappears. OSX Yosemite

Is it just me, or does this happen to anyone else? Occasionally if I am coding inside of a huge class, the source code text begins to chop it's way out to a white screen as I scroll. However, when I vigorously scroll to the top, then back down again. The source code re-appears again.
What could be the issue? Is there a work around? This issue is so annoying!
Go to Preferences->General tab and uncheck "Show live issues" under Issues. Notice that this is a work around to be able to continue working with Xcode, at least until they issue an official fix. This glitch seems to be noticeable when you have lots of lines of code (1000+).
After this, the glitch will still be happening but not while coding but during building phase. Not perfect but at least you will be able to continue working.

Black screen when I add UINavigationController

I am following the Udacity tutorial on Swift, and for some reason when I added the second view, I usually get a black screen (as in the screen print) right when I open the app. Occasionally I get it working but usually not.
What could be the problem?
Noticed that "Did appear" is printed before "Will appear", is that a bug or did I do something wrong?
I have read this and this but it didn't help much. I also have tried several times to clean the project and rebuild it (nothing changed).
One time I just commented out some code (from the second view that should be loaded) and it worked suddenly. When I uncommented the same code it still worked.
Another time it worked when I disconnected the second view on the story board (it was still there, just no way to reach it).
Both have worked at least one time, and not worked many times.
Sorry this seems like I throw in random pieces of information, but I have no idea what could be the reason.

Resources