Closed nrvraghu closed 7 years ago
var volumeButtonHandler: JPSVolumeButtonHandler? = JPSVolumeButtonHandler()
override func viewWillDisappear(_ animated: Bool)
{
self.volumeButtonHandler = nil
}
Swift variables can only be nil of they have the Optional type, caracterized by the "?" at the declaration:
var volumeButtonHandler: JPSVolumeButtonHandler?
var volumeButtonHandler = JPSVolumeButtonHandler() and override func viewWillDisappear(_ animated: Bool) { self.volumeButtonHandler = nil //Error showing that Nil can not be assign to the type of "JPSVolumeButtonHandler" } I am using Xcode 8.2.1 version. let me know a solution for this.