I want to display a message to the user in the same way as the following message "Invalid password" but I do not know what this kind of messages are called, and how they can be implemented.
These are not standard messages, they are just UIView
s (with a slight transparancy) that are located on top of the view stack and being hidden and displayed due to some events.
Just search for something like "overlay views" in a search engine of your choice. I quickly found the following (without knowing them):
https://github.com/SwiftKickMobile/SwiftMessages
http://zappdesigntemplates.com/create-your-own-overlay-view-in-swift/