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

merge :: 디자인 시스템 - RadioButton #31

Merged
merged 10 commits into from
Oct 9, 2022

Conversation

sian7563
Copy link
Member

개요

RadioButton 구현

사용방법

DMSRadioButton(
            isOn: .constant(false),
            isDisabled: .constant(false),
            id: "asdf",
            callback: { _ in }
        )

public struct DMSRadioButton: View {

@Binding var isOn: Bool
@Binding var isDisabeld: Bool
Copy link
Member

Choose a reason for hiding this comment

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

disabled를 binding으로 받는 특별한 이유가 있을까요?

Copy link
Member

@baekteun baekteun Oct 8, 2022

Choose a reason for hiding this comment

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

@Environment(.isEnabled)로 isEnabled상태를 받을 수 있으니 이거 쓰시는게 어떤가요

@team-aliens team-aliens deleted a comment from limsaehyun Oct 6, 2022
@team-aliens team-aliens deleted a comment from limsaehyun Oct 6, 2022
@sian7563 sian7563 changed the title 🔀 :: 디자인 시스템 - RadioButton merge :: 디자인 시스템 - RadioButton Oct 8, 2022
Circle()
.fill(Color.PrimaryVariant.primary)
.frame(width: 10, height: 10)
}.disabled(isEnabled)
Copy link
Member

Choose a reason for hiding this comment

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

disabled여기에 안붙이여도 실제 사용할 때

DMSRadioButton(isOn: $isOn)
.disabled(true)

이런식으로 써서 사용되니 빼주셔도 될거같아요

Suggested change
}.disabled(isEnabled)
}

Comment on lines 18 to 27
Circle()
.fill(Color.PrimaryVariant.primary)
.frame(width: 20, height: 20)
.clipShape(Circle())
Circle()
.fill(Color.white)
.frame(width: 15, height: 15)
Circle()
.fill(Color.PrimaryVariant.primary)
.frame(width: 10, height: 10)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Circle()
.fill(Color.PrimaryVariant.primary)
.frame(width: 20, height: 20)
.clipShape(Circle())
Circle()
.fill(Color.white)
.frame(width: 15, height: 15)
Circle()
.fill(Color.PrimaryVariant.primary)
.frame(width: 10, height: 10)
Circle()
.fill(Color.PrimaryVariant.primary)
.frame(width: 20, height: 20)
Circle()
.fill(Color.white)
.frame(width: 15, height: 15)
Circle()
.fill(Color.PrimaryVariant.primary)
.frame(width: 10, height: 10)

Apple Tutorial 식의 코드 공백 View 사이사이에 공백 주시면 됩니다. ViewBuilder Closure위 아래에는 공백 안주는 식입니다

@sian7563 sian7563 merged commit 4d8ea44 into develop Oct 9, 2022
@sian7563 sian7563 deleted the feat/29_design-system-RadioButton branch October 9, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants