-
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
[#255] YDSLabel SwiftUI로 리팩토링 #261
Changes from all commits
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// | ||
// IntOptionView.swift | ||
// OptionalIntOptionView.swift | ||
// YDS-Storybook | ||
// | ||
// Created by 정지혁 on 2023/08/19. | ||
// Created by 박지윤 on 1/16/24. | ||
// | ||
|
||
import SwiftUI | ||
import YDS_SwiftUI | ||
|
||
struct IntOptionView: View { | ||
struct OptionalIntOptionView: View { | ||
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. 나중에 optional값이 아닌 Int를 받는 경우가 생길 수도 있으니 기존 IntOptionView는 놔두고 새로 추가하는 것은 어떤가요? 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. 굿굿굿 |
||
private enum Dimension { | ||
enum Spacing { | ||
static let vstack: CGFloat = 8 | ||
|
@@ -24,11 +24,11 @@ struct IntOptionView: View { | |
} | ||
} | ||
|
||
@Binding private var value: Int | ||
@Binding private var value: Int? | ||
|
||
private let description: String? | ||
|
||
init(description: String?, value: Binding<Int>) { | ||
init(description: String?, value: Binding<Int?>) { | ||
self.description = description | ||
self._value = value | ||
} | ||
|
@@ -40,7 +40,7 @@ struct IntOptionView: View { | |
Text(description) | ||
.font(YDSFont.subtitle2) | ||
} | ||
Text("Int") | ||
Text("Optional<Int>") | ||
.font(YDSFont.body2) | ||
} | ||
|
||
|
@@ -56,8 +56,8 @@ struct IntOptionView: View { | |
} | ||
} | ||
|
||
struct IntOptionView_Previews: PreviewProvider { | ||
struct OptionalIntOptionView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
IntOptionView(description: "numberOfLines", value: .constant(1)) | ||
OptionalIntOptionView(description: "lineLimit", value: .constant(1)) | ||
} | ||
} |
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.
VStack은 없어도 될 것 같아요
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.
없애면 string 숨기기 했을 때 텍스트를 담은 뷰가 아예 사라집니다
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.
그렇군요~