iOS应用的视图状态分为以下几种
@available(iOS 2.0, *) public class UIViewController{ public func viewDidLoad() // Called after the view has been loaded. For view controllers created in code, this is after -loadView. For view controllers unarchived from a nib, this is after the view is set. public func viewWillAppear(animated: Bool) // Called when the view is about to made visible. Default does nothing public func viewDidAppear(animated: Bool) // Called when the view has been fully transitioned onto the screen. Default does nothing public func viewWillDisappear(animated: Bool) // Called when the view is dismissed, covered or otherwise hidden. Default does nothing public func viewDidDisappear(animated: Bool) // Called after the view was dismissed, covered or otherwise hidden. Default does nothing public func didReceiveMemoryWarning() // Called when the parent application receives a memory warning. On iOS 6.0 it will no longer clear the view by default. }