diff --git a/DropDown/helpers/DPDConstants.swift b/DropDown/helpers/DPDConstants.swift index 52047be..96eb892 100644 --- a/DropDown/helpers/DPDConstants.swift +++ b/DropDown/helpers/DPDConstants.swift @@ -27,7 +27,7 @@ internal struct DPDConstant { internal struct UI { static let TextColor = UIColor.black - static let SelectedTextColor = UIColor.black + static let SelectedTextColor = UIColor.black static let TextFont = UIFont.systemFont(ofSize: 15) static let BackgroundColor = UIColor(white: 0.94, alpha: 1) static let SelectionBackgroundColor = UIColor(white: 0.89, alpha: 1) @@ -36,6 +36,9 @@ internal struct DPDConstant { static let RowHeight: CGFloat = 44 static let HeightPadding: CGFloat = 20 + static let BorderColor: CGColor = UIColor.systemGray3.cgColor + static let BorderWidth: CGFloat = 1 + struct Shadow { static let Color = UIColor.darkGray diff --git a/DropDown/src/DropDown.swift b/DropDown/src/DropDown.swift index f41e8dd..c2401b4 100644 --- a/DropDown/src/DropDown.swift +++ b/DropDown/src/DropDown.swift @@ -232,6 +232,20 @@ public final class DropDown: UIView { didSet { reloadAllComponents() } } + @objc public dynamic var borderColor = DPDConstant.UI.BorderColor { + willSet { + tableViewContainer.layer.borderColor = newValue + } + didSet { reloadAllComponents() } + } + + @objc public dynamic var borderWidth = DPDConstant.UI.BorderWidth { + willSet { + tableViewContainer.layer.borderWidth = newValue + } + didSet { reloadAllComponents() } + } + /** Alias method for `cornerRadius` variable to avoid ambiguity. */ @@ -547,6 +561,9 @@ private extension DropDown { tableViewContainer.layer.shadowOpacity = shadowOpacity tableViewContainer.layer.shadowRadius = shadowRadius + tableViewContainer.layer.borderColor = borderColor + tableViewContainer.layer.borderWidth = borderWidth + tableView.backgroundColor = tableViewBackgroundColor tableView.separatorColor = separatorColor tableView.layer.cornerRadius = cornerRadius diff --git a/README.md b/README.md index c423fe5..2a54779 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,8 @@ If you need Swift 4.0, use version 2.3.2: Use [CocoaPods](http://www.cocoapods.org). -1. Add `pod 'DropDown'` to your *Podfile*. +1. Add `pod 'DropDown', :git => 'https://github.com/aksamitsah/DropDown.git', :branch => 'master''` to your *Podfile*. 2. Install the pod(s) by running `pod install`. -3. Add `import DropDown` in the .swift files where you want to use it ### Carthage