diff --git a/IQKeyBoardManager/IQToolbar/IQBarButtonItem.m b/IQKeyBoardManager/IQToolbar/IQBarButtonItem.m index 2951c5d8..88d26690 100644 --- a/IQKeyBoardManager/IQToolbar/IQBarButtonItem.m +++ b/IQKeyBoardManager/IQToolbar/IQBarButtonItem.m @@ -43,43 +43,43 @@ +(void)initialize [[self appearance] setTitleTextAttributes:nil forState:UIControlStateReserved]; //Background Image - [[self appearance] setBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateDisabled barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateSelected barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateApplication barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateReserved barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateDisabled barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateSelected barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateApplication barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateReserved barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateNormal style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateHighlighted style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateDisabled style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateSelected style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateApplication style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateReserved style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateNormal style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateHighlighted style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateDisabled style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateSelected style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateApplication style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateReserved style:UIBarButtonItemStyleBordered barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateNormal style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateHighlighted style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateDisabled style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateSelected style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateApplication style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateReserved style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateNormal style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateHighlighted style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateDisabled style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateSelected style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateApplication style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateReserved style:UIBarButtonItemStyleDone barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateNormal style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateHighlighted style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateDisabled style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateSelected style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateApplication style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forState:UIControlStateReserved style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateNormal style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateHighlighted style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateDisabled style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateSelected style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateApplication style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forState:UIControlStateReserved style:UIBarButtonItemStylePlain barMetrics:UIBarMetricsDefault]; [[self appearance] setBackgroundVerticalPositionAdjustment:0 forBarMetrics:UIBarMetricsDefault]; //Back Button - [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateDisabled barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateSelected barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateApplication barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateReserved barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateDisabled barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateSelected barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateApplication barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackButtonBackgroundImage:nil forState:UIControlStateReserved barMetrics:UIBarMetricsDefault]; [[self appearance] setBackButtonTitlePositionAdjustment:UIOffsetZero forBarMetrics:UIBarMetricsDefault]; [[self appearance] setBackButtonBackgroundVerticalPositionAdjustment:0 forBarMetrics:UIBarMetricsDefault]; diff --git a/IQKeyBoardManager/IQToolbar/IQToolbar.m b/IQKeyBoardManager/IQToolbar/IQToolbar.m index c4fe9e55..f5c89b25 100644 --- a/IQKeyBoardManager/IQToolbar/IQToolbar.m +++ b/IQKeyBoardManager/IQToolbar/IQToolbar.m @@ -52,10 +52,10 @@ +(void)initialize #endif //Background image - [[self appearance] setBackgroundImage:nil forToolbarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forToolbarPosition:UIBarPositionBottom barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forToolbarPosition:UIBarPositionTop barMetrics:UIBarMetricsDefault]; - [[self appearance] setBackgroundImage:nil forToolbarPosition:UIBarPositionTopAttached barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forToolbarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forToolbarPosition:UIBarPositionBottom barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forToolbarPosition:UIBarPositionTop barMetrics:UIBarMetricsDefault]; + [[self appearance] setBackgroundImage:nil forToolbarPosition:UIBarPositionTopAttached barMetrics:UIBarMetricsDefault]; //Shadow image [[self appearance] setShadowImage:nil forToolbarPosition:UIBarPositionAny]; diff --git a/IQKeyboardManagerSwift/IQKeyboardManager.swift b/IQKeyboardManagerSwift/IQKeyboardManager.swift index 57894c3c..5dea64cc 100644 --- a/IQKeyboardManagerSwift/IQKeyboardManager.swift +++ b/IQKeyboardManagerSwift/IQKeyboardManager.swift @@ -1263,12 +1263,12 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate { // (Bug ID: #5) if CGRectEqualToRect(_topViewBeginRect, CGRectZero) == true { // keyboard is not showing(At the beginning only). We should save rootViewRect. - var rootController = _textFieldView?.topMostController() - if rootController == nil { - rootController = keyWindow()?.topMostController() + _rootViewController = _textFieldView?.topMostController() + if _rootViewController == nil { + _rootViewController = keyWindow()?.topMostController() } - if let unwrappedRootController = rootController { + if let unwrappedRootController = _rootViewController { _topViewBeginRect = unwrappedRootController.view.frame _IQShowLog("Saving \(unwrappedRootController._IQDescription()) beginning Frame: \(_topViewBeginRect)") } else {