Hopefully, this is an easy question. I am trying to obtain the UIView of a UIBarButtonItem. Looking at the following StackOverflow question I came up with the following code:
let notificationButton = UIBarButtonItem(image: UIImage(named: "icon_notification.png"), style: .plain, target: self, action: nil)
let notificationView = notificationButton.value(forKey: "view") as? UIView
However, notificationView is nil. So, thoughts on what I failed to interpret from the linked StackOverflow question?