对于我的项目,我创建了一个排序菜单,它以编程方式创建水平滚动的按钮。但是我正在寻找动态分配IBAction的方法-特别是写入Firebase数据库的操作-给那些按钮......标记按钮和使用条件是否有效?我的代码是Food.swift-每个菜单项的属性集classFood{vartitle=""varfeaturedImage:UIImagevarcolor:UIColorinit(title:String,featuredImage:UIImage,color:UIColor){self.title=titleself.featuredImage=featuredImageself.