davidstump / SwiftPhoenixClient

Connect your Phoenix and iOS applications through WebSockets!
MIT License
507 stars 147 forks source link

Error compiling a hello world program #169

Closed fxn closed 4 years ago

fxn commented 4 years ago

Totally new to Swift and not familiar with its tooling.

I've written a minimal main.swift that connects to a WebSocket and finishes, but compilation fails with:

.../.build/checkouts/SwiftPhoenixClient/Sources/Socket.swift:659:17: error: 'scheduledTimer(withTimeInterval:repeats:block:)' is only available in macOS 10.12 or newer
        = Timer.scheduledTimer(withTimeInterval: heartbeatInterval,

There are also a bunch of warnings and notes.

I am working with a vanilla project structure generated by SPM.

macOS is 10.15.4, Swift is 5.2.2, Xcode is 11.4.1, and SwiftPhoenixClient is 1.2.1, according to Package.resolved.

dsrees commented 4 years ago

Looks like youre building a mac application? What is your target OS?

fxn commented 4 years ago

I want to write a command-line executable to exercise some channels I am developing from outside the test suite. Is that possible?

dsrees commented 4 years ago

Current target is for iOS and tvOS. I'm not sure if youd be able to build for a CLI. Not something I have experimented with, especially using SPM

fxn commented 4 years ago

Please feel free to close then, I'm going to write this client in Elixir itself.

Thanks anyway!