Code Monkey home page Code Monkey logo

uiresponder-keyboardcache's Introduction

UIResponder+KeyboardCache

There is a small problem in iOS that causes a pretty significant delay between the first time the keyboard is requested and when it actually appears. It is only the first time, and seems to be related to the OS trying to cache various properties of the keyboard.

On my iPhone 4S running iOS 5.1 (as of June 19th, 2012) it can take anywhere between .5 and .9 seconds. It can create a frustrating user experience, and most users will try to tap the activation area multiple times, sometimes leading to accidental dismissal of the keyboard.

Plenty of people have asked about this issue on sites like Stackoverflow, but it seems the best solution is from 2009 and it seems pretty risky (sifting through subviews of UIWindow looking for the keyboard view).

This category on UIResponder gives you a simple method +cacheKeyboard so that you can control when this caching work is done. For example, if you are loading some data from a server, then you could invoke this during that downtime. There is another method +cacheKeyboard: that takes an optional BOOL value. Passing YES to this method causes the cache invocation to happen on the next runloop. So, if you performed an animation just before calling this method it would not interrupt that animation.

##Installation

We love CocoaPods, so we recommend you use it.

##Author

Brandon Williams
@mbrandonw
www.opetopic.com

License

UIResponder+KeyboardCache is available under the MIT license. See the LICENSE file for more info.

uiresponder-keyboardcache's People

Contributors

fabiopelosin avatar

Watchers

KEL avatar James Cloos avatar  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.