Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added documents directory snippet

  • Loading branch information...
commit ed36712699844f7a546055279f8a16855dc83e7a 1 parent 7929410
@jaydee3 authored
Showing with 38 additions and 0 deletions.
  1. +8 −0 README.md
  2. +30 −0 getDocumentsDirectory.codesnippet
View
8 README.md
@@ -53,6 +53,14 @@ Shortcut for a formatted string
[NSString stringWithFormat: @"<#string#>", <#param1#>]
+**getDocumentsDirectory.codesnippet** (Get Documents directory)
+Shortcut: `documents`
+Create path to documents directory
+
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths objectAtIndex:0];
+ NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"<#fileName#>"];
+
**importFramework.codesnippet** (Import Framework)
Shortcut: `imp2`
import a framework
View
30 getDocumentsDirectory.codesnippet
@@ -0,0 +1,30 @@
+<?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>documents</string>
+ <key>IDECodeSnippetCompletionScopes</key>
+ <array>
+ <string>CodeBlock</string>
+ </array>
+ <key>IDECodeSnippetContents</key>
+ <string>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths objectAtIndex:0];
+NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"&lt;#fileName#&gt;"];</string>
+ <key>IDECodeSnippetIdentifier</key>
+ <string>5D5547B6-84D8-4B0D-88CE-5680D8095581</string>
+ <key>IDECodeSnippetLanguage</key>
+ <string>Xcode.SourceCodeLanguage.Objective-C</string>
+ <key>IDECodeSnippetPlatformFamily</key>
+ <string>iphoneos</string>
+ <key>IDECodeSnippetSummary</key>
+ <string>Create path to documents directory</string>
+ <key>IDECodeSnippetTitle</key>
+ <string>Get Documents directory</string>
+ <key>IDECodeSnippetUserSnippet</key>
+ <true/>
+ <key>IDECodeSnippetVersion</key>
+ <integer>0</integer>
+</dict>
+</plist>
Please sign in to comment.
Something went wrong with that request. Please try again.