Swift fun fact #1: You can use emoji characters in variable, constant, function, and class names

by Joey deVilla on June 3, 2014

swift kickBy allowing Unicode characters in constant and variable names, Apple’s new Swift programming language will allow programmers whose native languages don’t use the Roman alphabet to write code that makes more sense to them. Since emoji are part of the Unicode set, expect to see amusing code demos and search-and-replace pranks that look like this:

poopy swift code example

(And yes, this code compiles and runs on Swift using the XCode 6 beta.)

Want to see more Swift content?

Click here or on the “Swift Kick” logo near the top of this article to see all the Swift-related articles on Global Nerdy.

Previous post:

Next post: