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

Welcome to The infinite monkey theorem

Somewhere a monkey just typed Shakespeare in TypeScript. Be the first to read the masterpieces (and the hilarious misfires) landing on the blog.

Subscribe to The infinite monkey theorem

We fling fresh posts—no banana peels attached—straight to your inbox.