devxoul / Then

✨ Super sweet syntactic sugar for Swift initializers
MIT License
4.18k stars 290 forks source link

Suggestion: Then? Why not With? #7

Closed mattijsf closed 8 years ago

mattijsf commented 8 years ago

Nice idea!

I personally suggest a different keyword: .with { ... }

UILabel().with {
    $0.textColor = .blackColor() 
} 

Makes a bit more sense.

The keword/idea reminds me a bit of the old VB's With...End With statement: https://msdn.microsoft.com/en-us/library/wc500chb.aspx

devxoul commented 8 years ago

Hi @mattijsf! Why I chose then instead of with is to avoid name conflicts. Because with() is more general than then(). That means, other frameworks might have with() already.

mattijsf commented 8 years ago

Okay! Sounds like you already gave it a thought :)