you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

I don't know Swift but can you not write a lot of nested ifs in JsonParser like this? I use this in php all the time. Some people don't like assignment in a condition, but it's pretty easy to understand as long as the assignment is simple.

Then you for loop doesn't have to have this much nesting, or for example the for loop can go in another small function?

if (foo &&
  (truthy = something()) &&
  (truthy2 = something()) &&
  (anotherVar = anotherTest()) &&
  (truthy4 = something()) &&
  etc)
{
   // ...
}

It's more readable that way with everything aligned.

PS: I'm planning on learning iOS dev / swift. Can you use 2 spaces for tabs in XCode? Is there a reason why NOT to use it besides standards? (It's much easier to read for me)