What is difference between class and struct swift?



What is difference between class and struct swift?..

Answer / Rekha Yadav

In Swift, classes and structures are two different types of classes that differ in their default behavior. Classes inherit from an optional superclass (NSObject by default) and support inheritance, protocol conformance, and dynamic member lookup. Structures do not have a superclass and are value types instead of reference types.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Swift Interview Questions

What is ios swift?

1 Answers  


What is dynamic in swift?

1 Answers  


What do you do when you realize that your app is prone to crashing?

1 Answers  


How to call objective-c code from swift?

1 Answers  


What is a lazy var in swift?

1 Answers  


Consider the following code: var defaults = NSUserDefaults.standardUserDefaults() var userPref = defaults.stringForKey("userPref")! printString(userPref) func printString(string: String) { println(string) } Where is the bug? What does this bug cause? What’s the proper way to fix it?

1 Answers  


What is the full form of swift code?

1 Answers  


What is a protocol in swift?

1 Answers  


How do I create a swift file in xcode?

1 Answers  


Is it worth learning swift 2019?

1 Answers  


What is the usage of switch statement in swift language?

1 Answers  


What is mvp in swift?

1 Answers  


Categories