2

I have a problem, I import the swift file correctly, but some of the methods of the swift are not imported in an objective-c. I use SweetAlert in my project.

This code from SweetAlert.swift

But when generated interface header file (CashCourier-Swift.h) , it imported only the first function.

This is generated interface header

Like all did the right thing, but I can not use a showAlert function with multiple parameters.

1 Answers1

3

The enum AlertStyle causes the problem. Swift enums can only be bridged to Objective-C enums if they have basic integer type (e.g. Int) raw value (they also have to be marked with @objc attribute). The enum couldn't be bridged, so methods which use it are not visible from Objective-C.

Sebastian Osiński
  • 2,894
  • 3
  • 22
  • 34