{"id":15561346,"url":"https://github.com/ahmetkgunay/collageview","last_synced_at":"2025-06-19T08:35:02.086Z","repository":{"id":49046858,"uuid":"98220561","full_name":"ahmetkgunay/CollageView","owner":"ahmetkgunay","description":"Easy to use and fully customizable CollageView with multiple images inside. ","archived":false,"fork":false,"pushed_at":"2021-06-30T07:50:55.000Z","size":16781,"stargazers_count":20,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T22:43:36.488Z","etag":null,"topics":["collage","collageview","images","swift4"],"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/ahmetkgunay.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":"2017-07-24T18:11:10.000Z","updated_at":"2025-02-26T21:29:15.000Z","dependencies_parsed_at":"2022-09-09T03:00:28.732Z","dependency_job_id":null,"html_url":"https://github.com/ahmetkgunay/CollageView","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ahmetkgunay/CollageView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetkgunay%2FCollageView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetkgunay%2FCollageView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetkgunay%2FCollageView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetkgunay%2FCollageView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmetkgunay","download_url":"https://codeload.github.com/ahmetkgunay/CollageView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetkgunay%2FCollageView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260716269,"owners_count":23051416,"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":["collage","collageview","images","swift4"],"created_at":"2024-10-02T16:07:33.108Z","updated_at":"2025-06-19T08:34:57.063Z","avatar_url":"https://github.com/ahmetkgunay.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CollageView\n\n[![Version](https://img.shields.io/cocoapods/v/CollageView.svg?style=flat)](http://cocoapods.org/pods/CollageView)\n[![License](https://img.shields.io/cocoapods/l/CollageView.svg?style=flat)](http://cocoapods.org/pods/CollageView)\n[![Platform](https://img.shields.io/cocoapods/p/CollageView.svg?style=flat)](http://cocoapods.org/pods/CollageView)\n\u003ca href=\"https://swift.org\"\u003e\n\u003cimg src=\"http://img.shields.io/badge/Swift-4.0-brightgreen.svg\" alt=\"Language\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://twitter.com/ahmtgny\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/contact-@ahmtgny-blue.svg?style=flat\" alt=\"Twitter: @ahmtgny\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/ahmetkgunay/CollageView/tree/master/Source\"\u003e\n\u003cimg src=\"https://img.shields.io/gemnasium/mathiasbynens/he.svg?style=flat\"\u003e\n\u003c/a\u003e\n\nCustom View, collageView implementation with pure swift4.\n\nThis Library's aim is to make easily photo collage views.\n\n![Anim](https://github.com/ahmetkgunay/CollageView/blob/master/Gifs/collageView.gif)\n\n## Usage\n\nLike any other customViews, can be used with changing your view's class name as \"CollageView\" or initialize in code.\n\n- Interface Builder\n\n\u003cp align=\"left\"\u003e\n\u003cimg src=\"Images/interfaceClassName.png\" width=\"300\" max-width=\"50%\"/\u003e\n\u003c/p\u003e\n\n```swift\n\nclass ViewController: UIViewController {\n\n    //Assume that you have images array, or you can fetch from remote\n    let images = [#imageLiteral(resourceName: \"amsterdam\"), #imageLiteral(resourceName: \"istanbul\"), #imageLiteral(resourceName: \"camera\"), #imageLiteral(resourceName: \"istanbul2\"), #imageLiteral(resourceName: \"mirror\")];\n\n    @IBOutlet weak var collageView: CollageView!\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        // Set delegate to trigger click events on imageview's\n        collageView.delegate    = self\n        // Set datasource to fill your collageView with data\n        collageView.dataSource  = self\n    }\n\n    deinit {\n        collageView.delegate    = nil\n        collageView.dataSource  = nil\n    }\n\n    override func didReceiveMemoryWarning() {\n        super.didReceiveMemoryWarning()\n    }\n}\n```\n\n- Initialize in Code\n\n\n```swift\n\nclass ViewController: UIViewController {\n\n    //Assume that you have images array, or you can fetch from remote\n    let images = [#imageLiteral(resourceName: \"amsterdam\"), #imageLiteral(resourceName: \"istanbul\"), #imageLiteral(resourceName: \"camera\"), #imageLiteral(resourceName: \"istanbul2\"), #imageLiteral(resourceName: \"mirror\")];\n\n    var collageView = CollageView(frame: .zero)\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        view.addSubview(collageView)\n\n        // Set delegate to trigger click events on imageview's\n        collageView.delegate    = self\n        // Set datasource to fill your collageView with data\n        collageView.dataSource  = self\n    }\n\n    override func viewDidLayoutSubviews() {\n        super.viewDidLayoutSubviews()\n        // Example frame\n        collageView.frame = view.bounds\n    }\n\n    deinit {\n        collageView.delegate    = nil\n        collageView.dataSource  = nil\n    }\n\n    override func didReceiveMemoryWarning() {\n        super.didReceiveMemoryWarning()\n    }\n}\n```\n\nAfter that, fill required dataSource and optional delegate methods\n\n```swift\n\nextension ViewController: CollageViewDataSource {\n\n    func collageViewNumberOfTotalItem(_ collageView: CollageView) -\u003e Int {\n\n        // total images count to show up\n        return images.count\n    }\n\n    func collageViewNumberOfRowOrColoumn(_ collageView: CollageView) -\u003e Int {\n\n        // Sets number of total coloumn or row count of layout direction\n        return 3\n    }\n\n    func collageViewLayoutDirection(_ collageView: CollageView) -\u003e CollageViewLayoutDirection {\n\n        // Sets the starting layout to fill images with\n        // can be horizontol or vertical\n        // if set to horizontal, first image rowIndex is (0, 0) and second one is (1, 0)\n        // if set to vertical, first image rowIndex is (0, 0) and second one is (0, 1)\n\n        return .horizontal\n    }\n\n    func collageView(_ collageView: CollageView, configure itemView: CollageItemImageView, at index: Int) {\n\n        // MAGIC is in this code block\n        // You can prepare your item here also,\n        // You can fetch Images from Remote here!,\n        // Customize UI for item, and etc..\n        itemView.image = images[index]\n        itemView.layer.borderWidth = 3\n    }\n}\n\nextension ViewController: CollageViewDelegate {\n\n    func collageView(_ collageView: CollageView, didSelect itemView: CollageItemImageView, at index: Int) {\n\n        // Trigger click event of each image item\n        let message = \"didSelect at index:  \\(index), rowIndex: \\(String(describing: itemView.collageItem!.rowIndex))\"\n        print(message)\n    }\n}\n\n```\n\n## Demo App Output\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"Images/moreImages.png\" width=\"300\" height=\"533\"/\u003e\n\u003cimg src=\"Images/moreImagesLandscape.png\" width=\"534\" height=\"300\"/\u003e\n\u003c/p\u003e\n\n\n\n## Installation\n\nThere are two ways to use CollageView in your project:\n- using CocoaPods\n- by cloning the project into your repository\n\n### Installation with CocoaPods\n\n[CocoaPods](http://cocoapods.org/) is a dependency manager for Swift and Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the [Get Started](http://cocoapods.org/#get_started) section for more details.\n\n#### Podfile\n```ruby\nuse_frameworks!\npod 'CollageView', '~\u003e 1.0.4'\n```\n\n## Author\n\nAhmet Kazım Günay, ahmetkgunay@gmail.com\n\n## License\n\nCollageView is available under the MIT license. See the LICENSE file for more info.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetkgunay%2Fcollageview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmetkgunay%2Fcollageview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetkgunay%2Fcollageview/lists"}