//
//  EtsySettingsViewController.swift
//  Vendoo
//
//  Created by Okechi Onyeje on 6/29/16.
//  Copyright © 2016 Okechi Onyeje. All rights reserved.
//

import UIKit

class EtsySettingsViewController: UIViewController {
    var wereDefaultsChanged: Bool = NSUserDefaults.standardUserDefaults().boolForKey("etsyDefaultsOverriden")
    
    @IBOutlet weak var userID: UILabel!
    
    @IBOutlet weak var whoMadeBtn: UIButton!
    
    @IBOutlet weak var isSupplierBtn: UIButton!
    
    @IBOutlet weak var productAgeBtn: UIButton!
    
    var etsyManager: EtsyRESTAPIManager!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
        if(wereDefaultsChanged) {
            //change button labels to reflect user selected defaults
        }
        //dispatch_async(dispatch_get_main_queue(), {
        print(EtsyRESTAPIManager.settingsDictionary["userID"] as? String)
        self.userID.text = (EtsyRESTAPIManager.settingsDictionary["userID"] as! String)
        
        //})
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
    /*
     // MARK:  Navigation
     
     // In a storyboard-based application, you will often want to do a little preparation before navigation
     override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
     // Get the new view controller using segue.destinationViewController.
     // Pass the selected object to the new view controller.
     }
     */
    
}

//MARK:- IBActions
extension EtsySettingsViewController {
    
    @IBAction func navigateBack(sender: AnyObject){
        
        self.dismissViewControllerAnimated(true, completion: nil)
        
    }
    
}

//MARK:- Class Methods
extension EtsySettingsViewController {
    
    func loadManager (etsyManager: EtsyRESTAPIManager) {
        self.etsyManager = etsyManager
    }
}