-
Notifications
You must be signed in to change notification settings - Fork 2
✨[feat]: 폰트 변경 추가, userdefault 사용 #7
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
base: Dev
Are you sure you want to change the base?
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.
@cyberman0306 안녕하세요 현준님 ㅎㅎㅎㅎ
pr 잘보았습니다 처음 현준님 코드를 보는데 깔끔하고 이해하기 편한거 같습니다 !!
전반적으로 잘하셨는데 몇가지 궁금 한 사항이 있어서 질문을 드립니다
제가 몇가지 질문을 드리겠습니다 혹시 커스텀 폰트를 왜 userdefault를 사용하셨나요 ???
하셨으면 그이유를 알수 있을까요 ??
두번째 왜 커스텀 폰트를 class로 만들었나요 ???
만드셨으면 그 이유를 알수 있을까요 ???
마직막으로 잘하셨습니다
커스텀 폰트에대해서 자료 공유 해드립니다
참고 만 하시고 이렇게 만 하면 된다고 생각 하시면 됩니다 이런 방식이 있다고 생각을 하면 됩니다 !
저는 이런식으로 커스텀 폰트 를 사용을 합니다
수정하면서 궁금하시거나 모르는거 있으면 디코 주세요 !!
참고하실만한 래퍼런스
| static let subFont: String = "나눔손글씨 맛있는체" | ||
| } | ||
|
|
||
| enum FontType: String, CaseIterable { |
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.
@cyberman0306 안녕하세요 현준님
현준님이 하신 방법도 있는데 CustomStringConvertible을 사용하는 방법은 어떤가요 ??
| case subFont = "나눔손글씨 맛있는체" | ||
| } | ||
|
|
||
| class FontSettings: ObservableObject { |
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.
@cyberman0306 여기에는 왜 class 로 사용 했나용 ??
커스텀 폰트할때 viewModifier 를 사용하는 건 어떨가요
|
|
||
| class FontSettings: ObservableObject { | ||
| @Published var selectedFont: FontType { | ||
| didSet { |
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.
@cyberman0306 여기에서 왜 didSet을 사용 했나요 ?? 왜 사용한지 이유를 알수 있을까요 ???/
| } | ||
| } | ||
|
|
||
| init() { |
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.
@cyberman0306 여기에서 init이 필요했을까요 ?? 필요했다면 이유를 알고 싶어요!!
| } | ||
|
|
||
| @ViewBuilder | ||
| func settingView() -> some View { |
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.
@cyberman0306 여기에서 viewbuilder 사용 하는거 좋아요 !!
| EditButton() | ||
| .foregroundColor(ColorAsset.mainViewColor) | ||
| // MARK: Setting Button | ||
| NavigationLink { |
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.
@cyberman0306 여기에서 settingView는 무슨 역활을 하나요 ??
| // MARK: Edit Button Context | ||
| @Environment(\.editMode) var editButton | ||
| // MARK: Font Select | ||
| @EnvironmentObject var fontSettings: FontSettings |
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.
@cyberman0306 여기에서 왜 EnvironmentObject을 사용하셨나요 ?? 그러면 EnvironmentObject 역활에 대해서 설명부탁드려도 될까요 ??
폰트변경을 enum으로 받고
userdefault로 저장, 본문 폰트로 사용합니다