Commit 7a2667660569f6de041410644c8f39e7dfe28e73

Authored by 王帅
1 parent 923037f7

no message

Showing 36 changed files with 0 additions and 2353 deletions
WSWebImageDemo.xcodeproj/project.pbxproj deleted 100644 → 0
1 -// !$*UTF8*$!  
2 -{  
3 - archiveVersion = 1;  
4 - classes = {  
5 - };  
6 - objectVersion = 46;  
7 - objects = {  
8 -  
9 -/* Begin PBXBuildFile section */  
10 - 0339FBE91D48B7EF00E4EDAB /* text.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 0339FBE81D48B7EF00E4EDAB /* text.jpg */; };  
11 - 036CBF251D3731260044A601 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 036CBF241D3731260044A601 /* main.m */; };  
12 - 036CBF281D3731260044A601 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 036CBF271D3731260044A601 /* AppDelegate.m */; };  
13 - 036CBF2B1D3731260044A601 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 036CBF2A1D3731260044A601 /* ViewController.m */; };  
14 - 036CBF2E1D3731260044A601 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 036CBF2C1D3731260044A601 /* Main.storyboard */; };  
15 - 036CBF301D3731260044A601 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 036CBF2F1D3731260044A601 /* Assets.xcassets */; };  
16 - 036CBF331D3731260044A601 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 036CBF311D3731260044A601 /* LaunchScreen.storyboard */; };  
17 - 036CBF3E1D3731260044A601 /* WSWebImageDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 036CBF3D1D3731260044A601 /* WSWebImageDemoTests.m */; };  
18 - 036CBF491D3731260044A601 /* WSWebImageDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 036CBF481D3731260044A601 /* WSWebImageDemoUITests.m */; };  
19 - 324590E81D4B2A3200889091 /* CNLiveImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 324590D91D4B2A3200889091 /* CNLiveImageCache.m */; };  
20 - 324590E91D4B2A3200889091 /* CNLiveWebImageDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = 324590DC1D4B2A3200889091 /* CNLiveWebImageDownload.m */; };  
21 - 324590EA1D4B2A3200889091 /* CNLiveWebImageDownloadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 324590DE1D4B2A3200889091 /* CNLiveWebImageDownloadOperation.m */; };  
22 - 324590EB1D4B2A3200889091 /* CNLiveWebImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 324590E01D4B2A3200889091 /* CNLiveWebImageManager.m */; };  
23 - 324590EC1D4B2A3200889091 /* NSData+CNLiveImageContentType.m in Sources */ = {isa = PBXBuildFile; fileRef = 324590E31D4B2A3200889091 /* NSData+CNLiveImageContentType.m */; };  
24 - 324590ED1D4B2A3200889091 /* UIImage+CNLiveMultiFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 324590E51D4B2A3200889091 /* UIImage+CNLiveMultiFormat.m */; };  
25 - 324590EE1D4B2A3200889091 /* UIImageView+CNLiveWebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 324590E71D4B2A3200889091 /* UIImageView+CNLiveWebCache.m */; };  
26 -/* End PBXBuildFile section */  
27 -  
28 -/* Begin PBXContainerItemProxy section */  
29 - 036CBF3A1D3731260044A601 /* PBXContainerItemProxy */ = {  
30 - isa = PBXContainerItemProxy;  
31 - containerPortal = 036CBF181D3731260044A601 /* Project object */;  
32 - proxyType = 1;  
33 - remoteGlobalIDString = 036CBF1F1D3731260044A601;  
34 - remoteInfo = WSWebImageDemo;  
35 - };  
36 - 036CBF451D3731260044A601 /* PBXContainerItemProxy */ = {  
37 - isa = PBXContainerItemProxy;  
38 - containerPortal = 036CBF181D3731260044A601 /* Project object */;  
39 - proxyType = 1;  
40 - remoteGlobalIDString = 036CBF1F1D3731260044A601;  
41 - remoteInfo = WSWebImageDemo;  
42 - };  
43 -/* End PBXContainerItemProxy section */  
44 -  
45 -/* Begin PBXFileReference section */  
46 - 0339FBE81D48B7EF00E4EDAB /* text.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = text.jpg; sourceTree = "<group>"; };  
47 - 036CBF201D3731260044A601 /* WSWebImageDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WSWebImageDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };  
48 - 036CBF241D3731260044A601 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };  
49 - 036CBF261D3731260044A601 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };  
50 - 036CBF271D3731260044A601 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };  
51 - 036CBF291D3731260044A601 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };  
52 - 036CBF2A1D3731260044A601 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };  
53 - 036CBF2D1D3731260044A601 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };  
54 - 036CBF2F1D3731260044A601 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };  
55 - 036CBF321D3731260044A601 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };  
56 - 036CBF341D3731260044A601 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };  
57 - 036CBF391D3731260044A601 /* WSWebImageDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WSWebImageDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };  
58 - 036CBF3D1D3731260044A601 /* WSWebImageDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WSWebImageDemoTests.m; sourceTree = "<group>"; };  
59 - 036CBF3F1D3731260044A601 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };  
60 - 036CBF441D3731260044A601 /* WSWebImageDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WSWebImageDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };  
61 - 036CBF481D3731260044A601 /* WSWebImageDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WSWebImageDemoUITests.m; sourceTree = "<group>"; };  
62 - 036CBF4A1D3731260044A601 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };  
63 - 324590D81D4B2A3200889091 /* CNLiveImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveImageCache.h; sourceTree = "<group>"; };  
64 - 324590D91D4B2A3200889091 /* CNLiveImageCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveImageCache.m; sourceTree = "<group>"; };  
65 - 324590DA1D4B2A3200889091 /* CNLiveWebImageBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveWebImageBlock.h; sourceTree = "<group>"; };  
66 - 324590DB1D4B2A3200889091 /* CNLiveWebImageDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveWebImageDownload.h; sourceTree = "<group>"; };  
67 - 324590DC1D4B2A3200889091 /* CNLiveWebImageDownload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveWebImageDownload.m; sourceTree = "<group>"; };  
68 - 324590DD1D4B2A3200889091 /* CNLiveWebImageDownloadOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveWebImageDownloadOperation.h; sourceTree = "<group>"; };  
69 - 324590DE1D4B2A3200889091 /* CNLiveWebImageDownloadOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveWebImageDownloadOperation.m; sourceTree = "<group>"; };  
70 - 324590DF1D4B2A3200889091 /* CNLiveWebImageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveWebImageManager.h; sourceTree = "<group>"; };  
71 - 324590E01D4B2A3200889091 /* CNLiveWebImageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveWebImageManager.m; sourceTree = "<group>"; };  
72 - 324590E11D4B2A3200889091 /* CNLiveWebImageOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveWebImageOperation.h; sourceTree = "<group>"; };  
73 - 324590E21D4B2A3200889091 /* NSData+CNLiveImageContentType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+CNLiveImageContentType.h"; sourceTree = "<group>"; };  
74 - 324590E31D4B2A3200889091 /* NSData+CNLiveImageContentType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+CNLiveImageContentType.m"; sourceTree = "<group>"; };  
75 - 324590E41D4B2A3200889091 /* UIImage+CNLiveMultiFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+CNLiveMultiFormat.h"; sourceTree = "<group>"; };  
76 - 324590E51D4B2A3200889091 /* UIImage+CNLiveMultiFormat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+CNLiveMultiFormat.m"; sourceTree = "<group>"; };  
77 - 324590E61D4B2A3200889091 /* UIImageView+CNLiveWebCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+CNLiveWebCache.h"; sourceTree = "<group>"; };  
78 - 324590E71D4B2A3200889091 /* UIImageView+CNLiveWebCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+CNLiveWebCache.m"; sourceTree = "<group>"; };  
79 -/* End PBXFileReference section */  
80 -  
81 -/* Begin PBXFrameworksBuildPhase section */  
82 - 036CBF1D1D3731260044A601 /* Frameworks */ = {  
83 - isa = PBXFrameworksBuildPhase;  
84 - buildActionMask = 2147483647;  
85 - files = (  
86 - );  
87 - runOnlyForDeploymentPostprocessing = 0;  
88 - };  
89 - 036CBF361D3731260044A601 /* Frameworks */ = {  
90 - isa = PBXFrameworksBuildPhase;  
91 - buildActionMask = 2147483647;  
92 - files = (  
93 - );  
94 - runOnlyForDeploymentPostprocessing = 0;  
95 - };  
96 - 036CBF411D3731260044A601 /* Frameworks */ = {  
97 - isa = PBXFrameworksBuildPhase;  
98 - buildActionMask = 2147483647;  
99 - files = (  
100 - );  
101 - runOnlyForDeploymentPostprocessing = 0;  
102 - };  
103 -/* End PBXFrameworksBuildPhase section */  
104 -  
105 -/* Begin PBXGroup section */  
106 - 036CBF171D3731260044A601 = {  
107 - isa = PBXGroup;  
108 - children = (  
109 - 324590D71D4B2A3200889091 /* CNLiveWebImage */,  
110 - 036CBF221D3731260044A601 /* WSWebImageDemo */,  
111 - 036CBF3C1D3731260044A601 /* WSWebImageDemoTests */,  
112 - 036CBF471D3731260044A601 /* WSWebImageDemoUITests */,  
113 - 036CBF211D3731260044A601 /* Products */,  
114 - );  
115 - sourceTree = "<group>";  
116 - };  
117 - 036CBF211D3731260044A601 /* Products */ = {  
118 - isa = PBXGroup;  
119 - children = (  
120 - 036CBF201D3731260044A601 /* WSWebImageDemo.app */,  
121 - 036CBF391D3731260044A601 /* WSWebImageDemoTests.xctest */,  
122 - 036CBF441D3731260044A601 /* WSWebImageDemoUITests.xctest */,  
123 - );  
124 - name = Products;  
125 - sourceTree = "<group>";  
126 - };  
127 - 036CBF221D3731260044A601 /* WSWebImageDemo */ = {  
128 - isa = PBXGroup;  
129 - children = (  
130 - 0339FBE81D48B7EF00E4EDAB /* text.jpg */,  
131 - 036CBF261D3731260044A601 /* AppDelegate.h */,  
132 - 036CBF271D3731260044A601 /* AppDelegate.m */,  
133 - 036CBF291D3731260044A601 /* ViewController.h */,  
134 - 036CBF2A1D3731260044A601 /* ViewController.m */,  
135 - 036CBF2C1D3731260044A601 /* Main.storyboard */,  
136 - 036CBF2F1D3731260044A601 /* Assets.xcassets */,  
137 - 036CBF311D3731260044A601 /* LaunchScreen.storyboard */,  
138 - 036CBF341D3731260044A601 /* Info.plist */,  
139 - 036CBF231D3731260044A601 /* Supporting Files */,  
140 - );  
141 - path = WSWebImageDemo;  
142 - sourceTree = "<group>";  
143 - };  
144 - 036CBF231D3731260044A601 /* Supporting Files */ = {  
145 - isa = PBXGroup;  
146 - children = (  
147 - 036CBF241D3731260044A601 /* main.m */,  
148 - );  
149 - name = "Supporting Files";  
150 - sourceTree = "<group>";  
151 - };  
152 - 036CBF3C1D3731260044A601 /* WSWebImageDemoTests */ = {  
153 - isa = PBXGroup;  
154 - children = (  
155 - 036CBF3D1D3731260044A601 /* WSWebImageDemoTests.m */,  
156 - 036CBF3F1D3731260044A601 /* Info.plist */,  
157 - );  
158 - path = WSWebImageDemoTests;  
159 - sourceTree = "<group>";  
160 - };  
161 - 036CBF471D3731260044A601 /* WSWebImageDemoUITests */ = {  
162 - isa = PBXGroup;  
163 - children = (  
164 - 036CBF481D3731260044A601 /* WSWebImageDemoUITests.m */,  
165 - 036CBF4A1D3731260044A601 /* Info.plist */,  
166 - );  
167 - path = WSWebImageDemoUITests;  
168 - sourceTree = "<group>";  
169 - };  
170 - 324590D71D4B2A3200889091 /* CNLiveWebImage */ = {  
171 - isa = PBXGroup;  
172 - children = (  
173 - 324590D81D4B2A3200889091 /* CNLiveImageCache.h */,  
174 - 324590D91D4B2A3200889091 /* CNLiveImageCache.m */,  
175 - 324590DA1D4B2A3200889091 /* CNLiveWebImageBlock.h */,  
176 - 324590DB1D4B2A3200889091 /* CNLiveWebImageDownload.h */,  
177 - 324590DC1D4B2A3200889091 /* CNLiveWebImageDownload.m */,  
178 - 324590DD1D4B2A3200889091 /* CNLiveWebImageDownloadOperation.h */,  
179 - 324590DE1D4B2A3200889091 /* CNLiveWebImageDownloadOperation.m */,  
180 - 324590DF1D4B2A3200889091 /* CNLiveWebImageManager.h */,  
181 - 324590E01D4B2A3200889091 /* CNLiveWebImageManager.m */,  
182 - 324590E11D4B2A3200889091 /* CNLiveWebImageOperation.h */,  
183 - 324590E21D4B2A3200889091 /* NSData+CNLiveImageContentType.h */,  
184 - 324590E31D4B2A3200889091 /* NSData+CNLiveImageContentType.m */,  
185 - 324590E41D4B2A3200889091 /* UIImage+CNLiveMultiFormat.h */,  
186 - 324590E51D4B2A3200889091 /* UIImage+CNLiveMultiFormat.m */,  
187 - 324590E61D4B2A3200889091 /* UIImageView+CNLiveWebCache.h */,  
188 - 324590E71D4B2A3200889091 /* UIImageView+CNLiveWebCache.m */,  
189 - );  
190 - name = CNLiveWebImage;  
191 - path = WSWebImageDemo/CNLiveWebImage;  
192 - sourceTree = "<group>";  
193 - };  
194 -/* End PBXGroup section */  
195 -  
196 -/* Begin PBXNativeTarget section */  
197 - 036CBF1F1D3731260044A601 /* WSWebImageDemo */ = {  
198 - isa = PBXNativeTarget;  
199 - buildConfigurationList = 036CBF4D1D3731260044A601 /* Build configuration list for PBXNativeTarget "WSWebImageDemo" */;  
200 - buildPhases = (  
201 - 036CBF1C1D3731260044A601 /* Sources */,  
202 - 036CBF1D1D3731260044A601 /* Frameworks */,  
203 - 036CBF1E1D3731260044A601 /* Resources */,  
204 - );  
205 - buildRules = (  
206 - );  
207 - dependencies = (  
208 - );  
209 - name = WSWebImageDemo;  
210 - productName = WSWebImageDemo;  
211 - productReference = 036CBF201D3731260044A601 /* WSWebImageDemo.app */;  
212 - productType = "com.apple.product-type.application";  
213 - };  
214 - 036CBF381D3731260044A601 /* WSWebImageDemoTests */ = {  
215 - isa = PBXNativeTarget;  
216 - buildConfigurationList = 036CBF501D3731260044A601 /* Build configuration list for PBXNativeTarget "WSWebImageDemoTests" */;  
217 - buildPhases = (  
218 - 036CBF351D3731260044A601 /* Sources */,  
219 - 036CBF361D3731260044A601 /* Frameworks */,  
220 - 036CBF371D3731260044A601 /* Resources */,  
221 - );  
222 - buildRules = (  
223 - );  
224 - dependencies = (  
225 - 036CBF3B1D3731260044A601 /* PBXTargetDependency */,  
226 - );  
227 - name = WSWebImageDemoTests;  
228 - productName = WSWebImageDemoTests;  
229 - productReference = 036CBF391D3731260044A601 /* WSWebImageDemoTests.xctest */;  
230 - productType = "com.apple.product-type.bundle.unit-test";  
231 - };  
232 - 036CBF431D3731260044A601 /* WSWebImageDemoUITests */ = {  
233 - isa = PBXNativeTarget;  
234 - buildConfigurationList = 036CBF531D3731260044A601 /* Build configuration list for PBXNativeTarget "WSWebImageDemoUITests" */;  
235 - buildPhases = (  
236 - 036CBF401D3731260044A601 /* Sources */,  
237 - 036CBF411D3731260044A601 /* Frameworks */,  
238 - 036CBF421D3731260044A601 /* Resources */,  
239 - );  
240 - buildRules = (  
241 - );  
242 - dependencies = (  
243 - 036CBF461D3731260044A601 /* PBXTargetDependency */,  
244 - );  
245 - name = WSWebImageDemoUITests;  
246 - productName = WSWebImageDemoUITests;  
247 - productReference = 036CBF441D3731260044A601 /* WSWebImageDemoUITests.xctest */;  
248 - productType = "com.apple.product-type.bundle.ui-testing";  
249 - };  
250 -/* End PBXNativeTarget section */  
251 -  
252 -/* Begin PBXProject section */  
253 - 036CBF181D3731260044A601 /* Project object */ = {  
254 - isa = PBXProject;  
255 - attributes = {  
256 - LastUpgradeCheck = 0730;  
257 - ORGANIZATIONNAME = "王帅";  
258 - TargetAttributes = {  
259 - 036CBF1F1D3731260044A601 = {  
260 - CreatedOnToolsVersion = 7.3.1;  
261 - };  
262 - 036CBF381D3731260044A601 = {  
263 - CreatedOnToolsVersion = 7.3.1;  
264 - TestTargetID = 036CBF1F1D3731260044A601;  
265 - };  
266 - 036CBF431D3731260044A601 = {  
267 - CreatedOnToolsVersion = 7.3.1;  
268 - TestTargetID = 036CBF1F1D3731260044A601;  
269 - };  
270 - };  
271 - };  
272 - buildConfigurationList = 036CBF1B1D3731260044A601 /* Build configuration list for PBXProject "WSWebImageDemo" */;  
273 - compatibilityVersion = "Xcode 3.2";  
274 - developmentRegion = English;  
275 - hasScannedForEncodings = 0;  
276 - knownRegions = (  
277 - en,  
278 - Base,  
279 - );  
280 - mainGroup = 036CBF171D3731260044A601;  
281 - productRefGroup = 036CBF211D3731260044A601 /* Products */;  
282 - projectDirPath = "";  
283 - projectRoot = "";  
284 - targets = (  
285 - 036CBF1F1D3731260044A601 /* WSWebImageDemo */,  
286 - 036CBF381D3731260044A601 /* WSWebImageDemoTests */,  
287 - 036CBF431D3731260044A601 /* WSWebImageDemoUITests */,  
288 - );  
289 - };  
290 -/* End PBXProject section */  
291 -  
292 -/* Begin PBXResourcesBuildPhase section */  
293 - 036CBF1E1D3731260044A601 /* Resources */ = {  
294 - isa = PBXResourcesBuildPhase;  
295 - buildActionMask = 2147483647;  
296 - files = (  
297 - 0339FBE91D48B7EF00E4EDAB /* text.jpg in Resources */,  
298 - 036CBF331D3731260044A601 /* LaunchScreen.storyboard in Resources */,  
299 - 036CBF301D3731260044A601 /* Assets.xcassets in Resources */,  
300 - 036CBF2E1D3731260044A601 /* Main.storyboard in Resources */,  
301 - );  
302 - runOnlyForDeploymentPostprocessing = 0;  
303 - };  
304 - 036CBF371D3731260044A601 /* Resources */ = {  
305 - isa = PBXResourcesBuildPhase;  
306 - buildActionMask = 2147483647;  
307 - files = (  
308 - );  
309 - runOnlyForDeploymentPostprocessing = 0;  
310 - };  
311 - 036CBF421D3731260044A601 /* Resources */ = {  
312 - isa = PBXResourcesBuildPhase;  
313 - buildActionMask = 2147483647;  
314 - files = (  
315 - );  
316 - runOnlyForDeploymentPostprocessing = 0;  
317 - };  
318 -/* End PBXResourcesBuildPhase section */  
319 -  
320 -/* Begin PBXSourcesBuildPhase section */  
321 - 036CBF1C1D3731260044A601 /* Sources */ = {  
322 - isa = PBXSourcesBuildPhase;  
323 - buildActionMask = 2147483647;  
324 - files = (  
325 - 324590EB1D4B2A3200889091 /* CNLiveWebImageManager.m in Sources */,  
326 - 324590EC1D4B2A3200889091 /* NSData+CNLiveImageContentType.m in Sources */,  
327 - 324590ED1D4B2A3200889091 /* UIImage+CNLiveMultiFormat.m in Sources */,  
328 - 324590EE1D4B2A3200889091 /* UIImageView+CNLiveWebCache.m in Sources */,  
329 - 324590E91D4B2A3200889091 /* CNLiveWebImageDownload.m in Sources */,  
330 - 036CBF2B1D3731260044A601 /* ViewController.m in Sources */,  
331 - 324590E81D4B2A3200889091 /* CNLiveImageCache.m in Sources */,  
332 - 324590EA1D4B2A3200889091 /* CNLiveWebImageDownloadOperation.m in Sources */,  
333 - 036CBF281D3731260044A601 /* AppDelegate.m in Sources */,  
334 - 036CBF251D3731260044A601 /* main.m in Sources */,  
335 - );  
336 - runOnlyForDeploymentPostprocessing = 0;  
337 - };  
338 - 036CBF351D3731260044A601 /* Sources */ = {  
339 - isa = PBXSourcesBuildPhase;  
340 - buildActionMask = 2147483647;  
341 - files = (  
342 - 036CBF3E1D3731260044A601 /* WSWebImageDemoTests.m in Sources */,  
343 - );  
344 - runOnlyForDeploymentPostprocessing = 0;  
345 - };  
346 - 036CBF401D3731260044A601 /* Sources */ = {  
347 - isa = PBXSourcesBuildPhase;  
348 - buildActionMask = 2147483647;  
349 - files = (  
350 - 036CBF491D3731260044A601 /* WSWebImageDemoUITests.m in Sources */,  
351 - );  
352 - runOnlyForDeploymentPostprocessing = 0;  
353 - };  
354 -/* End PBXSourcesBuildPhase section */  
355 -  
356 -/* Begin PBXTargetDependency section */  
357 - 036CBF3B1D3731260044A601 /* PBXTargetDependency */ = {  
358 - isa = PBXTargetDependency;  
359 - target = 036CBF1F1D3731260044A601 /* WSWebImageDemo */;  
360 - targetProxy = 036CBF3A1D3731260044A601 /* PBXContainerItemProxy */;  
361 - };  
362 - 036CBF461D3731260044A601 /* PBXTargetDependency */ = {  
363 - isa = PBXTargetDependency;  
364 - target = 036CBF1F1D3731260044A601 /* WSWebImageDemo */;  
365 - targetProxy = 036CBF451D3731260044A601 /* PBXContainerItemProxy */;  
366 - };  
367 -/* End PBXTargetDependency section */  
368 -  
369 -/* Begin PBXVariantGroup section */  
370 - 036CBF2C1D3731260044A601 /* Main.storyboard */ = {  
371 - isa = PBXVariantGroup;  
372 - children = (  
373 - 036CBF2D1D3731260044A601 /* Base */,  
374 - );  
375 - name = Main.storyboard;  
376 - sourceTree = "<group>";  
377 - };  
378 - 036CBF311D3731260044A601 /* LaunchScreen.storyboard */ = {  
379 - isa = PBXVariantGroup;  
380 - children = (  
381 - 036CBF321D3731260044A601 /* Base */,  
382 - );  
383 - name = LaunchScreen.storyboard;  
384 - sourceTree = "<group>";  
385 - };  
386 -/* End PBXVariantGroup section */  
387 -  
388 -/* Begin XCBuildConfiguration section */  
389 - 036CBF4B1D3731260044A601 /* Debug */ = {  
390 - isa = XCBuildConfiguration;  
391 - buildSettings = {  
392 - ALWAYS_SEARCH_USER_PATHS = NO;  
393 - CLANG_ANALYZER_NONNULL = YES;  
394 - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";  
395 - CLANG_CXX_LIBRARY = "libc++";  
396 - CLANG_ENABLE_MODULES = YES;  
397 - CLANG_ENABLE_OBJC_ARC = YES;  
398 - CLANG_WARN_BOOL_CONVERSION = YES;  
399 - CLANG_WARN_CONSTANT_CONVERSION = YES;  
400 - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;  
401 - CLANG_WARN_EMPTY_BODY = YES;  
402 - CLANG_WARN_ENUM_CONVERSION = YES;  
403 - CLANG_WARN_INT_CONVERSION = YES;  
404 - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;  
405 - CLANG_WARN_UNREACHABLE_CODE = YES;  
406 - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;  
407 - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";  
408 - COPY_PHASE_STRIP = NO;  
409 - DEBUG_INFORMATION_FORMAT = dwarf;  
410 - ENABLE_STRICT_OBJC_MSGSEND = YES;  
411 - ENABLE_TESTABILITY = YES;  
412 - GCC_C_LANGUAGE_STANDARD = gnu99;  
413 - GCC_DYNAMIC_NO_PIC = NO;  
414 - GCC_NO_COMMON_BLOCKS = YES;  
415 - GCC_OPTIMIZATION_LEVEL = 0;  
416 - GCC_PREPROCESSOR_DEFINITIONS = (  
417 - "DEBUG=1",  
418 - "$(inherited)",  
419 - );  
420 - GCC_WARN_64_TO_32_BIT_CONVERSION = YES;  
421 - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;  
422 - GCC_WARN_UNDECLARED_SELECTOR = YES;  
423 - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;  
424 - GCC_WARN_UNUSED_FUNCTION = YES;  
425 - GCC_WARN_UNUSED_VARIABLE = YES;  
426 - IPHONEOS_DEPLOYMENT_TARGET = 9.3;  
427 - MTL_ENABLE_DEBUG_INFO = YES;  
428 - ONLY_ACTIVE_ARCH = YES;  
429 - SDKROOT = iphoneos;  
430 - TARGETED_DEVICE_FAMILY = "1,2";  
431 - };  
432 - name = Debug;  
433 - };  
434 - 036CBF4C1D3731260044A601 /* Release */ = {  
435 - isa = XCBuildConfiguration;  
436 - buildSettings = {  
437 - ALWAYS_SEARCH_USER_PATHS = NO;  
438 - CLANG_ANALYZER_NONNULL = YES;  
439 - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";  
440 - CLANG_CXX_LIBRARY = "libc++";  
441 - CLANG_ENABLE_MODULES = YES;  
442 - CLANG_ENABLE_OBJC_ARC = YES;  
443 - CLANG_WARN_BOOL_CONVERSION = YES;  
444 - CLANG_WARN_CONSTANT_CONVERSION = YES;  
445 - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;  
446 - CLANG_WARN_EMPTY_BODY = YES;  
447 - CLANG_WARN_ENUM_CONVERSION = YES;  
448 - CLANG_WARN_INT_CONVERSION = YES;  
449 - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;  
450 - CLANG_WARN_UNREACHABLE_CODE = YES;  
451 - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;  
452 - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";  
453 - COPY_PHASE_STRIP = NO;  
454 - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";  
455 - ENABLE_NS_ASSERTIONS = NO;  
456 - ENABLE_STRICT_OBJC_MSGSEND = YES;  
457 - GCC_C_LANGUAGE_STANDARD = gnu99;  
458 - GCC_NO_COMMON_BLOCKS = YES;  
459 - GCC_WARN_64_TO_32_BIT_CONVERSION = YES;  
460 - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;  
461 - GCC_WARN_UNDECLARED_SELECTOR = YES;  
462 - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;  
463 - GCC_WARN_UNUSED_FUNCTION = YES;  
464 - GCC_WARN_UNUSED_VARIABLE = YES;  
465 - IPHONEOS_DEPLOYMENT_TARGET = 9.3;  
466 - MTL_ENABLE_DEBUG_INFO = NO;  
467 - SDKROOT = iphoneos;  
468 - TARGETED_DEVICE_FAMILY = "1,2";  
469 - VALIDATE_PRODUCT = YES;  
470 - };  
471 - name = Release;  
472 - };  
473 - 036CBF4E1D3731260044A601 /* Debug */ = {  
474 - isa = XCBuildConfiguration;  
475 - buildSettings = {  
476 - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;  
477 - INFOPLIST_FILE = WSWebImageDemo/Info.plist;  
478 - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";  
479 - PRODUCT_BUNDLE_IDENTIFIER = wangshuai.WSWebImageDemo;  
480 - PRODUCT_NAME = "$(TARGET_NAME)";  
481 - };  
482 - name = Debug;  
483 - };  
484 - 036CBF4F1D3731260044A601 /* Release */ = {  
485 - isa = XCBuildConfiguration;  
486 - buildSettings = {  
487 - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;  
488 - INFOPLIST_FILE = WSWebImageDemo/Info.plist;  
489 - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";  
490 - PRODUCT_BUNDLE_IDENTIFIER = wangshuai.WSWebImageDemo;  
491 - PRODUCT_NAME = "$(TARGET_NAME)";  
492 - };  
493 - name = Release;  
494 - };  
495 - 036CBF511D3731260044A601 /* Debug */ = {  
496 - isa = XCBuildConfiguration;  
497 - buildSettings = {  
498 - BUNDLE_LOADER = "$(TEST_HOST)";  
499 - INFOPLIST_FILE = WSWebImageDemoTests/Info.plist;  
500 - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";  
501 - PRODUCT_BUNDLE_IDENTIFIER = wangshuai.WSWebImageDemoTests;  
502 - PRODUCT_NAME = "$(TARGET_NAME)";  
503 - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WSWebImageDemo.app/WSWebImageDemo";  
504 - };  
505 - name = Debug;  
506 - };  
507 - 036CBF521D3731260044A601 /* Release */ = {  
508 - isa = XCBuildConfiguration;  
509 - buildSettings = {  
510 - BUNDLE_LOADER = "$(TEST_HOST)";  
511 - INFOPLIST_FILE = WSWebImageDemoTests/Info.plist;  
512 - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";  
513 - PRODUCT_BUNDLE_IDENTIFIER = wangshuai.WSWebImageDemoTests;  
514 - PRODUCT_NAME = "$(TARGET_NAME)";  
515 - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WSWebImageDemo.app/WSWebImageDemo";  
516 - };  
517 - name = Release;  
518 - };  
519 - 036CBF541D3731260044A601 /* Debug */ = {  
520 - isa = XCBuildConfiguration;  
521 - buildSettings = {  
522 - INFOPLIST_FILE = WSWebImageDemoUITests/Info.plist;  
523 - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";  
524 - PRODUCT_BUNDLE_IDENTIFIER = wangshuai.WSWebImageDemoUITests;  
525 - PRODUCT_NAME = "$(TARGET_NAME)";  
526 - TEST_TARGET_NAME = WSWebImageDemo;  
527 - };  
528 - name = Debug;  
529 - };  
530 - 036CBF551D3731260044A601 /* Release */ = {  
531 - isa = XCBuildConfiguration;  
532 - buildSettings = {  
533 - INFOPLIST_FILE = WSWebImageDemoUITests/Info.plist;  
534 - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";  
535 - PRODUCT_BUNDLE_IDENTIFIER = wangshuai.WSWebImageDemoUITests;  
536 - PRODUCT_NAME = "$(TARGET_NAME)";  
537 - TEST_TARGET_NAME = WSWebImageDemo;  
538 - };  
539 - name = Release;  
540 - };  
541 -/* End XCBuildConfiguration section */  
542 -  
543 -/* Begin XCConfigurationList section */  
544 - 036CBF1B1D3731260044A601 /* Build configuration list for PBXProject "WSWebImageDemo" */ = {  
545 - isa = XCConfigurationList;  
546 - buildConfigurations = (  
547 - 036CBF4B1D3731260044A601 /* Debug */,  
548 - 036CBF4C1D3731260044A601 /* Release */,  
549 - );  
550 - defaultConfigurationIsVisible = 0;  
551 - defaultConfigurationName = Release;  
552 - };  
553 - 036CBF4D1D3731260044A601 /* Build configuration list for PBXNativeTarget "WSWebImageDemo" */ = {  
554 - isa = XCConfigurationList;  
555 - buildConfigurations = (  
556 - 036CBF4E1D3731260044A601 /* Debug */,  
557 - 036CBF4F1D3731260044A601 /* Release */,  
558 - );  
559 - defaultConfigurationIsVisible = 0;  
560 - defaultConfigurationName = Release;  
561 - };  
562 - 036CBF501D3731260044A601 /* Build configuration list for PBXNativeTarget "WSWebImageDemoTests" */ = {  
563 - isa = XCConfigurationList;  
564 - buildConfigurations = (  
565 - 036CBF511D3731260044A601 /* Debug */,  
566 - 036CBF521D3731260044A601 /* Release */,  
567 - );  
568 - defaultConfigurationIsVisible = 0;  
569 - defaultConfigurationName = Release;  
570 - };  
571 - 036CBF531D3731260044A601 /* Build configuration list for PBXNativeTarget "WSWebImageDemoUITests" */ = {  
572 - isa = XCConfigurationList;  
573 - buildConfigurations = (  
574 - 036CBF541D3731260044A601 /* Debug */,  
575 - 036CBF551D3731260044A601 /* Release */,  
576 - );  
577 - defaultConfigurationIsVisible = 0;  
578 - defaultConfigurationName = Release;  
579 - };  
580 -/* End XCConfigurationList section */  
581 - };  
582 - rootObject = 036CBF181D3731260044A601 /* Project object */;  
583 -}  
WSWebImageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<Workspace  
3 - version = "1.0">  
4 - <FileRef  
5 - location = "self:WSWebImageDemo.xcodeproj">  
6 - </FileRef>  
7 -</Workspace>  
WSWebImageDemo.xcodeproj/xcuserdata/leihaojie.xcuserdatad/xcschemes/WSWebImageDemo.xcscheme deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<Scheme  
3 - LastUpgradeVersion = "0730"  
4 - version = "1.3">  
5 - <BuildAction  
6 - parallelizeBuildables = "YES"  
7 - buildImplicitDependencies = "YES">  
8 - <BuildActionEntries>  
9 - <BuildActionEntry  
10 - buildForTesting = "YES"  
11 - buildForRunning = "YES"  
12 - buildForProfiling = "YES"  
13 - buildForArchiving = "YES"  
14 - buildForAnalyzing = "YES">  
15 - <BuildableReference  
16 - BuildableIdentifier = "primary"  
17 - BlueprintIdentifier = "036CBF1F1D3731260044A601"  
18 - BuildableName = "WSWebImageDemo.app"  
19 - BlueprintName = "WSWebImageDemo"  
20 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
21 - </BuildableReference>  
22 - </BuildActionEntry>  
23 - </BuildActionEntries>  
24 - </BuildAction>  
25 - <TestAction  
26 - buildConfiguration = "Debug"  
27 - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"  
28 - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"  
29 - shouldUseLaunchSchemeArgsEnv = "YES">  
30 - <Testables>  
31 - <TestableReference  
32 - skipped = "NO">  
33 - <BuildableReference  
34 - BuildableIdentifier = "primary"  
35 - BlueprintIdentifier = "036CBF381D3731260044A601"  
36 - BuildableName = "WSWebImageDemoTests.xctest"  
37 - BlueprintName = "WSWebImageDemoTests"  
38 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
39 - </BuildableReference>  
40 - </TestableReference>  
41 - <TestableReference  
42 - skipped = "NO">  
43 - <BuildableReference  
44 - BuildableIdentifier = "primary"  
45 - BlueprintIdentifier = "036CBF431D3731260044A601"  
46 - BuildableName = "WSWebImageDemoUITests.xctest"  
47 - BlueprintName = "WSWebImageDemoUITests"  
48 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
49 - </BuildableReference>  
50 - </TestableReference>  
51 - </Testables>  
52 - <MacroExpansion>  
53 - <BuildableReference  
54 - BuildableIdentifier = "primary"  
55 - BlueprintIdentifier = "036CBF1F1D3731260044A601"  
56 - BuildableName = "WSWebImageDemo.app"  
57 - BlueprintName = "WSWebImageDemo"  
58 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
59 - </BuildableReference>  
60 - </MacroExpansion>  
61 - <AdditionalOptions>  
62 - </AdditionalOptions>  
63 - </TestAction>  
64 - <LaunchAction  
65 - buildConfiguration = "Debug"  
66 - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"  
67 - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"  
68 - launchStyle = "0"  
69 - useCustomWorkingDirectory = "NO"  
70 - ignoresPersistentStateOnLaunch = "NO"  
71 - debugDocumentVersioning = "YES"  
72 - debugServiceExtension = "internal"  
73 - allowLocationSimulation = "YES">  
74 - <BuildableProductRunnable  
75 - runnableDebuggingMode = "0">  
76 - <BuildableReference  
77 - BuildableIdentifier = "primary"  
78 - BlueprintIdentifier = "036CBF1F1D3731260044A601"  
79 - BuildableName = "WSWebImageDemo.app"  
80 - BlueprintName = "WSWebImageDemo"  
81 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
82 - </BuildableReference>  
83 - </BuildableProductRunnable>  
84 - <AdditionalOptions>  
85 - </AdditionalOptions>  
86 - </LaunchAction>  
87 - <ProfileAction  
88 - buildConfiguration = "Release"  
89 - shouldUseLaunchSchemeArgsEnv = "YES"  
90 - savedToolIdentifier = ""  
91 - useCustomWorkingDirectory = "NO"  
92 - debugDocumentVersioning = "YES">  
93 - <BuildableProductRunnable  
94 - runnableDebuggingMode = "0">  
95 - <BuildableReference  
96 - BuildableIdentifier = "primary"  
97 - BlueprintIdentifier = "036CBF1F1D3731260044A601"  
98 - BuildableName = "WSWebImageDemo.app"  
99 - BlueprintName = "WSWebImageDemo"  
100 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
101 - </BuildableReference>  
102 - </BuildableProductRunnable>  
103 - </ProfileAction>  
104 - <AnalyzeAction  
105 - buildConfiguration = "Debug">  
106 - </AnalyzeAction>  
107 - <ArchiveAction  
108 - buildConfiguration = "Release"  
109 - revealArchiveInOrganizer = "YES">  
110 - </ArchiveAction>  
111 -</Scheme>  
WSWebImageDemo.xcodeproj/xcuserdata/leihaojie.xcuserdatad/xcschemes/xcschememanagement.plist deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>SchemeUserState</key>  
6 - <dict>  
7 - <key>WSWebImageDemo.xcscheme</key>  
8 - <dict>  
9 - <key>orderHint</key>  
10 - <integer>0</integer>  
11 - </dict>  
12 - </dict>  
13 - <key>SuppressBuildableAutocreation</key>  
14 - <dict>  
15 - <key>036CBF1F1D3731260044A601</key>  
16 - <dict>  
17 - <key>primary</key>  
18 - <true/>  
19 - </dict>  
20 - <key>036CBF381D3731260044A601</key>  
21 - <dict>  
22 - <key>primary</key>  
23 - <true/>  
24 - </dict>  
25 - <key>036CBF431D3731260044A601</key>  
26 - <dict>  
27 - <key>primary</key>  
28 - <true/>  
29 - </dict>  
30 - </dict>  
31 -</dict>  
32 -</plist>  
WSWebImageDemo.xcodeproj/xcuserdata/wangshuai.xcuserdatad/xcschemes/WSWebImageDemo.xcscheme deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<Scheme  
3 - LastUpgradeVersion = "0730"  
4 - version = "1.3">  
5 - <BuildAction  
6 - parallelizeBuildables = "YES"  
7 - buildImplicitDependencies = "YES">  
8 - <BuildActionEntries>  
9 - <BuildActionEntry  
10 - buildForTesting = "YES"  
11 - buildForRunning = "YES"  
12 - buildForProfiling = "YES"  
13 - buildForArchiving = "YES"  
14 - buildForAnalyzing = "YES">  
15 - <BuildableReference  
16 - BuildableIdentifier = "primary"  
17 - BlueprintIdentifier = "036CBF1F1D3731260044A601"  
18 - BuildableName = "WSWebImageDemo.app"  
19 - BlueprintName = "WSWebImageDemo"  
20 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
21 - </BuildableReference>  
22 - </BuildActionEntry>  
23 - </BuildActionEntries>  
24 - </BuildAction>  
25 - <TestAction  
26 - buildConfiguration = "Debug"  
27 - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"  
28 - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"  
29 - shouldUseLaunchSchemeArgsEnv = "YES">  
30 - <Testables>  
31 - <TestableReference  
32 - skipped = "NO">  
33 - <BuildableReference  
34 - BuildableIdentifier = "primary"  
35 - BlueprintIdentifier = "036CBF381D3731260044A601"  
36 - BuildableName = "WSWebImageDemoTests.xctest"  
37 - BlueprintName = "WSWebImageDemoTests"  
38 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
39 - </BuildableReference>  
40 - </TestableReference>  
41 - <TestableReference  
42 - skipped = "NO">  
43 - <BuildableReference  
44 - BuildableIdentifier = "primary"  
45 - BlueprintIdentifier = "036CBF431D3731260044A601"  
46 - BuildableName = "WSWebImageDemoUITests.xctest"  
47 - BlueprintName = "WSWebImageDemoUITests"  
48 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
49 - </BuildableReference>  
50 - </TestableReference>  
51 - </Testables>  
52 - <MacroExpansion>  
53 - <BuildableReference  
54 - BuildableIdentifier = "primary"  
55 - BlueprintIdentifier = "036CBF1F1D3731260044A601"  
56 - BuildableName = "WSWebImageDemo.app"  
57 - BlueprintName = "WSWebImageDemo"  
58 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
59 - </BuildableReference>  
60 - </MacroExpansion>  
61 - <AdditionalOptions>  
62 - </AdditionalOptions>  
63 - </TestAction>  
64 - <LaunchAction  
65 - buildConfiguration = "Debug"  
66 - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"  
67 - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"  
68 - launchStyle = "0"  
69 - useCustomWorkingDirectory = "NO"  
70 - ignoresPersistentStateOnLaunch = "NO"  
71 - debugDocumentVersioning = "YES"  
72 - debugServiceExtension = "internal"  
73 - allowLocationSimulation = "YES">  
74 - <BuildableProductRunnable  
75 - runnableDebuggingMode = "0">  
76 - <BuildableReference  
77 - BuildableIdentifier = "primary"  
78 - BlueprintIdentifier = "036CBF1F1D3731260044A601"  
79 - BuildableName = "WSWebImageDemo.app"  
80 - BlueprintName = "WSWebImageDemo"  
81 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
82 - </BuildableReference>  
83 - </BuildableProductRunnable>  
84 - <AdditionalOptions>  
85 - </AdditionalOptions>  
86 - </LaunchAction>  
87 - <ProfileAction  
88 - buildConfiguration = "Release"  
89 - shouldUseLaunchSchemeArgsEnv = "YES"  
90 - savedToolIdentifier = ""  
91 - useCustomWorkingDirectory = "NO"  
92 - debugDocumentVersioning = "YES">  
93 - <BuildableProductRunnable  
94 - runnableDebuggingMode = "0">  
95 - <BuildableReference  
96 - BuildableIdentifier = "primary"  
97 - BlueprintIdentifier = "036CBF1F1D3731260044A601"  
98 - BuildableName = "WSWebImageDemo.app"  
99 - BlueprintName = "WSWebImageDemo"  
100 - ReferencedContainer = "container:WSWebImageDemo.xcodeproj">  
101 - </BuildableReference>  
102 - </BuildableProductRunnable>  
103 - </ProfileAction>  
104 - <AnalyzeAction  
105 - buildConfiguration = "Debug">  
106 - </AnalyzeAction>  
107 - <ArchiveAction  
108 - buildConfiguration = "Release"  
109 - revealArchiveInOrganizer = "YES">  
110 - </ArchiveAction>  
111 -</Scheme>  
WSWebImageDemo.xcodeproj/xcuserdata/wangshuai.xcuserdatad/xcschemes/xcschememanagement.plist deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>SchemeUserState</key>  
6 - <dict>  
7 - <key>WSWebImageDemo.xcscheme</key>  
8 - <dict>  
9 - <key>orderHint</key>  
10 - <integer>0</integer>  
11 - </dict>  
12 - </dict>  
13 - <key>SuppressBuildableAutocreation</key>  
14 - <dict>  
15 - <key>036CBF1F1D3731260044A601</key>  
16 - <dict>  
17 - <key>primary</key>  
18 - <true/>  
19 - </dict>  
20 - <key>036CBF381D3731260044A601</key>  
21 - <dict>  
22 - <key>primary</key>  
23 - <true/>  
24 - </dict>  
25 - <key>036CBF431D3731260044A601</key>  
26 - <dict>  
27 - <key>primary</key>  
28 - <true/>  
29 - </dict>  
30 - </dict>  
31 -</dict>  
32 -</plist>  
WSWebImageDemo/AppDelegate.h deleted 100644 → 0
1 -//  
2 -// AppDelegate.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -  
11 -@interface AppDelegate : UIResponder <UIApplicationDelegate>  
12 -  
13 -@property (strong, nonatomic) UIWindow *window;  
14 -  
15 -  
16 -@end  
17 -  
WSWebImageDemo/AppDelegate.m deleted 100644 → 0
1 -//  
2 -// AppDelegate.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "AppDelegate.h"  
10 -  
11 -@interface AppDelegate ()  
12 -  
13 -@end  
14 -  
15 -@implementation AppDelegate  
16 -  
17 -  
18 -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  
19 - // Override point for customization after application launch.  
20 - return YES;  
21 -}  
22 -  
23 -- (void)applicationWillResignActive:(UIApplication *)application {  
24 - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.  
25 - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.  
26 -}  
27 -  
28 -- (void)applicationDidEnterBackground:(UIApplication *)application {  
29 - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.  
30 - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.  
31 -}  
32 -  
33 -- (void)applicationWillEnterForeground:(UIApplication *)application {  
34 - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.  
35 -}  
36 -  
37 -- (void)applicationDidBecomeActive:(UIApplication *)application {  
38 - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.  
39 -}  
40 -  
41 -- (void)applicationWillTerminate:(UIApplication *)application {  
42 - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.  
43 -}  
44 -  
45 -@end  
WSWebImageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json deleted 100644 → 0
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 -}  
74 \ No newline at end of file 0 \ No newline at end of file
WSWebImageDemo/Base.lproj/LaunchScreen.storyboard deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8" standalone="no"?>  
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">  
3 - <dependencies>  
4 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>  
5 - </dependencies>  
6 - <scenes>  
7 - <!--View Controller-->  
8 - <scene sceneID="EHf-IW-A2E">  
9 - <objects>  
10 - <viewController id="01J-lp-oVM" sceneMemberID="viewController">  
11 - <layoutGuides>  
12 - <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>  
13 - <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>  
14 - </layoutGuides>  
15 - <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">  
16 - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>  
17 - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>  
18 - <animations/>  
19 - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>  
20 - </view>  
21 - </viewController>  
22 - <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>  
23 - </objects>  
24 - <point key="canvasLocation" x="53" y="375"/>  
25 - </scene>  
26 - </scenes>  
27 -</document>  
WSWebImageDemo/Base.lproj/Main.storyboard deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8" standalone="no"?>  
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">  
3 - <dependencies>  
4 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>  
5 - </dependencies>  
6 - <scenes>  
7 - <!--View Controller-->  
8 - <scene sceneID="tne-QT-ifu">  
9 - <objects>  
10 - <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">  
11 - <layoutGuides>  
12 - <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>  
13 - <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>  
14 - </layoutGuides>  
15 - <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">  
16 - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>  
17 - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>  
18 - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>  
19 - </view>  
20 - </viewController>  
21 - <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>  
22 - </objects>  
23 - </scene>  
24 - </scenes>  
25 -</document>  
WSWebImageDemo/CNLiveWebImage/CNLiveImageCache.h deleted 100644 → 0
1 -//  
2 -// CNLiveImageCache.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/19.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import <UIKit/UIKit.h>  
11 -#import "CNLiveWebImageBlock.h"  
12 -  
13 -//typedef void(^CNLiveWebImageQueryCompletedBlock)(UIImage *image, CNLiveImageCacheType type);  
14 -typedef void(^CNLiveCompletedBlock)();  
15 -  
16 -@interface CNLiveImageCache : NSObject  
17 -  
18 -+ (CNLiveImageCache *)sharedImageCache;  
19 -  
20 -- (void)storeImage:(UIImage *)image forKey:(NSString *)key toDisk:(BOOL)toDisk;  
21 -  
22 -- (UIImage *)imageFromMemoryCacheForKey:(NSString *)key;  
23 -  
24 -- (UIImage *)imageFromDiskCacheForKey:(NSString *)key;  
25 -  
26 -- (BOOL)queryDiskCacheForKey:(NSString *)key done:(CNLiveWebImageQueryCompletedBlock)doneBlock;  
27 -  
28 -- (void)removeCacheForKey:(NSString *)key done:(CNLiveCompletedBlock)completed;  
29 -  
30 -- (long long)diskCacheSize;  
31 -  
32 -- (void)clearMemory;  
33 -  
34 -- (void)clearDisk;  
35 -  
36 -@end  
WSWebImageDemo/CNLiveWebImage/CNLiveImageCache.m deleted 100644 → 0
1 -//  
2 -// CNLiveImageCache.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/19.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveImageCache.h"  
10 -#import <CommonCrypto/CommonDigest.h>  
11 -#import "UIImage+CNLiveMultiFormat.h"  
12 -  
13 -FOUNDATION_STATIC_INLINE NSUInteger CNLiveCacheCostForImage(UIImage *image) {  
14 - return image.size.height * image.size.width * image.scale * image.scale;  
15 -}  
16 -  
17 -typedef void(^CNLiveWebImageNoParamsBlock)();  
18 -  
19 -@interface CNLiveImageCache ()  
20 -  
21 -@property (nonatomic, strong) NSCache *memoryCache;  
22 -@property (nonatomic, copy) NSString *diskCachePath;  
23 -@property (nonatomic, strong) dispatch_queue_t ioQueue;  
24 -  
25 -@end  
26 -  
27 -@implementation CNLiveImageCache  
28 -{  
29 - NSFileManager *_fileManager;  
30 -}  
31 -  
32 -+ (CNLiveImageCache *)sharedImageCache  
33 -{  
34 - static dispatch_once_t onceToken;  
35 - static id instance;  
36 - dispatch_once(&onceToken, ^{  
37 - instance = [self new];  
38 - });  
39 - return instance;  
40 -}  
41 -  
42 -- (id)init {  
43 - return [self initWithNamespace:@"default"];  
44 -}  
45 -  
46 -- (id)initWithNamespace:(NSString *)ns {  
47 - NSString *path = [self makeDiskCachePath:ns];  
48 - return [self initWithNamespace:ns diskCacheDirectory:path];  
49 -}  
50 -  
51 -- (NSString *)makeDiskCachePath:(NSString *)fullNamespace {  
52 - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);  
53 - return [paths[0] stringByAppendingString:fullNamespace];  
54 -}  
55 -  
56 -- (id)initWithNamespace:(NSString *)ns diskCacheDirectory:(NSString *)directory {  
57 - if (self = [super init]) {  
58 - NSString *fullNameSpace = [@"com.cnlive.CNLiveImageCache." stringByAppendingString:ns];  
59 - _ioQueue = dispatch_queue_create("com.cnlive.CNLiveImageCacheQueue", DISPATCH_QUEUE_SERIAL);  
60 - _memoryCache = [[NSCache alloc] init];  
61 - _memoryCache.name = fullNameSpace;  
62 -  
63 - if (directory != nil) {  
64 - _diskCachePath = [directory stringByAppendingPathComponent:fullNameSpace];  
65 - }  
66 - else {  
67 - _diskCachePath = [[self makeDiskCachePath:ns] stringByAppendingPathComponent:fullNameSpace];  
68 - }  
69 -  
70 - dispatch_sync(_ioQueue, ^{  
71 - _fileManager = [NSFileManager new];  
72 - });  
73 -  
74 - [[NSNotificationCenter defaultCenter] addObserver:self  
75 - selector:@selector(clearMemory)  
76 - name:UIApplicationDidReceiveMemoryWarningNotification  
77 - object:nil];  
78 -  
79 -// [[NSNotificationCenter defaultCenter] addObserver:self  
80 -// selector:@selector(clearDisk)  
81 -// name:UIApplicationWillTerminateNotification  
82 -// object:nil];  
83 - }  
84 - return self;  
85 -}  
86 -  
87 -- (void)dealloc  
88 -{  
89 - [[NSNotificationCenter defaultCenter] removeObserver:self];  
90 -}  
91 -  
92 -- (void)storeImage:(UIImage *)image forKey:(NSString *)key toDisk:(BOOL)toDisk  
93 -{  
94 - if (!image || !key) {  
95 - return;  
96 - }  
97 -  
98 - NSUInteger cost = CNLiveCacheCostForImage(image);  
99 - [_memoryCache setObject:image forKey:key cost:cost];  
100 -  
101 - if (toDisk) {  
102 - dispatch_async(_ioQueue, ^{  
103 - NSData *data = UIImageJPEGRepresentation(image, 1.0);  
104 -  
105 - if (data) {  
106 - if (![_fileManager fileExistsAtPath:_diskCachePath]) {  
107 - [_fileManager createDirectoryAtPath:_diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL];  
108 - }  
109 - NSString *cachePathForKey = [self defaultCachePathForKey:key];  
110 - [_fileManager createFileAtPath:cachePathForKey contents:data attributes:nil];  
111 - }  
112 - });  
113 - }  
114 -}  
115 -  
116 -- (UIImage *)imageFromMemoryCacheForKey:(NSString *)key  
117 -{  
118 - return [self.memoryCache objectForKey:key];  
119 -}  
120 -  
121 -- (UIImage *)imageFromDiskCacheForKey:(NSString *)key  
122 -{  
123 - UIImage *memoryImage = [self imageFromMemoryCacheForKey:key];  
124 - if (memoryImage) {  
125 - return memoryImage;  
126 - }  
127 -  
128 - NSData *diskData = [self getDiskImageDataWithKey:key];  
129 - if (diskData) {  
130 - return [UIImage ws_imageWithData:diskData];  
131 - }  
132 -  
133 - return nil;  
134 -}  
135 -  
136 -- (BOOL)queryDiskCacheForKey:(NSString *)key done:(CNLiveWebImageQueryCompletedBlock)doneBlock  
137 -{  
138 - if (!doneBlock) {  
139 - return NO;  
140 - }  
141 - if (!key) {  
142 - doneBlock(nil, CNLiveImageCacheTypeNone);  
143 - return NO;  
144 - }  
145 -  
146 - UIImage *memoryImage = [self imageFromMemoryCacheForKey:key];  
147 - if (memoryImage) {  
148 - doneBlock(memoryImage, CNLiveImageCacheTypeMemory);  
149 - return YES;  
150 - }  
151 -  
152 - UIImage *diskImage = [self imageFromDiskCacheForKey:key];  
153 - if (diskImage) {  
154 - doneBlock(diskImage, CNLiveImageCacheTypeDisk);  
155 - return YES;  
156 - }  
157 -  
158 - doneBlock(nil, CNLiveImageCacheTypeNone);  
159 - return NO;  
160 -  
161 -}  
162 -  
163 -- (void)removeCacheForKey:(NSString *)key done:(CNLiveCompletedBlock)completed  
164 -{  
165 - if (!key || !completed) {  
166 - return;  
167 - }  
168 -  
169 - if ([self imageFromMemoryCacheForKey:key]) {  
170 - [self.memoryCache removeObjectForKey:key];  
171 - }  
172 -  
173 - if ([self imageFromDiskCacheForKey:key]) {  
174 - NSString *cachePathForKey = [self defaultCachePathForKey:key];  
175 - [_fileManager removeItemAtPath:cachePathForKey error:nil];  
176 - }  
177 -  
178 - completed();  
179 -}  
180 -  
181 -- (long long)diskCacheSize  
182 -{  
183 - if ([_fileManager fileExistsAtPath:self.diskCachePath]) {  
184 - NSArray *subPathArray = [_fileManager subpathsAtPath:self.diskCachePath];  
185 - if (subPathArray && subPathArray.count > 0) {  
186 - long long totalCacheSize = 0;  
187 - for (NSString *subPath in subPathArray) {  
188 - NSString *fullPath = [self.diskCachePath stringByAppendingPathComponent:subPath];  
189 - NSDictionary *cacheSizeDic = [_fileManager attributesOfItemAtPath:fullPath error:nil];  
190 - totalCacheSize += [cacheSizeDic fileSize];  
191 - }  
192 - return totalCacheSize;  
193 - }  
194 - }  
195 - return 0;  
196 -}  
197 -  
198 -- (void)clearMemory  
199 -{  
200 - [self.memoryCache removeAllObjects];  
201 -}  
202 -  
203 -- (void)clearDisk  
204 -{  
205 - [self clearDiskOnCompletion:nil];  
206 -}  
207 -  
208 -- (void)clearDiskOnCompletion:(CNLiveWebImageNoParamsBlock)completion  
209 -{  
210 - dispatch_async(self.ioQueue, ^{  
211 - [_fileManager removeItemAtPath:self.diskCachePath error:nil];  
212 - [_fileManager createDirectoryAtPath:self.diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL];  
213 -  
214 - if (completion) {  
215 - dispatch_async(dispatch_get_main_queue(), ^{  
216 - completion();  
217 - });  
218 - }  
219 - });  
220 -}  
221 -  
222 -#pragma mark <PrivateMethod>  
223 -- (NSData *)getDiskImageDataWithKey:(NSString *)key  
224 -{  
225 - NSString *filePath = [self defaultCachePathForKey:key];  
226 - NSData *imageData = [NSData dataWithContentsOfFile:filePath];  
227 - return imageData;  
228 -}  
229 -  
230 -- (NSString *)defaultCachePathForKey:(NSString *)key  
231 -{  
232 - return [self cachePathForKey:key inPath:self.diskCachePath];  
233 -}  
234 -  
235 -- (NSString *)cachePathForKey:(NSString *)key inPath:(NSString *)path  
236 -{  
237 - NSString *fileName = [self cachedFileNameForKey:key];  
238 - return [path stringByAppendingPathComponent:fileName];  
239 -}  
240 -  
241 -- (NSString *)cachedFileNameForKey:(NSString *)key {  
242 - const char *str = [key UTF8String];  
243 - if (str == NULL) {  
244 - str = "";  
245 - }  
246 - unsigned char r[CC_MD5_DIGEST_LENGTH];  
247 - CC_MD5(str, (CC_LONG)strlen(str), r);  
248 - NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",  
249 - r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15]];  
250 -  
251 - return filename;  
252 -}  
253 -  
254 -@end  
WSWebImageDemo/CNLiveWebImage/CNLiveWebImageBlock.h deleted 100644 → 0
1 -//  
2 -// CNLiveWebImageBlock.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/27.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#ifndef CNLiveWebImageBlock_h  
10 -#define CNLiveWebImageBlock_h  
11 -  
12 -typedef NS_ENUM(NSUInteger, CNLiveImageCacheType) {  
13 - CNLiveImageCacheTypeNone,  
14 - CNLiveImageCacheTypeMemory,  
15 - CNLiveImageCacheTypeDisk  
16 -};  
17 -  
18 -typedef void(^CNLiveDownloadProgressBlock)(NSInteger receivedSize, NSInteger expectedSize);  
19 -typedef void(^CNLiveDownloadCompletedBlock)(UIImage *image, NSData *data, NSError *error, BOOL finished);  
20 -  
21 -typedef void(^CNLiveWebImageQueryCompletedBlock)(UIImage *image, CNLiveImageCacheType type);  
22 -typedef void(^CNLiveCompletedBlock)();  
23 -typedef void(^CNLiveWebImageNoParamsBlock)();  
24 -  
25 -#endif /* CNLiveWebImageBlock_h */  
WSWebImageDemo/CNLiveWebImage/CNLiveWebImageDownload.h deleted 100644 → 0
1 -//  
2 -// CNLiveWebImageDownload.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import <UIKit/UIKit.h>  
11 -#import "CNLiveWebImageOperation.h"  
12 -#import "CNLiveWebImageBlock.h"  
13 -  
14 -typedef NS_OPTIONS(NSUInteger, CNLiveWebImageDownloadOptions) {  
15 - CNLiveWebImageDownloadProgressiveDownload = 1 << 0,  
16 - CNLiveWebImageDownloadContinueInBackground = 1 << 1  
17 -};  
18 -  
19 -@interface CNLiveWebImageDownload : NSObject  
20 -  
21 -+ (CNLiveWebImageDownload *)sharedDownload;  
22 -  
23 -- (id <CNLiveWebImageOperation>)downloadWebImageWithURL:(NSURL *)url options:(CNLiveWebImageDownloadOptions)options progress:(CNLiveDownloadProgressBlock)progress completed:(CNLiveDownloadCompletedBlock)completed;  
24 -  
25 -@end  
WSWebImageDemo/CNLiveWebImage/CNLiveWebImageDownload.m deleted 100644 → 0
1 -//  
2 -// CNLiveWebImageDownload.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveWebImageDownload.h"  
10 -#import "CNLiveWebImageDownloadOperation.h"  
11 -  
12 -@interface CNLiveWebImageDownload ()  
13 -  
14 -@property (nonatomic, strong) NSOperationQueue *downloadQueue;  
15 -  
16 -@end  
17 -  
18 -@implementation CNLiveWebImageDownload  
19 -  
20 -+ (CNLiveWebImageDownload *)sharedDownload  
21 -{  
22 - static dispatch_once_t once;  
23 - static id instance;  
24 - dispatch_once(&once, ^{  
25 - instance = [self new];  
26 - });  
27 - return instance;  
28 -}  
29 -  
30 -- (instancetype)init  
31 -{  
32 - if ((self = [super init])) {  
33 - _downloadQueue = [NSOperationQueue new];  
34 - _downloadQueue.maxConcurrentOperationCount = 6;  
35 - }  
36 - return self;  
37 -}  
38 -  
39 -- (void)dealloc  
40 -{  
41 - [self.downloadQueue cancelAllOperations];  
42 -}  
43 -  
44 -- (id<CNLiveWebImageOperation>)downloadWebImageWithURL:(NSURL *)url options:(CNLiveWebImageDownloadOptions)options progress:(CNLiveDownloadProgressBlock)progress completed:(CNLiveDownloadCompletedBlock)completed  
45 -{  
46 - CNLiveWebImageDownloadOperation *operation;  
47 - operation = [[CNLiveWebImageDownloadOperation alloc] initWithURL:url  
48 - options:options  
49 - progress:progress  
50 - completed:completed];  
51 - [self.downloadQueue addOperation:operation];  
52 - return (id <CNLiveWebImageOperation>)operation;  
53 -}  
54 -@end  
WSWebImageDemo/CNLiveWebImage/CNLiveWebImageDownloadOperation.h deleted 100644 → 0
1 -//  
2 -// CNLiveWebImageDownloadOperation.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/25.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import "CNLiveWebImageDownload.h"  
11 -#import "CNLiveWebImageBlock.h"  
12 -  
13 -@interface CNLiveWebImageDownloadOperation : NSOperation  
14 -  
15 -- (id)initWithURL:(NSURL *)url options:(CNLiveWebImageDownloadOptions)options progress:(CNLiveDownloadProgressBlock)progress completed:(CNLiveDownloadCompletedBlock)completed;  
16 -  
17 -@end  
WSWebImageDemo/CNLiveWebImage/CNLiveWebImageDownloadOperation.m deleted 100644 → 0
1 -//  
2 -// CNLiveWebImageDownloadOperation.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/25.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveWebImageDownloadOperation.h"  
10 -#import "CNLiveWebImageOperation.h"  
11 -#import <ImageIO/ImageIO.h>  
12 -#import "UIImage+CNLiveMultiFormat.h"  
13 -  
14 -#define CNLiveWebImageBackgroundSessionIdentifier @"CNLiveWebImageBackgroundSessionIdentifier"  
15 -  
16 -@interface CNLiveWebImageDownloadOperation ()<CNLiveWebImageOperation, NSURLSessionDataDelegate, NSURLSessionTaskDelegate, NSURLSessionDelegate>  
17 -  
18 -@property (nonatomic, copy) CNLiveDownloadProgressBlock progressBlock;  
19 -@property (nonatomic, copy) CNLiveDownloadCompletedBlock completedBlock;  
20 -@property (nonatomic, assign) CNLiveWebImageDownloadOptions options;  
21 -@property (nonatomic, strong) NSURL *url;  
22 -  
23 -@property (nonatomic, strong) NSURLSessionConfiguration *config;  
24 -@property (nonatomic, strong) NSURLSession *session;  
25 -@property (nonatomic, strong) NSURLSessionDataTask *dataTask;  
26 -@property (nonatomic, assign) NSInteger expectedSize;  
27 -@property (nonatomic, strong) NSMutableData *imageData;  
28 -@property (nonatomic, strong) NSURLResponse *response;  
29 -  
30 -@end  
31 -  
32 -@implementation CNLiveWebImageDownloadOperation  
33 -  
34 -- (id)initWithURL:(NSURL *)url options:(CNLiveWebImageDownloadOptions)options progress:(CNLiveDownloadProgressBlock)progress completed:(CNLiveDownloadCompletedBlock)completed  
35 -{  
36 - if ((self = [super init])) {  
37 - _url = url;  
38 - _progressBlock = progress;  
39 - _completedBlock = completed;  
40 - _options = options;  
41 - }  
42 - return self;  
43 -}  
44 -  
45 -- (void)start  
46 -{  
47 - @synchronized (self) {  
48 - if (self.isCancelled) {  
49 - return;  
50 - }  
51 - }  
52 - self.dataTask = [self.session dataTaskWithURL:self.url];  
53 - [self.dataTask resume];  
54 - [self.session finishTasksAndInvalidate];  
55 -}  
56 -  
57 -- (NSURLSessionConfiguration *)config  
58 -{  
59 - if (!_config) {  
60 - if (self.options & CNLiveWebImageDownloadContinueInBackground) {  
61 - _config = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:CNLiveWebImageBackgroundSessionIdentifier];  
62 - }  
63 - else {  
64 - _config = [NSURLSessionConfiguration ephemeralSessionConfiguration];  
65 - }  
66 - }  
67 - return _config;  
68 -}  
69 -  
70 -- (NSURLSession *)session  
71 -{  
72 - if (!_session) {  
73 - _session = [NSURLSession sessionWithConfiguration:self.config delegate:self delegateQueue:[NSOperationQueue mainQueue]];  
74 - }  
75 - return _session;  
76 -}  
77 -  
78 -#pragma mark <NSURLSessionDataDelegate>  
79 -- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler  
80 -{  
81 - if (![response respondsToSelector:@selector(statusCode)] || ([((NSHTTPURLResponse *)response) statusCode] < 400 && [((NSHTTPURLResponse *)response) statusCode] != 304)) {  
82 - NSInteger expected = response.expectedContentLength > 0 ? (NSInteger)response.expectedContentLength : 0;  
83 - self.expectedSize = expected;  
84 - if (self.progressBlock) {  
85 - self.progressBlock(0, expected);  
86 - }  
87 -  
88 - self.imageData = [[NSMutableData alloc] initWithCapacity:expected];  
89 - self.response = response;  
90 - completionHandler(NSURLSessionResponseAllow);  
91 - }  
92 - else {  
93 -  
94 - [self.dataTask cancel];  
95 -  
96 - dispatch_async(dispatch_get_main_queue(), ^{  
97 - if (self.completedBlock) {  
98 - self.completedBlock(nil, nil, [NSError errorWithDomain:NSURLErrorDomain code:[((NSHTTPURLResponse *)response) statusCode] userInfo:nil], YES);  
99 - }  
100 - });  
101 - }  
102 -}  
103 -  
104 -- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data  
105 -{  
106 - [self.imageData appendData:data];  
107 - if (self.options & CNLiveWebImageDownloadProgressiveDownload && self.completedBlock) {  
108 - const NSInteger totalSize = self.imageData.length;  
109 - CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)self.imageData, NULL);  
110 - if (totalSize < self.expectedSize) {  
111 - CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(imageSource, 0, NULL);  
112 - if (partialImageRef) {  
113 - UIImage *image = [UIImage imageWithCGImage:partialImageRef];  
114 - CGImageRelease(partialImageRef);  
115 - dispatch_async(dispatch_get_main_queue(), ^{  
116 - if (self.completedBlock) {  
117 - self.completedBlock(image, self.imageData, nil, NO);  
118 - }  
119 - });  
120 - }  
121 - }  
122 -  
123 - CFRelease(imageSource);  
124 - }  
125 -  
126 - dispatch_async(dispatch_get_main_queue(), ^{  
127 - if (self.progressBlock) {  
128 - self.progressBlock(self.imageData.length, self.expectedSize);  
129 - }  
130 - });  
131 -}  
132 -  
133 -- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error  
134 -{  
135 - if (error) {  
136 - dispatch_async(dispatch_get_main_queue(), ^{  
137 - if (self.completedBlock) {  
138 - self.completedBlock(nil, nil, error, NO);  
139 - }  
140 - });  
141 - }  
142 - else {  
143 - dispatch_async(dispatch_get_main_queue(), ^{  
144 - if (self.completedBlock) {  
145 - self.completedBlock([UIImage ws_imageWithData:self.imageData], self.imageData, nil, YES);  
146 - }  
147 - });  
148 - }  
149 -}  
150 -  
151 -- (void)cancel  
152 -{  
153 - if (self.session) {  
154 - [self.session invalidateAndCancel];  
155 - }  
156 - self.completedBlock = nil;  
157 - self.progressBlock = nil;  
158 - self.session = nil;  
159 - self.imageData = nil;  
160 -}  
161 -  
162 -  
163 -  
164 -  
165 -  
166 -  
167 -  
168 -  
169 -  
170 -  
171 -  
172 -  
173 -  
174 -  
175 -@end  
WSWebImageDemo/CNLiveWebImage/CNLiveWebImageManager.h deleted 100644 → 0
1 -//  
2 -// CNLiveWebImageManager.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/27.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -#import <UIKit/UIKit.h>  
11 -#import "CNLiveWebImageBlock.h"  
12 -#import "CNLiveWebImageOperation.h"  
13 -  
14 -typedef NS_OPTIONS(NSUInteger, CNLiveWebImageOptions) {  
15 - CNLiveWebImageRetryFailed = 1 << 0,  
16 - CNLiveWebImageCacheMemoryOnly = 1 << 1,  
17 - CNLiveWebImageProgressiveDownload = 1 << 2,  
18 - CNLiveWebImageContinueInBackground = 1 << 3  
19 -};  
20 -  
21 -@interface CNLiveWebImageManager : NSObject  
22 -  
23 -+ (nonnull id)sharedManager;  
24 -  
25 -- (nonnull id <CNLiveWebImageOperation>)downloadWebImageWithURL:(nonnull NSURL *)url options:(CNLiveWebImageOptions)options progress:(nonnull CNLiveDownloadProgressBlock)progress completed:(nonnull CNLiveDownloadCompletedBlock)completed;  
26 -  
27 -- (void)storeImage:(nonnull UIImage *)image imageUrl:(nonnull NSURL *)url toDisk:(BOOL)toDisk;  
28 -  
29 -- (nullable UIImage *)imageFromMemoryCacheWithImageUrl:(nonnull NSURL *)url;  
30 -  
31 -- (nullable UIImage *)imageFromDiskCacheWithImageUrl:(nonnull NSURL *)url;  
32 -  
33 -- (BOOL)queryDiskCacheWithImageUrl:(nonnull NSURL *)url done:(nonnull CNLiveWebImageQueryCompletedBlock)doneBlock;  
34 -  
35 -- (void)removeCacheWithUrl:(nonnull NSURL *)url done:(nonnull CNLiveCompletedBlock)completed;  
36 -  
37 -- (long long)diskCacheSize;  
38 -  
39 -- (void)clearMemory;  
40 -  
41 -- (void)clearDisk;  
42 -  
43 -@end  
WSWebImageDemo/CNLiveWebImage/CNLiveWebImageManager.m deleted 100644 → 0
1 -//  
2 -// CNLiveWebImageManager.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/27.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "CNLiveWebImageManager.h"  
10 -#import "CNLiveWebImageDownload.h"  
11 -#import "CNLiveImageCache.h"  
12 -  
13 -@interface CNLiveWebImageManager ()  
14 -  
15 -@property (nonatomic, strong) CNLiveImageCache *imageCache;  
16 -@property (nonatomic, strong) NSMutableSet *failedURLs;  
17 -  
18 -@end  
19 -  
20 -@implementation CNLiveWebImageManager  
21 -  
22 -+ (id)sharedManager  
23 -{  
24 - static id manager;  
25 - static dispatch_once_t once;  
26 - dispatch_once(&once, ^{  
27 - manager = [self new];  
28 - });  
29 - return manager;  
30 -}  
31 -  
32 -- (instancetype)init  
33 -{  
34 - if ((self = [super init])) {  
35 - _imageCache = [CNLiveImageCache sharedImageCache];  
36 - _failedURLs = [NSMutableSet new];  
37 - }  
38 - return self;  
39 -}  
40 -  
41 -- (id<CNLiveWebImageOperation>)downloadWebImageWithURL:(NSURL *)url options:(CNLiveWebImageOptions)options progress:(CNLiveDownloadProgressBlock)progress completed:(CNLiveDownloadCompletedBlock)completed  
42 -{  
43 - if ([url isKindOfClass:NSString.class]) {  
44 - url = [NSURL URLWithString:(NSString *)url];  
45 - }  
46 - if (![url isKindOfClass:NSURL.class]) {  
47 - url = nil;  
48 - }  
49 -  
50 - BOOL isFailedUrl = NO;  
51 - @synchronized (self.failedURLs) {  
52 - isFailedUrl = [self.failedURLs containsObject:url];  
53 - }  
54 - if (!url || (!(options & CNLiveWebImageRetryFailed) && isFailedUrl)) {  
55 - NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil];  
56 - completed(nil, nil, error, YES);  
57 - }  
58 -  
59 - BOOL hasCacheImage = [self.imageCache queryDiskCacheForKey:url.absoluteString done:^(UIImage *image, CNLiveImageCacheType type) {  
60 - if (image) {  
61 - completed(image,UIImageJPEGRepresentation(image, 1.0), nil, YES);  
62 - }  
63 - }];;  
64 -  
65 - if (hasCacheImage) {  
66 - return nil;  
67 - }  
68 -  
69 -  
70 - CNLiveWebImageDownloadOptions downloadOptions = 0;  
71 - if (options & CNLiveWebImageProgressiveDownload) downloadOptions |= CNLiveWebImageDownloadProgressiveDownload;  
72 - if (options & CNLiveWebImageContinueInBackground) downloadOptions |= CNLiveWebImageDownloadContinueInBackground;  
73 - id <CNLiveWebImageOperation> operation = [[CNLiveWebImageDownload sharedDownload] downloadWebImageWithURL:url options:downloadOptions progress:progress completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {  
74 - if (error) {  
75 - BOOL shouldBeFailedURLAlliOSVersion = (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut);  
76 - BOOL shouldBeFailedURLiOS7 = (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1 && error.code != NSURLErrorInternationalRoamingOff && error.code != NSURLErrorCallIsActive && error.code != NSURLErrorDataNotAllowed);  
77 - if (shouldBeFailedURLAlliOSVersion || shouldBeFailedURLiOS7) {  
78 - @synchronized (self.failedURLs) {  
79 - [self.failedURLs addObject:url];  
80 - }  
81 - }  
82 - }  
83 - else {  
84 - if ((options & CNLiveWebImageRetryFailed)) {  
85 - @synchronized (self.failedURLs) {  
86 - [self.failedURLs removeObject:url];  
87 - }  
88 - }  
89 -  
90 - BOOL cacheOnDisk = !(options & CNLiveWebImageCacheMemoryOnly);  
91 - if (image && finished) {  
92 - if (cacheOnDisk) {  
93 - [self.imageCache storeImage:image forKey:[url absoluteString] toDisk:YES];  
94 - }  
95 - else {  
96 - [self.imageCache storeImage:image forKey:[url absoluteString] toDisk:NO];  
97 - }  
98 - }  
99 -  
100 - completed(image, data, error, finished);  
101 - }  
102 -  
103 - }];  
104 - return operation;  
105 -}  
106 -  
107 -- (void)storeImage:(UIImage *)image imageUrl:(NSURL *)url toDisk:(BOOL)toDisk  
108 -{  
109 - [self.imageCache storeImage:image forKey:url.absoluteString toDisk:toDisk];  
110 -}  
111 -  
112 -- (UIImage *)imageFromMemoryCacheWithImageUrl:(NSURL *)url  
113 -{  
114 - return [self.imageCache imageFromMemoryCacheForKey:url.absoluteString];  
115 -}  
116 -  
117 -- (UIImage *)imageFromDiskCacheWithImageUrl:(NSURL *)url  
118 -{  
119 - return [self.imageCache imageFromDiskCacheForKey:url.absoluteString];  
120 -}  
121 -  
122 -- (BOOL)queryDiskCacheWithImageUrl:(NSURL *)url done:(CNLiveWebImageQueryCompletedBlock)doneBlock  
123 -{  
124 - return [self.imageCache queryDiskCacheForKey:url.absoluteString done:doneBlock];  
125 -}  
126 -  
127 -- (void)removeCacheWithUrl:(NSURL *)url done:(CNLiveCompletedBlock)completed  
128 -{  
129 - [self.imageCache removeCacheForKey:url.absoluteString done:completed];  
130 -}  
131 -  
132 -- (long long)diskCacheSize  
133 -{  
134 - return [self.imageCache diskCacheSize];  
135 -}  
136 -  
137 -- (void)clearMemory  
138 -{  
139 - [self.imageCache clearMemory];  
140 -}  
141 -  
142 -- (void)clearDisk  
143 -{  
144 - [self.imageCache clearDisk];  
145 -}  
146 -  
147 -@end  
WSWebImageDemo/CNLiveWebImage/CNLiveWebImageOperation.h deleted 100644 → 0
1 -//  
2 -// CNLiveWebImageOperation.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/19.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -  
11 -@protocol CNLiveWebImageOperation <NSObject>  
12 -  
13 -- (void)cancel;  
14 -  
15 -@end  
WSWebImageDemo/CNLiveWebImage/NSData+CNLiveImageContentType.h deleted 100644 → 0
1 -//  
2 -// NSData+ImageContentType.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/21.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <Foundation/Foundation.h>  
10 -  
11 -@interface NSData (CNLiveImageContentType)  
12 -  
13 -+ (NSString *)ws_imageContentTypeWithData:(NSData *)data;  
14 -  
15 -@end  
WSWebImageDemo/CNLiveWebImage/NSData+CNLiveImageContentType.m deleted 100644 → 0
1 -//  
2 -// NSData+ImageContentType.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/21.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "NSData+CNLiveImageContentType.h"  
10 -  
11 -@implementation NSData (CNLiveImageContentType)  
12 -  
13 -+ (NSString *)ws_imageContentTypeWithData:(NSData *)data  
14 -{  
15 - uint8_t c;  
16 - [data getBytes:&c length:1];  
17 - switch (c) {  
18 - case 0xFF:  
19 - return @"image/jpeg";  
20 - case 0x89:  
21 - return @"image/png";  
22 - case 0x47:  
23 - return @"image/gif";  
24 - case 0x49:  
25 - case 0x4D:  
26 - return @"image/tiff";  
27 - case 0x52:  
28 -  
29 - if ([data length] < 12) {  
30 - return nil;  
31 - }  
32 -  
33 - NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];  
34 - if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {  
35 - return @"image/webp";  
36 - }  
37 -  
38 - return nil;  
39 - }  
40 - return nil;  
41 -}  
42 -  
43 -@end  
WSWebImageDemo/CNLiveWebImage/UIImage+CNLiveMultiFormat.h deleted 100644 → 0
1 -//  
2 -// UIImage+MultiFormat.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/21.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -  
11 -@interface UIImage (CNLiveMultiFormat)  
12 -  
13 -+ (UIImage *)ws_imageWithData:(NSData *)data;  
14 -  
15 -@end  
WSWebImageDemo/CNLiveWebImage/UIImage+CNLiveMultiFormat.m deleted 100644 → 0
1 -//  
2 -// UIImage+MultiFormat.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/21.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "UIImage+CNLiveMultiFormat.h"  
10 -#import "NSData+CNLiveImageContentType.h"  
11 -  
12 -@implementation UIImage (CNLiveMultiFormat)  
13 -  
14 -+ (UIImage *)ws_imageWithData:(NSData *)data  
15 -{  
16 - if (!data) {  
17 - return nil;  
18 - }  
19 - UIImage *image;  
20 - NSString *imageContentType = [NSData ws_imageContentTypeWithData:data];  
21 -  
22 - if ([imageContentType isEqualToString:@"image/gif"]) {  
23 - //TODO 处理GIF图片  
24 - }  
25 - else if ([imageContentType isEqualToString:@"image/webp"]) {  
26 - //TODO 处理WEBP图片  
27 - }  
28 - else {  
29 - image = [[UIImage alloc] initWithData:data];  
30 - }  
31 - return image;  
32 -}  
33 -  
34 -@end  
WSWebImageDemo/CNLiveWebImage/UIImageView+CNLiveWebCache.h deleted 100644 → 0
1 -//  
2 -// UIImageView+WebCache.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/26.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -#import "CNLiveWebImageManager.h"  
11 -  
12 -@interface UIImageView (CNLiveWebCache)  
13 -  
14 -- (void)ws_setImageWithUrl:(NSURL *)url;  
15 -  
16 -- (void)ws_setImageWithUrl:(NSURL *)url placeholderImage:(UIImage *)placeholder;  
17 -  
18 -@end  
WSWebImageDemo/CNLiveWebImage/UIImageView+CNLiveWebCache.m deleted 100644 → 0
1 -//  
2 -// UIImageView+WebCache.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/26.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "UIImageView+CNLiveWebCache.h"  
10 -#import "CNLiveWebImageBlock.h"  
11 -  
12 -@implementation UIImageView (CNLiveWebCache)  
13 -  
14 -- (void)ws_setImageWithUrl:(NSURL *)url  
15 -{  
16 - [self ws_setImageWithUrl:url placeholderImage:nil options:0 progress:nil completed:nil];  
17 -}  
18 -  
19 -- (void)ws_setImageWithUrl:(NSURL *)url placeholderImage:(UIImage *)placeholder  
20 -{  
21 - [self ws_setImageWithUrl:url placeholderImage:placeholder options:0 progress:nil completed:nil];  
22 -}  
23 -  
24 -- (void)ws_setImageWithUrl:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(CNLiveWebImageOptions)options progress:(CNLiveDownloadProgressBlock)progress completed:(CNLiveDownloadCompletedBlock)completed  
25 -{  
26 - if (placeholder) {  
27 - self.image = placeholder;  
28 - }  
29 -  
30 - if (url) {  
31 - __weak __typeof(self) weakSelf = self;  
32 - [[CNLiveWebImageManager sharedManager] downloadWebImageWithURL:url  
33 - options:options  
34 - progress:progress  
35 - completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {  
36 - if (image && !error && finished) {  
37 - weakSelf.image = image;  
38 - }  
39 - }];  
40 - }  
41 - else {  
42 - dispatch_async(dispatch_get_main_queue(), ^{  
43 - NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];  
44 - if (completed) {  
45 - completed(nil, nil, error, NO);  
46 - }  
47 - });  
48 - }  
49 -  
50 -}  
51 -  
52 -@end  
WSWebImageDemo/Info.plist deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>CFBundleDevelopmentRegion</key>  
6 - <string>en</string>  
7 - <key>CFBundleExecutable</key>  
8 - <string>$(EXECUTABLE_NAME)</string>  
9 - <key>CFBundleIdentifier</key>  
10 - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>  
11 - <key>CFBundleInfoDictionaryVersion</key>  
12 - <string>6.0</string>  
13 - <key>CFBundleName</key>  
14 - <string>$(PRODUCT_NAME)</string>  
15 - <key>CFBundlePackageType</key>  
16 - <string>APPL</string>  
17 - <key>CFBundleShortVersionString</key>  
18 - <string>1.0</string>  
19 - <key>CFBundleSignature</key>  
20 - <string>????</string>  
21 - <key>CFBundleVersion</key>  
22 - <string>1</string>  
23 - <key>LSRequiresIPhoneOS</key>  
24 - <true/>  
25 - <key>UILaunchStoryboardName</key>  
26 - <string>LaunchScreen</string>  
27 - <key>UIMainStoryboardFile</key>  
28 - <string>Main</string>  
29 - <key>UIRequiredDeviceCapabilities</key>  
30 - <array>  
31 - <string>armv7</string>  
32 - </array>  
33 - <key>UISupportedInterfaceOrientations</key>  
34 - <array>  
35 - <string>UIInterfaceOrientationPortrait</string>  
36 - <string>UIInterfaceOrientationLandscapeLeft</string>  
37 - <string>UIInterfaceOrientationLandscapeRight</string>  
38 - </array>  
39 - <key>UISupportedInterfaceOrientations~ipad</key>  
40 - <array>  
41 - <string>UIInterfaceOrientationPortrait</string>  
42 - <string>UIInterfaceOrientationPortraitUpsideDown</string>  
43 - <string>UIInterfaceOrientationLandscapeLeft</string>  
44 - <string>UIInterfaceOrientationLandscapeRight</string>  
45 - </array>  
46 - <key>NSAppTransportSecurity</key>  
47 - <dict>  
48 - <key>NSAllowsArbitraryLoads</key>  
49 - <true/>  
50 - </dict>  
51 -</dict>  
52 -</plist>  
WSWebImageDemo/ViewController.h deleted 100644 → 0
1 -//  
2 -// ViewController.h  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -  
11 -@interface ViewController : UIViewController  
12 -  
13 -  
14 -@end  
15 -  
WSWebImageDemo/ViewController.m deleted 100644 → 0
1 -//  
2 -// ViewController.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import "ViewController.h"  
10 -#import "CNLiveWebImageManager.h"  
11 -#import "CNLiveImageCache.h"  
12 -#import "UIImageView+CNLiveWebCache.h"  
13 -  
14 -@interface ViewController ()<UITableViewDelegate, UITableViewDataSource>  
15 -{  
16 - NSArray *_imageArray;  
17 -}  
18 -  
19 -@property (nonatomic, strong) UIImageView *imageView;  
20 -  
21 -@end  
22 -//static NSString *str = @"http://img.firefoxchina.cn/2016/07/4/201607261050080.jpg";  
23 -static NSString *str = @"http://desk.fd.zol-img.com.cn/t_s2560x1600c5/g5/M00/0D/0C/ChMkJ1eV8KuIKvxAADO4tztrTKcAAT0ZwCLaesAM7jP146.jpg";  
24 -//static NSString *str = @"http://pic104.nipic.com/file/20160720/21897230_115704969000_2.jpg";  
25 -  
26 -@implementation ViewController  
27 -  
28 -- (void)viewDidLoad {  
29 - [super viewDidLoad];  
30 - // Do any additional setup after loading the view, typically from a nib.  
31 -  
32 -// long long diskCacheSize = [[CNLiveImageCache sharedImageCache] diskCacheSize];  
33 -// NSLog(@"%lld",diskCacheSize);  
34 -//  
35 -// [self.view addSubview:self.imageView];  
36 -// [[CNLiveWebImageDownloadManager sharedManager] downloadWebImageWithURL:[NSURL URLWithString:str]  
37 -// options:CNLiveWebImageProgressiveDownload  
38 -// progress:^(NSInteger receivedSize, NSInteger expectedSize) {  
39 -// NSLog(@"receivedSize = %ld, expectedSize = %ld",(long)receivedSize, (long)expectedSize);  
40 -// }  
41 -// completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {  
42 -// dispatch_async(dispatch_get_main_queue(), ^{  
43 -// self.imageView.image = image;  
44 -// });  
45 -// }];  
46 -  
47 -// [[CNLiveImageCache sharedImageCache] removeCacheForKey:@"http://img.firefoxchina.cn/2016/07/4/201607261050080.jpg" done:^{  
48 -// NSLog(@"Do something");  
49 -// }];  
50 -  
51 -// UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 300, 200)];  
52 -// imageView.backgroundColor = [UIColor cyanColor];  
53 -// [self.view addSubview:imageView];  
54 -  
55 -// [imageView ws_setImageWithUrl:[NSURL URLWithString:str]];  
56 -// [imageView ws_setImageWithUrl:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"text.jpg"]];  
57 -  
58 - _imageArray = @[@"http://y1.cnliveimg.com:8080/image/itv/2016/0729/392ab54d87a049b6b7f7cf6d7df252d5_138931_101.jpg",  
59 - @"http://y3.cnliveimg.com:8080/image/itv/2016/0729/d56e527238a04a6d909cf080092c3e74_138923_100.jpg",  
60 - @"http://y2.cnliveimg.com:8080/image/itv/2016/0729/098609b945fc43169bea7a6093fe449e_138914_100.jpg",  
61 - @"http://y3.cnliveimg.com:8080/image/itv/2016/0729/e67a4abf5781407195e6544a1931913c_138913_100.jpg",  
62 - @"http://y3.cnliveimg.com:8080/image/itv/2016/0728/912ab18337e642439cfbca32ae527f23_138727_100.jpg",  
63 - @"http://y1.cnliveimg.com:8080/image/itv/2016/0722/75be21e738a945e3b6b0437a01437beb_101.jpg",  
64 - @"http://y1.cnliveimg.com:8080/image/itv/2016/0520/c4a9729f38f344f599be183bfb0ed0d0_100.jpg",  
65 - @"http://y1.cnliveimg.com:8080/image/itv/2016/0429/2237884c0dc64c1bbf486b7c00888cb0_119818_100.jpg",  
66 - @"http://y3.cnliveimg.com:8080/image/itv/2016/0405/f7e64bc903884ae3bebbd7493c81759e_115166_100.jpg",  
67 - @"http://y1.cnliveimg.com:8080/image/itv/2016/0116/7521576fd18f4bfbaee9efa8d379eee0_101710_100.jpg"];  
68 -  
69 - UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(100, 200, 100, 300) style:UITableViewStylePlain];  
70 - [self.view addSubview:tableView];  
71 - tableView.rowHeight = 100;  
72 - tableView.delegate = self;  
73 - tableView.dataSource = self;  
74 -  
75 -}  
76 -  
77 -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section  
78 -{  
79 - return _imageArray.count;  
80 -}  
81 -  
82 -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath  
83 -{  
84 - static NSString *identify = @"cell";  
85 - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify];  
86 - if (!cell) {  
87 - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identify];  
88 - UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];  
89 - [cell.contentView addSubview:image];  
90 - image.tag = 1001;  
91 - }  
92 - UIImageView *imageView = (UIImageView *)[cell viewWithTag:1001];  
93 - [imageView ws_setImageWithUrl:[NSURL URLWithString:_imageArray[indexPath.row]] placeholderImage:[UIImage imageNamed:@"text.jpg"]];  
94 -  
95 - return cell;  
96 -}  
97 -  
98 -- (void)didReceiveMemoryWarning {  
99 - [super didReceiveMemoryWarning];  
100 - // Dispose of any resources that can be recreated.  
101 -}  
102 -  
103 --(UIImageView *)imageView{  
104 - if (!_imageView) {  
105 - _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(40,40,300,200)];  
106 - _imageView.backgroundColor = [UIColor redColor];  
107 - _imageView.contentMode = UIViewContentModeScaleToFill;  
108 - }  
109 - return _imageView;  
110 -}  
111 -  
112 -@end  
WSWebImageDemo/main.m deleted 100644 → 0
1 -//  
2 -// main.m  
3 -// WSWebImageDemo  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <UIKit/UIKit.h>  
10 -#import "AppDelegate.h"  
11 -  
12 -int main(int argc, char * argv[]) {  
13 - @autoreleasepool {  
14 - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));  
15 - }  
16 -}  
WSWebImageDemo/text.jpg deleted 100644 → 0

41.4 KB

WSWebImageDemoTests/Info.plist deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>CFBundleDevelopmentRegion</key>  
6 - <string>en</string>  
7 - <key>CFBundleExecutable</key>  
8 - <string>$(EXECUTABLE_NAME)</string>  
9 - <key>CFBundleIdentifier</key>  
10 - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>  
11 - <key>CFBundleInfoDictionaryVersion</key>  
12 - <string>6.0</string>  
13 - <key>CFBundleName</key>  
14 - <string>$(PRODUCT_NAME)</string>  
15 - <key>CFBundlePackageType</key>  
16 - <string>BNDL</string>  
17 - <key>CFBundleShortVersionString</key>  
18 - <string>1.0</string>  
19 - <key>CFBundleSignature</key>  
20 - <string>????</string>  
21 - <key>CFBundleVersion</key>  
22 - <string>1</string>  
23 -</dict>  
24 -</plist>  
WSWebImageDemoTests/WSWebImageDemoTests.m deleted 100644 → 0
1 -//  
2 -// WSWebImageDemoTests.m  
3 -// WSWebImageDemoTests  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <XCTest/XCTest.h>  
10 -  
11 -@interface WSWebImageDemoTests : XCTestCase  
12 -  
13 -@end  
14 -  
15 -@implementation WSWebImageDemoTests  
16 -  
17 -- (void)setUp {  
18 - [super setUp];  
19 - // Put setup code here. This method is called before the invocation of each test method in the class.  
20 -}  
21 -  
22 -- (void)tearDown {  
23 - // Put teardown code here. This method is called after the invocation of each test method in the class.  
24 - [super tearDown];  
25 -}  
26 -  
27 -- (void)testExample {  
28 - // This is an example of a functional test case.  
29 - // Use XCTAssert and related functions to verify your tests produce the correct results.  
30 -}  
31 -  
32 -- (void)testPerformanceExample {  
33 - // This is an example of a performance test case.  
34 - [self measureBlock:^{  
35 - // Put the code you want to measure the time of here.  
36 - }];  
37 -}  
38 -  
39 -@end  
WSWebImageDemoUITests/Info.plist deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8"?>  
2 -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
3 -<plist version="1.0">  
4 -<dict>  
5 - <key>CFBundleDevelopmentRegion</key>  
6 - <string>en</string>  
7 - <key>CFBundleExecutable</key>  
8 - <string>$(EXECUTABLE_NAME)</string>  
9 - <key>CFBundleIdentifier</key>  
10 - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>  
11 - <key>CFBundleInfoDictionaryVersion</key>  
12 - <string>6.0</string>  
13 - <key>CFBundleName</key>  
14 - <string>$(PRODUCT_NAME)</string>  
15 - <key>CFBundlePackageType</key>  
16 - <string>BNDL</string>  
17 - <key>CFBundleShortVersionString</key>  
18 - <string>1.0</string>  
19 - <key>CFBundleSignature</key>  
20 - <string>????</string>  
21 - <key>CFBundleVersion</key>  
22 - <string>1</string>  
23 -</dict>  
24 -</plist>  
WSWebImageDemoUITests/WSWebImageDemoUITests.m deleted 100644 → 0
1 -//  
2 -// WSWebImageDemoUITests.m  
3 -// WSWebImageDemoUITests  
4 -//  
5 -// Created by 王帅 on 16/7/14.  
6 -// Copyright © 2016年 王帅. All rights reserved.  
7 -//  
8 -  
9 -#import <XCTest/XCTest.h>  
10 -  
11 -@interface WSWebImageDemoUITests : XCTestCase  
12 -  
13 -@end  
14 -  
15 -@implementation WSWebImageDemoUITests  
16 -  
17 -- (void)setUp {  
18 - [super setUp];  
19 -  
20 - // Put setup code here. This method is called before the invocation of each test method in the class.  
21 -  
22 - // In UI tests it is usually best to stop immediately when a failure occurs.  
23 - self.continueAfterFailure = NO;  
24 - // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.  
25 - [[[XCUIApplication alloc] init] launch];  
26 -  
27 - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.  
28 -}  
29 -  
30 -- (void)tearDown {  
31 - // Put teardown code here. This method is called after the invocation of each test method in the class.  
32 - [super tearDown];  
33 -}  
34 -  
35 -- (void)testExample {  
36 - // Use recording to get started writing UI tests.  
37 - // Use XCTAssert and related functions to verify your tests produce the correct results.  
38 -}  
39 -  
40 -@end