Permalink
Browse files

Merge pull request #19 from dulaccc/enhance-configuration

Add a `cardNavigationBarClass` configuration option
  • Loading branch information...
2 parents fe2e9ed + b514a79 commit dd3cf60b5df9900eccdc9352e0ebc5e27ed1e894 @KieranLafferty committed Mar 16, 2013
Showing with 8 additions and 1 deletion.
  1. +3 −0 Classes/KLNoteViewController.h
  2. +5 −1 Classes/KLNoteViewController.m
@@ -62,6 +62,9 @@ typedef UInt32 KLControllerCardPanGestureScope;
@property (nonatomic, assign) id<KLNoteViewControllerDataSource> dataSource;
@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
@property (nonatomic) CGFloat cardMinimizedScalingFactor; //Amount to shrink each card from the previous one
@property (nonatomic) CGFloat cardMaximizedScalingFactor; //Maximum a card can be scaled to
@@ -71,6 +71,8 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
}
- (void)configureDefaultSettings {
+ self.cardNavigationBarClass = [UINavigationBar class];
+
self.cardMinimizedScalingFactor = kDefaultMinimizedScalingFactor;
self.cardMaximizedScalingFactor = kDefaultMaximizedScalingFactor;
self.cardNavigationBarOverlap = kDefaultNavigationBarOverlap;
@@ -143,7 +145,9 @@ - (void) reloadData {
for (NSInteger count = 0; count < totalCards; count++) {
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
navigationController: navigationController

0 comments on commit dd3cf60

Please sign in to comment.