Guest User

Untitled

a guest
Feb 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. CPViewFrameSizeDidChangeNotification = "CPViewFrameSizeDidChangeNotification";
  2.  
  3. @implementation CPView (Ext)
  4. {
  5. _postsFrameSizeChangedNotifications;
  6. }
  7.  
  8. - (void)setPostsFrameSizeChangedNotifications:(BOOL)shouldPostFrameSizeChangedNotifications
  9. {
  10. _postsFrameSizeChangedNotifications = shouldPostFrameSizeChangedNotifications;
  11. }
  12.  
  13. - setFrameSize:aSize
  14. {
  15. var frameSizeChanged = (aSize.width != _frame.width || aSize.height != _frame.height);
  16. [super setFrameSize:aSize];
  17. if(frameSizeChanged && _postsFrameSizeChangedNotifications)
  18. {
  19. [_CPViewNotificationCenter postNotificationName:CPViewFrameSizeDidChangeNotification object:self];
  20. }
  21. }
  22.  
  23. @end
Add Comment
Please, Sign In to add comment