Skip to content
This repository
  • 2 commits
  • 2 files changed
  • 0 comments
  • 2 contributors
May 12, 2012
Euan Lau euanlau Added enablesReturnKeyAutomatically and isFirstResponder. 117f1c0
May 17, 2012
Hans Pinckaers Merge pull request #16 from euanlau/master
Added enablesReturnKeyAutomatically and isFirstResponder
d0fc657

Showing 2 changed files with 24 additions and 3 deletions. Show diff stats Hide diff stats

  1. +2 0  class/HPGrowingTextView.h
  2. +22 3 class/HPGrowingTextView.m
2  class/HPGrowingTextView.h
@@ -93,11 +93,13 @@
93 93 @property(nonatomic) UIDataDetectorTypes dataDetectorTypes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0);
94 94 @property (nonatomic) UIReturnKeyType returnKeyType;
95 95 @property (assign) UIEdgeInsets contentInset;
  96 +@property(nonatomic) BOOL enablesReturnKeyAutomatically;
96 97
97 98 //uitextview methods
98 99 //need others? use .internalTextView
99 100 - (BOOL)becomeFirstResponder;
100 101 - (BOOL)resignFirstResponder;
  102 +- (BOOL)isFirstResponder;
101 103
102 104 - (BOOL)hasText;
103 105 - (void)scrollRangeToVisible:(NSRange)range;
25 class/HPGrowingTextView.m
@@ -316,9 +316,14 @@ -(BOOL)resignFirstResponder
316 316 return [internalTextView resignFirstResponder];
317 317 }
318 318
  319 +-(BOOL)isFirstResponder
  320 +{
  321 + return [self.internalTextView isFirstResponder];
  322 +}
  323 +
319 324 - (void)dealloc {
320 325 [internalTextView release];
321   - [super dealloc];
  326 + [super dealloc];
322 327 }
323 328
324 329
@@ -366,15 +371,17 @@ -(UIColor*)textColor{
366 371 return internalTextView.textColor;
367 372 }
368 373
  374 +///////////////////////////////////////////////////////////////////////////////////////////////////
  375 +
369 376 -(void)setBackgroundColor:(UIColor *)backgroundColor
370 377 {
371   - [super setBackgroundColor:backgroundColor];
  378 + [super setBackgroundColor:backgroundColor];
372 379 internalTextView.backgroundColor = backgroundColor;
373 380 }
374 381
375 382 -(UIColor*)backgroundColor
376 383 {
377   - return internalTextView.backgroundColor;
  384 + return internalTextView.backgroundColor;
378 385 }
379 386
380 387 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -427,6 +434,18 @@ -(UIReturnKeyType)returnKeyType
427 434
428 435 ///////////////////////////////////////////////////////////////////////////////////////////////////
429 436
  437 +- (void)setEnablesReturnKeyAutomatically:(BOOL)enablesReturnKeyAutomatically
  438 +{
  439 + internalTextView.enablesReturnKeyAutomatically = enablesReturnKeyAutomatically;
  440 +}
  441 +
  442 +- (BOOL)enablesReturnKeyAutomatically
  443 +{
  444 + return internalTextView.enablesReturnKeyAutomatically;
  445 +}
  446 +
  447 +///////////////////////////////////////////////////////////////////////////////////////////////////
  448 +
430 449 -(void)setDataDetectorTypes:(UIDataDetectorTypes)datadetector
431 450 {
432 451 internalTextView.dataDetectorTypes = datadetector;

No commit comments for this range

Something went wrong with that request. Please try again.