pointfreeco / composable-core-location Goto Github PK
View Code? Open in Web Editor NEWA library that bridges the Composable Architecture and Core Location.
License: MIT License
A library that bridges the Composable Architecture and Core Location.
License: MIT License
Description
Hey guys,
first of all, I would like to thank you both for making such a great library. Working with it is a lot of fun! ๐ฅ
I believe, however, that I've found a memory leak when composable architecture is combined with the composable core location dependency in a very specific way. I've prepared a mini demo for you and I would really appreciate it if you'll have time to check it out. It is available here.
To Reproduce
Simulator -> Features -> Location -> City Run
CLLocation
objects are leaking (image attached)After investigating, I've found out that if I don't combine reducerA
into the "main" appReducer
, location objects stop leaking. I.e. using just one pulled back child reducer with a core location dependency inside of .combined
block works fine. But as soon as you add another "scoped" reducer, the issue reappears. You can reproduce this "fix" by commenting out the following code.
// MARK: - App Reducer
let appReducer = Reducer<AppState, AppAction, AppEnvironment>.combine(
/*
* Comment out the following reducer
*/
reducerA
.pullback(
state: \.stateA,
action: /AppAction.actionA,
environment: { $0 }
),
reducerB
.pullback(
state: \.stateB,
action: /AppAction.actionB,
environment: { $0 }
)
)
The other strange thing that it seems like it also helps is if you remove the map function from the didUpdateLocations
method in the core location dependency and only use the last location.
Change from:
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
subscriber.send(.didUpdateLocations(locations.map(Location.init(rawValue:))))
}
to:
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
subscriber.send(.didUpdateLocations(Location.init(rawValue: locations.last!)))
}
Expected behavior
CLLocation
objects should not leak.
Environment
Thanks for your help in advance. I hope that I am not wasting your time by misusing the library ๐
Enclosing extension in #if DEBUG
#endif
will solve it.
Describe the bug
Failed to resolve dependencies Dependencies could not be resolved because root depends on 'swift-composable-architecture' 1.2.0.
'swift-composable-architecture' 0.43.0..<1.0.0 is required because 'composable-core-location' 0.3.0 depends on 'swift-composable-architecture' 0.43.0..<1.0.0 and root depends on 'composable-core-location' 0.3.0.
To Reproduce
install TCA version 1.2.0 and Composable core location 0.3.0
It's been great to have .failing
becoming available after recent modernisation, which naturally leads to implementing a .noop
version of the dependency too, but it isn't possible currently. Was there a reason for keeping init
internal?
TCA 0.57.0 is a breaking change for the composable-core-location. Do you have any plans to support this repository?
Describe the bug
In projects that depend on both TCA and CCL Xcode raises the following warning during SPM package resolution:
'composable-core-location' dependency on 'https://github.com/pointfreeco/swift-composable-architecture' conflicts with dependency on 'https://github.com/pointfreeco/swift-composable-architecture' which has the same identity 'swift-composable-architecture'. this will be escalated to an error in future versions of SwiftPM.
To Reproduce
Expected behavior
No warning during SPM package resolution.
Environment
13.3 (13E113)
5.6
I am currently building an app in TCA to keep my chops fresh on the latest in Apple Platforms development. The app needs to hook into CoreLocation, and hence I found this repository. But just from searching, it appears that this library has not been updated to support newer versions of TCA (updated concurrency, reducer protocol, etc).
Are there plans to update this library? Or can anyone direct me to an example of implementing the delegation pattern of CoreLocation (and many other Apple APIs) within newer versions of TCA? The closest example I could find was in the audio recorder case study.
The Composable Architecture uses GitHub issues for bugs. For more general discussion and help, please use the Swift forum first.
Looks like there has been quite some progress since the 0.1.0 release to warrant a new release.
i dont understand why its always crashing i am using main branch
// And/or enter code that reproduces the behavior here.
https://gist.github.com/saroar/abdb5ec787246d150e66be1a4cb7d03b
Expected behavior
Give a clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional context
Add any more context about the problem here.
Describe the bug
I don't know what is the problem I just know the issue and send a small video clip also click any point of interest button that does not work
I run your demo app and it takes too much time to my iPhone 6s
take too much time to update the current location
Expected behavior
it should take not more than 1/2s or less
Screenshots
Environment
Additional context
Add any more context about the problem here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.