Ios 在哪些函数中,如何在LiquidFloatingActionButton的索引单元格中添加操作?
我已经用下面的代码在LiduidFloatingActionButton中创建了两个按钮单元Ios 在哪些函数中,如何在LiquidFloatingActionButton的索引单元格中添加操作?,ios,swift,Ios,Swift,我已经用下面的代码在LiduidFloatingActionButton中创建了两个按钮单元 private func createFloatingButtons(){ cells.append(createButtonCell("firstCell")) cells.append(createButtonCell("secondCell")) let floatingFrame = CGRect(x: self.view.frame.width - 56 - 16, y
private func createFloatingButtons(){
cells.append(createButtonCell("firstCell"))
cells.append(createButtonCell("secondCell"))
let floatingFrame = CGRect(x: self.view.frame.width - 56 - 16, y: self.view.frame.height - 56 - 36, width: 56, height: 56)
let floatingButton = createButton(floatingFrame, style:.Up)
self.view.addSubview(floatingButton)
self.floatingActionButton = floatingButton
}
我不知道如何在LiquidFloatingActionButton的每个单元格中添加操作,以及如何显示单元格的名称。如果有人知道,请帮助我。在
viewDidLoad()
中调用此函数。阅读此GitHub代码,您将了解更多信息 我得到了在每个单元格上添加操作的解决方案
extension CampaignListViewController: LiquidFloatingActionButtonDelegate {
func liquidFloatingActionButton(liquidFloatingActionButton: LiquidFloatingActionButton, didSelectItemAtIndex index: Int){
// floatingActionButton.didTappedCell()
switch(index){
case 0:
// do something
break;
case 1:
// do somthing
break;
default:
break;
}
self.floatingActionButton.close()
}
添加代码createButtonCell@jigneshVadadoriya你的意思是我必须在以下函数中添加代码private func createButtonCell(iconName:String)->LiquidFloatingCell{let name=LiquidFloatingCell(icon:UIImage(name:iconName)!)return name}我已经在viewDidLoad()中调用了该函数。但我想在每个单元格中添加操作。