{"id":2909,"url":"https://github.com/fmitech/FMMosaicLayout","last_synced_at":"2025-08-03T12:31:40.163Z","repository":{"id":27191120,"uuid":"30661388","full_name":"fmitech/FMMosaicLayout","owner":"fmitech","description":"A drop-in mosaic collection view layout with a focus on simple customizations.","archived":false,"fork":false,"pushed_at":"2016-08-21T01:34:06.000Z","size":24563,"stargazers_count":591,"open_issues_count":4,"forks_count":64,"subscribers_count":37,"default_branch":"master","last_synced_at":"2024-11-11T16:07:06.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/fmitech.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":"2015-02-11T17:55:58.000Z","updated_at":"2024-07-31T05:11:28.000Z","dependencies_parsed_at":"2022-07-25T17:00:25.005Z","dependency_job_id":null,"html_url":"https://github.com/fmitech/FMMosaicLayout","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/fmitech%2FFMMosaicLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmitech%2FFMMosaicLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmitech%2FFMMosaicLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmitech%2FFMMosaicLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmitech","download_url":"https://codeload.github.com/fmitech/FMMosaicLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228543189,"owners_count":17934443,"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":[],"created_at":"2024-01-05T20:16:26.049Z","updated_at":"2024-12-07T00:31:05.259Z","avatar_url":"https://github.com/fmitech.png","language":"Objective-C","funding_links":[],"categories":["UI"],"sub_categories":["Table View / Collection View","Layout","Other free courses"],"readme":"[![CI Status](http://img.shields.io/travis/JVillella/FMMosaicLayout.svg?style=flat)](https://travis-ci.org/JVillella/FMMosaicLayout)\n[![Version](https://img.shields.io/cocoapods/v/FMMosaicLayout.svg?style=flat)](http://cocoadocs.org/docsets/FMMosaicLayout)\n[![License](https://img.shields.io/cocoapods/l/FMMosaicLayout.svg?style=flat)](http://cocoadocs.org/docsets/FMMosaicLayout)\n[![Platform](https://img.shields.io/cocoapods/p/FMMosaicLayout.svg?style=flat)](http://cocoadocs.org/docsets/FMMosaicLayout)\n\nFMMosaicLayout is a mosiac collection view layout. There are a great number of media-based iOS applications that use `UICollectionViewFlowLayout` without any modifications. This lends itself to boring presentation, and unengaging interaction. FMMosaicLayout is a step in the right direction. Simply add this pod to your project, set your preferences and it will layout out your collection view cells in pretty mosaics. The algorithm behind this got its inspiration from this [blog post](http://blog.vjeux.com/2012/image/image-layout-algorithm-facebook.html).\n\n![Portrait Screenshot](https://fmitech.github.io/FMMosaicLayout/Screenshots/portrait-3-small.png)\n\n## Usage\n\nFMMosaicLayout is very easy to use. Below is all you need to get going.\n\n```objective-c\n- (void)viewDidLoad {\n    ...\n\n    FMMosaicLayout *mosaicLayout = [[FMMosaicLayout alloc] init];\n    self.collectionView.collectionViewLayout = mosaicLayout;\n\n    ...\n}\n\n#pragma mark \u003cFMMosaicLayoutDelegate\u003e\n\n- (NSInteger)collectionView:(UICollectionView *)collectionView layout:(FMMosaicLayout *)collectionViewLayout\n    numberOfColumnsInSection:(NSInteger)section {\n\n    return 2; // Or any number of your choosing.\n}\n```\n\nIt's also possible to set the layout via Interface Builder. To see a complete example implementation. Clone the repo, and run `pod install` from the Example directory. Then open up `Example/FMMosaicLayout.xcworkspace`.\n\n## Customization\n\nIn addition to the required protocol method `collectionView:layout:numberOfColumnsInSection:`, there are several optional methods you can implement from `FMMosaicLayoutDelegate`. You can see them in action in the example project.\n\n##### Mosaic Cell Size\n\n```objective-c\n- (FMMosaicCellSize)collectionView:(UICollectionView *)collectionView layout:(FMMosaicLayout *)collectionViewLayout\n        mosaicCellSizeForItemAtIndexPath:(NSIndexPath *)indexPath;\n```\n\nThis allows you to specify when you want to place a large or small mosaic cell.\n\n##### Section Insets    \n```objective-c\n- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(FMMosaicLayout *)collectionViewLayout\n        insetForSectionAtIndex:(NSInteger)section;\n```\n\nHere you can specify a custom `UIEdgeInsets` for each section.\n\n##### Interitem Spacing\n\n```objective-c\n- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(FMMosaicLayout *)collectionViewLayout\n        interitemSpacingForSectionAtIndex:(NSInteger)section;\n```\n\nHere you can specify the spacing between cells.\n\n##### Header and Footer Support\n\nBelow are the optional methods you can make use of to customize your headers and footers. The first methods are to set the height of your header/footers.\n\n```objective-c\n- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(FMMosaicLayout *)collectionViewLayout\n heightForHeaderInSection:(NSInteger)section;\n\n- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(FMMosaicLayout *)collectionViewLayout\n heightForFooterInSection:(NSInteger)section;\n```\n\nIf you want your header and/or to overlay your mosaic cells implement the following methods below in your delegate and have them return `YES`. The default is `NO`.\n\n```objective-c\n- (BOOL)headerShouldOverlayContentInCollectionView:(UICollectionView *)collectionView\n                                            layout:(FMMosaicLayout *)collectionViewLayout;\n\n- (BOOL)footerShouldOverlayContentInCollectionView:(UICollectionView *)collectionView\n                                            layout:(FMMosaicLayout *)collectionViewLayout;\n```\n\n## Installation\n\nFMMosaicLayout is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"FMMosaicLayout\"\n```\n\n## License\n\nFMMosaicLayout is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmitech%2FFMMosaicLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmitech%2FFMMosaicLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmitech%2FFMMosaicLayout/lists"}