initWithFrame$1 method

UISwitch initWithFrame$1(
  1. CGRect frame, {
  2. UIAction? primaryAction,
})

Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.

Implementation

UISwitch initWithFrame$1(objc.CGRect frame, {UIAction? primaryAction}) {
  objc.checkOsVersionInternal('UISwitch.initWithFrame:primaryAction:', iOS: (false, (14, 0, 0)));
  final $ret = _objc_msgSend_gxusyk(
    object$.ref.retainAndReturnPointer(),
    _sel_initWithFrame_primaryAction_,
    frame,
    primaryAction?.ref.pointer ?? ffi.nullptr,
  );
  return UISwitch.fromPointer($ret, retain: false, release: true);
}