pNre / ExSwift

A set of Swift extensions for standard types and classes.
Other
3.38k stars 318 forks source link

NSDate extension can't support iOS7 #112

Open ShineWu opened 9 years ago

PGLongo commented 9 years ago

This PR has been just merged and should fix the problem with iOS 7

smaspe commented 8 years ago

Nope. The issue (or another issue, possibly) is that

component.setValue(minutes, forComponent: .CalendarUnitMinute)

does not exist in iOS 7, it was added in iOS 8. cf https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSDateComponents_Class/index.html#//apple_ref/occ/instm/NSDateComponents/setValue:forComponent:

The solution is to access the properties directly:

component.minute = minutes