镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
This repository was archived by the owner on Nov 19, 2023. It is now read-only.
CoreKitPublic archive

About

Easy to use keyboard avoiding library.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

KeyboardAvoiding

Easy to use keyboard avoiding library.

Installation

Swift Package Manager

.package(url: "https://github.com/CoreKit/KeyboardAvoiding", from: "1.0.0"),

Usage

import UIKit
import KeyboardAvoiding

class ViewController: UIViewController {

    private var keyboardAvoiding: KeyboardAvoiding!

    override func viewDidLoad() {
        super.viewDidLoad()

        self.keyboardAvoiding = KeyboardAvoiding()
        .onKeyboardWillShow { rect in
            // do your stuff here 
        }
        .onKeyboardDidShow { rect in
            // do your stuff here
        }
        .onKeyboardWillHide {
            // do your stuff here
        }
        .onKeyboardDidHide {
            // do your stuff here
        }
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        self.keyboardAvoiding.start()
    }

    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)

        self.keyboardAvoiding.stop()
    }
}

About

Easy to use keyboard avoiding library.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages