swift1 > start

swift 无头文件,都在.swift 文件里

创建项目选择语言为swift即可


导入文件

  1. import Foundation
Objective-C frameworks vend APIs in header files. In Swift, those header files are compiled down to Objective-C modules, which are then imported into Swift as Swift APIs. 

  • Remap certain Objective-C types to their equivalents in Swift, like id to AnyObject

  • Remap certain Objective-C core types to their alternatives in Swift, like NSString to String

  • Remap certain Objective-C concepts to matching concepts in Swift, like pointers to optionals

The model for importing Swift into Objective-C is similar to the one used for importing Objective-C into Swift. Swift vends its APIs—such as from a framework—as Swift modules. Alongside these Swift modules are generated Objective-C headers. These headers vend the APIs that can be mapped back to Objective-C. Some Swift APIs do not map back to Objective-C because they leverage language features that are not available in Objective-C. For more information on using Swift in Objective-C

You cannot import C++ code directly into Swift. Instead, create an Objective-C or C wrapper for C++ code.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值