Skip to content

Conversation

@joshuakcockrell
Copy link

@joshuakcockrell joshuakcockrell commented Apr 23, 2025

This adds an example to the FocusStatePlayground that shows how @FocusState.Binding can be replaced with a normal @Binding so that @FocusState variables can be passed to child views.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

@cla-bot
Copy link

cla-bot bot commented Apr 23, 2025

Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @joshuakcockrell on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file

@joshuakcockrell
Copy link
Author

I tried to run swift test but it just says error: no tests found; create a target in the 'Tests' directory?

There's not really anything that would impact tests here though so idk what's happening.

@marcprux
Copy link
Member

I tried to run swift test but it just says error: no tests found; create a target in the 'Tests' directory?

The Showcase app doesn't have a test module. Test cases are typically part of framework projects and app projects often remove them, so you don't need to worry about them.

Comment on lines +44 to +48
#if !SKIP
@FocusState.Binding var focusedField: FocusField?
#else
@Binding var focusedField: FocusField?
#endif
Copy link
Member

Choose a reason for hiding this comment

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

@aabewhite Do you think we could just typealias FocusState.Binding to Binding in SkipUI? I'm unclear on why FocusState.Binding exists at all.

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