SwiftUI Navigation Flicker When Navigating Between Screens With and Without .searchable

I’m experiencing a UI flickering issue in a SwiftUI application related to navigation and the .searchable modifier. I have the following navigation flow:

Case 1:

Event Dashboard ↓ Attendee List ↓ Back to Event Dashboard

The Event Dashboard contains an event image at the top. The Attendee List has a navigation bar with a .searchable search field.

When I navigate back from the Attendee List to the Event Dashboard, the event image briefly becomes smaller and then returns to its original size after approximately one second.

Case 2:

Event Dashboard ↓ Attendee List ↓ Attendee Detail

The Attendee List contains .searchable, while the Attendee Detail screen does not.

When navigating from the Attendee List to the Attendee Detail screen, the attendee profile image similarly becomes slightly smaller and then enlarges back to its original size.

The behavior appears to be related to the navigation bar/search bar layout changing between screens.

For example, the Attendee List currently uses:

.searchable( text: $model.searchQuery, placement: .navigationBarDrawer, prompt: "Search" )

If I completely remove .searchable from the Attendee List, the flickering does not occur.

I would like to understand whether this is expected SwiftUI behavior or a known issue with .searchable and navigation transitions.

I am considering testing the Attendee List with ScrollView + LazyVStack instead of List to determine whether List is contributing to the issue.

Answered by DTS Engineer in 905323022

Hello @hitarth2000,

Thank you for this detailed report.

Can you attach the sample project used in testing? I want to make sure we are seeing the same result after following the steps to reproduce.

Include relevant screen recordings, logs and software/hardware versions used in testing along with your report.

Attach all of this in a feedback report filed through Feedback Assistant

Updates will be provided to you through Feedback Assistant. There, you can track if the report is still being investigated, has a potential identified fix, or has been resolved in another way.

For more details on Feedback Status, please see “Understanding the Status of Your Feedback” linked here: https://developer.apple.com/bug-reporting/status

Thank you,

 Travis

Hello @hitarth2000,

Thank you for this detailed report.

Can you attach the sample project used in testing? I want to make sure we are seeing the same result after following the steps to reproduce.

Include relevant screen recordings, logs and software/hardware versions used in testing along with your report.

Attach all of this in a feedback report filed through Feedback Assistant

Updates will be provided to you through Feedback Assistant. There, you can track if the report is still being investigated, has a potential identified fix, or has been resolved in another way.

For more details on Feedback Status, please see “Understanding the Status of Your Feedback” linked here: https://developer.apple.com/bug-reporting/status

Thank you,

 Travis

Ok i m attaching screen shots and video url also. You can take look once and you will get idea what i am trying to achieve and what issue facing.

Just consider SpeakerList instead of AttendeeList as per Que. As i m trying diff option in AttendeeList.

ss 1 : Event image getting cut for second while coming back from Speaker List.

ss 2 : Speaker profile image getting cut for 1 sec while going from spk list to detail.

video URL : https://acesse.one/fy46zxw

In video, we can see when searchbar visible in List screen and if we go next screen or prev screen then bz of Navigation re render and searchbar area getting filcker or cut for 1 sec.

if we scroll bit and hide search bar in List then no issue in push and pop. Opening next screen using navigationDestination only. Nothing addition done. hope you get it now.

Thanks for following up with more information.

Are you able to include these details in a report filed through Feedback Assistant?

Please upload the files in a Feedback report, reply with FB number once filed. If you filed already, reply with the FB number.

Make sure you include detailed steps to reproduce the issue and a minimal sample project that demonstrates that.

Also, I'd advise against using that link, it didn't seem like a place I trust to share files here on the Developer Forums, nor could I easily find a link to your video. In your report, attach the project files and screen recording directly.

 Travis

Thanks for filing @hitarth2000.

I see the screen recording and issue you describe now.

Can you attach a sample project that reproduces the issue?

Not the full app as shown in your video, but either:

  • create a new Xcode project, make a minimal project that demonstrates the issue, without any non-needed code.
  • remove non-needed code from your app until all you have left is a minimal project that reproduces the issue.

Sometimes when making this sample project, you might be able to solve the issue yourself.

Please include a stripped down version of your app used in the screen recording that demonstrates the issue. When complete, I will make sure that is included in your report.

Thank you,

 Travis

SwiftUI Navigation Flicker When Navigating Between Screens With and Without .searchable
 
 
Q