-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix: [HCPSDKFIORIUIKIT-2043] resolve UIFont instance from Swift pass to SwiftUI can't be resized and empty text disable accessibility. #418
Conversation
…to SwiftUI can't be resized and empty text disable accessibility.
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.
@shengxu7 Please comment
@@ -143,7 +143,13 @@ class LayoutData { | |||
let title = item.text | |||
var uifont: UIFont | |||
if let tmpUIFont = item.uifont { | |||
uifont = tmpUIFont | |||
// `item.uifont` is passed by developer, although is a preferred font but can't resize according to system in SwiftUI. So need to redefine the UIFont instance. | |||
if let styleName = tmpUIFont.fontDescriptor.fontAttributes[.textStyle] as? String { |
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.
In order for the text to be resizable, developes are responsible for passing in a scaled font. We, as SDK, are not supposed to force this conversion.
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.
At now, the issue is developers had init a UIFont
instance via UIFont.preferredFont()
in SDK and passed it to SwiftUI, but the text doesn't be resizable in SwiftUI. In order to fix the issue, so need to redefine UIFont
in SwiftUI, it is as the above code.
When it can be merged into the main branch? Whether this pull request has any question? Because I need to fix the issue-2043. |
…to SwiftUI can't be resized and empty text disable accessibility. (SAP#418) Co-authored-by: Bill Zhou <bill.zhou01@sap.com>
No description provided.