Swift – Get file size from url
First of all, in the file system you get the path of a URL with the path property. self.path = url.path But you don’t need that at all. You can retrieve the file size from the URL directly: self.path = String(describing: self.file!) // url to string do { let resources = try url.resourceValues(forKeys:[.fileSizeKey]) let fileSize … Read more