Hey, thanks for your comment. I ended up figuring out the issue. The JSON data wasn't being loaded completely before the app checked the date. So I moved the code from the onAppear to this part.
DispatchQueue.main.async { self?.user = user self?.user.checkDate() }
In regards to the issue with it printing June and July, it was because the view was being refreshed so the code to print ran twice. It printed before the JSON data was loaded, and then after it was loaded.
Topic:
Programming Languages
SubTopic:
Swift
Tags: