Because Objective‑C does not support namespaces, a Slice module maps to a prefix for the identifiers defined inside the modules. By default, the prefix is the same as the name of the module:
With this definition, the Slice Color identifier is mapped to the Objective‑C identifier
exampleColor.
With this definition, Vehicle maps to
OUTVehicle. However,
Color still maps to
outerinnerColor, that is, the metadata directive applies only to types defined in the
outer module, but not to types that are defined in nested modules. If you want to assign a prefix for types in the nested module, you must use a separate metadata directive, for example:
For the remainder of the examples in this chapter, we assume that Slice definitions are enclosed by a module
Example with a
["objc:prefix:EX"] metadata directive.