pointfreeco / composable-core-location

A library that bridges the Composable Architecture and Core Location.
MIT License
107 stars 56 forks source link

Region monitoring #3

Closed nizarjak closed 2 years ago

nizarjak commented 3 years ago

Implementing missing bridge for LocationManager to support region monitoring.

We can discuss unwrapping optionals and default values.

stephencelis commented 3 years ago

@nizarjak Thanks for the PR and sorry for sitting on it so long. We looked into this a bit and think maybe the current API choices we made are not quite right, particularly the Region data type doesn't account for CLRegion subclasses. Unfortunately we think we need to do more work to figure out a fix for that, but we're not quite sure when we'll have time to properly address.

nizarjak commented 2 years ago

Sorry for holding my response even longer 🙈

Not sure if I can help fixing the issue you mentioned - maybe with some guidance. How would you know which types those are as the regions survive app reset? You could try registering your own classes and try casting them. Not sure if it should happen in the library or in the client's code. Persisting it somewhere wouldn't work as they can be registered other way than using this library.

Although I think it's not possible to use region monitoring right now as those methods/closure are not implemented in live version. Wouldn't it be sufficient for the initial version? 👼 Currently we're using my fork in production only due to that and I'd be more than happy to remove it :)

nizarjak commented 2 years ago

Ah, I see you have it already included in the library 🔝. Closing this PR as it's no longer needed.