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

auto-registered views? #1495

Open
bcardarella opened this issue Dec 12, 2024 · 3 comments
Open

auto-registered views? #1495

bcardarella opened this issue Dec 12, 2024 · 3 comments
Milestone

Comments

@bcardarella
Copy link
Collaborator

it would be nice if we could have custom views be auto-registered within a project. For example, if a Views/ folder was added then at compile-time if a MyButton.swift was in there as MyButton view it would register it to be used automatically for LVN.

@carson-katri
Copy link
Contributor

I wonder if we could add a macro to register a View/ViewModifier with a specific addon that applies to the View.

@Register(for: .myCustomAddon)
@LiveElement
struct MyCustomView: View {
  // ...
}

@carson-katri
Copy link
Contributor

Or we can add a build plugin that scans the project for eligible Views.

@carson-katri
Copy link
Contributor

We could also add an automatic addon for each app, so you don't have to worry about creating the addon, just tag your Views with the right macros, and any #LiveView in the project would have access to them.

@bcardarella bcardarella added this to the 0.5.0 milestone Feb 27, 2025
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

No branches or pull requests

2 participants