isuru-nanayakkara / reach Goto Github PK
View Code? Open in Web Editor NEWA simple class to check for internet connection availability in Swift.
License: MIT License
A simple class to check for internet connection availability in Swift.
License: MIT License
Doesn't compile with Swift 2.0
Will this library get any Swift 4/4.2 support anytime soon?
So I'm getting this error and I can't find a solution, help.
Cannot invoke 'withUnsafePointer' with an argument list of type '(inout sockaddr_in, () -> _)
let defaultRouteReachability = withUnsafePointer(&zeroAddress)
I have downloaded the code from "https://github.com/Isuru-Nanayakkara/Swift-Reachability" and I have to integrate the Reachability in my app but I am getting the error "Use of unresolved identifier 'Reachability'". The problem is very confusing to me because in one of my View Controller I am able to access the function
if Reachability.isConnectedToNetwork()
{
}
but in another View Controller it is giving error Use of unresolved identifier 'Reachability'
I have been trying to understand the cause of this issue but I didn't find any solution. Please provide me solution ASAP.
Little experiment on XCODE 11.5
Add Reach.swift to project
Add code
NotificationCenter.default.addObserver(self, selector: #selector(ViewController.networkStatusChanged(_:)), name: Notification.Name(rawValue: ReachabilityStatusChangedNotification), object: nil)
Reach().monitorReachabilityChanges()
to viewDidLoad() of ViewController
Turn Network Off unplugging net cable and switch off Wi-Fi connection on Mac
Build and start project in Simulator
We get string "Offline" on output. Everything is fine right now.
Switch internet connection On connecting to WiFi. Run some net activity in project. Download some data successfully. Nothing happen in NotificationCenter about ReachabilityStatusChangedNotification.
Another scenario with same code.
Turn Network On unplugging net cable but switch Wi-Fi connection On
Build and start project in Simulator
We get string "Online" on output. Everything is fine right now.
Switch Wi-Fi off.
We get string "Offline" on output. Everything is perfect! But
Reconnect Wi-Fi. Run some net activity in project. Download some data successfully.
Ooops.
Nothing happen in NotificationCenter about ReachabilityStatusChangedNotification again.
Hi, i have some issues with Apple using this Framework. Apple says that my application is crashing when in IPV6 netowrk. Im using Reach framework and all works fine but Apple says no. Please if someone could help me.
I am iOS 8.2 using CocoaPods. What's missing here?
error: /Applications/Xcode-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker
Usage: /Applications/Xcode-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
Please check this issue. tonymillion/Reachability#74
Hi, your class seems to be simple and easy to use but unfortunately don't work on my swift 3 project :(
Do you plan to upgrade it ?
Thx ;)
Any plans on extending this class to provide support for detecting WiFi and WWAN availability?
Hi,
While cocoapods 0.36 doesn't have an official release, it would be nice to have a tag based on master branch and then add Swift-Reachability as reference in my project.
Like podspec says, I believe the tag should be named 0.1.0, just guessing, if not, please make sure both match with the same version.
Is it possible to install the Swift 2 version with Cocoapods? I tried:
pod 'Reach', :git => 'https://github.com/Isuru-Nanayakkara/Reach.git'
.. but it installs the 1.2 version.
Could you please add support for Carthage?
Hi,
I'm currently connected to a wi-fi network but it doesn't connect to the internet. Nevertheless your implementation still returns "Online" for connectionStatus. Can you please help me finding out what is wrong?
However it works properly when really exists internet connection or when the wi-fi is turned off.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.