Skip to content
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: 재생화면 뷰 구현(UI) #29

Merged
merged 17 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
44 changes: 44 additions & 0 deletions iOS/Layover/Layover.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
194552312B04DA1A00299768 /* LOCircleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 194552302B04DA1A00299768 /* LOCircleButton.swift */; };
19C7AFCE2B02410F003B35F2 /* AuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C7AFCD2B02410F003B35F2 /* AuthManager.swift */; };
19C7AFD62B02584D003B35F2 /* KeychainStored.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C7AFD52B02584D003B35F2 /* KeychainStored.swift */; };
835A61902B067D61002F22A5 /* LOSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A618F2B067D61002F22A5 /* LOSlider.swift */; };
835A61922B067FEC002F22A5 /* LOTagStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A61912B067FEC002F22A5 /* LOTagStackView.swift */; };
835A61942B068096002F22A5 /* LODescriptionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A61932B068096002F22A5 /* LODescriptionView.swift */; };
835A619D2B068115002F22A5 /* PlaybackPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A61972B068115002F22A5 /* PlaybackPresenter.swift */; };
835A619E2B068115002F22A5 /* PlaybackWorker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A61982B068115002F22A5 /* PlaybackWorker.swift */; };
835A619F2B068115002F22A5 /* PlaybackRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A61992B068115002F22A5 /* PlaybackRouter.swift */; };
835A61A02B068115002F22A5 /* PlaybackModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A619A2B068115002F22A5 /* PlaybackModels.swift */; };
835A61A12B068115002F22A5 /* PlaybackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A619B2B068115002F22A5 /* PlaybackViewController.swift */; };
835A61A22B068115002F22A5 /* PlaybackInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A619C2B068115002F22A5 /* PlaybackInteractor.swift */; };
FC2511A02B045C0A004717BC /* SignUpInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC25119F2B045C0A004717BC /* SignUpInteractor.swift */; };
FC2511A22B045C3F004717BC /* SignUpPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC2511A12B045C3F004717BC /* SignUpPresenter.swift */; };
FC2511A42B045D6C004717BC /* SignUpModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC2511A32B045D6C004717BC /* SignUpModels.swift */; };
Expand Down Expand Up @@ -99,6 +108,15 @@
194552302B04DA1A00299768 /* LOCircleButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LOCircleButton.swift; sourceTree = "<group>"; };
19C7AFCD2B02410F003B35F2 /* AuthManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthManager.swift; sourceTree = "<group>"; };
19C7AFD52B02584D003B35F2 /* KeychainStored.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainStored.swift; sourceTree = "<group>"; };
835A618F2B067D61002F22A5 /* LOSlider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LOSlider.swift; sourceTree = "<group>"; };
835A61912B067FEC002F22A5 /* LOTagStackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LOTagStackView.swift; sourceTree = "<group>"; };
835A61932B068096002F22A5 /* LODescriptionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LODescriptionView.swift; sourceTree = "<group>"; };
835A61972B068115002F22A5 /* PlaybackPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackPresenter.swift; sourceTree = "<group>"; };
835A61982B068115002F22A5 /* PlaybackWorker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackWorker.swift; sourceTree = "<group>"; };
835A61992B068115002F22A5 /* PlaybackRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackRouter.swift; sourceTree = "<group>"; };
835A619A2B068115002F22A5 /* PlaybackModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackModels.swift; sourceTree = "<group>"; };
835A619B2B068115002F22A5 /* PlaybackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackViewController.swift; sourceTree = "<group>"; };
835A619C2B068115002F22A5 /* PlaybackInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackInteractor.swift; sourceTree = "<group>"; };
FC25119F2B045C0A004717BC /* SignUpInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpInteractor.swift; sourceTree = "<group>"; };
FC2511A12B045C3F004717BC /* SignUpPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpPresenter.swift; sourceTree = "<group>"; };
FC2511A32B045D6C004717BC /* SignUpModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpModels.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -228,6 +246,19 @@
path = Keychain;
sourceTree = "<group>";
};
835A61962B0680FC002F22A5 /* Playback */ = {
isa = PBXGroup;
children = (
835A61972B068115002F22A5 /* PlaybackPresenter.swift */,
835A61982B068115002F22A5 /* PlaybackWorker.swift */,
835A61992B068115002F22A5 /* PlaybackRouter.swift */,
835A619A2B068115002F22A5 /* PlaybackModels.swift */,
835A619B2B068115002F22A5 /* PlaybackViewController.swift */,
835A619C2B068115002F22A5 /* PlaybackInteractor.swift */,
);
path = Playback;
sourceTree = "<group>";
};
FC2511A72B04DA9C004717BC /* MapScene */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -335,6 +366,7 @@
FC7E457B2AFF6F9D004F155A /* Scenes */ = {
isa = PBXGroup;
children = (
835A61962B0680FC002F22A5 /* Playback */,
1945520E2B03AEA400299768 /* Configurator.swift */,
FC2511A72B04DA9C004717BC /* MapScene */,
FCEE0FFB2B03AFAA00195BBE /* SingUpScene */,
Expand All @@ -354,6 +386,9 @@
FCEE0FF12B036B6000195BBE /* LOButton.swift */,
FCEE0FF52B03804000195BBE /* LOTextField.swift */,
194552302B04DA1A00299768 /* LOCircleButton.swift */,
835A618F2B067D61002F22A5 /* LOSlider.swift */,
835A61912B067FEC002F22A5 /* LOTagStackView.swift */,
835A61932B068096002F22A5 /* LODescriptionView.swift */,
);
path = DesignSystem;
sourceTree = "<group>";
Expand Down Expand Up @@ -527,6 +562,7 @@
194551F42B037F2D00299768 /* LoginRouter.swift in Sources */,
FC4975992B03439000D8627F /* UIFont+.swift in Sources */,
194551F52B037F2D00299768 /* LoginModels.swift in Sources */,
835A619E2B068115002F22A5 /* PlaybackWorker.swift in Sources */,
FC7E458C2AFF7455004F155A /* DummyModel.swift in Sources */,
FC2511AD2B04EACD004717BC /* MapInteractor.swift in Sources */,
19C7AFD62B02584D003B35F2 /* KeychainStored.swift in Sources */,
Expand All @@ -536,19 +572,27 @@
FC68E29D2B02326A001AABFF /* Responsable.swift in Sources */,
FC2511A02B045C0A004717BC /* SignUpInteractor.swift in Sources */,
1945522A2B04883800299768 /* UIView+.swift in Sources */,
835A61A02B068115002F22A5 /* PlaybackModels.swift in Sources */,
19C7AFCE2B02410F003B35F2 /* AuthManager.swift in Sources */,
194552232B0478B400299768 /* HomeRouter.swift in Sources */,
835A61922B067FEC002F22A5 /* LOTagStackView.swift in Sources */,
FC7E45902AFF746E004F155A /* DummyWorker.swift in Sources */,
835A61A12B068115002F22A5 /* PlaybackViewController.swift in Sources */,
1945520F2B03AEA400299768 /* Configurator.swift in Sources */,
835A619F2B068115002F22A5 /* PlaybackRouter.swift in Sources */,
FC2511B12B04EAEC004717BC /* MapModels.swift in Sources */,
FC68E29F2B023315001AABFF /* HTTPMethod.swift in Sources */,
835A619D2B068115002F22A5 /* PlaybackPresenter.swift in Sources */,
FCEE0FFA2B03AF8500195BBE /* SignUpViewController.swift in Sources */,
194551F32B037F2D00299768 /* LoginWorker.swift in Sources */,
835A61902B067D61002F22A5 /* LOSlider.swift in Sources */,
FC7E45942AFF7486004F155A /* DummyDesignSystem.swift in Sources */,
194551F72B037F2D00299768 /* LoginInteractor.swift in Sources */,
FC7E453C2AFEB623004F155A /* SceneDelegate.swift in Sources */,
FC2511A92B04DAD4004717BC /* MapViewController.swift in Sources */,
FCEE0FF62B03804000195BBE /* LOTextField.swift in Sources */,
835A61A22B068115002F22A5 /* PlaybackInteractor.swift in Sources */,
835A61942B068096002F22A5 /* LODescriptionView.swift in Sources */,
FC68E2A52B0233D3001AABFF /* Provider.swift in Sources */,
FC7E45922AFF747A004F155A /* DummyScene.swift in Sources */,
194552112B03AF2B00299768 /* MainTabBarConfigurator.swift in Sources */,
Expand Down
84 changes: 84 additions & 0 deletions iOS/Layover/Layover/DesignSystem/LODescriptionView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//
// LODescriptionView.swift
// Layover
//
// Created by 황지웅 on 11/15/23.
//

import UIKit

final class LODescriptionView: UIView {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

가능하면 mark 주석 부탁드립니다~

static let descriptionWidth: CGFloat = 104
static let descriptionHeight: CGFloat = 63

// MARK: - View isTouched State

enum State {
case show
case hidden
}

// MARK: - Properties

private (set) var titleLabel: UILabel = {
let label: UILabel = UILabel()
label.numberOfLines = 1
label.font = .loFont(type: .body1)
label.textColor = .layoverWhite
label.text = "제목 테스트"
return label
}()
private (set) var descriptionLabel: UILabel = {
let label: UILabel = UILabel()
label.textColor = .layoverWhite
label.font = .loFont(type: .body2)
label.numberOfLines = 0
return label
}()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 라벨을 var로 선언하신 이유가 있을까요 ??

Copy link
Collaborator Author

@chopmozzi chopmozzi Nov 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready only로 쓰려고 private (set) var를 했는데 이렇게 쓸거면 private 풀고 let 박아두는게 나을거 같아서 수정했습니다 감사합니다.

private var descrioptionText: String = ""
var state: State = .hidden

override init(frame: CGRect) {
super.init(frame: frame)
setupConstraints()
}

required init?(coder: NSCoder) {
super.init(coder: coder)
setupConstraints()
}

// MARK: Method

private func setupConstraints() {
descriptionLabel.textColor = .layoverWhite
descriptionLabel.font = .loFont(type: .body2)
descriptionLabel.numberOfLines = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선언할 때 클로저 내부에서 처리하면 어떨까요

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선언시에 처리해주는 걸로 수정하셨으니 이부분은 이제 삭제해도 괜찮지 않을까요 !

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아차차... 감사합니다.

descriptionLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.translatesAutoresizingMaskIntoConstraints = false
self.addSubviews(descriptionLabel, titleLabel)

NSLayoutConstraint.activate([
titleLabel.leadingAnchor.constraint(equalTo: self.leadingAnchor),
titleLabel.bottomAnchor.constraint(equalTo: descriptionLabel.topAnchor),
descriptionLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor),
descriptionLabel.leadingAnchor.constraint(equalTo: self.leadingAnchor),
descriptionLabel.widthAnchor.constraint(equalTo: self.widthAnchor)
])
}

func setText(_ content: String) {
let attrString: NSMutableAttributedString = NSMutableAttributedString(string: content)
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.3
attrString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: attrString.length))
descriptionLabel.attributedText = attrString
}

func checkLabelOverflow() -> Bool {
let originViewSize: CGSize = CGSize(width: LODescriptionView.descriptionWidth, height: LODescriptionView.descriptionHeight)
let currentSize: CGSize = descriptionLabel.intrinsicContentSize
return currentSize.height > originViewSize.height || currentSize.width > originViewSize.width
}
}
36 changes: 36 additions & 0 deletions iOS/Layover/Layover/DesignSystem/LOSlider.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// LOSlider.swift
// Layover
//
// Created by 황지웅 on 11/15/23.
//

import UIKit

final class LOSlider: UISlider {
private let normalThumbImage: String = "LONormalThumb"
private let selectedThumbImage: String = "LOSelectedThumb"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이미지 말고 깎아서 쓰는거 어때요... ㅎㅎㅎㅎ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UISlider에 thumb는 UIImage로 밖에 못 넣는거 같아서.. 좀 더 확인해보겠습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resource loader 사용하시면 될 듯 해서 없어도 될 코드 인 것 같습니다.
아래에 후술할게요


override init(frame: CGRect) {
super.init(frame: frame)
self.minimumTrackTintColor = .primaryPurple
setThumbImage(UIImage(named: normalThumbImage), for: .normal)
self.minimumValue = 1
self.maximumValue = 100
self.value = 50

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수로 감싸주세요....
minimumValue, maximumValue는 여기서 설정해줘도 될까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일단 레이아웃 뷰 배치만 하려고 임시로 설정했습니다.

}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 연쇄살인마를 위해 fatalError외에 구현해주세요...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오마오마갓


override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool {
setThumbImage(UIImage(named: selectedThumbImage), for: .normal)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setThumbImage(UIImage.selectedThumbImage, for: .normal

return true
}

override func endTracking(_ touch: UITouch?, with event: UIEvent?) {
setThumbImage(UIImage(named: normalThumbImage), for: .normal)
}
}
51 changes: 51 additions & 0 deletions iOS/Layover/Layover/DesignSystem/LOTagStackView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// LOTagStackView.swift
// Layover
//
// Created by 황지웅 on 11/16/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import UIKit
final class LOTagStackView: UIStackView {
lazy var tagButton1: UIButton = setButton("#테스트1")
lazy var tagButton2: UIButton = setButton("#테스트2")
lazy var tagButton3: UIButton = setButton("#테스트3")

override init(frame: CGRect) {
super.init(frame: frame)
setUpConstraints()
}

required init(coder: NSCoder) {
super.init(coder: coder)
setUpConstraints()
}

private func setUpConstraints() {
[tagButton1, tagButton2, tagButton3].forEach { tagButton in
self.addArrangedSubview(tagButton)
}
self.alignment = .fill
self.distribution = .fillProportionally
self.axis = .horizontal
self.spacing = 8
}

private func setButton(_ content: String) -> UIButton {
let button: UIButton = UIButton()
var config = UIButton.Configuration.plain()
config.titleTextAttributesTransformer = UIConfigurationTextAttributesTransformer { incoming in
var outgoing = incoming
outgoing.font = UIFont.loFont(type: .body2Bold)
return outgoing
}
Comment on lines +38 to +43
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

button.backgroundColor = UIColor.primaryPurple
button.setTitleColor(UIColor.layoverWhite, for: .normal)
button.setTitle(content, for: .normal)
button.configuration = config
button.configuration?.contentInsets = NSDirectionalEdgeInsets(top: 5.0, leading: 8.0, bottom: 5.0, trailing: 8.0)
button.layer.cornerRadius = 12
return button
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Ellipse 46.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Ellipse 47.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Ellipse 48.png",
"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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "big.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "big 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "big 2.png",
"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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading