RCTRawTextShadowView.m 723 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <React/RCTRawTextShadowView.h>
  8. #import <React/RCTShadowView+Layout.h>
  9. @implementation RCTRawTextShadowView
  10. - (void)setText:(NSString *)text
  11. {
  12. if (_text != text && ![_text isEqualToString:text]) {
  13. _text = [text copy];
  14. [self dirtyLayout];
  15. }
  16. }
  17. - (void)dirtyLayout
  18. {
  19. [self.superview dirtyLayout];
  20. }
  21. - (NSString *)description
  22. {
  23. NSString *superDescription = super.description;
  24. return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; text: %@>", self.text];
  25. }
  26. @end