Skip to content

Commit 1295343

Browse files
committed
Add static pin in detail view
1 parent 1fd210d commit 1295343

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

DemoApp/StreamChat/Components/CustomAttachments/LocationAttachment/LocationDetailViewController.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,17 @@ class LocationDetailViewController: UIViewController, ThemeProvider {
101101
UIView.animate(withDuration: 5, delay: 0.2, options: .curveEaseOut) {
102102
self.mapView.setCenter(coordinate, animated: true)
103103
}
104-
} else if let author = messageController.message?.author {
105-
// Create new annotation
104+
} else if let author = messageController.message?.author, isLiveLocationAttachment {
106105
let userAnnotation = UserAnnotation(
107106
coordinate: coordinate,
108107
user: author
109108
)
110109
mapView.addAnnotation(userAnnotation)
111110
self.userAnnotation = userAnnotation
111+
} else {
112+
let annotation = MKPointAnnotation()
113+
annotation.coordinate = coordinate
114+
mapView.addAnnotation(annotation)
112115
}
113116
}
114117

0 commit comments

Comments
 (0)