2016-12-12 14 views
5

Aşağıdaki kodla birlikte LiduidFloatingActionButton'da iki düğme hücresi oluşturdum.Hangi işlevlerde LiquidFloatingActionButton'un dizin hücresine eylem eklenir?

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 
} 

Ben LiquidFloatingActionButton her hücrede işlem eklemek için ve ayrıca hücrenin adını görüntülemek için bilmiyorum. Bilinen biri varsa lütfen bana yardım edin.

+0

Vadadoriya ben createButtonCell fonk özel fonksiyon aşağıdaki kod eklemek zorunda anlamına @jignesh createButtonCell –

+0

kodunu ekleyin (iconName: String) -> LiquidFloatingCell { izin name = LiquidFloatingCell (simge: UIImage (adlandırılmış: iconName) !) İade adı } –

cevap

2

Her hücreye eylem ekleme çözümünü buldum.

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() 
} 
İlgili konular