Class UISwitch

All Implemented Interfaces:
CALayerDelegate, NSCoding, NSObjectProtocol, UIAccessibilityIdentification, UIActivityItemsConfigurationProviding, UIAppearanceContainer, UIContextMenuInteractionDelegate, UICoordinateSpace, UIDynamicItem, UIFocusEnvironment, UIFocusItem, UIFocusItemContainer, UILargeContentViewerItem, UIPasteConfigurationSupporting, UIResponderStandardEditActions, UITraitEnvironment, UIUserActivityRestoring, ObjCProtocol

public class UISwitch
extends UIControl
implements NSCoding
  • Constructor Details

    • UISwitch

      public UISwitch()
    • UISwitch

      protected UISwitch​(NSObject.Handle h, long handle)
    • UISwitch

      protected UISwitch​(NSObject.SkipInit skipInit)
    • UISwitch

      public UISwitch​(CGRect frame)
    • UISwitch

      public UISwitch​(NSCoder coder)
    • UISwitch

      public UISwitch​(CGRect frame, UIAction primaryAction)
      Since:
      Available in iOS 14.0 and later.
  • Method Details

    • getOnTintColor

      public UIColor getOnTintColor()
    • setOnTintColor

      public void setOnTintColor​(UIColor v)
    • getThumbTintColor

      public UIColor getThumbTintColor()
    • setThumbTintColor

      public void setThumbTintColor​(UIColor v)
    • getOnImage

      public UIImage getOnImage()
    • setOnImage

      public void setOnImage​(UIImage v)
    • getOffImage

      public UIImage getOffImage()
    • setOffImage

      public void setOffImage​(UIImage v)
    • getTitle

      public String getTitle()
      Since:
      Available in iOS 14.0 and later.
    • setTitle

      public void setTitle​(String v)
      Since:
      Available in iOS 14.0 and later.
    • getStyle

      public UISwitchStyle getStyle()
      Since:
      Available in iOS 14.0 and later.
    • getPreferredStyle

      public UISwitchStyle getPreferredStyle()
      Since:
      Available in iOS 14.0 and later.
    • setPreferredStyle

      public void setPreferredStyle​(UISwitchStyle v)
      Since:
      Available in iOS 14.0 and later.
    • isOn

      public boolean isOn()
    • setOn

      public void setOn​(boolean v)
    • getLayerClass

      public static Class<? extends CALayer> getLayerClass()
    • init

      protected long init​(CGRect frame)
      Overrides:
      init in class UIControl
    • init

      protected long init​(NSCoder coder)
      Overrides:
      init in class UIControl
    • setOn

      public void setOn​(boolean on, boolean animated)
    • getUserInterfaceLayoutDirection

      public static UIUserInterfaceLayoutDirection getUserInterfaceLayoutDirection​(UISemanticContentAttribute attribute)
      Since:
      Available in iOS 9.0 and later.
    • getUserInterfaceLayoutDirection

      public static UIUserInterfaceLayoutDirection getUserInterfaceLayoutDirection​(UISemanticContentAttribute semanticContentAttribute, UIUserInterfaceLayoutDirection layoutDirection)
      Since:
      Available in iOS 10.0 and later.