I am trying to install SocketIO into my swift 4 iOS project using the swift package manager. The Package.swift file looks like this:
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "MyApp",
dependencies: [
.package(url: "https://github.com/socketio/socket.io-client-swift", .upToNextMajor(from: "12.0.0"))
]
)
On command line when I type 'swift build' the packages are fetched but there is an error:
"warning: no targets to build in package"
When I try to import SocketIO in my app I get:
"No such module 'SocketIO'" error.
This is my first time using Package Manager. Just wondering how to resolve this and whether or not I need to add targets myself in the Package.swift file?
Not sure if I set up Package Manager correctly initially. Also wondering if there is a way to uninstall and reinstall Package Manger? Or is it just a matter of replacing the Package.swift file in the project directory.