Get Updates By E-mail 

Article Written By:
Johann Dowa

Xcode Plugin Adding Code Snippets That Are Entered Using Text Trigger Strings

  •  
  •  
  •  
  •  
  •  

About a year ago I mentioned the XcodeSwiftSnippets library providing a wide number of code snippets for use within Xcode.

Here’s an Xcode plugin that allows you to create and use text trigger based snippets rather than having to go through the dropdown menu called HKSnippet from hunk3000. If you’re familiar with the Emmet tool for web developers HKSNippet adds similar functionality to Xcode.

This example from the readme shows some example snippets related to properties:

@ps expands to @property (strong) type *value;
@prs expands to @property (strong, readonly) type *value;
@pns expands to @property (noatomic, strong) type *value;
@prns expands to @property (nonatomic, strong, readonly) type *value;

HKSnippet has a number of snippets built-in, provides its own interface for entering code snippets, and browsing and searching through different snippets. Here is an animation showing HKSnippet built-in:

HKSnippet

You can find HKSnippet on Github here.

A nice plugin for code snippets.

Find more plugins on the Xcode plugin guide.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments