yonat / MultiSelectSegmentedControl

UISegmentedControl remake that supports selecting multiple segments, vertical stacking, combining text and images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working with tableview cell

PrashantKT opened this issue · comments

previously version (2.3.1) was working with tableview cell,

Now I have updated the version 2.3.2 and suddenly it's crashing, even I have commented all code just put

    multi.items = ["Hello","How","are","YOu"]

nothing shows on the tableview

 multi.items.removeAll() // crash here in 2.3.2 (working on 2.3.1)
        if variation.price.count == 1 && !variation.addition{
            //because of hidden, nothing is shown and the height of the cell is sero
            multi.isHidden = true
            titleLabel.isHidden = true
        }else{
            multi.isHidden = false
            titleLabel.isHidden = false
            multi.allowsMultipleSelection = !variation.radio
            var indexArray:[Int] = []
            for (i,price) in variation.price.enumerated(){
                multi.items.append("\(price.title) \(price.currencyString())")
                
                if price.selected{
                    indexArray.append(i)
                }
            }
            
            multi.selectedSegmentIndexes = IndexSet(indexArray)
            self.layoutIfNeeded()
//            multi.selectedBackgroundColor = .cyan
//            multi.tintColor = .white
        }

Thanks for reporting this, but I can't reproduce this problem. Would you create a minimal project that shows this behavior so I can fix it?
Thanks!

@PrashantKT still a problem? If it is, please create a minimal project that reproduces the problem and link to it here, so I can see the problem and fix it.

@PrashantKT Still a problem? To help me help you, please create a minimal reproducible project:

  1. Fork this repo. (See instructions)
  2. Open the project in the Example directory.
  3. Change the code there to make the problem appear.

Then just link to your fork here.