Access String value in enum without using rawValue

While I didn’t find a way to do this using the desired syntax with enums, this is possible using structs. struct DatabaseKeys { struct User { static let identifier = “User” static let Username = “username” } } To use: myUser[DatabaseKeys.User.Username] = “Johnny” Apple uses structs like this for storyboard and row type identifiers in … Read more

UTF8 vs. UTF16 vs. char* vs. what? Someone explain this mess to me!

Check out Joel Spolsky’s The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) EDIT 20140523: Also, watch Characters, Symbols and the Unicode Miracle by Tom Scott on YouTube – it’s just under ten minutes, and a wonderful explanation of the brilliant ‘hack’ that is UTF-8

What are Pascal Strings?

Pascal strings were made popular by one specific, but huge influential Pascal implementation, named UCSD. So UCSD Strings is a better term. This is the same implementation that made bytecode interpreters popular. In general it is not one specific type, but the basic principle of having the size prefixed to the character data. This makes … Read more