LiquidFloatingActionButton

LiquidFloatingActionButton

我使用以下代码在LiduidFloatingActionButton中创建了两个按钮单元。

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的每个单元格中添加 Action ,也不显示单元格的名称。如果有人知道,请帮助我。

最佳答案

我得到了在每个单元格上添加 Action 的解决方案。

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()
}

10-08 16:21