如何在iOS中使用Swift中的iosMath,因为iosMath是用Objective C编写的?或者有另一种方法来显示数学公式与斯威夫特?在Swift中使用iosMath
0
A
回答
0
我必使这尽可能快:
1)安装的CocoaPods(打开终端,写sudo gem install cocoapods
)
2)从终端改变目录到你的项目和init的CocoaPods和编辑podfile这样的:
cd /ProjectFolder
pod init
nano podFile
(打开podfile,在那里你粘贴荚回购),应该是这样的:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'mathExample' do
# Comment the next line if you're not using Swift and don't want to use dynam$
use_frameworks!
# Pods for mathExample
pod 'iosMath'
end
保存podfile,并通过安装:
pod install
从现在开始,使用工作区文件,而不是项目文件。我们完成安装,你需要对现在的荚...
现在有点棘手 - >您需要从项目中添加新的Objective-C文件(所以只需新建文件 - > Objective-C文件并选择创建桥接头),您可以删除创建的文件(但不是BRIDGING HEADER)
从现在起,您可以像使用快速fr一样使用Objective-C框架不要忘了将该框架导入你将要使用它的类:
import UIKit
//Importing our module
import iosMath
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
print(iosMathVersionNumber)
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
希望这有助于,希望快乐的编码! :)
0
一般问题已经回答。 Check this question out。
您只需在podfile中添加iosMath
,只要您在podfile中有use_frameworks!
,就不需要任何标题。简单地说,在你的swift文件中导入iosMath
,你很好。
相关问题
- 1. Swift 3:iosMath标签删除所有空格
- 2. 在Swift中使用CFNotificationCallback,或者在Swift中使用@convention(c)块
- 3. 在Swift 2.3中使用Swift 3框架
- 4. 使用swift在IOS下使用swift在xcode中实现Bump Distortion
- 5. 在Swift中使用OpenCV iOS
- 6. 在Swift中使用isKindOf
- 7. 在swift中使用C++ DLL
- 8. 在swift中使用委托
- 9. 在Swift中使用extern“C”?
- 10. 在Swift中使用标签
- 11. 在Swift 2.0中使用NSFetchedResultsController
- 12. 在swift中使用块
- 13. 在Swift中使用NSMutableArray sortUsingFunction?
- 14. 如何使用?:在Swift中?
- 15. 在swift中使用AFHTTPSessionManager
- 16. 在swift中使用widevine库
- 17. 在Swift中使用edgeLoopFromRect
- 18. 在spriteKit中使用waitForDuration()swift
- 19. 在Swift 2中使用TouchesMoved
- 20. iAd在SpriteKit中使用Swift
- 21. 在Xamarin中使用Swift库
- 22. 在swift中追加使用
- 23. 在Swift 1.2中使用assetForURL
- 24. 在Swift 2.0中使用mogenerator
- 25. NSNumber在swift中使用seconds_t?
- 26. 在Swift中使用框架
- 27. 在Swift中使用数组
- 28. 在Swift中使用RestKit
- 29. 在swift中使用.viewControllers
- 30. 在Swift中使用LSApplicationWorkspace
你读过[如何从Swift调用Objective-C代码](https://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift)? –