Esteban V Esteban V - 6 months ago 13
Swift Question

iOS Swift first app, controls dont appear

I have created my first app with xcode and swift followin a tutorial.
I have added a button and 2 images to the main story board.

I have also added some easy code:

http://screencast.com/t/m8DVzHNNz60Menter image description here

However when I run the app, the simulator is blank, nothing in it, and the button I know its not hidden.

enter image description here

Answer

There are a few things that could be wrong.

1. Your button isn't centered. You need to center it using constraints. Check out this: http://stackoverflow.com/a/26959256/5143847

2. In your IBAction, you are hiding your button. Try this:

uncoolButton.hidden = false

Or you can just remove it completely. Based on your question, it seems like you want to keep the button showing.