What is category and class extension? How these differ?
Answer / Pramd Kumar
A category in Objective-C is a way of extending an existing class by adding new methods, properties, or categories (other categories). Categories are declared using the @category directive, which specifies the name of the category and the name of the original class that it extends. Categories can be used to add functionality to existing classes without modifying their source code.nnClass extensions in Swift are similar to categories in Objective-C, but they are a part of the source file for the class they extend. Class extensions allow you to add additional properties and methods that are not exposed to the public interface of the class. Unlike categories, class extensions do not affect the behavior of existing instances of the class.nnThe main difference between categories and class extensions is that categories can be used with any existing class, while class extensions must be defined within the source file for the class they extend.
| Is This Answer Correct ? | 0 Yes | 0 No |
Define decoding or deserialization?
What is difference between weak and strong in ios?
Explain me how to parse json?
What is category and extension in ios?
What is auto-layout?
What are the skills required for ios developer?
What is difference between shallow copy and deep copy in ios ? : IOS Architect
What does ns stand for ios?
What is latest ios version?
Explain what is a framework?
Are document objects required for an application? What does they offer?
Difference between coredata & sqlite?