In UIKit you can do something like this:
UIView.animate(withDuration: TimeInterval, animations: {
//animation
}) { (Bool) in
//code which will be executed after the animation
}
Is there anything like that in SwiftUI, or can you think of a replacement?
There is an approach to this described here:
https://www.avanderlee.com/swiftui/withanimation-completion-callback/
The approach requires the use of a custom implementation of the AnimatableModifier
protocol. It's not completely trivial to implement, but it does seem to solve the problem.