Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing methods/properties in API #4

Closed
nonsensery opened this issue May 10, 2016 · 3 comments
Closed

Confusing methods/properties in API #4

nonsensery opened this issue May 10, 2016 · 3 comments
Milestone

Comments

@nonsensery
Copy link
Contributor

The public API for ELReachability consists of two types: NetworkStatus, and NetworkStatusInterpreter. The former exposes reachability state through methods, like networkStatus.isReachable() and the latter does it through computed properties, like networkStatusInterpreter.isReachable. This is kind of confusing.

FWIW, I'd rather have NetworkStatusInterpreter replaced with an enum, like:

public enum Reachability {
    case Offline, Cellular, WiFi
}

public typealias NetworkStatusCallbackClosure = (reachability: Reachability) -> Void

public class NetworkStatus {
    var currentReachability: Reachability {  }
}
@angelodipaolo
Copy link
Contributor

I agree about it being confusing and that an enum would be a better fit. Since this would be a breaking API change I'd like to see it land in the next major version, which would also support Swift 3.

@nonsensery Is this something you are interested in implementing? If not I can find time in the next week to get this change in as part of the updates for Swift 3.

@angelodipaolo angelodipaolo added this to the v2.0.0 milestone Oct 12, 2016
@nonsensery
Copy link
Contributor Author

@angelodipaolo Yeah, sure. I can take a look today.

@angelodipaolo
Copy link
Contributor

Fixed via 37be9aa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants