-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Feature] 베지어 스위치 구현 #85
[Feature] 베지어 스위치 구현 #85
Conversation
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.
작업 감사합니다!
let label: String | ||
let isOn: Binding<Bool> |
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.
let label: String | |
let isOn: Binding<Bool> | |
private let label: String | |
private let isOn: Binding<Bool> |
} | ||
|
||
public var body: some View { | ||
HStack(alignment: .top) { |
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.
spacing이 빠져있어요. SwiftUI HStack에 spacing 값이 없으면 12정도 값이 들어가더라구요
HStack(alignment: .top) { | ||
Text(self.label) | ||
.applyBezierFontStyle(.caption1Regular, bezierColor: .fgBlackDarkest) | ||
.frame(minHeight: 40) |
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.
Metric 에 추가해서 써야될 것 같아요
} | ||
.animation(.easeInOut(duration: 0.3), value: self.isOn) | ||
.padding(2) | ||
.compositingGroup() |
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.
.compositingGroup() | |
.applyDisabledStyle() |
Disable을 고려해서 요 모디파이어를 써주시면 좋을 것 같아요
import SwiftUI | ||
|
||
public struct BezierSwitchControl: View { | ||
@Binding public var isOn: Bool |
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.
@Binding public var isOn: Bool | |
@Binding private var isOn: Bool |
|
||
public var body: some View { | ||
ZStack(alignment: self.alignment) { | ||
RoundedRectangle(cornerRadius: 100.0, style: .circular) |
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.
Capsule을 쓰면 좋을 것 같아요.
기본적인 베지어 스위치를 구현합니다