1

Is there a simple way to use a Swift library in ObjC? And if yes, how can I do it ?

Here the library I would like to use: https://github.com/matthewpalmer/Regift

By the way, if you guys know another way to convert video to animated gif in iOS. Thanks!

rushelmet
  • 185
  • 1
  • 14
  • https://medium.com/swift-programming/merge-objective-c-static-library-into-swift-using-mosquitto-87ce0b6ec513 – lukeswitz Apr 11 '15 at 17:01
  • Hi @clementr Can u please tell me how did u solve this...i tried apple doc but i m missing out on something... – Hardik Amal Sep 07 '15 at 14:52
  • [Objective-C consumer -> Swift static library] - https://stackoverflow.com/a/59216016/4770877 – yoAlex5 Jan 02 '20 at 13:32

1 Answers1

2

You should take a look of Apple's document.

https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html

Referring to it,

To import Swift code into Objective-C from the same target

Import the Swift code from that target into any Objective-C .m file within that target using this syntax and substituting the appropriate name: OBJECTIVE-C

import "ProductModuleName-Swift.h" The Swift files in your target will be visible in Objective-C .m files containing this import

statement. For information on using Swift from Objective-C code, see Using Swift from Objective-C.

Community
  • 1
  • 1
Pang Ho Ming
  • 1,203
  • 10
  • 27