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

import UIKit

class EbaySettingsViewController: UIViewController {
    var wereDefaultsChanged: Bool = NSUserDefaults.standardUserDefaults().boolForKey("ebayDefaultsOverriden")
    
    //IBOutlets
    @IBOutlet weak var listingTypeBtn: UIButton!
    
    @IBOutlet weak var conditonBtn: UIButton!
    
    @IBOutlet weak var listingDurationBtn: UIButton!
    
    @IBOutlet weak var ebaySite: UIButton!
    
    @IBOutlet weak var postalCode: UIButton!
    
    @IBOutlet weak var shippingBtn: UIButton!
    
    @IBOutlet weak var paymentBtn: UIButton!
    
    @IBOutlet weak var returnPolicyBtn: UIButton!
    
    @IBOutlet weak var userID: UILabel!
    
    
    
    var ebayManager: EbayWebServiceManager!

    override func viewDidLoad() {
        super.viewDidLoad()
        self.ebayManager.reinit()
        // Do any additional setup after loading the view.
        if(wereDefaultsChanged) {
            //change button labels to reflect user selected defaults
        }else{
            
        }
        dispatch_async(dispatch_get_main_queue(), {
            print(EbayWebServiceManager.settingsDictionary["userID"] as? String)
            self.userID.text = EbayWebServiceManager.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:- Class Methods
extension EbaySettingsViewController {
    
    func loadManager (ebayManager: EbayWebServiceManager) {
        self.ebayManager = ebayManager
    }
}

//MARK:- IBActions
extension EbaySettingsViewController {

    @IBAction func navigateBack(sender: AnyObject){
    
        self.dismissViewControllerAnimated(true, completion: nil)
        
    }
    
    @IBAction func selectListingType(sender: AnyObject) {
    }
    
    @IBAction func selectCondition(sender: AnyObject) {
    }
    
    @IBAction func selectListingDuration(sender: AnyObject) {
    }
    
    @IBAction func selectEbaySite(sender: AnyObject) {
    }
    
    @IBAction func selectShipping(sender: AnyObject) {
    }
    
    @IBAction func selectPostalCode(sender: AnyObject) {
        
    }
    
    @IBAction func selectPayment(sender: AnyObject) {
    }
    
    @IBAction func selectReturnPolicy(sender: AnyObject) {
    }
    
}