Skip to content

Instantly share code, notes, and snippets.

@quanganhdo
Forked from mvnrc/breakpoint.png
Created November 1, 2023 13:26
Show Gist options
  • Select an option

  • Save quanganhdo/b4217be02706f6bf89fc570dcfc8e8b7 to your computer and use it in GitHub Desktop.

Select an option

Save quanganhdo/b4217be02706f6bf89fc570dcfc8e8b7 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