├── .gitignore ├── .travis.yml ├── Example ├── Ouroboros.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Ouroboros-Example.xcscheme ├── Ouroboros.xcworkspace │ └── contents.xcworkspacedata ├── Ouroboros │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── CardBG.imageset │ │ │ ├── CardBG@2x@.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Google.imageset │ │ │ ├── Contents.json │ │ │ └── Google@2x.png │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── instagram.imageset │ │ │ ├── Contents.json │ │ │ └── instagram@2x.png │ │ ├── linkedin.imageset │ │ │ ├── Contents.json │ │ │ └── linkedin@2x.png │ │ └── twitter.imageset │ │ │ ├── Contents.json │ │ │ └── twitter@2x.png │ ├── LaunchScreen.storyboard │ ├── OURAppDelegate.h │ ├── OURAppDelegate.m │ ├── OURViewController.h │ ├── OURViewController.m │ ├── Ouroboros-Info.plist │ ├── Ouroboros-Prefix.pch │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock ├── Pods │ ├── Headers │ │ └── Private │ │ │ └── Ouroboros │ │ │ ├── NSBKeyframeAnimationFunctions.h │ │ │ ├── Ouroboros.h │ │ │ ├── Scale.h │ │ │ ├── UIScrollView+Ouroboros.h │ │ │ ├── UIView+Measure.h │ │ │ └── UIView+Ouroboros.h │ ├── Local Podspecs │ │ └── Ouroboros.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Ouroboros.xcscheme │ └── Target Support Files │ │ ├── Ouroboros │ │ ├── Info.plist │ │ ├── Ouroboros-Private.xcconfig │ │ ├── Ouroboros-dummy.m │ │ ├── Ouroboros-prefix.pch │ │ ├── Ouroboros-umbrella.h │ │ ├── Ouroboros.modulemap │ │ └── Ouroboros.xcconfig │ │ ├── Pods-Ouroboros_Example │ │ ├── Info.plist │ │ ├── Pods-Ouroboros_Example-acknowledgements.markdown │ │ ├── Pods-Ouroboros_Example-acknowledgements.plist │ │ ├── Pods-Ouroboros_Example-dummy.m │ │ ├── Pods-Ouroboros_Example-frameworks.sh │ │ ├── Pods-Ouroboros_Example-resources.sh │ │ ├── Pods-Ouroboros_Example-umbrella.h │ │ ├── Pods-Ouroboros_Example.debug.xcconfig │ │ ├── Pods-Ouroboros_Example.modulemap │ │ └── Pods-Ouroboros_Example.release.xcconfig │ │ └── Pods-Ouroboros_Tests │ │ ├── Info.plist │ │ ├── Pods-Ouroboros_Tests-acknowledgements.markdown │ │ ├── Pods-Ouroboros_Tests-acknowledgements.plist │ │ ├── Pods-Ouroboros_Tests-dummy.m │ │ ├── Pods-Ouroboros_Tests-frameworks.sh │ │ ├── Pods-Ouroboros_Tests-resources.sh │ │ ├── Pods-Ouroboros_Tests-umbrella.h │ │ ├── Pods-Ouroboros_Tests.debug.xcconfig │ │ ├── Pods-Ouroboros_Tests.modulemap │ │ └── Pods-Ouroboros_Tests.release.xcconfig └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── Ouroboros.podspec ├── Ouroboros.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── Draveness.xcuserdatad │ └── xcschemes │ ├── Ouroboros.xcscheme │ └── xcschememanagement.plist ├── Ouroboros ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── Pod ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── NSBKeyframeAnimationFunctions.c │ ├── NSBKeyframeAnimationFunctions.h │ ├── Ouroboros.h │ ├── Ouroboros.m │ ├── Scale.h │ ├── Scale.m │ ├── UIScrollView+Ouroboros.h │ ├── UIScrollView+Ouroboros.m │ ├── UIView+Measure.h │ ├── UIView+Measure.m │ ├── UIView+Ouroboros.h │ └── UIView+Ouroboros.m ├── README.md ├── _Pods.xcodeproj └── demo.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | 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 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: 9 | # - gem install cocoapods # Since Travis is not always on latest version 10 | # - pod install --project-directory=Example 11 | install: 12 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 13 | script: 14 | # - set -o pipefail && xcodebuild test -workspace Example/Ouroboros.xcworkspace -scheme Ouroboros-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c 15 | - pod lib lint --quick 16 | -------------------------------------------------------------------------------- /Example/Ouroboros.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A57A564C65B4BA23BC81DA3 /* Pods_Ouroboros_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72E314357C0ECD2D8DD0CD8C /* Pods_Ouroboros_Tests.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 11 | 40DED6D4972A8EAEC768AE07 /* Pods_Ouroboros_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C725CB142B247E6BB8E8009 /* Pods_Ouroboros_Example.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 12 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 13 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 14 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 15 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 16 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 17 | 6003F59E195388D20070C39A /* OURAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* OURAppDelegate.m */; }; 18 | 6003F5A7195388D20070C39A /* OURViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* OURViewController.m */; }; 19 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 20 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 21 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 22 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 23 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 24 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 25 | 72C0F6371BE0E84200B12682 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 72C0F6361BE0E84200B12682 /* LaunchScreen.storyboard */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 6003F582195388D10070C39A /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 6003F589195388D20070C39A; 34 | remoteInfo = Ouroboros; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 003289B6A2C67F4B92BC6B8F /* Pods-Ouroboros_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Ouroboros_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example.debug.xcconfig"; sourceTree = ""; }; 40 | 0A0FEBD91B2F940E68C8B64B /* Ouroboros.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Ouroboros.podspec; path = ../Ouroboros.podspec; sourceTree = ""; }; 41 | 1D7D3183FBE7785EA9DA153E /* Pods-Ouroboros_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Ouroboros_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests.release.xcconfig"; sourceTree = ""; }; 42 | 2C725CB142B247E6BB8E8009 /* Pods_Ouroboros_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Ouroboros_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 58A6BC1B5680385FB3943DB3 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 44 | 6003F58A195388D20070C39A /* Ouroboros_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ouroboros_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 46 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 47 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 48 | 6003F595195388D20070C39A /* Ouroboros-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Ouroboros-Info.plist"; sourceTree = ""; }; 49 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 50 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 51 | 6003F59B195388D20070C39A /* Ouroboros-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Ouroboros-Prefix.pch"; sourceTree = ""; }; 52 | 6003F59C195388D20070C39A /* OURAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OURAppDelegate.h; sourceTree = ""; }; 53 | 6003F59D195388D20070C39A /* OURAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OURAppDelegate.m; sourceTree = ""; }; 54 | 6003F5A5195388D20070C39A /* OURViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OURViewController.h; sourceTree = ""; }; 55 | 6003F5A6195388D20070C39A /* OURViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OURViewController.m; sourceTree = ""; }; 56 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 57 | 6003F5AE195388D20070C39A /* Ouroboros_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Ouroboros_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 59 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 60 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 61 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 62 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 63 | 6CE86B211761331555B37341 /* Pods-Ouroboros_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Ouroboros_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests.debug.xcconfig"; sourceTree = ""; }; 64 | 72C0F6361BE0E84200B12682 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 65 | 72E314357C0ECD2D8DD0CD8C /* Pods_Ouroboros_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Ouroboros_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 8CFF3CBD6CEBEC8AB0CB8D0A /* Pods-Ouroboros_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Ouroboros_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example.release.xcconfig"; sourceTree = ""; }; 67 | 8EE22F6279228EC618B763D6 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 68 | /* End PBXFileReference section */ 69 | 70 | /* Begin PBXFrameworksBuildPhase section */ 71 | 6003F587195388D20070C39A /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 76 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 77 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 78 | 40DED6D4972A8EAEC768AE07 /* Pods_Ouroboros_Example.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | 6003F5AB195388D20070C39A /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 87 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 88 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 89 | 1A57A564C65B4BA23BC81DA3 /* Pods_Ouroboros_Tests.framework in Frameworks */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | /* End PBXFrameworksBuildPhase section */ 94 | 95 | /* Begin PBXGroup section */ 96 | 6003F581195388D10070C39A = { 97 | isa = PBXGroup; 98 | children = ( 99 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 100 | 6003F593195388D20070C39A /* Example for Ouroboros */, 101 | 6003F5B5195388D20070C39A /* Tests */, 102 | 6003F58C195388D20070C39A /* Frameworks */, 103 | 6003F58B195388D20070C39A /* Products */, 104 | C32C38B902780A7FB4604B8E /* Pods */, 105 | ); 106 | sourceTree = ""; 107 | }; 108 | 6003F58B195388D20070C39A /* Products */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 6003F58A195388D20070C39A /* Ouroboros_Example.app */, 112 | 6003F5AE195388D20070C39A /* Ouroboros_Tests.xctest */, 113 | ); 114 | name = Products; 115 | sourceTree = ""; 116 | }; 117 | 6003F58C195388D20070C39A /* Frameworks */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 6003F58D195388D20070C39A /* Foundation.framework */, 121 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 122 | 6003F591195388D20070C39A /* UIKit.framework */, 123 | 6003F5AF195388D20070C39A /* XCTest.framework */, 124 | 2C725CB142B247E6BB8E8009 /* Pods_Ouroboros_Example.framework */, 125 | 72E314357C0ECD2D8DD0CD8C /* Pods_Ouroboros_Tests.framework */, 126 | ); 127 | name = Frameworks; 128 | sourceTree = ""; 129 | }; 130 | 6003F593195388D20070C39A /* Example for Ouroboros */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 6003F59C195388D20070C39A /* OURAppDelegate.h */, 134 | 6003F59D195388D20070C39A /* OURAppDelegate.m */, 135 | 6003F5A5195388D20070C39A /* OURViewController.h */, 136 | 6003F5A6195388D20070C39A /* OURViewController.m */, 137 | 72C0F6361BE0E84200B12682 /* LaunchScreen.storyboard */, 138 | 6003F5A8195388D20070C39A /* Images.xcassets */, 139 | 6003F594195388D20070C39A /* Supporting Files */, 140 | ); 141 | name = "Example for Ouroboros"; 142 | path = Ouroboros; 143 | sourceTree = ""; 144 | }; 145 | 6003F594195388D20070C39A /* Supporting Files */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 6003F595195388D20070C39A /* Ouroboros-Info.plist */, 149 | 6003F596195388D20070C39A /* InfoPlist.strings */, 150 | 6003F599195388D20070C39A /* main.m */, 151 | 6003F59B195388D20070C39A /* Ouroboros-Prefix.pch */, 152 | ); 153 | name = "Supporting Files"; 154 | sourceTree = ""; 155 | }; 156 | 6003F5B5195388D20070C39A /* Tests */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 6003F5BB195388D20070C39A /* Tests.m */, 160 | 6003F5B6195388D20070C39A /* Supporting Files */, 161 | ); 162 | path = Tests; 163 | sourceTree = ""; 164 | }; 165 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 169 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 170 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 171 | ); 172 | name = "Supporting Files"; 173 | sourceTree = ""; 174 | }; 175 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 0A0FEBD91B2F940E68C8B64B /* Ouroboros.podspec */, 179 | 58A6BC1B5680385FB3943DB3 /* README.md */, 180 | 8EE22F6279228EC618B763D6 /* LICENSE */, 181 | ); 182 | name = "Podspec Metadata"; 183 | sourceTree = ""; 184 | }; 185 | C32C38B902780A7FB4604B8E /* Pods */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 003289B6A2C67F4B92BC6B8F /* Pods-Ouroboros_Example.debug.xcconfig */, 189 | 8CFF3CBD6CEBEC8AB0CB8D0A /* Pods-Ouroboros_Example.release.xcconfig */, 190 | 6CE86B211761331555B37341 /* Pods-Ouroboros_Tests.debug.xcconfig */, 191 | 1D7D3183FBE7785EA9DA153E /* Pods-Ouroboros_Tests.release.xcconfig */, 192 | ); 193 | name = Pods; 194 | sourceTree = ""; 195 | }; 196 | /* End PBXGroup section */ 197 | 198 | /* Begin PBXNativeTarget section */ 199 | 6003F589195388D20070C39A /* Ouroboros_Example */ = { 200 | isa = PBXNativeTarget; 201 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "Ouroboros_Example" */; 202 | buildPhases = ( 203 | 1385C99BBB992FA1E2118925 /* Check Pods Manifest.lock */, 204 | 6003F586195388D20070C39A /* Sources */, 205 | 6003F587195388D20070C39A /* Frameworks */, 206 | 6003F588195388D20070C39A /* Resources */, 207 | 3FF331F8DBCACE77465A0D80 /* Embed Pods Frameworks */, 208 | 94397DCAC731DB04C6E93704 /* Copy Pods Resources */, 209 | ); 210 | buildRules = ( 211 | ); 212 | dependencies = ( 213 | ); 214 | name = Ouroboros_Example; 215 | productName = Ouroboros; 216 | productReference = 6003F58A195388D20070C39A /* Ouroboros_Example.app */; 217 | productType = "com.apple.product-type.application"; 218 | }; 219 | 6003F5AD195388D20070C39A /* Ouroboros_Tests */ = { 220 | isa = PBXNativeTarget; 221 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Ouroboros_Tests" */; 222 | buildPhases = ( 223 | 208CAA4B7C207845D7615097 /* Check Pods Manifest.lock */, 224 | 6003F5AA195388D20070C39A /* Sources */, 225 | 6003F5AB195388D20070C39A /* Frameworks */, 226 | 6003F5AC195388D20070C39A /* Resources */, 227 | 72D6F1E9AFC2DB5B84C7BA3C /* Embed Pods Frameworks */, 228 | AFE0881DA0441A724417EC87 /* Copy Pods Resources */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 234 | ); 235 | name = Ouroboros_Tests; 236 | productName = OuroborosTests; 237 | productReference = 6003F5AE195388D20070C39A /* Ouroboros_Tests.xctest */; 238 | productType = "com.apple.product-type.bundle.unit-test"; 239 | }; 240 | /* End PBXNativeTarget section */ 241 | 242 | /* Begin PBXProject section */ 243 | 6003F582195388D10070C39A /* Project object */ = { 244 | isa = PBXProject; 245 | attributes = { 246 | CLASSPREFIX = OUR; 247 | LastUpgradeCheck = 0710; 248 | ORGANIZATIONNAME = Draveness; 249 | TargetAttributes = { 250 | 6003F5AD195388D20070C39A = { 251 | TestTargetID = 6003F589195388D20070C39A; 252 | }; 253 | }; 254 | }; 255 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "Ouroboros" */; 256 | compatibilityVersion = "Xcode 3.2"; 257 | developmentRegion = English; 258 | hasScannedForEncodings = 0; 259 | knownRegions = ( 260 | en, 261 | Base, 262 | ); 263 | mainGroup = 6003F581195388D10070C39A; 264 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 265 | projectDirPath = ""; 266 | projectRoot = ""; 267 | targets = ( 268 | 6003F589195388D20070C39A /* Ouroboros_Example */, 269 | 6003F5AD195388D20070C39A /* Ouroboros_Tests */, 270 | ); 271 | }; 272 | /* End PBXProject section */ 273 | 274 | /* Begin PBXResourcesBuildPhase section */ 275 | 6003F588195388D20070C39A /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 72C0F6371BE0E84200B12682 /* LaunchScreen.storyboard in Resources */, 280 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 281 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | 6003F5AC195388D20070C39A /* Resources */ = { 286 | isa = PBXResourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXResourcesBuildPhase section */ 294 | 295 | /* Begin PBXShellScriptBuildPhase section */ 296 | 1385C99BBB992FA1E2118925 /* Check Pods Manifest.lock */ = { 297 | isa = PBXShellScriptBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | inputPaths = ( 302 | ); 303 | name = "Check Pods Manifest.lock"; 304 | outputPaths = ( 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | shellPath = /bin/sh; 308 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 309 | showEnvVarsInLog = 0; 310 | }; 311 | 208CAA4B7C207845D7615097 /* Check Pods Manifest.lock */ = { 312 | isa = PBXShellScriptBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | ); 316 | inputPaths = ( 317 | ); 318 | name = "Check Pods Manifest.lock"; 319 | outputPaths = ( 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | shellPath = /bin/sh; 323 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 324 | showEnvVarsInLog = 0; 325 | }; 326 | 3FF331F8DBCACE77465A0D80 /* Embed Pods Frameworks */ = { 327 | isa = PBXShellScriptBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | ); 331 | inputPaths = ( 332 | ); 333 | name = "Embed Pods Frameworks"; 334 | outputPaths = ( 335 | ); 336 | runOnlyForDeploymentPostprocessing = 0; 337 | shellPath = /bin/sh; 338 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example-frameworks.sh\"\n"; 339 | showEnvVarsInLog = 0; 340 | }; 341 | 72D6F1E9AFC2DB5B84C7BA3C /* Embed Pods Frameworks */ = { 342 | isa = PBXShellScriptBuildPhase; 343 | buildActionMask = 2147483647; 344 | files = ( 345 | ); 346 | inputPaths = ( 347 | ); 348 | name = "Embed Pods Frameworks"; 349 | outputPaths = ( 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | shellPath = /bin/sh; 353 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests-frameworks.sh\"\n"; 354 | showEnvVarsInLog = 0; 355 | }; 356 | 94397DCAC731DB04C6E93704 /* Copy Pods Resources */ = { 357 | isa = PBXShellScriptBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | ); 361 | inputPaths = ( 362 | ); 363 | name = "Copy Pods Resources"; 364 | outputPaths = ( 365 | ); 366 | runOnlyForDeploymentPostprocessing = 0; 367 | shellPath = /bin/sh; 368 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example-resources.sh\"\n"; 369 | showEnvVarsInLog = 0; 370 | }; 371 | AFE0881DA0441A724417EC87 /* Copy Pods Resources */ = { 372 | isa = PBXShellScriptBuildPhase; 373 | buildActionMask = 2147483647; 374 | files = ( 375 | ); 376 | inputPaths = ( 377 | ); 378 | name = "Copy Pods Resources"; 379 | outputPaths = ( 380 | ); 381 | runOnlyForDeploymentPostprocessing = 0; 382 | shellPath = /bin/sh; 383 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests-resources.sh\"\n"; 384 | showEnvVarsInLog = 0; 385 | }; 386 | /* End PBXShellScriptBuildPhase section */ 387 | 388 | /* Begin PBXSourcesBuildPhase section */ 389 | 6003F586195388D20070C39A /* Sources */ = { 390 | isa = PBXSourcesBuildPhase; 391 | buildActionMask = 2147483647; 392 | files = ( 393 | 6003F59E195388D20070C39A /* OURAppDelegate.m in Sources */, 394 | 6003F5A7195388D20070C39A /* OURViewController.m in Sources */, 395 | 6003F59A195388D20070C39A /* main.m in Sources */, 396 | ); 397 | runOnlyForDeploymentPostprocessing = 0; 398 | }; 399 | 6003F5AA195388D20070C39A /* Sources */ = { 400 | isa = PBXSourcesBuildPhase; 401 | buildActionMask = 2147483647; 402 | files = ( 403 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 404 | ); 405 | runOnlyForDeploymentPostprocessing = 0; 406 | }; 407 | /* End PBXSourcesBuildPhase section */ 408 | 409 | /* Begin PBXTargetDependency section */ 410 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 411 | isa = PBXTargetDependency; 412 | target = 6003F589195388D20070C39A /* Ouroboros_Example */; 413 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 414 | }; 415 | /* End PBXTargetDependency section */ 416 | 417 | /* Begin PBXVariantGroup section */ 418 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 419 | isa = PBXVariantGroup; 420 | children = ( 421 | 6003F597195388D20070C39A /* en */, 422 | ); 423 | name = InfoPlist.strings; 424 | sourceTree = ""; 425 | }; 426 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 427 | isa = PBXVariantGroup; 428 | children = ( 429 | 6003F5B9195388D20070C39A /* en */, 430 | ); 431 | name = InfoPlist.strings; 432 | sourceTree = ""; 433 | }; 434 | /* End PBXVariantGroup section */ 435 | 436 | /* Begin XCBuildConfiguration section */ 437 | 6003F5BD195388D20070C39A /* Debug */ = { 438 | isa = XCBuildConfiguration; 439 | buildSettings = { 440 | ALWAYS_SEARCH_USER_PATHS = NO; 441 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 442 | CLANG_CXX_LIBRARY = "libc++"; 443 | CLANG_ENABLE_MODULES = YES; 444 | CLANG_ENABLE_OBJC_ARC = YES; 445 | CLANG_WARN_BOOL_CONVERSION = YES; 446 | CLANG_WARN_CONSTANT_CONVERSION = YES; 447 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 448 | CLANG_WARN_EMPTY_BODY = YES; 449 | CLANG_WARN_ENUM_CONVERSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 452 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 453 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 454 | COPY_PHASE_STRIP = NO; 455 | ENABLE_TESTABILITY = YES; 456 | GCC_C_LANGUAGE_STANDARD = gnu99; 457 | GCC_DYNAMIC_NO_PIC = NO; 458 | GCC_OPTIMIZATION_LEVEL = 0; 459 | GCC_PREPROCESSOR_DEFINITIONS = ( 460 | "DEBUG=1", 461 | "$(inherited)", 462 | ); 463 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 466 | GCC_WARN_UNDECLARED_SELECTOR = YES; 467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 468 | GCC_WARN_UNUSED_FUNCTION = YES; 469 | GCC_WARN_UNUSED_VARIABLE = YES; 470 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 471 | ONLY_ACTIVE_ARCH = YES; 472 | SDKROOT = iphoneos; 473 | TARGETED_DEVICE_FAMILY = "1,2"; 474 | }; 475 | name = Debug; 476 | }; 477 | 6003F5BE195388D20070C39A /* Release */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | ALWAYS_SEARCH_USER_PATHS = NO; 481 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 482 | CLANG_CXX_LIBRARY = "libc++"; 483 | CLANG_ENABLE_MODULES = YES; 484 | CLANG_ENABLE_OBJC_ARC = YES; 485 | CLANG_WARN_BOOL_CONVERSION = YES; 486 | CLANG_WARN_CONSTANT_CONVERSION = YES; 487 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 488 | CLANG_WARN_EMPTY_BODY = YES; 489 | CLANG_WARN_ENUM_CONVERSION = YES; 490 | CLANG_WARN_INT_CONVERSION = YES; 491 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 492 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 493 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 494 | COPY_PHASE_STRIP = YES; 495 | ENABLE_NS_ASSERTIONS = NO; 496 | GCC_C_LANGUAGE_STANDARD = gnu99; 497 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 498 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 499 | GCC_WARN_UNDECLARED_SELECTOR = YES; 500 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 501 | GCC_WARN_UNUSED_FUNCTION = YES; 502 | GCC_WARN_UNUSED_VARIABLE = YES; 503 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 504 | SDKROOT = iphoneos; 505 | TARGETED_DEVICE_FAMILY = "1,2"; 506 | VALIDATE_PRODUCT = YES; 507 | }; 508 | name = Release; 509 | }; 510 | 6003F5C0195388D20070C39A /* Debug */ = { 511 | isa = XCBuildConfiguration; 512 | baseConfigurationReference = 003289B6A2C67F4B92BC6B8F /* Pods-Ouroboros_Example.debug.xcconfig */; 513 | buildSettings = { 514 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 515 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 516 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 517 | GCC_PREFIX_HEADER = "Ouroboros/Ouroboros-Prefix.pch"; 518 | INFOPLIST_FILE = "Ouroboros/Ouroboros-Info.plist"; 519 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 520 | MODULE_NAME = ExampleApp; 521 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 522 | PRODUCT_NAME = "$(TARGET_NAME)"; 523 | TARGETED_DEVICE_FAMILY = 1; 524 | WRAPPER_EXTENSION = app; 525 | }; 526 | name = Debug; 527 | }; 528 | 6003F5C1195388D20070C39A /* Release */ = { 529 | isa = XCBuildConfiguration; 530 | baseConfigurationReference = 8CFF3CBD6CEBEC8AB0CB8D0A /* Pods-Ouroboros_Example.release.xcconfig */; 531 | buildSettings = { 532 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 533 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 534 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 535 | GCC_PREFIX_HEADER = "Ouroboros/Ouroboros-Prefix.pch"; 536 | INFOPLIST_FILE = "Ouroboros/Ouroboros-Info.plist"; 537 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 538 | MODULE_NAME = ExampleApp; 539 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 540 | PRODUCT_NAME = "$(TARGET_NAME)"; 541 | TARGETED_DEVICE_FAMILY = 1; 542 | WRAPPER_EXTENSION = app; 543 | }; 544 | name = Release; 545 | }; 546 | 6003F5C3195388D20070C39A /* Debug */ = { 547 | isa = XCBuildConfiguration; 548 | baseConfigurationReference = 6CE86B211761331555B37341 /* Pods-Ouroboros_Tests.debug.xcconfig */; 549 | buildSettings = { 550 | BUNDLE_LOADER = "$(TEST_HOST)"; 551 | FRAMEWORK_SEARCH_PATHS = ( 552 | "$(SDKROOT)/Developer/Library/Frameworks", 553 | "$(inherited)", 554 | "$(DEVELOPER_FRAMEWORKS_DIR)", 555 | ); 556 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 557 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 558 | GCC_PREPROCESSOR_DEFINITIONS = ( 559 | "DEBUG=1", 560 | "$(inherited)", 561 | ); 562 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 563 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 564 | PRODUCT_NAME = "$(TARGET_NAME)"; 565 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Ouroboros_Example.app/Ouroboros_Example"; 566 | WRAPPER_EXTENSION = xctest; 567 | }; 568 | name = Debug; 569 | }; 570 | 6003F5C4195388D20070C39A /* Release */ = { 571 | isa = XCBuildConfiguration; 572 | baseConfigurationReference = 1D7D3183FBE7785EA9DA153E /* Pods-Ouroboros_Tests.release.xcconfig */; 573 | buildSettings = { 574 | BUNDLE_LOADER = "$(TEST_HOST)"; 575 | FRAMEWORK_SEARCH_PATHS = ( 576 | "$(SDKROOT)/Developer/Library/Frameworks", 577 | "$(inherited)", 578 | "$(DEVELOPER_FRAMEWORKS_DIR)", 579 | ); 580 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 581 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 582 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 583 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 584 | PRODUCT_NAME = "$(TARGET_NAME)"; 585 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Ouroboros_Example.app/Ouroboros_Example"; 586 | WRAPPER_EXTENSION = xctest; 587 | }; 588 | name = Release; 589 | }; 590 | /* End XCBuildConfiguration section */ 591 | 592 | /* Begin XCConfigurationList section */ 593 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "Ouroboros" */ = { 594 | isa = XCConfigurationList; 595 | buildConfigurations = ( 596 | 6003F5BD195388D20070C39A /* Debug */, 597 | 6003F5BE195388D20070C39A /* Release */, 598 | ); 599 | defaultConfigurationIsVisible = 0; 600 | defaultConfigurationName = Release; 601 | }; 602 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "Ouroboros_Example" */ = { 603 | isa = XCConfigurationList; 604 | buildConfigurations = ( 605 | 6003F5C0195388D20070C39A /* Debug */, 606 | 6003F5C1195388D20070C39A /* Release */, 607 | ); 608 | defaultConfigurationIsVisible = 0; 609 | defaultConfigurationName = Release; 610 | }; 611 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Ouroboros_Tests" */ = { 612 | isa = XCConfigurationList; 613 | buildConfigurations = ( 614 | 6003F5C3195388D20070C39A /* Debug */, 615 | 6003F5C4195388D20070C39A /* Release */, 616 | ); 617 | defaultConfigurationIsVisible = 0; 618 | defaultConfigurationName = Release; 619 | }; 620 | /* End XCConfigurationList section */ 621 | }; 622 | rootObject = 6003F582195388D10070C39A /* Project object */; 623 | } 624 | -------------------------------------------------------------------------------- /Example/Ouroboros.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Ouroboros.xcodeproj/xcshareddata/xcschemes/Ouroboros-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/Ouroboros.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "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 | } -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/CardBG.imageset/CardBG@2x@.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/Example/Ouroboros/Images.xcassets/CardBG.imageset/CardBG@2x@.png -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/CardBG.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "CardBG@2x@.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 | } -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/Google.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Google@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/Google.imageset/Google@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/Example/Ouroboros/Images.xcassets/Google.imageset/Google@2x.png -------------------------------------------------------------------------------- /Example/Ouroboros/Images.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 | -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/instagram.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "instagram@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/instagram.imageset/instagram@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/Example/Ouroboros/Images.xcassets/instagram.imageset/instagram@2x.png -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/linkedin.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "linkedin@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/linkedin.imageset/linkedin@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/Example/Ouroboros/Images.xcassets/linkedin.imageset/linkedin@2x.png -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/twitter.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "twitter@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/Ouroboros/Images.xcassets/twitter.imageset/twitter@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/Example/Ouroboros/Images.xcassets/twitter.imageset/twitter@2x.png -------------------------------------------------------------------------------- /Example/Ouroboros/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 28 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Example/Ouroboros/OURAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OURAppDelegate.h 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 10/28/2015. 6 | // Copyright (c) 2015 Draveness. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface OURAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Ouroboros/OURAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // OURAppDelegate.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 10/28/2015. 6 | // Copyright (c) 2015 Draveness. All rights reserved. 7 | // 8 | 9 | #import "OURAppDelegate.h" 10 | #import "OURViewController.h" 11 | 12 | @implementation OURAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | [self.window makeKeyAndVisible]; 18 | self.window.rootViewController = [[OURViewController alloc] init]; 19 | return YES; 20 | } 21 | 22 | - (void)applicationWillResignActive:(UIApplication *)application 23 | { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application 29 | { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application 35 | { 36 | // 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. 37 | } 38 | 39 | - (void)applicationDidBecomeActive:(UIApplication *)application 40 | { 41 | // 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. 42 | } 43 | 44 | - (void)applicationWillTerminate:(UIApplication *)application 45 | { 46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Example/Ouroboros/OURViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OURViewController.h 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 10/28/2015. 6 | // Copyright (c) 2015 Draveness. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface OURViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Ouroboros/OURViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OURViewController.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 10/28/2015. 6 | // Copyright (c) 2015 Draveness. All rights reserved. 7 | // 8 | 9 | #import "OURViewController.h" 10 | #import "Ouroboros.h" 11 | 12 | @interface OURViewController () 13 | 14 | @end 15 | 16 | @implementation OURViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | UIScrollView *scrollView = [[UIScrollView alloc] init]; 21 | self.view.backgroundColor = [UIColor whiteColor]; 22 | [self.view addSubview:scrollView]; 23 | scrollView.frame = self.view.bounds; 24 | scrollView.backgroundColor = [UIColor clearColor]; 25 | scrollView.contentSize = CGSizeMake(self.view.bounds.size.width * 3, self.view.bounds.size.height); 26 | scrollView.pagingEnabled = YES; 27 | scrollView.ou_scrollDirection = OURScrollDirectionHorizontal; 28 | 29 | UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.frame]; 30 | backgroundView.backgroundColor = [UIColor whiteColor]; 31 | [scrollView addSubview:backgroundView]; 32 | 33 | [backgroundView our_pinWithConfigureBlock:^(Scale * _Nonnull scale) { 34 | 35 | }]; 36 | [backgroundView our_animateWithProperty:OURAnimationPropertyViewBackgroundColor 37 | configureBlock:^(Scale * _Nonnull scale) { 38 | scale.trigger = 0; 39 | scale.offset = self.view.our_width; 40 | scale.toValue = [UIColor colorWithRed:0.537 green:0.537 blue:0.537 alpha:1.0]; 41 | }]; 42 | [backgroundView our_animateWithProperty:OURAnimationPropertyViewBackgroundColor 43 | configureBlock:^(Scale * _Nonnull scale) { 44 | scale.trigger = self.view.our_width; 45 | scale.offset = self.view.our_width; 46 | scale.toValue = [UIColor colorWithRed:0.263 green:0.263 blue:0.263 alpha:1.0]; 47 | }]; 48 | 49 | UILabel *firstLabel = [[UILabel alloc] init]; 50 | firstLabel.text = @"Social Media Have Connections"; 51 | firstLabel.textColor = [UIColor colorWithRed:0.243 green:0.239 blue:0.239 alpha:1.0]; 52 | 53 | 54 | UILabel *secondLabel = [[UILabel alloc] init]; 55 | secondLabel.text = @"We Help You Organize Them"; 56 | secondLabel.alpha = 0; 57 | secondLabel.textColor = [UIColor whiteColor]; 58 | 59 | UILabel *thirdLabel = [[UILabel alloc] init]; 60 | thirdLabel.text = @"Cardro\nConnect More"; 61 | thirdLabel.alpha = 0; 62 | thirdLabel.textColor = [UIColor whiteColor]; 63 | 64 | for (UILabel *label in @[firstLabel, secondLabel, thirdLabel]) { 65 | label.font = [UIFont fontWithName:@"HelveticaNeue-UltraLight" size:40]; 66 | label.frame = CGRectMake(34.5, 106, 307, 94); 67 | label.numberOfLines = 2; 68 | label.textAlignment = NSTextAlignmentCenter; 69 | [scrollView addSubview:label]; 70 | } 71 | 72 | [firstLabel our_pinWithConfigureBlock:^(Scale * _Nonnull scale) { 73 | 74 | }]; 75 | [firstLabel our_animateWithProperty:OURAnimationPropertyViewAlpha 76 | configureBlock:^(Scale * _Nonnull scale) { 77 | scale.offset = self.view.our_width * 0.5; 78 | scale.toValue = @(0); 79 | }]; 80 | [secondLabel our_pinWithConfigureBlock:^(Scale * _Nonnull scale) { 81 | 82 | }]; 83 | [secondLabel our_animateWithProperty:OURAnimationPropertyViewAlpha 84 | configureBlock:^(Scale * _Nonnull scale) { 85 | scale.trigger = self.view.our_width * 0.5; 86 | scale.offset = self.view.our_width * 0.5; 87 | scale.toValue = @(1); 88 | }]; 89 | [secondLabel our_animateWithProperty:OURAnimationPropertyViewAlpha 90 | configureBlock:^(Scale * _Nonnull scale) { 91 | scale.trigger = self.view.our_width; 92 | scale.offset = self.view.our_width * 0.5; 93 | scale.toValue = @(0); 94 | }]; 95 | [thirdLabel our_pinWithConfigureBlock:^(Scale * _Nonnull scale) { 96 | 97 | }]; 98 | [thirdLabel our_animateWithProperty:OURAnimationPropertyViewAlpha 99 | configureBlock:^(Scale * _Nonnull scale) { 100 | scale.trigger = self.view.our_width * 1.5; 101 | scale.offset = self.view.our_width * 0.5; 102 | scale.toValue = @(1); 103 | }]; 104 | 105 | UIImageView *twitter = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"twitter"]]; 106 | UIImageView *instagram = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"instagram"]]; 107 | UIImageView *google = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Google"]]; 108 | UIImageView *linkedin = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"linkedin"]]; 109 | 110 | twitter.frame = CGRectMake(30.5, 331, 48, 48); 111 | instagram.frame = CGRectMake(115, 424, 48, 48); 112 | google.frame = CGRectMake(211.5, 331, 48, 48); 113 | linkedin.frame = CGRectMake(297.5, 424, 48, 48); 114 | 115 | for (UIImageView *imageView in @[twitter, instagram, google, linkedin]) { 116 | [scrollView addSubview:imageView]; 117 | } 118 | 119 | // second page 120 | [twitter our_animateWithProperty:OURAnimationPropertyViewFrame 121 | configureBlock:^(Scale * _Nonnull scale) { 122 | scale.offset = self.view.our_width; 123 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(46.5 + self.view.our_width, 274, 48, 48)]; 124 | }]; 125 | [instagram our_animateWithProperty:OURAnimationPropertyViewFrame 126 | configureBlock:^(Scale * _Nonnull scale) { 127 | scale.offset = self.view.our_width; 128 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(46.5 + self.view.our_width, 348, 48, 48)]; 129 | }]; 130 | [google our_animateWithProperty:OURAnimationPropertyViewFrame 131 | configureBlock:^(Scale * _Nonnull scale) { 132 | scale.offset = self.view.our_width; 133 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(46.5 + self.view.our_width, 421, 48, 48)]; 134 | }]; 135 | [linkedin our_animateWithProperty:OURAnimationPropertyViewFrame 136 | configureBlock:^(Scale * _Nonnull scale) { 137 | scale.offset = self.view.our_width; 138 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(46.5 + self.view.our_width, 494, 48, 48)]; 139 | }]; 140 | 141 | // third page 142 | [twitter our_animateWithProperty:OURAnimationPropertyViewFrame 143 | configureBlock:^(Scale * _Nonnull scale) { 144 | scale.trigger = self.view.our_width; 145 | scale.offset = self.view.our_width; 146 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(94.5 + self.view.our_width * 2, 309, 34, 34)]; 147 | }]; 148 | [instagram our_animateWithProperty:OURAnimationPropertyViewFrame 149 | configureBlock:^(Scale * _Nonnull scale) { 150 | scale.trigger = self.view.our_width; 151 | scale.offset = self.view.our_width; 152 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(94.5 + self.view.our_width * 2, 360, 34, 34)]; 153 | }]; 154 | [google our_animateWithProperty:OURAnimationPropertyViewFrame 155 | configureBlock:^(Scale * _Nonnull scale) { 156 | scale.trigger = self.view.our_width; 157 | scale.offset = self.view.our_width; 158 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(94.5 + self.view.our_width * 2, 411, 34, 34)]; 159 | }]; 160 | [linkedin our_animateWithProperty:OURAnimationPropertyViewFrame 161 | configureBlock:^(Scale * _Nonnull scale) { 162 | scale.trigger = self.view.our_width; 163 | scale.offset = self.view.our_width; 164 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(94.5 + self.view.our_width * 2, 463, 34, 34)]; 165 | }]; 166 | 167 | for (int i = 0; i < 4; i++) { 168 | UIView *line = [[UIView alloc] init]; 169 | line.backgroundColor = [UIColor colorWithRed:0.847 green:0.847 blue:0.847 alpha:1.0]; 170 | line.frame = CGRectMake(117 + self.view.our_width + i * self.view.our_width * 0.5, 292 + 73 * i, 200, 15); 171 | [scrollView addSubview:line]; 172 | [line our_animateWithProperty:OURAnimationPropertyViewFrame 173 | configureBlock:^(Scale * _Nonnull scale) { 174 | scale.offset = self.view.our_width; 175 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(117 + self.view.our_width, 292 + 73 * i, 200, 15)]; 176 | }]; 177 | [line our_animateWithProperty:OURAnimationPropertyViewFrame 178 | configureBlock:^(Scale * _Nonnull scale) { 179 | scale.trigger = self.view.our_width; 180 | scale.offset = self.view.our_width; 181 | scale.toValue = [NSValue valueWithCGRect:CGRectMake(144 + self.view.our_width * 2, 321 + i * 51, 140, 11)]; 182 | }]; 183 | } 184 | 185 | UIImageView *cardBG = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"CardBG"]]; 186 | cardBG.alpha = 0; 187 | cardBG.frame = CGRectMake(66, 247, 245, 324); 188 | [scrollView insertSubview:cardBG aboveSubview:backgroundView]; 189 | 190 | [cardBG our_pinWithConfigureBlock:^(Scale * _Nonnull scale) { 191 | 192 | }]; 193 | [cardBG our_animateWithProperty:OURAnimationPropertyViewAlpha 194 | configureBlock:^(Scale * _Nonnull scale) { 195 | scale.trigger = self.view.our_width * 1.5; 196 | scale.offset = self.view.our_width; 197 | scale.toValue = @(1); 198 | }]; 199 | } 200 | 201 | @end 202 | -------------------------------------------------------------------------------- /Example/Ouroboros/Ouroboros-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/Ouroboros/Ouroboros-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/Ouroboros/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/Ouroboros/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 10/28/2015. 6 | // Copyright (c) 2015 Draveness. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "OURAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([OURAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | use_frameworks! 3 | 4 | target 'Ouroboros_Example', :exclusive => true do 5 | pod "Ouroboros", :path => "../" 6 | end 7 | 8 | target 'Ouroboros_Tests', :exclusive => true do 9 | pod "Ouroboros", :path => "../" 10 | 11 | 12 | end 13 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Ouroboros (0.4.2) 3 | 4 | DEPENDENCIES: 5 | - Ouroboros (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | Ouroboros: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | Ouroboros: 854e902a755d0b1a94da008ffae729774759e390 13 | 14 | COCOAPODS: 0.38.2 15 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Ouroboros/NSBKeyframeAnimationFunctions.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/NSBKeyframeAnimationFunctions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Ouroboros/Ouroboros.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/Ouroboros.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Ouroboros/Scale.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/Scale.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Ouroboros/UIScrollView+Ouroboros.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/UIScrollView+Ouroboros.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Ouroboros/UIView+Measure.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/UIView+Measure.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Ouroboros/UIView+Ouroboros.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/UIView+Ouroboros.h -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/Ouroboros.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ouroboros", 3 | "version": "0.4.2", 4 | "summary": "An ObjectiveC library for magical scroll interactions.", 5 | "description": "Ouroboros is inspired by ScrollMagic which helps you to easily react to the user's current\nscroll position. With Ouroboros, you can easily create introduction pages.", 6 | "homepage": "https://github.com/Draveness/Ouroboros", 7 | "license": "MIT", 8 | "authors": { 9 | "Draveness": "stark.draven@gmail.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com/Draveness/Ouroboros.git", 13 | "tag": "0.4.2" 14 | }, 15 | "platforms": { 16 | "ios": "7.0" 17 | }, 18 | "requires_arc": true, 19 | "source_files": "Pod/Classes/**/*", 20 | "resource_bundles": { 21 | "Ouroboros": [ 22 | "Pod/Assets/*.png" 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Ouroboros (0.4.2) 3 | 4 | DEPENDENCIES: 5 | - Ouroboros (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | Ouroboros: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | Ouroboros: 854e902a755d0b1a94da008ffae729774759e390 13 | 14 | COCOAPODS: 0.38.2 15 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Ouroboros.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 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Ouroboros/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 | 0.4.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Ouroboros/Ouroboros-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Ouroboros.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Ouroboros" "${PODS_ROOT}/Headers/Public" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Ouroboros/Ouroboros-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Ouroboros : NSObject 3 | @end 4 | @implementation PodsDummy_Ouroboros 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Ouroboros/Ouroboros-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Ouroboros/Ouroboros-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "NSBKeyframeAnimationFunctions.h" 4 | #import "Ouroboros.h" 5 | #import "Scale.h" 6 | #import "UIScrollView+Ouroboros.h" 7 | #import "UIView+Measure.h" 8 | #import "UIView+Ouroboros.h" 9 | 10 | FOUNDATION_EXPORT double OuroborosVersionNumber; 11 | FOUNDATION_EXPORT const unsigned char OuroborosVersionString[]; 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Ouroboros/Ouroboros.modulemap: -------------------------------------------------------------------------------- 1 | framework module Ouroboros { 2 | umbrella header "Ouroboros-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Ouroboros/Ouroboros.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/Example/Pods/Target Support Files/Ouroboros/Ouroboros.xcconfig -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Ouroboros 5 | 6 | Copyright (c) 2015 Draveness 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2015 Draveness <stark.draven@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | Ouroboros 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Ouroboros_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Ouroboros_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | else 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | fi 16 | 17 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | 19 | if [ -L "${source}" ]; then 20 | echo "Symlinked..." 21 | source="$(readlink "${source}")" 22 | fi 23 | 24 | # use filter instead of exclude so missing patterns dont' throw errors 25 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 26 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 27 | 28 | # Resign the code if required by the build settings to avoid unstable apps 29 | code_sign_if_enabled "${destination}/$(basename "$1")" 30 | 31 | # Embed linked Swift runtime libraries 32 | local basename 33 | basename="$(basename "$1" | sed -E s/\\..+// && exit ${PIPESTATUS[0]})" 34 | local swift_runtime_libs 35 | swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${basename}.framework/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 36 | for lib in $swift_runtime_libs; do 37 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 38 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 39 | code_sign_if_enabled "${destination}/${lib}" 40 | done 41 | } 42 | 43 | # Signs a framework with the provided identity 44 | code_sign_if_enabled() { 45 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 46 | # Use the current code_sign_identitiy 47 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 48 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 49 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 50 | fi 51 | } 52 | 53 | 54 | if [[ "$CONFIGURATION" == "Debug" ]]; then 55 | install_framework 'Pods-Ouroboros_Example/Ouroboros.framework' 56 | fi 57 | if [[ "$CONFIGURATION" == "Release" ]]; then 58 | install_framework 'Pods-Ouroboros_Example/Ouroboros.framework' 59 | fi 60 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_Ouroboros_ExampleVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_Ouroboros_ExampleVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Ouroboros.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "Ouroboros" 5 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-Ouroboros_Example 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Ouroboros_Example { 2 | umbrella header "Pods-Ouroboros_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Example/Pods-Ouroboros_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Ouroboros.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "Ouroboros" 5 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-Ouroboros_Example 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Ouroboros 5 | 6 | Copyright (c) 2015 Draveness 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2015 Draveness <stark.draven@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | Ouroboros 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Ouroboros_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Ouroboros_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | else 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | fi 16 | 17 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | 19 | if [ -L "${source}" ]; then 20 | echo "Symlinked..." 21 | source="$(readlink "${source}")" 22 | fi 23 | 24 | # use filter instead of exclude so missing patterns dont' throw errors 25 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 26 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 27 | 28 | # Resign the code if required by the build settings to avoid unstable apps 29 | code_sign_if_enabled "${destination}/$(basename "$1")" 30 | 31 | # Embed linked Swift runtime libraries 32 | local basename 33 | basename="$(basename "$1" | sed -E s/\\..+// && exit ${PIPESTATUS[0]})" 34 | local swift_runtime_libs 35 | swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${basename}.framework/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 36 | for lib in $swift_runtime_libs; do 37 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 38 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 39 | code_sign_if_enabled "${destination}/${lib}" 40 | done 41 | } 42 | 43 | # Signs a framework with the provided identity 44 | code_sign_if_enabled() { 45 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 46 | # Use the current code_sign_identitiy 47 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 48 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 49 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 50 | fi 51 | } 52 | 53 | 54 | if [[ "$CONFIGURATION" == "Debug" ]]; then 55 | install_framework 'Pods-Ouroboros_Tests/Ouroboros.framework' 56 | fi 57 | if [[ "$CONFIGURATION" == "Release" ]]; then 58 | install_framework 'Pods-Ouroboros_Tests/Ouroboros.framework' 59 | fi 60 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_Ouroboros_TestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_Ouroboros_TestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Ouroboros.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "Ouroboros" 5 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-Ouroboros_Tests 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Ouroboros_Tests { 2 | umbrella header "Pods-Ouroboros_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Ouroboros_Tests/Pods-Ouroboros_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Ouroboros.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "Ouroboros" 5 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-Ouroboros_Tests 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // OuroborosTests.m 3 | // OuroborosTests 4 | // 5 | // Created by Draveness on 10/28/2015. 6 | // Copyright (c) 2015 Draveness. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Draveness 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 | -------------------------------------------------------------------------------- /Ouroboros.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint Ouroboros.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = "Ouroboros" 11 | s.version = "0.4.2" 12 | s.summary = "An ObjectiveC library for magical scroll interactions." 13 | 14 | s.description = <<-DESC 15 | Ouroboros is inspired by ScrollMagic which helps you to easily react to the user's current 16 | scroll position. With Ouroboros, you can easily create introduction pages. 17 | DESC 18 | 19 | s.homepage = "https://github.com/Draveness/Ouroboros" 20 | s.license = 'MIT' 21 | s.author = { "Draveness" => "stark.draven@gmail.com" } 22 | s.source = { :git => "https://github.com/Draveness/Ouroboros.git", :tag => s.version.to_s } 23 | s.platform = :ios, '7.0' 24 | s.requires_arc = true 25 | 26 | s.source_files = 'Pod/Classes/**/*' 27 | s.resource_bundles = { 28 | 'Ouroboros' => ['Pod/Assets/*.png'] 29 | } 30 | end 31 | -------------------------------------------------------------------------------- /Ouroboros.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7291EDE31BC2958F0089B8A8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7291EDE21BC2958F0089B8A8 /* main.m */; }; 11 | 7291EDE61BC2958F0089B8A8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7291EDE51BC2958F0089B8A8 /* AppDelegate.m */; }; 12 | 7291EDE91BC2958F0089B8A8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7291EDE81BC2958F0089B8A8 /* ViewController.m */; }; 13 | 7291EDEC1BC2958F0089B8A8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7291EDEA1BC2958F0089B8A8 /* Main.storyboard */; }; 14 | 7291EDEE1BC2958F0089B8A8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7291EDED1BC2958F0089B8A8 /* Assets.xcassets */; }; 15 | 7291EDF11BC2958F0089B8A8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7291EDEF1BC2958F0089B8A8 /* LaunchScreen.storyboard */; }; 16 | 7291EDFB1BC296D40089B8A8 /* UIScrollView+Ouroboros.m in Sources */ = {isa = PBXBuildFile; fileRef = 7291EDFA1BC296D40089B8A8 /* UIScrollView+Ouroboros.m */; settings = {ASSET_TAGS = (); }; }; 17 | 7291EDFE1BC296ED0089B8A8 /* UIView+Ouroboros.m in Sources */ = {isa = PBXBuildFile; fileRef = 7291EDFD1BC296ED0089B8A8 /* UIView+Ouroboros.m */; settings = {ASSET_TAGS = (); }; }; 18 | 72F103CE1BD9F5B30030B703 /* Ouroboros.m in Sources */ = {isa = PBXBuildFile; fileRef = 72F103CD1BD9F5B30030B703 /* Ouroboros.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 7291EDDE1BC2958F0089B8A8 /* Ouroboros.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ouroboros.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 7291EDE21BC2958F0089B8A8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 24 | 7291EDE41BC2958F0089B8A8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 25 | 7291EDE51BC2958F0089B8A8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 26 | 7291EDE71BC2958F0089B8A8 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 27 | 7291EDE81BC2958F0089B8A8 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 28 | 7291EDEB1BC2958F0089B8A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | 7291EDED1BC2958F0089B8A8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 30 | 7291EDF01BC2958F0089B8A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 31 | 7291EDF21BC2958F0089B8A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 7291EDF91BC296D40089B8A8 /* UIScrollView+Ouroboros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+Ouroboros.h"; sourceTree = ""; }; 33 | 7291EDFA1BC296D40089B8A8 /* UIScrollView+Ouroboros.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+Ouroboros.m"; sourceTree = ""; }; 34 | 7291EDFC1BC296ED0089B8A8 /* UIView+Ouroboros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Ouroboros.h"; sourceTree = ""; }; 35 | 7291EDFD1BC296ED0089B8A8 /* UIView+Ouroboros.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Ouroboros.m"; sourceTree = ""; }; 36 | 72F103CC1BD9F5B30030B703 /* Ouroboros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ouroboros.h; sourceTree = ""; }; 37 | 72F103CD1BD9F5B30030B703 /* Ouroboros.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Ouroboros.m; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 7291EDDB1BC2958F0089B8A8 /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | ); 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXFrameworksBuildPhase section */ 49 | 50 | /* Begin PBXGroup section */ 51 | 7291EDD51BC2958F0089B8A8 = { 52 | isa = PBXGroup; 53 | children = ( 54 | 7291EDE01BC2958F0089B8A8 /* Ouroboros */, 55 | 7291EDDF1BC2958F0089B8A8 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | 7291EDDF1BC2958F0089B8A8 /* Products */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 7291EDDE1BC2958F0089B8A8 /* Ouroboros.app */, 63 | ); 64 | name = Products; 65 | sourceTree = ""; 66 | }; 67 | 7291EDE01BC2958F0089B8A8 /* Ouroboros */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 7291EDF81BC295EE0089B8A8 /* Classes */, 71 | 7291EDE41BC2958F0089B8A8 /* AppDelegate.h */, 72 | 7291EDE51BC2958F0089B8A8 /* AppDelegate.m */, 73 | 7291EDE71BC2958F0089B8A8 /* ViewController.h */, 74 | 7291EDE81BC2958F0089B8A8 /* ViewController.m */, 75 | 7291EDEA1BC2958F0089B8A8 /* Main.storyboard */, 76 | 7291EDED1BC2958F0089B8A8 /* Assets.xcassets */, 77 | 7291EDEF1BC2958F0089B8A8 /* LaunchScreen.storyboard */, 78 | 7291EDF21BC2958F0089B8A8 /* Info.plist */, 79 | 7291EDE11BC2958F0089B8A8 /* Supporting Files */, 80 | ); 81 | path = Ouroboros; 82 | sourceTree = ""; 83 | }; 84 | 7291EDE11BC2958F0089B8A8 /* Supporting Files */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 7291EDE21BC2958F0089B8A8 /* main.m */, 88 | ); 89 | name = "Supporting Files"; 90 | sourceTree = ""; 91 | }; 92 | 7291EDF81BC295EE0089B8A8 /* Classes */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 7291EDF91BC296D40089B8A8 /* UIScrollView+Ouroboros.h */, 96 | 7291EDFA1BC296D40089B8A8 /* UIScrollView+Ouroboros.m */, 97 | 7291EDFC1BC296ED0089B8A8 /* UIView+Ouroboros.h */, 98 | 7291EDFD1BC296ED0089B8A8 /* UIView+Ouroboros.m */, 99 | 72F103CC1BD9F5B30030B703 /* Ouroboros.h */, 100 | 72F103CD1BD9F5B30030B703 /* Ouroboros.m */, 101 | ); 102 | path = Classes; 103 | sourceTree = SOURCE_ROOT; 104 | }; 105 | /* End PBXGroup section */ 106 | 107 | /* Begin PBXNativeTarget section */ 108 | 7291EDDD1BC2958F0089B8A8 /* Ouroboros */ = { 109 | isa = PBXNativeTarget; 110 | buildConfigurationList = 7291EDF51BC2958F0089B8A8 /* Build configuration list for PBXNativeTarget "Ouroboros" */; 111 | buildPhases = ( 112 | 7291EDDA1BC2958F0089B8A8 /* Sources */, 113 | 7291EDDB1BC2958F0089B8A8 /* Frameworks */, 114 | 7291EDDC1BC2958F0089B8A8 /* Resources */, 115 | ); 116 | buildRules = ( 117 | ); 118 | dependencies = ( 119 | ); 120 | name = Ouroboros; 121 | productName = Ouroboros; 122 | productReference = 7291EDDE1BC2958F0089B8A8 /* Ouroboros.app */; 123 | productType = "com.apple.product-type.application"; 124 | }; 125 | /* End PBXNativeTarget section */ 126 | 127 | /* Begin PBXProject section */ 128 | 7291EDD61BC2958F0089B8A8 /* Project object */ = { 129 | isa = PBXProject; 130 | attributes = { 131 | LastUpgradeCheck = 0700; 132 | ORGANIZATIONNAME = Draveness; 133 | TargetAttributes = { 134 | 7291EDDD1BC2958F0089B8A8 = { 135 | CreatedOnToolsVersion = 7.0.1; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 7291EDD91BC2958F0089B8A8 /* Build configuration list for PBXProject "Ouroboros" */; 140 | compatibilityVersion = "Xcode 3.2"; 141 | developmentRegion = English; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 7291EDD51BC2958F0089B8A8; 148 | productRefGroup = 7291EDDF1BC2958F0089B8A8 /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 7291EDDD1BC2958F0089B8A8 /* Ouroboros */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 7291EDDC1BC2958F0089B8A8 /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 7291EDF11BC2958F0089B8A8 /* LaunchScreen.storyboard in Resources */, 163 | 7291EDEE1BC2958F0089B8A8 /* Assets.xcassets in Resources */, 164 | 7291EDEC1BC2958F0089B8A8 /* Main.storyboard in Resources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXResourcesBuildPhase section */ 169 | 170 | /* Begin PBXSourcesBuildPhase section */ 171 | 7291EDDA1BC2958F0089B8A8 /* Sources */ = { 172 | isa = PBXSourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 7291EDFB1BC296D40089B8A8 /* UIScrollView+Ouroboros.m in Sources */, 176 | 7291EDE91BC2958F0089B8A8 /* ViewController.m in Sources */, 177 | 72F103CE1BD9F5B30030B703 /* Ouroboros.m in Sources */, 178 | 7291EDFE1BC296ED0089B8A8 /* UIView+Ouroboros.m in Sources */, 179 | 7291EDE61BC2958F0089B8A8 /* AppDelegate.m in Sources */, 180 | 7291EDE31BC2958F0089B8A8 /* main.m in Sources */, 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | /* End PBXSourcesBuildPhase section */ 185 | 186 | /* Begin PBXVariantGroup section */ 187 | 7291EDEA1BC2958F0089B8A8 /* Main.storyboard */ = { 188 | isa = PBXVariantGroup; 189 | children = ( 190 | 7291EDEB1BC2958F0089B8A8 /* Base */, 191 | ); 192 | name = Main.storyboard; 193 | sourceTree = ""; 194 | }; 195 | 7291EDEF1BC2958F0089B8A8 /* LaunchScreen.storyboard */ = { 196 | isa = PBXVariantGroup; 197 | children = ( 198 | 7291EDF01BC2958F0089B8A8 /* Base */, 199 | ); 200 | name = LaunchScreen.storyboard; 201 | sourceTree = ""; 202 | }; 203 | /* End PBXVariantGroup section */ 204 | 205 | /* Begin XCBuildConfiguration section */ 206 | 7291EDF31BC2958F0089B8A8 /* Debug */ = { 207 | isa = XCBuildConfiguration; 208 | buildSettings = { 209 | ALWAYS_SEARCH_USER_PATHS = NO; 210 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 211 | CLANG_CXX_LIBRARY = "libc++"; 212 | CLANG_ENABLE_MODULES = YES; 213 | CLANG_ENABLE_OBJC_ARC = YES; 214 | CLANG_WARN_BOOL_CONVERSION = YES; 215 | CLANG_WARN_CONSTANT_CONVERSION = YES; 216 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 217 | CLANG_WARN_EMPTY_BODY = YES; 218 | CLANG_WARN_ENUM_CONVERSION = YES; 219 | CLANG_WARN_INT_CONVERSION = YES; 220 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 221 | CLANG_WARN_UNREACHABLE_CODE = YES; 222 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 223 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 224 | COPY_PHASE_STRIP = NO; 225 | DEBUG_INFORMATION_FORMAT = dwarf; 226 | ENABLE_STRICT_OBJC_MSGSEND = YES; 227 | ENABLE_TESTABILITY = YES; 228 | GCC_C_LANGUAGE_STANDARD = gnu99; 229 | GCC_DYNAMIC_NO_PIC = NO; 230 | GCC_NO_COMMON_BLOCKS = YES; 231 | GCC_OPTIMIZATION_LEVEL = 0; 232 | GCC_PREPROCESSOR_DEFINITIONS = ( 233 | "DEBUG=1", 234 | "$(inherited)", 235 | ); 236 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 237 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 238 | GCC_WARN_UNDECLARED_SELECTOR = YES; 239 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 240 | GCC_WARN_UNUSED_FUNCTION = YES; 241 | GCC_WARN_UNUSED_VARIABLE = YES; 242 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 243 | MTL_ENABLE_DEBUG_INFO = YES; 244 | ONLY_ACTIVE_ARCH = YES; 245 | SDKROOT = iphoneos; 246 | }; 247 | name = Debug; 248 | }; 249 | 7291EDF41BC2958F0089B8A8 /* Release */ = { 250 | isa = XCBuildConfiguration; 251 | buildSettings = { 252 | ALWAYS_SEARCH_USER_PATHS = NO; 253 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 254 | CLANG_CXX_LIBRARY = "libc++"; 255 | CLANG_ENABLE_MODULES = YES; 256 | CLANG_ENABLE_OBJC_ARC = YES; 257 | CLANG_WARN_BOOL_CONVERSION = YES; 258 | CLANG_WARN_CONSTANT_CONVERSION = YES; 259 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 260 | CLANG_WARN_EMPTY_BODY = YES; 261 | CLANG_WARN_ENUM_CONVERSION = YES; 262 | CLANG_WARN_INT_CONVERSION = YES; 263 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 264 | CLANG_WARN_UNREACHABLE_CODE = YES; 265 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 266 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 267 | COPY_PHASE_STRIP = NO; 268 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 269 | ENABLE_NS_ASSERTIONS = NO; 270 | ENABLE_STRICT_OBJC_MSGSEND = YES; 271 | GCC_C_LANGUAGE_STANDARD = gnu99; 272 | GCC_NO_COMMON_BLOCKS = YES; 273 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 274 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 275 | GCC_WARN_UNDECLARED_SELECTOR = YES; 276 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 277 | GCC_WARN_UNUSED_FUNCTION = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 280 | MTL_ENABLE_DEBUG_INFO = NO; 281 | SDKROOT = iphoneos; 282 | VALIDATE_PRODUCT = YES; 283 | }; 284 | name = Release; 285 | }; 286 | 7291EDF61BC2958F0089B8A8 /* Debug */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 290 | INFOPLIST_FILE = Ouroboros/Info.plist; 291 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 292 | PRODUCT_BUNDLE_IDENTIFIER = com.draveness.Ouroboros; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | }; 295 | name = Debug; 296 | }; 297 | 7291EDF71BC2958F0089B8A8 /* Release */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 301 | INFOPLIST_FILE = Ouroboros/Info.plist; 302 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 303 | PRODUCT_BUNDLE_IDENTIFIER = com.draveness.Ouroboros; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | }; 306 | name = Release; 307 | }; 308 | /* End XCBuildConfiguration section */ 309 | 310 | /* Begin XCConfigurationList section */ 311 | 7291EDD91BC2958F0089B8A8 /* Build configuration list for PBXProject "Ouroboros" */ = { 312 | isa = XCConfigurationList; 313 | buildConfigurations = ( 314 | 7291EDF31BC2958F0089B8A8 /* Debug */, 315 | 7291EDF41BC2958F0089B8A8 /* Release */, 316 | ); 317 | defaultConfigurationIsVisible = 0; 318 | defaultConfigurationName = Release; 319 | }; 320 | 7291EDF51BC2958F0089B8A8 /* Build configuration list for PBXNativeTarget "Ouroboros" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | 7291EDF61BC2958F0089B8A8 /* Debug */, 324 | 7291EDF71BC2958F0089B8A8 /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | /* End XCConfigurationList section */ 330 | }; 331 | rootObject = 7291EDD61BC2958F0089B8A8 /* Project object */; 332 | } 333 | -------------------------------------------------------------------------------- /Ouroboros.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Ouroboros.xcodeproj/xcuserdata/Draveness.xcuserdatad/xcschemes/Ouroboros.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Ouroboros.xcodeproj/xcuserdata/Draveness.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Ouroboros.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 7291EDDD1BC2958F0089B8A8 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Ouroboros/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end -------------------------------------------------------------------------------- /Ouroboros/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Ouroboros/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 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Ouroboros/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 | -------------------------------------------------------------------------------- /Ouroboros/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 | -------------------------------------------------------------------------------- /Ouroboros/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Ouroboros/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Ouroboros/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "UIScrollView+Ouroboros.h" 11 | #import "UIView+Ouroboros.h" 12 | 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | UIScrollView *scrollView = [[UIScrollView alloc] init]; 22 | [self.view addSubview:scrollView]; 23 | scrollView.frame = self.view.bounds; 24 | scrollView.backgroundColor = [UIColor whiteColor]; 25 | scrollView.contentSize = CGSizeMake(self.view.bounds.size.width * 2, self.view.bounds.size.height); 26 | scrollView.ou_scrollDirection = OURScrollDirectionHorizontal; 27 | scrollView.delegate = self; 28 | 29 | UIView *yellowView = [[UIView alloc] init]; 30 | yellowView.backgroundColor = [UIColor redColor]; 31 | yellowView.frame = CGRectMake(50, 50, 100, 100); 32 | [scrollView addSubview:yellowView]; 33 | 34 | [yellowView ou_animateWithProperty:OURAnimationPropertyViewBackgroundColor 35 | configureBlock:^(Ouroboros *ouroboros) { 36 | ouroboros.toValue = [UIColor blueColor]; 37 | ouroboros.trggier = 0; 38 | ouroboros.duration = 100; 39 | }]; 40 | [yellowView ou_animateWithProperty:OURAnimationPropertyViewFrame 41 | configureBlock:^(Ouroboros *ouroboros) { 42 | ouroboros.toValue = [NSValue valueWithCGRect:CGRectMake(50, 500, 100, 100)]; 43 | ouroboros.trggier = 0; 44 | ouroboros.duration = 100; 45 | }]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Ouroboros/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/Pod/Assets/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/Pod/Classes/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/NSBKeyframeAnimationFunctions.c: -------------------------------------------------------------------------------- 1 | // 2 | // NSBKeyframeAnimationFunctions.c 3 | // NSBKeyframeAnimation 4 | // 5 | // Created by Nacho Soto on 8/6/12. 6 | // Copyright (c) 2012 Nacho Soto. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | 12 | #import "NSBKeyframeAnimationFunctions.h" 13 | 14 | // source: http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js 15 | 16 | #pragma clang diagnostic push 17 | #pragma clang diagnostic ignored "-Wunsequenced" 18 | 19 | double NSBKeyframeAnimationFunctionLinear(double t,double b, double c, double d) 20 | { 21 | return c*(t/=d) + b; 22 | } 23 | 24 | double NSBKeyframeAnimationFunctionEaseInQuad(double t,double b, double c, double d) 25 | { 26 | return c*(t/=d)*t + b; 27 | } 28 | 29 | double NSBKeyframeAnimationFunctionEaseOutQuad(double t,double b, double c, double d) 30 | { 31 | return -c *(t/=d)*(t-2) + b; 32 | } 33 | 34 | double NSBKeyframeAnimationFunctionEaseInOutQuad(double t,double b, double c, double d) 35 | { 36 | if ((t/=d/2) < 1) return c/2*t*t + b; 37 | return -c/2 * ((--t)*(t-2) - 1) + b; 38 | } 39 | 40 | double NSBKeyframeAnimationFunctionEaseInCubic(double t,double b, double c, double d) 41 | { 42 | return c*(t/=d)*t*t + b; 43 | } 44 | 45 | double NSBKeyframeAnimationFunctionEaseOutCubic(double t,double b, double c, double d) 46 | { 47 | return c*((t=t/d-1)*t*t + 1) + b; 48 | } 49 | 50 | double NSBKeyframeAnimationFunctionEaseInOutCubic(double t, double b, double c, double d) 51 | { 52 | if ((t/=d/2) < 1) return c/2*t*t*t + b; 53 | return c/2*((t-=2)*t*t + 2) + b; 54 | } 55 | 56 | double NSBKeyframeAnimationFunctionEaseInQuart(double t, double b, double c, double d) 57 | { 58 | return c*(t/=d)*t*t*t + b; 59 | } 60 | 61 | double NSBKeyframeAnimationFunctionEaseOutQuart(double t, double b, double c, double d) 62 | { 63 | return -c * ((t=t/d-1)*t*t*t - 1) + b; 64 | } 65 | 66 | double NSBKeyframeAnimationFunctionEaseInOutQuart(double t, double b, double c, double d) 67 | { 68 | if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 69 | return -c/2 * ((t-=2)*t*t*t - 2) + b; 70 | } 71 | 72 | double NSBKeyframeAnimationFunctionEaseInQuint(double t, double b, double c, double d) 73 | { 74 | return c*(t/=d)*t*t*t*t + b; 75 | } 76 | 77 | double NSBKeyframeAnimationFunctionEaseOutQuint(double t, double b, double c, double d) 78 | { 79 | return c*((t=t/d-1)*t*t*t*t + 1) + b; 80 | } 81 | 82 | double NSBKeyframeAnimationFunctionEaseInOutQuint(double t, double b, double c, double d) 83 | { 84 | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 85 | return c/2*((t-=2)*t*t*t*t + 2) + b; 86 | } 87 | 88 | double NSBKeyframeAnimationFunctionEaseInSine(double t, double b, double c, double d) 89 | { 90 | return -c * cos(t/d * (M_PI_2)) + c + b; 91 | } 92 | 93 | double NSBKeyframeAnimationFunctionEaseOutSine(double t, double b, double c, double d) 94 | { 95 | return c * sin(t/d * (M_PI_2)) + b; 96 | } 97 | 98 | double NSBKeyframeAnimationFunctionEaseInOutSine(double t, double b, double c, double d) 99 | { 100 | return -c/2 * (cos(M_PI*t/d) - 1) + b; 101 | } 102 | 103 | double NSBKeyframeAnimationFunctionEaseInExpo(double t, double b, double c, double d) 104 | { 105 | return (t==0) ? b : c * pow(2, 10 * (t/d - 1)) + b; 106 | } 107 | 108 | double NSBKeyframeAnimationFunctionEaseOutExpo(double t, double b, double c, double d) 109 | { 110 | return (t==d) ? b+c : c * (-pow(2, -10 * t/d) + 1) + b; 111 | } 112 | 113 | double NSBKeyframeAnimationFunctionEaseInOutExpo(double t, double b, double c, double d) 114 | { 115 | if (t==0) return b; 116 | if (t==d) return b+c; 117 | if ((t/=d/2) < 1) return c/2 * pow(2, 10 * (t - 1)) + b; 118 | return c/2 * (-pow(2, -10 * --t) + 2) + b; 119 | } 120 | 121 | double NSBKeyframeAnimationFunctionEaseInCirc(double t, double b, double c, double d) 122 | { 123 | return -c * (sqrt(1 - (t/=d)*t) - 1) + b; 124 | } 125 | 126 | double NSBKeyframeAnimationFunctionEaseOutCirc(double t, double b, double c, double d) 127 | { 128 | return c * sqrt(1 - (t=t/d-1)*t) + b; 129 | } 130 | 131 | double NSBKeyframeAnimationFunctionEaseInOutCirc(double t, double b, double c, double d) 132 | { 133 | if ((t/=d/2) < 1) return -c/2 * (sqrt(1 - t*t) - 1) + b; 134 | return c/2 * (sqrt(1 - (t-=2)*t) + 1) + b; 135 | } 136 | 137 | double NSBKeyframeAnimationFunctionEaseInElastic(double t, double b, double c, double d) 138 | { 139 | double s = 1.70158; double p=0; double a=c; 140 | 141 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 142 | if (a < fabs(c)) { a=c; s=p/4; } 143 | else s = p/(2*M_PI) * asin (c/a); 144 | return -(a*pow(2,10*(t-=1)) * sin( (t*d-s)*(2*M_PI)/p )) + b; 145 | } 146 | 147 | double NSBKeyframeAnimationFunctionEaseOutElastic(double t, double b, double c, double d) 148 | { 149 | double s=1.70158, p=0, a=c; 150 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 151 | if (a < fabs(c)) { a=c; s=p/4; } 152 | else s = p/(2*M_PI) * asin (c/a); 153 | return a*pow(2,-10*t) * sin( (t*d-s)*(2*M_PI)/p ) + c + b; 154 | } 155 | 156 | double NSBKeyframeAnimationFunctionEaseInOutElastic(double t, double b, double c, double d) 157 | { 158 | double s=1.70158, p=0, a=c; 159 | if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 160 | if (a < fabs(c)) { a=c; s=p/4; } 161 | else s = p/(2*M_PI) * asin(c/a); 162 | if (t < 1) return -.5*(a*pow(2,10*(t-=1)) * sin( (t*d-s)*(2*M_PI)/p )) + b; 163 | return a*pow(2,-10*(t-=1)) * sin( (t*d-s)*(2*M_PI)/p )*.5 + c + b; 164 | } 165 | 166 | double NSBKeyframeAnimationFunctionEaseInBack(double t, double b, double c, double d) 167 | { 168 | const double s = 1.70158; 169 | return c*(t/=d)*t*((s+1)*t - s) + b; 170 | } 171 | 172 | double NSBKeyframeAnimationFunctionEaseOutBack(double t, double b, double c, double d) 173 | { 174 | const double s = 1.70158; 175 | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 176 | } 177 | 178 | double NSBKeyframeAnimationFunctionEaseInOutBack(double t, double b, double c, double d) 179 | { 180 | double s = 1.70158; 181 | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 182 | return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 183 | } 184 | 185 | double NSBKeyframeAnimationFunctionEaseInBounce(double t, double b, double c, double d) 186 | { 187 | return c - NSBKeyframeAnimationFunctionEaseOutBounce(d-t, 0, c, d) + b; 188 | } 189 | 190 | double NSBKeyframeAnimationFunctionEaseOutBounce(double t, double b, double c, double d) 191 | { 192 | if ((t/=d) < (1/2.75)) { 193 | return c*(7.5625*t*t) + b; 194 | } else if (t < (2/2.75)) { 195 | return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 196 | } else if (t < (2.5/2.75)) { 197 | return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 198 | } else { 199 | return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 200 | } 201 | } 202 | 203 | double NSBKeyframeAnimationFunctionEaseInOutBounce(double t, double b, double c, double d) 204 | { 205 | if (t < d/2) 206 | return NSBKeyframeAnimationFunctionEaseInBounce (t*2, 0, c, d) * .5 + b; 207 | else 208 | return NSBKeyframeAnimationFunctionEaseOutBounce(t*2-d, 0, c, d) * .5 + c*.5 + b; 209 | } 210 | 211 | #pragma clang diagnostic pop 212 | -------------------------------------------------------------------------------- /Pod/Classes/NSBKeyframeAnimationFunctions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBKeyframeAnimationFunctions.h 3 | // NSBKeyframeAnimation 4 | // 5 | // Created by Nacho Soto on 8/6/12. 6 | // Copyright (c) 2012 Nacho Soto. All rights reserved. 7 | // 8 | 9 | typedef double (*NSBKeyframeAnimationFunction)(double, double, double, double); 10 | 11 | double NSBKeyframeAnimationFunctionLinear(double t,double b, double c, double d); 12 | 13 | double NSBKeyframeAnimationFunctionEaseInQuad(double t,double b, double c, double d); 14 | double NSBKeyframeAnimationFunctionEaseOutQuad(double t,double b, double c, double d); 15 | double NSBKeyframeAnimationFunctionEaseInOutQuad(double t,double b, double c, double d); 16 | 17 | double NSBKeyframeAnimationFunctionEaseInCubic(double t,double b, double c, double d); 18 | double NSBKeyframeAnimationFunctionEaseOutCubic(double t,double b, double c, double d); 19 | double NSBKeyframeAnimationFunctionEaseInOutCubic(double t, double b, double c, double d); 20 | 21 | double NSBKeyframeAnimationFunctionEaseInQuart(double t, double b, double c, double d); 22 | double NSBKeyframeAnimationFunctionEaseOutQuart(double t, double b, double c, double d); 23 | double NSBKeyframeAnimationFunctionEaseInOutQuart(double t, double b, double c, double d); 24 | 25 | double NSBKeyframeAnimationFunctionEaseInQuint(double t, double b, double c, double d); 26 | double NSBKeyframeAnimationFunctionEaseOutQuint(double t, double b, double c, double d); 27 | double NSBKeyframeAnimationFunctionEaseInOutQuint(double t, double b, double c, double d); 28 | 29 | double NSBKeyframeAnimationFunctionEaseInSine(double t, double b, double c, double d); 30 | double NSBKeyframeAnimationFunctionEaseOutSine(double t, double b, double c, double d); 31 | double NSBKeyframeAnimationFunctionEaseInOutSine(double t, double b, double c, double d); 32 | 33 | double NSBKeyframeAnimationFunctionEaseInExpo(double t, double b, double c, double d); 34 | double NSBKeyframeAnimationFunctionEaseOutExpo(double t, double b, double c, double d); 35 | double NSBKeyframeAnimationFunctionEaseInOutExpo(double t, double b, double c, double d); 36 | 37 | double NSBKeyframeAnimationFunctionEaseInCirc(double t, double b, double c, double d); 38 | double NSBKeyframeAnimationFunctionEaseOutCirc(double t, double b, double c, double d); 39 | double NSBKeyframeAnimationFunctionEaseInOutCirc(double t, double b, double c, double d); 40 | 41 | double NSBKeyframeAnimationFunctionEaseInElastic(double t, double b, double c, double d); 42 | double NSBKeyframeAnimationFunctionEaseOutElastic(double t, double b, double c, double d); 43 | double NSBKeyframeAnimationFunctionEaseInOutElastic(double t, double b, double c, double d); 44 | 45 | double NSBKeyframeAnimationFunctionEaseInBack(double t, double b, double c, double d); 46 | double NSBKeyframeAnimationFunctionEaseOutBack(double t, double b, double c, double d); 47 | double NSBKeyframeAnimationFunctionEaseInOutBack(double t, double b, double c, double d); 48 | 49 | double NSBKeyframeAnimationFunctionEaseInBounce(double t, double b, double c, double d); 50 | double NSBKeyframeAnimationFunctionEaseOutBounce(double t, double b, double c, double d); 51 | double NSBKeyframeAnimationFunctionEaseInOutBounce(double t, double b, double c, double d); 52 | -------------------------------------------------------------------------------- /Pod/Classes/Ouroboros.h: -------------------------------------------------------------------------------- 1 | 2 | // Ouroboros.h 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/23. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Scale.h" 11 | #import "UIView+Measure.h" 12 | #import "UIScrollView+Ouroboros.h" 13 | #import "UIView+Ouroboros.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | NSValue *NSValueFromCGRectParameters(CGFloat x, CGFloat y, CGFloat width, CGFloat height); 18 | NSValue *NSValueFromCGPointParameters(CGFloat x, CGFloat y); 19 | NSValue *NSValueFromCGSizeParameters(CGFloat width, CGFloat height); 20 | 21 | @interface Ouroboros : NSObject 22 | 23 | @property (nonatomic, weak, readonly) UIView *view; 24 | @property (nonatomic, assign, readonly) OURAnimationProperty property; 25 | @property (nonatomic, strong, readonly) NSMutableArray *scales; 26 | 27 | - (instancetype)initWithView:(UIView *)view property:(OURAnimationProperty)property; 28 | 29 | - (id)getCurrentValueWithPosition:(CGFloat)position; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /Pod/Classes/Ouroboros.m: -------------------------------------------------------------------------------- 1 | // 2 | // Ouroboros.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/23. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import "Ouroboros.h" 10 | 11 | @interface Ouroboros () 12 | 13 | @property (nonatomic, assign, readwrite) OURAnimationProperty property; 14 | @property (nonatomic, strong, readwrite) NSMutableArray *scales; 15 | @property (nonatomic, strong) id startValue; 16 | 17 | @end 18 | 19 | @implementation Ouroboros 20 | 21 | NSValue *NSValueFromCGRectParameters(CGFloat x, CGFloat y, CGFloat width, CGFloat height) { 22 | return [NSValue valueWithCGRect:CGRectMake(x, y, width, height)]; 23 | } 24 | 25 | NSValue *NSValueFromCGPointParameters(CGFloat x, CGFloat y) { 26 | return [NSValue valueWithCGPoint:CGPointMake(x, y)]; 27 | } 28 | 29 | NSValue *NSValueFromCGSizeParameters(CGFloat width, CGFloat height) { 30 | return [NSValue valueWithCGSize:CGSizeMake(width, height)]; 31 | } 32 | 33 | - (instancetype)initWithView:(UIView *)view property:(OURAnimationProperty)property { 34 | if (self = [super init]) { 35 | _view = view; 36 | _property = property; 37 | _scales = [[NSMutableArray alloc] init]; 38 | _startValue = [self startValue]; 39 | } 40 | return self; 41 | } 42 | 43 | - (id)getCurrentValueWithPosition:(CGFloat)position { 44 | Scale *previousScale = nil; 45 | Scale *afterScale = nil; 46 | for (Scale *scale in self.scales) { 47 | if ([scale isCurrentPositionOnScale:position]) { 48 | CGFloat percent = (position - scale.trigger) / scale.offset; 49 | return [scale calculateInternalValueWithPercent:percent]; 50 | } else if (scale.trigger > position && (!afterScale || afterScale.trigger > scale.trigger)) { 51 | afterScale = scale; 52 | } else if (scale.stop < position && (!previousScale || previousScale.stop < scale.stop)) { 53 | previousScale = scale; 54 | } 55 | } 56 | if (previousScale) { 57 | return previousScale.toValue; 58 | } else if (afterScale) { 59 | return afterScale.fromValue; 60 | } 61 | NSAssert(NO, @"FATAL ERROR, Unknown current value for property %@", @(self.property)); 62 | return [[NSObject alloc] init]; 63 | } 64 | 65 | - (UIScrollView *)closestScrollView { 66 | UIView *superview = self.view.superview; 67 | while (superview) { 68 | if ([superview isKindOfClass:[UIScrollView class]]) { 69 | return (UIScrollView *)superview; 70 | } 71 | superview = superview.superview; 72 | } 73 | NSAssert(NO, @"Can not find a UIScrollView on current view inheritance hierarchy"); 74 | return nil; 75 | } 76 | 77 | #pragma mark - Getter/Setter 78 | 79 | - (void)insertObject:(Scale *)currentScale inScalesAtIndex:(NSUInteger)index { 80 | Scale *previousScale = nil; 81 | Scale *afterScale = nil; 82 | for (Scale *scale in self.scales) { 83 | if ([scale isSeparateWithScale:currentScale]) { 84 | if (scale.trigger >= currentScale.stop && (!afterScale || afterScale.trigger >= scale.stop)) { 85 | afterScale = scale; 86 | } else if (scale.stop <= currentScale.trigger && (!previousScale || previousScale.stop <= scale.trigger)) { 87 | previousScale = scale; 88 | } 89 | } else { 90 | NSAssert(NO, @"Can not added an overlapping scales to the same ouroboros. currentScale: [%@, %@], existScale: [%@, %@]", @(currentScale.trigger), @(currentScale.stop), @(scale.trigger), @(scale.stop)); 91 | } 92 | } 93 | 94 | if (previousScale) { 95 | currentScale.fromValue = previousScale.toValue; 96 | } else { 97 | currentScale.fromValue = self.startValue; 98 | } 99 | if (afterScale) { 100 | afterScale.fromValue = currentScale.toValue; 101 | } 102 | [self.scales insertObject:currentScale atIndex:index]; 103 | } 104 | 105 | - (void)removeObjectFromScalesAtIndex:(NSUInteger)index { 106 | [self.scales removeObjectAtIndex:index]; 107 | } 108 | 109 | - (id)startValue { 110 | if (!_startValue) { 111 | switch (self.property) { 112 | case OURAnimationPropertyViewBackgroundColor: { 113 | _startValue = self.view.backgroundColor; 114 | } 115 | break; 116 | case OURAnimationPropertyViewBounds: { 117 | _startValue = [NSValue valueWithCGRect:self.view.bounds]; 118 | } 119 | break; 120 | case OURAnimationPropertyViewFrame: { 121 | _startValue = [NSValue valueWithCGRect:self.view.frame]; 122 | } 123 | break; 124 | case OURAnimationPropertyViewSize: { 125 | _startValue = [NSValue valueWithCGSize:self.view.frame.size]; 126 | } 127 | break; 128 | case OURAnimationPropertyViewCenter: { 129 | _startValue = [NSValue valueWithCGPoint:self.view.center]; 130 | } 131 | break; 132 | case OURAnimationPropertyViewCenterX: { 133 | _startValue = @(self.view.center.x); 134 | } 135 | break; 136 | case OURAnimationPropertyViewCenterY: { 137 | _startValue = @(self.view.center.y); 138 | } 139 | break; 140 | case OURAnimationPropertyViewOrigin: { 141 | _startValue = [NSValue valueWithCGPoint:self.view.frame.origin]; 142 | } 143 | break; 144 | case OURAnimationPropertyViewOriginX: { 145 | _startValue = @(self.view.frame.origin.x); 146 | } 147 | break; 148 | case OURAnimationPropertyViewOriginY: { 149 | _startValue = @(self.view.frame.origin.y); 150 | } 151 | break; 152 | case OURAnimationPropertyViewWidth: { 153 | _startValue = @(self.view.frame.size.width); 154 | } 155 | break; 156 | case OURAnimationPropertyViewHeight: { 157 | _startValue = @(self.view.frame.size.height); 158 | } 159 | break; 160 | case OURAnimationPropertyViewTintColor: { 161 | _startValue = self.view.tintColor; 162 | } 163 | break; 164 | case OURAnimationPropertyViewAlpha: { 165 | _startValue = @(self.view.alpha); 166 | } 167 | break; 168 | case OURAnimationPropertyViewTransform: { 169 | _startValue = [NSValue valueWithCGAffineTransform:self.view.transform]; 170 | } 171 | break; 172 | case OURAnimationPropertyLayerFrame: { 173 | _startValue = [NSValue valueWithCGRect:self.view.layer.frame]; 174 | } 175 | break; 176 | case OURAnimationPropertyLayerBounds: { 177 | _startValue = [NSValue valueWithCGRect:self.view.layer.bounds]; 178 | } 179 | break; 180 | case OURAnimationPropertyLayerPosition: { 181 | _startValue = [NSValue valueWithCGPoint:self.view.layer.position]; 182 | } 183 | break; 184 | case OURAnimationPropertyLayerZPosition: { 185 | _startValue = @(self.view.layer.zPosition); 186 | } 187 | break; 188 | case OURAnimationPropertyLayerAnchorPoint: { 189 | _startValue = [NSValue valueWithCGPoint:self.view.layer.anchorPoint]; 190 | } 191 | break; 192 | case OURAnimationPropertyLayerAnchorPointZ: { 193 | _startValue = @(self.view.layer.anchorPointZ); 194 | } 195 | break; 196 | case OURAnimationPropertyLayerTransform: { 197 | _startValue = [NSValue valueWithCATransform3D:self.view.layer.transform]; 198 | } 199 | break; 200 | case OURAnimationPropertyLayerBackgroundColor: { 201 | _startValue = [UIColor colorWithCGColor:self.view.layer.backgroundColor]; 202 | } 203 | break; 204 | case OURAnimationPropertyLayerBorderColor: { 205 | _startValue = [UIColor colorWithCGColor:self.view.layer.borderColor]; 206 | } 207 | break; 208 | case OURAnimationPropertyLayerBorderWidth: { 209 | _startValue = @(self.view.layer.borderWidth); 210 | } 211 | break; 212 | case OURAnimationPropertyLayerCornerRadius: { 213 | _startValue = @(self.view.layer.cornerRadius); 214 | } 215 | break; 216 | case OURAnimationPropertyLayerOpacity: { 217 | _startValue = @(self.view.layer.opacity); 218 | } 219 | break; 220 | 221 | default: { 222 | NSAssert(NO, @"Invalid OURAnimationProperty type. %@", @(self.property)); 223 | _startValue = [[NSObject alloc] init]; 224 | } 225 | break; 226 | } 227 | } 228 | return _startValue; 229 | } 230 | 231 | @end 232 | -------------------------------------------------------------------------------- /Pod/Classes/Scale.h: -------------------------------------------------------------------------------- 1 | // 2 | // Scale.h 3 | // Pods 4 | // 5 | // Created by Draveness on 15/11/1. 6 | // 7 | // 8 | 9 | #import 10 | #import "UIView+Ouroboros.h" 11 | 12 | typedef NS_ENUM(NSUInteger, OURAnimationFunction) { 13 | OURAnimationFunctionLinear, 14 | OURAnimationFunctionEaseInQuad, 15 | OURAnimationFunctionEaseOutQuad, 16 | OURAnimationFunctionEaseInOutQuad, 17 | OURAnimationFunctionEaseInCubic, 18 | OURAnimationFunctionEaseOutCubic, 19 | OURAnimationFunctionEaseInOutCubic, 20 | OURAnimationFunctionEaseInQuart, 21 | OURAnimationFunctionEaseOutQuart, 22 | OURAnimationFunctionEaseInOutQuart, 23 | OURAnimationFunctionEaseInQuint, 24 | OURAnimationFunctionEaseOutQuint, 25 | OURAnimationFunctionEaseInOutQuint, 26 | OURAnimationFunctionEaseInSine, 27 | OURAnimationFunctionEaseOutSine, 28 | OURAnimationFunctionEaseInOutSine, 29 | OURAnimationFunctionEaseInExpo, 30 | OURAnimationFunctionEaseOutExpo, 31 | OURAnimationFunctionEaseInOutExpo, 32 | OURAnimationFunctionEaseInCirc, 33 | OURAnimationFunctionEaseOutCirc, 34 | OURAnimationFunctionEaseInOutCirc, 35 | OURAnimationFunctionEaseInElastic, 36 | OURAnimationFunctionEaseOutElastic, 37 | OURAnimationFunctionEaseInOutElastic, 38 | OURAnimationFunctionEaseInBack, 39 | OURAnimationFunctionEaseOutBack, 40 | OURAnimationFunctionEaseInOutBack, 41 | OURAnimationFunctionEaseInBounce, 42 | OURAnimationFunctionEaseOutBounce, 43 | OURAnimationFunctionEaseInOutBounce, 44 | }; 45 | 46 | NS_ASSUME_NONNULL_BEGIN 47 | 48 | @interface Scale : NSObject 49 | 50 | @property (nonatomic, strong) id fromValue; 51 | @property (nonatomic, strong) id toValue; 52 | @property (nonatomic, assign) CGFloat trigger; 53 | @property (nonatomic, assign) CGFloat offset; 54 | @property (nonatomic, assign, readonly) CGFloat stop; 55 | @property (nonatomic, assign) OURAnimationFunction function; 56 | 57 | - (id)calculateInternalValueWithPercent:(CGFloat)percent; 58 | 59 | - (BOOL)isCurrentPositionOnScale:(CGFloat)currentPostion; 60 | - (BOOL)isSeparateWithScale:(Scale *)scale; 61 | 62 | @end 63 | 64 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Pod/Classes/Scale.m: -------------------------------------------------------------------------------- 1 | // 2 | // Scale.m 3 | // Pods 4 | // 5 | // Created by Draveness on 15/11/1. 6 | // 7 | // 8 | 9 | #import "Scale.h" 10 | #import "NSBKeyframeAnimationFunctions.h" 11 | 12 | typedef double(^NSBKeyframeAnimationFunctionBlock)(double t, double b, double c, double d); 13 | 14 | @interface Scale () 15 | 16 | @property (nonatomic, copy) NSBKeyframeAnimationFunctionBlock functionBlock; 17 | 18 | @end 19 | 20 | @implementation Scale 21 | 22 | - (instancetype)init { 23 | if (self = [super init]) { 24 | _function = OURAnimationFunctionLinear; 25 | _functionBlock = ^double(double t, double b, double c, double d) { 26 | return NSBKeyframeAnimationFunctionLinear(t, b, c, d); 27 | }; 28 | } 29 | return self; 30 | } 31 | 32 | - (id)calculateInternalValueWithPercent:(CGFloat)percent { 33 | percent = [self justifyPercent:percent]; 34 | 35 | CGFloat value = self.functionBlock(self.offset * percent * 1000, 0, 1, self.offset * 1000); 36 | 37 | id result = [[NSValue alloc] init]; 38 | if ([self.fromValue isKindOfClass:[NSNumber class]]) { 39 | CGFloat fromValue = [self.fromValue floatValue]; 40 | CGFloat toValue = [self.toValue floatValue]; 41 | 42 | CGFloat resultValue = fromValue + (toValue - fromValue) * value; 43 | result = @(resultValue); 44 | } else if ([self.fromValue isKindOfClass:[UIColor class]]) { 45 | UIColor *fromValue = self.fromValue; 46 | UIColor *toValue = self.toValue; 47 | 48 | const CGFloat *fromComponents = CGColorGetComponents(fromValue.CGColor); 49 | const CGFloat *toComponents = CGColorGetComponents(toValue.CGColor); 50 | if (CGColorGetNumberOfComponents(fromValue.CGColor) == 2) { 51 | fromValue = [UIColor colorWithRed:fromComponents[0] green:fromComponents[0] blue:fromComponents[0] alpha:fromComponents[1]]; 52 | fromComponents = CGColorGetComponents(fromValue.CGColor); 53 | } 54 | if (CGColorGetNumberOfComponents(toValue.CGColor) == 2) { 55 | toValue = [UIColor colorWithRed:toComponents[0] green:toComponents[0] blue:toComponents[0] alpha:toComponents[1]]; 56 | toComponents = CGColorGetComponents(toValue.CGColor); 57 | } 58 | 59 | CGFloat redComponent = fromComponents[0] + (toComponents[0] - fromComponents[0]) * value; 60 | CGFloat greenComponent = fromComponents[1] + (toComponents[1] - fromComponents[1]) * value; 61 | CGFloat blueComponent = fromComponents[2] + (toComponents[2] - fromComponents[2]) * value; 62 | CGFloat alphaComponent = fromComponents[3] + (toComponents[3] - fromComponents[3]) * value; 63 | 64 | result = [UIColor colorWithRed:redComponent green:greenComponent blue:blueComponent alpha:alphaComponent]; 65 | } else if ([self.fromValue isKindOfClass:[NSValue class]]) { 66 | NSString *valueType = [NSString stringWithCString:[self.fromValue objCType] encoding:NSStringEncodingConversionAllowLossy]; 67 | if ([valueType containsString:@"CGRect"]) { 68 | CGRect fromValue = [self.fromValue CGRectValue]; 69 | CGRect toValue = [self.toValue CGRectValue]; 70 | 71 | CGRect resultValue = 72 | CGRectMake( 73 | fromValue.origin.x + (toValue.origin.x - fromValue.origin.x) * value, 74 | fromValue.origin.y + (toValue.origin.y - fromValue.origin.y) * value, 75 | fromValue.size.width + (toValue.size.width - fromValue.size.width) * value, 76 | fromValue.size.height + (toValue.size.height - fromValue.size.height) * value 77 | ); 78 | result = [NSValue valueWithCGRect:resultValue]; 79 | } else if ([valueType containsString:@"CGSize"]) { 80 | CGSize fromValue = [self.fromValue CGSizeValue]; 81 | CGSize toValue = [self.toValue CGSizeValue]; 82 | 83 | CGSize resultValue = 84 | CGSizeMake( 85 | fromValue.width + (toValue.width - fromValue.width) * value, 86 | fromValue.height + (toValue.height - fromValue.height) * value 87 | ); 88 | result = [NSValue valueWithCGSize:resultValue]; 89 | } else if ([valueType containsString:@"CGPoint"]) { 90 | CGPoint fromValue = [self.fromValue CGPointValue]; 91 | CGPoint toValue = [self.toValue CGPointValue]; 92 | 93 | CGPoint resultValue = 94 | CGPointMake( 95 | fromValue.x + (toValue.x - fromValue.x) * value, 96 | fromValue.y + (toValue.y - fromValue.y) * value 97 | ); 98 | result = [NSValue valueWithCGPoint:resultValue]; 99 | } else if ([valueType containsString:@"CATransform3D"]) { 100 | CATransform3D fromTransform = [self.fromValue CATransform3DValue]; 101 | CATransform3D toTransform = [self.toValue CATransform3DValue]; 102 | 103 | CATransform3D resultValue = CATransform3DIdentity; 104 | CGFloat m11 = fromTransform.m11 + (toTransform.m11 - fromTransform.m11) * value; 105 | CGFloat m12 = fromTransform.m12 + (toTransform.m12 - fromTransform.m12) * value; 106 | CGFloat m13 = fromTransform.m13 + (toTransform.m13 - fromTransform.m13) * value; 107 | CGFloat m14 = fromTransform.m14 + (toTransform.m14 - fromTransform.m14) * value; 108 | CGFloat m21 = fromTransform.m21 + (toTransform.m21 - fromTransform.m21) * value; 109 | CGFloat m22 = fromTransform.m22 + (toTransform.m22 - fromTransform.m22) * value; 110 | CGFloat m23 = fromTransform.m23 + (toTransform.m23 - fromTransform.m23) * value; 111 | CGFloat m24 = fromTransform.m24 + (toTransform.m24 - fromTransform.m24) * value; 112 | CGFloat m31 = fromTransform.m31 + (toTransform.m31 - fromTransform.m31) * value; 113 | CGFloat m32 = fromTransform.m32 + (toTransform.m32 - fromTransform.m32) * value; 114 | CGFloat m33 = fromTransform.m33 + (toTransform.m33 - fromTransform.m33) * value; 115 | CGFloat m34 = fromTransform.m34 + (toTransform.m34 - fromTransform.m34) * value; 116 | CGFloat m41 = fromTransform.m41 + (toTransform.m41 - fromTransform.m41) * value; 117 | CGFloat m42 = fromTransform.m42 + (toTransform.m42 - fromTransform.m42) * value; 118 | CGFloat m43 = fromTransform.m43 + (toTransform.m43 - fromTransform.m43) * value; 119 | CGFloat m44 = fromTransform.m44 + (toTransform.m44 - fromTransform.m44) * value; 120 | 121 | resultValue.m11 = m11; 122 | resultValue.m12 = m12; 123 | resultValue.m13 = m13; 124 | resultValue.m14 = m14; 125 | resultValue.m21 = m21; 126 | resultValue.m22 = m22; 127 | resultValue.m23 = m23; 128 | resultValue.m24 = m24; 129 | resultValue.m31 = m31; 130 | resultValue.m32 = m32; 131 | resultValue.m33 = m33; 132 | resultValue.m34 = m34; 133 | resultValue.m41 = m41; 134 | resultValue.m42 = m42; 135 | resultValue.m43 = m43; 136 | resultValue.m44 = m44; 137 | 138 | result = [NSValue valueWithCATransform3D:resultValue]; 139 | } else if ([valueType containsString:@"CGAffineTransform"]) { 140 | CGAffineTransform fromTransform = [self.fromValue CGAffineTransformValue]; 141 | CGAffineTransform toTransform = [self.toValue CGAffineTransformValue]; 142 | 143 | CGFloat a = fromTransform.a + (toTransform.a - fromTransform.a) * percent; 144 | CGFloat b = fromTransform.b + (toTransform.b - fromTransform.b) * percent; 145 | CGFloat c = fromTransform.c + (toTransform.c - fromTransform.c) * percent; 146 | CGFloat d = fromTransform.d + (toTransform.d - fromTransform.d) * percent; 147 | CGFloat tx = fromTransform.tx + (toTransform.tx - fromTransform.tx) * percent; 148 | CGFloat ty = fromTransform.ty + (toTransform.ty - fromTransform.ty) * percent; 149 | 150 | CGAffineTransform resultValue = CGAffineTransformIdentity; 151 | 152 | resultValue.a = a; 153 | resultValue.b = b; 154 | resultValue.c = c; 155 | resultValue.d = d; 156 | resultValue.tx = tx; 157 | resultValue.ty = ty; 158 | 159 | result = [NSValue valueWithCGAffineTransform:resultValue]; 160 | } 161 | } 162 | 163 | return result; 164 | } 165 | 166 | - (CGFloat)justifyPercent:(CGFloat)percent { 167 | if (percent < 0) { 168 | return 0; 169 | } else if (percent > 1) { 170 | return 1; 171 | } else { 172 | return percent; 173 | } 174 | } 175 | 176 | - (CGFloat)stop { 177 | return self.trigger + self.offset; 178 | } 179 | 180 | - (BOOL)isCurrentPositionOnScale:(CGFloat)currentPostion { 181 | return currentPostion >= self.trigger && currentPostion <= self.stop; 182 | } 183 | 184 | - (BOOL)isSeparateWithScale:(Scale *)scale { 185 | return scale.stop <= self.trigger || scale.trigger >= self.stop; 186 | } 187 | 188 | #pragma mark - Getter/Setter 189 | 190 | - (void)setFunction:(OURAnimationFunction)function { 191 | _function = function; 192 | switch (_function) { 193 | case OURAnimationFunctionLinear: { 194 | self.functionBlock = ^double(double t, double b, double c, double d) { 195 | return NSBKeyframeAnimationFunctionLinear(t, b, c, d); 196 | }; 197 | } 198 | break; 199 | case OURAnimationFunctionEaseInQuad: { 200 | self.functionBlock = ^double(double t, double b, double c, double d) { 201 | return NSBKeyframeAnimationFunctionEaseInQuad(t, b, c, d); 202 | }; 203 | } 204 | break; 205 | case OURAnimationFunctionEaseOutQuad: { 206 | self.functionBlock = ^double(double t, double b, double c, double d) { 207 | return NSBKeyframeAnimationFunctionEaseOutQuad(t, b, c, d); 208 | }; 209 | } 210 | break; 211 | case OURAnimationFunctionEaseInOutQuad: { 212 | self.functionBlock = ^double(double t, double b, double c, double d) { 213 | return NSBKeyframeAnimationFunctionEaseInOutQuad(t, b, c, d); 214 | }; 215 | } 216 | break; 217 | case OURAnimationFunctionEaseInCubic: { 218 | self.functionBlock = ^double(double t, double b, double c, double d) { 219 | return NSBKeyframeAnimationFunctionEaseInCubic(t, b, c, d); 220 | }; 221 | } 222 | break; 223 | case OURAnimationFunctionEaseOutCubic: { 224 | self.functionBlock = ^double(double t, double b, double c, double d) { 225 | return NSBKeyframeAnimationFunctionEaseOutCubic(t, b, c, d); 226 | }; 227 | } 228 | break; 229 | case OURAnimationFunctionEaseInOutCubic: { 230 | self.functionBlock = ^double(double t, double b, double c, double d) { 231 | return NSBKeyframeAnimationFunctionEaseInOutCubic(t, b, c, d); 232 | }; 233 | } 234 | break; 235 | case OURAnimationFunctionEaseInQuart: { 236 | self.functionBlock = ^double(double t, double b, double c, double d) { 237 | return NSBKeyframeAnimationFunctionEaseInQuart(t, b, c, d); 238 | }; 239 | } 240 | break; 241 | case OURAnimationFunctionEaseOutQuart: { 242 | self.functionBlock = ^double(double t, double b, double c, double d) { 243 | return NSBKeyframeAnimationFunctionEaseOutQuart(t, b, c, d); 244 | }; 245 | } 246 | break; 247 | case OURAnimationFunctionEaseInOutQuart: { 248 | self.functionBlock = ^double(double t, double b, double c, double d) { 249 | return NSBKeyframeAnimationFunctionEaseInOutQuart(t, b, c, d); 250 | }; 251 | } 252 | break; 253 | case OURAnimationFunctionEaseInQuint: { 254 | self.functionBlock = ^double(double t, double b, double c, double d) { 255 | return NSBKeyframeAnimationFunctionEaseInQuint(t, b, c, d); 256 | }; 257 | } 258 | break; 259 | case OURAnimationFunctionEaseOutQuint: { 260 | self.functionBlock = ^double(double t, double b, double c, double d) { 261 | return NSBKeyframeAnimationFunctionEaseOutQuint(t, b, c, d); 262 | }; 263 | } 264 | break; 265 | case OURAnimationFunctionEaseInOutQuint: { 266 | self.functionBlock = ^double(double t, double b, double c, double d) { 267 | return NSBKeyframeAnimationFunctionEaseInOutQuint(t, b, c, d); 268 | }; 269 | } 270 | break; 271 | case OURAnimationFunctionEaseInSine: { 272 | self.functionBlock = ^double(double t, double b, double c, double d) { 273 | return NSBKeyframeAnimationFunctionEaseInSine(t, b, c, d); 274 | }; 275 | } 276 | break; 277 | case OURAnimationFunctionEaseOutSine: { 278 | self.functionBlock = ^double(double t, double b, double c, double d) { 279 | return NSBKeyframeAnimationFunctionEaseOutSine(t, b, c, d); 280 | }; 281 | } 282 | break; 283 | case OURAnimationFunctionEaseInOutSine: { 284 | self.functionBlock = ^double(double t, double b, double c, double d) { 285 | return NSBKeyframeAnimationFunctionEaseInOutSine(t, b, c, d); 286 | }; 287 | } 288 | break; 289 | case OURAnimationFunctionEaseInExpo: { 290 | self.functionBlock = ^double(double t, double b, double c, double d) { 291 | return NSBKeyframeAnimationFunctionEaseInExpo(t, b, c, d); 292 | }; 293 | } 294 | break; 295 | case OURAnimationFunctionEaseOutExpo: { 296 | self.functionBlock = ^double(double t, double b, double c, double d) { 297 | return NSBKeyframeAnimationFunctionEaseOutExpo(t, b, c, d); 298 | }; 299 | } 300 | break; 301 | case OURAnimationFunctionEaseInOutExpo: { 302 | self.functionBlock = ^double(double t, double b, double c, double d) { 303 | return NSBKeyframeAnimationFunctionEaseInOutExpo(t, b, c, d); 304 | }; 305 | } 306 | break; 307 | case OURAnimationFunctionEaseInCirc: { 308 | self.functionBlock = ^double(double t, double b, double c, double d) { 309 | return NSBKeyframeAnimationFunctionEaseInCirc(t, b, c, d); 310 | }; 311 | } 312 | break; 313 | case OURAnimationFunctionEaseOutCirc: { 314 | self.functionBlock = ^double(double t, double b, double c, double d) { 315 | return NSBKeyframeAnimationFunctionEaseOutCirc(t, b, c, d); 316 | }; 317 | } 318 | break; 319 | case OURAnimationFunctionEaseInOutCirc: { 320 | self.functionBlock = ^double(double t, double b, double c, double d) { 321 | return NSBKeyframeAnimationFunctionEaseInOutCirc(t, b, c, d); 322 | }; 323 | } 324 | break; 325 | case OURAnimationFunctionEaseInElastic: { 326 | self.functionBlock = ^double(double t, double b, double c, double d) { 327 | return NSBKeyframeAnimationFunctionEaseInElastic(t, b, c, d); 328 | }; 329 | } 330 | break; 331 | case OURAnimationFunctionEaseOutElastic: { 332 | self.functionBlock = ^double(double t, double b, double c, double d) { 333 | return NSBKeyframeAnimationFunctionEaseOutElastic(t, b, c, d); 334 | }; 335 | } 336 | break; 337 | case OURAnimationFunctionEaseInOutElastic: { 338 | self.functionBlock = ^double(double t, double b, double c, double d) { 339 | return NSBKeyframeAnimationFunctionEaseInOutElastic(t, b, c, d); 340 | }; 341 | } 342 | break; 343 | case OURAnimationFunctionEaseInBack: { 344 | self.functionBlock = ^double(double t, double b, double c, double d) { 345 | return NSBKeyframeAnimationFunctionEaseInBack(t, b, c, d); 346 | }; 347 | } 348 | break; 349 | case OURAnimationFunctionEaseOutBack: { 350 | self.functionBlock = ^double(double t, double b, double c, double d) { 351 | return NSBKeyframeAnimationFunctionEaseOutBack(t, b, c, d); 352 | }; 353 | } 354 | break; 355 | case OURAnimationFunctionEaseInOutBack: { 356 | self.functionBlock = ^double(double t, double b, double c, double d) { 357 | return NSBKeyframeAnimationFunctionEaseInOutBack(t, b, c, d); 358 | }; 359 | } 360 | break; 361 | case OURAnimationFunctionEaseInBounce: { 362 | self.functionBlock = ^double(double t, double b, double c, double d) { 363 | return NSBKeyframeAnimationFunctionEaseInBounce(t, b, c, d); 364 | }; 365 | } 366 | break; 367 | case OURAnimationFunctionEaseOutBounce: { 368 | self.functionBlock = ^double(double t, double b, double c, double d) { 369 | return NSBKeyframeAnimationFunctionEaseOutBounce(t, b, c, d); 370 | }; 371 | } 372 | break; 373 | case OURAnimationFunctionEaseInOutBounce: { 374 | self.functionBlock = ^double(double t, double b, double c, double d) { 375 | return NSBKeyframeAnimationFunctionEaseInOutBounce(t, b, c, d); 376 | }; 377 | } 378 | break; 379 | default: { 380 | NSAssert(NO, @"Invalid Animation Function type."); 381 | } 382 | break; 383 | } 384 | } 385 | 386 | @end 387 | -------------------------------------------------------------------------------- /Pod/Classes/UIScrollView+Ouroboros.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+Ouroboros.h 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef NS_ENUM(NSUInteger, OURScrollDirection) { 13 | OURScrollDirectionVertical, 14 | OURScrollDirectionHorizontal, 15 | }; 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | extern NSString *const OURScrollViewUpdateContentOffset; 20 | 21 | @interface UIScrollView (Ouroboros) 22 | 23 | @property (nonatomic, assign) OURScrollDirection ou_scrollDirection; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Pod/Classes/UIScrollView+Ouroboros.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+Ouroboros.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import "UIScrollView+Ouroboros.h" 10 | #import 11 | 12 | NSString *const OURScrollViewUpdateContentOffset = @"OURScrollViewUpdateContentOffset"; 13 | 14 | @implementation UIScrollView (Ouroboros) 15 | 16 | + (void)load { 17 | static dispatch_once_t onceToken; 18 | dispatch_once(&onceToken, ^{ 19 | Class class = [self class]; 20 | SEL originalSelector = @selector(setContentOffset:); 21 | SEL swizzledSelector = @selector(ou_setContentOffset:); 22 | Method originalMethod = class_getInstanceMethod(class, originalSelector); 23 | Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); 24 | BOOL didAddMethod = 25 | class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); 26 | if (didAddMethod){ 27 | class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 28 | } else { 29 | method_exchangeImplementations(originalMethod, swizzledMethod); 30 | } 31 | }); 32 | } 33 | 34 | - (void)ou_setContentOffset:(CGPoint)contentOffset { 35 | [self ou_setContentOffset:contentOffset]; 36 | [[NSNotificationCenter defaultCenter] postNotificationName:OURScrollViewUpdateContentOffset 37 | object:nil 38 | userInfo:@{@"contentOffset": [NSValue valueWithCGPoint:contentOffset], 39 | @"direction":@(self.ou_scrollDirection)}]; 40 | } 41 | 42 | #pragma mark - Getter/Setter 43 | 44 | - (OURScrollDirection)ou_scrollDirection { 45 | return [objc_getAssociatedObject(self, @selector(ou_scrollDirection)) integerValue]; 46 | } 47 | 48 | - (void)setOu_scrollDirection:(OURScrollDirection)ou_scrollDirection { 49 | objc_setAssociatedObject(self, @selector(ou_scrollDirection), @(ou_scrollDirection), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pod/Classes/UIView+Measure.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Measure.h 3 | // Pods 4 | // 5 | // Created by Draveness on 15/10/31. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Measure) 12 | 13 | - (CGFloat)our_width; 14 | - (CGFloat)our_height; 15 | - (CGFloat)our_left; 16 | - (CGFloat)our_right; 17 | - (CGFloat)our_top; 18 | - (CGFloat)our_bottom; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pod/Classes/UIView+Measure.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Measure.m 3 | // Pods 4 | // 5 | // Created by Draveness on 15/10/31. 6 | // 7 | // 8 | 9 | #import "UIView+Measure.h" 10 | 11 | @implementation UIView (Measure) 12 | 13 | - (CGFloat)our_width { 14 | return self.frame.size.width; 15 | } 16 | 17 | - (CGFloat)our_height { 18 | return self.frame.size.height; 19 | } 20 | 21 | - (CGFloat)our_left { 22 | return self.frame.origin.x; 23 | } 24 | 25 | - (CGFloat)our_right { 26 | return self.frame.origin.x + self.frame.size.width; 27 | } 28 | 29 | - (CGFloat)our_top { 30 | return self.frame.origin.y; 31 | } 32 | 33 | - (CGFloat)our_bottom { 34 | return self.frame.origin.y + self.frame.size.height; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Pod/Classes/UIView+Ouroboros.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Ouroboros.h 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class Ouroboros; 12 | @class Scale; 13 | 14 | typedef NS_ENUM(NSUInteger, OURAnimationProperty) { 15 | OURAnimationPropertyViewFrame, 16 | OURAnimationPropertyViewBounds, 17 | OURAnimationPropertyViewSize, 18 | OURAnimationPropertyViewCenter, 19 | OURAnimationPropertyViewPosition, 20 | OURAnimationPropertyViewOrigin, 21 | OURAnimationPropertyViewOriginX, 22 | OURAnimationPropertyViewOriginY, 23 | OURAnimationPropertyViewWidth, 24 | OURAnimationPropertyViewHeight, 25 | OURAnimationPropertyViewCenterX, 26 | OURAnimationPropertyViewCenterY, 27 | OURAnimationPropertyViewBackgroundColor, 28 | OURAnimationPropertyViewTintColor, 29 | OURAnimationPropertyViewAlpha, 30 | OURAnimationPropertyViewTransform, 31 | OURAnimationPropertyLayerFrame, 32 | OURAnimationPropertyLayerBounds, 33 | OURAnimationPropertyLayerPosition, 34 | OURAnimationPropertyLayerZPosition, 35 | OURAnimationPropertyLayerAnchorPoint, 36 | OURAnimationPropertyLayerAnchorPointZ, 37 | OURAnimationPropertyLayerTransform, 38 | OURAnimationPropertyLayerBackgroundColor, 39 | OURAnimationPropertyLayerCornerRadius, 40 | OURAnimationPropertyLayerBorderWidth, 41 | OURAnimationPropertyLayerBorderColor, 42 | OURAnimationPropertyLayerOpacity, 43 | }; 44 | 45 | NS_ASSUME_NONNULL_BEGIN 46 | 47 | typedef void(^ScaleAnimationBlock)(Scale *scale); 48 | 49 | @interface UIView (Ouroboros) 50 | 51 | - (void)our_animateWithProperty:(OURAnimationProperty)property 52 | configureBlock:(ScaleAnimationBlock)configureBlock; 53 | 54 | - (void)our_pinWithConfigureBlock:(ScaleAnimationBlock)configureBlock; 55 | 56 | - (void)updateState:(NSNotification *)notification; 57 | 58 | @end 59 | 60 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Pod/Classes/UIView+Ouroboros.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Ouroboros.m 3 | // Ouroboros 4 | // 5 | // Created by Draveness on 15/10/5. 6 | // Copyright © 2015年 Draveness. All rights reserved. 7 | // 8 | 9 | #import "UIView+Ouroboros.h" 10 | #import "UIScrollView+Ouroboros.h" 11 | #import "Ouroboros.h" 12 | #import 13 | 14 | @interface UIView () 15 | 16 | @property (nonatomic, strong) NSMutableArray *ouroboroses; 17 | 18 | @end 19 | 20 | @implementation UIView (Ouroboros) 21 | 22 | - (void)our_animateWithProperty:(OURAnimationProperty)property 23 | configureBlock:(ScaleAnimationBlock)configureBlock { 24 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateState:) name:OURScrollViewUpdateContentOffset object:nil]; 25 | Ouroboros *ouroboros = [self ouroborosWithProperty:property]; 26 | Scale *scale = [[Scale alloc] init]; 27 | configureBlock(scale); 28 | NSMutableArray *scales = [ouroboros mutableArrayValueForKey:@"scales"]; 29 | [scales addObject:scale]; 30 | } 31 | 32 | - (void)our_pinWithConfigureBlock:(ScaleAnimationBlock)configureBlock { 33 | OURAnimationProperty property = [[self closestScrollView] ou_scrollDirection] ? OURAnimationPropertyViewCenterX : OURAnimationPropertyViewCenterY; 34 | [self our_animateWithProperty:property configureBlock:^(Scale * _Nonnull scale) { 35 | scale.trigger = 0; 36 | scale.offset = INT_MAX; 37 | scale.fromValue = (property == OURAnimationPropertyViewCenterX) ? @(self.center.x) : @(self.center.y); 38 | if (configureBlock) configureBlock(scale); 39 | scale.toValue = @([scale.fromValue floatValue] + scale.offset); 40 | }]; 41 | } 42 | 43 | - (Ouroboros *)ouroborosWithProperty:(OURAnimationProperty)property { 44 | for (Ouroboros *ouroboros in self.ouroboroses) { 45 | if (ouroboros.property == property) { 46 | return ouroboros; 47 | } 48 | } 49 | Ouroboros *ouroboros = [[Ouroboros alloc] initWithView:self property:property]; 50 | [self.ouroboroses addObject:ouroboros]; 51 | return ouroboros; 52 | } 53 | 54 | - (UIScrollView *)closestScrollView { 55 | UIView *superview = self.superview; 56 | while (superview) { 57 | if ([superview isKindOfClass:[UIScrollView class]]) { 58 | return (UIScrollView *)superview; 59 | } 60 | superview = superview.superview; 61 | } 62 | NSAssert(NO, @"Cannot find a UIScrollView on current view inheritance hierarchy"); 63 | return nil; 64 | } 65 | 66 | - (void)updateState:(NSNotification *)notification { 67 | CGPoint contentOffset = [[notification userInfo][@"contentOffset"] CGPointValue]; 68 | OURScrollDirection direction = [[notification userInfo][@"direction"] integerValue]; 69 | for (Ouroboros *ouroboros in self.ouroboroses) { 70 | CGFloat currentPosition = 0; 71 | if (direction == OURScrollDirectionHorizontal) { 72 | currentPosition = contentOffset.x; 73 | } else { 74 | currentPosition = contentOffset.y; 75 | } 76 | 77 | id value = [ouroboros getCurrentValueWithPosition:currentPosition]; 78 | OURAnimationProperty property = ouroboros.property; 79 | 80 | CGPoint originCenter = self.center; 81 | 82 | switch (property) { 83 | case OURAnimationPropertyViewBackgroundColor: { 84 | self.backgroundColor = value; 85 | } 86 | break; 87 | case OURAnimationPropertyViewBounds: 88 | case OURAnimationPropertyViewFrame: { 89 | self.frame = [value CGRectValue]; 90 | } 91 | break; 92 | case OURAnimationPropertyViewSize: { 93 | self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, [value CGSizeValue].width, [value CGSizeValue].height); 94 | self.center = originCenter; 95 | } 96 | break; 97 | case OURAnimationPropertyViewPosition: 98 | case OURAnimationPropertyViewCenter: { 99 | self.center = [value CGPointValue]; 100 | } 101 | break; 102 | case OURAnimationPropertyViewCenterX: { 103 | self.center = CGPointMake([value floatValue], self.center.y); 104 | } 105 | break; 106 | case OURAnimationPropertyViewCenterY: { 107 | self.center = CGPointMake(self.center.x, [value floatValue]); 108 | } 109 | break; 110 | case OURAnimationPropertyViewOrigin: { 111 | self.frame = CGRectMake([value CGPointValue].x, [value CGPointValue].y, self.frame.size.width, self.frame.size.height); 112 | } 113 | break; 114 | case OURAnimationPropertyViewOriginX: { 115 | self.frame = CGRectMake([value floatValue], self.frame.origin.y, self.frame.size.width, self.frame.size.height); 116 | } 117 | break; 118 | case OURAnimationPropertyViewOriginY: { 119 | self.frame = CGRectMake(self.frame.origin.x, [value floatValue], self.frame.size.width, self.frame.size.height); 120 | } 121 | break; 122 | case OURAnimationPropertyViewWidth: { 123 | self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, [value floatValue], self.frame.size.height); 124 | self.center = originCenter; 125 | } 126 | break; 127 | case OURAnimationPropertyViewHeight: { 128 | self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, [value floatValue]); 129 | self.center = originCenter; 130 | } 131 | break; 132 | case OURAnimationPropertyViewTintColor: { 133 | self.tintColor = value; 134 | } 135 | break; 136 | case OURAnimationPropertyViewAlpha: { 137 | self.alpha = [value floatValue]; 138 | } 139 | break; 140 | case OURAnimationPropertyViewTransform: { 141 | self.transform = [value CGAffineTransformValue]; 142 | } 143 | break; 144 | case OURAnimationPropertyLayerFrame: { 145 | self.layer.frame = [value CGRectValue]; 146 | } 147 | break; 148 | case OURAnimationPropertyLayerBounds: { 149 | self.layer.bounds = [value CGRectValue]; 150 | } 151 | break; 152 | case OURAnimationPropertyLayerPosition: { 153 | self.layer.position = [value CGPointValue]; 154 | } 155 | break; 156 | case OURAnimationPropertyLayerZPosition: { 157 | self.layer.zPosition = [value floatValue]; 158 | } 159 | break; 160 | case OURAnimationPropertyLayerAnchorPoint: { 161 | self.layer.anchorPoint = [value CGPointValue]; 162 | } 163 | break; 164 | case OURAnimationPropertyLayerAnchorPointZ: { 165 | self.layer.anchorPointZ = [value floatValue]; 166 | } 167 | break; 168 | case OURAnimationPropertyLayerTransform: { 169 | self.layer.transform = [value CATransform3DValue]; 170 | } 171 | break; 172 | case OURAnimationPropertyLayerBackgroundColor: { 173 | self.layer.backgroundColor = [value CGColor]; 174 | } 175 | break; 176 | case OURAnimationPropertyLayerBorderColor: { 177 | self.layer.borderColor = [value CGColor]; 178 | } 179 | break; 180 | case OURAnimationPropertyLayerBorderWidth: { 181 | self.layer.borderWidth = [value floatValue]; 182 | } 183 | break; 184 | case OURAnimationPropertyLayerCornerRadius: { 185 | self.layer.cornerRadius = [value floatValue]; 186 | } 187 | break; 188 | case OURAnimationPropertyLayerOpacity: { 189 | self.layer.opacity = [value floatValue]; 190 | } 191 | break; 192 | default: 193 | break; 194 | } 195 | } 196 | } 197 | 198 | #pragma mark - Getter/Setter 199 | 200 | - (NSMutableArray *)ouroboroses { 201 | if (!objc_getAssociatedObject(self, @selector(ouroboroses))) { 202 | objc_setAssociatedObject(self, @selector(ouroboroses), [[NSMutableArray alloc] init], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 203 | } 204 | return objc_getAssociatedObject(self, @selector(ouroboroses)); 205 | } 206 | 207 | - (void)setOuroboroses:(NSMutableArray *)ouroboroses { 208 | objc_setAssociatedObject(self, @selector(ouroboroses), ouroboroses, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 209 | } 210 | 211 | @end 212 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ouroboros 2 | 3 | [![CI Status](http://img.shields.io/travis/Draveness/Ouroboros.svg?style=flat)](https://travis-ci.org/Draveness/Ouroboros) 4 | [![Version](https://img.shields.io/cocoapods/v/Ouroboros.svg?style=flat)](http://cocoapods.org/pods/Ouroboros) 5 | [![License](https://img.shields.io/cocoapods/l/Ouroboros.svg?style=flat)](http://cocoapods.org/pods/Ouroboros) 6 | [![Platform](https://img.shields.io/cocoapods/p/Ouroboros.svg?style=flat)](http://cocoapods.org/pods/Ouroboros) 7 | 8 | 9 | This is an Objective-C library for magical scroll interactions. Ouroboros is inspired by javascript third-party framework `scrollmagic`. You can create magical scroll interactions with `Ouroboros` in iOS App. 10 | 11 | ## Features 12 | 13 | - [x] Different scroll direction support 14 | - [x] UIView / Layer animation 15 | - [x] Overlapping animation detect 16 | - [x] Measure guide for UIView 17 | - [x] Animation curve support 18 | - [ ] Mac OS X support 19 | 20 | 21 | ## Demo 22 | 23 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 24 | 25 | ![Demo](./demo.gif) 26 | 27 | ## Installation with CocoaPods 28 | 29 | Ouroboros is available through [CocoaPods](http://cocoapods.org). To install 30 | it, simply add the following line to your Podfile: 31 | 32 | ```ruby 33 | pod "Ouroboros" 34 | ``` 35 | 36 | ## Usage 37 | 38 | ```objectivec 39 | #import "Ouroboros.h" 40 | ``` 41 | 42 | ### Animate 43 | 44 | Add animation to a `view` is extremely easy. `Ouroboros` provides a bunch of convience APIs on `UIView` through category. Directly invoke `our_animateWithProperty:configureBlock:` method of `UIView` instance. 45 | 46 | ```objectivec 47 | view.backgroundColor = [UIColor redColor]; 48 | [view our_animateWithProperty:OURAnimationPropertyViewBackgroundColor 49 | configureBlock:^(Ouroboros *ouroboros) { 50 | ouroboros.toValue = [UIColor blueColor]; 51 | ouroboros.trigger = 0; 52 | ouroboros.offset = 100; 53 | }]; 54 | ``` 55 | 56 | You should pass a type of `OURAnimationProperty` to this method, and set up the `ouroboros` instance in the block. And that's it. 57 | 58 | `trigger` is the point when the animation start and `offset` is the distance the animation occurs. 59 | 60 | Different kinds of animation needs different kinds of `toValue`. The `fromValue` for each view is the start value of it. i.e. the above `Ouroboros` animation's `fromValue` is `[UIColor redColor]`. So you do not need to pass a `fromValue` parameter to `ouroboros` object. 61 | 62 | ### Pin 63 | 64 | If you would like to pin a view to some position, call `our_pinWithConfigureBlock:` method directly. The default `trigger` for this pin animation is `0` and `offset` is `INT_MAX`. This method just animate view's center according to `OURScrollDirection` and 65 | 66 | ```objectivec 67 | [yellowView our_pinWithConfigureBlock:^(Scale * _Nonnull scale) { 68 | scale.trigger = 100; 69 | scale.offset = 200; 70 | }]; 71 | ``` 72 | 73 | ### AnimationType 74 | 75 | 76 | ```objectivec 77 | typedef NS_ENUM(NSUInteger, OURAnimationProperty) { 78 | OURAnimationPropertyViewFrame, 79 | OURAnimationPropertyViewBounds, 80 | OURAnimationPropertyViewSize, 81 | OURAnimationPropertyViewCenter, 82 | OURAnimationPropertyViewPosition, 83 | OURAnimationPropertyViewOrigin, 84 | OURAnimationPropertyViewOriginX, 85 | OURAnimationPropertyViewOriginY, 86 | OURAnimationPropertyViewWidth, 87 | OURAnimationPropertyViewHeight, 88 | OURAnimationPropertyViewCenterX, 89 | OURAnimationPropertyViewCenterY, 90 | OURAnimationPropertyViewBackgroundColor, 91 | OURAnimationPropertyViewTintColor, 92 | OURAnimationPropertyViewAlpha, 93 | OURAnimationPropertyViewTransform, 94 | OURAnimationPropertyLayerFrame, 95 | OURAnimationPropertyLayerBounds, 96 | OURAnimationPropertyLayerPosition, 97 | OURAnimationPropertyLayerZPosition, 98 | OURAnimationPropertyLayerAnchorPoint, 99 | OURAnimationPropertyLayerAnchorPointZ, 100 | OURAnimationPropertyLayerTransform, 101 | OURAnimationPropertyLayerBackgroundColor, 102 | OURAnimationPropertyLayerCornerRadius, 103 | OURAnimationPropertyLayerBorderWidth, 104 | OURAnimationPropertyLayerBorderColor, 105 | OURAnimationPropertyLayerOpacity, 106 | }; 107 | ``` 108 | 109 | 110 | ### Direction 111 | 112 | There are two animation directions for `scrollView`, if you want to animate according to `contentOffset.x`. You should change the `scrollView` property `ou_scrollDirection` to `OURScrollDirectionHorizontal`. 113 | 114 | ```objectivec 115 | typedef NS_ENUM(NSUInteger, OURScrollDirection) { 116 | OURScrollDirectionVertical, 117 | OURScrollDirectionHorizontal, 118 | }; 119 | ``` 120 | 121 | `OURScrollDirectionVertical` is the default behavior for each `scrollView` which will animate when `contentOffset.y` of `scrollView` changes. 122 | 123 | ## Author 124 | 125 | Draveness, stark.draven@gmail.com 126 | 127 | ## License 128 | 129 | Ouroboros is available under the MIT license. See the LICENSE file for more info. 130 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/draveness/Ouroboros/19a514b97c370a3e5672270850eedd56354e03d2/demo.gif --------------------------------------------------------------------------------