Last active
October 14, 2015 19:06
-
-
Save algal/5d8c87c9537524d32871 to your computer and use it in GitHub Desktop.
How to use UIView.recursiveDescription in a Swift playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let v = UIView() | |
// use `performSelector` to workaround that the method is private | |
// use `takeRetainedValue` to get an AnyObject | |
// use the forced cast because we know it's a string | |
let s = v.performSelector("recursiveDescription").takeRetainedValue() as! String | |
// convert the string to a fixed width font, so the quicklook is useful | |
NSAttributedString(string: s, attributes: [UIFontDescriptorFeatureSettingsAttribute:[UIFontFeatureTypeIdentifierKey:kMonospacedTextSelector]]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment