How to get a count of the characters allowed for use in url passwords in any language.

The documentation states CharacterSet and CharacterSet.urlPasswordAllowed are each a set, assuming a Swift set.  As such I should be allowed to append “.count”.

 

“However, I get a compiler error: “Value of type ‘CharacterSet’ has no member ‘count'”.

 

Inserting this into my code:

for char in CharacterSet.urlPasswordAllowed { print(char) }

 

compiler error:

Type ‘CharacterSet’ does not conform to protocol ‘Sequence’

 

Which indicates CharacterSet is not a Swift set.

 

Inserting this into my code:

print(CharacterSet.urlPasswordAllowed)

 

prints output to debugging area:

 

 

How then can I get a count of the characters allowed for use in url passwords in any language?

I assume Apple has this set defined for every language that has a system font defined.

Powered by WPeMatico

You may also like...

Comments are closed.