I found that my iPad Pro with the Apple external keyboard case was inserting slanted quotes instead of the UTF-8 quote characters expected by the Python interpreter for string literals. This was causing me to get the error:
Warning: could not load custom attributes of view "xyz": invalid character in identifier
I had to detach the keyboard and use the on-screen keyboard to get the correct string literal characters inserted. Note this applies to the IOS keyboard that pops up when editing custom attributes in the UI designer.