Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion React/Modules/RCTI18nUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
*/
@interface RCTI18nUtil : NSObject

+ (instancetype)sharedInstance;

- (BOOL)isRTL;
- (BOOL)isRTLAllowed;
- (void)allowRTL:(BOOL)value;
- (BOOL)isRTLForced;
- (void)forceRTL:(BOOL)value;
+ (id)sharedInstance;

@end
16 changes: 9 additions & 7 deletions React/Modules/RCTI18nUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@

@implementation RCTI18nUtil

+ (id)sharedInstance {
static RCTI18nUtil *sharedRCTI18nUtilInstance = nil;
@synchronized(self) {
if (sharedRCTI18nUtilInstance == nil)
sharedRCTI18nUtilInstance = [self new];
}
return sharedRCTI18nUtilInstance;
+ (instancetype)sharedInstance
{
static RCTI18nUtil *sharedInstance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [self new];
});

return sharedInstance;
}

/**
Expand Down