SimpleButton icon indicating copy to clipboard operation
SimpleButton copied to clipboard

"Vary For Trait"-aware?

Open wdcurry opened this issue 8 years ago • 2 comments
trafficstars

At present, the control completely blows VaryForTrait away. I think it is moderately easy to enable, but will have to review the Apple vids to confirm. This makes the corner radius attribute useless for a properly proportioned multi-device app.

If time permits, i will see if I can make it aware, then post back here, else (due to time constraints) will just tweak my deliverable to miss the mark as minimally as i can.

wdcurry avatar Jul 08 '17 17:07 wdcurry

What is required is to respond to traitCollectionDidChange, and ensure the corner radius is set via the method .setCornerRadius plus determining the trait class you are responding to. Then all is good.

wdcurry avatar Jul 08 '17 18:07 wdcurry

Hi, thanks for pointing this out! I don´t have a lot of experience with UITraitCollection´s, but as a first step, you can always subclass SimpleButton and add there traitCollectionDidChange support. Hopefully I find some time to look into it in more detail soon.

aloco avatar Jul 10 '17 10:07 aloco