Software equivalent of UIViewController "Resize View From NIB"

What is the software equivalent of a UIViewController Resize View From NIB when editing storyboards in Xcode Interface Builder?

I want to set this to no for a view controller that uses an xib file instead of a storyboard.

Resize View From NIB

+6
source share
1 answer

There UIViewController no method in the UIViewController that needs to be mapped to this IB property. However, since this affects the size and position of the top-level view in relation to the status bar, the software equivalent is likely to be the following: if the status bar is visible:

 int statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height; CGRect viewFrame = self.view.frame; self.view.frame = CGRectMake(0, statusBarHeight, viewFrame.size.width, viewFrame.size.height - statusBarHeight); 
+1
source

Source: https://habr.com/ru/post/976207/


All Articles