Swift اسئلة واجوبة المقابلات
سؤال 21. What is the role of the 'unowned' keyword in Swift?
The 'unowned' keyword is used in Swift to declare a reference that does not keep a strong hold on the instance it refers to, and it is assumed to always have a value.
سؤال 22. Explain the concept of generics in Swift.
Generics allow you to write flexible, reusable functions and types that can work with any type, subject to requirements that you define.
سؤال 23. What are property observers in Swift?
Property observers are used to observe and respond to changes in a property's value, providing a way to execute code before or after the value changes.
سؤال 24. How does Swift handle memory management compared to Objective-C?
Swift uses Automatic Reference Counting (ARC) for memory management, eliminating the need for manual memory management in Objective-C.
سؤال 25. Explain the difference between a struct and a class in Swift.
Structs are value types, while classes are reference types. Structs are copied when assigned or passed, whereas classes share a reference to the same instance.
الاكثر فائدة حسب تقييم المستخدمين:
- What is Swift?
- Explain optionals in Swift.
- What is the difference between 'let' and 'var' in Swift?
- What are property observers in Swift?
- What is the purpose of the 'static' keyword in Swift?