├── .gitignore ├── .travis.yml ├── CPInfiniteBanner.podspec ├── Example ├── CPInfiniteBanner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── CPInfiniteBanner-Example.xcscheme ├── CPInfiniteBanner.xcworkspace │ └── contents.xcworkspacedata ├── CPInfiniteBanner │ ├── CPAppDelegate.h │ ├── CPAppDelegate.m │ ├── CPInfiniteBanner-Info.plist │ ├── CPInfiniteBanner-Prefix.pch │ ├── CPViewController.h │ ├── CPViewController.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── LaunchImage.launchimage │ │ │ ├── 3.5.png │ │ │ ├── 4.png │ │ │ └── Contents.json │ ├── Images │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ └── 3.jpg │ ├── Main.storyboard │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── GIF └── iPhone 6.gif ├── LICENSE ├── Pod ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── CPInfiniteBannerSingleItem.h │ ├── CPInfiniteBannerSingleItem.m │ ├── CPInfiniteBannerView.h │ └── CPInfiniteBannerView.m └── README.md /.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 | *.moved-aside 17 | DerivedData 18 | *.hmap 19 | *.ipa 20 | 21 | # Bundler 22 | .bundle 23 | 24 | Carthage 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | # Note: if you ignore the Pods directory, make sure to uncomment 30 | # `pod install` in .travis.yml 31 | # 32 | Pods/ 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: 9 | # - gem install cocoapods # Since Travis is not always on latest version 10 | # - pod install --project-directory=Example 11 | install: 12 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 13 | script: 14 | - set -o pipefail && xcodebuild test -workspace Example/CPInfiniteBanner.xcworkspace -scheme CPInfiniteBanner-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c 15 | - pod lib lint --quick 16 | -------------------------------------------------------------------------------- /CPInfiniteBanner.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint CPInfiniteBanner.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # Any lines starting with a # are optional, but encouraged 6 | # 7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | s.name = "CPInfiniteBanner" 12 | s.version = "0.2.1" 13 | s.summary = "CPInfiniteBanner is an auto scroll banner lib." 14 | s.description = <<-DESC.gsub(/^\s*\|?/,'') 15 | An optional longer description of CPInfiniteBanner 16 | 17 | | * Markdown format. 18 | | * Don't worry about the indent, we strip it! 19 | DESC 20 | s.homepage = "https://github.com/crespoxiao/CPInfiniteBanner" 21 | # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" 22 | s.license = 'MIT' 23 | s.author = { "CrespoXiao" => "40176452@qq.com" } 24 | s.source = { :git => "https://github.com/crespoxiao/CPInfiniteBanner.git", :tag => s.version.to_s } 25 | # s.social_media_url = 'https://twitter.com/' 26 | 27 | s.platform = :ios, '7.0' 28 | s.requires_arc = true 29 | s.public_header_files = 'Pod/Classes/**/*.h' 30 | s.source_files = 'Pod/Classes/**/*' 31 | 32 | # Uncomment following lines if CPInfiniteBanner has some resource files. 33 | s.resource_bundles = { 34 | 'CPInfiniteBanner' => ['Pod/Assets/*'] 35 | } 36 | 37 | # Uncomment following lines if CPInfiniteBanner needs to link with some static libraries. 38 | # s.vendored_libraries = [ 39 | # 'Pod/lib/a-static-library.a', 40 | # ] 41 | 42 | # Uncomment following lines if CPInfiniteBanner depends on any system framework. 43 | s.frameworks = 'UIKit', 'Foundation' 44 | 45 | # Uncomment following lines if CPInfiniteBanner depends on any public or private pod. 46 | 47 | s.dependency 'libextobjc' 48 | s.dependency 'SDWebImage' 49 | s.dependency 'Masonry' 50 | 51 | end 52 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 24F392B106D61995B3FFE59C /* libPods-CPInfiniteBanner_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AEB5DA240DAB9AFD88B9A93 /* libPods-CPInfiniteBanner_Tests.a */; }; 11 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 12 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 13 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 14 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 15 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 16 | 6003F59E195388D20070C39A /* CPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* CPAppDelegate.m */; }; 17 | 6003F5A7195388D20070C39A /* CPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* CPViewController.m */; }; 18 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 19 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 20 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 21 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 22 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 23 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 24 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 25 | E32022AE7A7C239A37DD61C8 /* libPods-CPInfiniteBanner_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CCF60AFB45DFA745A6EED461 /* libPods-CPInfiniteBanner_Example.a */; }; 26 | E44D82771CCB84DE00F6AC93 /* 1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E44D82721CCB84DE00F6AC93 /* 1.jpg */; }; 27 | E44D82781CCB84DE00F6AC93 /* 2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E44D82731CCB84DE00F6AC93 /* 2.jpg */; }; 28 | E44D82791CCB84DE00F6AC93 /* 3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E44D82741CCB84DE00F6AC93 /* 3.jpg */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXContainerItemProxy section */ 32 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 6003F582195388D10070C39A /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 6003F589195388D20070C39A; 37 | remoteInfo = CPInfiniteBanner; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 0744E3D2288FDDDE47D89CD4 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 43 | 0AEB5DA240DAB9AFD88B9A93 /* libPods-CPInfiniteBanner_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CPInfiniteBanner_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 2C9F1BEBAEBE11FD66BE15A8 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 45 | 4C7BDD8699905E687D745438 /* Pods-CPInfiniteBanner_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CPInfiniteBanner_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-CPInfiniteBanner_Example/Pods-CPInfiniteBanner_Example.release.xcconfig"; sourceTree = ""; }; 46 | 6003F58A195388D20070C39A /* CPInfiniteBanner_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CPInfiniteBanner_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 48 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 49 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 50 | 6003F595195388D20070C39A /* CPInfiniteBanner-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CPInfiniteBanner-Info.plist"; sourceTree = ""; }; 51 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 52 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 53 | 6003F59B195388D20070C39A /* CPInfiniteBanner-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CPInfiniteBanner-Prefix.pch"; sourceTree = ""; }; 54 | 6003F59C195388D20070C39A /* CPAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPAppDelegate.h; sourceTree = ""; }; 55 | 6003F59D195388D20070C39A /* CPAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPAppDelegate.m; sourceTree = ""; }; 56 | 6003F5A5195388D20070C39A /* CPViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPViewController.h; sourceTree = ""; }; 57 | 6003F5A6195388D20070C39A /* CPViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPViewController.m; sourceTree = ""; }; 58 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 59 | 6003F5AE195388D20070C39A /* CPInfiniteBanner_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CPInfiniteBanner_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 61 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 62 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 63 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 64 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 65 | 7397C7AA88EAD5D63003BD0E /* Pods-CPInfiniteBanner_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CPInfiniteBanner_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CPInfiniteBanner_Example/Pods-CPInfiniteBanner_Example.debug.xcconfig"; sourceTree = ""; }; 66 | 83460799F54C15919159B680 /* Pods-CPInfiniteBanner_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CPInfiniteBanner_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CPInfiniteBanner_Tests/Pods-CPInfiniteBanner_Tests.debug.xcconfig"; sourceTree = ""; }; 67 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 68 | A27EEB257C2FEF222DB653B3 /* CPInfiniteBanner.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CPInfiniteBanner.podspec; path = ../CPInfiniteBanner.podspec; sourceTree = ""; }; 69 | AF4FDECE4B76FBF047168EBF /* Pods-CPInfiniteBanner_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CPInfiniteBanner_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CPInfiniteBanner_Tests/Pods-CPInfiniteBanner_Tests.release.xcconfig"; sourceTree = ""; }; 70 | CCF60AFB45DFA745A6EED461 /* libPods-CPInfiniteBanner_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CPInfiniteBanner_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | E44D82721CCB84DE00F6AC93 /* 1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = 1.jpg; path = Images/1.jpg; sourceTree = ""; }; 72 | E44D82731CCB84DE00F6AC93 /* 2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = 2.jpg; path = Images/2.jpg; sourceTree = ""; }; 73 | E44D82741CCB84DE00F6AC93 /* 3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = 3.jpg; path = Images/3.jpg; sourceTree = ""; }; 74 | /* End PBXFileReference section */ 75 | 76 | /* Begin PBXFrameworksBuildPhase section */ 77 | 6003F587195388D20070C39A /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 82 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 83 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 84 | E32022AE7A7C239A37DD61C8 /* libPods-CPInfiniteBanner_Example.a in Frameworks */, 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | 6003F5AB195388D20070C39A /* Frameworks */ = { 89 | isa = PBXFrameworksBuildPhase; 90 | buildActionMask = 2147483647; 91 | files = ( 92 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 93 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 94 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 95 | 24F392B106D61995B3FFE59C /* libPods-CPInfiniteBanner_Tests.a in Frameworks */, 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | /* End PBXFrameworksBuildPhase section */ 100 | 101 | /* Begin PBXGroup section */ 102 | 5F7CBCCDF0CBDBE6B804CDBA /* Pods */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7397C7AA88EAD5D63003BD0E /* Pods-CPInfiniteBanner_Example.debug.xcconfig */, 106 | 4C7BDD8699905E687D745438 /* Pods-CPInfiniteBanner_Example.release.xcconfig */, 107 | 83460799F54C15919159B680 /* Pods-CPInfiniteBanner_Tests.debug.xcconfig */, 108 | AF4FDECE4B76FBF047168EBF /* Pods-CPInfiniteBanner_Tests.release.xcconfig */, 109 | ); 110 | name = Pods; 111 | sourceTree = ""; 112 | }; 113 | 6003F581195388D10070C39A = { 114 | isa = PBXGroup; 115 | children = ( 116 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 117 | 6003F593195388D20070C39A /* Example for CPInfiniteBanner */, 118 | 6003F5B5195388D20070C39A /* Tests */, 119 | 6003F58C195388D20070C39A /* Frameworks */, 120 | 6003F58B195388D20070C39A /* Products */, 121 | 5F7CBCCDF0CBDBE6B804CDBA /* Pods */, 122 | ); 123 | sourceTree = ""; 124 | }; 125 | 6003F58B195388D20070C39A /* Products */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 6003F58A195388D20070C39A /* CPInfiniteBanner_Example.app */, 129 | 6003F5AE195388D20070C39A /* CPInfiniteBanner_Tests.xctest */, 130 | ); 131 | name = Products; 132 | sourceTree = ""; 133 | }; 134 | 6003F58C195388D20070C39A /* Frameworks */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 6003F58D195388D20070C39A /* Foundation.framework */, 138 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 139 | 6003F591195388D20070C39A /* UIKit.framework */, 140 | 6003F5AF195388D20070C39A /* XCTest.framework */, 141 | CCF60AFB45DFA745A6EED461 /* libPods-CPInfiniteBanner_Example.a */, 142 | 0AEB5DA240DAB9AFD88B9A93 /* libPods-CPInfiniteBanner_Tests.a */, 143 | ); 144 | name = Frameworks; 145 | sourceTree = ""; 146 | }; 147 | 6003F593195388D20070C39A /* Example for CPInfiniteBanner */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 6003F59C195388D20070C39A /* CPAppDelegate.h */, 151 | 6003F59D195388D20070C39A /* CPAppDelegate.m */, 152 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 153 | 6003F5A5195388D20070C39A /* CPViewController.h */, 154 | 6003F5A6195388D20070C39A /* CPViewController.m */, 155 | 6003F5A8195388D20070C39A /* Images.xcassets */, 156 | 6003F594195388D20070C39A /* Supporting Files */, 157 | ); 158 | name = "Example for CPInfiniteBanner"; 159 | path = CPInfiniteBanner; 160 | sourceTree = ""; 161 | }; 162 | 6003F594195388D20070C39A /* Supporting Files */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | E44D82711CCB84CB00F6AC93 /* image */, 166 | 6003F595195388D20070C39A /* CPInfiniteBanner-Info.plist */, 167 | 6003F596195388D20070C39A /* InfoPlist.strings */, 168 | 6003F599195388D20070C39A /* main.m */, 169 | 6003F59B195388D20070C39A /* CPInfiniteBanner-Prefix.pch */, 170 | ); 171 | name = "Supporting Files"; 172 | sourceTree = ""; 173 | }; 174 | 6003F5B5195388D20070C39A /* Tests */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 6003F5BB195388D20070C39A /* Tests.m */, 178 | 6003F5B6195388D20070C39A /* Supporting Files */, 179 | ); 180 | path = Tests; 181 | sourceTree = ""; 182 | }; 183 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 187 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 188 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 189 | ); 190 | name = "Supporting Files"; 191 | sourceTree = ""; 192 | }; 193 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | A27EEB257C2FEF222DB653B3 /* CPInfiniteBanner.podspec */, 197 | 2C9F1BEBAEBE11FD66BE15A8 /* README.md */, 198 | 0744E3D2288FDDDE47D89CD4 /* LICENSE */, 199 | ); 200 | name = "Podspec Metadata"; 201 | sourceTree = ""; 202 | }; 203 | E44D82711CCB84CB00F6AC93 /* image */ = { 204 | isa = PBXGroup; 205 | children = ( 206 | E44D82721CCB84DE00F6AC93 /* 1.jpg */, 207 | E44D82731CCB84DE00F6AC93 /* 2.jpg */, 208 | E44D82741CCB84DE00F6AC93 /* 3.jpg */, 209 | ); 210 | name = image; 211 | sourceTree = ""; 212 | }; 213 | /* End PBXGroup section */ 214 | 215 | /* Begin PBXNativeTarget section */ 216 | 6003F589195388D20070C39A /* CPInfiniteBanner_Example */ = { 217 | isa = PBXNativeTarget; 218 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CPInfiniteBanner_Example" */; 219 | buildPhases = ( 220 | D84ED3283CFE98C33E932FD0 /* Check Pods Manifest.lock */, 221 | 6003F586195388D20070C39A /* Sources */, 222 | 6003F587195388D20070C39A /* Frameworks */, 223 | 6003F588195388D20070C39A /* Resources */, 224 | E0353C2463C41C5364AF7332 /* Embed Pods Frameworks */, 225 | 6485DBC7CD52E51E9BCB33DF /* Copy Pods Resources */, 226 | ); 227 | buildRules = ( 228 | ); 229 | dependencies = ( 230 | ); 231 | name = CPInfiniteBanner_Example; 232 | productName = CPInfiniteBanner; 233 | productReference = 6003F58A195388D20070C39A /* CPInfiniteBanner_Example.app */; 234 | productType = "com.apple.product-type.application"; 235 | }; 236 | 6003F5AD195388D20070C39A /* CPInfiniteBanner_Tests */ = { 237 | isa = PBXNativeTarget; 238 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CPInfiniteBanner_Tests" */; 239 | buildPhases = ( 240 | 4EE9D1C90772F5930D505998 /* Check Pods Manifest.lock */, 241 | 6003F5AA195388D20070C39A /* Sources */, 242 | 6003F5AB195388D20070C39A /* Frameworks */, 243 | 6003F5AC195388D20070C39A /* Resources */, 244 | 5DA70809B3DFA5748BF1B3D7 /* Embed Pods Frameworks */, 245 | 5BDCA2BEA810DF595E321331 /* Copy Pods Resources */, 246 | ); 247 | buildRules = ( 248 | ); 249 | dependencies = ( 250 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 251 | ); 252 | name = CPInfiniteBanner_Tests; 253 | productName = CPInfiniteBannerTests; 254 | productReference = 6003F5AE195388D20070C39A /* CPInfiniteBanner_Tests.xctest */; 255 | productType = "com.apple.product-type.bundle.unit-test"; 256 | }; 257 | /* End PBXNativeTarget section */ 258 | 259 | /* Begin PBXProject section */ 260 | 6003F582195388D10070C39A /* Project object */ = { 261 | isa = PBXProject; 262 | attributes = { 263 | CLASSPREFIX = CP; 264 | LastUpgradeCheck = 0510; 265 | ORGANIZATIONNAME = xiaochengfei; 266 | TargetAttributes = { 267 | 6003F5AD195388D20070C39A = { 268 | TestTargetID = 6003F589195388D20070C39A; 269 | }; 270 | }; 271 | }; 272 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "CPInfiniteBanner" */; 273 | compatibilityVersion = "Xcode 3.2"; 274 | developmentRegion = English; 275 | hasScannedForEncodings = 0; 276 | knownRegions = ( 277 | en, 278 | Base, 279 | ); 280 | mainGroup = 6003F581195388D10070C39A; 281 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 282 | projectDirPath = ""; 283 | projectRoot = ""; 284 | targets = ( 285 | 6003F589195388D20070C39A /* CPInfiniteBanner_Example */, 286 | 6003F5AD195388D20070C39A /* CPInfiniteBanner_Tests */, 287 | ); 288 | }; 289 | /* End PBXProject section */ 290 | 291 | /* Begin PBXResourcesBuildPhase section */ 292 | 6003F588195388D20070C39A /* Resources */ = { 293 | isa = PBXResourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | E44D82781CCB84DE00F6AC93 /* 2.jpg in Resources */, 297 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 298 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 299 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 300 | E44D82791CCB84DE00F6AC93 /* 3.jpg in Resources */, 301 | E44D82771CCB84DE00F6AC93 /* 1.jpg in Resources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | 6003F5AC195388D20070C39A /* Resources */ = { 306 | isa = PBXResourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXResourcesBuildPhase section */ 314 | 315 | /* Begin PBXShellScriptBuildPhase section */ 316 | 4EE9D1C90772F5930D505998 /* Check Pods Manifest.lock */ = { 317 | isa = PBXShellScriptBuildPhase; 318 | buildActionMask = 2147483647; 319 | files = ( 320 | ); 321 | inputPaths = ( 322 | ); 323 | name = "Check Pods Manifest.lock"; 324 | outputPaths = ( 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | shellPath = /bin/sh; 328 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 329 | showEnvVarsInLog = 0; 330 | }; 331 | 5BDCA2BEA810DF595E321331 /* Copy Pods Resources */ = { 332 | isa = PBXShellScriptBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | ); 336 | inputPaths = ( 337 | ); 338 | name = "Copy Pods Resources"; 339 | outputPaths = ( 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | shellPath = /bin/sh; 343 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CPInfiniteBanner_Tests/Pods-CPInfiniteBanner_Tests-resources.sh\"\n"; 344 | showEnvVarsInLog = 0; 345 | }; 346 | 5DA70809B3DFA5748BF1B3D7 /* Embed Pods Frameworks */ = { 347 | isa = PBXShellScriptBuildPhase; 348 | buildActionMask = 2147483647; 349 | files = ( 350 | ); 351 | inputPaths = ( 352 | ); 353 | name = "Embed Pods Frameworks"; 354 | outputPaths = ( 355 | ); 356 | runOnlyForDeploymentPostprocessing = 0; 357 | shellPath = /bin/sh; 358 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CPInfiniteBanner_Tests/Pods-CPInfiniteBanner_Tests-frameworks.sh\"\n"; 359 | showEnvVarsInLog = 0; 360 | }; 361 | 6485DBC7CD52E51E9BCB33DF /* Copy Pods Resources */ = { 362 | isa = PBXShellScriptBuildPhase; 363 | buildActionMask = 2147483647; 364 | files = ( 365 | ); 366 | inputPaths = ( 367 | ); 368 | name = "Copy Pods Resources"; 369 | outputPaths = ( 370 | ); 371 | runOnlyForDeploymentPostprocessing = 0; 372 | shellPath = /bin/sh; 373 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CPInfiniteBanner_Example/Pods-CPInfiniteBanner_Example-resources.sh\"\n"; 374 | showEnvVarsInLog = 0; 375 | }; 376 | D84ED3283CFE98C33E932FD0 /* Check Pods Manifest.lock */ = { 377 | isa = PBXShellScriptBuildPhase; 378 | buildActionMask = 2147483647; 379 | files = ( 380 | ); 381 | inputPaths = ( 382 | ); 383 | name = "Check Pods Manifest.lock"; 384 | outputPaths = ( 385 | ); 386 | runOnlyForDeploymentPostprocessing = 0; 387 | shellPath = /bin/sh; 388 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 389 | showEnvVarsInLog = 0; 390 | }; 391 | E0353C2463C41C5364AF7332 /* Embed Pods Frameworks */ = { 392 | isa = PBXShellScriptBuildPhase; 393 | buildActionMask = 2147483647; 394 | files = ( 395 | ); 396 | inputPaths = ( 397 | ); 398 | name = "Embed Pods Frameworks"; 399 | outputPaths = ( 400 | ); 401 | runOnlyForDeploymentPostprocessing = 0; 402 | shellPath = /bin/sh; 403 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CPInfiniteBanner_Example/Pods-CPInfiniteBanner_Example-frameworks.sh\"\n"; 404 | showEnvVarsInLog = 0; 405 | }; 406 | /* End PBXShellScriptBuildPhase section */ 407 | 408 | /* Begin PBXSourcesBuildPhase section */ 409 | 6003F586195388D20070C39A /* Sources */ = { 410 | isa = PBXSourcesBuildPhase; 411 | buildActionMask = 2147483647; 412 | files = ( 413 | 6003F59E195388D20070C39A /* CPAppDelegate.m in Sources */, 414 | 6003F5A7195388D20070C39A /* CPViewController.m in Sources */, 415 | 6003F59A195388D20070C39A /* main.m in Sources */, 416 | ); 417 | runOnlyForDeploymentPostprocessing = 0; 418 | }; 419 | 6003F5AA195388D20070C39A /* Sources */ = { 420 | isa = PBXSourcesBuildPhase; 421 | buildActionMask = 2147483647; 422 | files = ( 423 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 424 | ); 425 | runOnlyForDeploymentPostprocessing = 0; 426 | }; 427 | /* End PBXSourcesBuildPhase section */ 428 | 429 | /* Begin PBXTargetDependency section */ 430 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 431 | isa = PBXTargetDependency; 432 | target = 6003F589195388D20070C39A /* CPInfiniteBanner_Example */; 433 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 434 | }; 435 | /* End PBXTargetDependency section */ 436 | 437 | /* Begin PBXVariantGroup section */ 438 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 439 | isa = PBXVariantGroup; 440 | children = ( 441 | 6003F597195388D20070C39A /* en */, 442 | ); 443 | name = InfoPlist.strings; 444 | sourceTree = ""; 445 | }; 446 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 447 | isa = PBXVariantGroup; 448 | children = ( 449 | 6003F5B9195388D20070C39A /* en */, 450 | ); 451 | name = InfoPlist.strings; 452 | sourceTree = ""; 453 | }; 454 | /* End PBXVariantGroup section */ 455 | 456 | /* Begin XCBuildConfiguration section */ 457 | 6003F5BD195388D20070C39A /* Debug */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | ALWAYS_SEARCH_USER_PATHS = NO; 461 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 462 | CLANG_CXX_LIBRARY = "libc++"; 463 | CLANG_ENABLE_MODULES = YES; 464 | CLANG_ENABLE_OBJC_ARC = YES; 465 | CLANG_WARN_BOOL_CONVERSION = YES; 466 | CLANG_WARN_CONSTANT_CONVERSION = YES; 467 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 468 | CLANG_WARN_EMPTY_BODY = YES; 469 | CLANG_WARN_ENUM_CONVERSION = YES; 470 | CLANG_WARN_INT_CONVERSION = YES; 471 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 472 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 473 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 474 | COPY_PHASE_STRIP = NO; 475 | GCC_C_LANGUAGE_STANDARD = gnu99; 476 | GCC_DYNAMIC_NO_PIC = NO; 477 | GCC_OPTIMIZATION_LEVEL = 0; 478 | GCC_PREPROCESSOR_DEFINITIONS = ( 479 | "DEBUG=1", 480 | "$(inherited)", 481 | ); 482 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 483 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 484 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 485 | GCC_WARN_UNDECLARED_SELECTOR = YES; 486 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 487 | GCC_WARN_UNUSED_FUNCTION = YES; 488 | GCC_WARN_UNUSED_VARIABLE = YES; 489 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 490 | ONLY_ACTIVE_ARCH = YES; 491 | SDKROOT = iphoneos; 492 | TARGETED_DEVICE_FAMILY = "1,2"; 493 | }; 494 | name = Debug; 495 | }; 496 | 6003F5BE195388D20070C39A /* Release */ = { 497 | isa = XCBuildConfiguration; 498 | buildSettings = { 499 | ALWAYS_SEARCH_USER_PATHS = NO; 500 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 501 | CLANG_CXX_LIBRARY = "libc++"; 502 | CLANG_ENABLE_MODULES = YES; 503 | CLANG_ENABLE_OBJC_ARC = YES; 504 | CLANG_WARN_BOOL_CONVERSION = YES; 505 | CLANG_WARN_CONSTANT_CONVERSION = YES; 506 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 507 | CLANG_WARN_EMPTY_BODY = YES; 508 | CLANG_WARN_ENUM_CONVERSION = YES; 509 | CLANG_WARN_INT_CONVERSION = YES; 510 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 511 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 512 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 513 | COPY_PHASE_STRIP = YES; 514 | ENABLE_NS_ASSERTIONS = NO; 515 | GCC_C_LANGUAGE_STANDARD = gnu99; 516 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 517 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 518 | GCC_WARN_UNDECLARED_SELECTOR = YES; 519 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 520 | GCC_WARN_UNUSED_FUNCTION = YES; 521 | GCC_WARN_UNUSED_VARIABLE = YES; 522 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 523 | SDKROOT = iphoneos; 524 | TARGETED_DEVICE_FAMILY = "1,2"; 525 | VALIDATE_PRODUCT = YES; 526 | }; 527 | name = Release; 528 | }; 529 | 6003F5C0195388D20070C39A /* Debug */ = { 530 | isa = XCBuildConfiguration; 531 | baseConfigurationReference = 7397C7AA88EAD5D63003BD0E /* Pods-CPInfiniteBanner_Example.debug.xcconfig */; 532 | buildSettings = { 533 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 534 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 535 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 536 | GCC_PREFIX_HEADER = "CPInfiniteBanner/CPInfiniteBanner-Prefix.pch"; 537 | INFOPLIST_FILE = "CPInfiniteBanner/CPInfiniteBanner-Info.plist"; 538 | MODULE_NAME = ExampleApp; 539 | PRODUCT_NAME = "$(TARGET_NAME)"; 540 | WRAPPER_EXTENSION = app; 541 | }; 542 | name = Debug; 543 | }; 544 | 6003F5C1195388D20070C39A /* Release */ = { 545 | isa = XCBuildConfiguration; 546 | baseConfigurationReference = 4C7BDD8699905E687D745438 /* Pods-CPInfiniteBanner_Example.release.xcconfig */; 547 | buildSettings = { 548 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 549 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 550 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 551 | GCC_PREFIX_HEADER = "CPInfiniteBanner/CPInfiniteBanner-Prefix.pch"; 552 | INFOPLIST_FILE = "CPInfiniteBanner/CPInfiniteBanner-Info.plist"; 553 | MODULE_NAME = ExampleApp; 554 | PRODUCT_NAME = "$(TARGET_NAME)"; 555 | WRAPPER_EXTENSION = app; 556 | }; 557 | name = Release; 558 | }; 559 | 6003F5C3195388D20070C39A /* Debug */ = { 560 | isa = XCBuildConfiguration; 561 | baseConfigurationReference = 83460799F54C15919159B680 /* Pods-CPInfiniteBanner_Tests.debug.xcconfig */; 562 | buildSettings = { 563 | BUNDLE_LOADER = "$(TEST_HOST)"; 564 | FRAMEWORK_SEARCH_PATHS = ( 565 | "$(SDKROOT)/Developer/Library/Frameworks", 566 | "$(inherited)", 567 | "$(DEVELOPER_FRAMEWORKS_DIR)", 568 | ); 569 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 570 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 571 | GCC_PREPROCESSOR_DEFINITIONS = ( 572 | "DEBUG=1", 573 | "$(inherited)", 574 | ); 575 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 576 | PRODUCT_NAME = "$(TARGET_NAME)"; 577 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CPInfiniteBanner_Example.app/CPInfiniteBanner_Example"; 578 | WRAPPER_EXTENSION = xctest; 579 | }; 580 | name = Debug; 581 | }; 582 | 6003F5C4195388D20070C39A /* Release */ = { 583 | isa = XCBuildConfiguration; 584 | baseConfigurationReference = AF4FDECE4B76FBF047168EBF /* Pods-CPInfiniteBanner_Tests.release.xcconfig */; 585 | buildSettings = { 586 | BUNDLE_LOADER = "$(TEST_HOST)"; 587 | FRAMEWORK_SEARCH_PATHS = ( 588 | "$(SDKROOT)/Developer/Library/Frameworks", 589 | "$(inherited)", 590 | "$(DEVELOPER_FRAMEWORKS_DIR)", 591 | ); 592 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 593 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 594 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 595 | PRODUCT_NAME = "$(TARGET_NAME)"; 596 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CPInfiniteBanner_Example.app/CPInfiniteBanner_Example"; 597 | WRAPPER_EXTENSION = xctest; 598 | }; 599 | name = Release; 600 | }; 601 | /* End XCBuildConfiguration section */ 602 | 603 | /* Begin XCConfigurationList section */ 604 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "CPInfiniteBanner" */ = { 605 | isa = XCConfigurationList; 606 | buildConfigurations = ( 607 | 6003F5BD195388D20070C39A /* Debug */, 608 | 6003F5BE195388D20070C39A /* Release */, 609 | ); 610 | defaultConfigurationIsVisible = 0; 611 | defaultConfigurationName = Release; 612 | }; 613 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "CPInfiniteBanner_Example" */ = { 614 | isa = XCConfigurationList; 615 | buildConfigurations = ( 616 | 6003F5C0195388D20070C39A /* Debug */, 617 | 6003F5C1195388D20070C39A /* Release */, 618 | ); 619 | defaultConfigurationIsVisible = 0; 620 | defaultConfigurationName = Release; 621 | }; 622 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "CPInfiniteBanner_Tests" */ = { 623 | isa = XCConfigurationList; 624 | buildConfigurations = ( 625 | 6003F5C3195388D20070C39A /* Debug */, 626 | 6003F5C4195388D20070C39A /* Release */, 627 | ); 628 | defaultConfigurationIsVisible = 0; 629 | defaultConfigurationName = Release; 630 | }; 631 | /* End XCConfigurationList section */ 632 | }; 633 | rootObject = 6003F582195388D10070C39A /* Project object */; 634 | } 635 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner.xcodeproj/xcshareddata/xcschemes/CPInfiniteBanner-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 79 | 80 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/CPAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPAppDelegate.h 3 | // CPInfiniteBanner 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface CPAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/CPAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPAppDelegate.m 3 | // CPInfiniteBanner 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | #import "CPAppDelegate.h" 10 | 11 | @implementation CPAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/CPInfiniteBanner-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.xiaojukeji.one-ios.demo.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | LSRequiresIPhoneOS 31 | 32 | UIMainStoryboardFile 33 | Main 34 | UIMainStoryboardFile~ipad 35 | Main 36 | UIRequiredDeviceCapabilities 37 | 38 | armv7 39 | armv7s 40 | arm64 41 | 42 | UISupportedInterfaceOrientations 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UISupportedInterfaceOrientations~ipad 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationPortraitUpsideDown 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/CPInfiniteBanner-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/CPViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPViewController.h 3 | // CPInfiniteBanner 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface CPViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/CPViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPViewController.m 3 | // CPInfiniteBanner 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | #import "CPViewController.h" 10 | #import 11 | 12 | 13 | @interface CPViewController () 14 | 15 | @end 16 | 17 | @implementation CPViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | self.view.backgroundColor = [UIColor lightGrayColor]; 23 | 24 | NSArray *array = @[@"http://file27.mafengwo.net/M00/52/F2/wKgB6lO_PTyAKKPBACID2dURuk410.jpeg", 25 | @"http://www.5068.com/u/faceimg/20140725173411.jpg", 26 | [UIImage imageNamed:@"2.jpg"]]; 27 | 28 | 29 | CPInfiniteBannerView *banner = [[CPInfiniteBannerView alloc]initWithContainerView:self.view responseBlock:^(NSString *link) { 30 | NSLog(@"the link of the image you pressed is %@",link); 31 | }]; 32 | banner.frame = CGRectMake(20, 30, self.view.frame.size.width-40, 90); 33 | banner.placeHolder = [UIImage imageNamed:@"3.jpg"]; 34 | banner.duration = 3.0; 35 | banner.enableAutoScroll = NO; 36 | banner.pageContolAliment = CPInfiniteBannerPageContolAlimentLeft; 37 | banner.pageControl.currentPageIndicatorTintColor = [UIColor blueColor]; 38 | banner.imageArray = [NSMutableArray arrayWithArray:array]; 39 | } 40 | 41 | - (void)didReceiveMemoryWarning { 42 | [super didReceiveMemoryWarning]; 43 | // Dispose of any resources that can be recreated. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/Images.xcassets/LaunchImage.launchimage/3.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crespoxiao/CPInfiniteBanner/0cd8843202bb3ae06ebd7c0768fde6886831a4ac/Example/CPInfiniteBanner/Images.xcassets/LaunchImage.launchimage/3.5.png -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/Images.xcassets/LaunchImage.launchimage/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crespoxiao/CPInfiniteBanner/0cd8843202bb3ae06ebd7c0768fde6886831a4ac/Example/CPInfiniteBanner/Images.xcassets/LaunchImage.launchimage/4.png -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "filename" : "3.5.png", 7 | "extent" : "full-screen", 8 | "minimum-system-version" : "7.0", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "extent" : "full-screen", 13 | "idiom" : "iphone", 14 | "subtype" : "retina4", 15 | "filename" : "4.png", 16 | "minimum-system-version" : "7.0", 17 | "orientation" : "portrait", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "orientation" : "portrait", 22 | "idiom" : "ipad", 23 | "extent" : "full-screen", 24 | "minimum-system-version" : "7.0", 25 | "scale" : "1x" 26 | }, 27 | { 28 | "orientation" : "landscape", 29 | "idiom" : "ipad", 30 | "extent" : "full-screen", 31 | "minimum-system-version" : "7.0", 32 | "scale" : "1x" 33 | }, 34 | { 35 | "orientation" : "portrait", 36 | "idiom" : "ipad", 37 | "extent" : "full-screen", 38 | "minimum-system-version" : "7.0", 39 | "scale" : "2x" 40 | }, 41 | { 42 | "orientation" : "landscape", 43 | "idiom" : "ipad", 44 | "extent" : "full-screen", 45 | "minimum-system-version" : "7.0", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/Images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crespoxiao/CPInfiniteBanner/0cd8843202bb3ae06ebd7c0768fde6886831a4ac/Example/CPInfiniteBanner/Images/1.jpg -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/Images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crespoxiao/CPInfiniteBanner/0cd8843202bb3ae06ebd7c0768fde6886831a4ac/Example/CPInfiniteBanner/Images/2.jpg -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/Images/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crespoxiao/CPInfiniteBanner/0cd8843202bb3ae06ebd7c0768fde6886831a4ac/Example/CPInfiniteBanner/Images/3.jpg -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/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 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/CPInfiniteBanner/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CPInfiniteBanner 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "CPAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CPAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | 3 | # We don't use Swift internally. Disable this option. 4 | #use_frameworks! 5 | 6 | # Use local pod code if available. 7 | def local_pod(name, *args) 8 | path = File.expand_path name, '../..' 9 | 10 | if File.exist? path 11 | pod name, :path => path 12 | else 13 | pod name, *args 14 | end 15 | end 16 | 17 | # Add global dependencies here. 18 | 19 | target 'CPInfiniteBanner_Example', :exclusive => true do 20 | # If CPInfiniteBanner depends on any private pod, remember to use `local_pod` 21 | # to refer it explicitly. 22 | # CocoaPods cannot distinguish public and private pod from podspec right now, 23 | # it's required to do so in Podfile. 24 | # 25 | # Sample: 26 | # local_pod "AnInternalPod", :git => "https://git.xiaojukeji.com/path/to/pod.git", :tag => "stable-tag" 27 | 28 | # Add Example specific dependencies here... 29 | 30 | pod "CPInfiniteBanner", :path => "../" 31 | end 32 | 33 | target 'CPInfiniteBanner_Tests', :exclusive => true do 34 | # Add Tests specific dependencies here... 35 | 36 | pod "CPInfiniteBanner", :path => "../" 37 | 38 | pod 'Kiwi' 39 | end 40 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CPInfiniteBanner (0.1.0): 3 | - libextobjc 4 | - Masonry 5 | - SDWebImage 6 | - Kiwi (2.4.0) 7 | - libextobjc (0.4.1): 8 | - libextobjc/EXTADT (= 0.4.1) 9 | - libextobjc/EXTConcreteProtocol (= 0.4.1) 10 | - libextobjc/EXTKeyPathCoding (= 0.4.1) 11 | - libextobjc/EXTNil (= 0.4.1) 12 | - libextobjc/EXTSafeCategory (= 0.4.1) 13 | - libextobjc/EXTScope (= 0.4.1) 14 | - libextobjc/EXTSelectorChecking (= 0.4.1) 15 | - libextobjc/EXTSynthesize (= 0.4.1) 16 | - libextobjc/NSInvocation+EXT (= 0.4.1) 17 | - libextobjc/NSMethodSignature+EXT (= 0.4.1) 18 | - libextobjc/RuntimeExtensions (= 0.4.1) 19 | - libextobjc/UmbrellaHeader (= 0.4.1) 20 | - libextobjc/EXTADT (0.4.1): 21 | - libextobjc/RuntimeExtensions 22 | - libextobjc/EXTConcreteProtocol (0.4.1): 23 | - libextobjc/RuntimeExtensions 24 | - libextobjc/EXTKeyPathCoding (0.4.1): 25 | - libextobjc/RuntimeExtensions 26 | - libextobjc/EXTNil (0.4.1): 27 | - libextobjc/RuntimeExtensions 28 | - libextobjc/EXTSafeCategory (0.4.1): 29 | - libextobjc/RuntimeExtensions 30 | - libextobjc/EXTScope (0.4.1): 31 | - libextobjc/RuntimeExtensions 32 | - libextobjc/EXTSelectorChecking (0.4.1): 33 | - libextobjc/RuntimeExtensions 34 | - libextobjc/EXTSynthesize (0.4.1): 35 | - libextobjc/RuntimeExtensions 36 | - libextobjc/NSInvocation+EXT (0.4.1): 37 | - libextobjc/RuntimeExtensions 38 | - libextobjc/NSMethodSignature+EXT (0.4.1): 39 | - libextobjc/RuntimeExtensions 40 | - libextobjc/RuntimeExtensions (0.4.1) 41 | - libextobjc/UmbrellaHeader (0.4.1) 42 | - Masonry (1.0.1) 43 | - SDWebImage (3.8.1): 44 | - SDWebImage/Core (= 3.8.1) 45 | - SDWebImage/Core (3.8.1) 46 | 47 | DEPENDENCIES: 48 | - CPInfiniteBanner (from `../`) 49 | - Kiwi 50 | 51 | EXTERNAL SOURCES: 52 | CPInfiniteBanner: 53 | :path: ../ 54 | 55 | SPEC CHECKSUMS: 56 | CPInfiniteBanner: cc4ab2b593fd54fd61d854d0760f4bee3753e40c 57 | Kiwi: f49c9d54b28917df5928fe44968a39ed198cb8a8 58 | libextobjc: a650fc1bf489a3d3a9bc2e621efa3e1006fc5471 59 | Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df 60 | SDWebImage: 35f9627a3e44b4f292a8a8ce6a531fa488239b91 61 | 62 | COCOAPODS: 0.39.0 63 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | @import Kiwi; 6 | @import FBSnapshotTestCase; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPInfiniteBannerTests.m 3 | // CPInfiniteBannerTests 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2015 CrespoXiao. All rights reserved. 7 | // 8 | 9 | // https://github.com/kiwi-bdd/Kiwi 10 | 11 | SPEC_BEGIN(InitialTests) 12 | 13 | describe(@"My initial tests", ^{ 14 | 15 | context(@"will fail", ^{ 16 | 17 | it(@"can do maths", ^{ 18 | [[@1 should] equal:@2]; 19 | }); 20 | 21 | it(@"can read", ^{ 22 | [[@"number" should] equal:@"string"]; 23 | }); 24 | 25 | it(@"will wait and fail", ^{ 26 | NSObject *object = [[NSObject alloc] init]; 27 | [[expectFutureValue(object) shouldEventually] receive:@selector(autoContentAccessingProxy)]; 28 | }); 29 | }); 30 | 31 | context(@"will pass", ^{ 32 | 33 | it(@"can do maths", ^{ 34 | [[@1 should] beLessThan:@23]; 35 | }); 36 | 37 | it(@"can read", ^{ 38 | [[@"team" shouldNot] containString:@"I"]; 39 | }); 40 | }); 41 | 42 | }); 43 | 44 | SPEC_END 45 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /GIF/iPhone 6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crespoxiao/CPInfiniteBanner/0cd8843202bb3ae06ebd7c0768fde6886831a4ac/GIF/iPhone 6.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 leichunfeng 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crespoxiao/CPInfiniteBanner/0cd8843202bb3ae06ebd7c0768fde6886831a4ac/Pod/Assets/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crespoxiao/CPInfiniteBanner/0cd8843202bb3ae06ebd7c0768fde6886831a4ac/Pod/Classes/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/CPInfiniteBannerSingleItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPInfiniteBannerSingleItem.h 3 | // Pods 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CPInfiniteBannerSingleItem : UIView 12 | 13 | @property (nonatomic,strong) UIImageView *imageView; 14 | 15 | @property (nonatomic,strong) UIImageView *placeHolderImageView; 16 | @property (nonatomic,strong) UIImage *placeHolderImage; 17 | 18 | @property (nonatomic,strong) NSString *link; 19 | @property (nonatomic,assign) BOOL hasSetImage; 20 | 21 | 22 | - (instancetype)initWithFrame:(CGRect)frame placeHolder:(UIImage *)placeHolder; 23 | 24 | - (void)setImage:(UIImage *)image; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pod/Classes/CPInfiniteBannerSingleItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPInfiniteBannerSingleItem.m 3 | // Pods 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | #import "CPInfiniteBannerSingleItem.h" 10 | #import 11 | #import 12 | 13 | 14 | @implementation CPInfiniteBannerSingleItem 15 | 16 | - (void)dealloc { 17 | _imageView = nil; 18 | _placeHolderImageView =nil; 19 | _placeHolderImage = nil; 20 | _link = nil; 21 | } 22 | 23 | 24 | - (instancetype)initWithFrame:(CGRect)frame placeHolder:(UIImage *)placeHolder { 25 | self = [super initWithFrame:frame]; 26 | if (self) { 27 | self.clipsToBounds = YES; 28 | self.userInteractionEnabled = YES; 29 | 30 | [self addSubview:self.imageView]; 31 | [self addSubview:self.placeHolderImageView]; 32 | [self makeConstraints]; 33 | 34 | self.placeHolderImage = placeHolder; 35 | } 36 | return self; 37 | } 38 | 39 | 40 | - (void)setImage:(UIImage *)image { 41 | self.hasSetImage = YES; 42 | [self.placeHolderImageView setHidden:YES]; 43 | [self.imageView setImage:image]; 44 | } 45 | 46 | #pragma mark - lazy load 47 | 48 | - (UIImageView *)imageView { 49 | if (!_imageView) { 50 | _imageView = [[UIImageView alloc]init]; 51 | _imageView.userInteractionEnabled = YES; 52 | [_imageView setContentMode:UIViewContentModeScaleToFill]; 53 | _imageView.clipsToBounds = YES; 54 | } 55 | return _imageView; 56 | } 57 | 58 | -(UIImageView *)placeHolderImageView { 59 | if (!_placeHolderImageView) { 60 | _placeHolderImageView = [[UIImageView alloc]init]; 61 | [_placeHolderImageView setContentMode:UIViewContentModeScaleToFill]; 62 | } 63 | return _placeHolderImageView; 64 | } 65 | 66 | #pragma mark - setter 67 | 68 | - (void)setPlaceHolderImage:(UIImage *)placeHolderImage { 69 | if (!placeHolderImage) { 70 | return; 71 | } 72 | _placeHolderImage = placeHolderImage; 73 | [self.placeHolderImageView setImage:_placeHolderImage]; 74 | } 75 | 76 | #pragma mark - constraints 77 | 78 | - (void)makeConstraints { 79 | @weakify(self); 80 | [self.imageView mas_updateConstraints:^(MASConstraintMaker *make) { 81 | @strongify(self); 82 | make.size.mas_equalTo(self); 83 | make.center.mas_equalTo(self); 84 | }]; 85 | 86 | [self.placeHolderImageView mas_updateConstraints:^(MASConstraintMaker *make) { 87 | @strongify(self); 88 | make.size.mas_equalTo(self); 89 | make.center.mas_equalTo(self); 90 | }]; 91 | } 92 | 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /Pod/Classes/CPInfiniteBannerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPInfiniteBannerView.h 3 | // Pods 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^CPInfiniteBannerResponseBlock)(NSString * link); 12 | 13 | typedef NS_ENUM(NSUInteger, CPInfiniteBannerPageContolAliment) { 14 | CPInfiniteBannerPageContolAlimentRight = 0, 15 | CPInfiniteBannerPageContolAlimentCenter, 16 | CPInfiniteBannerPageContolAlimentLeft 17 | }; 18 | 19 | 20 | @interface CPInfiniteBannerView : UIControl 21 | 22 | //placeholder of banner 23 | @property (nonatomic, strong ) UIImage *placeHolder; 24 | 25 | //image arrays of banner 26 | @property (nonatomic, strong ) NSMutableArray *imageArray; 27 | 28 | //duration of auto scroll, default is 3 29 | @property (nonatomic, assign ) CFTimeInterval duration; 30 | 31 | //enable auto scroll, default is Yes 32 | @property (nonatomic, assign ) BOOL enableAutoScroll; 33 | 34 | //page contol aliment, default is CPInfiniteBannerPageContolAlimentRight 35 | @property (nonatomic, assign ) CPInfiniteBannerPageContolAliment pageContolAliment; 36 | 37 | // scrollview to contol the images 38 | @property (nonatomic, strong, readonly) UIScrollView *scrollView; 39 | 40 | // you can cutom the pagecontol props 41 | @property (nonatomic, strong, readonly) UIPageControl *pageControl; 42 | 43 | /** 44 | * init method 45 | * 46 | * @param contianer 47 | * @param block 48 | * 49 | * @return 50 | */ 51 | - (instancetype)initWithContainerView:(UIView *)contianer responseBlock:(CPInfiniteBannerResponseBlock)block; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pod/Classes/CPInfiniteBannerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPInfiniteBannerView.m 3 | // Pods 4 | // 5 | // Created by CrespoXiao on 04/23/2016. 6 | // Copyright (c) 2016 CrespoXiao. All rights reserved. 7 | // 8 | 9 | #import "CPInfiniteBannerView.h" 10 | #import "CPInfiniteBannerSingleItem.h" 11 | 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | 18 | #define ITEM_WIDTH (self.frame.size.width) 19 | #define CP_SafeBlockRun(block, ...) block ? block(__VA_ARGS__) : nil 20 | 21 | 22 | 23 | @interface CPInfiniteBannerView () 24 | 25 | @property (nonatomic, strong) UIScrollView *scrollView; 26 | @property (nonatomic, strong) UIPageControl *pageControl; 27 | @property (nonatomic, strong) NSTimer *timer; 28 | @property (nonatomic, copy ) CPInfiniteBannerResponseBlock responseBlock; 29 | @end 30 | 31 | 32 | 33 | @implementation CPInfiniteBannerView 34 | 35 | 36 | - (void)dealloc { 37 | _scrollView.delegate = nil; 38 | _scrollView = nil; 39 | _pageControl = nil; 40 | _placeHolder = nil; 41 | 42 | if (_timer) { 43 | if ([_timer isValid]) { 44 | [_timer invalidate]; 45 | } 46 | _timer = nil; 47 | } 48 | 49 | if (_responseBlock) { 50 | _responseBlock = nil; 51 | } 52 | } 53 | 54 | - (instancetype)initWithContainerView:(UIView *)contianer responseBlock:(CPInfiniteBannerResponseBlock)block { 55 | self = [super init]; 56 | if (self) { 57 | [self commonInit]; 58 | 59 | if (contianer) { 60 | [contianer addSubview:self]; 61 | } else { 62 | [[[UIApplication sharedApplication].delegate window] addSubview:self]; 63 | } 64 | 65 | _responseBlock = [block copy]; 66 | } 67 | return self; 68 | } 69 | 70 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 71 | self = [super initWithCoder:aDecoder]; 72 | if (self) { 73 | [self commonInit]; 74 | } 75 | return self; 76 | } 77 | 78 | - (void)commonInit { 79 | [self addSubview:self.scrollView]; 80 | [self addSubview:self.pageControl]; 81 | _enableAutoScroll = YES; 82 | _pageContolAliment = CPInfiniteBannerPageContolAlimentRight; 83 | [self makeConstraints]; 84 | } 85 | 86 | #pragma mark - lazy load 87 | 88 | - (UIScrollView *)scrollView { 89 | if (!_scrollView) { 90 | _scrollView = [[UIScrollView alloc] init]; 91 | _scrollView.userInteractionEnabled = YES; 92 | _scrollView.bounces = YES; 93 | _scrollView.showsHorizontalScrollIndicator = NO; 94 | _scrollView.showsVerticalScrollIndicator = NO; 95 | _scrollView.pagingEnabled = YES; 96 | _scrollView.delegate = self; 97 | _scrollView.bounces = NO; 98 | _scrollView.decelerationRate = UIScrollViewDecelerationRateFast; 99 | UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self 100 | action:@selector(clickOnScrollView:)]; 101 | [_scrollView addGestureRecognizer:tapGesture]; 102 | } 103 | return _scrollView; 104 | } 105 | 106 | - (UIPageControl *)pageControl { 107 | if (!_pageControl) { 108 | _pageControl = [[UIPageControl alloc] init]; 109 | // 总页数 110 | _pageControl.hidesForSinglePage = YES; 111 | _pageControl.pageIndicatorTintColor = [UIColor whiteColor]; 112 | _pageControl.currentPageIndicatorTintColor = [UIColor orangeColor]; 113 | [_pageControl setBackgroundColor:[UIColor clearColor]]; 114 | _pageControl.currentPage = 0; 115 | } 116 | return _pageControl; 117 | } 118 | 119 | #pragma mark - constraints 120 | 121 | - (void)makeConstraints { 122 | @weakify(self); 123 | [self.scrollView mas_remakeConstraints:^(MASConstraintMaker *make) { 124 | @strongify(self); 125 | make.size.mas_equalTo(self); 126 | make.center.mas_equalTo(self); 127 | }]; 128 | 129 | [self.pageControl mas_remakeConstraints:^(MASConstraintMaker *make) { 130 | @strongify(self); 131 | if (self.pageContolAliment == CPInfiniteBannerPageContolAlimentRight) { 132 | make.right.equalTo(self.scrollView.mas_right).offset(-5); 133 | 134 | } else if (self.pageContolAliment == CPInfiniteBannerPageContolAlimentLeft) { 135 | make.left.equalTo(self.scrollView.mas_left).offset(5); 136 | 137 | } else if (self.pageContolAliment == CPInfiniteBannerPageContolAlimentCenter) { 138 | make.centerX.equalTo(self.scrollView.mas_centerX); 139 | 140 | } 141 | 142 | make.bottom.equalTo(self.scrollView.mas_bottom); 143 | 144 | make.height.equalTo(@20); 145 | }]; 146 | } 147 | 148 | 149 | #pragma mark - setter 150 | 151 | - (void)setPlaceHolder:(UIImage *)placeHolder { 152 | if (placeHolder) { 153 | _placeHolder = placeHolder; 154 | } 155 | } 156 | 157 | - (void)setDuration:(CFTimeInterval)duration { 158 | _duration = duration; 159 | } 160 | 161 | - (void)setImageArray:(NSMutableArray *)imageArray { 162 | 163 | if (!imageArray || (imageArray && ![imageArray count])) { 164 | return; 165 | } 166 | _imageArray = imageArray; 167 | 168 | if (_imageArray.count) { 169 | 170 | //首尾各加一张图片 171 | self.pageControl.hidden = YES; 172 | self.scrollView.contentSize = CGSizeMake(ITEM_WIDTH * (_imageArray.count+2), self.frame.size.height); 173 | //set center view 174 | for (NSInteger i = 0; i < _imageArray.count; i ++) { 175 | NSInteger tag = 100+i; 176 | [self buildSubViewOfScrollViewWithTag:tag andImageData:[_imageArray objectAtIndex:i]]; 177 | } 178 | 179 | //set head view 180 | NSInteger tag_head = 99; 181 | [self buildSubViewOfScrollViewWithTag:tag_head andImageData:[_imageArray lastObject]]; 182 | 183 | //set tail view 184 | NSInteger tag_tail = 100 + [_imageArray count]; 185 | [self buildSubViewOfScrollViewWithTag:tag_tail andImageData:[_imageArray firstObject]]; 186 | 187 | //move to the first item 188 | [self gotoStartPostionAfterSetData]; 189 | } 190 | } 191 | 192 | - (void)setEnableAutoScroll:(BOOL)enableAutoScroll { 193 | _enableAutoScroll = enableAutoScroll; 194 | enableAutoScroll ? [self fireTimer]:[self stopTimer]; 195 | } 196 | 197 | - (void)setPageContolAliment:(CPInfiniteBannerPageContolAliment)pageContolAliment { 198 | _pageContolAliment = pageContolAliment; 199 | [self makeConstraints]; 200 | } 201 | 202 | #pragma mark - build view 203 | 204 | - (void)buildSubViewOfScrollViewWithTag:(NSInteger)tag andImageData:(id)imageData { 205 | if ([self.scrollView viewWithTag:tag]) { 206 | [[self.scrollView viewWithTag:tag] removeFromSuperview]; 207 | } 208 | 209 | NSInteger position; 210 | if (tag == 99) { 211 | position = 0; 212 | }else if (tag == (100 + [_imageArray count])){ 213 | position = [_imageArray count]+1; 214 | }else{ 215 | position = (tag - 100) + 1; 216 | } 217 | CPInfiniteBannerSingleItem *singleItemView = [[CPInfiniteBannerSingleItem alloc] initWithFrame: 218 | CGRectMake(ITEM_WIDTH * position, 0, ITEM_WIDTH, self.frame.size.height) 219 | placeHolder:_placeHolder]; 220 | singleItemView.tag = tag; 221 | [self.scrollView addSubview:singleItemView]; 222 | 223 | 224 | if ([imageData isKindOfClass:[UIImage class]]) { 225 | dispatch_async(dispatch_get_main_queue(), ^{ 226 | singleItemView.link = nil; 227 | [singleItemView setImage:(UIImage*)imageData]; 228 | if (self.pageControl.hidden) { 229 | self.pageControl.hidden = NO; 230 | } 231 | }); 232 | }else if ([imageData isKindOfClass:[NSString class]]){ 233 | @weakify(self); 234 | [self downloadImageWithUrl:imageData relatedLink:imageData downloadImageCallBack:^(UIImage *image, NSString *link) { 235 | @strongify(self); 236 | if (image) { 237 | dispatch_async(dispatch_get_main_queue(), ^{ 238 | singleItemView.link = link; 239 | [singleItemView setImage:image]; 240 | if (self.pageControl.hidden) { 241 | self.pageControl.hidden = NO; 242 | } 243 | }); 244 | } 245 | }]; 246 | } 247 | } 248 | 249 | - (void)gotoStartPostionAfterSetData { 250 | self.pageControl.numberOfPages = [_imageArray count]; 251 | self.pageControl.currentPage = 0; 252 | [self scrollToIndex:0]; 253 | CGFloat targetX = self.scrollView.contentOffset.x + self.scrollView.frame.size.width; 254 | targetX = (NSInteger)(targetX/ITEM_WIDTH) * ITEM_WIDTH; 255 | [self.scrollView setContentOffset:CGPointMake(targetX, 0) animated:NO]; 256 | } 257 | 258 | 259 | #pragma mark - press image 260 | 261 | - (void)clickOnScrollView:(UITapGestureRecognizer *)gesture { 262 | CGPoint point = [gesture locationInView:self.scrollView]; 263 | NSInteger page = (NSInteger)point.x / (NSInteger)self.frame.size.width; 264 | 265 | CPInfiniteBannerSingleItem *itemView; 266 | NSInteger currentTag; 267 | if (page == 0) {//head 268 | currentTag = 99; 269 | }else if (page == [self.imageArray count]+1){//tail 270 | currentTag = (100 + [_imageArray count]); 271 | }else{//center 272 | currentTag = (page-1+100); 273 | } 274 | 275 | if ([self.scrollView viewWithTag:currentTag] && 276 | [[self.scrollView viewWithTag:currentTag]isKindOfClass:[CPInfiniteBannerSingleItem class]]) { 277 | itemView = (CPInfiniteBannerSingleItem *)[self.scrollView viewWithTag:currentTag]; 278 | 279 | if (_responseBlock) { 280 | if (itemView.link && [itemView.link length]) { 281 | CP_SafeBlockRun(_responseBlock,itemView.link); 282 | } 283 | } 284 | } 285 | } 286 | 287 | 288 | #pragma mark - timer methods 289 | 290 | - (void)fireTimer { 291 | if (!self.enableAutoScroll) { 292 | return; 293 | } 294 | [self stopTimer]; 295 | _duration = _duration ? _duration:3; 296 | _timer = [NSTimer scheduledTimerWithTimeInterval:_duration target:self selector:@selector(go2Next) userInfo:nil repeats:YES]; 297 | [[NSRunLoop mainRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes]; 298 | } 299 | 300 | - (void)go2Next { 301 | CGFloat targetX = self.scrollView.contentOffset.x + self.scrollView.frame.size.width; 302 | targetX = (NSInteger)(targetX/ITEM_WIDTH) * ITEM_WIDTH; 303 | [self.scrollView setContentOffset:CGPointMake(targetX, 0) animated:YES]; 304 | } 305 | 306 | - (void)stopTimer { 307 | if (_timer) { 308 | if ([_timer isValid]) { 309 | [_timer invalidate]; 310 | } 311 | } 312 | } 313 | 314 | 315 | #pragma mark -scrollView delegate 316 | 317 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 318 | [self stopTimer]; 319 | 320 | CGFloat targetX = scrollView.contentOffset.x; 321 | if ([self.imageArray count] >= 1){ 322 | if (targetX >= ITEM_WIDTH * ([self.imageArray count] + 1)) { 323 | targetX = ITEM_WIDTH; 324 | [self.scrollView setContentOffset:CGPointMake(targetX, 0) animated:NO]; 325 | }else if(targetX <= 0){ 326 | targetX = ITEM_WIDTH *[self.imageArray count]; 327 | [self.scrollView setContentOffset:CGPointMake(targetX, 0) animated:NO]; 328 | } 329 | } 330 | NSInteger page = (self.scrollView.contentOffset.x+ITEM_WIDTH/2.0) / ITEM_WIDTH; 331 | 332 | if ([self.imageArray count] > 1){ 333 | page --; 334 | if (page >= self.pageControl.numberOfPages){ 335 | page = 0; 336 | }else if(page <0){ 337 | page = self.pageControl.numberOfPages -1; 338 | } 339 | } 340 | self.pageControl.currentPage = page; 341 | 342 | [self fireTimer]; 343 | } 344 | 345 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { 346 | if (!decelerate){ 347 | CGFloat targetX = _scrollView.contentOffset.x + _scrollView.frame.size.width; 348 | targetX = (NSInteger)(targetX/ITEM_WIDTH) * ITEM_WIDTH; 349 | [self.scrollView setContentOffset:CGPointMake((NSInteger)targetX, 0) animated:YES]; 350 | } 351 | } 352 | 353 | 354 | - (void)scrollToIndex:(NSInteger)aIndex { 355 | if ([self.imageArray count]>1){ 356 | if (aIndex >= ([self.imageArray count])){ 357 | aIndex = [self.imageArray count]-1; 358 | } 359 | [self.scrollView setContentOffset:CGPointMake(ITEM_WIDTH*(aIndex+1), 0) animated:YES]; 360 | }else{ 361 | [self.scrollView setContentOffset:CGPointMake(0, 0) animated:YES]; 362 | } 363 | [self scrollViewDidScroll:self.scrollView]; 364 | } 365 | 366 | 367 | 368 | #pragma mark - download image 369 | 370 | - (void)downloadImageWithUrl:(NSString *)url 371 | relatedLink:(NSString *)relatedlink 372 | downloadImageCallBack:(void (^)(UIImage *image,NSString *link))block { 373 | if (url && ([url isKindOfClass:[NSString class]] && [url length])) { 374 | [[SDImageCache sharedImageCache] queryDiskCacheForKey:url done:^(UIImage *image, SDImageCacheType cacheType) { 375 | if (!image) { 376 | [[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:url] options:SDWebImageProgressiveDownload progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 377 | if (finished) { 378 | [[SDWebImageManager sharedManager] saveImageToCache:image forURL:[NSURL URLWithString:url]]; 379 | CP_SafeBlockRun(block,image,relatedlink?:@""); 380 | } 381 | }]; 382 | }else{ 383 | CP_SafeBlockRun(block,image,relatedlink?:@""); 384 | } 385 | }]; 386 | } 387 | } 388 | 389 | @end 390 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CPInfiniteBanner 2 | 3 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/crespoxiao/CPInfiniteBanner/blob/master/LICENSE) 4 | [![CocoaPods](https://img.shields.io/cocoapods/v/LCFInfiniteScrollView.svg)](http://cocoadocs.org/docsets/LCFInfiniteScrollView) 5 | [![CocoaPods](https://img.shields.io/cocoapods/p/LCFInfiniteScrollView.svg)](http://cocoadocs.org/docsets/LCFInfiniteScrollView) 6 | 7 | 8 | ![iPhone 6](GIF/iPhone 6.gif "iPhone 6") 9 | 10 | ## 功能简介 11 | 12 | CPInfiniteBanner是一个循环播放的组件,可以左右无缝滑动和自动切换图片。 13 | 14 | ## 使用方法 15 | 16 | ``` 17 | CPInfiniteBannerView *banner = [[CPInfiniteBannerView alloc]initWithContainerView:self.view responseBlock:nil]; 18 | banner.frame = CGRectMake(20, 30, self.view.frame.size.width-40, 90); 19 | banner.placeHolder = [UIImage imageNamed:@"3.jpg"]; 20 | banner.duration = 3.0; 21 | banner.imageArray = [NSMutableArray arrayWithArray:array]; 22 | ``` 23 | ## 安装 24 | 25 | 目前都使用cocoapods安装,在Podfile中加入 26 | 27 | ``` 28 | pod 'CPInfiniteBanner', '~> 0.2.1' 29 | ``` 30 | 31 | 32 | ## 设计思路 33 | 3个imageView放在scrollview上,左右2个imageview用于过渡,借助scrollview的deleagte来实现轮播逻辑。也可以参考别的实现方式 34 | 35 | ## 维护者 36 | 37 | CrespoXiao 38 | 39 | ## 版权声明 40 | 41 | CPInfiniteBanner is available under the MIT license. See the [LICENSE](LICENSE) file for more info. 42 | --------------------------------------------------------------------------------