Skip to content
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

updated border radius and borderWidth #336

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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
5 changes: 4 additions & 1 deletion DropDown/helpers/DPDConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
17 changes: 17 additions & 0 deletions DropDown/src/DropDown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down