O'Reilly logo

Reactive Programming with Swift 4 by Navdeep Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Debugging with total

RxSwift includes another utility operator that counts all Observable allocations, called total. This is not enabled by default. To enable it, the trace resources flag needs to be added to the RxSwift target. The most reliable way to do this with CocoaPods is to set this flag to the debug configuration in the pod file's post install hook. Check the pod file of the starter project for this section, and you will note the install hook, as follows:

post_install do |installer|    installer.pods_project.targets.each do |target|        target.build_configurations.each do |config|            config.build_settings['CONFIGURATION_BUILD_DIR'] = '$                                      PODS_CONFIGURATION_BUILD_DIR'            if config.name == 'Debug'                config.build_settings['OTHER_SWIFT_FLAGS'] ||= ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required