Skip to content

Commit a972c03

Browse files
committed
add can border setup
1 parent 4d79f1d commit a972c03

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

Sources/EKTabBarController/EKFloatingBarView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ class EKFloatingBarView: UIView {
2020
weak var delegate: EKFloatingBarViewDelegate?
2121

2222
private let cornerRadius: CGFloat
23+
private let borderWidth: CGFloat
24+
private let borderColor: UIColor
2325

2426
private var buttons: [UIButton] = []
2527

26-
init(_ items: [UITabBarItem], cornerRadius: CGFloat = 20, backgroundColor: UIColor = .white) {
28+
init(_ items: [UITabBarItem], cornerRadius: CGFloat = 20, backgroundColor: UIColor = .white, borderWidth: CGFloat,
29+
borderColor: UIColor) {
2730
self.cornerRadius = cornerRadius
31+
self.borderColor = borderColor
32+
self.borderWidth = borderWidth
2833

2934
super.init(frame: .zero)
3035

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

3944
layer.cornerRadius = cornerRadius
45+
layer.borderColor = borderColor
46+
layer.borderWidth = borderWidth
4047

4148
}
4249

Sources/EKTabBarController/EKTabBarController.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public final class EKTabBarController: UITabBarController {
1717
private let cornerRadius: CGFloat
1818
private let backColor: UIColor
1919
private let bottomSpace: CGFloat
20+
private let borderWidth: CGFloat
21+
private let borderColor: UIColor
2022

2123
/// Initialize TabBar controller
2224
/// - Parameters:
@@ -29,13 +31,18 @@ public final class EKTabBarController: UITabBarController {
2931
cornerRadius: CGFloat,
3032
backgroundColor: UIColor,
3133
insets: UIEdgeInsets = .init(top: 0, left: 16, bottom: 0, right: 16),
32-
bottomSpace: CGFloat = 50) {
34+
bottomSpace: CGFloat = 50,
35+
borderWidth: CGFloat = 0,
36+
borderColor: UIColor = .clear) {
3337

3438
self.controllerItems = controllerItems
3539
self.insets = insets
3640
self.cornerRadius = cornerRadius
3741
self.backColor = backgroundColor
3842
self.bottomSpace = abs(bottomSpace)
43+
44+
self.borderColor = borderColor
45+
self.borderWidth = borderWidth
3946

4047
super.init(nibName: nil, bundle: nil)
4148
}

0 commit comments

Comments
 (0)