From eb74987ccb0ae9c6785d42d3976a5d3c0b881c7b Mon Sep 17 00:00:00 2001 From: Kazuki Otsuka Date: Wed, 26 Mar 2014 12:12:23 +0900 Subject: [PATCH 1/3] fix the issue about measurement of content size in iOS7.1 --- class/HPGrowingTextView.m | 48 ++++++++++++++------------------------ class/HPTextViewInternal.m | 6 ++--- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/class/HPGrowingTextView.m b/class/HPGrowingTextView.m index 9871c6f..92dab40 100644 --- a/class/HPGrowingTextView.m +++ b/class/HPGrowingTextView.m @@ -88,15 +88,17 @@ -(void)commonInitialiser CGRect r = self.frame; r.origin.y = 0; r.origin.x = 0; -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 - internalTextView = [[HPTextViewInternal alloc] initWithFrame:r textContainer:textContainer]; -#else - internalTextView = [[HPTextViewInternal alloc] initWithFrame:r]; -#endif + + if ([internalTextView respondsToSelector:@selector(initWithFrame:textContainer:)]){ + internalTextView = [[HPTextViewInternal alloc] initWithFrame:r textContainer:textContainer]; + }else{ + internalTextView = [[HPTextViewInternal alloc] initWithFrame:r]; + } + internalTextView.delegate = self; internalTextView.scrollEnabled = NO; internalTextView.font = [UIFont fontWithName:@"Helvetica" size:13]; - internalTextView.contentInset = UIEdgeInsetsZero; + internalTextView.contentInset = UIEdgeInsetsZero; internalTextView.showsHorizontalScrollIndicator = NO; internalTextView.text = @"-"; internalTextView.contentMode = UIViewContentModeRedraw; @@ -333,13 +335,6 @@ - (void)refreshHeight [internalTextView setNeedsDisplay]; } - - // scroll to caret (needed on iOS7) - if ([self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) - { - [self performSelector:@selector(resetScrollPositionForIOS7) withObject:nil afterDelay:0.1f]; - } - // Tell the delegate that the text view changed if ([delegate respondsToSelector:@selector(growingTextViewDidChange:)]) { [delegate growingTextViewDidChange:self]; @@ -349,23 +344,22 @@ - (void)refreshHeight // Code from apple developer forum - @Steve Krulewitz, @Mark Marszal, @Eric Silverberg - (CGFloat)measureHeight { - if ([self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) + + if (sizeof(void*) == 4) { - return ceilf([self.internalTextView sizeThatFits:self.internalTextView.frame.size].height); + // Executing in a 32-bit environment + return [self.internalTextView sizeThatFits:CGSizeMake(self.internalTextView.frame.size.width, CGFLOAT_MAX)].height-(self.internalTextView.contentInset.top+self.internalTextView.contentInset.bottom); } else { - return self.internalTextView.contentSize.height; + if([[UIDevice currentDevice].systemVersion floatValue] >= 7.1){ + return ceilf([self.internalTextView sizeThatFits:self.internalTextView.frame.size].height); + } + else{ + return self.internalTextView.contentSize.height-5; + } } } -- (void)resetScrollPositionForIOS7 -{ - CGRect r = [internalTextView caretRectForPosition:internalTextView.selectedTextRange.end]; - CGFloat caretY = MAX(r.origin.y - internalTextView.frame.size.height + r.size.height + 8, 0); - if (internalTextView.contentOffset.y < caretY && r.origin.y != INFINITY) - internalTextView.contentOffset = CGPointMake(0, caretY); -} - -(void)resizeTextView:(NSInteger)newSizeH { if ([delegate respondsToSelector:@selector(growingTextView:willChangeHeight:)]) { @@ -384,12 +378,6 @@ -(void)resizeTextView:(NSInteger)newSizeH - (void)growDidStop { - // scroll to caret (needed on iOS7) - if ([self respondsToSelector:@selector(snapshotViewAfterScreenUpdates:)]) - { - [self resetScrollPositionForIOS7]; - } - if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { [delegate growingTextView:self didChangeHeight:self.frame.size.height]; } diff --git a/class/HPTextViewInternal.m b/class/HPTextViewInternal.m index f3a6a1d..6c3fe6e 100644 --- a/class/HPTextViewInternal.m +++ b/class/HPTextViewInternal.m @@ -61,13 +61,14 @@ -(void)setContentOffset:(CGPoint)s float bottomOffset = (self.contentSize.height - self.frame.size.height + self.contentInset.bottom); if(s.y < bottomOffset && self.scrollEnabled){ UIEdgeInsets insets = self.contentInset; - insets.bottom = 8; + insets.bottom = 0; insets.top = 0; self.contentInset = insets; } } // Fix "overscrolling" bug + if (s.y > self.contentSize.height - self.frame.size.height && !self.decelerating && !self.tracking && !self.dragging) s = CGPointMake(s.x, self.contentSize.height - self.frame.size.height); @@ -111,7 +112,7 @@ - (void)drawRect:(CGRect)rect } else { [self.placeholderColor set]; - [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withFont:self.font]; + [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withAttributes:@{NSFontAttributeName:self.font}]; } } } @@ -122,5 +123,4 @@ -(void)setPlaceholder:(NSString *)placeholder [self setNeedsDisplay]; } - @end From e8e6a69579b0ac9b26a9ccbb6e0c6b8729dd806f Mon Sep 17 00:00:00 2001 From: Kazuki Otsuka Date: Wed, 26 Mar 2014 14:52:43 +0900 Subject: [PATCH 2/3] eraced peripheral files --- README.md | 59 --- .../GrowingTextViewExampleAppDelegate.h | 41 -- .../GrowingTextViewExampleAppDelegate.m | 104 ----- .../GrowingTextViewExampleViewController.h | 39 -- .../GrowingTextViewExampleViewController.m | 202 --------- example/Default-568h@2x.png | Bin 18594 -> 0 bytes example/GrowingTextViewExample-Info.plist | 30 -- .../project.pbxproj | 320 -------------- .../contents.xcworkspacedata | 7 - .../GrowingTextViewExample.xccheckout | 39 -- .../xcschemes/GrowingTextViewExample.xcscheme | 77 ---- .../xcschemes/xcschememanagement.plist | 22 - example/GrowingTextViewExample_Prefix.pch | 8 - example/MainWindow.xib | 417 ------------------ example/MessageEntryBackground.png | Bin 181 -> 0 bytes example/MessageEntryBackground@2x.png | Bin 274 -> 0 bytes example/MessageEntryInputField.png | Bin 1356 -> 0 bytes example/MessageEntryInputField@2x.png | Bin 3177 -> 0 bytes example/MessageEntrySendButton.png | Bin 1037 -> 0 bytes example/MessageEntrySendButton@2x.png | Bin 2466 -> 0 bytes example/MessageEntrySendButtonPressed.png | Bin 1008 -> 0 bytes example/MessageEntrySendButtonPressed@2x.png | Bin 2365 -> 0 bytes example/main.m | 36 -- 23 files changed, 1401 deletions(-) delete mode 100644 README.md delete mode 100644 example/Classes/GrowingTextViewExampleAppDelegate.h delete mode 100644 example/Classes/GrowingTextViewExampleAppDelegate.m delete mode 100644 example/Classes/GrowingTextViewExampleViewController.h delete mode 100644 example/Classes/GrowingTextViewExampleViewController.m delete mode 100644 example/Default-568h@2x.png delete mode 100644 example/GrowingTextViewExample-Info.plist delete mode 100755 example/GrowingTextViewExample.xcodeproj/project.pbxproj delete mode 100644 example/GrowingTextViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 example/GrowingTextViewExample.xcodeproj/project.xcworkspace/xcshareddata/GrowingTextViewExample.xccheckout delete mode 100644 example/GrowingTextViewExample.xcodeproj/xcuserdata/Hans.xcuserdatad/xcschemes/GrowingTextViewExample.xcscheme delete mode 100644 example/GrowingTextViewExample.xcodeproj/xcuserdata/Hans.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 example/GrowingTextViewExample_Prefix.pch delete mode 100644 example/MainWindow.xib delete mode 100644 example/MessageEntryBackground.png delete mode 100644 example/MessageEntryBackground@2x.png delete mode 100644 example/MessageEntryInputField.png delete mode 100644 example/MessageEntryInputField@2x.png delete mode 100644 example/MessageEntrySendButton.png delete mode 100644 example/MessageEntrySendButton@2x.png delete mode 100644 example/MessageEntrySendButtonPressed.png delete mode 100644 example/MessageEntrySendButtonPressed@2x.png delete mode 100644 example/main.m diff --git a/README.md b/README.md deleted file mode 100644 index ca281ca..0000000 --- a/README.md +++ /dev/null @@ -1,59 +0,0 @@ -HPGrowingTextView -================= - -Multi-line/Autoresizing UITextView similar as in the SMS-app. The example project mimicks the look of Apple's SMS-app. - -![Screenshot](http://f.cl.ly/items/270f2F3q3d3q142m140A/ss.png) - -Properties ----------- - -```objective-c -int maxNumberOfLines; // Stops growing at this amount of lines. -int minNumberOfLines; // Starts growing at this amount of lines. -int maxHeight; // Specify the maximum height in points instead of lines. -int minHeight; // Specify the minimum height in points instead of lines. -BOOL animateHeightChange; // Animate the growing -NSTimeInterval animationDuration; // Adjust the duration of the growth animation. -``` - -UITextView borrowed properties ----------------- - -```objective-c -NSString *text; -UIFont *font; -UIColor *textColor; -NSTextAlignment textAlignment; -NSRange selectedRange; -BOOL editable; -UIDataDetectorTypes dataDetectorTypes; -UIReturnKeyType returnKeyType; -``` - -If you want to set other UITextView properties, use .internalTextView - -Delegate methods ---------------- - -```objective-c --(BOOL)growingTextViewShouldBeginEditing:(HPGrowingTextView *)growingTextView; --(BOOL)growingTextViewShouldEndEditing:(HPGrowingTextView *)growingTextView; - --(void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView; --(void)growingTextViewDidEndEditing:(HPGrowingTextView *)growingTextView; - --(BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; --(void)growingTextViewDidChange:(HPGrowingTextView *)growingTextView; - -// Called WITHIN animation block! --(void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height; - -// Called after animation --(void)growingTextView:(HPGrowingTextView *)growingTextView didChangeHeight:(float)height; - --(void)growingTextViewDidChangeSelection:(HPGrowingTextView *)growingTextView; --(BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView; -``` - -For more info, see blogpost: http://www.hanspinckaers.com/multi-line-uitextview-similar-to-sms diff --git a/example/Classes/GrowingTextViewExampleAppDelegate.h b/example/Classes/GrowingTextViewExampleAppDelegate.h deleted file mode 100644 index fc649c3..0000000 --- a/example/Classes/GrowingTextViewExampleAppDelegate.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// GrowingTextViewExampleAppDelegate.h -// -// Created by Hans Pinckaers on 29-06-10. -// -// MIT License -// -// Copyright (c) 2011 Hans Pinckaers -// -// 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 - -@class GrowingTextViewExampleViewController; - -@interface GrowingTextViewExampleAppDelegate : NSObject { - UIWindow *window; - GrowingTextViewExampleViewController *viewController; -} - -@property (nonatomic, strong) IBOutlet UIWindow *window; -@property (nonatomic, strong) GrowingTextViewExampleViewController *viewController; - -@end - diff --git a/example/Classes/GrowingTextViewExampleAppDelegate.m b/example/Classes/GrowingTextViewExampleAppDelegate.m deleted file mode 100644 index 9cf8920..0000000 --- a/example/Classes/GrowingTextViewExampleAppDelegate.m +++ /dev/null @@ -1,104 +0,0 @@ -// -// GrowingTextViewExampleAppDelegate.m -// -// Created by Hans Pinckaers on 29-06-10. -// -// MIT License -// -// Copyright (c) 2011 Hans Pinckaers -// -// 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 "GrowingTextViewExampleAppDelegate.h" -#import "GrowingTextViewExampleViewController.h" - -@implementation GrowingTextViewExampleAppDelegate - -@synthesize window; -@synthesize viewController; - - -#pragma mark - -#pragma mark Application lifecycle - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - - viewController = [[GrowingTextViewExampleViewController alloc] init]; - - // Add the view controller's view to the window and display. - [window addSubview:viewController.view]; - [window makeKeyAndVisible]; - - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - /* - Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - */ -} - - -- (void)applicationDidEnterBackground:(UIApplication *)application { - /* - Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - If your application supports background execution, called instead of applicationWillTerminate: when the user quits. - */ -} - - -- (void)applicationWillEnterForeground:(UIApplication *)application { - /* - Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. - */ -} - - -- (void)applicationDidBecomeActive:(UIApplication *)application { - /* - Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - */ -} - - -- (void)applicationWillTerminate:(UIApplication *)application { - /* - Called when the application is about to terminate. - See also applicationDidEnterBackground:. - */ -} - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - /* - Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. - */ -} - - - - -@end diff --git a/example/Classes/GrowingTextViewExampleViewController.h b/example/Classes/GrowingTextViewExampleViewController.h deleted file mode 100644 index 260417b..0000000 --- a/example/Classes/GrowingTextViewExampleViewController.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// GrowingTextViewExampleViewController.h -// -// Created by Hans Pinckaers on 29-06-10. -// -// MIT License -// -// Copyright (c) 2011 Hans Pinckaers -// -// 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 -#import "HPGrowingTextView.h" - -@interface GrowingTextViewExampleViewController : UIViewController { - UIView *containerView; - HPGrowingTextView *textView; -} - --(void)resignTextView; - -@end - diff --git a/example/Classes/GrowingTextViewExampleViewController.m b/example/Classes/GrowingTextViewExampleViewController.m deleted file mode 100644 index 6a80fd3..0000000 --- a/example/Classes/GrowingTextViewExampleViewController.m +++ /dev/null @@ -1,202 +0,0 @@ -// -// GrowingTextViewExampleViewController.m -// -// Created by Hans Pinckaers on 29-06-10. -// -// MIT License -// -// Copyright (c) 2011 Hans Pinckaers -// -// 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 "GrowingTextViewExampleViewController.h" - -@implementation GrowingTextViewExampleViewController - - --(id)init -{ - self = [super init]; - if(self){ - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; - } - - return self; -} - - - -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView { - self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; - self.view.backgroundColor = [UIColor colorWithRed:219.0f/255.0f green:226.0f/255.0f blue:237.0f/255.0f alpha:1]; - - containerView = [[UIView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 40, 320, 40)]; - - textView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(6, 3, 240, 40)]; - textView.isScrollable = NO; - textView.contentInset = UIEdgeInsetsMake(0, 5, 0, 5); - - textView.minNumberOfLines = 1; - textView.maxNumberOfLines = 6; - // you can also set the maximum height in points with maxHeight - // textView.maxHeight = 200.0f; - textView.returnKeyType = UIReturnKeyGo; //just as an example - textView.font = [UIFont systemFontOfSize:15.0f]; - textView.delegate = self; - textView.internalTextView.scrollIndicatorInsets = UIEdgeInsetsMake(5, 0, 5, 0); - textView.backgroundColor = [UIColor whiteColor]; - textView.placeholder = @"Type to see the textView grow!"; - - // textView.text = @"test\n\ntest"; - // textView.animateHeightChange = NO; //turns off animation - - [self.view addSubview:containerView]; - - UIImage *rawEntryBackground = [UIImage imageNamed:@"MessageEntryInputField.png"]; - UIImage *entryBackground = [rawEntryBackground stretchableImageWithLeftCapWidth:13 topCapHeight:22]; - UIImageView *entryImageView = [[UIImageView alloc] initWithImage:entryBackground]; - entryImageView.frame = CGRectMake(5, 0, 248, 40); - entryImageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; - - UIImage *rawBackground = [UIImage imageNamed:@"MessageEntryBackground.png"]; - UIImage *background = [rawBackground stretchableImageWithLeftCapWidth:13 topCapHeight:22]; - UIImageView *imageView = [[UIImageView alloc] initWithImage:background]; - imageView.frame = CGRectMake(0, 0, containerView.frame.size.width, containerView.frame.size.height); - imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; - - textView.autoresizingMask = UIViewAutoresizingFlexibleWidth; - - // view hierachy - [containerView addSubview:imageView]; - [containerView addSubview:textView]; - [containerView addSubview:entryImageView]; - - UIImage *sendBtnBackground = [[UIImage imageNamed:@"MessageEntrySendButton.png"] stretchableImageWithLeftCapWidth:13 topCapHeight:0]; - UIImage *selectedSendBtnBackground = [[UIImage imageNamed:@"MessageEntrySendButton.png"] stretchableImageWithLeftCapWidth:13 topCapHeight:0]; - - UIButton *doneBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - doneBtn.frame = CGRectMake(containerView.frame.size.width - 69, 8, 63, 27); - doneBtn.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin; - [doneBtn setTitle:@"Done" forState:UIControlStateNormal]; - - [doneBtn setTitleShadowColor:[UIColor colorWithWhite:0 alpha:0.4] forState:UIControlStateNormal]; - doneBtn.titleLabel.shadowOffset = CGSizeMake (0.0, -1.0); - doneBtn.titleLabel.font = [UIFont boldSystemFontOfSize:18.0f]; - - [doneBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - [doneBtn addTarget:self action:@selector(resignTextView) forControlEvents:UIControlEventTouchUpInside]; - [doneBtn setBackgroundImage:sendBtnBackground forState:UIControlStateNormal]; - [doneBtn setBackgroundImage:selectedSendBtnBackground forState:UIControlStateSelected]; - [containerView addSubview:doneBtn]; - containerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; -} - --(void)resignTextView -{ - [textView resignFirstResponder]; -} - -//Code from Brett Schumann --(void) keyboardWillShow:(NSNotification *)note{ - // get keyboard size and loctaion - CGRect keyboardBounds; - [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &keyboardBounds]; - NSNumber *duration = [note.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey]; - NSNumber *curve = [note.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey]; - - // Need to translate the bounds to account for rotation. - keyboardBounds = [self.view convertRect:keyboardBounds toView:nil]; - - // get a rect for the textView frame - CGRect containerFrame = containerView.frame; - containerFrame.origin.y = self.view.bounds.size.height - (keyboardBounds.size.height + containerFrame.size.height); - // animations settings - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationBeginsFromCurrentState:YES]; - [UIView setAnimationDuration:[duration doubleValue]]; - [UIView setAnimationCurve:[curve intValue]]; - - // set views with new info - containerView.frame = containerFrame; - - - // commit animations - [UIView commitAnimations]; -} - --(void) keyboardWillHide:(NSNotification *)note{ - NSNumber *duration = [note.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey]; - NSNumber *curve = [note.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey]; - - // get a rect for the textView frame - CGRect containerFrame = containerView.frame; - containerFrame.origin.y = self.view.bounds.size.height - containerFrame.size.height; - - // animations settings - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationBeginsFromCurrentState:YES]; - [UIView setAnimationDuration:[duration doubleValue]]; - [UIView setAnimationCurve:[curve intValue]]; - - // set views with new info - containerView.frame = containerFrame; - - // commit animations - [UIView commitAnimations]; -} - -- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height -{ - float diff = (growingTextView.frame.size.height - height); - - CGRect r = containerView.frame; - r.size.height -= diff; - r.origin.y += diff; - containerView.frame = r; -} - --(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - return YES; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - - -@end diff --git a/example/Default-568h@2x.png b/example/Default-568h@2x.png deleted file mode 100644 index 0891b7aabfcf3422423b109c8beed2bab838c607..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-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ingTextViewExample-Info.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSMainNibFile - MainWindow - - diff --git a/example/GrowingTextViewExample.xcodeproj/project.pbxproj b/example/GrowingTextViewExample.xcodeproj/project.pbxproj deleted file mode 100755 index 53f47ed..0000000 --- a/example/GrowingTextViewExample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,320 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1D3623260D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; - 28D7ACF80DDB3853001CB0EB /* GrowingTextViewExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* GrowingTextViewExampleViewController.m */; }; - 3A5B30CE13EC633200DB7A65 /* HPGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */; }; - 3A5B30CF13EC633200DB7A65 /* HPTextViewInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B30CD13EC633200DB7A65 /* HPTextViewInternal.m */; }; - 3A6144DE17719E8500311E3E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A6144DD17719E8500311E3E /* Default-568h@2x.png */; }; - 3AC80F9613EC953D00712F9A /* MessageEntryBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AC80F9213EC953D00712F9A /* MessageEntryBackground.png */; }; - 3AC80F9713EC953D00712F9A /* MessageEntryBackground@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AC80F9313EC953D00712F9A /* MessageEntryBackground@2x.png */; }; - 3AC80F9813EC953D00712F9A /* MessageEntryInputField.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AC80F9413EC953D00712F9A /* MessageEntryInputField.png */; }; - 3AC80F9913EC953D00712F9A /* MessageEntryInputField@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AC80F9513EC953D00712F9A /* MessageEntryInputField@2x.png */; }; - 3ADB373513EE98D60006E262 /* MessageEntrySendButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADB373113EE98D60006E262 /* MessageEntrySendButton.png */; }; - 3ADB373613EE98D60006E262 /* MessageEntrySendButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADB373213EE98D60006E262 /* MessageEntrySendButton@2x.png */; }; - 3ADB373713EE98D60006E262 /* MessageEntrySendButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADB373313EE98D60006E262 /* MessageEntrySendButtonPressed.png */; }; - 3ADB373813EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADB373413EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D3623240D0F684500981E51 /* GrowingTextViewExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrowingTextViewExampleAppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrowingTextViewExampleAppDelegate.m; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* GrowingTextViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GrowingTextViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 28D7ACF60DDB3853001CB0EB /* GrowingTextViewExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrowingTextViewExampleViewController.h; sourceTree = ""; }; - 28D7ACF70DDB3853001CB0EB /* GrowingTextViewExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrowingTextViewExampleViewController.m; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* GrowingTextViewExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrowingTextViewExample_Prefix.pch; sourceTree = ""; }; - 3A5B30CA13EC633200DB7A65 /* HPGrowingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPGrowingTextView.h; sourceTree = ""; }; - 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HPGrowingTextView.m; sourceTree = ""; }; - 3A5B30CC13EC633200DB7A65 /* HPTextViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPTextViewInternal.h; sourceTree = ""; }; - 3A5B30CD13EC633200DB7A65 /* HPTextViewInternal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HPTextViewInternal.m; sourceTree = ""; }; - 3A6144DD17719E8500311E3E /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - 3AC80F9213EC953D00712F9A /* MessageEntryBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MessageEntryBackground.png; sourceTree = ""; }; - 3AC80F9313EC953D00712F9A /* MessageEntryBackground@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MessageEntryBackground@2x.png"; sourceTree = ""; }; - 3AC80F9413EC953D00712F9A /* MessageEntryInputField.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MessageEntryInputField.png; sourceTree = ""; }; - 3AC80F9513EC953D00712F9A /* MessageEntryInputField@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MessageEntryInputField@2x.png"; sourceTree = ""; }; - 3ADB373113EE98D60006E262 /* MessageEntrySendButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MessageEntrySendButton.png; sourceTree = ""; }; - 3ADB373213EE98D60006E262 /* MessageEntrySendButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MessageEntrySendButton@2x.png"; sourceTree = ""; }; - 3ADB373313EE98D60006E262 /* MessageEntrySendButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MessageEntrySendButtonPressed.png; sourceTree = ""; }; - 3ADB373413EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "MessageEntrySendButtonPressed@2x.png"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* GrowingTextViewExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GrowingTextViewExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 3A5B30C913EC633200DB7A65 /* HPGrowingTextView */, - 1D3623240D0F684500981E51 /* GrowingTextViewExampleAppDelegate.h */, - 1D3623250D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m */, - 28D7ACF60DDB3853001CB0EB /* GrowingTextViewExampleViewController.h */, - 28D7ACF70DDB3853001CB0EB /* GrowingTextViewExampleViewController.m */, - ); - path = Classes; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* GrowingTextViewExample.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = CustomTemplate; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 3A6144DD17719E8500311E3E /* Default-568h@2x.png */, - 32CA4F630368D1EE00C91783 /* GrowingTextViewExample_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 3ADB373113EE98D60006E262 /* MessageEntrySendButton.png */, - 3ADB373213EE98D60006E262 /* MessageEntrySendButton@2x.png */, - 3ADB373313EE98D60006E262 /* MessageEntrySendButtonPressed.png */, - 3ADB373413EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png */, - 3AC80F9213EC953D00712F9A /* MessageEntryBackground.png */, - 3AC80F9313EC953D00712F9A /* MessageEntryBackground@2x.png */, - 3AC80F9413EC953D00712F9A /* MessageEntryInputField.png */, - 3AC80F9513EC953D00712F9A /* MessageEntryInputField@2x.png */, - 28AD733E0D9D9553002E5188 /* MainWindow.xib */, - 8D1107310486CEB800E47090 /* GrowingTextViewExample-Info.plist */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765A40DF7441C002DB57D /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 3A5B30C913EC633200DB7A65 /* HPGrowingTextView */ = { - isa = PBXGroup; - children = ( - 3A5B30CA13EC633200DB7A65 /* HPGrowingTextView.h */, - 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */, - 3A5B30CC13EC633200DB7A65 /* HPTextViewInternal.h */, - 3A5B30CD13EC633200DB7A65 /* HPTextViewInternal.m */, - ); - name = HPGrowingTextView; - path = ../../class; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* GrowingTextViewExample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "GrowingTextViewExample" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = GrowingTextViewExample; - productName = GrowingTextViewExample; - productReference = 1D6058910D05DD3D006BFB54 /* GrowingTextViewExample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GrowingTextViewExample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* GrowingTextViewExample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, - 3AC80F9613EC953D00712F9A /* MessageEntryBackground.png in Resources */, - 3AC80F9713EC953D00712F9A /* MessageEntryBackground@2x.png in Resources */, - 3AC80F9813EC953D00712F9A /* MessageEntryInputField.png in Resources */, - 3AC80F9913EC953D00712F9A /* MessageEntryInputField@2x.png in Resources */, - 3ADB373513EE98D60006E262 /* MessageEntrySendButton.png in Resources */, - 3ADB373613EE98D60006E262 /* MessageEntrySendButton@2x.png in Resources */, - 3ADB373713EE98D60006E262 /* MessageEntrySendButtonPressed.png in Resources */, - 3ADB373813EE98D60006E262 /* MessageEntrySendButtonPressed@2x.png in Resources */, - 3A6144DE17719E8500311E3E /* Default-568h@2x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* GrowingTextViewExampleAppDelegate.m in Sources */, - 28D7ACF80DDB3853001CB0EB /* GrowingTextViewExampleViewController.m in Sources */, - 3A5B30CE13EC633200DB7A65 /* HPGrowingTextView.m in Sources */, - 3A5B30CF13EC633200DB7A65 /* HPTextViewInternal.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = GrowingTextViewExample_Prefix.pch; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - INFOPLIST_FILE = "GrowingTextViewExample-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 5.1; - PRODUCT_NAME = GrowingTextViewExample; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = GrowingTextViewExample_Prefix.pch; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - INFOPLIST_FILE = "GrowingTextViewExample-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 5.1; - PRODUCT_NAME = GrowingTextViewExample; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "GrowingTextViewExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GrowingTextViewExample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/example/GrowingTextViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/GrowingTextViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 3ec2204..0000000 --- a/example/GrowingTextViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/example/GrowingTextViewExample.xcodeproj/project.xcworkspace/xcshareddata/GrowingTextViewExample.xccheckout b/example/GrowingTextViewExample.xcodeproj/project.xcworkspace/xcshareddata/GrowingTextViewExample.xccheckout deleted file mode 100644 index 67ae5e2..0000000 --- a/example/GrowingTextViewExample.xcodeproj/project.xcworkspace/xcshareddata/GrowingTextViewExample.xccheckout +++ /dev/null @@ -1,39 +0,0 @@ - - - - - IDESourceControlProjectIdentifier - CE238A39-5956-41F7-AD07-B1520BDD9DD1 - IDESourceControlProjectName - GrowingTextViewExample - IDESourceControlProjectOriginsDictionary - - 833FB93F-BB7B-4266-AA8D-9FF985F70642 - https://github.com/HansPinckaers/GrowingTextView.git - - IDESourceControlProjectPath - example/GrowingTextViewExample.xcodeproj/project.xcworkspace - IDESourceControlProjectRelativeInstallPathDictionary - - 833FB93F-BB7B-4266-AA8D-9FF985F70642 - ../../.. - - IDESourceControlProjectURL - https://github.com/HansPinckaers/GrowingTextView.git - IDESourceControlProjectVersion - 110 - IDESourceControlProjectWCCIdentifier - 833FB93F-BB7B-4266-AA8D-9FF985F70642 - IDESourceControlProjectWCConfigurations - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - 833FB93F-BB7B-4266-AA8D-9FF985F70642 - IDESourceControlWCCName - GrowingTextView - - - - diff --git a/example/GrowingTextViewExample.xcodeproj/xcuserdata/Hans.xcuserdatad/xcschemes/GrowingTextViewExample.xcscheme b/example/GrowingTextViewExample.xcodeproj/xcuserdata/Hans.xcuserdatad/xcschemes/GrowingTextViewExample.xcscheme deleted file mode 100644 index 6402da6..0000000 --- a/example/GrowingTextViewExample.xcodeproj/xcuserdata/Hans.xcuserdatad/xcschemes/GrowingTextViewExample.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/GrowingTextViewExample.xcodeproj/xcuserdata/Hans.xcuserdatad/xcschemes/xcschememanagement.plist b/example/GrowingTextViewExample.xcodeproj/xcuserdata/Hans.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index e46a121..0000000 --- a/example/GrowingTextViewExample.xcodeproj/xcuserdata/Hans.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - GrowingTextViewExample.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 1D6058900D05DD3D006BFB54 - - primary - - - - - diff --git a/example/GrowingTextViewExample_Prefix.pch b/example/GrowingTextViewExample_Prefix.pch deleted file mode 100644 index 277fdfb..0000000 --- a/example/GrowingTextViewExample_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'GrowingTextViewExample' target in the 'GrowingTextViewExample' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/example/MainWindow.xib b/example/MainWindow.xib deleted file mode 100644 index edaefc1..0000000 --- a/example/MainWindow.xib +++ /dev/null @@ -1,417 +0,0 @@ - - - - 1024 - 10F569 - 788 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 117 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - - 292 - {320, 480} - - - 1 - MSAxIDEAA - - NO - NO - - IBCocoaTouchFramework - YES - - - - - YES - - - delegate - - - - 4 - - - - window - - - - 14 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - 3 - - - GrowingTextViewExample App Delegate - - - -2 - - - - - 12 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 12.IBEditorWindowLastContentRect - 12.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - - - YES - UIApplication - UIResponder - {{525, 276}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - GrowingTextViewExampleAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 15 - - - - YES - - GrowingTextViewExampleAppDelegate - NSObject - - YES - - YES - viewController - window - - - YES - GrowingTextViewExampleViewController - UIWindow - - - - YES - - YES - viewController - window - - - YES - - viewController - GrowingTextViewExampleViewController - - - window - UIWindow - - - - - IBProjectSource - Classes/GrowingTextViewExampleAppDelegate.h - - - - GrowingTextViewExampleAppDelegate - NSObject - - IBUserSource - - - - - GrowingTextViewExampleViewController - UIViewController - - IBProjectSource - Classes/GrowingTextViewExampleViewController.h - - - - UIWindow - UIView - - IBUserSource - - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIApplication - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIApplication.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWindow - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWindow.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - GrowingTextViewExample.xcodeproj - 3 - 117 - - diff --git a/example/MessageEntryBackground.png b/example/MessageEntryBackground.png deleted file mode 100644 index 1db2bcea77a12d2b9f6d1fccdf2c0432e9690895..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^96+qW!2~3I4(hxDQZ=3~jv*SNb0-J#H5hO>&wTh# z+^9++*@mg~&-a-=c99vGr;pXmd6?x<^!LQ;x72`1#-QE2t*OrW=b^PT z7B{pk^!VA&S+In4TIh_Yzvr;$hklA!`RQMsiihwEy-AM^uNWQQ#n-qu$1^aXAk0|f g$%fAF#~VAv|Mw>-NH#9;0lI_1)78&qol`;+03n!3ssI20 diff --git a/example/MessageEntryBackground@2x.png b/example/MessageEntryBackground@2x.png deleted file mode 100644 index 53d805a209540b08f5eb73eaff15259917fc6663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!2~4dpG=AZQk(@Ik;M!QVyYm_=ozH)0VsIH z)5S5wgZJ(=N4~=b94>)Dg);MRr~8h22WQ%mvv4FO#m8hanAq% diff --git a/example/MessageEntryInputField.png b/example/MessageEntryInputField.png deleted file mode 100644 index f784561c17f4c2f4d0ae0f26e5c3544fb822db84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1356 zcmV-S1+)5zP)7`^Y!<9D>w08fGxsKby(K$u`sAav0tvZ&V7xG)+Q*kD>$uGFMyDXm!3cIC!| zlt>pQu8c-&7p0{O8%isbpP6Z}fJMrW9ZFjfh8bXHJZIoe9^pN}7BXLQGH>p?-#OpU zz3<%_rS)oCM8wgQ2rQ2JLi0U*6i5zR#fHU`-V*!9e=PQ zfXT_pnV)|Aq5s_3GaY`ve-un(0EL6VA`k*-Hb4WC00#0>YHDiEr=NXZaq#VTc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$N3~urTZ_j8k_H>=G?NR)iSpWb407*qoM6N<$f?55=IRF3v diff --git a/example/MessageEntrySendButtonPressed.png b/example/MessageEntrySendButtonPressed.png deleted file mode 100644 index f7397d1c0b21e744e8cc0e8a9e788b446567d5cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1008 zcmV%D7>LDY1D1v(Esh8|OC<=Ozs9u8Z zlu-~Ah~1%x%+w4s#arIj%Z|;=PQTycih1dRpgMp-Bi8SDRDUkF+<%I^d4X)cHcN0<8R%@k+wI&fd0gOj zIl!J^1FOXXg1|x3q99L9z}R>MhQp&UI24BA;gP$*^cxe+_io|?%qp|YY|Hj$YXHZ+ zZs&1-qR-?{@_{Idvj)z*p{gqM^!7tfU%xUiJaSP0xEN`=-7>x3Z)WD)vXwTgc-AL* zcBH4JK!VLWz3)Grk4I!^@92j9!J!8cSv~Xf%gqn*fm3EQBfBl(yw@j%GSgFma~ALO z-*q&qLu-2{4D=5^9E*&fh|h59{W$E7Qx2yil%5vAH~`Raz(NXf6jci`&fAf5j98ow zmb?RHg2_}7@F&qF(334x#33GWiBH#@!rLb~E4-2eDV>UE_=AONA_`Ud?d!7AR5(xe0Z|g-L2!rViw|)4-fb~O`4`IrWbyWRLmxx zCLUap{E{}Fu2VSD!Wk>#5}$mSEXzwv%Fk6deCx{>MYG{ERMnr5pOx59bM<5?$Nbe& zRG9e$pMZ*?X2c^d@yUm>zJB5K{;HBSIj>b!G4wSOkGRAqaO@L;3Ca)F~M`};2fC2~r6v__lO2Hzgpv;KN% zNx?1Tc2BZrnbCa-Rebi+sQn@cjc2Ieq{l@V|9Em%>vo6bVo*o!9c^djmtlt zIlAo%_IZmMjQ6E_=FFzIEyw*)Sati=_S*MfGrqL`2z2&_6Gz5m7yes_CQ(qGc565_ z$<>#encTH;RZd&Q-gS@g16+rY*cwfT(fOauV(oayLS>**QHdxg%7mgw8bS4;I#F$? eZz#$NbCzGcXAOW$64tQ*0000d=nt5y#*B!@y^JaGTU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Val = UIApplicationMain(argc, argv, nil, nil); - return retVal; - } -} From 9c8db08a4b7ebe25e52f1c40fc465bab042d7f13 Mon Sep 17 00:00:00 2001 From: Kazuki Otsuka Date: Wed, 26 Mar 2014 17:23:33 +0900 Subject: [PATCH 3/3] fixed 64bit 7.0 environment issue --- class/HPGrowingTextView.m | 44 ++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/class/HPGrowingTextView.m b/class/HPGrowingTextView.m index 92dab40..b8d3db3 100644 --- a/class/HPGrowingTextView.m +++ b/class/HPGrowingTextView.m @@ -41,7 +41,7 @@ @implementation HPGrowingTextView @synthesize minHeight; @synthesize font; @synthesize textColor; -@synthesize textAlignment; +@synthesize textAlignment; @synthesize selectedRange; @synthesize editable; @synthesize dataDetectorTypes; @@ -97,7 +97,7 @@ -(void)commonInitialiser internalTextView.delegate = self; internalTextView.scrollEnabled = NO; - internalTextView.font = [UIFont fontWithName:@"Helvetica" size:13]; + internalTextView.font = [UIFont fontWithName:@"Helvetica" size:13]; internalTextView.contentInset = UIEdgeInsetsZero; internalTextView.showsHorizontalScrollIndicator = NO; internalTextView.text = @"-"; @@ -113,7 +113,7 @@ -(void)commonInitialiser internalTextView.text = @""; [self setMaxNumberOfLines:3]; - + [self setPlaceholderColor:[UIColor lightGrayColor]]; internalTextView.displayPlaceHolder = YES; } @@ -198,7 +198,7 @@ - (void)setMaxHeight:(int)height -(void)setMinNumberOfLines:(int)m { if(m == 0 && minHeight > 0) return; // the user specified a minHeight themselves. - + // Use internalTextView for height calculations, thanks to Gwynne NSString *saveText = internalTextView.text, *newText = @"-"; @@ -248,7 +248,7 @@ - (UIColor *)placeholderColor return internalTextView.placeholderColor; } -- (void)setPlaceholderColor:(UIColor *)placeholderColor +- (void)setPlaceholderColor:(UIColor *)placeholderColor { [internalTextView setPlaceholderColor:placeholderColor]; } @@ -293,13 +293,13 @@ - (void)refreshHeight if ([UIView resolveClassMethod:@selector(animateWithDuration:animations:)]) { #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 - [UIView animateWithDuration:animationDuration - delay:0 + [UIView animateWithDuration:animationDuration + delay:0 options:(UIViewAnimationOptionAllowUserInteraction| - UIViewAnimationOptionBeginFromCurrentState) + UIViewAnimationOptionBeginFromCurrentState) animations:^(void) { [self resizeTextView:newSizeH]; - } + } completion:^(BOOL finished) { if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { [delegate growingTextView:self didChangeHeight:newSizeH]; @@ -316,13 +316,13 @@ - (void)refreshHeight [UIView commitAnimations]; } } else { - [self resizeTextView:newSizeH]; + [self resizeTextView:newSizeH]; // [fixed] The growingTextView:didChangeHeight: delegate method was not called at all when not animating height changes. // thanks to Gwynne if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { [delegate growingTextView:self didChangeHeight:newSizeH]; - } + } } } } @@ -351,11 +351,13 @@ - (CGFloat)measureHeight return [self.internalTextView sizeThatFits:CGSizeMake(self.internalTextView.frame.size.width, CGFLOAT_MAX)].height-(self.internalTextView.contentInset.top+self.internalTextView.contentInset.bottom); } else { + //64-bit 7.1 later if([[UIDevice currentDevice].systemVersion floatValue] >= 7.1){ return ceilf([self.internalTextView sizeThatFits:self.internalTextView.frame.size].height); } else{ - return self.internalTextView.contentSize.height-5; + //64-bit 7.0 + return [self.internalTextView sizeThatFits:CGSizeMake(self.internalTextView.frame.size.width, CGFLOAT_MAX)].height-(self.internalTextView.contentInset.top+self.internalTextView.contentInset.bottom); } } } @@ -402,7 +404,7 @@ -(BOOL)resignFirstResponder -(BOOL)isFirstResponder { - return [self.internalTextView isFirstResponder]; + return [self.internalTextView isFirstResponder]; } @@ -438,7 +440,7 @@ -(void)setFont:(UIFont *)afont -(UIFont *)font { return internalTextView.font; -} +} /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -455,13 +457,13 @@ -(UIColor*)textColor{ -(void)setBackgroundColor:(UIColor *)backgroundColor { - [super setBackgroundColor:backgroundColor]; + [super setBackgroundColor:backgroundColor]; internalTextView.backgroundColor = backgroundColor; } -(UIColor*)backgroundColor { - return internalTextView.backgroundColor; + return internalTextView.backgroundColor; } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -540,12 +542,12 @@ - (UIKeyboardType)keyboardType - (void)setEnablesReturnKeyAutomatically:(BOOL)enablesReturnKeyAutomatically { - internalTextView.enablesReturnKeyAutomatically = enablesReturnKeyAutomatically; + internalTextView.enablesReturnKeyAutomatically = enablesReturnKeyAutomatically; } - (BOOL)enablesReturnKeyAutomatically { - return internalTextView.enablesReturnKeyAutomatically; + return internalTextView.enablesReturnKeyAutomatically; } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -608,7 +610,7 @@ - (void)textViewDidBeginEditing:(UITextView *)textView { /////////////////////////////////////////////////////////////////////////////////////////////////// -- (void)textViewDidEndEditing:(UITextView *)textView { +- (void)textViewDidEndEditing:(UITextView *)textView { if ([delegate respondsToSelector:@selector(growingTextViewDidEndEditing:)]) { [delegate growingTextViewDidEndEditing:self]; } @@ -623,8 +625,8 @@ - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range if(![textView hasText] && [atext isEqualToString:@""]) return NO; //Added by bretdabaker: sometimes we want to handle this ourselves - if ([delegate respondsToSelector:@selector(growingTextView:shouldChangeTextInRange:replacementText:)]) - return [delegate growingTextView:self shouldChangeTextInRange:range replacementText:atext]; + if ([delegate respondsToSelector:@selector(growingTextView:shouldChangeTextInRange:replacementText:)]) + return [delegate growingTextView:self shouldChangeTextInRange:range replacementText:atext]; if ([atext isEqualToString:@"\n"]) { if ([delegate respondsToSelector:@selector(growingTextViewShouldReturn:)]) {