ButtonLayout

open class ButtonLayout<Button: UIButton>: BaseLayout<Button>, ConfigurableLayout

Layout for a UIButton.

Since UIKit does not provide threadsafe methods to determine the size of a button given its content it’s implememtation hard-codes the current observed style of UIButton. If the style of UIButton changes in the future, then the current implementation will need to be updated to reflect the new style.

If future-proofing is a concern for your application, then you should not use ButtonLayout and instead implement your own custom layout that uses you own custom button view (e.g. by subclassing UIControl).

Similary, if you have your own custom button view, you will need to create your own custom layout for it.