Swift linker error in release build fixable by adding code
问题 In Xcode 8, a Swift project of mine works in Debug mode but fails to link in Release mode: Undefined symbols for architecture x86_64: "Swift.UnsafeMutableBufferPointer.(subscript.materializeForSet : (Swift.Int) -> A).(closure #1)" I can fix the error by changing this line: let nextPeriod = currentSchedule.periods.filter({ $0.startDate > now }).sorted(by: { $0.startDate < $1.startDate }).first to: let nextPeriod = currentSchedule.periods.filter({ $0.startDate > now }).first but that obviously