From 48b2244ac353890d7ebf3ecff908a6baab625ebb Mon Sep 17 00:00:00 2001 From: gprasant Date: Fri, 19 Feb 2016 08:13:46 -0800 Subject: Add documentation comment for If let --- swift.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'swift.html.markdown') diff --git a/swift.html.markdown b/swift.html.markdown index 46768375..e921e7ea 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -94,6 +94,8 @@ var unwrappedString: String! = "Value is expected." // same as above, but ! is a postfix operator (more syntax candy) var unwrappedString2: ImplicitlyUnwrappedOptional = "Value is expected." +// If let structure - +// If let is a special structure in Swift that allows you to check if an Optional rhs holds a value, and in case it does - unwraps and assigns it to the lhs. if let someOptionalStringConstant = someOptionalString { // has `Some` value, non-nil if !someOptionalStringConstant.hasPrefix("ok") { -- cgit v1.2.3