mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
644 B
Matlab
32 lines
644 B
Matlab
8 years ago
|
//
|
||
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "NSString+OWS.h"
|
||
8 years ago
|
#import "UIView+OWS.h"
|
||
8 years ago
|
|
||
8 years ago
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
8 years ago
|
@implementation NSString (OWS)
|
||
|
|
||
|
- (NSString *)ows_stripped
|
||
|
{
|
||
8 years ago
|
return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||
8 years ago
|
}
|
||
|
|
||
8 years ago
|
- (NSString *)rtlSafeAppend:(NSString *)string referenceView:(UIView *)referenceView
|
||
|
{
|
||
|
OWSAssert(string);
|
||
|
OWSAssert(referenceView);
|
||
|
|
||
|
if ([referenceView isRTL]) {
|
||
|
return [string stringByAppendingString:self];
|
||
|
} else {
|
||
|
return [self stringByAppendingString:string];
|
||
|
}
|
||
|
}
|
||
|
|
||
8 years ago
|
@end
|
||
8 years ago
|
|
||
|
NS_ASSUME_NONNULL_END
|