2015-03-23 15:07:33 -07:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-03-23 15:07:33 -07:00
|
|
|
*/
|
2015-01-29 17:10:49 -08:00
|
|
|
|
2017-12-19 19:48:22 -08:00
|
|
|
#import "RCTRawTextShadowView.h"
|
2015-01-29 17:10:49 -08:00
|
|
|
|
2018-01-23 23:17:57 -08:00
|
|
|
#import <React/RCTShadowView+Layout.h>
|
2015-07-31 07:37:12 -07:00
|
|
|
|
2017-12-19 19:48:22 -08:00
|
|
|
@implementation RCTRawTextShadowView
|
2015-01-29 17:10:49 -08:00
|
|
|
|
|
|
|
- (void)setText:(NSString *)text
|
|
|
|
{
|
2015-11-04 04:04:37 -08:00
|
|
|
if (_text != text && ![_text isEqualToString:text]) {
|
2015-01-29 17:10:49 -08:00
|
|
|
_text = [text copy];
|
2018-01-23 23:17:57 -08:00
|
|
|
[self dirtyLayout];
|
2015-01-29 17:10:49 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-23 23:17:57 -08:00
|
|
|
- (void)dirtyLayout
|
|
|
|
{
|
|
|
|
[self.superview dirtyLayout];
|
|
|
|
}
|
|
|
|
|
2015-06-15 12:05:04 -07:00
|
|
|
- (NSString *)description
|
|
|
|
{
|
|
|
|
NSString *superDescription = super.description;
|
|
|
|
return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; text: %@>", self.text];
|
|
|
|
}
|
|
|
|
|
2015-01-29 17:10:49 -08:00
|
|
|
@end
|