Skip to content

Commit

Permalink
Safe area fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chanonly123 committed Aug 3, 2020
1 parent 98bcb5b commit 5a72817
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions AutoKeyboard.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "AutoKeyboard"
s.version = "1.4.5"
s.version = "1.4.6"
s.summary = "Automatic Keyboard handling with ease"
s.description = "Automatic bottom constraints changes with extreamly easy integration."
s.homepage = "https://github.com/chanonly123/AutoKeyboard"
Expand Down Expand Up @@ -80,7 +80,7 @@ Pod::Spec.new do |s|
# Supports git, hg, bzr, svn and HTTP.
#

s.source = { :git => "https://github.com/chanonly123/AutoKeyboard.git", :tag => "1.4.5" }
s.source = { :git => "https://github.com/chanonly123/AutoKeyboard.git", :tag => "1.4.6" }


# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand Down
4 changes: 2 additions & 2 deletions AutoKeyboard/AutoKeyboard.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.4.5;
MARKETING_VERSION = 1.4.6;
PRODUCT_BUNDLE_IDENTIFIER = com.chanonly123.AutoKeyboard;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -282,7 +282,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.4.5;
MARKETING_VERSION = 1.4.6;
PRODUCT_BUNDLE_IDENTIFIER = com.chanonly123.AutoKeyboard;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down
8 changes: 7 additions & 1 deletion AutoKeyboard/AutoKeyboard/AutoKeyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ extension UIViewController {
if let saved = savedConstant.object(forKey: self) as? [NSLayoutConstraint: CGFloat] {
for each in saved {
let tabBarHeight: CGFloat = (tabBarController?.tabBar.isHidden ?? true) ? 0 : tabBarController?.tabBar.bounds.height ?? 0
each.key.constant = each.value + result.keyboardFrameEnd.height - tabBarHeight
var iPhoneXExtra: CGFloat = 0
if #available(iOS 11.0, *) {
if view.safeAreaInsets.bottom > 0 {
iPhoneXExtra = view.safeAreaInsets.bottom
}
}
each.key.constant = each.value + result.keyboardFrameEnd.height - tabBarHeight - iPhoneXExtra
}
animateWithKeyboardEventNotified(result: result)
}
Expand Down

0 comments on commit 5a72817

Please sign in to comment.