Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add a `cardNavigationBarClass` configuration option #19

Merged
merged 1 commit into from

2 participants

@dulaccc

Again me with a configuration option ^^

Apple introduce in iOS5 initWithNavigationBarClass:toolbarClass:, a new UINavigationController method to properly customize the navigation bar used.

I think it's important that we can control this aspect of the design. I needed that, to achieve taller cards, like those one.

Capture d e cran du Simulateur iOS 16 mars 2013 01 33 36

@dulaccc dulaccc Add a `cardNavigationBarClass` configuration option
Apple introduce in iOS5 a new `UINavigationController` method
`initWithNavigationBarClass:toolbarClass:` to properly customize the
navigation bar used. I think it's important that we can control that
aspect.
b514a79
@KieranLafferty KieranLafferty merged commit dd3cf60 into KieranLafferty:master
@dulaccc

Fastest merge on earth :)

@KieranLafferty

haha :) thanks for contributing to the control, much appreciated

@dulaccc

You're welcome. Your project is awesome, I'm using it in one of my app. So not contributing would have been a crime !

@KieranLafferty

awesome be sure to let me know when you are done I would love to see the final product

@dulaccc

Deal! I'll let you know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 15, 2013
  1. @dulaccc

    Add a `cardNavigationBarClass` configuration option

    dulaccc authored
    Apple introduce in iOS5 a new `UINavigationController` method
    `initWithNavigationBarClass:toolbarClass:` to properly customize the
    navigation bar used. I think it's important that we can control that
    aspect.
This page is out of date. Refresh to see the latest.
View
3  Classes/KLNoteViewController.h
@@ -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
View
6 Classes/KLNoteViewController.m
@@ -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
Something went wrong with that request. Please try again.