Skip to content
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

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

AllenCao001
Copy link
Contributor

No description provided.

…to SwiftUI can't be resized and empty text disable accessibility.
@AllenCao001 AllenCao001 requested a review from a team as a code owner April 20, 2022 07:51
@AllenCao001 AllenCao001 requested review from billzhou0223 and removed request for a team April 20, 2022 07:51
@cla-assistant
Copy link

cla-assistant bot commented Apr 20, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@billzhou0223 billzhou0223 left a 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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@AllenCao001
Copy link
Contributor Author

When it can be merged into the main branch? Whether this pull request has any question? Because I need to fix the issue-2043.

@billzhou0223 billzhou0223 merged commit 530f3d1 into SAP:main Apr 25, 2022
@AllenCao001 AllenCao001 deleted the fix-2043 branch April 26, 2022 03:35
AllenCao001 added a commit to AllenCao001/cloud-sdk-ios-fiori that referenced this pull request Apr 27, 2022
…to SwiftUI can't be resized and empty text disable accessibility. (SAP#418)

Co-authored-by: Bill Zhou <bill.zhou01@sap.com>
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