mirror of
https://github.com/HackPlan/IQKeyboardManager.git
synced 2026-06-17 02:25:14 +08:00
Added a default IQPreviousNextView
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
4C631B161CB24A8E0078E59F /* IQPreviousNextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C631B151CB24A8E0078E59F /* IQPreviousNextView.m */; };
|
||||
4C631B181CB24AAD0078E59F /* IQPreviousNextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C631B171CB24AAD0078E59F /* IQPreviousNextView.swift */; };
|
||||
4C7FCC271C6A507E00537BA0 /* IQUIScrollView+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FCC261C6A507E00537BA0 /* IQUIScrollView+Additions.m */; };
|
||||
4C7FCC291C6A57FF00537BA0 /* IQUIScrollView+Additions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FCC281C6A57FF00537BA0 /* IQUIScrollView+Additions.swift */; };
|
||||
4CE611A01B98B7250020591A /* DemoObjCUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE6119F1B98B7250020591A /* DemoObjCUITests.m */; };
|
||||
@@ -102,6 +104,9 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
4C631B141CB24A8E0078E59F /* IQPreviousNextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IQPreviousNextView.h; sourceTree = "<group>"; };
|
||||
4C631B151CB24A8E0078E59F /* IQPreviousNextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IQPreviousNextView.m; sourceTree = "<group>"; };
|
||||
4C631B171CB24AAD0078E59F /* IQPreviousNextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IQPreviousNextView.swift; sourceTree = "<group>"; };
|
||||
4C7FCC251C6A507E00537BA0 /* IQUIScrollView+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IQUIScrollView+Additions.h"; sourceTree = "<group>"; };
|
||||
4C7FCC261C6A507E00537BA0 /* IQUIScrollView+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IQUIScrollView+Additions.m"; sourceTree = "<group>"; };
|
||||
4C7FCC281C6A57FF00537BA0 /* IQUIScrollView+Additions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "IQUIScrollView+Additions.swift"; sourceTree = "<group>"; };
|
||||
@@ -332,6 +337,7 @@
|
||||
4CEC3A661B8CECDF00909DCA /* IQTitleBarButtonItem.swift */,
|
||||
4CEC3A671B8CECDF00909DCA /* IQToolbar.swift */,
|
||||
4CEC3A681B8CECDF00909DCA /* IQUIView+IQKeyboardToolbar.swift */,
|
||||
4C631B171CB24AAD0078E59F /* IQPreviousNextView.swift */,
|
||||
);
|
||||
path = IQToolbar;
|
||||
sourceTree = "<group>";
|
||||
@@ -670,6 +676,8 @@
|
||||
C0CB62371B8850AE00C33368 /* IQToolbar.m */,
|
||||
C0CB62381B8850AE00C33368 /* IQUIView+IQKeyboardToolbar.h */,
|
||||
C0CB62391B8850AE00C33368 /* IQUIView+IQKeyboardToolbar.m */,
|
||||
4C631B141CB24A8E0078E59F /* IQPreviousNextView.h */,
|
||||
4C631B151CB24A8E0078E59F /* IQPreviousNextView.m */,
|
||||
);
|
||||
path = IQToolbar;
|
||||
sourceTree = "<group>";
|
||||
@@ -865,6 +873,7 @@
|
||||
4CEC3A6C1B8CECDF00909DCA /* IQUITextFieldView+Additions.swift in Sources */,
|
||||
C0CB61F41B884F2700C33368 /* TableViewInContainerViewController.swift in Sources */,
|
||||
4CEC3A741B8CECDF00909DCA /* IQTextView.swift in Sources */,
|
||||
4C631B181CB24AAD0078E59F /* IQPreviousNextView.swift in Sources */,
|
||||
C0CB61F91B884F2700C33368 /* WebViewController.swift in Sources */,
|
||||
C0CB61F51B884F2700C33368 /* TextFieldViewController.swift in Sources */,
|
||||
C03C87F91B8DCEC400295DFA /* NavigationTableViewCell.swift in Sources */,
|
||||
@@ -893,6 +902,7 @@
|
||||
C0CB62051B884FA100C33368 /* CollectionViewDemoController.m in Sources */,
|
||||
C0CB61FF1B884FA100C33368 /* OptionTableViewCell.m in Sources */,
|
||||
C0CB620D1B884FA100C33368 /* SettingsViewController.m in Sources */,
|
||||
4C631B161CB24A8E0078E59F /* IQPreviousNextView.m in Sources */,
|
||||
C0CB62461B8850AE00C33368 /* IQBarButtonItem.m in Sources */,
|
||||
C0CB62081B884FA100C33368 /* ExampleTableViewController.m in Sources */,
|
||||
C0CB61FD1B884FA100C33368 /* AppDelegate.m in Sources */,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
[super viewDidLoad];
|
||||
|
||||
returnHandler = [[IQKeyboardReturnKeyHandler alloc] initWithViewController:self];
|
||||
|
||||
returnHandler.lastTextFieldReturnKeyType = UIReturnKeyDone;
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#import "IQUIScrollView+Additions.h"
|
||||
#import "IQUITextFieldView+Additions.h"
|
||||
#import "IQUIViewController+Additions.h"
|
||||
#import "IQPreviousNextView.h"
|
||||
|
||||
#import <UIKit/UINavigationBar.h>
|
||||
#import <UIKit/UITapGestureRecognizer.h>
|
||||
@@ -232,9 +233,12 @@ void _IQShowLog(NSString *logString);
|
||||
//Initializing disabled classes Set.
|
||||
strongSelf.disabledDistanceHandlingClasses = [[NSMutableSet alloc] initWithObjects:[UITableViewController class], nil];
|
||||
strongSelf.enabledDistanceHandlingClasses = [[NSMutableSet alloc] init];
|
||||
|
||||
strongSelf.disabledToolbarClasses = [[NSMutableSet alloc] init];
|
||||
strongSelf.enabledToolbarClasses = [[NSMutableSet alloc] init];
|
||||
strongSelf.toolbarPreviousNextAllowedClasses = [[NSMutableSet alloc] initWithObjects:[UITableView class],[UICollectionView class], nil];
|
||||
|
||||
strongSelf.toolbarPreviousNextAllowedClasses = [[NSMutableSet alloc] initWithObjects:[UITableView class],[UICollectionView class],[IQPreviousNextView class], nil];
|
||||
|
||||
strongSelf.disabledTouchResignedClasses = [[NSMutableSet alloc] init];
|
||||
strongSelf.enabledTouchResignedClasses = [[NSMutableSet alloc] init];
|
||||
|
||||
|
||||
31
IQKeyboardManager/IQToolbar/IQPreviousNextView.h
Normal file
31
IQKeyboardManager/IQToolbar/IQPreviousNextView.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// IQPreviousNextView.h
|
||||
// https://github.com/hackiftekhar/IQKeyboardManager
|
||||
// Copyright (c) 2013-16 Iftekhar Qurashi.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
/**
|
||||
If you need to enable previous/next toolbar button with some complex hierarchy where your textFields are not in same view, then make the top view as IQPreviousNextView.
|
||||
*/
|
||||
@interface IQPreviousNextView : UIView
|
||||
|
||||
@end
|
||||
28
IQKeyboardManager/IQToolbar/IQPreviousNextView.m
Normal file
28
IQKeyboardManager/IQToolbar/IQPreviousNextView.m
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// IQPreviousNextView.m
|
||||
// https://github.com/hackiftekhar/IQKeyboardManager
|
||||
// Copyright (c) 2013-16 Iftekhar Qurashi.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "IQPreviousNextView.h"
|
||||
|
||||
@implementation IQPreviousNextView
|
||||
|
||||
@end
|
||||
@@ -801,7 +801,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate {
|
||||
disabledDistanceHandlingClasses.insert(NSStringFromClass(UITableViewController))
|
||||
toolbarPreviousNextAllowedClasses.insert(NSStringFromClass(UITableView))
|
||||
toolbarPreviousNextAllowedClasses.insert(NSStringFromClass(UICollectionView))
|
||||
|
||||
toolbarPreviousNextAllowedClasses.insert(NSStringFromClass(IQPreviousNextView))
|
||||
//Workaround to load all appearance proxies at startup
|
||||
let barButtonItem2 = IQTitleBarButtonItem()
|
||||
barButtonItem2.title = ""
|
||||
@@ -1369,7 +1369,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate {
|
||||
if _textFieldView != nil && _textFieldView?.isAlertViewTextField() == false {
|
||||
|
||||
//Getting textField viewController
|
||||
if let textFieldViewController = _textFieldView?.viewController() {
|
||||
if _textFieldView?.viewController() != nil {
|
||||
|
||||
// keyboard is already showing. adjust frame.
|
||||
adjustFrame()
|
||||
|
||||
28
IQKeyboardManagerSwift/IQToolbar/IQPreviousNextView.swift
Normal file
28
IQKeyboardManagerSwift/IQToolbar/IQPreviousNextView.swift
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// IQPreviousNextView.swift
|
||||
// https://github.com/hackiftekhar/IQKeyboardManager
|
||||
// Copyright (c) 2013-16 Iftekhar Qurashi.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
import Cocoa
|
||||
|
||||
class IQPreviousNextView: UIView {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user