venmo / Static

Simple static table views for iOS in Swift.
http://blog.soff.es/static
MIT License
1.25k stars 87 forks source link

adds new checkmark placeholder #125

Closed rhaining closed 6 years ago

rhaining commented 6 years ago

We were running into an issue where if you toggled back & forth between checked/unchecked states, the content would abruptly shift back & forth for the user, on smaller screens like the 5s. (The problem didn't exhibit itself on larger screens like the X).

This allows the developer to opt-in to use a checkmarkPlaceholder, allowing Static to insert a placeholder appropriately sized blank UIView to hang out until a checkmark may appear in its place.

Before After
privacy_settings_checks - bug privacy_settings_checks - fix
eliperkins commented 6 years ago

What do you think of handling this with a one-off .view case? This seems a little specific to this use-case and is more of an artifact of what UIKit is doing with these types of cells (changing title label widths with specific accessory views), than what Static is doing with UIKit.

rhaining commented 6 years ago

@eliperkins I think this'll be useful for others who might want their content to not move around when showing a check or not showing a check.