SwiftUIKitView icon indicating copy to clipboard operation
SwiftUIKitView copied to clipboard

Added dynamicMemberLookup support

Open jayrhynas opened this issue 2 years ago • 1 comments

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)

jayrhynas avatar Jul 30 '22 14:07 jayrhynas

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))

jayrhynas avatar Aug 02 '22 13:08 jayrhynas