Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Daniel Gibson
9,846 PointsHow do you compare two dates in Swift?
Hi Guys.
I'm wanting to compare dates in Swift.
I'm wanting it to be like a birthday countdown ideally.
So it would need to:
check what today's date is then compare it to the saved date returning something like "its only X days until your birthday"
Only new to swift & XCode (though ive been watching all the videos)
I'm not 100% but think it should be using the NSCalendar?
Hope you can help
Many thanks
Dan