Giter VIP home page Giter VIP logo

pkrevealcontroller's People

Contributors

alistra avatar anthonycvella avatar bri3d avatar brian-intuit avatar christopherstott avatar cristianbica avatar crudolf avatar dmishe avatar e28eta avatar ekurutepe avatar jasonmccreary avatar jiexi avatar jtmilne avatar jtoce avatar lvt avatar migrant avatar mspasov avatar nataliq avatar pkluz avatar shawnwall avatar stevemckenzie 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  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

pkrevealcontroller's Issues

Stuck between hide and show

First of all thank you for this great repo!

I found a bug using the controller on iOS 5 which gets the controller stuck between front and rear showing.

The problem with this is that the FrontViewPosition is still set to FrontViewPositionLeft. So when you now press one of the buttons in the tableview it hides the frontview instead of showing it!

IMG 0096

To achief this:

  1. Slide the navigationbar to the right about half of the screen.
  2. Use 2 fingers of your other hand to slide in oposite direction on the fronview controller
  3. Let go all of your fingers

or

  1. Slide the navigationbar to the right with one finger but keep your finger high enough to slide down the notificationcenter when your half way.

Sample Video (bad quality, sorry)

Gestures are still recognized

Hi,

It is a bit difficult to explain. When you are in rear view, the taps in the overlapped front view are still recognized.
For example you can click the push button, you can move the map.

In the Facebook and Path app, the front view is shown if you tap on the overlapped front view.

I hope you understand what I mean,

Greets
Michael

Change Interface Orientation for some view controllers

Hey pkluz,

In my app I need some view controllers to support portrait & landscape mode and some only portrait mode.
But it seams that I can't get this control for each view controller, because no matter how I implement shouldAutorotateToInterfaceOrientation in those view controllers it doesn't do anything, and the only one metters is the shouldAutorotateToInterfaceOrientation of the reveal controller itself.

For example I have tried to change the MapViewController in the example code, to support ONLY portrait mode. So I implemented shouldAutorotateToInterfaceOrientation to portrait only, but it has no effect and the map view still rotate to landscape...

Thanks a lot for your help & your code

Block front view "Push" button action while rear view is active.

I am thinking when the rear view is revealed, the "Push!" button in the sample code should not push other view inside the hidden front view. I am expecting the behavior of the front view while the rear view is active is either of these:

  1. Only "Reveal" button in the front view should listen to the event
  2. or like the implementation of other app, i.e. Path, the whole area of hidden front view should be able to toggle.

What frame is adopted by default for Rear View Controller?

I'm slowly adapting the demo app code and the first thing I've done is swap out the XIB drawn RearViewController with a vanilla UITableViewController object.

I don't declare a frame to the newly create controller's view.

It seems to adopt the application frame, complete with 20px offset for the status bar by default, so it's placed in the rear view position but with a 20px gap between the bottom of the status bar and the top of the rear view.

Am I implementing this wrong? Is this a bug in the way that non XIB controlled views adopt their default frame?

Lower the coupling / refactor.

Right now there's a couple of lines of code needed inside both the Front- and the RearViewController to make everything work. Get rid of most of it.

rear view adjustment not correct

First of all good job done here on this project.

I am using this solution for my FB-like menu in my app. The problem is when menu view (rear view) is revealed on top of menu view appears black space, like black bar. So I had to do frame adjustment in method _addRearViewControllerToHierarchy.

So my fix was same like in method _addFrontViewControllerToHierarchy.

Here is the whole method and line that added:

  • (void)_addRearViewControllerToHierarchy:(UIViewController *)rearViewController
    {
    [self addChildViewController:rearViewController];

    // line added by balabs - fixed my problem
    rearViewController.view.frame = CGRectMake(0.0f, 0.0f, self.rearView.frame.size.width, self.rearView.frame.size.height);

    [self.rearView addSubview:rearViewController.view];

    if ([rearViewController respondsToSelector:@selector(didMoveToParentViewController:)])
    {
    [rearViewController didMoveToParentViewController:self];
    }
    }

Apart from this I have no other problems so far.

Best regards,
Dejan

Landscape full-screen presentation mode

When the device is in landscape mode and you send the hideFrontView message, the rear view controller does not completely take over the screen, pushing the front view controller offscreen. The Facebook app's rear view takes over the screen on search for both orientations, and this seems to mesh with what a rear view presentation mode should do.

Ability to drag front view controllers back in to place from expanded state

In the Facebook implementation, when you expand to view the rear view controller, you can drag anywhere on the partially hidden front view controller to bring it back to focus. That view doesn't otherwise respond to touch events (you can't scan down your timeline whilst in the collapsed state).

In the demo app provided with ZUUIRevealController, when using the map view any interaction with the map when partially hidden pans the map. It would be better to prevent the touch events reaching this VC and instead use them to control the position of the front view as when you draw the navigation bar?

CocoaPods

Please, submit your changes into Specs repo.

Parametrized reveal from right or left

Is there any easy way to make the reveal edge appear from right or left at runtime? I'm trying to use this for left or right-handed users. If you give me a hint on what I should look into I'd be glad to implement it!

UITableView inside FrontViewController, not responding to statusbar Taps

Not sure, if this should be an issue or may be i am looking for help :)

UITableViews(rather any UIScrollView) that are inside the frontViewController are not responding to statusbar's tap. The usual behavior is to scroll the view to top on touching the status bar.

It works as expected without a ZUUIRC, but inside it, the functionality is lost. Any suggestions?

Edit: Or is it because, rearview has a table and it conflicts with the table on frontview? Apple docs say, there can't be 2 scroll views. But again, i have tried setting scrollsToTop property to NO inside rearView's table.
Thanks

EXC bug

in your demo, i insert a UItextview in MapViewController.xib. When i enter value in textbox and have a error EXC_BAD_ACCESS.
You can check and support me, please. Your control is very great.
Thank so much ^^

How to limit rear view width?

I am using a table view as rear view. But the table view is as width as the screen, so the right part of the table view is invisible, because it is overlapped by front view.
Is there be a chance to limit the width of the rear view, to only the visible width?

Btw. nice project!

didHideRearViewController delegate doesn't get called

thanks for sharing this fantastic code :)

It seams that the didHideRearViewController delegate doesn't get called if I pan the navigation bar to hide the rear view.
This happen only if I don't release my finger till the rear view is completely hidden.

Feature Request: Persistant Views

Hello, this is probably a tall order, as would require significant memory management etc... But what would be really awesome to have is view persistance, as the tab bar controller does. So the user is doing something in one view, heads to another view, and then heads back to their first view, and it would be in the state they left it in, without having to reload a new view each time.

pushing view controller from rear to front view

This is more of a noobish question, been banging my head for a few days.

I got the reveal rearview working with a uinav controller, but I cannot figure out how to get a simple button action to push another view controller to the frontView.

Or toggle the frontView back with a button on the rearview for that matter.

any help would be appreciated, thanks.

UIScrollview inside frontViewController problem

My rearViewController is a simple TableViewController and my frontViewController has a UINavigationBar and a UIScrollview with several views inside it (pages of a book).

When I revealToggle, the frontViewController goes to right, but the hidden page on UIScrollView appears in front of rearViewController as the image below:

http://db.tt/ZLpQVBSu

Am I doing something wrong?

This is the code I'm using to toggle the rearViewController:

UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:@"Title"];
item.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Menu"
                                                         style:UIBarButtonItemStylePlain
                                                         target:self.parentViewController.parentViewController
                                                         action:@selector(revealToggle:)];
item.hidesBackButton = YES;
[self.navigationBar pushNavigationItem:item animated:NO];

And this is the code to create the ZUUIRevealController:

BSMainMenuViewController *mainMenu = [[BSMainMenuViewController alloc] initWithStyle:UITableViewStylePlain];
mainMenu.title = @"Menu";
mainMenu.navigationController.navigationBarHidden = NO;

ZUUIRevealController *revealController = [[ZUUIRevealController alloc] initWithFrontViewController:self.viewController
                                                                                rearViewController:mainMenu];

self.window.rootViewController = revealController;

Navigation bar redraw(blinking) issue after rotation on modal screen

Steps to reproduce:

  • take device in landscape orientation
  • from front view controller present modal view controller with modal transition style "flip horizontal";
  • change device orientation to portrait

Actual result:

  • you can see black line below navigation bar during transition from modal view controller
  • navigation bar height remains thin (as in landscape) until animation finishes and then instantly changes it's height

Expected result:

  • navigation bar size should change before (or during?) transition animation from modal view controller. If you remove ZUUIRevealController and use UINavigationController controller instead, then there is no navigation bar blinking.

Note #1: You can reproduce this issue on your sample project - just replace
[self.navigationController pushViewController:stubController animated:YES];
with
stubController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController presentModalViewController:stubController animated:YES];

Note #2: This does not happen for default modal transitioning style "cover vertical".

XCode 3.X

Hi there,
is there any posibility to get this working Xcode 3.X with iOS SDK 4.3 or 4.2.1? Would be great for me cause i want a application wich is compatible with the iPhone 3G and the iPod touch 2G.
Thanks, Xomz.

ViewDidDisppear not called on frontViewController

Hi there,
I have been having this issue where viewDidDisappear is not called on the frontViewController

I followed the example, where i have a rearview controller with a table, clicking on an tablecell in the rearview controller, changes frontviewcontroller. All works well.

However, in each controller, there is code inside viewDidDisapper, for me to do some stuff when the frontView Changes. This method however is not fired at all.

How can i get those methods to be fired?

frontViewController memory leaks on iOS5

if ([frontViewController respondsToSelector:@selector(removeFromParentViewController:)])
{
    [frontViewController removeFromParentViewController];       
}

[frontViewController removeFromParentViewController]; never called because thereis now selector @selector(removeFromParentViewController:). You should remove ": "

if ([frontViewController respondsToSelector:@selector(removeFromParentViewController)])
{
    [frontViewController removeFromParentViewController];       
}

Rotation Problem Extension

I am working on an app with this awesome little tool, but it needs to be backwards compatible with iOS 4.3 in this case. There are a few areas where the code in your example project needed to be modified (manually calling the ViewWillAppear methods)... I noticed the rotation problem issue had been logged, this is still happening when trying to use this tool on iOS 4.3 but it is happening even when you don't use modal views...

I was wondering if you were able to test this and provide a fix? I realise it's an outdated OS, but i'm desperate to use this tool, so will be trying to work on a fix myself. I think you'll probably be quicker though!

Edit: Just read some of the other issue posts, seems i'm not the only one with the problem. Sorry for creating a duplicate issue, but consider me a +1 to the iOS 4 support request :-)

Feature Request: Nav controller back button change

Is it possible to auto change the navigation bar back button to be the "Reveal" button when the Rear View is reveal?

I will try to explain my self, if I push a view controller on top of the Front View, the navigation left button of course change from "Reveal" to "Front View".
If I now panning my finger to reveal the Rear View, I will still see the "Front View" back button, and I will still be able to tap it and go back in the view hierarchy.

So maybe it's better to change the "Front View" back button to "Reveal" button when the Rear View is reveal, and return it to what it was when the Rear View is hidden (like in the Facebook app, they also do the change of the buttons with nice animation)

Initial start up issue.

The downloaded zip file does not run out of the box for me. I see two errors they are as follows:

// First error -- Main.h
(1) unexpected '@' in program
@autoreleasepool
^

// Second error
(2) The document "FrontViewController_iPad.xib" could not be opened. The operation couldn’t be completed. -[IBUIScreenMetrics initWithCoder:]: unrecognized selector sent to instance 0x10066b360. With this one i deleted the IPad.xib because I am programing for the iphone. The error went away but the first one is still there.

Also it seems youv'e done some changes with @autoreleaspool in the main.m file is this change and your code for 5.0 only?

FYI I am using SDK Simulator 4.2 Any help would be appreciated

Rear View Controller Formatting iOS 5.1 BUG

After upgrading to iOS 5.1 I have noticed a bug, cannot confirm that this does not occur on other versions of iOS as well, but the issue is this..

I have customised the rear view controller table view, using custom cells, selection styles, etc... When i pop a modal view controller on the front view, and then exit that modal view, if I reveal the rear view controller, the table formatting is lost, cell backgrounds are not drawn etc, until they are flicked off the screen and back on again by scrolling the table view.

EDIT: Should note that this issue is not present on the iPad (2), but is on the iPhone (4s)...

hidesBottomBarWhenPushed does not work

When the front view controller is a UINavigationController, pushing a new view controller on to the navigation stack with the controller's hidesBottomBarWhenPushed property set to YES does not hide the UITabBar.

I can only assume this is related to the fact that the TabBarItem is currently assigned to a ZUUIRevealController instance and not directly to the front view controller.

Is there a fix for this?

Pan gesture and table view reorder

So I have my app setup like example project, where there is a pan GR on navigation controller in front view, and I have a table view inside that nav controller.

The problem is that as soon as I start to drag a cell inside the table, pan recogniser takes over and dragging is cancelled.

Rotation does not work in iOS6

iOS6 requires some changes in order to enable rotation. It's still NDA, but the change is very minor. Should I make a pull request or just wait few more days?

iOS4 front & rear ViewControllers lifecycle methods issue

On iOS4 methods like viewWillAppear: viewDidAppear: viewWillRotateToInterfaceOrientation viewDidRotateToInterfaceOrientation does not get called.
ZUUIRevealController does not crash anymore on iOS4, but there are UI issues on front/rear views if you have some code in the lifecycle methods mentioned above.
I think you need to call those lifecycle methods from ZUUIRevealController manually on iOS4.

slide down how to

I was wondering if its possible to reveal a view controller behind the front view by sliding it down instead of sliding right/left. If so how can i do this.

Improve 'overdraw' function.

Right now, if you pan your finger further than the right edge (which the front-view docks to if revealed) the sin-function used to slow the translation is good and does the job - but not well enough. It feels too abrupt.

Rear view not revealed when NOT using "initWithFrontViewController"

Following scenario:

  • Created a subclass of ZUUIRevealController
  • Used this class in Storyboard
  • Used "viewDidLoad" to set the "frontViewController" and "rearViewController" properties
    => When trying to reveal the rear view nothing happens

Problem is that the new "_loadDefaultConfiguration" method will only called inside "initWithFrontViewController".
Without it the front view won't move because of the missing defaults.

Cheers,
Jens

The FrontViewController should be swappable

See path's implementation.

  • One should be able to replace the FrontViewController.
  • Possibly needs a new set of delegate calls.
  • Should animate neatly on both iPad and iPhone.

Drop shadow does not extend on iPad

@pkluz I have an issue with the drop shadow that is created. I've noticed on iPad the drop shadow doesn't extend vertically to fill the screen. I can force the shadow to fill the remaining vertical space by changing the UIBezierPath's frame in ZUUIRevealController.m in viewDidLoad, but that's a hack. I want to ensure that my view controller's frame is an appropriate size and let the UIBezierPath do it's thing. I'd like to know why self.frontView.bounds is returning an iPhone sized CGRect even when an iPad-sized NIB has been init'd for the view controller that has been passed to it?

Here's what I'm doing in my project. I have a UITableViewController as my rearViewController and a simple MapView as my frontViewController. At run time I init my MapView VC with an appropriately sized iPad view whose frame is 768/1024. I can verify the appropriate frame size prior to the call to the ZUUIRevealController's viewDidLoad method. The bounds self.frontView.bounds on line 733 still reports a dimension of 320/548, even though the view controller whose view will be added to the frontView property has a different dimension.

Suppress rearViewController display when calling setFrontViewController:

I am setting the front view controller in response to a push notification, and when I call - (void)setFrontViewController:(UIViewController *)frontViewController, the rear view controller is displayed automatically, but is there a way to disable the rearViewController from displaying on a case by case basis?

In my use case, a user receives a push notification and launches the app from an inactive state. I want to programmatically switch the front view controller to the one that may or may not be the current frontViewController, without having the rearViewController display.

If you modify FrontViewController.m in the example project by 1) adding #import "RevealController.h" and 2) replacing - (IBAction)pushExample:(id)sender with the following, the "Push!" button will call setFrontViewController: & the frontViewController is set, but you'll see that the rearViewController slides out as well:

- (IBAction)pushExample:(id)sender
{
    UIViewController *stubController = [[UIViewController alloc] init];
    stubController.view.backgroundColor = [UIColor whiteColor];

    RevealController *revealController = [self.navigationController.parentViewController isKindOfClass:[RevealController class]] ? (RevealController *)self.navigationController.parentViewController : nil;
    [revealController setFrontViewController:stubController];
}

file also here: https://gist.github.com/4341159

Rotation problem

ZUUIRevealController does not work fine with modal view controller and rotation.

Steps to reproduce the issue:

  • create ZUUIRevealController instance with UIViewController subclass as rearViewController and UINavigationController as frontViewController;
  • present modal UIViewController in portrait device orientation;
  • rotate device to landscape orientation;
  • dismiss modal view controller in landscape orientation.

Actual result:
A half of screen if black. Rotating back and forth to portrait orientation does not help.

N.B. You can easily reproduce this issue on your sample project if you just change pushViewController to presentModalViewController.

API-compatbility with UISplitViewController

I'm just throwing this out there to see if anyone is interested. ZUUIRevealController is the best implementation I've seen of the slide-out navigation pattern, especially with its minimal implementation that doesn't attempt to solve every scenario, so I can understand why the following idea might not be applicable.

I've come to view this reveal/slide-out navigation pattern as similar to the iPad's UISplitViewController, that is, another way to present a master-detail interface. In my own project, I've written a wrapper and protocol to make ZUUIRevealController's interface a subset of UISplitViewController's interface – this allows for switching out different concrete master-detail implementations depending on the device's UIUserInterfaceIdiom.

If this interests anyone else, I'd volunteer to cleanup my changes and submit a patch that would make ZUUIRevealController adhere to the following protocol:

#import <Foundation/Foundation.h>

/**
 * `MasterDetailViewController` defines a protocol for a container
 * `UIViewController` that manages a child master view controller and a child
 * detail view controller.
 *
 * This container view controller could be, for example, a `UISplitViewController`
 * on an iPad, a `ZUUIRevealController` on an iPhone, or any different concrete
 * implementation that had some notion of two child view controllers.
 *
 * *-------------------------------------------*
 * |            |                              |
 * |------------|------------------------------|
 * |            |                              |
 * |     M      |               D              |
 * |     A      |               E              |
 * |     S      |               T              |
 * |     T      |               A              |
 * |     E      |               I              |
 * |     R      |               L              |
 * |            |                              |
 * *____________|______________________________*
 */
@protocol MasterDetailViewController <NSObject>

/**
 * The array of view controllers managed by the receiver.
 *
 * @discussion The `viewControllers` property is present to attempt some
 *             interface parity with `UISplitViewController`. Therefore,
 *             mimicking `UISplitViewController`, the array in this property must
 *             contain exactly two view controllers. The view controller at index
 *             0 is considered the *master* view controller. In the case of
 *             `ZUUIRevealController`, the view controller at index 0 would be
 *             the rear view controller. The view controller at index 1 would be
 *             the front view controller of `ZUUIRevealController`, i.e., the view
 *             controller that can slide out to reveal the rear view controller.
 */
@property (nonatomic, copy) NSArray *viewControllers;

/**
 * The delegate you want to receive master-detail view controller messages.
 *
 * @discussion The master-detail view controller uses its delegate to manage
 *             certain behavior based on the type of `MasterDetailViewController`.
 *             For example, if this view controller is a `UISplitViewController`,
 *             the `delegate` should conform to the `UISplitViewControllerDelegate`
 *             protocol to manage the showing and hiding of related view
 *             controllers. If this view controller is a `ZUUIRevealController`,
 *             it should conform to the `ZUUIRevealControllerDelegate`
 *             protocol.
 */
@property (nonatomic, assign) id delegate;

@end

Thanks for such a nice project!

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.