QBPopupMenuOverlayView.m 713 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // QBPopupMenuOverlayView.m
  3. // QBPopupMenu
  4. //
  5. // Created by Tanaka Katsuma on 2013/11/24.
  6. // Copyright (c) 2013年 Katsuma Tanaka. All rights reserved.
  7. //
  8. #import "QBPopupMenuOverlayView.h"
  9. #import "QBPopupMenu.h"
  10. @implementation QBPopupMenuOverlayView
  11. - (instancetype)initWithFrame:(CGRect)frame
  12. {
  13. self = [super initWithFrame:frame];
  14. if (self) {
  15. self.backgroundColor = [UIColor clearColor];
  16. }
  17. return self;
  18. }
  19. - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
  20. {
  21. UITouch *touch = [touches anyObject];
  22. UIView *view = touch.view;
  23. if (view == self) {
  24. // Close popup menu
  25. [self.popupMenu dismissAnimated:YES];
  26. }
  27. }
  28. @end