0% found this document useful (0 votes)
411 views1 page

iOS Interview Questions & Answers Guide

The document is a guide for iOS interview questions and answers, focusing on the basics of Swift. It explains Swift's advantages over Objective-C, including safety and modern features like type inference. Additionally, it covers how to declare constants in Swift and their importance in maintaining code safety and predictability.

Uploaded by

krishna2053.kg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
411 views1 page

iOS Interview Questions & Answers Guide

The document is a guide for iOS interview questions and answers, focusing on the basics of Swift. It explains Swift's advantages over Objective-C, including safety and modern features like type inference. Additionally, it covers how to declare constants in Swift and their importance in maintaining code safety and predictability.

Uploaded by

krishna2053.kg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

iOS Interview Questions and Answers Guide

1.1 Basics of Swift

Q: What is Swift, and what makes it different from Objective-C?

A: Swift is a powerful and intuitive programming language developed by Apple for iOS, macOS, watchOS,

and tvOS. It is safer, faster, and more concise than Objective-C. Swift offers modern language features such

as type inference, optionals, closures, and memory safety by default.

Q: Explain the concept of type inference in Swift.

A: Type inference allows Swift to deduce the type of a variable automatically based on the assigned value.

For example, `let number = 10` is inferred as an `Int`.

Q: How do you declare a constant in Swift, and when would you use it?

A: Constants are declared using the `let` keyword. You use them when the value should not change after

assignment, ensuring safety and predictability in your code.

You might also like