Swift Interview Questions

Swift Interview Questions Download Swift Interview Questions PDF

Swift Interview Questions

Int (signed) and Uint (unsigned) are the two main Integer types in Swift Programming.

A few of the many advantages of using swift are:
  • Optional types
  • Closures
  • Built-in error handling
  • Much faster than other languages
  • Supports pattern matching
  • Type-safe language
The classes are not inherited directly from the base class in the Swift programming language.The classes defined by the developer without specifying the superclass becomes the base class automatically.
The control transfer statements in swift are:
  • Continue
  • Break
  • Fallthrough
  • Return
The term “defer” is a keyword that provides a block of code that executes when the execution is leaving the current scope.
  • Typecasting Patterns – This pattern allows you to match or cast the types.
  • Wildcard Patterns – This pattern matches as well as ignores any kind and type of value.
  • Optional Patterns – This pattern is used to match the optional values.
When our application is making an API call and we are supposed to update the UI to show the data from the API call, then Completion Handler becomes handy and is super convenient.
  • @synthesize – It generates the getter and setter methods for the property.
  • @dynamic – It notifies the compiler that the getter and setter are implemented at some other place.