Skip to content

Commit 32c31f7

Browse files
committed
conditional for rangeAt or range(at
1 parent cf41b84 commit 32c31f7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

EVReflection.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "EVReflection"
3-
s.version = "5.4.1"
3+
s.version = "5.4.2"
44
s.summary = "Reflection based object mapping. (Dictionary, CKRecord, NSManagedObject, Realm, JSON, XML, Alamofire, Moya, RxSwift, ReactiveSwift)"
55

66
s.description = <<-EOS

Source/EVReflection.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,12 @@ extension Date {
15821582
return nil
15831583
}
15841584

1585-
let dateString = (fromDateTimeString as NSString).substring(with: match.range(at: 1)) // Extract milliseconds
1585+
#if swift(>=4.0)
1586+
let dateString = (fromDateTimeString as NSString).substring(with: match.range(at: 1)) // Extract milliseconds
1587+
#else
1588+
let dateString = (fromDateTimeString as NSString).substring(with: match.rangeAt(1)) // Extract milliseconds
1589+
#endif
1590+
15861591
let timeStamp = Double(dateString)! / 1000.0 // Convert to UNIX timestamp in seconds
15871592

15881593
self.init(timeIntervalSince1970: timeStamp) // Create Date from timestamp

0 commit comments

Comments
 (0)