[swift-evolution] What about a VBA style with Statement?

李海珍 banxi1988 at gmail.com
Wed Apr 13 08:15:08 CDT 2016


I recently learned some VBA and I found a very conveniently `with`
statement.

`with` statement can be helpful to set property for UIKit instance.

for instance a UILabel instance `textLabel` ,with `with` statement we can
set UILabel property like this


```swift

with textLabel{

.textAlignment = .Left

.textColor = UIColor.darkTextColor()

.font = UIFont.systemFontOfSize(15)

}

```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160413/effaa090/attachment.html>


More information about the swift-evolution mailing list