Code Snippets!

This commit is contained in:
Ryan Maxwell 2014-12-05 14:36:41 +13:00
parent 9db0127854
commit 7cf9a9ff59
4 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDECodeSnippetCompletionPrefix</key>
<string>snp_make</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>CodeBlock</string>
</array>
<key>IDECodeSnippetContents</key>
<string>&lt;#view#&gt;.snp_makeConstraints { make in
&lt;#code#&gt;
}</string>
<key>IDECodeSnippetIdentifier</key>
<string>FF434629-7B96-4AB9-BD96-522275E7B106</string>
<key>IDECodeSnippetLanguage</key>
<string>Xcode.SourceCodeLanguage.Swift</string>
<key>IDECodeSnippetTitle</key>
<string>Snappy Constraint Make</string>
<key>IDECodeSnippetUserSnippet</key>
<true/>
<key>IDECodeSnippetVersion</key>
<integer>2</integer>
</dict>
</plist>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDECodeSnippetCompletionPrefix</key>
<string>snp_remake</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>TopLevel</string>
</array>
<key>IDECodeSnippetContents</key>
<string>&lt;#view#&gt;.snp_remakeConstraints { make in
&lt;#code#&gt;
}</string>
<key>IDECodeSnippetIdentifier</key>
<string>FD093546-D614-4311-82C3-E8FE842F62B1</string>
<key>IDECodeSnippetLanguage</key>
<string>Xcode.SourceCodeLanguage.Swift</string>
<key>IDECodeSnippetTitle</key>
<string>Snappy Constraint Remake</string>
<key>IDECodeSnippetUserSnippet</key>
<true/>
<key>IDECodeSnippetVersion</key>
<integer>0</integer>
</dict>
</plist>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDECodeSnippetCompletionPrefix</key>
<string>snp_update</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>TopLevel</string>
</array>
<key>IDECodeSnippetContents</key>
<string>&lt;#view#&gt;.snp_updateConstraints { make in
&lt;#code#&gt;
}</string>
<key>IDECodeSnippetIdentifier</key>
<string>EBC85411-DF71-4954-9393-628A1BED8BBE</string>
<key>IDECodeSnippetLanguage</key>
<string>Xcode.SourceCodeLanguage.Swift</string>
<key>IDECodeSnippetTitle</key>
<string>Snappy Constraint Update</string>
<key>IDECodeSnippetUserSnippet</key>
<true/>
<key>IDECodeSnippetVersion</key>
<integer>0</integer>
</dict>
</plist>

View File

@ -274,6 +274,16 @@ func changeButtonPosition() {
}
```
## Code Snippets
Copy the included code snippets to ``~/Library/Developer/Xcode/UserData/CodeSnippets`` to write your snappy closures at lightning speed!
`snp_make` -> `<view>.snp_makeConstraints { make in <code> }`
`snp_update` -> `<view>.snp_updateConstraints { make in <code> }`
`snp_remake` -> `<view>.snp_remakeConstraints { make in <code> }`
## TODO
* Eye candy