 class RootViewController: UITableViewController, UIAdaptivePresentationControllerDelegate {
 
     var popOverViewController: PopOverViewController?
-    var section1 = ["Array", "Enum", "Array（All selectable）", "Enum（All selectable）"]
-    var section2 = ["UIBarButtonItem"]
-
-    var selectedKey: Int? = nil
+    var section1 = ["Int Array",  "String Array", "Int Array（All selectable）"]
+    var section2 = ["Enum",  "Enum（All selectable）"]
+    var section3 = ["UIBarButtonItem"]
+
+    var selectedIntKey: Int? = nil
+    var selectedStringKey: String? = nil
     var selectedFoodName: FoodName?
 
     @IBOutlet weak var baseTextView:UITextView?

            let text = section1[indexPath.row]
            cell.textLabel!.text = text
            return cell

        } else if indexPath.section == 1 {
            let cell = tableView.dequeueReusableCell(withIdentifier: "MoveCell", for: indexPath)

            let text = section2[indexPath.row]
            cell.textLabel!.text = text
            return cell
        }

        return UITableViewCell.init()
    }

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if indexPath.section == 0 {
            let cell = tableView.cellForRow(at: indexPath)
            guard let contentView = cell?.contentView else {
                return
            }

            if indexPath.row == 0 {
                openArrayMenu(view: contentView)
            } else if indexPath.row == 1 {
                openEnumMenu(view: contentView)
            } else if indexPath.row == 2 {
                openArrayMenu(view: contentView, allName: "All")
            } else if indexPath.row == 3 {
                openEnumMenu(view: contentView, allName: "All")
            }
        }


    // MARK: - function

    func openIntArrayMenu(view :UIView) {
        self.popOverViewController = PopOverViewController.instantiate()

        let titles = [ "Menu1", "Menu2", "Menu3"]
        let keys = [1, 2, 3]

        self.popOverViewController?.setArrayForView(delegate: self, view: view, titles: titles, keys: keys, defaultKey: selectedIntKey) { (key, index) in

            self.selectedIntKey = key

            print("key is  \(String(describing: key)) , index is  \(index) ")
        }

        if let popOverViewController = self.popOverViewController {
            self.present(popOverViewController, animated: true) {() -> Void in }
        }
    }

    func openStringArrayMenu(view :UIView) {
        self.popOverViewController = PopOverViewController.instantiate()

        let titles = [ "Menu1", "Menu2", "Menu3"]
        let keys = ["menu1", "menu2", "menu3"]

        self.popOverViewController?.setArrayForView(delegate: self, view: view, titles: titles, keys: keys, defaultKey: selectedStringKey) { (key, index) in

            self.selectedStringKey = key

            print("key is  \(String(describing: key)) , index is  \(index) ")
        }

        if let popOverViewController = self.popOverViewController {
            self.present(popOverViewController, animated: true) {() -> Void in }
        }
    }

    func openIntArrayMenu(view :UIView, allName: String) {
        self.popOverViewController = PopOverViewController.instantiate()

        let titles = ["Menu1", "Menu2", "Menu3"]
        let keys = [1, 2, 3]

        self.popOverViewController?.setArrayForView(delegate: self, view: view, titles: titles, keys: keys, defaultKey: selectedIntKey, allName: allName, onSelected: { (key, index) in
            self.selectedIntKey = key

            print("key is  \(String(describing: key)) , index is  \(index) ")
        })

        if let popOverViewController = self.popOverViewController {
            self.present(popOverViewController, animated: true) {() -> Void in }
        }
    }

    // MARK: - Enum

    func openEnumMenu(view :UIView) {
        self.popOverViewController = PopOverViewController.instantiate()

        self.popOverViewController?.setEnumForView(delegate: self, view: view, enumType: FoodName.self, defaultEnum: selectedFoodName, onSelected: { (key, index)  in

            self.selectedFoodName = key

            let foodValue = unsafeBitCast(key, to: FoodValue.self)
            print(foodValue.rawValue)

            print("key is  \(String(describing: key)) , index is  \(index) ")
        })

        if let popOverViewController = self.popOverViewController {
