apple / swift-async-dns-resolver

A Swift library for asynchronous DNS requests, wrapping c-ares with Swift-friendly APIs and data structures.
Apache License 2.0
82 stars 12 forks source link

Is it possible to add it as a package dependencies for new IOS project? #17

Closed asnov closed 5 months ago

asnov commented 5 months ago

Hello! Thank you for your great package. I have one issue. When I add it as a package dependencies to the IOS project without Package.swift, it gives me a lot of Concurrency is only available in iOS 13.0.0 or newer errors in the swift-async-dns-resolver/Sources/AsyncDNSResolver/AsyncDNSResolver.swift file.

I'm adding it this way: Xcode -> File -> Add Package Dependencies... -> swift-async-dns-resolver -> Add Package

Here is the demo project: https://github.com/asnov/AsyncDNSResolverDemoIOS

Thank you!

mkbrwr commented 5 months ago

Hello, in Package.swift under platforms only .macOS("13.0") is listed, you can make a local copy of a package and add .iOS("13.0") there and it should build. But I'm also curious why support for iOS is not listed

yim-lee commented 5 months ago

I can't recall why only .macOS is listed. @asnov Can you please try what @mkbrwr suggests and let us know whether it works for you? My main worry is the availability of dnssd, but we can fall back to c-ares if needed. And in case it does work then we can patch and add iOS to the list. Thanks.

asnov commented 5 months ago

@yim-lee I tried what @mkbrwr suggested. I needed to clone with submodules: git clone https://github.com/apple/swift-async-dns-resolver.git --recurse-submodules. And it works fine. So you could add iOS to the platforms. Thank you!

yim-lee commented 5 months ago

Thanks @asnov. Opened: https://github.com/apple/swift-async-dns-resolver/pull/19

yim-lee commented 5 months ago

Patch: https://github.com/apple/swift-async-dns-resolver/releases/tag/0.1.4