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

How can I pass an object as an input to a method? #43

Open
karaggeorge opened this issue Oct 24, 2024 · 0 comments
Open

How can I pass an object as an input to a method? #43

karaggeorge opened this issue Oct 24, 2024 · 0 comments

Comments

@karaggeorge
Copy link

Thank you so much for this project! It's been amazing so far. I'm reading through old issues and learning how to use all the different patterns. This is something I haven't found an example for yet:

I have a struct like:

struct Options {
	let destination: String
	let framesPerSecond: Int
	let cropRect: CGRect?
}

I'd like to expose a function that can take an object from js as input that has this shape, and then somehow type-cast it in Swift to use it as the struct

So I could for example do options.destination

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

1 participant