Commit Graph

48 Commits

Author SHA1 Message Date
Bogdan Poplauschi 4c6eb5e72e OSX compatibility and target. (NSImage+WebCache) for UIImage compatibility
Clarified and simplified the usage of TARGET_OS_* macros. Added SD_MAC, SD_UIKIT, SD_IOS, SD_TV, SD_WATCH.
Updated Travis CI
2016-06-12 23:23:53 +03:00
Bogdan Poplauschi 3d122e550b WatchOS support - just added a target and the conditional compiling - seems to work (pod lib lint works).
There is an issue, the SDWebImage watchOS target doesn't show the simulator, only Generic Device.
Also need to add some demo and test code.
2016-06-10 08:49:51 +03:00
Bogdan Poplauschi 17d8690127 Merge branch '4.x' into gif
# Conflicts:
#	SDWebImage/MKAnnotationView+WebCache.h
#	SDWebImage/MKAnnotationView+WebCache.m
#	SDWebImage/SDImageCache.h
#	SDWebImage/SDImageCache.m
#	SDWebImage/SDWebImageManager.h
#	SDWebImage/SDWebImageManager.m
#	SDWebImage/UIButton+WebCache.h
#	SDWebImage/UIButton+WebCache.m
#	SDWebImage/UIImageView+HighlightedWebCache.h
#	SDWebImage/UIImageView+HighlightedWebCache.m
#	SDWebImage/UIImageView+WebCache.h
#	SDWebImage/UIImageView+WebCache.m
2016-06-07 12:42:26 +03:00
Bogdan Poplauschi 2064f28d2f Implemented Nullability according to https://developer.apple.com/swift/blog/?id=25. Decided to make explicit nullable and nonnull and not use NS_ASSUME_NONNULL_BEGIN so everything is clearer when read. Done so in the implementation files as well 2016-06-07 08:48:45 +03:00
Bogdan Poplauschi 67f943b0fa Implemented Lightweight Generics - both for Swift interoperability and for easier to read code 2016-06-07 08:42:52 +03:00
Bogdan Poplauschi 8f4a9dae2d For consistency with the previous change, also renamed `SDWebImageCompletionBlock` to `SDExternalCompletionBlock` 2016-06-01 09:41:44 +03:00
Bogdan Poplauschi aecb13d421 Extended the SDWebImageManager `loadImageWithURL:options:progress:completed:` so it also returns the NSData (we will need it later for the GIF images).
- had to add an NSData param to `SDWebImageCompletionWithFinishedBlock `, so to make it simpler see this change for users, renamed the block type to `SDInternalCompletionBlock`
- pass the NSData from the ImageCache or the Downloader
- updated all classes using this method with the new signature
2016-06-01 09:40:36 +03:00
Bogdan Poplauschi a32a1775c2 Renamed SDWebImageManager `downloadImageWithURL:options:progress:completed:` to `loadImageWithURL:options:progress:completed:` as it makes more sense, since we check the cache first and download only if needed
Conflicts:
	SDWebImage/UIImageView+WebCache.m
2016-05-08 21:16:23 +03:00
Bogdan Poplauschi 0384a059c4 Fixed #774 - remove deprecated methods. Since 4.0 is a major release, we don't need the backwards compatible methods
Conflicts:
	SDWebImage/UIImageView+WebCache.h
	SDWebImage/UIImageView+WebCache.m
2016-05-08 21:13:52 +03:00
liushuaikobe 47115e2593 If the sd_imageURL of the UIImageView or UIButton is nil, won't create a NSError Instance 2016-01-18 16:29:28 +08:00
muer2000 40ad58571b Fixed #1361 sd_cancelBackgroundImageLoadForState
Fixed sd_cancelBackgroundImageLoadForState in sd_setBackgroundImageWithURL method
2015-11-12 15:45:47 +08:00
Xenon 05ce156764 Added support for SDWebImageAvoidAutoSetImage option to UIButton and highlighted UIImageView 2015-09-23 04:23:11 +03:00
Bogdan Poplauschi d56c4f3d22 Merge pull request #1054 from heistings/develop
Use __typeof(self) when assigning weak reference for block.
2015-03-19 14:19:58 +02:00
Bogdan Poplauschi 0ef0e07f77 Merge pull request #1011 from mattjgalloway/error_domain
Make a constant for the error domain
2015-03-19 10:55:59 +02:00
Bogdan Poplauschi fd34a9a0fa Revert "Fixed #774 - remove deprecated methods. Since 4.0 is a major release, we don't need the backwards compatible methods"
This reverts commit 62a8ee1ab6.
2015-03-17 15:55:16 +02:00
庞博 f83abb578a Use __typeof(self) when assigning weak reference for block.
Signed-off-by: 庞博 <bopang@sohu-inc.com>
2015-03-06 16:37:38 +08:00
Matt Galloway 761b00553b Make a constant for the error domain 2015-01-13 19:34:05 +00:00
Bogdan Poplauschi 62a8ee1ab6 Fixed #774 - remove deprecated methods. Since 4.0 is a major release, we don't need the backwards compatible methods 2014-10-31 19:12:42 +02: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
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 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 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 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
Diego Chohfi f5d0ddc270 #761 fixing potential bug when sending a nil url for UIButton+WebCache 2014-06-16 11:46:19 -03:00
Klaas Pieter Annema 1ac6b92d9d Conform to coding style 2014-06-12 13:31:40 -04:00
Klaas Pieter Annema b9389350cb Store image URLs by state in the UIButton category 2014-06-12 13:31:40 -04:00
Klaas Pieter Annema 67ed774c0c Scratch that, this won't work on UIButton 2014-06-12 13:31:40 -04:00
Klaas Pieter Annema 825207d1d0 Add imageURL property to remaining categories 2014-06-12 13:31:40 -04:00
Fabrice Aneche 6dc02bd8f7 reformat code (appcode) 2014-01-06 17:12:24 -08:00
Olivier Poitrey 3a6d9481c9 Call handlers on the main thread synchronously to enhance responsivity (fix #462) 2013-08-07 21:07:59 -07:00
Olivier Poitrey c6664248f1 Ensure we always set the UIKit image properties from the main thread (fix #403, fix #417, fix #398) 2013-06-12 17:02:40 +02:00
Olivier Poitrey 82faab82d3 Do not capture self in operations in categories 2012-11-29 18:52:28 +01:00
Matej Bukovinski 2e8c02556a Passing the exact cache type in the completion block.
- none, disk and memory
- can still be used as a bool (if true there was a cache hit)
2012-11-19 15:55:09 +01:00
Olivier Poitrey 95be2aad35 Inline conditions are baaad 2012-11-06 18:28:14 +01:00
Olivier Poitrey b29bb2e2e1 Do not call completed block on categories for intermediate progressive images 2012-11-06 18:24:57 +01:00
Olivier Poitrey e5b0d22e64 Do not break category API (cf previous commit) 2012-11-06 18:22:18 +01:00
Olivier Poitrey 2904559f54 Fix progressive mode 2012-11-06 18:14:22 +01:00
Olivier Poitrey 2227266c41 First beta of SDWebImage 3.0
This version is a rewrite of the lib using iOS 5.0 as minimum target.
The lib as thus been refactored to use blocks/GCD from the ground up.
As a consequence, all delegate code style has been removed. The result
is a lot less lines of code and more flexibility.
2012-11-04 10:09:10 +01:00
Olivier Poitrey b734f289d0 Add a cached parameter to the success block to tell the receiver if the image came from cache or network #181 2012-09-07 23:00:50 +02:00
Olivier Poitrey 960674fce1 Fix typo (fix #123) 2012-05-14 18:28:38 +02:00
Olivier Poitrey 874f944d8e Add support for setBackgroundImage:* in UIButton category (fix #121) 2012-05-14 11:17:30 +02:00
Olivier Poitrey eff6cac284 Set placeholder on all UIButton stats (fix #120) 2012-05-14 10:32:26 +02:00
Olivier Poitrey ba71333e17 Add support for optional progressive downloading using ImageIO (fix #114)
Thanks to @Xenofex for his idea and implementation example
2012-05-09 22:33:28 +02:00
Olivier Poitrey dd5f15055d Move all source to a subdirectory to comply with XCode 4 standards 2012-05-09 12:37:35 +02:00