Now if we take a closer look, we have condition here for iOS 9. In iOS 9 we have get all request either those are outstanding data, upload and download tasks at once and we get completion handler and into it we cancel all request. While in the else condition we are managing iOS 8 or previous versions. In that condition we get tasks completion handler which gives us three different array of outstanding data, upload and download tasks. By which we enumerate all kind of tasks and cancel it.