-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from NAGAZA-Team/Feature/mypage
Feat: 마이페이지 UI 구현
- Loading branch information
Showing
10 changed files
with
464 additions
and
33 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
Nagaza/Resources/Images.xcassets/ic_Info.imageset/Contents.json
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,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "ic_Info.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"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.
Binary file added
BIN
+674 Bytes
Nagaza/Resources/Images.xcassets/ic_Info.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1003 Bytes
Nagaza/Resources/Images.xcassets/ic_Info.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,33 @@ | ||
// | ||
// MypageInfo.swift | ||
// Nagaza | ||
// | ||
// Created by 강조은 on 3/10/24. | ||
// | ||
|
||
import Foundation | ||
|
||
enum MyPageInfoSection: Hashable { | ||
case myData([MyPageInfo]) | ||
case appSetting([MyPageInfo]) | ||
case inquiry([MyPageInfo]) | ||
|
||
var list: [MyPageInfo] { | ||
switch self { | ||
case .myData(let list), .appSetting(let list), .inquiry(let list): | ||
return list | ||
} | ||
} | ||
} | ||
|
||
struct MyPageInfo: Hashable { | ||
let identifier = UUID() | ||
let title: String | ||
var count: Int? = nil | ||
} | ||
|
||
extension MyPageInfo { | ||
public static func == (lhs: MyPageInfo, rhs: MyPageInfo) -> Bool { | ||
lhs.identifier == rhs.identifier | ||
} | ||
} |
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
68 changes: 68 additions & 0 deletions
68
Nagaza/Sources/Presentation/Feature/TabBar/MyPage/View/MyPageTableViewCell.swift
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,68 @@ | ||
// | ||
// MyPageTableViewCell.swift | ||
// Nagaza | ||
// | ||
// Created by 강조은 on 3/10/24. | ||
// | ||
|
||
import UIKit | ||
|
||
final class MyPageTableViewCell: UITableViewCell { | ||
|
||
static let identifier = MyPageTableViewCell.description() | ||
|
||
private let titleLabel: UILabel = { | ||
|
||
let label = UILabel() | ||
label.font = NagazaFontFamily.Pretendard.regular.font(size: 16) | ||
label.textColor = NagazaAsset.Colors.black1.color | ||
|
||
return label | ||
}() | ||
|
||
private let countLabel: UILabel = { | ||
let label = UILabel() | ||
|
||
label.font = NagazaFontFamily.Pretendard.regular.font(size: 15) | ||
label.textColor = NagazaAsset.Colors.mainOrange.color | ||
|
||
return label | ||
}() | ||
|
||
override init(style: UITableViewCell.CellStyle, | ||
reuseIdentifier: String?) { | ||
super.init(style: style, | ||
reuseIdentifier: reuseIdentifier) | ||
|
||
setup() | ||
initConstraints() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private func setup() { | ||
contentView.addSubviews([titleLabel, countLabel]) | ||
} | ||
|
||
private func initConstraints() { | ||
titleLabel.snp.makeConstraints { make in | ||
make.top.equalToSuperview().inset(20) | ||
make.leading.equalToSuperview().inset(24) | ||
make.centerY.equalToSuperview() | ||
} | ||
|
||
countLabel.snp.makeConstraints { make in | ||
make.centerY.equalToSuperview() | ||
make.trailing.equalToSuperview().inset(24) | ||
} | ||
} | ||
|
||
func config(item: MyPageInfo) { | ||
titleLabel.text = item.title | ||
if let count = item.count { | ||
countLabel.text = "\(count)" | ||
} else { countLabel.text = nil } | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
Nagaza/Sources/Presentation/Feature/TabBar/MyPage/View/MyPageTableViewHeader.swift
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,39 @@ | ||
// | ||
// MyPageTableViewHeader.swift | ||
// Nagaza | ||
// | ||
// Created by 강조은 on 3/10/24. | ||
// | ||
|
||
import UIKit | ||
|
||
final class MyPageTableViewHeader: UITableViewHeaderFooterView { | ||
|
||
static let identifier = MyPageTableViewHeader.description() | ||
|
||
private let background: UIView = { | ||
let view = UIView() | ||
|
||
view.backgroundColor = NagazaAsset.Colors.gray8.color | ||
|
||
return view | ||
}() | ||
|
||
override init(reuseIdentifier: String?) { | ||
super.init(reuseIdentifier: reuseIdentifier) | ||
|
||
makeUI() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
} | ||
|
||
private func makeUI() { | ||
addSubview(background) | ||
|
||
background.snp.makeConstraints { make in | ||
make.edges.equalToSuperview() | ||
} | ||
} | ||
} |
Oops, something went wrong.