If you show the Utilities pane on the far right of the XCode window, then select the “{ }” button, it shows code snippets that you can type the shortcut for, or drag and drop into your source code. How do you create your own?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Although the documentation is very scant on this, I did find a blog post by Jason Brennan that describes step-by-step.
NOTE: You can use prompters denoted by <#prompterName#> that will give blue bubbles that you can tab to, and replace with “parameters” in your source. For example:
NSDictionary *<#varibleName#> = [[NSBundle mainBundle] infoDictionary];
NOTE: Depending on the language of the source code file you are editing, your new snippet will default to be in that language. In this way, snippets are selectively used for Swift or Objective-C depending on your context.
NOTE: If you attempt to drag highlighted text, and it unselects and starts a new selection instead, try to start your drag action in the whitespace off to the right of your selected text.
Also, to delete your snippets, click to highlight in the snippet library, and press the “Delete” key.