Skip to content

Conversation

jayrhynas
Copy link

@jayrhynas jayrhynas commented Jul 30, 2022

This PR leverages dynamicMemberLookup to allow setting properties in the same style as SwiftUI.

Unfortunately DML cannot be implemented by a protocol so the implementation needs to be duplicated between the conforming types (UIViewContainer and ModifiedUIViewContainer)

Updated examples to use dynamicMemberLookup
@jayrhynas
Copy link
Author

jayrhynas commented Aug 2, 2022

The one downside of this approach is that any UIKit properties that have the same name as a View modifier won't be available via DML, but you can still fall back to set(_:to:)
(for example with a wrapped UILabel you cannot set the font as it tries to use View.font(_:Font))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant