In which functions, how to add an action to a LiquidFloatingActionButton index cell?

I created two buttons in LiduidFloatingActionButton with the following code.

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 } 

I do not know to add an action to each LiquidFloatingActionButton cell, as well as to display the cell name. Please help me if anyone finds out about this.

+5
source share
2 answers

I got a solution to add an action to each cell.

 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() } 
+2
source

Call this function in viewDidLoad() . Read this GitHub code, you will get more ideas. https://github.com/yoavlt/LiquidFloatingActionButton/blob/master/Example/LiquidFloatingActionButton/ViewController.swift

+1
source

Source: https://habr.com/ru/post/1261120/


All Articles