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

Feature Request: A section in usage.md on how to enable Xcode Previews #1450

Open
brentleyjones opened this issue Nov 16, 2022 · 3 comments
Open
Assignees
Labels
documentation Improvements or additions to documentation feature request New feature or request

Comments

@brentleyjones
Copy link
Contributor

This is the top search in our repo, and it's not always clear how to enable previews for swift_library targets.

@brentleyjones brentleyjones added the feature request New feature or request label Nov 16, 2022
@brentleyjones brentleyjones self-assigned this Jan 3, 2023
@joprice
Copy link

joprice commented Dec 19, 2023

I've gone through some of the issues referencing this and checked out the "integration" example but can't seem to figure out how to get this to work. In lieu of a longer doc, could you write a few sentences here on the recommended approach? I've tried wrapping swift_library's in ios_framework, but I get linker errors and can't seem to find a setup that pleases xcode.

@thiagohmcruz
Copy link
Contributor

thiagohmcruz commented Dec 27, 2023

Checked examples/integration in the latest main (28931c024335ac5d90b9fb4ddebf0fbce42eed9c) and it's indeed broken during linking (LibFramework.iOS not found via rpath). I was trying to run the preview from this source: https://github.com/MobileNativeFoundation/rules_xcodeproj/blob/28931c024335ac5d90b9fb4ddebf0fbce42eed9c/examples/integration/UI/ContentView.swift.

Noticed that if I stop un-focusing that target the preview works as expected though.

The above is for examples/integration, so non-rules_ios. Specifically for rules_ios users one option is to flip link_dynamic like I described here: #2612 (comment)

If you could verify if the above for examples/integration also works for you @joprice that would be great. Happy to add a blurb in usage.md (for both use cases) once we're able to root cause the issue above.

@joprice
Copy link

joprice commented Jan 29, 2024

@thiagohmcruz I haven't had time to test this, but just found that the new incremental generation might fix my issue #1384. I'm testing that now, so this workaround might not apply for my case after that.

@brentleyjones brentleyjones changed the title Feature Request: Add a section to usage.md on how to enable SwiftUI Previews Feature Request: Add a section to usage.md on how to enable Xcode Previews Mar 20, 2024
@brentleyjones brentleyjones added the documentation Improvements or additions to documentation label Mar 20, 2024
@brentleyjones brentleyjones changed the title Feature Request: Add a section to usage.md on how to enable Xcode Previews Feature Request: A section in usage.md on how to enable Xcode Previews Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants