rx-swift

Use of unresolved identifier 'Resources'

RxSwift.Resources are being used to detect memory leaks during pre release tests. Solving Use of unresolved identifier 'Resources' error.

RxSwift.Resources are being used to detect memory leaks during pre release tests.

The problem:

When trying to use RxSwift.Resources the following error occurs:

Use of unresolved identifier 'Resources'

The solution:

RxSwift.Resources are compiled conditionally and only when the “TRACE_RESOURCES” flag is present.

To include RxSwift.Resources for debug builds, update Podfile with the following code:

post_install do |installer|
   installer.pods_project.targets.each do |target|
      if target.name == 'RxSwift'
         target.build_configurations.each do |config|
            if config.name == 'Debug'
               config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
            end
         end
      end
   end
end

Subscribe to The infinite monkey theorem

Get the latest posts delivered right to your inbox