From 994c0724b08dc47c2fdda1f2199d92819105dcb4 Mon Sep 17 00:00:00 2001 From: Emil Karimov Date: Sat, 29 Oct 2022 15:33:30 +0530 Subject: [PATCH] fix insets --- Sources/EKTabBarController/EKFloatingBarView.swift | 5 +++-- Sources/EKTabBarController/EKTabBarController.swift | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/EKTabBarController/EKFloatingBarView.swift b/Sources/EKTabBarController/EKFloatingBarView.swift index 0b1f8a0..8580ca1 100644 --- a/Sources/EKTabBarController/EKFloatingBarView.swift +++ b/Sources/EKTabBarController/EKFloatingBarView.swift @@ -42,7 +42,8 @@ class EKFloatingBarView: UIView { super.layoutSubviews() layer.cornerRadius = cornerRadius - _ = addExternalBorder(borderWidth: borderWidth, borderColor: borderColor) + layer.borderColor = borderColor.cgColor + layer.borderWidth = borderWidth } @@ -66,7 +67,7 @@ class EKFloatingBarView: UIView { addSubview(stackView) stackView.snp.makeConstraints { make in - make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)) + make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: abs(16 - borderWidth), bottom: 0, right: abs(16 - borderWidth))) } DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { diff --git a/Sources/EKTabBarController/EKTabBarController.swift b/Sources/EKTabBarController/EKTabBarController.swift index 8b0ec78..7c3c7f7 100644 --- a/Sources/EKTabBarController/EKTabBarController.swift +++ b/Sources/EKTabBarController/EKTabBarController.swift @@ -36,7 +36,10 @@ public final class EKTabBarController: UITabBarController { borderColor: UIColor = .clear) { self.controllerItems = controllerItems - self.insets = insets + self.insets = UIEdgeInsets(top: insets.top - borderWidth, + left: insets.left - borderWidth, + bottom: insets.bottom - borderWidth, + right: insets.right - borderWidth) self.cornerRadius = cornerRadius self.backColor = backgroundColor self.bottomSpace = abs(bottomSpace)