Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Popover item subclass */
- @implementation NXWindowListPopoverItem
- -(void)commonInit{
- NSTouchBar* touchBar = [NXWindowListTouchBar new];
- self.popoverTouchBar = touchBar;
- self.pressAndHoldTouchBar = touchBar;
- self.customizationLabel = nil;
- self.collapsedRepresentationImage = [[NSBundle bundleForClass:self.class] imageForResource:@"NXWindowListIcon"];
- }
- -(instancetype)initWithCoder:(NSCoder *)coder{
- self = [super initWithCoder:coder];
- [self commonInit];
- return self;
- }
- -(instancetype)initWithIdentifier:(NSTouchBarItemIdentifier)identifier{
- self = [super initWithIdentifier:identifier];
- [self commonInit];
- return self;
- }
- ......
- @end
- /** subtouchbar subclass */
- @implementation NXWindowListTouchBar{ ... }
- -(void)commonInit{
- self.delegate = self;
- scrubberIdentifier = @"NXTouchBarWindowListTouchBarScrubberItem";
- subTouchBarIdentifier = @"NXTouchBarWindowListTouchBar";
- self.customizationIdentifier = subTouchBarIdentifier;
- self.defaultItemIdentifiers = @[scrubberIdentifier];
- self.customizationAllowedItemIdentifiers = @[scrubberIdentifier];
- }
- -(instancetype)initWithCoder:(NSCoder *)coder{
- self = [super initWithCoder:coder];
- [self commonInit];
- return self;
- }
- -(instancetype)init{
- self = [super init];
- [self commonInit];
- return self;
- }
- ...
- @end
Add Comment
Please, Sign In to add comment