gooberboobbutt gooberboobbutt - 7 months ago 13
Swift Question

If you have "return" in brackets, will following code outside of the bracket not be executed?

Here is the code in question.

if let error = error {


So if error != nil and it lets error = error, it will print to the console and return, so it will not run userSetDisplayName. Otherwise if error == nil, it doesnt print and it does not return and it will run userSetDisplayName. Is this the case?


Yes. Any return statement will end the current subprogram.

Also: This is not a bracket: {, it's a curly brace, or just braces