Commit Graph

646 Commits

Author SHA1 Message Date
Bogdan Poplauschi f080e38fb8 Replace #699 Fixed race condition in SDWebImageManager if one operation is cancelled, the completion block must not be called, otherwise it might race with a newer completion for the same object
Conflicts:
	SDWebImage/SDWebImageManager.m
2014-07-14 16:29:57 +03:00
Bogdan Poplauschi 6e4fbafa55 #625 In order to fix the deadlock, reviewed the `[SDImageCache diskImageExistsWithKey:]` method. Based on the Apple doc for NSFileManager, using the defaultManager without the dispatch on the ioQueue to avoid the deadlocks. This instance is thread safe. Also created an async variant of this method `[SDImageCache diskImageExistsWithKey:completion:]`
For consistency, added async methods in `SDWebImageManager` `cachedImageExistsForURL:completion:` and `diskImageExistsForURL:completion:`
2014-07-14 16:22:00 +03:00
Bogdan Poplauschi 0b47342b2f No need for explicit ivar and getters, as long as we have the @synthesize in place 2014-07-14 13:01:05 +03:00
Bogdan Poplauschi 39db378082 Merge pull request #783 from bpoplauschi/race_condition
Replace #621Fixed race condition between operation cancelation and loading finish
2014-07-11 09:57:28 +03:00
Bogdan Poplauschi 894a1b1810 Merge pull request #794 from vjyanand/master
Update MKAnnotationView+WebCache.m
2014-07-10 10:57:51 +03:00
Vjy Anand 99590ed6ec Update MKAnnotationView+WebCache.m
Replace deprecated method call
2014-07-06 06:40:06 -04:00
Bogdan Poplauschi 2e708d3518 Updated README.md with badges 2014-07-04 10:56:09 +03:00
Bogdan Poplauschi 30e034d60d Fixed misspell 2014-06-30 00:07:32 +03:00
Bogdan Poplauschi 72a4e7b830 Replace #621Fixed race condition between operation cancelation and loading finish 2014-06-26 00:30:45 +03:00
Bogdan Poplauschi 30f672661c Added option to use the cached image instead of the placeholder for UIImageView. Replaces #541. Fixes #599 2014-06-26 00:27:56 +03:00
Bogdan Poplauschi a6f11b3ad7 Fixed #775, made sure all the category methods that are public have the sd_ prefix (deprecated the old ones)
-there were a few exceptions where I just renamed the methods since they were added in this method
2014-06-25 21:32:53 +03:00
Bogdan Poplauschi 23874cdca4 Update for #771 - instead of removing the old methods, deprecated them so we are backwards compatible. 2014-06-25 11:24:59 +03:00
Bogdan Poplauschi 6d01e80409 Added comments and coding style to previous pull request #771 2014-06-25 11:04:28 +03:00
Bogdan Poplauschi 9b18145e56 Merge pull request #771 from Whirlwind/new_cancel_logic
Refactor the cancel logic
2014-06-25 10:49:44 +03:00
Bogdan Poplauschi 3a7adbbacf Merge pull request #780 from rokgregoric/master
Do not load placeholder image if SDWebImageDelayPlaceholder option specified.
2014-06-24 18:29:09 +03:00
Rok Gregorič 8d668b4121 Do not load placeholder image if SDWebImageDelayPlaceholder option specified. 2014-06-24 12:49:34 +02:00
Bogdan Poplauschi 50c4d1d2eb Implemented NTLM auth support. Replaced deprecated auth challenge methods from `NSURLConnectionDelegate`. Replaces #711.
- added `username` and `password` properties on `SDWebImageDownloader`
- added `shouldUseCredentialStorage` and `credential` properties on `SDWebImageDownloaderOperation`
- `SDWebImageDownloaderOperation` conforms to `NSURLConnectionDataDelegate` (it used to implement the methods, but didn't stated the protocol in the declaration)
- removed deprecated methods: `- connection:canAuthenticateAgainstProtectionSpace:` and `- connection:didReceiveAuthenticationChallenge:` with `- connectionShouldUseCredentialStorage:` and `- connection:willSendRequestForAuthenticationChallenge:`
- updated demo project to download one image the requires HTTP auth
2014-06-23 21:57:33 +03:00
Bogdan Poplauschi c7330db3a6 Merge branch 'unit_tests'
Unit testing setup + created workspace
- created a SDWebImage.xcworkspace
- includes the existing SDWebImage.xcodeproj (responsible of compiling the library)
- includes the existing SDWebImage Demo.xcodeproj
- includes the newly created SDWebImage Tests.xcodeproj (tests project). The test project uses the local CocoaPods repo to link to the library

Unit testing backbone:
- XCTest framework (the one from Apple)
- XCTestAsync - extension for XCTest that allows easily creating asynchronous tests. Relies on dispatch_after.
- Expecta - matcher Framework for Objective-C/Cocoa

Updated gitignore
2014-06-23 21:23:56 +03:00
Bogdan Poplauschi e5faad0026 Reverted demo project referencing source files directly. Re-added SDWebImage project as subproject 2014-06-20 18:04:06 +03:00
Bogdan Poplauschi e0b3de4357 Added error test 2014-06-20 17:51:40 +03:00
Bogdan Poplauschi c1fae30d63 Added SDWebImage Tests project. It uses CocoaPods (Expecta + XCTestAsync). Added some demo tests 2014-06-20 17:21:01 +03:00
Bogdan Poplauschi 60b043755f Created a SDWebImage workspace with the 2 existing projects, fixed the demo project so it directly references the source files. Shared a demo project scheme 2014-06-20 16:41:53 +03:00
Bogdan Poplauschi 7855f89185 Prepared gitignore for CocoaPods and workspaces 2014-06-20 16:40:43 +03:00
Bogdan Poplauschi fe4b3a088a Fixed warnings from demo project (started using the new methods, the ones with the sd_ prefix). 2014-06-20 10:07:12 +03:00
Whirlwind 5615cf12de Merge branch 'master' into new_cancel_logic
Conflicts:
	SDWebImage/MKAnnotationView+WebCache.m
	SDWebImage/UIButton+WebCache.m
	SDWebImage/UIImageView+HighlightedWebCache.h
	SDWebImage/UIImageView+HighlightedWebCache.m
	SDWebImage/UIImageView+WebCache.m
2014-06-20 10:51:17 +08:00
Bogdan Poplauschi af3e4f87e4 Returning error in setImage completedBlock if the url was nil. Added `dispatch_main_async_safe` macro. Fixes #505 2014-06-19 23:24:08 +03:00
Bogdan Poplauschi eb91fdd3b8 Fixed issue #529 - if the `cacheKeyFilter` was set, this was ignored when computing the `scaledImageForKey`. For most of the developers that did not set `cacheKeyFilter`, the code will work exactly the same 2014-06-19 23:05:14 +03:00
Olivier Poitrey a8a69ab9b6 Merge pull request #770 from bpoplauschi/completion_with_url
Pass imageURL in completedBlock
2014-06-19 12:38:12 -07:00
Bogdan Poplauschi 136daba9df Added proper handling for SDWebImageDownloaderLowPriority (aka NSOperationQueuePriorityLow). Fixes #713 #745 2014-06-19 22:19:22 +03:00
Bogdan Poplauschi e116aa5ce0 Updated some older code to match the coding style 2014-06-19 21:58:20 +03:00
Bogdan Poplauschi ea663b9602 As discussed with @rs, prefixed all the new methods to sd_set* 2014-06-19 21:54:25 +03:00
Whirlwind 4c18545dbc Refactor the cancel logic 2014-06-19 22:46:37 +08:00
Bogdan Poplauschi 03a751430d Pass image URL in completion blocks - step 6:
- deprecated block type `SDWebImageCompletedBlock `, replaced with `SDWebImageCompletedBlock ` that contains NSURL* param
2014-06-19 12:27:08 +03:00
Bogdan Poplauschi 81b5e72a9c Pass image URL in completion blocks - step 5:
- deprecated all UIImageView(WebCache) `setImage*` methods. Replaced with `loadImage*` methods that use the `SDWebImageCompletionBlock` as completion block type
- created WebCacheDeprecated category on UIImageView (to avoid collisions, we didn't name it Deprecated)
- replaced the usages of the deprecated items with the new ones
2014-06-19 12:26:12 +03:00
Bogdan Poplauschi 21b230f28f Fixed misspell (downloand -> download) 2014-06-19 12:13:39 +03:00
Bogdan Poplauschi 76b552e21e Pass image URL in completion blocks - step 4:
- deprecated all UIImageView(HighlightedWebCache) `setImage*` methods. Replaced with `loadImage*` methods that use the `SDWebImageCompletionBlock` as completion block type
- created HighlightedWebCacheDeprecated category on UIImageView (to avoid collisions, we didn't name it Deprecated)
- replaced the usages of the deprecated items with the new ones
2014-06-19 12:12:58 +03:00
Bogdan Poplauschi c38409b813 Updated UIButton category documentation (forth param for the completion block) + alignaments 2014-06-19 12:04:07 +03:00
Bogdan Poplauschi 673fca9113 Documentation alignaments 2014-06-19 12:00:23 +03:00
Bogdan Poplauschi 939f68d27e Updated MKAnnotation view category documentation (forth param for the completion block) + alignaments 2014-06-19 11:55:02 +03:00
Bogdan Poplauschi 7108b4f404 Pass image URL in completion blocks - step 3:
- deprecated all UIButton(WebCache) `setImage*` methods. Replaced with `loadImage*` methods that use the `SDWebImageCompletionBlock` as completion block type
- created WebCacheDeprecated category on UIButton (to avoid collisions, we didn't name it Deprecated)
- replaced the usages of the deprecated items with the new ones
2014-06-19 11:49:27 +03:00
Bogdan Poplauschi 654a9c98ea Pass image URL in completion blocks - step 2:
- created block type `SDWebImageCompletionBlock` that contains NSURL* param
- deprecated all MKAnnotationView(WebCache) `setImage*` methods. Replaced with `loadImage*` methods that use the `SDWebImageCompletionBlock` as completion block type
- created WebCacheDeprecated category on MKAnnotationView (to avoid collisions, we didn't name it Deprecated)
- replaced the usages of the deprecated items with the new ones
2014-06-19 11:32:28 +03:00
Bogdan Poplauschi 233ef65f98 Pass image URL in completion blocks - step 1:
- deprecated block type `SDWebImageCompletedWithFinishedBlock`, replaced with `SDWebImageCompletionWithFinishedBlock` that contains NSURL* param
- deprecated SDWebImageManager `-downloadWithURL:options:progress:completed:` method. Replaced with `downloadImageWithURL:options:progress:completed:` that uses the `SDWebImageCompletionWithFinishedBlock ` as completion block type
- created Deprecated category for SDWebImageManager containing the old method
- replaced the usages of the deprecated items with the new ones
2014-06-19 11:10:38 +03:00
Bogdan Poplauschi 99b7a090f8 Missing new line 2014-06-19 10:51:55 +03:00
Bogdan Poplauschi a8f5627052 Added doc description for the NSData category 2014-06-19 10:36:13 +03:00
Bogdan Poplauschi dfceb49d2b Reordered categories in project file 2014-06-19 10:35:55 +03:00
Bogdan Poplauschi e4b9ef512b Fixed a warning in the demo project 2014-06-19 10:21:09 +03:00
Bogdan Poplauschi 455188355f Merge pull request #764 from n13/master
support for image orientation
2014-06-19 00:02:20 +03:00
Bogdan Poplauschi 9dcd68d5ee Merge pull request #751 from robertmryan/master
Avoid premature completion of prefetcher if request fails
2014-06-18 15:39:57 +03:00
Bogdan Poplauschi e4104942ee Return nil from SDScaledImageForKey if the input image is nil. Replaces #750. Fixes #365 2014-06-18 15:28:13 +03:00
Bogdan Poplauschi f6fdaeb6ae Merge pull request #766 from Whirlwind/origin_master
should not add url to failedURLs when timeout, cancel and so on. #707
2014-06-17 21:57:54 +03:00