{"id":13769263,"url":"https://github.com/marty-suzuki/SAParallaxViewControllerSwift","last_synced_at":"2025-05-11T02:32:05.869Z","repository":{"id":26576688,"uuid":"30030988","full_name":"marty-suzuki/SAParallaxViewControllerSwift","owner":"marty-suzuki","description":"SAParallaxViewControllerSwift realizes parallax scrolling with blur effect. In addition, it realizes seamless opening transition.","archived":true,"fork":false,"pushed_at":"2016-09-23T14:51:44.000Z","size":17878,"stargazers_count":260,"open_issues_count":4,"forks_count":24,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-09T04:02:57.519Z","etag":null,"topics":[],"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/marty-suzuki.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-01-29T17:02:25.000Z","updated_at":"2024-04-19T01:14:29.000Z","dependencies_parsed_at":"2022-09-01T19:20:48.343Z","dependency_job_id":null,"html_url":"https://github.com/marty-suzuki/SAParallaxViewControllerSwift","commit_stats":null,"previous_names":["szk-atmosphere/saparallaxviewcontrollerswift"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty-suzuki%2FSAParallaxViewControllerSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty-suzuki%2FSAParallaxViewControllerSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty-suzuki%2FSAParallaxViewControllerSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty-suzuki%2FSAParallaxViewControllerSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marty-suzuki","download_url":"https://codeload.github.com/marty-suzuki/SAParallaxViewControllerSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225004585,"owners_count":17405644,"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-08-03T17:00:20.601Z","updated_at":"2024-11-17T05:30:44.020Z","avatar_url":"https://github.com/marty-suzuki.png","language":"Swift","funding_links":[],"categories":["TableView"],"sub_categories":[],"readme":"# SAParallaxViewControllerSwift\n\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat\n)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat\n)](https://developer.apple.com/swift)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat\n)](http://mit-license.org)\n[![Version](https://img.shields.io/cocoapods/v/SAParallaxViewControllerSwift.svg?style=flat)](http://cocoadocs.org/docsets/MSAlertController)\n\n![](./SampleImage/sample.gif) ![](./SampleImage/open_sample.gif)\n\nSAParallaxViewControllerSwift realizes parallax scrolling with blur effect. In addition, it realizes seamless opening transition.\n\n## Features\n\n- [x] Parallax scrolling\n- [x] Parallax scrolling with blur accessory view\n- [x] Seamlees opening transition\n- [x] Support Swift2.3\n- [x] Support Swift3\n\n## Installation\n\n#### CocoaPods\n\nSAParallaxViewControllerSwift is available through [CocoaPods](http://cocoapods.org). If you have cocoapods 0.36 beta or greater, you can install\nit, simply add the following line to your Podfile:\n\n    pod \"SAParallaxViewControllerSwift\"\n\n#### Manually\n\nAdd the [SAParallaxViewControllerSwift](./SAParallaxViewControllerSwift) directory to your project.\n\n## Usage\n\nIf you install from cocoapods, You have to white `import SAParallaxViewControllerSwift`.\n\nExtend `SAParallaxViewController` like this.\n\n```swift\nclass ViewController: SAParallaxViewController {\n    override init() {\n        super.init()\n    }\n\n    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {\n        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)\n    }\n\n    required init(coder aDecoder: NSCoder) {\n        super.init(coder: aDecoder)\n    }\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n    }\n}\n```\n\nIf you want to use `UICollectionViewDataSource`, implement extension like this. You can set image with `cell.setImage()`. You can add some UIView member classes to `cell.containerView.accessoryView`.\n\n```swift\nextension ViewController: UICollectionViewDataSource {\n    override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -\u003e UICollectionViewCell {\n        let cell = super.collectionView(collectionView, cellForItemAt: indexPath) as! SAParallaxViewCell\n\n        let index = indexPath.row % 6\n        let imageName = String(format: \"image%d\", index + 1)\n        if let image = UIImage(named: imageName) {\n            cell.setImage(image)\n        }\n        let title = [\"Girl with Room\", \"Beautiful sky\", \"Music Festival\", \"Fashion show\", \"Beautiful beach\", \"Pizza and beer\"]\n        let label = UILabel(frame: cell.containerView.accessoryView.bounds)\n        label.textAlignment = .Center\n        label.text = title[index]\n        label.textColor = .whiteColor()\n        label.font = .systemFontOfSize(30)\n        cell.containerView.accessoryView.addSubview(label)\n\n        return cell\n    }\n}\n```\n\nIf you want to use `UICollectionViewDelegate`, implement extension like this.\n\nYou must copy `cell.containerView` to `viewController.trantisionContainerView` because to use opening transition. When you copy them, use `containerView.setViews(cells: cells, view: view)`. Set `viewController.transitioningDelegate` as self, finally call `self.presentViewController()`.\n\n```swift\nextension ViewController: UICollectionViewDelegate {\n    override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {\n        super.collectionView(collectionView, didSelectItemAt: indexPath)\n\n        guard let cells = collectionView.visibleCells as? [SAParallaxViewCell] else { return }\n        let containerView = SATransitionContainerView(frame: view.bounds)\n        containerView.setViews(cells, view: view)\n\n        let viewController = DetailViewController()\n        viewController.transitioningDelegate = self\n        viewController.trantisionContainerView = containerView\n\n        present(viewController, animated: true, completion: nil)\n    }\n}\n```\n\nExtend `SADetailViewController` like this.\n\n`SADetailViewController` is detail view controller for parallax cell.\n\n```swift\nclass DetailViewController: SADetailViewController {\n    override init() {\n        super.init()\n    }\n\n    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {\n        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)\n    }\n\n    required init(coder aDecoder: NSCoder) {\n        super.init(coder: aDecoder)\n    }\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n    }\n}\n```\n\n## Customize\n\nYou can change parallax start position with function of `cell.containerView`.\n\n```swift\nfunc setParallaxStartPosition(#y: CGFloat)\n```\n\nYou can change height of `cell.containerView.accessoryView`.\n\n```swift\nfunc setAccessoryViewHeight(height: CGFloat)\n```\n\nYou can change blur size of `cell.containerView.accessoryView`.\n\n```swift  \nfunc setBlurSize(size: CGFloat)\n```\n\nYou can change blur color of `cell.containerView.accessoryView`.\n\n```swift\nfunc setBlurColor(color: UIColor)\n```\n\nYou can change blur color alpha of `cell.containerView.accessoryView`.\n\n```swift  \nfunc setBlurColorAlpha(alpha: CGFloat)\n```\n\n## Requirements\n\n- Xcode 8.0-beta or greater\n- iOS 8.0 or greater\n- ARC\n- [SABlurImageView](https://github.com/szk-atmosphere/SABlurImageView)\n- [MisterFusion](https://github.com/szk-atmosphere/MisterFusion)\n\n## Author\n\nTaiki Suzuki, s1180183@gmail.com\n\n## License\n\nSAParallaxViewControllerSwift 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%2Fmarty-suzuki%2FSAParallaxViewControllerSwift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarty-suzuki%2FSAParallaxViewControllerSwift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarty-suzuki%2FSAParallaxViewControllerSwift/lists"}