iOS Interview Questions 🍏

In this article, I will try to add as many Q&A’s related to iOS . I will keep on updating this article. Hope it helps you guys 🙂.

Abhimuralidharan
8 min readMar 14, 2019
source: stocksnap.io

1. Do we have an extension in Objective — C?

The answer is YES.

2. Difference between a category and extension in objective C?

A category can be declared for any class, even if you don’t have the original implementation source code.

A class extension bears some similarity to a category, but it can only be added to a class for which you have the source code at compile time (the class is compiled at the same time as the class extension).

Categories allow you to add methods outside of the main interface file. Whereas Extensions must be implemented in main Interface file. Which means we can safely conclude you cannot use extensions for extending Builtin classes or Classes for which you don’t have the source code, there you should use Categories. And to use extensions you need access to the source of the class you are extending.

--

--