{"id":18269861,"url":"https://github.com/maxep/MXPagerView","last_synced_at":"2025-04-04T23:31:36.496Z","repository":{"id":62447309,"uuid":"45803741","full_name":"maxep/MXPagerView","owner":"maxep","description":"Pager view with reusable page and storyboard support.","archived":false,"fork":false,"pushed_at":"2019-10-21T18:09:10.000Z","size":277,"stargazers_count":67,"open_issues_count":3,"forks_count":37,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T14:21:35.385Z","etag":null,"topics":["ios","pager","reuse-pages","storyboard"],"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/maxep.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-11-08T23:17:48.000Z","updated_at":"2024-05-27T11:09:09.000Z","dependencies_parsed_at":"2022-11-01T23:06:00.882Z","dependency_job_id":null,"html_url":"https://github.com/maxep/MXPagerView","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxep%2FMXPagerView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxep%2FMXPagerView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxep%2FMXPagerView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxep%2FMXPagerView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxep","download_url":"https://codeload.github.com/maxep/MXPagerView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266476,"owners_count":20910831,"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","pager","reuse-pages","storyboard"],"created_at":"2024-11-05T11:37:37.608Z","updated_at":"2025-04-04T23:31:34.490Z","avatar_url":"https://github.com/maxep.png","language":"Objective-C","readme":"# MXPagerView\n\n[![CI Status](http://img.shields.io/travis/maxep/MXPagerView.svg?style=flat)](https://travis-ci.org/maxep/MXPagerView)\n[![Version](https://img.shields.io/cocoapods/v/MXPagerView.svg?style=flat)](http://cocoapods.org/pods/MXPagerView)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](https://img.shields.io/cocoapods/l/MXPagerView.svg?style=flat)](http://cocoapods.org/pods/MXPagerView)\n[![Platform](https://img.shields.io/cocoapods/p/MXPagerView.svg?style=flat)](http://cocoapods.org/pods/MXPagerView)\n\nMXPagerView is a pager view with the ability to reuse pages like you would do with a table view and cells. Depending on the transition style, it will load the current page and neighbors and unload others pages.\n\nMXPagerViewController allows you to load pages from storyboard using the MXPageSegue.\n\n## Usage\n\nIf you want to try it, simply run:\n\n```\npod try MXPagerView\n```\n\nOr clone the repo and run `pod install` from the Example directory first. \n\n+ As a UITableView, the MXPagerView calls data source methods to load pages. \n\n```objective-c\n#pragma mark \u003cMXPagerViewDataSource\u003e\n\n// Asks the data source to return the number of pages in the pager.\n- (NSInteger)numberOfPagesInPagerView:(MXPagerView *)pagerView {\n    return 10;\n}\n\n// Asks the data source for a view to insert in a particular page of the pager.\n- (UIView *)pagerView:(MXPagerView *)pagerView viewForPageAtIndex:(NSInteger)index {\n    \n    UILabel *label = [UILabel new];\n    label.text = [NSString stringWithFormat:@\"Page #%i\", index];\n    [label sizeToFit];\n\n    return label;\n}\n```\n\n+ In order to reuse pages, first register the reusable view, e.g:\n\n```objective-c\n- (void)viewDidLoad {\n    [super viewDidLoad];\n    \n    //Register UITextView as page\n    [self.pagerView registerClass:[UITextView class] forPageReuseIdentifier:@\"TextPage\"];\n}\n```\n\nThen, dequeue a reusable page in the data source:\n\n```objective-c\n// Asks the data source for a view to insert in a particular page of the pager.\n- (UIView *)pagerView:(MXPagerView *)pagerView viewForPageAtIndex:(NSInteger)index {\n    \n    //Dequeue reusable page\n    UITextView *page = [self.pagerView dequeueReusablePageWithIdentifier:@\"TextPage\"];\n    page.text = @\"This is a text\";\n    \n    return page;\n}\n```\n\nThe MXPagerView comes with a UIView category which exposed the reuse identifier of the page as well as the ```prepareForReuse``` method, this is called just before the page is returned from the pager view method ```dequeueReusablePageWithIdentifier:```.\n\n+ Using MXPagerViewController in storyboard is super easy:\n\n![Demo](Example-swift/MXPagerView.png)\n\n## Installation\n\nMXPagerView is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"MXPagerView\"\n```\n\n## Documentation\n\nDocumentation is available through [CocoaDocs](http://cocoadocs.org/docsets/MXPagerView/).\n\n## Author\n\n[Maxime Epain](http://maxep.github.io)\n\n[![Twitter](https://img.shields.io/badge/twitter-%40MaximeEpain-blue.svg?style=flat)](https://twitter.com/MaximeEpain)\n\n## License\n\nMXPagerView is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","funding_links":[],"categories":["storyboard"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxep%2FMXPagerView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxep%2FMXPagerView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxep%2FMXPagerView/lists"}