2

In my Objective-C .h file, I have defined:

typedef NS_ENUM(NSInteger, RTSpinKitViewStyle) {
    RTSpinKitViewStylePlane,
    RTSpinKitViewStyleCircleFlip
};

How to access the enum in Swift code?

I tried using dot operator as RTSpinKitViewStyle.RTSpinKitViewStyleCircleFlip but it shows compile error

"RTSpinKitViewStyle.Type does not have member type name RTSpinKitViewStyleCircleFlip " .

nhgrif
  • 61,578
  • 25
  • 134
  • 173
sambhav
  • 39
  • 4

2 Answers2

2

Use:

RTSpinKitViewStyle.CircleFlip

or just:

.CircleFlip
Greg
  • 25,317
  • 6
  • 53
  • 62
  • @sambhav have you added the bridge file and imported the file which contains a definitions of the enum? – Greg Jun 08 '15 at 11:56
  • Ok, i guess that error is gone . actualy now i have to invoke one function func insertSpinnerOfStyle(style:RTSpinKitViewStyle, backgroundColor:UIColor, labelString:NSString) . where first argument is that enum .now its showing error cannot invoke insertSpinner of style with argument of type – sambhav Jun 08 '15 at 12:00
1

You can access them as RTSpinKitViewStyle.Plane.

nhgrif
  • 61,578
  • 25
  • 134
  • 173
yashwanth77
  • 1,820
  • 1
  • 12
  • 17