initWithFramePrimaryAction method

UISwitch initWithFramePrimaryAction(
  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 initWithFramePrimaryAction(objc.CGRect frame, {UIAction? primaryAction}) {
  objc.checkOsVersionInternal('UISwitch.initWithFrame:primaryAction:', iOS: (false, (14, 0, 0)));
  final _ret = _objc_msgSend_gxusyk(
    this.ref.retainAndReturnPointer(),
    _sel_initWithFrame_primaryAction_,
    frame,
    primaryAction?.ref.pointer ?? ffi.nullptr,
  );
  return UISwitch.castFromPointer(_ret, retain: false, release: true);
}