├── .github └── FUNDING.yml ├── .gitignore ├── .swiftpm └── xcode │ └── package.xcworkspace │ └── contents.xcworkspacedata ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Example ├── MSPeekCollectionViewDelegateImplementation.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── MSPeekCollectionViewDelegateImplementation-Example.xcscheme ├── MSPeekCollectionViewDelegateImplementation.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── MSPeekCollectionViewDelegateImplementation │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── MSPeekCollectionViewDelegateImplementation.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Target Support Files │ │ ├── MSPeekCollectionViewDelegateImplementation │ │ ├── Info.plist │ │ ├── MSPeekCollectionViewDelegateImplementation-Info.plist │ │ ├── MSPeekCollectionViewDelegateImplementation-dummy.m │ │ ├── MSPeekCollectionViewDelegateImplementation-prefix.pch │ │ ├── MSPeekCollectionViewDelegateImplementation-umbrella.h │ │ ├── MSPeekCollectionViewDelegateImplementation.debug.xcconfig │ │ ├── MSPeekCollectionViewDelegateImplementation.modulemap │ │ ├── MSPeekCollectionViewDelegateImplementation.release.xcconfig │ │ └── MSPeekCollectionViewDelegateImplementation.xcconfig │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example │ │ ├── Info.plist │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example-Info.plist │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example-acknowledgements.markdown │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example-acknowledgements.plist │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example-dummy.m │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example-frameworks.sh │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example-resources.sh │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example-umbrella.h │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example.debug.xcconfig │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Example.modulemap │ │ └── Pods-MSPeekCollectionViewDelegateImplementation_Example.release.xcconfig │ │ └── Pods-MSPeekCollectionViewDelegateImplementation_Tests │ │ ├── Info.plist │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests-Info.plist │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests-acknowledgements.markdown │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests-acknowledgements.plist │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests-dummy.m │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests-frameworks.sh │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests-resources.sh │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests-umbrella.h │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests.debug.xcconfig │ │ ├── Pods-MSPeekCollectionViewDelegateImplementation_Tests.modulemap │ │ └── Pods-MSPeekCollectionViewDelegateImplementation_Tests.release.xcconfig └── Tests │ └── Info.plist ├── LICENSE ├── MSPeekCollectionViewDelegateImplementation.podspec ├── MSPeekCollectionViewDelegateImplementation ├── Assets │ └── .gitkeep └── Classes │ └── .gitkeep ├── Package.swift ├── README.md ├── Sources └── MSPeekCollectionViewDelegateImplementation │ ├── Axis.swift │ ├── CGPoint+Axis.swift │ ├── MSCollectionViewCellPeekingLayout.swift │ ├── MSCollectionViewPaging.swift │ ├── MSCollectionViewPeekingBehavior.swift │ ├── Sign.swift │ ├── UICollectionView+PeekConfiguration.swift │ └── UICollectionViewScrollDirection+PeekDataCovnversion.swift ├── Tests ├── LinuxMain.swift └── MSPeekCollectionViewDelegateImplementationTests │ ├── MSPeekingTests.swift │ └── XCTestManifests.swift └── _Pods.xcodeproj /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [MaherKSantina] 2 | -------------------------------------------------------------------------------- /.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 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode10.1 6 | language: swift 7 | cache: cocoapods 8 | podfile: Example/Podfile 9 | before_install: 10 | - gem install cocoapods # Since Travis is not always on latest version 11 | - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MSPeekCollectionViewDelegateImplementation.xcworkspace -scheme MSPeekCollectionViewDelegateImplementation-Example -sdk iphonesimulator12.1 -destination 'platform=iOS Simulator,OS=12.1,name=iPhone 8' ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at maher.santina90@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, 4 | email, or any other method with the owners of this repository before making a change. 5 | 6 | ## Pull Request Process 7 | 8 | 1. Ensure any install or build dependencies are removed when doing a build. 9 | 2. Update the README.md if the changes made affect any of the sections in it. 10 | 3. Make sure the changes are clear and code is commented if necessary. 11 | 4. You may merge the Pull Request in once you have the sign-off of any maintainer of the repository, or if you 12 | do not have permission to do that, you may request the maintainer to merge it for you. 13 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2722B1562608D384009FCC4A /* MSPeekingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2722B1542608D37E009FCC4A /* MSPeekingTests.swift */; }; 11 | 4AA9BF6F4BB998C07B416FB0 /* Pods_MSPeekCollectionViewDelegateImplementation_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25A20EF37E9F7674D252EC07 /* Pods_MSPeekCollectionViewDelegateImplementation_Tests.framework */; }; 12 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 13 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 14 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 15 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 16 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 17 | 6CC61A01D070E53B5C9713D3 /* Pods_MSPeekCollectionViewDelegateImplementation_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D63706738AAABD8B65F2802 /* Pods_MSPeekCollectionViewDelegateImplementation_Example.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 26 | remoteInfo = MSPeekCollectionViewDelegateImplementation; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 1D63706738AAABD8B65F2802 /* Pods_MSPeekCollectionViewDelegateImplementation_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MSPeekCollectionViewDelegateImplementation_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 25A20EF37E9F7674D252EC07 /* Pods_MSPeekCollectionViewDelegateImplementation_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MSPeekCollectionViewDelegateImplementation_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 2722B1542608D37E009FCC4A /* MSPeekingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MSPeekingTests.swift; path = ../../Tests/MSPeekCollectionViewDelegateImplementationTests/MSPeekingTests.swift; sourceTree = ""; }; 34 | 607FACD01AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MSPeekCollectionViewDelegateImplementation_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 38 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 40 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 41 | 607FACE51AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MSPeekCollectionViewDelegateImplementation_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 6D62A78B4ED727736705D900 /* Pods-MSPeekCollectionViewDelegateImplementation_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MSPeekCollectionViewDelegateImplementation_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example.release.xcconfig"; sourceTree = ""; }; 44 | 7C9735FF72CB49CDCEB9B535 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 45 | A2049B1E9B6ED415F87F1C5A /* MSPeekCollectionViewDelegateImplementation.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = MSPeekCollectionViewDelegateImplementation.podspec; path = ../MSPeekCollectionViewDelegateImplementation.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 46 | A72FA0AC4731049825DB8C50 /* Pods-MSPeekCollectionViewDelegateImplementation_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MSPeekCollectionViewDelegateImplementation_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests.release.xcconfig"; sourceTree = ""; }; 47 | C5DD2B1EEE48CC25325761DA /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 48 | DF7372422D5B44BC145D286F /* Pods-MSPeekCollectionViewDelegateImplementation_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MSPeekCollectionViewDelegateImplementation_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests.debug.xcconfig"; sourceTree = ""; }; 49 | F9E8415924DCE1198471CA2D /* Pods-MSPeekCollectionViewDelegateImplementation_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MSPeekCollectionViewDelegateImplementation_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example.debug.xcconfig"; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 6CC61A01D070E53B5C9713D3 /* Pods_MSPeekCollectionViewDelegateImplementation_Example.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | 4AA9BF6F4BB998C07B416FB0 /* Pods_MSPeekCollectionViewDelegateImplementation_Tests.framework in Frameworks */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 342A8B88EC5B1FAAA74CB8AF /* Pods */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | F9E8415924DCE1198471CA2D /* Pods-MSPeekCollectionViewDelegateImplementation_Example.debug.xcconfig */, 76 | 6D62A78B4ED727736705D900 /* Pods-MSPeekCollectionViewDelegateImplementation_Example.release.xcconfig */, 77 | DF7372422D5B44BC145D286F /* Pods-MSPeekCollectionViewDelegateImplementation_Tests.debug.xcconfig */, 78 | A72FA0AC4731049825DB8C50 /* Pods-MSPeekCollectionViewDelegateImplementation_Tests.release.xcconfig */, 79 | ); 80 | name = Pods; 81 | sourceTree = ""; 82 | }; 83 | 527FF9896BDFF80D93F5DDE5 /* Frameworks */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 1D63706738AAABD8B65F2802 /* Pods_MSPeekCollectionViewDelegateImplementation_Example.framework */, 87 | 25A20EF37E9F7674D252EC07 /* Pods_MSPeekCollectionViewDelegateImplementation_Tests.framework */, 88 | ); 89 | name = Frameworks; 90 | sourceTree = ""; 91 | }; 92 | 607FACC71AFB9204008FA782 = { 93 | isa = PBXGroup; 94 | children = ( 95 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 96 | 607FACD21AFB9204008FA782 /* Example for MSPeekCollectionViewDelegateImplementation */, 97 | 607FACE81AFB9204008FA782 /* Tests */, 98 | 607FACD11AFB9204008FA782 /* Products */, 99 | 342A8B88EC5B1FAAA74CB8AF /* Pods */, 100 | 527FF9896BDFF80D93F5DDE5 /* Frameworks */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | 607FACD11AFB9204008FA782 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 607FACD01AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Example.app */, 108 | 607FACE51AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Tests.xctest */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 607FACD21AFB9204008FA782 /* Example for MSPeekCollectionViewDelegateImplementation */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 117 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 118 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 119 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 120 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 121 | 607FACD31AFB9204008FA782 /* Supporting Files */, 122 | ); 123 | name = "Example for MSPeekCollectionViewDelegateImplementation"; 124 | path = MSPeekCollectionViewDelegateImplementation; 125 | sourceTree = ""; 126 | }; 127 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 607FACD41AFB9204008FA782 /* Info.plist */, 131 | ); 132 | name = "Supporting Files"; 133 | sourceTree = ""; 134 | }; 135 | 607FACE81AFB9204008FA782 /* Tests */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 2722B1542608D37E009FCC4A /* MSPeekingTests.swift */, 139 | 607FACE91AFB9204008FA782 /* Supporting Files */, 140 | ); 141 | path = Tests; 142 | sourceTree = ""; 143 | }; 144 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 607FACEA1AFB9204008FA782 /* Info.plist */, 148 | ); 149 | name = "Supporting Files"; 150 | sourceTree = ""; 151 | }; 152 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | A2049B1E9B6ED415F87F1C5A /* MSPeekCollectionViewDelegateImplementation.podspec */, 156 | 7C9735FF72CB49CDCEB9B535 /* README.md */, 157 | C5DD2B1EEE48CC25325761DA /* LICENSE */, 158 | ); 159 | name = "Podspec Metadata"; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXGroup section */ 163 | 164 | /* Begin PBXNativeTarget section */ 165 | 607FACCF1AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Example */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MSPeekCollectionViewDelegateImplementation_Example" */; 168 | buildPhases = ( 169 | 4F8E503FD4797A91204CB9B0 /* [CP] Check Pods Manifest.lock */, 170 | 607FACCC1AFB9204008FA782 /* Sources */, 171 | 607FACCD1AFB9204008FA782 /* Frameworks */, 172 | 607FACCE1AFB9204008FA782 /* Resources */, 173 | D840CE19C5D15337C7AE435E /* [CP] Embed Pods Frameworks */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | ); 179 | name = MSPeekCollectionViewDelegateImplementation_Example; 180 | productName = MSPeekCollectionViewDelegateImplementation; 181 | productReference = 607FACD01AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Example.app */; 182 | productType = "com.apple.product-type.application"; 183 | }; 184 | 607FACE41AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Tests */ = { 185 | isa = PBXNativeTarget; 186 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MSPeekCollectionViewDelegateImplementation_Tests" */; 187 | buildPhases = ( 188 | 2DFFCAAD60C21EA817761D1A /* [CP] Check Pods Manifest.lock */, 189 | 607FACE11AFB9204008FA782 /* Sources */, 190 | 607FACE21AFB9204008FA782 /* Frameworks */, 191 | 607FACE31AFB9204008FA782 /* Resources */, 192 | ); 193 | buildRules = ( 194 | ); 195 | dependencies = ( 196 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 197 | ); 198 | name = MSPeekCollectionViewDelegateImplementation_Tests; 199 | productName = Tests; 200 | productReference = 607FACE51AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Tests.xctest */; 201 | productType = "com.apple.product-type.bundle.unit-test"; 202 | }; 203 | /* End PBXNativeTarget section */ 204 | 205 | /* Begin PBXProject section */ 206 | 607FACC81AFB9204008FA782 /* Project object */ = { 207 | isa = PBXProject; 208 | attributes = { 209 | LastSwiftUpdateCheck = 0830; 210 | LastUpgradeCheck = 1030; 211 | ORGANIZATIONNAME = CocoaPods; 212 | TargetAttributes = { 213 | 607FACCF1AFB9204008FA782 = { 214 | CreatedOnToolsVersion = 6.3.1; 215 | LastSwiftMigration = 1030; 216 | }; 217 | 607FACE41AFB9204008FA782 = { 218 | CreatedOnToolsVersion = 6.3.1; 219 | LastSwiftMigration = 1120; 220 | TestTargetID = 607FACCF1AFB9204008FA782; 221 | }; 222 | }; 223 | }; 224 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MSPeekCollectionViewDelegateImplementation" */; 225 | compatibilityVersion = "Xcode 3.2"; 226 | developmentRegion = en; 227 | hasScannedForEncodings = 0; 228 | knownRegions = ( 229 | en, 230 | Base, 231 | ); 232 | mainGroup = 607FACC71AFB9204008FA782; 233 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 234 | projectDirPath = ""; 235 | projectRoot = ""; 236 | targets = ( 237 | 607FACCF1AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Example */, 238 | 607FACE41AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Tests */, 239 | ); 240 | }; 241 | /* End PBXProject section */ 242 | 243 | /* Begin PBXResourcesBuildPhase section */ 244 | 607FACCE1AFB9204008FA782 /* Resources */ = { 245 | isa = PBXResourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 249 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 250 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | 607FACE31AFB9204008FA782 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXShellScriptBuildPhase section */ 264 | 2DFFCAAD60C21EA817761D1A /* [CP] Check Pods Manifest.lock */ = { 265 | isa = PBXShellScriptBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | ); 269 | inputPaths = ( 270 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 271 | "${PODS_ROOT}/Manifest.lock", 272 | ); 273 | name = "[CP] Check Pods Manifest.lock"; 274 | outputPaths = ( 275 | "$(DERIVED_FILE_DIR)/Pods-MSPeekCollectionViewDelegateImplementation_Tests-checkManifestLockResult.txt", 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | shellPath = /bin/sh; 279 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 280 | showEnvVarsInLog = 0; 281 | }; 282 | 4F8E503FD4797A91204CB9B0 /* [CP] Check Pods Manifest.lock */ = { 283 | isa = PBXShellScriptBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | ); 287 | inputPaths = ( 288 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 289 | "${PODS_ROOT}/Manifest.lock", 290 | ); 291 | name = "[CP] Check Pods Manifest.lock"; 292 | outputPaths = ( 293 | "$(DERIVED_FILE_DIR)/Pods-MSPeekCollectionViewDelegateImplementation_Example-checkManifestLockResult.txt", 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | shellPath = /bin/sh; 297 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 298 | showEnvVarsInLog = 0; 299 | }; 300 | D840CE19C5D15337C7AE435E /* [CP] Embed Pods Frameworks */ = { 301 | isa = PBXShellScriptBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ); 305 | inputPaths = ( 306 | "${PODS_ROOT}/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example-frameworks.sh", 307 | "${BUILT_PRODUCTS_DIR}/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.framework", 308 | ); 309 | name = "[CP] Embed Pods Frameworks"; 310 | outputPaths = ( 311 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MSPeekCollectionViewDelegateImplementation.framework", 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | shellPath = /bin/sh; 315 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example-frameworks.sh\"\n"; 316 | showEnvVarsInLog = 0; 317 | }; 318 | /* End PBXShellScriptBuildPhase section */ 319 | 320 | /* Begin PBXSourcesBuildPhase section */ 321 | 607FACCC1AFB9204008FA782 /* Sources */ = { 322 | isa = PBXSourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 326 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 327 | ); 328 | runOnlyForDeploymentPostprocessing = 0; 329 | }; 330 | 607FACE11AFB9204008FA782 /* Sources */ = { 331 | isa = PBXSourcesBuildPhase; 332 | buildActionMask = 2147483647; 333 | files = ( 334 | 2722B1562608D384009FCC4A /* MSPeekingTests.swift in Sources */, 335 | ); 336 | runOnlyForDeploymentPostprocessing = 0; 337 | }; 338 | /* End PBXSourcesBuildPhase section */ 339 | 340 | /* Begin PBXTargetDependency section */ 341 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 342 | isa = PBXTargetDependency; 343 | target = 607FACCF1AFB9204008FA782 /* MSPeekCollectionViewDelegateImplementation_Example */; 344 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 345 | }; 346 | /* End PBXTargetDependency section */ 347 | 348 | /* Begin PBXVariantGroup section */ 349 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 350 | isa = PBXVariantGroup; 351 | children = ( 352 | 607FACDA1AFB9204008FA782 /* Base */, 353 | ); 354 | name = Main.storyboard; 355 | sourceTree = ""; 356 | }; 357 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 358 | isa = PBXVariantGroup; 359 | children = ( 360 | 607FACDF1AFB9204008FA782 /* Base */, 361 | ); 362 | name = LaunchScreen.xib; 363 | sourceTree = ""; 364 | }; 365 | /* End PBXVariantGroup section */ 366 | 367 | /* Begin XCBuildConfiguration section */ 368 | 607FACED1AFB9204008FA782 /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | ALWAYS_SEARCH_USER_PATHS = NO; 372 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 373 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 374 | CLANG_CXX_LIBRARY = "libc++"; 375 | CLANG_ENABLE_MODULES = YES; 376 | CLANG_ENABLE_OBJC_ARC = YES; 377 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 378 | CLANG_WARN_BOOL_CONVERSION = YES; 379 | CLANG_WARN_COMMA = YES; 380 | CLANG_WARN_CONSTANT_CONVERSION = YES; 381 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 382 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 383 | CLANG_WARN_EMPTY_BODY = YES; 384 | CLANG_WARN_ENUM_CONVERSION = YES; 385 | CLANG_WARN_INFINITE_RECURSION = YES; 386 | CLANG_WARN_INT_CONVERSION = YES; 387 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 388 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 389 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 390 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 391 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 392 | CLANG_WARN_STRICT_PROTOTYPES = YES; 393 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 394 | CLANG_WARN_UNREACHABLE_CODE = YES; 395 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 396 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 397 | COPY_PHASE_STRIP = NO; 398 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 399 | ENABLE_STRICT_OBJC_MSGSEND = YES; 400 | ENABLE_TESTABILITY = YES; 401 | GCC_C_LANGUAGE_STANDARD = gnu99; 402 | GCC_DYNAMIC_NO_PIC = NO; 403 | GCC_NO_COMMON_BLOCKS = YES; 404 | GCC_OPTIMIZATION_LEVEL = 0; 405 | GCC_PREPROCESSOR_DEFINITIONS = ( 406 | "DEBUG=1", 407 | "$(inherited)", 408 | ); 409 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 410 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 411 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 412 | GCC_WARN_UNDECLARED_SELECTOR = YES; 413 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 414 | GCC_WARN_UNUSED_FUNCTION = YES; 415 | GCC_WARN_UNUSED_VARIABLE = YES; 416 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 417 | MTL_ENABLE_DEBUG_INFO = YES; 418 | ONLY_ACTIVE_ARCH = YES; 419 | SDKROOT = iphoneos; 420 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 421 | }; 422 | name = Debug; 423 | }; 424 | 607FACEE1AFB9204008FA782 /* Release */ = { 425 | isa = XCBuildConfiguration; 426 | buildSettings = { 427 | ALWAYS_SEARCH_USER_PATHS = NO; 428 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 429 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 430 | CLANG_CXX_LIBRARY = "libc++"; 431 | CLANG_ENABLE_MODULES = YES; 432 | CLANG_ENABLE_OBJC_ARC = YES; 433 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 434 | CLANG_WARN_BOOL_CONVERSION = YES; 435 | CLANG_WARN_COMMA = YES; 436 | CLANG_WARN_CONSTANT_CONVERSION = YES; 437 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 438 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 439 | CLANG_WARN_EMPTY_BODY = YES; 440 | CLANG_WARN_ENUM_CONVERSION = YES; 441 | CLANG_WARN_INFINITE_RECURSION = YES; 442 | CLANG_WARN_INT_CONVERSION = YES; 443 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 444 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 445 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 446 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 447 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 448 | CLANG_WARN_STRICT_PROTOTYPES = YES; 449 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 450 | CLANG_WARN_UNREACHABLE_CODE = YES; 451 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 452 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 453 | COPY_PHASE_STRIP = NO; 454 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 455 | ENABLE_NS_ASSERTIONS = NO; 456 | ENABLE_STRICT_OBJC_MSGSEND = YES; 457 | GCC_C_LANGUAGE_STANDARD = gnu99; 458 | GCC_NO_COMMON_BLOCKS = YES; 459 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 460 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 461 | GCC_WARN_UNDECLARED_SELECTOR = YES; 462 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 463 | GCC_WARN_UNUSED_FUNCTION = YES; 464 | GCC_WARN_UNUSED_VARIABLE = YES; 465 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 466 | MTL_ENABLE_DEBUG_INFO = NO; 467 | SDKROOT = iphoneos; 468 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 469 | VALIDATE_PRODUCT = YES; 470 | }; 471 | name = Release; 472 | }; 473 | 607FACF01AFB9204008FA782 /* Debug */ = { 474 | isa = XCBuildConfiguration; 475 | baseConfigurationReference = F9E8415924DCE1198471CA2D /* Pods-MSPeekCollectionViewDelegateImplementation_Example.debug.xcconfig */; 476 | buildSettings = { 477 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 478 | INFOPLIST_FILE = MSPeekCollectionViewDelegateImplementation/Info.plist; 479 | IPHONEOS_DEPLOYMENT_TARGET = 9; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 481 | MODULE_NAME = ExampleApp; 482 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | SWIFT_VERSION = 5.0; 485 | }; 486 | name = Debug; 487 | }; 488 | 607FACF11AFB9204008FA782 /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | baseConfigurationReference = 6D62A78B4ED727736705D900 /* Pods-MSPeekCollectionViewDelegateImplementation_Example.release.xcconfig */; 491 | buildSettings = { 492 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 493 | INFOPLIST_FILE = MSPeekCollectionViewDelegateImplementation/Info.plist; 494 | IPHONEOS_DEPLOYMENT_TARGET = 9; 495 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 496 | MODULE_NAME = ExampleApp; 497 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 498 | PRODUCT_NAME = "$(TARGET_NAME)"; 499 | SWIFT_VERSION = 5.0; 500 | }; 501 | name = Release; 502 | }; 503 | 607FACF31AFB9204008FA782 /* Debug */ = { 504 | isa = XCBuildConfiguration; 505 | baseConfigurationReference = DF7372422D5B44BC145D286F /* Pods-MSPeekCollectionViewDelegateImplementation_Tests.debug.xcconfig */; 506 | buildSettings = { 507 | BUNDLE_LOADER = "$(TEST_HOST)"; 508 | CLANG_ENABLE_MODULES = YES; 509 | GCC_PREPROCESSOR_DEFINITIONS = ( 510 | "DEBUG=1", 511 | "$(inherited)", 512 | ); 513 | INFOPLIST_FILE = Tests/Info.plist; 514 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 515 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 516 | PRODUCT_NAME = "$(TARGET_NAME)"; 517 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 518 | SWIFT_VERSION = 5.0; 519 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MSPeekCollectionViewDelegateImplementation_Example.app/MSPeekCollectionViewDelegateImplementation_Example"; 520 | }; 521 | name = Debug; 522 | }; 523 | 607FACF41AFB9204008FA782 /* Release */ = { 524 | isa = XCBuildConfiguration; 525 | baseConfigurationReference = A72FA0AC4731049825DB8C50 /* Pods-MSPeekCollectionViewDelegateImplementation_Tests.release.xcconfig */; 526 | buildSettings = { 527 | BUNDLE_LOADER = "$(TEST_HOST)"; 528 | CLANG_ENABLE_MODULES = YES; 529 | INFOPLIST_FILE = Tests/Info.plist; 530 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 531 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 532 | PRODUCT_NAME = "$(TARGET_NAME)"; 533 | SWIFT_VERSION = 5.0; 534 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MSPeekCollectionViewDelegateImplementation_Example.app/MSPeekCollectionViewDelegateImplementation_Example"; 535 | }; 536 | name = Release; 537 | }; 538 | /* End XCBuildConfiguration section */ 539 | 540 | /* Begin XCConfigurationList section */ 541 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MSPeekCollectionViewDelegateImplementation" */ = { 542 | isa = XCConfigurationList; 543 | buildConfigurations = ( 544 | 607FACED1AFB9204008FA782 /* Debug */, 545 | 607FACEE1AFB9204008FA782 /* Release */, 546 | ); 547 | defaultConfigurationIsVisible = 0; 548 | defaultConfigurationName = Release; 549 | }; 550 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MSPeekCollectionViewDelegateImplementation_Example" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | 607FACF01AFB9204008FA782 /* Debug */, 554 | 607FACF11AFB9204008FA782 /* Release */, 555 | ); 556 | defaultConfigurationIsVisible = 0; 557 | defaultConfigurationName = Release; 558 | }; 559 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MSPeekCollectionViewDelegateImplementation_Tests" */ = { 560 | isa = XCConfigurationList; 561 | buildConfigurations = ( 562 | 607FACF31AFB9204008FA782 /* Debug */, 563 | 607FACF41AFB9204008FA782 /* Release */, 564 | ); 565 | defaultConfigurationIsVisible = 0; 566 | defaultConfigurationName = Release; 567 | }; 568 | /* End XCConfigurationList section */ 569 | }; 570 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 571 | } 572 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation.xcodeproj/xcshareddata/xcschemes/MSPeekCollectionViewDelegateImplementation-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 79 | 81 | 87 | 88 | 89 | 90 | 91 | 92 | 98 | 100 | 106 | 107 | 108 | 109 | 111 | 112 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | PreviewsEnabled 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2018 maher.santina90@gmail.com 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 | 21 | 22 | import UIKit 23 | 24 | @UIApplicationMain 25 | class AppDelegate: UIResponder, UIApplicationDelegate { 26 | 27 | var window: UIWindow? 28 | 29 | 30 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 31 | // Override point for customization after application launch. 32 | return true 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation/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 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/MSPeekCollectionViewDelegateImplementation/ViewController.swift: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2018 maher.santina90@gmail.com 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 | 21 | 22 | import UIKit 23 | import MSPeekCollectionViewDelegateImplementation 24 | 25 | class CustomSlider: UISlider { 26 | @IBInspectable var isInt: Bool = false 27 | } 28 | 29 | class ViewController: UIViewController { 30 | 31 | @IBOutlet weak var cellSpacingSlider: UISlider! 32 | @IBOutlet weak var cellPeekWidthSlider: UISlider! 33 | @IBOutlet weak var scrollThresholdSlider: UISlider! 34 | @IBOutlet weak var maximumItemsToScrollSlider: UISlider! 35 | @IBOutlet weak var numberOfItemsToShowSlider: UISlider! 36 | 37 | @IBOutlet weak var collectionView: UICollectionView! 38 | 39 | var behavior: MSCollectionViewPeekingBehavior! 40 | 41 | override func viewDidLoad() { 42 | super.viewDidLoad() 43 | reloadDelegate() 44 | collectionView.delegate = self 45 | collectionView.dataSource = self 46 | 47 | initSliderValues() 48 | } 49 | 50 | func initSliderValues() { 51 | cellSpacingSlider.value = Float(behavior.cellSpacing) 52 | cellPeekWidthSlider.value = Float(behavior.cellPeekWidth) 53 | maximumItemsToScrollSlider.value = Float(behavior.maximumItemsToScroll ?? 1) 54 | numberOfItemsToShowSlider.value = Float(behavior.numberOfItemsToShow) 55 | } 56 | 57 | @IBAction func sliderValueDidChange(_ slider: CustomSlider) { 58 | if slider.isInt { 59 | let value = slider.value 60 | slider.value = Float(Int(value)) 61 | } 62 | 63 | reloadDelegate() 64 | } 65 | 66 | func reloadDelegate() { 67 | behavior = MSCollectionViewPeekingBehavior(cellSpacing: CGFloat(cellSpacingSlider.value), cellPeekWidth: CGFloat(cellPeekWidthSlider.value), maximumItemsToScroll: Int(maximumItemsToScrollSlider.value), numberOfItemsToShow: Int(numberOfItemsToShowSlider.value), scrollDirection: .horizontal) 68 | collectionView.configureForPeekingBehavior(behavior: behavior) 69 | collectionView.reloadData() 70 | } 71 | 72 | } 73 | 74 | extension ViewController: UICollectionViewDataSource { 75 | func numberOfSections(in collectionView: UICollectionView) -> Int { 76 | return 1 77 | } 78 | 79 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 80 | return 4 81 | } 82 | 83 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 84 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) 85 | let value = (180 + CGFloat(indexPath.row)*20) / 255 86 | cell.contentView.backgroundColor = UIColor(red: value, green: value, blue: value, alpha: 1) 87 | return cell 88 | } 89 | } 90 | 91 | extension ViewController: UICollectionViewDelegate { 92 | func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { 93 | behavior.scrollViewWillEndDragging(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset) 94 | } 95 | 96 | func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { 97 | print(behavior.currentIndex) 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'MSPeekCollectionViewDelegateImplementation_Example' do 4 | pod 'MSPeekCollectionViewDelegateImplementation', :path => '../' 5 | 6 | target 'MSPeekCollectionViewDelegateImplementation_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MSPeekCollectionViewDelegateImplementation (3.2.0) 3 | 4 | DEPENDENCIES: 5 | - MSPeekCollectionViewDelegateImplementation (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | MSPeekCollectionViewDelegateImplementation: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | MSPeekCollectionViewDelegateImplementation: be35a217bd302976a9e4476151be992c1f150127 13 | 14 | PODFILE CHECKSUM: 8d230cee08c8a8b7e62859eff8016277efe2311d 15 | 16 | COCOAPODS: 1.10.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/MSPeekCollectionViewDelegateImplementation.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MSPeekCollectionViewDelegateImplementation", 3 | "version": "3.2.0", 4 | "summary": "A custom paging behavior that peeks the previous and next items in a collection view", 5 | "swift_versions": "5.0", 6 | "description": "Current design trends require complex designs which allow horizontal scrolling inside vertical scrolling. So to show the users that they can scroll vertically, a peeking item should be shown on the side. This library does exactly that.\nI wrote this library because there's no pod that does this simple feature. Also, other libraries require me to inherit from a UICollectionViewController, which doesn't give alot of freedom if I'm inheriting from other View Controllers.", 7 | "homepage": "https://github.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation", 8 | "license": { 9 | "type": "MIT", 10 | "file": "LICENSE" 11 | }, 12 | "authors": { 13 | "Maher Santina": "maher.santina90@gmail.com" 14 | }, 15 | "source": { 16 | "git": "https://github.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation.git", 17 | "tag": "3.2.0" 18 | }, 19 | "platforms": { 20 | "ios": "9" 21 | }, 22 | "source_files": "Sources/**/*.swift", 23 | "swift_version": "5.0" 24 | } 25 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MSPeekCollectionViewDelegateImplementation (3.2.0) 3 | 4 | DEPENDENCIES: 5 | - MSPeekCollectionViewDelegateImplementation (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | MSPeekCollectionViewDelegateImplementation: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | MSPeekCollectionViewDelegateImplementation: be35a217bd302976a9e4476151be992c1f150127 13 | 14 | PODFILE CHECKSUM: 8d230cee08c8a8b7e62859eff8016277efe2311d 15 | 16 | COCOAPODS: 1.10.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/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.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MSPeekCollectionViewDelegateImplementation : NSObject 3 | @end 4 | @implementation PodsDummy_MSPeekCollectionViewDelegateImplementation 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double MSPeekCollectionViewDelegateImplementationVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char MSPeekCollectionViewDelegateImplementationVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.modulemap: -------------------------------------------------------------------------------- 1 | framework module MSPeekCollectionViewDelegateImplementation { 2 | umbrella header "MSPeekCollectionViewDelegateImplementation-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_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-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_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-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MSPeekCollectionViewDelegateImplementation 5 | 6 | Copyright (c) 2018 maher.santina90@gmail.com 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 - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_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) 2018 maher.santina90@gmail.com <maher.santina90@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 | License 38 | MIT 39 | Title 40 | MSPeekCollectionViewDelegateImplementation 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MSPeekCollectionViewDelegateImplementation_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MSPeekCollectionViewDelegateImplementation_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | BCSYMBOLMAP_DIR="BCSymbolMaps" 23 | 24 | 25 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 26 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 27 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 28 | 29 | # Copies and strips a vendored framework 30 | install_framework() 31 | { 32 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 33 | local source="${BUILT_PRODUCTS_DIR}/$1" 34 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 35 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 36 | elif [ -r "$1" ]; then 37 | local source="$1" 38 | fi 39 | 40 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 41 | 42 | if [ -L "${source}" ]; then 43 | echo "Symlinked..." 44 | source="$(readlink "${source}")" 45 | fi 46 | 47 | if [ -d "${source}/${BCSYMBOLMAP_DIR}" ]; then 48 | # Locate and install any .bcsymbolmaps if present, and remove them from the .framework before the framework is copied 49 | find "${source}/${BCSYMBOLMAP_DIR}" -name "*.bcsymbolmap"|while read f; do 50 | echo "Installing $f" 51 | install_bcsymbolmap "$f" "$destination" 52 | rm "$f" 53 | done 54 | rmdir "${source}/${BCSYMBOLMAP_DIR}" 55 | fi 56 | 57 | # Use filter instead of exclude so missing patterns don't throw errors. 58 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 59 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 60 | 61 | local basename 62 | basename="$(basename -s .framework "$1")" 63 | binary="${destination}/${basename}.framework/${basename}" 64 | 65 | if ! [ -r "$binary" ]; then 66 | binary="${destination}/${basename}" 67 | elif [ -L "${binary}" ]; then 68 | echo "Destination binary is symlinked..." 69 | dirname="$(dirname "${binary}")" 70 | binary="${dirname}/$(readlink "${binary}")" 71 | fi 72 | 73 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 74 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 75 | strip_invalid_archs "$binary" 76 | fi 77 | 78 | # Resign the code if required by the build settings to avoid unstable apps 79 | code_sign_if_enabled "${destination}/$(basename "$1")" 80 | 81 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 82 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 83 | local swift_runtime_libs 84 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 85 | for lib in $swift_runtime_libs; do 86 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 87 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 88 | code_sign_if_enabled "${destination}/${lib}" 89 | done 90 | fi 91 | } 92 | # Copies and strips a vendored dSYM 93 | install_dsym() { 94 | local source="$1" 95 | warn_missing_arch=${2:-true} 96 | if [ -r "$source" ]; then 97 | # Copy the dSYM into the targets temp dir. 98 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 99 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 100 | 101 | local basename 102 | basename="$(basename -s .dSYM "$source")" 103 | binary_name="$(ls "$source/Contents/Resources/DWARF")" 104 | binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" 105 | 106 | # Strip invalid architectures from the dSYM. 107 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 108 | strip_invalid_archs "$binary" "$warn_missing_arch" 109 | fi 110 | if [[ $STRIP_BINARY_RETVAL == 0 ]]; then 111 | # Move the stripped file into its final destination. 112 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 113 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 114 | else 115 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 116 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" 117 | fi 118 | fi 119 | } 120 | 121 | # Used as a return value for each invocation of `strip_invalid_archs` function. 122 | STRIP_BINARY_RETVAL=0 123 | 124 | # Strip invalid architectures 125 | strip_invalid_archs() { 126 | binary="$1" 127 | warn_missing_arch=${2:-true} 128 | # Get architectures for current target binary 129 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 130 | # Intersect them with the architectures we are building for 131 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 132 | # If there are no archs supported by this binary then warn the user 133 | if [[ -z "$intersected_archs" ]]; then 134 | if [[ "$warn_missing_arch" == "true" ]]; then 135 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 136 | fi 137 | STRIP_BINARY_RETVAL=1 138 | return 139 | fi 140 | stripped="" 141 | for arch in $binary_archs; do 142 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 143 | # Strip non-valid architectures in-place 144 | lipo -remove "$arch" -output "$binary" "$binary" 145 | stripped="$stripped $arch" 146 | fi 147 | done 148 | if [[ "$stripped" ]]; then 149 | echo "Stripped $binary of architectures:$stripped" 150 | fi 151 | STRIP_BINARY_RETVAL=0 152 | } 153 | 154 | # Copies the bcsymbolmap files of a vendored framework 155 | install_bcsymbolmap() { 156 | local bcsymbolmap_path="$1" 157 | local destination="${BUILT_PRODUCTS_DIR}" 158 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 159 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 160 | } 161 | 162 | # Signs a framework with the provided identity 163 | code_sign_if_enabled() { 164 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 165 | # Use the current code_sign_identity 166 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 167 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 168 | 169 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 170 | code_sign_cmd="$code_sign_cmd &" 171 | fi 172 | echo "$code_sign_cmd" 173 | eval "$code_sign_cmd" 174 | fi 175 | } 176 | 177 | if [[ "$CONFIGURATION" == "Debug" ]]; then 178 | install_framework "${BUILT_PRODUCTS_DIR}/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.framework" 179 | fi 180 | if [[ "$CONFIGURATION" == "Release" ]]; then 181 | install_framework "${BUILT_PRODUCTS_DIR}/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.framework" 182 | fi 183 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 184 | wait 185 | fi 186 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_MSPeekCollectionViewDelegateImplementation_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_MSPeekCollectionViewDelegateImplementation_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_LDFLAGS = $(inherited) -framework "MSPeekCollectionViewDelegateImplementation" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MSPeekCollectionViewDelegateImplementation_Example { 2 | umbrella header "Pods-MSPeekCollectionViewDelegateImplementation_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Example/Pods-MSPeekCollectionViewDelegateImplementation_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | OTHER_LDFLAGS = $(inherited) -framework "MSPeekCollectionViewDelegateImplementation" 8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 9 | PODS_BUILD_DIR = ${BUILD_DIR} 10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_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-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_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-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_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 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MSPeekCollectionViewDelegateImplementation_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MSPeekCollectionViewDelegateImplementation_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_MSPeekCollectionViewDelegateImplementation_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_MSPeekCollectionViewDelegateImplementation_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "MSPeekCollectionViewDelegateImplementation" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MSPeekCollectionViewDelegateImplementation_Tests { 2 | umbrella header "Pods-MSPeekCollectionViewDelegateImplementation_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MSPeekCollectionViewDelegateImplementation_Tests/Pods-MSPeekCollectionViewDelegateImplementation_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MSPeekCollectionViewDelegateImplementation/MSPeekCollectionViewDelegateImplementation.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "MSPeekCollectionViewDelegateImplementation" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 maher.santina90@gmail.com 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 | -------------------------------------------------------------------------------- /MSPeekCollectionViewDelegateImplementation.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint MSPeekCollectionViewDelegateImplementation.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 https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'MSPeekCollectionViewDelegateImplementation' 11 | s.version = '3.2.0' 12 | s.summary = 'A custom paging behavior that peeks the previous and next items in a collection view' 13 | s.swift_version = '5.0' 14 | 15 | # This description is used to generate tags and improve search results. 16 | # * Think: What does it do? Why did you write it? What is the focus? 17 | # * Try to keep it short, snappy and to the point. 18 | # * Write the description between the DESC delimiters below. 19 | # * Finally, don't worry about the indent, CocoaPods strips it! 20 | 21 | s.description = <<-DESC 22 | Current design trends require complex designs which allow horizontal scrolling inside vertical scrolling. So to show the users that they can scroll vertically, a peeking item should be shown on the side. This library does exactly that. 23 | I wrote this library because there's no pod that does this simple feature. Also, other libraries require me to inherit from a UICollectionViewController, which doesn't give alot of freedom if I'm inheriting from other View Controllers. 24 | DESC 25 | 26 | s.homepage = 'https://github.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation' 27 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 28 | s.license = { :type => 'MIT', :file => 'LICENSE' } 29 | s.author = { 'Maher Santina' => 'maher.santina90@gmail.com' } 30 | s.source = { :git => 'https://github.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation.git', :tag => s.version.to_s } 31 | # s.social_media_url = 'https://twitter.com/' 32 | 33 | s.ios.deployment_target = '9' 34 | 35 | s.source_files = 'Sources/**/*.swift' 36 | 37 | # s.resource_bundles = { 38 | # 'MSPeekCollectionViewDelegateImplementation' => ['MSPeekCollectionViewDelegateImplementation/Assets/*.png'] 39 | # } 40 | 41 | # s.public_header_files = 'Pod/Classes/**/*.h' 42 | # s.frameworks = 'UIKit', 'MapKit' 43 | # s.dependency 'AFNetworking', '~> 2.3' 44 | end 45 | -------------------------------------------------------------------------------- /MSPeekCollectionViewDelegateImplementation/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation/5bc891a2ff11be914fee9b58de7bfeabf0a6fff0/MSPeekCollectionViewDelegateImplementation/Assets/.gitkeep -------------------------------------------------------------------------------- /MSPeekCollectionViewDelegateImplementation/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation/5bc891a2ff11be914fee9b58de7bfeabf0a6fff0/MSPeekCollectionViewDelegateImplementation/Classes/.gitkeep -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.2 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "MSPeekCollectionViewDelegateImplementation", 8 | products: [ 9 | // Products define the executables and libraries produced by a package, and make them visible to other packages. 10 | .library( 11 | name: "MSPeekCollectionViewDelegateImplementation", 12 | targets: ["MSPeekCollectionViewDelegateImplementation"]), 13 | ], 14 | dependencies: [ 15 | // Dependencies declare other packages that this package depends on. 16 | // .package(url: /* package url */, from: "1.0.0"), 17 | ], 18 | targets: [ 19 | // Targets are the basic building blocks of a package. A target can define a module or a test suite. 20 | // Targets can depend on other targets in this package, and on products in packages which this package depends on. 21 | .target( 22 | name: "MSPeekCollectionViewDelegateImplementation", 23 | dependencies: []), 24 | .testTarget( 25 | name: "MSPeekCollectionViewDelegateImplementationTests", 26 | dependencies: ["MSPeekCollectionViewDelegateImplementation"]), 27 | ] 28 | ) 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MSPeekCollectionViewDelegateImplementation 2 | 3 | # Version 3.0.0 is here! 🎉 4 | The peeking logic is now done using a custom `UICollectionViewLayout` which makes it easier to integrate and will introduce less bugs! (And hopefully it will solve all the issues you were facing) 5 | 6 | # Migrating from 2.0.0 to 3.0.0 7 | I've tried to keep minimal effort to migrate from v2 to v3. Here are the steps: 8 | 9 | 1- Replace `MSPeekCollectionViewDelegateImplementation` initialization with `MSCollectionViewPeekingBehavior` 10 | 11 | 2- On your `collectionView`, call `configureForPeekingBehavior` like this: 12 | 13 | ```swift 14 | collectionView.configureForPeekingBehavior(behavior: behavior) 15 | ``` 16 | 3- Set the collection view's delegate as the view controller (Or any other class you want) 17 | 18 | 4- In the collection view delegate function `scrollViewWillEndDragging`, call the behavior's `scrollViewWillEndDragging` like this: 19 | ```swift 20 | func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { 21 | behavior.scrollViewWillEndDragging(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset) 22 | } 23 | ``` 24 | 25 | 5- ??? 26 | 27 | 6- Profit 💰 28 | 29 | You can check out the example for a detailed use 30 | 31 | # Introduction 32 | 33 | [![Build Status](https://travis-ci.org/MaherKSantina/MSPeekCollectionViewDelegateImplementation.svg?branch=master)](https://travis-ci.org/MaherKSantina/MSPeekCollectionViewDelegateImplementation) 34 | 35 | ![ezgif-2-9f7a86182f](https://user-images.githubusercontent.com/24646608/41348369-c0887714-6f4f-11e8-9231-8a86a278ee4a.gif) 36 | 37 | Current design trends require complex designs which allow horizontal scrolling inside vertical scrolling. So to show the users that they can scroll vertically, a peeking item should be shown on the side. This library does exactly that. 38 | I wrote this library because there's no pod that does this simple feature. Also, other libraries require me to inherit from a UICollectionViewController, which doesn't give alot of freedom if I'm inheriting from other View Controllers. 39 | 40 | ## Example 41 | 42 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 43 | 44 | ## Requirements 45 | 46 | - XCode 11.2.1 47 | - Swift 5 48 | 49 | This pod will probably work on older versions of XCode but I haven't tested it. 50 | 51 | ## Installation 52 | 53 | MSPeekCollectionViewDelegateImplementation is available through [CocoaPods](https://cocoapods.org). To install 54 | it, simply add the following line to your Podfile: 55 | 56 | ```ruby 57 | pod 'MSPeekCollectionViewDelegateImplementation' 58 | ``` 59 | 60 | ## Usage 61 | 62 | ### Storyboard 63 | 1. Drag-Drop a `UICollectionView` 64 | 65 | 2. Set the reuse identifier for the collection view's cell to `Cell` 66 | 67 | 3. Create a reference for the collection view 68 | ```swift 69 | @IBOutlet weak var collectionView: UICollectionView! 70 | ``` 71 | 72 | 4. Bind collection view to outlet 73 | 74 | 5. Import library 75 | ```swift 76 | import MSPeekCollectionViewDelegateImplementation 77 | ``` 78 | 79 | 6. Create a variable of type `MSCollectionViewPeekingBehavior` 80 | ```swift 81 | var behavior: MSCollectionViewPeekingBehavior! 82 | ``` 83 | 84 | 7. In `viewDidLoad()`, , initialize the behavior and configure the `collectionView` for peek behavior: 85 | ```swift 86 | behavior = MSCollectionViewPeekingBehavior() 87 | collectionView.configureForPeekingBehavior(behavior: behavior) 88 | ``` 89 | Or you can use whatever arguments from the ones below (Can be combined together as needed): 90 | ```swift 91 | behavior = MSCollectionViewPeekingBehavior(cellSpacing: 10) 92 | ``` 93 | ```swift 94 | behavior = MSCollectionViewPeekingBehavior(cellPeekWidth: 20) 95 | ``` 96 | ```swift 97 | //minimumItemsToScroll is the minimum number of items that can be scrolled 98 | behavior = MSCollectionViewPeekingBehavior(minimumItemsToScroll: 1) 99 | ``` 100 | ```swift 101 | //maximumItemsToScroll is the maximum number of items that can be scrolled if the scroll distance is large 102 | behavior = MSCollectionViewPeekingBehavior(maximumItemsToScroll: 3) 103 | ``` 104 | ```swift 105 | //numberOfItemsToShow is the number of items that will be shown at the same time. 106 | behavior = MSCollectionViewPeekingBehavior(numberOfItemsToShow: 3) 107 | ``` 108 | 109 | ![peek explanation](https://user-images.githubusercontent.com/24646608/41348656-b0ad14fc-6f50-11e8-8723-2996b016e9c9.jpg) 110 | 111 | 112 | 8. In `viewDidLoad()`, set the collection view's delegate to self: 113 | ```swift 114 | collectionView.delegate = self 115 | ``` 116 | 9. In the collection view delegate function `scrollViewWillEndDragging`, call the behavior's `scrollViewWillEndDragging` like this: 117 | ```swift 118 | func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { 119 | behavior.scrollViewWillEndDragging(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset) 120 | } 121 | ``` 122 | 10. Create the data source implementation as an extension for the `ViewController` 123 | ```swift 124 | extension ViewController: UICollectionViewDataSource { 125 | func numberOfSections(in collectionView: UICollectionView) -> Int { 126 | return 1 127 | } 128 | 129 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 130 | return 4 131 | } 132 | 133 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 134 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) 135 | //TODO: Configure cell 136 | return cell 137 | } 138 | } 139 | ``` 140 | 141 | 11. In `viewDidLoad()`, Set the collection view's data source to `self` 142 | ```swift 143 | collectionView.dataSource = self 144 | ``` 145 | 146 | ### Working Example 147 | 148 | ```swift 149 | import UIKit 150 | import MSPeekCollectionViewDelegateImplementation 151 | 152 | class ViewController: UIViewController { 153 | 154 | @IBOutlet weak var collectionView: UICollectionView! 155 | var behavior = MSCollectionViewPeekingBehavior() 156 | 157 | override func viewDidLoad() { 158 | super.viewDidLoad() 159 | collectionView.configureForPeekingBehavior(behavior: behavior) 160 | collectionView.delegate = self 161 | collectionView.dataSource = self 162 | } 163 | } 164 | 165 | extension ViewController: UICollectionViewDataSource { 166 | func numberOfSections(in collectionView: UICollectionView) -> Int { 167 | return 1 168 | } 169 | 170 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 171 | return 4 172 | } 173 | 174 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 175 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) 176 | cell.contentView.backgroundColor = UIColor.red 177 | return cell 178 | } 179 | } 180 | 181 | extension ViewController: UICollectionViewDelegate { 182 | func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { 183 | behavior.scrollViewWillEndDragging(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset) 184 | } 185 | 186 | func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { 187 | print(behavior.currentIndex) 188 | } 189 | } 190 | ``` 191 | 192 | ## Features 193 | ### Scrolling to a specific item 194 | The `MSCollectionViewPeekingBehavior` now has a function to scroll to a specific index 195 | ```swift 196 | public func scrollToItem(at index: Int, animated: Bool) 197 | ``` 198 | 199 | You can do something like: 200 | ```swift 201 | behavior.scrollToItem(at: 1, animated: true) 202 | ``` 203 | 204 | ### Listen to index changes 205 | You can use the scroll view's delegate function to do that (Make sure you conform to `UICollectionViewDelegate`): 206 | ```swift 207 | func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { 208 | print(behavior.currentIndex) 209 | } 210 | ``` 211 | 212 | ## Customization 213 | ### Vertical Scroll Direction 214 | The implementation supports collection views with vertical directions and will automatically position cells correctly, you can set the scrolling and peeking to be vertical using: 215 | ```swift 216 | delegate = MSCollectionViewPeekingBehavior(scrollDirection: .vertical) 217 | collectionView.configureForPeekingBehavior(behavior: behavior) 218 | ``` 219 | 220 | ## Author 221 | 222 | Maher Santina, maher.santina90@gmail.com 223 | 224 | ## Sponsor 225 | 226 | If you're liking this repo I'd really appreciate it if you sponsor me (Orange Juice) so that I can continue supporting this project. I'm also working on adding more reusable UI elements similar to this one to make developer's lives easier. Please see [my sponsor page](https://github.com/sponsors/MaherKSantina/) for more details 227 | 228 | ## Contributing 229 | 230 | Any contribution is highly appreciated, please see [CONTRIBUTING.md](https://github.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation/blob/master/CONTRIBUTING.md) for more info. 231 | 232 | ## License 233 | 234 | MSPeekCollectionViewDelegateImplementation is available under the MIT license. See the [LICENSE](https://github.com/MaherKSantina/MSPeekCollectionViewDelegateImplementation/blob/master/LICENSE) file for more info. 235 | -------------------------------------------------------------------------------- /Sources/MSPeekCollectionViewDelegateImplementation/Axis.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Axis.swift 3 | // CustomCollectionViewLayout 4 | // 5 | // Created by Maher Santina on 12/7/19. 6 | // Copyright © 2019 Maher Santina. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Defines the possible cases of a collection view axis. 12 | enum Axis { 13 | 14 | /// Represents the main axis in the direction of paging 15 | case main 16 | 17 | /// Represents the cross axis perpendicular to the direction of paging 18 | case cross 19 | } 20 | -------------------------------------------------------------------------------- /Sources/MSPeekCollectionViewDelegateImplementation/CGPoint+Axis.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGPoint+Axis.swift 3 | // CustomCollectionViewLayout 4 | // 5 | // Created by Maher Santina on 12/8/19. 6 | // Copyright © 2019 Maher Santina. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension CGPoint { 12 | func attribute(axis: Axis, scrollDirection: UICollectionView.ScrollDirection) -> CGFloat { 13 | switch (axis, scrollDirection) { 14 | case (.main, .horizontal), (.cross, .vertical): 15 | return x 16 | case (.main, .vertical), (.cross, .horizontal): 17 | return y 18 | default: 19 | assertionFailure("Not implemented") 20 | return 0 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/MSPeekCollectionViewDelegateImplementation/MSCollectionViewCellPeekingLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PeekingCollectionViewLayout.swift 3 | // CustomCollectionViewLayout 4 | // 5 | // Created by Maher Santina on 12/6/19. 6 | // Copyright © 2019 Maher Santina. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | /// Defines a way to pass data to the peeking layout 13 | public protocol MSCollectionViewCellPeekingLayoutDataSource: AnyObject { 14 | 15 | /// The peek length of the adjacent cells 16 | func cellPeekingLayoutPeekingLength(_ layout: MSCollectionViewCellPeekingLayout) -> CGFloat 17 | 18 | /// The spacing between cells 19 | func cellPeekingLayoutSpacingLength(_ layout: MSCollectionViewCellPeekingLayout) -> CGFloat 20 | 21 | /// Defines how many items need to be shown in each page 22 | func cellPeekingLayoutNumberOfItemsToShow(_ layout: MSCollectionViewCellPeekingLayout) -> Int 23 | } 24 | 25 | /// An implementation of a peeking behavior where 2 cells peek on the sindes 26 | open class MSCollectionViewCellPeekingLayout: UICollectionViewLayout { 27 | 28 | public weak var dataSource: MSCollectionViewCellPeekingLayoutDataSource? 29 | 30 | open var scrollDirection: UICollectionView.ScrollDirection 31 | 32 | var boundsWidth: CGFloat { 33 | return collectionView?.bounds.width ?? 1 34 | } 35 | 36 | var boundsHeight: CGFloat { 37 | return collectionView?.bounds.height ?? 1 38 | } 39 | 40 | var numberOfItemsToShow: Int { 41 | return dataSource?.cellPeekingLayoutNumberOfItemsToShow(self) ?? 1 42 | } 43 | 44 | var numberOfItems: Int { 45 | return collectionView?.numberOfItems(inSection: 0) ?? 0 46 | } 47 | 48 | var peekingLength: CGFloat { 49 | return dataSource?.cellPeekingLayoutPeekingLength(self) ?? 0 50 | } 51 | 52 | var spacingLength: CGFloat { 53 | return dataSource?.cellPeekingLayoutSpacingLength(self) ?? 0 54 | } 55 | 56 | override open var collectionViewContentSize: CGSize { 57 | switch scrollDirection { 58 | case .horizontal: 59 | return CGSize(width: contentLength(axis: .main, allowNegativeValues: false), height: contentLength(axis: .cross, allowNegativeValues: false)) 60 | case .vertical: 61 | return CGSize(width: contentLength(axis: .cross, allowNegativeValues: false), height: contentLength(axis: .main, allowNegativeValues: false)) 62 | default: 63 | return .zero 64 | } 65 | } 66 | 67 | public init(scrollDirection: UICollectionView.ScrollDirection) { 68 | self.scrollDirection = scrollDirection 69 | super.init() 70 | } 71 | 72 | required public init?(coder: NSCoder) { 73 | self.scrollDirection = .horizontal 74 | super.init(coder: coder) 75 | } 76 | 77 | func bounds(axis: Axis) -> CGFloat { 78 | switch (axis, scrollDirection) { 79 | case (.main, .horizontal), (.cross, .vertical): 80 | return boundsWidth 81 | case (.cross, .horizontal), (.main, .vertical): 82 | return boundsHeight 83 | default: 84 | assertionFailure("Not implemented") 85 | return 0 86 | } 87 | } 88 | 89 | /// Returns length of item without peeking length 90 | func itemLength(axis: Axis) -> CGFloat { 91 | let spacings = spacingLength * CGFloat(numberOfItemsToShow + 1) 92 | let peekings = peekingLength * 2 93 | switch axis { 94 | case .main: 95 | return (bounds(axis: .main) - spacings - peekings) / CGFloat(numberOfItemsToShow) 96 | case .cross: 97 | return bounds(axis: .cross) 98 | } 99 | } 100 | 101 | func contentLength(axis: Axis, allowNegativeValues: Bool) -> CGFloat { 102 | let spacing = allowNegativeValues ? spacingLength * 2 : max(0, spacingLength * 2) 103 | switch axis { 104 | case .main: 105 | let length = itemLength(axis: .main) 106 | let offsets = spacing + peekingLength * 2 // One from the start and one at the end 107 | return (length * CGFloat(numberOfItems)) + (CGFloat(numberOfItems) * spacingLength) + offsets 108 | case .cross: 109 | return itemLength(axis: .cross) 110 | } 111 | } 112 | 113 | func frameForItem(index: Int) -> CGRect { 114 | let mainLength = itemLength(axis: .main) 115 | let crossLength = itemLength(axis: .cross) 116 | 117 | // Offset from the beginning 118 | let contentOffset = peekingLength + spacingLength 119 | let mainMin = CGFloat(index) * (mainLength + spacingLength) + contentOffset 120 | let crossMin = CGFloat(0) 121 | switch scrollDirection { 122 | case .horizontal: 123 | return CGRect(x: mainMin, y: crossMin, width: mainLength, height: crossLength) 124 | case .vertical: 125 | return CGRect(x: crossMin, y: mainMin, width: crossLength, height: mainLength) 126 | default: 127 | assertionFailure("Not implemented") 128 | return .zero 129 | } 130 | } 131 | 132 | public func startingPointForItem(index: Int) -> CGPoint { 133 | let safeIndex = max(0, min(index, numberOfItems)) 134 | switch scrollDirection { 135 | case .horizontal: 136 | let x = frameForItem(index: safeIndex).minX - spacingLength - peekingLength 137 | return CGPoint(x: x, y: 0) 138 | case .vertical: 139 | let y = frameForItem(index: safeIndex).minY - spacingLength - peekingLength 140 | return CGPoint(x: 0, y: y) 141 | default: 142 | assertionFailure("Not implemented") 143 | return .zero 144 | } 145 | } 146 | 147 | public func indexForItemAtPoint(point: CGPoint) -> Int { 148 | // at 375 * 200, peeking = 20, spacing = 20, item length = 137.5 149 | // at index = 2, point is 315 150 | // at index = 4, point is 630 151 | // at index = 6, point is 945 152 | 153 | let pointOffset: CGFloat 154 | switch scrollDirection { 155 | case .horizontal: 156 | pointOffset = point.x 157 | case .vertical: 158 | pointOffset = point.y 159 | default: 160 | assertionFailure("Not implemented") 161 | return 0 162 | } 163 | 164 | let coefficent = pointOffset / (itemLength(axis: .main) + spacingLength) 165 | let finalCoefficent = Int(round(coefficent)) 166 | 167 | return min(max(0, finalCoefficent), numberOfItems) 168 | } 169 | 170 | func getIndexPaths(rect: CGRect) -> [IndexPath] { 171 | return (0.. UICollectionViewLayoutAttributes { 175 | let attributes = UICollectionViewLayoutAttributes(forCellWith: IndexPath(row: index, section: 0)) 176 | attributes.frame = frameForItem(index: index) 177 | return attributes 178 | } 179 | 180 | override open func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { 181 | return getIndexPaths(rect: rect).map{ self.getCollectionViewLayoutAttributes(index: $0.row) } 182 | } 183 | 184 | override open func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { 185 | return getCollectionViewLayoutAttributes(index: indexPath.row) 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /Sources/MSPeekCollectionViewDelegateImplementation/MSCollectionViewPaging.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MSCollectionViewPaging.swift 3 | // CustomCollectionViewLayout 4 | // 5 | // Created by Maher Santina on 12/7/19. 6 | // Copyright © 2019 Maher Santina. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// Defines a way to pass data to the paging logic 12 | public protocol MSCollectionViewPagingDataSource: AnyObject { 13 | 14 | /// Will be called whenever the pager needs the offset of a specific index 15 | func collectionViewPaging(_ collectionViewPaging: MSCollectionViewPaging, offsetForItemAtIndex index: Int) -> CGFloat 16 | 17 | /// Will be called whenever the pager needs an index at a specific offset. 18 | func collectionViewPaging(_ collectionViewPaging: MSCollectionViewPaging, indexForItemAtOffset offset: CGFloat) -> Int 19 | 20 | /// The minimum velocity required to jump to the adjacent item 21 | func collectionViewPagingVelocityThreshold(_ collectionViewPaging: MSCollectionViewPaging) -> CGFloat 22 | 23 | /// The minimum number of items to scroll 24 | func collectionViewPagingMinimumItemsToScroll(_ collectionViewPaging: MSCollectionViewPaging) -> Int? 25 | 26 | /// The maximum number of items to scroll 27 | func collectionViewPagingMaximumItemsToScroll(_ collectionViewPaging: MSCollectionViewPaging) -> Int? 28 | 29 | /// Returns whether a specific index exists in the collection items or not 30 | func collectionViewNumberOfItems(_ collectionViewPaging: MSCollectionViewPaging) -> Int 31 | } 32 | 33 | public class MSCollectionViewPaging: NSObject { 34 | 35 | weak var dataSource: MSCollectionViewPagingDataSource? 36 | 37 | var currentContentOffset: CGFloat = 0 38 | 39 | public var currentIndex: Int { 40 | return dataSource?.collectionViewPaging(self, indexForItemAtOffset: currentContentOffset) ?? 0 41 | } 42 | 43 | var velocityThreshold: CGFloat { 44 | return dataSource?.collectionViewPagingVelocityThreshold(self) ?? 0 45 | } 46 | 47 | var numberOfItems: Int { 48 | return dataSource?.collectionViewNumberOfItems(self) ?? 0 49 | } 50 | 51 | func setIndex(_ index: Int) { 52 | currentContentOffset = dataSource?.collectionViewPaging(self, offsetForItemAtIndex: index) ?? 0 53 | } 54 | 55 | func getIndexWithMinimumAndMaximumItemsToScroll(currentIndex: Int) -> Int { 56 | var offset = currentIndex 57 | // If we've set a minimum number of items to scroll, enforce it 58 | if let minimumItemsToScroll = dataSource?.collectionViewPagingMinimumItemsToScroll(self), offset != 0 { 59 | offset = max(offset, minimumItemsToScroll) 60 | } 61 | 62 | // If we've set a maximum number of items to scroll, enforce it 63 | if let maximumItemsToScroll = dataSource?.collectionViewPagingMaximumItemsToScroll(self) { 64 | offset = min(offset, maximumItemsToScroll) 65 | } 66 | return offset 67 | } 68 | 69 | func getNewTargetOffset(startingOffset: CGFloat, velocity: CGFloat, targetOffset: CGFloat) -> CGFloat { 70 | 71 | // Check the velocity, if it's greater than the threshold, move at least 1 cell in the direction of the velocity 72 | switch abs(velocity) { 73 | case let v where v > velocityThreshold: 74 | 75 | // Get the current index and target index based on the offset 76 | let currentIndex = dataSource?.collectionViewPaging(self, indexForItemAtOffset: startingOffset) ?? 0 77 | let targetIndex = dataSource?.collectionViewPaging(self, indexForItemAtOffset: targetOffset) ?? 0 78 | 79 | // Making sure not to scroll to non-existing indices 80 | let imAtFistItemAndScrollingBack = currentIndex == 0 && velocity < 0 81 | let imAtLastItemAndScrollingForward = currentIndex == numberOfItems && velocity > 0 82 | 83 | guard !imAtFistItemAndScrollingBack && !imAtLastItemAndScrollingForward else { return startingOffset } 84 | 85 | // Making sure we move at least 1 cell 86 | var offset = max(targetIndex - currentIndex, 1) 87 | 88 | offset = getIndexWithMinimumAndMaximumItemsToScroll(currentIndex: offset) 89 | 90 | // The final index is the current index ofsetted by the value and in the velocity direction 91 | var finalIndex = currentIndex + (offset * Sign(value: velocity).multiplier) 92 | 93 | let indexExists = finalIndex < numberOfItems 94 | // Move to index only if it exists. This will solve issues when there are multiple items in the same page 95 | if !indexExists { 96 | finalIndex = currentIndex 97 | } 98 | return dataSource?.collectionViewPaging(self, offsetForItemAtIndex: finalIndex) ?? 0 99 | 100 | default: 101 | 102 | var finalIndex = dataSource?.collectionViewPaging(self, indexForItemAtOffset: targetOffset) ?? 0 103 | 104 | finalIndex = getIndexWithMinimumAndMaximumItemsToScroll(currentIndex: finalIndex) 105 | 106 | return dataSource?.collectionViewPaging(self, offsetForItemAtIndex: finalIndex) ?? 0 107 | } 108 | } 109 | 110 | public func collectionViewWillEndDragging(scrollDirection: UICollectionView.ScrollDirection, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { 111 | var newOffset: CGFloat 112 | switch scrollDirection { 113 | case .horizontal: 114 | newOffset = getNewTargetOffset(startingOffset: currentContentOffset, velocity: velocity.x, targetOffset: targetContentOffset.pointee.x) 115 | targetContentOffset.pointee = CGPoint(x: newOffset, y: targetContentOffset.pointee.y) 116 | case .vertical: 117 | newOffset = getNewTargetOffset(startingOffset: currentContentOffset, velocity: velocity.y, targetOffset: targetContentOffset.pointee.y) 118 | targetContentOffset.pointee = CGPoint(x: targetContentOffset.pointee.x, y: newOffset) 119 | default: 120 | assertionFailure("Not Implemented") 121 | newOffset = 0 122 | } 123 | currentContentOffset = newOffset 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /Sources/MSPeekCollectionViewDelegateImplementation/MSCollectionViewPeekingBehavior.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MSCollectionViewPeekingBehavior.swift 3 | // CustomCollectionViewLayout 4 | // 5 | // Created by Maher Santina on 12/7/19. 6 | // Copyright © 2019 Maher Santina. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UICollectionView { 12 | public func configureForPeekingBehavior(behavior: MSCollectionViewPeekingBehavior) { 13 | collectionViewLayout = behavior.layout 14 | decelerationRate = .fast 15 | } 16 | } 17 | 18 | /// Defines a peeking behavior for the collection view. This class will hold all logic and dependencies to make the paging work 19 | public class MSCollectionViewPeekingBehavior { 20 | 21 | /// The collection view layout that allows cells to peek 22 | public var layout: MSCollectionViewCellPeekingLayout 23 | 24 | /// The scrolling paging behavior 25 | public var paging = MSCollectionViewPaging() 26 | 27 | /// The space between cells 28 | public var cellSpacing: CGFloat 29 | 30 | /// The peeking of the cells 31 | public var cellPeekWidth: CGFloat 32 | 33 | /// The minimum number of items that can be scrolled. Setting this value to nil will not add any constraints. 34 | /// 35 | /// This field is useful in cases where you have multiple items showing at the same time. Setting this value to the number of items to show will ensure that scrolling will always show a page with new items. 36 | public var minimumItemsToScroll: Int? 37 | 38 | /// The maximum number of items that can be scrolled. Setting this value to nil will not add any constraint 39 | /// 40 | /// The default implementation is to allow scrolling depending on the target page and the velocity. 41 | public var maximumItemsToScroll: Int? 42 | 43 | /// The number of items to be shown in each page 44 | public var numberOfItemsToShow: Int 45 | 46 | /// The direction of scrolling of the collection view 47 | public var scrollDirection: UICollectionView.ScrollDirection 48 | 49 | public var velocityThreshold: CGFloat 50 | 51 | /// Total number of items to be shown 52 | private var numberOfItems: Int { 53 | return layout.collectionView?.numberOfItems(inSection: 0) ?? 0 54 | } 55 | 56 | /// Returns the current index of the left most item 57 | public var currentIndex: Int { 58 | return paging.currentIndex 59 | } 60 | 61 | public init(cellSpacing: CGFloat = 20, cellPeekWidth: CGFloat = 20, minimumItemsToScroll: Int? = nil, maximumItemsToScroll: Int? = nil, numberOfItemsToShow: Int = 1, scrollDirection: UICollectionView.ScrollDirection = .horizontal, velocityThreshold: CGFloat = 0.2) { 62 | self.cellSpacing = cellSpacing 63 | self.cellPeekWidth = cellPeekWidth 64 | self.minimumItemsToScroll = minimumItemsToScroll 65 | self.maximumItemsToScroll = maximumItemsToScroll 66 | self.numberOfItemsToShow = numberOfItemsToShow 67 | self.scrollDirection = scrollDirection 68 | layout = MSCollectionViewCellPeekingLayout(scrollDirection: scrollDirection) 69 | self.velocityThreshold = velocityThreshold 70 | layout.dataSource = self 71 | paging.dataSource = self 72 | } 73 | 74 | /// Scrolls to an item at a specific index with or without animation 75 | public func scrollToItem(at index: Int, animated: Bool) { 76 | layout.collectionView?.setContentOffset(layout.startingPointForItem(index: index), animated: animated) 77 | paging.setIndex(index) 78 | } 79 | 80 | /// Required function to be called when the `scrollViewWillEndDragging` `UICollectionViewDelegate` function is called 81 | public func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { 82 | paging.collectionViewWillEndDragging(scrollDirection: scrollDirection, withVelocity: velocity, targetContentOffset: targetContentOffset) 83 | } 84 | } 85 | 86 | extension MSCollectionViewPeekingBehavior: MSCollectionViewCellPeekingLayoutDataSource { 87 | public func cellPeekingLayoutPeekingLength(_ layout: MSCollectionViewCellPeekingLayout) -> CGFloat { 88 | return cellPeekWidth 89 | } 90 | 91 | public func cellPeekingLayoutSpacingLength(_ layout: MSCollectionViewCellPeekingLayout) -> CGFloat { 92 | return cellSpacing 93 | } 94 | 95 | public func cellPeekingLayoutNumberOfItemsToShow(_ layout: MSCollectionViewCellPeekingLayout) -> Int { 96 | return numberOfItemsToShow 97 | } 98 | } 99 | 100 | extension MSCollectionViewPeekingBehavior: MSCollectionViewPagingDataSource { 101 | public func collectionViewPagingVelocityThreshold(_ collectionViewPaging: MSCollectionViewPaging) -> CGFloat { 102 | return velocityThreshold 103 | } 104 | 105 | public func collectionViewNumberOfItems(_ collectionViewPaging: MSCollectionViewPaging) -> Int { 106 | return numberOfItems 107 | } 108 | 109 | public func collectionViewPaging(_ collectionViewPaging: MSCollectionViewPaging, offsetForItemAtIndex index: Int) -> CGFloat { 110 | return layout.startingPointForItem(index: index).attribute(axis: .main, scrollDirection: scrollDirection) 111 | } 112 | 113 | public func collectionViewPaging(_ collectionViewPaging: MSCollectionViewPaging, indexForItemAtOffset offset: CGFloat) -> Int { 114 | let safeOffset = min(max(0, offset), layout.contentLength(axis: .main, allowNegativeValues: true)) 115 | let point: CGPoint 116 | switch (scrollDirection) { 117 | case .horizontal: 118 | point = CGPoint(x: safeOffset, y: 0) 119 | case .vertical: 120 | point = CGPoint(x: 0, y: safeOffset) 121 | default: 122 | assertionFailure("Not implemented") 123 | return .zero 124 | } 125 | return layout.indexForItemAtPoint(point: point) 126 | } 127 | 128 | public func collectionViewPagingMinimumItemsToScroll(_ collectionViewPaging: MSCollectionViewPaging) -> Int? { 129 | return minimumItemsToScroll 130 | } 131 | 132 | public func collectionViewPagingMaximumItemsToScroll(_ collectionViewPaging: MSCollectionViewPaging) -> Int? { 133 | return maximumItemsToScroll 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Sources/MSPeekCollectionViewDelegateImplementation/Sign.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Sign.swift 3 | // CustomCollectionViewLayout 4 | // 5 | // Created by Maher Santina on 12/8/19. 6 | // Copyright © 2019 Maher Santina. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | enum Sign { 12 | case positive 13 | case negative 14 | 15 | var multiplier: Int { 16 | switch self { 17 | case .positive: 18 | return 1 19 | case .negative: 20 | return -1 21 | } 22 | } 23 | 24 | init(value: Double) { 25 | if value < 0 { 26 | self = .negative 27 | } 28 | else { 29 | self = .positive 30 | } 31 | } 32 | 33 | init(value: CGFloat) { 34 | if value < 0 { 35 | self = .negative 36 | } 37 | else { 38 | self = .positive 39 | } 40 | } 41 | } 42 | 43 | extension CGFloat { 44 | var sign: Sign { 45 | switch self { 46 | case let x where x < 0: 47 | return .negative 48 | default: 49 | return .positive 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Sources/MSPeekCollectionViewDelegateImplementation/UICollectionView+PeekConfiguration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionView+PeekConfiguration.swift 3 | // MSPeekCollectionViewDelegateImplementation 4 | // 5 | // Created by Maher Santina on 2/3/19. 6 | // 7 | 8 | import UIKit 9 | 10 | extension UICollectionView { 11 | public func configureForPeekingDelegate(scrollDirection: UICollectionView.ScrollDirection = .horizontal) { 12 | self.decelerationRate = UIScrollView.DecelerationRate.fast 13 | self.showsHorizontalScrollIndicator = false 14 | self.showsVerticalScrollIndicator = false 15 | self.isPagingEnabled = false 16 | //Keeping this to support older versions 17 | let layout = collectionViewLayout as! UICollectionViewFlowLayout 18 | layout.scrollDirection = scrollDirection 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Sources/MSPeekCollectionViewDelegateImplementation/UICollectionViewScrollDirection+PeekDataCovnversion.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionViewScrollDirection+PeekDataCovnversion.swift 3 | // MSPeekCollectionViewDelegateImplementation 4 | // 5 | // Created by Maher Santina on 2/3/19. 6 | // 7 | 8 | import UIKit 9 | 10 | extension UICollectionView.ScrollDirection { 11 | func length(for view: UIView) -> CGFloat { 12 | switch self { 13 | case .horizontal: 14 | return view.frame.size.width 15 | case .vertical: 16 | return view.frame.size.height 17 | @unknown default: 18 | fatalError() 19 | } 20 | } 21 | 22 | func value(for point: CGPoint) -> CGFloat { 23 | switch self { 24 | case .horizontal: 25 | return point.x 26 | case .vertical: 27 | return point.y 28 | @unknown default: 29 | fatalError() 30 | } 31 | } 32 | 33 | func value(for size: CGSize) -> CGFloat { 34 | switch self { 35 | case .horizontal: 36 | return size.width 37 | case .vertical: 38 | return size.height 39 | @unknown default: 40 | fatalError() 41 | } 42 | } 43 | 44 | func point(for value: CGFloat, defaultPoint: CGPoint) -> CGPoint { 45 | switch self { 46 | case .horizontal: 47 | return CGPoint(x: value, y: defaultPoint.y) 48 | case .vertical: 49 | return CGPoint(x: defaultPoint.x, y: value) 50 | @unknown default: 51 | fatalError() 52 | } 53 | } 54 | 55 | func size(for value: CGFloat, defaultSize: CGSize) -> CGSize { 56 | switch self { 57 | case .horizontal: 58 | return CGSize(width: value, height: defaultSize.height) 59 | case .vertical: 60 | return CGSize(width: defaultSize.width, height: value) 61 | @unknown default: 62 | fatalError() 63 | } 64 | } 65 | 66 | func edgeInsets(for value: CGFloat) -> UIEdgeInsets { 67 | switch self { 68 | case .horizontal: 69 | return UIEdgeInsets(top: 0, left: value, bottom: 0, right: value) 70 | case .vertical: 71 | return UIEdgeInsets(top: value, left: 0, bottom: value, right: 0) 72 | @unknown default: 73 | fatalError() 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | import MSPeekCollectionViewDelegateImplementationTests 4 | 5 | var tests = [XCTestCaseEntry]() 6 | tests += MSPeekCollectionViewDelegateImplementationTests.allTests() 7 | XCTMain(tests) 8 | -------------------------------------------------------------------------------- /Tests/MSPeekCollectionViewDelegateImplementationTests/MSPeekingTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MSPeekingTests.swift 3 | // MSPeekCollectionViewDelegateImplementation_Tests 4 | // 5 | // Created by Maher Santina on 12/16/19. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import MSPeekCollectionViewDelegateImplementation 11 | 12 | class MSPeekingTests: XCTestCase { 13 | 14 | var sut: MSCollectionViewPeekingBehavior! 15 | var collectionView: UICollectionView! 16 | 17 | override func setUp() { 18 | 19 | } 20 | 21 | func setupWith(cellSpacing: CGFloat = 20, cellPeekWidth: CGFloat = 20) { 22 | sut = MSCollectionViewPeekingBehavior(cellSpacing: cellSpacing, cellPeekWidth: cellPeekWidth) 23 | collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 375, height: 200), collectionViewLayout: UICollectionViewFlowLayout()) 24 | collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "Cell") 25 | collectionView.configureForPeekingBehavior(behavior: sut) 26 | collectionView.dataSource = self 27 | collectionView.delegate = self 28 | } 29 | 30 | override func tearDown() { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | } 33 | 34 | private func simulateHorizontalScroll(distance: CGFloat, velocity: CGFloat) -> UnsafeMutablePointer { 35 | collectionView.delegate?.scrollViewWillBeginDragging?(collectionView) 36 | let simulatedTargetContentOffset = UnsafeMutablePointer.allocate(capacity: 1) 37 | simulatedTargetContentOffset.pointee = CGPoint(x: collectionView.contentOffset.x + distance, y: 0) 38 | collectionView.delegate?.scrollViewWillEndDragging?(collectionView, withVelocity: CGPoint(x: velocity, y: 0), targetContentOffset: simulatedTargetContentOffset) 39 | return simulatedTargetContentOffset 40 | } 41 | 42 | @discardableResult 43 | private func setContentIndex(index: Int) -> CGFloat { 44 | let offset = sut.collectionViewPaging(sut.paging, offsetForItemAtIndex: index) 45 | collectionView.setContentOffset(CGPoint(x: offset, y: 0), animated: false) 46 | sut.paging.setIndex(index) 47 | return offset 48 | } 49 | 50 | @discardableResult 51 | private func setContentOffset(offset: CGFloat) -> CGFloat { 52 | collectionView.setContentOffset(CGPoint(x: offset, y: 0), animated: false) 53 | sut.paging.currentContentOffset = offset 54 | return offset 55 | } 56 | 57 | func test_100PeekWidth_0CellSpacing() { 58 | setupWith(cellSpacing: 0, cellPeekWidth: 100) 59 | let target = simulateHorizontalScroll(distance: 10, velocity: 2) 60 | XCTAssertEqual(sut.layout.collectionViewContentSize.width, 900) 61 | } 62 | 63 | func test_0PeekWidth_0CellSpacing() { 64 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 65 | let target = simulateHorizontalScroll(distance: 10, velocity: 2) 66 | print(target.pointee) 67 | XCTAssertEqual(sut.layout.collectionViewContentSize.width, 1500) 68 | } 69 | 70 | func test_0PeekWidth_100CellSpacing() { 71 | setupWith(cellSpacing: 100, cellPeekWidth: 0) 72 | let target = simulateHorizontalScroll(distance: 10, velocity: 2) 73 | print(target.pointee) 74 | XCTAssertEqual(sut.layout.collectionViewContentSize.width, 1300) 75 | } 76 | 77 | func test_LessThanVelocityThreshold_Forward_ShouldShowCorrect() { 78 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 79 | setContentIndex(index: 1) 80 | let newOffset = simulateHorizontalScroll(distance: 50, velocity: 0.2).pointee.x 81 | XCTAssertEqual(newOffset, 375) 82 | } 83 | 84 | func test_GreaterThanVelocityThreshold_Forward_ShouldShowCorrect() { 85 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 86 | setContentIndex(index: 1) 87 | let newOffset = simulateHorizontalScroll(distance: 190, velocity: 0.21).pointee.x 88 | XCTAssertEqual(newOffset, 750) 89 | } 90 | 91 | func test_GreaterThanVelocityThreshold_Backward_ShouldShowCorrect() { 92 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 93 | setContentIndex(index: 1) 94 | let newOffset = simulateHorizontalScroll(distance: -50, velocity: -0.21).pointee.x 95 | XCTAssertEqual(newOffset, 0) 96 | } 97 | 98 | func test_GreaterThanVelocityThreshold_LastItem_GoingForward_ShouldShowCorrect() { 99 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 100 | setContentIndex(index: 3) 101 | let newOffset = simulateHorizontalScroll(distance: 50, velocity: 0.21).pointee.x 102 | XCTAssertEqual(newOffset, 1125) 103 | } 104 | 105 | func test_GreaterThanVelocityThreshold_FirstItem_GoingBack_ShouldShowCorrect() { 106 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 107 | setContentIndex(index: 0) 108 | let newOffset = simulateHorizontalScroll(distance: -50, velocity: -0.21).pointee.x 109 | XCTAssertEqual(newOffset, 0) 110 | } 111 | 112 | func test_SingleTap_ShouldShowCorrect() { 113 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 114 | setContentOffset(offset: 350) 115 | let newOffset = simulateHorizontalScroll(distance: 0, velocity: 0).pointee.x 116 | XCTAssertEqual(newOffset, 375) 117 | } 118 | 119 | func test_LessThanVelocityThreshold_ScrollForward_ShouldShowCorrect() { 120 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 121 | let newOffset = simulateHorizontalScroll(distance: 190, velocity: 0).pointee.x 122 | XCTAssertEqual(newOffset, 375) 123 | } 124 | 125 | func test_LessThanVelocityThreshold_ScrollBackward_ShouldShowCorrect() { 126 | setupWith(cellSpacing: 0, cellPeekWidth: 0) 127 | setContentIndex(index: 1) 128 | let newOffset = simulateHorizontalScroll(distance: -190, velocity: 0).pointee.x 129 | XCTAssertEqual(newOffset, 0) 130 | } 131 | 132 | } 133 | 134 | extension MSPeekingTests: UICollectionViewDataSource { 135 | func numberOfSections(in collectionView: UICollectionView) -> Int { 136 | return 1 137 | } 138 | 139 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 140 | return 4 141 | } 142 | 143 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 144 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) 145 | let value = (180 + CGFloat(indexPath.row)*20) / 255 146 | cell.contentView.backgroundColor = UIColor(red: value, green: value, blue: value, alpha: 1) 147 | return cell 148 | } 149 | } 150 | 151 | extension MSPeekingTests: UICollectionViewDelegate { 152 | func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { 153 | sut.scrollViewWillEndDragging(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset) 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /Tests/MSPeekCollectionViewDelegateImplementationTests/XCTestManifests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | #if !canImport(ObjectiveC) 4 | public func allTests() -> [XCTestCaseEntry] { 5 | return [ 6 | testCase(MSPeekCollectionViewDelegateImplementationTests.allTests), 7 | ] 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------