Skip to content

Conversation

@cyberman0306
Copy link

폰트변경을 enum으로 받고
userdefault로 저장, 본문 폰트로 사용합니다

@cyberman0306 cyberman0306 added the enhancement New feature or request label May 17, 2023
@cyberman0306 cyberman0306 requested a review from Roy-wonji May 17, 2023 10:44
@cyberman0306 cyberman0306 self-assigned this May 17, 2023
Copy link
Owner

@Roy-wonji Roy-wonji left a 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 {
Copy link
Owner

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 {
Copy link
Owner

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 {
Copy link
Owner

Choose a reason for hiding this comment

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

@cyberman0306 여기에서 왜 didSet을 사용 했나요 ?? 왜 사용한지 이유를 알수 있을까요 ???/

}
}

init() {
Copy link
Owner

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 {
Copy link
Owner

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 {
Copy link
Owner

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
Copy link
Owner

Choose a reason for hiding this comment

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

@cyberman0306 여기에서 왜 EnvironmentObject을 사용하셨나요 ?? 그러면 EnvironmentObject 역활에 대해서 설명부탁드려도 될까요 ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants