From 9db01278540b89c667bec7de399928bc549f06e0 Mon Sep 17 00:00:00 2001 From: Ryan Maxwell Date: Fri, 5 Dec 2014 14:36:32 +1300 Subject: [PATCH 1/3] grammar. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b43247..2d7febf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Snappy is a light-weight layout framework which wraps AutoLayout with a nicer syntax. Snappy has its own layout DSL which provides a chainable way of describing your NSLayoutConstraints which results in layout code that is more concise and readable. Snappy supports both iOS and OS X. -> Snappy uses some Swift only features like function overloading it cannot be used from Objective-C. Because of this we’ve chosen to swap prefixes from Masonry’s `mas_` to `snp_` so you can use both Masonry and Snappy in the same project. +> Snappy uses some Swift-only features like function overloading, so it cannot be used from Objective-C. Because of this we’ve chosen to swap prefixes from Masonry’s `mas_` to `snp_` so you can use both Masonry and Snappy in the same project. ## Requirements From 7cf9a9ff593b0599a770830919fdbebddda3308e Mon Sep 17 00:00:00 2001 From: Ryan Maxwell Date: Fri, 5 Dec 2014 14:36:41 +1300 Subject: [PATCH 2/3] Code Snippets! --- .../Snappy Constraint Make.codesnippet | 26 +++++++++++++++++++ .../Snappy Constraint Remake.codesnippet | 26 +++++++++++++++++++ .../Snappy Constraint Update.codesnippet | 26 +++++++++++++++++++ README.md | 10 +++++++ 4 files changed, 88 insertions(+) create mode 100644 CodeSnippets/Snappy Constraint Make.codesnippet create mode 100644 CodeSnippets/Snappy Constraint Remake.codesnippet create mode 100644 CodeSnippets/Snappy Constraint Update.codesnippet diff --git a/CodeSnippets/Snappy Constraint Make.codesnippet b/CodeSnippets/Snappy Constraint Make.codesnippet new file mode 100644 index 0000000..35bf0b8 --- /dev/null +++ b/CodeSnippets/Snappy Constraint Make.codesnippet @@ -0,0 +1,26 @@ + + + + + IDECodeSnippetCompletionPrefix + snp_make + IDECodeSnippetCompletionScopes + + CodeBlock + + IDECodeSnippetContents + <#view#>.snp_makeConstraints { make in + <#code#> +} + IDECodeSnippetIdentifier + FF434629-7B96-4AB9-BD96-522275E7B106 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetTitle + Snappy Constraint Make + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 2 + + diff --git a/CodeSnippets/Snappy Constraint Remake.codesnippet b/CodeSnippets/Snappy Constraint Remake.codesnippet new file mode 100644 index 0000000..3b28109 --- /dev/null +++ b/CodeSnippets/Snappy Constraint Remake.codesnippet @@ -0,0 +1,26 @@ + + + + + IDECodeSnippetCompletionPrefix + snp_remake + IDECodeSnippetCompletionScopes + + TopLevel + + IDECodeSnippetContents + <#view#>.snp_remakeConstraints { make in + <#code#> +} + IDECodeSnippetIdentifier + FD093546-D614-4311-82C3-E8FE842F62B1 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetTitle + Snappy Constraint Remake + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 0 + + diff --git a/CodeSnippets/Snappy Constraint Update.codesnippet b/CodeSnippets/Snappy Constraint Update.codesnippet new file mode 100644 index 0000000..b86745d --- /dev/null +++ b/CodeSnippets/Snappy Constraint Update.codesnippet @@ -0,0 +1,26 @@ + + + + + IDECodeSnippetCompletionPrefix + snp_update + IDECodeSnippetCompletionScopes + + TopLevel + + IDECodeSnippetContents + <#view#>.snp_updateConstraints { make in + <#code#> +} + IDECodeSnippetIdentifier + EBC85411-DF71-4954-9393-628A1BED8BBE + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Swift + IDECodeSnippetTitle + Snappy Constraint Update + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 0 + + diff --git a/README.md b/README.md index 2d7febf..5887912 100644 --- a/README.md +++ b/README.md @@ -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` -> `.snp_makeConstraints { make in }` + +`snp_update` -> `.snp_updateConstraints { make in }` + +`snp_remake` -> `.snp_remakeConstraints { make in }` + ## TODO * Eye candy From 6a2611f0f690aa263071edf1f0b5b69fd5d5c9a2 Mon Sep 17 00:00:00 2001 From: Ryan Maxwell Date: Wed, 10 Dec 2014 20:48:07 +1300 Subject: [PATCH 3/3] Delete Snappy Constraint Update code snippet, 'cos snp_updateConstraints don't exist. --- .../Snappy Constraint Update.codesnippet | 26 ------------------- README.md | 2 -- 2 files changed, 28 deletions(-) delete mode 100644 CodeSnippets/Snappy Constraint Update.codesnippet diff --git a/CodeSnippets/Snappy Constraint Update.codesnippet b/CodeSnippets/Snappy Constraint Update.codesnippet deleted file mode 100644 index b86745d..0000000 --- a/CodeSnippets/Snappy Constraint Update.codesnippet +++ /dev/null @@ -1,26 +0,0 @@ - - - - - IDECodeSnippetCompletionPrefix - snp_update - IDECodeSnippetCompletionScopes - - TopLevel - - IDECodeSnippetContents - <#view#>.snp_updateConstraints { make in - <#code#> -} - IDECodeSnippetIdentifier - EBC85411-DF71-4954-9393-628A1BED8BBE - IDECodeSnippetLanguage - Xcode.SourceCodeLanguage.Swift - IDECodeSnippetTitle - Snappy Constraint Update - IDECodeSnippetUserSnippet - - IDECodeSnippetVersion - 0 - - diff --git a/README.md b/README.md index 5887912..5e9e57d 100644 --- a/README.md +++ b/README.md @@ -280,8 +280,6 @@ Copy the included code snippets to ``~/Library/Developer/Xcode/UserData/CodeSnip `snp_make` -> `.snp_makeConstraints { make in }` -`snp_update` -> `.snp_updateConstraints { make in }` - `snp_remake` -> `.snp_remakeConstraints { make in }` ## TODO