Calling a static Swift Method from within Obj-C

Christian

I've developed a CocoaPods Framework in Swift 3. Now I'd like to provide a Demo App for Swift and Obj-c. Swift Demo App works well, but I'm struggling with the Obj-C Demo App.

After I've done pod install and importing the auto generated Header file ({PROJECT_NAME.h}), I now need to call a static swift method to initialize my framework.

Something like FrameWork.initialize(param1, param2, param3) but it seems that Obj-C does not even see my Class..

What do I need to do here?

Christian

Got it. I need to import the Swift file with

@import "FILE";

And remember to tag those classes/methods that should be visible to Obj-C with and @objc.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Javascript

Calling an overridden static method from parent

From Java

calling a super method from a static method

From Java

Calling Java Main method from static block

From Java

Calling a method on an Object from within a Class vs from within a method

From Java

Calling super method from within super class

From Dev

Calling protected ctor of inheriting class from within static template method of base class fails

From Dev

calling static method from inside the class

From Dev

Calling Swift from C

From Dev

Calling a static void Java method from JNI

From Dev

Calling obj-c enum from swift not working after upgrading to Xcode 7.3 swift 2.2

From Dev

Calling objective-c method from Swift error

From Dev

Swift doesn't recognize method from Obj-C class

From Dev

C++ calling a static method

From Dev

Calling Swift class method from Objective-C

From Dev

Invoking an Obj-C class method named `init` from Swift

From Dev

PHP Calling a function within a static method of a class

From Dev

Getting static object reference from object container and calling its method from within another object

From Dev

Calling an instance method within a static method in Python

From Dev

Calling a Java static method with generics from Scala

From Dev

Calling a constructor from method within the same class

From Dev

Calling super static method from designated initializer

From Dev

calling method from struct in swift

From Dev

Calling swift from obj c

From Dev

Calling a C library method from swift using pointers

From Dev

iOS Swift method called on obj C project

From Dev

Calling a non static method from a in a static context

From Dev

How do I reference the containing class from within a static method when "this" is already taken by the calling object?

From Dev

Calling a method from within itself is not working

From Dev

Calling child method from obj of parent class

Related Related

  1. 1

    Calling an overridden static method from parent

  2. 2

    calling a super method from a static method

  3. 3

    Calling Java Main method from static block

  4. 4

    Calling a method on an Object from within a Class vs from within a method

  5. 5

    Calling super method from within super class

  6. 6

    Calling protected ctor of inheriting class from within static template method of base class fails

  7. 7

    calling static method from inside the class

  8. 8

    Calling Swift from C

  9. 9

    Calling a static void Java method from JNI

  10. 10

    Calling obj-c enum from swift not working after upgrading to Xcode 7.3 swift 2.2

  11. 11

    Calling objective-c method from Swift error

  12. 12

    Swift doesn't recognize method from Obj-C class

  13. 13

    C++ calling a static method

  14. 14

    Calling Swift class method from Objective-C

  15. 15

    Invoking an Obj-C class method named `init` from Swift

  16. 16

    PHP Calling a function within a static method of a class

  17. 17

    Getting static object reference from object container and calling its method from within another object

  18. 18

    Calling an instance method within a static method in Python

  19. 19

    Calling a Java static method with generics from Scala

  20. 20

    Calling a constructor from method within the same class

  21. 21

    Calling super static method from designated initializer

  22. 22

    calling method from struct in swift

  23. 23

    Calling swift from obj c

  24. 24

    Calling a C library method from swift using pointers

  25. 25

    iOS Swift method called on obj C project

  26. 26

    Calling a non static method from a in a static context

  27. 27

    How do I reference the containing class from within a static method when "this" is already taken by the calling object?

  28. 28

    Calling a method from within itself is not working

  29. 29

    Calling child method from obj of parent class

HotTag

Archive