             //toggleSelectState()
         }
     }
-}
+    
+    func p_view() {
+        if isEditMode {
+            if isSelected {
+                p_selectedViewAtEditMode()
+            } else {
+                p_unSelectedViewAtEditMode()
+            }
+        } else {
+            if isSelected {
+                p_selectedViewAtNormalMode()
+            } else {
+                p_unSelectedViewAtNormalMode()
+            }
+        }
+    }
+    
+    func p_selectedViewAtEditMode() {
+        button.hidden = false
+        backgroundColor = UIColor.blueColor()
+    }
+    func p_selectedViewAtNormalMode() {
+        button.hidden = true
+        backgroundColor = UIColor.yellowColor()
+    }
+    func p_unSelectedViewAtEditMode() {
+        button.hidden = false
+        backgroundColor = UIColor.whiteColor()
+    }
+    func p_unSelectedViewAtNormalMode() {
+        button.hidden = true
+        backgroundColor = UIColor.whiteColor()
+
+    }
+}
            isSelected = false
        }
        titleLabel.text = item!.title
    }
    
    func toggleSelectState() {
        isSelected = !isSelected // invert
    }
    func didSelect() {
        if isEditMode {
            toggleSelectState()

    var item : ModelItem?
    
    var isEditMode:Bool = false {
        didSet(oldEditMode) {
            p_view()
        }
    }
    var isSelected:Bool = false {
        didSet(oldSelected) {
            item!.isSelected = isSelected
            p_view()
        }
    }
    
