Skip to content

Instantly share code, notes, and snippets.

@jknthn
Created July 19, 2018 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jknthn/81d13c30fc98b9d24d522e4c75e2a72d to your computer and use it in GitHub Desktop.
Save jknthn/81d13c30fc98b9d24d522e4c75e2a72d to your computer and use it in GitHub Desktop.
extension MapViewController: DJISDKManagerDelegate {
func appRegisteredWithError(_ error: Error?) {
if let error = error {
print(error.localizedDescription)
} else {
DJISDKManager.startConnectionToProduct()
}
}
func productConnected(_ product: DJIBaseProduct?) {
if let _ = product {
if DJISDKManager.product()!.isKind(of: DJIAircraft.self) {
let flightController = (DJISDKManager.product()! as! DJIAircraft).flightController!
flightController.delegate = self
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment