Giter Site home page Giter Site logo

nologis / ttinputvisibilitycontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tapptitude/ttinputvisibilitycontroller

0.0 3.0 0.0 2.9 MB

Lightweight controller to keep your inputs visible when the keyboard is presented.

Home Page: https://tapptitude.com

License: MIT License

Ruby 4.04% Objective-C 4.42% Swift 91.54%

ttinputvisibilitycontroller's Introduction

TTInputVisibilityController

Twitter

About

Lightweight controller to keep your inputs visible when the keyboard is presented.

This project is maintained by Tapptitude, a mobile app development agency specialized in building high-quality iOS and Android mobile apps, for startups and brands alike. A lively team of skilled app developers and app designers based in Europe, we provide full-stack mobile app development services to entrepreneurs looking to innovate on mobile.




Features:

  • Lightweight & very easy to integrate
  • Works with any inputs or keyboard types
  • Automatic keyboard dismiss when tapping outside of the input
  • Ignore views that trigger dimissal
  • Custom additional distance from the keyboard
  • Add any view to be visible
  • Custom animation block when the keyboard is presented.

Requirements

  • iOS 8.0+
  • Xcode 7.3+

Installation

CocoaPods

Swift 4.0, 3.X

pod 'TTInputVisibilityController'

Carthage

github "tapptitude/TTInputVisibilityController"

Manually

Add the contents of TTInputVisibilityController files to your project.

Usage

Add the controller directly to your view

You can add the keyboardVisibilityController to the view property of any ViewController.

override func viewDidLoad() {
    super.viewDidLoad()
    self.view.addInputVisibilityController()
}

Custom space above the keyboard

You can add extra space above the keyboard by setting the swift extraSpaceAboveKeyboard property.

Ignore views that trigger dimissal

If you want some view to not trigger the dismissal of the keyboard(e.g. a login button) you can set

inputVisibilityController.dismissKeyboardTouchRecognizer?.ignoreViews = [myLoginButton] 

Additional animation block

You can also provide a block to be called when the keyboard is dismissed or presented, providing you the translation value. (e.g animating some constraints)

inputVisibilityController.additionallAnimatioBlock = { [weak self] translation in
    self?.loginButtonBottomConstraint.constant = initialConstraint + translation
    self?.view.layoutIfNeeded()
}

Contribution

Feel free to Fork, submit Pull Requests or send us your feedback and suggestions!

License

TTInputVisibilityController is available under the MIT license. See the LICENSE file for more info.

ttinputvisibilitycontroller's People

Contributors

efraimb avatar cocanlucian avatar buguibu avatar

Watchers

James Cloos avatar Raúl Anatol 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.