{"id":21241069,"url":"https://github.com/winkitee/infiniteimagescroller","last_synced_at":"2026-05-18T04:40:22.211Z","repository":{"id":251150581,"uuid":"836548310","full_name":"winkitee/InfiniteImageScroller","owner":"winkitee","description":"SwiftUI component for infinitely scrolling images horizontally with customizable labels and directions.","archived":false,"fork":false,"pushed_at":"2025-01-21T05:41:07.000Z","size":2500,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T06:25:39.130Z","etag":null,"topics":["infinite-scroll","ios","scroll","scrollview","swift","swiftui","swiftui-components","swiftui-framework"],"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/winkitee.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":"2024-08-01T04:51:19.000Z","updated_at":"2025-01-21T05:40:25.000Z","dependencies_parsed_at":"2024-12-18T05:38:36.101Z","dependency_job_id":null,"html_url":"https://github.com/winkitee/InfiniteImageScroller","commit_stats":null,"previous_names":["winkitee/infiniteimagescroller"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkitee%2FInfiniteImageScroller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkitee%2FInfiniteImageScroller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkitee%2FInfiniteImageScroller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkitee%2FInfiniteImageScroller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winkitee","download_url":"https://codeload.github.com/winkitee/InfiniteImageScroller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243680999,"owners_count":20330155,"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":["infinite-scroll","ios","scroll","scrollview","swift","swiftui","swiftui-components","swiftui-framework"],"created_at":"2024-11-21T00:54:26.341Z","updated_at":"2026-05-18T04:40:17.190Z","avatar_url":"https://github.com/winkitee.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InfiniteImageScroller\n\nSwiftUI component for infinitely scrolling images horizontally with customizable labels and directions. Compatible with iOS 13.0 and later.\n\n![InfiniteImageScroller Example](https://winkitee.github.io/InfiniteImageScroller/example_10.gif)\n\n## Installation\n\nTo install `InfiniteImageScroller` using Swift Package Manager, add the following to your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/winkitee/InfiniteImageScroller.git\", from: \"0.1.0\")\n]\n```\n\n## Usage\n\nHere are some examples of how to use InfiniteImageScroller in your SwiftUI project:\n\n```swift\nimport SwiftUI\n\nstruct ExampleView: View {\n    @State private var isLoading: Bool = true\n    @State private var images: [Image] = []\n\n    let colors: [Color] = [.red, .green, .blue]\n\n    var body: some View {\n        ScrollView {\n            VStack(spacing: 24) {\n                if images.count \u003e 0 {\n                    // First InfiniteImageScroller example\n                    InfiniteImageScroller(images) { (_, image) in\n                        image\n                            .resizable()\n                            .aspectRatio(contentMode: .fit)\n                            .clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))\n                    }\n\n                    // Second InfiniteImageScroller example with different configuration\n                    InfiniteImageScroller(\n                        images,\n                        item: .init(.fixed(200), spacing: 16),\n                        direction: .right\n                    ) { (_, image) in\n                        image\n                            .resizable()\n                            .aspectRatio(contentMode: .fit)\n                            .clipShape(Circle())\n                            .padding(20)\n                            .background(Circle().fill(.black))\n                    }\n\n                    // Third InfiniteImageScroller example with custom speed and background color\n                    InfiniteImageScroller(\n                        images,\n                        item: .init(.fixed(400), spacing: 24),\n                        speed: 0.5,\n                        direction: .right\n                    ) { (index, image) in\n                        image\n                            .resizable()\n                            .aspectRatio(contentMode: .fit)\n                            .clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))\n                            .padding(20)\n                            .background(RoundedRectangle(cornerRadius: 24, style: .continuous)\n                            .fill(colors[index % colors.count]))\n                    }\n                }\n            }\n        }\n        .background(Color.gray.opacity(0.1).edgesIgnoringSafeArea(.all))\n        .onAppear {\n            Task {\n                await fetchImages()\n            }\n        }\n    }\n\n    @MainActor\n    private func fetchImages() async {\n        isLoading = true\n        defer {\n            isLoading = false\n        }\n\n        let urls = [\n            \"https://picsum.photos/400\",\n            \"https://picsum.photos/400\",\n            \"https://picsum.photos/400\",\n            \"https://picsum.photos/400\",\n            \"https://picsum.photos/400\",\n            \"https://picsum.photos/400\",\n            \"https://picsum.photos/400\",\n            \"https://picsum.photos/400\",\n        ]\n\n        do {\n            var images = [Image]()\n            try await withThrowingTaskGroup(of: (String, Data).self) { group in\n                for url in urls {\n                    group.addTask {\n                        let (data, _) = try await URLSession.shared.data(from: URL(string: url)!)\n                        return (url, data)\n                    }\n                }\n\n                for try await (url, data) in group {\n                    if let uiImage = UIImage(data: data) {\n                        images.append(Image(uiImage: uiImage))\n                    } else {\n                        print(\"Failed to convert data to UIImage for URL: \\(url)\")\n                    }\n                }\n            }\n            self.images = images\n        } catch {\n            print(error)\n        }\n    }\n}\n\nstruct ExampleView_Previews: PreviewProvider {\n    static var previews: some View {\n        ExampleView()\n    }\n}\n```\n\n## Example Explanation\n\n### Infinite Scroller with Rounded Rectangles\n\n```swift\nInfiniteImageScroller(images) { (_, image) in\n    image\n        .resizable()\n        .aspectRatio(contentMode: .fit)\n        .clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))\n}\n```\n\nThis example demonstrates a simple InfiniteImageScroller with images clipped to a rounded rectangle shape.\n\n### Infinite Scroller with Circular Images and Black Background\n\n```swift\nInfiniteImageScroller(\n    images,\n    item: .init(.fixed(200), spacing: 16),\n    direction: .right\n) { (_, image) in\n    image\n        .resizable()\n        .aspectRatio(contentMode: .fit)\n        .clipShape(Circle())\n        .padding(20)\n        .background(Circle().fill(.black))\n}\n```\nThis example shows how to configure the InfiniteImageScroller with a fixed item size, custom spacing, and right scrolling direction. Images are clipped to a circular shape with a background.\n\n### Infinite Scroller with Custom Speed and Colored Background\n```swift\nInfiniteImageScroller(\n    images,\n    item: .init(.fixed(400), spacing: 24),\n    speed: 0.5,\n    direction: .right\n) { (index, image) in\n    image\n        .resizable()\n        .aspectRatio(contentMode: .fit)\n        .clipShape(RoundedRectangle(cornerRadius: 24, style: .continuous))\n        .padding(20)\n        .background(RoundedRectangle(cornerRadius: 24, style: .continuous)\n            .fill(colors[index % colors.count]))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinkitee%2Finfiniteimagescroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinkitee%2Finfiniteimagescroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinkitee%2Finfiniteimagescroller/lists"}