I am making the basic Minesweeper app for fast exercise / fun. I want to make the board size (10 tiles wide) adapt to any iOS screen.
To do this, I set the size of each tile, getting my tileContainer view.frame.width and / 10.
My problem is that tileContainer is set to 600, no matter what. On my storyboard, I set the tileContainer to be the width of the View Container by clicking on CTR and dragging it into the view and selecting equal width. So the tileContainer width is set to 600, regardless of the device I'm testing on. (this is my problem, the width should vary depending on the screen width not constant 600)
Does anyone know how I can get the correct screen width no matter which device it is used in?
ios autolayout swift storyboard
Evan nudd
source share