init(directoryWithFileWrappers:)
Initializes the receiver as a directory file wrapper, with a given file-wrapper list.
Declaration
init(directoryWithFileWrappers childrenByPreferredName: [String : FileWrapper])Parameters
- childrenByPreferredName:
Key-value dictionary of file wrappers with which to initialize the receiver. The dictionary must contain entries whose values are the file wrappers that are to become children and whose keys are filenames. See TP40010672 CH13 SW1 in TP40010672 for more information about the file-wrapper list structure.
Return Value
Initialized file wrapper for fileWrappers.
Discussion
After initialization, the file wrapper is not associated with a file-system node until you save it using write(to:options:originalContentsURL:).
The receiver is initialized with open permissions: anyone can read, write, or modify the directory on disk.
If any file wrapper in the directory doesn’t have a preferred filename, its preferred name is automatically set to its corresponding key in the childrenByPreferredName dictionary.