Swift calls third-party OC projects

Source: Internet
Author: User

First step: Create and configure Bridging-header.h

Swift and OC are mixed, first there must be a. h file, where you use Bridging-header.h and then set the project's build Settings--swift compiler--objective-c bridging The Header content is demoapp/bridging-header.h, which is related to the Bridging-header.h location, starting at the root of the project in Objective-c bridging The Header option writes the Bridging-header.h relative path.



Step Two: Modify bridging-header.h

write in Bridging-header.h #import "AFNetworking.h"

Step three: Call OC

We can invoke the functionality of a third-party project when the previous work is done.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Swift calls third-party OC projects

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.