After struggling to get NSUndoManager
to work correctly in a Swift-only app under OS X 10.11 El Capitan, I finally figured it out (and it works the same for iOS 9). The meat is in answer I posted to a StackOverflow question. Reposted below for completeness.