Skip to content

Add support for LocalizedStringResource#3

Open
yidev0 wants to merge 1 commit into
vistar941:mainfrom
yidev0:main
Open

Add support for LocalizedStringResource#3
yidev0 wants to merge 1 commit into
vistar941:mainfrom
yidev0:main

Conversation

@yidev0

@yidev0 yidev0 commented Jun 7, 2026

Copy link
Copy Markdown
  • Add support for LocalizedStringResource as input for scrollAwareTitle
// Example Code
NavigationStack{
    ScrollView { }
        .scrollAwareTitle(LocalizedStringResource("Title", table: "Settings"))
}

Text(title)
}
}
public func scrollAwareTitle(_ title: LocalizedStringResource) -> some View {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
public func scrollAwareTitle(_ title: LocalizedStringResource) -> some View {
@_disfavoredOverload public func scrollAwareTitle(_ title: LocalizedStringResource) -> some View {

}

extension View {
public func scrollAwareTitle<S: StringProtocol>(_ title: S) -> some View {

@vistar941 vistar941 Jun 11, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Also, if possible, I’d appreciate it if you could add @_disfavoredOverload to public func scrollAwareTitle<S: StringProtocol>(_ title: S) as well.

@vistar941

vistar941 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

@yidev0
Thank you for the great PR!

Since we now have more String-related APIs with the same name, I think we should add @_disfavoredOverload to the APIs other than LocalizedStringKey.

The fact that it wasn’t added before was my mistake…

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.

2 participants