Xcode 6 Swift calls Objective-c class Couxia file naming

Source: Internet
Author: User

A third-party class library written in objective-c language can be called in Swift.

Before calling, need a bridge file, this file in the first import OC Library when the project will be prompted to create, this time as long as the answer is "yes" can be, if missed this opportunity, we can also manually add, the steps are as follows:

For example, the project name is: HelloWorld

Right-click Project-"New file-" Header file

Named: Helloworld-brigding-header.h can be

The experiment can also be named Xxxyy-brigding-header.h, which is especially handy when the project is named with the Chinese name.

Write in File:

#import "ClassName.h"

Additional configuration is required in the project:

Item-"Builde Setting-" Objective the value in bridging header is set to Helloworld-brigding-header.h

It is important to note that to ensure that the file path is correct, you may need to write:./project name/helloworld-brigding-header.h in this form.


Xcode 6 Swift calls Objective-c class Couxia file naming

Related Article

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.