LoginSignup
2

More than 5 years have passed since last update.

RxSwift関連の総オブジェクト数出力

Posted at

元ネタはこちらです。
http://qiita.com/ShingoFukuyama/items/20035171f9ec78efded7

RxSwift 3.0 version だとビルドできないようでしたので改めて記述しなおすと以下になります。


    let timer = Timer(timeInterval: 3.0, target: BlockOperation.init(block: {
        print("Resource count \(RxSwift.Resources.total)")
    }), selector: #selector(Operation.main), userInfo: nil, repeats: true)
    RunLoop.main.add(timer, forMode: .commonModes)


RxSwiftをデバッグビルドしていないと、RxSwift.Resources.total の定義が無いよ、と怒られてビルド失敗します。
Carthageを使っている場合は

carthage bootstrap RxSwift --configuration Debug

と、Debugをつけてビルドする必要がありちょっと面倒です。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2