快捷方式下拉菜单中的下拉菜单

时间:2018-01-24 22:33:03

标签: swift dropdown

所以我在Swift中创建了一个dropdown菜单。当我按下按钮时出现dropdown menu,但我的问题是我不知道如何从我的第一个dropdown menu为我的选项添加另一个dropdown

这是我dropdown的当前代码:

import UIKit

class ViewController: UIViewController {

    @IBOutlet var skolButtons: [UIButton]! // buttons for different schools

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func handleSelection(_ sender: UIButton) {
        skolButtons.forEach { (button) in
            button.isHidden = !button.isHidden // Hides button and = ! is the oppesite
            self.view.layoutIfNeeded()


        }



    }

    @IBAction func itgTap(_ sender: UIButton) { // what happens when you tap different schools

    }
}

因此,如果有人知道如何创建子下拉列表,请帮助我!

0 个答案:

没有答案