Skip to content

Commit

Permalink
Add location manager examples to readmes. (pointfreeco#114)
Browse files Browse the repository at this point in the history
* Update readmes

* wip

* remove some old code
  • Loading branch information
mbrandonw authored May 19, 2020
1 parent fbd5874 commit 0bd288a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ extension Reducer {
case .downloadClient(.success(.response)):
state.mode = .downloaded
state.alert = nil
return .cancel(id: ThrottleId(id: state.id))
return .none

case let .downloadClient(.success(.updateProgress(progress))):
state.mode = .downloading(progress: progress)
Expand All @@ -139,7 +139,7 @@ extension Reducer {
case .downloadClient(.failure):
state.mode = .notDownloaded
state.alert = nil
return .cancel(id: ThrottleId(id: state.id))
return .none
}
}
.pullback(state: state, action: action, environment: environment),
Expand All @@ -148,10 +148,6 @@ extension Reducer {
}
}

private struct ThrottleId<ID>: Hashable where ID: Hashable {
var id: ID
}

private let deleteAlert = DownloadAlert(
primaryButton: .init(
action: .alert(.deleteButtonTapped),
Expand Down
3 changes: 3 additions & 0 deletions Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ This directory holds many case studies and applications to demonstrate solving v
* **Case Studies**
<br> Demonstrates how to solve some common application problems in an isolated environment, in both SwiftUI and UIKit. Things like bindings, navigation, effects, and reusable components.

* **Location Manager**
<br> This application uses Apple's CoreLocation and MapKit frameworks to allow the user to search for points of interest on a map. It also includes the ability to center the map on your current location, as well as a full test suite for how the app interacts with `CLLocationManager` and `MKLocalSearch`.

* **Motion Manager**
<br> This application uses Apple's CoreMotion framework to show a graph of device movements. It's a demonstration of how to wrap complex dependencies in the `Effect` type so that you can interact with them in the reducer _and_ write tests for its logic.

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ This repo comes with _lots_ of examples to demonstrate how to solve common and c
* Navigation
* Higher-order reducers
* Reusable components
* [Location manager](./Examples/LocationManager)
* [Motion manager](./Examples/MotionManager)
* [Search](./Examples/Search)
* [Speech Recognition](./Examples/SpeechRecognition)
Expand Down

0 comments on commit 0bd288a

Please sign in to comment.