Initializers, also known as constructors in other programming languages, have two types: and . They are used to initialize properties or customize a variable or object for classes or structs.

Designated init

This type of the Initializer is frequently seen in Swift class, also named as primary Initializer

  • Designated…

TLDR

Both and are used to synchronise changes between branches. The difference is will revise the commits but keep a clean organised history, while will keep all the original commits and add ones automatically but gives out a circuit board like history.

Real world scenarios

Image…

Actions and func are another ways to create delegates.

Action is a delegate that points to a method which in turn accepts one or more arguments but returns no value.

Func is a delegate that points to a method that accepts one or more arguments and returns a value.

  • Action…

Recently I was working on a legacy project written in Objective-C, which reminded me of the early days when working on Objective-C projects.

In the code I saw few things like the following which defines a constant:

#define car_price 300

creates a macro which simply do the replacement for…

Needone App

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