iOS development-Self-built bridging files for OC and Swift

Source: Internet
Author: User

For swift Development, the OC Project has been going on for a long time, so by default using Xcode's built-in bridging file, the bridge file name is fixed and the directory cannot be changed, so I want to create a bridging file myself and configure it in target. But after the compilation found that the system has been prompted, bridging files can not be found, so I looked for ways to find out how to build a bridge file.

1. Create a header file and place it under the file you want to place:

Here I still named "Ihome-bridging-header", placed under the root directory under the Supportfile file:

2. A key step:

According to the 1, 2, 3, 4, 5 steps, of course, the most critical is the 5th step, before the blog said, in the 5th step to fill in the path of the bridge file, this is not right, in the 5th step, directly to the bridge file dragged to the white box, must be directly dragged past, and then press ENTER, This way our custom bridge files are built, so we can import the OC header file into it with great abandon.

3. Import the required OC header files:

Complete!

iOS development-Self-built bridging files for OC and Swift

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.