GithubHelp home page GithubHelp logo

customkeyboard's Introduction

CustomKeyboard

Provide Previous, Next, Done buttons for iOS keyboard

Usage

The CustomKeyboard class has a delegate class CustomKeyboardDelegate. Any class requiring the CustomKeyboard implementation will need to implement the delegate functions. These functions are:

  • (void)nextClicked:(NSUInteger)selectedId; This function will receive a call when the user clicks on the next button. The selectedId is the integer value of which textbox the user was in BEFORE clicking next.

  • (void)previousClicked:(NSUInteger)selectedId; This function will be called when the user clicks on previous. The variable selectedId will have the id of the box that the user was on before clicking previous.

  • (void)doneClicked:(NSUInteger)selectedId; This function will be called when the user clicks on done.

After implementing the three delegate functions, create an instance of the CustomKeyboard class and assign the delegate to that object (i.e. customKeyboard.delegate = self;).

When showing a keyboard for a particular box, inside the textFieldDidBeginEditing function, the following functions are available to create the toolbar above the keyboard:

  • (UIToolbar *)getToolbarWithPrevNextDone:(BOOL)prevEnabled :(BOOL)nextEnabled; Generate a UIToolbar with Previous, Next, and Done. The variables prevEnabled and nextEnabled define if the buttons should be enabled or not (i.e. first box won't have previous enabled).

  • (UIToolbar *)getToolbarWithDone; Generate a UIToolbar with only the Done button.

The functions above can be used in the following way: [textField setInputAccessoryView:[customKeyboard getToolbarWithPrevNextDone:FALSE :TRUE]];

This would show Previous, Next, and Done. Previous button would be disabled.

customkeyboard's People

Contributors

kalvish21 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.