Swift KVO监听frame改变

//监听frame改变 
addObserver(self, forKeyPath: "frame", options: NSKeyValueObservingOptions.New, context: nil)
deinit
{
     removeObserver(self, forKeyPath: "frame")
}
override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer) {   
}

你可能感兴趣的:(Swift KVO监听frame改变)