Swift method with a swift enum as parameter is not visible in Objective C

I have a swift Class with an enum and a method which expects a parameter of with type of the enum:

import SpriteKit

enum Direction: Int {
    case up = 1;
    case down = -1;
}

class ParallaxScrollingNode: SKNode {

    func addStaticBackground(name: String) {
        ...
    }

    func addParallaxBackground(imageNames: [String], yScaleFactor: CGFloat, yDirection: Direction) {
        ...
    }

In my Objective C class it is possible to call the first, but not the second method:

  • Removing the title text of an iOS UIBarButtonItem
  • UIImage meta data
  • How to determine the true data type of an NSNumber?
  • CIFilter on SCNNode only works in Simulator
  • Can a website (HTML5,JavaScript) access a mobile device's (android/iPhone) contact list, SDCard files
  • Replace ALAsset object in iOS ALAssetsLibrary
  • enter image description here

    Looks like the enum is causing the issue. The method is missile, if I change the type to Int. Of course I can do this with my code, but I want to understand if this is not working in general or if I have missed something.

    Thanks
    Stefan

    Solutions Collect From Internet About “Swift method with a swift enum as parameter is not visible in Objective C”

    So for someone who has simillar issue:

    adding @objc specification before declaration makes this struct available in Objective-C world.

    Docs.