KeyboardLock 0.1.8

KeyboardLock 0.1.8

Nathan Fiscaletti维护。



  • 作者
  • nathan-fiscaletti

KeyboardLock

Preview

CI Status Version License Platform

示例

要运行示例项目,请先克隆仓库,然后首先从示例目录运行pod install

KeyboardLock(
    withView: containerView,
    andLockType: .BottomConstraint
).lock()

锁定类型

锁定类型 描述 约束搜索条件
.BottomConstraint 底部的约束将在其动画周期结束时根据键盘的高度向上移动。 superView.constraints.firstAttribute == .bottom && superview.constraints.relation == .equal
.HeightConstraint 约束的高度将在其动画周期结束时根据键盘的高度缩短。 view.constraints.firstAttribute == .height && view.constraints.relation == .equal
.FrameOrigin 视图框架的Y起始点将在其动画周期结束时根据键盘的高度向上移动。 None

其他注意事项

  1. 使用 .BottomConstraint.HeightConstraint 时,您可以通过在构造函数中使用 andConstraint: 手动传递您希望更新的约束来实现,或者将其留空,系统将尝试自己找到约束。如果无法找到合适的约束,将通过 NSLog 发送警告消息。
  2. 您可以使用相关的 KeyboardLock 实例的 .unlock() 成员函数解锁键盘上的视图。

安装

KeyboardLock 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile:

pod 'KeyboardLock'

作者

nathan-fiscaletti, [email protected]

许可

KeyboardLock 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。