Skip to content

Silence Font Registration Warning #308

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

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Silence Font Registration Warning #308

merged 1 commit into from
Dec 2, 2024

Conversation

KunJeongPark
Copy link
Collaborator

Summary of changes

  • Move configure function with PayPal font registration to init function to silence failure to register
    already registered font
  • Modify extension to UIFont to return on already registered font

Checklist

  • Added a changelog entry

Authors

List GitHub usernames for everyone who contributed to this pull request.

@KunJeongPark KunJeongPark requested a review from a team as a code owner December 2, 2024 15:17
guard UIFont(name: name, size: 10.0) == nil else {
return
}

Copy link
Collaborator Author

@KunJeongPark KunJeongPark Dec 2, 2024

Choose a reason for hiding this comment

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

If there is failure to instantiate this font, it most likely means the font is not registered, so it goes through with registering this font, otherwise it returns without registering.

Copy link
Contributor

@GMALKHA GMALKHA Dec 2, 2024

Choose a reason for hiding this comment

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

I was thinking if it would make sense to call it from the AppDelegate, so the registration logic is available globally throughout the app. This way i think we wouldn’t need to register it again in individual views later.
Just thinking out loud :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this font is used only in a few specific views, so it makes sense to initialize it only in the PaymentButtonFont.

@KunJeongPark KunJeongPark merged commit 0525444 into main Dec 2, 2024
7 checks passed
@KunJeongPark KunJeongPark deleted the button-warning branch December 2, 2024 19:06
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