![]() Now the framework and the project both should build successfully. It is present in the Packaging section of target’s build settings. Next step is to change this setting: Always Embed Swift Standard Libraries to Yes in the target’s build settings.Īfter that change, this setting Defines Modules to Yes if it is No. I even created a bridging-header manually but, it’s not required. I wasted a lot of time in this as I read it in many forums and blog posts that you get a popup. Note: If it’s an Objective-C project then a popup window will appear for adding a bridging-header but not in the framework. For example, let’s create a view and change its background color: Once that gets done, then we can add our Swift code to that file. Remember to add it to the Framework not project. Adding Swift Fileįirst Step is to add a new Swift file in an Objective-C framework. I thought I should share the details of how I did it. So, the question is, How to use Swift code in an Objective-C framework? You might think that I will get a lot of results when I search it on Google but that was not the case, most of the results are for adding Swift code in an Objective-C project, not a framework. ![]() I decided that I will use Swift for any new feature that I am going to add. I have an Objective-C framework which I started before Swift came out and it works fine. ![]() Using Swift Code in an Objective-C Framework
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |