0

I am working on an application which is built in objective C.

I have to implement UIActivityController which is easy to implement using swift in any application but since I am not familiar with Objective- C even by a %, can I use swift code to implement the UIActivityController in a button?

If so, how?

vivekDas
  • 1,248
  • 8
  • 12

1 Answers1

1

Yes you can create Swift file, with your Swift implementation in the Objective-C project.

You just have to add

#import "YourProjectName-Swift.h"

into the objc file where you wanna call the swift code and execute it.

More info in article here for example https://medium.com/ios-os-x-development/swift-and-objective-c-interoperability-2add8e6d6887

Martin Prusa
  • 201
  • 1
  • 5