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

Please manage some conditions in the date variable. May be defaults send you a nil value if it is nil. And check the case if it nil then put another date in the date variable.
Don’t direct pass the userDefaults value in date variable

Leave a Comment