Skip to content

yilmazedis/Swift-ObjC-Cpp-ObjC-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Swift-ObjC-Cpp-ObjC-Swift

Do you want to use a project written in C/C++, ObjC/ObjC++ in your swift project? This structure is exactly what you was looking for.

Travel between C/C++ <-> ObjC/ObjC++ <-> Swift

This read me is a scratch paper, I am going to prepare more advance.

print("-- Go To ObjC --")
let calculate = CalculateWrapper()
print(calculate.multiply(5, with: 44))

print("-- Go To ObjC Then Go Back to Swift --")
calculate.greeting(withNumber: 100)

print("-- Go To ObjCpp --")
let person = PersonWrapper()
let name = person.printName()
print(name!)

print("-- Go To ObjCpp Then Go Back to Swift --")
calculate.greeting(withNumber: 500)

print("-- Go Directly to C --")
print(rectangleArea(3, 5))

print("-- Go To Cpp mm Extension Then Go Back to Swift --")
person.sum(ofThree: 3, 4, 5)

Swift-ObjC-Swift

Important Parts

Screen Shot 2022-07-26 at 20 56 14

Screen Shot 2022-07-26 at 20 56 38

Screen Shot 2022-07-26 at 20 56 54

Swift-ObjCpp-Swift

Plus Important Parts to ObjCpp

Don't forget to add this flag -fcxx-modules to .mm file Check it

Screen Shot 2022-07-27 at 23 34 32

Cpp-Swift Directly through C wrapper

Screenshot 2024-01-28 at 14 42 13

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published