{"id":15050750,"url":"https://github.com/joelmarquez90/jmparallaxview","last_synced_at":"2026-03-16T20:03:01.930Z","repository":{"id":56916280,"uuid":"75148188","full_name":"joelmarquez90/JMParallaxView","owner":"joelmarquez90","description":"A drop-in solution for all your parallax problems","archived":false,"fork":false,"pushed_at":"2016-11-30T04:53:19.000Z","size":329,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T21:39:56.407Z","etag":null,"topics":["ios","objective-c","parallax-scrolling","parallaxview","pod"],"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/joelmarquez90.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":"2016-11-30T03:37:51.000Z","updated_at":"2018-12-25T15:31:15.000Z","dependencies_parsed_at":"2022-08-20T21:20:25.196Z","dependency_job_id":null,"html_url":"https://github.com/joelmarquez90/JMParallaxView","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelmarquez90%2FJMParallaxView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelmarquez90%2FJMParallaxView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelmarquez90%2FJMParallaxView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelmarquez90%2FJMParallaxView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joelmarquez90","download_url":"https://codeload.github.com/joelmarquez90/JMParallaxView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234862659,"owners_count":18898393,"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","objective-c","parallax-scrolling","parallaxview","pod"],"created_at":"2024-09-24T21:29:12.019Z","updated_at":"2025-12-28T20:34:43.839Z","avatar_url":"https://github.com/joelmarquez90.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JMParallaxView\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n## Installation\n\nJMParallaxView is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"JMParallaxView\"\n```\n\n## Usage\n\n### Simple header\n\n##### 1. Create a tableView:\n\n```objective-c\nself.tableView = [UITableView new];\nself.tableView.delegate = self;\n```\n\n##### 2. Create a header:\n\n```objective-c\nself.parallaxHeader = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@\"header1\"]];\nself.parallaxHeader.frame = CGRectMake(0, 0, CGRectGetWidth([UIScreen mainScreen].bounds), 200);\nself.parallaxHeader.contentMode = UIViewContentModeScaleAspectFill;\nself.parallaxHeader.clipsToBounds = YES;\n```\n\n##### 3. Create a `JMParallaxView`:\n\n```objective-c\nself.parallaxView = [JMParallaxView new];\nself.parallaxView.delegate = self;\nself.parallaxView.headerTintColor = [UIColor whiteColor];\n[self.view addSubview:self.parallaxView];\n[self.parallaxView mas_updateConstraints:^(MASConstraintMaker *make) {\n    make.edges.equalTo(self.view);\n}];\n```\n\n##### 4. Create a parallax content view:\n```objective-c\nself.parallaxContentView = [UIView new];\n[self.parallaxContentView addSubview:self.tableView];\n[self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {\n    make.edges.equalTo(self.parallaxContentView);\n}];\n```\n\n##### 5. Pluging in all the stuff together:\n\n```objective-c\n[self.parallaxView addScrollView:self.tableView];\nself.parallaxView.mainView = self.parallaxContentView;\nself.parallaxView.headerView = self.parallaxHeader;\n```\n\n##### 6. Implement scroll view delegate methods in order to notify the parallaxView for scroll events:\n\n```objective-c\n- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView\n{\n    [self.parallaxView userDidStartDraggingScrollView:scrollView];\n}\n\n- (void)scrollViewDidScroll:(UIScrollView *)scrollView\n{\n    [self.parallaxView userDidDragScrollView:scrollView toOffset:scrollView.contentOffset.y];\n}\n\n-(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView\n{\n    [self.parallaxView userDidDragScrollView:scrollView toOffset:scrollView.contentOffset.y];\n}\n\n- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity\n              targetContentOffset:(inout CGPoint *)targetContentOffset\n{\n    [self.parallaxView userDidEndDraggingScrollView:scrollView toOffset:targetContentOffset];\n}\n```\n##### 7. Enjoy\n\n![enjoy](http://i.giphy.com/l3vQZiDorvDVCbgHK.gif)\n\n##### Note: optionally you could also implement the JMParallaxViewDelegate method in order to know the current state of the parallaxView:\n\n```objective-c\n- (void)parallaxView:(JMParallaxView *)parallaxView didChangeState:(JMParallaxState)fromState\n             toState:(JMParallaxState)toState\n{\n   CATransition *fade = [CATransition animation];\n   fade.type = kCATransitionFade;\n   fade.duration = 0.1;\n   [self.navigationController.navigationBar.layer addAnimation:fade forKey:nil];\n\n   switch (toState) {\n       case JMParallaxStateOnBottom:\n       case JMParallaxStateNearBottom: {\n           if (fromState != JMParallaxStateOnBottom \u0026\u0026 fromState != JMParallaxStateNearBottom) {\n               self.titleLabel.text = @\"Header\";\n               [self.titleLabel sizeToFit];\n               self.tableView.showsVerticalScrollIndicator = NO;\n           }\n       }\n           break;\n\n       case JMParallaxStateOnTop:\n       case JMParallaxStateNearTop: {\n           if (fromState != JMParallaxStateOnTop \u0026\u0026 fromState != JMParallaxStateNearTop) {\n               self.titleLabel.text = @\"Scrolled!\";\n               [self.titleLabel sizeToFit];\n               self.tableView.showsVerticalScrollIndicator = YES;\n           }\n       }\n           break;\n\n       default:\n           break;\n   }\n}\n```\n\n### Header with sticky view\n\nFollow all the previous step, and in the final one, add this line:\n\n```objective-c\nUILabel *stickyLabel = [[UILabel alloc] initWithFrame:\n                        CGRectMake(0, 0, CGRectGetWidth([UIScreen mainScreen].bounds), 60)];\nstickyLabel.text = @\"I'm a sticky label!\";\nstickyLabel.backgroundColor = [UIColor orangeColor];\nstickyLabel.textAlignment = NSTextAlignmentCenter;\n\nself.parallaxView.stickyView = stickyLabel;\n```\n\n##### Voilá!\n\n![enjoy](http://i.giphy.com/3oz8xu4R96MdTVRK00.gif)\n\n## Author\n\nJoel Marquez, 90joelmarquez@gmail.com\n\n## License\n\nJMParallaxView 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%2Fjoelmarquez90%2Fjmparallaxview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoelmarquez90%2Fjmparallaxview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelmarquez90%2Fjmparallaxview/lists"}