Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return instancetype for shared RCTI18nUtil instance
Summary: In modern Objective-C you should use the `instancetype` keyword for methods which return an instance of the class they are called on. See Apple's [Adopting Modern Objective-C](https://developer.apple.com/library/content/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObjective-C/AdoptingModernObjective-C.html) guide. Because `sharedInstance` was returning an object of type `id`, the returned value needed to be cast before it could be used in Swift. I also changed the implementation of `sharedInstance` to use Grand Central Dispatch, which is the generally accepted best way of creating a singleton in Objective-C. I verified my changes with the "RTLExample" app in RNTester. | LTR | RTL | |---|---| |<img width="300" src="https://user-images.githubusercontent.com/1413388/31155210-6454b4d6-a87a-11e7-9dd7-9a52f3924737.png">|<img width="300" src="https://user-images.githubusercontent.com/1413388/31155233-8702aff6-a87a-11e7-8028-51cf2b3eb0c4.png">| Closes #16196 Differential Revision: D5971898 Pulled By: shergin fbshipit-source-id: dfa375c89248adfc9fd885cacc6a6d4cbfea6e90
- Loading branch information