@@ -67,18 +67,11 @@ class TunnelViewController: UIViewController, RootContainment {
67
67
)
68
68
69
69
connectionView = ConnectionView (
70
- connectionViewModel: self . connectionViewViewModel,
71
- indicatorsViewModel: self . indicatorsViewViewModel
70
+ connectionViewModel: connectionViewViewModel,
71
+ indicatorsViewModel: indicatorsViewViewModel
72
72
)
73
73
74
74
super. init ( nibName: nil , bundle: nil )
75
-
76
- // When content size is updated in SwiftUI we need to explicitly tell UIKit to
77
- // update its view size. This is not necessary on iOS 16 where we can set
78
- // hostingController.sizingOptions instead.
79
- connectionView. onContentUpdate = { [ weak self] in
80
- self ? . connectionController? . view. setNeedsUpdateConstraints ( )
81
- }
82
75
}
83
76
84
77
required init ? ( coder: NSCoder ) {
@@ -168,20 +161,16 @@ class TunnelViewController: UIViewController, RootContainment {
168
161
case let . connecting( tunnelRelays, _, _) :
169
162
mapViewController. removeLocationMarker ( )
170
163
mapViewController. setCenter ( tunnelRelays? . exit. location. geoCoordinate, animated: animated)
171
- connectionViewViewModel. showsActivityIndicator = true
172
164
activityIndicator. startAnimating ( )
173
165
174
166
case let . reconnecting( tunnelRelays, _, _) , let . negotiatingEphemeralPeer( tunnelRelays, _, _, _) :
175
167
activityIndicator. startAnimating ( )
176
168
mapViewController. removeLocationMarker ( )
177
169
mapViewController. setCenter ( tunnelRelays. exit. location. geoCoordinate, animated: animated)
178
- connectionViewViewModel. showsActivityIndicator = true
179
170
180
171
case let . connected( tunnelRelays, _, _) :
181
172
let center = tunnelRelays. exit. location. geoCoordinate
182
173
mapViewController. setCenter ( center, animated: animated) {
183
- self . connectionViewViewModel. showsActivityIndicator = false
184
-
185
174
// Connection can change during animation, so make sure we're still connected before adding marker.
186
175
if case . connected = self . tunnelState {
187
176
self . mapViewController. addLocationMarker ( coordinate: center)
@@ -192,18 +181,15 @@ class TunnelViewController: UIViewController, RootContainment {
192
181
case . pendingReconnect:
193
182
activityIndicator. startAnimating ( )
194
183
mapViewController. removeLocationMarker ( )
195
- connectionViewViewModel. showsActivityIndicator = true
196
184
197
185
case . waitingForConnectivity, . error:
198
186
activityIndicator. stopAnimating ( )
199
187
mapViewController. removeLocationMarker ( )
200
- connectionViewViewModel. showsActivityIndicator = false
201
188
202
189
case . disconnected, . disconnecting:
203
190
activityIndicator. stopAnimating ( )
204
191
mapViewController. removeLocationMarker ( )
205
192
mapViewController. setCenter ( nil , animated: animated)
206
- connectionViewViewModel. showsActivityIndicator = false
207
193
}
208
194
}
209
195
0 commit comments