├── .gitignore ├── .gitmodules ├── Image └── demo.gif ├── LICENSE ├── MMSpinImageView.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── MMSpinImageView ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── MMAppDelegate.h ├── MMAppDelegate.m ├── MMSpinImageView-Info.plist ├── MMSpinImageView-Prefix.pch ├── MMViewController.h ├── MMViewController.m ├── en.lproj │ └── InfoPlist.strings └── main.m ├── MMSpinImageViewTests ├── MMSpinImageViewTests-Info.plist ├── MMSpinImageViewTests.m └── en.lproj │ └── InfoPlist.strings ├── README.md ├── Resource ├── 01.png ├── 02.png ├── 03.png ├── 04.png ├── 05.png └── car.zip └── Source ├── MMSpinImageView.h └── MMSpinImageView.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "zipzap"] 2 | path = zipzap 3 | url = https://github.com/pixelglow/zipzap.git 4 | -------------------------------------------------------------------------------- /Image/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adad184/MMSpinImageView/097c89abf551404a5356777dbb4fd89ec9ce38bd/Image/demo.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 ralph li 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /MMSpinImageView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | ED1877A21870FCFE00F00729 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877A11870FCFE00F00729 /* Foundation.framework */; }; 11 | ED1877A41870FCFE00F00729 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877A31870FCFE00F00729 /* CoreGraphics.framework */; }; 12 | ED1877A61870FCFE00F00729 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877A51870FCFE00F00729 /* UIKit.framework */; }; 13 | ED1877AC1870FCFE00F00729 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ED1877AA1870FCFE00F00729 /* InfoPlist.strings */; }; 14 | ED1877AE1870FCFE00F00729 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1877AD1870FCFE00F00729 /* main.m */; }; 15 | ED1877B21870FCFE00F00729 /* MMAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1877B11870FCFE00F00729 /* MMAppDelegate.m */; }; 16 | ED1877B41870FCFE00F00729 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED1877B31870FCFE00F00729 /* Images.xcassets */; }; 17 | ED1877BB1870FCFE00F00729 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877BA1870FCFE00F00729 /* XCTest.framework */; }; 18 | ED1877BC1870FCFE00F00729 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877A11870FCFE00F00729 /* Foundation.framework */; }; 19 | ED1877BD1870FCFE00F00729 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877A51870FCFE00F00729 /* UIKit.framework */; }; 20 | ED1877C51870FCFE00F00729 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = ED1877C31870FCFE00F00729 /* InfoPlist.strings */; }; 21 | ED1877C71870FCFE00F00729 /* MMSpinImageViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1877C61870FCFE00F00729 /* MMSpinImageViewTests.m */; }; 22 | ED1877DC187103EB00F00729 /* libzipzap.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877D9187103E100F00729 /* libzipzap.a */; }; 23 | ED1877F1187105DF00F00729 /* MMSpinImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1877F0187105DF00F00729 /* MMSpinImageView.m */; }; 24 | ED1877F4187105EE00F00729 /* MMViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1877F3187105EE00F00729 /* MMViewController.m */; }; 25 | ED1877F81871095300F00729 /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877F61871095300F00729 /* libc++.dylib */; }; 26 | ED1877F91871095300F00729 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877F71871095300F00729 /* libz.dylib */; }; 27 | ED1877FB1871095B00F00729 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1877FA1871095B00F00729 /* ImageIO.framework */; }; 28 | ED18780218710C8F00F00729 /* 01.png in Resources */ = {isa = PBXBuildFile; fileRef = ED1877FC18710C8F00F00729 /* 01.png */; }; 29 | ED18780318710C8F00F00729 /* 02.png in Resources */ = {isa = PBXBuildFile; fileRef = ED1877FD18710C8F00F00729 /* 02.png */; }; 30 | ED18780418710C8F00F00729 /* 03.png in Resources */ = {isa = PBXBuildFile; fileRef = ED1877FE18710C8F00F00729 /* 03.png */; }; 31 | ED18780518710C8F00F00729 /* 04.png in Resources */ = {isa = PBXBuildFile; fileRef = ED1877FF18710C8F00F00729 /* 04.png */; }; 32 | ED18780618710C8F00F00729 /* 05.png in Resources */ = {isa = PBXBuildFile; fileRef = ED18780018710C8F00F00729 /* 05.png */; }; 33 | ED18780718710C8F00F00729 /* car.zip in Resources */ = {isa = PBXBuildFile; fileRef = ED18780118710C8F00F00729 /* car.zip */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | ED1877BE1870FCFE00F00729 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = ED1877961870FCFE00F00729 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = ED18779D1870FCFE00F00729; 42 | remoteInfo = MMSpinImageView; 43 | }; 44 | ED1877D6187103E100F00729 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = ED1877D0187103E000F00729 /* zipzap.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = D899CF82162C5EC100112F49; 49 | remoteInfo = "zipzap (OS X)"; 50 | }; 51 | ED1877D8187103E100F00729 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = ED1877D0187103E000F00729 /* zipzap.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = D899CFB0162C5EEB00112F49; 56 | remoteInfo = "zipzap (iOS)"; 57 | }; 58 | ED1877DA187103E100F00729 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = ED1877D0187103E000F00729 /* zipzap.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = D899CF96162C5EC100112F49; 63 | remoteInfo = zipzapTests; 64 | }; 65 | ED1877EA1871048700F00729 /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = ED1877D0187103E000F00729 /* zipzap.xcodeproj */; 68 | proxyType = 1; 69 | remoteGlobalIDString = D899CFAF162C5EEB00112F49; 70 | remoteInfo = "zipzap (iOS)"; 71 | }; 72 | /* End PBXContainerItemProxy section */ 73 | 74 | /* Begin PBXFileReference section */ 75 | ED18779E1870FCFE00F00729 /* MMSpinImageView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MMSpinImageView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 76 | ED1877A11870FCFE00F00729 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 77 | ED1877A31870FCFE00F00729 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 78 | ED1877A51870FCFE00F00729 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 79 | ED1877A91870FCFE00F00729 /* MMSpinImageView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MMSpinImageView-Info.plist"; sourceTree = ""; }; 80 | ED1877AB1870FCFE00F00729 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 81 | ED1877AD1870FCFE00F00729 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 82 | ED1877AF1870FCFE00F00729 /* MMSpinImageView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MMSpinImageView-Prefix.pch"; sourceTree = ""; }; 83 | ED1877B01870FCFE00F00729 /* MMAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMAppDelegate.h; sourceTree = ""; }; 84 | ED1877B11870FCFE00F00729 /* MMAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMAppDelegate.m; sourceTree = ""; }; 85 | ED1877B31870FCFE00F00729 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 86 | ED1877B91870FCFE00F00729 /* MMSpinImageViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MMSpinImageViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 87 | ED1877BA1870FCFE00F00729 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 88 | ED1877C21870FCFE00F00729 /* MMSpinImageViewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MMSpinImageViewTests-Info.plist"; sourceTree = ""; }; 89 | ED1877C41870FCFE00F00729 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 90 | ED1877C61870FCFE00F00729 /* MMSpinImageViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MMSpinImageViewTests.m; sourceTree = ""; }; 91 | ED1877D0187103E000F00729 /* zipzap.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = zipzap.xcodeproj; path = zipzap/zipzap.xcodeproj; sourceTree = ""; }; 92 | ED1877EF187105DF00F00729 /* MMSpinImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMSpinImageView.h; sourceTree = ""; }; 93 | ED1877F0187105DF00F00729 /* MMSpinImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMSpinImageView.m; sourceTree = ""; }; 94 | ED1877F2187105EE00F00729 /* MMViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMViewController.h; sourceTree = ""; }; 95 | ED1877F3187105EE00F00729 /* MMViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMViewController.m; sourceTree = ""; }; 96 | ED1877F61871095300F00729 /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; }; 97 | ED1877F71871095300F00729 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 98 | ED1877FA1871095B00F00729 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; 99 | ED1877FC18710C8F00F00729 /* 01.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 01.png; path = Resource/01.png; sourceTree = ""; }; 100 | ED1877FD18710C8F00F00729 /* 02.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 02.png; path = Resource/02.png; sourceTree = ""; }; 101 | ED1877FE18710C8F00F00729 /* 03.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 03.png; path = Resource/03.png; sourceTree = ""; }; 102 | ED1877FF18710C8F00F00729 /* 04.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 04.png; path = Resource/04.png; sourceTree = ""; }; 103 | ED18780018710C8F00F00729 /* 05.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 05.png; path = Resource/05.png; sourceTree = ""; }; 104 | ED18780118710C8F00F00729 /* car.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; name = car.zip; path = Resource/car.zip; sourceTree = ""; }; 105 | /* End PBXFileReference section */ 106 | 107 | /* Begin PBXFrameworksBuildPhase section */ 108 | ED18779B1870FCFE00F00729 /* Frameworks */ = { 109 | isa = PBXFrameworksBuildPhase; 110 | buildActionMask = 2147483647; 111 | files = ( 112 | ED1877FB1871095B00F00729 /* ImageIO.framework in Frameworks */, 113 | ED1877F81871095300F00729 /* libc++.dylib in Frameworks */, 114 | ED1877F91871095300F00729 /* libz.dylib in Frameworks */, 115 | ED1877DC187103EB00F00729 /* libzipzap.a in Frameworks */, 116 | ED1877A41870FCFE00F00729 /* CoreGraphics.framework in Frameworks */, 117 | ED1877A61870FCFE00F00729 /* UIKit.framework in Frameworks */, 118 | ED1877A21870FCFE00F00729 /* Foundation.framework in Frameworks */, 119 | ); 120 | runOnlyForDeploymentPostprocessing = 0; 121 | }; 122 | ED1877B61870FCFE00F00729 /* Frameworks */ = { 123 | isa = PBXFrameworksBuildPhase; 124 | buildActionMask = 2147483647; 125 | files = ( 126 | ED1877BB1870FCFE00F00729 /* XCTest.framework in Frameworks */, 127 | ED1877BD1870FCFE00F00729 /* UIKit.framework in Frameworks */, 128 | ED1877BC1870FCFE00F00729 /* Foundation.framework in Frameworks */, 129 | ); 130 | runOnlyForDeploymentPostprocessing = 0; 131 | }; 132 | /* End PBXFrameworksBuildPhase section */ 133 | 134 | /* Begin PBXGroup section */ 135 | ED1877951870FCFE00F00729 = { 136 | isa = PBXGroup; 137 | children = ( 138 | ED1877F51871065500F00729 /* Resource */, 139 | ED1877EE187105DF00F00729 /* Source */, 140 | ED1877A71870FCFE00F00729 /* MMSpinImageView */, 141 | ED1877C01870FCFE00F00729 /* MMSpinImageViewTests */, 142 | ED1877A01870FCFE00F00729 /* Frameworks */, 143 | ED18779F1870FCFE00F00729 /* Products */, 144 | ED1877D0187103E000F00729 /* zipzap.xcodeproj */, 145 | ); 146 | sourceTree = ""; 147 | }; 148 | ED18779F1870FCFE00F00729 /* Products */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | ED18779E1870FCFE00F00729 /* MMSpinImageView.app */, 152 | ED1877B91870FCFE00F00729 /* MMSpinImageViewTests.xctest */, 153 | ); 154 | name = Products; 155 | sourceTree = ""; 156 | }; 157 | ED1877A01870FCFE00F00729 /* Frameworks */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | ED1877FA1871095B00F00729 /* ImageIO.framework */, 161 | ED1877F61871095300F00729 /* libc++.dylib */, 162 | ED1877F71871095300F00729 /* libz.dylib */, 163 | ED1877A11870FCFE00F00729 /* Foundation.framework */, 164 | ED1877A31870FCFE00F00729 /* CoreGraphics.framework */, 165 | ED1877A51870FCFE00F00729 /* UIKit.framework */, 166 | ED1877BA1870FCFE00F00729 /* XCTest.framework */, 167 | ); 168 | name = Frameworks; 169 | sourceTree = ""; 170 | }; 171 | ED1877A71870FCFE00F00729 /* MMSpinImageView */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | ED1877B01870FCFE00F00729 /* MMAppDelegate.h */, 175 | ED1877B11870FCFE00F00729 /* MMAppDelegate.m */, 176 | ED1877B31870FCFE00F00729 /* Images.xcassets */, 177 | ED1877A81870FCFE00F00729 /* Supporting Files */, 178 | ED1877F2187105EE00F00729 /* MMViewController.h */, 179 | ED1877F3187105EE00F00729 /* MMViewController.m */, 180 | ); 181 | path = MMSpinImageView; 182 | sourceTree = ""; 183 | }; 184 | ED1877A81870FCFE00F00729 /* Supporting Files */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | ED1877A91870FCFE00F00729 /* MMSpinImageView-Info.plist */, 188 | ED1877AA1870FCFE00F00729 /* InfoPlist.strings */, 189 | ED1877AD1870FCFE00F00729 /* main.m */, 190 | ED1877AF1870FCFE00F00729 /* MMSpinImageView-Prefix.pch */, 191 | ); 192 | name = "Supporting Files"; 193 | sourceTree = ""; 194 | }; 195 | ED1877C01870FCFE00F00729 /* MMSpinImageViewTests */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | ED1877C61870FCFE00F00729 /* MMSpinImageViewTests.m */, 199 | ED1877C11870FCFE00F00729 /* Supporting Files */, 200 | ); 201 | path = MMSpinImageViewTests; 202 | sourceTree = ""; 203 | }; 204 | ED1877C11870FCFE00F00729 /* Supporting Files */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | ED1877C21870FCFE00F00729 /* MMSpinImageViewTests-Info.plist */, 208 | ED1877C31870FCFE00F00729 /* InfoPlist.strings */, 209 | ); 210 | name = "Supporting Files"; 211 | sourceTree = ""; 212 | }; 213 | ED1877D1187103E000F00729 /* Products */ = { 214 | isa = PBXGroup; 215 | children = ( 216 | ED1877D7187103E100F00729 /* libzipzap.a */, 217 | ED1877D9187103E100F00729 /* libzipzap.a */, 218 | ED1877DB187103E100F00729 /* zipzapTests.xctest */, 219 | ); 220 | name = Products; 221 | sourceTree = ""; 222 | }; 223 | ED1877EE187105DF00F00729 /* Source */ = { 224 | isa = PBXGroup; 225 | children = ( 226 | ED1877EF187105DF00F00729 /* MMSpinImageView.h */, 227 | ED1877F0187105DF00F00729 /* MMSpinImageView.m */, 228 | ); 229 | path = Source; 230 | sourceTree = ""; 231 | }; 232 | ED1877F51871065500F00729 /* Resource */ = { 233 | isa = PBXGroup; 234 | children = ( 235 | ED1877FC18710C8F00F00729 /* 01.png */, 236 | ED1877FD18710C8F00F00729 /* 02.png */, 237 | ED1877FE18710C8F00F00729 /* 03.png */, 238 | ED1877FF18710C8F00F00729 /* 04.png */, 239 | ED18780018710C8F00F00729 /* 05.png */, 240 | ED18780118710C8F00F00729 /* car.zip */, 241 | ); 242 | name = Resource; 243 | sourceTree = ""; 244 | }; 245 | /* End PBXGroup section */ 246 | 247 | /* Begin PBXNativeTarget section */ 248 | ED18779D1870FCFE00F00729 /* MMSpinImageView */ = { 249 | isa = PBXNativeTarget; 250 | buildConfigurationList = ED1877CA1870FCFE00F00729 /* Build configuration list for PBXNativeTarget "MMSpinImageView" */; 251 | buildPhases = ( 252 | ED18779A1870FCFE00F00729 /* Sources */, 253 | ED18779B1870FCFE00F00729 /* Frameworks */, 254 | ED18779C1870FCFE00F00729 /* Resources */, 255 | ); 256 | buildRules = ( 257 | ); 258 | dependencies = ( 259 | ED1877EB1871048700F00729 /* PBXTargetDependency */, 260 | ); 261 | name = MMSpinImageView; 262 | productName = MMSpinImageView; 263 | productReference = ED18779E1870FCFE00F00729 /* MMSpinImageView.app */; 264 | productType = "com.apple.product-type.application"; 265 | }; 266 | ED1877B81870FCFE00F00729 /* MMSpinImageViewTests */ = { 267 | isa = PBXNativeTarget; 268 | buildConfigurationList = ED1877CD1870FCFE00F00729 /* Build configuration list for PBXNativeTarget "MMSpinImageViewTests" */; 269 | buildPhases = ( 270 | ED1877B51870FCFE00F00729 /* Sources */, 271 | ED1877B61870FCFE00F00729 /* Frameworks */, 272 | ED1877B71870FCFE00F00729 /* Resources */, 273 | ); 274 | buildRules = ( 275 | ); 276 | dependencies = ( 277 | ED1877BF1870FCFE00F00729 /* PBXTargetDependency */, 278 | ); 279 | name = MMSpinImageViewTests; 280 | productName = MMSpinImageViewTests; 281 | productReference = ED1877B91870FCFE00F00729 /* MMSpinImageViewTests.xctest */; 282 | productType = "com.apple.product-type.bundle.unit-test"; 283 | }; 284 | /* End PBXNativeTarget section */ 285 | 286 | /* Begin PBXProject section */ 287 | ED1877961870FCFE00F00729 /* Project object */ = { 288 | isa = PBXProject; 289 | attributes = { 290 | CLASSPREFIX = MM; 291 | LastUpgradeCheck = 0500; 292 | ORGANIZATIONNAME = LJC; 293 | TargetAttributes = { 294 | ED1877B81870FCFE00F00729 = { 295 | TestTargetID = ED18779D1870FCFE00F00729; 296 | }; 297 | }; 298 | }; 299 | buildConfigurationList = ED1877991870FCFE00F00729 /* Build configuration list for PBXProject "MMSpinImageView" */; 300 | compatibilityVersion = "Xcode 3.2"; 301 | developmentRegion = English; 302 | hasScannedForEncodings = 0; 303 | knownRegions = ( 304 | en, 305 | ); 306 | mainGroup = ED1877951870FCFE00F00729; 307 | productRefGroup = ED18779F1870FCFE00F00729 /* Products */; 308 | projectDirPath = ""; 309 | projectReferences = ( 310 | { 311 | ProductGroup = ED1877D1187103E000F00729 /* Products */; 312 | ProjectRef = ED1877D0187103E000F00729 /* zipzap.xcodeproj */; 313 | }, 314 | ); 315 | projectRoot = ""; 316 | targets = ( 317 | ED18779D1870FCFE00F00729 /* MMSpinImageView */, 318 | ED1877B81870FCFE00F00729 /* MMSpinImageViewTests */, 319 | ); 320 | }; 321 | /* End PBXProject section */ 322 | 323 | /* Begin PBXReferenceProxy section */ 324 | ED1877D7187103E100F00729 /* libzipzap.a */ = { 325 | isa = PBXReferenceProxy; 326 | fileType = archive.ar; 327 | path = libzipzap.a; 328 | remoteRef = ED1877D6187103E100F00729 /* PBXContainerItemProxy */; 329 | sourceTree = BUILT_PRODUCTS_DIR; 330 | }; 331 | ED1877D9187103E100F00729 /* libzipzap.a */ = { 332 | isa = PBXReferenceProxy; 333 | fileType = archive.ar; 334 | path = libzipzap.a; 335 | remoteRef = ED1877D8187103E100F00729 /* PBXContainerItemProxy */; 336 | sourceTree = BUILT_PRODUCTS_DIR; 337 | }; 338 | ED1877DB187103E100F00729 /* zipzapTests.xctest */ = { 339 | isa = PBXReferenceProxy; 340 | fileType = wrapper.cfbundle; 341 | path = zipzapTests.xctest; 342 | remoteRef = ED1877DA187103E100F00729 /* PBXContainerItemProxy */; 343 | sourceTree = BUILT_PRODUCTS_DIR; 344 | }; 345 | /* End PBXReferenceProxy section */ 346 | 347 | /* Begin PBXResourcesBuildPhase section */ 348 | ED18779C1870FCFE00F00729 /* Resources */ = { 349 | isa = PBXResourcesBuildPhase; 350 | buildActionMask = 2147483647; 351 | files = ( 352 | ED18780418710C8F00F00729 /* 03.png in Resources */, 353 | ED18780618710C8F00F00729 /* 05.png in Resources */, 354 | ED18780218710C8F00F00729 /* 01.png in Resources */, 355 | ED1877AC1870FCFE00F00729 /* InfoPlist.strings in Resources */, 356 | ED18780518710C8F00F00729 /* 04.png in Resources */, 357 | ED1877B41870FCFE00F00729 /* Images.xcassets in Resources */, 358 | ED18780718710C8F00F00729 /* car.zip in Resources */, 359 | ED18780318710C8F00F00729 /* 02.png in Resources */, 360 | ); 361 | runOnlyForDeploymentPostprocessing = 0; 362 | }; 363 | ED1877B71870FCFE00F00729 /* Resources */ = { 364 | isa = PBXResourcesBuildPhase; 365 | buildActionMask = 2147483647; 366 | files = ( 367 | ED1877C51870FCFE00F00729 /* InfoPlist.strings in Resources */, 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | }; 371 | /* End PBXResourcesBuildPhase section */ 372 | 373 | /* Begin PBXSourcesBuildPhase section */ 374 | ED18779A1870FCFE00F00729 /* Sources */ = { 375 | isa = PBXSourcesBuildPhase; 376 | buildActionMask = 2147483647; 377 | files = ( 378 | ED1877F1187105DF00F00729 /* MMSpinImageView.m in Sources */, 379 | ED1877B21870FCFE00F00729 /* MMAppDelegate.m in Sources */, 380 | ED1877F4187105EE00F00729 /* MMViewController.m in Sources */, 381 | ED1877AE1870FCFE00F00729 /* main.m in Sources */, 382 | ); 383 | runOnlyForDeploymentPostprocessing = 0; 384 | }; 385 | ED1877B51870FCFE00F00729 /* Sources */ = { 386 | isa = PBXSourcesBuildPhase; 387 | buildActionMask = 2147483647; 388 | files = ( 389 | ED1877C71870FCFE00F00729 /* MMSpinImageViewTests.m in Sources */, 390 | ); 391 | runOnlyForDeploymentPostprocessing = 0; 392 | }; 393 | /* End PBXSourcesBuildPhase section */ 394 | 395 | /* Begin PBXTargetDependency section */ 396 | ED1877BF1870FCFE00F00729 /* PBXTargetDependency */ = { 397 | isa = PBXTargetDependency; 398 | target = ED18779D1870FCFE00F00729 /* MMSpinImageView */; 399 | targetProxy = ED1877BE1870FCFE00F00729 /* PBXContainerItemProxy */; 400 | }; 401 | ED1877EB1871048700F00729 /* PBXTargetDependency */ = { 402 | isa = PBXTargetDependency; 403 | name = "zipzap (iOS)"; 404 | targetProxy = ED1877EA1871048700F00729 /* PBXContainerItemProxy */; 405 | }; 406 | /* End PBXTargetDependency section */ 407 | 408 | /* Begin PBXVariantGroup section */ 409 | ED1877AA1870FCFE00F00729 /* InfoPlist.strings */ = { 410 | isa = PBXVariantGroup; 411 | children = ( 412 | ED1877AB1870FCFE00F00729 /* en */, 413 | ); 414 | name = InfoPlist.strings; 415 | sourceTree = ""; 416 | }; 417 | ED1877C31870FCFE00F00729 /* InfoPlist.strings */ = { 418 | isa = PBXVariantGroup; 419 | children = ( 420 | ED1877C41870FCFE00F00729 /* en */, 421 | ); 422 | name = InfoPlist.strings; 423 | sourceTree = ""; 424 | }; 425 | /* End PBXVariantGroup section */ 426 | 427 | /* Begin XCBuildConfiguration section */ 428 | ED1877C81870FCFE00F00729 /* Debug */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 434 | CLANG_CXX_LIBRARY = "libc++"; 435 | CLANG_ENABLE_MODULES = YES; 436 | CLANG_ENABLE_OBJC_ARC = YES; 437 | CLANG_WARN_BOOL_CONVERSION = YES; 438 | CLANG_WARN_CONSTANT_CONVERSION = YES; 439 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 440 | CLANG_WARN_EMPTY_BODY = YES; 441 | CLANG_WARN_ENUM_CONVERSION = YES; 442 | CLANG_WARN_INT_CONVERSION = YES; 443 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 444 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 445 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 446 | COPY_PHASE_STRIP = NO; 447 | GCC_C_LANGUAGE_STANDARD = gnu99; 448 | GCC_DYNAMIC_NO_PIC = NO; 449 | GCC_OPTIMIZATION_LEVEL = 0; 450 | GCC_PREPROCESSOR_DEFINITIONS = ( 451 | "DEBUG=1", 452 | "$(inherited)", 453 | ); 454 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 455 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 456 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 457 | GCC_WARN_UNDECLARED_SELECTOR = YES; 458 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 459 | GCC_WARN_UNUSED_FUNCTION = YES; 460 | GCC_WARN_UNUSED_VARIABLE = YES; 461 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 462 | ONLY_ACTIVE_ARCH = YES; 463 | SDKROOT = iphoneos; 464 | TARGETED_DEVICE_FAMILY = "1,2"; 465 | }; 466 | name = Debug; 467 | }; 468 | ED1877C91870FCFE00F00729 /* Release */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | ALWAYS_SEARCH_USER_PATHS = NO; 472 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 473 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 474 | CLANG_CXX_LIBRARY = "libc++"; 475 | CLANG_ENABLE_MODULES = YES; 476 | CLANG_ENABLE_OBJC_ARC = YES; 477 | CLANG_WARN_BOOL_CONVERSION = YES; 478 | CLANG_WARN_CONSTANT_CONVERSION = YES; 479 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 480 | CLANG_WARN_EMPTY_BODY = YES; 481 | CLANG_WARN_ENUM_CONVERSION = YES; 482 | CLANG_WARN_INT_CONVERSION = YES; 483 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 484 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 485 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 486 | COPY_PHASE_STRIP = YES; 487 | ENABLE_NS_ASSERTIONS = NO; 488 | GCC_C_LANGUAGE_STANDARD = gnu99; 489 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 490 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 491 | GCC_WARN_UNDECLARED_SELECTOR = YES; 492 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 493 | GCC_WARN_UNUSED_FUNCTION = YES; 494 | GCC_WARN_UNUSED_VARIABLE = YES; 495 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 496 | SDKROOT = iphoneos; 497 | TARGETED_DEVICE_FAMILY = "1,2"; 498 | VALIDATE_PRODUCT = YES; 499 | }; 500 | name = Release; 501 | }; 502 | ED1877CB1870FCFE00F00729 /* Debug */ = { 503 | isa = XCBuildConfiguration; 504 | buildSettings = { 505 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 506 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 507 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 508 | GCC_PREFIX_HEADER = "MMSpinImageView/MMSpinImageView-Prefix.pch"; 509 | HEADER_SEARCH_PATHS = ( 510 | "$(inherited)", 511 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 512 | ../zipzap, 513 | ); 514 | INFOPLIST_FILE = "MMSpinImageView/MMSpinImageView-Info.plist"; 515 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 516 | PRODUCT_NAME = "$(TARGET_NAME)"; 517 | TARGETED_DEVICE_FAMILY = 1; 518 | WRAPPER_EXTENSION = app; 519 | }; 520 | name = Debug; 521 | }; 522 | ED1877CC1870FCFE00F00729 /* Release */ = { 523 | isa = XCBuildConfiguration; 524 | buildSettings = { 525 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 526 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 527 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 528 | GCC_PREFIX_HEADER = "MMSpinImageView/MMSpinImageView-Prefix.pch"; 529 | HEADER_SEARCH_PATHS = ( 530 | "$(inherited)", 531 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 532 | ../zipzap, 533 | ); 534 | INFOPLIST_FILE = "MMSpinImageView/MMSpinImageView-Info.plist"; 535 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 536 | PRODUCT_NAME = "$(TARGET_NAME)"; 537 | TARGETED_DEVICE_FAMILY = 1; 538 | WRAPPER_EXTENSION = app; 539 | }; 540 | name = Release; 541 | }; 542 | ED1877CE1870FCFE00F00729 /* Debug */ = { 543 | isa = XCBuildConfiguration; 544 | buildSettings = { 545 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 546 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MMSpinImageView.app/MMSpinImageView"; 547 | FRAMEWORK_SEARCH_PATHS = ( 548 | "$(SDKROOT)/Developer/Library/Frameworks", 549 | "$(inherited)", 550 | "$(DEVELOPER_FRAMEWORKS_DIR)", 551 | ); 552 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 553 | GCC_PREFIX_HEADER = "MMSpinImageView/MMSpinImageView-Prefix.pch"; 554 | GCC_PREPROCESSOR_DEFINITIONS = ( 555 | "DEBUG=1", 556 | "$(inherited)", 557 | ); 558 | INFOPLIST_FILE = "MMSpinImageViewTests/MMSpinImageViewTests-Info.plist"; 559 | PRODUCT_NAME = "$(TARGET_NAME)"; 560 | TEST_HOST = "$(BUNDLE_LOADER)"; 561 | WRAPPER_EXTENSION = xctest; 562 | }; 563 | name = Debug; 564 | }; 565 | ED1877CF1870FCFE00F00729 /* Release */ = { 566 | isa = XCBuildConfiguration; 567 | buildSettings = { 568 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 569 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MMSpinImageView.app/MMSpinImageView"; 570 | FRAMEWORK_SEARCH_PATHS = ( 571 | "$(SDKROOT)/Developer/Library/Frameworks", 572 | "$(inherited)", 573 | "$(DEVELOPER_FRAMEWORKS_DIR)", 574 | ); 575 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 576 | GCC_PREFIX_HEADER = "MMSpinImageView/MMSpinImageView-Prefix.pch"; 577 | INFOPLIST_FILE = "MMSpinImageViewTests/MMSpinImageViewTests-Info.plist"; 578 | PRODUCT_NAME = "$(TARGET_NAME)"; 579 | TEST_HOST = "$(BUNDLE_LOADER)"; 580 | WRAPPER_EXTENSION = xctest; 581 | }; 582 | name = Release; 583 | }; 584 | /* End XCBuildConfiguration section */ 585 | 586 | /* Begin XCConfigurationList section */ 587 | ED1877991870FCFE00F00729 /* Build configuration list for PBXProject "MMSpinImageView" */ = { 588 | isa = XCConfigurationList; 589 | buildConfigurations = ( 590 | ED1877C81870FCFE00F00729 /* Debug */, 591 | ED1877C91870FCFE00F00729 /* Release */, 592 | ); 593 | defaultConfigurationIsVisible = 0; 594 | defaultConfigurationName = Release; 595 | }; 596 | ED1877CA1870FCFE00F00729 /* Build configuration list for PBXNativeTarget "MMSpinImageView" */ = { 597 | isa = XCConfigurationList; 598 | buildConfigurations = ( 599 | ED1877CB1870FCFE00F00729 /* Debug */, 600 | ED1877CC1870FCFE00F00729 /* Release */, 601 | ); 602 | defaultConfigurationIsVisible = 0; 603 | defaultConfigurationName = Release; 604 | }; 605 | ED1877CD1870FCFE00F00729 /* Build configuration list for PBXNativeTarget "MMSpinImageViewTests" */ = { 606 | isa = XCConfigurationList; 607 | buildConfigurations = ( 608 | ED1877CE1870FCFE00F00729 /* Debug */, 609 | ED1877CF1870FCFE00F00729 /* Release */, 610 | ); 611 | defaultConfigurationIsVisible = 0; 612 | defaultConfigurationName = Release; 613 | }; 614 | /* End XCConfigurationList section */ 615 | }; 616 | rootObject = ED1877961870FCFE00F00729 /* Project object */; 617 | } 618 | -------------------------------------------------------------------------------- /MMSpinImageView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MMSpinImageView/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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /MMSpinImageView/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /MMSpinImageView/MMAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMAppDelegate.h 3 | // MMSpinImageView 4 | // 5 | // Created by Ralph Li on 12/30/13. 6 | // Copyright (c) 2013 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MMAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MMSpinImageView/MMAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMAppDelegate.m 3 | // MMSpinImageView 4 | // 5 | // Created by Ralph Li on 12/30/13. 6 | // Copyright (c) 2013 LJC. All rights reserved. 7 | // 8 | 9 | #import "MMAppDelegate.h" 10 | #import "MMViewController.h" 11 | 12 | @implementation MMAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | // Override point for customization after application launch. 18 | 19 | self.window.rootViewController = [[MMViewController alloc] init]; 20 | 21 | self.window.backgroundColor = [UIColor whiteColor]; 22 | [self.window makeKeyAndVisible]; 23 | return YES; 24 | } 25 | 26 | - (void)applicationWillResignActive:(UIApplication *)application 27 | { 28 | // 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. 29 | // 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. 30 | } 31 | 32 | - (void)applicationDidEnterBackground:(UIApplication *)application 33 | { 34 | // 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. 35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 36 | } 37 | 38 | - (void)applicationWillEnterForeground:(UIApplication *)application 39 | { 40 | // 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. 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application 44 | { 45 | // 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. 46 | } 47 | 48 | - (void)applicationWillTerminate:(UIApplication *)application 49 | { 50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /MMSpinImageView/MMSpinImageView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.ljc.${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 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarHidden 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /MMSpinImageView/MMSpinImageView-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_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | 18 | #import -------------------------------------------------------------------------------- /MMSpinImageView/MMViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMViewController.h 3 | // MMSpinImageView 4 | // 5 | // Created by Ralph Li on 12/30/13. 6 | // Copyright (c) 2013 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MMViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MMSpinImageView/MMViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMViewController.m 3 | // MMSpinImageView 4 | // 5 | // Created by Ralph Li on 12/30/13. 6 | // Copyright (c) 2013 LJC. All rights reserved. 7 | // 8 | 9 | #import "MMViewController.h" 10 | #import "MMSpinImageView.h" 11 | 12 | @interface MMViewController () 13 | < 14 | MMSpinImageViewDelegate 15 | > 16 | 17 | @property (nonatomic, strong) MMSpinImageView *imageView; 18 | @property (nonatomic, strong) UIButton *btnMemo; 19 | @property (nonatomic, strong) UIButton *btnFile; 20 | 21 | @end 22 | 23 | @implementation MMViewController 24 | 25 | - (id)init 26 | { 27 | self = [super init]; 28 | if (self) { 29 | // Custom initialization 30 | self.imageView = [[MMSpinImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)]; 31 | self.imageView.delegate = self; 32 | [self.view addSubview:self.imageView]; 33 | 34 | self.btnMemo = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 35 | self.btnMemo.layer.borderWidth = 1.0f; 36 | self.btnMemo.frame = CGRectMake(20, 320, 130, 50); 37 | [self.btnMemo setTitle:@"load images" forState:UIControlStateNormal]; 38 | [self.btnMemo setBackgroundColor:[UIColor whiteColor]]; 39 | [self.btnMemo addTarget:self action:@selector(actionMemo) forControlEvents:UIControlEventTouchUpInside]; 40 | [self.view addSubview:self.btnMemo]; 41 | 42 | self.btnFile = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 43 | self.btnFile.layer.borderWidth = 1.0f; 44 | self.btnFile.frame = CGRectMake(170, 320, 130, 50); 45 | [self.btnFile setTitle:@"load zip file" forState:UIControlStateNormal]; 46 | [self.btnFile setBackgroundColor:[UIColor whiteColor]]; 47 | [self.btnFile addTarget:self action:@selector(actionFile) forControlEvents:UIControlEventTouchUpInside]; 48 | [self.view addSubview:self.btnFile]; 49 | 50 | } 51 | return self; 52 | } 53 | 54 | - (void)viewDidLoad 55 | { 56 | [super viewDidLoad]; 57 | // Do any additional setup after loading the view. 58 | } 59 | 60 | - (void)didReceiveMemoryWarning 61 | { 62 | [super didReceiveMemoryWarning]; 63 | // Dispose of any resources that can be recreated. 64 | } 65 | 66 | - (void) actionMemo 67 | { 68 | self.imageView.imagesArray = @[ 69 | [UIImage imageNamed:@"01.png"], 70 | [UIImage imageNamed:@"02.png"], 71 | [UIImage imageNamed:@"03.png"], 72 | [UIImage imageNamed:@"04.png"], 73 | [UIImage imageNamed:@"05.png"] 74 | ]; 75 | } 76 | 77 | - (void) actionFile 78 | { 79 | [self.imageView loadDataFromZip:[[NSBundle mainBundle].resourcePath stringByAppendingString:@"/car.zip"]]; 80 | } 81 | 82 | - (void)spinImageView:(MMSpinImageView *)view didSelectAtIndex:(NSInteger)index 83 | { 84 | NSLog(@"%d",index); 85 | } 86 | 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /MMSpinImageView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /MMSpinImageView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MMSpinImageView 4 | // 5 | // Created by Ralph Li on 12/30/13. 6 | // Copyright (c) 2013 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MMAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([MMAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MMSpinImageViewTests/MMSpinImageViewTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.ljc.${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 | -------------------------------------------------------------------------------- /MMSpinImageViewTests/MMSpinImageViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMSpinImageViewTests.m 3 | // MMSpinImageViewTests 4 | // 5 | // Created by Ralph Li on 12/30/13. 6 | // Copyright (c) 2013 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MMSpinImageViewTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MMSpinImageViewTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /MMSpinImageViewTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MMSpinImageView 2 | =============== 3 | [![CocoaPods](https://img.shields.io/cocoapods/v/MMSpinImageView.svg)]() 4 | [![CocoaPods](https://img.shields.io/cocoapods/p/MMSpinImageView.svg)]() 5 | [![CocoaPods](https://img.shields.io/cocoapods/l/MMSpinImageView.svg)]() 6 | 7 | **MMSpinImageView** is UIView to display 360 degree spin photography. 8 | 9 | ![demo](https://github.com/adad184/MMSpinImageView/blob/master/Image/demo.gif?raw=true) 10 | 11 | 12 | Usage 13 | =============== 14 | 15 | There's 3 ways to use **MMSpinImageView**. 16 | 17 | you can use datasource to provide your images. 18 | 19 | 20 | @protocol MMSpinImageViewDelegate 21 | 22 | @optional 23 | 24 | - (void)spinImageView:(MMSpinImageView*)view didSelectAtIndex:(NSInteger)index; 25 | - (void)spinImageViewBeginLoadData:(MMSpinImageView*)view; 26 | - (void)spinImageViewEndLoadData:(MMSpinImageView*)view; 27 | - (void)spinImageViewFailedLoadData:(MMSpinImageView*)view; 28 | 29 | @end 30 | 31 | @protocol MMSpinImageViewDatasource 32 | 33 | - (UIImage *)spinImageView:(MMSpinImageView *)view imageAtIndex:(NSInteger)index; 34 | 35 | @optional 36 | - (NSInteger)numberOfViewsInspinImageView:(MMSpinImageView *)spinImageView; 37 | 38 | @end 39 | 40 | 41 | or you can directly set the images array. 42 | 43 | 44 | @property (nonatomic, strong) NSArray *imagesArray; 45 | 46 | and maybe you want to load images from zip file.( this feather depends on [zipzap](https://github.com/pixelglow/zipzap), you can remove relative methods if you don't need this) 47 | 48 | - (void)loadDataFromZip:(NSString*)path; 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Resource/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adad184/MMSpinImageView/097c89abf551404a5356777dbb4fd89ec9ce38bd/Resource/01.png -------------------------------------------------------------------------------- /Resource/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adad184/MMSpinImageView/097c89abf551404a5356777dbb4fd89ec9ce38bd/Resource/02.png -------------------------------------------------------------------------------- /Resource/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adad184/MMSpinImageView/097c89abf551404a5356777dbb4fd89ec9ce38bd/Resource/03.png -------------------------------------------------------------------------------- /Resource/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adad184/MMSpinImageView/097c89abf551404a5356777dbb4fd89ec9ce38bd/Resource/04.png -------------------------------------------------------------------------------- /Resource/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adad184/MMSpinImageView/097c89abf551404a5356777dbb4fd89ec9ce38bd/Resource/05.png -------------------------------------------------------------------------------- /Resource/car.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adad184/MMSpinImageView/097c89abf551404a5356777dbb4fd89ec9ce38bd/Resource/car.zip -------------------------------------------------------------------------------- /Source/MMSpinImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HMspinImageView.h 3 | // museum 4 | // 5 | // Created by Ralph Li on 12/25/13. 6 | // Copyright (c) 2013 hnmuseum. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef NS_ENUM(NSInteger, MMSpinViewDirection) { 13 | MMSpinViewDirectionForward, 14 | MMSpinViewDirectionBackward, 15 | MMSpinViewDirectionMax = 999 16 | }; 17 | 18 | @class MMSpinImageView; 19 | 20 | @protocol MMSpinImageViewDelegate 21 | 22 | @optional 23 | 24 | - (void)spinImageView:(MMSpinImageView*)view didSpinToIndex:(NSInteger)index; 25 | - (void)spinImageView:(MMSpinImageView*)view didSelectAtIndex:(NSInteger)index; 26 | - (void)spinImageViewBeginLoadData:(MMSpinImageView*)view; 27 | - (void)spinImageViewEndLoadData:(MMSpinImageView*)view; 28 | - (void)spinImageViewFailedLoadData:(MMSpinImageView*)view; 29 | 30 | @end 31 | 32 | @protocol MMSpinImageViewDatasource 33 | 34 | - (UIImage *)spinImageView:(MMSpinImageView *)view imageAtIndex:(NSInteger)index; 35 | 36 | @optional 37 | - (NSInteger)numberOfViewsInspinImageView:(MMSpinImageView *)spinImageView; 38 | 39 | @end 40 | 41 | 42 | @interface MMSpinImageView : UIView 43 | 44 | @property (nonatomic, weak) id delegate; 45 | @property (nonatomic, weak) id dataSource; 46 | 47 | @property (nonatomic, readonly) UIImageView *imageView; 48 | 49 | @property (nonatomic, strong) NSArray *imagesArray; 50 | @property (nonatomic, readonly) UIImage *currentImage; 51 | @property (nonatomic, assign) NSInteger currentIndex; 52 | @property (nonatomic, assign) double panDistance; 53 | @property (nonatomic, assign) MMSpinViewDirection direction; 54 | 55 | - (void)reloadData; 56 | - (void)loadDataFromZip:(NSString*)path; 57 | - (void)clear; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Source/MMSpinImageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HMspinImageView.m 3 | // museum 4 | // 5 | // Created by Ralph Li on 12/25/13. 6 | // Copyright (c) 2013 hnmuseum. All rights reserved. 7 | // 8 | 9 | #import "MMSpinImageView.h" 10 | 11 | @interface MMSpinImageView() 12 | < 13 | MMSpinImageViewDelegate, 14 | MMSpinImageViewDatasource, 15 | UIGestureRecognizerDelegate 16 | > 17 | 18 | @property (nonatomic, assign) NSInteger imageCount; 19 | @property (nonatomic, assign) CGPoint touchPoint; 20 | @property (nonatomic, assign) NSInteger touchIndex; 21 | 22 | @end 23 | 24 | @implementation MMSpinImageView 25 | 26 | 27 | - (id)initWithFrame:(CGRect)frame 28 | { 29 | self = [super initWithFrame:frame]; 30 | if (self) { 31 | // Initialization code 32 | _imageView = [[UIImageView alloc] initWithFrame:self.bounds]; 33 | _imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 34 | _imageView.contentMode = UIViewContentModeScaleAspectFit; 35 | 36 | [self addSubview:self.imageView]; 37 | 38 | _panDistance = 20; 39 | _direction = MMSpinViewDirectionForward; 40 | 41 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(actionPan:)]; 42 | panGesture.maximumNumberOfTouches = 1; 43 | panGesture.delegate = self; 44 | panGesture.cancelsTouchesInView = YES; 45 | [self addGestureRecognizer:panGesture]; 46 | 47 | 48 | UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(actionTap:)]; 49 | tapGesture.delegate = self; 50 | tapGesture.cancelsTouchesInView = YES; 51 | [self addGestureRecognizer:tapGesture]; 52 | } 53 | return self; 54 | } 55 | 56 | - (void)didMoveToSuperview 57 | { 58 | [super didMoveToSuperview]; 59 | 60 | [self reloadData]; 61 | } 62 | 63 | - (void)setCurrentIndex:(NSInteger)currentIndex 64 | { 65 | if ( self.dataSource ) 66 | { 67 | _currentIndex = currentIndex; 68 | self.imageView.image = (currentIndex>=self.imageCount)?nil:[self.dataSource spinImageView:self imageAtIndex:currentIndex]; 69 | } 70 | else 71 | { 72 | _currentIndex = 0; 73 | } 74 | 75 | } 76 | 77 | - (UIImage *)currentImage 78 | { 79 | if ( self.dataSource ) 80 | { 81 | return [self.dataSource spinImageView:self imageAtIndex:self.currentIndex]; 82 | } 83 | 84 | return nil; 85 | } 86 | 87 | - (void)setImagesArray:(NSArray *)imagesArray 88 | { 89 | _imagesArray = imagesArray; 90 | self.dataSource = self; 91 | 92 | [self reloadData]; 93 | } 94 | 95 | #pragma mark data 96 | 97 | - (void)reloadData 98 | { 99 | if ( self.dataSource ) 100 | { 101 | self.imageCount = [self.dataSource numberOfViewsInspinImageView:self]; 102 | self.currentIndex = 0; 103 | } 104 | 105 | } 106 | 107 | - (void)clear 108 | { 109 | self.delegate = nil; 110 | self.dataSource = nil; 111 | 112 | self.imageView.image = nil; 113 | self.imageCount = 0; 114 | self.currentIndex = 0; 115 | 116 | self.imagesArray = nil; 117 | } 118 | 119 | - (void)loadDataFromZip:(NSString *)path 120 | { 121 | if ( !path ) 122 | { 123 | return; 124 | } 125 | 126 | __weak __typeof(&*self)weakSelf = self; 127 | 128 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 129 | 130 | ZZArchive* oldArchive = [ZZArchive archiveWithContentsOfURL:[NSURL fileURLWithPath:path]]; 131 | 132 | if ( oldArchive.entries.count == 0 ) 133 | { 134 | if ( [weakSelf.delegate respondsToSelector:@selector(spinImageViewFailedLoadData:)] ) 135 | { 136 | [weakSelf.delegate spinImageViewFailedLoadData:weakSelf]; 137 | } 138 | 139 | return; 140 | } 141 | 142 | if ( [weakSelf.delegate respondsToSelector:@selector(spinImageViewBeginLoadData:)] ) 143 | { 144 | [weakSelf.delegate spinImageViewBeginLoadData:weakSelf]; 145 | } 146 | 147 | NSMutableArray *array = [NSMutableArray array]; 148 | 149 | for ( ZZArchiveEntry *entry in oldArchive.entries ) 150 | { 151 | //avoid the damn __MACOS problem on mac 152 | if ( [entry.fileName rangeOfString:@"/"].location != NSNotFound ) 153 | { 154 | continue; 155 | } 156 | 157 | NSData *data = [entry newDataWithError:nil]; 158 | 159 | UIImage * image = [UIImage imageWithData:data scale:[UIScreen mainScreen].scale]; 160 | 161 | [array addObject:image]; 162 | } 163 | 164 | dispatch_async (dispatch_get_main_queue (), ^{ 165 | 166 | if ( !weakSelf ) 167 | { 168 | return; 169 | } 170 | 171 | weakSelf.dataSource = weakSelf; 172 | weakSelf.imagesArray = array; 173 | 174 | if ( [weakSelf.delegate respondsToSelector:@selector(spinImageViewEndLoadData:)] ) 175 | { 176 | [weakSelf.delegate spinImageViewEndLoadData:weakSelf]; 177 | } 178 | }); 179 | 180 | }); 181 | 182 | } 183 | 184 | #pragma mark dataSource 185 | 186 | - (UIImage *)spinImageView:(MMSpinImageView *)view imageAtIndex:(NSInteger)index 187 | { 188 | return self.imagesArray[index]; 189 | } 190 | 191 | - (NSInteger)numberOfViewsInspinImageView:(MMSpinImageView *)spinImageView 192 | { 193 | return self.imagesArray.count; 194 | } 195 | 196 | #pragma mark gesture 197 | 198 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer 199 | { 200 | if ( [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] ) 201 | { 202 | return self.imageCount > 1; 203 | } 204 | 205 | if ( [gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] ) 206 | { 207 | return self.imageCount > 0; 208 | } 209 | return NO; 210 | } 211 | 212 | - (void)actionPan:(UIPanGestureRecognizer*)gesture 213 | { 214 | switch (gesture.state) { 215 | case UIGestureRecognizerStateBegan: 216 | { 217 | self.touchIndex = self.currentIndex; 218 | self.touchPoint = [gesture locationInView:self]; 219 | break; 220 | } 221 | case UIGestureRecognizerStateChanged: 222 | { 223 | CGPoint pt = [gesture locationInView:self]; 224 | 225 | double offset = pt.x - self.touchPoint.x; 226 | 227 | if ( self.direction == MMSpinViewDirectionBackward ) 228 | { 229 | offset = -offset; 230 | } 231 | 232 | NSInteger index = (int)(((offset+self.panDistance/2.0f) + (1000*self.panDistance) )/ self.panDistance) - 1000 + self.touchIndex; 233 | 234 | if ( index != self.currentIndex ) 235 | { 236 | self.currentIndex = (index + self.imageCount*1000) % self.imageCount; 237 | 238 | 239 | if ( [self.delegate respondsToSelector:@selector(spinImageView:didSpinToIndex:)] ) 240 | { 241 | [self.delegate spinImageView:self didSpinToIndex:index]; 242 | } 243 | } 244 | 245 | break; 246 | } 247 | 248 | default: 249 | break; 250 | } 251 | } 252 | 253 | - (void)actionTap:(UIPanGestureRecognizer*)gesture 254 | { 255 | if ( [self.delegate respondsToSelector:@selector(spinImageView:didSelectAtIndex:)] ) 256 | { 257 | [self.delegate spinImageView:self didSelectAtIndex:self.currentIndex]; 258 | } 259 | } 260 | 261 | @end 262 | --------------------------------------------------------------------------------