2

I’m using the default iOS file manager for a Swift application. I’m writing the class for a UIDocumentBrowserViewController and I want the whole file name to show. For example rather than Untitled, I want Untitled.txt. Or rather than script, script.py.

As a side note, I notice that the actual files app does not have functionality to show the extension.

1
  • I apologize for poor formatting, will edit question later. Commented Jul 6, 2019 at 16:01

1 Answer 1

2

Sometimes its worth to check apple documentation) https://developer.apple.com/documentation/uikit/uidocumentbrowserviewcontroller

As I see it is possible to show file's extension, with help of var shouldShowFileExtensions: Bool from UIDocumentBrowserViewController. But to our sorrow it's available only from iOS 13.0+.

And as Apple says about this property https://developer.apple.com/documentation/uikit/uidocumentbrowserviewcontroller/3153159-shouldshowfileextensions

The default value is false.

This property has no effect in iPad apps running in macOS.

Sign up to request clarification or add additional context in comments.

2 Comments

I appreciate it. I saw nothing online because it is still in beta. And I looked through the documentation, but the current one (not the beta one). Cheers
This is all nice to read, but in practice it doesn't do anything. Adding .shouldShowFileExtensions = true still doesn't show filenames. So frustrating. Why would anyone NOT want to show filenames is beyond my imagination... It just adds confusion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.