Skip to content

Commit

Permalink
v0.9.5 - 09 MAY 2013
Browse files Browse the repository at this point in the history
- Changed 'numberpadDonePressed:' so that target '*ShouldEndEditing' delegate method is no longer being called twice.
- Changed declared property 'targetTextField' from class 'id' to class 'UIResponder'.
- Updated copyright years and version numbers.
  • Loading branch information
lnafziger committed May 10, 2013
1 parent 6501513 commit 47caf55
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 52 deletions.
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright (c) 2013 Louis Nafziger
Copyright (c) 2012 - 2013 Louis Nafziger

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:

Expand Down
6 changes: 3 additions & 3 deletions Example/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/******************************************************************************
* v. 0.9 12 NOV 2012
* v. 0.9.5 09 MAY 2013
* Filename AppDelegate.h
* Project: LNNumberpad
* Purpose: Default Application Delegate
* Author: Louis Nafziger
*
* Copyright 2012 Louis Nafziger
* Copyright 2012-2013 Louis Nafziger
******************************************************************************
*
* This file is part of LNNumberpad.
*
* COPYRIGHT 2013 Louis Nafziger
* COPYRIGHT 2012 - 2013 Louis Nafziger
*
* LNNumberpad is free software: you can redistribute it and/or modify
* it under the terms of the The MIT License (MIT).
Expand Down
6 changes: 3 additions & 3 deletions Example/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/******************************************************************************
* v. 0.9 12 NOV 2012
* v. 0.9.5 09 MAY 2013
* Filename AppDelegate.m
* Project: LNNumberpad
* Purpose: Default Application Delegate
* Author: Louis Nafziger
*
* Copyright 2012 Louis Nafziger
* Copyright 2012-2013 Louis Nafziger
******************************************************************************
*
* This file is part of LNNumberpad.
*
* COPYRIGHT 2013 Louis Nafziger
* COPYRIGHT 2012 - 2013 Louis Nafziger
*
* LNNumberpad is free software: you can redistribute it and/or modify
* it under the terms of the The MIT License (MIT).
Expand Down
5 changes: 5 additions & 0 deletions Example/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v0.9.5 - 09 MAY 2013
- Changed 'numberpadDonePressed:' so that target 'textFieldShouldEndEditing' delegate method is no longer being called twice.
- Changed declared property 'targetTextField' from class 'id' to class 'UIResponder'.
- Updated copyright years and version numbers.

v0.9.4 - 01 FEB 2013
- Changed name to LNNumberpad to avoid namespace conflicts
- Reformatted code
Expand Down
4 changes: 2 additions & 2 deletions Example/LNNumberpad-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.9.4</string>
<string>0.9.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.9.4</string>
<string>0.9.5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
Expand Down
6 changes: 4 additions & 2 deletions Example/LNNumberpad-Prefix.pch
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/******************************************************************************
* v. 0.9 12 NOV 2012
* v. 0.9.5 09 MAY 2013
* Filename LNNumberpad-Prefix.pch
* Project: LNNumberpad
* Purpose: Prefix header for all source files of the 'LNNumberpad' target in the 'LNNumberpad' project
* Author: Louis Nafziger
*
* Copyright 2012-2013 Louis Nafziger
******************************************************************************
*
* This file is part of LNNumberpad.
*
* COPYRIGHT 2013 Louis Nafziger
* COPYRIGHT 2012 - 2013 Louis Nafziger
*
* LNNumberpad is free software: you can redistribute it and/or modify
* it under the terms of the The MIT License (MIT).
Expand Down
6 changes: 3 additions & 3 deletions Example/ViewController.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/******************************************************************************
* v. 0.9 12 NOV 2012
* v. 0.9.5 09 MAY 2013
* Filename ViewController.h
* Project: LNNumberpad
* Purpose: Simple UIViewController subclass to demo the LNNumberpad class
* Author: Louis Nafziger
*
* Copyright 2012 Louis Nafziger
* Copyright 2012-2013 Louis Nafziger
******************************************************************************
*
* This file is part of LNNumberpad.
*
* COPYRIGHT 2013 Louis Nafziger
* COPYRIGHT 2012 - 2013 Louis Nafziger
*
* LNNumberpad is free software: you can redistribute it and/or modify
* it under the terms of the The MIT License (MIT).
Expand Down
6 changes: 3 additions & 3 deletions Example/ViewController.m
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/******************************************************************************
* v. 0.9 12 NOV 2012
* v. 0.9.5 09 MAY 2013
* Filename ViewController.m
* Project: LNNumberpad
* Purpose: Simple UIViewController subclass to demo the LNNumberpad class
* Author: Louis Nafziger
*
* Copyright 2012 Louis Nafziger
* Copyright 2012-2013 Louis Nafziger
******************************************************************************
*
* COPYRIGHT 2013 Louis Nafziger
* COPYRIGHT 2012 - 2013 Louis Nafziger
*
* LNNumberpad is free software: you can redistribute it and/or modify
* it under the terms of the The MIT License (MIT).
Expand Down
6 changes: 3 additions & 3 deletions Example/main.m
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/******************************************************************************
* v. 0.9 12 NOV 2012
* v. 0.9.5 09 MAY 2013
* Filename main.m
* Project: LNNumberpad
* Purpose: Default main.m
* Author: Louis Nafziger
*
* Copyright 2012 Louis Nafziger
* Copyright 2012-2013 Louis Nafziger
******************************************************************************
*
* This file is part of LNNumberpad.
*
* COPYRIGHT 2013 Louis Nafziger
* COPYRIGHT 2012 - 2013 Louis Nafziger
*
* LNNumberpad is free software: you can redistribute it and/or modify
* it under the terms of the The MIT License (MIT).
Expand Down
6 changes: 3 additions & 3 deletions LNNumberpad/LNNumberpad.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/******************************************************************************
* v. 0.9 12 NOV 2012
* v. 0.9.5 09 MAY 2013
* Filename LNNumberpad.h
* Project: LNNumberpad
* Purpose: Class to display a custom LNNumberpad on an iPad and properly handle
* the text input.
* Author: Louis Nafziger
*
* Copyright 2012 Louis Nafziger
* Copyright 2012 - 2013 Louis Nafziger
******************************************************************************
*
* This file is part of LNNumberpad.
*
* COPYRIGHT 2013 Louis Nafziger
* COPYRIGHT 2012 - 2013 Louis Nafziger
*
* LNNumberpad is free software: you can redistribute it and/or modify
* it under the terms of the The MIT License (MIT).
Expand Down
38 changes: 13 additions & 25 deletions LNNumberpad/LNNumberpad.m
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/******************************************************************************
* v. 0.9.1 15 NOV 2012
* v. 0.9.5 09 MAY 2013
* Filename LNNumberpad.m
* Project: LNNumberpad
* Purpose: Class to display a custom LNNumberpad on an iPad and properly handle
* the text input.
* Author: Louis Nafziger
*
* Copyright 2012 Louis Nafziger
* Copyright 2012 - 2013 Louis Nafziger
******************************************************************************
*
* This file is part of LNNumberpad.
*
* COPYRIGHT 2013 Louis Nafziger
* COPYRIGHT 2012 - 2013 Louis Nafziger
*
* LNNumberpad is free software: you can redistribute it and/or modify
* it under the terms of the The MIT License (MIT).
Expand All @@ -32,7 +32,7 @@

@interface LNNumberpad ()

@property (nonatomic, weak) id<UITextInput> targetTextInput;
@property (nonatomic, weak) UIResponder <UITextInput> *targetTextInput;

@end

Expand Down Expand Up @@ -113,12 +113,15 @@ - (void)dealloc {

// Editing just began, store a reference to the object that just became the firstResponder
- (void)editingDidBegin:(NSNotification *)notification {
if ([notification.object conformsToProtocol:@protocol(UITextInput)]) {
self.targetTextInput = notification.object;
return;
if ([notification.object isKindOfClass:[UIResponder class]])
{
if ([notification.object conformsToProtocol:@protocol(UITextInput)]) {
self.targetTextInput = notification.object;
return;
}
}

// Object does not conform to UITextInput so we don't care about it
// Not a valid target for us to worry about.
self.targetTextInput = nil;
}

Expand Down Expand Up @@ -177,24 +180,9 @@ - (IBAction)numberpadClearPressed:(UIButton *)sender {

// The done button was just pressed on the number pad
- (IBAction)numberpadDonePressed:(UIButton *)sender {
if (self.targetTextInput) {
// Call the delegate methods and resign the first responder if appropriate
if ([self.targetTextInput isKindOfClass:[UITextView class]]) {
UITextView *textView = (UITextView *)self.targetTextInput;
if ([textView.delegate respondsToSelector:@selector(textViewShouldEndEditing:)]) {
if ([textView.delegate textViewShouldEndEditing:textView]) {
[textView resignFirstResponder];
}
}
} else if ([self.targetTextInput isKindOfClass:[UITextField class]]) {
UITextField *textField = (UITextField *)self.targetTextInput;
if ([textField.delegate respondsToSelector:@selector(textFieldShouldEndEditing:)]) {
if ([textField.delegate textFieldShouldEndEditing:textField]) {
[textField resignFirstResponder];
}
}
if (self.targetTextInput) {
[self.targetTextInput resignFirstResponder];
}
}
}

#pragma mark - text replacement routines
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LNNumberpad v0.9.4
LNNumberpad v0.9.5
=========

iOS Custom Numberpad
Expand Down Expand Up @@ -29,8 +29,8 @@ self.myTextField.inputView = [LNNumberpad defaultLNNumberpad];

A complete example project is included in the Example directory.

Screen Shot
===========
Screen Shots
============
![LNNumberpad Screen Shot](/Images/LNNumberpad Example 1.png)

![LNHexNumberpad Screen Shot](/Images/LNNumberpad Example 2.png)
Expand All @@ -43,7 +43,7 @@ TODO
Copying
=======

COPYRIGHT 2013 Louis Nafziger
COPYRIGHT 2012-2013 Louis Nafziger

LNNumberpad is free software: you can redistribute it and/or modify
it under the terms of the The MIT License (MIT).
Expand Down

0 comments on commit 47caf55

Please sign in to comment.