fileprivate func playVideoId(_ apiId: String) {
(MApi.sharedMApi() as! MApi).getVideoALaCarta(withID: apiId, completionHandler: { [weak self] (videoObject: AnyObject?, error: NSError?) -> Void in
if ((error) != nil || (videoObject) == nil) {
print("ERROR AL DESCARGAR VIDEO A LA CARTA: \(String(describing: error))")
self?.userInterface?.showLoadingView(false)
} else {
self?.userInterface?.presentPlayer(videoObject as! MApi_VideoAlaCarta)
}
} as CompletionBlock)
}
和CompletionBlock代码:
$
typedef void(^ CompletionBlock)(id对象,NSError *错误);