iOS swift interview question for fresher and experience

What is the difference between atomic and nonatomic properties?

Atomic Properties are guaranteed to always return a initialized object. This also happens to be the default state for synthesized properties.

Nonatomic, no such guarantees are made. Thus, nonatomic is considerably faster than atomic.

atomic does not do is make any guarantees about thread safety when multiple dependent properties are in run.

What is the different between App ID and Bundle ID in ios ?

Multiple apps can have the same App ID. The App ID does not uniquely identify an application.
App ID is a two part string used to identify one or more application in a single development
There are tow types of app ID
1. Explicit app id
Explicit app is used for single application
2. Wildcard app id
Wildcard app id is used for set of application

What is the different between Strong and Weak in iOS ?

The compiler will take care that any object that you assign to this property will not be destroyed as long as you point to it with a strong reference.
If you want to destroy strong reference object then set the property to nil.

We do not control life time of weak reference object.
Once that is no longer the case the object gets destroyed and your weak property will automatically get set to nil.
We must declare every weak reference as having an optional type.

 

What is the different type of application state in iOS ?

1. Not running
The application has not been launched OR was running but it was terminated by the system.

2. Inactive
The application is running in foreground but currently not receiving any event.
(when users lock the screen)

3. Active
The application is running in the foreground and is receiving events.

4. Background
The application is in the background and currently executing code.

5. Suspended
Then application remains in memory but does not execute any code.

whats is Different between objective C and swift ?

https://pathanikbal.wordpress.com/2020/01/15/different-between-objective-c-and-swift/

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.