There are a couple of things going on here. Let's go back to this:
memberData?["login_date"]
If memberData is a Dictionary (of type [String: Any], I would guess), then why are you using the optional chaining operator ("?"). The simple reference:
memberData ["login_date"]
already returns an optional (Any?), because that's how dictionaries work: you look up a key, and there may or may not be a value. By adding the "?" operator, you're changing the result type from Any? to Any??. That's why — via a series of bridging rules — you're ending up with the value of type NSNull (I think).
So, my guess is you want something like this:
userProfile.login_date = (memberData ["login_date"] as? String) ?? ""
However, keep in mind that you're dealing with three cases, not two:
1. The dictionary contains a date string.
2. The dictionary contains no entry for key "login_date".
3. The dictionary contains an entry for key "login_date", but it's not a String.
If you want to handle these properly, you really need to do the conversions in a different order:
userProfile.login_date = (memberData ["login_date"] ?? "") as! String
That is, a missing value defaults to "", but an incorrect value causes a deliberate program crash. (You can handle this error if you want, but if it's a "shouldn't happen" error, the recommended techique is to crash immediately.)