Reachability.swift | Replacement for Apple 's Reachability re-written in Swift | iOS library

 by   ashleymills Swift Version: v5.1.0 License: MIT

kandi X-RAY | Reachability.swift Summary

kandi X-RAY | Reachability.swift Summary

Reachability.swift is a Swift library typically used in Mobile, iOS, Xcode applications. Reachability.swift has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Reachability.swift is a replacement for Apple's Reachability sample, re-written in Swift with closures. It is compatible with iOS (8.0 - 12.0), OSX (10.9 - 10.14) and tvOS (9.0 - 12.0).

            kandi-support Support

              Reachability.swift has a medium active ecosystem.
              It has 7783 star(s) with 916 fork(s). There are 123 watchers for this library.
              It had no major release in the last 12 months.
              There are 76 open issues and 191 have been closed. On average issues are closed in 82 days. There are 8 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of Reachability.swift is v5.1.0

            kandi-Quality Quality

              Reachability.swift has no bugs reported.

            kandi-Security Security

              Reachability.swift has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              Reachability.swift is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Reachability.swift releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Reachability.swift
            Get all kandi verified functions for this library.

            Reachability.swift Key Features

            No Key Features are available at this moment for Reachability.swift.

            Reachability.swift Examples and Code Snippets

            No Code Snippets are available at this moment for Reachability.swift.

            Community Discussions


            Keep property in memory forever
            Asked 2020-Jun-25 at 17:45

            I want to add Reachability library to my app, and there is what we can read in doc:



            Answered 2020-Jun-25 at 17:45

            Yes, the property declared in AppDelegate will be available throughout the lifecycle of the application.



            Firebase -can Database.database().reference(withPath: ".info/connected") substitute for Ashley Mills Reachability
            Asked 2020-Feb-25 at 08:15

            I was in a situation where the router with the wifi was plugged in but the router wasn't connected to the internet (no wifi). Whatever reachability class I was using at the time thought it was connected because wifi was available but it couldn't determine that the wifi itself couldn't get a connection.

            I now use Ashley Mills Reachability and it works fine because it can tell wether I'm connected to the internet or not by pinging a host name.



            Answered 2020-Feb-25 at 08:15

            Really late to the party, but I can confirm the Firebase feature does in fact work properly. It checks for connection to the Firebase Database. So, if your wifi is on but no internet, then Firebase will say there's no internet.

            It's remarkably simple. You are testing a connection to Firebase. If it can't reach Firebase, it doesn't matter if there's wifi or cell data or anything else. If it can't reach it, it can't reach it, and it will tell you there's no connection.

            Hope that helps someone in the future. Oh, and I've been using this code in my production app for over a year.



            Carthage update - Task failed with exit code 65
            Asked 2020-Jan-17 at 09:57

            I have 2 versions of Xcode installed, 8.3.2 and 8.2.1.

            I'm working on a project that was written in Swift 2 and installed few third-party's via Carthage. After pulling branch I did carthage update : then I got this error:



            Answered 2017-May-07 at 12:20

            Assuming this is a new device you're pulling the changes to: run carthage bootstrap to install according to the docs



            Connection is always giving me false?
            Asked 2019-Apr-03 at 20:00

            I am using Reachability.swift to test the internet connection is (off/On) and the server is (live/dead) the server check work fine but internet Connection is always giving me false?



            Answered 2019-Apr-03 at 20:00

            Connection is an enum with 3 cases:



            How to check network connectivity changes for internet connection at run time with Reachability?
            Asked 2019-Mar-08 at 12:13

            I am using this lib for checking Reachability

            And below is my sample code:



            Answered 2019-Mar-08 at 12:13

            Faced the same issue before, to resolve it you need to declare



            Ashley Mills reachability not sending notification when wifi turns back on?
            Asked 2018-Nov-29 at 10:20

            I have a set up, using Ashley Mills Reachability, which is supposed to send a notification, using NotificationCenter, to the application when the connection of the app changes. It is set up as follows:



            Answered 2018-Nov-29 at 10:20

            it get's triggered only for one time per run in the simulator, but on a real iOS device, it works normally.



            Creating an easy to use extension/function for Reachability (host/internet WIFI, Cellular)
            Asked 2018-Oct-01 at 08:33

            I am working on a complex app and I want to test both host in internet reachability on each ViewController that receive data from server I am currently using this library for Reachability


            And I want to create an easy method or extension that check the reachability for both internet and host out of this I have already use the sample code from the library which is below: `import UIKit



            Answered 2017-May-02 at 20:28

            Is there a reason for not just dropping this in your AppDelegate and subscribe to the observer there instead of doing it on a specific vc?



            ReachabilitySwift can't be installed with CocoaPods
            Asked 2018-Oct-01 at 08:33

            In my Podfile, I have:



            Answered 2017-Sep-23 at 08:07

            You don't have to edit the podspec file manually, that would involve forking the project.

            The project's podspec file references a wrong tag, you should specify the correct tag and use that until the podspec file is fixed.

            From a GitHub Issue:

            Podspec is still looking for the old v3 tag, for now manually specify the repo and tag will fix:



            How to test for iPhone connection to internet with swift 4?
            Asked 2018-Oct-01 at 08:32

            For Swift 4/xcode:
            I have scoured the internet for a solution to this issue, but I have yet to find a definitive, comprehensive answer that covers all of the bases. There are several on Stack that answer the question to some extent, including swift specific answers such as these or AshleyMills Reachability, but many are old and not comprehensive.
            1. I want the method to check for internet connection, not just connection to wifi. Several of the methods online merely check for connection to Wi-Fi, but do not confirm that internet is available via the wifi. I want a method that only returns true if internet connection is detected.
            2. This method must also return true for cellular data usage. Yes Wi-Fi can provide internet connection, but so can data. This method needs to be comprehensive enough to return true if either or both cellular/wifi internet is provided.
            Lastly, a note. The fact that there isn't a full swift answer online that checks all of the boxes makes me wonder if my approach to this issue is incorrect in a more general sense. My app needs to load data from a database, which is why it needs the internet connection. This is an extremely common thing for popular apps nowadays. Apps don't crash from trying to load their data without internet connection. What I am thinking they do (which is the basis for this question) is as so:



            Answered 2017-Nov-01 at 03:05

            Here is a list of URLErrors when making a network request. In the list, there is an enum value called notConnectedToInternet. When you make a network request and it fails, look at the error code to find out if it is due to no connectivity or something else.

            Alternatively, you can host a health-check end-point on your server. Before making any request, make a request to this end-point. If the request is successful, you can rest assured that there is internet connectivity. Although, I would highly recommend going with the first option.


            NOTE: The code below is in Swift 3.



            Swift iOS -AshleyMills Reachability keeps toggling wifi on and off every few secs
            Asked 2018-Oct-01 at 08:30

            I downloaded the iOS sample Reachability project from AshleyMills Reachability

            It has a networkStatus label that says either: Wifi or No Connection

            Underneath that it has a hostNameLabel that says either: No host name or or invalidhost

            When I run the app on my device it repeatedly cycles the connection every 5 seconds in the following manner:

            1st 5 secs:

            2nd 5 sec:

            3rd 5 secs:

            Start cycle over from 1st, 2nd, and 3rd all over again and keep repeating.

            I'm on Home wifi and my internet connection is strong (no problems with any other apps). Why does it continuously cycle like this instead of just staying on Wifi + (the 2nd cycle)

            ViewController File:



            Answered 2018-May-03 at 18:45

            I looked through the code and found the answer. Inside the ViewController file the startHost() function has timer in it that cycles every 5 secs.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install Reachability.swift

            You can download it from GitHub.


            Keeping Reachability.swift up-to-date is a time consuming task. Making updates, reviewing pull requests, responding to issues and answering emails all take time.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone ashleymills/Reachability.swift

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link