{"id":16426256,"url":"https://github.com/bdbergeron/remoteimage","last_synced_at":"2025-03-23T07:32:48.707Z","repository":{"id":196177670,"uuid":"694827112","full_name":"bdbergeron/RemoteImage","owner":"bdbergeron","description":"A drop-in alternative to SwiftUI's AsyncImage, with support for custom URLSessions, caching, and animated phase changes.","archived":false,"fork":false,"pushed_at":"2024-09-06T02:59:35.000Z","size":7832,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T09:35:36.953Z","etag":null,"topics":["ios","swift","swiftui"],"latest_commit_sha":null,"homepage":"https://bdbergeron.github.io/RemoteImage/documentation/remoteimage/","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/bdbergeron.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-09-21T19:20:21.000Z","updated_at":"2024-09-06T02:57:38.000Z","dependencies_parsed_at":"2024-04-02T17:48:35.582Z","dependency_job_id":"32a1f8df-c93f-4180-9a84-584010662b17","html_url":"https://github.com/bdbergeron/RemoteImage","commit_stats":null,"previous_names":["bdbergeron/remoteimage"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbergeron%2FRemoteImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbergeron%2FRemoteImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbergeron%2FRemoteImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbergeron%2FRemoteImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdbergeron","download_url":"https://codeload.github.com/bdbergeron/RemoteImage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221847069,"owners_count":16890959,"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":["ios","swift","swiftui"],"created_at":"2024-10-11T08:07:54.246Z","updated_at":"2024-10-28T15:12:51.171Z","avatar_url":"https://github.com/bdbergeron.png","language":"Swift","readme":"# 🖼️ RemoteImage\nA drop-in alternative to SwiftUI's `AsyncImage`, with support for custom URLSessions, caching, and animated phase changes.\n\n![build-ios](https://github.com/bdbergeron/remoteimage/actions/workflows/build-and-test-ios.yml/badge.svg)\n![build-macos](https://github.com/bdbergeron/remoteimage/actions/workflows/build-and-test-macos.yml/badge.svg)\n[![codecov](https://codecov.io/gh/bdbergeron/remoteimage/graph/badge.svg?token=1PYkoRXex8)](https://codecov.io/gh/bdbergeron/remoteimage)\n[![CodeFactor](https://www.codefactor.io/repository/github/bdbergeron/remoteimage/badge)](https://www.codefactor.io/repository/github/bdbergeron/remoteimage)\n\n## Getting Started\n\nAdd `RemoteImage` to your project via Swift Package Manager, and add `import RemoteImage` where you want to use it.\n\n```swift\n.package(url: \"https://github.com/bdbergeron/RemoteImage\", from: \"1.0.0\"),\n```\n\n## Usage\n\n`RemoteImage`'s APIs have been designed to make it super easy to adopt in your app/project. In most cases, it's a simple drop-in replacement for SwiftUI's `AsyncImage`.\n\nCheck out the `RemoteImage Demos` app in the Xcode project to see some live exmaples.\n\n![Demos](.github/readme/RemoteImageDemos.gif)\n\n### Simple Configuration\n\n```swift\nlet imageURL: URL?\n\n/// A simple `RemoteImage` view.\nRemoteImage(url: imageURL)\n\n/// A simple `RemoteImage` view with modifier closure.\nRemoteImage(url: imageURL) {\n  $0.resizable().scaledToFit()\n}\n\n/// A `RemoteImage` view with a custom placeholder view.\nRemoteImage(url: imageURL) {\n  $0.resizable().scaledToFit()\n} placeholder: {\n  ProgressView()\n}\n\n/// A `RemoteImage` view with custom placeholder and failure views.\nRemoteImage(url: imageURL) {\n  $0.resizable().scaledToFit()\n} placeholder: {\n  ProgressView()\n} failure: { error in\n  ZStack {\n    Color.yellow.opacity(0.3)\n    Text(\"Image could not be loaded.\")\n      .font(.caption)\n      .foregroundStyle(.secondary)\n  }\n}\n```\n\n### Advanced Configuration\n\n```swift\nlet imageURL: URL?\nlet urlSession = URLSession(configuration: .ephemeral)\nlet imageCache = URLCache(memoryCapacity: 10_000_000, diskCapacity: 0)\n\n/// Image loaded with a custom `URLSession` and using a custom phase transition animation.\nRemoteImage(\n  url: imageURL,\n  urlSession: urlSession,\n  configuration: RemoteImageConfiguration(\n    transaction: Transaction(\n      animation: .spring(duration: 1.0).delay(0.5))))\n{\n  $0.resizable().scaledToFit()\n}\n\n/// Image loaded from a custom cache. If the image is not yet cached, a new `URLSession`\n/// will be constructed using the `URLSessionConfiguration.default` configuration\n/// and the provided cache instance.\nRemoteImage(url: imageURL, cache: imageCache) {\n  $0.resizable().scaledToFit()\n} placeholder: {\n  ZStack {\n    Color.black.opacity(0.05)\n    ProgressView()\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdbergeron%2Fremoteimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdbergeron%2Fremoteimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdbergeron%2Fremoteimage/lists"}