Xcode shortcuts

/Xcode shortcuts
  1. Find matching brace, bracket or parenthesis
    Double tap on one of the nested parenthesis, code within the braces will be highlighted.
  2. Setting Optimization level
    Optimization level defines how code are compiled and linked. For code debugging this should be disabled other wise breakpoint will not behave properly. Xcode will complain about the same by printing message “App Name was compiled with optimization – stepping may behave oddly; variables may not be available.” on Xcode console. Different optimization flags you want to turn off for debugging are :
    • LLVM Link Time Optimization (-flto)
    • LLVM Optimization Level (-O)
    • Swift Compiler Optimization Level

    Set the Optimization Level to None while debugging to make the message go away and your break points behave normally. Project setting to change for the same is: 

  3. Commenting out multiple lines of code
    Command + /
  4. Search through and open any file
    Command + Shift + O
  5. See the scope of functions and braces
    Command + mouse hover over the braces.
  6. Fold the scope by one level.
    Command + Alt (Option) + Left arrow key
    To open the scope, select right arrow key
  7. Jump to the function definition
    Command + click
  8. Navigating between accessed files
    Command + Control + Left or Right arrow keys to navigate between the previous and next files that you accessed

September 13th, 2019|Categories: Miscellaneous|
Notify of