@@ -41,6 +41,7 @@ struct PostView: View {
4141 var onPostPinned : ( ) -> Void
4242 var onPostUnpinned : ( ) -> Void
4343
44+ @Namespace private var namespace
4445 @State private var isShowingComments = false
4546 @State private var isReporting = false
4647 @State private var showReportAlert = false
@@ -88,6 +89,15 @@ struct PostView: View {
8889 . padding ( . horizontal, 16 )
8990 . sheet ( isPresented: $isShowingComments) {
9091 CommentsView ( postId: post. post. postId, postManager: postManager)
92+ . modify {
93+ #if os(iOS)
94+ if #available( iOS 18 , * ) {
95+ $0. navigationTransition (
96+ . zoom( sourceID: " comments " , in: namespace)
97+ )
98+ }
99+ #endif
100+ }
91101 }
92102 . alert ( " Post Reported " , isPresented: $showReportAlert) {
93103 Button ( " OK " ) { }
@@ -244,7 +254,10 @@ struct PostView: View {
244254 }
245255 }
246256
247- Button ( role: . destructive, action: { showDeleteConfirmation = true } ) {
257+ Button (
258+ role: . destructive,
259+ action: { showDeleteConfirmation = true }
260+ ) {
248261 Label ( " Delete " , systemImage: " trash " )
249262 . foregroundColor ( . red)
250263 }
@@ -307,6 +320,11 @@ struct PostView: View {
307320 }
308321 . buttonStyle ( . plain)
309322 . sensoryFeedback ( . impact, trigger: isShowingComments)
323+ . modify {
324+ if #available( iOS 18 , * ) {
325+ $0. matchedTransitionSource ( id: " comments " , in: namespace)
326+ }
327+ }
310328
311329 Divider ( )
312330 . padding ( . vertical, 5 )
0 commit comments