-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] 준비 현황 뷰 구현 #186
[feat] 준비 현황 뷰 구현 #186
Changes from 22 commits
74679af
9cda8af
b28c076
4898437
3433905
350b162
4baafa8
04f5d77
8353124
92b853a
ce7ef60
a66e0bd
a04c646
8c38be1
b94cf2d
4ff8dab
5c5093b
6187c61
71f2130
3374f87
88704f6
c14a7b8
e6db3f7
df868aa
59c01f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,17 +11,12 @@ import Foundation | |
// MARK: 약속 참여자 목록 | ||
|
||
struct PromiseParticipantListModel: ResponseModelType { | ||
let participantCount: Int | ||
let participants: [Participant] | ||
} | ||
|
||
struct Participant: Codable { | ||
let id: Int | ||
let name, profileImageURL, state: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id | ||
case name | ||
case profileImageURL = "profileImg" | ||
case state | ||
} | ||
let participantId, memberId: Int | ||
let name, state: String | ||
let profileImg: String? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 수정했습니다 !! 😆 |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// PromiseLateInfoResponseModel.swift | ||
// KkuMulKum | ||
// | ||
// Created by YOUJIM on 7/8/24. | ||
// | ||
|
||
|
||
// MARK: 약속 지각 상세 조회 | ||
|
||
import Foundation | ||
|
||
struct TardyInfoModel: ResponseModelType { | ||
let penalty: String | ||
let isPastDue: Bool | ||
let lateComers: [Comer] | ||
} | ||
|
||
struct Comer: Codable { | ||
let participantId: Int | ||
let name, profileImg: String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분도 마찬가지입니다! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 수정했습니다 !! 😆 |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// PromiseLateInfoResponseModel.swift | ||
// KkuMulKum | ||
// | ||
// Created by YOUJIM on 7/8/24. | ||
// | ||
|
||
|
||
// MARK: 약속 지각 상세 조회 | ||
|
||
import Foundation | ||
|
||
struct TardyInfoModel: ResponseModelType { | ||
let penalty: String | ||
let isPastDue: Bool | ||
let lateComers: [Comer] | ||
} | ||
|
||
struct Comer: Codable { | ||
let participantId: Int | ||
let name, profileImg: String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅇ ㅕ기두.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 엇... 이 파일은 삭제되어야 하는데 깜빡했어요 감사합니다 !! |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "text_popup.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// PagePromiseSegmentedControl.swift | ||
// KkuMulKum | ||
// | ||
// Created by YOUJIM on 7/9/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import SnapKit | ||
|
||
class PagePromiseSegmentedControl: UISegmentedControl { | ||
private let backgroundLineView: UIView = UIView(backgroundColor: .gray2) | ||
|
||
let selectedUnderLineView: UIView = UIView(backgroundColor: .black).then { | ||
$0.layer.cornerRadius = 1 | ||
} | ||
|
||
override init(items: [Any]?) { | ||
super.init(items: items) | ||
|
||
setupSegment() | ||
setupTextAttribute() | ||
setupBackgroundLineView() | ||
setupBackgroundAndDivider() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError() | ||
} | ||
|
||
private func setupSegment() { | ||
addSubviews(backgroundLineView, selectedUnderLineView) | ||
|
||
selectedSegmentIndex = 0 | ||
} | ||
|
||
private func setupBackgroundAndDivider() { | ||
setBackgroundImage(UIImage(), for: .normal, barMetrics: .default) | ||
setBackgroundImage(UIImage(), for: .selected, barMetrics: .default) | ||
setBackgroundImage(UIImage(), for: .highlighted, barMetrics: .default) | ||
|
||
setDividerImage( | ||
UIImage(), | ||
forLeftSegmentState: .selected, | ||
rightSegmentState: .normal, | ||
barMetrics: .default | ||
) | ||
} | ||
|
||
private func setupTextAttribute() { | ||
setTitleTextAttributes([ | ||
NSAttributedString.Key.foregroundColor: UIColor.gray3, | ||
NSAttributedString.Key.font: UIFont.pretendard(.body05) | ||
], for: .normal) | ||
setTitleTextAttributes([ | ||
NSAttributedString.Key.foregroundColor: UIColor.black, | ||
NSAttributedString.Key.font: UIFont.pretendard(.body05) | ||
], for: .selected) | ||
} | ||
|
||
private func setupBackgroundLineView() { | ||
backgroundLineView.snp.makeConstraints { | ||
$0.bottom.leading.trailing.equalToSuperview() | ||
$0.height.equalTo(2) | ||
} | ||
|
||
selectedUnderLineView.snp.makeConstraints { | ||
$0.bottom.leading.equalToSuperview() | ||
$0.width.equalToSuperview().dividedBy(numberOfSegments) | ||
$0.height.equalTo(backgroundLineView) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// PagePromiseSegmentedControl.swift | ||
// KkuMulKum | ||
// | ||
// Created by YOUJIM on 7/9/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import SnapKit | ||
|
||
class PagePromiseSegmentedControl: UISegmentedControl { | ||
private let backgroundLineView: UIView = UIView(backgroundColor: .gray2) | ||
|
||
let selectedUnderLineView: UIView = UIView(backgroundColor: .black).then { | ||
$0.layer.cornerRadius = 1 | ||
} | ||
|
||
override init(items: [Any]?) { | ||
super.init(items: items) | ||
|
||
setupSegment() | ||
setupTextAttribute() | ||
setupBackgroundLineView() | ||
setupBackgroundAndDivider() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError() | ||
} | ||
|
||
private func setupSegment() { | ||
addSubviews(backgroundLineView, selectedUnderLineView) | ||
|
||
selectedSegmentIndex = 0 | ||
} | ||
|
||
private func setupBackgroundAndDivider() { | ||
setBackgroundImage(UIImage(), for: .normal, barMetrics: .default) | ||
setBackgroundImage(UIImage(), for: .selected, barMetrics: .default) | ||
setBackgroundImage(UIImage(), for: .highlighted, barMetrics: .default) | ||
|
||
setDividerImage( | ||
UIImage(), | ||
forLeftSegmentState: .selected, | ||
rightSegmentState: .normal, | ||
barMetrics: .default | ||
) | ||
} | ||
|
||
private func setupTextAttribute() { | ||
setTitleTextAttributes([ | ||
NSAttributedString.Key.foregroundColor: UIColor.gray3, | ||
NSAttributedString.Key.font: UIFont.pretendard(.body05) | ||
], for: .normal) | ||
setTitleTextAttributes([ | ||
NSAttributedString.Key.foregroundColor: UIColor.black, | ||
NSAttributedString.Key.font: UIFont.pretendard(.body05) | ||
], for: .selected) | ||
} | ||
|
||
private func setupBackgroundLineView() { | ||
backgroundLineView.snp.makeConstraints { | ||
$0.bottom.leading.trailing.equalToSuperview() | ||
$0.height.equalTo(2) | ||
} | ||
|
||
selectedUnderLineView.snp.makeConstraints { | ||
$0.bottom.leading.equalToSuperview() | ||
$0.width.equalToSuperview().dividedBy(numberOfSegments) | ||
$0.height.equalTo(backgroundLineView) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodingKey를 사용해서 저희 컨벤션에 맞게 promiseID로 수정해도 좋을 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정했습니다!