Tag: Optional chaining

  • Optional binding and Optional Chaining

    Swift has a feature that lets users to assign optional value to a variable or a constant. Optional variable or constant can contain a value or a nil value. Let us take the following example which tries to find a given string in a array of string. Optional Binding var fruits = [“Apple”,”Orange”,”Grape”,”Mango”] let searchIndex…