mirror of
https://github.com/status-im/react-native.git
synced 2025-01-25 00:39:03 +00:00
09680f71df
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 https://github.com/facebook/react-native/pull/16196 Differential Revision: D5971898 Pulled By: shergin fbshipit-source-id: dfa375c89248adfc9fd885cacc6a6d4cbfea6e90