{"id":2164,"url":"https://github.com/manuelescrig/MEVHorizontalContacts","last_synced_at":"2025-08-02T23:32:06.817Z","repository":{"id":56920339,"uuid":"56929973","full_name":"manuelescrig/MEVHorizontalContacts","owner":"manuelescrig","description":"An iOS UICollectionViewLayout subclass to show a list of contacts with configurable expandable items.","archived":false,"fork":false,"pushed_at":"2016-08-25T16:10:34.000Z","size":404,"stargazers_count":359,"open_issues_count":2,"forks_count":39,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-04-29T18:06:34.996Z","etag":null,"topics":["cocoapods","ios","ios-animation","objective-c","objective-c-library"],"latest_commit_sha":null,"homepage":"","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/manuelescrig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-04-23T16:45:28.000Z","updated_at":"2024-03-14T21:17:59.000Z","dependencies_parsed_at":"2022-08-20T21:50:21.373Z","dependency_job_id":null,"html_url":"https://github.com/manuelescrig/MEVHorizontalContacts","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelescrig%2FMEVHorizontalContacts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelescrig%2FMEVHorizontalContacts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelescrig%2FMEVHorizontalContacts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelescrig%2FMEVHorizontalContacts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manuelescrig","download_url":"https://codeload.github.com/manuelescrig/MEVHorizontalContacts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503134,"owners_count":17930517,"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":["cocoapods","ios","ios-animation","objective-c","objective-c-library"],"created_at":"2024-01-05T20:16:06.321Z","updated_at":"2024-12-06T17:30:46.716Z","avatar_url":"https://github.com/manuelescrig.png","language":"Objective-C","funding_links":[],"categories":["CollectionView","HarmonyOS","UI","Objective-C"],"sub_categories":["Windows Manager","Other free courses","Font","Other Testing"],"readme":"# MEVHorizontalContacts\nAn **iOS** UICollectionViewLayout subclass to show a **list of contacts** with configurable expandable **items**.\n\n\n[![CI Status](http://img.shields.io/travis/manuelescrig/MEVHorizontalContacts.svg?style=flat)](https://travis-ci.org/manuelescrig/MEVHorizontalContacts)\n[![Version](https://img.shields.io/cocoapods/v/MEVHorizontalContacts.svg?style=flat)](http://cocoapods.org/pods/MEVHorizontalContacts)\n[![License](https://img.shields.io/cocoapods/l/MEVHorizontalContacts.svg?style=flat)](http://cocoapods.org/pods/MEVHorizontalContacts)\n[![Platform](https://img.shields.io/cocoapods/p/MEVHorizontalContacts.svg?style=flat)](http://cocoapods.org/pods/MEVHorizontalContacts)\n[![Language](http://img.shields.io/badge/language-objective--c-blue.svg?style=flat)](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/1849990/15137846/645a0d18-168c-11e6-96e2-651d8f8de3b0.gif\" align=\"center\" height=\"600\" width=\"800\" \u003e\u003c/p\u003e\n\n \n## Features\n- [x] Customizable contacts cells\n- [x] Customizable contact items cells\n- [x] Different sizes and responsive design\n- [x] Multiple delegate methods\n\n\n## Demo App\n\nRun the demo app and play with it!\n[Demo App](https://appetize.io/app/y5mq0egpmtvvj6e7up8qg07qjg?device=iphone6splus\u0026scale=50\u0026orientation=portrait\u0026osVersion=9.3\u0026deviceColor=white)\n\n## Demo Project\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Getting Started\n\n### Requirements\n\nRequires iOS SDK version \u003e 7.0\n\nRequires ARC\n\n### Installation with CocoaPods\n\n[CocoaPods](cocoapods.org) is a 3rd-party dependency manager for Swift and Objective-C projects. For more information, refer to the [CocoaPods Getting Started Guide](https://guides.cocoapods.org/using/getting-started.html). Otherwise, you can install CocoaPods with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\n#### Podfile\nTo integrate MEVHorizontalContacts into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\npod 'MEVHorizontalContacts'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n###  Installation Manually\nTo integrate MEVHorizontalContacts into your Xcode project manually, just include the filest from [/Pod/Classes/](https://github.com/manuelescrig/MEVHorizontalContacts/tree/master/MEVHorizontalContacts/Classes) folder in your App’s Xcode project.\n\nThen, import the following file your classes:\n```objc\n#import \"MEVHorizontalContacts.h\"\n```\n\n## Quick Guide\n\n### Usage\n\n###### 1. Import class\n\n```objective-c\n#import \"MEVHorizontalContacts.h\"\n```\n\n###### 2. Add Datasource and Delegate protocols.\n\n```objective-c\n@interface ViewController () \u003cMEVHorizontalContactsDataSource, MEVHorizontalContactsDelegate\u003e\n@property (nonatomic, strong) MEVHorizontalContacts *horizontalContacts;\n@end\n```\n\n###### 3. Create, initialize and add MEVHorizontalContacts view.\n\n```objective-c\n_horizontalContacts = [MEVHorizontalContacts new];\n_horizontalContacts.backgroundColor = [UIColor whiteColor];\n_horizontalContacts.dataSource = self;\n_horizontalContacts.delegate = self;\n[self addSubview:_horizontalContacts];\n[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@\"H:|[horizontalContacts]|\" options:NSLayoutFormatAlignAllCenterX metrics:nil views:@{@\"horizontalContacts\" : _horizontalContacts}]];\n[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@\"V:|[horizontalContacts]|\" options:NSLayoutFormatAlignAllCenterY metrics:nil views:@{@\"horizontalContacts\" : _horizontalContacts}]];\n```\n\n###### 4. Implement Datasource Methods\n\n```objective-c\n#pragma mark - MEVHorizontalContactsDataSource Methods\n\n- (NSInteger)numberOfContacts;\n- (NSInteger)numberOfItemsAtContactIndex:(NSInteger)index;\n- (MEVHorizontalContactsCell *)contactAtIndex:(NSInteger)index;\n- (MEVHorizontalContactsCell *)item:(NSInteger)item atContactIndex:(NSInteger)index;\n- (UIEdgeInsets)horizontalContactsInsets;\n- (NSInteger)horizontalContactsSpacing;\n\n```\n\n###### 5. Implement Delegate Methods\n\n```objective-c\n#pragma mark - MEVHorizontalContactsDelegate Methods\n\n- (void)contactSelectedAtIndex:(NSInteger)index;\n- (void)item:(NSInteger)item selectedAtContactIndex:(NSInteger)index;\n\n```\n\n### Example\n\n###### Customization 1\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/1849990/15117532/42b3110c-1608-11e6-81ce-36a493962c8b.gif\" align=\"center\" height=\"78\" width=\"332\" \u003e\u003c/p\u003e\n\n```objective-c\n- (MEVHorizontalContactsCell *)contactAtIndex:(NSInteger)index {\n    MEVHorizontalContactsCell *cell = [_horizontalContacts dequeueReusableContactCellForIndex:index];\n    [cell.imageView setImage:[UIImage imageNamed:[self getImageNameAtIndex:index]]];\n    [cell.imageView.layer setBorderColor:[UIColor colorWithRed:34/255.0f green:167/255.0f blue:240/255.0f alpha:1].CGColor];\n    [cell.imageView.layer setBorderWidth:1.0f];\n    [cell.label setText:[self getUserNameAtIndex:index]];\n    [cell.label setFont:[UIFont boldSystemFontOfSize:12.0f]];\n    return cell;\n}\n\n- (MEVHorizontalContactsCell *)item:(NSInteger)item atContactIndex:(NSInteger)index {\n\n    UIImage *image;\n    NSString *labelText;\n    switch (item) {\n        case 0:\n            labelText = @\"Call\";\n            image = [UIImage imageNamed:@\"actionCall\"];\n            break;\n        case 1:\n            labelText = @\"Email\";\n            image = [UIImage imageNamed:@\"actionEmail\"];\n            break;\n        case 2:\n            labelText = @\"Message\";\n            image = [UIImage imageNamed:@\"actionMessage\"];\n            break;\n        default:\n            labelText = @\"Call\";\n            image = [UIImage imageNamed:@\"actionCall\"];\n            break;\n    }\n    \n    MEVHorizontalContactsCell *cell = [_horizontalContacts dequeueReusableItemCellForIndex:index];\n    [cell.imageView setImage:image];\n    [cell.imageView setTintColor:[UIColor colorWithRed:34/255.0f green:167/255.0f blue:240/255.0f alpha:1]];\n    [cell.imageView.layer setBorderColor:[UIColor colorWithRed:34/255.0f green:167/255.0f blue:240/255.0f alpha:1].CGColor];\n    [cell.imageView.layer setBorderWidth:1.0f];\n    [cell.label setText:labelText];\n    [cell.label setFont:[UIFont boldSystemFontOfSize:10.0f]];\n\n    return cell;\n}\n\n```\n\n\n###### Customization 2\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/1849990/15117199/c853d546-1606-11e6-924a-15e8dcd0e709.gif\" align=\"center\"  height=\"97\" width=\"332\" \u003e\u003c/p\u003e\n\n```objective-c\n- (MEVHorizontalContactsCell *)contactAtIndex:(NSInteger)index {\n    MEVHorizontalContactsCell *cell = [_horizontalContacts dequeueReusableContactCellForIndex:index];\n    [cell.imageView setImage:[UIImage imageNamed:[self getImageNameAtIndex:index]]];\n    [cell.label setText:[self getUserNameAtIndex:index]];\n    return cell;\n}\n\n- (MEVHorizontalContactsCell *)item:(NSInteger)item atContactIndex:(NSInteger)index {\n    \n    UIImage *image;\n    NSString *labelText;\n    switch (item) {\n        case 0:\n            labelText = @\"Call\";\n            image = [UIImage imageNamed:@\"actionCall\"];\n            break;\n        case 1:\n            labelText = @\"Email\";\n            image = [UIImage imageNamed:@\"actionEmail\"];\n            break;\n        case 2:\n            labelText = @\"Message\";\n            image = [UIImage imageNamed:@\"actionMessage\"];\n            break;\n        default:\n            labelText = @\"Call\";\n            image = [UIImage imageNamed:@\"actionCall\"];\n            break;\n    }\n    \n    MEVHorizontalContactsCell *cell = [_horizontalContacts dequeueReusableItemCellForIndex:index];\n    [cell.imageView setImage:image];\n    [cell.imageView setBackgroundColor:[UIColor colorWithRed:34/255.0f green:167/255.0f blue:240/255.0f alpha:1]];\n    [cell.imageView setTintColor:[UIColor whiteColor]];\n    [cell.label setText:labelText];\n    [cell.label setTextColor:[UIColor colorWithRed:34/255.0f green:167/255.0f blue:240/255.0f alpha:1]];\n    return cell;\n}\n\n```\n\n\n## Roadmap\n- [x] CocoaPods support\n- [ ] Carthage support\n- [ ] Tests\n\n## Change Log\n\nSee [Changelog.md](https://github.com/manuelescrig/MEVHorizontalContacts/blob/master/CHANGELOG.md)\n\n## Author\n\n- Manuel Escrig Ventura, [@manuelescrig](https://www.twitter.com/manuelescrig/)\n- Email [manuel@ventura.media](mailto:manuel@ventura.media)\n- Portfolio [http://ventura.media](http://ventura.media)\n\n## Apps using this library\n\n- [People Tracker App](http://itunes.apple.com/us/app/people-tracker-pro/id539205975?ls=1\u0026mt=8), [www.peopletrackerapp.com](http://www.peopletrackerapp.com)\n\n## License\n\nMEVHorizontalContacts is available under the MIT license. See the [LICENSE](https://github.com/manuelescrig/MEVHorizontalContacts/blob/master/LICENSE) file for more info.\n\nIcons made by [Gregor Cresnar](http://www.flaticon.com/authors/gregor-cresnar) is licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelescrig%2FMEVHorizontalContacts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanuelescrig%2FMEVHorizontalContacts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelescrig%2FMEVHorizontalContacts/lists"}