Latest 1.0
Homepage https://github.com/JeromeTan1997/KeyboardAnimatable
License MIT
Platforms ios 8.0, requires ARC
Authors

A protocol-oriented library for performing animation when toggling keyboard

Language
CocoaPods
Carthage Compatible
License

Installation

Cocoapods

CocoaPods is a dependency manager for Cocoa projects.

You can install it with the following command:

$ gem install cocoapods

To integrate KeyboardAnimatable into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '8.0'
use_frameworks!

target 'YourApp' do
    pod 'KeyboardAnimatable'
end

Manually

Download KeyboardAnimatable.swift and add it to your project

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate KeyboardAnimatable into your Xcode project using Carthage, specify it in your Cartfile:

github "JeromeTan1997/KeyboardAnimatable"

Swift Package Manager

Swift Package Manager is a tool for managing the distribution of Swift code.

To integrate KeyboardAnimatable into your Xcode project using Swift Package Manager, specify it in your Packages.swift:

import PackageDescription

let package = Package(
    name: "Your Project Name",
    targets: [],
    dependencies: [
        .Package(url: "https://github.com/JeromeTan1997/KeyboardAnimatable.git", versions: "1.0" ..< Version.max)
    ]
)

usage

import UIKit
import KeyboardAnimatable

class ViewController: UIViewController, KeyboardAnimatable {

    override func viewDidLoad() {
        super.viewDidLoad()

        // enable keyboard animation
        enableKeyboardAnimation()
    }

    deinit {
        // disable keyboard animation, This method MUST be called, or will cause memory issue.
        disableKeyboardAnimation()
    }

    func animateWhenKeyboardAppear(keyboardHeight keyboardHeight: CGFloat, duration: NSTimeInterval) {
        UIView.animateWithDuration(duration) {
            // perform animation
        }
    }

    func animateWhenKeyboardDisappear(keyboardHeight keyboardHeight: CGFloat, duration: NSTimeInterval) {
        UIView.animateWithDuration(duration) {
            // perform animation
        }
    }

}

License

The MIT License (MIT)

Copyright (c) 2016 Jerome Tan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Latest podspec

{
    "name": "KeyboardAnimatable",
    "version": "1.0",
    "summary": "A protocol-oriented library for performing animation when toggling keyboard.",
    "homepage": "https://github.com/JeromeTan1997/KeyboardAnimatable",
    "license": "MIT",
    "authors": {
        "Jerome Tan": "[email protected]"
    },
    "source": {
        "git": "https://github.com/JeromeTan1997/KeyboardAnimatable.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "KeyboardAnimatable/*"
}

Pin It on Pinterest

Share This