Since the warning refers to Swift, I suppose your mock is written in Swift.
In that case you need to add an @objc attribute with a name to it, just as the warning suggests.
If this is the first version of your app (i.e. it is not an update to an already published app), it can be just a prefixed name like this:
@objc(ABCDEFMockUser)class MockUser: NSObject, NSCoding {
...
}
*note that "ABCDEF" here is anything you want, but "MockUser" has to match your class name.
But if there is a live version of your app already in the wild and you don't want it to crash after update, you will need a special name there. This name is written in the Xcode's warning itself. In your case it is:
@objc(_TtCC13Foo27Bar8MockUser)class MockUser: NSObject, NSCoding {
...
}
Actually the easiest way is to just click the yellow warning sign and hit "Fix" in the very first Xcode's suggestion saying "For compatibility with existing archives use...". That's it.