     - lol-status-v1.0
     */
 }
+
+protocol LolAPIListener {
+    func didReturnResult(result: NSDictionary)
+    func errorDidOccur(error: NSError, userString: String?)
+    func submittedURLInvalid(url: String)
+}

public class lolApiWrapper: NSObject {
    
    // MARK: Initialised detail
    var APIKey = ""
    var region = ""
    var miniURL = ""
    var result = NSDictionary();
    var static_data:Bool = false;
    
    public func ApiKey(APIKey: String, region: String = "") -> lolApiWrapper {
        self.APIKey = APIKey
        self.region = region
        
        return self
    }
    
    
    // MARK: Retrieve API
    public func get() -> NSDictionary {
        var apiURL = "";
        
        if(self.region == "") {
            for i in 0...(regions.count-1) {
                if(!static_data) {
                    apiURL = APIURL.stringByReplacingOccurrencesOfString("{region}", withString: regions[i], options: NSStringCompareOptions.LiteralSearch, range: nil)
                } else {
                    apiURL = STATICURL.stringByReplacingOccurrencesOfString("{region}", withString: regions[i], options: NSStringCompareOptions.LiteralSearch, range: nil)
                }
                let URL = apiURL + self.miniURL + (self.miniURL.containsString("?") ? "&" : "?") + "api_key=" + self.APIKey
                
                self.result = self.getJSON(URL)
                
                if (self.result.count > 0) {
                    break;
                }
            }
        } else {
            if(!static_data) {
                apiURL = APIURL.stringByReplacingOccurrencesOfString("{region}", withString: self.region, options: NSStringCompareOptions.LiteralSearch, range: nil)
            } else {
                apiURL = STATICURL.stringByReplacingOccurrencesOfString("{region}", withString: self.region, options: NSStringCompareOptions.LiteralSearch, range: nil)
            }
            let URL = apiURL + self.miniURL + (self.miniURL.containsString("?") ? "&" : "?") + "api_key=" + self.APIKey
            self.result = self.getJSON(URL)
        }
        
        
        print(self.result)
        
        return self.result
    }
    
    public func getJSON(urlToRequest: String) -> NSDictionary{

//
//  Created by Mobin Zadeh Kochak on 04/09/2015.
//  Copyright (c) 2015 Mobin Zadeh Kochak. All rights reserved.
//  Edited by Mason Phillips (https://github.com/mathmatrix828/
//  Edited on 30MAY2016
//

import UIKit
