Design Pattern Help Needed

Rick Aurbach

I have what must be a common problem, and am looking for some architectural suggestions.
Over the years, I've built custom objects (e.g., popup calendars, button menus, etc) which have now been added to iOS as of iOS 14. This presents a problem for me, because I want my apps to support pre-14 systems. What I want to implement is:
> An @IBDesignable object which implements a custom class on pre-14 systems, but implements the new iOS-14 objects on 14+.
> The object must compile and build with a deployment target of 12.0. Obviously this means that I need to use @available and #available to make the link work.
> I expect to use adaptor (wrapper) patterns to present a common external API that is iOS-version independent.
BUT, I can't figure out how to make this happen. I have some thoughts about making the @IBDesignable class a proxy for an implementation class (which is factory-constructed in the proxy's init methods). The implementation object would be intalled as a subview of the proxy object so all UI would go to it. But I'm sure I'm not thinking of all of the potential issues here.
Have you done something similar to this? Can you give any help or advice about such an undertaking before I sit down and get mired in code? (Maybe even a design pattern to share?)
Any help would be welcome.

Join to automatically receive all group messages.