Skip to content

Animating size from within SwiftUI #1

@nicoreese

Description

@nicoreese

My biggest pain point of using SwiftUI within UIKit is animation. Example:
I can't animate the height of a SwiftUI view from within SwiftUI when it's in a UIHostingController or your HostingView that's constrained to other views or in a UIStackView. SwiftUI tries to animate the change, but UIKit abruptly updates the layout. This leads to a less than ideal animation in total.

I've attached a video and a sample project. I've seen that you already do a lot of stuff for layout in your code, so you might be able to crack this issue and make SwiftUI much nicer to use in UIKit for all of us!

Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2024-09-14.at.12.22.03.mp4

Test33.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions