To save an array of UIImages to User Defaults, you need to convert the array to an array of Data objects, which can be stored in User Defaults. Here is the code to do that:
main.swift268 chars8 lines
To retrieve the array of UIImages from User Defaults, you need to reverse the process:
main.swift395 chars10 lines
Note that if the array of UIImages is large, it may be more efficient to save it to disk instead of User Defaults. In that case, you can use FileManager to write the array of Data objects to a file, and read it back when needed.
gistlibby LogSnag