Question: I tried `[[UIScreen mainScreen] bounds]` to get the screen size of a resizable iPhone on `Xcode 6` simulator. But it doesn't take into account the new screen width and screen height I assign to it.

Is there a better way to get the screen size? Even if I set the screen size to **320x800** the `[[UIScreen mainScreen] bounds]` returns me `(CGRect) $0 = origin=(x=0, y=0) size=(width=768, height=1024)`

![enter image description here](https://i.stack.imgur.com/y0k9k.png)

Answer: 
Do following

**CGRect Rect=[[UIScreen mainScreen] bounds];**

So it will preserves the bounds in the rect.
try once.
In Swift 4.0, 3.0 

```
let screenRect:CGRect = UIScreen.main.bounds

```