Live templates
Live templates let you quickly create common code elements in a source file.
Please refer to JetBrains’ documentation about live templates to learn more about the feature.
Swift live templates
Noctule provides live templates for Swift files. All available live templates are shown below.
| Abbreviation | Title | Description |
|---|---|---|
class | Class declaration | Inserts a declarations of an empty class |
struct | Struct declaration | Inserts a declarations of an empty struct |
protocol | Protocol declaration | Inserts a declarations of an empty protocol |
actor | Actor declaration | Inserts a declarations of an empty actor |
enum | Enum declaration | Inserts a declarations of an empty union-style enum |
extension | Extension declaration | Inserts a new extension declaration |
func | Function declaration | Inserts a declarations of an empty function |
init | Initializer declaration | Inserts an empty initializer declaration |
deinit | Deinitializer declaration | Inserts an empty deinitializer declaration |
var | Var declaration | Inserts an empty var declaration |
let | Let declaration | Inserts an empty let declaration |
defer | defer statement | Inserts an empty defer statement |
for | for-in statement | Inserts a new for-in statement |
Objective-C live templates
Noctule provides live templates for Objective-C files. All available live templates are shown below.
| Abbreviation | Title | Description |
|---|---|---|
log | Insert new NSLog call | Inserts a new NSLog call as a new statement. |
logm | Log current function/method | Inserts a new NSLog call statement to log the execution context. |
pm | #pragma mark | Inserts a #pragma marker |
for | Indexed for loop | Inserts an index-based for loop. |
while | while loop | Inserts a while loop. |
if | if statement | Inserts an if statement. |
ifelse | if-else statement | Inserts an if statement with an else branch. |
switch | switch statement | Inserts a switch statement with a default branch. |
struct | struct declaration | Inserts a struct declaration. |
enum | enum declaration | Inserts an enum declaration. |
def | #define directive | Inserts a #define preprocessor directive. |
inc | #include directive | Inserts a #include directive with a quoted path. |
incs | #include directive (system header) | Inserts a #include directive with an angle-bracket path. |
imp | #import directive | Inserts a #import directive with a quoted path. |
guard | Include guard | Inserts an include guard derived from the file name. |
intf | @interface declaration | Inserts a class interface declaration. |
impl | @implementation declaration | Inserts a class implementation. |
prot | @protocol declaration | Inserts a protocol declaration. |
ext | Class extension | Inserts a class extension declaration. |
cat | Category declaration | Inserts a category declaration. |
block | Block typedef | Inserts a typedef of a block type. |
init | Initializer implementation | Inserts the canonical init method implementation. |
props | @property (strong) | Inserts a strong property declaration. |
propw | @property (weak) | Inserts a weak property declaration. |
propc | @property (copy) | Inserts a copy property declaration. |
propa | @property (assign) | Inserts an assign property declaration. |
propro | @property (readonly) | Inserts a readonly property declaration. |
ibac | IBAction method | Inserts an IBAction method. |
each | Fast enumeration loop | Inserts a for-in loop over a collection. |
dam | dispatch_async on the main queue | Inserts a dispatch_async call on the main queue. |
once | dispatch_once block | Inserts a dispatch_once call with a static token. |
after | dispatch_after on the main queue | Inserts a delayed dispatch_after call on the main queue. |
swf | NSString with format | Inserts a stringWithFormat call. |