In many projects this control structure is ideal for readability:
forCount( 40 )
{
// this block is run 40 times
}
You can do exactly that in objective-C.
Given that Swift has a very different approach to macros than objective-c,
is there a way to create such a forCount(40)
control structure in Swift projects?
Some similar concepts in Swift:
for _ in 1...40
{ // this block is run 40 times }
Using an ingenious extension to Int ...
40.times
{ // this block is run 40 times }