~/talk

Subclassing Structs

TalkinFrenchat dotSwift 2017 · on Friday, 2017-01-27· [swift]
links:none on file
slides:none on file

Shows how to emulate a class hierarchy while keeping value semantics by using Swift enums with associated values plus composition instead of inheritance. Uses a concrete Post model that replaces optional fields with distinct enum cases for text, image, and video, demonstrates enum layout, initializers, pattern-matching switches, serialization, and protocol conformance, and argues this yields simpler state reasoning and predictable performance suitable for real app models.

AI-written summary · about

~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.