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

Add AppearanceActionModifier, onAppear/onDisappear #145

Merged
merged 4 commits into from
Jul 2, 2020

Conversation

MaxDesiatov
Copy link
Collaborator

This is required to unblock #136 as I think it would make sense for the DOMEnvironment view there to add/remove its color scheme listener in onAppear/onDisappear closures.

I've also restored full SwiftUI compatibility in the signature of func modifier<Modifier>(_ modifier: Modifier). Consequently ViewDeferredToRenderer had to be implemented on ModifiedContent then instead of _ViewModifier_Content to make it work.

@MaxDesiatov MaxDesiatov added the SwiftUI compatibility Tokamak API differences with SwiftUI label Jul 2, 2020
@MaxDesiatov MaxDesiatov requested review from carson-katri and j-f1 July 2, 2020 00:08
@@ -29,6 +29,8 @@ public struct Counter: View {
Button("Increment") { count += 1 }
Text("\(count)")
}
.onAppear { print("Counter.VStack onAppear") }
.onDisappear { print("Counter.VStack onDisappear") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do print statements get outputted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Web Inspector console, all print output is redirected with console.log.

@MaxDesiatov MaxDesiatov requested a review from j-f1 July 2, 2020 13:43
j-f1
j-f1 previously approved these changes Jul 2, 2020
@MaxDesiatov MaxDesiatov merged commit 38ca009 into main Jul 2, 2020
@MaxDesiatov MaxDesiatov deleted the lifecycle-view-modifiers branch July 2, 2020 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SwiftUI compatibility Tokamak API differences with SwiftUI
Development

Successfully merging this pull request may close these issues.

3 participants