{"id":26212331,"url":"https://github.com/hackinggate/swift-public-ip","last_synced_at":"2025-04-15T15:22:14.354Z","repository":{"id":34895822,"uuid":"186410897","full_name":"HackingGate/Swift-Public-IP","owner":"HackingGate","description":"Swift library for checking your public IP address","archived":false,"fork":false,"pushed_at":"2024-09-03T22:18:19.000Z","size":60,"stargazers_count":19,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T21:51:08.700Z","etag":null,"topics":["icanhazip","ident","ipv6-test","seeip","swift","swift-library","whatismyipaddress"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HackingGate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-13T11:59:02.000Z","updated_at":"2025-03-12T12:30:00.000Z","dependencies_parsed_at":"2025-03-12T08:40:49.121Z","dependency_job_id":null,"html_url":"https://github.com/HackingGate/Swift-Public-IP","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackingGate%2FSwift-Public-IP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackingGate%2FSwift-Public-IP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackingGate%2FSwift-Public-IP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HackingGate%2FSwift-Public-IP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HackingGate","download_url":"https://codeload.github.com/HackingGate/Swift-Public-IP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249095202,"owners_count":21211882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["icanhazip","ident","ipv6-test","seeip","swift","swift-library","whatismyipaddress"],"created_at":"2025-03-12T08:29:56.541Z","updated_at":"2025-04-15T15:22:14.323Z","avatar_url":"https://github.com/HackingGate.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift-Public-IP\n[![SwiftLint](https://github.com/HackingGate/Swift-Public-IP/actions/workflows/swiftlint.yml/badge.svg)](https://github.com/HackingGate/Swift-Public-IP/actions/workflows/swiftlint.yml)\n[![Test](https://github.com/HackingGate/Swift-Public-IP/actions/workflows/test.yml/badge.svg)](https://github.com/HackingGate/Swift-Public-IP/actions/workflows/test.yml)\n\nSwift library for checking your public IP address\n\nSupports macOS, iOS, tvOS, watchOS and Linux.\n\nUses [icanhazip](https://icanhazip.com), [ipv6test](https://v4v6.ipv6-test.com/api/myip.php), [seeip](https://ip.seeip.org), [whatismyipaddress](https://bot.whatismyipaddress.com), [ident](https://ident.me/) and etc.\n\n## Usage\n\n```swift\nimport SwiftPublicIP\n\nSwiftPublicIP.getPublicIP(url: PublicIPAPIURLs.IPv4.icanhazip.rawValue) { (string, error) in\n    if let error = error {\n        print(error.localizedDescription)\n    } else if let string = string {\n        print(string) // Your IP address\n    }\n}\n```\n\n## Implementation\n\n### Carthage\n\nAdd it in the Cartfile.\n\n```\ngithub \"HackingGate/Swift-Public-IP\" \"0.0.2\"\n```\n\nRun `carthage update`.\n\nAdd the SwiftPublicIP framework as an embedded binary to your .xcodeproj file.\n\n### CocoaPods\n\nAdd it in the Podfile\n\n```\npod 'SwiftPublicIP', '~\u003e 0.0.2'\n```\n\nRun `pod install`.\n\nIf you only want try this pod without import it. Run  `pod try SwiftPublicIP`.\n\n### Swift Package Manager (SPM)\n\nYou need Package.swift file.\n\n```swift\n// swift-tools-version:5.0\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"YourAwesomeApp\",\n    dependencies: [\n        .package(url: \"https://github.com/HackingGate/Swift-Public-IP\", from: \"0.0.2\"),\n    ],\n    targets: [\n        .target(\n            name: \"YourAwesomeApp\",\n            dependencies: [\"SwiftPublicIP\"],\n            path: \"Sources\")\n    ]\n)\n```\n\n### Git Submodule or Manual\n\nAdd as a git submodule.\n\n```\ngit submodule add https://github.com/HackingGate/Swift-Public-IP\n```\n\nIf you don't use git, just download it manually.\n\nDrag SwiftPublicIP.xcodeproj to your project.\n\nAdd the SwiftPublicIP framework as an embedded binary to your .xcodeproj file.\n\nIf you want to remove git submodule Swift-Public-IP.\n\n```\ngit submodule deinit Swift-Public-IP\n```\n\nAnd don't forget remove reference from Xcode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackinggate%2Fswift-public-ip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackinggate%2Fswift-public-ip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackinggate%2Fswift-public-ip/lists"}