Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Then? Why not With? #7

Closed
mattijsf opened this issue Dec 30, 2015 · 2 comments
Closed

Suggestion: Then? Why not With? #7

mattijsf opened this issue Dec 30, 2015 · 2 comments

Comments

@mattijsf
Copy link

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
Copy link
Owner

devxoul commented Dec 30, 2015

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
Copy link
Author

mattijsf commented Jan 1, 2016

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

@mattijsf mattijsf closed this as completed Jan 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants