Isuru-Nanayakkara / Reach

A simple class to check for internet connection availability in Swift.
MIT License
456 stars 119 forks source link

"Use of unresolved identifier 'Reachability'" #1

Closed harshcs closed 9 years ago

harshcs commented 9 years ago

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.

Isuru-Nanayakkara commented 9 years ago

I slapped together a small test project with two view controllers and I call the Reachability class' isConnectedToNetwork() method in both of those view controllers and strangely I'm not getting this error.

Have you tried cleaning and rebuilding the project? If that doesn't work, try deleting the Derived Data folder and try running it again.

harshcs commented 9 years ago

I tried that but still it is showing the same error even after suggested by the compiler. Please see the attached screen shot. I have added the SystemConfiguration.framework as well.

screen shot 2014-10-13 at 4 58 02 pm

harshcs commented 9 years ago

Moreover, it is not showing any error in App Delegate and working properly. Only in my View Controllers it is showing the issue. How come this is possible?

Isuru-Nanayakkara commented 9 years ago

Unfortunately I can't reproduce your error. But I think this is has something to do with access control. Try making the isConnectedToNetwork() method public. Also check out this thread and try the answers given there and let me know.

Isuru-Nanayakkara commented 9 years ago

Hi @harshcs,

Were you able to resolve your issue? Shall I close the issue?