Giter Club home page Giter Club logo

mbpulldowncontroller's Introduction

MBPullDownController Build Status

MBPullDownController accepts two view controllers, which it presents one above the other. The front view controller is configured to accept a pull interaction which it utilizes to show or hide back view controller.

Requirements

MBPullDownController requires iOS 5 or newer and uses ARC. It depends on the following Apple frameworks:

  • Foundation.framework
  • UIKit.framework
  • QuartzCore.framework

You will need LLVM 3.0 or later in order to build MBPullDownController.

Adding MBPullDownController to your project

CocoaPods

CocoaPods is the recommended way to add MBPullDownController to your project.

  1. Add a pod entry for MBPullDownController to your Podfile pod 'MBPullDownController', '~> 1.0'
  2. Install the pod(s) by running pod install.
  3. Include MBPullDownController wherever you need it with #import "MBPullDownController.h".

Source files

Alternatively you can directly add the MBPullDownController.h and MBPullDownController.m source files to your project.

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. Open your project in Xcode, than drag and drop MBPullDownController.h and MBPullDownController.m from the MBPullDownController directory onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
  3. Include MBPullDownController wherever you need it with #import "MBPullDownController.h".

Static library

You can also add MBPullDownController as a static library to your project or workspace.

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. Open your project in Xcode, than drag and drop MBPullDownController.xcodeproj onto your project or workspace (use the "Product Navigator view").
  3. Select your target and go to the Build phases tab. In the Link Binary With Libraries section select the add button. On the sheet find and add libMBPullDownController.a. You might also need to add MBPullDownController to the Target Dependencies list.
  4. Include MBPullDownController wherever you need it with #import <MBPullDownController/MBPullDownController.h>.

Usage

Initialize a MBPullDownController with a front and back view controller, than add the controller to your controller hierarchy.

UITableViewController *front = [[UITableViewController new];
UIViewController *back = [[UIViewController new];
MBPullDownController *pullDownController = [[MBPullDownController alloc] initWithFrontController:front backController:back];
[self.navigationController pushViewController:pullDownController animated:NO];

The front controller's view must be a UIScrollView subclass. See the demo application for further details and check out MBPullDownController.h for API options.

License

This code is distributed under the terms and conditions of the MIT license.

mbpulldowncontroller's People

Contributors

matej avatar readmecritic 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

mbpulldowncontroller's Issues

same backgroundColor

when i change the front view backgroundColor,then back view controller's view become same background color

Table view scrolling issue

Hi Matej,
I have come across 2 issues using MBPullDownController. I'm using the Storyboards method by the way.

  1. I have a UITableViewController as the back controller. And the problem is the last couple of cells are obscured by the front controller when scrolling. For example, I have 10 rows here.
    ios simulator screen shot may 6 2014 12 32 38 pm

But the last cell is covered from the front controller view. The table view doesn't reach the end. If I pull up, you can see it but if I let go, it hides behind again.

ios simulator screen shot may 6 2014 12 32 44 pm

  1. In my above example I have only 10 items. If I increase it up to say, 30 and try to scroll to the bottom, it gets stuck halfway!
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 30;
}

I cannot scroll back up or down. It's weird. I have no idea why that's happening.

I also uploaded a small Xcode project to demonstrate the issues I'm having. If you can take a look at it and tell me how to correct them, I'd really appreciate it. To
https://www.dropbox.com/s/xfdvbnlzxulim8e/PullDownTest.zip

Thank you.

erreur pls help me

'The front controller's view is not a UIScrollView subclas
explication i create newx project and i copy all file in my new project and i have this error 'NSInternalInconsistencyException', reason: 'The front controller's view is not a UIScrollView subclass.'
pls i want to see the image full screen how i can do this
excuse me but i french
i spreak bad enslish tkanks you

Ho to use with Storyboards

Hi,

I'm trying to get this working in a Storyboard app. I tried to do it using the method you've described in another similar issue.

#14 (comment)

I've created 2 separate view controllers (a UIViewController, UITableViewCOntroller) and have assigned them unique identifiers. For the main view controller I've subclasses it from MBPullDownController and in its awakeFromNib method I'm trying to put the following 2 lines.

[self frontController:[self.storyboard instantiateViewControllerWithIdentifier:@"FrontController"]];
[self backController:[self.storyboard instantiateViewControllerWithIdentifier:@"BackController"]];

But when I do so, the following errors occur.

No visible @interface for 'BaseViewController' declares the selector 'frontController'
No visible @interface for 'BaseViewController' declares the selector 'backController'

BaseViewController is my main view controller (MBPullDownController
suubclass). Can you please tell me how to rectify this? Am I missing something here?

I've created a small project demonstrating the issue and uploaded it if you want to take a quick look at it.
http://www30.zippyshare.com/v/17127840/file.html

Fixed Header Menu Improvement

Hello,

Is there is anyway to make the top header menu shown all the time? i mean when i have too many cells in the front controller and i move up lots of cells i must scroll back too much to get to the top menu. is there is a way to make the top menu always visible?

Not Working With TabBarController

Does anyone have a clue on how I can instantiate MBPullDownController?

i have a UITABBARCONTROLLER and want to integrate the MBPullDown with the view controllers of the tabarcontroller.

Some correction in NSAssert condition of MBPullDownController.m

the current implementation of code at MBPullDownController.m :
if (new) { [self addChildViewController:new]; UIView *containerView = self.view; UIView *newView = new.view; NSString *message = @"The front controller's view is not a UIScrollView subclass."; NSAssert(!newView || [newView isKindOfClass:[UIScrollView class]], message); if (newView) { newView.frame = containerView.bounds; [containerView addSubview:newView]; } }

According to my understanding , the condition of NSAssert should be

NSAssert(newView || [newView isKindOfClass:[UIScrollView class]], message);

log the message if new view is nil and newView is not kind of UIScrollView.

UICollectionView hiding under the UINavigationBar when using with Storyboards

When using MBPullDownController in storyboard, I came across his issue. Top part of the collection view goes under the navigation bar.

screen shot 2014-01-11 at 1 50 10 pm

I managed to get resolve it by the following line of code.

[self.collectionView setContentInset:UIEdgeInsetsMake(self.navigationController.navigationBar.frame.size.height + [UIApplication sharedApplication].statusBarFrame.size.height, 0, 0, 0)];

screen shot 2014-01-11 at 1 50 41 pm

Now the problem is say, I open the pull down menu and select something from the under laying table view and then the collection view slides back up. When it does, it appears under the navigation bar same as before.

I tried to resolve this by using NSNotifications. By sending a notification when the collection view finishes sliding back up. But couldn't do it because there's no method firing when it finishes sliding back. It sends the notification just before the animation starts, not after its done.

Is there any workaround for this? Any suggestion would be great. Thanks.

Regarding TabbarController on Front View

Hi Matej,
I embedded a TabbarController to the front view controller (subclass of scrollview)and the tab bar is not visible when in action.The rest of the things are working fine.Also I tried adding it programatically .but the tab bar scrolls with the view.Please help

My code snippet as below

FrontViewController *front = [self.storyboard instantiateViewControllerWithIdentifier:@"front"];
MBPullDownController *pullDownController=[[MBPullDownController alloc]initWithFrontController:front backController:self];
[self.navigationController addChildViewController:pullDownController];

screen shot 2014-09-10 at 12 16 47 am
screen shot 2014-09-10 at 12 16 13 am
screen shot 2014-09-10 at 12 16 26 am

erreur pls help me

'NSInvalidArgumentException', reason: '-[NSCache setObject:forKey:cost:]: attempt to insert nil value

Rotation doesn't work properly on iPad when "opened"

Link to a video demonstrating the problem: http://cl.ly/3h2x033e0o22

When the front view is lowered, then rotated, the front (green) view has now either disappeared completely, or is far too big (depending on which rotation you started before the rotation).

I have not added any custom code into my view controllers to make this reproduceable. The only line I added into my default AppDelegate.m is:

self.window.rootViewController = [[MBPullDownController alloc] initWithFrontController:[[FirstViewController alloc] init] backController:[[SecondViewController alloc] init]];

And then I changed a line in MBPulldownController to make the front view appear green.

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.