The immediate problem you’re having is that
self._date
is optional, so this construct:
_date?.timeIntervalSince(_lastTimestamp!)
produces an optional. My preferred way around that is to use a local non-optional reference and then assign it to
self._date
when I’m done.
let now = Date()
let _interval: TimeInterval = self._lastTimestamp ? now.timeIntervalSince(_lastTimestamp): 0.0
self._date = now
But that still won’t compile because the
self._lastTimestamp
to the left of the
?
is not a Boolean and I don’t even have a good guess as what you’re trying to do there.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"