iOS Interview Questions (Swift) — Part 1

Animesh Mishra
4 min readMay 3, 2018
  1. What is the Swift and its advantages?

Swift is a general-purpose, multi-paradigm, compiled time programming language developed by Apple Inc. for iOS, macOS, watchOS, tvOS, and Linux.

  • Readability — Clean syntax, which makes it easier to read and write.
  • Maintenance — Less Code & Less Legacy — one file .swift.
  • Safer Platform — You can compile, and fix the errors while writing the code.
  • High Speed — The incredibly quick and high-performing LLVM compiler transforms the Swift code into optimized native code to get the most out of its devices. The syntax and standard library have also been tuned to make the code perform optimally.
  • Swift Supports Dynamic Libraries
  • Open Source

2. Explain difference between class and structure.

There are mainly four difference between class and struct in swift. Classes have below additional capabilities that structures do not:

  1. Type Casting : Type casting enables you to check and interpret the type of a class instance at runtime.
  2. Reference counting allows more than one reference to a class instance. (Structs are value types and Classes are reference types.)

--

--