Removed the unused ReviewCell table cell from the Feed framework.

This commit is contained in:
Javier Cicchelli 2024-03-19 02:00:30 +01:00
parent a4fa2210e1
commit 36ea9659c6
3 changed files with 1 additions and 78 deletions

View File

@ -16,14 +16,7 @@ struct Review {
let id: Int
let rating: Rating
let title: String
func ratingVersionText() -> String {
var stars = ""
for _ in 0..<rating.stars {
stars += "⭐️"
}
return "\(stars) (ver: \(rating.appVersion))"
}
}
// MARK: - Structs

View File

@ -1,66 +0,0 @@
//
// AppDelegate.swift
// ReviewsFeed
//
// Created by Dmitrii Ivanov on 21/07/2020.
// Copyright © 2020 ING. All rights reserved.
//
import UIKit
class ReviewCell: UITableViewCell {
private var titleLabel = UILabel()
private var authorLabel = UILabel()
private var textPreviewLabel = UILabel()
private var ratingVersionLabel = UILabel()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupLabels()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func update(item: Review) {
ratingVersionLabel.text = item.ratingVersionText()
authorLabel.text = "from: \(item.author)"
titleLabel.text = "\(item.title)"
textPreviewLabel.text = "\(item.comment)"
}
private func setupLabels() {
titleLabel.translatesAutoresizingMaskIntoConstraints = false
authorLabel.translatesAutoresizingMaskIntoConstraints = false
textPreviewLabel.translatesAutoresizingMaskIntoConstraints = false
ratingVersionLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.font = UIFont.boldSystemFont(ofSize: 18)
titleLabel.numberOfLines = 2
ratingVersionLabel.font = UIFont.italicSystemFont(ofSize: 18)
authorLabel.font = UIFont.italicSystemFont(ofSize: 18)
textPreviewLabel.font = UIFont.systemFont(ofSize: 14)
textPreviewLabel.numberOfLines = 3
let stack = UIStackView()
stack.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(stack)
stack.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 8).isActive = true
stack.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -8).isActive = true
stack.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 8).isActive = true
stack.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -8).isActive = true
stack.axis = .vertical
stack.distribution = .equalSpacing
stack.alignment = .leading
stack.addArrangedSubview(ratingVersionLabel)
stack.addArrangedSubview(authorLabel)
stack.addArrangedSubview(titleLabel)
stack.addArrangedSubview(textPreviewLabel)
}
}

View File

@ -13,7 +13,6 @@
02DC7FA22BA51793000EEEBE /* ReviewsFeed.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */; };
02DC7FA32BA51793000EEEBE /* ReviewsFeed.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
02DC7FAC2BA51B4C000EEEBE /* DetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */; };
02DC7FAD2BA51B4C000EEEBE /* ReviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13024C6EE64004E2EE1 /* ReviewCell.swift */; };
02DC7FAE2BA51B4C000EEEBE /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */; };
02DC7FAF2BA51B4C000EEEBE /* Review.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13124C6EE64004E2EE1 /* Review.swift */; };
02DC7FB32BA52518000EEEBE /* ReviewsKit in Frameworks */ = {isa = PBXBuildFile; productRef = 02DC7FB22BA52518000EEEBE /* ReviewsKit */; };
@ -59,7 +58,6 @@
345AD12724C6EDDC004E2EE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
345AD12924C6EDDC004E2EE1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = "<group>"; };
345AD13024C6EE64004E2EE1 /* ReviewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReviewCell.swift; sourceTree = "<group>"; };
345AD13124C6EE64004E2EE1 /* Review.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Review.swift; sourceTree = "<group>"; };
345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailsViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -123,7 +121,6 @@
02620B892BA89C2400DE7137 /* Components */ = {
isa = PBXGroup;
children = (
345AD13024C6EE64004E2EE1 /* ReviewCell.swift */,
0220ADA22BA90646001E6A9F /* FeedItem.swift */,
);
path = Components;
@ -373,7 +370,6 @@
0220ADA32BA90646001E6A9F /* FeedItem.swift in Sources */,
02DC7FAF2BA51B4C000EEEBE /* Review.swift in Sources */,
02DC7FAE2BA51B4C000EEEBE /* FeedViewController.swift in Sources */,
02DC7FAD2BA51B4C000EEEBE /* ReviewCell.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};