Skip to content

Commit

Permalink
add can border setup
Browse files Browse the repository at this point in the history
  • Loading branch information
emvakar committed Oct 29, 2022
1 parent 4d79f1d commit a972c03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Sources/EKTabBarController/EKFloatingBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ class EKFloatingBarView: UIView {
weak var delegate: EKFloatingBarViewDelegate?

private let cornerRadius: CGFloat
private let borderWidth: CGFloat
private let borderColor: UIColor

private var buttons: [UIButton] = []

init(_ items: [UITabBarItem], cornerRadius: CGFloat = 20, backgroundColor: UIColor = .white) {
init(_ items: [UITabBarItem], cornerRadius: CGFloat = 20, backgroundColor: UIColor = .white, borderWidth: CGFloat,
borderColor: UIColor) {
self.cornerRadius = cornerRadius
self.borderColor = borderColor
self.borderWidth = borderWidth

super.init(frame: .zero)

Expand All @@ -37,6 +42,8 @@ class EKFloatingBarView: UIView {
super.layoutSubviews()

layer.cornerRadius = cornerRadius
layer.borderColor = borderColor
layer.borderWidth = borderWidth

}

Expand Down
9 changes: 8 additions & 1 deletion Sources/EKTabBarController/EKTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public final class EKTabBarController: UITabBarController {
private let cornerRadius: CGFloat
private let backColor: UIColor
private let bottomSpace: CGFloat
private let borderWidth: CGFloat
private let borderColor: UIColor

/// Initialize TabBar controller
/// - Parameters:
Expand All @@ -29,13 +31,18 @@ public final class EKTabBarController: UITabBarController {
cornerRadius: CGFloat,
backgroundColor: UIColor,
insets: UIEdgeInsets = .init(top: 0, left: 16, bottom: 0, right: 16),
bottomSpace: CGFloat = 50) {
bottomSpace: CGFloat = 50,
borderWidth: CGFloat = 0,
borderColor: UIColor = .clear) {

self.controllerItems = controllerItems
self.insets = insets
self.cornerRadius = cornerRadius
self.backColor = backgroundColor
self.bottomSpace = abs(bottomSpace)

self.borderColor = borderColor
self.borderWidth = borderWidth

super.init(nibName: nil, bundle: nil)
}
Expand Down

0 comments on commit a972c03

Please sign in to comment.