Some fiddling with Swift code.
Consolidate the NSURL resource identifier checker to one function.
Minor changes.