Skip to content

Instantly share code, notes, and snippets.

@EvgenyKarkan
Last active January 4, 2016 00:08
Show Gist options
  • Select an option

  • Save EvgenyKarkan/8539278 to your computer and use it in GitHub Desktop.

Select an option

Save EvgenyKarkan/8539278 to your computer and use it in GitHub Desktop.

Revisions

  1. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -84,6 +84,7 @@ switch (type)
    if (someInstance != nil){
    //do stuff
    }

    while (isTrue){
    //do stuff
    }
  2. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 25 additions and 0 deletions.
    25 changes: 25 additions & 0 deletions ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -49,6 +49,14 @@
    if (someInstance != nil) {
    //do stuff
    }

    while (isTrue) {
    //do stuff
    }

    switch (type) {
    //do stuff
    }
    ```

    ### Curlybrace with new line
    @@ -58,6 +66,16 @@ if (someInstance != nil)
    {
    //do stuff
    }

    while (isTrue)
    {
    //do stuff
    }

    switch (type)
    {
    //do stuff
    }
    ```

    ### Curlybrace with no space
    @@ -66,6 +84,13 @@ if (someInstance != nil)
    if (someInstance != nil){
    //do stuff
    }
    while (isTrue){
    //do stuff
    }

    switch (type){
    //do stuff
    }
    ```

    ## Brace Placement (Methods)
  3. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 20 additions and 1 deletion.
    21 changes: 20 additions & 1 deletion ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@
    /* width is within 150 characters */
    ```

    ## Block Statements
    ## Brace Placement (Control Structure)

    ### Curlybrace with one space

    @@ -66,4 +66,23 @@ if (someInstance != nil)
    if (someInstance != nil){
    //do stuff
    }
    ```

    ## Brace Placement (Methods)

    ### Curlybrace from new line

    ```objective-с
    - (void)clearAllDataWithCompletionBlock:(void (^)(NSString *))block
    {
    //do stuff
    }
    ```

    ### Curlybrace on same line

    ```objective-с
    - (void)clearAllDataWithCompletionBlock:(void (^)(NSString *))block {
    //do stuff
    }
    ```
  4. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@

    ```objective-c
    if (someInstance != nil) {
    //do stuff
    //do stuff
    }
    ```

    @@ -56,14 +56,14 @@ if (someInstance != nil) {
    ```objective-c
    if (someInstance != nil)
    {
    //do stuff
    //do stuff
    }
    ```

    ### Curlybrace with no space

    ```objective-c
    if (someInstance != nil){
    //do stuff
    //do stuff
    }
    ```
  5. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 27 additions and 0 deletions.
    27 changes: 27 additions & 0 deletions ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -39,4 +39,31 @@

    ```objective-c
    /* width is within 150 characters */
    ```

    ## Block Statements

    ### Curlybrace with one space

    ```objective-c
    if (someInstance != nil) {
    //do stuff
    }
    ```

    ### Curlybrace with new line

    ```objective-c
    if (someInstance != nil)
    {
    //do stuff
    }
    ```

    ### Curlybrace with no space

    ```objective-c
    if (someInstance != nil){
    //do stuff
    }
    ```
  6. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -25,13 +25,16 @@
    ```objective-c
    /* width is within 80 characters */
    ```
    ### Line length is within 100 characters.

    ```objective-c
    /* width is within 100 characters */
    ```
    ### Line length is within 120 characters.

    ```objective-c
    /* width is within 120 characters */
    ```

    ### Line length is within 150 characters.

    ```objective-c
  7. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -17,4 +17,23 @@
    // uses 1 tab for indentation
    return data;
    }
    ```
    ## Line Length over 80 characters

    ### Line length is within 80 characters.

    ```objective-c
    /* width is within 80 characters */
    ```

    ### Line length is within 120 characters.

    ```objective-c
    /* width is within 120 characters */
    ```

    ### Line length is within 150 characters.

    ```objective-c
    /* width is within 150 characters */
    ```
  8. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@
    ```objective-c
    - (NSData *)returnSomething
    {
    // uses 1 tab for indentation
    // uses 1 tab for indentation
    return data;
    }
    ```
  9. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@
    ```objective-c
    - (NSData *)returnSomething
    {
    // uses 4 spaces for indentation
    return data;
    }
    ```
    @@ -13,6 +14,7 @@
    ```objective-c
    - (NSData *)returnSomething
    {
    // uses 1 tab for indentation
    return data;
    }
    ```
  10. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,18 @@
    ## Space vs Tab

    ### Space

    ```objective-c
    - (NSData *)returnSomething
    {
    return data;
    }
    ```
    ### Tabs

    ```objective-c
    - (NSData *)returnSomething
    {
    return data;
    }
    }
    ```
  11. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,11 @@
    ## Space vs Tab
    ### Space
    ```objective-c
    - (NSData *)returnSomething
    {
    return data;
    }

    ```
    ### Tabs
    - (NSData *)returnSomething
    {
  12. EvgenyKarkan revised this gist Jan 21, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@
    {
    return data;
    }

    ### Tabs
    - (NSData *)returnSomething
    {
  13. EvgenyKarkan created this gist Jan 21, 2014.
    11 changes: 11 additions & 0 deletions ObjC-conventions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    ## Space vs Tab
    ### Space
    - (NSData *)returnSomething
    {
    return data;
    }
    ### Tabs
    - (NSData *)returnSomething
    {
    return data;
    }