Swift-ObjectiveC-Interoperability
Swift-ObjectiveC-Interoperability copied to clipboard
Let's discover how to create a project where both swift and objective c class resides with each other. We will discuss more advanced by creating swift and objective c static library and how they can i...
Swift ObjectiveC Interoperability with App Target and multiple Static Libraries.
Let's discover
-
how to create a project where both swift and objective c belong to App Tarbet and interact with each other.
-
We will discuss more advanced by creating swift and objective c static library and how they can interact with each other.
-
We will discuss about module.modulemap and how it is helping us to modularise the APIs.
-
Let's create mix lanugage libraries where both swift and objective c code reside and use them.
Let's take an Example where the dependencies look like:
When Both Swift and Objective-C file resides at App Target:
When both swift and objc file reside in same static library:
swiftc (swift compiler) contains clang (objc compiler) as a module, we do not need any import objc_module_name in swift classes to use Objective c classes.When Both Swift and Objective C reside in different Static Library:
Medium Story:
check the medium page to get end-end understanding:
https://medium.com/@mail2ashislaha/swift-objective-c-interoperability-static-libraries-modulemap-etc-39caa77ce1fc