{"id":22433617,"url":"https://github.com/gavinning/imagematrix","last_synced_at":"2025-10-04T17:54:59.835Z","repository":{"id":56915330,"uuid":"127728878","full_name":"gavinning/ImageMatrix","owner":"gavinning","description":"图片矩阵，九宫格","archived":false,"fork":false,"pushed_at":"2018-04-09T09:14:33.000Z","size":15499,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-10T13:02:06.093Z","etag":null,"topics":["ios","matrix","swift"],"latest_commit_sha":null,"homepage":null,"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/gavinning.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}},"created_at":"2018-04-02T08:38:18.000Z","updated_at":"2021-01-06T07:11:32.000Z","dependencies_parsed_at":"2022-08-21T02:50:40.977Z","dependency_job_id":null,"html_url":"https://github.com/gavinning/ImageMatrix","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gavinning/ImageMatrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2FImageMatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2FImageMatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2FImageMatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2FImageMatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinning","download_url":"https://codeload.github.com/gavinning/ImageMatrix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinning%2FImageMatrix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265430277,"owners_count":23763967,"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","matrix","swift"],"created_at":"2024-12-05T22:15:27.918Z","updated_at":"2025-10-04T17:54:54.745Z","avatar_url":"https://github.com/gavinning.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"ImageMatrix\n---\n图片矩阵，当然也可以做其他矩阵  \n  \n\n![](imageMatrix.gif)\n\n  \n### Install\n```sh\n// =\u003e Podfile\npod 'ImageMatrix'\n```\n```sh\npod install\n```\n\n### Requirements\n* iOS 10.0+\n* Swift 4.0+\n\n### Usage\n```swift\nlet imageMatrix = ImageMatrix(frame: CGRect(x: 0, y: 50, width: 375, height: 375))\n\n// 设置间隔\nimageMatrix.spacing = 20\n// 设置列 2为4宫格 3为9宫格\nimageMatrix.column = 3\n\n// items属性对应矩阵内的UIView\n// 对items执行增删操作，即会反应到UI上\n// 在UI上的增删实际也是对该数组的增删\nimageMatrix.items = [ImageMatrixItem(), ImageMatrixItem()]\n\n// 关闭动画 默认为true\nimageMatrix.isAnimate = false\n\nself.view.addSubview(imageMatrix)\n```\n  \nImageMatrixItem\n```swift\n// ImageMatrixItem是UIView的子类\n// 矩阵的元素是由ImageMatrixItem进行创建\nvar item = ImageMatrixItem()\n\n// 是否显示删除按钮\nitem.showDeleteIcon = true\n```\n\ndelegate\n```swift\n@objc protocol ImageMatrixDelegate {\n    \n    // 布局发生改变后\n    @objc optional func imageMatrix(didLayout imageMatrix: ImageMatrix, oldFrame: CGRect)\n    \n    // 新增子元素\n    @objc optional func imageMatrix(imageMatrix: ImageMatrix, didAdded item: ImageMatrixItem)\n    \n    // 子元素被删除\n    @objc optional func imageMatrix(imageMatrix: ImageMatrix, didRemoved item: ImageMatrixItem)\n}\n\n@objc public protocol ImageMatrixItemDelegate {\n    \n    // 布局发生改变后\n    @objc optional func imageMatrixItem(didLayout item: ImageMatrixItem)\n    \n    // 被删除时\n    @objc optional func imageMatrixItem(didRemoved item: ImageMatrixItem)\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fimagematrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinning%2Fimagematrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinning%2Fimagematrix/lists"}