Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifier -> SwiftUI -> View fundamentals: onAppear(perform:) #608

Closed
2 tasks
AZholtkevych opened this issue Mar 13, 2023 · 6 comments · Fixed by #970
Closed
2 tasks

Modifier -> SwiftUI -> View fundamentals: onAppear(perform:) #608

AZholtkevych opened this issue Mar 13, 2023 · 6 comments · Fixed by #970
Assignees
Labels
MODIFIER Label for the Modifiers SWIFTUI Label for SwiftUI VIEW FUNDAMENTALS Label for the SwiftUI -> View fundamentals
Milestone

Comments

@AZholtkevych
Copy link

AZholtkevych commented Mar 13, 2023

Doc: https://developer.apple.com/documentation/swiftui/view/onappear(perform:)

  • Swift implementation
  • Elixir implementation
@AZholtkevych AZholtkevych added SWIFTUI Label for SwiftUI MODIFIER Label for the Modifiers VIEW FUNDAMENTALS Label for the SwiftUI -> View fundamentals labels Mar 13, 2023
@AZholtkevych AZholtkevych added this to the Version 0.2.0 milestone Apr 13, 2023
@AZholtkevych
Copy link
Author

It should be more investigated

@shadowfacts
Copy link
Contributor

I started investigating this and #609 (see 33f5eb4) but ran into an issue: every time an element appears or disappears, both the onAppear and onDisappear callbacks fire. It's not immediately clear to me why, but I suspect it has to do with the notion of element identity not being preserved across view updates (see liveview-native/liveview-native-core#13).

@dginsburg
Copy link
Contributor

@AZholtkevych I don't think this is a good ticket for me to work on. If Anil didn't know how to do it then I definitely won't. It involves parts of the architecture I don't know at all.

@carson-katri
Copy link
Contributor

I wasn't able to replicate the mentioned issue in a few simple tests, perhaps it shows up with more complex hierarchies. I've opened a PR with @shadowfacts implementation: #970

@AZholtkevych
Copy link
Author

@carson-katri could you please link PR here

@carson-katri carson-katri linked a pull request Jun 6, 2023 that will close this issue
@AZholtkevych
Copy link
Author

@carson-katri please merge this one

carson-katri added a commit that referenced this issue Jun 8, 2023
See #608
See #609

Co-authored-by: Shadowfacts <me@shadowfacts.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MODIFIER Label for the Modifiers SWIFTUI Label for SwiftUI VIEW FUNDAMENTALS Label for the SwiftUI -> View fundamentals
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants