Skip to content

Commit

Permalink
πŸ”— :: (#130) 도움말 Section μΆ”κ°€
Browse files Browse the repository at this point in the history
  • Loading branch information
juyeong525 authored Feb 26, 2024
2 parents 96c6dca + b9a650b commit 849bd59
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "fluent_speaker-2-48-regular.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Projects/Modules/DesignSystem/Sources/Image/JobisIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public enum JobisIcon {
case currentPageControl
case defaultPageControl
case pieChart
case sound
case trash
case emptyBookmark

Expand Down Expand Up @@ -100,6 +101,9 @@ public enum JobisIcon {
case .pieChart:
return dsIcons.pieChart.image

case .sound:
return dsIcons.sound.image

case .trash:
return dsIcons.trash.image

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import UIKit
import DesignSystem

final class SectionTableViewCell: UITableViewCell {
typealias SectionType = (String, UIImage)
final class SectionTableViewCell: BaseTableViewCell<SectionType> {
static let identifier = "SectionTableViewCell"
private let sectionImageView = UIImageView()
private let titleLabel = UILabel()

override func setHighlighted(_ highlighted: Bool, animated: Bool) {
super.setHighlighted(highlighted, animated: animated)
self.titleLabel.textColor = self.isHighlighted ? .GrayScale.gray90.withAlphaComponent(0.1) : .GrayScale.gray90
self.titleLabel.textColor = self.isHighlighted ? .GrayScale.gray50 : .GrayScale.gray90
}

override func layoutSubviews() {
override func addView() {
[
sectionImageView,
titleLabel
].forEach { self.addSubview($0) }
}

override func setLayout() {
sectionImageView.snp.makeConstraints {
$0.top.bottom.equalToSuperview().inset(12)
$0.width.equalTo(28)
Expand All @@ -28,9 +31,9 @@ final class SectionTableViewCell: UITableViewCell {
}
}

func setCell(image: UIImage, title: String) {
self.sectionImageView.image = image
self.titleLabel.setJobisText(title, font: .body, color: .GrayScale.gray90)
override func adapt(model: SectionType) {
self.sectionImageView.image = model.1
self.titleLabel.setJobisText(model.0, font: .body, color: .GrayScale.gray90)
self.selectionStyle = .none
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import UIKit
import SnapKit
import Then
import RxSwift
import RxCocoa
import DesignSystem

final class HelpSectionView: BaseView {
enum HelpSectionType: Int {
case announcement
}
private let helpSectionView = SectionView(
menuText: "도움말",
items: [
("곡지사항", .jobisIcon(.sound))
]
)

override func addView() {
self.addSubview(helpSectionView)
}

override func setLayout() {
helpSectionView.snp.makeConstraints {
$0.edges.equalToSuperview()
}
}

func getSelectedItem(type: HelpSectionType) -> Observable<IndexPath> {
self.helpSectionView.getSelectedItem(index: type.rawValue)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ extension SectionView: UITableViewDataSource {
withIdentifier: SectionTableViewCell.identifier,
for: indexPath
) as? SectionTableViewCell else { return UITableViewCell() }
cell.setCell(image: items[indexPath.row].icon, title: items[indexPath.row].title)
cell.adapt(model: items[indexPath.row])

return cell
}
}
18 changes: 16 additions & 2 deletions Projects/Presentation/Sources/MyPage/MyPageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public final class MyPageViewController: BaseViewController<MyPageViewModel> {
private let reviewNavigateStackView = ReviewNavigateStackView()
private let accountSectionView = AccountSectionView()
private let bugSectionView = BugSectionView()
private let helpSectionView = HelpSectionView()

public override func addView() {
self.view.addSubview(scrollView)
Expand All @@ -27,6 +28,7 @@ public final class MyPageViewController: BaseViewController<MyPageViewModel> {
studentInfoView,
editButton,
reviewNavigateStackView,
helpSectionView,
accountSectionView,
bugSectionView
].forEach { self.contentView.addSubview($0) }
Expand All @@ -36,31 +38,43 @@ public final class MyPageViewController: BaseViewController<MyPageViewModel> {
scrollView.snp.makeConstraints {
$0.edges.equalToSuperview()
}

contentView.snp.makeConstraints {
$0.edges.equalTo(scrollView.contentLayoutGuide)
$0.top.width.equalToSuperview()
$0.bottom.equalTo(bugSectionView)
$0.bottom.equalTo(bugSectionView).offset(60)
}

studentInfoView.snp.makeConstraints {
$0.top.equalToSuperview()
$0.leading.trailing.equalToSuperview()
}

editButton.snp.makeConstraints {
$0.centerY.equalTo(studentInfoView)
$0.trailing.equalToSuperview().offset(-28)
}

reviewNavigateStackView.snp.updateConstraints {
$0.leading.trailing.equalToSuperview().inset(24)
$0.top.equalTo(studentInfoView.snp.bottom)
}
accountSectionView.snp.makeConstraints {

helpSectionView.snp.makeConstraints {
$0.top.equalTo(reviewNavigateStackView.snp.bottom)
$0.leading.trailing.equalToSuperview()
}

accountSectionView.snp.makeConstraints {
$0.top.equalTo(helpSectionView.snp.bottom)
$0.leading.trailing.equalToSuperview()
}

bugSectionView.snp.makeConstraints {
$0.top.equalTo(accountSectionView.snp.bottom)
$0.leading.trailing.equalToSuperview()
}

}

public override func bind() {
Expand Down

0 comments on commit 849bd59

Please sign in to comment.