{"id":13777806,"url":"https://github.com/JWAutumn/ACarousel","last_synced_at":"2025-05-11T11:34:17.525Z","repository":{"id":46572717,"uuid":"313049791","full_name":"JWAutumn/ACarousel","owner":"JWAutumn","description":"A carousel view for SwiftUI | SwiftUI 旋转木马效果","archived":false,"fork":false,"pushed_at":"2024-08-13T07:41:55.000Z","size":16574,"stargazers_count":413,"open_issues_count":29,"forks_count":81,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-17T13:37:52.835Z","etag":null,"topics":["carousel","image","image-scroll","ios","scroll","swift","swift5","swiftui"],"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/JWAutumn.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":"2020-11-15T14:32:03.000Z","updated_at":"2024-11-14T05:01:20.000Z","dependencies_parsed_at":"2024-07-06T03:31:29.370Z","dependency_job_id":"5abf9249-9d47-411b-922d-1c27ab79d1cc","html_url":"https://github.com/JWAutumn/ACarousel","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWAutumn%2FACarousel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWAutumn%2FACarousel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWAutumn%2FACarousel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWAutumn%2FACarousel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JWAutumn","download_url":"https://codeload.github.com/JWAutumn/ACarousel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253559414,"owners_count":21927582,"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":["carousel","image","image-scroll","ios","scroll","swift","swift5","swiftui"],"created_at":"2024-08-03T18:00:48.964Z","updated_at":"2025-05-11T11:34:16.414Z","avatar_url":"https://github.com/JWAutumn.png","language":"Swift","readme":"# ACarousel\n\nA carousel view for SwiftUI\n\n[中文文档](README.zh-CN.md)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src='https://img.shields.io/badge/Swift-5.1-green?style=flat'\u003e\n\u003cimg src='https://img.shields.io/badge/platform-iOS%20%7C%20macOS-lightgray.svg?style=flat'\u003e\n\u003cimg src='https://img.shields.io/badge/SMP-Supported-orange?style=flat'\u003e\n\u003cimg src='https://img.shields.io/github/license/JWAutumn/ACarousel'\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src='Resource/iPhoneDemo.gif' width='260'\u003e\u0026nbsp\u0026nbsp\u0026nbsp\n\u003cimg src='Resource/MacDemo.gif' width='350'\u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n  - [Requirements](#requirements)\n  - [Install](#install)\n  - [Usage](#usage)\n  - [Example](#example)\n  - [Maintainers](#maintainers)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n\n## Requirements\n\n- iOS 13.0+ / macOS 10.15+ / tvOS 13.0+\n- Xcode 11.0+\n- Swift 5.1+\n\n\n## Install\n\n### Swift Package Manager\n\nOpen `Xcode`, go to `File -\u003e Swift Packages -\u003e Add Package Dependency` and enter `https://github.com/JWAutumn/ACarousel`\n\nYou can also add `ACarousel` as a dependency to your `Package.swift`:\n```swift\ndependencies: [\n  .package(url: \"https://github.com/JWAutumn/ACarousel\", from: \"0.2.0\")\n]\n```\n\n### Manually\n\n[Download](https://github.com/JWAutumn/ACarousel/archive/main.zip) and open the project, drag the `ACarousel.swift` file into your own project.\n\n## Usage\n\n- Basic use: The parameters of `ACarousel` have default values, so you can simply pass in the data source and eat it ~\n```swift\nstruct Item: Identifiable {\n    let id = UUID()\n    let image: Image\n}\n\nlet roles = [\"Luffy\", \"Zoro\", \"Sanji\", \"Nami\", \"Usopp\", \"Chopper\", \"Robin\", \"Franky\", \"Brook\"]\n\nstruct ContentView: View {\n    \n    let items: [Item] = roles.map { Item(image: Image($0)) }\n    \n    var body: some View {\n        ACarousel(items) { item in\n            item.image\n                .resizable()\n                .scaledToFill()\n                .frame(height: 300)\n                .cornerRadius(30)\n        }\n        .frame(height: 300)\n    }\n}\n```\nor:\n```swift\n...\nvar body: some View {\n    ACarousel(roles, id: \\.self) { name in\n        Image(name)\n            .resizable()\n            .scaledToFill()\n            .frame(height: 300)\n            .cornerRadius(30)\n    }\n    .frame(height: 300)\n}\n...\n```\n- Customize configuration: You can configure the corresponding parameters to customize the display style according to your needs.\n```swift\n /// ...\n\nstruct ContentView: View {\n    \n    let items: [Item] = roles.map { Item(image: Image($0)) }\n    \n    var body: some View {\n        ACarousel(items,\n                  spacing: 10,\n                  headspace: 10,\n                  sidesScaling: 0.7,\n                  isWrap: true,\n                  autoScroll: .active(2)) { item in\n            item.image\n                .resizable()\n                .scaledToFill()\n                .frame(height: 300)\n                .cornerRadius(30)\n        }\n        .frame(height: 300)\n    }\n}\n```\n\n\n## Example\n[Download](https://github.com/JWAutumn/ACarousel/archive/main.zip) and open `ACarouselDemo -\u003e ACarouselDemo.xcodeproj`, run and view.\n\n## Maintainers\n\n[@JWAutumn](https://github.com/JWAutumn)，[@Underthestars-zhy](https://github.com/underthestars-zhy)， [@Alexander Chapliuk](https://github.com/krin-san)，[@thitran-incepit](https://github.com/thitran-incepit).\n\n\n## Contributing\n\nFeel free to dive in! [Open an issue](https://github.com/JWAutumn/ACarousel/issues/new) or submit PRs.\n\n\n## License\n\n[MIT](LICENSE) © JWAutumn\n","funding_links":[],"categories":["Swift","Carousel"],"sub_categories":["Content"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJWAutumn%2FACarousel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJWAutumn%2FACarousel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJWAutumn%2FACarousel/lists"}