Skip to content

Commit 634cc34

Browse files
committed
Added methods to register ViewController for disabling library #117, #139 and enabling toolbar previous/next for CustomView #154, #179.
Former-commit-id: bda4c62
1 parent c8c7008 commit 634cc34

32 files changed

+241
-219
lines changed

IQKeyBoardManager/Categories/IQNSArray+Sort.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@
2323

2424
#import <Foundation/NSArray.h>
2525

26-
/*!
26+
/**
2727
@category NSArray (IQ_NSArray_Sort)
2828
2929
@abstract UIView.subviews sorting category.
3030
*/
3131
@interface NSArray (IQ_NSArray_Sort)
3232

33-
/*!
33+
/**
3434
@method sortedArrayByTag
3535
3636
@return Returns the array by sorting the UIView's by their tag property.
3737
*/
3838
- (NSArray*)sortedArrayByTag;
3939

40-
/*!
40+
/**
4141
@method sortedArrayByTag
4242
4343
@return Returns the array by sorting the UIView's by their tag property.

IQKeyBoardManager/Categories/IQUIView+Hierarchy.h

+18-32
Original file line numberDiff line numberDiff line change
@@ -26,105 +26,91 @@
2626

2727
@class UICollectionView, UIScrollView, UITableView, NSArray;
2828

29-
/*!
29+
/**
3030
@category UIView (IQ_UIView_Hierarchy)
3131
3232
@abstract UIView hierarchy category.
3333
*/
3434
@interface UIView (IQ_UIView_Hierarchy)
3535

36-
/*!
36+
/**
3737
@property isAskingCanBecomeFirstResponder
3838
3939
@abstract Returns YES if IQKeyboardManager asking for `canBecomeFirstResponder. Useful when doing custom work in `textFieldShouldBeginEditing:` delegate.
4040
*/
4141
@property (nonatomic, readonly) BOOL isAskingCanBecomeFirstResponder;
4242

43-
/*!
43+
/**
4444
@property viewController
4545
4646
@abstract Returns the UIViewController object that manages the receiver.
4747
*/
4848
@property (nonatomic, readonly, strong) UIViewController *viewController;
4949

50-
/*!
50+
/**
5151
@property topMostController
5252
5353
@abstract Returns the topMost UIViewController object in hierarchy.
5454
*/
5555
@property (nonatomic, readonly, strong) UIViewController *topMostController;
5656

57-
/*!
58-
@property superScrollView
57+
/**
58+
@method superviewOfClassType:
5959
60-
@abstract Returns the UIScrollView object if any found in view's upper hierarchy.
60+
@return Returns the superView of provided class type.
6161
*/
62-
@property (nonatomic, readonly, strong) UIScrollView *superScrollView;
62+
-(UIView*)superviewOfClassType:(Class)classType;
6363

64-
/*!
65-
@property superTableView
66-
67-
@abstract Returns the UITableView object if any found in view's upper hierarchy.
68-
*/
69-
@property (nonatomic, readonly, strong) UITableView *superTableView;
70-
71-
/*!
72-
@property superCollectionView
73-
74-
@abstract Returns the UICollectionView object if any found in view's upper hierarchy.
75-
*/
76-
@property (nonatomic, readonly, strong) UICollectionView *superCollectionView NS_AVAILABLE_IOS(6_0);
77-
78-
/*!
64+
/**
7965
@property responderSiblings
8066
8167
@abstract returns all siblings of the receiver which canBecomeFirstResponder.
8268
*/
8369
@property (nonatomic, readonly, copy) NSArray *responderSiblings;
8470

85-
/*!
71+
/**
8672
@property deepResponderViews
8773
8874
@abstract returns all deep subViews of the receiver which canBecomeFirstResponder.
8975
*/
9076
@property (nonatomic, readonly, copy) NSArray *deepResponderViews;
9177

92-
/*!
78+
/**
9379
@property isSearchBarTextField
9480
9581
@abstract returns YES if the receiver object is UISearchBarTextField, otherwise return NO.
9682
*/
9783
@property (nonatomic, getter=isSearchBarTextField, readonly) BOOL searchBarTextField;
9884

99-
/*!
85+
/**
10086
@property isAlertViewTextField
10187
10288
@abstract returns YES if the receiver object is UIAlertSheetTextField, otherwise return NO.
10389
*/
10490
@property (nonatomic, getter=isAlertViewTextField, readonly) BOOL alertViewTextField;
10591

106-
/*!
92+
/**
10793
@method convertTransformToView
10894
10995
@return returns current view transform with respect to the 'toView'.
11096
*/
11197
-(CGAffineTransform)convertTransformToView:(UIView*)toView;
11298

113-
/*!
99+
/**
114100
@property subHierarchy
115101
116102
@abstract Returns a string that represent the information about it's subview's hierarchy. You can use this method to debug the subview's positions.
117103
*/
118104
@property (nonatomic, readonly, copy) NSString *subHierarchy;
119105

120-
/*!
106+
/**
121107
@property superHierarchy
122108
123109
@abstract Returns an string that represent the information about it's upper hierarchy. You can use this method to debug the superview's positions.
124110
*/
125111
@property (nonatomic, readonly, copy) NSString *superHierarchy;
126112

127-
/*!
113+
/**
128114
@property debugHierarchy
129115
130116
@abstract Returns an string that represent the information about it's frame positions. You can use this method to debug self positions.
@@ -134,7 +120,7 @@
134120
@end
135121

136122

137-
/*!
123+
/**
138124
@category UIView (IQ_UIView_Frame)
139125
140126
@abstract UIView frame category.
@@ -154,7 +140,7 @@
154140

155141
@interface NSObject (IQ_Logging)
156142

157-
/*!
143+
/**
158144
@property _IQDescription
159145
160146
@abstract Short description for logging purpose.

IQKeyBoardManager/Categories/IQUIView+Hierarchy.m

+6-35
Original file line numberDiff line numberDiff line change
@@ -119,47 +119,18 @@ -(UIViewController *)topMostController
119119
return (UIViewController*)matchController;
120120
}
121121

122-
- (UITableView*)superTableView
122+
-(UIView*)superviewOfClassType:(Class)classType
123123
{
124124
UIView *superview = self.superview;
125125

126126
while (superview)
127127
{
128-
if ([superview isKindOfClass:[UITableView class]])
128+
if ([superview isKindOfClass:classType] &&
129+
([superview isKindOfClass:UITableViewCellScrollViewClass] == NO) &&
130+
([superview isKindOfClass:UITableViewWrapperViewClass] == NO) &&
131+
([superview isKindOfClass:UIQueuingScrollViewClass] == NO))
129132
{
130-
return (UITableView*)superview;
131-
}
132-
else superview = superview.superview;
133-
}
134-
135-
return nil;
136-
}
137-
138-
-(UICollectionView *)superCollectionView
139-
{
140-
UIView *superview = self.superview;
141-
142-
while (superview)
143-
{
144-
if ([superview isKindOfClass:[UICollectionView class]])
145-
{
146-
return (UICollectionView*)superview;
147-
}
148-
else superview = superview.superview;
149-
}
150-
151-
return nil;
152-
}
153-
154-
- (UIScrollView*)superScrollView
155-
{
156-
UIView *superview = self.superview;
157-
158-
while (superview)
159-
{
160-
if ([superview isKindOfClass:[UIScrollView class]] && ([superview isKindOfClass:UITableViewCellScrollViewClass] == NO) && ([superview isKindOfClass:UITableViewWrapperViewClass] == NO) && ([superview isKindOfClass:UIQueuingScrollViewClass] == NO))
161-
{
162-
return (UIScrollView*)superview;
133+
return superview;
163134
}
164135
else superview = superview.superview;
165136
}

IQKeyBoardManager/Categories/IQUIWindow+Hierarchy.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525

2626
@class UIViewController;
2727

28-
/*!
28+
/**
2929
@category UIWindow (IQ_UIWindow_Hierarchy)
3030
3131
@abstract UIWindow hierarchy category.
3232
*/
3333
@interface UIWindow (IQ_UIWindow_Hierarchy)
3434

35-
/*!
35+
/**
3636
@method topMostController
3737
3838
@return Returns the current Top Most ViewController in hierarchy.
3939
*/
4040
@property (nonatomic, readonly, strong) UIViewController *topMostController;
4141

42-
/*!
42+
/**
4343
@method currentViewController
4444
4545
@return Returns the topViewController in stack of topMostController.

IQKeyBoardManager/Constants/IQKeyboardManagerConstants.h

+11-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
/* Set IQKEYBOARDMANAGER_DEBUG=1 in preprocessor macros under build settings to enable debugging.*/
3030

31-
/*!
31+
/**
3232
@enum IQAutoToolbarManageBehaviour
3333
3434
@abstract AutoToolbar manage settings.
@@ -41,15 +41,23 @@
4141
*/
4242

4343
#ifndef NS_ENUM
44-
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
45-
#endif
44+
45+
typedef enum IQAutoToolbarManageBehaviour {
46+
IQAutoToolbarBySubviews,
47+
IQAutoToolbarByTag,
48+
IQAutoToolbarByPosition,
49+
}IQAutoToolbarManageBehaviour;
50+
51+
#else
4652

4753
typedef NS_ENUM(NSInteger, IQAutoToolbarManageBehaviour) {
4854
IQAutoToolbarBySubviews,
4955
IQAutoToolbarByTag,
5056
IQAutoToolbarByPosition,
5157
};
5258

59+
#endif
60+
5361
#define IQLocalizedString(key, comment) [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"IQKeyboardManager" ofType:@"bundle"]] localizedStringForKey:(key) value:@"" table:@"IQKeyboardManager"]
5462

5563
#endif

IQKeyBoardManager/Constants/IQKeyboardManagerConstantsInternal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#endif
4040

4141

42-
/*! https://github.com/kif-framework/KIF/blob/master/Additions/LoadableCategory.h
42+
/** https://github.com/kif-framework/KIF/blob/master/Additions/LoadableCategory.h
4343
4444
@discussion To load categories in the current file loadable without using "-load-all" flag. When we try to create framework or library the compilers skips linking files that contain only categories. So use this macro to add a dummy class, which causes the linker to add the file. You will also need to add "-ObjC" to the "Other Linker Flags" build setting in any project that uses the framework.
4545

0 commit comments

Comments
 (0)