{"id":13465779,"url":"https://github.com/imgix/imgix-swift","last_synced_at":"2025-10-13T20:06:53.334Z","repository":{"id":52194923,"uuid":"62355463","full_name":"imgix/imgix-swift","owner":"imgix","description":"A Swift client library for generating URLs with imgix","archived":false,"fork":false,"pushed_at":"2024-12-14T12:18:46.000Z","size":422,"stargazers_count":25,"open_issues_count":5,"forks_count":10,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-10-04T18:39:34.552Z","etag":null,"topics":["carthage","cocoapods","images","imgix","signing-imgix-urls","src","srcset","swift","url-builder"],"latest_commit_sha":null,"homepage":"https://www.imgix.com","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imgix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.MD","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-07-01T02:15:29.000Z","updated_at":"2024-02-21T21:53:00.000Z","dependencies_parsed_at":"2025-04-12T10:53:35.790Z","dependency_job_id":null,"html_url":"https://github.com/imgix/imgix-swift","commit_stats":{"total_commits":114,"total_committers":13,"mean_commits":8.76923076923077,"dds":0.5350877192982456,"last_synced_commit":"e69365a58fd3b81c78829800eb5f7d06c1721912"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/imgix/imgix-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgix%2Fimgix-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgix%2Fimgix-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgix%2Fimgix-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgix%2Fimgix-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imgix","download_url":"https://codeload.github.com/imgix/imgix-swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imgix%2Fimgix-swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016929,"owners_count":26085905,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["carthage","cocoapods","images","imgix","signing-imgix-urls","src","srcset","swift","url-builder"],"created_at":"2024-07-31T15:00:35.308Z","updated_at":"2025-10-13T20:06:53.318Z","avatar_url":"https://github.com/imgix.png","language":"Swift","funding_links":[],"categories":["Libs","Images [🔝](#readme)"],"sub_categories":["Images"],"readme":"\u003c!-- ix-docs-ignore --\u003e\n![imgix logo](https://assets.imgix.net/sdk-imgix-logo.svg)\n\n`imgix-swift` is a client library for generating image URLs with [imgix](https://www.imgix.com/). Written in Swift, but can be used with Objective-C codebases as well.\n\n[![CocoaPods](https://img.shields.io/cocoapods/v/ImgixSwift.svg)](https://cocoapods.org/pods/ImgixSwift)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n![Build Status](https://img.shields.io/circleci/build/github/imgix/imgix-swift)\n![Supported Platforms](https://img.shields.io/cocoapods/p/ImgixSwift.svg)\n[![License](https://img.shields.io/github/license/imgix/imgix-swift)](https://github.com/imgix/imgix-swift/blob/main/LICENSE.md)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fimgix%2Fimgix-swift.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fimgix%2Fimgix-swift?ref=badge_shield)\n\n---\n\u003c!-- /ix-docs-ignore --\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n    * [Swift](#swift)\n    * [Objective-C](#objective-c)\n- [Advanced Usage](#advanced-usage)\n    * [Automatic Signing](#automatic-signing)\n    * [Automatic Base64 Encoding](#automatic-base64-encoding)\n    * [URL Reconstruction](#url-reconstruction)\n    * [What is the `ixlib` param](#what-is-the-ixlib-param)\n- [License](#license)\n\n## Installation\n\n- **[Carthage](https://github.com/carthage/carthage):** `github \"imgix/imgix-swift\"`\n- **[CocoaPods](https://github.com/cocoapods/cocoapods):** `pod \"ImgixSwift\"`\n- **[Swift Package Manager](https://github.com/apple/swift-package-manager)**:\n\n```swift\n// add the following to your Package.swift manifest, within the dependencies array\n\n.package(url: \"https://github.com/imgix/imgix-swift.git\", from: \"1.0.0\")\n\n// add the package name \"ImgixSwift\" to the list of named dependencies in your project target\n\n.target(\n    name: \"YourSwiftProject\",\n    dependencies: [\"ImgixSwift\"]),\n```\n\nAs of version [`1.0.0`](https://github.com/imgix/imgix-swift/releases/tag/1.0.0) imgix Swift client is compatible with Swift 5.0.\n\nThe latest version compatible with Swift 4.0 is [`0.4.3`](https://github.com/imgix/imgix-swift/releases/tag/0.4.3).\n\nThe latest version compatible with Swift 3.0 is [`0.3.0`](https://github.com/imgix/imgix-swift/releases/tag/0.3.0).\n\n## Usage\n\n### Swift\n\n``` swift\n// Import the framework\nimport ImgixSwift\n\n// Set up an ImgixClient\nlet client = ImgixClient.init(host: \"assets.imgix.net\")\n\n// Build a basic URL\nclient.buildUrl(\"dog.jpg\") // =\u003e https://assets.imgix.net/dog.jpg\n\n// Add some parameters\nclient.buildUrl(\"dog.jpg\", params: [\n  \"w\": 300,\n  \"h\": 300,\n  \"fit\": \"crop\"\n]) // =\u003e https://assets.imgix.net/dog.jpg?fit=crop\u0026h=300\u0026w=300\n```\n\n### Objective-C\n\nIf your project doesn't contain any other Swift code, make sure to set your target's `Build Settings \u003e Build Options \u003e Embedded Content Contains Swift Code` to `YES`.\n\n``` objective-c\n// Import the framework\n#import \u003cImgixSwift/ImgixSwift.h\u003e\n\n// Set up an ImgixClient\nImgixClient *client = [[ImgixClient alloc] initWithHost:@\"assets.imgix.net\"];\n\n// Build a basic URL\n[client buildUrl:@\"dog.jpg\"]; // =\u003e https://assets.imgix.net/dog.jpg\n\n// Add some parameters\n[client buildUrl:@\"dog.jpg\", params:@{\n  @\"w\": @300,\n  @\"h\": @300,\n  @\"fit\": @\"crop\",\n}]; // =\u003e https://assets.imgix.net/dog.jpg?fit=crop\u0026h=300\u0026w=300\n```\n\n## Advanced Usage\n\n### Automatic Signing\n\nIf you're using a source that requires signed URLs, imgix-swift can automatically build and sign them for you.\n\n``` swift\nlet signedClient = ImgixClient.init(\n  host: \"imgix-library-secure-test-source.imgix.net\",\n  secureUrlToken: \"EHFQXiZhxP4wA2c4\"\n)\n\nsignedClient.buildUrl(\"dog.jpg\", params: [\n  \"bri\": 50\n]) // =\u003e https://imgix-library-secure-test-source.imgix.net/dog.jpg?bri=50\u0026s=3b293930d9c288fb788657fd9ed8164f\n```\n\n### Automatic Base64 Encoding\n\nimgix-swift will automatically Base64-encode any parameter key ending in `64`, according to the requirements of imgix's [Base64 variant parameters](https://docs.imgix.com/apis/url#base64-variants).\n\n``` swift\nlet client = ImgixClient.init(host: \"assets.imgix.net\")\n\nclient.buildUrl(\"dog.jpg\", params: [\n  \"w\": 640,\n  \"txt64\": \"🐶 Puppy!\",\n  \"txtfont64\": \"Avenir Next Demi,Bold\",\n  \"txtalign\": \"center,top\",\n  \"txtpad\": 50,\n  \"txtshad\": 10,\n  \"txtclr\": \"fff\",\n  \"txtfit\": \"max\",\n  \"txtsize\": 50\n]) // =\u003e https://assets.imgix.net/dog.jpg?txt64=8J-QtiBQdXBweSE\u0026txtalign=center%2Ctop\u0026txtclr=fff\u0026txtfit=max\u0026txtfont64=QXZlbmlyIE5leHQgRGVtaSxCb2xk\u0026txtpad=50\u0026txtshad=10\u0026txtsize=50\u0026w=640\n```\n\n### URL Reconstruction\n\nYou can reconstruct existing URLs by using the `ImgixClient#reconstruct` method. Existing parameters on the input URL will be merged and/or overridden by passed params.\n\n``` swift\nlet client = ImgixClient.init(host: \"assets.imgix.net\")\nlet inputUrl = URL.init(string: \"https://paulstraw.imgix.net/pika.jpg?w=300\")!\n\nclient.reconstruct(originalURL: inputUrl, params: [\n  \"h\": 300,\n  \"fit\": \"crop\"\n]) // =\u003e https://paulstraw.imgix.net/pika.jpg?fit=crop\u0026h=300\u0026w=300\n```\n\n### What is the `ixlib` param\n\nFor security and diagnostic purposes, we default to signing all requests with the language and version of library used to generate the URL. This can be disabled by setting `client.includeLibraryParam = false`.\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fimgix%2Fimgix-swift.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fimgix%2Fimgix-swift?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimgix%2Fimgix-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimgix%2Fimgix-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimgix%2Fimgix-swift/lists"}