├── .gitignore ├── .swift-version ├── .travis.yml ├── LICENSE ├── README.md ├── SAParallaxViewControllerSwift.podspec ├── SAParallaxViewControllerSwift ├── SADetailViewController.swift ├── SAParallaxContainerView.swift ├── SAParallaxViewCell.swift ├── SAParallaxViewController.swift ├── SAParallaxViewLayout.swift ├── SATransitionContainerView.swift └── SATransitionManager.swift ├── SAParallaxViewControllerSwiftExample ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── SAParallaxViewControllerSwift.podspec.json │ ├── Manifest.lock │ ├── MisterFusion │ │ ├── LICENSE │ │ ├── MisterFusion │ │ │ ├── Array+MisterFusion.swift │ │ │ └── MisterFusion.swift │ │ └── README.md │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── SABlurImageView │ │ ├── LICENSE │ │ ├── README.md │ │ └── SABlurImageView │ │ │ ├── CATransition+Closure.swift │ │ │ ├── SABlurImageView.swift │ │ │ └── UIImage+BlurEffect.swift │ └── Target Support Files │ │ ├── MisterFusion │ │ ├── Info.plist │ │ ├── MisterFusion-dummy.m │ │ ├── MisterFusion-prefix.pch │ │ ├── MisterFusion-umbrella.h │ │ ├── MisterFusion.modulemap │ │ └── MisterFusion.xcconfig │ │ ├── Pods-SAParallaxViewControllerSwiftExample │ │ ├── Info.plist │ │ ├── Pods-SAParallaxViewControllerSwiftExample-acknowledgements.markdown │ │ ├── Pods-SAParallaxViewControllerSwiftExample-acknowledgements.plist │ │ ├── Pods-SAParallaxViewControllerSwiftExample-dummy.m │ │ ├── Pods-SAParallaxViewControllerSwiftExample-frameworks.sh │ │ ├── Pods-SAParallaxViewControllerSwiftExample-resources.sh │ │ ├── Pods-SAParallaxViewControllerSwiftExample-umbrella.h │ │ ├── Pods-SAParallaxViewControllerSwiftExample.debug.xcconfig │ │ ├── Pods-SAParallaxViewControllerSwiftExample.modulemap │ │ └── Pods-SAParallaxViewControllerSwiftExample.release.xcconfig │ │ ├── SABlurImageView │ │ ├── Info.plist │ │ ├── SABlurImageView-dummy.m │ │ ├── SABlurImageView-prefix.pch │ │ ├── SABlurImageView-umbrella.h │ │ ├── SABlurImageView.modulemap │ │ └── SABlurImageView.xcconfig │ │ └── SAParallaxViewControllerSwift │ │ ├── Info.plist │ │ ├── SAParallaxViewControllerSwift-dummy.m │ │ ├── SAParallaxViewControllerSwift-prefix.pch │ │ ├── SAParallaxViewControllerSwift-umbrella.h │ │ ├── SAParallaxViewControllerSwift.modulemap │ │ └── SAParallaxViewControllerSwift.xcconfig ├── SAParallaxViewControllerSwiftExample.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── SAParallaxViewControllerSwiftExample.xcworkspace │ └── contents.xcworkspacedata ├── SAParallaxViewControllerSwiftExample │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── DetailViewController.swift │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── image1.imageset │ │ │ ├── Contents.json │ │ │ ├── ダウンロード-1.jpeg │ │ │ ├── ダウンロード-2.jpeg │ │ │ └── ダウンロード.jpeg │ │ ├── image2.imageset │ │ │ ├── Contents.json │ │ │ ├── aaa-1.jpeg │ │ │ ├── aaa-2.jpeg │ │ │ └── aaa.jpeg │ │ ├── image3.imageset │ │ │ ├── Contents.json │ │ │ ├── bbb-1.jpeg │ │ │ ├── bbb-2.jpeg │ │ │ └── bbb.jpeg │ │ ├── image4.imageset │ │ │ ├── Contents.json │ │ │ ├── ccc-1.jpeg │ │ │ ├── ccc-2.jpeg │ │ │ └── ccc.jpeg │ │ ├── image5.imageset │ │ │ ├── Contents.json │ │ │ ├── ddd-1.jpeg │ │ │ ├── ddd-2.jpeg │ │ │ └── ddd.jpeg │ │ └── image6.imageset │ │ │ ├── Contents.json │ │ │ ├── eee-1.jpeg │ │ │ ├── eee-2.jpeg │ │ │ └── eee.jpeg │ ├── Info.plist │ └── ViewController.swift └── SAParallaxViewControllerSwiftExampleTests │ ├── Info.plist │ └── SAParallaxViewControllerSwiftExampleTests.swift └── SampleImage ├── open_sample.gif └── sample.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | # Note: if you ignore the Pods directory, make sure to uncomment 30 | # `pod install` in .travis.yml 31 | # 32 | # Pods/ 33 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: 9 | # - gem install cocoapods # Since Travis is not always on latest version 10 | # - pod install --project-directory=Example 11 | install: 12 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 13 | script: 14 | - set -o pipefail && xcodebuild test -workspace Example/SAParallaxViewControllerSwift.xcworkspace -scheme SAParallaxViewControllerSwift-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c 15 | - pod lib lint --quick 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Taiki Suzuki 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SAParallaxViewControllerSwift 2 | 3 | [![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat 4 | )](https://developer.apple.com/iphone/index.action) 5 | [![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat 6 | )](https://developer.apple.com/swift) 7 | [![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat 8 | )](http://mit-license.org) 9 | [![Version](https://img.shields.io/cocoapods/v/SAParallaxViewControllerSwift.svg?style=flat)](http://cocoadocs.org/docsets/MSAlertController) 10 | 11 | ![](./SampleImage/sample.gif) ![](./SampleImage/open_sample.gif) 12 | 13 | SAParallaxViewControllerSwift realizes parallax scrolling with blur effect. In addition, it realizes seamless opening transition. 14 | 15 | ## Features 16 | 17 | - [x] Parallax scrolling 18 | - [x] Parallax scrolling with blur accessory view 19 | - [x] Seamlees opening transition 20 | - [x] Support Swift2.3 21 | - [x] Support Swift3 22 | 23 | ## Installation 24 | 25 | #### CocoaPods 26 | 27 | SAParallaxViewControllerSwift is available through [CocoaPods](http://cocoapods.org). If you have cocoapods 0.36 beta or greater, you can install 28 | it, simply add the following line to your Podfile: 29 | 30 | pod "SAParallaxViewControllerSwift" 31 | 32 | #### Manually 33 | 34 | Add the [SAParallaxViewControllerSwift](./SAParallaxViewControllerSwift) directory to your project. 35 | 36 | ## Usage 37 | 38 | If you install from cocoapods, You have to white `import SAParallaxViewControllerSwift`. 39 | 40 | Extend `SAParallaxViewController` like this. 41 | 42 | ```swift 43 | class ViewController: SAParallaxViewController { 44 | override init() { 45 | super.init() 46 | } 47 | 48 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 49 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 50 | } 51 | 52 | required init(coder aDecoder: NSCoder) { 53 | super.init(coder: aDecoder) 54 | } 55 | 56 | override func viewDidLoad() { 57 | super.viewDidLoad() 58 | } 59 | } 60 | ``` 61 | 62 | If 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`. 63 | 64 | ```swift 65 | extension ViewController: UICollectionViewDataSource { 66 | override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 67 | let cell = super.collectionView(collectionView, cellForItemAt: indexPath) as! SAParallaxViewCell 68 | 69 | let index = indexPath.row % 6 70 | let imageName = String(format: "image%d", index + 1) 71 | if let image = UIImage(named: imageName) { 72 | cell.setImage(image) 73 | } 74 | let title = ["Girl with Room", "Beautiful sky", "Music Festival", "Fashion show", "Beautiful beach", "Pizza and beer"] 75 | let label = UILabel(frame: cell.containerView.accessoryView.bounds) 76 | label.textAlignment = .Center 77 | label.text = title[index] 78 | label.textColor = .whiteColor() 79 | label.font = .systemFontOfSize(30) 80 | cell.containerView.accessoryView.addSubview(label) 81 | 82 | return cell 83 | } 84 | } 85 | ``` 86 | 87 | If you want to use `UICollectionViewDelegate`, implement extension like this. 88 | 89 | You 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()`. 90 | 91 | ```swift 92 | extension ViewController: UICollectionViewDelegate { 93 | override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 94 | super.collectionView(collectionView, didSelectItemAt: indexPath) 95 | 96 | guard let cells = collectionView.visibleCells as? [SAParallaxViewCell] else { return } 97 | let containerView = SATransitionContainerView(frame: view.bounds) 98 | containerView.setViews(cells, view: view) 99 | 100 | let viewController = DetailViewController() 101 | viewController.transitioningDelegate = self 102 | viewController.trantisionContainerView = containerView 103 | 104 | present(viewController, animated: true, completion: nil) 105 | } 106 | } 107 | ``` 108 | 109 | Extend `SADetailViewController` like this. 110 | 111 | `SADetailViewController` is detail view controller for parallax cell. 112 | 113 | ```swift 114 | class DetailViewController: SADetailViewController { 115 | override init() { 116 | super.init() 117 | } 118 | 119 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 120 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 121 | } 122 | 123 | required init(coder aDecoder: NSCoder) { 124 | super.init(coder: aDecoder) 125 | } 126 | 127 | override func viewDidLoad() { 128 | super.viewDidLoad() 129 | } 130 | } 131 | ``` 132 | 133 | ## Customize 134 | 135 | You can change parallax start position with function of `cell.containerView`. 136 | 137 | ```swift 138 | func setParallaxStartPosition(#y: CGFloat) 139 | ``` 140 | 141 | You can change height of `cell.containerView.accessoryView`. 142 | 143 | ```swift 144 | func setAccessoryViewHeight(height: CGFloat) 145 | ``` 146 | 147 | You can change blur size of `cell.containerView.accessoryView`. 148 | 149 | ```swift 150 | func setBlurSize(size: CGFloat) 151 | ``` 152 | 153 | You can change blur color of `cell.containerView.accessoryView`. 154 | 155 | ```swift 156 | func setBlurColor(color: UIColor) 157 | ``` 158 | 159 | You can change blur color alpha of `cell.containerView.accessoryView`. 160 | 161 | ```swift 162 | func setBlurColorAlpha(alpha: CGFloat) 163 | ``` 164 | 165 | ## Requirements 166 | 167 | - Xcode 8.0-beta or greater 168 | - iOS 8.0 or greater 169 | - ARC 170 | - [SABlurImageView](https://github.com/szk-atmosphere/SABlurImageView) 171 | - [MisterFusion](https://github.com/szk-atmosphere/MisterFusion) 172 | 173 | ## Author 174 | 175 | Taiki Suzuki, s1180183@gmail.com 176 | 177 | ## License 178 | 179 | SAParallaxViewControllerSwift is available under the MIT license. See the LICENSE file for more info. 180 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwift.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint SAParallaxViewControllerSwift.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # Any lines starting with a # are optional, but encouraged 6 | # 7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | s.name = "SAParallaxViewControllerSwift" 12 | s.version = "2.0.0" 13 | s.summary = "SAParallaxViewControllerSwift realizes parallax scrolling with blur effect. In addition, it realizes seamless opening transition." 14 | s.homepage = "https://github.com/marty-suzuki/SAParallaxViewControllerSwift" 15 | # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" 16 | s.license = 'MIT' 17 | s.author = { "Taiki Suzuki" => "s1180183@gmail.com" } 18 | s.source = { :git => "https://github.com/marty-suzuki/SAParallaxViewControllerSwift.git", :tag => s.version.to_s } 19 | s.social_media_url = 'https://twitter.com/marty_suzuki' 20 | 21 | s.platform = :ios, '8.0' 22 | s.requires_arc = true 23 | 24 | s.source_files = 'SAParallaxViewControllerSwift/*.{swift}' 25 | # s.resource_bundles = { 26 | # 'SAParallaxViewControllerSwift' => ['Pod/Assets/*.png'] 27 | # } 28 | 29 | # s.public_header_files = 'Pod/Classes/**/*.h' 30 | # s.frameworks = 'UIKit', 'MapKit' 31 | s.dependency 'SABlurImageView' 32 | s.dependency 'MisterFusion' 33 | end 34 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwift/SADetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SADetailViewController.swift 3 | // SAParallaxViewControllerSwift 4 | // 5 | // Created by 鈴木大貴 on 2015/02/05. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SABlurImageView 11 | 12 | open class SADetailViewController: UIViewController { 13 | fileprivate struct Const { 14 | static let headerViewHeight: CGFloat = 44 15 | } 16 | 17 | open var trantisionContainerView: SATransitionContainerView? 18 | open var imageView = SABlurImageView() 19 | 20 | open var headerView: UIView? 21 | open var closeButton: UIButton? 22 | fileprivate var headerColorView: UIView? 23 | fileprivate var headerImageView: UIImageView? 24 | fileprivate var headerContainerView: UIView? 25 | fileprivate var blurImageView: UIImageView? 26 | 27 | open override func viewDidLoad() { 28 | super.viewDidLoad() 29 | 30 | // Do any additional setup after loading the view. 31 | view.backgroundColor = .white 32 | 33 | let width = UIScreen.main.bounds.size.width 34 | imageView.image = trantisionContainerView?.containerView?.imageView.image 35 | if let imageSize = imageView.image?.size { 36 | let height = width * imageSize.height / imageSize.width 37 | imageView.autoresizingMask = UIViewAutoresizing() 38 | imageView.frame = CGRect(x: 0, y: 0, width: width, height: height) 39 | view.addSubview(imageView) 40 | } 41 | 42 | 43 | let headerContainerView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: width, height: Const.headerViewHeight)) 44 | headerContainerView.alpha = 0.0 45 | headerContainerView.clipsToBounds = true 46 | view.addSubview(headerContainerView) 47 | self.headerContainerView = headerContainerView 48 | 49 | let blurImageView = SABlurImageView(frame: imageView.bounds) 50 | blurImageView.addBlurEffect(20.0) 51 | headerContainerView.addSubview(blurImageView) 52 | self.blurImageView = blurImageView 53 | 54 | let headerColorView = UIView(frame: headerContainerView.bounds) 55 | headerColorView.backgroundColor = .black 56 | headerColorView.alpha = 0.5 57 | headerContainerView.addSubview(headerColorView) 58 | self.headerColorView = headerColorView 59 | 60 | let headerView = UIView(frame: headerContainerView.bounds) 61 | headerContainerView.addSubview(headerView) 62 | self.headerView = headerView 63 | 64 | let closeButton = UIButton(frame: CGRect(x: 0.0, y: 0.0, width: Const.headerViewHeight, height: Const.headerViewHeight)) 65 | closeButton.setTitle("×", for: UIControlState()) 66 | closeButton.titleLabel?.font = .systemFont(ofSize: Const.headerViewHeight) 67 | closeButton.titleLabel?.textColor = .white 68 | closeButton.addTarget(self, action: #selector(SADetailViewController.closeAction(_:)), for: .touchUpInside) 69 | headerView.addSubview(closeButton) 70 | self.closeButton = closeButton 71 | } 72 | 73 | open override func viewDidAppear(_ animated: Bool) { 74 | super.viewDidAppear(animated) 75 | 76 | UIView.animate(withDuration: 0.25, delay: 0.0, options: .curveEaseIn, animations: { 77 | self.headerContainerView?.alpha = 1.0 78 | }, completion: nil) 79 | } 80 | 81 | open override func didReceiveMemoryWarning() { 82 | super.didReceiveMemoryWarning() 83 | // Dispose of any resources that can be recreated. 84 | } 85 | 86 | open override var prefersStatusBarHidden : Bool { 87 | return true 88 | } 89 | 90 | open func closeAction(_ button: UIButton) { 91 | UIView.animate(withDuration: 0.25, delay: 0.0, options: .curveEaseIn, animations: { 92 | self.headerContainerView?.alpha = 0.0 93 | }, completion: { _ in 94 | self.dismiss(animated: true, completion: nil) 95 | }) 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwift/SAParallaxContainerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SAParallaxContainerView.swift 3 | // SAParallaxViewControllerSwift 4 | // 5 | // Created by 鈴木大貴 on 2015/02/01. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SABlurImageView 11 | 12 | open class SAParallaxContainerView: UIView { 13 | 14 | open var imageView = UIImageView() 15 | open var accessoryView = UIView() 16 | 17 | open var blurContainerView = UIView() 18 | open var blurImageView = SABlurImageView() 19 | 20 | fileprivate var yStartPoint: CGFloat? 21 | fileprivate var accessoryViewHeight: CGFloat = 60 22 | 23 | fileprivate var blurColorView = UIView() 24 | fileprivate var blurSize: CGFloat = 20 25 | 26 | public convenience init() { 27 | self.init(frame: .zero) 28 | initialize() 29 | } 30 | 31 | public override init(frame: CGRect) { 32 | super.init(frame: frame) 33 | initialize() 34 | } 35 | 36 | public required init?(coder aDecoder: NSCoder) { 37 | super.init(coder: aDecoder) 38 | initialize() 39 | } 40 | 41 | //MARK: - SAParallaxContainerView Private Methods 42 | fileprivate func initialize() { 43 | imageView.contentMode = .scaleAspectFit 44 | 45 | blurContainerView.backgroundColor = .clear 46 | blurContainerView.clipsToBounds = true 47 | 48 | accessoryView.backgroundColor = .clear 49 | 50 | blurColorView.backgroundColor = .white 51 | blurColorView.alpha = 0.3 52 | 53 | backgroundColor = .clear 54 | clipsToBounds = true 55 | } 56 | 57 | //MARK: - SAParallaxContainerView Public Methods 58 | open func setImage(_ image: UIImage) { 59 | self.imageView.image = image 60 | if let imageSize = imageView.image?.size { 61 | let width = bounds.size.width 62 | let height = width * imageSize.height / imageSize.width 63 | 64 | let yPoint = yStartPoint ?? 0 65 | if yPoint == 0 { 66 | yStartPoint = 0 67 | } 68 | imageView.autoresizingMask = UIViewAutoresizing() 69 | imageView.frame = CGRect(x: 0, y: -yPoint, width: width, height: height) 70 | addSubview(imageView) 71 | } 72 | 73 | let width = UIScreen.main.bounds.size.width 74 | let height = width / 320.0 * accessoryViewHeight 75 | blurContainerView.frame = CGRect(x: 0, y: frame.size.height - height, width: width, height: height) 76 | addSubview(blurContainerView) 77 | 78 | let blurImage = imageView.image 79 | if let imageSize = blurImage?.size { 80 | let height = width * imageSize.height / imageSize.width 81 | blurImageView.image = blurImage 82 | blurImageView.addBlurEffect(blurSize) 83 | blurImageView.frame = CGRect(x: 0, y: -(frame.size.height - blurContainerView.frame.height), width: width, height: height) 84 | blurContainerView.addSubview(blurImageView) 85 | } 86 | 87 | blurColorView.frame = blurContainerView.bounds 88 | blurContainerView.addSubview(blurColorView) 89 | 90 | accessoryView.frame = blurContainerView.bounds 91 | blurContainerView.addSubview(accessoryView) 92 | } 93 | 94 | open func setImageOffset(_ offset: CGPoint) { 95 | imageView.frame = imageView.bounds.offsetBy(dx: offset.x, dy: offset.y) 96 | blurImageView.frame = blurImageView.bounds.offsetBy(dx: offset.x, dy: -(frame.size.height - blurContainerView.frame.height) + offset.y) 97 | } 98 | 99 | open func setParallaxStartPosition(_ y: CGFloat) { 100 | yStartPoint = CGFloat(y) 101 | } 102 | 103 | open func parallaxStartPosition() -> CGFloat? { 104 | return yStartPoint 105 | } 106 | 107 | open func setAccessoryViewHeight(_ height: CGFloat) { 108 | accessoryViewHeight = CGFloat(height) 109 | } 110 | 111 | open func setBlurSize(_ size: CGFloat) { 112 | blurSize = size 113 | } 114 | 115 | open func setBlurColorAlpha(_ alpha: CGFloat) { 116 | blurColorView.alpha = alpha 117 | } 118 | 119 | open func setBlurColor(_ color: UIColor) { 120 | blurColorView.backgroundColor = color 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwift/SAParallaxViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SAParallaxViewCell.swift 3 | // SAParallaxViewControllerSwift 4 | // 5 | // Created by 鈴木大貴 on 2015/01/30. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class SAParallaxViewCell: UICollectionViewCell { 12 | 13 | open var containerView = SAParallaxContainerView() 14 | 15 | fileprivate var previousImageOffset = CGPoint.zero 16 | 17 | public convenience init() { 18 | self.init(frame: .zero) 19 | initialize() 20 | } 21 | 22 | public required init?(coder aDecoder: NSCoder) { 23 | super.init(coder: aDecoder) 24 | initialize() 25 | } 26 | 27 | public override init(frame: CGRect) { 28 | super.init(frame: frame) 29 | initialize() 30 | } 31 | 32 | open override func prepareForReuse() { 33 | containerView.removeFromSuperview() 34 | initialize() 35 | } 36 | 37 | //MARK: - SAParallaxViewCell Private Methods 38 | fileprivate func initialize() { 39 | containerView.frame = bounds 40 | addSubview(containerView) 41 | } 42 | 43 | //MARK: - SAParallaxViewCell Public Methods 44 | open func setImage(_ image: UIImage) { 45 | containerView.setImage(image) 46 | } 47 | 48 | open func setImageOffset(_ offset: CGPoint) { 49 | if isSelected { 50 | return 51 | } 52 | containerView.setImageOffset(offset) 53 | } 54 | 55 | open func screenShot() -> UIImageView { 56 | 57 | let scale = UIScreen.main.scale 58 | UIGraphicsBeginImageContextWithOptions(self.frame.size, false, scale) 59 | containerView.layer.render(in: UIGraphicsGetCurrentContext()!) 60 | let image = UIGraphicsGetImageFromCurrentImageContext() 61 | UIGraphicsEndImageContext() 62 | 63 | let imageView = UIImageView(frame: containerView.bounds) 64 | imageView.image = image 65 | 66 | return imageView 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwift/SAParallaxViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SAParallaxViewController.swift 3 | // SAParallaxViewControllerSwift 4 | // 5 | // Created by 鈴木大貴 on 2015/01/30. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import MisterFusion 11 | 12 | open class SAParallaxViewController: UIViewController { 13 | 14 | open static let parallaxViewCellReuseIdentifier = "ParallaxViewCellReuseIdentifier" 15 | 16 | open var collectionView = UICollectionView(frame: .zero, collectionViewLayout: SAParallaxViewLayout()) 17 | 18 | fileprivate let transitionManager = SATransitionManager() 19 | 20 | public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { 21 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 22 | } 23 | 24 | public required init?(coder aDecoder: NSCoder) { 25 | super.init(coder: aDecoder) 26 | } 27 | 28 | open override func viewDidLoad() { 29 | super.viewDidLoad() 30 | // Do any additional setup after loading the view. 31 | view.backgroundColor = .white 32 | 33 | view.addLayoutSubview(collectionView, andConstraints: 34 | collectionView.top, 35 | collectionView.left, 36 | collectionView.right, 37 | collectionView.bottom 38 | ) 39 | 40 | collectionView.register(SAParallaxViewCell.self, forCellWithReuseIdentifier: SAParallaxViewController.parallaxViewCellReuseIdentifier) 41 | collectionView.backgroundColor = .clear 42 | collectionView.delegate = self 43 | collectionView.dataSource = self 44 | } 45 | 46 | open override func viewWillAppear(_ animated: Bool) { 47 | super.viewWillAppear(animated) 48 | collectionView.visibleCells.forEach { $0.isSelected = false } 49 | } 50 | 51 | open override func didReceiveMemoryWarning() { 52 | super.didReceiveMemoryWarning() 53 | // Dispose of any resources that can be recreated. 54 | } 55 | 56 | open override var prefersStatusBarHidden : Bool { 57 | return true 58 | } 59 | } 60 | 61 | //MARK: - UICollectionViewDataSource 62 | extension SAParallaxViewController: UICollectionViewDataSource { 63 | open func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 64 | return 30 65 | } 66 | 67 | open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 68 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: SAParallaxViewController.parallaxViewCellReuseIdentifier, for: indexPath) 69 | cell.backgroundColor = .clear 70 | cell.isSelected = false 71 | return cell 72 | } 73 | } 74 | 75 | //MARK: - UICollectionViewDelegate 76 | extension SAParallaxViewController: UICollectionViewDelegate { 77 | open func scrollViewDidScroll(_ scrollView: UIScrollView) { 78 | guard let cells = collectionView.visibleCells as? [SAParallaxViewCell] else { return } 79 | cells.forEach { 80 | guard let point = $0.superview?.convert($0.frame.origin, to:view) else { return } 81 | let yScrollStart = scrollView.frame.size.height - $0.frame.size.height 82 | guard yScrollStart >= point.y else { return } 83 | let imageRemainDistance = ($0.containerView.imageView.frame.size.width - $0.frame.size.height) / 2.0 84 | let maxScrollDistance = scrollView.frame.size.height 85 | var yOffset = (1.0 - ((point.y + $0.frame.size.height) / maxScrollDistance)) * imageRemainDistance 86 | 87 | if yOffset > imageRemainDistance { 88 | yOffset = imageRemainDistance 89 | } 90 | if let parallaxStartPosition = $0.containerView.parallaxStartPosition() { 91 | $0.setImageOffset(CGPoint(x: 0.0, y: -(parallaxStartPosition) - yOffset)) 92 | } 93 | } 94 | } 95 | 96 | open func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 97 | collectionView.deselectItem(at: indexPath, animated: false) 98 | collectionView.cellForItem(at: indexPath)?.isSelected = true 99 | } 100 | } 101 | 102 | //MARK: - UIViewControllerTransitioningDelegate 103 | extension SAParallaxViewController: UIViewControllerTransitioningDelegate { 104 | open func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { 105 | return transitionManager 106 | } 107 | 108 | open func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 109 | return transitionManager 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwift/SAParallaxViewLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SAParallaxViewLayout.swift 3 | // SAParallaxViewControllerSwift 4 | // 5 | // Created by 鈴木大貴 on 2015/01/30. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class SAParallaxViewLayout: UICollectionViewFlowLayout { 12 | 13 | fileprivate static let defaultHeight: CGFloat = 220 14 | 15 | public override init() { 16 | super.init() 17 | initialize() 18 | } 19 | 20 | public required init?(coder aDecoder: NSCoder) { 21 | super.init(coder: aDecoder) 22 | initialize() 23 | } 24 | 25 | fileprivate func initialize() { 26 | minimumInteritemSpacing = 0.0 27 | minimumLineSpacing = 0.0 28 | sectionInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0) 29 | let width = UIScreen.main.bounds.size.width 30 | let height = width / 320.0 * SAParallaxViewLayout.defaultHeight 31 | itemSize = CGSize(width: width, height: height) 32 | } 33 | 34 | open override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { 35 | return super.layoutAttributesForElements(in: rect) 36 | } 37 | 38 | open override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { 39 | return super.layoutAttributesForItem(at: indexPath) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwift/SATransitionContainerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SATransitionContainerView.swift 3 | // SAParallaxViewControllerSwift 4 | // 5 | // Created by 鈴木大貴 on 2015/02/05. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class SATransitionContainerView: UIView { 12 | 13 | open var views: [UIView] = [] 14 | open var viewInitialPositions: [CGPoint] = [] 15 | open var imageViewInitialFrame: CGRect = .zero 16 | open var blurImageViewInitialFrame: CGRect = .zero 17 | open var containerViewInitialFrame: CGRect = .zero 18 | open var containerView: SAParallaxContainerView? 19 | 20 | public required init?(coder aDecoder: NSCoder) { 21 | super.init(coder: aDecoder) 22 | } 23 | 24 | public override init(frame: CGRect) { 25 | super.init(frame: frame) 26 | } 27 | 28 | open func setViews(_ cells: [SAParallaxViewCell], view: UIView) { 29 | cells.forEach { 30 | guard let point = $0.superview?.convert($0.frame.origin, to:view) else { return } 31 | viewInitialPositions.append(point) 32 | 33 | if $0.isSelected { 34 | let containerView = SAParallaxContainerView(frame: $0.containerView.bounds) 35 | containerView.frame.origin = point 36 | containerView.clipsToBounds = true 37 | containerView.backgroundColor = .white 38 | containerViewInitialFrame = containerView.frame 39 | 40 | if let image = $0.containerView.imageView.image { 41 | containerView.setImage(image) 42 | } 43 | if let _ = containerView.imageView.image { 44 | containerView.imageView.frame = $0.containerView.imageView.frame 45 | imageViewInitialFrame = containerView.imageView.frame 46 | } 47 | 48 | if let _ = containerView.blurImageView.image { 49 | containerView.blurImageView.frame = $0.containerView.blurImageView.frame 50 | blurImageViewInitialFrame = containerView.blurImageView.frame; 51 | } 52 | 53 | views.append(containerView) 54 | addSubview(containerView) 55 | self.containerView = containerView 56 | return 57 | } 58 | 59 | let imageView = $0.screenShot() 60 | imageView.frame.origin = point 61 | views.append(imageView) 62 | addSubview(imageView) 63 | } 64 | } 65 | 66 | open func openAnimation() { 67 | guard 68 | let yPositionContainer = containerView?.frame.origin.y, 69 | let containerViewHeight = containerView?.frame.size.height 70 | else { return } 71 | let height = frame.size.height 72 | 73 | let distanceToTop = yPositionContainer 74 | let distanceToBottom = height - (yPositionContainer + containerViewHeight) 75 | 76 | views.forEach { 77 | if $0 != containerView { 78 | var frame = $0.frame 79 | if frame.origin.y < yPositionContainer { 80 | frame.origin.y -= distanceToTop 81 | } else { 82 | frame.origin.y += distanceToBottom 83 | } 84 | $0.frame = frame 85 | return 86 | } 87 | guard let containerView = containerView else { return } 88 | containerView.frame = bounds 89 | containerView.imageView.frame = containerView.imageView.bounds 90 | var rect = containerView.blurContainerView.frame 91 | rect.origin.y = height - rect.size.height 92 | containerView.blurContainerView.frame = rect 93 | } 94 | } 95 | 96 | open func closeAnimation() { 97 | views.enumerated().forEach { 98 | if $0.element != containerView { 99 | let point = self.viewInitialPositions[$0.offset] 100 | $0.element.frame.origin = point 101 | return 102 | } 103 | containerView?.frame = containerViewInitialFrame 104 | containerView?.imageView.frame = imageViewInitialFrame 105 | containerView?.blurImageView.frame = blurImageViewInitialFrame 106 | guard let containerView = containerView else { return } 107 | var rect = containerView.blurContainerView.frame 108 | rect.origin.y = containerView.frame.size.height - rect.size.height 109 | containerView.blurContainerView.frame = rect 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwift/SATransitionManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SATransitionManager.swift 3 | // SAParallaxViewControllerSwift 4 | // 5 | // Created by 鈴木大貴 on 2015/02/05. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class SATransitionManager: NSObject, UIViewControllerAnimatedTransitioning { 12 | open var animationDuration = 0.25 13 | 14 | //MARK: - UIViewControllerAnimatedTransitioning 15 | open func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { 16 | return animationDuration 17 | } 18 | 19 | open func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { 20 | guard 21 | let toViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to), 22 | let fromViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from) 23 | else { return } 24 | 25 | let containerView = transitionContext.containerView 26 | let duration = transitionDuration(using: transitionContext) 27 | 28 | switch (toViewController, fromViewController) { 29 | case (let _ as SAParallaxViewController, let fromVC as SADetailViewController): 30 | guard let transitionContainer = fromVC.trantisionContainerView else { break } 31 | containerView.addSubview(transitionContainer) 32 | 33 | UIView.animate(withDuration: duration, delay: 0.0, options: .curveEaseIn, animations: { 34 | 35 | transitionContainer.closeAnimation() 36 | 37 | }, completion: { (finished) in 38 | 39 | UIView.animate(withDuration: duration, delay: 0.0, options: .curveEaseIn, animations: { 40 | 41 | transitionContainer.containerView?.blurContainerView.alpha = 1.0 42 | 43 | }, completion: { (finished) in 44 | 45 | let cancelled = transitionContext.transitionWasCancelled 46 | if cancelled { 47 | transitionContainer.removeFromSuperview() 48 | } else { 49 | containerView.addSubview(toViewController.view) 50 | } 51 | transitionContext.completeTransition(!cancelled) 52 | 53 | }) 54 | }) 55 | return 56 | 57 | case (let toVC as SADetailViewController, let _ as SAParallaxViewController): 58 | guard let transitionContainer = toVC.trantisionContainerView else { break } 59 | containerView.addSubview(transitionContainer) 60 | 61 | UIView.animate(withDuration: duration, delay: 0.0, options: .curveEaseIn, animations: { 62 | 63 | transitionContainer.containerView?.blurContainerView.alpha = 0.0 64 | 65 | }, completion: { (finished) in 66 | 67 | UIView.animate(withDuration: duration, delay: 0.0, options: .curveEaseIn, animations: { 68 | 69 | transitionContainer.openAnimation() 70 | 71 | }, completion: { (finished) in 72 | 73 | let cancelled = transitionContext.transitionWasCancelled 74 | if cancelled { 75 | transitionContainer.removeFromSuperview() 76 | } else { 77 | containerView.addSubview(toViewController.view) 78 | } 79 | transitionContext.completeTransition(!cancelled) 80 | 81 | }) 82 | }) 83 | return 84 | 85 | default: 86 | break 87 | } 88 | 89 | transitionContext.completeTransition(true) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '8.0' 3 | # Uncomment this line if you're using Swift 4 | use_frameworks! 5 | 6 | target 'SAParallaxViewControllerSwiftExample' do 7 | pod 'SAParallaxViewControllerSwift', :path => '../' 8 | end 9 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MisterFusion (2.0.1) 3 | - SABlurImageView (3.0.0) 4 | - SAParallaxViewControllerSwift (2.0.0): 5 | - MisterFusion 6 | - SABlurImageView 7 | 8 | DEPENDENCIES: 9 | - SAParallaxViewControllerSwift (from `../`) 10 | 11 | EXTERNAL SOURCES: 12 | SAParallaxViewControllerSwift: 13 | :path: "../" 14 | 15 | SPEC CHECKSUMS: 16 | MisterFusion: d42cac7afe8318c282bcda93396eba0aef45d30e 17 | SABlurImageView: 7003ca28ded502c984846374a117f88a287d9faf 18 | SAParallaxViewControllerSwift: 04939b077ef0a563be74fed16cfc0688900a3c09 19 | 20 | PODFILE CHECKSUM: d35a45f146416c6f7fd66ee848bba9b490f4a723 21 | 22 | COCOAPODS: 1.1.0.rc.2 23 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Local Podspecs/SAParallaxViewControllerSwift.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SAParallaxViewControllerSwift", 3 | "version": "2.0.0", 4 | "summary": "SAParallaxViewControllerSwift realizes parallax scrolling with blur effect. In addition, it realizes seamless opening transition.", 5 | "homepage": "https://github.com/marty-suzuki/SAParallaxViewControllerSwift", 6 | "license": "MIT", 7 | "authors": { 8 | "Taiki Suzuki": "s1180183@gmail.com" 9 | }, 10 | "source": { 11 | "git": "https://github.com/marty-suzuki/SAParallaxViewControllerSwift.git", 12 | "tag": "2.0.0" 13 | }, 14 | "social_media_url": "https://twitter.com/marty_suzuki", 15 | "platforms": { 16 | "ios": "8.0" 17 | }, 18 | "requires_arc": true, 19 | "source_files": "SAParallaxViewControllerSwift/*.{swift}", 20 | "dependencies": { 21 | "SABlurImageView": [ 22 | 23 | ], 24 | "MisterFusion": [ 25 | 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MisterFusion (2.0.1) 3 | - SABlurImageView (3.0.0) 4 | - SAParallaxViewControllerSwift (2.0.0): 5 | - MisterFusion 6 | - SABlurImageView 7 | 8 | DEPENDENCIES: 9 | - SAParallaxViewControllerSwift (from `../`) 10 | 11 | EXTERNAL SOURCES: 12 | SAParallaxViewControllerSwift: 13 | :path: "../" 14 | 15 | SPEC CHECKSUMS: 16 | MisterFusion: d42cac7afe8318c282bcda93396eba0aef45d30e 17 | SABlurImageView: 7003ca28ded502c984846374a117f88a287d9faf 18 | SAParallaxViewControllerSwift: 04939b077ef0a563be74fed16cfc0688900a3c09 19 | 20 | PODFILE CHECKSUM: d35a45f146416c6f7fd66ee848bba9b490f4a723 21 | 22 | COCOAPODS: 1.1.0.rc.2 23 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/MisterFusion/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Taiki Suzuki 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/MisterFusion/MisterFusion/Array+MisterFusion.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Array+NSLayoutConstraint.swift 3 | // MisterFusion 4 | // 5 | // Created by Taiki Suzuki on 2015/11/18. 6 | // Copyright © 2015年 Taiki Suzuki. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension Array where Element: NSLayoutConstraint { 12 | public func firstItem(_ view: UIView) -> [Element] { 13 | return filter { $0.firstItem as? UIView == view } 14 | } 15 | 16 | public func firstAttribute(_ attribute: NSLayoutAttribute) -> [Element] { 17 | return filter { $0.firstAttribute == attribute } 18 | } 19 | 20 | public func relation(_ relation: NSLayoutRelation) -> [Element] { 21 | return filter { $0.relation == relation } 22 | } 23 | 24 | public func secondItem(_ view: UIView) -> [Element] { 25 | return filter { $0.secondItem as? UIView == view } 26 | } 27 | 28 | public func secondAttribute(_ attribute: NSLayoutAttribute) -> [Element] { 29 | return filter { $0.secondAttribute == attribute } 30 | } 31 | } 32 | 33 | extension NSArray { 34 | @available(*, unavailable) 35 | @objc(FirstItem) 36 | public var firstItem: (UIView) -> NSArray { 37 | guard let array = self as? [NSLayoutConstraint] else { 38 | return { _ in return [] } 39 | } 40 | return { view in 41 | return array.filter { $0.firstItem as? UIView == view } as NSArray 42 | } 43 | } 44 | 45 | @available(*, unavailable) 46 | @objc(FirstAttribute) 47 | public var firstAttribute: (NSLayoutAttribute) -> NSArray { 48 | guard let array = self as? [NSLayoutConstraint] else { 49 | return { _ in return [] } 50 | } 51 | return { attribute in 52 | return array.filter { $0.firstAttribute == attribute } as NSArray 53 | } 54 | } 55 | 56 | @available(*, unavailable) 57 | @objc(SecondItem) 58 | public var secondItem: (UIView) -> NSArray { 59 | guard let array = self as? [NSLayoutConstraint] else { 60 | return { _ in return [] } 61 | } 62 | return { view in 63 | return array.filter { $0.secondItem as? UIView == view } as NSArray 64 | } 65 | } 66 | 67 | @available(*, unavailable) 68 | @objc(SecondAttribute) 69 | public var secondAttribute: (NSLayoutAttribute) -> NSArray { 70 | guard let array = self as? [NSLayoutConstraint] else { 71 | return { _ in return [] } 72 | } 73 | return { attribute in 74 | return array.filter { $0.secondAttribute == attribute } as NSArray 75 | } 76 | } 77 | 78 | @available(*, unavailable) 79 | @objc(Reration) 80 | public var reration: (NSLayoutRelation) -> NSArray { 81 | guard let array = self as? [NSLayoutConstraint] else { 82 | return { _ in return [] } 83 | } 84 | return { relation in 85 | return array.filter { $0.relation == relation } as NSArray 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/MisterFusion/MisterFusion/MisterFusion.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MisterFusion.swift 3 | // MisterFusion 4 | // 5 | // Created by Taiki Suzuki on 2015/11/13. 6 | // Copyright © 2015年 Taiki Suzuki. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class MisterFusion: NSObject { 12 | fileprivate let item: UIView? 13 | fileprivate let attribute: NSLayoutAttribute? 14 | fileprivate let relatedBy: NSLayoutRelation? 15 | fileprivate let toItem: UIView? 16 | fileprivate let toAttribute: NSLayoutAttribute? 17 | fileprivate let multiplier: CGFloat? 18 | fileprivate let constant: CGFloat? 19 | fileprivate let priority: UILayoutPriority? 20 | fileprivate let horizontalSizeClass: UIUserInterfaceSizeClass? 21 | fileprivate let verticalSizeClass: UIUserInterfaceSizeClass? 22 | fileprivate let identifier: String? 23 | 24 | override open var description: String { 25 | return "\(super.description)\n" + 26 | "item : \(item)\n" + 27 | "attribute : \(attribute?.rawValue))\n" + 28 | "relatedBy : \(relatedBy?.rawValue))\n" + 29 | "toItem : \(toItem)\n" + 30 | "toAttribute : \(toAttribute?.rawValue))\n" + 31 | "multiplier : \(multiplier)\n" + 32 | "constant : \(constant)\n" + 33 | "priority : \(priority)\n" + 34 | "horizontalSizeClass: \(horizontalSizeClass?.rawValue)\n" + 35 | "verticalSizeClass : \(verticalSizeClass?.rawValue)\n" 36 | } 37 | 38 | init(item: UIView?, attribute: NSLayoutAttribute?, relatedBy: NSLayoutRelation?, toItem: UIView?, toAttribute: NSLayoutAttribute?, multiplier: CGFloat?, constant: CGFloat?, priority: UILayoutPriority?, horizontalSizeClass: UIUserInterfaceSizeClass?, verticalSizeClass: UIUserInterfaceSizeClass?, identifier: String?) { 39 | self.item = item 40 | self.attribute = attribute 41 | self.relatedBy = relatedBy 42 | self.toItem = toItem 43 | self.toAttribute = toAttribute 44 | self.multiplier = multiplier 45 | self.constant = constant 46 | self.priority = priority 47 | self.horizontalSizeClass = horizontalSizeClass 48 | self.verticalSizeClass = verticalSizeClass 49 | self.identifier = identifier 50 | super.init() 51 | } 52 | 53 | @available(*, unavailable) 54 | open var Equal: (MisterFusion) -> MisterFusion? { 55 | return { [weak self] in 56 | guard let me = self else { return nil } 57 | return me |==| $0 58 | } 59 | } 60 | 61 | @available(*, unavailable) 62 | open var NotRelatedEqualConstant: (CGFloat) -> MisterFusion? { 63 | return { [weak self] in 64 | guard let me = self else { return nil } 65 | return me |==| $0 66 | } 67 | } 68 | 69 | @available(*, unavailable) 70 | open var LessThanOrEqual: (MisterFusion) -> MisterFusion? { 71 | return { [weak self] in 72 | guard let me = self else { return nil } 73 | return me |<=| $0 74 | } 75 | } 76 | 77 | @available(iOS, unavailable) 78 | open var NotRelatedLessThanOrEqualConstant: (CGFloat) -> MisterFusion? { 79 | return { [weak self] in 80 | guard let me = self else { return nil } 81 | return me |<=| $0 82 | } 83 | } 84 | 85 | @available(iOS, unavailable) 86 | open var GreaterThanOrEqual: (MisterFusion) -> MisterFusion? { 87 | return { [weak self] in 88 | guard let me = self else { return nil } 89 | return me |>=| $0 90 | } 91 | } 92 | 93 | @available(iOS, unavailable) 94 | open var NotRelatedGreaterThanOrEqualConstant: (CGFloat) -> MisterFusion? { 95 | return { [weak self] in 96 | guard let me = self else { return nil } 97 | return me |>=| $0 98 | } 99 | } 100 | 101 | @available(iOS, unavailable) 102 | open var Multiplier: (CGFloat) -> MisterFusion? { 103 | return { [weak self] in 104 | guard let me = self else { return nil } 105 | return me |*| $0 106 | } 107 | } 108 | 109 | @available(iOS, unavailable) 110 | open var Constant: (CGFloat) -> MisterFusion? { 111 | return { [weak self] in 112 | guard let me = self else { return nil } 113 | return me |+| $0 114 | } 115 | } 116 | 117 | @available(iOS, unavailable) 118 | open var Priority: (UILayoutPriority) -> MisterFusion? { 119 | return { [weak self] in 120 | guard let me = self else { return nil } 121 | return me |<>| $0 122 | } 123 | } 124 | 125 | @available(*, unavailable) 126 | open var NotRelatedConstant: (CGFloat) -> MisterFusion? { 127 | return { [weak self] in 128 | guard let me = self else { return nil } 129 | return me |==| $0 130 | } 131 | } 132 | 133 | @available(*, unavailable) 134 | open var HorizontalSizeClass: (UIUserInterfaceSizeClass) -> MisterFusion? { 135 | return { [weak self] in 136 | guard let me = self else { return nil } 137 | return me <-> $0 138 | } 139 | } 140 | 141 | @available(*, unavailable) 142 | open var VerticalSizeClass: (UIUserInterfaceSizeClass) -> MisterFusion? { 143 | return { [weak self] in 144 | guard let me = self else { return nil } 145 | return me <|> $0 146 | } 147 | } 148 | 149 | 150 | @available(*, unavailable) 151 | open var Identifier: (String) -> MisterFusion? { 152 | return { [weak self] in 153 | guard let me = self else { return nil } 154 | return me -=- $0 155 | } 156 | } 157 | } 158 | 159 | precedencegroup MisterFusionAdditive { 160 | associativity: left 161 | higherThan: TernaryPrecedence, CastingPrecedence, AssignmentPrecedence 162 | } 163 | 164 | infix operator |==| : MisterFusionAdditive 165 | public func |==| (left: MisterFusion, right: MisterFusion) -> MisterFusion { 166 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: .equal, toItem: right.item, toAttribute: right.attribute, multiplier: nil, constant: nil, priority: nil, horizontalSizeClass: nil, verticalSizeClass: nil, identifier: left.identifier) 167 | } 168 | 169 | public func |==| (left: MisterFusion, right: CGFloat) -> MisterFusion { 170 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: .equal, toItem: nil, toAttribute: .notAnAttribute, multiplier: nil, constant: right, priority: nil, horizontalSizeClass: nil, verticalSizeClass: nil, identifier: left.identifier) 171 | } 172 | 173 | infix operator |<=| : MisterFusionAdditive 174 | public func |<=| (left: MisterFusion, right: MisterFusion) -> MisterFusion { 175 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: .lessThanOrEqual, toItem: right.item, toAttribute: right.attribute, multiplier: nil, constant: nil, priority: nil, horizontalSizeClass: nil, verticalSizeClass: nil, identifier: left.identifier) 176 | } 177 | 178 | public func |<=| (left: MisterFusion, right: CGFloat) -> MisterFusion { 179 | let toAttribute = left.attribute == .height || left.attribute == .width ? .notAnAttribute : left.attribute 180 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: .lessThanOrEqual, toItem: nil, toAttribute: toAttribute, multiplier: nil, constant: right, priority: nil, horizontalSizeClass: nil, verticalSizeClass: nil, identifier: left.identifier) 181 | } 182 | 183 | infix operator |>=| : MisterFusionAdditive 184 | public func |>=| (left: MisterFusion, right: MisterFusion) -> MisterFusion { 185 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: .greaterThanOrEqual, toItem: right.item, toAttribute: right.attribute, multiplier: nil, constant: nil, priority: nil, horizontalSizeClass: nil, verticalSizeClass: nil, identifier: left.identifier) 186 | } 187 | 188 | public func |>=| (left: MisterFusion, right: CGFloat) -> MisterFusion { 189 | let toAttribute = left.attribute == .height || left.attribute == .width ? .notAnAttribute : left.attribute 190 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: .greaterThanOrEqual, toItem: nil, toAttribute: toAttribute, multiplier: nil, constant: right, priority: nil, horizontalSizeClass: nil, verticalSizeClass: nil, identifier: left.identifier) 191 | } 192 | 193 | infix operator |+| : MisterFusionAdditive 194 | public func |+| (left: MisterFusion, right: CGFloat) -> MisterFusion { 195 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: left.relatedBy, toItem: left.toItem, toAttribute: left.toAttribute, multiplier: left.multiplier, constant: right, priority: left.priority, horizontalSizeClass: left.horizontalSizeClass, verticalSizeClass: left.verticalSizeClass, identifier: left.identifier) 196 | } 197 | 198 | infix operator |-| : MisterFusionAdditive 199 | public func |-| (left: MisterFusion, right: CGFloat) -> MisterFusion { 200 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: left.relatedBy, toItem: left.toItem, toAttribute: left.toAttribute, multiplier: left.multiplier, constant: -right, priority: left.priority, horizontalSizeClass: left.horizontalSizeClass, verticalSizeClass: left.verticalSizeClass, identifier: left.identifier) 201 | } 202 | 203 | infix operator |*| : MisterFusionAdditive 204 | public func |*| (left: MisterFusion, right: CGFloat) -> MisterFusion { 205 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: left.relatedBy, toItem: left.toItem, toAttribute: left.toAttribute, multiplier: right, constant: left.constant, priority: left.priority, horizontalSizeClass: left.horizontalSizeClass, verticalSizeClass: left.verticalSizeClass, identifier: left.identifier) 206 | } 207 | 208 | infix operator |/| : MisterFusionAdditive 209 | public func |/| (left: MisterFusion, right: CGFloat) -> MisterFusion { 210 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: left.relatedBy, toItem: left.toItem, toAttribute: left.toAttribute, multiplier: 1 / right, constant: left.constant, priority: left.priority, horizontalSizeClass: left.horizontalSizeClass, verticalSizeClass: left.verticalSizeClass, identifier: left.identifier) 211 | } 212 | 213 | infix operator |<>| : MisterFusionAdditive 214 | public func |<>| (left: MisterFusion, right: UILayoutPriority) -> MisterFusion { 215 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: left.relatedBy, toItem: left.toItem, toAttribute: left.toAttribute, multiplier: left.multiplier, constant: left.constant, priority: right, horizontalSizeClass: left.horizontalSizeClass, verticalSizeClass: left.verticalSizeClass, identifier: left.identifier) 216 | } 217 | 218 | infix operator <-> : MisterFusionAdditive 219 | public func <-> (left: MisterFusion, right: UIUserInterfaceSizeClass) -> MisterFusion { 220 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: left.relatedBy, toItem: left.toItem, toAttribute: left.toAttribute, multiplier: left.multiplier, constant: left.constant, priority: left.priority, horizontalSizeClass: right, verticalSizeClass: left.verticalSizeClass, identifier: left.identifier) 221 | } 222 | 223 | infix operator <|> : MisterFusionAdditive 224 | public func <|> (left: MisterFusion, right: UIUserInterfaceSizeClass) -> MisterFusion { 225 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: left.relatedBy, toItem: left.toItem, toAttribute: left.toAttribute, multiplier: left.multiplier, constant: left.constant, priority: left.priority, horizontalSizeClass: left.horizontalSizeClass, verticalSizeClass: right, identifier: left.identifier) 226 | } 227 | 228 | infix operator -=- : MisterFusionAdditive 229 | public func -=- (left: MisterFusion, right: String) -> MisterFusion { 230 | return MisterFusion(item: left.item, attribute: left.attribute, relatedBy: left.relatedBy, toItem: left.toItem, toAttribute: left.toAttribute, multiplier: left.multiplier, constant: left.constant, priority: left.priority, horizontalSizeClass: left.horizontalSizeClass, verticalSizeClass: left.verticalSizeClass, identifier: right) 231 | } 232 | 233 | extension UIView { 234 | @objc(Top) 235 | public var top: MisterFusion { return createMisterFusion(withAttribute: .top) } 236 | 237 | @objc(Right) 238 | public var right: MisterFusion { return createMisterFusion(withAttribute: .right) } 239 | 240 | @objc(Left) 241 | public var left: MisterFusion { return createMisterFusion(withAttribute: .left) } 242 | 243 | @objc(Bottom) 244 | public var bottom: MisterFusion { return createMisterFusion(withAttribute: .bottom) } 245 | 246 | @objc(Height) 247 | public var height: MisterFusion { return createMisterFusion(withAttribute: .height) } 248 | 249 | @objc(Width) 250 | public var width: MisterFusion { return createMisterFusion(withAttribute: .width) } 251 | 252 | @objc(Leading) 253 | public var leading: MisterFusion { return createMisterFusion(withAttribute: .leading) } 254 | 255 | @objc(Trailing) 256 | public var trailing: MisterFusion { return createMisterFusion(withAttribute: .trailing) } 257 | 258 | @objc(CenterX) 259 | public var centerX: MisterFusion { return createMisterFusion(withAttribute: .centerX) } 260 | 261 | @objc(CenterY) 262 | public var centerY: MisterFusion { return createMisterFusion(withAttribute: .centerY) } 263 | 264 | @available(iOS, obsoleted: 7.0, renamed: "lastBaseline") 265 | @objc(Baseline) 266 | public var baseline: MisterFusion { return createMisterFusion(withAttribute: .lastBaseline) } 267 | 268 | @objc(NotAnAttribute) 269 | public var notAnAttribute: MisterFusion { return createMisterFusion(withAttribute: .notAnAttribute) } 270 | 271 | @objc(LastBaseline) 272 | public var lastBaseline: MisterFusion { return createMisterFusion(withAttribute: .lastBaseline) } 273 | 274 | @available(iOS 8.0, *) 275 | @objc(FirstBaseline) 276 | public var firstBaseline: MisterFusion { return createMisterFusion(withAttribute: .firstBaseline) } 277 | 278 | @available(iOS 8.0, *) 279 | @objc(LeftMargin) 280 | public var leftMargin: MisterFusion { return createMisterFusion(withAttribute: .leftMargin) } 281 | 282 | @available(iOS 8.0, *) 283 | @objc(RightMargin) 284 | public var rightMargin: MisterFusion { return createMisterFusion(withAttribute: .rightMargin) } 285 | 286 | @available(iOS 8.0, *) 287 | @objc(TopMargin) 288 | public var topMargin: MisterFusion { return createMisterFusion(withAttribute: .topMargin) } 289 | 290 | @available(iOS 8.0, *) 291 | @objc(BottomMargin) 292 | public var bottomMargin: MisterFusion { return createMisterFusion(withAttribute: .bottomMargin) } 293 | 294 | @available(iOS 8.0, *) 295 | @objc(LeadingMargin) 296 | public var leadingMargin: MisterFusion { return createMisterFusion(withAttribute: .leadingMargin) } 297 | 298 | @available(iOS 8.0, *) 299 | @objc(TrailingMargin) 300 | public var trailingMargin: MisterFusion { return createMisterFusion(withAttribute: .trailingMargin) } 301 | 302 | @available(iOS 8.0, *) 303 | @objc(CenterXWithinMargins) 304 | public var centerXWithinMargins: MisterFusion { return createMisterFusion(withAttribute: .centerXWithinMargins) } 305 | 306 | @available(iOS 8.0, *) 307 | @objc(CenterYWithinMargins) 308 | public var centerYWithinMargins: MisterFusion { return createMisterFusion(withAttribute: .centerYWithinMargins) } 309 | 310 | fileprivate func createMisterFusion(withAttribute attribute: NSLayoutAttribute) -> MisterFusion { 311 | return MisterFusion(item: self, attribute: attribute, relatedBy: nil, toItem: nil, toAttribute: nil, multiplier: nil, constant: nil, priority: nil, horizontalSizeClass: nil, verticalSizeClass: nil, identifier: nil) 312 | } 313 | } 314 | 315 | extension UIView { 316 | //MARK: - addConstraint() 317 | public func addLayoutConstraint(_ misterFusion: MisterFusion) -> NSLayoutConstraint? { 318 | let item: UIView = misterFusion.item ?? self 319 | let traitCollection = UIApplication.shared.keyWindow?.traitCollection 320 | if let horizontalSizeClass = misterFusion.horizontalSizeClass 321 | , horizontalSizeClass != traitCollection?.horizontalSizeClass { 322 | return nil 323 | } 324 | if let verticalSizeClass = misterFusion.verticalSizeClass 325 | , verticalSizeClass != traitCollection?.verticalSizeClass { 326 | return nil 327 | } 328 | let attribute: NSLayoutAttribute = misterFusion.attribute ?? .notAnAttribute 329 | let relatedBy: NSLayoutRelation = misterFusion.relatedBy ?? .equal 330 | let toAttribute: NSLayoutAttribute = misterFusion.toAttribute ?? attribute 331 | let toItem: UIView? = toAttribute == .notAnAttribute ? nil : misterFusion.toItem ?? self 332 | let multiplier: CGFloat = misterFusion.multiplier ?? 1 333 | let constant: CGFloat = misterFusion.constant ?? 0 334 | let constraint = NSLayoutConstraint(item: item, attribute: attribute, relatedBy: relatedBy, toItem: toItem, attribute: toAttribute, multiplier: multiplier, constant: constant) 335 | constraint.priority = misterFusion.priority ?? UILayoutPriorityRequired 336 | constraint.identifier = misterFusion.identifier 337 | addConstraint(constraint) 338 | return constraint 339 | } 340 | 341 | @discardableResult 342 | public func addLayoutConstraints(_ misterFusions: [MisterFusion]) -> [NSLayoutConstraint] { 343 | return misterFusions.flatMap { addLayoutConstraint($0) } 344 | } 345 | 346 | @discardableResult 347 | public func addLayoutConstraints(_ misterFusions: MisterFusion...) -> [NSLayoutConstraint] { 348 | return addLayoutConstraints(misterFusions) 349 | } 350 | 351 | //MARK: - addSubview() 352 | @discardableResult 353 | public func addLayoutSubview(_ subview: UIView, andConstraint misterFusion: MisterFusion) -> NSLayoutConstraint? { 354 | addSubview(subview) 355 | subview.translatesAutoresizingMaskIntoConstraints = false 356 | return addLayoutConstraint(misterFusion) 357 | } 358 | 359 | @discardableResult 360 | public func addLayoutSubview(_ subview: UIView, andConstraints misterFusions: [MisterFusion]) -> [NSLayoutConstraint] { 361 | addSubview(subview) 362 | subview.translatesAutoresizingMaskIntoConstraints = false 363 | return addLayoutConstraints(misterFusions) 364 | } 365 | 366 | @discardableResult 367 | public func addLayoutSubview(_ subview: UIView, andConstraints misterFusions: MisterFusion...) -> [NSLayoutConstraint] { 368 | return addLayoutSubview(subview, andConstraints: misterFusions) 369 | } 370 | 371 | //MARK: - insertSubview(_ at:_) 372 | @objc(insertLayoutSubview:atIndex:andConstraint:) 373 | @discardableResult 374 | public func insertLayoutSubview(_ subview: UIView, at index: Int, andConstraint misterFusion: MisterFusion) -> NSLayoutConstraint? { 375 | insertSubview(subview, at: index) 376 | subview.translatesAutoresizingMaskIntoConstraints = false 377 | return addLayoutConstraint(misterFusion) 378 | } 379 | 380 | @objc(insertLayoutSubview:atIndex:andConstraints:) 381 | @discardableResult 382 | public func insertLayoutSubview(_ subview: UIView, at index: Int, andConstraints misterFusions: [MisterFusion]) -> [NSLayoutConstraint] { 383 | insertSubview(subview, at: index) 384 | subview.translatesAutoresizingMaskIntoConstraints = false 385 | return addLayoutConstraints(misterFusions) 386 | } 387 | 388 | @discardableResult 389 | public func insertLayoutSubview(_ subview: UIView, at index: Int, andConstraints misterFusions: MisterFusion...) -> [NSLayoutConstraint] { 390 | return insertLayoutSubview(subview, at: index, andConstraints: misterFusions) 391 | } 392 | 393 | //MARK: - insertSubview(_ belowSubview:_) 394 | @discardableResult 395 | public func insertLayoutSubview(_ subview: UIView, belowSubview siblingSubview: UIView, andConstraint misterFusion: MisterFusion) -> NSLayoutConstraint? { 396 | insertSubview(subview, belowSubview: siblingSubview) 397 | subview.translatesAutoresizingMaskIntoConstraints = false 398 | return addLayoutConstraint(misterFusion) 399 | } 400 | 401 | @discardableResult 402 | public func insertLayoutSubview(_ subview: UIView, belowSubview siblingSubview: UIView, andConstraints misterFusions: [MisterFusion]) -> [NSLayoutConstraint] { 403 | insertSubview(subview, belowSubview: siblingSubview) 404 | subview.translatesAutoresizingMaskIntoConstraints = false 405 | return addLayoutConstraints(misterFusions) 406 | } 407 | 408 | @discardableResult 409 | public func insertLayoutSubview(_ subview: UIView, belowSubview siblingSubview: UIView, andConstraints misterFusions: MisterFusion...) -> [NSLayoutConstraint] { 410 | return insertLayoutSubview(subview, belowSubview: siblingSubview, andConstraints: misterFusions) 411 | } 412 | 413 | //MARK: - insertSubview(_ aboveSubview:_) 414 | @discardableResult 415 | public func insertLayoutSubview(_ subview: UIView, aboveSubview siblingSubview: UIView, andConstraint misterFusion: MisterFusion) -> NSLayoutConstraint? { 416 | insertSubview(subview, aboveSubview: siblingSubview) 417 | subview.translatesAutoresizingMaskIntoConstraints = false 418 | return addLayoutConstraint(misterFusion) 419 | } 420 | 421 | @discardableResult 422 | public func insertLayoutSubview(_ subview: UIView, aboveSubview siblingSubview: UIView, andConstraints misterFusions: [MisterFusion]) -> [NSLayoutConstraint] { 423 | insertSubview(subview, aboveSubview: siblingSubview) 424 | subview.translatesAutoresizingMaskIntoConstraints = false 425 | return addLayoutConstraints(misterFusions) 426 | } 427 | 428 | @discardableResult 429 | public func insertLayoutSubview(_ subview: UIView, aboveSubview siblingSubview: UIView, andConstraints misterFusions: MisterFusion...) -> [NSLayoutConstraint] { 430 | return insertLayoutSubview(subview, aboveSubview: siblingSubview, andConstraints: misterFusions) 431 | } 432 | } 433 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/MisterFusion/README.md: -------------------------------------------------------------------------------- 1 | # MisterFusion 2 | 3 | [![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat 4 | )](https://developer.apple.com/iphone/index.action) 5 | [![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat 6 | )](https://developer.apple.com/swift) 7 | [![Version](https://img.shields.io/cocoapods/v/MisterFusion.svg?style=flat)](http://cocoapods.org/pods/MisterFusion) 8 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 9 | [![License](https://img.shields.io/cocoapods/l/MisterFusion.svg?style=flat)](http://cocoapods.org/pods/MisterFusion) 10 | 11 | [ManiacDev.com](https://maniacdev.com/) referred. 12 | [https://maniacdev.com/2015/12/open-source-auto-layout-library-with-a-simple-and-concise-syntax](https://maniacdev.com/2015/12/open-source-auto-layout-library-with-a-simple-and-concise-syntax) 13 | 14 | ![](./Images/logo.png) 15 | 16 | MisterFusion makes more easier to use AutoLayout in Swift & Objective-C code. 17 | 18 | ## Features 19 | - [x] Simple And Concise Syntax 20 | - [x] Use in Swift and Objective-C 21 | - [x] Support Size Class 22 | - [x] Support Swift2.3 23 | - [x] Support Swift3 24 | 25 | #### MisterFusion Code for Swift 26 | 27 | ```swift 28 | let view = UIView() 29 | self.view.addLayoutSubview(view, andConstraints: 30 | view.top |+| 10, 31 | view.right |-| 10, 32 | view.left |+| 10, 33 | view.bottom |-| 10 34 | ) 35 | ``` 36 | 37 | #### Ordinary Code for Swift 38 | 39 | This is same implementation as above code, but this is hard to see. 40 | 41 | ```swift 42 | let view = UIView() 43 | self.view.addSubview(view) 44 | view.translatesAutoresizingMaskIntoConstraints = false 45 | self.view.addConstraints([ 46 | NSLayoutConstraint(item: view, attribute: .top, relatedBy: .equal, toItem: self.view, attribute: .top, multiplier: 1, constant: 10), 47 | NSLayoutConstraint(item: view, attribute: .right, relatedBy: .equal, toItem: self.view, attribute: .right, multiplier: 1, constant: -10), 48 | NSLayoutConstraint(item: view, attribute: .left, relatedBy: .equal, toItem: self.view, attribute: .left, multiplier: 1, constant: 10), 49 | NSLayoutConstraint(item: view, attribute: .bottom, relatedBy: .equal, toItem: self.view, attribute: .bottom, multiplier: 1, constant: -10), 50 | ]) 51 | ``` 52 | 53 | #### MisterFusion Code for Objective-C 54 | 55 | ```objective-c 56 | UIView *view = [UIView new]; 57 | [self.view addLayoutSubview:view andConstraints:@[ 58 | view.Top .Constant(10.0f), 59 | view.Right .Constant(-10.0f), 60 | view.Left .Constant(10.0f), 61 | view.Bottom.Constant(-10.0f) 62 | ]]; 63 | ``` 64 | 65 | #### Ordinary Code for Objective-C 66 | 67 | This is same implementation as above code, but this is hard to see. 68 | 69 | ```objective-c 70 | UIView *view = [UIView new]; 71 | view.translatesAutoresizingMaskIntoConstraints = NO; 72 | [self.view addSubview: view]; 73 | [self.view addConstraints:@[ 74 | [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0f constant:10.0f], 75 | [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0f constant:-10.0f], 76 | [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0f constant:10.0f], 77 | [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeHeight multiplier:0.5f constant:-15.0f] 78 | ]]; 79 | ``` 80 | 81 | #### Sample Layout 82 | 83 | ![](./Images/layout.png) 84 | 85 | If you want to realize layout like a above image, needed code is only this. 86 | 87 | ```swift 88 | let redView = UIView() 89 | redView.backgroundColor = .red() 90 | self.view.addLayoutSubview(redView, andConstraints: 91 | redView.top |+| 10, 92 | redView.right |-| 10, 93 | redView.left |+| 10 94 | ) 95 | 96 | let yellowView = UIView() 97 | yellowView.backgroundColor = .yellow() 98 | self.view.addLayoutSubview(yellowView, andConstraints: 99 | yellowView.top |==| redView.bottom |+| 10, 100 | yellowView.left |+| 10, 101 | yellowView.bottom |-| 10, 102 | yellowView.height |==| redView.height 103 | ) 104 | 105 | let greenView = UIView() 106 | greenView.backgroundColor = .green() 107 | self.view.addLayoutSubview(greenView, andConstraints: 108 | greenView.top |==| redView.bottom |+| 10, 109 | greenView.left |==| yellowView.right |+| 10, 110 | greenView.bottom |-| 10, 111 | greenView.right |-| 10, 112 | greenView.width |==| yellowView.width, 113 | greenView.height |==| yellowView.height 114 | ) 115 | ``` 116 | 117 | ## Installation 118 | 119 | #### CocoaPods 120 | 121 | MisterFusion is available through [CocoaPods](http://cocoapods.org). If you have cocoapods 0.39.0 or greater, you can install 122 | it, simply add the following line to your Podfile: 123 | 124 | pod 'MisterFusion' 125 | 126 | In addtion, import **MisterFusion** like this. 127 | 128 | ##### Swift 129 | 130 | import MisterFusion 131 | 132 | ##### Objective-C 133 | 134 | #import 135 | 136 | #### Carthage 137 | 138 | If you’re using [Carthage](https://github.com/Carthage/Carthage), simply add 139 | MisterFusion to your `Cartfile`: 140 | 141 | ``` 142 | github "szk-atmosphere/MisterFusion" 143 | ``` 144 | Make sure to add `MisterFusion.framework` to "Linked Frameworks and Libraries" and "copy-frameworks" Build Phases. 145 | 146 | ## Advanced Setting 147 | 148 | You can set `multiplier`, `constant` and `priority` like this. 149 | (This is same implementation as [first example](#misterfusion-code-for-swift).) 150 | 151 | #### Swift 152 | 153 | ```swift 154 | self.view.addLayoutSubview(view, andConstraints: 155 | view.top |==| self.view.top |*| 1 |+| 10 |<>| UILayoutPriorityRequired, 156 | view.right |==| self.view.right |*| 1 |-| 10 |<>| UILayoutPriorityRequired, 157 | view.left |==| self.view.left |*| 1 |+| 10 |<>| UILayoutPriorityRequired, 158 | view.bottom |==| self.view.bottom |*| 1 |-| 10 |<>| UILayoutPriorityRequired 159 | ) 160 | ``` 161 | 162 | #### Objective-C 163 | 164 | ```objective-c 165 | [self.view addLayoutSubview:view andConstraints:@[ 166 | view.Top .Equal(self.view.Top) .Multiplier(1.0f).Constant(10.0f) .Priority(UILayoutPriorityRequired), 167 | view.Right .Equal(self.view.Right) .Multiplier(1.0f).Constant(-10.0f).Priority(UILayoutPriorityRequired), 168 | view.Left .Equal(self.view.Left) .Multiplier(1.0f).Constant(10.0f) .Priority(UILayoutPriorityRequired), 169 | view.Bottom.Equal(self.view.Bottom).Multiplier(1.0f).Constant(-10.0f).Priority(UILayoutPriorityRequired) 170 | ]]; 171 | ``` 172 | 173 | ## For Swift 174 | 175 | #### Operators 176 | 177 | - `|==|`, `|<=|`, `|>=|` ... `NSLayoutRelation` and fixed `height` and `width` 178 | - `|*|`, `|/|` ... `multiplier` 179 | - `|+|`, `|-|` ... `constant` 180 | - `|<>|` ... `UILayoutPriority` 181 | - `<|>` ... `UIUserInterfaceSizeClass` for VerticalSizeClass 182 | - `<->` ... `UIUserInterfaceSizeClass` for HorizontalSizeClass 183 | - `-=-` ... Identifier 184 | 185 | #### UIView Extensions 186 | 187 | ```swift 188 | public func addLayoutConstraint(_ misterFusion: MisterFusion) -> NSLayoutConstraint? 189 | public func addLayoutConstraints(_ misterFusions: MisterFusion...) -> [NSLayoutConstraint] 190 | public func addLayoutConstraints(_ misterFusions: [MisterFusion]) -> [NSLayoutConstraint] 191 | public func addLayoutSubview(_ subview: UIView, andConstraint misterFusion: MisterFusion) -> NSLayoutConstraint? 192 | public func addLayoutSubview(_ subview: UIView, andConstraints misterFusions: [MisterFusion]) -> [NSLayoutConstraint] 193 | public func addLayoutSubview(_ subview: UIView, andConstraints misterFusions: MisterFusion...) -> [NSLayoutConstraint] 194 | public func insertLayoutSubview(_ subview: UIView, at index: Int, andConstraint misterFusion: MisterFusion) -> NSLayoutConstraint? 195 | public func insertLayoutSubview(_ subview: UIView, at index: Int, andConstraints misterFusions: [MisterFusion]) -> [NSLayoutConstraint] 196 | public func insertLayoutSubview(_ subview: UIView, at index: Int, andConstraints misterFusions: MisterFusion...) -> [NSLayoutConstraint] 197 | public func insertLayoutSubview(_ subview: UIView, belowSubview siblingSubview: UIView, andConstraint misterFusion: MisterFusion) -> NSLayoutConstraint? 198 | public func insertLayoutSubview(_ subview: UIView, belowSubview siblingSubview: UIView, andConstraints misterFusions: [MisterFusion]) -> [NSLayoutConstraint] 199 | public func insertLayoutSubview(_ subview: UIView, belowSubview siblingSubview: UIView, andConstraints misterFusions: MisterFusion...) -> [NSLayoutConstraint] 200 | public func insertLayoutSubview(_ subview: UIView, aboveSubview siblingSubview: UIView, andConstraint misterFusion: MisterFusion) -> NSLayoutConstraint? 201 | public func insertLayoutSubview(_ subview: UIView, aboveSubview siblingSubview: UIView, andConstraints misterFusions: [MisterFusion]) -> [NSLayoutConstraint] 202 | public func insertLayoutSubview(_ subview: UIView, aboveSubview siblingSubview: UIView, andConstraints misterFusions: MisterFusion...) -> [NSLayoutConstraint] 203 | ``` 204 | 205 | #### Array Extensions 206 | 207 | ```swift 208 | public func firstItem(_ view: UIView) -> [NSLayoutConstraint] 209 | public func firstAttribute(_ attribute: NSLayoutAttribute) -> [NSLayoutConstraint] 210 | public func relation(_ relation: NSLayoutRelation) -> [NSLayoutConstraint] 211 | public func secondItem(_ view: UIView) -> [NSLayoutConstraint] 212 | public func secondAttribute(_ attribute: NSLayoutAttribute) -> [NSLayoutConstraint] 213 | ``` 214 | 215 | You can get added `NSLayoutConstraint` with those functions. 216 | This is a example. 217 | 218 | ```swift 219 | let bottomConstraint: NSLayoutConstraint = self.view.addLayoutSubview(view, andConstraints: 220 | view.top |+| 10, 221 | view.right |-| 10, 222 | view.left |+| 10, 223 | view.bottom |-| 10 224 | ).firstAttribute(.Bottom).first 225 | ``` 226 | 227 | You can use `Size Class` with `func traitCollectionDidChange(previousTraitCollection: UITraitCollection?)`. 228 | 229 | ![](./Images/misterfusion.gif) 230 | 231 | This is an example Regular, Compact size for iPhone6s+. 232 | 233 | ```swift 234 | override func traitCollectionDidChange(previousTraitCollection: UITraitCollection?) { 235 | guard let whiteView = whiteView, redView = redView else { return } 236 | if let whiteViewHeightConstraint = whiteViewWidthConstraint { 237 | redView.removeConstraint(whiteViewHeightConstraint) 238 | } 239 | self.whiteViewWidthConstraint = redView.addLayoutConstraints( 240 | whiteView.width |-| 20 <|> .compact <-> .regular, 241 | whiteView.width |*| 0.5 |-| 10 <|> .regular <-> .compact 242 | ).firstAttribute(.width).first 243 | } 244 | ``` 245 | 246 | * A detail sample is [here](./MisterFusionSample/MisterFusionSample/ViewController.swift) 247 | 248 | ## For Objective-C 249 | 250 | ### Readonly Blocks 251 | 252 | ```objective-c 253 | @interface MisterFusion : NSObject 254 | //NSLayoutRelation 255 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull Equal)(MisterFusion * __nonnull); 256 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull LessThanOrEqual)(MisterFusion * __nonnull); 257 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull GreaterThanOrEqual)(MisterFusion * __nonnull); 258 | //multiplier 259 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull Multiplier)(CGFloat); 260 | //constant 261 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull Constant)(CGFloat); 262 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull NotRelatedEqualConstant)(CGFloat); 263 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull NotRelatedLessThanOrEqualConstant)(CGFloat); 264 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull NotRelatedGreaterThanOrEqualConstant)(CGFloat); 265 | //@property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull NotRelatedConstant)(CGFloat); (deprecated since 1.1.0, use NotRelatedEqualConstant) 266 | //UILayoutPriority 267 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull Priority)(UILayoutPriority); 268 | //UIUserInterfaceSizeClass for HorizontalSizeClass 269 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull HorizontalSizeClass)(UIUserInterfaceSizeClass); 270 | //UIUserInterfaceSizeClass for VerticalSizeClass 271 | @property (nonatomic, readonly, copy) MisterFusion * __nullable (^ __nonnull VerticalSizeClass)(UIUserInterfaceSizeClass); 272 | //Identifier 273 | @property (nonatomic, readonly, copy) MisterFusion * _Nullable (^ _Nonnull Identifier)(NSString * _Nonnull); 274 | @end 275 | ``` 276 | 277 | #### UIView Category 278 | 279 | ```objective-c 280 | - (NSLayoutConstraint * _Nullable)addLayoutConstraint:(MisterFusion * _Nonnull)misterFusion; 281 | - (NSArray * _Nonnull)addLayoutConstraints:(NSArray * _Nonnull)misterFusions; 282 | - (NSLayoutConstraint * _Nullable)addLayoutSubview:(UIView * _Nonnull)subview andConstraint:(MisterFusion * _Nonnull)misterFusion; 283 | - (NSArray * _Nonnull)addLayoutSubview:(UIView * _Nonnull)subview andConstraints:(NSArray * _Nonnull)misterFusions; 284 | - (NSLayoutConstraint * _Nullable)insertLayoutSubview:(UIView * _Nonnull)subview atIndex:(NSInteger)index andConstraint:(MisterFusion * _Nonnull)misterFusion; 285 | - (NSArray * _Nonnull)insertLayoutSubview:(UIView * _Nonnull)subview atIndex:(NSInteger)index andConstraints:(NSArray * _Nonnull)misterFusions; 286 | - (NSLayoutConstraint * _Nullable)insertLayoutSubview:(UIView * _Nonnull)subview belowSubview:(UIView * _Nonnull)siblingSubview andConstraint:(MisterFusion * _Nonnull)misterFusion; 287 | - (NSArray * _Nonnull)insertLayoutSubview:(UIView * _Nonnull)subview belowSubview:(UIView * _Nonnull)siblingSubview andConstraints:(NSArray * _Nonnull)misterFusions; 288 | - (NSLayoutConstraint * _Nullable)insertLayoutSubview:(UIView * _Nonnull)subview aboveSubview:(UIView * _Nonnull)siblingSubview andConstraint:(MisterFusion * _Nonnull)misterFusion; 289 | - (NSArray * _Nonnull)insertLayoutSubview:(UIView * _Nonnull)subview aboveSubview:(UIView * _Nonnull)siblingSubview andConstraints:(NSArray * _Nonnull)misterFusions; 290 | ``` 291 | 292 | #### NSArray Category 293 | ```objective-c 294 | @property (nonatomic, readonly, copy) NSArray * __nonnull (^ __nonnull FirstItem)(UIView * __nonnull); 295 | @property (nonatomic, readonly, copy) NSArray * __nonnull (^ __nonnull FirstAttribute)(NSLayoutAttribute); 296 | @property (nonatomic, readonly, copy) NSArray * __nonnull (^ __nonnull SecondItem)(UIView * __nonnull); 297 | @property (nonatomic, readonly, copy) NSArray * __nonnull (^ __nonnull SecondAttribute)(NSLayoutAttribute); 298 | @property (nonatomic, readonly, copy) NSArray * __nonnull (^ __nonnull Reration)(NSLayoutRelation); 299 | ``` 300 | 301 | You can get added `NSLayoutConstraint` with those properties. 302 | This is a example. 303 | 304 | ```objective-c 305 | NSLayoutConstraint *bottomConstraint = [self.view addLayoutSubview:view andConstraints:@[ 306 | view.Top .Constant(10.0f), 307 | view.Right .Constant(-10.0f), 308 | view.Left .Constant(10.0f), 309 | view.Bottom.Constant(-10.0f) 310 | ]].FirstAttribute(NSLayoutAttributeBottom).firstObject; 311 | ``` 312 | 313 | You can use `Size Class` with `- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection`. 314 | 315 | ![](./Images/misterfusion.gif) 316 | 317 | This is an example Regular, Compact size for iPhone6s+. 318 | 319 | ```objective-c 320 | - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { 321 | [self.redView removeConstraint:self.whiteViewWidthConstraint]; 322 | self.whiteViewWidthConstraint = [self.redView addLayoutConstraints:@[ 323 | self.whiteView.Width.Multiplier(0.5f).Constant(-10).VerticalSizeClass(UIUserInterfaceSizeClassRegular).HorizontalSizeClass(UIUserInterfaceSizeClassCompact), 324 | self.whiteView.Width.Constant(-20).VerticalSizeClass(UIUserInterfaceSizeClassCompact).HorizontalSizeClass(UIUserInterfaceSizeClassRegular) 325 | ]].FirstAttribute(NSLayoutAttributeWidth).firstObject; 326 | } 327 | ``` 328 | 329 | * A detail sample is [here](./MisterFusionSample/MisterFusionSample/MFViewController.m) 330 | 331 | ## Requirements 332 | 333 | - Xcode 8.0 or greater 334 | - iOS 8.0 or greater 335 | 336 | ## Author 337 | 338 | Taiki Suzuki, s1180183@gmail.com 339 | 340 | ## License 341 | 342 | MisterFusion is available under the MIT license. See the LICENSE file for more info. 343 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/SABlurImageView/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Taiki Suzuki 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/SABlurImageView/README.md: -------------------------------------------------------------------------------- 1 | # SABlurImageView 2 | 3 | [![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat 4 | )](https://developer.apple.com/iphone/index.action) 5 | [![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat 6 | )](https://developer.apple.com/swift) 7 | [![Version](https://img.shields.io/cocoapods/v/SABlurImageView.svg?style=flat)](http://cocoapods.org/pods/SABlurImageView) 8 | [![License](https://img.shields.io/cocoapods/l/SABlurImageView.svg?style=flat)](http://cocoapods.org/pods/SABlurImageView) 9 | 10 | ![](./SampleImage/sample.gif) 11 | 12 | You can use blur effect and it's animation easily to call only two methods. 13 | 14 | [ManiacDev.com](https://maniacdev.com/) referred. 15 | [https://maniacdev.com/2015/04/open-source-ios-library-for-easily-adding-animated-blurunblur-effects-to-an-image](https://maniacdev.com/2015/04/open-source-ios-library-for-easily-adding-animated-blurunblur-effects-to-an-image) 16 | 17 | ## Features 18 | 19 | - [x] Blur effect with box size 20 | - [x] Blur animation 21 | - [x] 0.0 to 1.0 parameter blur 22 | - [x] Support Swift2 23 | - [x] Support Swift2.3 24 | - [x] Support Swift3 25 | 26 | ## Installation 27 | 28 | #### CocoaPods 29 | 30 | SABlurImageView is available through [CocoaPods](http://cocoapods.org). If you have cocoapods 0.38.0 or greater, you can install 31 | it, simply add the following line to your Podfile: 32 | 33 | pod "SABlurImageView" 34 | 35 | #### Manually 36 | 37 | Add the [SABlurImageView](./SABlurImageView) directory to your project. 38 | 39 | ## Usage 40 | 41 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 42 | 43 | If you install from pod, you have to write `import SABlurImageView`. 44 | 45 | If you want to apply blur effect for image 46 | 47 | ```swift 48 | let imageView = SABlurImageView(image: image) 49 | imageView.addBlurEffect(30, times: 1) 50 | ``` 51 | 52 | If you want to animate 53 | 54 | ```swift 55 | let imageView = SABlurImageView(image: image) 56 | imageView.configrationForBlurAnimation() 57 | imageView.startBlurAnimation(duration: 2.0) 58 | ``` 59 | 60 | First time of blur animation is normal to blur. Second time is blur to normal. (automatically set configration of reverse animation) 61 | 62 | If you want to use 0.0 to 1.0 parameter 63 | 64 | ```swift 65 | let imageView = SABlurImageView(image: image) 66 | imageView.configrationForBlurAnimation(100) 67 | imageView?.blur(0.5) 68 | ``` 69 | 70 | ## Requirements 71 | 72 | - Xcode 8.0beta or greater 73 | - iOS7.0(manually only) or greater 74 | - QuartzCore 75 | - Accelerate 76 | 77 | ## Change Log 78 | 79 | ### v2.0.0 -> v2.1.0 80 | 81 | Use `CGFloat`, instead of `Float` 82 | 83 | ## Author 84 | 85 | Taiki Suzuki, s1180183@gmail.com 86 | 87 | ## Other 88 | 89 | Objective-C version of this project is [SABlurImageViewObjc](https://github.com/szk-atmosphere/SABlurImageViewObjc). 90 | 91 | ## License 92 | 93 | SABlurImageView is available under the MIT license. See the LICENSE file for more info. 94 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/SABlurImageView/SABlurImageView/CATransition+Closure.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CATransition+Closure.swift 3 | // SABlurImageView 4 | // 5 | // Created by 鈴木大貴 on 2016/01/21. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import QuartzCore 11 | 12 | extension CATransaction { 13 | class func animationWithDuration(_ duration: TimeInterval, animation: () -> Void) { 14 | CATransaction.begin() 15 | CATransaction.setAnimationDuration(duration) 16 | animation() 17 | CATransaction.commit() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/SABlurImageView/SABlurImageView/SABlurImageView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+BlurEffect.swift 3 | // SABlurImageView 4 | // 5 | // Created by 鈴木大貴 on 2015/03/27. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Foundation 11 | import QuartzCore 12 | 13 | open class SABlurImageView: UIImageView { 14 | //MARK: - Static Properties 15 | fileprivate struct Const { 16 | static let fadeAnimationKey = "FadeAnimationKey" 17 | static let maxImageCount: Int = 10 18 | static let contentsAnimationKey = "contents" 19 | } 20 | 21 | //MARK: - Instance Properties 22 | fileprivate var cgImages: [CGImage] = [CGImage]() 23 | fileprivate var nextBlurLayer: CALayer? 24 | fileprivate var previousImageIndex: Int = -1 25 | fileprivate var previousPercentage: CGFloat = 0.0 26 | open fileprivate(set) var isBlurAnimating: Bool = false 27 | 28 | deinit { 29 | clearMemory() 30 | } 31 | 32 | //MARK: - Life Cycle 33 | open override func layoutSubviews() { 34 | super.layoutSubviews() 35 | nextBlurLayer?.frame = bounds 36 | } 37 | 38 | open func configrationForBlurAnimation(_ boxSize: CGFloat = 100) { 39 | guard let image = image else { return } 40 | let baseBoxSize = max(min(boxSize, 200), 0) 41 | let baseNumber = sqrt(CGFloat(baseBoxSize)) / CGFloat(Const.maxImageCount) 42 | let baseCGImages = [image].flatMap { $0.cgImage } 43 | cgImages = bluredCGImages(baseCGImages, sourceImage: image, at: 0, to: Const.maxImageCount, baseNumber: baseNumber) 44 | } 45 | 46 | fileprivate func bluredCGImages(_ images: [CGImage], sourceImage: UIImage?, at index: Int, to limit: Int, baseNumber: CGFloat) -> [CGImage] { 47 | guard index < limit else { return images } 48 | let newImage = sourceImage?.blurEffect(pow(CGFloat(index) * baseNumber, 2)) 49 | let newImages = images + [newImage].flatMap { $0?.cgImage } 50 | return bluredCGImages(newImages, sourceImage: newImage, at: index + 1, to: limit, baseNumber: baseNumber) 51 | } 52 | 53 | open func clearMemory() { 54 | cgImages.removeAll(keepingCapacity: false) 55 | nextBlurLayer?.removeFromSuperlayer() 56 | nextBlurLayer = nil 57 | previousImageIndex = -1 58 | previousPercentage = 0.0 59 | layer.removeAllAnimations() 60 | } 61 | 62 | //MARK: - Add single blur 63 | open func addBlurEffect(_ boxSize: CGFloat, times: UInt = 1) { 64 | guard let image = image else { return } 65 | self.image = addBlurEffectTo(image, boxSize: boxSize, remainTimes: times) 66 | } 67 | 68 | fileprivate func addBlurEffectTo(_ image: UIImage, boxSize: CGFloat, remainTimes: UInt) -> UIImage { 69 | return remainTimes > 0 ? addBlurEffectTo(image.blurEffect(boxSize), boxSize: boxSize, remainTimes: remainTimes - 1) : image 70 | } 71 | 72 | //MARK: - Percentage blur 73 | open func blur(_ percentage: CGFloat) { 74 | let percentage = min(max(percentage, 0.0), 0.99) 75 | if previousPercentage - percentage > 0 { 76 | let index = Int(floor(percentage * 10)) + 1 77 | if index > 0 { 78 | setLayers(index, percentage: percentage, currentIndex: index - 1, nextIndex: index) 79 | } 80 | } else { 81 | let index = Int(floor(percentage * 10)) 82 | if index < cgImages.count - 1 { 83 | setLayers(index, percentage: percentage, currentIndex: index, nextIndex: index + 1) 84 | } 85 | } 86 | previousPercentage = percentage 87 | } 88 | 89 | fileprivate func setLayers(_ index: Int, percentage: CGFloat, currentIndex: Int, nextIndex: Int) { 90 | if index != previousImageIndex { 91 | CATransaction.animationWithDuration(0) { layer.contents = self.cgImages[currentIndex] } 92 | 93 | if nextBlurLayer == nil { 94 | let nextBlurLayer = CALayer() 95 | nextBlurLayer.frame = bounds 96 | layer.addSublayer(nextBlurLayer) 97 | self.nextBlurLayer = nextBlurLayer 98 | } 99 | 100 | CATransaction.animationWithDuration(0) { 101 | self.nextBlurLayer?.contents = self.cgImages[nextIndex] 102 | self.nextBlurLayer?.opacity = 1.0 103 | } 104 | } 105 | previousImageIndex = index 106 | 107 | let minPercentage = percentage * 100.0 108 | let alpha = min(max((minPercentage - CGFloat(Int(minPercentage / 10.0) * 10)) / 10.0, 0.0), 1.0) 109 | CATransaction.animationWithDuration(0) { self.nextBlurLayer?.opacity = Float(alpha) } 110 | } 111 | 112 | //MARK: - Animation blur 113 | open func startBlurAnimation(_ duration: TimeInterval) { 114 | if isBlurAnimating { return } 115 | isBlurAnimating = true 116 | let count = cgImages.count 117 | let group = CAAnimationGroup() 118 | group.animations = cgImages.enumerated().flatMap { 119 | guard $0.offset < count - 1 else { return nil } 120 | let anim = CABasicAnimation(keyPath: Const.contentsAnimationKey) 121 | anim.fromValue = $0.element 122 | anim.toValue = cgImages[$0.offset + 1] 123 | anim.fillMode = kCAFillModeForwards 124 | anim.isRemovedOnCompletion = false 125 | anim.duration = duration / TimeInterval(count) 126 | anim.beginTime = anim.duration * TimeInterval($0.offset) 127 | return anim 128 | } 129 | group.duration = duration 130 | group.delegate = self 131 | group.isRemovedOnCompletion = false 132 | group.fillMode = kCAFillModeForwards 133 | layer.add(group, forKey: Const.fadeAnimationKey) 134 | cgImages = cgImages.reversed() 135 | } 136 | } 137 | 138 | extension SABlurImageView: CAAnimationDelegate { 139 | open func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 140 | guard let _ = anim as? CAAnimationGroup else { return } 141 | layer.removeAnimation(forKey: Const.fadeAnimationKey) 142 | isBlurAnimating = false 143 | guard let cgImage = cgImages.first else { return } 144 | image = UIImage(cgImage: cgImage) 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/SABlurImageView/SABlurImageView/UIImage+BlurEffect.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+BlurEffect.swift 3 | // SABlurImageView 4 | // 5 | // Created by 鈴木大貴 on 2015/03/27. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import QuartzCore 11 | import Accelerate 12 | 13 | extension UIImage { 14 | class func blurEffect(_ cgImage: CGImage, boxSize: CGFloat) -> UIImage! { 15 | return UIImage(cgImage: cgImage.blurEffect(boxSize)) 16 | } 17 | 18 | func blurEffect(_ boxSize: CGFloat) -> UIImage! { 19 | return UIImage(cgImage: bluredCGImage(boxSize)) 20 | } 21 | 22 | func bluredCGImage(_ boxSize: CGFloat) -> CGImage! { 23 | return cgImage!.blurEffect(boxSize) 24 | } 25 | } 26 | 27 | extension CGImage { 28 | func blurEffect(_ boxSize: CGFloat) -> CGImage! { 29 | 30 | let boxSize = boxSize - (boxSize.truncatingRemainder(dividingBy: 2)) + 1 31 | 32 | let inProvider = self.dataProvider 33 | 34 | let height = vImagePixelCount(self.height) 35 | let width = vImagePixelCount(self.width) 36 | let rowBytes = self.bytesPerRow 37 | 38 | let inBitmapData = inProvider?.data 39 | let inData = UnsafeMutableRawPointer(mutating: CFDataGetBytePtr(inBitmapData)) 40 | var inBuffer = vImage_Buffer(data: inData, height: height, width: width, rowBytes: rowBytes) 41 | 42 | let outData = malloc(self.bytesPerRow * self.height) 43 | var outBuffer = vImage_Buffer(data: outData, height: height, width: width, rowBytes: rowBytes) 44 | 45 | vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer, nil, 0, 0, UInt32(boxSize), UInt32(boxSize), nil, vImage_Flags(kvImageEdgeExtend)) 46 | 47 | let colorSpace = CGColorSpaceCreateDeviceRGB() 48 | let context = CGContext(data: outBuffer.data, width: Int(outBuffer.width), height: Int(outBuffer.height), bitsPerComponent: 8, bytesPerRow: outBuffer.rowBytes, space: colorSpace, bitmapInfo: self.bitmapInfo.rawValue) 49 | let imageRef = context?.makeImage() 50 | 51 | free(outData) 52 | 53 | return imageRef 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/MisterFusion/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/MisterFusion/MisterFusion-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MisterFusion : NSObject 3 | @end 4 | @implementation PodsDummy_MisterFusion 5 | @end 6 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/MisterFusion/MisterFusion-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/MisterFusion/MisterFusion-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double MisterFusionVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char MisterFusionVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/MisterFusion/MisterFusion.modulemap: -------------------------------------------------------------------------------- 1 | framework module MisterFusion { 2 | umbrella header "MisterFusion-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/MisterFusion/MisterFusion.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MisterFusion 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "UIKit" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MisterFusion 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2015 Taiki Suzuki 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | 29 | 30 | ## SABlurImageView 31 | 32 | Copyright (c) 2015 Taiki Suzuki 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining a copy 35 | of this software and associated documentation files (the "Software"), to deal 36 | in the Software without restriction, including without limitation the rights 37 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 38 | copies of the Software, and to permit persons to whom the Software is 39 | furnished to do so, subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in 42 | all copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 45 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 46 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 47 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 48 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 49 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 50 | THE SOFTWARE. 51 | 52 | 53 | ## SAParallaxViewControllerSwift 54 | 55 | Copyright (c) 2015 Taiki Suzuki 56 | 57 | Permission is hereby granted, free of charge, to any person obtaining a copy 58 | of this software and associated documentation files (the "Software"), to deal 59 | in the Software without restriction, including without limitation the rights 60 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 61 | copies of the Software, and to permit persons to whom the Software is 62 | furnished to do so, subject to the following conditions: 63 | 64 | The above copyright notice and this permission notice shall be included in 65 | all copies or substantial portions of the Software. 66 | 67 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 68 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 69 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 70 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 71 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 72 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 73 | THE SOFTWARE. 74 | 75 | Generated by CocoaPods - https://cocoapods.org 76 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2015 Taiki Suzuki 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | 40 | License 41 | MIT 42 | Title 43 | MisterFusion 44 | Type 45 | PSGroupSpecifier 46 | 47 | 48 | FooterText 49 | Copyright (c) 2015 Taiki Suzuki <s1180183@gmail.com> 50 | 51 | Permission is hereby granted, free of charge, to any person obtaining a copy 52 | of this software and associated documentation files (the "Software"), to deal 53 | in the Software without restriction, including without limitation the rights 54 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 55 | copies of the Software, and to permit persons to whom the Software is 56 | furnished to do so, subject to the following conditions: 57 | 58 | The above copyright notice and this permission notice shall be included in 59 | all copies or substantial portions of the Software. 60 | 61 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 62 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 63 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 64 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 65 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 66 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 67 | THE SOFTWARE. 68 | 69 | License 70 | MIT 71 | Title 72 | SABlurImageView 73 | Type 74 | PSGroupSpecifier 75 | 76 | 77 | FooterText 78 | Copyright (c) 2015 Taiki Suzuki <s1180183@gmail.com> 79 | 80 | Permission is hereby granted, free of charge, to any person obtaining a copy 81 | of this software and associated documentation files (the "Software"), to deal 82 | in the Software without restriction, including without limitation the rights 83 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 84 | copies of the Software, and to permit persons to whom the Software is 85 | furnished to do so, subject to the following conditions: 86 | 87 | The above copyright notice and this permission notice shall be included in 88 | all copies or substantial portions of the Software. 89 | 90 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 91 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 92 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 93 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 94 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 95 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 96 | THE SOFTWARE. 97 | 98 | License 99 | MIT 100 | Title 101 | SAParallaxViewControllerSwift 102 | Type 103 | PSGroupSpecifier 104 | 105 | 106 | FooterText 107 | Generated by CocoaPods - https://cocoapods.org 108 | Title 109 | 110 | Type 111 | PSGroupSpecifier 112 | 113 | 114 | StringsTable 115 | Acknowledgements 116 | Title 117 | Acknowledgements 118 | 119 | 120 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SAParallaxViewControllerSwiftExample : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SAParallaxViewControllerSwiftExample 5 | @end 6 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/MisterFusion/MisterFusion.framework" 88 | install_framework "$BUILT_PRODUCTS_DIR/SABlurImageView/SABlurImageView.framework" 89 | install_framework "$BUILT_PRODUCTS_DIR/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift.framework" 90 | fi 91 | if [[ "$CONFIGURATION" == "Release" ]]; then 92 | install_framework "$BUILT_PRODUCTS_DIR/MisterFusion/MisterFusion.framework" 93 | install_framework "$BUILT_PRODUCTS_DIR/SABlurImageView/SABlurImageView.framework" 94 | install_framework "$BUILT_PRODUCTS_DIR/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift.framework" 95 | fi 96 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_SAParallaxViewControllerSwiftExampleVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_SAParallaxViewControllerSwiftExampleVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MisterFusion" "$PODS_CONFIGURATION_BUILD_DIR/SABlurImageView" "$PODS_CONFIGURATION_BUILD_DIR/SAParallaxViewControllerSwift" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/MisterFusion/MisterFusion.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SABlurImageView/SABlurImageView.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "MisterFusion" -framework "SABlurImageView" -framework "SAParallaxViewControllerSwift" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_SAParallaxViewControllerSwiftExample { 2 | umbrella header "Pods-SAParallaxViewControllerSwiftExample-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MisterFusion" "$PODS_CONFIGURATION_BUILD_DIR/SABlurImageView" "$PODS_CONFIGURATION_BUILD_DIR/SAParallaxViewControllerSwift" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/MisterFusion/MisterFusion.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SABlurImageView/SABlurImageView.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "MisterFusion" -framework "SABlurImageView" -framework "SAParallaxViewControllerSwift" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SABlurImageView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SABlurImageView/SABlurImageView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SABlurImageView : NSObject 3 | @end 4 | @implementation PodsDummy_SABlurImageView 5 | @end 6 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SABlurImageView/SABlurImageView-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SABlurImageView/SABlurImageView-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double SABlurImageViewVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char SABlurImageViewVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SABlurImageView/SABlurImageView.modulemap: -------------------------------------------------------------------------------- 1 | framework module SABlurImageView { 2 | umbrella header "SABlurImageView-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SABlurImageView/SABlurImageView.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SABlurImageView 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "Accelerate" -framework "QuartzCore" -framework "UIKit" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SAParallaxViewControllerSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SAParallaxViewControllerSwift : NSObject 3 | @end 4 | @implementation PodsDummy_SAParallaxViewControllerSwift 5 | @end 6 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double SAParallaxViewControllerSwiftVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char SAParallaxViewControllerSwiftVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift.modulemap: -------------------------------------------------------------------------------- 1 | framework module SAParallaxViewControllerSwift { 2 | umbrella header "SAParallaxViewControllerSwift-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/Pods/Target Support Files/SAParallaxViewControllerSwift/SAParallaxViewControllerSwift.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SAParallaxViewControllerSwift 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MisterFusion" "$PODS_CONFIGURATION_BUILD_DIR/SABlurImageView" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 370129F41A8288A800921235 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370129F31A8288A800921235 /* DetailViewController.swift */; }; 11 | 3717D09A1A7E7C76000A1E0B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3717D0991A7E7C76000A1E0B /* ViewController.swift */; }; 12 | 37E219071A7A997800896D72 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37E219061A7A997800896D72 /* AppDelegate.swift */; }; 13 | 37E2190C1A7A997800896D72 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 37E2190A1A7A997800896D72 /* Main.storyboard */; }; 14 | 37E2190E1A7A997800896D72 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 37E2190D1A7A997800896D72 /* Images.xcassets */; }; 15 | 37E219111A7A997800896D72 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 37E2190F1A7A997800896D72 /* LaunchScreen.xib */; }; 16 | 37E2191D1A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37E2191C1A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests.swift */; }; 17 | 37E219301A7D315600896D72 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37E2192F1A7D315600896D72 /* Accelerate.framework */; }; 18 | A91EB7053D61C2052CA260F1 /* Pods_SAParallaxViewControllerSwiftExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 58D9FFE3052060F412E8A405 /* Pods_SAParallaxViewControllerSwiftExample.framework */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 37E219171A7A997800896D72 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 37E218F91A7A997800896D72 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 37E219001A7A997800896D72; 27 | remoteInfo = SAParallaxViewControllerSwiftExample; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 370129F31A8288A800921235 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; 33 | 3717D0991A7E7C76000A1E0B /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 34 | 37E219011A7A997800896D72 /* SAParallaxViewControllerSwiftExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SAParallaxViewControllerSwiftExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 37E219051A7A997800896D72 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 37E219061A7A997800896D72 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 37E2190B1A7A997800896D72 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 38 | 37E2190D1A7A997800896D72 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 39 | 37E219101A7A997800896D72 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 40 | 37E219161A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SAParallaxViewControllerSwiftExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 37E2191B1A7A997800896D72 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | 37E2191C1A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SAParallaxViewControllerSwiftExampleTests.swift; sourceTree = ""; }; 43 | 37E2192F1A7D315600896D72 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 44 | 4B7B25543FE9ED785555A345 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 45 | 58D9FFE3052060F412E8A405 /* Pods_SAParallaxViewControllerSwiftExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SAParallaxViewControllerSwiftExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 6846F36077588499286D9E35 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 47 | 87741A1EE37DC1820C468AB5 /* Pods-SAParallaxViewControllerSwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SAParallaxViewControllerSwiftExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample.debug.xcconfig"; sourceTree = ""; }; 48 | 8E49D96A1DEA3C70BE3650CB /* Pods-SAParallaxViewControllerSwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SAParallaxViewControllerSwiftExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample.release.xcconfig"; sourceTree = ""; }; 49 | D13D477417D91DE1AEF9A6A7 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 37E218FE1A7A997800896D72 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 37E219301A7D315600896D72 /* Accelerate.framework in Frameworks */, 58 | A91EB7053D61C2052CA260F1 /* Pods_SAParallaxViewControllerSwiftExample.framework in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | 37E219131A7A997800896D72 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 2AE1A7A90750D44545B58D27 /* Pods */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 4B7B25543FE9ED785555A345 /* Pods.debug.xcconfig */, 76 | 6846F36077588499286D9E35 /* Pods.release.xcconfig */, 77 | 87741A1EE37DC1820C468AB5 /* Pods-SAParallaxViewControllerSwiftExample.debug.xcconfig */, 78 | 8E49D96A1DEA3C70BE3650CB /* Pods-SAParallaxViewControllerSwiftExample.release.xcconfig */, 79 | ); 80 | name = Pods; 81 | sourceTree = ""; 82 | }; 83 | 3717D09B1A7E8052000A1E0B /* Framework */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 37E2192F1A7D315600896D72 /* Accelerate.framework */, 87 | ); 88 | name = Framework; 89 | sourceTree = ""; 90 | }; 91 | 37E218F81A7A997800896D72 = { 92 | isa = PBXGroup; 93 | children = ( 94 | 37E219031A7A997800896D72 /* SAParallaxViewControllerSwiftExample */, 95 | 37E219191A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests */, 96 | 37E219021A7A997800896D72 /* Products */, 97 | 2AE1A7A90750D44545B58D27 /* Pods */, 98 | DC461D79E954703062E3993E /* Frameworks */, 99 | ); 100 | sourceTree = ""; 101 | }; 102 | 37E219021A7A997800896D72 /* Products */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 37E219011A7A997800896D72 /* SAParallaxViewControllerSwiftExample.app */, 106 | 37E219161A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests.xctest */, 107 | ); 108 | name = Products; 109 | sourceTree = ""; 110 | }; 111 | 37E219031A7A997800896D72 /* SAParallaxViewControllerSwiftExample */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 37E219061A7A997800896D72 /* AppDelegate.swift */, 115 | 3717D0991A7E7C76000A1E0B /* ViewController.swift */, 116 | 370129F31A8288A800921235 /* DetailViewController.swift */, 117 | 37E2190A1A7A997800896D72 /* Main.storyboard */, 118 | 37E2190D1A7A997800896D72 /* Images.xcassets */, 119 | 37E2190F1A7A997800896D72 /* LaunchScreen.xib */, 120 | 3717D09B1A7E8052000A1E0B /* Framework */, 121 | 37E219041A7A997800896D72 /* Supporting Files */, 122 | ); 123 | path = SAParallaxViewControllerSwiftExample; 124 | sourceTree = ""; 125 | }; 126 | 37E219041A7A997800896D72 /* Supporting Files */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 37E219051A7A997800896D72 /* Info.plist */, 130 | ); 131 | name = "Supporting Files"; 132 | sourceTree = ""; 133 | }; 134 | 37E219191A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 37E2191C1A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests.swift */, 138 | 37E2191A1A7A997800896D72 /* Supporting Files */, 139 | ); 140 | path = SAParallaxViewControllerSwiftExampleTests; 141 | sourceTree = ""; 142 | }; 143 | 37E2191A1A7A997800896D72 /* Supporting Files */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 37E2191B1A7A997800896D72 /* Info.plist */, 147 | ); 148 | name = "Supporting Files"; 149 | sourceTree = ""; 150 | }; 151 | DC461D79E954703062E3993E /* Frameworks */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | D13D477417D91DE1AEF9A6A7 /* Pods.framework */, 155 | 58D9FFE3052060F412E8A405 /* Pods_SAParallaxViewControllerSwiftExample.framework */, 156 | ); 157 | name = Frameworks; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | 37E219001A7A997800896D72 /* SAParallaxViewControllerSwiftExample */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = 37E219201A7A997800896D72 /* Build configuration list for PBXNativeTarget "SAParallaxViewControllerSwiftExample" */; 166 | buildPhases = ( 167 | 945A196D7B0ADDC065ECE3D2 /* [CP] Check Pods Manifest.lock */, 168 | 37E218FD1A7A997800896D72 /* Sources */, 169 | 37E218FE1A7A997800896D72 /* Frameworks */, 170 | 37E218FF1A7A997800896D72 /* Resources */, 171 | 72F9C588FC91E918C4A860E5 /* [CP] Embed Pods Frameworks */, 172 | 26B6F49F1C4DB721AA3A1AA5 /* [CP] Copy Pods Resources */, 173 | ); 174 | buildRules = ( 175 | ); 176 | dependencies = ( 177 | ); 178 | name = SAParallaxViewControllerSwiftExample; 179 | productName = SAParallaxViewControllerSwiftExample; 180 | productReference = 37E219011A7A997800896D72 /* SAParallaxViewControllerSwiftExample.app */; 181 | productType = "com.apple.product-type.application"; 182 | }; 183 | 37E219151A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests */ = { 184 | isa = PBXNativeTarget; 185 | buildConfigurationList = 37E219231A7A997800896D72 /* Build configuration list for PBXNativeTarget "SAParallaxViewControllerSwiftExampleTests" */; 186 | buildPhases = ( 187 | 37E219121A7A997800896D72 /* Sources */, 188 | 37E219131A7A997800896D72 /* Frameworks */, 189 | 37E219141A7A997800896D72 /* Resources */, 190 | ); 191 | buildRules = ( 192 | ); 193 | dependencies = ( 194 | 37E219181A7A997800896D72 /* PBXTargetDependency */, 195 | ); 196 | name = SAParallaxViewControllerSwiftExampleTests; 197 | productName = SAParallaxViewControllerSwiftExampleTests; 198 | productReference = 37E219161A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests.xctest */; 199 | productType = "com.apple.product-type.bundle.unit-test"; 200 | }; 201 | /* End PBXNativeTarget section */ 202 | 203 | /* Begin PBXProject section */ 204 | 37E218F91A7A997800896D72 /* Project object */ = { 205 | isa = PBXProject; 206 | attributes = { 207 | LastSwiftMigration = 0700; 208 | LastSwiftUpdateCheck = 0700; 209 | LastUpgradeCheck = 0800; 210 | ORGANIZATIONNAME = "鈴木大貴"; 211 | TargetAttributes = { 212 | 37E219001A7A997800896D72 = { 213 | CreatedOnToolsVersion = 6.1.1; 214 | LastSwiftMigration = 0800; 215 | }; 216 | 37E219151A7A997800896D72 = { 217 | CreatedOnToolsVersion = 6.1.1; 218 | LastSwiftMigration = 0800; 219 | TestTargetID = 37E219001A7A997800896D72; 220 | }; 221 | }; 222 | }; 223 | buildConfigurationList = 37E218FC1A7A997800896D72 /* Build configuration list for PBXProject "SAParallaxViewControllerSwiftExample" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | Base, 230 | ); 231 | mainGroup = 37E218F81A7A997800896D72; 232 | productRefGroup = 37E219021A7A997800896D72 /* Products */; 233 | projectDirPath = ""; 234 | projectRoot = ""; 235 | targets = ( 236 | 37E219001A7A997800896D72 /* SAParallaxViewControllerSwiftExample */, 237 | 37E219151A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests */, 238 | ); 239 | }; 240 | /* End PBXProject section */ 241 | 242 | /* Begin PBXResourcesBuildPhase section */ 243 | 37E218FF1A7A997800896D72 /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | 37E2190C1A7A997800896D72 /* Main.storyboard in Resources */, 248 | 37E219111A7A997800896D72 /* LaunchScreen.xib in Resources */, 249 | 37E2190E1A7A997800896D72 /* Images.xcassets in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | 37E219141A7A997800896D72 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | /* End PBXResourcesBuildPhase section */ 261 | 262 | /* Begin PBXShellScriptBuildPhase section */ 263 | 26B6F49F1C4DB721AA3A1AA5 /* [CP] Copy Pods Resources */ = { 264 | isa = PBXShellScriptBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | inputPaths = ( 269 | ); 270 | name = "[CP] Copy Pods Resources"; 271 | outputPaths = ( 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | shellPath = /bin/sh; 275 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample-resources.sh\"\n"; 276 | showEnvVarsInLog = 0; 277 | }; 278 | 72F9C588FC91E918C4A860E5 /* [CP] Embed Pods Frameworks */ = { 279 | isa = PBXShellScriptBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | inputPaths = ( 284 | ); 285 | name = "[CP] Embed Pods Frameworks"; 286 | outputPaths = ( 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | shellPath = /bin/sh; 290 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SAParallaxViewControllerSwiftExample/Pods-SAParallaxViewControllerSwiftExample-frameworks.sh\"\n"; 291 | showEnvVarsInLog = 0; 292 | }; 293 | 945A196D7B0ADDC065ECE3D2 /* [CP] Check Pods Manifest.lock */ = { 294 | isa = PBXShellScriptBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | ); 298 | inputPaths = ( 299 | ); 300 | name = "[CP] Check Pods Manifest.lock"; 301 | outputPaths = ( 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | shellPath = /bin/sh; 305 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 306 | showEnvVarsInLog = 0; 307 | }; 308 | /* End PBXShellScriptBuildPhase section */ 309 | 310 | /* Begin PBXSourcesBuildPhase section */ 311 | 37E218FD1A7A997800896D72 /* Sources */ = { 312 | isa = PBXSourcesBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | 37E219071A7A997800896D72 /* AppDelegate.swift in Sources */, 316 | 370129F41A8288A800921235 /* DetailViewController.swift in Sources */, 317 | 3717D09A1A7E7C76000A1E0B /* ViewController.swift in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | 37E219121A7A997800896D72 /* Sources */ = { 322 | isa = PBXSourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | 37E2191D1A7A997800896D72 /* SAParallaxViewControllerSwiftExampleTests.swift in Sources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | /* End PBXSourcesBuildPhase section */ 330 | 331 | /* Begin PBXTargetDependency section */ 332 | 37E219181A7A997800896D72 /* PBXTargetDependency */ = { 333 | isa = PBXTargetDependency; 334 | target = 37E219001A7A997800896D72 /* SAParallaxViewControllerSwiftExample */; 335 | targetProxy = 37E219171A7A997800896D72 /* PBXContainerItemProxy */; 336 | }; 337 | /* End PBXTargetDependency section */ 338 | 339 | /* Begin PBXVariantGroup section */ 340 | 37E2190A1A7A997800896D72 /* Main.storyboard */ = { 341 | isa = PBXVariantGroup; 342 | children = ( 343 | 37E2190B1A7A997800896D72 /* Base */, 344 | ); 345 | name = Main.storyboard; 346 | sourceTree = ""; 347 | }; 348 | 37E2190F1A7A997800896D72 /* LaunchScreen.xib */ = { 349 | isa = PBXVariantGroup; 350 | children = ( 351 | 37E219101A7A997800896D72 /* Base */, 352 | ); 353 | name = LaunchScreen.xib; 354 | sourceTree = ""; 355 | }; 356 | /* End PBXVariantGroup section */ 357 | 358 | /* Begin XCBuildConfiguration section */ 359 | 37E2191E1A7A997800896D72 /* Debug */ = { 360 | isa = XCBuildConfiguration; 361 | buildSettings = { 362 | ALWAYS_SEARCH_USER_PATHS = NO; 363 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 364 | CLANG_CXX_LIBRARY = "libc++"; 365 | CLANG_ENABLE_MODULES = YES; 366 | CLANG_ENABLE_OBJC_ARC = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_CONSTANT_CONVERSION = YES; 369 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 370 | CLANG_WARN_EMPTY_BODY = YES; 371 | CLANG_WARN_ENUM_CONVERSION = YES; 372 | CLANG_WARN_INT_CONVERSION = YES; 373 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 374 | CLANG_WARN_UNREACHABLE_CODE = YES; 375 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 376 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 377 | COPY_PHASE_STRIP = NO; 378 | ENABLE_STRICT_OBJC_MSGSEND = YES; 379 | ENABLE_TESTABILITY = YES; 380 | GCC_C_LANGUAGE_STANDARD = gnu99; 381 | GCC_DYNAMIC_NO_PIC = NO; 382 | GCC_NO_COMMON_BLOCKS = YES; 383 | GCC_OPTIMIZATION_LEVEL = 0; 384 | GCC_PREPROCESSOR_DEFINITIONS = ( 385 | "DEBUG=1", 386 | "$(inherited)", 387 | ); 388 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 389 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 390 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 391 | GCC_WARN_UNDECLARED_SELECTOR = YES; 392 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 393 | GCC_WARN_UNUSED_FUNCTION = YES; 394 | GCC_WARN_UNUSED_VARIABLE = YES; 395 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 396 | MTL_ENABLE_DEBUG_INFO = YES; 397 | ONLY_ACTIVE_ARCH = YES; 398 | SDKROOT = iphoneos; 399 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 400 | }; 401 | name = Debug; 402 | }; 403 | 37E2191F1A7A997800896D72 /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ALWAYS_SEARCH_USER_PATHS = NO; 407 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 408 | CLANG_CXX_LIBRARY = "libc++"; 409 | CLANG_ENABLE_MODULES = YES; 410 | CLANG_ENABLE_OBJC_ARC = YES; 411 | CLANG_WARN_BOOL_CONVERSION = YES; 412 | CLANG_WARN_CONSTANT_CONVERSION = YES; 413 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 414 | CLANG_WARN_EMPTY_BODY = YES; 415 | CLANG_WARN_ENUM_CONVERSION = YES; 416 | CLANG_WARN_INT_CONVERSION = YES; 417 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 418 | CLANG_WARN_UNREACHABLE_CODE = YES; 419 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 420 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 421 | COPY_PHASE_STRIP = YES; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | GCC_C_LANGUAGE_STANDARD = gnu99; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 427 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 428 | GCC_WARN_UNDECLARED_SELECTOR = YES; 429 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 430 | GCC_WARN_UNUSED_FUNCTION = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 433 | MTL_ENABLE_DEBUG_INFO = NO; 434 | SDKROOT = iphoneos; 435 | VALIDATE_PRODUCT = YES; 436 | }; 437 | name = Release; 438 | }; 439 | 37E219211A7A997800896D72 /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 87741A1EE37DC1820C468AB5 /* Pods-SAParallaxViewControllerSwiftExample.debug.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | INFOPLIST_FILE = SAParallaxViewControllerSwiftExample/Info.plist; 445 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | PRODUCT_BUNDLE_IDENTIFIER = "szk-atmosphere.$(PRODUCT_NAME:rfc1034identifier)"; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | SWIFT_VERSION = 3.0; 450 | }; 451 | name = Debug; 452 | }; 453 | 37E219221A7A997800896D72 /* Release */ = { 454 | isa = XCBuildConfiguration; 455 | baseConfigurationReference = 8E49D96A1DEA3C70BE3650CB /* Pods-SAParallaxViewControllerSwiftExample.release.xcconfig */; 456 | buildSettings = { 457 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 458 | INFOPLIST_FILE = SAParallaxViewControllerSwiftExample/Info.plist; 459 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 461 | PRODUCT_BUNDLE_IDENTIFIER = "szk-atmosphere.$(PRODUCT_NAME:rfc1034identifier)"; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 464 | SWIFT_VERSION = 3.0; 465 | }; 466 | name = Release; 467 | }; 468 | 37E219241A7A997800896D72 /* Debug */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | BUNDLE_LOADER = "$(TEST_HOST)"; 472 | FRAMEWORK_SEARCH_PATHS = ""; 473 | GCC_PREPROCESSOR_DEFINITIONS = ( 474 | "DEBUG=1", 475 | "$(inherited)", 476 | ); 477 | INFOPLIST_FILE = SAParallaxViewControllerSwiftExampleTests/Info.plist; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 479 | PRODUCT_BUNDLE_IDENTIFIER = "szk-atmosphere.$(PRODUCT_NAME:rfc1034identifier)"; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | SWIFT_VERSION = 3.0; 482 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SAParallaxViewControllerSwiftExample.app/SAParallaxViewControllerSwiftExample"; 483 | }; 484 | name = Debug; 485 | }; 486 | 37E219251A7A997800896D72 /* Release */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | BUNDLE_LOADER = "$(TEST_HOST)"; 490 | FRAMEWORK_SEARCH_PATHS = ""; 491 | INFOPLIST_FILE = SAParallaxViewControllerSwiftExampleTests/Info.plist; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 493 | PRODUCT_BUNDLE_IDENTIFIER = "szk-atmosphere.$(PRODUCT_NAME:rfc1034identifier)"; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 496 | SWIFT_VERSION = 3.0; 497 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SAParallaxViewControllerSwiftExample.app/SAParallaxViewControllerSwiftExample"; 498 | }; 499 | name = Release; 500 | }; 501 | /* End XCBuildConfiguration section */ 502 | 503 | /* Begin XCConfigurationList section */ 504 | 37E218FC1A7A997800896D72 /* Build configuration list for PBXProject "SAParallaxViewControllerSwiftExample" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | 37E2191E1A7A997800896D72 /* Debug */, 508 | 37E2191F1A7A997800896D72 /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | 37E219201A7A997800896D72 /* Build configuration list for PBXNativeTarget "SAParallaxViewControllerSwiftExample" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | 37E219211A7A997800896D72 /* Debug */, 517 | 37E219221A7A997800896D72 /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | 37E219231A7A997800896D72 /* Build configuration list for PBXNativeTarget "SAParallaxViewControllerSwiftExampleTests" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | 37E219241A7A997800896D72 /* Debug */, 526 | 37E219251A7A997800896D72 /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | defaultConfigurationName = Release; 530 | }; 531 | /* End XCConfigurationList section */ 532 | }; 533 | rootObject = 37E218F91A7A997800896D72 /* Project object */; 534 | } 535 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SAParallaxViewControllerSwiftExample 4 | // 5 | // Created by 鈴木大貴 on 2015/01/30. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/DetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.swift 3 | // SAParallaxViewControllerSwiftExample 4 | // 5 | // Created by 鈴木大貴 on 2015/02/05. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SAParallaxViewControllerSwift 11 | 12 | class DetailViewController: SADetailViewController { 13 | convenience init() { 14 | self.init(nibName: nil, bundle: nil) 15 | } 16 | 17 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { 18 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 19 | } 20 | 21 | required init?(coder aDecoder: NSCoder) { 22 | super.init(coder: aDecoder) 23 | } 24 | 25 | override func viewDidLoad() { 26 | super.viewDidLoad() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "ダウンロード-2.jpeg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "ダウンロード-1.jpeg" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "ダウンロード.jpeg" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image1.imageset/ダウンロード-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image1.imageset/ダウンロード-1.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image1.imageset/ダウンロード-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image1.imageset/ダウンロード-2.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image1.imageset/ダウンロード.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image1.imageset/ダウンロード.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "aaa.jpeg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "aaa-1.jpeg" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "aaa-2.jpeg" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image2.imageset/aaa-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image2.imageset/aaa-1.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image2.imageset/aaa-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image2.imageset/aaa-2.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image2.imageset/aaa.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image2.imageset/aaa.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "bbb.jpeg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "bbb-1.jpeg" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "bbb-2.jpeg" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image3.imageset/bbb-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image3.imageset/bbb-1.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image3.imageset/bbb-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image3.imageset/bbb-2.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image3.imageset/bbb.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image3.imageset/bbb.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "ccc.jpeg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "ccc-2.jpeg" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "ccc-1.jpeg" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image4.imageset/ccc-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image4.imageset/ccc-1.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image4.imageset/ccc-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image4.imageset/ccc-2.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image4.imageset/ccc.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image4.imageset/ccc.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "ddd.jpeg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "ddd-1.jpeg" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "ddd-2.jpeg" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image5.imageset/ddd-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image5.imageset/ddd-1.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image5.imageset/ddd-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image5.imageset/ddd-2.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image5.imageset/ddd.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image5.imageset/ddd.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "eee.jpeg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "eee-1.jpeg" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "eee-2.jpeg" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image6.imageset/eee-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image6.imageset/eee-1.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image6.imageset/eee-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image6.imageset/eee-2.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image6.imageset/eee.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Images.xcassets/image6.imageset/eee.jpeg -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SAParallaxViewControllerSwiftExample 4 | // 5 | // Created by 鈴木大貴 on 2015/02/02. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SAParallaxViewControllerSwift 11 | 12 | class ViewController: SAParallaxViewController { 13 | let titleList: [String] = ["Girl with Room", "Beautiful sky", "Music Festival", "Fashion show", "Beautiful beach", "Pizza and beer"] 14 | 15 | convenience init() { 16 | self.init(nibName: nil, bundle: nil) 17 | } 18 | 19 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { 20 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 21 | } 22 | 23 | required init?(coder aDecoder: NSCoder) { 24 | super.init(coder: aDecoder) 25 | } 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | } 30 | 31 | //MARK: - UICollectionViewDataSource 32 | override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 33 | let rawCell = super.collectionView(collectionView, cellForItemAt: indexPath) 34 | guard let cell = rawCell as? SAParallaxViewCell else { return rawCell } 35 | 36 | for case let view as UILabel in cell.containerView.accessoryView.subviews { 37 | view.removeFromSuperview() 38 | } 39 | 40 | let index = (indexPath as NSIndexPath).row % 6 41 | let imageName = String(format: "image%d", index + 1) 42 | if let image = UIImage(named: imageName) { 43 | cell.setImage(image) 44 | } 45 | let label = UILabel(frame: cell.containerView.accessoryView.bounds) 46 | label.textAlignment = .center 47 | label.text = titleList[index] 48 | label.textColor = .white 49 | label.font = .systemFont(ofSize: 30) 50 | cell.containerView.accessoryView.addSubview(label) 51 | 52 | return cell 53 | } 54 | 55 | //MARK: - UICollectionViewDelegate 56 | override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 57 | super.collectionView(collectionView, didSelectItemAt: indexPath) 58 | 59 | guard let cells = collectionView.visibleCells as? [SAParallaxViewCell] else { return } 60 | let containerView = SATransitionContainerView(frame: view.bounds) 61 | containerView.setViews(cells, view: view) 62 | 63 | let viewController = DetailViewController() 64 | viewController.transitioningDelegate = self 65 | viewController.trantisionContainerView = containerView 66 | 67 | present(viewController, animated: true, completion: nil) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SAParallaxViewControllerSwiftExample/SAParallaxViewControllerSwiftExampleTests/SAParallaxViewControllerSwiftExampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SAParallaxViewControllerSwiftExampleTests.swift 3 | // SAParallaxViewControllerSwiftExampleTests 4 | // 5 | // Created by 鈴木大貴 on 2015/01/30. 6 | // Copyright (c) 2015年 鈴木大貴. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class SAParallaxViewControllerSwiftExampleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /SampleImage/open_sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SampleImage/open_sample.gif -------------------------------------------------------------------------------- /SampleImage/sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty-suzuki/SAParallaxViewControllerSwift/6ae97a48a44a21dfea975a6541c68e5d3a551131/SampleImage/sample.gif --------------------------------------------------------------------------------