-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ShowProgress storyboard and ShowProgressCell xib.
There is no more storyboards/xib on the project
- Loading branch information
1 parent
50d5dae
commit 86306c1
Showing
22 changed files
with
564 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
open class TableViewCell: UITableViewCell { | ||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
setup() | ||
} | ||
|
||
public required init?(coder aDecoder: NSCoder) { | ||
super.init(coder: aDecoder) | ||
setup() | ||
} | ||
|
||
private func setup() { | ||
initialize() | ||
installConstraints() | ||
} | ||
|
||
open func initialize() {} | ||
|
||
open func installConstraints() {} | ||
} |
37 changes: 0 additions & 37 deletions
37
CouchTrackerApp/Shows/Progress/Cell/ShowProgressCell.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import Cartography | ||
import CouchTrackerCore | ||
|
||
final class ShowProgressCell: TableViewCell, ShowProgressCellView { | ||
static let identifier = "ShowProgressCell" | ||
// Remove | ||
var presenter: ShowProgressCellPresenter! { | ||
didSet { | ||
posterImageView.image = nil | ||
presenter.viewWillAppear() | ||
} | ||
} | ||
|
||
func show(viewModel: WatchedShowViewModel) { | ||
showTitleLabel.text = viewModel.title | ||
episodeTitleLabel.text = viewModel.nextEpisode | ||
statusAndDateLabel.text = viewModel.nextEpisodeDate | ||
remainingAndNetworkLabel.text = viewModel.status | ||
} | ||
|
||
func showPosterImage(with url: URL) { | ||
posterImageView.kf.setImage(with: url) | ||
} | ||
|
||
// Remove | ||
|
||
let posterImageView = UIImageView() | ||
|
||
let showTitleLabel: UILabel = { | ||
let label = UILabel() | ||
label.textColor = Colors.Text.primaryTextColor | ||
label.font = UIFont.systemFont(ofSize: UIFont.systemFontSize) | ||
return label | ||
}() | ||
|
||
let episodeTitleLabel: UILabel = { | ||
let label = UILabel() | ||
label.textColor = Colors.Text.primaryTextColor | ||
label.font = UIFont.systemFont(ofSize: UIFont.systemFontSize) | ||
return label | ||
}() | ||
|
||
let remainingAndNetworkLabel: UILabel = { | ||
let label = UILabel() | ||
label.textColor = Colors.Text.secondaryTextColor | ||
label.font = UIFont.systemFont(ofSize: UIFont.smallSystemFontSize) | ||
return label | ||
}() | ||
|
||
let statusAndDateLabel: UILabel = { | ||
let label = UILabel() | ||
label.textColor = Colors.Text.secondaryTextColor | ||
label.font = UIFont.systemFont(ofSize: UIFont.smallSystemFontSize) | ||
return label | ||
}() | ||
|
||
private lazy var labelsStackView: UIStackView = { | ||
let subviews = [remainingAndNetworkLabel, showTitleLabel, episodeTitleLabel, statusAndDateLabel] | ||
let stack = UIStackView(arrangedSubviews: subviews) | ||
stack.axis = .vertical | ||
stack.distribution = .fillProportionally | ||
return stack | ||
}() | ||
|
||
override func initialize() { | ||
addSubview(labelsStackView) | ||
addSubview(posterImageView) | ||
backgroundColor = Colors.Cell.backgroundColor | ||
} | ||
|
||
override func installConstraints() { | ||
constrain(labelsStackView, posterImageView) { stack, poster in | ||
let margin: CGFloat = 5 | ||
|
||
poster.height == poster.superview!.height - (margin * 2) | ||
poster.width == poster.height * 0.75 | ||
poster.left == poster.superview!.left + margin | ||
poster.top == poster.superview!.top + margin | ||
poster.bottom == poster.superview!.bottom - margin | ||
|
||
stack.left == poster.right + margin | ||
stack.top == poster.top | ||
stack.bottom == poster.bottom | ||
stack.right == stack.superview!.right | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.