Buttons

“Button” has two styles: Tinted, Filled:

Button supports more functions:

Button Configuration

Configuratation to set a style for the button:

Customize the configuration of a button and use it to create a Button object:

Using configurationUpdateHandler to custom image in the condition of normal/highlighted the display of the situation, and give the button to set the subtitle:

When configurationUpdateHandler is called? When a customer changes to buy the number of buttons, the application will update itemQuantityDescription in didSet method, called setNeedsUpdateConfiguration), So you can make configurationUpdateHandler is invoked.

Activity indicator

Set the Button property showActivityIndicator = true to start the ActivityIndicator.

Depending on the need, we can replace image with an indicator and show only the indicator.

Metrics adjustments

You can customize the contentInsets, titlePadding, and imagePadding to change the internal layout of a Button:

Semantic styling

Semantic styles make it easier to create buttons:

UIBackgroundConfiguration

Using UIBackgroundConfiguration for the button to set the default background color, so, end of the indicator, will use the default background color:

Toggle buttons

What are Toggle buttons? Take a look at the chart below:

uncheck The selected

Initialize a Toggle button, you just need to set up changesSelectionAsPrimaryAction = true, you can set the default selected:

Pop-up buttons

What are pop-up buttons? Take a look at the chart below:

1) initialize a Pop – up buttons, need in changesSelectionAsPrimaryAction = true premise, set showMenuAsPrimaryAction = true.

② Set the selected items by default

③ Modify the selected items

UIMenus

This is an example of adding UIMenus to UIBarButtonItem. It now supports setting options:.Singleselection: