【问题标题】:Can I use the Spotify Web API in Xcode to develop a native iOS app?我可以在 Xcode 中使用 Spotify Web API 来开发原生 iOS 应用程序吗?
【发布时间】:2016-10-02 17:39:57
【问题描述】:

我想使用 Swift 和网络语言来编写我的应用程序,但我对如何实现这一点感到困惑。 Spotify 的 API 是用 Obj C 编写的,但我想通过使用 Obj C 流式传输歌曲和他们的 web api 来搜索和做其他事情来尽可能地规避这一点。

谢谢!

【问题讨论】:

标签: ios xcode spotify spotify-app


【解决方案1】:

您可以使用桥接头在 Swift 中使用 Spotify 的 API。创建一个新的头文件,添加#import "Spotify/Spotify.h",进入Build Settings并搜索Objective-C Bridging Header(在Swift Compiler - Code Generation下),并添加您刚刚制作的头文件的名称。您可能还需要在 Build Settings 的 Other Linker Flags 下添加“-all_load”。

【讨论】:

    猜你喜欢
    • 2014-09-26
    • 2019-07-03
    • 2018-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-11
    • 2013-07-15
    相关资源
    最近更新 更多