MVVM with Co-ordinator

MVVM (Model-View-ViewModel) Purpose: Separate business logic, UI and data to improve testability and structure. 1. Model 2. View 3. ViewModel Coordinator Pattern Purpose: Decouples navigation logic from view controllers. This helps to: Coordinator Responsibilities:

SOLID Principle

The SOLID principles are five design principles that help create maintainable, scalable, and testable software. 1. Single Responsibility Principle (SRP) A class should have only one reason to change (i.e only one responsibility). Example (Violating SRP) Example (Following SRP) 2.Open/Closed Principle A class should be open for extension but closed …

Design Patterns in iOS

Design patterns help in structuring code efficiently and making it reusable, maintainable, and scalable. Here are some commonly used design patterns in Swift with examples: 1. Creational Design Patterns (Object Creation) 1.1 Singleton Pattern Ensures only one instance of a class exists. 1.2 Factory Pattern Creates objects without specifying the …

Dependency Injection in iOS

Dependency Injection (DI) in Swift is a design pattern that allows to inject dependencies into a class instead of letting the class create them itself. This improves testability, modularity and flexibility. There are three main types of Dependency Injection in Swift: 1. Constructor Injection (Initialiser Injection) 2. Property Injection 3. …

Architecture Patterns in iOS

1. MVC (Model-View-Controller) MVC is the default architecture pattern where 2. MVVM (Model-View-ViewModel) MVVM with Dependency Inversion (DI) Difference Between MVVM and MVC MVVM (Model-View-ViewModel) and MVC (Model-View-Controller) are two popular architectural patterns used in iOS app development, particularly when working with Swift. Each pattern has its own set of …