{"id":13462670,"url":"https://github.com/romansorochak/ParallaxHeader","last_synced_at":"2025-03-25T05:32:11.662Z","repository":{"id":47291804,"uuid":"95213972","full_name":"romansorochak/ParallaxHeader","owner":"romansorochak","description":"Simple way to add parallax header to UIScrollView/UITableView written in Swift.","archived":false,"fork":false,"pushed_at":"2022-10-28T13:05:36.000Z","size":9437,"stargazers_count":1034,"open_issues_count":36,"forks_count":132,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-18T08:11:19.980Z","etag":null,"topics":["cocoapods","ios","parallax-header","parallaxheader","scrollview","swift","tableview","uiscrollview","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/romansorochak.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":"2017-06-23T11:26:45.000Z","updated_at":"2025-03-11T13:14:57.000Z","dependencies_parsed_at":"2022-08-31T02:01:51.146Z","dependency_job_id":null,"html_url":"https://github.com/romansorochak/ParallaxHeader","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/romansorochak%2FParallaxHeader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansorochak%2FParallaxHeader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansorochak%2FParallaxHeader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansorochak%2FParallaxHeader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romansorochak","download_url":"https://codeload.github.com/romansorochak/ParallaxHeader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407517,"owners_count":20610226,"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","parallax-header","parallaxheader","scrollview","swift","tableview","uiscrollview","xcode"],"created_at":"2024-07-31T13:00:18.575Z","updated_at":"2025-03-25T05:32:10.864Z","avatar_url":"https://github.com/romansorochak.png","language":"Swift","funding_links":[],"categories":["Libs","UI [🔝](#readme)","iOS","uiscrollview nested uiscrollview"],"sub_categories":["UI","ListView"],"readme":"# ParallaxHeader\nSimple way to add parallax header to UIScrollView or it's subclasses.\n\n|        One image view      |     Slider with images          |     Blur vibrant text        |  Blur round icon   |\n|----------------------------|---------------------------------|------------------------------|--------------------|\n|![Demo](https://github.com/romansorochak/ParallaxHeader/blob/master/Exmple/Demo.gif)|![Demo](https://github.com/romansorochak/ParallaxHeader/blob/master/Exmple/CollectionDemo.gif)|![Demo](https://github.com/romansorochak/ParallaxHeader/blob/master/Exmple/Demo_with_blur.gif)|![Demo](https://github.com/romansorochak/ParallaxHeader/blob/master/Exmple/Demo_blur_icon.gif)|\n\n## Try it [here](https://appetize.io/app/8v7k0gb5juwc1aeh4up179v8cw?device=iphone5s\u0026scale=75\u0026orientation=portrait\u0026osVersion=9.3)\n\n## Contents\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n\n## Requirements\n\n- iOS 8.0+\n- Xcode 8.0+\n- Swift 3.0+\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\n\u003e CocoaPods 1.1.0+ is required to build Reusable 1.0.0+.\n\nTo integrate ParallaxHeader into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'ParallaxHeader', '~\u003e 3.0.0'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n## Cocoapods versions\n\n- Swift5 : \n```ruby\npod 'ParallaxHeader', '~\u003e 3.0.0'\n```\n- Swift4 : \n```ruby\npod 'ParallaxHeader', '~\u003e 2.0.0'\n```\n- Swift3 : \n```ruby\npod 'ParallaxHeader', '~\u003e 1.0.6'\n```\n\n# Usage\n\nTo add parallax header to scroll view (table view) you need just create view and set it to your scroll view (table view).\n\n## Use case - one image view\n```swift\n  //create view as header view    \n  let imageView = UIImageView()\n  imageView.image = UIImage(named: \"1\")\n  imageView.contentMode = .scaleAspectFill\n        \n  tableView.parallaxHeader.view = imageView\n  tableView.parallaxHeader.height = 400\n  tableView.parallaxHeader.minimumHeight = 0\n  tableView.parallaxHeader.mode = .topFill\n```\n\n## Use case - slider of images\n```swift\nlet parallaxHeight: CGFloat = view.frame.height - 64 - 49 - sliderHeight\nlet layout = UICollectionViewFlowLayout()\nlayout.scrollDirection = .horizontal\ncollectionParallaxView = UICollectionView(\n    frame: CGRect(x: 0, y: 0, width: view.frame.width, height: parallaxHeight),\n    collectionViewLayout: layout\n)\ncollectionParallaxView.isPagingEnabled = true\ncollectionParallaxView.showsHorizontalScrollIndicator = false\ncollectionParallaxView.backgroundColor = UIColor.white\ncollectionParallaxView.delegate = self\ncollectionParallaxView.dataSource = self\n\n//adding view as parallax header to table view is straightforward\ntableView.parallaxHeader.view = collectionParallaxView\ntableView.parallaxHeader.height = parallaxHeight\ntableView.parallaxHeader.minimumHeight = 0\ntableView.parallaxHeader.mode = .centerFill\ntableView.parallaxHeader.parallaxHeaderDidScrollHandler = { parallaxHeader in\n    print(parallaxHeader.progress)\n}\n```\n\n## Use case - Blur vibrant text\n- [Blur](https://github.com/romansorochak/Blur) library is used here.\n- [SnapKit](https://github.com/SnapKit/SnapKit) library is used here.\n```swift\nlet imageView = UIImageView()\nimageView.image = UIImage(named: \"profile\")\nimageView.contentMode = .scaleAspectFill\n        \n//setup blur vibrant view\nimageView.blurView.setup(style: UIBlurEffectStyle.dark, alpha: 1).enable()\n        \nheaderImageView = imageView\n        \ntableView.parallaxHeader.view = imageView\ntableView.parallaxHeader.height = 400\ntableView.parallaxHeader.minimumHeight = 40\ntableView.parallaxHeader.mode = .centerFill\ntableView.parallaxHeader.parallaxHeaderDidScrollHandler = { parallaxHeader in\n    //update alpha of blur view on top of image view \n    parallaxHeader.view.blurView.alpha = 1 - parallaxHeader.progress\n}\n        \n// Label for vibrant text\nlet vibrantLabel = UILabel()\nvibrantLabel.text = \"Vibrant\"\nvibrantLabel.font = UIFont.systemFont(ofSize: 40.0)\nvibrantLabel.sizeToFit()\nvibrantLabel.textAlignment = .center\nimageView.blurView.vibrancyContentView?.addSubview(vibrantLabel)\n//add constraints using SnapKit library\nvibrantLabel.snp.makeConstraints { make in\n    make.edges.equalToSuperview()\n}\n```\n\n## Use case - Blur round icon\n- [Blur](https://github.com/romansorochak/Blur) library is used here.\n- [SnapKit](https://github.com/SnapKit/SnapKit) library is used here.\n```swift\nlet image = UIImage(named: \"profile\")\n        \nlet imageView = UIImageView()\nimageView.image = image\nimageView.contentMode = .scaleAspectFill\nparallaxHeaderView = imageView\n        \n//setup bur view\nimageView.blurView.setup(style: UIBlurEffectStyle.dark, alpha: 1).enable()\n        \ntableView.parallaxHeader.view = imageView\ntableView.parallaxHeader.height = 400\ntableView.parallaxHeader.minimumHeight = 120\ntableView.parallaxHeader.mode = .centerFill\ntableView.parallaxHeader.parallaxHeaderDidScrollHandler = { parallaxHeader in\n    //update alpha of blur view on top of image view\n    parallaxHeader.view.blurView.alpha = 1 - parallaxHeader.progress\n}\n        \nlet roundIcon = UIImageView(\n    frame: CGRect(x: 0, y: 0, width: 100, height: 100)\n)\nroundIcon.image = image\nroundIcon.layer.borderColor = UIColor.white.cgColor\nroundIcon.layer.borderWidth = 2\nroundIcon.layer.cornerRadius = roundIcon.frame.width / 2\nroundIcon.clipsToBounds = true\n        \n//add round image view to blur content view\n//do not use vibrancyContentView to prevent vibrant effect\nimageView.blurView.blurContentView?.addSubview(roundIcon)\n//add constraints using SnpaKit library\nroundIcon.snp.makeConstraints { make in\n    make.center.equalToSuperview()\n    make.width.height.equalTo(100)\n}\n```\n\n## Author\nRoman Sorochak - iOS developer - roman.sorochak@gmail.com\n\n## License\n\nParallaxHeader is released under the MIT license. See [LICENSE](https://github.com/romansorochak/ParallaxHeader/blob/master/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromansorochak%2FParallaxHeader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromansorochak%2FParallaxHeader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromansorochak%2FParallaxHeader/lists"}