Use Auto Layout and pin your view to Top Layout Guide, or use the new Safe Area Layout Guides. To enable it, in your storyboard's File inspector tick the following option.
![enter image description here](https://i.stack.imgur.com/c8s7U.png)
As an example I have used gray image view:
![enter image description here](https://i.stack.imgur.com/zzGUg.png)
As you can see below, it does not overlap status bar:
![enter image description here](https://i.stack.imgur.com/rzzqR.png)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…