Fix bugs on Linux Merge pull request #11 from Samasaur1/fix-linux
Fix bugs on Linux
Merge pull request #11 from Samasaur1/fix-linux
A library to help with getting IP addresses in Swift.
Add the following to your Package.swift:
Package.swift
.package(url: "https://github.com/Samasaur1/SwiftIP.git", from: "2.0.0"),
Or use Ice:
$ ice add SwiftIP
The documentation is available here: https://samasaur1.github.io/SwiftIP/
Effectively, however, you do this:
import SwiftIP guard let localIP = IP.local() else { fatalError("Could not find local IP") } let publicIP: String? = IP.public() print("Local IP: \(localIP); public IP: \(publicIP ?? "Not connected")")
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
SwiftIP
A library to help with getting IP addresses in Swift.
Installing
Add the following to your
Package.swift
:Or use Ice:
Usage
The documentation is available here: https://samasaur1.github.io/SwiftIP/
Effectively, however, you do this: