Skip to content

Commit 0bd288a

Browse files
authored
Add location manager examples to readmes. (#114)
* Update readmes * wip * remove some old code
1 parent fbd5874 commit 0bd288a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Examples/CaseStudies/SwiftUICaseStudies/04-HigherOrderReducers-ResuableOfflineDownloads/DownloadComponent.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ extension Reducer {
130130
case .downloadClient(.success(.response)):
131131
state.mode = .downloaded
132132
state.alert = nil
133-
return .cancel(id: ThrottleId(id: state.id))
133+
return .none
134134

135135
case let .downloadClient(.success(.updateProgress(progress))):
136136
state.mode = .downloading(progress: progress)
@@ -139,7 +139,7 @@ extension Reducer {
139139
case .downloadClient(.failure):
140140
state.mode = .notDownloaded
141141
state.alert = nil
142-
return .cancel(id: ThrottleId(id: state.id))
142+
return .none
143143
}
144144
}
145145
.pullback(state: state, action: action, environment: environment),
@@ -148,10 +148,6 @@ extension Reducer {
148148
}
149149
}
150150

151-
private struct ThrottleId<ID>: Hashable where ID: Hashable {
152-
var id: ID
153-
}
154-
155151
private let deleteAlert = DownloadAlert(
156152
primaryButton: .init(
157153
action: .alert(.deleteButtonTapped),

Examples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ This directory holds many case studies and applications to demonstrate solving v
55
* **Case Studies**
66
<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.
77

8+
* **Location Manager**
9+
<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`.
10+
811
* **Motion Manager**
912
<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.
1013

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ This repo comes with _lots_ of examples to demonstrate how to solve common and c
4848
* Navigation
4949
* Higher-order reducers
5050
* Reusable components
51+
* [Location manager](./Examples/LocationManager)
5152
* [Motion manager](./Examples/MotionManager)
5253
* [Search](./Examples/Search)
5354
* [Speech Recognition](./Examples/SpeechRecognition)

0 commit comments

Comments
 (0)