How to listen a frame property of a view on iOS

I have a view and I added a observer like this:

_aView = [UIView new];
[_aView addObserver:self forKeyPath:@"frame" options:NSKeyValueObservingOptionNew context:nil];
_aView.frame = CGRectMake(100, 100, 100, 100);

In the observer method I get the new value : - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([keyPath isEqualToString:@"frame"]) { NSLog(@"%@", change[@"new"]); } } The log is NSRect: {{100, 100}, {100, 100}}. The question is that I got the value type is NSRect, how to convert it to CGRect?

In the UIKit library have no type named NSRect


Click here view more answers http://ift.tt/1OYN2ZB