diff --git a/Keyboard+LayoutGuide.podspec b/Keyboard+LayoutGuide.podspec index 09189b1..db59e43 100644 --- a/Keyboard+LayoutGuide.podspec +++ b/Keyboard+LayoutGuide.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Keyboard+LayoutGuide' - s.version = "1.4.2" + s.version = "1.5.0" s.summary = "Apple's missing KeyboardLayoutGuide" s.homepage = "https://github.com/freshOS/KeyboardLayoutGuide" s.license = { :type => "MIT", :file => "LICENSE" } @@ -13,5 +13,5 @@ Pod::Spec.new do |s| s.ios.deployment_target = "9" s.description = "An alternative approach to handling keyboard in iOS with Autolayout" s.module_name = 'KeyboardLayoutGuide' - s.swift_versions = ['4', '4.1', '4.2', '5.0'] + s.swift_versions = ['4', '4.1', '4.2', '5.0', '5.1'] end diff --git a/KeyboardLayoutGuide.framework.zip b/KeyboardLayoutGuide.framework.zip index 644c7f3..9850c59 100644 Binary files a/KeyboardLayoutGuide.framework.zip and b/KeyboardLayoutGuide.framework.zip differ diff --git a/KeyboardLayoutGuide/KeyboardLayoutGuide.xcodeproj/project.pbxproj b/KeyboardLayoutGuide/KeyboardLayoutGuide.xcodeproj/project.pbxproj index 0e02195..8bda9a3 100644 --- a/KeyboardLayoutGuide/KeyboardLayoutGuide.xcodeproj/project.pbxproj +++ b/KeyboardLayoutGuide/KeyboardLayoutGuide.xcodeproj/project.pbxproj @@ -380,6 +380,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 1.5.0; PRODUCT_BUNDLE_IDENTIFIER = com.freshos.KeyboardLayoutGuide; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -402,6 +403,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 1.5.0; PRODUCT_BUNDLE_IDENTIFIER = com.freshos.KeyboardLayoutGuide; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; diff --git a/KeyboardLayoutGuide/KeyboardLayoutGuide/Info.plist b/KeyboardLayoutGuide/KeyboardLayoutGuide/Info.plist index 409203b..fcd3639 100644 --- a/KeyboardLayoutGuide/KeyboardLayoutGuide/Info.plist +++ b/KeyboardLayoutGuide/KeyboardLayoutGuide/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.4.2 + $(MARKETING_VERSION) CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/KeyboardLayoutGuide/KeyboardLayoutGuide/Keyboard+LayoutGuide.swift b/KeyboardLayoutGuide/KeyboardLayoutGuide/Keyboard+LayoutGuide.swift index 92deec5..a123d04 100644 --- a/KeyboardLayoutGuide/KeyboardLayoutGuide/Keyboard+LayoutGuide.swift +++ b/KeyboardLayoutGuide/KeyboardLayoutGuide/Keyboard+LayoutGuide.swift @@ -8,7 +8,7 @@ import UIKit -private class Keyboard { +internal class Keyboard { static let shared = Keyboard() var currentHeight: CGFloat = 0 } @@ -17,7 +17,7 @@ extension UIView { private enum AssociatedKeys { static var keyboardLayoutGuide = "keyboardLayoutGuide" } - + /// A layout guide representing the inset for the keyboard. /// Use this layout guideā€™s top anchor to create constraints pinning to the top of the keyboard. public var keyboardLayoutGuide: KeyboardLayoutGuide { @@ -38,14 +38,14 @@ open class KeyboardLayoutGuide: UILayoutGuide { updateButtomAnchor() } } - + private var bottomConstraint: NSLayoutConstraint? - + @available(*, unavailable) public required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } - + public init(notificationCenter: NotificationCenter = NotificationCenter.default) { super.init() // Observe keyboardWillChangeFrame notifications @@ -56,7 +56,7 @@ open class KeyboardLayoutGuide: UILayoutGuide { object: nil ) } - + internal func setUp() { guard let view = owningView else { return } NSLayoutConstraint.activate( @@ -68,25 +68,25 @@ open class KeyboardLayoutGuide: UILayoutGuide { ) updateButtomAnchor() } - + func updateButtomAnchor() { if let bottomConstraint = bottomConstraint { bottomConstraint.isActive = false } - + guard let view = owningView else { return } - + let viewBottomAnchor: NSLayoutYAxisAnchor if #available(iOS 11.0, *), usesSafeArea { viewBottomAnchor = view.safeAreaLayoutGuide.bottomAnchor } else { viewBottomAnchor = view.bottomAnchor } - + bottomConstraint = bottomAnchor.constraint(equalTo: viewBottomAnchor) bottomConstraint?.isActive = true } - + @objc private func keyboardWillChangeFrame(_ note: Notification) { if var height = note.keyboardHeight { @@ -98,7 +98,7 @@ open class KeyboardLayoutGuide: UILayoutGuide { Keyboard.shared.currentHeight = height } } - + private func animate(_ note: Notification) { if let owningView = self.owningView,