时间是挤出来的
感觉需要加快点脚步才行呀,时间感觉总是不够用
1.ContainerView的创建
ContainerView感觉类似于iOS中的childVieewController,拖入SB中会自带一个viewController
效果:
ContainerView.jpg
2.NSViewController生命周期
感觉和iOS的基本上没有区别
viewDidLoad
视图加载完毕
viewWillAppear
视图即将显示
viewWillLayout
视图即将布局
viewDidLayout
视图布局完毕
viewDidAppear
视图显示完毕
此处的viewWillLayout
文档是这样解释的
You can override this method to perform tasks to precede the layout of the view controller’s view, such as adjusting Auto Layout constraints. If you override this method, call this method on super at some point in your implementation in case a superclass also overrides this method.
The default implementation of this method does nothing.
重写此方法,执行视图控制器视图布局之前的任务,可以调整自动布局约束
此处的viewDidLayout
文档是这样解释的
You can override this method to perform tasks to follow the completion of layout of the view controller’s view. If you override this method, call this method on super at some point in your implementation in case a superclass also overrides this method.
The default implementation of this method does nothing.
网友评论