Sen Liu·Nov 27, 2018Why do you need @autoclosureWhen define a function in Swift,@autoclosure wraps an expression or a literal argument into a closure. It is just syntactic sugar. You can…
Sen Liu·Aug 8, 2018Swift: Use Self to let methods in subclass return instances of subclassMany of us know Self can be used in protocols, but Self can also be used in classes.A response icon1A response icon1
Sen Liu·Jul 31, 2018Swift: Use KeyPath to modify a variable passed by reference in Escaping ClosureIn Swift we use inout to perform pass-by-reference, however, escaping closure does not support inout. This means we cannot use inout in…A response icon1A response icon1