Git

Git Cheat Sheet

Git

List of commands that I use for my day-to-day development workflows. I will update this post with typical workflows and development scenarios later on.

Read More

Objective-C

Concise code · using a macro in a return statement

Objective-C

So, I bet this will sound familiar: for filling a table view you need to return either

  • The number of items in the datasource to indicate the required number of rows, or
  • 1 — in case there are no items and we need to show a cell stating that there is no content.

Solution 1 · Verbose

if ([self.catalogue.products count]) {  
    return [self.catalogue.products count];
} else {
    return 1;
}

Creating an if-else statement creates a lot of wasted space around the

Read More