iOS

Async Await with SwiftUI

In this article It has explanation how to use async/await with two network callsWe can use an array of Task instances to manage multiple concurrent tasks in Swift. This approach is useful for running multiple network requests in parallel and handling their results collectively. Here’s how you can incorporate an array of Task instances into […]

Async Await with SwiftUI Read More »

Count all prime numbers

[Question] Count all prime numbers from given nExample Input: n = 10Output: 4Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.Solution: using Sieve of Eratosthenes AlgoThe Sieve of Eratosthenes is an ancient and efficient algorithm for finding all prime numbers up to a specified integer \( n \). It

Count all prime numbers Read More »

SOLID principles in swift

SOLID represents 5 five design principles intended to make object-oriented designs more understandable, flexible, and maintainable.  Let’s discuss one by one 1. Single Responsibility Principle Every class should have only one responsibilityExample: In below example class UserProfileManager is single responsibility class which has getUserProfile function 2.Open/Closed Principle Software entities such as classes, modules, and functions should be open for

SOLID principles in swift Read More »