FLEXWindow.m 976 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // FLEXWindow.m
  3. // Flipboard
  4. //
  5. // Created by Ryan Olson on 4/13/14.
  6. // Copyright (c) 2014 Flipboard. All rights reserved.
  7. //
  8. #import "FLEXWindow.h"
  9. @implementation FLEXWindow
  10. - (id)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. self.backgroundColor = [UIColor clearColor];
  15. // Some apps have windows at UIWindowLevelStatusBar + n.
  16. // If we make the window level too high, we block out UIAlertViews.
  17. // There's a balance between staying above the app's windows and staying below alerts.
  18. // UIWindowLevelStatusBar + 100 seems to hit that balance.
  19. self.windowLevel = UIWindowLevelStatusBar + 100.0;
  20. }
  21. return self;
  22. }
  23. - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
  24. {
  25. BOOL pointInside = NO;
  26. if ([self.eventDelegate shouldHandleTouchAtPoint:point]) {
  27. pointInside = [super pointInside:point withEvent:event];
  28. }
  29. return pointInside;
  30. }
  31. @end