How to get file size using FileManager + formatting
Read OriginalThis article provides a practical guide for Swift developers on how to get a file's size from its URL using FileManager's attributesOfItem method. It explains how to extract the size in bytes and then format it into a human-readable string (e.g., "24.4 MB") using Swift's built-in ByteCountFormatter class, including code examples and a reusable extension.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser