Skip to content

Instantly share code, notes, and snippets.

@sauvikatinnofied
Last active January 19, 2017 15:06
Show Gist options
  • Save sauvikatinnofied/2dace27129874469770c1c2650f52182 to your computer and use it in GitHub Desktop.
Save sauvikatinnofied/2dace27129874469770c1c2650f52182 to your computer and use it in GitHub Desktop.
Medium Blog Post Code Snippet
/// Adds a new listener to the listeners array
///
/// - parameter delegate: a new listener
func addListener(listener: NetworkStatusListener){
listeners.append(listener)
}
/// Removes a listener from listeners array
///
/// - parameter delegate: the listener which is to be removed
func removeListener(listener: NetworkStatusListener){
listeners = listeners.filter{ $0 !== listener}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment