then() on value types are renamed to with(). (Actually both then() and with() are available on value types and do the same thing, but with() does make more sense because it's about copying.)
let point = CGPoint().with {
$0.x = 10
$0.y = 20
}
Add Then extensions on CoreGraphics by default.
Add do() in class types to execute something without returning value.
This version is compatible with Xcode 8.
then()
on value types are renamed towith()
. (Actually boththen()
andwith()
are available on value types and do the same thing, butwith()
does make more sense because it's about copying.)Add
do()
in class types to execute something without returning value.