Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a cardNavigationBarClass configuration option #19

Merged
merged 1 commit into from Mar 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Classes/KLNoteViewController.h
Expand Up @@ -62,6 +62,9 @@ typedef UInt32 KLControllerCardPanGestureScope;
@property (nonatomic, assign) id<KLNoteViewControllerDataSource> dataSource; @property (nonatomic, assign) id<KLNoteViewControllerDataSource> dataSource;
@property (nonatomic, assign) id<KLNoteViewControllerDelegate> delegate; @property (nonatomic, assign) id<KLNoteViewControllerDelegate> delegate;


//Navigation bar properties
@property (nonatomic, strong) Class cardNavigationBarClass; //Use a custom class for the card navigation bar

//Layout properties //Layout properties
@property (nonatomic) CGFloat cardMinimizedScalingFactor; //Amount to shrink each card from the previous one @property (nonatomic) CGFloat cardMinimizedScalingFactor; //Amount to shrink each card from the previous one
@property (nonatomic) CGFloat cardMaximizedScalingFactor; //Maximum a card can be scaled to @property (nonatomic) CGFloat cardMaximizedScalingFactor; //Maximum a card can be scaled to
Expand Down
6 changes: 5 additions & 1 deletion Classes/KLNoteViewController.m
Expand Up @@ -71,6 +71,8 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
} }


- (void)configureDefaultSettings { - (void)configureDefaultSettings {
self.cardNavigationBarClass = [UINavigationBar class];

self.cardMinimizedScalingFactor = kDefaultMinimizedScalingFactor; self.cardMinimizedScalingFactor = kDefaultMinimizedScalingFactor;
self.cardMaximizedScalingFactor = kDefaultMaximizedScalingFactor; self.cardMaximizedScalingFactor = kDefaultMaximizedScalingFactor;
self.cardNavigationBarOverlap = kDefaultNavigationBarOverlap; self.cardNavigationBarOverlap = kDefaultNavigationBarOverlap;
Expand Down Expand Up @@ -143,7 +145,9 @@ - (void) reloadData {
for (NSInteger count = 0; count < totalCards; count++) { for (NSInteger count = 0; count < totalCards; count++) {
UIViewController* viewController = [self noteView:self viewControllerForRowAtIndexPath:[NSIndexPath indexPathForRow:count inSection:0]]; UIViewController* viewController = [self noteView:self viewControllerForRowAtIndexPath:[NSIndexPath indexPathForRow:count inSection:0]];


UINavigationController* navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; UINavigationController* navigationController = [[UINavigationController alloc] initWithNavigationBarClass:self.cardNavigationBarClass
toolbarClass:[UIToolbar class]];
[navigationController pushViewController:viewController animated:NO];


KLControllerCard* noteContainer = [[KLControllerCard alloc] initWithNoteViewController: self KLControllerCard* noteContainer = [[KLControllerCard alloc] initWithNoteViewController: self
navigationController: navigationController navigationController: navigationController
Expand Down