Guest User

Untitled

a guest
Apr 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. /** Popover item subclass */
  2.  
  3. @implementation NXWindowListPopoverItem
  4.  
  5. -(void)commonInit{
  6. NSTouchBar* touchBar = [NXWindowListTouchBar new];
  7. self.popoverTouchBar = touchBar;
  8. self.pressAndHoldTouchBar = touchBar;
  9. self.customizationLabel = nil;
  10. self.collapsedRepresentationImage = [[NSBundle bundleForClass:self.class] imageForResource:@"NXWindowListIcon"];
  11. }
  12.  
  13. -(instancetype)initWithCoder:(NSCoder *)coder{
  14. self = [super initWithCoder:coder];
  15. [self commonInit];
  16. return self;
  17. }
  18. -(instancetype)initWithIdentifier:(NSTouchBarItemIdentifier)identifier{
  19. self = [super initWithIdentifier:identifier];
  20. [self commonInit];
  21. return self;
  22. }
  23. ......
  24. @end
  25.  
  26.  
  27.  
  28. /** subtouchbar subclass */
  29.  
  30. @implementation NXWindowListTouchBar{ ... }
  31. -(void)commonInit{
  32. self.delegate = self;
  33. scrubberIdentifier = @"NXTouchBarWindowListTouchBarScrubberItem";
  34. subTouchBarIdentifier = @"NXTouchBarWindowListTouchBar";
  35. self.customizationIdentifier = subTouchBarIdentifier;
  36. self.defaultItemIdentifiers = @[scrubberIdentifier];
  37. self.customizationAllowedItemIdentifiers = @[scrubberIdentifier];
  38. }
  39.  
  40.  
  41. -(instancetype)initWithCoder:(NSCoder *)coder{
  42. self = [super initWithCoder:coder];
  43. [self commonInit];
  44. return self;
  45. }
  46. -(instancetype)init{
  47. self = [super init];
  48. [self commonInit];
  49. return self;
  50. }
  51. ...
  52. @end
Add Comment
Please, Sign In to add comment