![]() This sets the button size to large and the corner style to medium. To do that, add the following code underneath the code you just added: Once you have a configuration object, there are many options you can modify to create the perfect button!įor example, you can change the size of the button and the style of its corners. This created a basic configuration object based on the filled template. ![]() To start styling buttons, open SignInViewController.swift, and find signInButton.Īt the top, inside the initializer closure, add the following code tinted: A button whose background is tinted with a color. filled: A button whose background is filled with a color. plain: A plain button with a transparent background. They come as four different functions on UIButton.Configuration that generate a configuration object based on that template. Fortunately, this is easy to fix with the new Configuration API!Īt a high level, there are four primitive options for a button configuration. This opens the SignInViewController view controller. Beginning Adoption of UIButton.Configurationīuild and run the starter project. ![]() Now you’ll learn how to use the Configuration API to take your button’s styles to the next level with ease. If you’ve used a completion handler-based API before, this new UIAction API should feel familiar. When tapping the button, the block will be called and the print statement will execute. Here’s a brief example of how to use this API: Read on to discover everything you need to know to start configuring buttons! Getting Startedĭownload the starter project by clicking the Download Materials button at the top or bottom of the tutorial.Ī quick refresher: In iOS 14, Apple introduced the UIAction API for UIButton, which removed the need for the target-action pattern. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |