[ios] make the UIView's extension AddSeparator internal

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn 2024-02-04 14:12:35 +04:00 committed by Alexander Borsuk
parent b158a546a5
commit fb4bb96abe
3 changed files with 21 additions and 19 deletions

View file

@ -0,0 +1,17 @@
extension UIView {
func addSeparator(thickness: CGFloat = 1.0,
color: UIColor? = StyleManager.shared.theme?.colors.blackDividers,
insets: UIEdgeInsets = .zero) {
let lineView = UIView()
lineView.backgroundColor = color
lineView.isUserInteractionEnabled = false
lineView.translatesAutoresizingMaskIntoConstraints = false
addSubview(lineView)
NSLayoutConstraint.activate([
lineView.heightAnchor.constraint(equalToConstant: thickness),
lineView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: insets.left),
lineView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -insets.right),
lineView.topAnchor.constraint(equalTo: topAnchor, constant: insets.top),
])
}
}

View file

@ -463,6 +463,7 @@
CDCA27842245090900167D87 /* ListenerContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDCA27832245090900167D87 /* ListenerContainer.swift */; };
CDCA278622451F5000167D87 /* RouteInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDCA278522451F5000167D87 /* RouteInfo.swift */; };
CDCA278E2248F34C00167D87 /* MWMRoutingManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA278B2248F34C00167D87 /* MWMRoutingManager.mm */; };
ED1263AB2B6F99F900AD99F3 /* UIView+AddSeparator.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED1263AA2B6F99F900AD99F3 /* UIView+AddSeparator.swift */; };
ED3EAC202B03C88100220A4A /* BottomTabBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3EAC1F2B03C88100220A4A /* BottomTabBarButton.swift */; };
EDBD68072B625724005DD151 /* LocationServicesDisabledAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = EDBD68062B625724005DD151 /* LocationServicesDisabledAlert.xib */; };
EDBD680B2B62572E005DD151 /* LocationServicesDisabledAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDBD680A2B62572E005DD151 /* LocationServicesDisabledAlert.swift */; };
@ -1328,6 +1329,7 @@
CDCA278C2248F34C00167D87 /* MWMRouterResultCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMRouterResultCode.h; sourceTree = "<group>"; };
CDCA278F2248F3B800167D87 /* MWMLocationModeListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMLocationModeListener.h; sourceTree = "<group>"; };
CDE0F3AD225B8D45008BA5C3 /* MWMSpeedCameraManagerMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMSpeedCameraManagerMode.h; sourceTree = "<group>"; };
ED1263AA2B6F99F900AD99F3 /* UIView+AddSeparator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+AddSeparator.swift"; sourceTree = "<group>"; };
ED3EAC1F2B03C88100220A4A /* BottomTabBarButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarButton.swift; sourceTree = "<group>"; };
ED48BBB817C2B1E2003E7E92 /* CircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleView.h; sourceTree = "<group>"; };
ED48BBB917C2B1E2003E7E92 /* CircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleView.m; sourceTree = "<group>"; };
@ -2057,6 +2059,7 @@
1DFA2F6820D3B52F00FB2C66 /* UIColor+PartnerColor.h */,
1DFA2F6920D3B57400FB2C66 /* UIColor+PartnerColor.m */,
3454D7A41E07F045004AF2AD /* UIColor+MapsMeColor.h */,
ED1263AA2B6F99F900AD99F3 /* UIView+AddSeparator.swift */,
3454D7A51E07F045004AF2AD /* UIColor+MapsMeColor.m */,
3488B0181E9D0B230068AFD8 /* UIColor+Modifications.swift */,
3454D7A61E07F045004AF2AD /* UIFont+MapsMeFonts.h */,
@ -4205,6 +4208,7 @@
993DF10E23F6BDB100AC231A /* UIButtonRenderer.swift in Sources */,
99514BBB23E82B450085D3A7 /* ElevationProfileBuilder.swift in Sources */,
34AB66381FC5AA330078E451 /* RouteManagerCell.swift in Sources */,
ED1263AB2B6F99F900AD99F3 /* UIView+AddSeparator.swift in Sources */,
CD4A1F132305872700F2A6B6 /* PromoBookingPresentationController.swift in Sources */,
3472B5D3200F501500DC6CD5 /* BackgroundFetchTaskFrameworkType.swift in Sources */,
47E460AD240D737D00385B45 /* OpeinigHoursLocalization.swift in Sources */,

View file

@ -356,22 +356,3 @@ private extension UIStackView {
addArrangedSubview(view)
}
}
private extension UIView {
func addSeparator(thickness: CGFloat,
color: UIColor?,
insets: UIEdgeInsets) {
let lineView = UIView()
lineView.styleName = "Divider"
lineView.backgroundColor = color ?? .black
lineView.isUserInteractionEnabled = false
lineView.translatesAutoresizingMaskIntoConstraints = false
addSubview(lineView)
NSLayoutConstraint.activate([
lineView.heightAnchor.constraint(equalToConstant: thickness),
lineView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: insets.left),
lineView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -insets.right),
lineView.topAnchor.constraint(equalTo: topAnchor, constant: insets.top),
])
}
}