morenoh149 / react-native-contacts

React Native Contacts
MIT License
1.64k stars 560 forks source link

Update RCTContacts.m to use correct UIBarButtonItemStyle constant #658

Closed NSProgrammer closed 2 years ago

NSProgrammer commented 2 years ago

openExistingContact:... was creating a UIBarButtonItem with a style of UIBarButtonSystemItemCancel. However UIBarButtonSystemItemCancel is not a style, it is a type of item. Instead we should use UIBarButtonItemStyleDone

This will avoid raising a -Wenum-conversion error and fixes the bug for the style ending up being the deprecated UIBarButtonItemStyleBordered (0x1) by accident.

You can verify by enabling -Wenum-conversion and -Werror=enum-conversion in your compilation. The current state of the code will fail with a compiler error for using the wrong enum value. Building with this change will succeed without issue.