Skip to content

Commit 71887f6

Browse files
authored
Merge pull request #248 from EAT-SSU/fix/#213
[#213, #247] 리뷰 이미지 누락 수정 및 아이폰 설정 예외처리
2 parents 9cf34cf + 657b7bb commit 71887f6

File tree

4 files changed

+70
-5
lines changed

4 files changed

+70
-5
lines changed

EATSSU/App/Sources/Presentation/Home/ViewController/HomeTimeTabmanController.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,17 @@ extension HomeTimeTabmanController: PageboyViewControllerDataSource, TMBarDataSo
129129
return TMBarItem(title: title)
130130
}
131131
}
132-
132+
133133
func setLayoutTabBar(ctBar: TMBar.ButtonBar) {
134-
ctBar.backgroundColor = .white
135-
ctBar.backgroundView.style = .blur(style: .regular)
134+
// 투명도 줄이기 활성화 체크
135+
if UIAccessibility.isReduceTransparencyEnabled {
136+
ctBar.backgroundView.style = .flat(color: .white)
137+
ctBar.backgroundColor = .white.withAlphaComponent(1.0)
138+
} else {
139+
ctBar.backgroundView.style = .blur(style: .regular)
140+
ctBar.backgroundColor = .clear
141+
}
142+
136143
ctBar.layout.contentInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0)
137144
ctBar.buttons.customize { button in
138145
button.tintColor = .gray700 // 선택 안되어 있을 때

EATSSU/App/Sources/Presentation/Review/ViewController/SetRateViewController.swift

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,38 @@ final class SetRateViewController: BaseViewController {
131131
$0.addGestureRecognizer(tapGesture)
132132
}
133133

134+
private lazy var imageContainer = UIView().then {
135+
$0.addSubview(selectImageButton)
136+
$0.addSubview(imageCountLabel)
137+
}
138+
134139
private lazy var selectImageButton = UIButton().then {
135-
$0.setImage(UIImage(named: "AddImageButton"), for: .normal)
140+
var config = UIButton.Configuration.plain()
141+
config.image = EATSSUDesignAsset.Images.addImageButton.image
142+
config.contentInsets = NSDirectionalEdgeInsets(top: -5, leading: 0, bottom: 5, trailing: 0)
143+
144+
$0.configuration = config
136145
$0.addTarget(self, action: #selector(didSelectedImage), for: .touchUpInside)
146+
147+
$0.layer.borderWidth = 1
148+
$0.layer.borderColor = EATSSUDesignAsset.Color.GrayScale.gray500.color.cgColor
149+
$0.layer.cornerRadius = 8
150+
$0.clipsToBounds = true
151+
152+
$0.contentVerticalAlignment = .center
153+
$0.contentHorizontalAlignment = .center
154+
}
155+
156+
157+
private let imageCountLabel = UILabel().then {
158+
$0.text = "사진 0/1"
159+
$0.font = .caption3
160+
$0.textColor = EATSSUDesignAsset.Color.GrayScale.gray500.color
161+
$0.textAlignment = .center
137162
}
138163

139164
private let deleteMethodLabel = UILabel().then {
140-
$0.text = "이미지 클릭 시, 삭제됩니다"
165+
$0.text = "사진 클릭 시, 삭제됩니다"
141166
$0.font = .caption3
142167
$0.textColor = EATSSUDesignAsset.Color.GrayScale.gray500.color
143168
}
@@ -183,6 +208,7 @@ final class SetRateViewController: BaseViewController {
183208
userReviewTextView,
184209
maximumWordLabel,
185210
selectImageButton,
211+
imageCountLabel,
186212
userReviewImageView,
187213
deleteMethodLabel,
188214
nextButton)
@@ -266,6 +292,12 @@ final class SetRateViewController: BaseViewController {
266292
$0.width.equalTo(60)
267293
$0.height.equalTo(60)
268294
}
295+
296+
imageCountLabel.snp.makeConstraints {
297+
$0.top.equalTo(selectImageButton.snp.bottom).offset(-19)
298+
$0.centerX.equalTo(selectImageButton)
299+
$0.width.equalTo(selectImageButton)
300+
}
269301

270302
userReviewImageView.snp.makeConstraints {
271303
$0.top.equalTo(maximumWordLabel.snp.bottom).offset(15)
@@ -386,6 +418,7 @@ final class SetRateViewController: BaseViewController {
386418
func didTappedimageView() {
387419
userReviewImageView.image = nil // 이미지 삭제
388420
userPickedImage = nil
421+
imageCountLabel.text = "사진 0/1"
389422
}
390423

391424
private func prepareForNextReview() {
@@ -511,6 +544,7 @@ extension SetRateViewController: UIImagePickerControllerDelegate {
511544
if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
512545
userReviewImageView.image = image
513546
userPickedImage = image
547+
imageCountLabel.text = "사진 1/1"
514548
}
515549
picker.dismiss(animated: true, completion: nil)
516550
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "AddImageButton.svg",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}

0 commit comments

Comments
 (0)