iOS之 Auto Layout

1. 动画

// 修改从 StoryBoard 绑定到类的约束的值
self.boxView.constant += 80

// 在动画闭包里对其父级进行 layoutIfNeeded()
UIView.animateWithDuration(0.5, animations: { () -> Void in
    self.view.layoutIfNeeded()
})

 2. frame的确定

viewDidLoad
viewWillAppear
viewWillLayoutSubviews
viewDidLayoutSubviews // frame 确定
viewDidAppear
viewWillDisappear
viewDidDisappear

3. why?  

原文地址:https://www.cnblogs.com/Ohero/p/5125940.html