Definitions
Protocols
Misc
Gotchas
Review
100

User perceived character

What is a grapheme cluster?

100

The protocol that only Substring and String conform to (do not declare new conformances to this)

What is StringProtocol?

100

The answer to:

let family1 =

What is 1?

100

Why indexing a String is not constant O(1) time

What is Unicode characters are not fixed width?

100

Uses & to denote this type of parameter, except with operators

What is an inout parameter?

200

Single value in Unicode code space with possible value of 0 to 0x10FFF

What is a code point?

200

The protocol that none of the String views conform to, which allows someone to access to the nth position in constant time

What is the RandomAccessCollection protocol?

200

The only type in the standard library that conforms to TextOutputStream

What is String?

200

NSString.compare(_:) does this, while NSString == does not

What is comparing canonical equivalence?

200

Uninvoked reference to a property, starting with "\"

What is a key path?

300

The standard code unit view for storing text or sending over a network

What is UTF8?

300

The reason why you can't iterate over a range of characters; you can only check if an array of Characters contains a certain letter

What is the Strideable protocol?

(Characters don't conform to Strideable protocol)

300

The two protocols needed to write and output a stream of data

BONUS: [Health worker emoji] - [man emoji]

What are TextOutputStream and TextOutputStreamable?

BONUS:What is ⚕️(staff of aesculapius)?

300

The reason why iterating over Strings is efficient

What is being able to use the previous' offset to calculate from, instead of starting from the beginning?

300

The type of nothingness that describes the "presence of nothing", as opposed to "a thing which cannot be" or "absence of a thing"

What is void?

Bonus points for other ones: never, nil

400

Bit patterns that aren't valid values for a particular type

What are extra inhabitants?

400

The protocol that String does conform to to make up for the fact that it is not a MutableCollection

What is RangeReplaceableCollection?

400

The in-memory representation Swift would use for this:

"To be or not to be"

But not this:

"Alas [skull emoji] poor Yorick"

What is 8-bit ASCII?

400

The null terminated representation of data

What is utf8CString?

400

[1,2,3] is this, but Array() is not

What is an array literal?

500

The global variable declaration in the standard library with the signature ((String) -> Void)?

What is _playgroundPrintHook?

500

The line that, if you forget to write it, makes some NSString members and methods inaccessible

What is "import Foundation"?

500

The reason why you can find the index of a Character in a string and use that same index in a UTF-16 code unit, but not the other way around

What is index sharing, but only down the abstraction ladder?

500

The reason why you should not return a substring from a function except for Sequence or Collection APIs and why it is not recommended to store substrings long-term

What is the fact that substrings hold onto the original string in memory?

500

The reason why structs cannot be delegates

What is the fact that structs have value semantics and cannot take advantage of weak references?

M
e
n
u