aromajoin/material-showcase-ios

showing a button in tableview

AmirFT opened this issue · 4 comments

I have a table view which has a custom cell, and it has 2 buttons.
I'm gonna use showcase to present both buttons and the cell itself.
as I tried
<< showcase.setTargetView(view: cell.editUnitBtn) >>
it changes the buttons constraints and misplace them and it shows the showcase on the nav bar.

screen shot 2018-11-14 at 1 28 16 pm

Did you called it under onViewDidLoad? the view is not positioned correctly yet.
Please call it inside onViewWillAppear or onViewDidAppear.

I have this problem too. how can I access to specific row of tableview and specific item in cell like uibutton in first row of tableview?

@vre142
By implementing the willDisplay cell of tableView and create an instance of Showcase and show it like this code:

func tableView(_ tableView: UITableView,
                   willDisplay cell: UITableViewCell,
                   forRowAt indexPath: IndexPath) {
        if indexPath.row == 0 {
            let showcase = MaterialShowcase()
            //Set view parameter with your control you want to show intro on it.
            showcase.setTargetView(view: cell.contentView.subviews.last!)
            showcase.backgroundViewType = .circle
            showcase.targetTintColor = UIColor.clear
            showcase.targetHolderColor = UIColor.clear
            showcase.primaryText = "Action 3"
            showcase.secondaryText = "Click here to go into details"
            showcase.isTapRecognizerForTargetView = true
            showcase.delegate = self
            showcase.show(completion: nil)
        }
}
Screenshot:

Hi,
For that you can call this wherever you want to show showcase
if let cell = tableview.visibleCells.first as? {
let showcase = MaterialShowcase()
materialShowcase.setTargetView(view: cell.)
showcase.backgroundViewType = .circle
showcase.targetTintColor = UIColor.clear
showcase.targetHolderColor = UIColor.clear
showcase.primaryText = "Action 3"
showcase.secondaryText = "Click here to go into details"
showcase.isTapRecognizerForTargetView = true
showcase.delegate = self
showcase.show(completion: nil)
}