[英]Can I use the Spotify Web API in Xcode to develop a native iOS app?
I would like to use Swift and web languages to write my app but I'm confused as to how I can achieve this. 我想使用Swift和网络语言编写我的应用程序,但是我对如何实现这一目标感到困惑。 Spotify's API is written in Obj C but I'd like to circumvent that as much as possible by using Obj C to stream songs and their web api to search and do other things.
Spotify的API是用Obj C编写的,但我想通过使用Obj C播放歌曲以及使用其网络api来搜索和执行其他操作来尽可能地避免这种情况。
Thanks! 谢谢!
You can use a bridging header to use Spotify's API in Swift. 您可以使用桥接标头在Swift中使用Spotify的API。 Create a new header file, add
#import "Spotify/Spotify.h"
, go to Build Settings and search for Objective-C Bridging Header (under Swift Compiler - Code Generation), and add the name of the header file you just made. 创建一个新的头文件,添加
#import "Spotify/Spotify.h"
,转到Build Settings并搜索Objective-C桥接头文件(在Swift Compiler-Code Generation下),然后添加刚创建的头文件的名称。 You may also need to add "-all_load" under Other Linker Flags in Build Settings as well. 您可能还需要在“构建设置”中的“其他链接器标志”下添加“ -all_load”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.