Skip to content

Commit

Permalink
Word around for XCode 8.1 bug
Browse files Browse the repository at this point in the history
Intentionally forced unwrapped.
Workaround the error by explicitly unwrapping u:

func compare<T: Comparable>(v: T, u: T!) -> Bool {
       return v < u!
}

https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
  • Loading branch information
patchthecode committed Oct 28, 2016
1 parent 8140cc9 commit 9736389
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Sources/UserInteractionFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 9736389

Please sign in to comment.