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: Fri Oct 18 2024 02:30:35 GMT-0900 (Hawaii-Aleutian Daylight Time)