{"id":18270114,"url":"https://github.com/maxep/MXSegmentedPager","last_synced_at":"2025-04-04T23:31:48.463Z","repository":{"id":27837206,"uuid":"31327239","full_name":"maxep/MXSegmentedPager","owner":"maxep","description":"Segmented pager view with Parallax header","archived":false,"fork":false,"pushed_at":"2022-06-13T14:36:15.000Z","size":40065,"stargazers_count":1273,"open_issues_count":1,"forks_count":250,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-03-31T20:08:56.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"GyueGuo/GyueGuo.github.io","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-02-25T17:47:41.000Z","updated_at":"2025-03-13T07:12:13.000Z","dependencies_parsed_at":"2022-07-28T20:10:03.605Z","dependency_job_id":null,"html_url":"https://github.com/maxep/MXSegmentedPager","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxep%2FMXSegmentedPager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxep%2FMXSegmentedPager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxep%2FMXSegmentedPager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxep%2FMXSegmentedPager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxep","download_url":"https://codeload.github.com/maxep/MXSegmentedPager/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":[],"created_at":"2024-11-05T11:38:18.541Z","updated_at":"2025-04-04T23:31:43.454Z","avatar_url":"https://github.com/maxep.png","language":"Objective-C","readme":"# MXSegmentedPager\n\n[![CI Status](http://img.shields.io/travis/maxep/MXSegmentedPager.svg?style=flat)](https://travis-ci.org/maxep/MXSegmentedPager)\n[![Version](https://img.shields.io/cocoapods/v/MXSegmentedPager.svg?style=flat)](http://cocoadocs.org/docsets/MXSegmentedPager)\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/MXSegmentedPager.svg?style=flat)](http://cocoadocs.org/docsets/MXSegmentedPager)\n[![Platform](https://img.shields.io/cocoapods/p/MXSegmentedPager.svg?style=flat)](http://cocoadocs.org/docsets/MXSegmentedPager)\n[![Dependency Status](https://www.versioneye.com/objective-c/mxsegmentedpager/1.0/badge.svg)](https://www.versioneye.com/objective-c/mxsegmentedpager)\n\n:warning: This project is no longer maintained, see [#263](https://github.com/maxep/MXSegmentedPager/issues/263) :warning:\n\nMXSegmentedPager combines [MXPagerView](https://github.com/maxep/MXPagerView) with [MXSegmentedControl](https://github.com/maxep/MXSegmentedControl) to control the page selection. The integration of [MXParallaxHeader](https://github.com/maxep/MXParallaxHeader) allows you to add a parallax header on top while keeping a reliable scrolling effect.\n\n\n|           Simple view         |           Parallax view         |\n|-------------------------------|---------------------------------|\n|![Demo](Examples/Simple.gif)|![Demo](Examples/Parallax.gif)|\n\n## Highlight\n+ [MXSegmentedControl](https://github.com/maxep/MXSegmentedControl) is a very customizable control.\n+ [MXParallaxHeader](https://github.com/maxep/MXParallaxHeader) supports any kind of view with different modes.\n+ [MXPagerView](https://github.com/maxep/MXPagerView) lazily loads pages and supports reusable page registration.\n+ Reliable vertical scroll with any view hierarchy.\n+ Can load view-controller from storyboard using custom segues.\n+ Fully documented.\n\n## Usage\n\n### MXSegmentedPager calls data source methods to load pages.\n\n\u003cdetails open=1\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\n// Asks the data source to return the number of pages in the segmented pager.\nfunc numberOfPages(in segmentedPager: MXSegmentedPager) -\u003e Int {\n    return 10\n}\n\n// Asks the data source for a title realted to a particular page of the segmented pager.\nfunc segmentedPager(_ segmentedPager: MXSegmentedPager, titleForSectionAt index: Int) -\u003e String {\n    return \"Page \\(index)\"\n}\n\n// Asks the data source for a view to insert in a particular page of the pager.\nfunc segmentedPager(_ segmentedPager: MXSegmentedPager, viewForPageAt index: Int) -\u003e UIView {\n    let label = UILabel()\n    label.text = \"Page \\(index)\"\n    label.textAlignment = .center\n    return label;\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C\u003c/summary\u003e\n\n```objective-c\n#pragma mark \u003cMXSegmentedPagerDataSource\u003e\n\n// Asks the data source to return the number of pages in the segmented pager.\n- (NSInteger)numberOfPagesInSegmentedPager:(MXSegmentedPager *)segmentedPager {\n    return 10;\n}\n\n// Asks the data source for a title realted to a particular page of the segmented pager.\n- (NSString *)segmentedPager:(MXSegmentedPager *)segmentedPager titleForSectionAtIndex:(NSInteger)index {\n    return [NSString stringWithFormat:@\"Page %li\", (long) index];\n}\n\n// Asks the data source for a view to insert in a particular page of the pager.\n- (UIView *)segmentedPager:(MXSegmentedPager *)segmentedPager viewForPageAtIndex:(NSInteger)index {\n    \n    UILabel *label = [UILabel new];\n    label.text = [NSString stringWithFormat:@\"Page #%i\", index];\n    label.textAlignment = NSTextAlignmentCenter;;\n\n    return label;\n}\n```\n\u003c/details\u003e\n\n### Adding a parallax header to a MXSegmentedPager is straightforward, e.g:\n\n\u003cdetails open=1\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\nlet headerView = UIImageView()\nheaderView.image = UIImage(named: \"success-baby\")\nheaderView.contentMode = .scaleAspectFit\n\nlet segmentedPager = MXSegmentedPager()\nsegmentedPager.parallaxHeader.view = headerView\nsegmentedPager.parallaxHeader.height = 150\nsegmentedPager.parallaxHeader.mode = .fill\nsegmentedPager.parallaxHeader.minimumHeight = 20\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C\u003c/summary\u003e\n\n```objective-c\nUIImageView *headerView = [UIImageView new];\nheaderView.image = [UIImage imageNamed:@\"success-baby\"];\nheaderView.contentMode = UIViewContentModeScaleAspectFill;\n   \nMXSegmentedPager *segmentedPager = [MXSegmentedPager new]; \nsegmentedPager.parallaxHeader.view = headerView;\nsegmentedPager.parallaxHeader.height = 150;\nsegmentedPager.parallaxHeader.mode = MXParallaxHeaderModeFill;\nsegmentedPager.parallaxHeader.minimumHeight = 20;\n```\n\u003c/details\u003e\n\n\n\n## Examples\n\nIf you want to try it, simply run:\n```\npod try MXSegmentedPager\n```\nOr clone the repo and run `pod install` from the Example directory first. \n\n+ See MXSimpleViewController for a standard implementation.\n+ See MXParallaxViewController to implement a pager with a parallax header.\n+ See MXExampleViewController for a MXSegmentedPagerController subclass example.\n\nThis repo also provides a **Swift** example project, see [Examples/Swift](Examples/Swift).\n\n## Installation\n\nMXSegmentedPager is available through [CocoaPods](https://cocoapods.org/pods/MXSegmentedPager). To install\nit, simply add the following line to your Podfile:\n\n```\npod 'MXSegmentedPager'\n```\n\n## Documentation\n\nDocumentation is available through [CocoaDocs](http://cocoadocs.org/docsets/MXSegmentedPager/).\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                                               \nMXSegmentedPager is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxep%2FMXSegmentedPager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxep%2FMXSegmentedPager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxep%2FMXSegmentedPager/lists"}