We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 837667d commit 55c9fbbCopy full SHA for 55c9fbb
iOSDropDown/Classes/iOSDropDown.swift
@@ -224,11 +224,10 @@ open class DropDown : UITextField{
224
table.backgroundColor = rowBackgroundColor
225
table.rowHeight = rowHeight
226
if scrollToSelectedIndex{
227
- if selectedIndex != nil{
228
- if let indexPath = NSIndexPath(row: selectedIndex!, section: 0) as? IndexPath{
229
- self.table.scrollToRow(at: indexPath, at: .top, animated: true)
230
- self.table.reloadData()
231
- }
+ if let selectedIndex = selectedIndex {
+ let indexPath = IndexPath(row: selectedIndex, section: 0)
+ self.table.scrollToRow(at: indexPath, at: .top, animated: true)
+ self.table.reloadData()
232
}
233
234
parentController?.view.addSubview(shadow)
0 commit comments