January 27, 2026
After explaining error handling using do-try-catch, I thought it would be irresponsible not to share my daily notes on the swift Result type . It's very simple to return result from a function and handle errors especially if you want to handle both cases, success & failure. Throws is great for immed
Read →
January 25, 2026
It's important to use swift for error handling in your structs. I'm going to show you how to do this with enums. I'm excited because I really do like enums, I think they're very powerful and you should be using them in your code. I'm going to refactor the BankAccount struct with new logic. I previou
Read →
January 22, 2026
Lets piggyback off of the previous blog post where I showed you why private(set) was needed to protect your variables. You can read that post here : Using private(set) and why it's important . Here is the code that we're going to be referencing from that tutorial. struct BankAccount { var owner:Stri
Read →
January 21, 2026
Why even use private(set) when you can just declare the variable struct BankAccount { var owner:String var balance:Double } Imagine you're creating an app for a bank and every owner has a balance. Naturally, you may define a struct above with the variable balance and move on. Now the balance can be
Read →
July 16, 2025
Learn how to write your first “Hello, World!” program in Swift using Playgrounds and SwiftUI. Simple examples, clear steps, and translations in 100 languages.
Read →