Skip to content

Instantly share code, notes, and snippets.

@amixpal
Created November 19, 2019 11:40
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 amixpal/c1de11e66c59c59c1ac4f4e985c0b492 to your computer and use it in GitHub Desktop.
Save amixpal/c1de11e66c59c59c1ac4f4e985c0b492 to your computer and use it in GitHub Desktop.
NetworkManager.makeRequest(HttpRouter.createNewNutritionProgram(name: programName, interestList: interestList, description: textView.text, trainerId: userId!, addedByTrainer: true, programPrice: price.removeFormatAmount(), programType: typeOfProgram, isPromoCode: isPromoCode, promoId: promoCodeId, previewPdfUrl: previewPdfUrl, pdfUrl: fullPdfUrl, trainingVideos: self.trainingVideos, isVideo: self.isVideos), message: processingBar.PROCESSING_MESSAGE, showProgress: true)
.onSuccess { (response: FitMeResponse) in
let rootViewController = MainTabBarViewController()
if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
appDelegate.window?.rootViewController = rootViewController
rootViewController.selectedIndex = 1
}
}
.onFailure { error in
print(error.localizedDescription)
}
.onComplete { _ in
RappleActivityIndicatorView.stopAnimation()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment