Skip to content

Commit

Permalink
Added demo for 'preventShowingBottomBlankSpace' #93.
Browse files Browse the repository at this point in the history
Former-commit-id: aa3bac7
  • Loading branch information
hackiftekhar committed Oct 15, 2014
1 parent 80f37a8 commit 341019c
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 6 deletions.
2 changes: 1 addition & 1 deletion IQKeyBoardManager/IQKeyboardManager.m.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cc3cc5ccd2dfe840941dc6b5a245d289c2891158
18a26f06a720b48ed1d4ceed371f563dab825416
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6af4568c358356e390946138c145b979447d7314
f9c34d1b01f3acd8f344e58c447b3369dd725e01
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8a647445935c0a7373189364dbab8d5ce934c800
a88ff880e57a9f5e84bfc8da62abf5284bf80ac0
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,37 @@
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../IQKeyBoardManager/IQKeyboardManager.m"
timestampString = "435086539.997263"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "748"
endingLineNumber = "748"
landmarkName = "-keyboardDidHide:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../IQKeyBoardManager/IQKeyboardManager.m"
timestampString = "435086543.480972"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "735"
endingLineNumber = "735"
landmarkName = "-keyboardWillHide:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d60c0b13e68ca2179edd43fa9e1d344a1da129dd
405469a002cd5f0ade289f5c1d0d37720558c310
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// BottomBlankSpaceViewController.h
// IQKeyboard
//
// Created by Iftekhar on 15/10/14.
// Copyright (c) 2014 Iftekhar. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BottomBlankSpaceViewController : UIViewController

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// BottomBlankSpaceViewController.m
// IQKeyboard
//
// Created by Iftekhar on 15/10/14.
// Copyright (c) 2014 Iftekhar. All rights reserved.
//

#import "BottomBlankSpaceViewController.h"
#import "IQKeyboardManager.h"

@implementation BottomBlankSpaceViewController
{
IBOutlet UISwitch *switchPreventShowingBottomBlankSpace;
}

-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

switchPreventShowingBottomBlankSpace.on = [[IQKeyboardManager sharedManager] preventShowingBottomBlankSpace];
}

- (IBAction)preventSwitchAction:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setPreventShowingBottomBlankSpace:switchPreventShowingBottomBlankSpace.on];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ - (void)viewDidLoad
@"Animation handling"];


keyboardManagerProperties = @[@[@"Enable",@"Keyboard Distance From TextField"],
keyboardManagerProperties = @[@[@"Enable", @"Keyboard Distance From TextField", @"Prevent Showing Bottom Blank Space"],
@[@"Enable Auto Toolbar",@"Toolbar Manage Behaviour",@"Should Toolbar Uses TextField TintColor",@"Should Show TextField Placeholder",@"Placeholder Font"],
@[@"Can Adjust TextView"],
@[@"Override Keyboard Appearance",@"Keyboard Appearance"],
Expand All @@ -52,7 +52,7 @@ - (void)viewDidLoad
];


keyboardManagerPropertyDetails = @[@[@"Enable/Disable IQKeyboardManager",@"Set keyboard distance from textField"],
keyboardManagerPropertyDetails = @[@[@"Enable/Disable IQKeyboardManager",@"Set keyboard distance from textField",@"Prevent to show blank space between UIKeyboard and View"],
@[@"Automatic add the IQToolbar on UIKeyboard",@"AutoToolbar previous/next button managing behaviour",@"Uses textField's tintColor property for IQToolbar",@"Add the textField's placeholder text on IQToolbar",@"UIFont for IQToolbar placeholder text"],
@[@"Adjust textView's frame when it is too big in height"],
@[@"Override the keyboardAppearance for all UITextField/UITextView",@"All the UITextField keyboardAppearance is set using this property"],
Expand All @@ -66,6 +66,8 @@ - (IBAction)doneAction:(UIBarButtonItem *)sender
[self dismissViewControllerAnimated:YES completion:nil];
}

/*! UIKeyboard Handling */

- (void)enableAction:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setEnable:sender.on];
Expand All @@ -79,6 +81,15 @@ - (void)keyboardDistanceFromTextFieldAction:(UIStepper *)sender
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:1 inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
}

- (void)preventShowingBottomBlankSpaceAction:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setPreventShowingBottomBlankSpace:sender.on];

[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
}

/*! IQToolbar handling */

- (void)enableAutoToolbarAction:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:sender.on];
Expand All @@ -98,33 +109,44 @@ - (void)shouldShowTextFieldPlaceholder:(UISwitch *)sender
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationFade];
}

/*! UITextView handling */

- (void)canAdjustTextViewAction:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setCanAdjustTextView:sender.on];
}

/*! "Keyboard appearance overriding */

- (void)overrideKeyboardAppearanceAction:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setOverrideKeyboardAppearance:sender.on];

[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:3] withRowAnimation:UITableViewRowAnimationFade];
}

/*! Resign first responder handling */

- (void)shouldResignOnTouchOutsideAction:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setShouldResignOnTouchOutside:sender.on];
}

/*! Sound handling */

- (void)shouldPlayInputClicksAction:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setShouldPlayInputClicks:sender.on];
}

/*! Animation handling */

- (void)shouldAdoptDefaultKeyboardAnimation:(UISwitch *)sender
{
[[IQKeyboardManager sharedManager] setShouldAdoptDefaultKeyboardAnimation:sender.on];
}


#pragma mark - Table view data source

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
Expand Down Expand Up @@ -211,6 +233,17 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}
break;
case 2:
{
SwitchTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SwitchTableViewCell class]) forIndexPath:indexPath];
cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row];
cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row];
cell.switchEnable.on = [[IQKeyboardManager sharedManager] preventShowingBottomBlankSpace];
[cell.switchEnable removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
[cell.switchEnable addTarget:self action:@selector(preventShowingBottomBlankSpaceAction:) forControlEvents:UIControlEventValueChanged];
return cell;
}
break;
}
}
break;
Expand Down

0 comments on commit 341019c

Please sign in to comment.