Просмотр исходного кода

Remove unused optional library protocol methods

Adam Pritchard 9 лет назад
Родитель
Сommit
6e68af7b8c

+ 3 - 54
MobileLibrary/iOS/SampleApps/TunneledWebRequest/TunneledWebRequest/ViewController.swift

@@ -48,7 +48,9 @@ class ViewController: UIViewController {
 }
 }
 
 
 // MARK: TunneledAppDelegate implementation
 // MARK: TunneledAppDelegate implementation
-// See the protocol definition for details about the functions.
+// See the protocol definition for details about the methods.
+// Note that we're excluding all the optional methods that we aren't using, 
+// however your needs may be different.
 extension ViewController: TunneledAppDelegate {
 extension ViewController: TunneledAppDelegate {
     func getPsiphonConfig() -> String? {
     func getPsiphonConfig() -> String? {
         // In this example, we're going to retrieve our Psiphon config from a file in the app bundle.
         // In this example, we're going to retrieve our Psiphon config from a file in the app bundle.
@@ -71,10 +73,6 @@ extension ViewController: TunneledAppDelegate {
         NSLog("onDiagnosticMessage: %@", message)
         NSLog("onDiagnosticMessage: %@", message)
     }
     }
     
     
-    func onConnecting() {
-        NSLog("onConnecting")
-    }
-    
     func onConnected() {
     func onConnected() {
         NSLog("onConnected")
         NSLog("onConnected")
         
         
@@ -143,23 +141,6 @@ extension ViewController: TunneledAppDelegate {
         }
         }
     }
     }
     
     
-    func onExiting() {
-        // TODO: After updating tunnel-core, make sure this is getting hit.
-        NSLog("onExiting")
-    }
-    
-    func onAvailableEgressRegions(_ regions: [Any]) {
-        NSLog("onAvailableEgressRegions: %@", regions)
-    }
-    
-    func onSocksProxyPort(inUse port: Int) {
-        NSLog("onSocksProxyPort: %d", port)
-    }
-    
-    func onHttpProxyPort(inUse port: Int) {
-        NSLog("onHttpProxyPort: %d", port)
-    }
-    
     func onListeningSocksProxyPort(_ port: Int) {
     func onListeningSocksProxyPort(_ port: Int) {
         NSLog("onListeningSocksProxyPort: %d", port)
         NSLog("onListeningSocksProxyPort: %d", port)
         // Record the port being used so that we can proxy through it later.
         // Record the port being used so that we can proxy through it later.
@@ -175,36 +156,4 @@ extension ViewController: TunneledAppDelegate {
             self.httpProxyPort = port
             self.httpProxyPort = port
         }
         }
     }
     }
-    
-    func onUpstreamProxyError(_ message: String) {
-        NSLog("onUpstreamProxyError: %@", message)
-    }
-    
-    func onClientRegion(_ region: String) {
-        NSLog("onClientRegion: %@", region)
-    }
-    
-    func onSplitTunnelRegion(_ region: String) {
-        NSLog("onSplitTunnelRegion: %@", region)
-    }
-    
-    func onUntunneledAddress(_ address: String) {
-        NSLog("onUntunneledAddress: %@", address)
-    }
-    
-    func onBytesTransferred(_ sent: Int64, _ received: Int64) {
-        NSLog("onBytesTransferred: sent:%d, received:%d", sent, received)
-    }
-    
-    func onHomepage(_ url: String) {
-        NSLog("onHomepage: %@", url)
-    }
-    
-    func onClientIsLatestVersion() {
-        NSLog("onClientIsLatestVersion")
-    }
-    
-    func onClientUpgradeDownloaded(_ filename: String) {
-        NSLog("onClientUpgradeDownloaded: %@", filename)
-    }
 }
 }