{"id":17163239,"url":"https://github.com/noppefoxwolf/mediaviewer","last_synced_at":"2025-04-13T14:42:13.374Z","repository":{"id":204851842,"uuid":"711796131","full_name":"noppefoxwolf/MediaViewer","owner":"noppefoxwolf","description":"MediaViewer is customizable preview library","archived":false,"fork":false,"pushed_at":"2024-02-01T13:01:58.000Z","size":3772,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-02T05:46:05.895Z","etag":null,"topics":["image-viewer","ios","swift"],"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/noppefoxwolf.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}},"created_at":"2023-10-30T07:39:35.000Z","updated_at":"2024-02-13T03:08:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"8fb277d8-0d3a-4bb1-9ec8-46f23545854a","html_url":"https://github.com/noppefoxwolf/MediaViewer","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"440ba3b85e9bfad2cc7b23e59b9207bfbed901b4"},"previous_names":["noppefoxwolf/mediaviewer"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMediaViewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMediaViewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMediaViewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noppefoxwolf%2FMediaViewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noppefoxwolf","download_url":"https://codeload.github.com/noppefoxwolf/MediaViewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248731593,"owners_count":21152835,"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":["image-viewer","ios","swift"],"created_at":"2024-10-14T22:48:19.770Z","updated_at":"2025-04-13T14:42:13.336Z","avatar_url":"https://github.com/noppefoxwolf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MediaViewer\n\n![](https://github.com/noppefoxwolf/MediaViewer/blob/main/.github/example.gif)\n\n## Features\n\n- [x] No dependencies\n- [x] Playback video\n- [x] Morphing transition\n- [x] Waiting for preview with thumbnail\n- [x] Custom preview\n- [x] Lazy load asset\n- [x] Landscape\n\n## Installation\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/noppefoxwolf/MediaViewer\", from: \"x.x.x\")\n],\n```\n\n## Usage\n\n### PreviewItem\n\nThe ﻿`PreviewItem` is a protocol that provides the behavior necessary for previewing.\n`UIImage` and `AVPlayer` have built-in implementations. \nIt can also be customized. \n\n```swift\nextension String: PreviewItem {\n    func makeViewController() async -\u003e UIViewController {\n        UIHostingController(rootView: Text(self))\n    }\n    \n    func makeThumbnailViewController() -\u003e UIViewController? {\n        nil\n    }\n}\n```\n\n### PreviewController\n\n`PreviewItem` are displayed using `PreviewController`.\n`PreviewController` uses a `PreviewControllerDataSource` to retrieve `PreviewItem`.\n\n```swift\nlet vc = PreviewController()\nvc.delegate = self\nvc.dataSource = self\npresent(vc, animated: true)\n```\n\n### PreviewControllerDataSource\n\n```swift\nfunc numberOfPreviewItems(in controller: PreviewController) -\u003e Int\nfunc previewController(_ controller: PreviewController, previewItemAt index: Int) -\u003e any PreviewItem\n```\n\n### PreviewControllerDelegate\n\n`PreviewControllerDelegate` supports animations on transitions.\n\n```swift\nfunc previewController(_ controller: PreviewController, transitionViewFor item: any PreviewItem) -\u003e UIView?\n```\n\n## Apps Using\n\n\u003cp float=\"left\"\u003e\n    \u003ca href=\"https://apps.apple.com/app/id1668645019\"\u003e\u003cimg src=\"https://github.com/noppefoxwolf/MediaViewer/blob/main/.github/dawn.png\" height=\"65\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nIf you use a MediaViewer, add your app via Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoppefoxwolf%2Fmediaviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoppefoxwolf%2Fmediaviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoppefoxwolf%2Fmediaviewer/lists"}