{"id":20936500,"url":"https://github.com/eneskaraosman/swipecell","last_synced_at":"2025-07-26T00:16:22.122Z","repository":{"id":43474114,"uuid":"262656447","full_name":"EnesKaraosman/SwipeCell","owner":"EnesKaraosman","description":"Swipe Left2Right \u0026 Right2Left, pure SwiftUI implementation","archived":false,"fork":false,"pushed_at":"2024-11-12T17:41:31.000Z","size":2000,"stargazers_count":278,"open_issues_count":0,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-26T07:22:12.227Z","etag":null,"topics":["custom-cell","left-to-right","swiftui","swipe","swipecell","swipecellkit"],"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/EnesKaraosman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"enesKaraosman","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2020-05-09T20:49:24.000Z","updated_at":"2025-03-30T02:50:46.000Z","dependencies_parsed_at":"2025-01-08T09:02:37.495Z","dependency_job_id":"8f3ef463-98c9-4cb0-8699-22fd34f4d1c6","html_url":"https://github.com/EnesKaraosman/SwipeCell","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/EnesKaraosman/SwipeCell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnesKaraosman%2FSwipeCell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnesKaraosman%2FSwipeCell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnesKaraosman%2FSwipeCell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnesKaraosman%2FSwipeCell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EnesKaraosman","download_url":"https://codeload.github.com/EnesKaraosman/SwipeCell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnesKaraosman%2FSwipeCell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267092553,"owners_count":24034805,"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-07-25T02:00:09.625Z","response_time":70,"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":["custom-cell","left-to-right","swiftui","swipe","swipecell","swipecellkit"],"created_at":"2024-11-18T22:20:00.660Z","updated_at":"2025-07-26T00:16:22.011Z","avatar_url":"https://github.com/EnesKaraosman.png","language":"Swift","funding_links":["https://github.com/sponsors/enesKaraosman"],"categories":[],"sub_categories":[],"readme":"# SwipeCell\n\n### Preview\n![](https://github.com/EnesKaraosman/SwipeCell/blob/master/Sources/SwipeCell/Resources/swipe_cell_both.png)\n\n### Features\n\n- [x] Swipe cell from Left2Right \u0026 Right2Left.\n- [ ] Destructive swipe\n\n### Usage\n\n* Simply add `onSwipe(leading, trailing)` method to your list item\n\n```swift\nList {\n    HStack {\n        Text(\"Enes Karaosman\")\n        Spacer()\n    }\n    .listRowInsets(EdgeInsets())\n    .onSwipe(leading: [\n      .. // here add slots\n    ])\n    \n}\n```\n\nBut what is `Slot`? \u003cbr\u003e\nIt's just a container that wraps your elements\n\n```swift\npublic struct Slot: Identifiable {\n    \n    /// The Icon will be displayed.\n    public let image: () -\u003e Image\n    \n    /// To allow modification on Text, wrap it with AnyView.\n    public let title: () -\u003e AnyView\n    \n    /// Tap Action\n    public let action: () -\u003e Void\n    \n    /// Style\n    public let style: SlotStyle\n}\n\npublic struct SlotStyle {\n    \n    /// Background color of slot.\n    public let background: Color\n    \n    /// Image tint color\n    public let imageColor: Color // default = .white\n    \n    /// Individual slot width\n    public let slotWidth: CGFloat // default = 60\n}\n```\n\nThat's it, here is full working example\n\n```swift\nstruct SwipeCellDemoView: View {\n    \n    var slidableContent: some View {\n        HStack(spacing: 16) {\n            Image(systemName: \"person.crop.circle.fill\")\n            .resizable()\n            .scaledToFit()\n            .foregroundColor(.secondary)\n            .frame(height: 60)\n            \n            VStack(alignment: .leading) {\n                Text(\"Enes Karaosman\")\n                .fontWeight(.semibold)\n            \n                Text(\"eneskaraosman53@gmail.com\")\n                .foregroundColor(.secondary)\n            }\n        }.padding()\n    }\n    \n    var slots = [\n        // First item\n        Slot(\n            image: {\n                Image(systemName: \"envelope.open.fill\")\n            },\n            title: {\n                Text(\"Read\")\n                .foregroundColor(.white)\n                .font(.footnote)\n                .fontWeight(.semibold)\n                .embedInAnyView()\n            },\n            action: { print(\"Read Slot tapped\") },\n            style: .init(background: .orange)\n        ),\n        // Second item\n        Slot(\n            image: {\n                Image(systemName: \"hand.raised.fill\")\n            },\n            title: {\n                Text(\"Block\")\n                .foregroundColor(.white)\n                .font(.footnote)\n                .fontWeight(.semibold)\n                .embedInAnyView()\n            },\n            action: { print(\"Block Slot Tapped\") },\n            style: .init(background: .blue, imageColor: .red)\n        )\n    ]\n    \n    var left2Right: some View {\n        slidableContent\n        .frame(height: 60)\n        .padding()\n        .onSwipe(leading: slots)\n    }\n    \n    var right2Left: some View {\n        slidableContent\n        .frame(height: 60)\n        .padding()\n        .onSwipe(trailing: slots)\n    }\n    \n    var leftAndRight: some View {\n        slidableContent\n        .frame(height: 60)\n        .padding()\n        .onSwipe(leading: slots, trailing: slots)\n    }\n    \n    var items: [AnyView] {\n        [\n            left2Right.embedInAnyView(),\n            right2Left.embedInAnyView(),\n            leftAndRight.embedInAnyView()\n        ]\n    }\n    \n    var body: some View {\n        NavigationView {\n            List {\n                ForEach(items.indices, id: \\.self) { idx in\n                    self.items[idx]\n                }.listRowInsets(EdgeInsets())\n            }.navigationBarTitle(\"Messages\")\n        }\n    }\n    \n}\n```\n\n### Custom\n\nIn demo I used system images, but using local image is allowed as well.\n\n```swift\nListItem\n    .onSwipe(leading: [\n        Slot(\n            image: {\n                Image(\"localImageName\")\n                    // To allow colorifying\n                    .renderingMode(.template)\n            },\n            title: {\n                Text(\"Title\").embedInAnyView()\n            },\n            action: { print(\"Slot tapped\") },\n            style: .init(background: .orange)\n        )\n    ])\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feneskaraosman%2Fswipecell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feneskaraosman%2Fswipecell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feneskaraosman%2Fswipecell/lists"}