In this part, we will look a very basic approach to a network call in swift. In later parts we will look at advanced and nice way.

In this article we will look at how we could make a network call in swift for fetching the data from backend services.

We will not be using any third party for network calls, instead we will be using apples own api services URLSession.

Also we will be using openweathermap for fetching a json response of weather information.

Be sure about these things before Integrating API in app

  • Do we need GET method or POST method or Both.
  • A JSON body to know…

If You are an iOS Developer , you must take a look here . You will find this article very helpfull .

Why This Article ?

The time when I was exploring about AVFoundation , for a good examples and documentation , there was literally no such explanations and documentation . There are some but very poorly written .


Objective of This Article

We are going to understand the AVFoundation and Implement that in an SwiftUI app project . We will follow the MVVM pattern . And Line by Line Understanding of Code .

Sources and Codes

Below is the repository for this project , just give it a star and…

In this article, we will take a very short look at the implementation of MVVM architecture with an example project.

Source Code: GitHub


Here you will learn about how UI logic is separated from core application logic by taking your first look at the MVVM architecture pattern. MVVM is a widely used design pattern that allows us to separate core application logic from UI logic.

Model: This is your core model, which will contain all data that you may have consumed from a database or via an external API.

ViewModel: A stripped-down or UI-tailored representation of your Model that contains…

Solutions To Real-World Problems in Swift

This article contains solutions to the few common problems you will face later or early in your carrier 👀 .

If you are an iOS Developer, you are going to face these questions in the future or you may have faced these questions already. Just read this article and implement its usage in your real-world applications 👍🏻

Now let us look at the first question!

How to compare two Date type variables in Swift?

Suppose you are working on an application that shows the DATA of the selected date in a calendar. …

Let us handle the API and API calls in any application 🥸

Selecting API

Openweathermap is one of the free api provider for weather information , We will be using their api in this application . You can go through this link to understand the documentation about the APIs .

We will just pass the city name with URL and APIKey to get the weather information .{cityName}&appid={YOUR APIKEY}

API Data Model

Before making an api call in our application , let us create a model which stores the information getting from API while decoding it .

Since we need only few informations from…

How to Create An Interactive UI for ToDo App using MVVM Pattern ??


Objective of This Article

In this article , you will see how to handle MVVM design pattern by creating a working to do application . We will se how we have written code for UI and how we are handling the viewModels and models .

Project Source Codes

You will be able to download the source code by the below repositry , just give it a star . All the best .

Starting the project

The app we are going to create is named as TaskManager . After watching the above GIF , you may got the…

Swift 5 features | Best 10 features of Swift Programming Language

Let us take a look to some of the best swift features we must know !


  • Readability , Speed , Memory Management and Easy Syntax .
  • Swift can automatically detect the type of any variable or constant based on the initial value . This properties is called as Type Inference .
  • Optionals define a variable which might not have no value .
  • Generics , which allows us to write code ONCE to perform similar task for different type of objects .
  • Protocol Oriented Design
  • Associated values in Enumeration
  • Multiple…

In this article , I have covered some basic concepts of Red Black Trees !

What are Red Black Trees ?

In Red-black trees each node is associated with an extra attribute: the color, which is either red or black. To get logarithmic complexity we impose the following restrictions.

Definition: A Red-black tree is a binary search tree that satisfies the following properties:

1. Each tree node is colored either red or black.

2. The root node of the tree is always black.

3. Every path from the root to any of the leaf nodes must have the same number of black nodes.

4. No two…

Some basic things about BITs and its Manipulation


To play with Bits , you must be familiar with binary numbers , and their operations like addition , subtraction etc .

Bit Operators

NOT ( ~ )

Bitwise NOT is an unary operator that flips the bits of the number i.e., if the ith bit is 0, it will change it to 1 and vice versa. Bitwise NOT is nothing but simply the one’s complement of a number. Lets take an example.

In this article you will see how to solve knapsack problem by memoization .

Photo by Markus Spiske on Unsplash

Problem Statement

You have given a bag of capacity ‘W’ . And also you have ’n’ items with ‘w’ weights and ‘v’ values . You need to fill the bag with maximum values without crossing the capacity weight .

Recursive Approach

In this approach , we will try to find all the possibilities using recursion .

def knapSack(W, wt, val, n):    if n == 0 or W == 0 :
return 0…

Mohammad Yasir

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store