You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

52 lines
1.2 KiB

  1. //
  2. // TSBlurView.m
  3. // Pods
  4. //
  5. // Created by Felix Krause on 20.08.13.
  6. //
  7. //
  8. #import "TSBlurView.h"
  9. #import <QuartzCore/QuartzCore.h>
  10. @interface TSBlurView ()
  11. @property (nonatomic, strong) UIToolbar *toolbar;
  12. @end
  13. @implementation TSBlurView
  14. - (UIToolbar *)toolbar
  15. {
  16. if (_toolbar == nil) {
  17. _toolbar = [[UIToolbar alloc] initWithFrame:self.bounds];
  18. _toolbar.userInteractionEnabled = NO;
  19. _toolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  20. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
  21. [_toolbar setBackgroundImage:nil forToolbarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault]; // remove background set through the appearence proxy
  22. #endif
  23. [self addSubview:_toolbar];
  24. }
  25. return _toolbar;
  26. }
  27. - (void)setBlurTintColor:(UIColor *)blurTintColor
  28. {
  29. if ([self.toolbar respondsToSelector:@selector(setBarTintColor:)]) {
  30. [self.toolbar performSelector:@selector(setBarTintColor:) withObject:blurTintColor];
  31. }
  32. }
  33. - (UIColor *)blurTintColor
  34. {
  35. if ([self.toolbar respondsToSelector:@selector(barTintColor)]) {
  36. return [self.toolbar performSelector:@selector(barTintColor)];
  37. }
  38. return nil;
  39. }
  40. @end