Skip to content

added new item "selectedRowTextColor" #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion iOSDropDown/Classes/iOSDropDown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ open class DropDown: UITextField {
@IBInspectable public var itemsColor: UIColor = .darkGray
@IBInspectable public var itemsTintColor: UIColor = .blue
@IBInspectable public var selectedRowColor: UIColor = .systemPink
@IBInspectable public var selectedRowTextColor: UIColor = .black
@IBInspectable public var hideOptionsWhenSelect = true
@IBInspectable public var isSearchEnable: Bool = true {
didSet {
Expand Down Expand Up @@ -404,15 +405,16 @@ extension DropDown: UITableViewDataSource {

if indexPath.row != selectedIndex {
cell!.backgroundColor = rowBackgroundColor
cell!.textLabel!.textColor = itemsColor
} else {
cell?.backgroundColor = selectedRowColor
cell!.textLabel!.textColor = selectedRowTextColor
}

if imageArray.count > indexPath.row {
cell!.imageView!.image = UIImage(named: imageArray[indexPath.row])
}
cell!.textLabel!.text = "\(dataArray[indexPath.row])"
cell!.textLabel!.textColor = itemsColor
cell!.tintColor = itemsTintColor
cell!.accessoryType = (indexPath.row == selectedIndex) && checkMarkEnabled ? .checkmark : .none
cell!.selectionStyle = .none
Expand Down