From 0a82d9cf6219cd45a442fbb88e347963a6f1f71a Mon Sep 17 00:00:00 2001 From: Amit Sah Date: Tue, 4 Jun 2024 11:20:14 +0530 Subject: [PATCH 1/4] Update DropDown.swift added border radius and border width --- DropDown/src/DropDown.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 From e2f14ea8f2e891f2552f6c7ccdaa20c3d3f71035 Mon Sep 17 00:00:00 2001 From: Amit Sah Date: Tue, 4 Jun 2024 11:20:56 +0530 Subject: [PATCH 2/4] Update DropDown.swift added border radius and border width --- DropDown/src/DropDown.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 From 89455071c26cfff8e59803239051cd1d2d246322 Mon Sep 17 00:00:00 2001 From: Amit Sah Date: Tue, 4 Jun 2024 11:23:06 +0530 Subject: [PATCH 3/4] Update DPDConstants.swift update constraints --- DropDown/helpers/DPDConstants.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From 8eb9828fa8e82f852298d3860790fb700beb9b1e Mon Sep 17 00:00:00 2001 From: Amit Sah Date: Tue, 4 Jun 2024 11:28:50 +0530 Subject: [PATCH 4/4] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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