Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions DropDown/helpers/DPDConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ internal struct DPDConstant {
static let CornerRadius: CGFloat = 2
static let RowHeight: CGFloat = 44
static let HeightPadding: CGFloat = 20
static let BorderWidth : CGFloat = 0.0
static let BorderColor : CGColor = UIColor.clear.cgColor

struct Shadow {

Expand Down
28 changes: 28 additions & 0 deletions DropDown/src/DropDown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,32 @@ public final class DropDown: UIView {
}
didSet { reloadAllComponents() }
}

/**
The borderWidth of DropDown.

Changing the corner borderWidth automatically reloads the drop down.
*/
@objc public dynamic var borderWidth = DPDConstant.UI.BorderWidth {
willSet {
tableViewContainer.layer.borderWidth = newValue
tableView.layer.borderWidth = newValue
}
didSet { reloadAllComponents() }
}

/**
The borderColor of DropDown.

Changing the corner borderColor automatically reloads the drop down.
*/
@objc public dynamic var borderColor = DPDConstant.UI.BorderColor {
willSet {
tableViewContainer.layer.borderColor = newValue
tableView.layer.borderColor = newValue
}
didSet { reloadAllComponents() }
}

/**
The color of the shadow.
Expand Down Expand Up @@ -503,6 +529,8 @@ private extension DropDown {
tableView.separatorColor = separatorColor
tableView.layer.cornerRadius = cornerRadius
tableView.layer.masksToBounds = true
tableView.layer.borderColor = borderColor
tableView.layer.borderWidth = borderWidth
}

}
Expand Down