Skip to content

Commit

Permalink
#57 Make the picker's toolbar to conform UIApperance so that it can b…
Browse files Browse the repository at this point in the history
…e overridden
  • Loading branch information
1and2papa committed Nov 5, 2014
1 parent b1be9c0 commit ae80272
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions CTAssetsPickerController/CTAssetsPickerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self.preferredContentSize = CTAssetPickerPopoverContentSize;

[self setupNavigationController];
[self setupToolbarApperance];
[self addKeyValueObserver];
}

Expand Down Expand Up @@ -87,9 +88,10 @@ - (UINavigationController *)createChildNavigationController
return [UINavigationController alloc];
}

#pragma mark - UINavigationControllerDelegate


#pragma mark - UINavigationControllerDelegate

- (id<UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
animationControllerForOperation:(UINavigationControllerOperation)operation
fromViewController:(UIViewController *)fromVC
Expand All @@ -111,6 +113,17 @@ - (UINavigationController *)createChildNavigationController



#pragma mark - Toolbar Appearance

- (void)setupToolbarApperance
{
NSDictionary *attributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
UIBarButtonItem *barButtonItem = [UIBarButtonItem appearanceWhenContainedIn:[UIToolbar class], [CTAssetsPickerController class], nil];
[barButtonItem setTitleTextAttributes:attributes forState:UIControlStateNormal];
}



#pragma mark - ALAssetsLibrary

+ (ALAssetsLibrary *)defaultAssetsLibrary
Expand Down Expand Up @@ -430,11 +443,7 @@ - (UIBarButtonItem *)titleButtonItem
style:UIBarButtonItemStylePlain
target:nil
action:nil];

NSDictionary *attributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};

[title setTitleTextAttributes:attributes forState:UIControlStateNormal];
[title setTitleTextAttributes:attributes forState:UIControlStateDisabled];

[title setEnabled:NO];

return title;
Expand Down

0 comments on commit ae80272

Please sign in to comment.