├── .gitignore
├── FFLoopView iOS Demo
├── FFLoopView iOS Demo.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── FFLoopView iOS Demo.xcworkspace
│ └── contents.xcworkspacedata
├── FFLoopView iOS Demo
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── DemoSBViewController.swift
│ ├── DemoViewController.swift
│ ├── Info.plist
│ └── images
│ │ ├── 01.jpg
│ │ ├── 02.jpg
│ │ ├── 03.jpg
│ │ ├── 04.jpg
│ │ ├── 05.jpg
│ │ ├── 06.jpg
│ │ ├── 07.jpg
│ │ ├── 08.jpg
│ │ ├── 09.jpg
│ │ └── 10.jpg
├── Podfile
├── Podfile.lock
└── Pods
│ ├── FFLoopView
│ ├── FFLoopView
│ │ └── Source
│ │ │ ├── LoopView+Additions.swift
│ │ │ ├── LoopView.swift
│ │ │ └── PagingView.swift
│ ├── LICENSE
│ └── README.md
│ ├── Headers
│ └── Private
│ │ └── SDWebImage
│ │ ├── NSData+ImageContentType.h
│ │ ├── SDImageCache.h
│ │ ├── SDWebImageCompat.h
│ │ ├── SDWebImageDecoder.h
│ │ ├── SDWebImageDownloader.h
│ │ ├── SDWebImageDownloaderOperation.h
│ │ ├── SDWebImageManager.h
│ │ ├── SDWebImageOperation.h
│ │ ├── SDWebImagePrefetcher.h
│ │ ├── UIButton+WebCache.h
│ │ ├── UIImage+GIF.h
│ │ ├── UIImage+MultiFormat.h
│ │ ├── UIImageView+HighlightedWebCache.h
│ │ ├── UIImageView+WebCache.h
│ │ └── UIView+WebCacheOperation.h
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ └── project.pbxproj
│ ├── SDWebImage
│ ├── LICENSE
│ ├── README.md
│ └── SDWebImage
│ │ ├── NSData+ImageContentType.h
│ │ ├── NSData+ImageContentType.m
│ │ ├── SDImageCache.h
│ │ ├── SDImageCache.m
│ │ ├── SDWebImageCompat.h
│ │ ├── SDWebImageCompat.m
│ │ ├── SDWebImageDecoder.h
│ │ ├── SDWebImageDecoder.m
│ │ ├── SDWebImageDownloader.h
│ │ ├── SDWebImageDownloader.m
│ │ ├── SDWebImageDownloaderOperation.h
│ │ ├── SDWebImageDownloaderOperation.m
│ │ ├── SDWebImageManager.h
│ │ ├── SDWebImageManager.m
│ │ ├── SDWebImageOperation.h
│ │ ├── SDWebImagePrefetcher.h
│ │ ├── SDWebImagePrefetcher.m
│ │ ├── UIButton+WebCache.h
│ │ ├── UIButton+WebCache.m
│ │ ├── UIImage+GIF.h
│ │ ├── UIImage+GIF.m
│ │ ├── UIImage+MultiFormat.h
│ │ ├── UIImage+MultiFormat.m
│ │ ├── UIImageView+HighlightedWebCache.h
│ │ ├── UIImageView+HighlightedWebCache.m
│ │ ├── UIImageView+WebCache.h
│ │ ├── UIImageView+WebCache.m
│ │ ├── UIView+WebCacheOperation.h
│ │ └── UIView+WebCacheOperation.m
│ └── Target Support Files
│ ├── FFLoopView
│ ├── FFLoopView-dummy.m
│ ├── FFLoopView-prefix.pch
│ ├── FFLoopView-umbrella.h
│ ├── FFLoopView.modulemap
│ ├── FFLoopView.xcconfig
│ └── Info.plist
│ ├── Pods-FFLoopView iOS Demo
│ ├── Info.plist
│ ├── Pods-FFLoopView iOS Demo-acknowledgements.markdown
│ ├── Pods-FFLoopView iOS Demo-acknowledgements.plist
│ ├── Pods-FFLoopView iOS Demo-dummy.m
│ ├── Pods-FFLoopView iOS Demo-frameworks.sh
│ ├── Pods-FFLoopView iOS Demo-resources.sh
│ ├── Pods-FFLoopView iOS Demo-umbrella.h
│ ├── Pods-FFLoopView iOS Demo.debug.xcconfig
│ ├── Pods-FFLoopView iOS Demo.modulemap
│ └── Pods-FFLoopView iOS Demo.release.xcconfig
│ └── SDWebImage
│ ├── Info.plist
│ ├── SDWebImage-dummy.m
│ ├── SDWebImage-prefix.pch
│ ├── SDWebImage-umbrella.h
│ ├── SDWebImage.modulemap
│ └── SDWebImage.xcconfig
├── FFLoopView.podspec
├── FFLoopView
├── FFLoopView.xcodeproj
│ └── project.pbxproj
├── FFLoopView.xcworkspace
│ └── contents.xcworkspacedata
├── FFLoopView
│ ├── FFLoopView.h
│ └── Info.plist
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Headers
│ │ └── Private
│ │ │ └── SDWebImage
│ │ │ ├── NSData+ImageContentType.h
│ │ │ ├── SDImageCache.h
│ │ │ ├── SDWebImageCompat.h
│ │ │ ├── SDWebImageDecoder.h
│ │ │ ├── SDWebImageDownloader.h
│ │ │ ├── SDWebImageDownloaderOperation.h
│ │ │ ├── SDWebImageManager.h
│ │ │ ├── SDWebImageOperation.h
│ │ │ ├── SDWebImagePrefetcher.h
│ │ │ ├── UIButton+WebCache.h
│ │ │ ├── UIImage+GIF.h
│ │ │ ├── UIImage+MultiFormat.h
│ │ │ ├── UIImageView+HighlightedWebCache.h
│ │ │ ├── UIImageView+WebCache.h
│ │ │ └── UIView+WebCacheOperation.h
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ ├── SDWebImage
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── SDWebImage
│ │ │ ├── NSData+ImageContentType.h
│ │ │ ├── NSData+ImageContentType.m
│ │ │ ├── SDImageCache.h
│ │ │ ├── SDImageCache.m
│ │ │ ├── SDWebImageCompat.h
│ │ │ ├── SDWebImageCompat.m
│ │ │ ├── SDWebImageDecoder.h
│ │ │ ├── SDWebImageDecoder.m
│ │ │ ├── SDWebImageDownloader.h
│ │ │ ├── SDWebImageDownloader.m
│ │ │ ├── SDWebImageDownloaderOperation.h
│ │ │ ├── SDWebImageDownloaderOperation.m
│ │ │ ├── SDWebImageManager.h
│ │ │ ├── SDWebImageManager.m
│ │ │ ├── SDWebImageOperation.h
│ │ │ ├── SDWebImagePrefetcher.h
│ │ │ ├── SDWebImagePrefetcher.m
│ │ │ ├── UIButton+WebCache.h
│ │ │ ├── UIButton+WebCache.m
│ │ │ ├── UIImage+GIF.h
│ │ │ ├── UIImage+GIF.m
│ │ │ ├── UIImage+MultiFormat.h
│ │ │ ├── UIImage+MultiFormat.m
│ │ │ ├── UIImageView+HighlightedWebCache.h
│ │ │ ├── UIImageView+HighlightedWebCache.m
│ │ │ ├── UIImageView+WebCache.h
│ │ │ ├── UIImageView+WebCache.m
│ │ │ ├── UIView+WebCacheOperation.h
│ │ │ └── UIView+WebCacheOperation.m
│ └── Target Support Files
│ │ ├── Pods-FFLoopView
│ │ ├── Info.plist
│ │ ├── Pods-FFLoopView-acknowledgements.markdown
│ │ ├── Pods-FFLoopView-acknowledgements.plist
│ │ ├── Pods-FFLoopView-dummy.m
│ │ ├── Pods-FFLoopView-frameworks.sh
│ │ ├── Pods-FFLoopView-resources.sh
│ │ ├── Pods-FFLoopView-umbrella.h
│ │ ├── Pods-FFLoopView.debug.xcconfig
│ │ ├── Pods-FFLoopView.modulemap
│ │ └── Pods-FFLoopView.release.xcconfig
│ │ └── SDWebImage
│ │ ├── Info.plist
│ │ ├── SDWebImage-dummy.m
│ │ ├── SDWebImage-prefix.pch
│ │ ├── SDWebImage-umbrella.h
│ │ ├── SDWebImage.modulemap
│ │ └── SDWebImage.xcconfig
└── Source
│ ├── LoopView+Additions.swift
│ ├── LoopView.swift
│ └── PagingView.swift
├── LICENSE
├── README.md
└── screenshots
├── screenshots_1.png
├── screenshots_2.png
└── screenshots_3.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata
19 |
20 | ## Other
21 | *.xccheckout
22 | *.moved-aside
23 | *.xcuserstate
24 | *.xcscmblueprint
25 | *.xcscheme
26 |
27 | ## Obj-C/Swift specific
28 | *.hmap
29 | *.ipa
30 |
31 | # CocoaPods
32 | #
33 | # We recommend against adding the Pods directory to your .gitignore. However
34 | # you should judge for yourself, the pros and cons are mentioned at:
35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
36 | #
37 | # Pods/
38 |
39 | # Carthage
40 | #
41 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
42 | # Carthage/Checkouts
43 |
44 | Carthage/Build
45 |
46 | # fastlane
47 | #
48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
49 | # screenshots whenever they are needed.
50 | # For more information about the recommended setup visit:
51 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
52 |
53 | fastlane/report.xml
54 | fastlane/screenshots
55 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // FFLoopView iOS Demo
4 | //
5 | // Created by 刘凡 on 15/11/16.
6 | // Copyright © 2015年 joyios. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(application: UIApplication) {
23 | // 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.
24 | // 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.
25 | }
26 |
27 | func applicationDidEnterBackground(application: UIApplication) {
28 | // 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.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(application: UIApplication) {
33 | // 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.
34 | }
35 |
36 | func applicationDidBecomeActive(application: UIApplication) {
37 | // 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.
38 | }
39 |
40 | func applicationWillTerminate(application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "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 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/DemoSBViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DemoSBViewController.swift
3 | // FFLoopView iOS Demo
4 | //
5 | // Created by 刘凡 on 15/11/15.
6 | // Copyright © 2015年 joyios. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import FFLoopView
11 |
12 | private var typeValue = 0
13 |
14 | class DemoSBViewController: UIViewController {
15 |
16 | @IBOutlet weak var loopView1: LoopView!
17 | @IBOutlet weak var loopView2: LoopView!
18 |
19 | override func viewDidLoad() {
20 | super.viewDidLoad()
21 |
22 | // 创建数据数组
23 | var urls = [NSURL]()
24 | var tips = [String]()
25 | for i in 1...5 {
26 | let fileName = String(format: "%02d.jpg", i)
27 | urls.append(NSBundle.mainBundle().URLForResource(fileName, withExtension: nil)!)
28 |
29 | tips.append("提示信息 --- \(i)")
30 | }
31 |
32 | loopView1.tipViewPosition = .Split
33 | loopView1.tipView.backgroundColor = UIColor.brownColor()
34 | loopView1.tipLabel.font = UIFont.systemFontOfSize(18)
35 | loopView1.pagingViewPosition = .Center
36 | loopView1.pagingView.pagingType = .SmallDot
37 | loopView1.showImages(urls, tips: tips) { [weak self] index in
38 | print("选中了第 \(index) 张图像 \(self?.view)")
39 | }
40 |
41 | loopView2.pagingView.pagingType = .Clock
42 | loopView2.showImages(urls, tips: tips) { [weak self] index in
43 | print("选中了第 \(index) 张图像 \(self?.view)")
44 | }
45 | }
46 |
47 | override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) {
48 |
49 | loopView1.relayoutView()
50 | loopView2.relayoutView()
51 | }
52 |
53 | @IBAction func changePagingView() {
54 | loopView2.pagingView.pagingType = PagingViewType(rawValue: typeValue++ % 3)!
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/DemoViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DemoViewController.swift
3 | // FFLoopView iOS Demo
4 | //
5 | // Created by 刘凡 on 15/11/15.
6 | // Copyright © 2015年 joyios. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import FFLoopView
11 |
12 | class DemoViewController: UIViewController {
13 |
14 | private var loopView: LoopView?
15 |
16 | override func viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | prepareLoopView()
20 | }
21 |
22 | private func prepareLoopView() {
23 |
24 | // 1. 添加控件
25 | loopView = LoopView()
26 | view.addSubview(loopView!)
27 |
28 | // 2. 自动布局
29 | for v in view.subviews {
30 | v.translatesAutoresizingMaskIntoConstraints = false
31 | }
32 |
33 | let views: [String : AnyObject] = ["loopView": loopView!, "topLayoutGuide": topLayoutGuide]
34 | view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[loopView]-0-|",
35 | options: [],
36 | metrics: nil,
37 | views: views))
38 | view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[topLayoutGuide]-0-[loopView(160)]",
39 | options: [],
40 | metrics: nil,
41 | views: views))
42 |
43 | // 3. 创建数据数组
44 | var urls = [NSURL]()
45 | var tips = [String]()
46 | for i in 1...5 {
47 | let fileName = String(format: "%02d.jpg", i)
48 | urls.append(NSBundle.mainBundle().URLForResource(fileName, withExtension: nil)!)
49 |
50 | tips.append("提示信息 --- \(i)")
51 | }
52 |
53 | loopView?.showImages(urls, tips: tips) { [weak self] index in
54 | print("选中了第 \(index) 张图像 \(self?.view)")
55 | }
56 | }
57 |
58 | override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) {
59 |
60 | loopView?.relayoutView()
61 | }
62 |
63 | @IBAction func removeLoopView() {
64 | loopView?.removeFromSuperview()
65 | loopView?.stopTimer()
66 |
67 | loopView = nil
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/01.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/02.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/03.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/04.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/05.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/06.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/06.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/07.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/07.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/08.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/08.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/09.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/09.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/FFLoopView iOS Demo/images/10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/FFLoopView iOS Demo/FFLoopView iOS Demo/images/10.jpg
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '8.0'
2 | use_frameworks!
3 |
4 | target 'FFLoopView iOS Demo' do
5 | pod 'FFLoopView'
6 | end
7 |
8 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - FFLoopView (1.0.2):
3 | - SDWebImage
4 | - SDWebImage (3.7.3):
5 | - SDWebImage/Core (= 3.7.3)
6 | - SDWebImage/Core (3.7.3)
7 |
8 | DEPENDENCIES:
9 | - FFLoopView
10 |
11 | SPEC CHECKSUMS:
12 | FFLoopView: 064c6cfd249d2e28eb9123f3fdd0202ebd833a67
13 | SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84
14 |
15 | COCOAPODS: 0.39.0
16 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/FFLoopView/FFLoopView/Source/LoopView+Additions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LoopView+Additions.swift
3 | // FFLoopView
4 | //
5 | // Created by 刘凡 on 15/11/16.
6 | // Copyright © 2015年 joyios. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | // MARK: - UIView extension
12 | extension UIView {
13 |
14 | /// 取消所有子视图的 autoresizing 属性
15 | func disableSubviewsAutoresizing() {
16 | for v in subviews {
17 | v.translatesAutoresizingMaskIntoConstraints = false
18 | }
19 | }
20 | }
21 |
22 | // MARK: - NSLayoutConstraint extension
23 | extension NSLayoutConstraint {
24 |
25 | /// 建立约束数组
26 | ///
27 | /// - parameter formats: VLF 数组
28 | /// - parameter views: views 字典
29 | ///
30 | /// - returns: 约束数组
31 | class func constraints(formats: [String], views: [String: AnyObject]) -> [NSLayoutConstraint] {
32 |
33 | var cons = [NSLayoutConstraint]()
34 |
35 | for format in formats {
36 | cons += NSLayoutConstraint.constraintsWithVisualFormat(format, options: [], metrics: nil, views: views)
37 | }
38 |
39 | return cons
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/FFLoopView/FFLoopView/Source/PagingView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PagingView.swift
3 | // FFLoopView
4 | //
5 | // Created by 刘凡 on 15/11/16.
6 | // Copyright © 2015年 joyios. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// 分页视图类型
12 | ///
13 | /// - Text: 文本,适合任意个数的分页显示
14 | /// - SmallDot: 小点,适合 5 个以内的分页显示
15 | /// - Clock: 时钟,适合 4~12 个左右的分页显示
16 | public enum PagingViewType: Int {
17 | case Text
18 | case SmallDot
19 | case Clock
20 | }
21 |
22 | /// 页面半径
23 | private let SmallDotPageRadius: CGFloat = 1
24 | /// 当前页面半径
25 | private let SmallDotCurrentPageRadius: CGFloat = 2
26 |
27 | /// 分页视图
28 | public class PagingView: UIView {
29 |
30 | // MARK: 公共属性
31 | /// 分页视图类型
32 | public var pagingType: PagingViewType = .Text {
33 | didSet {
34 | setNeedsDisplay()
35 | hiddenLabels()
36 | }
37 | }
38 |
39 | /// 总页数
40 | public var numberOfPages: Int = 0 {
41 | didSet {
42 | pageLabel.text = "\(numberOfPages)"
43 |
44 | hiddenLabels()
45 | }
46 | }
47 | /// 当前页数
48 | public var currentPage: Int = 0 {
49 | didSet {
50 | setNeedsDisplay()
51 | currentPageLabel.text = "\(currentPage + 1)"
52 | hiddenLabels()
53 | }
54 | }
55 | /// 单页时隐藏
56 | public var hidesForSinglePage: Bool = true
57 | /// 其他页号标示颜色
58 | public var pageIndicatorTintColor: UIColor?
59 | /// 当前页标示颜色
60 | public var currentPageIndicatorTintColor: UIColor?
61 |
62 | // MARK: 公共函数
63 | /// 设置外观
64 | ///
65 | /// - parameter labelFont: 分页标签字体
66 | /// - parameter labelColor: 分页标签颜色
67 | /// - parameter currentFont: 当前分页标签字体
68 | /// - parameter currentColor: 当前分页标签颜色
69 | public func setupAppearance(labelFont: UIFont, labelColor: UIColor, currentFont: UIFont, currentColor: UIColor) {
70 |
71 | pageLabel.font = labelFont
72 | sepLabel.font = labelFont
73 | currentPageLabel.font = currentFont
74 |
75 | pageLabel.textColor = labelColor
76 | sepLabel.textColor = labelColor
77 | currentPageLabel.textColor = currentColor
78 |
79 | pageLabel.sizeToFit()
80 | sepLabel.sizeToFit()
81 | currentPageLabel.sizeToFit()
82 | }
83 |
84 | // MARK: 构造函数
85 | override init(frame: CGRect) {
86 | super.init(frame: frame)
87 |
88 | prepareUI()
89 | }
90 |
91 | required public init?(coder aDecoder: NSCoder) {
92 | fatalError("init(coder:) has not been implemented")
93 | }
94 |
95 | // MARK: 私有控件
96 | /// 总页数标签
97 | private lazy var pageLabel = UILabel()
98 | /// 当前页标签
99 | private lazy var currentPageLabel = UILabel()
100 | /// 分割线标签
101 | private lazy var sepLabel = UILabel()
102 | }
103 |
104 | // MARK: - 绘制视图
105 | extension PagingView {
106 |
107 | public override func drawRect(rect: CGRect) {
108 |
109 | // 条件检测
110 | if numberOfPages <= 0 {
111 | return
112 | }
113 | if numberOfPages == 1 && hidesForSinglePage {
114 | return
115 | }
116 |
117 | switch pagingType {
118 | case .SmallDot: drawSmallDot(rect)
119 | case .Clock: drawClock(rect)
120 | case .Text: break
121 | }
122 | }
123 |
124 | private func drawClock(rect: CGRect) {
125 | let center = CGPoint(x: rect.width * 0.5, y: rect.height * 0.5)
126 | let r = min(rect.width, rect.height) * 0.5
127 |
128 | // 中心点
129 | let centerPath = UIBezierPath(ovalInRect: centerRect(center, radius: 1.2))
130 |
131 | // 总页数
132 | let pagePath = UIBezierPath()
133 | pagePath.moveToPoint(center)
134 | pagePath.addLineToPoint(CGPoint(x: center.x, y: center.y - r * 0.6))
135 |
136 | pageIndicatorTintColor?.set()
137 | centerPath.fill()
138 | pagePath.stroke()
139 |
140 | // 当前页数
141 | let currentPagePath = UIBezierPath()
142 | currentPagePath.moveToPoint(center)
143 | let angle = CGFloat(Double(currentPage + 1) / Double(numberOfPages) * M_PI * 2 - M_PI_2)
144 | let x = center.x + r * cos(angle) * 0.8
145 | let y = center.y + r * sin(angle) * 0.8
146 | currentPagePath.addLineToPoint(CGPoint(x: x, y: y))
147 |
148 | currentPageIndicatorTintColor?.set()
149 | currentPagePath.stroke()
150 | }
151 |
152 | private func drawSmallDot(rect: CGRect) {
153 | let width = rect.width
154 | let step = width / CGFloat(numberOfPages + 1)
155 | let y = rect.height * 0.5
156 | var x = step
157 |
158 | for i in 0.. CGRect {
173 | let rect = CGRect(origin: center, size: CGSizeZero)
174 |
175 | return CGRectInset(rect, -radius, -radius)
176 | }
177 | }
178 |
179 | // MARK: - 设置视图
180 | private extension PagingView {
181 |
182 | /// 隐藏标签
183 | private func hiddenLabels() {
184 | let isShow = (pagingType == .Text) && numberOfPages > 1 && hidesForSinglePage
185 |
186 | pageLabel.hidden = !isShow
187 | currentPageLabel.hidden = !isShow
188 | sepLabel.hidden = !isShow
189 | }
190 |
191 | /// 准备界面
192 | private func prepareUI() {
193 | backgroundColor = UIColor.clearColor()
194 |
195 | currentPageLabel.text = "10"
196 | sepLabel.text = "/"
197 | pageLabel.text = "99"
198 |
199 | addSubview(currentPageLabel)
200 | addSubview(sepLabel)
201 | addSubview(pageLabel)
202 |
203 | setupAppearance(UIFont.systemFontOfSize(10),
204 | labelColor: UIColor.whiteColor(),
205 | currentFont: UIFont.systemFontOfSize(14),
206 | currentColor: UIColor.yellowColor())
207 |
208 | disableSubviewsAutoresizing()
209 |
210 | addConstraint(NSLayoutConstraint(item: sepLabel,
211 | attribute: .CenterX,
212 | relatedBy: .Equal,
213 | toItem: self,
214 | attribute: .CenterX,
215 | multiplier: 1.0,
216 | constant: 0.0))
217 | addConstraint(NSLayoutConstraint(item: currentPageLabel,
218 | attribute: .Right,
219 | relatedBy: .Equal,
220 | toItem: sepLabel,
221 | attribute: .Left,
222 | multiplier: 1.0,
223 | constant: 0.0))
224 | addConstraint(NSLayoutConstraint(item: pageLabel,
225 | attribute: .Left,
226 | relatedBy: .Equal,
227 | toItem: sepLabel,
228 | attribute: .Right,
229 | multiplier: 1.0,
230 | constant: 0.0))
231 |
232 | addConstraint(NSLayoutConstraint(item: sepLabel,
233 | attribute: .CenterY,
234 | relatedBy: .Equal,
235 | toItem: self,
236 | attribute: .CenterY,
237 | multiplier: 1.0,
238 | constant: 0.0))
239 | addConstraint(NSLayoutConstraint(item: currentPageLabel,
240 | attribute: .Baseline,
241 | relatedBy: .Equal,
242 | toItem: sepLabel,
243 | attribute: .Baseline,
244 | multiplier: 1.0,
245 | constant: 0.0))
246 | addConstraint(NSLayoutConstraint(item: pageLabel,
247 | attribute: .Baseline,
248 | relatedBy: .Equal,
249 | toItem: sepLabel,
250 | attribute: .Baseline,
251 | multiplier: 1.0,
252 | constant: 0.0))
253 | }
254 | }
255 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/FFLoopView/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Fan Liu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/FFLoopView/README.md:
--------------------------------------------------------------------------------
1 | # FFLoopView
2 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/SDImageCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCache.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/SDWebImageManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - FFLoopView (1.0.2):
3 | - SDWebImage
4 | - SDWebImage (3.7.3):
5 | - SDWebImage/Core (= 3.7.3)
6 | - SDWebImage/Core (3.7.3)
7 |
8 | DEPENDENCIES:
9 | - FFLoopView
10 |
11 | SPEC CHECKSUMS:
12 | FFLoopView: 064c6cfd249d2e28eb9123f3fdd0202ebd833a67
13 | SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84
14 |
15 | COCOAPODS: 0.39.0
16 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 Olivier Poitrey
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is furnished
8 | to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Fabrice Aneche on 06/01/14.
3 | // Copyright (c) 2014 Dailymotion. All rights reserved.
4 | //
5 |
6 | #import
7 |
8 | @interface NSData (ImageContentType)
9 |
10 | /**
11 | * Compute the content type for an image data
12 | *
13 | * @param data the input data
14 | *
15 | * @return the content type as string (i.e. image/jpeg, image/gif)
16 | */
17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data;
18 |
19 | @end
20 |
21 |
22 | @interface NSData (ImageContentTypeDeprecated)
23 |
24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`");
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Fabrice Aneche on 06/01/14.
3 | // Copyright (c) 2014 Dailymotion. All rights reserved.
4 | //
5 |
6 | #import "NSData+ImageContentType.h"
7 |
8 |
9 | @implementation NSData (ImageContentType)
10 |
11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data {
12 | uint8_t c;
13 | [data getBytes:&c length:1];
14 | switch (c) {
15 | case 0xFF:
16 | return @"image/jpeg";
17 | case 0x89:
18 | return @"image/png";
19 | case 0x47:
20 | return @"image/gif";
21 | case 0x49:
22 | case 0x4D:
23 | return @"image/tiff";
24 | case 0x52:
25 | // R as RIFF for WEBP
26 | if ([data length] < 12) {
27 | return nil;
28 | }
29 |
30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];
31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {
32 | return @"image/webp";
33 | }
34 |
35 | return nil;
36 | }
37 | return nil;
38 | }
39 |
40 | @end
41 |
42 |
43 | @implementation NSData (ImageContentTypeDeprecated)
44 |
45 | + (NSString *)contentTypeForImageData:(NSData *)data {
46 | return [self sd_contentTypeForImageData:data];
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Jamie Pinkham
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import
11 |
12 | #ifdef __OBJC_GC__
13 | #error SDWebImage does not support Objective-C Garbage Collection
14 | #endif
15 |
16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0
17 | #error SDWebImage doesn't support Deployement Target version < 5.0
18 | #endif
19 |
20 | #if !TARGET_OS_IPHONE
21 | #import
22 | #ifndef UIImage
23 | #define UIImage NSImage
24 | #endif
25 | #ifndef UIImageView
26 | #define UIImageView NSImageView
27 | #endif
28 | #else
29 |
30 | #import
31 |
32 | #endif
33 |
34 | #ifndef NS_ENUM
35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
36 | #endif
37 |
38 | #ifndef NS_OPTIONS
39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
40 | #endif
41 |
42 | #if OS_OBJECT_USE_OBJC
43 | #undef SDDispatchQueueRelease
44 | #undef SDDispatchQueueSetterSementics
45 | #define SDDispatchQueueRelease(q)
46 | #define SDDispatchQueueSetterSementics strong
47 | #else
48 | #undef SDDispatchQueueRelease
49 | #undef SDDispatchQueueSetterSementics
50 | #define SDDispatchQueueRelease(q) (dispatch_release(q))
51 | #define SDDispatchQueueSetterSementics assign
52 | #endif
53 |
54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image);
55 |
56 | typedef void(^SDWebImageNoParamsBlock)();
57 |
58 | extern NSString *const SDWebImageErrorDomain;
59 |
60 | #define dispatch_main_sync_safe(block)\
61 | if ([NSThread isMainThread]) {\
62 | block();\
63 | } else {\
64 | dispatch_sync(dispatch_get_main_queue(), block);\
65 | }
66 |
67 | #define dispatch_main_async_safe(block)\
68 | if ([NSThread isMainThread]) {\
69 | block();\
70 | } else {\
71 | dispatch_async(dispatch_get_main_queue(), block);\
72 | }
73 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDWebImageCompat.m
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 11/12/12.
6 | // Copyright (c) 2012 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if !__has_feature(objc_arc)
12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
13 | #endif
14 |
15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) {
16 | if (!image) {
17 | return nil;
18 | }
19 |
20 | if ([image.images count] > 0) {
21 | NSMutableArray *scaledImages = [NSMutableArray array];
22 |
23 | for (UIImage *tempImage in image.images) {
24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)];
25 | }
26 |
27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration];
28 | }
29 | else {
30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
31 | CGFloat scale = 1.0;
32 | if (key.length >= 8) {
33 | NSRange range = [key rangeOfString:@"@2x."];
34 | if (range.location != NSNotFound) {
35 | scale = 2.0;
36 | }
37 |
38 | range = [key rangeOfString:@"@3x."];
39 | if (range.location != NSNotFound) {
40 | scale = 3.0;
41 | }
42 | }
43 |
44 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
45 | image = scaledImage;
46 | }
47 | return image;
48 | }
49 | }
50 |
51 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain";
52 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * Created by james on 9/28/11.
6 | *
7 | * For the full copyright and license information, please view the LICENSE
8 | * file that was distributed with this source code.
9 | */
10 |
11 | #import
12 | #import "SDWebImageCompat.h"
13 |
14 | @interface UIImage (ForceDecode)
15 |
16 | + (UIImage *)decodedImageWithImage:(UIImage *)image;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * Created by james on 9/28/11.
6 | *
7 | * For the full copyright and license information, please view the LICENSE
8 | * file that was distributed with this source code.
9 | */
10 |
11 | #import "SDWebImageDecoder.h"
12 |
13 | @implementation UIImage (ForceDecode)
14 |
15 | + (UIImage *)decodedImageWithImage:(UIImage *)image {
16 | if (image.images) {
17 | // Do not decode animated images
18 | return image;
19 | }
20 |
21 | CGImageRef imageRef = image.CGImage;
22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef));
23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize};
24 |
25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
27 |
28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask);
29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone ||
30 | infoMask == kCGImageAlphaNoneSkipFirst ||
31 | infoMask == kCGImageAlphaNoneSkipLast);
32 |
33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB.
34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html
35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) {
36 | // Unset the old alpha info.
37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask;
38 |
39 | // Set noneSkipFirst.
40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst;
41 | }
42 | // Some PNGs tell us they have alpha but only 3 components. Odd.
43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) {
44 | // Unset the old alpha info.
45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask;
46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst;
47 | }
48 |
49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments.
50 | CGContextRef context = CGBitmapContextCreate(NULL,
51 | imageSize.width,
52 | imageSize.height,
53 | CGImageGetBitsPerComponent(imageRef),
54 | 0,
55 | colorSpace,
56 | bitmapInfo);
57 | CGColorSpaceRelease(colorSpace);
58 |
59 | // If failed, return undecompressed image
60 | if (!context) return image;
61 |
62 | CGContextDrawImage(context, imageRect, imageRef);
63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context);
64 |
65 | CGContextRelease(context);
66 |
67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation];
68 | CGImageRelease(decompressedImageRef);
69 | return decompressedImage;
70 | }
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCompat.h"
11 | #import "SDWebImageOperation.h"
12 |
13 | typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) {
14 | SDWebImageDownloaderLowPriority = 1 << 0,
15 | SDWebImageDownloaderProgressiveDownload = 1 << 1,
16 |
17 | /**
18 | * By default, request prevent the of NSURLCache. With this flag, NSURLCache
19 | * is used with default policies.
20 | */
21 | SDWebImageDownloaderUseNSURLCache = 1 << 2,
22 |
23 | /**
24 | * Call completion block with nil image/imageData if the image was read from NSURLCache
25 | * (to be combined with `SDWebImageDownloaderUseNSURLCache`).
26 | */
27 |
28 | SDWebImageDownloaderIgnoreCachedResponse = 1 << 3,
29 | /**
30 | * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for
31 | * extra time in background to let the request finish. If the background task expires the operation will be cancelled.
32 | */
33 |
34 | SDWebImageDownloaderContinueInBackground = 1 << 4,
35 |
36 | /**
37 | * Handles cookies stored in NSHTTPCookieStore by setting
38 | * NSMutableURLRequest.HTTPShouldHandleCookies = YES;
39 | */
40 | SDWebImageDownloaderHandleCookies = 1 << 5,
41 |
42 | /**
43 | * Enable to allow untrusted SSL ceriticates.
44 | * Useful for testing purposes. Use with caution in production.
45 | */
46 | SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6,
47 |
48 | /**
49 | * Put the image in the high priority queue.
50 | */
51 | SDWebImageDownloaderHighPriority = 1 << 7,
52 | };
53 |
54 | typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) {
55 | /**
56 | * Default value. All download operations will execute in queue style (first-in-first-out).
57 | */
58 | SDWebImageDownloaderFIFOExecutionOrder,
59 |
60 | /**
61 | * All download operations will execute in stack style (last-in-first-out).
62 | */
63 | SDWebImageDownloaderLIFOExecutionOrder
64 | };
65 |
66 | extern NSString *const SDWebImageDownloadStartNotification;
67 | extern NSString *const SDWebImageDownloadStopNotification;
68 |
69 | typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize);
70 |
71 | typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage *image, NSData *data, NSError *error, BOOL finished);
72 |
73 | typedef NSDictionary *(^SDWebImageDownloaderHeadersFilterBlock)(NSURL *url, NSDictionary *headers);
74 |
75 | /**
76 | * Asynchronous downloader dedicated and optimized for image loading.
77 | */
78 | @interface SDWebImageDownloader : NSObject
79 |
80 | /**
81 | * Decompressing images that are downloaded and cached can improve peformance but can consume lot of memory.
82 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption.
83 | */
84 | @property (assign, nonatomic) BOOL shouldDecompressImages;
85 |
86 | @property (assign, nonatomic) NSInteger maxConcurrentDownloads;
87 |
88 | /**
89 | * Shows the current amount of downloads that still need to be downloaded
90 | */
91 | @property (readonly, nonatomic) NSUInteger currentDownloadCount;
92 |
93 |
94 | /**
95 | * The timeout value (in seconds) for the download operation. Default: 15.0.
96 | */
97 | @property (assign, nonatomic) NSTimeInterval downloadTimeout;
98 |
99 |
100 | /**
101 | * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`.
102 | */
103 | @property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder;
104 |
105 | /**
106 | * Singleton method, returns the shared instance
107 | *
108 | * @return global shared instance of downloader class
109 | */
110 | + (SDWebImageDownloader *)sharedDownloader;
111 |
112 | /**
113 | * Set username
114 | */
115 | @property (strong, nonatomic) NSString *username;
116 |
117 | /**
118 | * Set password
119 | */
120 | @property (strong, nonatomic) NSString *password;
121 |
122 | /**
123 | * Set filter to pick headers for downloading image HTTP request.
124 | *
125 | * This block will be invoked for each downloading image request, returned
126 | * NSDictionary will be used as headers in corresponding HTTP request.
127 | */
128 | @property (nonatomic, copy) SDWebImageDownloaderHeadersFilterBlock headersFilter;
129 |
130 | /**
131 | * Set a value for a HTTP header to be appended to each download HTTP request.
132 | *
133 | * @param value The value for the header field. Use `nil` value to remove the header.
134 | * @param field The name of the header field to set.
135 | */
136 | - (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field;
137 |
138 | /**
139 | * Returns the value of the specified HTTP header field.
140 | *
141 | * @return The value associated with the header field field, or `nil` if there is no corresponding header field.
142 | */
143 | - (NSString *)valueForHTTPHeaderField:(NSString *)field;
144 |
145 | /**
146 | * Sets a subclass of `SDWebImageDownloaderOperation` as the default
147 | * `NSOperation` to be used each time SDWebImage constructs a request
148 | * operation to download an image.
149 | *
150 | * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set
151 | * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`.
152 | */
153 | - (void)setOperationClass:(Class)operationClass;
154 |
155 | /**
156 | * Creates a SDWebImageDownloader async downloader instance with a given URL
157 | *
158 | * The delegate will be informed when the image is finish downloaded or an error has happen.
159 | *
160 | * @see SDWebImageDownloaderDelegate
161 | *
162 | * @param url The URL to the image to download
163 | * @param options The options to be used for this download
164 | * @param progressBlock A block called repeatedly while the image is downloading
165 | * @param completedBlock A block called once the download is completed.
166 | * If the download succeeded, the image parameter is set, in case of error,
167 | * error parameter is set with the error. The last parameter is always YES
168 | * if SDWebImageDownloaderProgressiveDownload isn't use. With the
169 | * SDWebImageDownloaderProgressiveDownload option, this block is called
170 | * repeatedly with the partial image object and the finished argument set to NO
171 | * before to be called a last time with the full image and finished argument
172 | * set to YES. In case of error, the finished argument is always YES.
173 | *
174 | * @return A cancellable SDWebImageOperation
175 | */
176 | - (id )downloadImageWithURL:(NSURL *)url
177 | options:(SDWebImageDownloaderOptions)options
178 | progress:(SDWebImageDownloaderProgressBlock)progressBlock
179 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock;
180 |
181 | /**
182 | * Sets the download queue suspension state
183 | */
184 | - (void)setSuspended:(BOOL)suspended;
185 |
186 | @end
187 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageDownloader.h"
11 | #import "SDWebImageOperation.h"
12 |
13 | extern NSString *const SDWebImageDownloadStartNotification;
14 | extern NSString *const SDWebImageDownloadReceiveResponseNotification;
15 | extern NSString *const SDWebImageDownloadStopNotification;
16 | extern NSString *const SDWebImageDownloadFinishNotification;
17 |
18 | @interface SDWebImageDownloaderOperation : NSOperation
19 |
20 | /**
21 | * The request used by the operation's connection.
22 | */
23 | @property (strong, nonatomic, readonly) NSURLRequest *request;
24 |
25 |
26 | @property (assign, nonatomic) BOOL shouldDecompressImages;
27 |
28 | /**
29 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default.
30 | *
31 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`.
32 | */
33 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage;
34 |
35 | /**
36 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`.
37 | *
38 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present.
39 | */
40 | @property (nonatomic, strong) NSURLCredential *credential;
41 |
42 | /**
43 | * The SDWebImageDownloaderOptions for the receiver.
44 | */
45 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options;
46 |
47 | /**
48 | * The expected size of data.
49 | */
50 | @property (assign, nonatomic) NSInteger expectedSize;
51 |
52 | /**
53 | * The response returned by the operation's connection.
54 | */
55 | @property (strong, nonatomic) NSURLResponse *response;
56 |
57 | /**
58 | * Initializes a `SDWebImageDownloaderOperation` object
59 | *
60 | * @see SDWebImageDownloaderOperation
61 | *
62 | * @param request the URL request
63 | * @param options downloader options
64 | * @param progressBlock the block executed when a new chunk of data arrives.
65 | * @note the progress block is executed on a background queue
66 | * @param completedBlock the block executed when the download is done.
67 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue
68 | * @param cancelBlock the block executed if the download (operation) is cancelled
69 | *
70 | * @return the initialized instance
71 | */
72 | - (id)initWithRequest:(NSURLRequest *)request
73 | options:(SDWebImageDownloaderOptions)options
74 | progress:(SDWebImageDownloaderProgressBlock)progressBlock
75 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock
76 | cancelled:(SDWebImageNoParamsBlock)cancelBlock;
77 |
78 | @end
79 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 |
11 | @protocol SDWebImageOperation
12 |
13 | - (void)cancel;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageManager.h"
11 |
12 | @class SDWebImagePrefetcher;
13 |
14 | @protocol SDWebImagePrefetcherDelegate
15 |
16 | @optional
17 |
18 | /**
19 | * Called when an image was prefetched.
20 | *
21 | * @param imagePrefetcher The current image prefetcher
22 | * @param imageURL The image url that was prefetched
23 | * @param finishedCount The total number of images that were prefetched (successful or not)
24 | * @param totalCount The total number of images that were to be prefetched
25 | */
26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount;
27 |
28 | /**
29 | * Called when all images are prefetched.
30 | * @param imagePrefetcher The current image prefetcher
31 | * @param totalCount The total number of images that were prefetched (whether successful or not)
32 | * @param skippedCount The total number of images that were skipped
33 | */
34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount;
35 |
36 | @end
37 |
38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls);
39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls);
40 |
41 | /**
42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority.
43 | */
44 | @interface SDWebImagePrefetcher : NSObject
45 |
46 | /**
47 | * The web image manager
48 | */
49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager;
50 |
51 | /**
52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3.
53 | */
54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads;
55 |
56 | /**
57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority.
58 | */
59 | @property (nonatomic, assign) SDWebImageOptions options;
60 |
61 | /**
62 | * Queue options for Prefetcher. Defaults to Main Queue.
63 | */
64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue;
65 |
66 | @property (weak, nonatomic) id delegate;
67 |
68 | /**
69 | * Return the global image prefetcher instance.
70 | */
71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher;
72 |
73 | /**
74 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
75 | * currently one image is downloaded at a time,
76 | * and skips images for failed downloads and proceed to the next image in the list
77 | *
78 | * @param urls list of URLs to prefetch
79 | */
80 | - (void)prefetchURLs:(NSArray *)urls;
81 |
82 | /**
83 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
84 | * currently one image is downloaded at a time,
85 | * and skips images for failed downloads and proceed to the next image in the list
86 | *
87 | * @param urls list of URLs to prefetch
88 | * @param progressBlock block to be called when progress updates;
89 | * first parameter is the number of completed (successful or not) requests,
90 | * second parameter is the total number of images originally requested to be prefetched
91 | * @param completionBlock block to be called when prefetching is completed
92 | * first param is the number of completed (successful or not) requests,
93 | * second parameter is the number of skipped requests
94 | */
95 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock;
96 |
97 | /**
98 | * Remove and cancel queued list
99 | */
100 | - (void)cancelPrefetching;
101 |
102 |
103 | @end
104 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImagePrefetcher.h"
10 |
11 | #if (!defined(DEBUG) && !defined (SD_VERBOSE)) || defined(SD_LOG_NONE)
12 | #define NSLog(...)
13 | #endif
14 |
15 | @interface SDWebImagePrefetcher ()
16 |
17 | @property (strong, nonatomic) SDWebImageManager *manager;
18 | @property (strong, nonatomic) NSArray *prefetchURLs;
19 | @property (assign, nonatomic) NSUInteger requestedCount;
20 | @property (assign, nonatomic) NSUInteger skippedCount;
21 | @property (assign, nonatomic) NSUInteger finishedCount;
22 | @property (assign, nonatomic) NSTimeInterval startedTime;
23 | @property (copy, nonatomic) SDWebImagePrefetcherCompletionBlock completionBlock;
24 | @property (copy, nonatomic) SDWebImagePrefetcherProgressBlock progressBlock;
25 |
26 | @end
27 |
28 | @implementation SDWebImagePrefetcher
29 |
30 | + (SDWebImagePrefetcher *)sharedImagePrefetcher {
31 | static dispatch_once_t once;
32 | static id instance;
33 | dispatch_once(&once, ^{
34 | instance = [self new];
35 | });
36 | return instance;
37 | }
38 |
39 | - (id)init {
40 | if ((self = [super init])) {
41 | _manager = [SDWebImageManager new];
42 | _options = SDWebImageLowPriority;
43 | _prefetcherQueue = dispatch_get_main_queue();
44 | self.maxConcurrentDownloads = 3;
45 | }
46 | return self;
47 | }
48 |
49 | - (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads {
50 | self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads;
51 | }
52 |
53 | - (NSUInteger)maxConcurrentDownloads {
54 | return self.manager.imageDownloader.maxConcurrentDownloads;
55 | }
56 |
57 | - (void)startPrefetchingAtIndex:(NSUInteger)index {
58 | if (index >= self.prefetchURLs.count) return;
59 | self.requestedCount++;
60 | [self.manager downloadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
61 | if (!finished) return;
62 | self.finishedCount++;
63 |
64 | if (image) {
65 | if (self.progressBlock) {
66 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
67 | }
68 | NSLog(@"Prefetched %@ out of %@", @(self.finishedCount), @(self.prefetchURLs.count));
69 | }
70 | else {
71 | if (self.progressBlock) {
72 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
73 | }
74 | NSLog(@"Prefetched %@ out of %@ (Failed)", @(self.finishedCount), @(self.prefetchURLs.count));
75 |
76 | // Add last failed
77 | self.skippedCount++;
78 | }
79 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) {
80 | [self.delegate imagePrefetcher:self
81 | didPrefetchURL:self.prefetchURLs[index]
82 | finishedCount:self.finishedCount
83 | totalCount:self.prefetchURLs.count
84 | ];
85 | }
86 | if (self.prefetchURLs.count > self.requestedCount) {
87 | dispatch_async(self.prefetcherQueue, ^{
88 | [self startPrefetchingAtIndex:self.requestedCount];
89 | });
90 | }
91 | else if (self.finishedCount == self.requestedCount) {
92 | [self reportStatus];
93 | if (self.completionBlock) {
94 | self.completionBlock(self.finishedCount, self.skippedCount);
95 | self.completionBlock = nil;
96 | }
97 | self.progressBlock = nil;
98 | }
99 | }];
100 | }
101 |
102 | - (void)reportStatus {
103 | NSUInteger total = [self.prefetchURLs count];
104 | NSLog(@"Finished prefetching (%@ successful, %@ skipped, timeElasped %.2f)", @(total - self.skippedCount), @(self.skippedCount), CFAbsoluteTimeGetCurrent() - self.startedTime);
105 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) {
106 | [self.delegate imagePrefetcher:self
107 | didFinishWithTotalCount:(total - self.skippedCount)
108 | skippedCount:self.skippedCount
109 | ];
110 | }
111 | }
112 |
113 | - (void)prefetchURLs:(NSArray *)urls {
114 | [self prefetchURLs:urls progress:nil completed:nil];
115 | }
116 |
117 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock {
118 | [self cancelPrefetching]; // Prevent duplicate prefetch request
119 | self.startedTime = CFAbsoluteTimeGetCurrent();
120 | self.prefetchURLs = urls;
121 | self.completionBlock = completionBlock;
122 | self.progressBlock = progressBlock;
123 |
124 | if(urls.count == 0){
125 | if(completionBlock){
126 | completionBlock(0,0);
127 | }
128 | }else{
129 | // Starts prefetching from the very first image on the list with the max allowed concurrency
130 | NSUInteger listCount = self.prefetchURLs.count;
131 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) {
132 | [self startPrefetchingAtIndex:i];
133 | }
134 | }
135 | }
136 |
137 | - (void)cancelPrefetching {
138 | self.prefetchURLs = nil;
139 | self.skippedCount = 0;
140 | self.requestedCount = 0;
141 | self.finishedCount = 0;
142 | [self.manager cancelAll];
143 | }
144 |
145 | @end
146 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+GIF.h
3 | // LBGIFImage
4 | //
5 | // Created by Laurin Brandner on 06.01.12.
6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (GIF)
12 |
13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name;
14 |
15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data;
16 |
17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/UIImage+GIF.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+GIF.m
3 | // LBGIFImage
4 | //
5 | // Created by Laurin Brandner on 06.01.12.
6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "UIImage+GIF.h"
10 | #import
11 |
12 | @implementation UIImage (GIF)
13 |
14 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data {
15 | if (!data) {
16 | return nil;
17 | }
18 |
19 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
20 |
21 | size_t count = CGImageSourceGetCount(source);
22 |
23 | UIImage *animatedImage;
24 |
25 | if (count <= 1) {
26 | animatedImage = [[UIImage alloc] initWithData:data];
27 | }
28 | else {
29 | NSMutableArray *images = [NSMutableArray array];
30 |
31 | NSTimeInterval duration = 0.0f;
32 |
33 | for (size_t i = 0; i < count; i++) {
34 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
35 |
36 | duration += [self sd_frameDurationAtIndex:i source:source];
37 |
38 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]];
39 |
40 | CGImageRelease(image);
41 | }
42 |
43 | if (!duration) {
44 | duration = (1.0f / 10.0f) * count;
45 | }
46 |
47 | animatedImage = [UIImage animatedImageWithImages:images duration:duration];
48 | }
49 |
50 | CFRelease(source);
51 |
52 | return animatedImage;
53 | }
54 |
55 | + (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
56 | float frameDuration = 0.1f;
57 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
58 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
59 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary];
60 |
61 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime];
62 | if (delayTimeUnclampedProp) {
63 | frameDuration = [delayTimeUnclampedProp floatValue];
64 | }
65 | else {
66 |
67 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime];
68 | if (delayTimeProp) {
69 | frameDuration = [delayTimeProp floatValue];
70 | }
71 | }
72 |
73 | // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
74 | // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
75 | // a duration of <= 10 ms. See and
76 | // for more information.
77 |
78 | if (frameDuration < 0.011f) {
79 | frameDuration = 0.100f;
80 | }
81 |
82 | CFRelease(cfFrameProperties);
83 | return frameDuration;
84 | }
85 |
86 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name {
87 | CGFloat scale = [UIScreen mainScreen].scale;
88 |
89 | if (scale > 1.0f) {
90 | NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"];
91 |
92 | NSData *data = [NSData dataWithContentsOfFile:retinaPath];
93 |
94 | if (data) {
95 | return [UIImage sd_animatedGIFWithData:data];
96 | }
97 |
98 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"];
99 |
100 | data = [NSData dataWithContentsOfFile:path];
101 |
102 | if (data) {
103 | return [UIImage sd_animatedGIFWithData:data];
104 | }
105 |
106 | return [UIImage imageNamed:name];
107 | }
108 | else {
109 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"];
110 |
111 | NSData *data = [NSData dataWithContentsOfFile:path];
112 |
113 | if (data) {
114 | return [UIImage sd_animatedGIFWithData:data];
115 | }
116 |
117 | return [UIImage imageNamed:name];
118 | }
119 | }
120 |
121 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size {
122 | if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) {
123 | return self;
124 | }
125 |
126 | CGSize scaledSize = size;
127 | CGPoint thumbnailPoint = CGPointZero;
128 |
129 | CGFloat widthFactor = size.width / self.size.width;
130 | CGFloat heightFactor = size.height / self.size.height;
131 | CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor;
132 | scaledSize.width = self.size.width * scaleFactor;
133 | scaledSize.height = self.size.height * scaleFactor;
134 |
135 | if (widthFactor > heightFactor) {
136 | thumbnailPoint.y = (size.height - scaledSize.height) * 0.5;
137 | }
138 | else if (widthFactor < heightFactor) {
139 | thumbnailPoint.x = (size.width - scaledSize.width) * 0.5;
140 | }
141 |
142 | NSMutableArray *scaledImages = [NSMutableArray array];
143 |
144 | UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
145 |
146 | for (UIImage *image in self.images) {
147 | [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)];
148 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
149 |
150 | [scaledImages addObject:newImage];
151 | }
152 |
153 | UIGraphicsEndImageContext();
154 |
155 | return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
156 | }
157 |
158 | @end
159 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+MultiFormat.h
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 07/06/13.
6 | // Copyright (c) 2013 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (MultiFormat)
12 |
13 | + (UIImage *)sd_imageWithData:(NSData *)data;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+MultiFormat.m
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 07/06/13.
6 | // Copyright (c) 2013 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import "UIImage+MultiFormat.h"
10 | #import "UIImage+GIF.h"
11 | #import "NSData+ImageContentType.h"
12 | #import
13 |
14 | #ifdef SD_WEBP
15 | #import "UIImage+WebP.h"
16 | #endif
17 |
18 | @implementation UIImage (MultiFormat)
19 |
20 | + (UIImage *)sd_imageWithData:(NSData *)data {
21 | if (!data) {
22 | return nil;
23 | }
24 |
25 | UIImage *image;
26 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data];
27 | if ([imageContentType isEqualToString:@"image/gif"]) {
28 | image = [UIImage sd_animatedGIFWithData:data];
29 | }
30 | #ifdef SD_WEBP
31 | else if ([imageContentType isEqualToString:@"image/webp"])
32 | {
33 | image = [UIImage sd_imageWithWebPData:data];
34 | }
35 | #endif
36 | else {
37 | image = [[UIImage alloc] initWithData:data];
38 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data];
39 | if (orientation != UIImageOrientationUp) {
40 | image = [UIImage imageWithCGImage:image.CGImage
41 | scale:image.scale
42 | orientation:orientation];
43 | }
44 | }
45 |
46 |
47 | return image;
48 | }
49 |
50 |
51 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData {
52 | UIImageOrientation result = UIImageOrientationUp;
53 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);
54 | if (imageSource) {
55 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL);
56 | if (properties) {
57 | CFTypeRef val;
58 | int exifOrientation;
59 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation);
60 | if (val) {
61 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation);
62 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation];
63 | } // else - if it's not set it remains at up
64 | CFRelease((CFTypeRef) properties);
65 | } else {
66 | //NSLog(@"NO PROPERTIES, FAIL");
67 | }
68 | CFRelease(imageSource);
69 | }
70 | return result;
71 | }
72 |
73 | #pragma mark EXIF orientation tag converter
74 | // Convert an EXIF image orientation to an iOS one.
75 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html
76 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation {
77 | UIImageOrientation orientation = UIImageOrientationUp;
78 | switch (exifOrientation) {
79 | case 1:
80 | orientation = UIImageOrientationUp;
81 | break;
82 |
83 | case 3:
84 | orientation = UIImageOrientationDown;
85 | break;
86 |
87 | case 8:
88 | orientation = UIImageOrientationLeft;
89 | break;
90 |
91 | case 6:
92 | orientation = UIImageOrientationRight;
93 | break;
94 |
95 | case 2:
96 | orientation = UIImageOrientationUpMirrored;
97 | break;
98 |
99 | case 4:
100 | orientation = UIImageOrientationDownMirrored;
101 | break;
102 |
103 | case 5:
104 | orientation = UIImageOrientationLeftMirrored;
105 | break;
106 |
107 | case 7:
108 | orientation = UIImageOrientationRightMirrored;
109 | break;
110 | default:
111 | break;
112 | }
113 | return orientation;
114 | }
115 |
116 |
117 |
118 | @end
119 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCompat.h"
11 | #import "SDWebImageManager.h"
12 |
13 | /**
14 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state.
15 | */
16 | @interface UIImageView (HighlightedWebCache)
17 |
18 | /**
19 | * Set the imageView `highlightedImage` with an `url`.
20 | *
21 | * The download is asynchronous and cached.
22 | *
23 | * @param url The url for the image.
24 | */
25 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url;
26 |
27 | /**
28 | * Set the imageView `highlightedImage` with an `url` and custom options.
29 | *
30 | * The download is asynchronous and cached.
31 | *
32 | * @param url The url for the image.
33 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
34 | */
35 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options;
36 |
37 | /**
38 | * Set the imageView `highlightedImage` with an `url`.
39 | *
40 | * The download is asynchronous and cached.
41 | *
42 | * @param url The url for the image.
43 | * @param completedBlock A block called when operation has been completed. This block has no return value
44 | * and takes the requested UIImage as first parameter. In case of error the image parameter
45 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
46 | * indicating if the image was retrived from the local cache or from the network.
47 | * The fourth parameter is the original image url.
48 | */
49 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock;
50 |
51 | /**
52 | * Set the imageView `highlightedImage` with an `url` and custom options.
53 | *
54 | * The download is asynchronous and cached.
55 | *
56 | * @param url The url for the image.
57 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
58 | * @param completedBlock A block called when operation has been completed. This block has no return value
59 | * and takes the requested UIImage as first parameter. In case of error the image parameter
60 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
61 | * indicating if the image was retrived from the local cache or from the network.
62 | * The fourth parameter is the original image url.
63 | */
64 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock;
65 |
66 | /**
67 | * Set the imageView `highlightedImage` with an `url` and custom options.
68 | *
69 | * The download is asynchronous and cached.
70 | *
71 | * @param url The url for the image.
72 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
73 | * @param progressBlock A block called while image is downloading
74 | * @param completedBlock A block called when operation has been completed. This block has no return value
75 | * and takes the requested UIImage as first parameter. In case of error the image parameter
76 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
77 | * indicating if the image was retrived from the local cache or from the network.
78 | * The fourth parameter is the original image url.
79 | */
80 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock;
81 |
82 | /**
83 | * Cancel the current download
84 | */
85 | - (void)sd_cancelCurrentHighlightedImageLoad;
86 |
87 | @end
88 |
89 |
90 | @interface UIImageView (HighlightedWebCacheDeprecated)
91 |
92 | - (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`");
93 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`");
94 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`");
95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`");
96 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`");
97 |
98 | - (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`");
99 |
100 | @end
101 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIImageView+HighlightedWebCache.h"
10 | #import "UIView+WebCacheOperation.h"
11 |
12 | #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage"
13 |
14 | @implementation UIImageView (HighlightedWebCache)
15 |
16 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url {
17 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil];
18 | }
19 |
20 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options {
21 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil];
22 | }
23 |
24 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock {
25 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock];
26 | }
27 |
28 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock {
29 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock];
30 | }
31 |
32 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock {
33 | [self sd_cancelCurrentHighlightedImageLoad];
34 |
35 | if (url) {
36 | __weak __typeof(self)wself = self;
37 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
38 | if (!wself) return;
39 | dispatch_main_sync_safe (^
40 | {
41 | if (!wself) return;
42 | if (image) {
43 | wself.highlightedImage = image;
44 | [wself setNeedsLayout];
45 | }
46 | if (completedBlock && finished) {
47 | completedBlock(image, error, cacheType, url);
48 | }
49 | });
50 | }];
51 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey];
52 | } else {
53 | dispatch_main_async_safe(^{
54 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
55 | if (completedBlock) {
56 | completedBlock(nil, error, SDImageCacheTypeNone, url);
57 | }
58 | });
59 | }
60 | }
61 |
62 | - (void)sd_cancelCurrentHighlightedImageLoad {
63 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey];
64 | }
65 |
66 | @end
67 |
68 |
69 | @implementation UIImageView (HighlightedWebCacheDeprecated)
70 |
71 | - (void)setHighlightedImageWithURL:(NSURL *)url {
72 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil];
73 | }
74 |
75 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options {
76 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil];
77 | }
78 |
79 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock {
80 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
81 | if (completedBlock) {
82 | completedBlock(image, error, cacheType);
83 | }
84 | }];
85 | }
86 |
87 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
88 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
89 | if (completedBlock) {
90 | completedBlock(image, error, cacheType);
91 | }
92 | }];
93 | }
94 |
95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock {
96 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
97 | if (completedBlock) {
98 | completedBlock(image, error, cacheType);
99 | }
100 | }];
101 | }
102 |
103 | - (void)cancelCurrentHighlightedImageLoad {
104 | [self sd_cancelCurrentHighlightedImageLoad];
105 | }
106 |
107 | @end
108 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageManager.h"
11 |
12 | @interface UIView (WebCacheOperation)
13 |
14 | /**
15 | * Set the image load operation (storage in a UIView based dictionary)
16 | *
17 | * @param operation the operation
18 | * @param key key for storing the operation
19 | */
20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key;
21 |
22 | /**
23 | * Cancel all operations for the current UIView and key
24 | *
25 | * @param key key for identifying the operations
26 | */
27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key;
28 |
29 | /**
30 | * Just remove the operations corresponding to the current UIView and key without cancelling them
31 | *
32 | * @param key key for identifying the operations
33 | */
34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIView+WebCacheOperation.h"
10 | #import "objc/runtime.h"
11 |
12 | static char loadOperationKey;
13 |
14 | @implementation UIView (WebCacheOperation)
15 |
16 | - (NSMutableDictionary *)operationDictionary {
17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey);
18 | if (operations) {
19 | return operations;
20 | }
21 | operations = [NSMutableDictionary dictionary];
22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
23 | return operations;
24 | }
25 |
26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key {
27 | [self sd_cancelImageLoadOperationWithKey:key];
28 | NSMutableDictionary *operationDictionary = [self operationDictionary];
29 | [operationDictionary setObject:operation forKey:key];
30 | }
31 |
32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key {
33 | // Cancel in progress downloader from queue
34 | NSMutableDictionary *operationDictionary = [self operationDictionary];
35 | id operations = [operationDictionary objectForKey:key];
36 | if (operations) {
37 | if ([operations isKindOfClass:[NSArray class]]) {
38 | for (id operation in operations) {
39 | if (operation) {
40 | [operation cancel];
41 | }
42 | }
43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){
44 | [(id) operations cancel];
45 | }
46 | [operationDictionary removeObjectForKey:key];
47 | }
48 | }
49 |
50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key {
51 | NSMutableDictionary *operationDictionary = [self operationDictionary];
52 | [operationDictionary removeObjectForKey:key];
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/FFLoopView/FFLoopView-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_FFLoopView : NSObject
3 | @end
4 | @implementation PodsDummy_FFLoopView
5 | @end
6 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/FFLoopView/FFLoopView-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/FFLoopView/FFLoopView-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double FFLoopViewVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char FFLoopViewVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/FFLoopView/FFLoopView.modulemap:
--------------------------------------------------------------------------------
1 | framework module FFLoopView {
2 | umbrella header "FFLoopView-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/FFLoopView/FFLoopView.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FFLoopView" "${PODS_ROOT}/Headers/Public"
3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
4 | PODS_ROOT = ${SRCROOT}
5 | SKIP_INSTALL = YES
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/FFLoopView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.2
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## FFLoopView
5 |
6 | The MIT License (MIT)
7 |
8 | Copyright (c) 2015 Fan Liu
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 |
28 |
29 |
30 | ## SDWebImage
31 |
32 | Copyright (c) 2009 Olivier Poitrey
33 |
34 | Permission is hereby granted, free of charge, to any person obtaining a copy
35 | of this software and associated documentation files (the "Software"), to deal
36 | in the Software without restriction, including without limitation the rights
37 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
38 | copies of the Software, and to permit persons to whom the Software is furnished
39 | to do so, subject to the following conditions:
40 |
41 | The above copyright notice and this permission notice shall be included in all
42 | copies or substantial portions of the Software.
43 |
44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
48 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
49 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
50 | THE SOFTWARE.
51 |
52 |
53 | Generated by CocoaPods - http://cocoapods.org
54 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | The MIT License (MIT)
18 |
19 | Copyright (c) 2015 Fan Liu
20 |
21 | Permission is hereby granted, free of charge, to any person obtaining a copy
22 | of this software and associated documentation files (the "Software"), to deal
23 | in the Software without restriction, including without limitation the rights
24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 | copies of the Software, and to permit persons to whom the Software is
26 | furnished to do so, subject to the following conditions:
27 |
28 | The above copyright notice and this permission notice shall be included in all
29 | copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37 | SOFTWARE.
38 |
39 |
40 | Title
41 | FFLoopView
42 | Type
43 | PSGroupSpecifier
44 |
45 |
46 | FooterText
47 | Copyright (c) 2009 Olivier Poitrey <rs@dailymotion.com>
48 |
49 | Permission is hereby granted, free of charge, to any person obtaining a copy
50 | of this software and associated documentation files (the "Software"), to deal
51 | in the Software without restriction, including without limitation the rights
52 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53 | copies of the Software, and to permit persons to whom the Software is furnished
54 | to do so, subject to the following conditions:
55 |
56 | The above copyright notice and this permission notice shall be included in all
57 | copies or substantial portions of the Software.
58 |
59 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
65 | THE SOFTWARE.
66 |
67 |
68 | Title
69 | SDWebImage
70 | Type
71 | PSGroupSpecifier
72 |
73 |
74 | FooterText
75 | Generated by CocoaPods - http://cocoapods.org
76 | Title
77 |
78 | Type
79 | PSGroupSpecifier
80 |
81 |
82 | StringsTable
83 | Acknowledgements
84 | Title
85 | Acknowledgements
86 |
87 |
88 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_FFLoopView_iOS_Demo : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_FFLoopView_iOS_Demo
5 | @end
6 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
64 | fi
65 | }
66 |
67 | # Strip invalid architectures
68 | strip_invalid_archs() {
69 | binary="$1"
70 | # Get architectures for current file
71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
72 | stripped=""
73 | for arch in $archs; do
74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
75 | # Strip non-valid architectures in-place
76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
77 | stripped="$stripped $arch"
78 | fi
79 | done
80 | if [[ "$stripped" ]]; then
81 | echo "Stripped $binary of architectures:$stripped"
82 | fi
83 | }
84 |
85 |
86 | if [[ "$CONFIGURATION" == "Debug" ]]; then
87 | install_framework "Pods-FFLoopView iOS Demo/FFLoopView.framework"
88 | install_framework "Pods-FFLoopView iOS Demo/SDWebImage.framework"
89 | fi
90 | if [[ "$CONFIGURATION" == "Release" ]]; then
91 | install_framework "Pods-FFLoopView iOS Demo/FFLoopView.framework"
92 | install_framework "Pods-FFLoopView iOS Demo/SDWebImage.framework"
93 | fi
94 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | realpath() {
12 | DIRECTORY="$(cd "${1%/*}" && pwd)"
13 | FILENAME="${1##*/}"
14 | echo "$DIRECTORY/$FILENAME"
15 | }
16 |
17 | install_resource()
18 | {
19 | case $1 in
20 | *.storyboard)
21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
23 | ;;
24 | *.xib)
25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
27 | ;;
28 | *.framework)
29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
33 | ;;
34 | *.xcdatamodel)
35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
37 | ;;
38 | *.xcdatamodeld)
39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
41 | ;;
42 | *.xcmappingmodel)
43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
45 | ;;
46 | *.xcassets)
47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
49 | ;;
50 | /*)
51 | echo "$1"
52 | echo "$1" >> "$RESOURCES_TO_COPY"
53 | ;;
54 | *)
55 | echo "${PODS_ROOT}/$1"
56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
57 | ;;
58 | esac
59 | }
60 |
61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
66 | fi
67 | rm -f "$RESOURCES_TO_COPY"
68 |
69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
70 | then
71 | case "${TARGETED_DEVICE_FAMILY}" in
72 | 1,2)
73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
74 | ;;
75 | 1)
76 | TARGET_DEVICE_ARGS="--target-device iphone"
77 | ;;
78 | 2)
79 | TARGET_DEVICE_ARGS="--target-device ipad"
80 | ;;
81 | *)
82 | TARGET_DEVICE_ARGS="--target-device mac"
83 | ;;
84 | esac
85 |
86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
88 | while read line; do
89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
90 | XCASSET_FILES+=("$line")
91 | fi
92 | done <<<"$OTHER_XCASSETS"
93 |
94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
95 | fi
96 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double Pods_FFLoopView_iOS_DemoVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char Pods_FFLoopView_iOS_DemoVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo.debug.xcconfig:
--------------------------------------------------------------------------------
1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/FFLoopView.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "FFLoopView" -framework "SDWebImage"
6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-FFLoopView iOS Demo
8 | PODS_ROOT = ${SRCROOT}/Pods
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_FFLoopView_iOS_Demo {
2 | umbrella header "Pods-FFLoopView iOS Demo-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/Pods-FFLoopView iOS Demo/Pods-FFLoopView iOS Demo.release.xcconfig:
--------------------------------------------------------------------------------
1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/FFLoopView.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "FFLoopView" -framework "SDWebImage"
6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-FFLoopView iOS Demo
8 | PODS_ROOT = ${SRCROOT}/Pods
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/SDWebImage/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.7.3
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SDWebImage : NSObject
3 | @end
4 | @implementation PodsDummy_SDWebImage
5 | @end
6 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "NSData+ImageContentType.h"
4 | #import "SDImageCache.h"
5 | #import "SDWebImageCompat.h"
6 | #import "SDWebImageDecoder.h"
7 | #import "SDWebImageDownloader.h"
8 | #import "SDWebImageDownloaderOperation.h"
9 | #import "SDWebImageManager.h"
10 | #import "SDWebImageOperation.h"
11 | #import "SDWebImagePrefetcher.h"
12 | #import "UIButton+WebCache.h"
13 | #import "UIImage+GIF.h"
14 | #import "UIImage+MultiFormat.h"
15 | #import "UIImageView+HighlightedWebCache.h"
16 | #import "UIImageView+WebCache.h"
17 | #import "UIView+WebCacheOperation.h"
18 |
19 | FOUNDATION_EXPORT double SDWebImageVersionNumber;
20 | FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[];
21 |
22 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap:
--------------------------------------------------------------------------------
1 | framework module SDWebImage {
2 | umbrella header "SDWebImage-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/FFLoopView iOS Demo/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public"
3 | OTHER_LDFLAGS = -framework "ImageIO"
4 | PODS_ROOT = ${SRCROOT}
5 | SKIP_INSTALL = YES
--------------------------------------------------------------------------------
/FFLoopView.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "FFLoopView"
3 | s.version = "1.0.2"
4 | s.summary = "Simple images loop view in Swift with custom paging view"
5 | s.homepage = "https://github.com/liufan321/FFLoopView"
6 | s.license = "MIT"
7 | s.author = { "Fan Liu" => "liufan321@gmail.com" }
8 | s.platform = :ios, "8.0"
9 | s.source = { :git => "https://github.com/liufan321/FFLoopView.git", :tag => s.version }
10 | s.source_files = "FFLoopView", "FFLoopView/Source/*.swift"
11 | s.requires_arc = true
12 | s.dependency "SDWebImage"
13 | end
14 |
--------------------------------------------------------------------------------
/FFLoopView/FFLoopView.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/FFLoopView/FFLoopView/FFLoopView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FFLoopView.h
3 | // FFLoopView
4 | //
5 | // Created by 刘凡 on 15/11/15.
6 | // Copyright © 2015年 joyios. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for FFLoopView.
12 | FOUNDATION_EXPORT double FFLoopViewVersionNumber;
13 |
14 | //! Project version string for FFLoopView.
15 | FOUNDATION_EXPORT const unsigned char FFLoopViewVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/FFLoopView/FFLoopView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/FFLoopView/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '8.0'
2 | use_frameworks!
3 |
4 | target 'FFLoopView' do
5 | pod 'SDWebImage'
6 | end
7 |
8 |
--------------------------------------------------------------------------------
/FFLoopView/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SDWebImage (3.7.3):
3 | - SDWebImage/Core (= 3.7.3)
4 | - SDWebImage/Core (3.7.3)
5 |
6 | DEPENDENCIES:
7 | - SDWebImage
8 |
9 | SPEC CHECKSUMS:
10 | SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84
11 |
12 | COCOAPODS: 0.39.0
13 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/SDImageCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCache.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/SDWebImageManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h
--------------------------------------------------------------------------------
/FFLoopView/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SDWebImage (3.7.3):
3 | - SDWebImage/Core (= 3.7.3)
4 | - SDWebImage/Core (3.7.3)
5 |
6 | DEPENDENCIES:
7 | - SDWebImage
8 |
9 | SPEC CHECKSUMS:
10 | SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84
11 |
12 | COCOAPODS: 0.39.0
13 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 Olivier Poitrey
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is furnished
8 | to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Fabrice Aneche on 06/01/14.
3 | // Copyright (c) 2014 Dailymotion. All rights reserved.
4 | //
5 |
6 | #import
7 |
8 | @interface NSData (ImageContentType)
9 |
10 | /**
11 | * Compute the content type for an image data
12 | *
13 | * @param data the input data
14 | *
15 | * @return the content type as string (i.e. image/jpeg, image/gif)
16 | */
17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data;
18 |
19 | @end
20 |
21 |
22 | @interface NSData (ImageContentTypeDeprecated)
23 |
24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`");
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Fabrice Aneche on 06/01/14.
3 | // Copyright (c) 2014 Dailymotion. All rights reserved.
4 | //
5 |
6 | #import "NSData+ImageContentType.h"
7 |
8 |
9 | @implementation NSData (ImageContentType)
10 |
11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data {
12 | uint8_t c;
13 | [data getBytes:&c length:1];
14 | switch (c) {
15 | case 0xFF:
16 | return @"image/jpeg";
17 | case 0x89:
18 | return @"image/png";
19 | case 0x47:
20 | return @"image/gif";
21 | case 0x49:
22 | case 0x4D:
23 | return @"image/tiff";
24 | case 0x52:
25 | // R as RIFF for WEBP
26 | if ([data length] < 12) {
27 | return nil;
28 | }
29 |
30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];
31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {
32 | return @"image/webp";
33 | }
34 |
35 | return nil;
36 | }
37 | return nil;
38 | }
39 |
40 | @end
41 |
42 |
43 | @implementation NSData (ImageContentTypeDeprecated)
44 |
45 | + (NSString *)contentTypeForImageData:(NSData *)data {
46 | return [self sd_contentTypeForImageData:data];
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Jamie Pinkham
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import
11 |
12 | #ifdef __OBJC_GC__
13 | #error SDWebImage does not support Objective-C Garbage Collection
14 | #endif
15 |
16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0
17 | #error SDWebImage doesn't support Deployement Target version < 5.0
18 | #endif
19 |
20 | #if !TARGET_OS_IPHONE
21 | #import
22 | #ifndef UIImage
23 | #define UIImage NSImage
24 | #endif
25 | #ifndef UIImageView
26 | #define UIImageView NSImageView
27 | #endif
28 | #else
29 |
30 | #import
31 |
32 | #endif
33 |
34 | #ifndef NS_ENUM
35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
36 | #endif
37 |
38 | #ifndef NS_OPTIONS
39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
40 | #endif
41 |
42 | #if OS_OBJECT_USE_OBJC
43 | #undef SDDispatchQueueRelease
44 | #undef SDDispatchQueueSetterSementics
45 | #define SDDispatchQueueRelease(q)
46 | #define SDDispatchQueueSetterSementics strong
47 | #else
48 | #undef SDDispatchQueueRelease
49 | #undef SDDispatchQueueSetterSementics
50 | #define SDDispatchQueueRelease(q) (dispatch_release(q))
51 | #define SDDispatchQueueSetterSementics assign
52 | #endif
53 |
54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image);
55 |
56 | typedef void(^SDWebImageNoParamsBlock)();
57 |
58 | extern NSString *const SDWebImageErrorDomain;
59 |
60 | #define dispatch_main_sync_safe(block)\
61 | if ([NSThread isMainThread]) {\
62 | block();\
63 | } else {\
64 | dispatch_sync(dispatch_get_main_queue(), block);\
65 | }
66 |
67 | #define dispatch_main_async_safe(block)\
68 | if ([NSThread isMainThread]) {\
69 | block();\
70 | } else {\
71 | dispatch_async(dispatch_get_main_queue(), block);\
72 | }
73 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDWebImageCompat.m
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 11/12/12.
6 | // Copyright (c) 2012 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if !__has_feature(objc_arc)
12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
13 | #endif
14 |
15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) {
16 | if (!image) {
17 | return nil;
18 | }
19 |
20 | if ([image.images count] > 0) {
21 | NSMutableArray *scaledImages = [NSMutableArray array];
22 |
23 | for (UIImage *tempImage in image.images) {
24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)];
25 | }
26 |
27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration];
28 | }
29 | else {
30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
31 | CGFloat scale = 1.0;
32 | if (key.length >= 8) {
33 | NSRange range = [key rangeOfString:@"@2x."];
34 | if (range.location != NSNotFound) {
35 | scale = 2.0;
36 | }
37 |
38 | range = [key rangeOfString:@"@3x."];
39 | if (range.location != NSNotFound) {
40 | scale = 3.0;
41 | }
42 | }
43 |
44 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
45 | image = scaledImage;
46 | }
47 | return image;
48 | }
49 | }
50 |
51 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain";
52 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * Created by james on 9/28/11.
6 | *
7 | * For the full copyright and license information, please view the LICENSE
8 | * file that was distributed with this source code.
9 | */
10 |
11 | #import
12 | #import "SDWebImageCompat.h"
13 |
14 | @interface UIImage (ForceDecode)
15 |
16 | + (UIImage *)decodedImageWithImage:(UIImage *)image;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * Created by james on 9/28/11.
6 | *
7 | * For the full copyright and license information, please view the LICENSE
8 | * file that was distributed with this source code.
9 | */
10 |
11 | #import "SDWebImageDecoder.h"
12 |
13 | @implementation UIImage (ForceDecode)
14 |
15 | + (UIImage *)decodedImageWithImage:(UIImage *)image {
16 | if (image.images) {
17 | // Do not decode animated images
18 | return image;
19 | }
20 |
21 | CGImageRef imageRef = image.CGImage;
22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef));
23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize};
24 |
25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
27 |
28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask);
29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone ||
30 | infoMask == kCGImageAlphaNoneSkipFirst ||
31 | infoMask == kCGImageAlphaNoneSkipLast);
32 |
33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB.
34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html
35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) {
36 | // Unset the old alpha info.
37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask;
38 |
39 | // Set noneSkipFirst.
40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst;
41 | }
42 | // Some PNGs tell us they have alpha but only 3 components. Odd.
43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) {
44 | // Unset the old alpha info.
45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask;
46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst;
47 | }
48 |
49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments.
50 | CGContextRef context = CGBitmapContextCreate(NULL,
51 | imageSize.width,
52 | imageSize.height,
53 | CGImageGetBitsPerComponent(imageRef),
54 | 0,
55 | colorSpace,
56 | bitmapInfo);
57 | CGColorSpaceRelease(colorSpace);
58 |
59 | // If failed, return undecompressed image
60 | if (!context) return image;
61 |
62 | CGContextDrawImage(context, imageRect, imageRef);
63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context);
64 |
65 | CGContextRelease(context);
66 |
67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation];
68 | CGImageRelease(decompressedImageRef);
69 | return decompressedImage;
70 | }
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCompat.h"
11 | #import "SDWebImageOperation.h"
12 |
13 | typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) {
14 | SDWebImageDownloaderLowPriority = 1 << 0,
15 | SDWebImageDownloaderProgressiveDownload = 1 << 1,
16 |
17 | /**
18 | * By default, request prevent the of NSURLCache. With this flag, NSURLCache
19 | * is used with default policies.
20 | */
21 | SDWebImageDownloaderUseNSURLCache = 1 << 2,
22 |
23 | /**
24 | * Call completion block with nil image/imageData if the image was read from NSURLCache
25 | * (to be combined with `SDWebImageDownloaderUseNSURLCache`).
26 | */
27 |
28 | SDWebImageDownloaderIgnoreCachedResponse = 1 << 3,
29 | /**
30 | * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for
31 | * extra time in background to let the request finish. If the background task expires the operation will be cancelled.
32 | */
33 |
34 | SDWebImageDownloaderContinueInBackground = 1 << 4,
35 |
36 | /**
37 | * Handles cookies stored in NSHTTPCookieStore by setting
38 | * NSMutableURLRequest.HTTPShouldHandleCookies = YES;
39 | */
40 | SDWebImageDownloaderHandleCookies = 1 << 5,
41 |
42 | /**
43 | * Enable to allow untrusted SSL ceriticates.
44 | * Useful for testing purposes. Use with caution in production.
45 | */
46 | SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6,
47 |
48 | /**
49 | * Put the image in the high priority queue.
50 | */
51 | SDWebImageDownloaderHighPriority = 1 << 7,
52 | };
53 |
54 | typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) {
55 | /**
56 | * Default value. All download operations will execute in queue style (first-in-first-out).
57 | */
58 | SDWebImageDownloaderFIFOExecutionOrder,
59 |
60 | /**
61 | * All download operations will execute in stack style (last-in-first-out).
62 | */
63 | SDWebImageDownloaderLIFOExecutionOrder
64 | };
65 |
66 | extern NSString *const SDWebImageDownloadStartNotification;
67 | extern NSString *const SDWebImageDownloadStopNotification;
68 |
69 | typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize);
70 |
71 | typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage *image, NSData *data, NSError *error, BOOL finished);
72 |
73 | typedef NSDictionary *(^SDWebImageDownloaderHeadersFilterBlock)(NSURL *url, NSDictionary *headers);
74 |
75 | /**
76 | * Asynchronous downloader dedicated and optimized for image loading.
77 | */
78 | @interface SDWebImageDownloader : NSObject
79 |
80 | /**
81 | * Decompressing images that are downloaded and cached can improve peformance but can consume lot of memory.
82 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption.
83 | */
84 | @property (assign, nonatomic) BOOL shouldDecompressImages;
85 |
86 | @property (assign, nonatomic) NSInteger maxConcurrentDownloads;
87 |
88 | /**
89 | * Shows the current amount of downloads that still need to be downloaded
90 | */
91 | @property (readonly, nonatomic) NSUInteger currentDownloadCount;
92 |
93 |
94 | /**
95 | * The timeout value (in seconds) for the download operation. Default: 15.0.
96 | */
97 | @property (assign, nonatomic) NSTimeInterval downloadTimeout;
98 |
99 |
100 | /**
101 | * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`.
102 | */
103 | @property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder;
104 |
105 | /**
106 | * Singleton method, returns the shared instance
107 | *
108 | * @return global shared instance of downloader class
109 | */
110 | + (SDWebImageDownloader *)sharedDownloader;
111 |
112 | /**
113 | * Set username
114 | */
115 | @property (strong, nonatomic) NSString *username;
116 |
117 | /**
118 | * Set password
119 | */
120 | @property (strong, nonatomic) NSString *password;
121 |
122 | /**
123 | * Set filter to pick headers for downloading image HTTP request.
124 | *
125 | * This block will be invoked for each downloading image request, returned
126 | * NSDictionary will be used as headers in corresponding HTTP request.
127 | */
128 | @property (nonatomic, copy) SDWebImageDownloaderHeadersFilterBlock headersFilter;
129 |
130 | /**
131 | * Set a value for a HTTP header to be appended to each download HTTP request.
132 | *
133 | * @param value The value for the header field. Use `nil` value to remove the header.
134 | * @param field The name of the header field to set.
135 | */
136 | - (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field;
137 |
138 | /**
139 | * Returns the value of the specified HTTP header field.
140 | *
141 | * @return The value associated with the header field field, or `nil` if there is no corresponding header field.
142 | */
143 | - (NSString *)valueForHTTPHeaderField:(NSString *)field;
144 |
145 | /**
146 | * Sets a subclass of `SDWebImageDownloaderOperation` as the default
147 | * `NSOperation` to be used each time SDWebImage constructs a request
148 | * operation to download an image.
149 | *
150 | * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set
151 | * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`.
152 | */
153 | - (void)setOperationClass:(Class)operationClass;
154 |
155 | /**
156 | * Creates a SDWebImageDownloader async downloader instance with a given URL
157 | *
158 | * The delegate will be informed when the image is finish downloaded or an error has happen.
159 | *
160 | * @see SDWebImageDownloaderDelegate
161 | *
162 | * @param url The URL to the image to download
163 | * @param options The options to be used for this download
164 | * @param progressBlock A block called repeatedly while the image is downloading
165 | * @param completedBlock A block called once the download is completed.
166 | * If the download succeeded, the image parameter is set, in case of error,
167 | * error parameter is set with the error. The last parameter is always YES
168 | * if SDWebImageDownloaderProgressiveDownload isn't use. With the
169 | * SDWebImageDownloaderProgressiveDownload option, this block is called
170 | * repeatedly with the partial image object and the finished argument set to NO
171 | * before to be called a last time with the full image and finished argument
172 | * set to YES. In case of error, the finished argument is always YES.
173 | *
174 | * @return A cancellable SDWebImageOperation
175 | */
176 | - (id )downloadImageWithURL:(NSURL *)url
177 | options:(SDWebImageDownloaderOptions)options
178 | progress:(SDWebImageDownloaderProgressBlock)progressBlock
179 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock;
180 |
181 | /**
182 | * Sets the download queue suspension state
183 | */
184 | - (void)setSuspended:(BOOL)suspended;
185 |
186 | @end
187 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageDownloader.h"
11 | #import "SDWebImageOperation.h"
12 |
13 | extern NSString *const SDWebImageDownloadStartNotification;
14 | extern NSString *const SDWebImageDownloadReceiveResponseNotification;
15 | extern NSString *const SDWebImageDownloadStopNotification;
16 | extern NSString *const SDWebImageDownloadFinishNotification;
17 |
18 | @interface SDWebImageDownloaderOperation : NSOperation
19 |
20 | /**
21 | * The request used by the operation's connection.
22 | */
23 | @property (strong, nonatomic, readonly) NSURLRequest *request;
24 |
25 |
26 | @property (assign, nonatomic) BOOL shouldDecompressImages;
27 |
28 | /**
29 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default.
30 | *
31 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`.
32 | */
33 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage;
34 |
35 | /**
36 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`.
37 | *
38 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present.
39 | */
40 | @property (nonatomic, strong) NSURLCredential *credential;
41 |
42 | /**
43 | * The SDWebImageDownloaderOptions for the receiver.
44 | */
45 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options;
46 |
47 | /**
48 | * The expected size of data.
49 | */
50 | @property (assign, nonatomic) NSInteger expectedSize;
51 |
52 | /**
53 | * The response returned by the operation's connection.
54 | */
55 | @property (strong, nonatomic) NSURLResponse *response;
56 |
57 | /**
58 | * Initializes a `SDWebImageDownloaderOperation` object
59 | *
60 | * @see SDWebImageDownloaderOperation
61 | *
62 | * @param request the URL request
63 | * @param options downloader options
64 | * @param progressBlock the block executed when a new chunk of data arrives.
65 | * @note the progress block is executed on a background queue
66 | * @param completedBlock the block executed when the download is done.
67 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue
68 | * @param cancelBlock the block executed if the download (operation) is cancelled
69 | *
70 | * @return the initialized instance
71 | */
72 | - (id)initWithRequest:(NSURLRequest *)request
73 | options:(SDWebImageDownloaderOptions)options
74 | progress:(SDWebImageDownloaderProgressBlock)progressBlock
75 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock
76 | cancelled:(SDWebImageNoParamsBlock)cancelBlock;
77 |
78 | @end
79 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 |
11 | @protocol SDWebImageOperation
12 |
13 | - (void)cancel;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageManager.h"
11 |
12 | @class SDWebImagePrefetcher;
13 |
14 | @protocol SDWebImagePrefetcherDelegate
15 |
16 | @optional
17 |
18 | /**
19 | * Called when an image was prefetched.
20 | *
21 | * @param imagePrefetcher The current image prefetcher
22 | * @param imageURL The image url that was prefetched
23 | * @param finishedCount The total number of images that were prefetched (successful or not)
24 | * @param totalCount The total number of images that were to be prefetched
25 | */
26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount;
27 |
28 | /**
29 | * Called when all images are prefetched.
30 | * @param imagePrefetcher The current image prefetcher
31 | * @param totalCount The total number of images that were prefetched (whether successful or not)
32 | * @param skippedCount The total number of images that were skipped
33 | */
34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount;
35 |
36 | @end
37 |
38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls);
39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls);
40 |
41 | /**
42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority.
43 | */
44 | @interface SDWebImagePrefetcher : NSObject
45 |
46 | /**
47 | * The web image manager
48 | */
49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager;
50 |
51 | /**
52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3.
53 | */
54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads;
55 |
56 | /**
57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority.
58 | */
59 | @property (nonatomic, assign) SDWebImageOptions options;
60 |
61 | /**
62 | * Queue options for Prefetcher. Defaults to Main Queue.
63 | */
64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue;
65 |
66 | @property (weak, nonatomic) id delegate;
67 |
68 | /**
69 | * Return the global image prefetcher instance.
70 | */
71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher;
72 |
73 | /**
74 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
75 | * currently one image is downloaded at a time,
76 | * and skips images for failed downloads and proceed to the next image in the list
77 | *
78 | * @param urls list of URLs to prefetch
79 | */
80 | - (void)prefetchURLs:(NSArray *)urls;
81 |
82 | /**
83 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
84 | * currently one image is downloaded at a time,
85 | * and skips images for failed downloads and proceed to the next image in the list
86 | *
87 | * @param urls list of URLs to prefetch
88 | * @param progressBlock block to be called when progress updates;
89 | * first parameter is the number of completed (successful or not) requests,
90 | * second parameter is the total number of images originally requested to be prefetched
91 | * @param completionBlock block to be called when prefetching is completed
92 | * first param is the number of completed (successful or not) requests,
93 | * second parameter is the number of skipped requests
94 | */
95 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock;
96 |
97 | /**
98 | * Remove and cancel queued list
99 | */
100 | - (void)cancelPrefetching;
101 |
102 |
103 | @end
104 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImagePrefetcher.h"
10 |
11 | #if (!defined(DEBUG) && !defined (SD_VERBOSE)) || defined(SD_LOG_NONE)
12 | #define NSLog(...)
13 | #endif
14 |
15 | @interface SDWebImagePrefetcher ()
16 |
17 | @property (strong, nonatomic) SDWebImageManager *manager;
18 | @property (strong, nonatomic) NSArray *prefetchURLs;
19 | @property (assign, nonatomic) NSUInteger requestedCount;
20 | @property (assign, nonatomic) NSUInteger skippedCount;
21 | @property (assign, nonatomic) NSUInteger finishedCount;
22 | @property (assign, nonatomic) NSTimeInterval startedTime;
23 | @property (copy, nonatomic) SDWebImagePrefetcherCompletionBlock completionBlock;
24 | @property (copy, nonatomic) SDWebImagePrefetcherProgressBlock progressBlock;
25 |
26 | @end
27 |
28 | @implementation SDWebImagePrefetcher
29 |
30 | + (SDWebImagePrefetcher *)sharedImagePrefetcher {
31 | static dispatch_once_t once;
32 | static id instance;
33 | dispatch_once(&once, ^{
34 | instance = [self new];
35 | });
36 | return instance;
37 | }
38 |
39 | - (id)init {
40 | if ((self = [super init])) {
41 | _manager = [SDWebImageManager new];
42 | _options = SDWebImageLowPriority;
43 | _prefetcherQueue = dispatch_get_main_queue();
44 | self.maxConcurrentDownloads = 3;
45 | }
46 | return self;
47 | }
48 |
49 | - (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads {
50 | self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads;
51 | }
52 |
53 | - (NSUInteger)maxConcurrentDownloads {
54 | return self.manager.imageDownloader.maxConcurrentDownloads;
55 | }
56 |
57 | - (void)startPrefetchingAtIndex:(NSUInteger)index {
58 | if (index >= self.prefetchURLs.count) return;
59 | self.requestedCount++;
60 | [self.manager downloadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
61 | if (!finished) return;
62 | self.finishedCount++;
63 |
64 | if (image) {
65 | if (self.progressBlock) {
66 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
67 | }
68 | NSLog(@"Prefetched %@ out of %@", @(self.finishedCount), @(self.prefetchURLs.count));
69 | }
70 | else {
71 | if (self.progressBlock) {
72 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
73 | }
74 | NSLog(@"Prefetched %@ out of %@ (Failed)", @(self.finishedCount), @(self.prefetchURLs.count));
75 |
76 | // Add last failed
77 | self.skippedCount++;
78 | }
79 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) {
80 | [self.delegate imagePrefetcher:self
81 | didPrefetchURL:self.prefetchURLs[index]
82 | finishedCount:self.finishedCount
83 | totalCount:self.prefetchURLs.count
84 | ];
85 | }
86 | if (self.prefetchURLs.count > self.requestedCount) {
87 | dispatch_async(self.prefetcherQueue, ^{
88 | [self startPrefetchingAtIndex:self.requestedCount];
89 | });
90 | }
91 | else if (self.finishedCount == self.requestedCount) {
92 | [self reportStatus];
93 | if (self.completionBlock) {
94 | self.completionBlock(self.finishedCount, self.skippedCount);
95 | self.completionBlock = nil;
96 | }
97 | self.progressBlock = nil;
98 | }
99 | }];
100 | }
101 |
102 | - (void)reportStatus {
103 | NSUInteger total = [self.prefetchURLs count];
104 | NSLog(@"Finished prefetching (%@ successful, %@ skipped, timeElasped %.2f)", @(total - self.skippedCount), @(self.skippedCount), CFAbsoluteTimeGetCurrent() - self.startedTime);
105 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) {
106 | [self.delegate imagePrefetcher:self
107 | didFinishWithTotalCount:(total - self.skippedCount)
108 | skippedCount:self.skippedCount
109 | ];
110 | }
111 | }
112 |
113 | - (void)prefetchURLs:(NSArray *)urls {
114 | [self prefetchURLs:urls progress:nil completed:nil];
115 | }
116 |
117 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock {
118 | [self cancelPrefetching]; // Prevent duplicate prefetch request
119 | self.startedTime = CFAbsoluteTimeGetCurrent();
120 | self.prefetchURLs = urls;
121 | self.completionBlock = completionBlock;
122 | self.progressBlock = progressBlock;
123 |
124 | if(urls.count == 0){
125 | if(completionBlock){
126 | completionBlock(0,0);
127 | }
128 | }else{
129 | // Starts prefetching from the very first image on the list with the max allowed concurrency
130 | NSUInteger listCount = self.prefetchURLs.count;
131 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) {
132 | [self startPrefetchingAtIndex:i];
133 | }
134 | }
135 | }
136 |
137 | - (void)cancelPrefetching {
138 | self.prefetchURLs = nil;
139 | self.skippedCount = 0;
140 | self.requestedCount = 0;
141 | self.finishedCount = 0;
142 | [self.manager cancelAll];
143 | }
144 |
145 | @end
146 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+GIF.h
3 | // LBGIFImage
4 | //
5 | // Created by Laurin Brandner on 06.01.12.
6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (GIF)
12 |
13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name;
14 |
15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data;
16 |
17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/UIImage+GIF.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+GIF.m
3 | // LBGIFImage
4 | //
5 | // Created by Laurin Brandner on 06.01.12.
6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "UIImage+GIF.h"
10 | #import
11 |
12 | @implementation UIImage (GIF)
13 |
14 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data {
15 | if (!data) {
16 | return nil;
17 | }
18 |
19 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
20 |
21 | size_t count = CGImageSourceGetCount(source);
22 |
23 | UIImage *animatedImage;
24 |
25 | if (count <= 1) {
26 | animatedImage = [[UIImage alloc] initWithData:data];
27 | }
28 | else {
29 | NSMutableArray *images = [NSMutableArray array];
30 |
31 | NSTimeInterval duration = 0.0f;
32 |
33 | for (size_t i = 0; i < count; i++) {
34 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
35 |
36 | duration += [self sd_frameDurationAtIndex:i source:source];
37 |
38 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]];
39 |
40 | CGImageRelease(image);
41 | }
42 |
43 | if (!duration) {
44 | duration = (1.0f / 10.0f) * count;
45 | }
46 |
47 | animatedImage = [UIImage animatedImageWithImages:images duration:duration];
48 | }
49 |
50 | CFRelease(source);
51 |
52 | return animatedImage;
53 | }
54 |
55 | + (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
56 | float frameDuration = 0.1f;
57 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
58 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
59 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary];
60 |
61 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime];
62 | if (delayTimeUnclampedProp) {
63 | frameDuration = [delayTimeUnclampedProp floatValue];
64 | }
65 | else {
66 |
67 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime];
68 | if (delayTimeProp) {
69 | frameDuration = [delayTimeProp floatValue];
70 | }
71 | }
72 |
73 | // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
74 | // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
75 | // a duration of <= 10 ms. See and
76 | // for more information.
77 |
78 | if (frameDuration < 0.011f) {
79 | frameDuration = 0.100f;
80 | }
81 |
82 | CFRelease(cfFrameProperties);
83 | return frameDuration;
84 | }
85 |
86 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name {
87 | CGFloat scale = [UIScreen mainScreen].scale;
88 |
89 | if (scale > 1.0f) {
90 | NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"];
91 |
92 | NSData *data = [NSData dataWithContentsOfFile:retinaPath];
93 |
94 | if (data) {
95 | return [UIImage sd_animatedGIFWithData:data];
96 | }
97 |
98 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"];
99 |
100 | data = [NSData dataWithContentsOfFile:path];
101 |
102 | if (data) {
103 | return [UIImage sd_animatedGIFWithData:data];
104 | }
105 |
106 | return [UIImage imageNamed:name];
107 | }
108 | else {
109 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"];
110 |
111 | NSData *data = [NSData dataWithContentsOfFile:path];
112 |
113 | if (data) {
114 | return [UIImage sd_animatedGIFWithData:data];
115 | }
116 |
117 | return [UIImage imageNamed:name];
118 | }
119 | }
120 |
121 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size {
122 | if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) {
123 | return self;
124 | }
125 |
126 | CGSize scaledSize = size;
127 | CGPoint thumbnailPoint = CGPointZero;
128 |
129 | CGFloat widthFactor = size.width / self.size.width;
130 | CGFloat heightFactor = size.height / self.size.height;
131 | CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor;
132 | scaledSize.width = self.size.width * scaleFactor;
133 | scaledSize.height = self.size.height * scaleFactor;
134 |
135 | if (widthFactor > heightFactor) {
136 | thumbnailPoint.y = (size.height - scaledSize.height) * 0.5;
137 | }
138 | else if (widthFactor < heightFactor) {
139 | thumbnailPoint.x = (size.width - scaledSize.width) * 0.5;
140 | }
141 |
142 | NSMutableArray *scaledImages = [NSMutableArray array];
143 |
144 | UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
145 |
146 | for (UIImage *image in self.images) {
147 | [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)];
148 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
149 |
150 | [scaledImages addObject:newImage];
151 | }
152 |
153 | UIGraphicsEndImageContext();
154 |
155 | return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
156 | }
157 |
158 | @end
159 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+MultiFormat.h
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 07/06/13.
6 | // Copyright (c) 2013 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (MultiFormat)
12 |
13 | + (UIImage *)sd_imageWithData:(NSData *)data;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+MultiFormat.m
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 07/06/13.
6 | // Copyright (c) 2013 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import "UIImage+MultiFormat.h"
10 | #import "UIImage+GIF.h"
11 | #import "NSData+ImageContentType.h"
12 | #import
13 |
14 | #ifdef SD_WEBP
15 | #import "UIImage+WebP.h"
16 | #endif
17 |
18 | @implementation UIImage (MultiFormat)
19 |
20 | + (UIImage *)sd_imageWithData:(NSData *)data {
21 | if (!data) {
22 | return nil;
23 | }
24 |
25 | UIImage *image;
26 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data];
27 | if ([imageContentType isEqualToString:@"image/gif"]) {
28 | image = [UIImage sd_animatedGIFWithData:data];
29 | }
30 | #ifdef SD_WEBP
31 | else if ([imageContentType isEqualToString:@"image/webp"])
32 | {
33 | image = [UIImage sd_imageWithWebPData:data];
34 | }
35 | #endif
36 | else {
37 | image = [[UIImage alloc] initWithData:data];
38 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data];
39 | if (orientation != UIImageOrientationUp) {
40 | image = [UIImage imageWithCGImage:image.CGImage
41 | scale:image.scale
42 | orientation:orientation];
43 | }
44 | }
45 |
46 |
47 | return image;
48 | }
49 |
50 |
51 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData {
52 | UIImageOrientation result = UIImageOrientationUp;
53 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);
54 | if (imageSource) {
55 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL);
56 | if (properties) {
57 | CFTypeRef val;
58 | int exifOrientation;
59 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation);
60 | if (val) {
61 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation);
62 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation];
63 | } // else - if it's not set it remains at up
64 | CFRelease((CFTypeRef) properties);
65 | } else {
66 | //NSLog(@"NO PROPERTIES, FAIL");
67 | }
68 | CFRelease(imageSource);
69 | }
70 | return result;
71 | }
72 |
73 | #pragma mark EXIF orientation tag converter
74 | // Convert an EXIF image orientation to an iOS one.
75 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html
76 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation {
77 | UIImageOrientation orientation = UIImageOrientationUp;
78 | switch (exifOrientation) {
79 | case 1:
80 | orientation = UIImageOrientationUp;
81 | break;
82 |
83 | case 3:
84 | orientation = UIImageOrientationDown;
85 | break;
86 |
87 | case 8:
88 | orientation = UIImageOrientationLeft;
89 | break;
90 |
91 | case 6:
92 | orientation = UIImageOrientationRight;
93 | break;
94 |
95 | case 2:
96 | orientation = UIImageOrientationUpMirrored;
97 | break;
98 |
99 | case 4:
100 | orientation = UIImageOrientationDownMirrored;
101 | break;
102 |
103 | case 5:
104 | orientation = UIImageOrientationLeftMirrored;
105 | break;
106 |
107 | case 7:
108 | orientation = UIImageOrientationRightMirrored;
109 | break;
110 | default:
111 | break;
112 | }
113 | return orientation;
114 | }
115 |
116 |
117 |
118 | @end
119 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCompat.h"
11 | #import "SDWebImageManager.h"
12 |
13 | /**
14 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state.
15 | */
16 | @interface UIImageView (HighlightedWebCache)
17 |
18 | /**
19 | * Set the imageView `highlightedImage` with an `url`.
20 | *
21 | * The download is asynchronous and cached.
22 | *
23 | * @param url The url for the image.
24 | */
25 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url;
26 |
27 | /**
28 | * Set the imageView `highlightedImage` with an `url` and custom options.
29 | *
30 | * The download is asynchronous and cached.
31 | *
32 | * @param url The url for the image.
33 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
34 | */
35 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options;
36 |
37 | /**
38 | * Set the imageView `highlightedImage` with an `url`.
39 | *
40 | * The download is asynchronous and cached.
41 | *
42 | * @param url The url for the image.
43 | * @param completedBlock A block called when operation has been completed. This block has no return value
44 | * and takes the requested UIImage as first parameter. In case of error the image parameter
45 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
46 | * indicating if the image was retrived from the local cache or from the network.
47 | * The fourth parameter is the original image url.
48 | */
49 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock;
50 |
51 | /**
52 | * Set the imageView `highlightedImage` with an `url` and custom options.
53 | *
54 | * The download is asynchronous and cached.
55 | *
56 | * @param url The url for the image.
57 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
58 | * @param completedBlock A block called when operation has been completed. This block has no return value
59 | * and takes the requested UIImage as first parameter. In case of error the image parameter
60 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
61 | * indicating if the image was retrived from the local cache or from the network.
62 | * The fourth parameter is the original image url.
63 | */
64 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock;
65 |
66 | /**
67 | * Set the imageView `highlightedImage` with an `url` and custom options.
68 | *
69 | * The download is asynchronous and cached.
70 | *
71 | * @param url The url for the image.
72 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
73 | * @param progressBlock A block called while image is downloading
74 | * @param completedBlock A block called when operation has been completed. This block has no return value
75 | * and takes the requested UIImage as first parameter. In case of error the image parameter
76 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
77 | * indicating if the image was retrived from the local cache or from the network.
78 | * The fourth parameter is the original image url.
79 | */
80 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock;
81 |
82 | /**
83 | * Cancel the current download
84 | */
85 | - (void)sd_cancelCurrentHighlightedImageLoad;
86 |
87 | @end
88 |
89 |
90 | @interface UIImageView (HighlightedWebCacheDeprecated)
91 |
92 | - (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`");
93 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`");
94 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`");
95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`");
96 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`");
97 |
98 | - (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`");
99 |
100 | @end
101 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIImageView+HighlightedWebCache.h"
10 | #import "UIView+WebCacheOperation.h"
11 |
12 | #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage"
13 |
14 | @implementation UIImageView (HighlightedWebCache)
15 |
16 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url {
17 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil];
18 | }
19 |
20 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options {
21 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil];
22 | }
23 |
24 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock {
25 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock];
26 | }
27 |
28 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock {
29 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock];
30 | }
31 |
32 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock {
33 | [self sd_cancelCurrentHighlightedImageLoad];
34 |
35 | if (url) {
36 | __weak __typeof(self)wself = self;
37 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
38 | if (!wself) return;
39 | dispatch_main_sync_safe (^
40 | {
41 | if (!wself) return;
42 | if (image) {
43 | wself.highlightedImage = image;
44 | [wself setNeedsLayout];
45 | }
46 | if (completedBlock && finished) {
47 | completedBlock(image, error, cacheType, url);
48 | }
49 | });
50 | }];
51 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey];
52 | } else {
53 | dispatch_main_async_safe(^{
54 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
55 | if (completedBlock) {
56 | completedBlock(nil, error, SDImageCacheTypeNone, url);
57 | }
58 | });
59 | }
60 | }
61 |
62 | - (void)sd_cancelCurrentHighlightedImageLoad {
63 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey];
64 | }
65 |
66 | @end
67 |
68 |
69 | @implementation UIImageView (HighlightedWebCacheDeprecated)
70 |
71 | - (void)setHighlightedImageWithURL:(NSURL *)url {
72 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil];
73 | }
74 |
75 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options {
76 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil];
77 | }
78 |
79 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock {
80 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
81 | if (completedBlock) {
82 | completedBlock(image, error, cacheType);
83 | }
84 | }];
85 | }
86 |
87 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
88 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
89 | if (completedBlock) {
90 | completedBlock(image, error, cacheType);
91 | }
92 | }];
93 | }
94 |
95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock {
96 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
97 | if (completedBlock) {
98 | completedBlock(image, error, cacheType);
99 | }
100 | }];
101 | }
102 |
103 | - (void)cancelCurrentHighlightedImageLoad {
104 | [self sd_cancelCurrentHighlightedImageLoad];
105 | }
106 |
107 | @end
108 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageManager.h"
11 |
12 | @interface UIView (WebCacheOperation)
13 |
14 | /**
15 | * Set the image load operation (storage in a UIView based dictionary)
16 | *
17 | * @param operation the operation
18 | * @param key key for storing the operation
19 | */
20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key;
21 |
22 | /**
23 | * Cancel all operations for the current UIView and key
24 | *
25 | * @param key key for identifying the operations
26 | */
27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key;
28 |
29 | /**
30 | * Just remove the operations corresponding to the current UIView and key without cancelling them
31 | *
32 | * @param key key for identifying the operations
33 | */
34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIView+WebCacheOperation.h"
10 | #import "objc/runtime.h"
11 |
12 | static char loadOperationKey;
13 |
14 | @implementation UIView (WebCacheOperation)
15 |
16 | - (NSMutableDictionary *)operationDictionary {
17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey);
18 | if (operations) {
19 | return operations;
20 | }
21 | operations = [NSMutableDictionary dictionary];
22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
23 | return operations;
24 | }
25 |
26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key {
27 | [self sd_cancelImageLoadOperationWithKey:key];
28 | NSMutableDictionary *operationDictionary = [self operationDictionary];
29 | [operationDictionary setObject:operation forKey:key];
30 | }
31 |
32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key {
33 | // Cancel in progress downloader from queue
34 | NSMutableDictionary *operationDictionary = [self operationDictionary];
35 | id operations = [operationDictionary objectForKey:key];
36 | if (operations) {
37 | if ([operations isKindOfClass:[NSArray class]]) {
38 | for (id operation in operations) {
39 | if (operation) {
40 | [operation cancel];
41 | }
42 | }
43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){
44 | [(id) operations cancel];
45 | }
46 | [operationDictionary removeObjectForKey:key];
47 | }
48 | }
49 |
50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key {
51 | NSMutableDictionary *operationDictionary = [self operationDictionary];
52 | [operationDictionary removeObjectForKey:key];
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SDWebImage
5 |
6 | Copyright (c) 2009 Olivier Poitrey
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is furnished
13 | to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in all
16 | copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 |
27 | Generated by CocoaPods - http://cocoapods.org
28 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2009 Olivier Poitrey <rs@dailymotion.com>
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is furnished
24 | to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in all
27 | copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 |
38 | Title
39 | SDWebImage
40 | Type
41 | PSGroupSpecifier
42 |
43 |
44 | FooterText
45 | Generated by CocoaPods - http://cocoapods.org
46 | Title
47 |
48 | Type
49 | PSGroupSpecifier
50 |
51 |
52 | StringsTable
53 | Acknowledgements
54 | Title
55 | Acknowledgements
56 |
57 |
58 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_FFLoopView : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_FFLoopView
5 | @end
6 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\""
63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
64 | fi
65 | }
66 |
67 | # Strip invalid architectures
68 | strip_invalid_archs() {
69 | binary="$1"
70 | # Get architectures for current file
71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
72 | stripped=""
73 | for arch in $archs; do
74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
75 | # Strip non-valid architectures in-place
76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
77 | stripped="$stripped $arch"
78 | fi
79 | done
80 | if [[ "$stripped" ]]; then
81 | echo "Stripped $binary of architectures:$stripped"
82 | fi
83 | }
84 |
85 |
86 | if [[ "$CONFIGURATION" == "Debug" ]]; then
87 | install_framework "Pods-FFLoopView/SDWebImage.framework"
88 | fi
89 | if [[ "$CONFIGURATION" == "Release" ]]; then
90 | install_framework "Pods-FFLoopView/SDWebImage.framework"
91 | fi
92 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | realpath() {
12 | DIRECTORY="$(cd "${1%/*}" && pwd)"
13 | FILENAME="${1##*/}"
14 | echo "$DIRECTORY/$FILENAME"
15 | }
16 |
17 | install_resource()
18 | {
19 | case $1 in
20 | *.storyboard)
21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
23 | ;;
24 | *.xib)
25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
27 | ;;
28 | *.framework)
29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
33 | ;;
34 | *.xcdatamodel)
35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
37 | ;;
38 | *.xcdatamodeld)
39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
41 | ;;
42 | *.xcmappingmodel)
43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
45 | ;;
46 | *.xcassets)
47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
49 | ;;
50 | /*)
51 | echo "$1"
52 | echo "$1" >> "$RESOURCES_TO_COPY"
53 | ;;
54 | *)
55 | echo "${PODS_ROOT}/$1"
56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
57 | ;;
58 | esac
59 | }
60 |
61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
66 | fi
67 | rm -f "$RESOURCES_TO_COPY"
68 |
69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
70 | then
71 | case "${TARGETED_DEVICE_FAMILY}" in
72 | 1,2)
73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
74 | ;;
75 | 1)
76 | TARGET_DEVICE_ARGS="--target-device iphone"
77 | ;;
78 | 2)
79 | TARGET_DEVICE_ARGS="--target-device ipad"
80 | ;;
81 | *)
82 | TARGET_DEVICE_ARGS="--target-device mac"
83 | ;;
84 | esac
85 |
86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
88 | while read line; do
89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
90 | XCASSET_FILES+=("$line")
91 | fi
92 | done <<<"$OTHER_XCASSETS"
93 |
94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
95 | fi
96 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 |
4 | FOUNDATION_EXPORT double Pods_FFLoopViewVersionNumber;
5 | FOUNDATION_EXPORT const unsigned char Pods_FFLoopViewVersionString[];
6 |
7 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers"
4 | OTHER_LDFLAGS = $(inherited) -framework "SDWebImage"
5 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-FFLoopView
6 | PODS_ROOT = ${SRCROOT}/Pods
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_FFLoopView {
2 | umbrella header "Pods-FFLoopView-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/Pods-FFLoopView/Pods-FFLoopView.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/SDWebImage.framework/Headers"
4 | OTHER_LDFLAGS = $(inherited) -framework "SDWebImage"
5 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-FFLoopView
6 | PODS_ROOT = ${SRCROOT}/Pods
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/SDWebImage/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.7.3
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SDWebImage : NSObject
3 | @end
4 | @implementation PodsDummy_SDWebImage
5 | @end
6 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #endif
4 |
5 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "NSData+ImageContentType.h"
4 | #import "SDImageCache.h"
5 | #import "SDWebImageCompat.h"
6 | #import "SDWebImageDecoder.h"
7 | #import "SDWebImageDownloader.h"
8 | #import "SDWebImageDownloaderOperation.h"
9 | #import "SDWebImageManager.h"
10 | #import "SDWebImageOperation.h"
11 | #import "SDWebImagePrefetcher.h"
12 | #import "UIButton+WebCache.h"
13 | #import "UIImage+GIF.h"
14 | #import "UIImage+MultiFormat.h"
15 | #import "UIImageView+HighlightedWebCache.h"
16 | #import "UIImageView+WebCache.h"
17 | #import "UIView+WebCacheOperation.h"
18 |
19 | FOUNDATION_EXPORT double SDWebImageVersionNumber;
20 | FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[];
21 |
22 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap:
--------------------------------------------------------------------------------
1 | framework module SDWebImage {
2 | umbrella header "SDWebImage-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/FFLoopView/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public"
3 | OTHER_LDFLAGS = -framework "ImageIO"
4 | PODS_ROOT = ${SRCROOT}
5 | SKIP_INSTALL = YES
--------------------------------------------------------------------------------
/FFLoopView/Source/LoopView+Additions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LoopView+Additions.swift
3 | // FFLoopView
4 | //
5 | // Created by 刘凡 on 15/11/16.
6 | // Copyright © 2015年 joyios. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | // MARK: - UIView extension
12 | extension UIView {
13 |
14 | /// 取消所有子视图的 autoresizing 属性
15 | func disableSubviewsAutoresizing() {
16 | for v in subviews {
17 | v.translatesAutoresizingMaskIntoConstraints = false
18 | }
19 | }
20 | }
21 |
22 | // MARK: - NSLayoutConstraint extension
23 | extension NSLayoutConstraint {
24 |
25 | /// 建立约束数组
26 | ///
27 | /// - parameter formats: VLF 数组
28 | /// - parameter views: views 字典
29 | ///
30 | /// - returns: 约束数组
31 | class func constraints(formats: [String], views: [String: AnyObject]) -> [NSLayoutConstraint] {
32 |
33 | var cons = [NSLayoutConstraint]()
34 |
35 | for format in formats {
36 | cons += NSLayoutConstraint.constraintsWithVisualFormat(format, options: [], metrics: nil, views: views)
37 | }
38 |
39 | return cons
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/FFLoopView/Source/PagingView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PagingView.swift
3 | // FFLoopView
4 | //
5 | // Created by 刘凡 on 15/11/16.
6 | // Copyright © 2015年 joyios. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// 分页视图类型
12 | ///
13 | /// - Text: 文本,适合任意个数的分页显示
14 | /// - SmallDot: 小点,适合 5 个以内的分页显示
15 | /// - Clock: 时钟,适合 4~12 个左右的分页显示
16 | public enum PagingViewType: Int {
17 | case Text
18 | case SmallDot
19 | case Clock
20 | }
21 |
22 | /// 页面半径
23 | private let SmallDotPageRadius: CGFloat = 1
24 | /// 当前页面半径
25 | private let SmallDotCurrentPageRadius: CGFloat = 2
26 |
27 | /// 分页视图
28 | public class PagingView: UIView {
29 |
30 | // MARK: 公共属性
31 | /// 分页视图类型
32 | public var pagingType: PagingViewType = .Text {
33 | didSet {
34 | setNeedsDisplay()
35 | hiddenLabels()
36 | }
37 | }
38 |
39 | /// 总页数
40 | public var numberOfPages: Int = 0 {
41 | didSet {
42 | pageLabel.text = "\(numberOfPages)"
43 |
44 | hiddenLabels()
45 | }
46 | }
47 | /// 当前页数
48 | public var currentPage: Int = 0 {
49 | didSet {
50 | setNeedsDisplay()
51 | currentPageLabel.text = "\(currentPage + 1)"
52 | hiddenLabels()
53 | }
54 | }
55 | /// 单页时隐藏
56 | public var hidesForSinglePage: Bool = true
57 | /// 其他页号标示颜色
58 | public var pageIndicatorTintColor: UIColor?
59 | /// 当前页标示颜色
60 | public var currentPageIndicatorTintColor: UIColor?
61 |
62 | // MARK: 公共函数
63 | /// 设置外观
64 | ///
65 | /// - parameter labelFont: 分页标签字体
66 | /// - parameter labelColor: 分页标签颜色
67 | /// - parameter currentFont: 当前分页标签字体
68 | /// - parameter currentColor: 当前分页标签颜色
69 | public func setupAppearance(labelFont: UIFont, labelColor: UIColor, currentFont: UIFont, currentColor: UIColor) {
70 |
71 | pageLabel.font = labelFont
72 | sepLabel.font = labelFont
73 | currentPageLabel.font = currentFont
74 |
75 | pageLabel.textColor = labelColor
76 | sepLabel.textColor = labelColor
77 | currentPageLabel.textColor = currentColor
78 |
79 | pageLabel.sizeToFit()
80 | sepLabel.sizeToFit()
81 | currentPageLabel.sizeToFit()
82 | }
83 |
84 | // MARK: 构造函数
85 | override init(frame: CGRect) {
86 | super.init(frame: frame)
87 |
88 | prepareUI()
89 | }
90 |
91 | required public init?(coder aDecoder: NSCoder) {
92 | fatalError("init(coder:) has not been implemented")
93 | }
94 |
95 | // MARK: 私有控件
96 | /// 总页数标签
97 | private lazy var pageLabel = UILabel()
98 | /// 当前页标签
99 | private lazy var currentPageLabel = UILabel()
100 | /// 分割线标签
101 | private lazy var sepLabel = UILabel()
102 | }
103 |
104 | // MARK: - 绘制视图
105 | extension PagingView {
106 |
107 | public override func drawRect(rect: CGRect) {
108 |
109 | // 条件检测
110 | if numberOfPages <= 0 {
111 | return
112 | }
113 | if numberOfPages == 1 && hidesForSinglePage {
114 | return
115 | }
116 |
117 | switch pagingType {
118 | case .SmallDot: drawSmallDot(rect)
119 | case .Clock: drawClock(rect)
120 | case .Text: break
121 | }
122 | }
123 |
124 | private func drawClock(rect: CGRect) {
125 | let center = CGPoint(x: rect.width * 0.5, y: rect.height * 0.5)
126 | let r = min(rect.width, rect.height) * 0.5
127 |
128 | // 中心点
129 | let centerPath = UIBezierPath(ovalInRect: centerRect(center, radius: 1.2))
130 |
131 | // 总页数
132 | let pagePath = UIBezierPath()
133 | pagePath.moveToPoint(center)
134 | pagePath.addLineToPoint(CGPoint(x: center.x, y: center.y - r * 0.6))
135 |
136 | pageIndicatorTintColor?.set()
137 | centerPath.fill()
138 | pagePath.stroke()
139 |
140 | // 当前页数
141 | let currentPagePath = UIBezierPath()
142 | currentPagePath.moveToPoint(center)
143 | let angle = CGFloat(Double(currentPage + 1) / Double(numberOfPages) * M_PI * 2 - M_PI_2)
144 | let x = center.x + r * cos(angle) * 0.8
145 | let y = center.y + r * sin(angle) * 0.8
146 | currentPagePath.addLineToPoint(CGPoint(x: x, y: y))
147 |
148 | currentPageIndicatorTintColor?.set()
149 | currentPagePath.stroke()
150 | }
151 |
152 | private func drawSmallDot(rect: CGRect) {
153 | let width = rect.width
154 | let step = width / CGFloat(numberOfPages + 1)
155 | let y = rect.height * 0.5
156 | var x = step
157 |
158 | for i in 0.. CGRect {
173 | let rect = CGRect(origin: center, size: CGSizeZero)
174 |
175 | return CGRectInset(rect, -radius, -radius)
176 | }
177 | }
178 |
179 | // MARK: - 设置视图
180 | private extension PagingView {
181 |
182 | /// 隐藏标签
183 | private func hiddenLabels() {
184 | let isShow = (pagingType == .Text) && numberOfPages > 1 && hidesForSinglePage
185 |
186 | pageLabel.hidden = !isShow
187 | currentPageLabel.hidden = !isShow
188 | sepLabel.hidden = !isShow
189 | }
190 |
191 | /// 准备界面
192 | private func prepareUI() {
193 | backgroundColor = UIColor.clearColor()
194 |
195 | currentPageLabel.text = "10"
196 | sepLabel.text = "/"
197 | pageLabel.text = "99"
198 |
199 | addSubview(currentPageLabel)
200 | addSubview(sepLabel)
201 | addSubview(pageLabel)
202 |
203 | setupAppearance(UIFont.systemFontOfSize(10),
204 | labelColor: UIColor.whiteColor(),
205 | currentFont: UIFont.systemFontOfSize(14),
206 | currentColor: UIColor.yellowColor())
207 |
208 | disableSubviewsAutoresizing()
209 |
210 | addConstraint(NSLayoutConstraint(item: sepLabel,
211 | attribute: .CenterX,
212 | relatedBy: .Equal,
213 | toItem: self,
214 | attribute: .CenterX,
215 | multiplier: 1.0,
216 | constant: 0.0))
217 | addConstraint(NSLayoutConstraint(item: currentPageLabel,
218 | attribute: .Right,
219 | relatedBy: .Equal,
220 | toItem: sepLabel,
221 | attribute: .Left,
222 | multiplier: 1.0,
223 | constant: 0.0))
224 | addConstraint(NSLayoutConstraint(item: pageLabel,
225 | attribute: .Left,
226 | relatedBy: .Equal,
227 | toItem: sepLabel,
228 | attribute: .Right,
229 | multiplier: 1.0,
230 | constant: 0.0))
231 |
232 | addConstraint(NSLayoutConstraint(item: sepLabel,
233 | attribute: .CenterY,
234 | relatedBy: .Equal,
235 | toItem: self,
236 | attribute: .CenterY,
237 | multiplier: 1.0,
238 | constant: 0.0))
239 | addConstraint(NSLayoutConstraint(item: currentPageLabel,
240 | attribute: .Baseline,
241 | relatedBy: .Equal,
242 | toItem: sepLabel,
243 | attribute: .Baseline,
244 | multiplier: 1.0,
245 | constant: 0.0))
246 | addConstraint(NSLayoutConstraint(item: pageLabel,
247 | attribute: .Baseline,
248 | relatedBy: .Equal,
249 | toItem: sepLabel,
250 | attribute: .Baseline,
251 | multiplier: 1.0,
252 | constant: 0.0))
253 | }
254 | }
255 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Fan Liu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FFLoopView
2 |
3 | ## 功能特点
4 |
5 | * 无限循环的图片轮播器
6 | * 支持显示提示标签
7 | * 三种自定义分页控件
8 | * 指定分页控件位置
9 |
10 | ### 屏幕截图
11 |
12 |
13 |
14 |
15 |
16 | ## 开发环境
17 |
18 | * iOS 8.0+
19 | * Xcode 7.0+
20 | * Swift 2.0
21 |
22 | ## 安装
23 |
24 | * 进入终端并且切换到 `xcodeproj` 所在目录
25 | * 输入以下命令,创建 `Podfile`
26 |
27 | ```bash
28 | $ pod init
29 | ```
30 |
31 | * 编辑 `Podfile`,并且输入以下内容
32 |
33 | ```
34 | platform :ios, '8.0'
35 | use_frameworks!
36 |
37 | pod 'FFLoopView'
38 | ```
39 |
40 | ## 使用
41 |
42 | ### Swift
43 |
44 | ```swift
45 | loopView.showImages(urls, tips: tips) { [weak self] index in
46 | print("选中了第 \(index) 张图像 \(self?.view)")
47 | }
48 | ```
49 |
50 | #### 参数说明
51 |
52 | 1. urls: 轮播器图像的 URL 数组
53 | 2. tips: 每张图片对应的提示信息字符串数组,可以为 nil
54 | 3. 完成回调:index 选中图像的索引值
55 |
56 | #### 注意事项
57 |
58 | 1. 完成闭包中的 self 需要使用 `[weak self]` 否则会出现循环引用
59 | 2. 如果需要释放轮播器视图,需要先调用 `loopView.stopTimer()` 关闭时钟,否则会出现内存泄漏
60 | 3. 如果由于设备旋转需要重新更新轮播器布局,可以调用 `loopView.relayoutView()`
61 |
62 | ### Objective-C
63 |
64 | ```objc
65 | __weak typeof(self) weakSelf = self;
66 | [self.loopView showImages:urls tips:nil timeInterval:5.0 selectedImage:^(NSInteger index) {
67 | NSLog(@"选中了第 %zd 张图片 %@", index, weakSelf.view);
68 | }];
69 | ```
70 |
71 | > 详细信息请参见示例代码
72 |
--------------------------------------------------------------------------------
/screenshots/screenshots_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/screenshots/screenshots_1.png
--------------------------------------------------------------------------------
/screenshots/screenshots_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/screenshots/screenshots_2.png
--------------------------------------------------------------------------------
/screenshots/screenshots_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liufan321/FFLoopView/9d274124bd698713662c19116297e38c1c2e9a34/screenshots/screenshots_3.png
--------------------------------------------------------------------------------