Linked List Swift

❗A linked list is a collection of values arranged in a linear unidirectional sequence. A linked list has several theoretical advantages over contiguous storage options such as the Swift Array:   ✅ Constant time insertion and removal from the front of the list. ✅ Reliable performance characteristics.   ❗A linked list is a chain of …

Linked List Swift Read More »

Prototype Pattern

Prototype is a creational design pattern that lets you copy existing objects without making your code dependent on their classes.   💡 Use the Prototype pattern when your code shouldn’t depend on the concrete classes of objects that you need to copy.   This happens a lot when your code works with objects passed to …

Prototype Pattern Read More »

Pattern Singleton

Singleton is a creational design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.   – Use the Singleton pattern when a class in your program should have just a single instance available to all clients; for example, a single database object shared …

Pattern Singleton Read More »

CI/CD

Continuous Integration:   Developers who use continuous integration merge their changes back into the main branch whenever possible. Changes made by a developer are verified by creating an assembly and running automated tests on that assembly. With this approach, you avoid the hassle of integrating when you have to wait for release day to merge …

CI/CD Read More »

Iterator Pattern

Iterator is a behavioral design pattern that lets you traverse elements of a collection without exposing its underlying representation (list, stack, tree, etc.).  – Use the Iterator pattern when your collection has a complex data structure under the hood, but you want to hide its complexity from clients (either for convenience or security reasons).  The iterator encapsulates …

Iterator Pattern Read More »

Actor in Swift

Actor is a concrete nominal type in Swift to tackle data synchronisation. They are reference types and can have methods, and properties, and also can implement protocols, but they don’t support inheritance which makes their initializers much simpler — there is no need for convenience initializers, overriding, the final keyword. Actors are created using the …

Actor in Swift Read More »

Facade Pattern

Facade is a structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of classes.  Applicability  – Use the Facade pattern when you need to have a limited but straightforward interface to a complex subsystem. Often, subsystems get more complex over time. Even applying design patterns typically leads to …

Facade Pattern Read More »

Command Pattern

Command is a behavioral design pattern that turns a request into a stand-alone object that contains all information about the request. This transformation lets you pass requests as a method arguments, delay or queue a request’s execution, and support undoable operations.  Applicability  Use the Command pattern when you want to parametrize objects with operations.  The Command pattern …

Command Pattern Read More »

Generics in Swift

Generic code enables you to write flexible, reusable functions and types that can work with any type, subject to requirements that you define. You can write code that avoids duplication and expresses its intent in a clear, abstracted manner. Generics are one of the most powerful features of Swift, and much of the Swift standard library …

Generics in Swift Read More »

Access Levels in Swift

Open/Public Internal Fileprivate Private Open access and public access enable entities to be used within any source file from their defining module, and also in a source file from another module that imports the defining module. You typically use open or public access when specifying the public interface to a framework. Open access is the highest …

Access Levels in Swift Read More »