     }
     
 }
-
-
-// MARK: - Private functions
-
-private extension EnvironmentSwitcherViewController {
-    
-    func closeSwitcher() {
-        presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
-    }
-    
-}

        view.endEditing(true)
        let updatedEnvironment = environments[picker.selectedRowInComponent(0)]
        AppNetworkState.currentAppState = updatedEnvironment
        closeSwitcher()
    }
    
    @IBAction func cancelSwitch(sender: AnyObject) {
        closeSwitcher()
    }
    
}

import NetworkStack
import UIKit

public protocol EnvironmentSwitcherDelegate {
    func closeEnvironmentSwitcher(appNetworkStateChanged: Bool)
}

public class EnvironmentSwitcherViewController: UIViewController {
    
    // MARK: - Public properties
    
    public var delegate: EnvironmentSwitcherDelegate?
    public var environments = [AppNetworkState]()

    
