{"id":19174308,"url":"https://github.com/vectorform/yarp","last_synced_at":"2025-05-07T18:20:31.731Z","repository":{"id":56930131,"uuid":"74515003","full_name":"vectorform/Yarp","owner":"vectorform","description":"Yarp (Yet another reachability pod) is a reachability framework with a focus on reliability and simplicity. ","archived":false,"fork":false,"pushed_at":"2020-08-28T17:01:17.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-20T01:33:00.544Z","etag":null,"topics":["cocoapods","ios","reachability","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vectorform.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}},"created_at":"2016-11-22T21:30:20.000Z","updated_at":"2025-02-28T17:43:40.000Z","dependencies_parsed_at":"2022-08-21T06:20:34.572Z","dependency_job_id":null,"html_url":"https://github.com/vectorform/Yarp","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorform%2FYarp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorform%2FYarp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorform%2FYarp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorform%2FYarp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vectorform","download_url":"https://codeload.github.com/vectorform/Yarp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931785,"owners_count":21827163,"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":["cocoapods","ios","reachability","swift"],"created_at":"2024-11-09T10:17:16.148Z","updated_at":"2025-05-07T18:20:31.702Z","avatar_url":"https://github.com/vectorform.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Swift 4 Compatible](https://img.shields.io/badge/swift%204-compatible-4BC51D.svg?style=flat)](https://developer.apple.com/swift)\n[![Platform](https://img.shields.io/cocoapods/p/Yarp.svg?style=flat)](http://cocoadocs.org/docsets/Yarp)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Yarp.svg)](https://img.shields.io/cocoapods/v/Yarp.svg)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n\n# Yarp\nCreated and maintained by Vectorform.\n\nYarp (Yet another reachability pod) is a reachability framework with a focus on reliability and simplicity. Yarp fully supports IPv6 and IPv4. Yarp allows you to observe changes in reachability using blocks or notifications.\n\n# Requirements\n- iOS 8.0+\n- Xcode 9.0+\n- Swift 4.0+\n\n# Initilize Yarp Object\nThe IPv4 addresses in the below example can be switched out for their IPv6 counterparts.\nIn versions prior to Yarp 1.0.0, IP addresses would not perform an initial callback on init. In 1.0.0 they now return a callback.\n\n```swift\n//base init defaults to \"0.0.0.0\" which is Apple's special internet reachability address\nlet yarp: Yarp? = Yarp()\n\n//Custom hostname init\nlet yarp: Yarp? = Yarp(hostName: \"www.google.com\") //or \"http://216.58.195.238\" either will work\n\n//Custom Address init\nlet yarp: Yarp? = Yarp(hostAddress: \"216.58.195.238\")\nyarp?.start()\n```\n\n# Listening Methods\n### Handler Block\n```swift\nyarp?.addHandler(\"key1\", handler: { (yarp) in\n    if let reachable = yarp.isReachable {\n        print(\"block yarp has reachable-ness: \\(reachable)\")\n    }\n})\n```\n\n### OR Notification Observer\nYou can listen for the notification sent from Yarp. If you have only one Yarp object you can safely set the object parameter to nil, but if you use more than one to monitor multiple hosts, then passing the object parameter into the addObserver function will make sure that you only get that objects reachability notifications.\n\n```swift\n//listen for ANY Yarp notification\nNotificationCenter.default.addObserver(self, selector: #selector(reachabilityChanged, name: Yarp.StatusChangedNotification, object: nil)\n\n// OR\n\n//listen for a specific Yarp notification\nNotificationCenter.default.addObserver(self, selector: #selector(reachabilityChanged, name: Yarp.StatusChangedNotification, object: yarpObject)\n```\n\n### Set Notification handlers\n\n```swift\nfunc reachabilityChanged(notification: Notification) {\n        if let yarp = notification.object as? Yarp {\n          //Note: isReachable will likely never be null here\n            if let reachable = yarp.isReachable {\n                defaultStatusLabel.text = \"Default isReachable: \\(reachable)\"\n            }\n        }\n    }\n```\n\n## Installation\n### CocoaPods\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n```bash\n$ gem install cocoapods\n```\n\nTo integrate Yarp into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '11.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'Yarp', '~\u003e 1.0.0'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Carthage\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate Yarp into your Xcode project using Carthage, specify it in your `Cartfile`:\n```ogdl\ngithub \"Vectorform/Yarp\" ~\u003e 1.0.0\n```\n\nRun `carthage update` to build the framework and drag the built `Yarp.framework` into your Xcode project.\n\n\n### Manually\nIf you prefer not to use any of the listed dependency managers, you can integrate Yarp into your project manually.\n\n\n## Authors\n\nJeff Meador, jmeador@vectorform.com\n\nCory Bechtel, cbechtel@vectorform.com\n\n\n## License\n\nYarp is available under the BSD license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectorform%2Fyarp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvectorform%2Fyarp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectorform%2Fyarp/lists"}