Skip to content

Instantly share code, notes, and snippets.

@fakiho
Created January 23, 2018 10:54
Show Gist options
  • Select an option

  • Save fakiho/c72413535dfb48aca817fc80bd30942c to your computer and use it in GitHub Desktop.

Select an option

Save fakiho/c72413535dfb48aca817fc80bd30942c to your computer and use it in GitHub Desktop.

Revisions

  1. fakiho created this gist Jan 23, 2018.
    7 changes: 7 additions & 0 deletions Connectivity.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import Foundation
    import Alamofire
    class Connectivity {
    class func isConnectedToInternet() ->Bool {
    return NetworkReachabilityManager()!.isReachable
    }
    }
    4 changes: 4 additions & 0 deletions VController .swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    if Connectivity.isConnectedToInternet() {
    print("Yes! internet is available.")
    // do some tasks..
    }