SCLTextView.m 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // SCLTextView.m
  3. // SCLAlertView
  4. //
  5. // Created by Diogo Autilio on 9/18/15.
  6. // Copyright (c) 2015-2017 AnyKey Entertainment. All rights reserved.
  7. //
  8. #import "SCLTextView.h"
  9. #define MIN_HEIGHT 30.0f
  10. @implementation SCLTextView
  11. - (instancetype)init
  12. {
  13. self = [super init];
  14. if (self)
  15. {
  16. [self setup];
  17. }
  18. return self;
  19. }
  20. - (instancetype)initWithCoder:(NSCoder *)aDecoder
  21. {
  22. self = [super initWithCoder:aDecoder];
  23. if(self)
  24. {
  25. [self setup];
  26. }
  27. return self;
  28. }
  29. - (instancetype)initWithFrame:(CGRect)frame
  30. {
  31. self = [super initWithFrame:frame];
  32. if (self)
  33. {
  34. [self setup];
  35. }
  36. return self;
  37. }
  38. - (void)setup
  39. {
  40. self.frame = CGRectMake(0.0f, 0.0f, 0.0f, MIN_HEIGHT);
  41. self.returnKeyType = UIReturnKeyDone;
  42. self.borderStyle = UITextBorderStyleRoundedRect;
  43. self.autocapitalizationType = UITextAutocapitalizationTypeSentences;
  44. self.clearButtonMode = UITextFieldViewModeWhileEditing;
  45. self.layer.masksToBounds = YES;
  46. self.layer.borderWidth = 1.0f;
  47. }
  48. @end