From 97363897006877b62ebfb357cb98160a1b5b291b Mon Sep 17 00:00:00 2001 From: JayT Date: Fri, 28 Oct 2016 00:11:36 -0700 Subject: [PATCH] Word around for XCode 8.1 bug Intentionally forced unwrapped. Workaround the error by explicitly unwrapping u: func compare(v: T, u: T!) -> Bool { return v < u! } https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html --- Sources/UserInteractionFunctions.swift | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Sources/UserInteractionFunctions.swift b/Sources/UserInteractionFunctions.swift index 4c614652..50430410 100644 --- a/Sources/UserInteractionFunctions.swift +++ b/Sources/UserInteractionFunctions.swift @@ -375,13 +375,11 @@ extension JTAppleCalendarView { } } for date in validDatesToSelect { - let components = self.calendar - .dateComponents([.year, .month, .day], from: date) - let firstDayOfDate = self.calendar.date(from: components)! + let components = calendar.dateComponents([.year, .month, .day], from: date) + let firstDayOfDate = calendar.date(from: components)! // If the date is not within valid boundaries, then exit - if !(firstDayOfDate >= self.startOfMonthCache && - firstDayOfDate <= self.endOfMonthCache) { - continue + if !(firstDayOfDate >= startOfMonthCache! && firstDayOfDate <= endOfMonthCache!) { + continue } let pathFromDates = self.pathsFromDates([date]) // If the date path youre searching for, doesnt exist, return @@ -530,8 +528,7 @@ extension JTAppleCalendarView { scrollInProgress = true delayRunOnMainThread(0.0, closure: { // This part should be inside the mainRunLoop - if !(firstDayOfDate >= self.startOfMonthCache && - firstDayOfDate <= self.endOfMonthCache) { + if !((firstDayOfDate >= self.startOfMonthCache!) && (firstDayOfDate <= self.endOfMonthCache!)) { self.scrollInProgress = false return }