2015-03-23 22:07:33 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00: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 22:07:33 +00:00
|
|
|
*/
|
2015-01-30 01:10:49 +00:00
|
|
|
|
2017-12-20 03:48:22 +00:00
|
|
|
#import "RCTRawTextShadowView.h"
|
2015-01-30 01:10:49 +00:00
|
|
|
|
2018-01-24 07:17:57 +00:00
|
|
|
#import <React/RCTShadowView+Layout.h>
|
2015-07-31 14:37:12 +00:00
|
|
|
|
2017-12-20 03:48:22 +00:00
|
|
|
@implementation RCTRawTextShadowView
|
2015-01-30 01:10:49 +00:00
|
|
|
|
|
|
|
- (void)setText:(NSString *)text
|
|
|
|
{
|
2015-11-04 12:04:37 +00:00
|
|
|
if (_text != text && ![_text isEqualToString:text]) {
|
2015-01-30 01:10:49 +00:00
|
|
|
_text = [text copy];
|
2018-01-24 07:17:57 +00:00
|
|
|
[self dirtyLayout];
|
2015-01-30 01:10:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-24 07:17:57 +00:00
|
|
|
- (void)dirtyLayout
|
|
|
|
{
|
|
|
|
[self.superview dirtyLayout];
|
|
|
|
}
|
|
|
|
|
2015-06-15 19:05:04 +00:00
|
|
|
- (NSString *)description
|
|
|
|
{
|
|
|
|
NSString *superDescription = super.description;
|
|
|
|
return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; text: %@>", self.text];
|
|
|
|
}
|
|
|
|
|
2015-01-30 01:10:49 +00:00
|
|
|
@end
|