Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Runnect-iOS/Runnect-iOS/Global/Utils/Toast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Toast {

toastContainer.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.bottom.equalToSuperview().inset(safeAreaBottomInset+40)
$0.bottom.equalToSuperview().inset(safeAreaBottomInset+80)
$0.width.equalTo(200)
$0.height.equalTo(44)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ final class CourseListCVC: UICollectionViewCell {
$0.clipsToBounds = true
}

private let imageCoverView = UIImageView().then {
$0.backgroundColor = .m1.withAlphaComponent(0.2)
$0.layer.cornerRadius = 5
$0.isHidden = true
}

private let titleLabel = UILabel().then {
$0.text = "제목"
$0.font = .b4
Expand Down Expand Up @@ -109,8 +115,10 @@ extension CourseListCVC {
if didSelect {
courseImageView.layer.borderColor = UIColor.m1.cgColor
courseImageView.layer.borderWidth = 2
imageCoverView.isHidden = false
} else {
courseImageView.layer.borderColor = UIColor.clear.cgColor
imageCoverView.isHidden = true
}
}
}
Expand All @@ -133,14 +141,18 @@ extension CourseListCVC {
}

private func setLayout() {
self.contentView.addSubviews(courseImageView, labelStackView, likeButton)
self.contentView.addSubviews(courseImageView, imageCoverView, labelStackView, likeButton)

courseImageView.snp.makeConstraints { make in
make.leading.top.trailing.equalToSuperview()
let imageHeight = contentView.frame.width * (124/174)
make.height.equalTo(imageHeight)
}

imageCoverView.snp.makeConstraints { make in
make.edges.equalTo(courseImageView)
}

likeButton.snp.makeConstraints { make in
make.top.equalTo(courseImageView.snp.bottom).offset(7)
make.trailing.equalToSuperview()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ final class NicknameEditorVC: UIViewController {

weak var delegate: NicknameEditorVCDelegate?

private let nicknameMaxLength: Int = 7

// MARK: - UI Components

private let editorContentView = UIView().then {
Expand Down Expand Up @@ -55,13 +57,12 @@ final class NicknameEditorVC: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
self.tabBarController?.tabBar.isHidden = true
nickNameTextField.delegate = self
isTextExist(textField: nickNameTextField)
view.backgroundColor = .black.withAlphaComponent(0.8)
setUI()
setLayout()
showKeyboard()
setAddTarget()
}
}

Expand All @@ -76,6 +77,10 @@ extension NicknameEditorVC {
}
}

private func setAddTarget(){
nickNameTextField.addTarget(self, action: #selector(textFieldTextDidChange), for: .editingChanged)
}

func showKeyboard() {
self.nickNameTextField.becomeFirstResponder()
}
Expand All @@ -100,13 +105,25 @@ extension NicknameEditorVC {
guard let nickname = nickNameTextField.text else { return }
self.updateUserNickname(nickname: nickname)
}

@objc private func textFieldTextDidChange() {
guard let text = nickNameTextField.text else { return }

if text.count > nicknameMaxLength {
let index = text.index(text.startIndex, offsetBy: nicknameMaxLength)
let newString = text[text.startIndex..<index]
self.nickNameTextField.text = String(newString)
}
}
}

extension NicknameEditorVC {

// MARK: - Layout Helpers

private func setUI() {
self.tabBarController?.tabBar.isHidden = true
view.backgroundColor = .black.withAlphaComponent(0.8)
editorContentView.backgroundColor = .w1
horizontalDivideLine.backgroundColor = .g3
}
Expand Down