             case "password":
                 rightField.keyboardType = UIKeyboardType.ASCIICapable
                 rightField.secureTextEntry = true
+            case "date":
+                rightButton.setImage(UIImage(named: "QQ"), forState: UIControlState.Normal)
             default:
                 break
             }


class PMDetailControllerCell: UITableViewCell , UITextFieldDelegate {
    weak var superController: PMDetailController?
    var ele: Element? {
        didSet {
            if let lt = ele?.leftText {

        //            rightButton.hidden = true
        //        }
    }
    
    // MARK: - Button action
    @IBAction func rightButtonAction(sender: UIButton) {
        if let passwordGeneratorController = superController?.storyboard?.instantiateViewControllerWithIdentifier("PMPasswordGeneratorController") as? PMPasswordGeneratorController {
            passwordGeneratorController.success = { [unowned self](randomString: String) -> Void in
                self.ele?.rightText = randomString
            }
            superController?.showViewController(passwordGeneratorController, sender: nil)
        }
    }
