Git Product home page Git Product logo

Comments (6)

matej avatar matej commented on September 28, 2024

I'm using the component in a storyboard without issues.

Here's how you can do it.

Create a MBPullDownController subclass and use that as the storyboard's
view controller class. Create two additional view controllers in the
storybard and assign unique storyboard ids to them.

You can't connect the controllers in the storyboard editor (storyboard
limitation), but you can do it in code.
In the MBPullDownController subclass do the following:

  • (void)awakeFromNib {
    [self
    frontController:[self.storyboard instantiateViewControllerWithIdentifier:@
    "frontControllerID"]];
    [self backController:[self.storyboard instantiateViewControllerWithIdentifier:@
    "backControllerID"]];
    }

That's it.

On 29. jun. 2013, at 07:21, Alex Saidani [email protected] wrote:

Major issues when trying to get this to work with storyboards, anyone
managed it?


Reply to this email directly or view it on
GitHubhttps://github.com//issues/14
.

from mbpulldowncontroller.

alexsaidani avatar alexsaidani commented on September 28, 2024

And you don't have to stick anything in the AppDelegate when doing this? It just doesn't seem to want to work for me, have you got an example project using storyboards?

from mbpulldowncontroller.

alexsaidani avatar alexsaidani commented on September 28, 2024

I've managed to get it working but in a completely different way, it also doesn't work so well. I've created a FrontViewController as a subclass of UITableViewController and a BackViewController also as a subclass of UITableViewController, there are two corresponding view controllers in the storyboard that have the class of each of these. Then in the app delegate i've put:

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.rootViewController = [self setUpViewControllerHierarchy];
    [self.window makeKeyAndVisible];
    return YES;
    }
  • (UIViewController *)setUpViewControllerHierarchy {
    FrontViewController *front = [[FrontViewController alloc] init];
    BackViewController *back = [[BackViewController alloc] init];
    MBPullDownController *pullDownController = [[MBPullDownController alloc] initWithFrontController:front backController:back];
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:pullDownController];
    navigationController.navigationBarHidden = YES;
    return navigationController;
    }

But whilst this works, it doesn't work well at all, I don't actually think it makes use of the storyboard file whatsoever and is all created by code. Is there a better method of doing this that'll allow me to make use of the storyboard document?

from mbpulldowncontroller.

alexsaidani avatar alexsaidani commented on September 28, 2024

I've just tried this again and your method of implementing it with storyboards just doesn't work for me.

from mbpulldowncontroller.

alexsaidani avatar alexsaidani commented on September 28, 2024

Are you able to upload a sample project working with storyboards? That'd be awesome.

from mbpulldowncontroller.

matej avatar matej commented on September 28, 2024

See #16.

from mbpulldowncontroller.

Related Issues (20)

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.