Broken Text animation in iOS 16 SwiftUI

Viewed 19

I am developing a search feature with input text highlighting, and I ran into a problem with text animation.

Tested on a device with iOS 15.5, everything works as intended, but on the new iOS 16, the text moves to the end point without animation, you can see this in the video examples below.

Here is the code for how the text color changes:

Text(task.title)
        .kerning(-0.41)
        .foregroundColor(task.title.lowercased().contains(navigation.search.lowercased().trimmingCharacters(in: .whitespaces)) ? .accentColor : .black)
        .font(.system(size: 14, weight: .semibold))
        .frame(width: rowDetailsViewWidth, height: 18, alignment: .leading)

This video is an example of a problem with iOS 15.5 and iOS 16:

enter image description hereenter image description here

0 Answers
Related