If you’re calling this directly from a UIView (and not a UIViewController), it should be self.superview instead of self.view.superview.
If you’re calling this directly from a UIView (and not a UIViewController), it should be self.superview instead of self.view.superview.