-
Notifications
You must be signed in to change notification settings - Fork 113
Preview is rendered wrong in dark mode #11
Comments
Not sure if this is a UIKit bug. |
I believe this is a UIKit bug. |
I heard iOS 11.3 will fix a lot of bugs in UIDocumentBrowserViewController, hopefully fixes this glitch. |
I use 11.3 😄 |
How are previews generated? Does the system create the thumbnail or is the app rendering it in an extension? |
The system creates it, so out of our control I’m afraid 😕. |
Yeah, it's just a simple line of code and iOS should automatically set colors, previews, and everything. |
If iOS isn't providing correct/good thumbnail renderings, we do have a couple options to work around it. Option 1We could manually generate a thumbnail and set the appropriate resource key as part of the save process for the override func fileAttributesToWrite(to url: URL, for saveOperation: UIDocumentSaveOperation) throws -> [AnyHashable : Any] {
let thumbnail = thumbnailForDocument(at: url)
return [
URLResourceKey.thumbnailDictionaryKey: [
URLThumbnailDictionaryItem.NSThumbnail1024x1024SizeKey: thumbnail
]
]
} This would be the option I'd recommend as we're only handling it for documents that Textor has created/edited and not text documents system wide. For further reference see:
Option 2We could support the new thumbnail extension that came with iOS 11. There's an Xcode template for this. Essentially, the core method is:
I don't recommend this as we aren't the primary owners of the text UTI type. We aren't dealing with a custom document format, which is what this is designed for. For further reference see: |
To reproduce, quickly tap the Add button, type a short word and tap Done.
After editing several times, it becomes fully white as expected.
The text was updated successfully, but these errors were encountered: