Swi Interview Questions
Automatic Reference Counting is used by Swi (ARC) in order to do memory
management. This is the same thing in Swi as it is in Objective C in terms of notion.
When you assign or unassign instances of classes (reference types) to constants,
properties, and variables, ARC keeps track of strong references to those instances and
increases or decreases their reference count correspondingly. It frees up memory
consumed by objects with a reference count of zero. Because value types are copied
when assigned, ARC does not raise or decrease its reference count. If you don't
declare differently, all references will be strong references by default.
3. Highlight the key difference between Upcast and Downcast in
ios Swi .
The key difference between Upcast and Downcast in ios Swi is that upcasting from a
derived to a base class can be verified at compile-time and will never fail to compile
and Downcasts, on the other hand, can fail to compile since the precise class is not
always known. It is possible that the UIView you have is a UITableView or a UIButton.
4. What is the difference between the "==" operator and the
"===" operator in ios Swi ?
The fundamental difference between the "==" operator and the "===" operator in ios
Swi is that the equal to "==" operator compares value types to see if the values are
the same while the equivalent to "===" operator compares reference types to see if
the references point to the same instance (both point to the same memory address)
or not. Let us consider the following example for understanding the difference
between the two in a better way:
Page 9
© Copyright by Interviewbit