Actually, above answers are not quite right. I followed them and got zeros again and again.
The trick is to place your frame-dependent code to the viewDidLayoutSubviews
method, which
Notifies the view controller that its view just laid out its subviews.
Do not forget that this method is called multiple times and is not the part of ViewController's life cycle, so be careful while using this.
Hope it will be helpful to someone.
Just wanted to add, that for my program without landscape mode NOT using Auto Layout is way much simplier... I tried, though =D
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…