PaoloCuscela / Cards

Awesome iOS 11 appstore cards in swift 5.
MIT License
4.2k stars 274 forks source link

Action or event in button #122

Closed agentelu closed 4 years ago

agentelu commented 5 years ago

HI, there is any way to add a function to the button in Card ?

Ragazzetto commented 5 years ago

Use the delegate method

func cardHighlightDidTapButton(card: CardHighlight, button: UIButton)

For example

func cardHighlightDidTapButton(card: CardHighlight, button: UIButton) {        
        if card == myCard {
// add your function here
        }
    }

Vanni

agentelu commented 5 years ago

Thanks, its works

Ragazzetto commented 5 years ago

👍

kevink1103 commented 4 years ago

Can anyone tell me how to do this in detail? I am trying to use the button to do something else rather than opening detailVC.