Skip to content

Commit 23b1b87

Browse files
committed
created view desing
1 parent 5d62ff9 commit 23b1b87

6 files changed

Lines changed: 453 additions & 42 deletions

File tree

ICTMDBDetailModule/DetailController.swift

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
//
2+
// CastCell.swift
3+
// ICTMDBDetailModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
import UIKit
9+
import SnapKit
10+
import ICTMDBViewKit
11+
12+
final class CastCell: UICollectionViewCell {
13+
static let identifier = "CastCellIdentifier"
14+
private let containerView = UIView()
15+
private let castImageView = UIImageView()
16+
private let nameLabel = UILabel()
17+
private let characterLabel = UILabel()
18+
19+
override init(frame: CGRect) {
20+
super.init(frame: frame)
21+
setupViews()
22+
setupConstraints()
23+
}
24+
25+
required init?(coder: NSCoder) {
26+
fatalError("init(coder:) has not been implemented")
27+
}
28+
29+
private func setupViews() {
30+
contentView.addSubview(containerView)
31+
containerView.addSubview(castImageView)
32+
containerView.addSubview(nameLabel)
33+
containerView.addSubview(characterLabel)
34+
35+
36+
contentView.backgroundColor = .blue
37+
layer.shadowColor = UIColor.black.cgColor
38+
layer.shadowOpacity = 0.15
39+
layer.shadowOffset = CGSize(width: 0, height: 4)
40+
layer.shadowRadius = 6
41+
layer.masksToBounds = false
42+
43+
44+
containerView.backgroundColor = .white
45+
containerView.layer.cornerRadius = 10
46+
containerView.layer.masksToBounds = true
47+
containerView.layer.borderWidth = 1
48+
containerView.layer.borderColor = UIColor.lightGray.cgColor
49+
50+
51+
castImageView.contentMode = .scaleAspectFill
52+
castImageView.clipsToBounds = true
53+
castImageView.layer.cornerRadius = 8
54+
55+
56+
nameLabel.font = .systemFont(ofSize: 14, weight: .semibold)
57+
nameLabel.textAlignment = .center
58+
nameLabel.numberOfLines = 1
59+
60+
characterLabel.font = .systemFont(ofSize: 13, weight: .regular)
61+
characterLabel.textColor = .darkGray
62+
characterLabel.textAlignment = .center
63+
characterLabel.numberOfLines = 1
64+
65+
66+
}
67+
68+
private func setupConstraints() {
69+
containerView.snp.makeConstraints { make in
70+
make.edges.equalToSuperview().inset(6)
71+
}
72+
73+
castImageView.snp.makeConstraints { make in
74+
make.top.equalToSuperview().offset(8)
75+
make.centerX.equalToSuperview()
76+
make.width.height.equalTo(100)
77+
}
78+
79+
nameLabel.snp.makeConstraints { make in
80+
make.top.equalTo(castImageView.snp.bottom).offset(6)
81+
make.left.right.equalToSuperview().inset(8)
82+
}
83+
84+
characterLabel.snp.makeConstraints { make in
85+
make.top.equalTo(nameLabel.snp.bottom).offset(4)
86+
make.left.right.equalToSuperview().inset(8)
87+
make.bottom.lessThanOrEqualToSuperview().inset(8)
88+
}
89+
}
90+
91+
func configure() {
92+
93+
}
94+
95+
96+
}
97+
98+
#Preview {
99+
CastCell()
100+
}
101+
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
//
2+
// SeasonCell.swift
3+
// ICTMDBDetailModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
import UIKit
9+
import SnapKit
10+
import ICTMDBViewKit
11+
12+
final class SeasonCell: UICollectionViewCell {
13+
static let identifier = "SeasonCellIdentifier"
14+
let containerView = UIView()
15+
let posterImageView = UIImageView()
16+
let seasonLabel = UILabel()
17+
let airDateLabel = UILabel()
18+
let episodeCountLabel = UILabel()
19+
let ratingLabel = UILabel()
20+
21+
override init(frame: CGRect) {
22+
super.init(frame: frame)
23+
setupViews()
24+
setupConstraints()
25+
}
26+
27+
required init?(coder: NSCoder) {
28+
fatalError("init(coder:) has not been implemented")
29+
}
30+
31+
private func setupViews() {
32+
contentView.addSubview(containerView)
33+
containerView.addSubview(posterImageView)
34+
containerView.addSubview(seasonLabel)
35+
containerView.addSubview(airDateLabel)
36+
containerView.addSubview(episodeCountLabel)
37+
containerView.addSubview(ratingLabel)
38+
39+
40+
contentView.backgroundColor = .red
41+
layer.shadowColor = UIColor.black.cgColor
42+
layer.shadowOpacity = 0.15
43+
layer.shadowOffset = CGSize(width: 0, height: 4)
44+
layer.shadowRadius = 6
45+
layer.masksToBounds = false
46+
47+
48+
containerView.backgroundColor = .white
49+
containerView.layer.cornerRadius = 10
50+
containerView.layer.masksToBounds = true
51+
52+
53+
posterImageView.contentMode = .scaleAspectFill
54+
posterImageView.layer.cornerRadius = 8
55+
posterImageView.clipsToBounds = true
56+
57+
seasonLabel.font = .boldSystemFont(ofSize: 16)
58+
airDateLabel.font = .systemFont(ofSize: 14)
59+
airDateLabel.textColor = .gray
60+
episodeCountLabel.font = .systemFont(ofSize: 14)
61+
episodeCountLabel.textColor = .darkGray
62+
ratingLabel.font = .boldSystemFont(ofSize: 14)
63+
ratingLabel.textColor = .systemYellow
64+
65+
66+
}
67+
68+
private func setupConstraints() {
69+
containerView.snp.makeConstraints { make in
70+
make.edges.equalToSuperview().inset(6)
71+
}
72+
73+
posterImageView.snp.makeConstraints { make in
74+
make.top.left.equalToSuperview().offset(8)
75+
make.bottom.equalToSuperview().inset(8)
76+
make.width.equalTo(100)
77+
}
78+
79+
ratingLabel.snp.makeConstraints { make in
80+
make.top.equalToSuperview().offset(8)
81+
make.right.equalToSuperview().inset(8)
82+
}
83+
84+
seasonLabel.snp.makeConstraints { make in
85+
make.top.equalToSuperview().offset(8)
86+
make.left.equalTo(posterImageView.snp.right).offset(8)
87+
make.right.lessThanOrEqualTo(ratingLabel.snp.left).offset(-8)
88+
}
89+
90+
airDateLabel.snp.makeConstraints { make in
91+
make.top.equalTo(seasonLabel.snp.bottom).offset(4)
92+
make.left.equalTo(seasonLabel)
93+
make.right.lessThanOrEqualToSuperview().inset(8)
94+
}
95+
96+
episodeCountLabel.snp.makeConstraints { make in
97+
make.top.equalTo(airDateLabel.snp.bottom).offset(4)
98+
make.left.equalTo(seasonLabel)
99+
make.right.lessThanOrEqualToSuperview().inset(8)
100+
}
101+
}
102+
103+
func configure() {
104+
}
105+
}
106+
107+
#Preview {
108+
SeasonCell()
109+
}
110+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// TvShowDetailViewController+CollectionView.swift
3+
// ICTMDBDetailModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
import UIKit
9+
import SnapKit
10+
extension DetailViewController{
11+
12+
func setupCollectionView() {
13+
mainStackView.addArrangedSubview(collectionView)
14+
collectionView.snp.makeConstraints { $0.height.equalTo(570) }
15+
16+
collectionView.dataSource = dataSource
17+
collectionView.delegate = delegateSource
18+
}
19+
20+
func configureCollectionData() {
21+
collectionView.dataSource = dataSource
22+
collectionView.delegate = delegateSource
23+
}
24+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
//
2+
// DetailViewController+Setup.swift
3+
// ICTMDBDetailModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
import UIKit
9+
import ICTMDBViewKit
10+
import SnapKit
11+
import GenericCollectionViewKit
12+
13+
14+
extension DetailViewController {
15+
16+
func setupUI() {
17+
view.backgroundColor = .systemBackground
18+
19+
// Scroll & Content
20+
view.addSubview(scrollView)
21+
scrollView.contentInsetAdjustmentBehavior = .never
22+
scrollView.addSubview(contentView)
23+
24+
// Stack View
25+
contentView.addSubview(mainStackView)
26+
mainStackView.axis = .vertical
27+
mainStackView.spacing = 16
28+
29+
// Poster Section
30+
mainStackView.addArrangedSubview(posterBGContainerView)
31+
posterBGContainerView.addSubview(posterBGImageView)
32+
posterBGContainerView.addSubview(posterBGBlurView)
33+
mainPoster.addSubview(languageFlag)
34+
let blurContent = posterBGBlurView.contentView
35+
[mainPoster, nameLabel, categoryStackView].forEach { blurContent.addSubview($0) }
36+
37+
// Details Section
38+
mainStackView.addArrangedSubview(createdByTitleLabel)
39+
mainStackView.addArrangedSubview(createdByStackView)
40+
[createdByImageView, createdByNameLabel].forEach { createdByStackView.addArrangedSubview($0) }
41+
42+
[firstDateLabel, lastDateLabel, overviewTitleLabel, overviewLabel].forEach { mainStackView.addArrangedSubview($0) }
43+
}
44+
45+
func setupConstraints() {
46+
scrollView.snp.makeConstraints { $0.edges.equalToSuperview() }
47+
contentView.snp.makeConstraints {
48+
$0.edges.equalTo(scrollView)
49+
$0.width.equalTo(scrollView)
50+
}
51+
mainStackView.snp.makeConstraints { $0.edges.equalToSuperview() }
52+
53+
posterBGContainerView.snp.makeConstraints { $0.leading.trailing.equalToSuperview() }
54+
posterBGImageView.snp.makeConstraints { $0.edges.equalToSuperview() }
55+
posterBGBlurView.snp.makeConstraints { $0.edges.equalToSuperview() }
56+
57+
posterTopLayoutConstraint = mainPoster.topAnchor.constraint(equalTo: posterBGBlurView.contentView.topAnchor)
58+
posterTopLayoutConstraint.isActive = true
59+
60+
mainPoster.snp.makeConstraints {
61+
$0.centerX.equalToSuperview()
62+
$0.height.equalTo(view.safeAreaLayoutGuide.snp.height).multipliedBy(0.4)
63+
$0.width.equalTo(view.safeAreaLayoutGuide.snp.height).multipliedBy(0.3)
64+
}
65+
66+
nameLabel.snp.makeConstraints {
67+
$0.centerX.equalToSuperview()
68+
$0.top.equalTo(mainPoster.snp.bottom).offset(10)
69+
}
70+
71+
categoryStackView.snp.makeConstraints {
72+
$0.centerX.equalToSuperview()
73+
$0.top.equalTo(nameLabel.snp.bottom).offset(12)
74+
$0.bottom.equalToSuperview().offset(-10)
75+
}
76+
77+
createdByImageView.snp.makeConstraints { $0.size.equalTo(60) }
78+
79+
[createdByTitleLabel, createdByStackView,
80+
firstDateLabel, lastDateLabel,
81+
overviewTitleLabel, overviewLabel].forEach {
82+
$0.snp.makeConstraints {
83+
$0.leading.equalToSuperview().offset(15)
84+
$0.trailing.equalToSuperview().offset(-15)
85+
}
86+
}
87+
languageFlag.snp.makeConstraints { make in
88+
make.trailing.equalToSuperview().offset(-10)
89+
make.top.equalToSuperview()
90+
make.height.equalTo(80)
91+
}
92+
}
93+
}
94+

0 commit comments

Comments
 (0)