func setup() {
addSubview(leftButton)
addSubview(rightButton)
addSubview(label)
backgroundColor = buttonsBackgroundColor
layer.cornerRadius = cornerRadius
clipsToBounds = true
//Commented this line out
NotificationCenter.default.addObserver(self, selector: #selector(GMStepper.reset), name: NSNotification.Name.UIApplicationWillResignActive, object: nil)
}
Whenever the applicationWillResignActive AppDelegate function was being called, the reset() function would cause a 'found nil while unwrapping an optional value' error. Not sure why the steppers need to be reset when the application resigns, honestly. I commented the observer out and it seems to work fine. If I'm wrong in this, or there's a better way to fix this error, please do inform me. Thanks!
Whenever the applicationWillResignActive AppDelegate function was being called, the reset() function would cause a 'found nil while unwrapping an optional value' error. Not sure why the steppers need to be reset when the application resigns, honestly. I commented the observer out and it seems to work fine. If I'm wrong in this, or there's a better way to fix this error, please do inform me. Thanks!