一个用于从Yahoo API获取股票信息和汇率的框架。
获取一个或多个报价很简单
Quote.fetch(["MSFT","AAPL"]) { result in
switch result {
case .Success(let quotes):
// do something with the quotes
break
case .Failure(let error):
// handle the error
break
}
}.resume()
获取一个或多个汇率也是如此
ExchangeRate.fetch(["USDGBP","GBPEUR"]) { result in
switch result {
case .Success(let exchangeRates):
// do something with the exchange rates
break
case .Failure(let error):
// handle the error
break
}
}.resume()
iOS 8.0 / Mac OS 10.10
StocksKit可通过CocoaPods获取。要安装它,只需将以下行添加到Podfile中
pod "StocksKit"
Alexander Edge,[email protected]
StocksKit可在MIT许可证下获取。有关更多信息,请参阅LICENSE文件。