ios - By fetching Date using this struct getting nil value even i have manually set date on having nil in swift 3 -
this question has answer here:
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
Post a Comment