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

iOS

Swift 3 upgrade gives FIXME: "comparison operators with optionals were removed from the Swift Standard Library..."

Hi,

I got this FIXME at the top of my code when I updated to Swift 3.

// FIXME: comparison operators with optionals were removed from the Swift Standard Libary. // Consider refactoring the code to use the non-optional operators. fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool { switch (lhs, rhs) { case let (l?, r?): return l < r case (nil, _?): return true default: return false } }

I have NO CLUE WHAT THIS MEANS!! Can someone please help / explain what's going on?

I am using a Date comparison in the code. I.e. if it's been longer than 30 minutes, send this notification, otherwise reset the timer.

I use Date.timeIntervalSinceReferenceDate; if thisTime > lastTime + waitTime, call func.

Thanks!!