GithubHelp home page GithubHelp logo

weissi / frlayerednavigationcontroller Goto Github PK

View Code? Open in Web Editor NEW
484.0 484.0 61.0 2.06 MB

FRLayeredNavigationController, an iOS container view controller that works like a stack of paper with an API similar to UINavigationController.

License: Other

Ruby 0.66% Objective-C 96.87% Shell 1.09% C 1.38%

frlayerednavigationcontroller's People

Contributors

nickpack avatar skogsbaer avatar sptramer avatar sunilgowda avatar weissi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frlayerednavigationcontroller's Issues

Issue with title not being centered

We have been using FRLayeredNavigationController in our project and one thing I have noticed but haven't been able to work around is that the title of the navigation bar seems to be centered as long as no UIBarButtonItems are added. As soon as I set self.layeredNavigationItem.leftBarButtonItem = .... in the viewDidLoad: of my view controller it seems to mess up the centered title and move it into an odd location. I tried setting up the bar button items in the configuration block but couldn't get the navigation bar to show the buttons then. The attached image shows what I am talking about. Am I missing something? Thanks

screen shot 2013-08-21 at 11 44 09 am

Twitter like 'pull-right-to-remove' functionality

Twitter for iPad has a great feature where, if you pull the layers rightward far enough, they are removed from the view. I find this a very intuitive way to clean up the interface.

What would it take to implement the same thing for FRLayeredNavigationController? I can attempt to do it, but some guidance would be most helpful!

Support Multiple Layer Stacking Directions

FRLayeredNavigationController should have a small abstraction layer, which abstracts from the screen's coordinate system. So, the axis and the direction of the axis in which to stack the layer (currently X-Axis in positive direction) should be configurable. After building that abstraction layer, FRLayeredNavigationController should easily support Left-to-Right (X-Axis, positive), Right-to-Left (X-Axis negative), Top-to-Bottom (Y-Axis, positive) and Bottom-to-Top (Y-Axis, negative) directions.

Especially Right-to-Left is interesting for bidirectional and RTL languages, such as arabic.

The code quality of FRLayeredNavigationController should profit of this abstraction, too.

The implementation should not be too hard, I think. There has already been an issue asking about RTL stacking.

Auto Pop View Controllers

I want the Naviagtion Controller to treat swiping a layer off the screen as a pop. Is this possible ?

Handle Orientation

I would like to be able to set percentages so that when the view is rotated they always fill x % of the screen. Can I do this now ?

unable to assign a custom title view

example code to reproduce problem.

_labelPrompt = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 160, 22)];
_labelPrompt.backgroundColor = [UIColor clearColor];
_labelPrompt.numberOfLines = 1;
_labelPrompt.font = [UIFont boldSystemFontOfSize: 14.0f];
_labelPrompt.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
_labelPrompt.textAlignment = UITextAlignmentCenter;
_labelPrompt.textColor = [UIColor whiteColor];
_labelPrompt.adjustsFontSizeToFitWidth = YES;

_labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 22, 160, 22)];
_labelTitle.backgroundColor = [UIColor clearColor];
_labelTitle.numberOfLines = 1;
_labelTitle.font = [UIFont boldSystemFontOfSize: 14.0f];
_labelTitle.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
_labelTitle.textAlignment = UITextAlignmentCenter;
_labelTitle.textColor = [UIColor whiteColor];
UIView* titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 160, 44)];
[titleView addSubview:_labelPrompt];
[titleView addSubview:_labelTitle];

_labelPrompt.text = @"prompt";
_labelTitle.text = @"title";

if (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad) {
    self.layeredNavigationItem.rightBarButtonItem = _buttonHistory;
    self.layeredNavigationItem.titleView = titleView;
} else {
    self.navigationItem.rightBarButtonItem = _buttonHistory;
    self.navigationItem.titleView = titleView;
}

Is it possible to reorder tableview cells?

When you go into edit mode on a tableview and try to drag a cell the drag get cancelled. I see the gesture recognizer is disabled for sliders, was wondering if theres any way to do similar for tableviews in editmode?

Multiple stacking points

At the moment, FRLayeredNavigationController supports only one explicit stacking point (configured via the initialViewPosition property of FRLayeredNavigationItem). In addition, there is an implicit stacking point at the right margin of each layer.

It would be great if each layer could have several explicit stacking points. Each stacking point would have an additional priority which specifies the ordering of stacking. Let me explain via an example:

+--------------+ +-----------+ +-------------+
|              | |  xxxxx    | | zzzzzzzz    |
|              | |  xxxxx    | | zzzzzzzz    |
+--------------+ +-----------+ +-------------+
A    B              C    D

The stacking points A, B, C and D have the following priorities:

A: 1
B: 3
C: 2
D: 4

If the frame now becomes smaller, FRLayeredNavigationController first moves the right-most layer to stacking point D. If after this, the layers do not fit into the new frame, the controller moves the middle layer to stacking poing B. If there is still need for more space, the left-most layer is moved to C. If there is still need for more space, the middle layer is moved to A. You see, layers are moved to stacking points in descending order of priorities.

What do you think? I'm willing to implement this feature but would like to ask for feedback first.

How to make the selected layer to become the root layer

Hello again,

Do you have a solution to make the selected layer to become the root one (like in twitter).

I found a way to temporarly make it possible in modifying the property "initialViewPosition" to readwrite.

Here is what I do:

  • (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
    [aTableView deselectRowAtIndexPath:indexPath animated:YES];

    self.layeredNavigationItem.initialViewPosition = CGPointMake(0, 0);

    RangeViewController *rangeViewController = [[RangeViewController alloc] initWithNibName:@"RangeViewController" bundle:nil];

    [self.layeredNavigationController pushViewController:rangeViewController inFrontOf:self maximumWidth:YES animated:YES configuration:^(FRLayeredNavigationItem *item) {
    item.nextItemDistance = 64;
    item.hasChrome = NO;
    return;
    }];

    [rangeViewController release];
    }

The problem is that modifying this property make the layer to be anchored to point 0. Is there a better way to to this ?

Thanks for help :)

Initialize out of AppDelegate

How I could initialize FRLayeredNavigationController out of "AppDelegate"?

My first view (defined at Delegate) don't use stacked layout (provided by FRLayeredNavigationController), but another.

On examples I saw it being defined at application:didFinishLaunchingWithOptions: , through self.window.rootViewController (accessible only at 'AppDelegate').

iOS 7

On iOS 7 the layered nav controllers need offsetting below the status bar. The status bar colour is ignored? (shows black on my project)
The gradient in the chrome view looks so iOS 6 :)

Crash on IOS 5.1.1 UIViewControllerHierarchyInconsistency

In certain cases pushing an new viewController onto the stack crashes with following error:

*** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<MainSettingsViewController: 0xf3696b0> should have parent view controller:<FRLayerController: 0x9e36270> but requested parent is:<FRLayerController: 0x9e38ed0>'

This happens mostly when switching viewControllers very quickly.

Is this a known problem ? is there any way to solve this ?

Decouple Layer Placement Strategy From Core

The idea is to decouple the layer placement (and re-placement) strategy from core FRLayeredNavigationController. This would allow the implementation of e.g. of dynamic placing strategies like

  • make every layer at least x points wide, rearrange all layers if space is not available (sample implementation directly integrated into the FRLayeredNavigationController core: mronkko/FRLayeredNavigationController@f0109c7 )
  • exponential spacing (very old implementation when this was FRLayeredNavigationController's (called FancyVC back then) default strategy: c92b0f8)
  • ...

The work to do would be:

  • define an sensible API for different kinds of layer placement strategies
  • write tests for the current placement strategy
  • decouple the current strategy to a class that FRLayeredNavigationController uses by default (when it's not provided another placement strategy)

The prerequisites would be (and therefore best implemented along with Issue #5 and Issue #13):

  • unit tests
  • probably an explicit data model for FRLayeredNavigationController

Can't hide the NavigationBar

Hey!

I have tried everything... but I can't delete the navigation bar of my view. I have tried:

  • (void)viewDidLoad
    {
    [super viewDidLoad];

    self.title = @"Title";
    self.navigationController.navigationBar.hidden = YES;
    self.layeredNavigationController.navigationController.navigationBar.hidden = YES;
    }

And the Title keeps appearing. Any ideas?!

Thanks!

iOS7 status bar

need to lower the whole thing by the statusbar height on ios7

have pulled recent commits, not seeing new methods?

Hi guys,

This feels like a newbie question :)

There's been some useful commits recently but xcode is just not seeing any of the new methods (ie, compressViewControllers:YES)

I've done the usual stuff like cleaning my project, derived data is supposedly empty.

I'm inclined to think it's an xcode bug but FRNav is the only thing affected by it, hence asking the question here.

Thank you :)

Use controller as a subview

Hello, first of all, thanks for the job done, this solution seems to be the easiest one to use for twitter like apps.

Do you have a solution to use the LayeredNavigationController as a subview?

Here is what I try to do with no sucess, am I doing it wrong ? :

InfoCategoriesViewController *icvc = [[InfoCategoriesViewController alloc] init];
FRLayeredNavigationController *lnc = [[FRLayeredNavigationController alloc] initWithRootViewController:icvc configuration:^(FRLayeredNavigationItem *item) {
    item.width = 50;
    item.nextItemDistance = 50;
}];

[self.contentView addSubview:lnc.view];

Is FRLayeredNavigationItem.titleView implemented?

First, thanks for a great library! I love it :)

That being said, there are some things that make me think that it isn't yet implemented: the property is being @synthesize'd in FRLayeredNavigationItem.m, which differs from the other getters and setters (e.g. leftBarButtonItem), which are implemented manually. Also, in FRLayerChromeView.m, in manageToolbar, there is no reference to titleView.

Also, when I set the property nothing happens :/

Thank you in advance.

left of ParentViewController?

 configuration:^(FRLayeredNavigationItem *item) {
                                              item.width = 200; 
                                              item.nextItemDistance = -300;
                                          }];

hi~,I want push a ViewController (the ViewController left bounds is left to its ParentViewController)
I try set

 item.nextIitemDistance = - 300;

but not working,How can I do?

custom subviews with chrome view

Hello.

I'm trying to find the best way to some custom subviews to the chrome view. I want to add two right bar button items and a label aligned left. Right now I'm just using self.layeredNavigationController.view addSubview:

which works, but those subviews are completely independent of the presented view (as it would I suppose). That is to say, if the view moves, those subviews don't move with it.

What would be the best way to add two right bar button items and alight a label to the left side of the view? I hope I provided enough info.

Thanks

State restoration

Just wondering if this is something that is planned? And, if not, might this be considered as a feature request?

hasChrome affects grouped table background

really great library you've got here

I was struggling to set the background of a grouped tableview to clear and noticed that the same code works when a FRLayeredNavigationItem hasChrome is set to NO.
If hasChrome is set to YES then the tableviews background is grey

in my tablewviews viewdidload:
[super viewDidLoad];
[self.tableView setBackgroundView:nil];

is there a quick fix for this please?

iOS 7 translucent bar

I'd like to set the iOS 7 translucent top bar but I don't see how. Is there a way to achieve this?

Note: As a workaround, I managed to achieve this by pushing my controllers inside a UINavigationController.

possible features

I've written a couple of tweaks that I'm using in the chrome view

You may or may not consider them feature requests and formalise them into your project.

One is for tintcolor and the other is for multiline title support which I needed, the gist is below.

https://gist.github.com/4304605

Specify minimum width for child view controllers

FRLayeredNavigationController does not work well as master view controller in master-detail application (UISplitviewController), as shown in this screenshot http://imageshack.us/photo/my-images/543/photosl.png/

This could be improved by implementing a minimum width for child view controllers. If pushing new view controller would leave the new controller less room than what the minimum width is, all the view controllers on the stack would be moved left. In other words, instead of showing a constant width slice of each view controller in the stack, this the width of these slices should dynamically adjust to make room for more controllers.

Question

Hi,

I've just started implementing your controller system and I must say I've been really impressed with the way you've done things! Also it's not in your list but the Wunderlist application also uses your framework.

I'm fairly new to coding and am struggling with getting a few things to work and was hoping you could help. I've integrated your system into my app which uses the storyboard to layout all the menus.

Essentially I have a root view controller (uitableview) and a tab view controller which controls the rest of the app, I have successfully got the transition working correctly so I can pull the tab controller to the right to reveal the uitableview controller.

However there are a few things that, for the life of me, I can't figure out how to get working.

  • When the app loads it sets the root view as above and then pushes the tab view on top.

However I want to be able to slide the view to reveal (in the same way the user does by moving their finger) by the press of a button, using the popToRootViewControllerAnimated works but it only slides the menu downwards and you can't get back by a finger slide.

Is this possible (it's done in the wunderlist application that your framework is used in)?

  • Is it possible to leave a small lip on the screen when the top layer is pushed off screen? I essentially want the top view to fully cover the screen when its on top but when it is pushed over screen to reveal the lower layer a small lip of it remains on screen.

Is this possible? Again the wunderlist application uses this approach.

  • Is it possible to disable the finger swipe gesture so the user can't pull the view off screen, this used in conjunction with a button press to reveal the lower view is what i am trying to achieve.
  • Is it possible to disable the user from pulling the view to the left once it fully fits the screen?

One last thing, my delegate methods don't seem to be firing, is there something specific i need in the delegate method code wise?

Sorry for all the questions but i hope you can help.

Many Thanks
Richard

Lingering gesture recognizer when setting userInteractionEnabled = NO

When you try to temporarily disable swiping by calling:

self.layeredNavigationController.userInteractionEnabled = NO;

The swiping will not be recognized (as expected), but FRLayeredNavigationController's gesture recognizer is not fully removed.

In my application I need to disable swiping and display a transparent UIView that allows for freehand drawing. I was having issues while drawing because touchesCancelled was getting called unexpectedly on my transparent UIView, which prevented the user from drawing anything.

I was able to fix this by calling removeGestureRecognizer in FRLayeredNavigationController's detachGestureRecognizer method:

- (void)detachGestureRecognizer
{
    [self.view removeGestureRecognizer:self.panGR];
    [self.panGR removeTarget:self action:NULL];
    self.panGR.delegate = nil;
    self.panGR = nil;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.