instacart / TrueTime.swift

NTP library for Swift and Objective-C. Get the true time impervious to device clock changes.
https://tech.instacart.com/truetime/
Apache License 2.0
588 stars 130 forks source link

Swift 4.1 compile errors #44

Closed YuriiTrach closed 5 years ago

YuriiTrach commented 6 years ago

Tried to use the latest version with cocoapods and this what I get: NTPExtensions.swift:50:22: 'toIntMax()' is unavailable NTPExtensions.swift:55:25: 'toIntMax()' is unavailable NTPExtensions.swift:67:23: 'toIntMax()' is unavailable TrueTime.swift:54:50: Let 'defaultTimeout' is private and cannot be referenced from a default argument value TrueTime.swift:55:44: Let 'defaultMaxRetries' is private and cannot be referenced from a default argument value TrueTime.swift:56:48: Let 'defaultMaxConnections' is private and cannot be referenced from a default argument value TrueTime.swift:57:44: Let 'defaultMaxServers' is private and cannot be referenced from a default argument value TrueTime.swift:58:49: Let 'defaultNumberOfSamples' is private and cannot be referenced from a default argument value TrueTime.swift:59:55: Let 'defaultPollInterval' is private and cannot be referenced from a default argument value

Any ideas what's wrong?

pipacs commented 6 years ago

Looks like it's been fixed in master -- could we please get a new release.

artemmihelson commented 6 years ago

I am getting the same error. When to expect the new version?

artemmihelson commented 6 years ago

By the way, anyone experiencing this issue. You can temporary avoid by selecting Swift 3.2 as a Swift Language version in Pods -> Targets -> TrueTime -> Build Settings.

miketsprague commented 6 years ago

If you're using cocoapods... It was updated to Swift 4 in October, but the podspec has yet to be updated. You have to point the pod at the latest commit

 pod 'TrueTime', :git => 'https://github.com/instacart/TrueTime.swift', :commit => '8aadebabe2590d6ab295c390df5bbc109b346348'
sirioz commented 6 years ago

Is it possible to update the podspec and set a new tag with the latest commit? It would be very important for the Swift4 compatibility.

Funi1234 commented 6 years ago

+1 @sirioz. I have TrueTime as a dependancy in a podspec and cannot specify a commit to or branch. It must be a version.

usman-whizpool commented 6 years ago

hi when will you upload/commit proper code