Skip to content

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 interact with each other.

Notifications You must be signed in to change notification settings

ashislaha/Swift-ObjectiveC-Interoperability

Repository files navigation

Swift ObjectiveC Interoperability with App Target and multiple Static Libraries.

Let's discover

  1. how to create a project where both swift and objective c belong to App Tarbet and interact with each other.

  2. We will discuss more advanced by creating swift and objective c static library and how they can interact with each other.

  3. We will discuss about module.modulemap and how it is helping us to modularise the APIs.

  4. 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:

Screenshot 2020-05-31 at 5 54 55 PM

When Both Swift and Objective-C file resides at App Target:

Screenshot 2020-05-31 at 6 12 58 PM

When both swift and objc file reside in same static library:

Screenshot 2020-05-31 at 6 10 03 PM

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:

Screenshot 2019-11-27 at 8 09 35 PM

Medium Story:

check the medium page to get end-end understanding:

https://medium.com/@mail2ashislaha/swift-objective-c-interoperability-static-libraries-modulemap-etc-39caa77ce1fc

About

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 interact with each other.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published