LivecenterKit 0.1.7

LivecenterKit 0.1.7

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最新发布2016 年 7 月

Hamza AnsariHamza Ansari 维护。



  • Thoughtchimp

简介

以下是关于如何在您的 iOS 应用中安装 Livecenter SDK 的详细步骤。如果您在使用或理解过程中遇到任何问题,请[email protected]联系。

要求

  • iOS 8.0+
  • Xcode 7.3+

设置 LivecenterKit

导入 Livecenter kit 框架
import LivecenterKit
与您的应用集成

要使用您的应用凭据初始化 Livecenter Kit,请将它们传递到您的应用 AppDelegate 中的 setConsumerKey: secret:。

Livecenter.sharedInstance.setConsumerKey(consumerKey, secret: consumerSecret)

用法

加载匹配列表
Livecenter.sharedInstance.api.getMatchList { (matches, error) -> Void in
    // handle the response or error
}
加载匹配数据
Livecenter.sharedInstance.api.getMatchData(matchId: 12) { (matchData, error) -> Void in
    // handle the response or error
}
加载匹配目标
Livecenter.sharedInstance.api.getMatchGoals(matchId: 12) { (goals, error) -> Void in
    // handle the response or error
}
加载匹配股票指数
Livecenter.sharedInstance.api.getMatchTicker(matchId: 12) { (tickers, error) -> Void in
    // handle the response or error
}

显示新闻室视图

导入 Livecenter kit 框架
import LivecenterKit
创建 LivecenterView
let livecenterView = LivecenterView(frame: CGRect(x: 0, y: 110, width: 320, height: 400))

//Set its delegate
livecenterView.delegate = self

//loadLivecenter match 'Liveblog' with matchId and count
  livecenterView.loadLivecenter(matchId: matchId, livecenterType: .Liveblog, count: 10)

//loadLivecenter match 'Social' with matchId and count
  livecenterView.loadLiveCenter(matchId: matchId, livecenterType: .Social, count: 10)
处理 LivecenterView 代理
func livecenterViewLoadFinish() {
 //livecenterView Loading Finish        
}

func livecenterViewEmptyPage() {
    //livecenterView Return Empty Page        
}

func livecenterViewLoadFailed(error: NSError) {
    //livecenter Return Error
      print(error.localizedDescription)
}