├── .github
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
└── stale.yml
├── .gitignore
├── .travis.yml
├── Examples
├── objective-c
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Balloon1.imageset
│ │ │ ├── Contents.json
│ │ │ └── balloon.png
│ │ ├── Balloon2.imageset
│ │ │ ├── Contents.json
│ │ │ └── balloon2.png
│ │ ├── Balloon3.imageset
│ │ │ ├── Contents.json
│ │ │ └── balloon3.png
│ │ ├── Cloud1.imageset
│ │ │ ├── Contents.json
│ │ │ └── cloud-lg1.png
│ │ ├── Cloud2.imageset
│ │ │ ├── Contents.json
│ │ │ └── cloud-lg2.png
│ │ ├── Cloud3.imageset
│ │ │ ├── Contents.json
│ │ │ └── cloud-sm1.png
│ │ ├── Contents.json
│ │ ├── Ground.imageset
│ │ │ ├── Contents.json
│ │ │ └── ground.png
│ │ ├── Icon.imageset
│ │ │ ├── Contents.json
│ │ │ └── Icon.png
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── Backgrounds
│ │ ├── Clouds1.xib
│ │ ├── Clouds2.xib
│ │ └── Land.xib
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Horizontal.gif
│ ├── Info.plist
│ ├── MXAppDelegate.h
│ ├── MXAppDelegate.m
│ ├── MXHorizontalViewController.h
│ ├── MXHorizontalViewController.m
│ ├── MXVerticalViewController.h
│ ├── MXVerticalViewController.m
│ ├── Vertical.gif
│ └── main.m
└── swift
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Balloon1.imageset
│ │ ├── Contents.json
│ │ └── balloon.png
│ ├── Balloon2.imageset
│ │ ├── Contents.json
│ │ └── balloon2.png
│ ├── Balloon3.imageset
│ │ ├── Contents.json
│ │ └── balloon3.png
│ ├── Cloud1.imageset
│ │ ├── Contents.json
│ │ └── cloud-lg1.png
│ ├── Cloud2.imageset
│ │ ├── Contents.json
│ │ └── cloud-lg2.png
│ ├── Cloud3.imageset
│ │ ├── Contents.json
│ │ └── cloud-sm1.png
│ ├── Ground.imageset
│ │ ├── Contents.json
│ │ └── ground.png
│ └── Icon.imageset
│ │ ├── Contents.json
│ │ └── Icon.png
│ ├── Backgrounds
│ ├── Clouds1.xib
│ ├── Clouds2.xib
│ └── Land.xib
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── MXHorizontalViewController.swift
│ └── MXVerticalViewController.swift
├── Framework
├── Info.plist
├── MXParallaxBackground-umbrella.h
└── module.modulemap
├── LICENSE
├── MXParallaxBackground.podspec
├── MXParallaxBackground.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcshareddata
│ └── xcschemes
│ └── MXParallaxBackground.xcscheme
├── MXParallaxBackground
├── MXParallaxBackground.h
└── MXParallaxBackground.m
└── README.md
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
7 |
8 | NOTE: ISSUES ARE NOT FOR CODE HELP - Ask for Help at https://stackoverflow.com
9 |
10 | Your issue may already be reported!
11 | Please search on the [issue tracker](../) before creating one.
12 |
13 | #### Issue Description
14 | * When Issue Happens
15 | * Steps To Reproduce
16 |
17 | #### Environment Information
18 | * Lib Version
19 | * OS Version
20 |
21 | #### Your Code
22 |
23 | ```
24 | If relevant, paste all of your challenge code in here
25 | ```
26 |
27 | #### Screenshot
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Description
4 |
5 |
6 | ## Motivation and Context
7 |
8 |
9 |
10 | ## How Has This Been Tested?
11 |
12 |
13 |
14 |
15 | ## Screenshots (if appropriate):
16 |
17 | ## Types of changes
18 |
19 | - [ ] Bug fix (non-breaking change which fixes an issue)
20 | - [ ] New feature (non-breaking change which adds functionality)
21 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
22 |
23 | ## Checklist:
24 |
25 |
26 | - [ ] My code follows the code style of this project.
27 | - [ ] My change requires a change to the documentation.
28 | - [ ] I have updated the documentation accordingly.
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Configuration for probot-stale - https://github.com/probot/stale
2 |
3 | # Number of days of inactivity before an Issue or Pull Request becomes stale
4 | daysUntilStale: 60
5 |
6 | # Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7 | # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8 | daysUntilClose: 7
9 |
10 | # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11 | onlyLabels: []
12 |
13 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14 | exemptLabels:
15 | - bug
16 | - help wanted
17 | - enhancement
18 | - need review
19 |
20 | # Label to use when marking as stale
21 | staleLabel: stale
22 |
23 | # Comment to post when marking as stale. Set to `false` to disable
24 | markComment: >
25 | This issue has been automatically marked as stale because it has not had
26 | recent activity. It will be closed if no further activity occurs. Thank you
27 | for your contributions.
--------------------------------------------------------------------------------
/.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 | Carthage
26 | # We recommend against adding the Pods directory to your .gitignore. However
27 | # you should judge for yourself, the pros and cons are mentioned at:
28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
29 | #
30 | # Note: if you ignore the Pods directory, make sure to uncomment
31 | # `pod install` in .travis.yml
32 | #
33 | # Pods/
34 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | osx_image: xcode10.2
3 | env:
4 | global:
5 | - FRAMEWORK_NAME=MXParallaxBackground
6 | before_install:
7 | - brew update
8 | - brew outdated carthage || brew upgrade carthage
9 | install:
10 | - gem install cocoapods
11 | - gem install xcpretty --no-document --quiet
12 | script:
13 | - set -o pipefail && xcodebuild -project MXParallaxBackground.xcodeproj -scheme $FRAMEWORK_NAME
14 | -sdk iphonesimulator12.2 -configuration Release | xcpretty -c
15 | - pod lib lint --quick
16 | before_deploy:
17 | - carthage build --no-skip-current
18 | - carthage archive $FRAMEWORK_NAME
19 | deploy:
20 | provider: releases
21 | api_key:
22 | secure: lAqjJEprMrh/cuQknRWNoY+jJtpFbx9YuXxlzNXUUQ0vGQPn/Sn2PTB2lYlMYuTJiyzzoyx/XxggupjOmdTc75DvesYDZlneaohxmmHcl/jZHTFHHumhJsdsez5s/VXq0Awv3bMk9mbO3tzvzhdvOIMXBQKgO/h8XX4Yhicl9T62PEGpVkyf3pTSmentPmN3WH9pp0YsJTxE0AINxe4tIcYIRPh3xOASjZhAXyYCFA0QnRknhMRDC51ncpCGLuxVI3cw85/w6gLnFap2dToaN9NttmWjAM52PVf+rFyCV1waKB5txtej1LF+bKumX2i6bKwPirpooQds8FeXqdzXmtCmbkOF7Lz3xLZPf4EAcwcRZQJE/sakCn9lqD+F63uQfUaJFh4TDzVaBzhlZDPrY/pbnvI7xM5ZHHgyH6XRaOhGsAIV/rhvmCcW2Ctj+QOOgzrllwogU5BZF51/CNSy3YqAcvrCsrjwQ87eM5orBGFzEqE2IZQnyQXr4+3EPh9dVQVAqgaFwujla8WXG7NkuNtbX9j6coWVSzD6Af6JuYh5Thekb/5jamRhKmcRPGjDda2DuDMD/T5RyAK6kypL+hVG4/oZJFnHldEmndxhwCUic/2y7LYbRr/+ttiu9nLnXG1ze6d2KYNBGX1F1lFvseSni7T6j0GmiIrcQ7PLEkE=
23 | file: $FRAMEWORK_NAME.framework.zip
24 | skip_cleanup: true
25 | on:
26 | repo: maxep/MXParallaxBackground
27 | tags: true
28 |
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Balloon1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "balloon.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Balloon1.imageset/balloon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Assets.xcassets/Balloon1.imageset/balloon.png
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Balloon2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "balloon2.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Balloon2.imageset/balloon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Assets.xcassets/Balloon2.imageset/balloon2.png
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Balloon3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "balloon3.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Balloon3.imageset/balloon3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Assets.xcassets/Balloon3.imageset/balloon3.png
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Cloud1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "cloud-lg1.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Cloud1.imageset/cloud-lg1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Assets.xcassets/Cloud1.imageset/cloud-lg1.png
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Cloud2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "cloud-lg2.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Cloud2.imageset/cloud-lg2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Assets.xcassets/Cloud2.imageset/cloud-lg2.png
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Cloud3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "cloud-sm1.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Cloud3.imageset/cloud-sm1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Assets.xcassets/Cloud3.imageset/cloud-sm1.png
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Ground.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "ground.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Ground.imageset/ground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Assets.xcassets/Ground.imageset/ground.png
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Icon.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/Icon.imageset/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Assets.xcassets/Icon.imageset/Icon.png
--------------------------------------------------------------------------------
/Examples/objective-c/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | },
18 | {
19 | "orientation" : "portrait",
20 | "idiom" : "ipad",
21 | "extent" : "full-screen",
22 | "minimum-system-version" : "7.0",
23 | "scale" : "1x"
24 | },
25 | {
26 | "orientation" : "landscape",
27 | "idiom" : "ipad",
28 | "extent" : "full-screen",
29 | "minimum-system-version" : "7.0",
30 | "scale" : "1x"
31 | },
32 | {
33 | "orientation" : "portrait",
34 | "idiom" : "ipad",
35 | "extent" : "full-screen",
36 | "minimum-system-version" : "7.0",
37 | "scale" : "2x"
38 | },
39 | {
40 | "orientation" : "landscape",
41 | "idiom" : "ipad",
42 | "extent" : "full-screen",
43 | "minimum-system-version" : "7.0",
44 | "scale" : "2x"
45 | }
46 | ],
47 | "info" : {
48 | "version" : 1,
49 | "author" : "xcode"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Examples/objective-c/Backgrounds/Clouds1.xib:
--------------------------------------------------------------------------------
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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/Examples/objective-c/Backgrounds/Clouds2.xib:
--------------------------------------------------------------------------------
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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/Examples/objective-c/Backgrounds/Land.xib:
--------------------------------------------------------------------------------
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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Examples/objective-c/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Examples/objective-c/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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/Examples/objective-c/Horizontal.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Horizontal.gif
--------------------------------------------------------------------------------
/Examples/objective-c/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
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Examples/objective-c/MXAppDelegate.h:
--------------------------------------------------------------------------------
1 | // MXAppDelegate.h
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | @import UIKit;
24 |
25 | @interface MXAppDelegate : UIResponder
26 |
27 | @property (strong, nonatomic) UIWindow *window;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Examples/objective-c/MXAppDelegate.m:
--------------------------------------------------------------------------------
1 | // MXAppDelegate.m
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 | #import "MXAppDelegate.h"
23 |
24 | @implementation MXAppDelegate
25 |
26 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
27 | {
28 | // Override point for customization after application launch.
29 | [UITabBar appearance].tintColor = [UIColor blackColor];
30 | return YES;
31 | }
32 |
33 | - (void)applicationWillResignActive:(UIApplication *)application
34 | {
35 | // 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.
36 | // 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.
37 | }
38 |
39 | - (void)applicationDidEnterBackground:(UIApplication *)application
40 | {
41 | // 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.
42 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
43 | }
44 |
45 | - (void)applicationWillEnterForeground:(UIApplication *)application
46 | {
47 | // 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.
48 | }
49 |
50 | - (void)applicationDidBecomeActive:(UIApplication *)application
51 | {
52 | // 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.
53 | }
54 |
55 | - (void)applicationWillTerminate:(UIApplication *)application
56 | {
57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/Examples/objective-c/MXHorizontalViewController.h:
--------------------------------------------------------------------------------
1 | // MXBalloonsViewController.h
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 | #import
23 |
24 | @interface MXHorizontalViewController : UIViewController
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Examples/objective-c/MXHorizontalViewController.m:
--------------------------------------------------------------------------------
1 | // MXBalloonsViewController.m
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #import "MXHorizontalViewController.h"
24 | #import "MXParallaxBackground.h"
25 |
26 | @interface MXHorizontalViewController ()
27 | @property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
28 | @end
29 |
30 | @implementation MXHorizontalViewController
31 |
32 | - (void)viewDidLoad {
33 | [super viewDidLoad];
34 | [self loadPages];
35 |
36 | // Sets backgrounds
37 | MXParallaxBackground *clouds1 = [MXParallaxBackground new];
38 | clouds1.view = [NSBundle.mainBundle loadNibNamed:@"Clouds1" owner:self options:nil].firstObject;
39 | clouds1.intensity = 0.25;
40 | [self.scrollView addBackground:clouds1];
41 |
42 | MXParallaxBackground *clouds2 = [MXParallaxBackground new];
43 | clouds2.view = [NSBundle.mainBundle loadNibNamed:@"Clouds2" owner:self options:nil].firstObject;
44 | clouds2.intensity = 0.5;
45 | clouds2.reverse = YES;
46 | [self.scrollView addBackground:clouds2];
47 |
48 | [self.scrollView bringBackgroundToFront:clouds2];
49 | }
50 |
51 | - (void)didReceiveMemoryWarning {
52 | [super didReceiveMemoryWarning];
53 | // Dispose of any resources that can be recreated.
54 | }
55 |
56 | - (void) loadPages {
57 | NSMutableDictionary *views = [NSMutableDictionary new];
58 | NSMutableString *hFormat = [NSMutableString stringWithString:@"H:|"];
59 |
60 | for (NSInteger i = 0; i < 3; i++) {
61 | NSString *imageName = [NSString stringWithFormat:@"Balloon%li", (i + 1)];
62 |
63 | UIImageView *imageView = [UIImageView new];
64 | imageView.image = [UIImage imageNamed:imageName];
65 | imageView.contentMode = UIViewContentModeCenter;
66 | imageView.translatesAutoresizingMaskIntoConstraints = NO;
67 |
68 | [self.scrollView addSubview:imageView];
69 |
70 | views[imageName] = imageView;
71 | NSString *vFormat = [NSString stringWithFormat:@"V:|[%@]|", imageName];
72 | [self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:vFormat
73 | options:0
74 | metrics:nil
75 | views:views]];
76 |
77 | [self.scrollView addConstraint:[NSLayoutConstraint constraintWithItem:imageView
78 | attribute:NSLayoutAttributeCenterY
79 | relatedBy:NSLayoutRelationEqual
80 | toItem:self.scrollView
81 | attribute:NSLayoutAttributeCenterY
82 | multiplier:1
83 | constant:0]];
84 |
85 | [self.view addConstraint:[NSLayoutConstraint constraintWithItem:imageView
86 | attribute:NSLayoutAttributeWidth
87 | relatedBy:NSLayoutRelationEqual
88 | toItem:self.view
89 | attribute:NSLayoutAttributeWidth
90 | multiplier:1
91 | constant:0]];
92 | [hFormat appendFormat:@"[%@]", imageName];
93 | }
94 |
95 | [hFormat appendString:@"|"];
96 | [self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:hFormat
97 | options:0
98 | metrics:nil
99 | views:views]];
100 | }
101 |
102 | @end
103 |
--------------------------------------------------------------------------------
/Examples/objective-c/MXVerticalViewController.h:
--------------------------------------------------------------------------------
1 | // MXVerticalViewController.h
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | @interface MXVerticalViewController : UIViewController
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Examples/objective-c/MXVerticalViewController.m:
--------------------------------------------------------------------------------
1 | // MXVerticalViewController.m
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #import "MXVerticalViewController.h"
24 | #import "MXParallaxBackground.h"
25 |
26 | @interface MXVerticalViewController ()
27 | @property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
28 | @end
29 |
30 | @implementation MXVerticalViewController
31 |
32 | - (void)viewDidLoad {
33 | [super viewDidLoad];
34 | [self loadPages];
35 |
36 | MXParallaxBackground *land = [MXParallaxBackground new];
37 | land.view = [NSBundle.mainBundle loadNibNamed:@"Land" owner:self options:nil].firstObject;
38 | land.intensity = 0.80;
39 | [self.scrollView addBackground:land];
40 |
41 | MXParallaxBackground *clouds1 = [MXParallaxBackground new];
42 | clouds1.view = [NSBundle.mainBundle loadNibNamed:@"Clouds1" owner:self options:nil].firstObject;
43 | clouds1.intensity = 0.5;
44 | [self.scrollView addBackground:clouds1];
45 |
46 | MXParallaxBackground *clouds2 = [MXParallaxBackground new];
47 | clouds2.view = [NSBundle.mainBundle loadNibNamed:@"Clouds2" owner:self options:nil].firstObject;
48 | clouds2.intensity = 0.25;
49 | clouds2.reverse = YES;
50 |
51 | [self.scrollView bringBackgroundToFront:land];
52 | [self.scrollView insertBackground:clouds2 belowBackground:land];
53 | }
54 |
55 | - (void)loadPages {
56 | NSMutableDictionary *views = [NSMutableDictionary new];
57 | NSMutableString *hFormat = [NSMutableString stringWithString:@"V:|"];
58 |
59 | for (NSInteger i = 0; i < 3; i++) {
60 | NSString *imageName = [NSString stringWithFormat:@"Balloon%li", (i + 1)];
61 |
62 | UIImageView *imageView = [UIImageView new];
63 | imageView.image = [UIImage imageNamed:imageName];
64 | imageView.contentMode = UIViewContentModeCenter;
65 | imageView.translatesAutoresizingMaskIntoConstraints = NO;
66 |
67 | [self.scrollView addSubview:imageView];
68 |
69 | views[imageName] = imageView;
70 | NSString *vFormat = [NSString stringWithFormat:@"H:|[%@]|", imageName];
71 | [self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:vFormat
72 | options:0
73 | metrics:nil
74 | views:views]];
75 |
76 | [self.scrollView addConstraint:[NSLayoutConstraint constraintWithItem:imageView
77 | attribute:NSLayoutAttributeCenterX
78 | relatedBy:NSLayoutRelationEqual
79 | toItem:self.scrollView
80 | attribute:NSLayoutAttributeCenterX
81 | multiplier:1
82 | constant:0]];
83 |
84 | [self.view addConstraint:[NSLayoutConstraint constraintWithItem:imageView
85 | attribute:NSLayoutAttributeHeight
86 | relatedBy:NSLayoutRelationEqual
87 | toItem:self.view
88 | attribute:NSLayoutAttributeHeight
89 | multiplier:1
90 | constant:0]];
91 | [hFormat appendFormat:@"[%@]", imageName];
92 | }
93 |
94 | [hFormat appendString:@"|"];
95 | [self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:hFormat
96 | options:0
97 | metrics:nil
98 | views:views]];
99 | }
100 |
101 | @end
102 |
--------------------------------------------------------------------------------
/Examples/objective-c/Vertical.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/objective-c/Vertical.gif
--------------------------------------------------------------------------------
/Examples/objective-c/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // MXParallaxBackground
4 | //
5 | // Created by Maxime Epain on 12/13/2019.
6 | // Copyright (c) 2019 Maxime Epain. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 | #import "MXAppDelegate.h"
11 |
12 | int main(int argc, char * argv[])
13 | {
14 | @autoreleasepool {
15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([MXAppDelegate class]));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Examples/swift/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | // AppDelegate.swift
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | import UIKit
24 |
25 | @UIApplicationMain
26 | class AppDelegate: UIResponder, UIApplicationDelegate {
27 |
28 | var window: UIWindow?
29 |
30 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
31 | // Override point for customization after application launch.
32 | UITabBar.appearance().tintColor = .black
33 | return true
34 | }
35 |
36 | func applicationWillResignActive(_ application: UIApplication) {
37 | // 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.
38 | // 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.
39 | }
40 |
41 | func applicationDidEnterBackground(_ application: UIApplication) {
42 | // 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.
43 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
44 | }
45 |
46 | func applicationWillEnterForeground(_ application: UIApplication) {
47 | // 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.
48 | }
49 |
50 | func applicationDidBecomeActive(_ application: UIApplication) {
51 | // 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.
52 | }
53 |
54 | func applicationWillTerminate(_ application: UIApplication) {
55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
56 | }
57 |
58 |
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/Examples/swift/Assets.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 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Balloon1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "balloon.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Balloon1.imageset/balloon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/swift/Assets.xcassets/Balloon1.imageset/balloon.png
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Balloon2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "balloon2.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Balloon2.imageset/balloon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/swift/Assets.xcassets/Balloon2.imageset/balloon2.png
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Balloon3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "balloon3.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Balloon3.imageset/balloon3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/swift/Assets.xcassets/Balloon3.imageset/balloon3.png
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Cloud1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "cloud-lg1.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Cloud1.imageset/cloud-lg1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/swift/Assets.xcassets/Cloud1.imageset/cloud-lg1.png
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Cloud2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "cloud-lg2.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Cloud2.imageset/cloud-lg2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/swift/Assets.xcassets/Cloud2.imageset/cloud-lg2.png
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Cloud3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "cloud-sm1.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Cloud3.imageset/cloud-sm1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/swift/Assets.xcassets/Cloud3.imageset/cloud-sm1.png
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Ground.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "ground.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Ground.imageset/ground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/swift/Assets.xcassets/Ground.imageset/ground.png
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Icon.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Examples/swift/Assets.xcassets/Icon.imageset/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxep/MXParallaxBackground/b9af636b033b5b90bbe1646f0d906c6bff3e3873/Examples/swift/Assets.xcassets/Icon.imageset/Icon.png
--------------------------------------------------------------------------------
/Examples/swift/Backgrounds/Clouds1.xib:
--------------------------------------------------------------------------------
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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Examples/swift/Backgrounds/Clouds2.xib:
--------------------------------------------------------------------------------
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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/Examples/swift/Backgrounds/Land.xib:
--------------------------------------------------------------------------------
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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Examples/swift/Base.lproj/LaunchScreen.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 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Examples/swift/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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/Examples/swift/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
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Examples/swift/MXHorizontalViewController.swift:
--------------------------------------------------------------------------------
1 | // MXHorizontalViewController.swift
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | import UIKit
24 | import MXParallaxBackground
25 |
26 | class MXHorizontalViewController: UIViewController {
27 |
28 | @IBOutlet weak var scrollView: UIScrollView!
29 |
30 | override func viewDidLoad() {
31 | super.viewDidLoad()
32 | loadPages()
33 |
34 | // Sets backgrounds
35 | let clouds1 = MXParallaxBackground()
36 | clouds1.view = Bundle.main.loadNibNamed("Clouds1", owner: self, options: nil)?[0] as? UIView
37 | clouds1.intensity = 0.25
38 | scrollView.add(background: clouds1)
39 |
40 | let clouds2 = MXParallaxBackground()
41 | clouds2.view = Bundle.main.loadNibNamed("Clouds2", owner: self, options: nil)?[0] as? UIView
42 | clouds2.intensity = 0.5
43 | clouds2.isReverse = true
44 | scrollView.add(background: clouds2)
45 |
46 | scrollView.bringBackground(toFront: clouds2)
47 | }
48 |
49 | override func didReceiveMemoryWarning() {
50 | super.didReceiveMemoryWarning()
51 | // Dispose of any resources that can be recreated.
52 | }
53 |
54 | fileprivate func loadPages() {
55 | var views = Dictionary()
56 | var format = "H:|"
57 |
58 | for i in 1...3 {
59 | let imageName = "Balloon\(i)"
60 |
61 | let imageView = UIImageView()
62 | imageView.image = UIImage(named: imageName);
63 | imageView.contentMode = UIViewContentMode.center
64 | imageView.translatesAutoresizingMaskIntoConstraints = false
65 |
66 | scrollView.addSubview(imageView)
67 |
68 | views[imageName] = imageView
69 | scrollView.addConstraints(NSLayoutConstraint.constraints(
70 | withVisualFormat: "V:|[\(imageName)]|",
71 | options: .directionLeadingToTrailing,
72 | metrics: nil,
73 | views: views)
74 | )
75 |
76 | scrollView.addConstraint( NSLayoutConstraint(
77 | item: imageView,
78 | attribute: .centerY,
79 | relatedBy: .equal,
80 | toItem: scrollView,
81 | attribute: .centerY,
82 | multiplier: 1,
83 | constant: 0)
84 | )
85 |
86 | view.addConstraint( NSLayoutConstraint(
87 | item: imageView,
88 | attribute: .width,
89 | relatedBy: .equal,
90 | toItem: view,
91 | attribute: .width,
92 | multiplier: 1,
93 | constant: 0)
94 | )
95 |
96 | format += "[\(imageName)]"
97 | }
98 |
99 | format += "|"
100 | scrollView.addConstraints( NSLayoutConstraint.constraints(
101 | withVisualFormat: format,
102 | options: .directionLeadingToTrailing,
103 | metrics: nil,
104 | views: views)
105 | )
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/Examples/swift/MXVerticalViewController.swift:
--------------------------------------------------------------------------------
1 | // MXVerticalViewController.swift
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | import UIKit
24 | import MXParallaxBackground
25 |
26 | class MXVerticalViewController: UIViewController {
27 |
28 | @IBOutlet weak var scrollView: UIScrollView!
29 |
30 | override func viewDidLoad() {
31 | super.viewDidLoad()
32 | loadPages()
33 |
34 | // Sets backgrounds
35 | let land = MXParallaxBackground()
36 | land.view = Bundle.main.loadNibNamed("Land", owner: self, options: nil)?[0] as? UIView
37 | land.intensity = 0.80
38 | self.scrollView.add(background: land)
39 |
40 | let clouds1 = MXParallaxBackground()
41 | clouds1.view = Bundle.main.loadNibNamed("Clouds1", owner: self, options: nil)?[0] as? UIView
42 | clouds1.intensity = 0.5
43 | self.scrollView.add(background: clouds1)
44 |
45 | let clouds2 = MXParallaxBackground()
46 | clouds2.view = Bundle.main.loadNibNamed("Clouds2", owner: self, options: nil)?[0] as? UIView
47 | clouds2.intensity = 0.25
48 | clouds2.isReverse = true
49 |
50 | scrollView.bringBackground(toFront: land)
51 | scrollView.insert(background: clouds2, below: land)
52 | }
53 |
54 | override func didReceiveMemoryWarning() {
55 | super.didReceiveMemoryWarning()
56 | // Dispose of any resources that can be recreated.
57 | }
58 |
59 | fileprivate func loadPages() {
60 | var views = Dictionary()
61 | var format = "V:|"
62 |
63 | for i in 1...3 {
64 | let imageName = "Balloon\(i)"
65 |
66 | let imageView = UIImageView()
67 | imageView.image = UIImage(named: imageName);
68 | imageView.contentMode = .center
69 | imageView.translatesAutoresizingMaskIntoConstraints = false
70 |
71 | scrollView.addSubview(imageView)
72 |
73 | views[imageName] = imageView
74 | scrollView.addConstraints(
75 | NSLayoutConstraint.constraints(
76 | withVisualFormat: "H:|[\(imageName)]|",
77 | options: .directionLeadingToTrailing,
78 | metrics: nil,
79 | views: views
80 | )
81 | )
82 |
83 | scrollView.addConstraint( NSLayoutConstraint(
84 | item: imageView,
85 | attribute: .centerX,
86 | relatedBy: .equal,
87 | toItem: scrollView,
88 | attribute: .centerX,
89 | multiplier: 1,
90 | constant: 0)
91 | )
92 |
93 | view.addConstraint( NSLayoutConstraint(
94 | item: imageView,
95 | attribute: .height,
96 | relatedBy: .equal,
97 | toItem: view,
98 | attribute: .height,
99 | multiplier: 1,
100 | constant: 0)
101 | )
102 |
103 | format += "[\(imageName)]"
104 | }
105 |
106 | format += "|"
107 | scrollView.addConstraints( NSLayoutConstraint.constraints(
108 | withVisualFormat: format,
109 | options: .directionLeadingToTrailing,
110 | metrics: nil,
111 | views: views)
112 | )
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/Framework/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 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Framework/MXParallaxBackground-umbrella.h:
--------------------------------------------------------------------------------
1 | //
2 | // MXParallaxBackground.h
3 | // MXParallaxBackground
4 | //
5 | // Created by Maxime Epain on 02/12/2019.
6 | // Copyright © 2019 Maxime Epain. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for MXParallaxBackground.
12 | FOUNDATION_EXPORT double MXParallaxBackgroundVersionNumber;
13 |
14 | //! Project version string for MXParallaxBackground.
15 | FOUNDATION_EXPORT const unsigned char MXParallaxBackgroundVersionString[];
16 |
17 | #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Framework/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module MXParallaxBackground {
2 | umbrella header "MXParallaxBackground-umbrella.h"
3 | export *
4 | module * { export * }
5 | }
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Maxime Epain
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 |
--------------------------------------------------------------------------------
/MXParallaxBackground.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "MXParallaxBackground"
3 | s.version = "1.0.0"
4 | s.summary = "MXParallaxBackground is a simple background class for UIScrolView."
5 |
6 | s.description = <<-DESC
7 | MXParallaxBackground is a simple background class for UIScrolView.
8 | You can add as many backgrounds as you want with different intensity and direction.
9 | DESC
10 |
11 | s.homepage = "https://github.com/maxep/MXParallaxBackground"
12 | # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
13 | s.license = 'MIT'
14 | s.author = { "Maxime Epain" => "maime.epain@gmail.com" }
15 | s.source = { :git => "https://github.com/maxep/MXParallaxBackground.git", :tag => s.version.to_s }
16 | s.social_media_url = 'https://twitter.com/MaximeEpain'
17 |
18 | s.platform = :ios, '7.0'
19 | s.requires_arc = true
20 |
21 | s.source_files = 'MXParallaxBackground/**/*'
22 |
23 | end
24 |
--------------------------------------------------------------------------------
/MXParallaxBackground.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 9C4FCC611DF1C9840065C140 /* MXParallaxBackground.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C4FCC5F1DF1C9840065C140 /* MXParallaxBackground.h */; settings = {ATTRIBUTES = (Public, ); }; };
11 | 9C4FCC6D1DF1CA6A0065C140 /* MXParallaxBackground-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C4FCC6B1DF1CA6A0065C140 /* MXParallaxBackground-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
12 | 9C4FCC6F1DF1CAB40065C140 /* MXParallaxBackground.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4FCC6E1DF1CAB40065C140 /* MXParallaxBackground.m */; };
13 | 9C4FCC781DF1CB2E0065C140 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4FCC771DF1CB2E0065C140 /* main.m */; };
14 | 9C4FCC811DF1CB2F0065C140 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCC7F1DF1CB2F0065C140 /* Main.storyboard */; };
15 | 9C4FCC831DF1CB2F0065C140 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCC821DF1CB2F0065C140 /* Assets.xcassets */; };
16 | 9C4FCC861DF1CB2F0065C140 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCC841DF1CB2F0065C140 /* LaunchScreen.storyboard */; };
17 | 9C4FCC961DF1CC150065C140 /* Clouds1.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCC8C1DF1CC150065C140 /* Clouds1.xib */; };
18 | 9C4FCC971DF1CC150065C140 /* Clouds2.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCC8D1DF1CC150065C140 /* Clouds2.xib */; };
19 | 9C4FCC991DF1CC150065C140 /* Land.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCC8F1DF1CC150065C140 /* Land.xib */; };
20 | 9C4FCC9A1DF1CC150065C140 /* MXAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4FCC911DF1CC150065C140 /* MXAppDelegate.m */; };
21 | 9C4FCC9B1DF1CC150065C140 /* MXHorizontalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4FCC931DF1CC150065C140 /* MXHorizontalViewController.m */; };
22 | 9C4FCC9C1DF1CC150065C140 /* MXVerticalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4FCC951DF1CC150065C140 /* MXVerticalViewController.m */; };
23 | 9C4FCC9F1DF1CC3C0065C140 /* MXParallaxBackground.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4FCC5C1DF1C9840065C140 /* MXParallaxBackground.framework */; };
24 | 9C4FCCA01DF1CC3C0065C140 /* MXParallaxBackground.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4FCC5C1DF1C9840065C140 /* MXParallaxBackground.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
25 | 9C4FCCA91DF1CE9A0065C140 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C4FCCA81DF1CE9A0065C140 /* AppDelegate.swift */; };
26 | 9C4FCCAE1DF1CE9A0065C140 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCCAC1DF1CE9A0065C140 /* Main.storyboard */; };
27 | 9C4FCCB01DF1CE9A0065C140 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCCAF1DF1CE9A0065C140 /* Assets.xcassets */; };
28 | 9C4FCCB31DF1CE9A0065C140 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCCB11DF1CE9A0065C140 /* LaunchScreen.storyboard */; };
29 | 9C4FCCBA1DF1CED10065C140 /* MXHorizontalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C4FCCB81DF1CED10065C140 /* MXHorizontalViewController.swift */; };
30 | 9C4FCCBB1DF1CED10065C140 /* MXVerticalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C4FCCB91DF1CED10065C140 /* MXVerticalViewController.swift */; };
31 | 9C4FCCBE1DF1CF9D0065C140 /* MXParallaxBackground.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4FCC5C1DF1C9840065C140 /* MXParallaxBackground.framework */; };
32 | 9C4FCCBF1DF1CF9D0065C140 /* MXParallaxBackground.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9C4FCC5C1DF1C9840065C140 /* MXParallaxBackground.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
33 | 9C4FCCC61DF1D0A40065C140 /* Clouds1.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCCC21DF1D0A40065C140 /* Clouds1.xib */; };
34 | 9C4FCCC71DF1D0A40065C140 /* Clouds2.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCCC31DF1D0A40065C140 /* Clouds2.xib */; };
35 | 9C4FCCC91DF1D0A40065C140 /* Land.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C4FCCC51DF1D0A40065C140 /* Land.xib */; };
36 | /* End PBXBuildFile section */
37 |
38 | /* Begin PBXContainerItemProxy section */
39 | 9C4FCC9D1DF1CC370065C140 /* PBXContainerItemProxy */ = {
40 | isa = PBXContainerItemProxy;
41 | containerPortal = 9C4FCC531DF1C9840065C140 /* Project object */;
42 | proxyType = 1;
43 | remoteGlobalIDString = 9C4FCC5B1DF1C9840065C140;
44 | remoteInfo = MXParallaxBackground;
45 | };
46 | 9C4FCCBC1DF1CF940065C140 /* PBXContainerItemProxy */ = {
47 | isa = PBXContainerItemProxy;
48 | containerPortal = 9C4FCC531DF1C9840065C140 /* Project object */;
49 | proxyType = 1;
50 | remoteGlobalIDString = 9C4FCC5B1DF1C9840065C140;
51 | remoteInfo = MXParallaxBackground;
52 | };
53 | /* End PBXContainerItemProxy section */
54 |
55 | /* Begin PBXCopyFilesBuildPhase section */
56 | 9C4FCCA11DF1CC3C0065C140 /* Embed Frameworks */ = {
57 | isa = PBXCopyFilesBuildPhase;
58 | buildActionMask = 2147483647;
59 | dstPath = "";
60 | dstSubfolderSpec = 10;
61 | files = (
62 | 9C4FCCA01DF1CC3C0065C140 /* MXParallaxBackground.framework in Embed Frameworks */,
63 | );
64 | name = "Embed Frameworks";
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | 9C4FCCC01DF1CF9D0065C140 /* Embed Frameworks */ = {
68 | isa = PBXCopyFilesBuildPhase;
69 | buildActionMask = 2147483647;
70 | dstPath = "";
71 | dstSubfolderSpec = 10;
72 | files = (
73 | 9C4FCCBF1DF1CF9D0065C140 /* MXParallaxBackground.framework in Embed Frameworks */,
74 | );
75 | name = "Embed Frameworks";
76 | runOnlyForDeploymentPostprocessing = 0;
77 | };
78 | /* End PBXCopyFilesBuildPhase section */
79 |
80 | /* Begin PBXFileReference section */
81 | 9C4FCC5C1DF1C9840065C140 /* MXParallaxBackground.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MXParallaxBackground.framework; sourceTree = BUILT_PRODUCTS_DIR; };
82 | 9C4FCC5F1DF1C9840065C140 /* MXParallaxBackground.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MXParallaxBackground.h; sourceTree = ""; };
83 | 9C4FCC691DF1CA6A0065C140 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
84 | 9C4FCC6B1DF1CA6A0065C140 /* MXParallaxBackground-umbrella.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MXParallaxBackground-umbrella.h"; sourceTree = ""; };
85 | 9C4FCC6E1DF1CAB40065C140 /* MXParallaxBackground.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXParallaxBackground.m; sourceTree = ""; };
86 | 9C4FCC741DF1CB2E0065C140 /* MXParallaxBackground-objc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MXParallaxBackground-objc.app"; sourceTree = BUILT_PRODUCTS_DIR; };
87 | 9C4FCC771DF1CB2E0065C140 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
88 | 9C4FCC801DF1CB2F0065C140 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
89 | 9C4FCC821DF1CB2F0065C140 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
90 | 9C4FCC851DF1CB2F0065C140 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
91 | 9C4FCC871DF1CB2F0065C140 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
92 | 9C4FCC8C1DF1CC150065C140 /* Clouds1.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Clouds1.xib; sourceTree = ""; };
93 | 9C4FCC8D1DF1CC150065C140 /* Clouds2.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Clouds2.xib; sourceTree = ""; };
94 | 9C4FCC8F1DF1CC150065C140 /* Land.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Land.xib; sourceTree = ""; };
95 | 9C4FCC901DF1CC150065C140 /* MXAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXAppDelegate.h; sourceTree = ""; };
96 | 9C4FCC911DF1CC150065C140 /* MXAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXAppDelegate.m; sourceTree = ""; };
97 | 9C4FCC921DF1CC150065C140 /* MXHorizontalViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXHorizontalViewController.h; sourceTree = ""; };
98 | 9C4FCC931DF1CC150065C140 /* MXHorizontalViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXHorizontalViewController.m; sourceTree = ""; };
99 | 9C4FCC941DF1CC150065C140 /* MXVerticalViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXVerticalViewController.h; sourceTree = ""; };
100 | 9C4FCC951DF1CC150065C140 /* MXVerticalViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXVerticalViewController.m; sourceTree = ""; };
101 | 9C4FCCA61DF1CE9A0065C140 /* MXParallaxBackground-swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MXParallaxBackground-swift.app"; sourceTree = BUILT_PRODUCTS_DIR; };
102 | 9C4FCCA81DF1CE9A0065C140 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
103 | 9C4FCCAD1DF1CE9A0065C140 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
104 | 9C4FCCAF1DF1CE9A0065C140 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
105 | 9C4FCCB21DF1CE9A0065C140 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
106 | 9C4FCCB41DF1CE9A0065C140 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
107 | 9C4FCCB81DF1CED10065C140 /* MXHorizontalViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MXHorizontalViewController.swift; sourceTree = ""; };
108 | 9C4FCCB91DF1CED10065C140 /* MXVerticalViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MXVerticalViewController.swift; sourceTree = ""; };
109 | 9C4FCCC21DF1D0A40065C140 /* Clouds1.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Clouds1.xib; sourceTree = ""; };
110 | 9C4FCCC31DF1D0A40065C140 /* Clouds2.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Clouds2.xib; sourceTree = ""; };
111 | 9C4FCCC51DF1D0A40065C140 /* Land.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Land.xib; sourceTree = ""; };
112 | 9C4FCCCB1DF1D1EF0065C140 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = ""; };
113 | 9C4FCCCC1DF1D1EF0065C140 /* MXParallaxBackground.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = MXParallaxBackground.podspec; sourceTree = ""; };
114 | 9C4FCCCD1DF1D1EF0065C140 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
115 | /* End PBXFileReference section */
116 |
117 | /* Begin PBXFrameworksBuildPhase section */
118 | 9C4FCC581DF1C9840065C140 /* Frameworks */ = {
119 | isa = PBXFrameworksBuildPhase;
120 | buildActionMask = 2147483647;
121 | files = (
122 | );
123 | runOnlyForDeploymentPostprocessing = 0;
124 | };
125 | 9C4FCC711DF1CB2E0065C140 /* Frameworks */ = {
126 | isa = PBXFrameworksBuildPhase;
127 | buildActionMask = 2147483647;
128 | files = (
129 | 9C4FCC9F1DF1CC3C0065C140 /* MXParallaxBackground.framework in Frameworks */,
130 | );
131 | runOnlyForDeploymentPostprocessing = 0;
132 | };
133 | 9C4FCCA31DF1CE9A0065C140 /* Frameworks */ = {
134 | isa = PBXFrameworksBuildPhase;
135 | buildActionMask = 2147483647;
136 | files = (
137 | 9C4FCCBE1DF1CF9D0065C140 /* MXParallaxBackground.framework in Frameworks */,
138 | );
139 | runOnlyForDeploymentPostprocessing = 0;
140 | };
141 | /* End PBXFrameworksBuildPhase section */
142 |
143 | /* Begin PBXGroup section */
144 | 9C4FCC521DF1C9840065C140 = {
145 | isa = PBXGroup;
146 | children = (
147 | 9C4FCCCA1DF1D1D60065C140 /* Metadata */,
148 | 9C4FCC5E1DF1C9840065C140 /* MXParallaxBackground */,
149 | 9C4FCC681DF1CA6A0065C140 /* Framework */,
150 | 9C73FA4022FC75030021C818 /* Examples */,
151 | 9C4FCC5D1DF1C9840065C140 /* Products */,
152 | );
153 | sourceTree = "";
154 | };
155 | 9C4FCC5D1DF1C9840065C140 /* Products */ = {
156 | isa = PBXGroup;
157 | children = (
158 | 9C4FCC5C1DF1C9840065C140 /* MXParallaxBackground.framework */,
159 | 9C4FCC741DF1CB2E0065C140 /* MXParallaxBackground-objc.app */,
160 | 9C4FCCA61DF1CE9A0065C140 /* MXParallaxBackground-swift.app */,
161 | );
162 | name = Products;
163 | sourceTree = "";
164 | };
165 | 9C4FCC5E1DF1C9840065C140 /* MXParallaxBackground */ = {
166 | isa = PBXGroup;
167 | children = (
168 | 9C4FCC5F1DF1C9840065C140 /* MXParallaxBackground.h */,
169 | 9C4FCC6E1DF1CAB40065C140 /* MXParallaxBackground.m */,
170 | );
171 | path = MXParallaxBackground;
172 | sourceTree = "";
173 | };
174 | 9C4FCC681DF1CA6A0065C140 /* Framework */ = {
175 | isa = PBXGroup;
176 | children = (
177 | 9C4FCC691DF1CA6A0065C140 /* Info.plist */,
178 | 9C4FCC6B1DF1CA6A0065C140 /* MXParallaxBackground-umbrella.h */,
179 | );
180 | path = Framework;
181 | sourceTree = "";
182 | };
183 | 9C4FCC751DF1CB2E0065C140 /* objective-c */ = {
184 | isa = PBXGroup;
185 | children = (
186 | 9C4FCC8B1DF1CC150065C140 /* Backgrounds */,
187 | 9C4FCC901DF1CC150065C140 /* MXAppDelegate.h */,
188 | 9C4FCC911DF1CC150065C140 /* MXAppDelegate.m */,
189 | 9C4FCC921DF1CC150065C140 /* MXHorizontalViewController.h */,
190 | 9C4FCC931DF1CC150065C140 /* MXHorizontalViewController.m */,
191 | 9C4FCC941DF1CC150065C140 /* MXVerticalViewController.h */,
192 | 9C4FCC951DF1CC150065C140 /* MXVerticalViewController.m */,
193 | 9C4FCC7F1DF1CB2F0065C140 /* Main.storyboard */,
194 | 9C4FCC821DF1CB2F0065C140 /* Assets.xcassets */,
195 | 9C4FCC841DF1CB2F0065C140 /* LaunchScreen.storyboard */,
196 | 9C4FCC871DF1CB2F0065C140 /* Info.plist */,
197 | 9C4FCC761DF1CB2E0065C140 /* Supporting Files */,
198 | );
199 | path = "objective-c";
200 | sourceTree = "";
201 | };
202 | 9C4FCC761DF1CB2E0065C140 /* Supporting Files */ = {
203 | isa = PBXGroup;
204 | children = (
205 | 9C4FCC771DF1CB2E0065C140 /* main.m */,
206 | );
207 | name = "Supporting Files";
208 | sourceTree = "";
209 | };
210 | 9C4FCC8B1DF1CC150065C140 /* Backgrounds */ = {
211 | isa = PBXGroup;
212 | children = (
213 | 9C4FCC8C1DF1CC150065C140 /* Clouds1.xib */,
214 | 9C4FCC8D1DF1CC150065C140 /* Clouds2.xib */,
215 | 9C4FCC8F1DF1CC150065C140 /* Land.xib */,
216 | );
217 | path = Backgrounds;
218 | sourceTree = "";
219 | };
220 | 9C4FCCA71DF1CE9A0065C140 /* swift */ = {
221 | isa = PBXGroup;
222 | children = (
223 | 9C4FCCC11DF1D0A40065C140 /* Backgrounds */,
224 | 9C4FCCA81DF1CE9A0065C140 /* AppDelegate.swift */,
225 | 9C4FCCB81DF1CED10065C140 /* MXHorizontalViewController.swift */,
226 | 9C4FCCB91DF1CED10065C140 /* MXVerticalViewController.swift */,
227 | 9C4FCCAC1DF1CE9A0065C140 /* Main.storyboard */,
228 | 9C4FCCAF1DF1CE9A0065C140 /* Assets.xcassets */,
229 | 9C4FCCB11DF1CE9A0065C140 /* LaunchScreen.storyboard */,
230 | 9C4FCCB41DF1CE9A0065C140 /* Info.plist */,
231 | );
232 | path = swift;
233 | sourceTree = "";
234 | };
235 | 9C4FCCC11DF1D0A40065C140 /* Backgrounds */ = {
236 | isa = PBXGroup;
237 | children = (
238 | 9C4FCCC21DF1D0A40065C140 /* Clouds1.xib */,
239 | 9C4FCCC31DF1D0A40065C140 /* Clouds2.xib */,
240 | 9C4FCCC51DF1D0A40065C140 /* Land.xib */,
241 | );
242 | path = Backgrounds;
243 | sourceTree = "";
244 | };
245 | 9C4FCCCA1DF1D1D60065C140 /* Metadata */ = {
246 | isa = PBXGroup;
247 | children = (
248 | 9C4FCCCB1DF1D1EF0065C140 /* .travis.yml */,
249 | 9C4FCCCC1DF1D1EF0065C140 /* MXParallaxBackground.podspec */,
250 | 9C4FCCCD1DF1D1EF0065C140 /* README.md */,
251 | );
252 | name = Metadata;
253 | sourceTree = "";
254 | };
255 | 9C73FA4022FC75030021C818 /* Examples */ = {
256 | isa = PBXGroup;
257 | children = (
258 | 9C4FCC751DF1CB2E0065C140 /* objective-c */,
259 | 9C4FCCA71DF1CE9A0065C140 /* swift */,
260 | );
261 | path = Examples;
262 | sourceTree = "";
263 | };
264 | /* End PBXGroup section */
265 |
266 | /* Begin PBXHeadersBuildPhase section */
267 | 9C4FCC591DF1C9840065C140 /* Headers */ = {
268 | isa = PBXHeadersBuildPhase;
269 | buildActionMask = 2147483647;
270 | files = (
271 | 9C4FCC6D1DF1CA6A0065C140 /* MXParallaxBackground-umbrella.h in Headers */,
272 | 9C4FCC611DF1C9840065C140 /* MXParallaxBackground.h in Headers */,
273 | );
274 | runOnlyForDeploymentPostprocessing = 0;
275 | };
276 | /* End PBXHeadersBuildPhase section */
277 |
278 | /* Begin PBXNativeTarget section */
279 | 9C4FCC5B1DF1C9840065C140 /* MXParallaxBackground */ = {
280 | isa = PBXNativeTarget;
281 | buildConfigurationList = 9C4FCC641DF1C9840065C140 /* Build configuration list for PBXNativeTarget "MXParallaxBackground" */;
282 | buildPhases = (
283 | 9C4FCC571DF1C9840065C140 /* Sources */,
284 | 9C4FCC581DF1C9840065C140 /* Frameworks */,
285 | 9C4FCC591DF1C9840065C140 /* Headers */,
286 | 9C4FCC5A1DF1C9840065C140 /* Resources */,
287 | );
288 | buildRules = (
289 | );
290 | dependencies = (
291 | );
292 | name = MXParallaxBackground;
293 | productName = MXParallaxBackground;
294 | productReference = 9C4FCC5C1DF1C9840065C140 /* MXParallaxBackground.framework */;
295 | productType = "com.apple.product-type.framework";
296 | };
297 | 9C4FCC731DF1CB2E0065C140 /* MXParallaxBackground-objc */ = {
298 | isa = PBXNativeTarget;
299 | buildConfigurationList = 9C4FCC881DF1CB2F0065C140 /* Build configuration list for PBXNativeTarget "MXParallaxBackground-objc" */;
300 | buildPhases = (
301 | 9C4FCC701DF1CB2E0065C140 /* Sources */,
302 | 9C4FCC711DF1CB2E0065C140 /* Frameworks */,
303 | 9C4FCC721DF1CB2E0065C140 /* Resources */,
304 | 9C4FCCA11DF1CC3C0065C140 /* Embed Frameworks */,
305 | );
306 | buildRules = (
307 | );
308 | dependencies = (
309 | 9C4FCC9E1DF1CC370065C140 /* PBXTargetDependency */,
310 | );
311 | name = "MXParallaxBackground-objc";
312 | productName = "MXParallaxBackground-objc";
313 | productReference = 9C4FCC741DF1CB2E0065C140 /* MXParallaxBackground-objc.app */;
314 | productType = "com.apple.product-type.application";
315 | };
316 | 9C4FCCA51DF1CE9A0065C140 /* MXParallaxBackground-swift */ = {
317 | isa = PBXNativeTarget;
318 | buildConfigurationList = 9C4FCCB51DF1CE9A0065C140 /* Build configuration list for PBXNativeTarget "MXParallaxBackground-swift" */;
319 | buildPhases = (
320 | 9C4FCCA21DF1CE9A0065C140 /* Sources */,
321 | 9C4FCCA31DF1CE9A0065C140 /* Frameworks */,
322 | 9C4FCCA41DF1CE9A0065C140 /* Resources */,
323 | 9C4FCCC01DF1CF9D0065C140 /* Embed Frameworks */,
324 | );
325 | buildRules = (
326 | );
327 | dependencies = (
328 | 9C4FCCBD1DF1CF940065C140 /* PBXTargetDependency */,
329 | );
330 | name = "MXParallaxBackground-swift";
331 | productName = "MXParallaxBackground-swift";
332 | productReference = 9C4FCCA61DF1CE9A0065C140 /* MXParallaxBackground-swift.app */;
333 | productType = "com.apple.product-type.application";
334 | };
335 | /* End PBXNativeTarget section */
336 |
337 | /* Begin PBXProject section */
338 | 9C4FCC531DF1C9840065C140 /* Project object */ = {
339 | isa = PBXProject;
340 | attributes = {
341 | LastSwiftUpdateCheck = 0810;
342 | LastUpgradeCheck = 1030;
343 | ORGANIZATIONNAME = "Maxime Epain";
344 | TargetAttributes = {
345 | 9C4FCC5B1DF1C9840065C140 = {
346 | CreatedOnToolsVersion = 8.1;
347 | DevelopmentTeam = C75GEDTP26;
348 | ProvisioningStyle = Automatic;
349 | };
350 | 9C4FCC731DF1CB2E0065C140 = {
351 | CreatedOnToolsVersion = 8.1;
352 | };
353 | 9C4FCCA51DF1CE9A0065C140 = {
354 | CreatedOnToolsVersion = 8.1;
355 | LastSwiftMigration = 0900;
356 | };
357 | };
358 | };
359 | buildConfigurationList = 9C4FCC561DF1C9840065C140 /* Build configuration list for PBXProject "MXParallaxBackground" */;
360 | compatibilityVersion = "Xcode 3.2";
361 | developmentRegion = en;
362 | hasScannedForEncodings = 0;
363 | knownRegions = (
364 | en,
365 | Base,
366 | );
367 | mainGroup = 9C4FCC521DF1C9840065C140;
368 | productRefGroup = 9C4FCC5D1DF1C9840065C140 /* Products */;
369 | projectDirPath = "";
370 | projectRoot = "";
371 | targets = (
372 | 9C4FCC5B1DF1C9840065C140 /* MXParallaxBackground */,
373 | 9C4FCC731DF1CB2E0065C140 /* MXParallaxBackground-objc */,
374 | 9C4FCCA51DF1CE9A0065C140 /* MXParallaxBackground-swift */,
375 | );
376 | };
377 | /* End PBXProject section */
378 |
379 | /* Begin PBXResourcesBuildPhase section */
380 | 9C4FCC5A1DF1C9840065C140 /* Resources */ = {
381 | isa = PBXResourcesBuildPhase;
382 | buildActionMask = 2147483647;
383 | files = (
384 | );
385 | runOnlyForDeploymentPostprocessing = 0;
386 | };
387 | 9C4FCC721DF1CB2E0065C140 /* Resources */ = {
388 | isa = PBXResourcesBuildPhase;
389 | buildActionMask = 2147483647;
390 | files = (
391 | 9C4FCC861DF1CB2F0065C140 /* LaunchScreen.storyboard in Resources */,
392 | 9C4FCC831DF1CB2F0065C140 /* Assets.xcassets in Resources */,
393 | 9C4FCC991DF1CC150065C140 /* Land.xib in Resources */,
394 | 9C4FCC811DF1CB2F0065C140 /* Main.storyboard in Resources */,
395 | 9C4FCC971DF1CC150065C140 /* Clouds2.xib in Resources */,
396 | 9C4FCC961DF1CC150065C140 /* Clouds1.xib in Resources */,
397 | );
398 | runOnlyForDeploymentPostprocessing = 0;
399 | };
400 | 9C4FCCA41DF1CE9A0065C140 /* Resources */ = {
401 | isa = PBXResourcesBuildPhase;
402 | buildActionMask = 2147483647;
403 | files = (
404 | 9C4FCCB31DF1CE9A0065C140 /* LaunchScreen.storyboard in Resources */,
405 | 9C4FCCB01DF1CE9A0065C140 /* Assets.xcassets in Resources */,
406 | 9C4FCCC91DF1D0A40065C140 /* Land.xib in Resources */,
407 | 9C4FCCAE1DF1CE9A0065C140 /* Main.storyboard in Resources */,
408 | 9C4FCCC71DF1D0A40065C140 /* Clouds2.xib in Resources */,
409 | 9C4FCCC61DF1D0A40065C140 /* Clouds1.xib in Resources */,
410 | );
411 | runOnlyForDeploymentPostprocessing = 0;
412 | };
413 | /* End PBXResourcesBuildPhase section */
414 |
415 | /* Begin PBXSourcesBuildPhase section */
416 | 9C4FCC571DF1C9840065C140 /* Sources */ = {
417 | isa = PBXSourcesBuildPhase;
418 | buildActionMask = 2147483647;
419 | files = (
420 | 9C4FCC6F1DF1CAB40065C140 /* MXParallaxBackground.m in Sources */,
421 | );
422 | runOnlyForDeploymentPostprocessing = 0;
423 | };
424 | 9C4FCC701DF1CB2E0065C140 /* Sources */ = {
425 | isa = PBXSourcesBuildPhase;
426 | buildActionMask = 2147483647;
427 | files = (
428 | 9C4FCC781DF1CB2E0065C140 /* main.m in Sources */,
429 | 9C4FCC9A1DF1CC150065C140 /* MXAppDelegate.m in Sources */,
430 | 9C4FCC9B1DF1CC150065C140 /* MXHorizontalViewController.m in Sources */,
431 | 9C4FCC9C1DF1CC150065C140 /* MXVerticalViewController.m in Sources */,
432 | );
433 | runOnlyForDeploymentPostprocessing = 0;
434 | };
435 | 9C4FCCA21DF1CE9A0065C140 /* Sources */ = {
436 | isa = PBXSourcesBuildPhase;
437 | buildActionMask = 2147483647;
438 | files = (
439 | 9C4FCCBA1DF1CED10065C140 /* MXHorizontalViewController.swift in Sources */,
440 | 9C4FCCA91DF1CE9A0065C140 /* AppDelegate.swift in Sources */,
441 | 9C4FCCBB1DF1CED10065C140 /* MXVerticalViewController.swift in Sources */,
442 | );
443 | runOnlyForDeploymentPostprocessing = 0;
444 | };
445 | /* End PBXSourcesBuildPhase section */
446 |
447 | /* Begin PBXTargetDependency section */
448 | 9C4FCC9E1DF1CC370065C140 /* PBXTargetDependency */ = {
449 | isa = PBXTargetDependency;
450 | target = 9C4FCC5B1DF1C9840065C140 /* MXParallaxBackground */;
451 | targetProxy = 9C4FCC9D1DF1CC370065C140 /* PBXContainerItemProxy */;
452 | };
453 | 9C4FCCBD1DF1CF940065C140 /* PBXTargetDependency */ = {
454 | isa = PBXTargetDependency;
455 | target = 9C4FCC5B1DF1C9840065C140 /* MXParallaxBackground */;
456 | targetProxy = 9C4FCCBC1DF1CF940065C140 /* PBXContainerItemProxy */;
457 | };
458 | /* End PBXTargetDependency section */
459 |
460 | /* Begin PBXVariantGroup section */
461 | 9C4FCC7F1DF1CB2F0065C140 /* Main.storyboard */ = {
462 | isa = PBXVariantGroup;
463 | children = (
464 | 9C4FCC801DF1CB2F0065C140 /* Base */,
465 | );
466 | name = Main.storyboard;
467 | sourceTree = "";
468 | };
469 | 9C4FCC841DF1CB2F0065C140 /* LaunchScreen.storyboard */ = {
470 | isa = PBXVariantGroup;
471 | children = (
472 | 9C4FCC851DF1CB2F0065C140 /* Base */,
473 | );
474 | name = LaunchScreen.storyboard;
475 | sourceTree = "";
476 | };
477 | 9C4FCCAC1DF1CE9A0065C140 /* Main.storyboard */ = {
478 | isa = PBXVariantGroup;
479 | children = (
480 | 9C4FCCAD1DF1CE9A0065C140 /* Base */,
481 | );
482 | name = Main.storyboard;
483 | sourceTree = "";
484 | };
485 | 9C4FCCB11DF1CE9A0065C140 /* LaunchScreen.storyboard */ = {
486 | isa = PBXVariantGroup;
487 | children = (
488 | 9C4FCCB21DF1CE9A0065C140 /* Base */,
489 | );
490 | name = LaunchScreen.storyboard;
491 | sourceTree = "";
492 | };
493 | /* End PBXVariantGroup section */
494 |
495 | /* Begin XCBuildConfiguration section */
496 | 9C4FCC621DF1C9840065C140 /* Debug */ = {
497 | isa = XCBuildConfiguration;
498 | buildSettings = {
499 | ALWAYS_SEARCH_USER_PATHS = NO;
500 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
501 | CLANG_ANALYZER_NONNULL = YES;
502 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
503 | CLANG_CXX_LIBRARY = "libc++";
504 | CLANG_ENABLE_MODULES = YES;
505 | CLANG_ENABLE_OBJC_ARC = YES;
506 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
507 | CLANG_WARN_BOOL_CONVERSION = YES;
508 | CLANG_WARN_COMMA = YES;
509 | CLANG_WARN_CONSTANT_CONVERSION = YES;
510 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
511 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
512 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
513 | CLANG_WARN_EMPTY_BODY = YES;
514 | CLANG_WARN_ENUM_CONVERSION = YES;
515 | CLANG_WARN_INFINITE_RECURSION = YES;
516 | CLANG_WARN_INT_CONVERSION = YES;
517 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
518 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
519 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
520 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
521 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
522 | CLANG_WARN_STRICT_PROTOTYPES = YES;
523 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
524 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
525 | CLANG_WARN_UNREACHABLE_CODE = YES;
526 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
527 | COPY_PHASE_STRIP = NO;
528 | CURRENT_PROJECT_VERSION = 1;
529 | DEBUG_INFORMATION_FORMAT = dwarf;
530 | ENABLE_STRICT_OBJC_MSGSEND = YES;
531 | ENABLE_TESTABILITY = YES;
532 | GCC_C_LANGUAGE_STANDARD = gnu99;
533 | GCC_DYNAMIC_NO_PIC = NO;
534 | GCC_NO_COMMON_BLOCKS = YES;
535 | GCC_OPTIMIZATION_LEVEL = 0;
536 | GCC_PREPROCESSOR_DEFINITIONS = (
537 | "DEBUG=1",
538 | "$(inherited)",
539 | );
540 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
541 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
542 | GCC_WARN_UNDECLARED_SELECTOR = YES;
543 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
544 | GCC_WARN_UNUSED_FUNCTION = YES;
545 | GCC_WARN_UNUSED_VARIABLE = YES;
546 | IPHONEOS_DEPLOYMENT_TARGET = 10.1;
547 | MTL_ENABLE_DEBUG_INFO = YES;
548 | ONLY_ACTIVE_ARCH = YES;
549 | SDKROOT = iphoneos;
550 | TARGETED_DEVICE_FAMILY = "1,2";
551 | VERSIONING_SYSTEM = "apple-generic";
552 | VERSION_INFO_PREFIX = "";
553 | };
554 | name = Debug;
555 | };
556 | 9C4FCC631DF1C9840065C140 /* Release */ = {
557 | isa = XCBuildConfiguration;
558 | buildSettings = {
559 | ALWAYS_SEARCH_USER_PATHS = NO;
560 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
561 | CLANG_ANALYZER_NONNULL = YES;
562 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
563 | CLANG_CXX_LIBRARY = "libc++";
564 | CLANG_ENABLE_MODULES = YES;
565 | CLANG_ENABLE_OBJC_ARC = YES;
566 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
567 | CLANG_WARN_BOOL_CONVERSION = YES;
568 | CLANG_WARN_COMMA = YES;
569 | CLANG_WARN_CONSTANT_CONVERSION = YES;
570 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
571 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
572 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
573 | CLANG_WARN_EMPTY_BODY = YES;
574 | CLANG_WARN_ENUM_CONVERSION = YES;
575 | CLANG_WARN_INFINITE_RECURSION = YES;
576 | CLANG_WARN_INT_CONVERSION = YES;
577 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
578 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
579 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
580 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
581 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
582 | CLANG_WARN_STRICT_PROTOTYPES = YES;
583 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
584 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
585 | CLANG_WARN_UNREACHABLE_CODE = YES;
586 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
587 | COPY_PHASE_STRIP = NO;
588 | CURRENT_PROJECT_VERSION = 1;
589 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
590 | ENABLE_NS_ASSERTIONS = NO;
591 | ENABLE_STRICT_OBJC_MSGSEND = YES;
592 | GCC_C_LANGUAGE_STANDARD = gnu99;
593 | GCC_NO_COMMON_BLOCKS = YES;
594 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
595 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
596 | GCC_WARN_UNDECLARED_SELECTOR = YES;
597 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
598 | GCC_WARN_UNUSED_FUNCTION = YES;
599 | GCC_WARN_UNUSED_VARIABLE = YES;
600 | IPHONEOS_DEPLOYMENT_TARGET = 10.1;
601 | MTL_ENABLE_DEBUG_INFO = NO;
602 | SDKROOT = iphoneos;
603 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
604 | TARGETED_DEVICE_FAMILY = "1,2";
605 | VALIDATE_PRODUCT = YES;
606 | VERSIONING_SYSTEM = "apple-generic";
607 | VERSION_INFO_PREFIX = "";
608 | };
609 | name = Release;
610 | };
611 | 9C4FCC651DF1C9840065C140 /* Debug */ = {
612 | isa = XCBuildConfiguration;
613 | buildSettings = {
614 | CODE_SIGN_IDENTITY = "";
615 | DEFINES_MODULE = YES;
616 | DEVELOPMENT_TEAM = C75GEDTP26;
617 | DYLIB_COMPATIBILITY_VERSION = 1;
618 | DYLIB_CURRENT_VERSION = 1;
619 | DYLIB_INSTALL_NAME_BASE = "@rpath";
620 | INFOPLIST_FILE = "$(SRCROOT)/Framework/Info.plist";
621 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
622 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
623 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
624 | MODULEMAP_FILE = Framework/module.modulemap;
625 | PRODUCT_BUNDLE_IDENTIFIER = com.maxep.MXParallaxBackground;
626 | PRODUCT_NAME = "$(TARGET_NAME)";
627 | SKIP_INSTALL = YES;
628 | };
629 | name = Debug;
630 | };
631 | 9C4FCC661DF1C9840065C140 /* Release */ = {
632 | isa = XCBuildConfiguration;
633 | buildSettings = {
634 | CODE_SIGN_IDENTITY = "";
635 | DEFINES_MODULE = YES;
636 | DEVELOPMENT_TEAM = C75GEDTP26;
637 | DYLIB_COMPATIBILITY_VERSION = 1;
638 | DYLIB_CURRENT_VERSION = 1;
639 | DYLIB_INSTALL_NAME_BASE = "@rpath";
640 | INFOPLIST_FILE = "$(SRCROOT)/Framework/Info.plist";
641 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
642 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
643 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
644 | MODULEMAP_FILE = Framework/module.modulemap;
645 | PRODUCT_BUNDLE_IDENTIFIER = com.maxep.MXParallaxBackground;
646 | PRODUCT_NAME = "$(TARGET_NAME)";
647 | SKIP_INSTALL = YES;
648 | };
649 | name = Release;
650 | };
651 | 9C4FCC891DF1CB2F0065C140 /* Debug */ = {
652 | isa = XCBuildConfiguration;
653 | buildSettings = {
654 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
655 | INFOPLIST_FILE = "$(SRCROOT)/Examples/objective-c/Info.plist";
656 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
657 | PRODUCT_BUNDLE_IDENTIFIER = "com.maxep.MXParallaxBackground-objc";
658 | PRODUCT_NAME = "$(TARGET_NAME)";
659 | };
660 | name = Debug;
661 | };
662 | 9C4FCC8A1DF1CB2F0065C140 /* Release */ = {
663 | isa = XCBuildConfiguration;
664 | buildSettings = {
665 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
666 | INFOPLIST_FILE = "$(SRCROOT)/Examples/objective-c/Info.plist";
667 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
668 | PRODUCT_BUNDLE_IDENTIFIER = "com.maxep.MXParallaxBackground-objc";
669 | PRODUCT_NAME = "$(TARGET_NAME)";
670 | };
671 | name = Release;
672 | };
673 | 9C4FCCB61DF1CE9A0065C140 /* Debug */ = {
674 | isa = XCBuildConfiguration;
675 | buildSettings = {
676 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
677 | INFOPLIST_FILE = "$(SRCROOT)/Examples/swift/Info.plist";
678 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
679 | PRODUCT_BUNDLE_IDENTIFIER = "com.maxep.MXParallaxBackground-swift";
680 | PRODUCT_NAME = "$(TARGET_NAME)";
681 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
682 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
683 | SWIFT_VERSION = 4.0;
684 | };
685 | name = Debug;
686 | };
687 | 9C4FCCB71DF1CE9A0065C140 /* Release */ = {
688 | isa = XCBuildConfiguration;
689 | buildSettings = {
690 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
691 | INFOPLIST_FILE = "$(SRCROOT)/Examples/swift/Info.plist";
692 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
693 | PRODUCT_BUNDLE_IDENTIFIER = "com.maxep.MXParallaxBackground-swift";
694 | PRODUCT_NAME = "$(TARGET_NAME)";
695 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
696 | SWIFT_VERSION = 4.0;
697 | };
698 | name = Release;
699 | };
700 | /* End XCBuildConfiguration section */
701 |
702 | /* Begin XCConfigurationList section */
703 | 9C4FCC561DF1C9840065C140 /* Build configuration list for PBXProject "MXParallaxBackground" */ = {
704 | isa = XCConfigurationList;
705 | buildConfigurations = (
706 | 9C4FCC621DF1C9840065C140 /* Debug */,
707 | 9C4FCC631DF1C9840065C140 /* Release */,
708 | );
709 | defaultConfigurationIsVisible = 0;
710 | defaultConfigurationName = Release;
711 | };
712 | 9C4FCC641DF1C9840065C140 /* Build configuration list for PBXNativeTarget "MXParallaxBackground" */ = {
713 | isa = XCConfigurationList;
714 | buildConfigurations = (
715 | 9C4FCC651DF1C9840065C140 /* Debug */,
716 | 9C4FCC661DF1C9840065C140 /* Release */,
717 | );
718 | defaultConfigurationIsVisible = 0;
719 | defaultConfigurationName = Release;
720 | };
721 | 9C4FCC881DF1CB2F0065C140 /* Build configuration list for PBXNativeTarget "MXParallaxBackground-objc" */ = {
722 | isa = XCConfigurationList;
723 | buildConfigurations = (
724 | 9C4FCC891DF1CB2F0065C140 /* Debug */,
725 | 9C4FCC8A1DF1CB2F0065C140 /* Release */,
726 | );
727 | defaultConfigurationIsVisible = 0;
728 | defaultConfigurationName = Release;
729 | };
730 | 9C4FCCB51DF1CE9A0065C140 /* Build configuration list for PBXNativeTarget "MXParallaxBackground-swift" */ = {
731 | isa = XCConfigurationList;
732 | buildConfigurations = (
733 | 9C4FCCB61DF1CE9A0065C140 /* Debug */,
734 | 9C4FCCB71DF1CE9A0065C140 /* Release */,
735 | );
736 | defaultConfigurationIsVisible = 0;
737 | defaultConfigurationName = Release;
738 | };
739 | /* End XCConfigurationList section */
740 | };
741 | rootObject = 9C4FCC531DF1C9840065C140 /* Project object */;
742 | }
743 |
--------------------------------------------------------------------------------
/MXParallaxBackground.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MXParallaxBackground.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/MXParallaxBackground.xcodeproj/xcshareddata/xcschemes/MXParallaxBackground.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/MXParallaxBackground/MXParallaxBackground.h:
--------------------------------------------------------------------------------
1 | // MXParallaxBackground.h
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | NS_ASSUME_NONNULL_BEGIN
26 |
27 | /**
28 | The MXParallaxBackground class represents a parallax background for UIScrollView.
29 | */
30 | @interface MXParallaxBackground : NSObject
31 |
32 | /**
33 | The parent scroll-view.
34 | */
35 | @property (nonatomic,readonly,nullable) UIScrollView *parentview;
36 |
37 | /**
38 | The background view.
39 | */
40 | @property (nonatomic,strong,nullable) UIView *view;
41 |
42 | /**
43 | The parallax effect intensity. [0-1], 0.5 by default.
44 | */
45 | @property (nonatomic) CGFloat intensity;
46 |
47 | /**
48 | Reverse the parallax effect.
49 | */
50 | @property (nonatomic,getter=isReverse) BOOL reverse;
51 |
52 | /**
53 | Remove the background from the super view.
54 | */
55 | - (void)removeFromSuperview;
56 |
57 | @end
58 |
59 | /**
60 | A UIScrollView category with a MXParallaxBackground stack.
61 | */
62 | @interface UIScrollView (MXParallaxBackground)
63 |
64 | /**
65 | The background array.
66 | */
67 | @property(nonatomic, readonly, copy) NSArray *backgrounds;
68 |
69 | /**
70 | Adds a background on top of others backgrounds.
71 |
72 | @param background The background to add.
73 | */
74 | - (void)addBackground:(MXParallaxBackground *)background NS_SWIFT_NAME(add(background:));
75 |
76 | /**
77 | Inserts a background at a specific index.
78 |
79 | @param background The background to insert.
80 | @param index The index of the background in the view stack.
81 | */
82 | - (void)insertBackground:(MXParallaxBackground *)background atIndex:(NSInteger)index NS_SWIFT_NAME(insert(background:at:));
83 |
84 | /**
85 | Inserts a background below a sibling background.
86 |
87 | @param background The background to insert.
88 | @param siblingBackground The sibling background.
89 | */
90 | - (void)insertBackground:(MXParallaxBackground *)background belowBackground:(MXParallaxBackground *)siblingBackground NS_SWIFT_NAME(insert(background:below:));
91 |
92 | /**
93 | Inserts a background above a sibling background.
94 |
95 | @param background The background to insert.
96 | @param siblingBackground The sibling background.
97 | */
98 | - (void)insertBackground:(MXParallaxBackground *)background aboveBackground:(MXParallaxBackground *)siblingBackground NS_SWIFT_NAME(insert(background:above:));
99 |
100 | /**
101 | Inserts a background below a sibling view.
102 |
103 | @param background The background to insert.
104 | @param siblingSubview The sibling background view.
105 | */
106 | - (void)insertBackground:(MXParallaxBackground *)background belowSubview:(UIView *)siblingSubview NS_SWIFT_NAME(insert(background:belowSubview:));
107 |
108 | /**
109 | Inserts a background above a sibling view.
110 |
111 | @param background The background to insert.
112 | @param siblingSubview The sibling background view.
113 | */
114 | - (void)insertBackground:(MXParallaxBackground *)background aboveSubview:(UIView *)siblingSubview NS_SWIFT_NAME(insert(background:aboveSubview:));
115 |
116 | /**
117 | Brings the background to the front of the subview stack.
118 |
119 | @param background The background to bring back.
120 | */
121 | - (void)bringBackgroundToFront:(MXParallaxBackground *)background;
122 |
123 | /**
124 | Sends the background to the back of the subview stack.
125 |
126 | @param background The background to send back.
127 | */
128 | - (void)sendBackgroundToBack:(MXParallaxBackground *)background;
129 |
130 | @end
131 |
132 | NS_ASSUME_NONNULL_END
133 |
--------------------------------------------------------------------------------
/MXParallaxBackground/MXParallaxBackground.m:
--------------------------------------------------------------------------------
1 | // MXParallaxBackground.m
2 | //
3 | // Copyright (c) 2019 Maxime Epain
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #import
24 | #import "MXParallaxBackground.h"
25 |
26 | CGFloat MXInterval(CGFloat value, CGFloat min, CGFloat max) {
27 | if (value < min)
28 | return min;
29 | else if (value > max)
30 | return max;
31 | return value;
32 | }
33 |
34 | @interface UIScrollView ()
35 | @property (nonatomic,strong,readonly) NSMutableArray *stack;
36 | @end
37 |
38 | @interface MXBackgroundView : UIScrollView
39 | @property (nonatomic,weak) MXParallaxBackground *parent;
40 | @end
41 |
42 | @implementation MXBackgroundView
43 |
44 | static void * const kMXParallaxBackgroundKVOContext = (void*)&kMXParallaxBackgroundKVOContext;
45 |
46 | - (void)willMoveToSuperview:(UIView *)newSuperview {
47 | [self.superview removeObserver:self.parent
48 | forKeyPath:NSStringFromSelector(@selector(contentOffset))
49 | context:kMXParallaxBackgroundKVOContext];
50 | }
51 |
52 | - (void)didMoveToSuperview {
53 | [self.superview addObserver:self.parent
54 | forKeyPath:NSStringFromSelector(@selector(contentOffset))
55 | options:NSKeyValueObservingOptionNew
56 | context:kMXParallaxBackgroundKVOContext];
57 | }
58 |
59 | @end
60 |
61 | @interface MXParallaxBackground ()
62 | @property (nonatomic,weak) UIScrollView *scrollView;
63 | @property (nonatomic,strong) MXBackgroundView *backgroundView;
64 | @end
65 |
66 | @implementation MXParallaxBackground
67 |
68 | - (instancetype)init {
69 | if (self = [super init]) {
70 | self.intensity = .5;
71 | }
72 | return self;
73 | }
74 |
75 | - (void)removeFromSuperview {
76 | [self.backgroundView removeFromSuperview];
77 | [self.scrollView.stack removeObject:self];
78 | self.scrollView = nil;
79 | }
80 |
81 | - (void)layoutBackground {
82 |
83 | CGRect frame = self.scrollView.frame;
84 | //Vector between scroll view's frame size and content size
85 | CGVector v1 = CGVectorMake(self.scrollView.contentSize.width - frame.size.width, self.scrollView.contentSize.height - frame.size.height);
86 | //Size of the view
87 | CGSize size = CGSizeMake(v1.dx * self.intensity + frame.size.width, v1.dy * self.intensity + frame.size.height);
88 |
89 | //Layout background view always visible
90 | frame.origin = CGPointMake(self.scrollView.contentOffset.x, self.scrollView.contentOffset.y);
91 | self.backgroundView.frame = frame;
92 | self.backgroundView.contentSize = size;
93 |
94 | //Layout view
95 | frame.origin = CGPointZero;
96 | frame.size = size;
97 | self.view.frame = frame;
98 |
99 | //Vector between background view's frame size and content size
100 | CGVector v2 = CGVectorMake((size.width - self.scrollView.frame.size.width), (size.height - self.scrollView.frame.size.height));
101 |
102 | //Compute background's content offset
103 | CGFloat x = v2.dx * self.scrollView.contentOffset.x / (v1.dx?: 1);
104 | CGFloat y = v2.dy * self.scrollView.contentOffset.y / (v1.dy?: 1);
105 |
106 | //Reverse content offset
107 | if (self.isReverse) {
108 | x = v2.dx - x;
109 | y = v2.dy - y;
110 | }
111 |
112 | //No bouncing
113 | x = MXInterval(x, 0, v2.dx);
114 | y = MXInterval(y, 0, v2.dy);
115 |
116 | self.backgroundView.contentOffset = CGPointMake(x, y);
117 | }
118 |
119 | #pragma mark Properties
120 |
121 | - (MXBackgroundView *)backgroundView {
122 | if (!_backgroundView) {
123 | _backgroundView = [MXBackgroundView new];
124 | _backgroundView.parent = self;
125 | _backgroundView.bounces = NO;
126 | _backgroundView.userInteractionEnabled = NO;
127 | }
128 | return _backgroundView;
129 | }
130 |
131 | - (void)setScrollView:(UIScrollView *)scrollView {
132 | _scrollView = scrollView;
133 | [self layoutBackground];
134 | }
135 |
136 | - (UIScrollView *)parentview {
137 | return self.scrollView;
138 | }
139 |
140 | - (void)setView:(UIView *)view {
141 | if (view != _view) {
142 | [_view removeFromSuperview];
143 | [self.backgroundView addSubview:view];
144 | _view = view;
145 |
146 | [self layoutBackground];
147 | }
148 | }
149 |
150 | - (void)setIntensity:(CGFloat)intensity {
151 | _intensity = MXInterval(intensity, 0, 1);
152 | [self layoutBackground];
153 | }
154 |
155 | - (void)setReverse:(BOOL)reverse {
156 | _reverse = reverse;
157 | [self layoutBackground];
158 | }
159 |
160 | #pragma mark KVO
161 |
162 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
163 |
164 | if (context == kMXParallaxBackgroundKVOContext) {
165 |
166 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(contentOffset))]) {
167 | [self layoutBackground];
168 | }
169 | } else {
170 | [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
171 | }
172 | }
173 |
174 | @end
175 |
176 | @implementation UIScrollView (MXParallaxBackground)
177 |
178 | - (NSMutableArray *)stack {
179 | NSMutableArray *stack = objc_getAssociatedObject(self, @selector(stack));
180 | if (!stack) {
181 | stack = [NSMutableArray new];
182 | objc_setAssociatedObject(self, @selector(stack), stack, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
183 | }
184 | return stack;
185 | }
186 |
187 | - (NSArray *)backgrounds {
188 | return self.stack.copy;
189 | }
190 |
191 | - (void)addBackgroundToStack:(MXParallaxBackground *)background {
192 | background.scrollView = self;
193 |
194 | if ([self.stack containsObject:background]) {
195 | [self.stack removeObject:background];
196 | }
197 |
198 | NSInteger index = MXInterval([self.subviews indexOfObject:background.backgroundView], 0, self.stack.count);
199 | [self.stack insertObject:background atIndex:index];
200 | }
201 |
202 | - (void)insertBackground:(MXParallaxBackground *)background atIndex:(NSInteger)index {
203 | [self insertSubview:background.backgroundView atIndex:index];
204 | [self addBackgroundToStack:background];
205 | }
206 |
207 | - (void)addBackground:(MXParallaxBackground *)background {
208 | [self insertBackground:background atIndex:self.stack.count];
209 | }
210 |
211 | - (void)insertBackground:(MXParallaxBackground *)background belowBackground:(MXParallaxBackground *)siblingBackground {
212 | [self insertSubview:background.backgroundView belowSubview:siblingBackground.backgroundView];
213 | [self addBackgroundToStack:background];
214 | }
215 |
216 | - (void)insertBackground:(MXParallaxBackground *)background aboveBackground:(MXParallaxBackground *)siblingBackground {
217 | [self insertSubview:background.backgroundView aboveSubview:siblingBackground.backgroundView];
218 | [self addBackgroundToStack:background];
219 | }
220 |
221 | - (void)insertBackground:(MXParallaxBackground *)background belowSubview:(UIView *)siblingSubview {
222 | [self insertSubview:background.backgroundView aboveSubview:siblingSubview];
223 | [self addBackgroundToStack:background];
224 | }
225 |
226 | - (void)insertBackground:(MXParallaxBackground *)background aboveSubview:(UIView *)siblingSubview {
227 | [self insertSubview:background.backgroundView aboveSubview:siblingSubview];
228 | [self addBackgroundToStack:background];
229 | }
230 |
231 | - (void)bringBackgroundToFront:(MXParallaxBackground *)background {
232 | [self bringSubviewToFront:background.backgroundView];
233 | }
234 |
235 | - (void)sendBackgroundToBack:(MXParallaxBackground *)background {
236 | [self sendSubviewToBack:background.backgroundView];
237 | }
238 |
239 | @end
240 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MXParallaxBackground
2 |
3 | [](https://travis-ci.org/maxep/MXParallaxBackground)
4 | [](http://cocoapods.org/pods/MXParallaxBackground)
5 | [](https://github.com/Carthage/Carthage)
6 | [](http://cocoapods.org/pods/MXParallaxBackground)
7 | [](http://cocoapods.org/pods/MXParallaxBackground)
8 |
9 | MXParallaxBackground is a simple background class for UIScrolView.
10 |
11 | | Horizontal | Vertical |
12 | |-------------------------------|-----------------------------|
13 | |||
14 |
15 | ## Usage
16 |
17 | If you want to try it, simply run:
18 |
19 | ```
20 | pod try MXParallaxBackground
21 | ```
22 |
23 | Or clone the repo and run `pod install` from the Example directory first.
24 |
25 | + Adding a parallax background to a UIScrollView is straightforward, e.g:
26 |
27 |
28 | Swift
29 |
30 | ```swift
31 | let imageView = UIImageView()
32 | imageView.contentMode = .scaleAspectFill
33 | imageView.image = UIImage(named: "Background")
34 |
35 | let background = MXParallaxBackground()
36 | background.view = imageView
37 | background.intensity = 0.75
38 |
39 | let scrollView = UIScrollView()
40 | scrollView.add(background)
41 | ```
42 |
43 |
44 |
45 | Objective-C
46 |
47 | ```objective-c
48 | UIImageView *imageView = [UIImageView new];
49 | imageView.contentMode = UIViewContentModeScaleAspectFill;
50 | imageView.image = [UIImage imageNamed:@"Background"];
51 |
52 | MXParallaxBackground *background = [MXParallaxBackground new];
53 | background.view = imageView;
54 | background.intensity = 0.75;
55 |
56 | UIScrollView *scrollView = [UIScrollView new];
57 | [scrollView addBackground:background];
58 | ```
59 |
60 |
61 | ## Installation
62 |
63 | MXParallaxBackground is available through [CocoaPods](http://cocoapods.org). To install
64 | it, simply add the following line to your Podfile:
65 |
66 | ```ruby
67 | pod "MXParallaxBackground"
68 | ```
69 |
70 | ## Author
71 |
72 | [Maxime Epain](http://maxep.github.io)
73 |
74 | [](https://twitter.com/MaximeEpain)
75 |
76 | ## Credits
77 |
78 | Images are taken from [this](http://jonathannicol.com/blog/2011/08/06/build-a-parallax-scrolling-website-interface-with-jquery-and-css/) tutorial made by [Jonathan Nicol](https://github.com/jnicol).
79 |
80 | ## License
81 |
82 | MXParallaxBackground is available under the MIT license. See the LICENSE file for more info.
83 |
--------------------------------------------------------------------------------