Skip to content
  • Oskar Kwaśniewski's avatar
    feat: add conditionals for iOS only code in `RCTDeviceInfo.mm` (#45176) · c5653a03
    Oskar Kwaśniewski authored
    Summary:
    Having React Native support every Apple platform is tough to achieve as it introduces many platform-specific ifdefs.
    
    On the other side, maintaining an OOT platform fork is already a demanding job, so to make it easier I propose adding ifdefs for iOS-specific code. Thanks to this change, OOT platforms can focus on their OS-specific features while the core is also adding iOS-specific features behind ifdefs. Fortunately, **most of the code on Apple platforms can be shared** and this PR aims to introduce better support for this and to minimize OOT fork's surface.
    
    In this example `RCTDeviceInfo.mm` has support for handling orientation changes and the availability of this feature across Apple OS looks as follows:
    
    | Platform  | Support |
    | ------------- | ------------- |
    | macOS |    |
    | tvOS |    |
    | visionOS |    |
    | iOS/iPadOS |    |
    
    Here is a table from `TargetConditionals.h` header file which shows the coverage ...
    c5653a03
This project manages its dependencies using Bundler. Learn more