Should I use struct or class swift?



Should I use struct or class swift?..

Answer / Praveena Rani

Whether to use a struct or a class in Swift depends on your specific needs. Use a struct when the value type does not need to be mutable or you don't need inheritance. Use a class for more complex object-oriented programming, where inheritance and reference types are necessary.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Swift Interview Questions

what are functions different from methods?

1 Answers  


What is nil in swift?

1 Answers  


What are structures in swift?

1 Answers  


How you define variables in swift language?

1 Answers  


What is difference between class and struct swift?

1 Answers  


What are the collection types available in swift?

1 Answers  


What is $0 in swift?

1 Answers  


How do you make a swift bridging header?

1 Answers  


How can you write a multiple line comment swift?

1 Answers  


What is mvvm in swift?

1 Answers  


What is an in-out parameter in swift?

1 Answers  


What is dynamic keyword in swift?

1 Answers  


Categories