1

Am trying to use the new ContinuousClock feature in Swift 5.7 using Xcode 14.0 (14A309) in a command line app with with the statement

let clock = ContinuousClock()

I get the following error:

Cannot find 'ContinuousClock' in scope

Is there an import missing (I'm importing Foundation)? The apple docs show its in Swift Standard Library which isn't really an import..That doc page also list it as beta, but the release announcement shows it as implemented.

Clues?

Scott
  • 1,034
  • 1
  • 9
  • 19
  • Well as you have already mentioned in your post it comes with Swift 7 • Xcode 14. No need to import anything. It is part of the Swift Standard library. – Leo Dabus Sep 24 '22 at 17:22
  • It's only available in macOS 13 Beta, if this is a Mac playground or project you will need a beta version of Xcode (14.0 Beta 6 or 14.1 Beta 2 for instance) to have access to it – Joakim Danielson Sep 24 '22 at 17:22
  • @JoakimDanielson Thats probably the case. OP is probably targeting macOS – Leo Dabus Sep 24 '22 at 17:25
  • Got it, thanks. Indeed, command line app on macOS. – Scott Sep 24 '22 at 17:26
  • This explains it: https://forums.swift.org/t/swift-5-7-released/60249/14 – Sajjon Sep 24 '22 at 17:30

0 Answers0