Storyboard bug setting up gesture recognizer?

Hooking up the long press gesture recognizer in a Swift storyboard did not work for me. Perhaps it was because the view was in an embedded view controller. Xcode connected the action to the method just fine, but did not add the view to the gesture’s gestureRecognizers (under Referencing Outlet Collections).

There are two fixes. Either connect it in code, or manually connect it from the outlets inspector. The code method is:

Swift 2.2
let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(longPressAction))
self.view.addGestureRecognizer(longPressRecognizer)