SwiftIP

master

A library to help with getting IP addresses in Swift.
Samasaur1/SwiftIP

SwiftIP

A library to help with getting IP addresses in Swift.

Installing

Add the following to your Package.swift:

.package(url: "https://github.com/Samasaur1/SwiftIP.git", from: "2.0.0"),

Or use Ice:

$ ice add SwiftIP

Usage

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")")

Description

  • Swift Tools 4.2.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Sep 01 2022 05:17:53 GMT-0500 (GMT-05:00)