iOSDropDown icon indicating copy to clipboard operation
iOSDropDown copied to clipboard

dropdown within scrollview

Open deepakverma4 opened this issue 6 years ago • 1 comments

my dropdown menu is inside scrollview. issue i'm facing is that scrollview stops scrolling if dropdown list is appeared. any idea how to fix that?

deepakverma4 avatar Jun 04 '19 06:06 deepakverma4

@deepakverma4 I have resolved this issue. Set nil to parentController when the user clicks on any item. Please find the code and replace it.

//MARK: UITableViewDelegate extension DropDown: UITableViewDelegate { public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { selectedIndex = (indexPath as NSIndexPath).row let selectedText = self.dataArray[self.selectedIndex!] tableView.cellForRow(at: indexPath)?.alpha = 0 UIView.animate(withDuration: 0.5, animations: { () -> Void in tableView.cellForRow(at: indexPath)?.alpha = 1.0 tableView.cellForRow(at: indexPath)?.backgroundColor = self.selectedRowColor } , completion: { (didFinish) -> Void in self.text = "(selectedText)"

                    tableView.reloadData()
    })
    if hideOptionsWhenSelect {
        touchAction()
        self.endEditing(true)
    }
    if let selected = optionArray.index(where: {$0 == selectedText}) {
        self.parentController = nil
        if let id = optionIds?[selected] {
            didSelectCompletion(selectedText, selected , id )
        }else{
            didSelectCompletion(selectedText, selected , 0)
        }

    }

}

}

ShubhamSingla125 avatar Jul 12 '19 05:07 ShubhamSingla125