1.

In iOS Swift, what types of objects are considered basic data types?

Answer»

For various purposes, Swift uses a common set of basic data types such as Boolean values, integers, and strings:

  • Int: The integer value is stored in the int variable. Example - 5
  • Double and Float: When working with DECIMAL numbers in Swift, double and float are TAKEN into account. Example - 5.78
  • Bool: The bool type is used to store the value of a Boolean. True and false conditions are used in Swift. Example - true
  • String: In Swift, the user defines the content that is enclosed by double quotes in String LITERALS. Example - "Muskan"
  • Arrays: Arrays are collections of OBJECTS of the same type from a list. Example - [2,4,11,90,78]
  • Dictionaries: A dictionary is an unsorted collection of elements of a specific type linked by a SINGLE key. Example - [{name:"Nidhi"}]


Discussion

No Comment Found