ios - "Expression was too complex to be solved in reasonable time" while adding data to dictionary in swift 3, works fine in swift 2.3 -


let parameters : [string : anyobject] = [     "address" :      txtaddress.text ?? "",     "person_name" :  txtauthorname.text ?? "",     "person_image" : imgurl ?? "",      "book_title" :   txtbooktitle.text ?? "",      "dedicated_to" : txtdedicatedto.text ?? "" ,      "person_about" : txtabouttheauthor.text ?? "",     "is_published" : false,     "recipes" : recipearr  ?? ""] 

this code adding data dictionary. works fine on swift2.3.

swift 3 compiler says break expression sub-expressions.

kindly suggest apt solution.

breaking in below manner worked fine me

var dictionary =  [string: any]()    dictionary["key1"] = value1    dictionary["key2"] = value2    //... 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -