Swift vs. Flutter – Unveiling the Battle of iOS Development Titans!
Today, if you graze your eyes over things people are doing to make money and generate a massive load of revenues, you’ll soon find out that there is an app helping them climb the success tree. And if you’re too seeking such a help for…
Error “Missing package product” for Swift Packages (SPM)
Error Missing package product <package name> Problem Have you added some Swift Packages and, after that everything worked perfectly, Xcode thrown this error? After multiple attempts, I found this solution that worked perfectly. Solution Close Xcode Open Terminal where the directory of your .xcodeproj is…
Understanding Dependency Injection in Swift
What is Dependency Injection? As the name says, this technique allows you to pass/inject objects (dependencies) to a receiver object. There are two types of dependency injection: Constructor Injection Property Injection But what is a Dependency? A Dependency is an object (eg. a class) that…
Abstract Factory Pattern in Swift
Abstract Factory is a pattern that allow you to create families of object that conform to a common protocol. This patterns has three main components: the factory, the product and a client. Factory: Factory protocol: Declares an interface that allows to create abstract objects. Concrete…
Create Custom Units and Dimensions in Swift (Part 2)
In this article we are going to lear how to create custom units and dimensions to extend the ones that Swift offers. Creating a Custom Unit To create a custom unit we need to use the initializer of the dimension we want to add a…
Units and Measurement Conversion in Swift (Part 1)
Most developers are not aware that Apple introduced the units and measurements APIs. They are part of the Foundation framework and available on every Apple platform. Let’s get started by seeing what Unit, Dimension, and Measurement are. Unit The Unit class represents a unit that…
How to Create Swift Macros with Xcode 15
What are Macros? Swift Macros allow you to generate repetitive code at compile time, making your app’s codebase more easier to read and less tedious to write. There are two types of macros: Freestanding macros stand in place of something else in your code. They…
Make Code Easier to Write and Read in Swift 5.9
Swift 5.9 introduces some improvements that will allow a more clear and less tedious to write code. This changes affect if else and switch statements. Let’s see them more in detail. If-else The ternary syntax is really handy and allows us to return a result…