iOS UIButton

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

UIButton : UIControl intercepts touch events and sends an action message to a target object when it's tapped. You can set the title, image, and other appearance properties of a button. In addition, you can specify a different appearance for each button state.

Remarks

Button Types

A button’s type defines its basic appearance and behavior. After creating a button, you cannot change its type. The most commonly used button types are the Custom and System types, but use the other types when appropriate

  • UIButtonTypeCustom

    No button style.
    
  • UIButtonTypeSystem

    A system style button, such as those shown in navigation bars and toolbars.
    
  • UIButtonTypeDetailDisclosure

    A detail disclosure button.
    
  • UIButtonTypeInfoLight

    An information button that has a light background.
    
  • UIButtonTypeInfoDark

    An information button that has a dark background.
    
  • UIButtonTypeContactAdd

    A contact add button.
    

When creating a custom button—that is a button with the type custom—the frame of the button is set to (0, 0, 0, 0) initially. Before adding the button to your interface, you should update the frame to a more appropriate value.



Got any iOS Question?