PaoloCuscela / Cards

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

Set a button in card details #19

Closed hihelloluigi closed 7 years ago

hihelloluigi commented 7 years ago

Hi, I found this fantastic library. I've integrated it today, but when I try to add a button in the contents of card, it's impossible to touch.

Is it possible to add a button in card details?

Thank you

PaoloCuscela commented 7 years ago

You have to add it to your detailView. And then manage it in the detailView's ViewController.

If you want to add it to the card itself instead, you have to pick CardHighlight or subclass another card.

hihelloluigi commented 7 years ago

I tried to add buttons in my detailView's but the click doesn't work. Seems that the new view controller are unattainable. If you want to see what I mean what my project (Develop branch). https://github.com/mo3bius/My-Simple-Instagram/tree/develop

There are some buttons in in details view but if tried to click on it nothing is happening.

PaoloCuscela commented 7 years ago

Ok, got it. The problem was that the detailViewController wasn't added as child of the card's presented vc. I'll push a new release today. Just use shoudPresent( :UIViewController, from :UIViewController ) instead of shoudPresent( :UIView, from :UIViewController )