ios - By fetching Date using this struct getting nil value even i have manually set date on having nil in swift 3 -


struct apiversioncheck {    static let nsobject: anyobject? = bundle.main.infodictionary!["cfbundleshortversionstring"] anyobject    static let date = userdefaults.standard.value(forkey: "versiondateparameter")    static let checkdevicetoken = ""    static let checkappversion = nsobject as! string    static let checkdevicetype = 1    static let checkcustomerid = "1055"    static let checkdate = validator.sharedvalidation().checkblankstring(apiversioncheck.date as! string) == false ? "2016-08-03 11:20:53.957" : (apiversioncheck.date as! string) } 

in last line of struct checkdate getting nil value , therefore prevents other codes run crashing app. contribute precious opinion fix issue ?

please manage conditions in date variable. may defaults send nil value if nil. , check case if nil put date in date variable. don't direct pass userdefaults value in date variable


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 -