所以我在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
}
}
因此,如果有人知道如何创建子下拉列表,请帮助我!