Skip to content

Commit

Permalink
Reorder completion call
Browse files Browse the repository at this point in the history
  • Loading branch information
nishant-karajgikar committed Apr 23, 2021
1 parent b934bf9 commit 1cba9c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Sources/MapboxMaps/Foundation/BaseMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ open class BaseMapView: UIView {
object: nil)

if let validStyleURI = styleURI {
mapboxMap.__map.setStyleURIForUri(validStyleURI.path)
mapboxMap.__map.setStyleURIForUri(validStyleURI.absoluteString)
}
}

Expand Down
9 changes: 3 additions & 6 deletions Sources/MapboxMaps/Foundation/Camera/CameraManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ public class CameraManager {

// Add completion
cameraAnimator.addCompletion({ [weak self] (position) in
completion?(position)
self?.internalAnimator = nil
completion?(position)
})

// Start animation
Expand Down Expand Up @@ -235,8 +235,8 @@ public class CameraManager {
// Nil out the internalAnimator after `flyTo` finishes
flyToAnimator.addCompletion { [weak self](position) in
// Call the developer-provided completion (if present)
completion?(position)
self?.internalAnimator = nil
completion?(position)
}

flyToAnimator.startAnimation()
Expand Down Expand Up @@ -268,12 +268,9 @@ public class CameraManager {
// Nil out the `internalAnimator` once the "ease to" finishes
animator.addCompletion { [weak self] (_) in
self?.internalAnimator = nil
}

// Add the developer-provided completion (if present)
if let completion = completion {
animator.addCompletion(completion)
}

animator.startAnimation()
internalAnimator = animator

Expand Down

0 comments on commit 1cba9c5

Please sign in to comment.