-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Refactor] MyPageView 수정사항 반영 #162
base: develop
Are you sure you want to change the base?
Changes from all commits
b80ddb7
5b126c7
9aa5cd5
301d9c1
fdc2a56
2f28982
0f965d0
64bd126
3bba161
e55897c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "LedyEmpty.svg", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// ViskitYellowButton.swift | ||
// Common | ||
// | ||
// Created by 송여경 on 10/19/24. | ||
// Copyright © 2024 com.recordy. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
public class ViskitYellowButton: UIButton { | ||
|
||
public override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
setUI() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private func setUI() { | ||
backgroundColor = CommonAsset.viskitYellow400.color | ||
layer.cornerRadius = 40 | ||
titleLabel?.font = ViskitFont.body2Bold.font | ||
setTitleColor(.black, for: .normal) | ||
clipsToBounds = true | ||
} | ||
|
||
public override func layoutSubviews() { | ||
super.layoutSubviews() | ||
layer.cornerRadius = bounds.height / 2 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// | ||
// BookMarkEmptyView.swift | ||
// Presentation | ||
// | ||
// Created by 송여경 on 10/19/24. | ||
// Copyright © 2024 com.recordy. All rights reserved. | ||
// | ||
import UIKit | ||
import SnapKit | ||
import Then | ||
|
||
import Common | ||
|
||
class BookMarkEmptyView: UIView { | ||
private let imageView = UIImageView() | ||
private let titleLabel = UILabel() | ||
private let goAroundButton = ViskitYellowButton() | ||
|
||
private var actionButtonHandler: (() -> Void)? | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
setStyle() | ||
setUI() | ||
setAutoLayout() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private func setStyle() { | ||
backgroundColor = .black | ||
|
||
imageView.do { | ||
$0.image = CommonAsset.ledyEmpty.image | ||
$0.contentMode = .scaleAspectFit | ||
} | ||
|
||
titleLabel.do { | ||
let text = "북마크한 영상이 없어요.\n영상을 둘러보고 저장해 보세요!" | ||
$0.numberOfLines = 0 | ||
$0.textColor = CommonAsset.viskitGray02.color | ||
$0.font = ViskitFont.title2.font | ||
|
||
let paragraphStyle = NSMutableParagraphStyle() | ||
paragraphStyle.lineSpacing = 30 - $0.font.lineHeight | ||
paragraphStyle.alignment = .center | ||
Comment on lines
+46
to
+48
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. p3 |
||
|
||
let attributedString = NSAttributedString( | ||
string: text, | ||
attributes: [ | ||
.paragraphStyle: paragraphStyle, | ||
.font: ViskitFont.title2.font, | ||
.foregroundColor: CommonAsset.viskitGray02.color | ||
] | ||
) | ||
$0.attributedText = attributedString | ||
$0.textAlignment = .center | ||
} | ||
|
||
goAroundButton.do { | ||
$0.setTitle("영상 둘러보기", for: .normal) | ||
} | ||
} | ||
|
||
private func setUI() { | ||
[ | ||
imageView, | ||
titleLabel, | ||
goAroundButton | ||
].forEach { addSubview($0) } | ||
Comment on lines
+68
to
+72
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. p3 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. 다른 View / VIewController에도 수정 필요해요 |
||
} | ||
|
||
private func setAutoLayout() { | ||
imageView.snp.makeConstraints { | ||
$0.top.equalToSuperview().offset(111) | ||
$0.centerX.equalToSuperview() | ||
$0.width.equalTo(110.adaptiveWidth) | ||
$0.height.equalTo(97.adaptiveHeight) | ||
} | ||
|
||
titleLabel.snp.makeConstraints { | ||
$0.top.equalTo(imageView.snp.bottom).offset(14) | ||
$0.centerX.equalToSuperview() | ||
$0.leading.trailing.equalToSuperview().inset(65) | ||
} | ||
|
||
goAroundButton.snp.makeConstraints { | ||
$0.top.equalTo(titleLabel.snp.bottom).offset(24) | ||
$0.centerX.equalToSuperview() | ||
$0.width.equalTo(113.adaptiveWidth) | ||
$0.height.equalTo(44.adaptiveHeight) | ||
} | ||
} | ||
|
||
func setActionButtonHandler(_ handler: @escaping () -> Void) { | ||
goAroundButton.addTarget(self, action: #selector(actionButtonTapped), for: .touchUpInside) | ||
self.actionButtonHandler = handler | ||
} | ||
|
||
@objc private func actionButtonTapped() { | ||
actionButtonHandler?() | ||
} | ||
Comment on lines
+97
to
+104
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. p3 |
||
} |
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.
p2
height 쓰는 부분에 .adaptiveHeight 필요할 것 같습니다!
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.