The documentation states that UINib
will throw and exception if nibName
is not found.
let nib = UINib(nibName: , bundle: )
Unfortunately, it's not marked with throws
so I cannot capture the error.
Checking the .xib
file exists using the following
FileManager.default.fileExists(atPath: )
The documentation for fileExists(atPath: )
highlights race conditions, file permissions and security. So the best way to move forward with file introspection is to just load the file and handle any erros loading the file rather than check it's location first.
So is there any way to load a nib without using the class UINib?