3 ms·
Swift solves this with "guard" statements, which must return if their condition fails. This is most commonly used in combination with converting optional values
by cballard 11y ago
Swift solves this with "guard" statements, which must return if their condition fails. This is most commonly used in combination with converting optional values to non-optional values, to prevent pyramids of doom.
guard let something = maybeSomething else { return ... }