0

I am trying to cast my strings to AnyHashable but getting crashed.

I am using as below

let castArray = [string1,string2] as! AnyHashable
Myclass?.functionName!(forAction: actionMethod, forData: [
        castArray:string3,
        ])

It is throwing error as:

Could not cast value of type 'Swift.Array<Swift.String>'  to 'Swift.AnyHashable' and crashing.

String1 and String2 and String3 are the static strings.

Any idea why it is crashing ?

Steve Gear
  • 757
  • 2
  • 16
  • 44

0 Answers0