How to use NMSSH in swift

独自空忆成欢 提交于 2019-12-12 08:59:14

问题


I developed a simple IOs app to control a Raspberry Pi through SSH using NMSSH few month ago, this app is developped with obj-c and I would like to devellop alost the same in Swift so i import the NMSSH library the same and I follow this to import nmssh with bridging so I can use the library in my swift file but i wan tto compile I have 117 error because xCode see NMSSH file like swift files and not obj-c files and I don't have any idea why or how to solve this. Sorry if that's a simple question but I try to learn Swift and as a french it's not pretty simple with all documentation in Engloish. Thanks.

EDIT:


回答1:


First follow the instruction in iOS Developer library about using Swift with Objective-C. Second include:

#import <Foundation/Foundation.h>

and then NMSSH import

#import <NMSSH/NMSSH.h>

in your Bridging header file

I am new with this framework but it seems like the Foundation contain information/definition of primitive objects.

Also check this answer in more detail: How to call Objective-C code from Swift



来源:https://stackoverflow.com/questions/26110980/how-to-use-nmssh-in-swift

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!