From e47e99614e95ee92de4d1447fd75b2ef79a8cadd Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Tue, 3 Mar 2026 07:26:18 +0100 Subject: [PATCH 1/7] launching and activating app is already in launchscreentests --- BeeSwiftUITests/BeeSwiftUITests.swift | 39 --------------------------- 1 file changed, 39 deletions(-) delete mode 100644 BeeSwiftUITests/BeeSwiftUITests.swift diff --git a/BeeSwiftUITests/BeeSwiftUITests.swift b/BeeSwiftUITests/BeeSwiftUITests.swift deleted file mode 100644 index adb2d8031..000000000 --- a/BeeSwiftUITests/BeeSwiftUITests.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// BeeSwiftUITests.swift -// BeeSwiftUITests -// -// Created by Andrew Brett on 8/14/20. -// Copyright 2020 APB. All rights reserved. -// - -import XCTest - -class BeeSwiftUITests: XCTestCase { - - override func setUp() { - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() { - // UI tests must launch the application that they test. - let app = XCUIApplication() - app.launch() - - // Use recording to get started writing UI tests. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testLaunchPerformance() { - // This measures how long it takes to launch your application. - measure(metrics: [XCTApplicationLaunchMetric()]) { XCUIApplication().launch() } - } -} From ad90825ae0a647781cfaa09115a1eca6072b74c1 Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Sat, 7 Feb 2026 09:26:51 +0100 Subject: [PATCH 2/7] clean code --- BeeSwift/Cells/GoalCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BeeSwift/Cells/GoalCollectionViewCell.swift b/BeeSwift/Cells/GoalCollectionViewCell.swift index 8546baffa..900d9d9af 100644 --- a/BeeSwift/Cells/GoalCollectionViewCell.swift +++ b/BeeSwift/Cells/GoalCollectionViewCell.swift @@ -1,5 +1,5 @@ // -// GoalTableViewCell.swift +// GoalCollectionViewCell.swift // BeeSwift // // Created by Andy Brett on 4/24/15. From 986d24c5b48c045df5c400b5ac0c8963dd8e9fb6 Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Sat, 7 Feb 2026 10:14:06 +0100 Subject: [PATCH 3/7] color tweaks for varying catchiness --- BeeSwift/Cells/GoalCollectionViewCell.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BeeSwift/Cells/GoalCollectionViewCell.swift b/BeeSwift/Cells/GoalCollectionViewCell.swift index 900d9d9af..e901c4f11 100644 --- a/BeeSwift/Cells/GoalCollectionViewCell.swift +++ b/BeeSwift/Cells/GoalCollectionViewCell.swift @@ -26,7 +26,7 @@ class GoalCollectionViewCell: UICollectionViewCell { self.contentView.backgroundColor = .systemBackground self.slugLabel.font = UIFont.beeminder.defaultFontHeavy - self.slugLabel.textColor = .label + self.goalSlugLabel.textColor = .secondaryLabel self.slugLabel.snp.makeConstraints { (make) -> Void in make.left.equalTo(self.margin) make.top.equalTo(10) @@ -41,7 +41,7 @@ class GoalCollectionViewCell: UICollectionViewCell { make.right.lessThanOrEqualTo(self.todaytaLabel.snp.left).offset(-10) } self.todaytaLabel.font = UIFont.beeminder.defaultFont - self.todaytaLabel.textColor = .label + self.todaytaLabel.textColor = .secondaryLabel self.todaytaLabel.textAlignment = .right self.todaytaLabel.snp.makeConstraints { (make) -> Void in make.centerY.equalTo(self.slugLabel) From d89c0e7f7d8febc62298775b8845d8240196ac9e Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Sat, 7 Feb 2026 09:34:42 +0100 Subject: [PATCH 4/7] intro cardview --- .../Components/UI/CardLookConstants.swift | 15 +++++++ BeeSwift/Components/UI/CardView.swift | 40 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 BeeSwift/Components/UI/CardLookConstants.swift create mode 100644 BeeSwift/Components/UI/CardView.swift diff --git a/BeeSwift/Components/UI/CardLookConstants.swift b/BeeSwift/Components/UI/CardLookConstants.swift new file mode 100644 index 000000000..0dc62b809 --- /dev/null +++ b/BeeSwift/Components/UI/CardLookConstants.swift @@ -0,0 +1,15 @@ +// Part of BeeSwift. Copyright Beeminder + +struct CardLookConstants { + static let cornerRadius: CGFloat = 12 + static let shadowOpacity: Float = 0.08 + static let shadowRadius: CGFloat = 6 + static let shadowOffset = CGSize(width: 0, height: 2) + static let horizontalPadding: CGFloat = 16 + static let verticalPadding: CGFloat = 14 + static let spacing: CGFloat = 12 + static let primaryBackground = UIColor.secondarySystemBackground + static let secondaryBackground = UIColor.tertiarySystemBackground + static let borderColor = UIColor.separator + static let borderWidth: CGFloat = 0.5 +} diff --git a/BeeSwift/Components/UI/CardView.swift b/BeeSwift/Components/UI/CardView.swift new file mode 100644 index 000000000..cb2e50017 --- /dev/null +++ b/BeeSwift/Components/UI/CardView.swift @@ -0,0 +1,40 @@ +// Part of BeeSwift. Copyright Beeminder + +import UIKit + +class CardView: UIView { + enum Style { + case primary + case secondary + case tertiary + } + var style: Style = .primary { didSet { updateStyle() } } + var cornerRadius: CGFloat = CardLookConstants.cornerRadius { didSet { layer.cornerRadius = cornerRadius } } + var shadowOpacity: Float = CardLookConstants.shadowOpacity { didSet { layer.shadowOpacity = shadowOpacity } } + var shadowRadius: CGFloat = CardLookConstants.shadowRadius { didSet { layer.shadowRadius = shadowRadius } } + var shadowOffset: CGSize = CardLookConstants.shadowOffset { didSet { layer.shadowOffset = shadowOffset } } + override init(frame: CGRect) { + super.init(frame: frame) + setupView() + } + required init?(coder: NSCoder) { + super.init(coder: coder) + setupView() + } + private func setupView() { + backgroundColor = CardLookConstants.primaryBackground + layer.cornerRadius = cornerRadius + layer.shadowColor = UIColor.black.cgColor + layer.shadowOpacity = shadowOpacity + layer.shadowRadius = shadowRadius + layer.shadowOffset = shadowOffset + layer.masksToBounds = false + } + private func updateStyle() { + switch style { + case .primary: backgroundColor = CardLookConstants.primaryBackground + case .secondary: backgroundColor = CardLookConstants.secondaryBackground + case .tertiary: backgroundColor = .clear + } + } +} From 6dec41f5a8987bc70588770dfa51005dbece3b0e Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Sat, 7 Feb 2026 10:14:06 +0100 Subject: [PATCH 5/7] Card-based Gallery (cells), included rounded corners --- BeeSwift/Cells/GoalCollectionViewCell.swift | 100 ++++++++++--------- BeeSwift/Components/GoalImageView.swift | 42 ++++---- BeeSwift/Gallery/GalleryViewController.swift | 9 +- 3 files changed, 81 insertions(+), 70 deletions(-) diff --git a/BeeSwift/Cells/GoalCollectionViewCell.swift b/BeeSwift/Cells/GoalCollectionViewCell.swift index e901c4f11..842f5e7d3 100644 --- a/BeeSwift/Cells/GoalCollectionViewCell.swift +++ b/BeeSwift/Cells/GoalCollectionViewCell.swift @@ -10,65 +10,71 @@ import BeeKit import Foundation class GoalCollectionViewCell: UICollectionViewCell { - let slugLabel: BSLabel = BSLabel() - let titleLabel: BSLabel = BSLabel() - let todaytaLabel: BSLabel = BSLabel() - let thumbnailImageView = GoalImageView(isThumbnail: true) - let safesumLabel: BSLabel = BSLabel() - let margin = 8 + private let cardView = CardView() + private let thumbnailImageView = GoalImageView(isThumbnail: true) + private let titleLabel = BSLabel() + private let slugLabel = BSLabel() + private let countdownLabel = BSLabel() + private let todaytaLabel = BSLabel() override init(frame: CGRect) { super.init(frame: frame) - self.contentView.addSubview(self.slugLabel) - self.contentView.addSubview(self.titleLabel) - self.contentView.addSubview(self.todaytaLabel) - self.contentView.addSubview(self.thumbnailImageView) - self.contentView.addSubview(self.safesumLabel) - self.contentView.backgroundColor = .systemBackground + setupView() + } + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setupView() + } + private func setupView() { + self.contentView.backgroundColor = .clear + self.contentView.addSubview(self.cardView) + self.cardView.backgroundColor = .secondarySystemGroupedBackground + self.cardView.layer.cornerRadius = CardLookConstants.cornerRadius + self.cardView.layer.shadowColor = UIColor.black.cgColor + self.cardView.layer.shadowOpacity = 0.1 + self.cardView.layer.shadowRadius = 4 + self.cardView.layer.shadowOffset = CardLookConstants.shadowOffset - self.slugLabel.font = UIFont.beeminder.defaultFontHeavy - self.goalSlugLabel.textColor = .secondaryLabel - self.slugLabel.snp.makeConstraints { (make) -> Void in - make.left.equalTo(self.margin) - make.top.equalTo(10) - make.width.lessThanOrEqualTo(self.contentView).multipliedBy(0.35) + self.slugLabel.textColor = .label + self.cardView.snp.makeConstraints { make in make.edges.equalToSuperview().inset(6) } + [self.thumbnailImageView, self.titleLabel, self.todaytaLabel, self.slugLabel, self.countdownLabel].forEach { + self.cardView.addSubview($0) + } + self.thumbnailImageView.snp.makeConstraints { make in + make.left.top.bottom.equalToSuperview().inset(CardLookConstants.spacing) + make.width.equalTo(CGFloat(Constants.thumbnailWidth)) + make.height.equalTo(CGFloat(Constants.thumbnailHeight)) } - self.titleLabel.font = UIFont.beeminder.defaultFont + self.titleLabel.font = UIFont.beeminder.defaultFontHeavy.withSize(17) self.titleLabel.textColor = .label - self.titleLabel.textAlignment = .left - self.titleLabel.snp.makeConstraints { (make) -> Void in - make.centerY.equalTo(self.slugLabel) - make.left.equalTo(self.slugLabel.snp.right).offset(10) - make.right.lessThanOrEqualTo(self.todaytaLabel.snp.left).offset(-10) + self.titleLabel.snp.makeConstraints { make in + make.top.equalToSuperview().offset(CardLookConstants.verticalPadding) + make.left.equalTo(self.thumbnailImageView.snp.right).offset(CardLookConstants.spacing) + make.right.equalTo(self.todaytaLabel.snp.left).offset(-8) } - self.todaytaLabel.font = UIFont.beeminder.defaultFont - self.todaytaLabel.textColor = .secondaryLabel + self.todaytaLabel.textColor = .label + self.todaytaLabel.font = UIFont.beeminder.defaultFont.withSize(14) self.todaytaLabel.textAlignment = .right - self.todaytaLabel.snp.makeConstraints { (make) -> Void in - make.centerY.equalTo(self.slugLabel) - make.right.equalTo(-self.margin) + self.todaytaLabel.snp.makeConstraints { make in + make.centerY.equalTo(self.titleLabel) + make.right.equalToSuperview().offset(-CardLookConstants.horizontalPadding) } self.todaytaLabel.setContentCompressionResistancePriority(.required, for: .horizontal) - - self.thumbnailImageView.snp.makeConstraints { (make) -> Void in - make.left.equalTo(0).offset(self.margin) - make.top.equalTo(self.slugLabel.snp.bottom).offset(5) - make.height.equalTo(Constants.thumbnailHeight) - make.width.equalTo(Constants.thumbnailWidth) + self.slugLabel.font = UIFont.beeminder.defaultFont.withSize(15) + self.slugLabel.snp.makeConstraints { make in + make.top.equalTo(self.titleLabel.snp.bottom).offset(2) + make.left.right.equalTo(self.titleLabel) } - - self.safesumLabel.textAlignment = NSTextAlignment.center - self.safesumLabel.font = UIFont.beeminder.defaultBoldFont.withSize(13) - self.safesumLabel.numberOfLines = 0 - self.safesumLabel.snp.makeConstraints { (make) -> Void in - make.left.equalTo(self.thumbnailImageView.snp.right).offset(5) - make.centerY.equalTo(self.thumbnailImageView.snp.centerY) - make.right.equalTo(-self.margin) + self.countdownLabel.font = UIFont.beeminder.defaultBoldFont.withSize(13) + self.countdownLabel.numberOfLines = 0 + self.countdownLabel.snp.makeConstraints { make in + make.top.equalTo(self.slugLabel.snp.bottom).offset(4) + make.left.right.equalTo(self.titleLabel) + make.bottom.lessThanOrEqualToSuperview().offset(-CardLookConstants.verticalPadding) } } - required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override func prepareForReuse() { super.prepareForReuse() - configure(with: nil) + self.configure(with: nil) } func configure(with goal: Goal?) { self.thumbnailImageView.goal = goal @@ -76,7 +82,7 @@ class GoalCollectionViewCell: UICollectionViewCell { self.slugLabel.text = goal?.slug self.titleLabel.isHidden = goal?.title == goal?.slug self.todaytaLabel.text = goal?.todayta == true ? "✓" : "" - self.safesumLabel.text = goal?.capitalSafesum() - self.safesumLabel.textColor = goal?.countdownColor ?? UIColor.Beeminder.gray + self.countdownLabel.text = goal?.capitalSafesum() + self.countdownLabel.textColor = goal?.countdownColor ?? UIColor.Beeminder.SafetyBuffer.gray } } diff --git a/BeeSwift/Components/GoalImageView.swift b/BeeSwift/Components/GoalImageView.swift index c099b0c5c..6a20aecad 100644 --- a/BeeSwift/Components/GoalImageView.swift +++ b/BeeSwift/Components/GoalImageView.swift @@ -41,11 +41,16 @@ class GoalImageView: UIView { private func setupView() { self.addSubview(imageView) - imageView.snp.makeConstraints { (make) in make.edges.equalToSuperview() } + + self.layer.cornerRadius = CardLookConstants.cornerRadius + self.layer.borderWidth = 0 + self.clipsToBounds = true + imageView.snp.makeConstraints { $0.edges.equalToSuperview() } + self.imageView.image = UIImage(named: "GraphPlaceholder") self.addSubview(beeLemniscateView) - beeLemniscateView.snp.makeConstraints { (make) in make.edges.equalToSuperview() } + beeLemniscateView.snp.makeConstraints { $0.edges.equalToSuperview() } beeLemniscateView.isHidden = true NotificationCenter.default.addObserver( @@ -59,17 +64,7 @@ class GoalImageView: UIView { imageView.image = UIImage(named: "GraphPlaceholder") currentlyShowingGraph = false beeLemniscateView.isHidden = true - updateBorder() - } - - @MainActor private func updateBorder() { - if isThumbnail { - imageView.layer.borderColor = goal?.countdownColor.cgColor - imageView.layer.borderWidth = goal == nil ? 0 : 1 - } else { - imageView.layer.borderColor = nil - imageView.layer.borderWidth = 0 - } + layer.borderWidth = 0 } @MainActor private func showGraphImage(image: UIImage) { @@ -83,11 +78,20 @@ class GoalImageView: UIView { duration: duration, options: .transitionCrossDissolve, animations: { [weak self] in - self?.imageView.image = image - self?.beeLemniscateView.isHidden = self?.goal == nil || self?.goal?.queued == false - self?.updateBorder() + guard let self else { return } + self.imageView.image = image + self.beeLemniscateView.isHidden = self.goal == nil || self.goal?.queued == false + self.imageView.contentMode = self.isThumbnail == true ? .scaleAspectFill : .scaleAspectFit + }, + completion: { [weak self] _ in + guard let self else { return } + if self.isThumbnail { + self.layer.borderColor = self.goal?.countdownColor.cgColor + self.layer.borderWidth = self.goal == nil ? 0 : 2 + } + self.currentlyShowingGraph = true } - ) { [weak self] _ in self?.currentlyShowingGraph = true } + ) } @MainActor private func refresh() { @@ -107,8 +111,8 @@ class GoalImageView: UIView { return } - // - Deadbeat: Placeholder, no animation - if goal.owner.deadbeat { + // Deadbeat: Placeholder, no animation + guard !goal.owner.deadbeat else { clearGoalGraph() return } diff --git a/BeeSwift/Gallery/GalleryViewController.swift b/BeeSwift/Gallery/GalleryViewController.swift index c76406a6d..5a0789d19 100644 --- a/BeeSwift/Gallery/GalleryViewController.swift +++ b/BeeSwift/Gallery/GalleryViewController.swift @@ -41,8 +41,8 @@ class GalleryViewController: UIViewController { }() private lazy var collectionContainer = UIView() private lazy var collectionView: UICollectionView = { - let collectionView = UICollectionView(frame: stackView.frame, collectionViewLayout: self.collectionViewLayout) - collectionView.backgroundColor = .systemBackground + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: self.collectionViewLayout) + collectionView.backgroundColor = .systemGray6 collectionView.alwaysBounceVertical = true collectionView.register( UICollectionReusableView.self, @@ -144,7 +144,8 @@ class GalleryViewController: UIViewController { object: nil, ) self.view.addSubview(self.stackView) - stackView.snp.makeConstraints { (make) -> Void in make.edges.equalToSuperview() } + self.stackView.snp.makeConstraints { (make) -> Void in make.edges.equalToSuperview() } + NotificationCenter.default.addObserver( self, selector: #selector(self.keyboardWillShow), @@ -489,7 +490,7 @@ extension GalleryViewController: UICollectionViewDelegateFlowLayout { let minimumWidth: CGFloat = 320 let itemSpacing = self.collectionViewLayout.minimumInteritemSpacing let availableWidth = - collectionView.frame.width - collectionView.contentInset.left - collectionView.contentInset.right + collectionView.bounds.width - collectionView.contentInset.left - collectionView.contentInset.right // Calculate how many cells could fit at the minimum width, rounding down (as we can't show a fractional cell) // We need to account for there being margin between cells, so there is 1 fewer margin than cell. We do this by // imagining there is some non-showed spacing after the final cell. For example with wo cells: From 0b320019cc037235aaa35ee34b08f4581197145d Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Sat, 7 Feb 2026 10:16:14 +0100 Subject: [PATCH 6/7] clean code the independent parts of the views can be configured in their inline configuration closures whereas setUpView is kept minimal, addressing how the views relate to one another --- BeeSwift/Cells/GoalCollectionViewCell.swift | 77 +++++++++++++++------ 1 file changed, 54 insertions(+), 23 deletions(-) diff --git a/BeeSwift/Cells/GoalCollectionViewCell.swift b/BeeSwift/Cells/GoalCollectionViewCell.swift index 842f5e7d3..e7e1ab481 100644 --- a/BeeSwift/Cells/GoalCollectionViewCell.swift +++ b/BeeSwift/Cells/GoalCollectionViewCell.swift @@ -10,72 +10,103 @@ import BeeKit import Foundation class GoalCollectionViewCell: UICollectionViewCell { - private let cardView = CardView() - private let thumbnailImageView = GoalImageView(isThumbnail: true) - private let titleLabel = BSLabel() - private let slugLabel = BSLabel() - private let countdownLabel = BSLabel() - private let todaytaLabel = BSLabel() + private lazy var cardView: CardView = { + let view = CardView() + view.backgroundColor = .secondarySystemGroupedBackground + view.layer.cornerRadius = CardLookConstants.cornerRadius + view.layer.shadowColor = UIColor.black.cgColor + view.layer.shadowOpacity = 0.1 + view.layer.shadowRadius = 4 + view.layer.shadowOffset = CardLookConstants.shadowOffset + return view + }() + + private lazy var thumbnailImageView: GoalImageView = { return GoalImageView(isThumbnail: true) }() + + private lazy var titleLabel: BSLabel = { + let label = BSLabel() + label.font = UIFont.beeminder.defaultFontHeavy.withSize(17) + label.textColor = .label + return label + }() + + private lazy var slugLabel: BSLabel = { + let label = BSLabel() + label.font = UIFont.beeminder.defaultFont.withSize(15) + label.textColor = .label + return label + }() + + private lazy var countdownLabel: BSLabel = { + let label = BSLabel() + label.font = UIFont.beeminder.defaultBoldFont.withSize(13) + label.numberOfLines = 0 + return label + }() + + private lazy var todaytaLabel: BSLabel = { + let label = BSLabel() + label.textColor = .label + label.font = UIFont.beeminder.defaultFont.withSize(14) + label.textAlignment = .right + label.setContentCompressionResistancePriority(.required, for: .horizontal) + return label + }() + override init(frame: CGRect) { super.init(frame: frame) setupView() } + required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) setupView() } + private func setupView() { self.contentView.backgroundColor = .clear self.contentView.addSubview(self.cardView) - self.cardView.backgroundColor = .secondarySystemGroupedBackground - self.cardView.layer.cornerRadius = CardLookConstants.cornerRadius - self.cardView.layer.shadowColor = UIColor.black.cgColor - self.cardView.layer.shadowOpacity = 0.1 - self.cardView.layer.shadowRadius = 4 - self.cardView.layer.shadowOffset = CardLookConstants.shadowOffset - - self.slugLabel.textColor = .label + self.cardView.snp.makeConstraints { make in make.edges.equalToSuperview().inset(6) } + [self.thumbnailImageView, self.titleLabel, self.todaytaLabel, self.slugLabel, self.countdownLabel].forEach { self.cardView.addSubview($0) } + self.thumbnailImageView.snp.makeConstraints { make in make.left.top.bottom.equalToSuperview().inset(CardLookConstants.spacing) make.width.equalTo(CGFloat(Constants.thumbnailWidth)) make.height.equalTo(CGFloat(Constants.thumbnailHeight)) } - self.titleLabel.font = UIFont.beeminder.defaultFontHeavy.withSize(17) - self.titleLabel.textColor = .label + self.titleLabel.snp.makeConstraints { make in make.top.equalToSuperview().offset(CardLookConstants.verticalPadding) make.left.equalTo(self.thumbnailImageView.snp.right).offset(CardLookConstants.spacing) make.right.equalTo(self.todaytaLabel.snp.left).offset(-8) } - self.todaytaLabel.textColor = .label - self.todaytaLabel.font = UIFont.beeminder.defaultFont.withSize(14) - self.todaytaLabel.textAlignment = .right + self.todaytaLabel.snp.makeConstraints { make in make.centerY.equalTo(self.titleLabel) make.right.equalToSuperview().offset(-CardLookConstants.horizontalPadding) } - self.todaytaLabel.setContentCompressionResistancePriority(.required, for: .horizontal) - self.slugLabel.font = UIFont.beeminder.defaultFont.withSize(15) + self.slugLabel.snp.makeConstraints { make in make.top.equalTo(self.titleLabel.snp.bottom).offset(2) make.left.right.equalTo(self.titleLabel) } - self.countdownLabel.font = UIFont.beeminder.defaultBoldFont.withSize(13) - self.countdownLabel.numberOfLines = 0 + self.countdownLabel.snp.makeConstraints { make in make.top.equalTo(self.slugLabel.snp.bottom).offset(4) make.left.right.equalTo(self.titleLabel) make.bottom.lessThanOrEqualToSuperview().offset(-CardLookConstants.verticalPadding) } } + override func prepareForReuse() { super.prepareForReuse() self.configure(with: nil) } + func configure(with goal: Goal?) { self.thumbnailImageView.goal = goal self.titleLabel.text = goal?.title From 90c8069bc9d4244d72c3dd33b6f726ae7302eb74 Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Sat, 7 Feb 2026 10:17:08 +0100 Subject: [PATCH 7/7] clean code typo --- BeeSwift/Cells/GoalCollectionViewCell.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BeeSwift/Cells/GoalCollectionViewCell.swift b/BeeSwift/Cells/GoalCollectionViewCell.swift index e7e1ab481..3507a1a99 100644 --- a/BeeSwift/Cells/GoalCollectionViewCell.swift +++ b/BeeSwift/Cells/GoalCollectionViewCell.swift @@ -55,15 +55,15 @@ class GoalCollectionViewCell: UICollectionViewCell { override init(frame: CGRect) { super.init(frame: frame) - setupView() + setUpView() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) - setupView() + setUpView() } - private func setupView() { + private func setUpView() { self.contentView.backgroundColor = .clear self.contentView.addSubview(self.cardView)