GithubHelp home page GithubHelp logo

svanichkin / modal Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 55 KB

The class allows without thinking about showing any controllers (modal / push) without thinking about the root controller.

License: Apache License 2.0

Objective-C 75.36% Ruby 24.64%

modal's Introduction

Modal

The class allows without thinking about showing any controllers (modal / push) without thinking about the root controller.

This library works on many projects such as Mubert, Morse, etc. Top of App Store.

Show controller immediately

[Modal showViewController:controller
                  options:kNilOptions
               completion:nil];

Show controller after other

[Modal showViewController:controller
                  options:ModalOptionQuery
               completion:nil];

Show controller immediately wrapped in navigation controller

[Modal showViewController:controller
                  options:ModalOptionNavigation
               completion:nil];

Show controller immediately wrapped in navigation controller with hidden navigation bar

[Modal showViewController:controller
                  options:ModalOptionNavigation|ModalOptionNavigationHidden
               completion:nil];

It is also possible to proxy clicks of view on the lower layers. For example, we need the window that is opened to be transparent for clicks (i.e., clicks are passed to the window below). To do this, it is sufficient to specify the proxyUserInteractionEnabled = YES parameter for the UIView. If you specify this key for the UIView, which is the lowest layer of the controller, the whole window will become transparent for clicks.

The controller can be obtained directly from the storyboard, just specify the name of the class with the Storyboard ID. For example, we have a class UIViewController on a storyboard and our class MyViewController is assigned to it, then in My Storiboard ID you also need to specify MyViewController. Then it will be possible to create controllers in this way:

MyViewController *controller = MyViewController.newFromStoryboard;

You can also get a controller with a different name Storyboard ID, for example like this:

MyViewController *controller = [MyViewController newFromStoryboardWithId:@"Name"];

And immediately show it like this:

[controller show];

Or with the execution method at the end of the show:

[controller showWithCompletion:nil];

// or
[controller showWithOptions:kNilOptions
                 completion:nil];

modal's People

Contributors

svanichkin avatar vladimirbrejcha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.