Created
March 29, 2023 07:15
-
-
Save Atsumi3/178f1de4fa7dfa86813b8a553599ffaa to your computer and use it in GitHub Desktop.
iOS Dump UIView child tree
This file contains 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
import UIKit | |
extension UIView { | |
func dumpChildViewTree(_ indent: Int = 0) { | |
print("\(String(repeating: " ", count: indent)) \(className)") | |
subviews.forEach { $0.dumpChildViewTree(indent + 1) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment