{"id":15723945,"url":"https://github.com/flocked/fzquicklook","last_synced_at":"2025-05-13T03:58:48.278Z","repository":{"id":169362731,"uuid":"645302038","full_name":"flocked/FZQuicklook","owner":"flocked","description":"Framework For Quicklook Previews","archived":false,"fork":false,"pushed_at":"2025-05-11T00:44:44.000Z","size":841,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T03:58:40.963Z","etag":null,"topics":["appkit","cocoa","macos","quicklook","uikit"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flocked.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-25T11:01:34.000Z","updated_at":"2025-05-11T00:44:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"9794dad0-5fd2-482a-9e83-03a001679500","html_url":"https://github.com/flocked/FZQuicklook","commit_stats":null,"previous_names":["flocked/fzquicklook"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FFZQuicklook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FFZQuicklook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FFZQuicklook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flocked%2FFZQuicklook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flocked","download_url":"https://codeload.github.com/flocked/FZQuicklook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870858,"owners_count":21976612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appkit","cocoa","macos","quicklook","uikit"],"created_at":"2024-10-03T22:13:51.444Z","updated_at":"2025-05-13T03:58:48.250Z","avatar_url":"https://github.com/flocked.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FZQuicklook\n\nCreate previews of files presented either in a panel similar to Finder's Quicklook or in a view.\n\n**For a full documentation take a look at the** [Online Documentation](https://swiftpackageindex.com/flocked/FZQuicklook/documentation/).\n\n## QuicklookPreviewable\n A protocol that defines a set of properties you implement to make a preview that can be displayed by `QuicklookPanel` and `QuicklookView`. `URL`, `NSURL` and `AVURLAsset` conform to `QuicklookPreviewable`.\n \n ```swift\n struct GalleryItem: QuicklookPreviewable {\n    let title: String\n    let imageURL: URL\n \n    var previewItemURL: URL? {\n        return imageURL\n    }\n \n    var previewItemTitle: String? {\n        return title\n    }\n }\n \n QuicklookPanel.shared.preset(aGalleryItem)\n ```\n\n## QuicklookPanel\nPresents previews of files in a panel simliar to Finder`s Quicklook. \n\n```swift\n// URL is compatible `QuicklookPreviewable`\nQuicklookPanel.shared.present(fileURLs)\n```\n\n## QuicklookView\n A preview of a file that you can embed into your view hierarchy.\n \n```swift\nlet quicklookView = QuicklookView(content: fileURL)\n```\n\n## Quicklook for NSTableView \u0026 NSCollectionView\nNSCollectionView/NSTableView `isQuicklookPreviewable` enables quicklook of items/cells.\n\nThere are several ways to provide quicklook previews:\n- NSCollectionViewItems's \u0026 NSTableCellView's `var quicklookPreview: QuicklookPreviewable?`\n\n```swift\ncollectionViewItem.quicklookPreview = URL(fileURLWithPath: \"someFile.png\")\n```\n- NSCollectionView's datasource `collectionView(_ collectionView: NSCollectionView, quicklookPreviewForItemAt indexPath: IndexPath)` \u0026 NSTableView's datasource `tableView(_ tableView: NSTableView, quicklookPreviewForRow row: Int)`\n\n```swift\nfunc collectionView(_ collectionView: NSCollectionView, quicklookPreviewForItemAt indexPath: IndexPath) -\u003e QuicklookPreviewable? {\n    let galleryItem = galleryItems[indexPath.item]\n    return galleryItem.fileURL\n}\n```\n- A NSCollectionViewDiffableDataSource \u0026 NSTableViewDiffableDataSource with an ItemIdentifierType conforming to `QuicklookPreviewable`\n\n```swift\nstruct GalleryItem: QuicklookPreviewable {\n    let title: String\n    let imageURL: URL\n    \n    // The file url for quicklook preview.\n    let previewItemURL: URL? {\n        return imageURL\n    }\n    \n    let previewItemTitle: String? {\n        return title\n    }\n}\n  \ncollectionView.dataSource = NSCollectionViewDiffableDataSource\u003cSection, GalleryItem\u003e(collectionView: collectionView) { \ncollectionView, indexPath, galleryItem in\n// configurate data source\n}\n\n// …\ncollectionView.quicklookSelectedItems()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflocked%2Ffzquicklook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflocked%2Ffzquicklook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflocked%2Ffzquicklook/lists"}