The Lazy Swift Blog

The one-page blog spreading knowledge one piece at time!

Greetings fellow Swifter! Here's my advice for you: be like lazy variables and lazy views in the Swift programming language: do the right thing, at the right time, only if it's truly needed, in the name of efficiency.

TIP OF THE DAY FOR THE SAVIOR iOS DEVELOPER:

Use 'defer' to guarantee cleanup code runs: instead of remembering to call cleanup in every return path, use 'defer' to guarantee cleanup happens. 'Defer' blocks execute in reverse order when leaving the current scope, whether by normal return, throwing an error, or breaking from a loop. Perfect for resource cleanup, logging, or any "finally" behavior you need guaranteed.

Contact Me