GithubHelp home page GithubHelp logo

tanin47 / backward-modal Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 126 KB

iOS 4 to support self.presentingViewController

Home Page: http://tanin.nanakorn.com/b/62/ios_4_and_5_incompatibility_in_dismissing_a_modal_view

Objective-C 100.00%

backward-modal's Introduction

UIViewController+PresentingViewController

I was very annoyed with the problem that iOS 4 does not support self.presentingViewController. And that makes my code look bad when trying to dismiss a modal view.

This library allow you to use self.presentingViewController on iOS 4. (On iOS 5, it disables itself. So, no worry)

I hope it benefits you as much as it does to me.

For more information about the technique, please see my blog here

How to use it

Include 2 files into your project:

  • UIViewController+PresentingViewController.h
  • UIViewController+PresentingViewController.m

That's it.

On iOS 4, you may use self.presentingViewController.

On iOS 5, the files are disabled by themselves. So, don't worry about it.

How to test it

  1. Clone the project (or Download as a zip file)
  2. Run the project under iPhone 4.x simulator
  3. Run the project under iPhone 5.x simulator to see that it works on both iOS

Author

Tanin Na Nakorn

License

Do What The Fuck You Want To Public License (http://sam.zoy.org/wtfpl/)

  1. You just DO WHAT THE FUCK YOU WANT TO.

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.