This code can be the view top to the status bar to stick to the top of the screen
This code will also be the view top to the bottom, so if the project is developed with Tabbarcontroller
TableView below the total display is not complete, with code to set the offset is useless;
The official documentation is explained as follows: A Boolean value that indicates whether the view controller should automatically adjust its scroll view insets. Declarationswiftvar Automaticallyadjustsscrollviewinsets:boolobjective-c@property (nonatomic, assign) BOOL Automaticallyadjustsscrollviewinsetsdiscussionthe default value of this property is YES, which allows the view controller To adjust their scroll view insets in response to the screens areas consumed by the status bar, navigation bar, and toolbar O R Tab Bar. Set to NO if you want to manage scroll view inset adjustments yourself, such as when there are more than one scroll view in The view hierarchy. Availabilityavailable in IOS 7.0 and later. The simple point is that Automaticallyadjustsscrollviewinsets is based on the status bar at the interface, Navigationbar, with Tabbar height, automatically adjusts ScrollView inset, sets to No, does not let Viewcontroller adjust,
Therefore, in order to avoid the problem can be manually set the Contentinset can also achieve the same effect;
Get the controller's view to the top of the screen, which is underneath the status bar