From 476ec50be33004db5dfa3ae382d0e1771bc22876 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Wed, 21 Aug 2024 13:15:46 +0530 Subject: [PATCH 1/3] Fix for CXTDT-586497, Using the icon instead of UIImage while feeding data to Table component. --- VDSSample/ViewControllers/TableViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/VDSSample/ViewControllers/TableViewController.swift b/VDSSample/ViewControllers/TableViewController.swift index 72cf505..f645f00 100644 --- a/VDSSample/ViewControllers/TableViewController.swift +++ b/VDSSample/ViewControllers/TableViewController.swift @@ -202,11 +202,12 @@ class TableViewController: BaseViewController { trailingToolTip.labelText = "5G Ultra Wideband is available in your area" trailingToolTip.tooltipModel = .init(title: "Check the formatting of your address", content:"House/Building number then street name") - let image = UIImage(named: "clean-surface") - let imageView = UIImageView(image: image) + + let iconView = Icon() + iconView.name = .cleanSurface rows.append(TableRowModel(columns: [TableItemModel(bottomLine: .secondary, component:textArea), - TableItemModel(bottomLine: .secondary, component:imageView), + TableItemModel(bottomLine: .secondary, component:iconView), TableItemModel(bottomLine: .secondary, component:trailingToolTip)])) } From d72cd1e2daba108d89272e83b8b63954d1a75d02 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 27 Aug 2024 13:32:10 -0500 Subject: [PATCH 2/3] updated carousel Signed-off-by: Matt Bruce --- VDSSample/Classes/Helper.swift | 16 ++++++++----- .../CarouselViewController.swift | 23 ++++++++++++------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/VDSSample/Classes/Helper.swift b/VDSSample/Classes/Helper.swift index 7fefee7..d81b275 100644 --- a/VDSSample/Classes/Helper.swift +++ b/VDSSample/Classes/Helper.swift @@ -10,15 +10,15 @@ import VDS import UIKit extension UIView { - public func makeWrapper(edgeSpacing: CGFloat = 0.0, isTrailing: Bool = true) -> View { - UIView.makeWrapper(for: self, edgeSpacing: edgeSpacing, isTrailing: isTrailing) + public func makeWrapper(edgeSpacing: CGFloat = 0.0, isTrailing: Bool = true, isBottom: Bool = false) -> View { + UIView.makeWrapper(for: self, edgeSpacing: edgeSpacing, isTrailing: isTrailing, isBottom: isBottom) } - public static func makeWrapper(for view: UIView, edgeSpacing: CGFloat = 0.0, isTrailing: Bool = true) -> View { - makeWrapperWithConstraints(for: view, edgeSpacing: edgeSpacing, isTrailing: isTrailing).view + public static func makeWrapper(for view: UIView, edgeSpacing: CGFloat = 0.0, isTrailing: Bool = true, isBottom: Bool = false) -> View { + makeWrapperWithConstraints(for: view, edgeSpacing: edgeSpacing, isTrailing: isTrailing, isBottom: isBottom).view } - public static func makeWrapperWithConstraints(for view: UIView, edgeSpacing: CGFloat = 0.0, isTrailing: Bool = true) -> (view: View, container: NSLayoutConstraint.Container) { + public static func makeWrapperWithConstraints(for view: UIView, edgeSpacing: CGFloat = 0.0, isTrailing: Bool = true, isBottom: Bool = false) -> (view: View, container: NSLayoutConstraint.Container) { let container = NSLayoutConstraint.Container() let wrapper = View().with { $0.translatesAutoresizingMaskIntoConstraints = false @@ -26,7 +26,11 @@ extension UIView { wrapper.addSubview(view) container.topConstraint = view.pinTop(anchor: wrapper.topAnchor, constant: edgeSpacing) - container.bottomConstraint = view.pinBottom(anchor: wrapper.bottomAnchor, constant: edgeSpacing) + if isBottom { + container.bottomConstraint = view.pinBottomLessThanOrEqualTo(anchor: wrapper.bottomAnchor, constant: edgeSpacing) + } else { + container.bottomConstraint = view.pinBottom(anchor: wrapper.bottomAnchor, constant: edgeSpacing) + } container.leadingConstraint = view.pinLeading(anchor: wrapper.leadingAnchor, constant: edgeSpacing) if isTrailing { container.trailingConstraint = view.pinTrailingLessThanOrEqualTo(anchor: wrapper.trailingAnchor, constant: edgeSpacing) diff --git a/VDSSample/ViewControllers/CarouselViewController.swift b/VDSSample/ViewControllers/CarouselViewController.swift index d5c4bb8..969c594 100644 --- a/VDSSample/ViewControllers/CarouselViewController.swift +++ b/VDSSample/ViewControllers/CarouselViewController.swift @@ -132,18 +132,13 @@ class CarouselViewController: BaseViewController { rows.append(Button().with{ $0.use = .secondary; $0.text = "Shop"; $0.onClick = onClick}) rows.append(Button().with{ $0.use = .secondary; $0.text = "Buy"; $0.onClick = onClick}) rows.append(Button().with{ $0.use = .secondary; $0.text = "Offer"; $0.onClick = onClick}) - component.views = rows.compactMap({ view in - return TileContainer().with { instance in - instance.aspectRatio = .none - instance.addContentView(view) - instance.color = .custom(.lightGray) - } - }) + label.text = "0" - component.slotAlignment = .init(vertical: Carousel.Vertical.top, horizontal: Carousel.Horizontal.left) horizAlignmtPickerSelectorView.text = Carousel.Horizontal.left.rawValue vertAlignmtPickerSelectorView.text = Carousel.Vertical.top.rawValue + + updateCarousel() // Callback when moving the carousel. Returns selectedGroupIndex. component.onChange = { [weak self] selectedGroupIndex in @@ -152,6 +147,16 @@ class CarouselViewController: BaseViewController { } } + func updateCarousel() { + component.views = rows.compactMap({ view in + return TileContainer().with { instance in + instance.aspectRatio = .none + instance.addContentView(view) + instance.color = .custom(.lightGray) + } + }) + } + func setupPicker() { surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in self?.component.surface = item @@ -184,6 +189,7 @@ class CarouselViewController: BaseViewController { gutterPickerSelectorView.onPickerDidSelect = { [weak self] item in self?.component.gutter = item + self?.updateCarousel() } layoutPickerSelectorView.onPickerDidSelect = { [weak self] item in @@ -194,6 +200,7 @@ class CarouselViewController: BaseViewController { } self?.component.layout = item self?.label.text = "0" + self?.updateCarousel() } paginationKindPickerSelectorView.onPickerDidSelect = { [weak self] item in From fcf89c19ec128d57660808b65c1631a41c0cd440 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 27 Aug 2024 15:20:13 -0500 Subject: [PATCH 3/3] updated version Signed-off-by: Matt Bruce --- VDSSample.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDSSample.xcodeproj/project.pbxproj b/VDSSample.xcodeproj/project.pbxproj index 9ad4b88..64ec822 100644 --- a/VDSSample.xcodeproj/project.pbxproj +++ b/VDSSample.xcodeproj/project.pbxproj @@ -725,7 +725,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 72; + CURRENT_PROJECT_VERSION = 73; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = FCMA4QKS77; GENERATE_INFOPLIST_FILE = YES; @@ -761,7 +761,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 72; + CURRENT_PROJECT_VERSION = 73; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = FCMA4QKS77; GENERATE_INFOPLIST_FILE = YES;