While the default iOS password now remains at 6 digits, it used to be 4 a couple of years back, there is a possibility for the users to opt for a more extended alpha-numeric code. And so, to get to this alternative, go to Settings > Touch ID and Password. From that point, you would see a “Password Options” tag that should give you a chance to pick a custom alphanumeric code for your iPhone.
While longer passwords surely give an additional layer of security, but the reality is that most users will never pick a 10-digit password. And at one point, there should be a balance maintained amongst convenience and security. So, in case you’re not in a situation to forfeit security for any reason, at that point you should simply try to think of a long alpha-numeric password.