Search code examples
swiftxcodecode-snippets

Is there any shortcut for // MARK: in Xcode like there is for /// <#Description#>?


Is there any keyboard shortcut for '// MARK:' in swift like there is for header doc '/// Description' ?


Solution

  • There is no problem to add it as a code snippet to Xcode.

    What you should do is:

    • Type: // MARK: <#Description#>, select it and then drag it to the code snippet in the utilities section:

    enter image description here

    • Fill the popup form, as follows:

    enter image description here

    and that's it!

    Usage:

    As per the screenshot above, the completion handler shortcut is: 'm'; By typing 'm' in the code area, you should see:

    enter image description here