9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

UIView のデバッグに便利な recursiveDescription を Swift で使う

Last updated at Posted at 2016-02-24

recursiveDescription メソッドはビューの階層構造をダンプできてデバッグに便利です。
プライベートメソッドなので performSelector を使います。

(lldb) po self.contentView.performSelector("recursiveDescription")
▿ Unmanaged<AnyObject>
  - _value : <UIButton: 0x7ff21159abe0; frame = (0 0; 60 60); alpha = 0; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x7ff211599f80>>
   | <UIButtonLabel: 0x7ff21159b540; frame = (0 0; 0 0); hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7ff21159bb90>>

Objective-C と同じでいけると思ったら ダメでした。

(lldb) po self.contentView.recursiveDescription()
error: <EXPR>:1:1: error: value of type '$__lldb_context' has no member 'recursiveDescription'
9
9
1

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
9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?