I used KVO to detect changes to view.layoutMargins. And I found that the view itself will change layoutMargins after setting during processing of layoutSubViews .
So, just enter your settings codes into the viewDidLayoutSubviews method:
- (void)viewDidLayoutSubviews { self.view.layoutMargins = UIEdgeInsetsMake(100.0f, 100.0f, 100.0f, 100.0f); }
PS: There is an OC through these codes, but I think it can also work for Swift. Hope this works for you!
mayqiyue Jan 09 '16 at 6:39 2016-01-09 06:39
source share