Skip to content

Commit

Permalink
[FIX] 커리큘럼 주차별에서 메인이미지 넣기(Team-LionHeart#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffalswo2 committed Jul 21, 2023
1 parent e3f686d commit 46549f2
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 5 deletions.
4 changes: 4 additions & 0 deletions LionHeart-iOS/LionHeart-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
B5C6A2BE2A5DE6590021BE5E /* GeneralTitleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C6A2BD2A5DE6590021BE5E /* GeneralTitleTableViewCell.swift */; };
B5C6A2C22A5DEA1B0021BE5E /* CopyRightTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C6A2C12A5DEA1B0021BE5E /* CopyRightTableViewCell.swift */; };
B5C6A2C82A5EF4EB0021BE5E /* ArticleDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C6A2C72A5EF4EB0021BE5E /* ArticleDetail.swift */; };
B5F323E92A6A8F0000047869 /* CurriculumWeekBackgroundDummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F323E82A6A8F0000047869 /* CurriculumWeekBackgroundDummy.swift */; };
C00780B72A5FFE0E0043EB36 /* UILabel+.swift in Sources */ = {isa = PBXBuildFile; fileRef = C00780B62A5FFE0E0043EB36 /* UILabel+.swift */; };
C00780BA2A60149D0043EB36 /* LHTodayArticleTitle.swift in Sources */ = {isa = PBXBuildFile; fileRef = C00780B92A60149D0043EB36 /* LHTodayArticleTitle.swift */; };
C06E381B2A65346700B00600 /* UserDefaultToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = C06E381A2A65346700B00600 /* UserDefaultToken.swift */; };
Expand Down Expand Up @@ -305,6 +306,7 @@
B5C6A2BD2A5DE6590021BE5E /* GeneralTitleTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralTitleTableViewCell.swift; sourceTree = "<group>"; };
B5C6A2C12A5DEA1B0021BE5E /* CopyRightTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CopyRightTableViewCell.swift; sourceTree = "<group>"; };
B5C6A2C72A5EF4EB0021BE5E /* ArticleDetail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleDetail.swift; sourceTree = "<group>"; };
B5F323E82A6A8F0000047869 /* CurriculumWeekBackgroundDummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurriculumWeekBackgroundDummy.swift; sourceTree = "<group>"; };
C00780B62A5FFE0E0043EB36 /* UILabel+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+.swift"; sourceTree = "<group>"; };
C00780B92A60149D0043EB36 /* LHTodayArticleTitle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LHTodayArticleTitle.swift; sourceTree = "<group>"; };
C06E381A2A65346700B00600 /* UserDefaultToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultToken.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1360,6 +1362,7 @@
children = (
F4490C062A5CEEA300A6D9D7 /* CurriculumDummyData.swift */,
F4DB30AF2A611C9700413EB9 /* CurriculumListByWeekData.swift */,
B5F323E82A6A8F0000047869 /* CurriculumWeekBackgroundDummy.swift */,
);
path = Model;
sourceTree = "<group>";
Expand Down Expand Up @@ -1589,6 +1592,7 @@
B59892EC2A5B94E100CE1FEB /* UIApplication+.swift in Sources */,
4AE19A172A65864F00C1DB7E /* BookmarkService.swift in Sources */,
4AE19A1A2A65886100C1DB7E /* BookmarkReponse.swift in Sources */,
B5F323E92A6A8F0000047869 /* CurriculumWeekBackgroundDummy.swift in Sources */,
C0DF039F2A5CABC10037F740 /* GetPregnancyViewController.swift in Sources */,
C0DF035F2A5A9C330037F740 /* ArticleListByWeekViewController.swift in Sources */,
F4DB30BC2A61691F00413EB9 /* CurriculumArticleByWeekRowZeroTableViewCell.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ import UIKit
import SnapKit

final class CurriculumArticleByWeekRowZeroTableViewCell: UITableViewCell, TableViewCellRegisterDequeueProtocol {

var inputData: Int? {
didSet {
guard let inputData else { return }
//inputData는 row가 0부터인데 주차정보는 4주차부터 시작이므로 +4를 해줌

weekLabel.text = "\(inputData)주차"

weekBackGroundImageView.image = WeekBackgroundImage.dummy()[inputData-4].weekBackgroundImage

}
}

private enum Size {
static let weekBackGroundImageSize: CGFloat = 200 / 375
}

private let weekBackGroundImageView: UIImageView = {
let imageView = UIImageView()
imageView.backgroundColor = .designSystem(.gray500)
Expand All @@ -37,7 +39,7 @@ final class CurriculumArticleByWeekRowZeroTableViewCell: UITableViewCell, TableV
button.setImage(ImageLiterals.Curriculum.arrowLeftWeek, for: .normal)
button.addButtonAction { _ in

NotificationCenter.default.post(name: NSNotification.Name("leftButton"),
NotificationCenter.default.post(name: NSNotification.Name("leftButton"),
object: nil)
}
return button
Expand Down Expand Up @@ -72,7 +74,7 @@ final class CurriculumArticleByWeekRowZeroTableViewCell: UITableViewCell, TableV
}()

private let curriculumAndWeekStackView: UIStackView = {
let stackView = UIStackView()
let stackView = UIStackView()
stackView.spacing = 2
stackView.distribution = .fill
stackView.axis = .vertical
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// CurriculumWeekBackgroundDummy.swift
// LionHeart-iOS
//
// Created by 김민재 on 2023/07/21.
//

import UIKit

struct WeekBackgroundImage: AppData {
let weekBackgroundImage: UIImage
}

extension WeekBackgroundImage {
static func dummy() -> [WeekBackgroundImage] {
return [WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week4Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week5Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week6Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week7Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week8Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week9Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week10Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week11Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week12Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week13Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week14Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week15Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week16Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week17Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week18Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week19Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week20Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week21Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week22Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week23Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week24Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week25Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week26Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week27Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week28Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week29Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week30Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week31Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week32Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week33Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week34Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week35Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week36Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week37Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week38Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week39Image),
WeekBackgroundImage(weekBackgroundImage: ImageLiterals.Curriculum.week40Image)



]

}
}

0 comments on commit 46549f2

Please sign in to comment.