-1

I have cards like shown below. When i tap on the card i want the card extension with textfield to edit.

Cards

I tried using tableview but it's not perfect.

if item is SwiftyAccordionCells.HeaderItem {
  if self.selectedHeaderIndex == nil {
    self.selectedHeaderIndex = (indexPath as NSIndexPath).row
  } else {
    self.previouslySelectedHeaderIndex = self.selectedHeaderIndex
    self.selectedHeaderIndex = (indexPath as NSIndexPath).row
  }

  if let previouslySelectedHeaderIndex = self.previouslySelectedHeaderIndex {
    self.cells.collapse(previouslySelectedHeaderIndex)
  }

  if self.previouslySelectedHeaderIndex != self.selectedHeaderIndex {
    self.cells.expand(self.selectedHeaderIndex!)
  } else {
    self.selectedHeaderIndex = nil
    self.previouslySelectedHeaderIndex = nil
  }

  self.table.beginUpdates()
  self.table.endUpdates()
  • Added inline-image, formatted coded – Jan Jun 7 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.