Skip to content

Commit 9b997fc

Browse files
authored
Merge pull request #14 from SDWebImage/fix_module_import
Fix the compatible issue when using the Static Library (CocoaPods) to install SDWebImage
2 parents af69c77 + 8141ce8 commit 9b997fc

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

.travis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: objective-c
2-
osx_image: xcode9.4
2+
osx_image: xcode11.2
33

44
env:
55
global:
@@ -15,10 +15,9 @@ notifications:
1515
before_install:
1616
- env
1717
- locale
18-
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
19-
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
18+
- gem install cocoapods --no-document --quiet
19+
- gem install xcpretty --no-document --quiet
2020
- pod --version
21-
- pod setup --silent > /dev/null
2221
- pod repo update --silent
2322
- xcpretty --version
2423
- xcodebuild -version
@@ -32,14 +31,14 @@ script:
3231

3332
- echo Build example
3433
- pod install --project-directory=Example
35-
- xcodebuild build -workspace Example/SDWebImagePhotosPlugin.xcworkspace -scheme SDWebImagePhotosPlugin-Example -sdk iphonesimulator -destination 'name=iPhone 8' ONLY_ACTIVE_ARCH=NO | xcpretty -c
34+
- xcodebuild build -workspace Example/SDWebImagePhotosPlugin.xcworkspace -scheme SDWebImagePhotosPlugin-Example -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug | xcpretty -c
3635

3736
- echo Clean DerivedData
37+
- rm -rf ~/Library/Developer/Xcode/DerivedData/
3838
- mkdir DerivedData
39-
- rm -rf ~/Library/Developer/Xcode/DerivedData
4039

4140
- echo Run the tests
42-
- xcodebuild test -workspace Example/SDWebImagePhotosPlugin.xcworkspace -scheme 'SDWebImagePhotosPlugin_Tests' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8' -configuration Debug | xcpretty -c
41+
- xcodebuild test -workspace Example/SDWebImagePhotosPlugin.xcworkspace -scheme 'SDWebImagePhotosPlugin_Tests' -destination 'platform=iOS Simulator,name=iPhone 11 Pro' -configuration Debug | xcpretty -c
4342
- mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
4443

4544
after_success:

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "SDWebImage/SDWebImage" "5.1.0"
1+
github "SDWebImage/SDWebImage" "5.4.0"

SDWebImagePhotosPlugin/Classes/SDImagePhotosLoader.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
* file that was distributed with this source code.
77
*/
88

9+
#if __has_include(<SDWebImage/SDWebImage.h>)
10+
#import <SDWebImage/SDWebImage.h>
11+
#else
912
@import SDWebImage;
10-
@import Photos;
13+
#endif
14+
#import <Photos/Photos.h>
1115

1216
/**
1317
The imgae loader to load image asset from Photos library. You need to register the loader into manager firstly. Use `@import SDWebImagePhotosPlugin` to import full framework instead of each header.

SDWebImagePhotosPlugin/Classes/SDWebImagePhotosDefine.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
* file that was distributed with this source code.
77
*/
88

9+
#if __has_include(<SDWebImage/SDWebImage.h>)
10+
#import <SDWebImage/SDWebImage.h>
11+
#else
912
@import SDWebImage;
13+
#endif
1014

1115
/**
1216
* The scheme when identifing the URL is Photos URL

0 commit comments

Comments
 (0)