     func articleSaved(success:Bool, error:NSError?)
 }
 
+let bgColorUnselected = UIColor(hue: 200/360, saturation: 0.40, brightness: 1.0, alpha: 1.0)
+let bgColorSelected = UIColor(hue: 200/360, saturation: 1.0, brightness: 1.0, alpha: 1.0)
+
 class ArticleViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
-
+    
     @IBOutlet weak var longOrShortSegmentedControl: UISegmentedControl!
     @IBOutlet weak var pictureImageView: UIImageView!
-
+    
     @IBOutlet weak var averageColorImageView: UIImageView!
+    @IBOutlet weak var casualButton: UIButton!
+    @IBOutlet weak var workButton: UIButton!
+    @IBOutlet weak var dateButton: UIButton!
+    @IBOutlet weak var socialButton: UIButton!
+    @IBOutlet weak var formalButton: UIButton!
+    @IBOutlet weak var blkTieButton: UIButton!
     
     var libraryHasBeenViewed: Bool!
     var vc: UIImagePickerController!
+    var occassionDictionary: [String:Bool] = ["Casual": false, "Work": false, "Date": false, "Social": false, "Formal": false, "Blk Tie": false]
+    var buttonDictionary: [String:UIButton]!
+    
+    
+    var article: Article! {
+        didSet {
+            /* set the occasion buttons bgcolor by iterating through the button dictionary */
+            if let attires = article.occasion {
+                for attire in attires {
+                    if occassionDictionary[attire]! {
+                        buttonDictionary[attire]!.backgroundColor = bgColorSelected
+                    } else {
+                        buttonDictionary[attire]!.backgroundColor = bgColorUnselected
+                    }
+                }
+            } else {
+                for (_,button) in buttonDictionary {
+                    button.backgroundColor = bgColorUnselected
+                }
+            }
+            
+            //pictureImageView.image = article.image as! UIImage
+            article.mediaImage = Article.getPFFileFromImage(pictureImageView.image)
+        }
+    }
+    
+    var picture: PFObject! {
+        didSet {
+            
+        }
+    }
     
     var article: Article!
     
     override func viewDidLoad() {
         super.viewDidLoad()
-
+        
         // Do any additional setup after loading the view.
         libraryHasBeenViewed = false
         vc = UIImagePickerController()
         vc.delegate = self
         vc.allowsEditing = true
         
-    }
-    
-    override func viewDidAppear(animated: Bool) {
-        
-    
-        
-        
+        //article = Article()
+        buttonDictionary = ["Casual": casualButton, "Work": workButton, "Date": dateButton, "Social": socialButton, "Formal": formalButton, "Blk Tie": blkTieButton]
     }
     
     func imagePickerController(picker: UIImagePickerController,
-        didFinishPickingMediaWithInfo info: [String : AnyObject]) {
-            // Get the image captured by the UIImagePickerController
-            let editedImage = info[UIImagePickerControllerEditedImage] as! UIImage
-            
-            // Do something with the images (based on your use case)
-            pictureImageView.image = editedImage
-            // Dismiss UIImagePickerController to go back to your original view controller
-            dismissViewControllerAnimated(true, completion: nil)
+                               didFinishPickingMediaWithInfo info: [String : AnyObject]) {
+        // Get the image captured by the UIImagePickerController
+        let editedImage = info[UIImagePickerControllerEditedImage] as! UIImage
+        
+        // Do something with the images (based on your use case)
+        pictureImageView.image = editedImage
+        
+        
+        // Dismiss UIImagePickerController to go back to your original view controller
+        dismissViewControllerAnimated(true, completion: nil)
     }
-
-
+    
     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.
    }
    */

}

//
//  ArticleViewController.swift
//  CPOutfitters
//
//  Created by Cory Thompson on 3/9/16.
