Skip to content

Instantly share code, notes, and snippets.

@mvnrc
Last active November 1, 2023 13:26
Show Gist options
  • Save mvnrc/da407e78f2a413399794e3de2700c08e to your computer and use it in GitHub Desktop.
Save mvnrc/da407e78f2a413399794e3de2700c08e to your computer and use it in GitHub Desktop.
Print current UIViewController class name on viewDidAppear in debug console in Xcode (Swift/Objective-C)
  • Create a Symbolic Breakpoint in Xcode
  • for Symbol, add -[UIViewController viewWillAppear:]
  • for Action, add a Debugger Command and the following expression:
    expr -- (void) printf("🔘 %s\n", (char *)object_getClassName($arg1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment