You can quickly override the ==(_:_:) and hash(into:) methods (isEqual: and hash for Objective-C) for your class. Press &shortcut:Generate; and select equals and hash (-isEqual: and hash for Objective-C). In the dialog that opens, select the properties that should be added to the ==(_:_:) and hash(into:) methods:
