Calling a function which is placed in an Array
问题 I have an array where I have the Title of Button as Key and the Image as Value with position 0. I am calling this in CollectionView and the view looks like show in screenshot. At position 1 i have the name of the function that needs to be called with didSelectItemAt indexPath. How do I execute the function on click? var mainBtnsArr = [ ["Hotels" : ["homepage_hotel", ShowHotelSearch]], ["Flights" : ["homepage_flights", ShowFlightSearch]], ["Transfer" : ["homepage_transfer", ShowTransferSearch]