Thanks for writing this. I also needed this for my app — a gift-giving app where the user enters info about their friends and family. As the developer, I don’t need gender but it is relevant as part of the info a user keeps on their friends. I didn’t want to use radio buttons because that limits options (and I didn’t know what options to include) so I ended up with a text field that autocompletes male and female but allows anything.
I got a lot of negative usability feedback on this — that it’s too difficult, not intuitive, and makes a simple choice harder to save. I wonder if there is a better middle ground?