To understand how an iOS application works and handles events when its state gets changed, the know-how of its life cycle is very important and one of the first steps to get started.

The UIKit notifies the application by calling appropriate delegate methods when the state of the application changes…

Every data type we use, be it user-defined or already provided it is categorised either as Value type or Reference type.

Reference type will point to the same underlying address even though you have 2 different variables when copied.

Value type is defined as a data type which creates its…

Whenever you try to create a new class in Objective-C and write @property for a variable you have to specify property attributes like atomic, nonatomic, assign etc. Today let’s discuss what is the difference between atomic and nonatomic and when to use either.

A common misconception about atomic is that…

As a developer, you should know where to use structs and where to use classes. In this post, I will try to give you a basic idea about that.

  1. Struct is what we call as Value Type as compared to Reference Type for classes.
  2. Struct initialiser does not require you to assign values to the variable inside it while in case of Classes, either an initial value needs to be assigned or defined the variable as an optional.
  3. You cannot inherit Structs but is perfectly fine in case of Classes.
  4. To mutate a value, use mutating keyword with method inside structs.
  5. In Structs, values are copied while in Classes, values are given the same reference.

In general, you use structs when you have to pass values which need not to be persistent.

Pre Automatic Reference Counting(ARC), memory management in iOS was troublesome. For example, if you are allocating memory to an object, then it is your responsibility to release the memory. Issues such as memory leak, dangling pointer creeps into your code.

To avoid such kind of issues, Apple came up with…

ObjectiveC is called a dynamic type language since most of the heavy lifting is carried out during runtime. One such feature of ObjectiveC is the ability to add methods and properties during runtime to existing classes using categories and extensions.

When to use Categories v/s When to use Extensions

  1. When…

Most people gets really confused about when to use pod install vs update. Today we are going to discuss just that.

To install the list of pods mentioned in your podfile for the first time,use pod install. This in turn will create a Podfile.lock file which manages the list of pods version. Suppose after some days of development, you decided to add a new pod in the Podfile, which command should you use..install or update ??

Common sense dictates that since we are updating the Podfile, we should use pod update and this is where most people make mistakes. We have to use pod update only in case where we have to update the version of a particular pod or all the pods.

Prashant Humney

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