目录
目录README.md

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")")
关于
561.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号