Browse Source

更新IQKeyboardManager

15555599100 6 years ago
parent
commit
47317af382

BIN
HappyWork/HappyWork.xcworkspace/xcuserdata/zhangxiaoguang.xcuserdatad/UserInterfaceState.xcuserstate


+ 6 - 6
HappyWork/Podfile.lock

@@ -16,7 +16,7 @@ PODS:
     - AFNetworking/NSURLSession
   - DZNEmptyDataSet (1.8.1)
   - FLAnimatedImage (1.0.12)
-  - IQKeyboardManager (6.4.0)
+  - IQKeyboardManager (6.5.0)
   - Masonry (1.1.0)
   - MJExtension (3.1.2)
   - MJRefresh (3.2.0)
@@ -35,7 +35,7 @@ PODS:
 DEPENDENCIES:
   - AFNetworking (~> 3.2.1)
   - DZNEmptyDataSet (~> 1.8.1)
-  - IQKeyboardManager (~> 6.4.0)
+  - IQKeyboardManager (~> 6.5.0)
   - Masonry (~> 1.1.0)
   - MJExtension (~> 3.1.2)
   - MJRefresh (~> 3.2.0)
@@ -50,7 +50,6 @@ SPEC REPOS:
   https://github.com/CocoaPods/Specs.git:
     - AFNetworking
     - DZNEmptyDataSet
-    - IQKeyboardManager
     - Masonry
     - MJExtension
     - MJRefresh
@@ -61,13 +60,14 @@ SPEC REPOS:
     - YTKNetwork
   trunk:
     - FLAnimatedImage
+    - IQKeyboardManager
     - XHLaunchAd
 
 SPEC CHECKSUMS:
   AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
   DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
   FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
-  IQKeyboardManager: fcef267266379c003181fc3592f6bdb8bf4db839
+  IQKeyboardManager: 700e5155d6a292383b54e8678aec769e14fc78fc
   Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   MJExtension: 81e8e411ced318561dd09334b0c83d8227cef79c
   MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437
@@ -78,6 +78,6 @@ SPEC CHECKSUMS:
   XHLaunchAd: 45048592af01aa501c9d2d0c45e95ca74c4d0596
   YTKNetwork: df8a7a5597bda1664a4efaa7ef871a818a887fe0
 
-PODFILE CHECKSUM: 7d09d12202dd4291a7d43a31cfe1122a2d391244
+PODFILE CHECKSUM: 00117b36bed6c581c51990f8a8bffa6e72d083c2
 
-COCOAPODS: 1.8.3
+COCOAPODS: 1.8.4

+ 10 - 8
HappyWork/Pods/IQKeyboardManager/IQKeyboardManager/Categories/IQUIView+Hierarchy.m

@@ -204,15 +204,17 @@
 {
     BOOL _IQcanBecomeFirstResponder = NO;
     
-    if ([self isKindOfClass:[UITextField class]])
-    {
-        _IQcanBecomeFirstResponder = [(UITextField*)self isEnabled];
-    }
-    else if ([self isKindOfClass:[UITextView class]])
-    {
-        _IQcanBecomeFirstResponder = [(UITextView*)self isEditable];
+    if ([self conformsToProtocol:@protocol(UITextInput)]) {
+        if ([self respondsToSelector:@selector(isEditable)] && [self isKindOfClass:[UIScrollView class]])
+        {
+            _IQcanBecomeFirstResponder = [(UITextView*)self isEditable];
+        }
+        else if ([self respondsToSelector:@selector(isEnabled)])
+        {
+            _IQcanBecomeFirstResponder = [(UITextField*)self isEnabled];
+        }
     }
-
+    
     if (_IQcanBecomeFirstResponder == YES)
     {
         _IQcanBecomeFirstResponder = ([self isUserInteractionEnabled] && ![self isHidden] && [self alpha]!=0.0 && ![self isAlertViewTextField]  && !self.textFieldSearchBar);

+ 4 - 4
HappyWork/Pods/IQKeyboardManager/IQKeyboardManager/IQKeyboardManager.h

@@ -121,17 +121,17 @@ extern NSInteger const kIQPreviousNextButtonToolbarTag;
 @property(nonatomic, assign) IQAutoToolbarManageBehaviour toolbarManageBehaviour;
 
 /**
- If YES, then uses textField's tintColor property for IQToolbar, otherwise tint color is black. Default is NO.
+ If YES, then uses textField's tintColor property for IQToolbar, otherwise tint color is nil. Default is NO.
  */
 @property(nonatomic, assign) BOOL shouldToolbarUsesTextFieldTintColor;
 
 /**
- This is used for toolbar.tintColor when textfield.keyboardAppearance is UIKeyboardAppearanceDefault. If shouldToolbarUsesTextFieldTintColor is YES then this property is ignored. Default is nil and uses black color.
+ This is used for toolbar.tintColor when textfield.keyboardAppearance is UIKeyboardAppearanceDefault. If shouldToolbarUsesTextFieldTintColor is YES then this property is ignored. Default is nil.
  */
 @property(nullable, nonatomic, strong) UIColor *toolbarTintColor;
 
 /**
- This is used for toolbar.barTintColor. Default is nil and uses white color.
+ This is used for toolbar.barTintColor. Default is nil.
  */
 @property(nullable, nonatomic, strong) UIColor *toolbarBarTintColor;
 
@@ -172,7 +172,7 @@ extern NSInteger const kIQPreviousNextButtonToolbarTag;
 @property(nullable, nonatomic, strong) UIColor *placeholderColor;
 
 /**
- Placeholder Button Color when it's treated as button. Default is nil. Which means iOS Blue for light toolbar and Yellow for dark toolbar
+ Placeholder Button Color when it's treated as button. Default is nil
  */
 @property(nullable, nonatomic, strong) UIColor *placeholderButtonColor;
 

+ 81 - 46
HappyWork/Pods/IQKeyboardManager/IQKeyboardManager/IQKeyboardManager.m

@@ -126,8 +126,6 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
 
 /*******************************************/
 
-@property(nonatomic, strong, nonnull, readwrite) NSMutableSet<Class> *registeredClasses;
-
 @property(nonatomic, strong, nonnull, readwrite) NSMutableSet<Class> *disabledDistanceHandlingClasses;
 @property(nonatomic, strong, nonnull, readwrite) NSMutableSet<Class> *enabledDistanceHandlingClasses;
 
@@ -191,12 +189,19 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
 
 #pragma mark - Initializing functions
 
-/** Override +load method to enable KeyboardManager when class loader load IQKeyboardManager. Enabling when app starts (No need to write any code) */
+/**
+ Override +load method to enable KeyboardManager when class loader load IQKeyboardManager. Enabling when app starts (No need to write any code)
+ 
+ @Note: If you want to disable `+ (void)load` method, you can add build setting in configurations. Like that:
+       `{ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) IQ_KEYBOARD_MANAGER_LOAD_METHOD_DISABLE=1' }`
+ */
+#if !IQ_KEYBOARD_MANAGER_LOAD_METHOD_DISABLE
 +(void)load
 {
     //Enabling IQKeyboardManager. Loading asynchronous on main thread
     [self performSelectorOnMainThread:@selector(sharedManager) withObject:nil waitUntilDone:NO];
 }
+#endif
 
 /*  Singleton Object Initialization. */
 -(instancetype)init
@@ -209,9 +214,7 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
         dispatch_once(&onceToken, ^{
             
             __strong __typeof__(self) strongSelf = weakSelf;
-
-            strongSelf.registeredClasses = [[NSMutableSet alloc] init];
-
+            
             [strongSelf registerAllNotifications];
 
             //Creating gesture for @shouldResignOnTouchOutside. (Enhancement ID: #14)
@@ -348,6 +351,15 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
         
         if (textFieldViewController)
         {
+            //If it is searchBar textField embedded in Navigation Bar
+            if ([_textFieldView textFieldSearchBar] != nil && [textFieldViewController isKindOfClass:[UINavigationController class]]) {
+                
+                UINavigationController *navController = (UINavigationController*)textFieldViewController;
+                if (navController.topViewController) {
+                    textFieldViewController = navController.topViewController;
+                }
+            }
+
             if (enable == NO)
             {
                 //If viewController is kind of enable viewController class, then assuming it's enabled.
@@ -432,6 +444,15 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
         
         if (textFieldViewController)
         {
+            //If it is searchBar textField embedded in Navigation Bar
+            if ([_textFieldView textFieldSearchBar] != nil && [textFieldViewController isKindOfClass:[UINavigationController class]]) {
+                
+                UINavigationController *navController = (UINavigationController*)textFieldViewController;
+                if (navController.topViewController) {
+                    textFieldViewController = navController.topViewController;
+                }
+            }
+
             if (shouldResignOnTouchOutside == NO)
             {
                 //If viewController is kind of enable viewController class, then assuming shouldResignOnTouchOutside is enabled.
@@ -502,6 +523,15 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
     
     if (textFieldViewController)
     {
+        //If it is searchBar textField embedded in Navigation Bar
+        if ([_textFieldView textFieldSearchBar] != nil && [textFieldViewController isKindOfClass:[UINavigationController class]]) {
+            
+            UINavigationController *navController = (UINavigationController*)textFieldViewController;
+            if (navController.topViewController) {
+                textFieldViewController = navController.topViewController;
+            }
+        }
+
         if (enableAutoToolbar == NO)
         {
             //If found any toolbar enabled classes then return.
@@ -604,7 +634,7 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
     //  Getting KeyWindow object.
     UIWindow *keyWindow = [self keyWindow];
     
-    //  We are unable to get textField object while keyboard showing on UIWebView's textField.  (Bug ID: #11)
+    //  We are unable to get textField object while keyboard showing on WKWebView's textField.  (Bug ID: #11)
     if (_hasPendingAdjustRequest == NO ||
         textFieldView == nil ||
         rootController == nil ||
@@ -672,7 +702,7 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
     CGFloat layoutAreaHeight = rootController.view.layoutMargins.top;
     
     CGFloat topLayoutGuide = MAX(navigationBarAreaHeight, layoutAreaHeight) + 5;
-    CGFloat bottomLayoutGuide = [textFieldView isKindOfClass:[UITextView class]] ? 0 : rootController.view.layoutMargins.bottom; //Validation of textView for case where there is a tab bar at the bottom or running on iPhone X and textView is at the bottom.
+    CGFloat bottomLayoutGuide = ([textFieldView respondsToSelector:@selector(isEditable)] && [textFieldView isKindOfClass:[UIScrollView class]]) ? 0 : rootController.view.layoutMargins.bottom; //Validation of textView for case where there is a tab bar at the bottom or running on iPhone X and textView is at the bottom.
 
     //  +Move positive = textField is hidden.
     //  -Move negative = textField is showing.
@@ -937,7 +967,7 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
                 //[textFieldView isKindOfClass:[UITextView class]] If is a UITextView type
                 //[superScrollView superviewOfClassType:[UIScrollView class]] == nil    If processing scrollView is last scrollView in upper hierarchy (there is no other scrollView upper hierarchy.)
                 //shouldOffsetY >= 0     shouldOffsetY must be greater than in order to keep distance from navigationBar (Bug ID: #92)
-                if ([textFieldView isKindOfClass:[UITextView class]] &&
+                if ([textFieldView respondsToSelector:@selector(isEditable)]  && [textFieldView isKindOfClass:[UIScrollView class]] &&
                     nextScrollView == nil &&
                     (shouldOffsetY >= 0))
                 {
@@ -1010,10 +1040,15 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
                 CGFloat bottom = (kbSize.height-keyboardDistanceFromTextField)-(CGRectGetHeight(keyWindow.frame)-CGRectGetMaxY(lastScrollViewRect));
 
                 // Update the insets so that the scroll vew doesn't shift incorrectly when the offset is near the bottom of the scroll view.
+                CGFloat bottomInset = MAX(_startingContentInsets.bottom, bottom);
+
+                if (@available(iOS 11, *)) {
+                    bottomInset -= strongLastScrollView.safeAreaInsets.bottom;
+                }
+
                 UIEdgeInsets movedInsets = strongLastScrollView.contentInset;
+                movedInsets.bottom = bottomInset;
 
-                movedInsets.bottom = MAX(_startingContentInsets.bottom, bottom);
-                
                 if (UIEdgeInsetsEqualToEdgeInsets(strongLastScrollView.contentInset, movedInsets) == NO)
                 {
                     [self showLog:[NSString stringWithFormat:@"old ContentInset : %@ new ContentInset : %@", NSStringFromUIEdgeInsets(strongLastScrollView.contentInset), NSStringFromUIEdgeInsets(movedInsets)]];
@@ -1047,9 +1082,9 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
         //Special case for UITextView(Readjusting textView.contentInset when textView hight is too big to fit on screen)
         //_lastScrollView       If not having inside any scrollView, (now contentInset manages the full screen textView.
         //[textFieldView isKindOfClass:[UITextView class]] If is a UITextView type
-        if ([textFieldView isKindOfClass:[UITextView class]])
+        if ([textFieldView respondsToSelector:@selector(isEditable)] && [textFieldView isKindOfClass:[UIScrollView class]])
         {
-            UITextView *textView = (UITextView*)textFieldView;
+            UIScrollView *textView = (UIScrollView*)textFieldView;
 
             CGFloat keyboardYPosition = CGRectGetHeight(keyWindow.frame)-(kbSize.height-keyboardDistanceFromTextField);
 
@@ -1078,8 +1113,15 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
                     }
                 }
 
+                CGFloat bottomInset = self.textFieldView.frame.size.height-textViewHeight;
+
+                if (@available(iOS 11, *)) {
+                    bottomInset -= self.textFieldView.safeAreaInsets.bottom;
+                }
+
                 UIEdgeInsets newContentInset = textView.contentInset;
-                newContentInset.bottom = self.textFieldView.frame.size.height-textViewHeight;
+                newContentInset.bottom = bottomInset;
+
                 self.isTextViewContentInsetChanged = YES;
 
                 if (UIEdgeInsetsEqualToEdgeInsets(textView.contentInset, newContentInset) == NO)
@@ -1361,8 +1403,8 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
     CFTimeInterval startTime = CACurrentMediaTime();
     [self showLog:[NSString stringWithFormat:@"****** %@ started ******",NSStringFromSelector(_cmd)] indentation:1];
 
-    //Commented due to #56. Added all the conditions below to handle UIWebView's textFields.    (Bug ID: #56)
-    //  We are unable to get textField object while keyboard showing on UIWebView's textField.  (Bug ID: #11)
+    //Commented due to #56. Added all the conditions below to handle WKWebView's textFields.    (Bug ID: #56)
+    //  We are unable to get textField object while keyboard showing on WKWebView's textField.  (Bug ID: #11)
 //    if (_textFieldView == nil)   return;
 
     //Restoring the contentOffset of the lastScrollView
@@ -1498,7 +1540,7 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
 	if ([self privateIsEnableAutoToolbar])
     {
         //UITextView special case. Keyboard Notification is firing before textView notification so we need to reload it's inputViews.
-        if ([textFieldView isKindOfClass:[UITextView class]] &&
+        if ([textFieldView respondsToSelector:@selector(isEditable)] && [textFieldView isKindOfClass:[UIScrollView class]] &&
             textFieldView.inputAccessoryView == nil)
         {
             __weak __typeof__(self) weakSelf = self;
@@ -1592,9 +1634,9 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
 
     // We check if there's a change in original frame or not.
     if(_isTextViewContentInsetChanged == YES &&
-       [textFieldView isKindOfClass:[UITextView class]])
+       [textFieldView respondsToSelector:@selector(isEditable)] && [textFieldView isKindOfClass:[UIScrollView class]])
     {
-        UITextView *textView = (UITextView*)textFieldView;
+        UIScrollView *textView = (UIScrollView*)textFieldView;
         self.isTextViewContentInsetChanged = NO;
         if (UIEdgeInsetsEqualToEdgeInsets(textView.contentInset, self.startingTextViewContentInsets) == NO)
         {
@@ -1657,9 +1699,9 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
 
     //If textViewContentInsetChanged is changed then restore it.
     if (_isTextViewContentInsetChanged == YES &&
-        [_textFieldView isKindOfClass:[UITextView class]])
+        [_textFieldView respondsToSelector:@selector(isEditable)] && [_textFieldView isKindOfClass:[UIScrollView class]])
     {
-        UITextView *textView = (UITextView*)_textFieldView;
+        UIScrollView *textView = (UIScrollView*)_textFieldView;
         self.isTextViewContentInsetChanged = NO;
         if (UIEdgeInsetsEqualToEdgeInsets(textView.contentInset, self.startingTextViewContentInsets) == NO)
         {
@@ -1957,14 +1999,14 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
             }
 
             //    If only one object is found, then adding only Done button.
-            if ((siblings.count==1 && self.previousNextDisplayMode == IQPreviousNextDisplayModeDefault) || self.previousNextDisplayMode == IQPreviousNextDisplayModeAlwaysHide)
+            if ((siblings.count <= 1 && self.previousNextDisplayMode == IQPreviousNextDisplayModeDefault) || self.previousNextDisplayMode == IQPreviousNextDisplayModeAlwaysHide)
             {
                 [textField addKeyboardToolbarWithTarget:self titleText:(_shouldShowToolbarPlaceholder ? textField.drawingToolbarPlaceholder : nil) rightBarButtonConfiguration:rightConfiguration previousBarButtonConfiguration:nil nextBarButtonConfiguration:nil];
 
                 textField.inputAccessoryView.tag = kIQDoneButtonToolbarTag; //  (Bug ID: #78)
             }
             //If there is multiple siblings of textField
-            else if ((siblings.count && self.previousNextDisplayMode == IQPreviousNextDisplayModeDefault) || self.previousNextDisplayMode == IQPreviousNextDisplayModeAlwaysShow)
+            else if ((self.previousNextDisplayMode == IQPreviousNextDisplayModeDefault) || self.previousNextDisplayMode == IQPreviousNextDisplayModeAlwaysShow)
             {
                 IQBarButtonItemConfiguration *prevConfiguration = nil;
                 
@@ -2010,12 +2052,25 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
             //Bar style according to keyboard appearance
             if ([textField respondsToSelector:@selector(keyboardAppearance)])
             {
+                //Setting toolbar tintColor //  (Enhancement ID: #30)
+                if (_shouldToolbarUsesTextFieldTintColor)
+                {
+                    toolbar.tintColor = [textField tintColor];
+                }
+                else if (_toolbarTintColor)
+                {
+                    toolbar.tintColor = _toolbarTintColor;
+                }
+                else
+                {
+                    toolbar.tintColor = nil;
+                }
+
                 switch ([textField keyboardAppearance])
                 {
                     case UIKeyboardAppearanceDark:
                     {
                         toolbar.barStyle = UIBarStyleBlack;
-                        [toolbar setTintColor:[UIColor whiteColor]];
                         [toolbar setBarTintColor:nil];
                     }
                         break;
@@ -2023,20 +2078,6 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
                     {
                         toolbar.barStyle = UIBarStyleDefault;
                         toolbar.barTintColor = _toolbarBarTintColor;
-
-                        //Setting toolbar tintColor //  (Enhancement ID: #30)
-                        if (_shouldToolbarUsesTextFieldTintColor)
-                        {
-                            toolbar.tintColor = [textField tintColor];
-                        }
-                        else if (_toolbarTintColor)
-                        {
-                            toolbar.tintColor = _toolbarTintColor;
-                        }
-                        else
-                        {
-                            toolbar.tintColor = [UIColor blackColor];
-                        }
                     }
                         break;
                 }
@@ -2060,15 +2101,13 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
                     }
 
                     //Setting toolbar title color.   //  (Enhancement ID: #880)
-                    if (_placeholderColor &&
-                        [_placeholderColor isKindOfClass:[UIColor class]])
+                    if (_placeholderColor)
                     {
                         [toolbar.titleBarButton setTitleColor:_placeholderColor];
                     }
 
                     //Setting toolbar button title color.   //  (Enhancement ID: #880)
-                    if (_placeholderButtonColor &&
-                        [_placeholderButtonColor isKindOfClass:[UIColor class]])
+                    if (_placeholderButtonColor)
                     {
                         [toolbar.titleBarButton setSelectableTitleColor:_placeholderButtonColor];
                     }
@@ -2284,8 +2323,6 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
   didBeginEditingNotificationName:(nonnull NSString *)didBeginEditingNotificationName
     didEndEditingNotificationName:(nonnull NSString *)didEndEditingNotificationName
 {
-    [_registeredClasses addObject:aClass];
-    
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldViewDidBeginEditing:) name:didBeginEditingNotificationName object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldViewDidEndEditing:) name:didEndEditingNotificationName object:nil];
 }
@@ -2297,8 +2334,6 @@ NSInteger const kIQPreviousNextButtonToolbarTag     =   -1005;
     didBeginEditingNotificationName:(nonnull NSString *)didBeginEditingNotificationName
       didEndEditingNotificationName:(nonnull NSString *)didEndEditingNotificationName
 {
-    [_registeredClasses removeObject:aClass];
-    
     [[NSNotificationCenter defaultCenter] removeObserver:self name:didBeginEditingNotificationName object:nil];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:didEndEditingNotificationName object:nil];
 }

+ 19 - 25
HappyWork/Pods/IQKeyboardManager/IQKeyboardManager/IQKeyboardReturnKeyHandler.m

@@ -125,17 +125,16 @@
     
     if (modal)
     {
-        if ([view isKindOfClass:[UITextField class]])
+        UITextField *textField = (UITextField*)view;
+
+        if ([view respondsToSelector:@selector(setReturnKeyType:)])
         {
-            UITextField *textField = (UITextField*)view;
             textField.returnKeyType = modal.originalReturnKeyType;
-            textField.delegate = modal.textFieldDelegate;
         }
-        else if ([view isKindOfClass:[UITextView class]])
+
+        if ([view respondsToSelector:@selector(setDelegate:)])
         {
-            UITextView *textView = (UITextView*)view;
-            textView.returnKeyType = modal.originalReturnKeyType;
-            textView.delegate = modal.textViewDelegate;
+            textField.delegate = modal.textFieldDelegate;
         }
         
         [textFieldInfoCache removeObject:modal];
@@ -146,19 +145,17 @@
 {
     IQTextFieldViewInfoModal *modal = [[IQTextFieldViewInfoModal alloc] initWithTextFieldView:view textFieldDelegate:nil textViewDelegate:nil originalReturnKey:UIReturnKeyDefault];
     
-    if ([view isKindOfClass:[UITextField class]])
+    UITextField *textField = (UITextField*)view;
+
+    if ([view respondsToSelector:@selector(setReturnKeyType:)])
     {
-        UITextField *textField = (UITextField*)view;
         modal.originalReturnKeyType = textField.returnKeyType;
-        modal.textFieldDelegate = textField.delegate;
-        [textField setDelegate:self];
     }
-    else if ([view isKindOfClass:[UITextView class]])
+
+    if ([view respondsToSelector:@selector(setDelegate:)])
     {
-        UITextView *textView = (UITextView*)view;
-        modal.originalReturnKeyType = textView.returnKeyType;
-        modal.textViewDelegate = textView.delegate;
-        [textView setDelegate:self];
+        modal.textFieldDelegate = textField.delegate;
+        [textField setDelegate:self];
     }
 
     [textFieldInfoCache addObject:modal];
@@ -599,19 +596,16 @@
 {
     for (IQTextFieldViewInfoModal *modal in textFieldInfoCache)
     {
-        UIView *textFieldView = modal.textFieldView;
-        if ([textFieldView isKindOfClass:[UITextField class]])
+        UITextField *textField = (UITextField*)modal.textFieldView;
+
+        if ([textField respondsToSelector:@selector(setReturnKeyType:)])
         {
-            UITextField *textField = (UITextField*)textFieldView;
             textField.returnKeyType = modal.originalReturnKeyType;
-            textField.delegate = modal.textFieldDelegate
-            ;
         }
-        else if ([textFieldView isKindOfClass:[UITextView class]])
+
+        if ([textField respondsToSelector:@selector(setDelegate:)])
         {
-            UITextView *textView = (UITextView*)textFieldView;
-            textView.returnKeyType = modal.originalReturnKeyType;
-            textView.delegate = modal.textViewDelegate;
+            textField.delegate = modal.textFieldDelegate;
         }
     }
 

+ 10 - 1
HappyWork/Pods/IQKeyboardManager/IQKeyboardManager/IQTextView/IQTextView.m

@@ -165,7 +165,16 @@
         _placeholderLabel.font = self.font;
         _placeholderLabel.textAlignment = self.textAlignment;
         _placeholderLabel.backgroundColor = [UIColor clearColor];
-        _placeholderLabel.textColor = [UIColor colorWithWhite:0.7 alpha:1.0];
+        #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
+            if (@available(iOS 13.0, *)) {
+                _placeholderLabel.textColor = [UIColor systemGrayColor];
+            } else
+        #endif
+            {
+        #if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
+                _placeholderLabel.textColor = [UIColor lightTextColor];
+        #endif
+            }
         _placeholderLabel.alpha = 0;
         [self addSubview:_placeholderLabel];
     }

+ 20 - 2
HappyWork/Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.m

@@ -48,7 +48,16 @@
         _titleButton = [UIButton buttonWithType:UIButtonTypeSystem];
         _titleButton.enabled = NO;
         _titleButton.titleLabel.numberOfLines = 3;
-        [_titleButton setTitleColor:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
+        #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
+        if (@available(iOS 13.0, *)) {
+            [_titleButton setTitleColor:[UIColor systemBlueColor] forState:UIControlStateNormal];
+        } else
+        #endif
+        {
+        #if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
+            [_titleButton setTitleColor:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
+        #endif
+        }
         [_titleButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
         [_titleButton setBackgroundColor:[UIColor clearColor]];
         [_titleButton.titleLabel setTextAlignment:NSTextAlignmentCenter];
@@ -119,7 +128,16 @@
 -(void)setSelectableTitleColor:(UIColor*)selectableTitleColor
 {
     _selectableTitleColor = selectableTitleColor;
-    [_titleButton setTitleColor:_selectableTitleColor?:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
+    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
+    if (@available(iOS 13.0, *)) {
+        [_titleButton setTitleColor:_selectableTitleColor?:[UIColor systemBlueColor] forState:UIControlStateNormal];
+    } else
+    #endif
+    {
+    #if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
+        [_titleButton setTitleColor:_selectableTitleColor?:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
+    #endif
+    }
 }
 
 -(void)setInvocation:(NSInvocation *)invocation

+ 0 - 23
HappyWork/Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQToolbar.m

@@ -29,12 +29,6 @@
 #import <UIKit/UIAccessibility.h>
 #import <UIKit/UIViewController.h>
 
-@interface IQTitleBarButtonItem (PrivateAccessor)
-
-@property(nonnull, nonatomic, strong) UIButton *titleButton;
-
-@end
-
 @implementation IQToolbar
 @synthesize previousBarButton = _previousBarButton;
 @synthesize nextBarButton = _nextBarButton;
@@ -162,23 +156,6 @@
     return sizeThatFit;
 }
 
--(void)setBarStyle:(UIBarStyle)barStyle
-{
-    [super setBarStyle:barStyle];
-    
-    if (self.titleBarButton.selectableTitleColor == nil)
-    {
-        if (barStyle == UIBarStyleDefault)
-        {
-            [self.titleBarButton.titleButton setTitleColor:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
-        }
-        else
-        {
-            [self.titleBarButton.titleButton setTitleColor:[UIColor yellowColor] forState:UIControlStateNormal];
-        }
-    }
-}
-
 -(void)setTintColor:(UIColor *)tintColor
 {
     [super setTintColor:tintColor];

+ 4 - 1
HappyWork/Pods/IQKeyboardManager/IQKeyboardManager/IQToolbar/IQUIView+IQKeyboardToolbar.m

@@ -30,6 +30,7 @@
 
 #import <UIKit/UIImage.h>
 #import <UIKit/UILabel.h>
+#import <UIKit/UIScreen.h>
 #import <UIKit/UIAccessibility.h>
 
 @implementation IQBarButtonItemConfiguration
@@ -231,7 +232,9 @@
         
         if (keyboardToolbar == nil)
         {
-            keyboardToolbar = [[IQToolbar alloc] init];
+            CGRect frame = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, 44);
+
+            keyboardToolbar = [[IQToolbar alloc] initWithFrame:frame];
             
             objc_setAssociatedObject(self, @selector(keyboardToolbar), keyboardToolbar, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
         }

+ 6 - 6
HappyWork/Pods/Manifest.lock

@@ -16,7 +16,7 @@ PODS:
     - AFNetworking/NSURLSession
   - DZNEmptyDataSet (1.8.1)
   - FLAnimatedImage (1.0.12)
-  - IQKeyboardManager (6.4.0)
+  - IQKeyboardManager (6.5.0)
   - Masonry (1.1.0)
   - MJExtension (3.1.2)
   - MJRefresh (3.2.0)
@@ -35,7 +35,7 @@ PODS:
 DEPENDENCIES:
   - AFNetworking (~> 3.2.1)
   - DZNEmptyDataSet (~> 1.8.1)
-  - IQKeyboardManager (~> 6.4.0)
+  - IQKeyboardManager (~> 6.5.0)
   - Masonry (~> 1.1.0)
   - MJExtension (~> 3.1.2)
   - MJRefresh (~> 3.2.0)
@@ -50,7 +50,6 @@ SPEC REPOS:
   https://github.com/CocoaPods/Specs.git:
     - AFNetworking
     - DZNEmptyDataSet
-    - IQKeyboardManager
     - Masonry
     - MJExtension
     - MJRefresh
@@ -61,13 +60,14 @@ SPEC REPOS:
     - YTKNetwork
   trunk:
     - FLAnimatedImage
+    - IQKeyboardManager
     - XHLaunchAd
 
 SPEC CHECKSUMS:
   AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
   DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
   FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
-  IQKeyboardManager: fcef267266379c003181fc3592f6bdb8bf4db839
+  IQKeyboardManager: 700e5155d6a292383b54e8678aec769e14fc78fc
   Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   MJExtension: 81e8e411ced318561dd09334b0c83d8227cef79c
   MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437
@@ -78,6 +78,6 @@ SPEC CHECKSUMS:
   XHLaunchAd: 45048592af01aa501c9d2d0c45e95ca74c4d0596
   YTKNetwork: df8a7a5597bda1664a4efaa7ef871a818a887fe0
 
-PODFILE CHECKSUM: 7d09d12202dd4291a7d43a31cfe1122a2d391244
+PODFILE CHECKSUM: 00117b36bed6c581c51990f8a8bffa6e72d083c2
 
-COCOAPODS: 1.8.3
+COCOAPODS: 1.8.4

+ 1 - 1
HappyWork/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-Info.plist

@@ -15,7 +15,7 @@
   <key>CFBundlePackageType</key>
   <string>FMWK</string>
   <key>CFBundleShortVersionString</key>
-  <string>6.4.0</string>
+  <string>6.5.0</string>
   <key>CFBundleSignature</key>
   <string>????</string>
   <key>CFBundleVersion</key>

+ 1 - 1
HappyWork/podfile

@@ -9,7 +9,7 @@ target 'HappyWork' do
 
 pod 'Masonry', '~> 1.1.0'
 pod 'SVProgressHUD', '~> 2.2.5'
-pod 'IQKeyboardManager', '~> 6.4.0'
+pod 'IQKeyboardManager', '~> 6.5.0'
 pod 'SDCycleScrollView', '~> 1.80'
 pod 'SDWebImage', '~> 5.0.6'
 pod 'AFNetworking', '~> 3.2.1'