Hello, I am trying to learn more about the different stock market APIs and am working with Polygonio right now. I am using the swift wrapper for it by toniremi (https://github.com/toniremi/PolygonioSwift). The example on the site makes it seem like just doing this should make it work but I am still not producing any requests on Polygonio.
Code:
import UIKit
import PolygonioSwift
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let polygon = PolygonioSwift.Client(key: "Access Code")
polygon.setDebug(enable: true)
polygon.dailyOpenClose(symbol: "symbol", date: "date") { (result: DailyOpenCloseResponse?, err) in
if let err = err {
print(err)
} else {
print(result!) //Not sure why force-unwrap is necessary but XCode warns the expression is implicitly coerced from DailyOpenCloseResponse? to 'Any" without it
}
}
}
}
But without any compiler or runtime errors the simulation finishes after a few seconds and never produces any requests on Polygon.io. The package declares DailyOpenClose response and the ApiRequest so I am not sure if I need to include it on my ContentView file and even if I do I get other compiler errors but that is for another post I think(let me know and I will include that stuff if necessary).