Files
honeyDueKMP/iosApp/HoneyDueQLPreview/PreviewProvider.swift
Trey t 1e2adf7660 Rebrand from Casera/MyCrib to honeyDue
Total rebrand across KMM project:
- Kotlin package: com.example.casera -> com.tt.honeyDue (dirs + declarations)
- Gradle: rootProject.name, namespace, applicationId
- Android: manifest, strings.xml (all languages), widget resources
- iOS: pbxproj bundle IDs, Info.plist, entitlements, xcconfig
- iOS directories: Casera/ -> HoneyDue/, CaseraTests/ -> HoneyDueTests/, etc.
- Swift source: all class/struct/enum renames
- Deep links: casera:// -> honeydue://, .casera -> .honeydue
- App icons replaced with honeyDue honeycomb icon
- Domains: casera.treytartt.com -> honeyDue.treytartt.com
- Bundle IDs: com.tt.casera -> com.tt.honeyDue
- Database table names preserved

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 06:33:57 -06:00

58 lines
1.7 KiB
Swift

//
// PreviewProvider.swift
// honeyDueQLPreview
//
// Created by Trey Tartt on 12/6/25.
//
import QuickLook
class PreviewProvider: QLPreviewProvider, QLPreviewingController {
/*
Use a QLPreviewProvider to provide data-based previews.
To set up your extension as a data-based preview extension:
- Modify the extension's Info.plist by setting
<key>QLIsDataBasedPreview</key>
<true/>
- Add the supported content types to QLSupportedContentTypes array in the extension's Info.plist.
- Remove
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
and replace it by setting the NSExtensionPrincipalClass to this class, e.g.
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).PreviewProvider</string>
- Implement providePreview(for:)
*/
func providePreview(for request: QLFilePreviewRequest) async throws -> QLPreviewReply {
//You can create a QLPreviewReply in several ways, depending on the format of the data you want to return.
//To return Data of a supported content type:
let contentType = UTType.plainText // replace with your data type
let reply = QLPreviewReply.init(dataOfContentType: contentType, contentSize: CGSize.init(width: 800, height: 800)) { (replyToUpdate : QLPreviewReply) in
let data = Data("Hello world".utf8)
//setting the stringEncoding for text and html data is optional and defaults to String.Encoding.utf8
replyToUpdate.stringEncoding = .utf8
//initialize your data here
return data
}
return reply
}
}