Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting an Objective-C framework to Swift - Header files still displaying Objective-C functions

I converted my entire Objective-C framework to Swift. After building it, when I check the framework's Header files, it is still displaying the old Objective-c functions.
I deleted all the Objective-C files from the framework project. I have tried cleaning and building the project. But with no success.

like image 602
Nitish Avatar asked Oct 05 '18 06:10

Nitish


People also ask

Can I mix Objective-C and Swift?

You can use Objective-C and Swift files together in a single project, no matter which language the project used originally. This makes creating mixed-language app and framework targets as straightforward as creating an app or framework target written in a single language.

Can I use Swift library in Objective-C?

We recommend using our native Swift library, even for Objective-C projects, but if you still need to use the Objective-C library, this document helps.


1 Answers

You deleted the Objective-C files from the Xcode project, but did you also remove them from the file system and any source control you might be using?

Also, your Build Settings in your Xcode project can be searching for library/header files even after you've removed them from explicit inclusion in the Project Navigator in Xcode.

Just make sure the search paths don't look for old Obj-C stuff. Be careful of recursive searches like MyXcodeProject/**. The ** will recursively search all subfolders and their subfolders for things to include.

Better to specify folders directly in the search paths if you can. If you know you don't need search paths, you can just clear them all.

enter image description here

...although, you may want to leave the default exclusions in place:

enter image description here

like image 96
Jacob Barnard Avatar answered Oct 05 '22 02:10

Jacob Barnard