├── .gitignore
├── FSLoopScrollViewDemo
├── FSLoopScrollViewDemo.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── FSLoopScrollViewDemo.xcworkspace
│ └── contents.xcworkspacedata
├── FSLoopScrollViewDemo
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── FSLoopScrollView
│ │ ├── FSLoopScrollView.h
│ │ ├── FSLoopScrollView.m
│ │ ├── NSTimer+FSLoop.h
│ │ └── NSTimer+FSLoop.m
│ ├── Info.plist
│ ├── ViewController.h
│ ├── ViewController.m
│ ├── home_ic_hot@2x.png
│ ├── home_ic_new@2x.png
│ ├── images
│ │ ├── 1.jpg
│ │ ├── 2.jpg
│ │ ├── 3.jpg
│ │ ├── 4.jpg
│ │ ├── 5.jpg
│ │ └── 6.jpg
│ └── main.m
├── 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
│ │ └── YYText
│ │ │ ├── NSAttributedString+YYText.h
│ │ │ ├── NSParagraphStyle+YYText.h
│ │ │ ├── UIPasteboard+YYText.h
│ │ │ ├── UIView+YYText.h
│ │ │ ├── YYLabel.h
│ │ │ ├── YYText.h
│ │ │ ├── YYTextArchiver.h
│ │ │ ├── YYTextAsyncLayer.h
│ │ │ ├── YYTextAttribute.h
│ │ │ ├── YYTextContainerView.h
│ │ │ ├── YYTextDebugOption.h
│ │ │ ├── YYTextEffectWindow.h
│ │ │ ├── YYTextInput.h
│ │ │ ├── YYTextKeyboardManager.h
│ │ │ ├── YYTextLayout.h
│ │ │ ├── YYTextLine.h
│ │ │ ├── YYTextMagnifier.h
│ │ │ ├── YYTextParser.h
│ │ │ ├── YYTextRubyAnnotation.h
│ │ │ ├── YYTextRunDelegate.h
│ │ │ ├── YYTextSelectionView.h
│ │ │ ├── YYTextTransaction.h
│ │ │ ├── YYTextUtilities.h
│ │ │ ├── YYTextView.h
│ │ │ └── YYTextWeakProxy.h
│ └── Public
│ │ ├── 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
│ │ └── YYText
│ │ ├── NSAttributedString+YYText.h
│ │ ├── NSParagraphStyle+YYText.h
│ │ ├── UIPasteboard+YYText.h
│ │ ├── UIView+YYText.h
│ │ ├── YYLabel.h
│ │ ├── YYText.h
│ │ ├── YYTextArchiver.h
│ │ ├── YYTextAsyncLayer.h
│ │ ├── YYTextAttribute.h
│ │ ├── YYTextContainerView.h
│ │ ├── YYTextDebugOption.h
│ │ ├── YYTextEffectWindow.h
│ │ ├── YYTextInput.h
│ │ ├── YYTextKeyboardManager.h
│ │ ├── YYTextLayout.h
│ │ ├── YYTextLine.h
│ │ ├── YYTextMagnifier.h
│ │ ├── YYTextParser.h
│ │ ├── YYTextRubyAnnotation.h
│ │ ├── YYTextRunDelegate.h
│ │ ├── YYTextSelectionView.h
│ │ ├── YYTextTransaction.h
│ │ ├── YYTextUtilities.h
│ │ ├── YYTextView.h
│ │ └── YYTextWeakProxy.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-FSLoopScrollViewDemo
│ │ ├── Pods-FSLoopScrollViewDemo-acknowledgements.markdown
│ │ ├── Pods-FSLoopScrollViewDemo-acknowledgements.plist
│ │ ├── Pods-FSLoopScrollViewDemo-dummy.m
│ │ ├── Pods-FSLoopScrollViewDemo-frameworks.sh
│ │ ├── Pods-FSLoopScrollViewDemo-resources.sh
│ │ ├── Pods-FSLoopScrollViewDemo.debug.xcconfig
│ │ └── Pods-FSLoopScrollViewDemo.release.xcconfig
│ ├── SDWebImage
│ │ ├── SDWebImage-dummy.m
│ │ ├── SDWebImage-prefix.pch
│ │ └── SDWebImage.xcconfig
│ └── YYText
│ │ ├── YYText-dummy.m
│ │ ├── YYText-prefix.pch
│ │ └── YYText.xcconfig
│ └── YYText
│ ├── LICENSE
│ ├── README.md
│ └── YYText
│ ├── Component
│ ├── YYTextContainerView.h
│ ├── YYTextContainerView.m
│ ├── YYTextDebugOption.h
│ ├── YYTextDebugOption.m
│ ├── YYTextEffectWindow.h
│ ├── YYTextEffectWindow.m
│ ├── YYTextInput.h
│ ├── YYTextInput.m
│ ├── YYTextKeyboardManager.h
│ ├── YYTextKeyboardManager.m
│ ├── YYTextLayout.h
│ ├── YYTextLayout.m
│ ├── YYTextLine.h
│ ├── YYTextLine.m
│ ├── YYTextMagnifier.h
│ ├── YYTextMagnifier.m
│ ├── YYTextSelectionView.h
│ └── YYTextSelectionView.m
│ ├── String
│ ├── YYTextArchiver.h
│ ├── YYTextArchiver.m
│ ├── YYTextAttribute.h
│ ├── YYTextAttribute.m
│ ├── YYTextParser.h
│ ├── YYTextParser.m
│ ├── YYTextRubyAnnotation.h
│ ├── YYTextRubyAnnotation.m
│ ├── YYTextRunDelegate.h
│ └── YYTextRunDelegate.m
│ ├── Utility
│ ├── NSAttributedString+YYText.h
│ ├── NSAttributedString+YYText.m
│ ├── NSParagraphStyle+YYText.h
│ ├── NSParagraphStyle+YYText.m
│ ├── UIPasteboard+YYText.h
│ ├── UIPasteboard+YYText.m
│ ├── UIView+YYText.h
│ ├── UIView+YYText.m
│ ├── YYTextAsyncLayer.h
│ ├── YYTextAsyncLayer.m
│ ├── YYTextTransaction.h
│ ├── YYTextTransaction.m
│ ├── YYTextUtilities.h
│ ├── YYTextUtilities.m
│ ├── YYTextWeakProxy.h
│ └── YYTextWeakProxy.m
│ ├── YYLabel.h
│ ├── YYLabel.m
│ ├── YYText.h
│ ├── YYTextView.h
│ └── YYTextView.m
├── README.md
└── loopViewDemo.gif
/.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 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | # CocoaPods
31 | #
32 | # We recommend against adding the Pods directory to your .gitignore. However
33 | # you should judge for yourself, the pros and cons are mentioned at:
34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
35 | #
36 | # Pods/
37 |
38 | # Carthage
39 | #
40 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
41 | # Carthage/Checkouts
42 |
43 | Carthage/Build
44 |
45 | # fastlane
46 | #
47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48 | # screenshots whenever they are needed.
49 | # For more information about the recommended setup visit:
50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
51 |
52 | fastlane/report.xml
53 | fastlane/screenshots
54 |
55 | #Code Injection
56 | #
57 | # After new code Injection tools there's a generated folder /iOSInjectionProject
58 | # https://github.com/johnno1962/injectionforxcode
59 |
60 | iOSInjectionProject/
61 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // FSLoopScrollViewDemo
4 | //
5 | // Created by huim on 2017/3/6.
6 | // Copyright © 2017年 shunFSKi. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // FSLoopScrollViewDemo
4 | //
5 | // Created by huim on 2017/3/6.
6 | // Copyright © 2017年 shunFSKi. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // 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.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // 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.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
38 | }
39 |
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // 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.
43 | }
44 |
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/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 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/Base.lproj/Main.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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/FSLoopScrollView/FSLoopScrollView.h:
--------------------------------------------------------------------------------
1 | //
2 | // FSLoopScrollView.h
3 | // SFLoopScrollview
4 | //
5 | // Created by huim on 2017/3/6.
6 | // Copyright © 2017年 shunFSKi. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FSLoopScrollView : UIView
12 | /**
13 | 提供给外部的动态属性
14 | */
15 | @property (nonatomic, copy) NSArray *imgResourceArr;//图片资源数组(网络,本地,图片)
16 | @property (nonatomic, assign) NSTimeInterval timeinterval;//滚动间隔时间,默认2s
17 | @property (nonatomic, assign, readonly) NSInteger currentIndex;//当前的index
18 | @property (nonatomic, copy) void (^tapClickBlock)(FSLoopScrollView *loopView);//触摸事件
19 |
20 |
21 | /**
22 | 仅文本轮播调用
23 | */
24 | @property (nonatomic, strong) UIColor *textColor;//默认黑色
25 | @property (nonatomic, strong) UIFont *textFont;//默认15
26 | @property (nonatomic, copy) NSArray *titlesArr;//文本数组
27 | @property (nonatomic, copy) NSArray *titleImgArr;//文本图片数组
28 |
29 |
30 | /**
31 | 纯图片轮播图
32 |
33 | @param frame 初始化frame
34 | @param isHorizontal 是否横向
35 | @return 图片轮播
36 | */
37 | + (instancetype)loopImageViewWithFrame:(CGRect)frame isHorizontal:(BOOL)isHorizontal;
38 |
39 |
40 | /**
41 | 带图片头文本轮播图
42 |
43 | @param frame 初始化frame
44 | @param isTitleView 是否为文本视图
45 | @param titleImgArr 头图片数组(可以置空)
46 | @return 文本轮播
47 | */
48 | + (instancetype)loopTitleViewWithFrame:(CGRect)frame isTitleView:(BOOL)isTitleView titleImgArr:(NSArray *)titleImgArr;
49 | @end
50 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/FSLoopScrollView/NSTimer+FSLoop.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSTimer+FSLoop.h
3 | // SFLoopScrollview
4 | //
5 | // Created by huim on 2017/3/6.
6 | // Copyright © 2017年 shunFSKi. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSTimer (FSLoop)
12 |
13 | - (void)pauseTimer;
14 | - (void)resumeTimer;
15 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval;
16 | @end
17 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/FSLoopScrollView/NSTimer+FSLoop.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSTimer+FSLoop.m
3 | // SFLoopScrollview
4 | //
5 | // Created by huim on 2017/3/6.
6 | // Copyright © 2017年 shunFSKi. All rights reserved.
7 | //
8 |
9 | #import "NSTimer+FSLoop.h"
10 |
11 | @implementation NSTimer (FSLoop)
12 |
13 | -(void)pauseTimer
14 | {
15 | if (![self isValid]) {
16 | return ;
17 | }
18 | [self setFireDate:[NSDate distantFuture]];
19 | }
20 |
21 |
22 | -(void)resumeTimer
23 | {
24 | if (![self isValid]) {
25 | return ;
26 | }
27 | [self setFireDate:[NSDate date]];
28 | }
29 |
30 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval
31 | {
32 | if (![self isValid]) {
33 | return ;
34 | }
35 | [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]];
36 | }
37 |
38 | - (void)stopTimer
39 | {
40 | if ([self isValid]) {
41 | [self invalidate];
42 | }
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/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 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | NSAppTransportSecurity
38 |
39 | NSAllowsArbitraryLoads
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // FSLoopScrollViewDemo
4 | //
5 | // Created by huim on 2017/3/6.
6 | // Copyright © 2017年 shunFSKi. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // FSLoopScrollViewDemo
4 | //
5 | // Created by huim on 2017/3/6.
6 | // Copyright © 2017年 shunFSKi. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "FSLoopScrollView.h"
11 |
12 |
13 | @interface ViewController ()
14 |
15 | @end
16 |
17 | @implementation ViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | // Do any additional setup after loading the view, typically from a nib.
22 | {
23 | FSLoopScrollView *loopView = [FSLoopScrollView loopImageViewWithFrame:CGRectMake(10, 20, CGRectGetWidth(self.view.bounds)-20, 200) isHorizontal:NO];
24 | loopView.imgResourceArr = @[@"1.jpg",@"2.jpg",@"3.jpg",@"4.jpg",@"5.jpg"];
25 | loopView.tapClickBlock = ^(FSLoopScrollView *loopView){
26 | NSString *message = [NSString stringWithFormat:@"老%ld被点啦",(long)loopView.currentIndex+1];
27 | UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"大顺啊" message:message delegate:self cancelButtonTitle:@"love you" otherButtonTitles:nil, nil];
28 | [alert show];
29 | };
30 | [self.view addSubview:loopView];
31 | }
32 | {
33 | FSLoopScrollView *loopView = [FSLoopScrollView loopImageViewWithFrame:CGRectMake(10, 300, CGRectGetWidth(self.view.bounds)-20, 200) isHorizontal:YES];
34 | loopView.imgResourceArr = @[@"http://img05.tooopen.com/images/20150202/sy_80219211654.jpg",
35 | @"http://img06.tooopen.com/images/20161123/tooopen_sy_187628854311.jpg",
36 | @"http://img07.tooopen.com/images/20170306/tooopen_sy_200775896618.jpg",
37 | @"http://img06.tooopen.com/images/20170224/tooopen_sy_199503612842.jpg",
38 | @"http://img02.tooopen.com/images/20160316/tooopen_sy_156105468631.jpg"];
39 | loopView.tapClickBlock = ^(FSLoopScrollView *loopView){
40 | NSString *message = [NSString stringWithFormat:@"老%ld被点啦",(long)loopView.currentIndex+1];
41 | UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"大顺啊" message:message delegate:self cancelButtonTitle:@"love you" otherButtonTitles:nil, nil];
42 | [alert show];
43 | };
44 | [self.view addSubview:loopView];
45 | }
46 | {
47 | FSLoopScrollView *loopView = [FSLoopScrollView loopTitleViewWithFrame:CGRectMake(10, 550, CGRectGetWidth(self.view.bounds)-20, 50) isTitleView:YES titleImgArr:@[@"home_ic_new",@"home_ic_hot",@"home_ic_new",@"home_ic_new",@"home_ic_hot"]];
48 | loopView.titlesArr = @[@"这是一个简易的文字轮播",
49 | @"This is a simple text rotation",
50 | @"นี่คือการหมุนข้อความที่เรียบง่าย",
51 | @"Это простое вращение текста",
52 | @"이것은 간단한 텍스트 회전 인"];
53 | loopView.tapClickBlock = ^(FSLoopScrollView *loopView){
54 | NSString *message = [NSString stringWithFormat:@"老%ld被点啦",(long)loopView.currentIndex+1];
55 | UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"大顺啊" message:message delegate:self cancelButtonTitle:@"love you" otherButtonTitles:nil, nil];
56 | [alert show];
57 | };
58 | [self.view addSubview:loopView];
59 | }
60 | }
61 |
62 |
63 | - (void)didReceiveMemoryWarning {
64 | [super didReceiveMemoryWarning];
65 | // Dispose of any resources that can be recreated.
66 | }
67 |
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/home_ic_hot@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/FSLoopScrollViewDemo/FSLoopScrollViewDemo/home_ic_hot@2x.png
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/home_ic_new@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/FSLoopScrollViewDemo/FSLoopScrollViewDemo/home_ic_new@2x.png
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/1.jpg
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/2.jpg
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/3.jpg
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/4.jpg
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/5.jpg
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/FSLoopScrollViewDemo/FSLoopScrollViewDemo/images/6.jpg
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/FSLoopScrollViewDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // FSLoopScrollViewDemo
4 | //
5 | // Created by huim on 2017/3/6.
6 | // Copyright © 2017年 shunFSKi. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '7.0'
2 |
3 | target 'FSLoopScrollViewDemo' do
4 |
5 | pod 'SDWebImage','~> 3.0'
6 | pod 'YYText'
7 | end
8 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SDWebImage (3.8.2):
3 | - SDWebImage/Core (= 3.8.2)
4 | - SDWebImage/Core (3.8.2)
5 | - YYText (1.0.7)
6 |
7 | DEPENDENCIES:
8 | - SDWebImage (~> 3.0)
9 | - YYText
10 |
11 | SPEC CHECKSUMS:
12 | SDWebImage: 098e97e6176540799c27e804c96653ee0833d13c
13 | YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
14 |
15 | PODFILE CHECKSUM: eb5ae3826271177dd7dd96a06975dd878fc80459
16 |
17 | COCOAPODS: 1.2.0
18 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/SDImageCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCache.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/SDWebImageManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/NSAttributedString+YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/NSAttributedString+YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/NSParagraphStyle+YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/NSParagraphStyle+YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/UIPasteboard+YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/UIPasteboard+YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/UIView+YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/UIView+YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYLabel.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/YYLabel.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextArchiver.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextArchiver.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextAsyncLayer.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/YYTextAsyncLayer.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextAttribute.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextAttribute.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextContainerView.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextContainerView.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextDebugOption.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextDebugOption.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextEffectWindow.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextEffectWindow.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextInput.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextInput.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextKeyboardManager.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextKeyboardManager.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextLayout.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextLayout.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextLine.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextLine.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextMagnifier.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextMagnifier.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextParser.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextParser.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextRubyAnnotation.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextRubyAnnotation.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextRunDelegate.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextRunDelegate.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextSelectionView.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextSelectionView.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextTransaction.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/YYTextTransaction.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextUtilities.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/YYTextUtilities.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextView.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/YYTextView.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Private/YYText/YYTextWeakProxy.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/YYTextWeakProxy.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/SDImageCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCache.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/SDWebImageManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/NSAttributedString+YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/NSAttributedString+YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/NSParagraphStyle+YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/NSParagraphStyle+YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/UIPasteboard+YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/UIPasteboard+YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/UIView+YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/UIView+YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYLabel.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/YYLabel.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYText.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/YYText.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextArchiver.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextArchiver.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextAsyncLayer.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/YYTextAsyncLayer.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextAttribute.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextAttribute.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextContainerView.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextContainerView.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextDebugOption.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextDebugOption.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextEffectWindow.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextEffectWindow.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextInput.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextInput.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextKeyboardManager.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextKeyboardManager.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextLayout.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextLayout.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextLine.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextLine.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextMagnifier.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextMagnifier.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextParser.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextParser.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextRubyAnnotation.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextRubyAnnotation.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextRunDelegate.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/String/YYTextRunDelegate.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextSelectionView.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Component/YYTextSelectionView.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextTransaction.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/YYTextTransaction.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextUtilities.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/YYTextUtilities.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextView.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/YYTextView.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Headers/Public/YYText/YYTextWeakProxy.h:
--------------------------------------------------------------------------------
1 | ../../../YYText/YYText/Utility/YYTextWeakProxy.h
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SDWebImage (3.8.2):
3 | - SDWebImage/Core (= 3.8.2)
4 | - SDWebImage/Core (3.8.2)
5 | - YYText (1.0.7)
6 |
7 | DEPENDENCIES:
8 | - SDWebImage (~> 3.0)
9 | - YYText
10 |
11 | SPEC CHECKSUMS:
12 | SDWebImage: 098e97e6176540799c27e804c96653ee0833d13c
13 | YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
14 |
15 | PODFILE CHECKSUM: eb5ae3826271177dd7dd96a06975dd878fc80459
16 |
17 | COCOAPODS: 1.2.0
18 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/SDWebImage/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Olivier Poitrey rs@dailymotion.com
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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 Deployment 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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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;
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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 | // while downloading huge amount of images
17 | // autorelease the bitmap context
18 | // and all vars to help system to free memory
19 | // when there are memory warning.
20 | // on iOS7, do not forget to call
21 | // [[SDImageCache sharedImageCache] clearMemory];
22 |
23 | if (image == nil) { // Prevent "CGBitmapContextCreateImage: invalid context 0x0" error
24 | return nil;
25 | }
26 |
27 | @autoreleasepool{
28 | // do not decode animated images
29 | if (image.images != nil) {
30 | return image;
31 | }
32 |
33 | CGImageRef imageRef = image.CGImage;
34 |
35 | CGImageAlphaInfo alpha = CGImageGetAlphaInfo(imageRef);
36 | BOOL anyAlpha = (alpha == kCGImageAlphaFirst ||
37 | alpha == kCGImageAlphaLast ||
38 | alpha == kCGImageAlphaPremultipliedFirst ||
39 | alpha == kCGImageAlphaPremultipliedLast);
40 | if (anyAlpha) {
41 | return image;
42 | }
43 |
44 | // current
45 | CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(CGImageGetColorSpace(imageRef));
46 | CGColorSpaceRef colorspaceRef = CGImageGetColorSpace(imageRef);
47 |
48 | BOOL unsupportedColorSpace = (imageColorSpaceModel == kCGColorSpaceModelUnknown ||
49 | imageColorSpaceModel == kCGColorSpaceModelMonochrome ||
50 | imageColorSpaceModel == kCGColorSpaceModelCMYK ||
51 | imageColorSpaceModel == kCGColorSpaceModelIndexed);
52 | if (unsupportedColorSpace) {
53 | colorspaceRef = CGColorSpaceCreateDeviceRGB();
54 | }
55 |
56 | size_t width = CGImageGetWidth(imageRef);
57 | size_t height = CGImageGetHeight(imageRef);
58 | NSUInteger bytesPerPixel = 4;
59 | NSUInteger bytesPerRow = bytesPerPixel * width;
60 | NSUInteger bitsPerComponent = 8;
61 |
62 |
63 | // kCGImageAlphaNone is not supported in CGBitmapContextCreate.
64 | // Since the original image here has no alpha info, use kCGImageAlphaNoneSkipLast
65 | // to create bitmap graphics contexts without alpha info.
66 | CGContextRef context = CGBitmapContextCreate(NULL,
67 | width,
68 | height,
69 | bitsPerComponent,
70 | bytesPerRow,
71 | colorspaceRef,
72 | kCGBitmapByteOrderDefault|kCGImageAlphaNoneSkipLast);
73 |
74 | // Draw the image into the context and retrieve the new bitmap image without alpha
75 | CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef);
76 | CGImageRef imageRefWithoutAlpha = CGBitmapContextCreateImage(context);
77 | UIImage *imageWithoutAlpha = [UIImage imageWithCGImage:imageRefWithoutAlpha
78 | scale:image.scale
79 | orientation:image.imageOrientation];
80 |
81 | if (unsupportedColorSpace) {
82 | CGColorSpaceRelease(colorspaceRef);
83 | }
84 |
85 | CGContextRelease(context);
86 | CGImageRelease(imageRefWithoutAlpha);
87 |
88 | return imageWithoutAlpha;
89 | }
90 | }
91 |
92 | @end
93 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 use 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 certificates.
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 performance 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 the default URL credential to be set for request operations.
114 | */
115 | @property (strong, nonatomic) NSURLCredential *urlCredential;
116 |
117 | /**
118 | * Set username
119 | */
120 | @property (strong, nonatomic) NSString *username;
121 |
122 | /**
123 | * Set password
124 | */
125 | @property (strong, nonatomic) NSString *password;
126 |
127 | /**
128 | * Set filter to pick headers for downloading image HTTP request.
129 | *
130 | * This block will be invoked for each downloading image request, returned
131 | * NSDictionary will be used as headers in corresponding HTTP request.
132 | */
133 | @property (nonatomic, copy) SDWebImageDownloaderHeadersFilterBlock headersFilter;
134 |
135 | /**
136 | * Set a value for a HTTP header to be appended to each download HTTP request.
137 | *
138 | * @param value The value for the header field. Use `nil` value to remove the header.
139 | * @param field The name of the header field to set.
140 | */
141 | - (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field;
142 |
143 | /**
144 | * Returns the value of the specified HTTP header field.
145 | *
146 | * @return The value associated with the header field field, or `nil` if there is no corresponding header field.
147 | */
148 | - (NSString *)valueForHTTPHeaderField:(NSString *)field;
149 |
150 | /**
151 | * Sets a subclass of `SDWebImageDownloaderOperation` as the default
152 | * `NSOperation` to be used each time SDWebImage constructs a request
153 | * operation to download an image.
154 | *
155 | * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set
156 | * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`.
157 | */
158 | - (void)setOperationClass:(Class)operationClass;
159 |
160 | /**
161 | * Creates a SDWebImageDownloader async downloader instance with a given URL
162 | *
163 | * The delegate will be informed when the image is finish downloaded or an error has happen.
164 | *
165 | * @see SDWebImageDownloaderDelegate
166 | *
167 | * @param url The URL to the image to download
168 | * @param options The options to be used for this download
169 | * @param progressBlock A block called repeatedly while the image is downloading
170 | * @param completedBlock A block called once the download is completed.
171 | * If the download succeeded, the image parameter is set, in case of error,
172 | * error parameter is set with the error. The last parameter is always YES
173 | * if SDWebImageDownloaderProgressiveDownload isn't use. With the
174 | * SDWebImageDownloaderProgressiveDownload option, this block is called
175 | * repeatedly with the partial image object and the finished argument set to NO
176 | * before to be called a last time with the full image and finished argument
177 | * set to YES. In case of error, the finished argument is always YES.
178 | *
179 | * @return A cancellable SDWebImageOperation
180 | */
181 | - (id )downloadImageWithURL:(NSURL *)url
182 | options:(SDWebImageDownloaderOptions)options
183 | progress:(SDWebImageDownloaderProgressBlock)progressBlock
184 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock;
185 |
186 | /**
187 | * Sets the download queue suspension state
188 | */
189 | - (void)setSuspended:(BOOL)suspended;
190 |
191 | /**
192 | * Cancels all download operations in the queue
193 | */
194 | - (void)cancelAllDownloads;
195 |
196 | @end
197 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 task.
22 | */
23 | @property (strong, nonatomic, readonly) NSURLRequest *request;
24 |
25 | /**
26 | * The operation's task
27 | */
28 | @property (strong, nonatomic, readonly) NSURLSessionTask *dataTask;
29 |
30 |
31 | @property (assign, nonatomic) BOOL shouldDecompressImages;
32 |
33 | /**
34 | * Was used to determine whether the URL connection should consult the credential storage for authenticating the connection.
35 | * @deprecated Not used for a couple of versions
36 | */
37 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage __deprecated_msg("Property deprecated. Does nothing. Kept only for backwards compatibility");
38 |
39 | /**
40 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`.
41 | *
42 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present.
43 | */
44 | @property (nonatomic, strong) NSURLCredential *credential;
45 |
46 | /**
47 | * The SDWebImageDownloaderOptions for the receiver.
48 | */
49 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options;
50 |
51 | /**
52 | * The expected size of data.
53 | */
54 | @property (assign, nonatomic) NSInteger expectedSize;
55 |
56 | /**
57 | * The response returned by the operation's connection.
58 | */
59 | @property (strong, nonatomic) NSURLResponse *response;
60 |
61 | /**
62 | * Initializes a `SDWebImageDownloaderOperation` object
63 | *
64 | * @see SDWebImageDownloaderOperation
65 | *
66 | * @param request the URL request
67 | * @param session the URL session in which this operation will run
68 | * @param options downloader options
69 | * @param progressBlock the block executed when a new chunk of data arrives.
70 | * @note the progress block is executed on a background queue
71 | * @param completedBlock the block executed when the download is done.
72 | * @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
73 | * @param cancelBlock the block executed if the download (operation) is cancelled
74 | *
75 | * @return the initialized instance
76 | */
77 | - (id)initWithRequest:(NSURLRequest *)request
78 | inSession:(NSURLSession *)session
79 | options:(SDWebImageDownloaderOptions)options
80 | progress:(SDWebImageDownloaderProgressBlock)progressBlock
81 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock
82 | cancelled:(SDWebImageNoParamsBlock)cancelBlock;
83 |
84 | /**
85 | * Initializes a `SDWebImageDownloaderOperation` object
86 | *
87 | * @see SDWebImageDownloaderOperation
88 | *
89 | * @param request the URL request
90 | * @param options downloader options
91 | * @param progressBlock the block executed when a new chunk of data arrives.
92 | * @note the progress block is executed on a background queue
93 | * @param completedBlock the block executed when the download is done.
94 | * @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
95 | * @param cancelBlock the block executed if the download (operation) is cancelled
96 | *
97 | * @return the initialized instance. The operation will run in a separate session created for this operation
98 | */
99 | - (id)initWithRequest:(NSURLRequest *)request
100 | options:(SDWebImageDownloaderOptions)options
101 | progress:(SDWebImageDownloaderProgressBlock)progressBlock
102 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock
103 | cancelled:(SDWebImageNoParamsBlock)cancelBlock
104 | __deprecated_msg("Method deprecated. Use `initWithRequest:inSession:options:progress:completed:cancelled`");
105 |
106 | @end
107 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 | * Allows you to instantiate a prefetcher with any arbitrary image manager.
75 | */
76 | - (id)initWithImageManager:(SDWebImageManager *)manager;
77 |
78 | /**
79 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
80 | * currently one image is downloaded at a time,
81 | * and skips images for failed downloads and proceed to the next image in the list
82 | *
83 | * @param urls list of URLs to prefetch
84 | */
85 | - (void)prefetchURLs:(NSArray *)urls;
86 |
87 | /**
88 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
89 | * currently one image is downloaded at a time,
90 | * and skips images for failed downloads and proceed to the next image in the list
91 | *
92 | * @param urls list of URLs to prefetch
93 | * @param progressBlock block to be called when progress updates;
94 | * first parameter is the number of completed (successful or not) requests,
95 | * second parameter is the total number of images originally requested to be prefetched
96 | * @param completionBlock block to be called when prefetching is completed
97 | * first param is the number of completed (successful or not) requests,
98 | * second parameter is the number of skipped requests
99 | */
100 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock;
101 |
102 | /**
103 | * Remove and cancel queued list
104 | */
105 | - (void)cancelPrefetching;
106 |
107 |
108 | @end
109 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 | @interface SDWebImagePrefetcher ()
12 |
13 | @property (strong, nonatomic) SDWebImageManager *manager;
14 | @property (strong, nonatomic) NSArray *prefetchURLs;
15 | @property (assign, nonatomic) NSUInteger requestedCount;
16 | @property (assign, nonatomic) NSUInteger skippedCount;
17 | @property (assign, nonatomic) NSUInteger finishedCount;
18 | @property (assign, nonatomic) NSTimeInterval startedTime;
19 | @property (copy, nonatomic) SDWebImagePrefetcherCompletionBlock completionBlock;
20 | @property (copy, nonatomic) SDWebImagePrefetcherProgressBlock progressBlock;
21 |
22 | @end
23 |
24 | @implementation SDWebImagePrefetcher
25 |
26 | + (SDWebImagePrefetcher *)sharedImagePrefetcher {
27 | static dispatch_once_t once;
28 | static id instance;
29 | dispatch_once(&once, ^{
30 | instance = [self new];
31 | });
32 | return instance;
33 | }
34 |
35 | - (id)init {
36 | return [self initWithImageManager:[SDWebImageManager new]];
37 | }
38 |
39 | - (id)initWithImageManager:(SDWebImageManager *)manager {
40 | if ((self = [super init])) {
41 | _manager = manager;
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 | }
69 | else {
70 | if (self.progressBlock) {
71 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]);
72 | }
73 | // Add last failed
74 | self.skippedCount++;
75 | }
76 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) {
77 | [self.delegate imagePrefetcher:self
78 | didPrefetchURL:self.prefetchURLs[index]
79 | finishedCount:self.finishedCount
80 | totalCount:self.prefetchURLs.count
81 | ];
82 | }
83 | if (self.prefetchURLs.count > self.requestedCount) {
84 | dispatch_async(self.prefetcherQueue, ^{
85 | [self startPrefetchingAtIndex:self.requestedCount];
86 | });
87 | } else if (self.finishedCount == self.requestedCount) {
88 | [self reportStatus];
89 | if (self.completionBlock) {
90 | self.completionBlock(self.finishedCount, self.skippedCount);
91 | self.completionBlock = nil;
92 | }
93 | self.progressBlock = nil;
94 | }
95 | }];
96 | }
97 |
98 | - (void)reportStatus {
99 | NSUInteger total = [self.prefetchURLs count];
100 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) {
101 | [self.delegate imagePrefetcher:self
102 | didFinishWithTotalCount:(total - self.skippedCount)
103 | skippedCount:self.skippedCount
104 | ];
105 | }
106 | }
107 |
108 | - (void)prefetchURLs:(NSArray *)urls {
109 | [self prefetchURLs:urls progress:nil completed:nil];
110 | }
111 |
112 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock {
113 | [self cancelPrefetching]; // Prevent duplicate prefetch request
114 | self.startedTime = CFAbsoluteTimeGetCurrent();
115 | self.prefetchURLs = urls;
116 | self.completionBlock = completionBlock;
117 | self.progressBlock = progressBlock;
118 |
119 | if (urls.count == 0) {
120 | if (completionBlock) {
121 | completionBlock(0,0);
122 | }
123 | } else {
124 | // Starts prefetching from the very first image on the list with the max allowed concurrency
125 | NSUInteger listCount = self.prefetchURLs.count;
126 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) {
127 | [self startPrefetchingAtIndex:i];
128 | }
129 | }
130 | }
131 |
132 | - (void)cancelPrefetching {
133 | self.prefetchURLs = nil;
134 | self.skippedCount = 0;
135 | self.requestedCount = 0;
136 | self.finishedCount = 0;
137 | [self.manager cancelAll];
138 | }
139 |
140 | @end
141 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 | if (!image) {
36 | continue;
37 | }
38 |
39 | duration += [self sd_frameDurationAtIndex:i source:source];
40 |
41 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]];
42 |
43 | CGImageRelease(image);
44 | }
45 |
46 | if (!duration) {
47 | duration = (1.0f / 10.0f) * count;
48 | }
49 |
50 | animatedImage = [UIImage animatedImageWithImages:images duration:duration];
51 | }
52 |
53 | CFRelease(source);
54 |
55 | return animatedImage;
56 | }
57 |
58 | + (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
59 | float frameDuration = 0.1f;
60 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
61 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
62 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary];
63 |
64 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime];
65 | if (delayTimeUnclampedProp) {
66 | frameDuration = [delayTimeUnclampedProp floatValue];
67 | }
68 | else {
69 |
70 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime];
71 | if (delayTimeProp) {
72 | frameDuration = [delayTimeProp floatValue];
73 | }
74 | }
75 |
76 | // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
77 | // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
78 | // a duration of <= 10 ms. See and
79 | // for more information.
80 |
81 | if (frameDuration < 0.011f) {
82 | frameDuration = 0.100f;
83 | }
84 |
85 | CFRelease(cfFrameProperties);
86 | return frameDuration;
87 | }
88 |
89 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name {
90 | CGFloat scale = [UIScreen mainScreen].scale;
91 |
92 | if (scale > 1.0f) {
93 | NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"];
94 |
95 | NSData *data = [NSData dataWithContentsOfFile:retinaPath];
96 |
97 | if (data) {
98 | return [UIImage sd_animatedGIFWithData:data];
99 | }
100 |
101 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"];
102 |
103 | data = [NSData dataWithContentsOfFile:path];
104 |
105 | if (data) {
106 | return [UIImage sd_animatedGIFWithData:data];
107 | }
108 |
109 | return [UIImage imageNamed:name];
110 | }
111 | else {
112 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"];
113 |
114 | NSData *data = [NSData dataWithContentsOfFile:path];
115 |
116 | if (data) {
117 | return [UIImage sd_animatedGIFWithData:data];
118 | }
119 |
120 | return [UIImage imageNamed:name];
121 | }
122 | }
123 |
124 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size {
125 | if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) {
126 | return self;
127 | }
128 |
129 | CGSize scaledSize = size;
130 | CGPoint thumbnailPoint = CGPointZero;
131 |
132 | CGFloat widthFactor = size.width / self.size.width;
133 | CGFloat heightFactor = size.height / self.size.height;
134 | CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor;
135 | scaledSize.width = self.size.width * scaleFactor;
136 | scaledSize.height = self.size.height * scaleFactor;
137 |
138 | if (widthFactor > heightFactor) {
139 | thumbnailPoint.y = (size.height - scaledSize.height) * 0.5;
140 | }
141 | else if (widthFactor < heightFactor) {
142 | thumbnailPoint.x = (size.width - scaledSize.width) * 0.5;
143 | }
144 |
145 | NSMutableArray *scaledImages = [NSMutableArray array];
146 |
147 | for (UIImage *image in self.images) {
148 | UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
149 |
150 | [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)];
151 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
152 |
153 | [scaledImages addObject:newImage];
154 |
155 | UIGraphicsEndImageContext();
156 | }
157 |
158 | return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
159 | }
160 |
161 | @end
162 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 retrieved 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 retrieved 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 retrieved 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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 && (options & SDWebImageAvoidAutoSetImage) && completedBlock)
43 | {
44 | completedBlock(image, error, cacheType, url);
45 | return;
46 | }
47 | else if (image) {
48 | wself.highlightedImage = image;
49 | [wself setNeedsLayout];
50 | }
51 | if (completedBlock && finished) {
52 | completedBlock(image, error, cacheType, url);
53 | }
54 | });
55 | }];
56 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey];
57 | } else {
58 | dispatch_main_async_safe(^{
59 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
60 | if (completedBlock) {
61 | completedBlock(nil, error, SDImageCacheTypeNone, url);
62 | }
63 | });
64 | }
65 | }
66 |
67 | - (void)sd_cancelCurrentHighlightedImageLoad {
68 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey];
69 | }
70 |
71 | @end
72 |
73 |
74 | @implementation UIImageView (HighlightedWebCacheDeprecated)
75 |
76 | - (void)setHighlightedImageWithURL:(NSURL *)url {
77 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil];
78 | }
79 |
80 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options {
81 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil];
82 | }
83 |
84 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock {
85 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
86 | if (completedBlock) {
87 | completedBlock(image, error, cacheType);
88 | }
89 | }];
90 | }
91 |
92 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
93 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
94 | if (completedBlock) {
95 | completedBlock(image, error, cacheType);
96 | }
97 | }];
98 | }
99 |
100 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock {
101 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
102 | if (completedBlock) {
103 | completedBlock(image, error, cacheType);
104 | }
105 | }];
106 | }
107 |
108 | - (void)cancelCurrentHighlightedImageLoad {
109 | [self sd_cancelCurrentHighlightedImageLoad];
110 | }
111 |
112 | @end
113 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/Pods-FSLoopScrollViewDemo/Pods-FSLoopScrollViewDemo-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SDWebImage
5 |
6 | Copyright (c) 2016 Olivier Poitrey rs@dailymotion.com
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 |
28 | ## YYText
29 |
30 | The MIT License (MIT)
31 |
32 | Copyright (c) 2015 ibireme
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
39 | furnished 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 THE
50 | SOFTWARE.
51 |
52 |
53 | Generated by CocoaPods - https://cocoapods.org
54 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/Pods-FSLoopScrollViewDemo/Pods-FSLoopScrollViewDemo-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) 2016 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 | License
39 | MIT
40 | Title
41 | SDWebImage
42 | Type
43 | PSGroupSpecifier
44 |
45 |
46 | FooterText
47 | The MIT License (MIT)
48 |
49 | Copyright (c) 2015 ibireme <ibireme@gmail.com>
50 |
51 | Permission is hereby granted, free of charge, to any person obtaining a copy
52 | of this software and associated documentation files (the "Software"), to deal
53 | in the Software without restriction, including without limitation the rights
54 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55 | copies of the Software, and to permit persons to whom the Software is
56 | furnished to do so, subject to the following conditions:
57 |
58 | The above copyright notice and this permission notice shall be included in all
59 | copies or substantial portions of the Software.
60 |
61 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67 | SOFTWARE.
68 |
69 |
70 | License
71 | MIT
72 | Title
73 | YYText
74 | Type
75 | PSGroupSpecifier
76 |
77 |
78 | FooterText
79 | Generated by CocoaPods - https://cocoapods.org
80 | Title
81 |
82 | Type
83 | PSGroupSpecifier
84 |
85 |
86 | StringsTable
87 | Acknowledgements
88 | Title
89 | Acknowledgements
90 |
91 |
92 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/Pods-FSLoopScrollViewDemo/Pods-FSLoopScrollViewDemo-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_FSLoopScrollViewDemo : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_FSLoopScrollViewDemo
5 | @end
6 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/Pods-FSLoopScrollViewDemo/Pods-FSLoopScrollViewDemo-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="${TARGET_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 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
63 |
64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
65 | code_sign_cmd="$code_sign_cmd &"
66 | fi
67 | echo "$code_sign_cmd"
68 | eval "$code_sign_cmd"
69 | fi
70 | }
71 |
72 | # Strip invalid architectures
73 | strip_invalid_archs() {
74 | binary="$1"
75 | # Get architectures for current file
76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
77 | stripped=""
78 | for arch in $archs; do
79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
80 | # Strip non-valid architectures in-place
81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
82 | stripped="$stripped $arch"
83 | fi
84 | done
85 | if [[ "$stripped" ]]; then
86 | echo "Stripped $binary of architectures:$stripped"
87 | fi
88 | }
89 |
90 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
91 | wait
92 | fi
93 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/Pods-FSLoopScrollViewDemo/Pods-FSLoopScrollViewDemo-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_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 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | 3)
22 | TARGET_DEVICE_ARGS="--target-device tv"
23 | ;;
24 | *)
25 | TARGET_DEVICE_ARGS="--target-device mac"
26 | ;;
27 | esac
28 |
29 | install_resource()
30 | {
31 | if [[ "$1" = /* ]] ; then
32 | RESOURCE_PATH="$1"
33 | else
34 | RESOURCE_PATH="${PODS_ROOT}/$1"
35 | fi
36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
37 | cat << EOM
38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
39 | EOM
40 | exit 1
41 | fi
42 | case $RESOURCE_PATH in
43 | *.storyboard)
44 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
45 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
46 | ;;
47 | *.xib)
48 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
49 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
50 | ;;
51 | *.framework)
52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | ;;
57 | *.xcdatamodel)
58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
60 | ;;
61 | *.xcdatamodeld)
62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
64 | ;;
65 | *.xcmappingmodel)
66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
68 | ;;
69 | *.xcassets)
70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
72 | ;;
73 | *)
74 | echo "$RESOURCE_PATH"
75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
76 | ;;
77 | esac
78 | }
79 |
80 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
83 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | fi
86 | rm -f "$RESOURCES_TO_COPY"
87 |
88 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
89 | then
90 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
91 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
92 | while read line; do
93 | if [[ $line != "${PODS_ROOT}*" ]]; then
94 | XCASSET_FILES+=("$line")
95 | fi
96 | done <<<"$OTHER_XCASSETS"
97 |
98 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | fi
100 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/Pods-FSLoopScrollViewDemo/Pods-FSLoopScrollViewDemo.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/YYText"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/YYText"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/YYText"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -l"YYText" -framework "Accelerate" -framework "CoreFoundation" -framework "CoreText" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "UIKit"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/Pods-FSLoopScrollViewDemo/Pods-FSLoopScrollViewDemo.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/YYText"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/YYText"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/YYText"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -l"YYText" -framework "Accelerate" -framework "CoreFoundation" -framework "CoreText" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "UIKit"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SDWebImage : NSObject
3 | @end
4 | @implementation PodsDummy_SDWebImage
5 | @end
6 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDWebImage
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/YYText"
4 | OTHER_LDFLAGS = -framework "ImageIO"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/YYText/YYText-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_YYText : NSObject
3 | @end
4 | @implementation PodsDummy_YYText
5 | @end
6 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/YYText/YYText-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/Target Support Files/YYText/YYText.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YYText
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYText" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/YYText"
4 | OTHER_LDFLAGS = -framework "Accelerate" -framework "CoreFoundation" -framework "CoreText" -framework "MobileCoreServices" -framework "QuartzCore" -framework "UIKit"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYText
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 ibireme
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 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextContainerView.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextContainerView.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/21.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | #if __has_include()
15 | #import
16 | #else
17 | #import "YYTextLayout.h"
18 | #endif
19 |
20 | NS_ASSUME_NONNULL_BEGIN
21 |
22 | /**
23 | A simple view to diaplay `YYTextLayout`.
24 |
25 | @discussion This view can become first responder. If this view is first responder,
26 | all the action (such as UIMenu's action) would forward to the `hostView` property.
27 | Typically, you should not use this class directly.
28 |
29 | @warning All the methods in this class should be called on main thread.
30 | */
31 | @interface YYTextContainerView : UIView
32 |
33 | /// First responder's aciton will forward to this view.
34 | @property (nullable, nonatomic, weak) UIView *hostView;
35 |
36 | /// Debug option for layout debug. Set this property will let the view redraw it's contents.
37 | @property (nullable, nonatomic, copy) YYTextDebugOption *debugOption;
38 |
39 | /// Text vertical alignment.
40 | @property (nonatomic) YYTextVerticalAlignment textVerticalAlignment;
41 |
42 | /// Text layout. Set this property will let the view redraw it's contents.
43 | @property (nullable, nonatomic, strong) YYTextLayout *layout;
44 |
45 | /// The contents fade animation duration when the layout's contents changed. Default is 0 (no animation).
46 | @property (nonatomic) NSTimeInterval contentsFadeDuration;
47 |
48 | /// Convenience method to set `layout` and `contentsFadeDuration`.
49 | /// @param layout Same as `layout` property.
50 | /// @param fadeDuration Same as `contentsFadeDuration` property.
51 | - (void)setLayout:(nullable YYTextLayout *)layout withFadeDuration:(NSTimeInterval)fadeDuration;
52 |
53 | @end
54 |
55 | NS_ASSUME_NONNULL_END
56 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextContainerView.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextContainerView.m
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/21.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextContainerView.h"
13 |
14 | @implementation YYTextContainerView {
15 | BOOL _attachmentChanged;
16 | NSMutableArray *_attachmentViews;
17 | NSMutableArray *_attachmentLayers;
18 | }
19 |
20 | - (instancetype)initWithFrame:(CGRect)frame {
21 | self = [super initWithFrame:frame];
22 | if (!self) return nil;
23 | self.backgroundColor = [UIColor clearColor];
24 | _attachmentViews = [NSMutableArray array];
25 | _attachmentLayers = [NSMutableArray array];
26 | return self;
27 | }
28 |
29 | - (void)setDebugOption:(YYTextDebugOption *)debugOption {
30 | BOOL needDraw = _debugOption.needDrawDebug;
31 | _debugOption = debugOption.copy;
32 | if (_debugOption.needDrawDebug != needDraw) {
33 | [self setNeedsDisplay];
34 | }
35 | }
36 |
37 | - (void)setTextVerticalAlignment:(YYTextVerticalAlignment)textVerticalAlignment {
38 | if (_textVerticalAlignment == textVerticalAlignment) return;
39 | _textVerticalAlignment = textVerticalAlignment;
40 | [self setNeedsDisplay];
41 | }
42 |
43 | - (void)setContentsFadeDuration:(NSTimeInterval)contentsFadeDuration {
44 | if (_contentsFadeDuration == contentsFadeDuration) return;
45 | _contentsFadeDuration = contentsFadeDuration;
46 | if (contentsFadeDuration <= 0) {
47 | [self.layer removeAnimationForKey:@"contents"];
48 | }
49 | }
50 |
51 | - (void)setLayout:(YYTextLayout *)layout {
52 | if (_layout == layout) return;
53 | _layout = layout;
54 | _attachmentChanged = YES;
55 | [self setNeedsDisplay];
56 | }
57 |
58 | - (void)setLayout:(YYTextLayout *)layout withFadeDuration:(NSTimeInterval)fadeDuration {
59 | self.contentsFadeDuration = fadeDuration;
60 | self.layout = layout;
61 | }
62 |
63 | - (void)drawRect:(CGRect)rect {
64 | // fade content
65 | [self.layer removeAnimationForKey:@"contents"];
66 | if (_contentsFadeDuration > 0) {
67 | CATransition *transition = [CATransition animation];
68 | transition.duration = _contentsFadeDuration;
69 | transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
70 | transition.type = kCATransitionFade;
71 | [self.layer addAnimation:transition forKey:@"contents"];
72 | }
73 |
74 | // update attachment
75 | if (_attachmentChanged) {
76 | for (UIView *view in _attachmentViews) {
77 | if (view.superview == self) [view removeFromSuperview];
78 | }
79 | for (CALayer *layer in _attachmentLayers) {
80 | if (layer.superlayer == self.layer) [layer removeFromSuperlayer];
81 | }
82 | [_attachmentViews removeAllObjects];
83 | [_attachmentLayers removeAllObjects];
84 | }
85 |
86 | // draw layout
87 | CGSize boundingSize = _layout.textBoundingSize;
88 | CGPoint point = CGPointZero;
89 | if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) {
90 | if (_layout.container.isVerticalForm) {
91 | point.x = -(self.bounds.size.width - boundingSize.width) * 0.5;
92 | } else {
93 | point.y = (self.bounds.size.height - boundingSize.height) * 0.5;
94 | }
95 | } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) {
96 | if (_layout.container.isVerticalForm) {
97 | point.x = -(self.bounds.size.width - boundingSize.width);
98 | } else {
99 | point.y = (self.bounds.size.height - boundingSize.height);
100 | }
101 | }
102 | [_layout drawInContext:UIGraphicsGetCurrentContext() size:self.bounds.size point:point view:self layer:self.layer debug:_debugOption cancel:nil];
103 |
104 | // update attachment
105 | if (_attachmentChanged) {
106 | _attachmentChanged = NO;
107 | for (YYTextAttachment *a in _layout.attachments) {
108 | if ([a.content isKindOfClass:[UIView class]]) [_attachmentViews addObject:a.content];
109 | if ([a.content isKindOfClass:[CALayer class]]) [_attachmentLayers addObject:a.content];
110 | }
111 | }
112 | }
113 |
114 | - (void)setFrame:(CGRect)frame {
115 | CGSize oldSize = self.bounds.size;
116 | [super setFrame:frame];
117 | if (!CGSizeEqualToSize(oldSize, self.bounds.size)) {
118 | [self setNeedsLayout];
119 | }
120 | }
121 |
122 | - (void)setBounds:(CGRect)bounds {
123 | CGSize oldSize = self.bounds.size;
124 | [super setBounds:bounds];
125 | if (!CGSizeEqualToSize(oldSize, self.bounds.size)) {
126 | [self setNeedsLayout];
127 | }
128 | }
129 |
130 | #pragma mark - UIResponder forward
131 |
132 | - (BOOL)canBecomeFirstResponder {
133 | return YES;
134 | }
135 |
136 | - (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
137 | return [self.hostView canPerformAction:action withSender:sender];
138 | }
139 |
140 | - (id)forwardingTargetForSelector:(SEL)aSelector {
141 | return self.hostView;
142 | }
143 |
144 | @end
145 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextDebugOption.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextDebugOption.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/8.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | @class YYTextDebugOption;
15 |
16 | NS_ASSUME_NONNULL_BEGIN
17 |
18 | /**
19 | The YYTextDebugTarget protocol defines the method a debug target should implement.
20 | A debug target can be add to the global container to receive the shared debug
21 | option changed notification.
22 | */
23 | @protocol YYTextDebugTarget
24 |
25 | @required
26 | /**
27 | When the shared debug option changed, this method would be called on main thread.
28 | It should return as quickly as possible. The option's property should not be changed
29 | in this method.
30 |
31 | @param option The shared debug option.
32 | */
33 | - (void)setDebugOption:(nullable YYTextDebugOption *)option;
34 | @end
35 |
36 |
37 |
38 | /**
39 | The debug option for YYText.
40 | */
41 | @interface YYTextDebugOption : NSObject
42 | @property (nullable, nonatomic, strong) UIColor *baselineColor; ///< baseline color
43 | @property (nullable, nonatomic, strong) UIColor *CTFrameBorderColor; ///< CTFrame path border color
44 | @property (nullable, nonatomic, strong) UIColor *CTFrameFillColor; ///< CTFrame path fill color
45 | @property (nullable, nonatomic, strong) UIColor *CTLineBorderColor; ///< CTLine bounds border color
46 | @property (nullable, nonatomic, strong) UIColor *CTLineFillColor; ///< CTLine bounds fill color
47 | @property (nullable, nonatomic, strong) UIColor *CTLineNumberColor; ///< CTLine line number color
48 | @property (nullable, nonatomic, strong) UIColor *CTRunBorderColor; ///< CTRun bounds border color
49 | @property (nullable, nonatomic, strong) UIColor *CTRunFillColor; ///< CTRun bounds fill color
50 | @property (nullable, nonatomic, strong) UIColor *CTRunNumberColor; ///< CTRun number color
51 | @property (nullable, nonatomic, strong) UIColor *CGGlyphBorderColor; ///< CGGlyph bounds border color
52 | @property (nullable, nonatomic, strong) UIColor *CGGlyphFillColor; ///< CGGlyph bounds fill color
53 |
54 | - (BOOL)needDrawDebug; ///< `YES`: at least one debug color is visible. `NO`: all debug color is invisible/nil.
55 | - (void)clear; ///< Set all debug color to nil.
56 |
57 | /**
58 | Add a debug target.
59 |
60 | @discussion When `setSharedDebugOption:` is called, all added debug target will
61 | receive `setDebugOption:` in main thread. It maintains an unsafe_unretained
62 | reference to this target. The target must to removed before dealloc.
63 |
64 | @param target A debug target.
65 | */
66 | + (void)addDebugTarget:(id)target;
67 |
68 | /**
69 | Remove a debug target which is added by `addDebugTarget:`.
70 |
71 | @param target A debug target.
72 | */
73 | + (void)removeDebugTarget:(id)target;
74 |
75 | /**
76 | Returns the shared debug option.
77 |
78 | @return The shared debug option, default is nil.
79 | */
80 | + (nullable YYTextDebugOption *)sharedDebugOption;
81 |
82 | /**
83 | Set a debug option as shared debug option.
84 | This method must be called on main thread.
85 |
86 | @discussion When call this method, the new option will set to all debug target
87 | which is added by `addDebugTarget:`.
88 |
89 | @param option A new debug option (nil is valid).
90 | */
91 | + (void)setSharedDebugOption:(nullable YYTextDebugOption *)option;
92 |
93 | @end
94 |
95 | NS_ASSUME_NONNULL_END
96 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextDebugOption.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextDebugOption.m
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/8.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextDebugOption.h"
13 | #import "YYTextWeakProxy.h"
14 | #import
15 | #import
16 |
17 | static pthread_mutex_t _sharedDebugLock;
18 | static CFMutableSetRef _sharedDebugTargets = nil;
19 | static YYTextDebugOption *_sharedDebugOption = nil;
20 |
21 | static const void* _sharedDebugSetRetain(CFAllocatorRef allocator, const void *value) {
22 | return value;
23 | }
24 |
25 | static void _sharedDebugSetRelease(CFAllocatorRef allocator, const void *value) {
26 | }
27 |
28 | void _sharedDebugSetFunction(const void *value, void *context) {
29 | id target = (__bridge id)(value);
30 | [target setDebugOption:_sharedDebugOption];
31 | }
32 |
33 | static void _initSharedDebug() {
34 | static dispatch_once_t onceToken;
35 | dispatch_once(&onceToken, ^{
36 | pthread_mutex_init(&_sharedDebugLock, NULL);
37 | CFSetCallBacks callbacks = kCFTypeSetCallBacks;
38 | callbacks.retain = _sharedDebugSetRetain;
39 | callbacks.release = _sharedDebugSetRelease;
40 | _sharedDebugTargets = CFSetCreateMutable(CFAllocatorGetDefault(), 0, &callbacks);
41 | });
42 | }
43 |
44 | static void _setSharedDebugOption(YYTextDebugOption *option) {
45 | _initSharedDebug();
46 | pthread_mutex_lock(&_sharedDebugLock);
47 | _sharedDebugOption = option.copy;
48 | CFSetApplyFunction(_sharedDebugTargets, _sharedDebugSetFunction, NULL);
49 | pthread_mutex_unlock(&_sharedDebugLock);
50 | }
51 |
52 | static YYTextDebugOption *_getSharedDebugOption() {
53 | _initSharedDebug();
54 | pthread_mutex_lock(&_sharedDebugLock);
55 | YYTextDebugOption *op = _sharedDebugOption;
56 | pthread_mutex_unlock(&_sharedDebugLock);
57 | return op;
58 | }
59 |
60 | static void _addDebugTarget(id target) {
61 | _initSharedDebug();
62 | pthread_mutex_lock(&_sharedDebugLock);
63 | CFSetAddValue(_sharedDebugTargets, (__bridge const void *)(target));
64 | pthread_mutex_unlock(&_sharedDebugLock);
65 | }
66 |
67 | static void _removeDebugTarget(id target) {
68 | _initSharedDebug();
69 | pthread_mutex_lock(&_sharedDebugLock);
70 | CFSetRemoveValue(_sharedDebugTargets, (__bridge const void *)(target));
71 | pthread_mutex_unlock(&_sharedDebugLock);
72 | }
73 |
74 |
75 | @implementation YYTextDebugOption
76 |
77 | - (id)copyWithZone:(NSZone *)zone {
78 | YYTextDebugOption *op = [self.class new];
79 | op.baselineColor = self.baselineColor;
80 | op.CTFrameBorderColor = self.CTFrameBorderColor;
81 | op.CTFrameFillColor = self.CTFrameFillColor;
82 | op.CTLineBorderColor = self.CTLineBorderColor;
83 | op.CTLineFillColor = self.CTLineFillColor;
84 | op.CTLineNumberColor = self.CTLineNumberColor;
85 | op.CTRunBorderColor = self.CTRunBorderColor;
86 | op.CTRunFillColor = self.CTRunFillColor;
87 | op.CTRunNumberColor = self.CTRunNumberColor;
88 | op.CGGlyphBorderColor = self.CGGlyphBorderColor;
89 | op.CGGlyphFillColor = self.CGGlyphFillColor;
90 | return op;
91 | }
92 |
93 | - (BOOL)needDrawDebug {
94 | if (self.baselineColor ||
95 | self.CTFrameBorderColor ||
96 | self.CTFrameFillColor ||
97 | self.CTLineBorderColor ||
98 | self.CTLineFillColor ||
99 | self.CTLineNumberColor ||
100 | self.CTRunBorderColor ||
101 | self.CTRunFillColor ||
102 | self.CTRunNumberColor ||
103 | self.CGGlyphBorderColor ||
104 | self.CGGlyphFillColor) return YES;
105 | return NO;
106 | }
107 |
108 | - (void)clear {
109 | self.baselineColor = nil;
110 | self.CTFrameBorderColor = nil;
111 | self.CTFrameFillColor = nil;
112 | self.CTLineBorderColor = nil;
113 | self.CTLineFillColor = nil;
114 | self.CTLineNumberColor = nil;
115 | self.CTRunBorderColor = nil;
116 | self.CTRunFillColor = nil;
117 | self.CTRunNumberColor = nil;
118 | self.CGGlyphBorderColor = nil;
119 | self.CGGlyphFillColor = nil;
120 | }
121 |
122 | + (void)addDebugTarget:(id)target {
123 | if (target) _addDebugTarget(target);
124 | }
125 |
126 | + (void)removeDebugTarget:(id)target {
127 | if (target) _removeDebugTarget(target);
128 | }
129 |
130 | + (YYTextDebugOption *)sharedDebugOption {
131 | return _getSharedDebugOption();
132 | }
133 |
134 | + (void)setSharedDebugOption:(YYTextDebugOption *)option {
135 | NSAssert([NSThread isMainThread], @"This method must be called on the main thread");
136 | _setSharedDebugOption(option);
137 | }
138 |
139 | @end
140 |
141 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextEffectWindow.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextEffectWindow.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/2/25.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | #if __has_include()
15 | #import
16 | #import
17 | #else
18 | #import "YYTextMagnifier.h"
19 | #import "YYTextSelectionView.h"
20 | #endif
21 |
22 | NS_ASSUME_NONNULL_BEGIN
23 |
24 | /**
25 | A window to display magnifier and extra contents for text view.
26 |
27 | @discussion Use `sharedWindow` to get the instance, don't create your own instance.
28 | Typically, you should not use this class directly.
29 | */
30 | @interface YYTextEffectWindow : UIWindow
31 |
32 | /// Returns the shared instance (returns nil in App Extension).
33 | + (nullable instancetype)sharedWindow;
34 |
35 | /// Show the magnifier in this window with a 'popup' animation. @param mag A magnifier.
36 | - (void)showMagnifier:(YYTextMagnifier *)mag;
37 | /// Update the magnifier content and position. @param mag A magnifier.
38 | - (void)moveMagnifier:(YYTextMagnifier *)mag;
39 | /// Remove the magnifier from this window with a 'shrink' animation. @param mag A magnifier.
40 | - (void)hideMagnifier:(YYTextMagnifier *)mag;
41 |
42 |
43 | /// Show the selection dot in this window if the dot is clipped by the selection view.
44 | /// @param selection A selection view.
45 | - (void)showSelectionDot:(YYTextSelectionView *)selection;
46 | /// Remove the selection dot from this window.
47 | /// @param selection A selection view.
48 | - (void)hideSelectionDot:(YYTextSelectionView *)selection;
49 |
50 | @end
51 |
52 | NS_ASSUME_NONNULL_END
53 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextInput.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextInput.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/17.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | Text position affinity. For example, the offset appears after the last
18 | character on a line is backward affinity, before the first character on
19 | the following line is forward affinity.
20 | */
21 | typedef NS_ENUM(NSInteger, YYTextAffinity) {
22 | YYTextAffinityForward = 0, ///< offset appears before the character
23 | YYTextAffinityBackward = 1, ///< offset appears after the character
24 | };
25 |
26 |
27 | /**
28 | A YYTextPosition object represents a position in a text container; in other words,
29 | it is an index into the backing string in a text-displaying view.
30 |
31 | YYTextPosition has the same API as Apple's implementation in UITextView/UITextField,
32 | so you can alse use it to interact with UITextView/UITextField.
33 | */
34 | @interface YYTextPosition : UITextPosition
35 |
36 | @property (nonatomic, readonly) NSInteger offset;
37 | @property (nonatomic, readonly) YYTextAffinity affinity;
38 |
39 | + (instancetype)positionWithOffset:(NSInteger)offset;
40 | + (instancetype)positionWithOffset:(NSInteger)offset affinity:(YYTextAffinity) affinity;
41 |
42 | - (NSComparisonResult)compare:(id)otherPosition;
43 |
44 | @end
45 |
46 |
47 | /**
48 | A YYTextRange object represents a range of characters in a text container; in other words,
49 | it identifies a starting index and an ending index in string backing a text-displaying view.
50 |
51 | YYTextRange has the same API as Apple's implementation in UITextView/UITextField,
52 | so you can alse use it to interact with UITextView/UITextField.
53 | */
54 | @interface YYTextRange : UITextRange
55 |
56 | @property (nonatomic, readonly) YYTextPosition *start;
57 | @property (nonatomic, readonly) YYTextPosition *end;
58 | @property (nonatomic, readonly, getter=isEmpty) BOOL empty;
59 |
60 | + (instancetype)rangeWithRange:(NSRange)range;
61 | + (instancetype)rangeWithRange:(NSRange)range affinity:(YYTextAffinity) affinity;
62 | + (instancetype)rangeWithStart:(YYTextPosition *)start end:(YYTextPosition *)end;
63 | + (instancetype)defaultRange; ///< <{0,0} Forward>
64 |
65 | - (NSRange)asRange;
66 |
67 | @end
68 |
69 |
70 | /**
71 | A YYTextSelectionRect object encapsulates information about a selected range of
72 | text in a text-displaying view.
73 |
74 | YYTextSelectionRect has the same API as Apple's implementation in UITextView/UITextField,
75 | so you can alse use it to interact with UITextView/UITextField.
76 | */
77 | @interface YYTextSelectionRect : UITextSelectionRect
78 |
79 | @property (nonatomic, readwrite) CGRect rect;
80 | @property (nonatomic, readwrite) UITextWritingDirection writingDirection;
81 | @property (nonatomic, readwrite) BOOL containsStart;
82 | @property (nonatomic, readwrite) BOOL containsEnd;
83 | @property (nonatomic, readwrite) BOOL isVertical;
84 |
85 | @end
86 |
87 | NS_ASSUME_NONNULL_END
88 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextInput.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextInput.m
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/17.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextInput.h"
13 | #import "YYTextUtilities.h"
14 |
15 |
16 | @implementation YYTextPosition
17 |
18 | + (instancetype)positionWithOffset:(NSInteger)offset {
19 | return [self positionWithOffset:offset affinity:YYTextAffinityForward];
20 | }
21 |
22 | + (instancetype)positionWithOffset:(NSInteger)offset affinity:(YYTextAffinity)affinity {
23 | YYTextPosition *p = [self new];
24 | p->_offset = offset;
25 | p->_affinity = affinity;
26 | return p;
27 | }
28 |
29 | - (instancetype)copyWithZone:(NSZone *)zone {
30 | return [self.class positionWithOffset:_offset affinity:_affinity];
31 | }
32 |
33 | - (NSString *)description {
34 | return [NSString stringWithFormat:@"<%@: %p> (%@%@)", self.class, self, @(_offset), _affinity == YYTextAffinityForward ? @"F":@"B"];
35 | }
36 |
37 | - (NSUInteger)hash {
38 | return _offset * 2 + (_affinity == YYTextAffinityForward ? 1 : 0);
39 | }
40 |
41 | - (BOOL)isEqual:(YYTextPosition *)object {
42 | if (!object) return NO;
43 | return _offset == object.offset && _affinity == object.affinity;
44 | }
45 |
46 | - (NSComparisonResult)compare:(YYTextPosition *)otherPosition {
47 | if (!otherPosition) return NSOrderedAscending;
48 | if (_offset < otherPosition.offset) return NSOrderedAscending;
49 | if (_offset > otherPosition.offset) return NSOrderedDescending;
50 | if (_affinity == YYTextAffinityBackward && otherPosition.affinity == YYTextAffinityForward) return NSOrderedAscending;
51 | if (_affinity == YYTextAffinityForward && otherPosition.affinity == YYTextAffinityBackward) return NSOrderedDescending;
52 | return NSOrderedSame;
53 | }
54 |
55 | @end
56 |
57 |
58 |
59 | @implementation YYTextRange {
60 | YYTextPosition *_start;
61 | YYTextPosition *_end;
62 | }
63 |
64 | - (instancetype)init {
65 | self = [super init];
66 | if (!self) return nil;
67 | _start = [YYTextPosition positionWithOffset:0];
68 | _end = [YYTextPosition positionWithOffset:0];
69 | return self;
70 | }
71 |
72 | - (YYTextPosition *)start {
73 | return _start;
74 | }
75 |
76 | - (YYTextPosition *)end {
77 | return _end;
78 | }
79 |
80 | - (BOOL)isEmpty {
81 | return _start.offset == _end.offset;
82 | }
83 |
84 | - (NSRange)asRange {
85 | return NSMakeRange(_start.offset, _end.offset - _start.offset);
86 | }
87 |
88 | + (instancetype)rangeWithRange:(NSRange)range {
89 | return [self rangeWithRange:range affinity:YYTextAffinityForward];
90 | }
91 |
92 | + (instancetype)rangeWithRange:(NSRange)range affinity:(YYTextAffinity)affinity {
93 | YYTextPosition *start = [YYTextPosition positionWithOffset:range.location affinity:affinity];
94 | YYTextPosition *end = [YYTextPosition positionWithOffset:range.location + range.length affinity:affinity];
95 | return [self rangeWithStart:start end:end];
96 | }
97 |
98 | + (instancetype)rangeWithStart:(YYTextPosition *)start end:(YYTextPosition *)end {
99 | if (!start || !end) return nil;
100 | if ([start compare:end] == NSOrderedDescending) {
101 | YYTEXT_SWAP(start, end);
102 | }
103 | YYTextRange *range = [YYTextRange new];
104 | range->_start = start;
105 | range->_end = end;
106 | return range;
107 | }
108 |
109 | + (instancetype)defaultRange {
110 | return [self new];
111 | }
112 |
113 | - (instancetype)copyWithZone:(NSZone *)zone {
114 | return [self.class rangeWithStart:_start end:_end];
115 | }
116 |
117 | - (NSString *)description {
118 | return [NSString stringWithFormat:@"<%@: %p> (%@, %@)%@", self.class, self, @(_start.offset), @(_end.offset - _start.offset), _end.affinity == YYTextAffinityForward ? @"F":@"B"];
119 | }
120 |
121 | - (NSUInteger)hash {
122 | return (sizeof(NSUInteger) == 8 ? OSSwapInt64(_start.hash) : OSSwapInt32(_start.hash)) + _end.hash;
123 | }
124 |
125 | - (BOOL)isEqual:(YYTextRange *)object {
126 | if (!object) return NO;
127 | return [_start isEqual:object.start] && [_end isEqual:object.end];
128 | }
129 |
130 | @end
131 |
132 |
133 |
134 | @implementation YYTextSelectionRect
135 |
136 | @synthesize rect = _rect;
137 | @synthesize writingDirection = _writingDirection;
138 | @synthesize containsStart = _containsStart;
139 | @synthesize containsEnd = _containsEnd;
140 | @synthesize isVertical = _isVertical;
141 |
142 | - (id)copyWithZone:(NSZone *)zone {
143 | YYTextSelectionRect *one = [self.class new];
144 | one.rect = _rect;
145 | one.writingDirection = _writingDirection;
146 | one.containsStart = _containsStart;
147 | one.containsEnd = _containsEnd;
148 | one.isVertical = _isVertical;
149 | return one;
150 | }
151 |
152 | @end
153 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextKeyboardManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextKeyboardManager.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/6/3.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | System keyboard transition information.
18 | Use -[YYTextKeyboardManager convertRect:toView:] to convert frame to specified view.
19 | */
20 | typedef struct {
21 | BOOL fromVisible; ///< Keyboard visible before transition.
22 | BOOL toVisible; ///< Keyboard visible after transition.
23 | CGRect fromFrame; ///< Keyboard frame before transition.
24 | CGRect toFrame; ///< Keyboard frame after transition.
25 | NSTimeInterval animationDuration; ///< Keyboard transition animation duration.
26 | UIViewAnimationCurve animationCurve; ///< Keyboard transition animation curve.
27 | UIViewAnimationOptions animationOption; ///< Keybaord transition animation option.
28 | } YYTextKeyboardTransition;
29 |
30 |
31 | /**
32 | The YYTextKeyboardObserver protocol defines the method you can use
33 | to receive system keyboard change information.
34 | */
35 | @protocol YYTextKeyboardObserver
36 | @optional
37 | - (void)keyboardChangedWithTransition:(YYTextKeyboardTransition)transition;
38 | @end
39 |
40 |
41 | /**
42 | A YYTextKeyboardManager object lets you get the system keyboard information,
43 | and track the keyboard visible/frame/transition.
44 |
45 | @discussion You should access this class in main thread.
46 | Compatible: iPhone/iPad with iOS6/7/8/9.
47 | */
48 | @interface YYTextKeyboardManager : NSObject
49 |
50 | - (instancetype)init UNAVAILABLE_ATTRIBUTE;
51 | + (instancetype)new UNAVAILABLE_ATTRIBUTE;
52 |
53 | /// Get the default manager (returns nil in App Extension).
54 | + (nullable instancetype)defaultManager;
55 |
56 | /// Get the keyboard window. nil if there's no keyboard window.
57 | @property (nullable, nonatomic, readonly) UIWindow *keyboardWindow;
58 |
59 | /// Get the keyboard view. nil if there's no keyboard view.
60 | @property (nullable, nonatomic, readonly) UIView *keyboardView;
61 |
62 | /// Whether the keyboard is visible.
63 | @property (nonatomic, readonly, getter=isKeyboardVisible) BOOL keyboardVisible;
64 |
65 | /// Get the keyboard frame. CGRectNull if there's no keyboard view.
66 | /// Use convertRect:toView: to convert frame to specified view.
67 | @property (nonatomic, readonly) CGRect keyboardFrame;
68 |
69 |
70 | /**
71 | Add an observer to manager to get keyboard change information.
72 | This method makes a weak reference to the observer.
73 |
74 | @param observer An observer.
75 | This method will do nothing if the observer is nil, or already added.
76 | */
77 | - (void)addObserver:(id)observer;
78 |
79 | /**
80 | Remove an observer from manager.
81 |
82 | @param observer An observer.
83 | This method will do nothing if the observer is nil, or not in manager.
84 | */
85 | - (void)removeObserver:(id)observer;
86 |
87 | /**
88 | Convert rect to specified view or window.
89 |
90 | @param rect The frame rect.
91 | @param view A specified view or window (pass nil to convert for main window).
92 | @return The converted rect in specifeid view.
93 | */
94 | - (CGRect)convertRect:(CGRect)rect toView:(nullable UIView *)view;
95 |
96 | @end
97 |
98 | NS_ASSUME_NONNULL_END
99 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextLine.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextLine.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/3/10.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 | #import
14 |
15 | #if __has_include()
16 | #import
17 | #else
18 | #import "YYTextAttribute.h"
19 | #endif
20 |
21 | @class YYTextRunGlyphRange;
22 |
23 | NS_ASSUME_NONNULL_BEGIN
24 |
25 | /**
26 | A text line object wrapped `CTLineRef`, see `YYTextLayout` for more.
27 | */
28 | @interface YYTextLine : NSObject
29 |
30 | + (instancetype)lineWithCTLine:(CTLineRef)CTLine position:(CGPoint)position vertical:(BOOL)isVertical;
31 |
32 | @property (nonatomic) NSUInteger index; ///< line index
33 | @property (nonatomic) NSUInteger row; ///< line row
34 | @property (nullable, nonatomic, strong) NSArray *> *verticalRotateRange; ///< Run rotate range
35 |
36 | @property (nonatomic, readonly) CTLineRef CTLine; ///< CoreText line
37 | @property (nonatomic, readonly) NSRange range; ///< string range
38 | @property (nonatomic, readonly) BOOL vertical; ///< vertical form
39 |
40 | @property (nonatomic, readonly) CGRect bounds; ///< bounds (ascent + descent)
41 | @property (nonatomic, readonly) CGSize size; ///< bounds.size
42 | @property (nonatomic, readonly) CGFloat width; ///< bounds.size.width
43 | @property (nonatomic, readonly) CGFloat height; ///< bounds.size.height
44 | @property (nonatomic, readonly) CGFloat top; ///< bounds.origin.y
45 | @property (nonatomic, readonly) CGFloat bottom; ///< bounds.origin.y + bounds.size.height
46 | @property (nonatomic, readonly) CGFloat left; ///< bounds.origin.x
47 | @property (nonatomic, readonly) CGFloat right; ///< bounds.origin.x + bounds.size.width
48 |
49 | @property (nonatomic) CGPoint position; ///< baseline position
50 | @property (nonatomic, readonly) CGFloat ascent; ///< line ascent
51 | @property (nonatomic, readonly) CGFloat descent; ///< line descent
52 | @property (nonatomic, readonly) CGFloat leading; ///< line leading
53 | @property (nonatomic, readonly) CGFloat lineWidth; ///< line width
54 | @property (nonatomic, readonly) CGFloat trailingWhitespaceWidth;
55 |
56 | @property (nullable, nonatomic, readonly) NSArray *attachments; ///< YYTextAttachment
57 | @property (nullable, nonatomic, readonly) NSArray *attachmentRanges; ///< NSRange(NSValue)
58 | @property (nullable, nonatomic, readonly) NSArray *attachmentRects; ///< CGRect(NSValue)
59 |
60 | @end
61 |
62 |
63 | typedef NS_ENUM(NSUInteger, YYTextRunGlyphDrawMode) {
64 | /// No rotate.
65 | YYTextRunGlyphDrawModeHorizontal = 0,
66 |
67 | /// Rotate vertical for single glyph.
68 | YYTextRunGlyphDrawModeVerticalRotate = 1,
69 |
70 | /// Rotate vertical for single glyph, and move the glyph to a better position,
71 | /// such as fullwidth punctuation.
72 | YYTextRunGlyphDrawModeVerticalRotateMove = 2,
73 | };
74 |
75 | /**
76 | A range in CTRun, used for vertical form.
77 | */
78 | @interface YYTextRunGlyphRange : NSObject
79 | @property (nonatomic) NSRange glyphRangeInRun;
80 | @property (nonatomic) YYTextRunGlyphDrawMode drawMode;
81 | + (instancetype)rangeWithRange:(NSRange)range drawMode:(YYTextRunGlyphDrawMode)mode;
82 | @end
83 |
84 | NS_ASSUME_NONNULL_END
85 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextLine.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYYTextLine.m
3 | // YYText
4 | //
5 | // Created by ibireme on 15/3/3.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextLine.h"
13 | #import "YYTextUtilities.h"
14 |
15 |
16 | @implementation YYTextLine {
17 | CGFloat _firstGlyphPos; // first glyph position for baseline, typically 0.
18 | }
19 |
20 | + (instancetype)lineWithCTLine:(CTLineRef)CTLine position:(CGPoint)position vertical:(BOOL)isVertical {
21 | if (!CTLine) return nil;
22 | YYTextLine *line = [self new];
23 | line->_position = position;
24 | line->_vertical = isVertical;
25 | [line setCTLine:CTLine];
26 | return line;
27 | }
28 |
29 | - (void)dealloc {
30 | if (_CTLine) CFRelease(_CTLine);
31 | }
32 |
33 | - (void)setCTLine:(_Nonnull CTLineRef)CTLine {
34 | if (_CTLine != CTLine) {
35 | if (CTLine) CFRetain(CTLine);
36 | if (_CTLine) CFRelease(_CTLine);
37 | _CTLine = CTLine;
38 | if (_CTLine) {
39 | _lineWidth = CTLineGetTypographicBounds(_CTLine, &_ascent, &_descent, &_leading);
40 | CFRange range = CTLineGetStringRange(_CTLine);
41 | _range = NSMakeRange(range.location, range.length);
42 | if (CTLineGetGlyphCount(_CTLine) > 0) {
43 | CFArrayRef runs = CTLineGetGlyphRuns(_CTLine);
44 | CTRunRef run = CFArrayGetValueAtIndex(runs, 0);
45 | CGPoint pos;
46 | CTRunGetPositions(run, CFRangeMake(0, 1), &pos);
47 | _firstGlyphPos = pos.x;
48 | } else {
49 | _firstGlyphPos = 0;
50 | }
51 | _trailingWhitespaceWidth = CTLineGetTrailingWhitespaceWidth(_CTLine);
52 | } else {
53 | _lineWidth = _ascent = _descent = _leading = _firstGlyphPos = _trailingWhitespaceWidth = 0;
54 | _range = NSMakeRange(0, 0);
55 | }
56 | [self reloadBounds];
57 | }
58 | }
59 |
60 | - (void)setPosition:(CGPoint)position {
61 | _position = position;
62 | [self reloadBounds];
63 | }
64 |
65 | - (void)reloadBounds {
66 | if (_vertical) {
67 | _bounds = CGRectMake(_position.x - _descent, _position.y, _ascent + _descent, _lineWidth);
68 | _bounds.origin.y += _firstGlyphPos;
69 | } else {
70 | _bounds = CGRectMake(_position.x, _position.y - _ascent, _lineWidth, _ascent + _descent);
71 | _bounds.origin.x += _firstGlyphPos;
72 | }
73 |
74 | _attachments = nil;
75 | _attachmentRanges = nil;
76 | _attachmentRects = nil;
77 | if (!_CTLine) return;
78 | CFArrayRef runs = CTLineGetGlyphRuns(_CTLine);
79 | NSUInteger runCount = CFArrayGetCount(runs);
80 | if (runCount == 0) return;
81 |
82 | NSMutableArray *attachments = [NSMutableArray new];
83 | NSMutableArray *attachmentRanges = [NSMutableArray new];
84 | NSMutableArray *attachmentRects = [NSMutableArray new];
85 | for (NSUInteger r = 0; r < runCount; r++) {
86 | CTRunRef run = CFArrayGetValueAtIndex(runs, r);
87 | CFIndex glyphCount = CTRunGetGlyphCount(run);
88 | if (glyphCount == 0) continue;
89 | NSDictionary *attrs = (id)CTRunGetAttributes(run);
90 | YYTextAttachment *attachment = attrs[YYTextAttachmentAttributeName];
91 | if (attachment) {
92 | CGPoint runPosition = CGPointZero;
93 | CTRunGetPositions(run, CFRangeMake(0, 1), &runPosition);
94 |
95 | CGFloat ascent, descent, leading, runWidth;
96 | CGRect runTypoBounds;
97 | runWidth = CTRunGetTypographicBounds(run, CFRangeMake(0, 0), &ascent, &descent, &leading);
98 |
99 | if (_vertical) {
100 | YYTEXT_SWAP(runPosition.x, runPosition.y);
101 | runPosition.y = _position.y + runPosition.y;
102 | runTypoBounds = CGRectMake(_position.x + runPosition.x - descent, runPosition.y , ascent + descent, runWidth);
103 | } else {
104 | runPosition.x += _position.x;
105 | runPosition.y = _position.y - runPosition.y;
106 | runTypoBounds = CGRectMake(runPosition.x, runPosition.y - ascent, runWidth, ascent + descent);
107 | }
108 |
109 | NSRange runRange = YYTextNSRangeFromCFRange(CTRunGetStringRange(run));
110 | [attachments addObject:attachment];
111 | [attachmentRanges addObject:[NSValue valueWithRange:runRange]];
112 | [attachmentRects addObject:[NSValue valueWithCGRect:runTypoBounds]];
113 | }
114 | }
115 | _attachments = attachments.count ? attachments : nil;
116 | _attachmentRanges = attachmentRanges.count ? attachmentRanges : nil;
117 | _attachmentRects = attachmentRects.count ? attachmentRects : nil;
118 | }
119 |
120 | - (CGSize)size {
121 | return _bounds.size;
122 | }
123 |
124 | - (CGFloat)width {
125 | return CGRectGetWidth(_bounds);
126 | }
127 |
128 | - (CGFloat)height {
129 | return CGRectGetHeight(_bounds);
130 | }
131 |
132 | - (CGFloat)top {
133 | return CGRectGetMinY(_bounds);
134 | }
135 |
136 | - (CGFloat)bottom {
137 | return CGRectGetMaxY(_bounds);
138 | }
139 |
140 | - (CGFloat)left {
141 | return CGRectGetMinX(_bounds);
142 | }
143 |
144 | - (CGFloat)right {
145 | return CGRectGetMaxX(_bounds);
146 | }
147 |
148 | - (NSString *)description {
149 | NSMutableString *desc = @"".mutableCopy;
150 | NSRange range = self.range;
151 | [desc appendFormat:@" row:%zd range:%tu,%tu",self, self.row, range.location, range.length];
152 | [desc appendFormat:@" position:%@",NSStringFromCGPoint(self.position)];
153 | [desc appendFormat:@" bounds:%@",NSStringFromCGRect(self.bounds)];
154 | return desc;
155 | }
156 |
157 | @end
158 |
159 |
160 | @implementation YYTextRunGlyphRange
161 | + (instancetype)rangeWithRange:(NSRange)range drawMode:(YYTextRunGlyphDrawMode)mode {
162 | YYTextRunGlyphRange *one = [self new];
163 | one.glyphRangeInRun = range;
164 | one.drawMode = mode;
165 | return one;
166 | }
167 | @end
168 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextMagnifier.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextMagnifier.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/2/25.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | #if __has_include()
15 | #import
16 | #else
17 | #import "YYTextAttribute.h"
18 | #endif
19 |
20 | NS_ASSUME_NONNULL_BEGIN
21 |
22 | /// Magnifier type
23 | typedef NS_ENUM(NSInteger, YYTextMagnifierType) {
24 | YYTextMagnifierTypeCaret, ///< Circular magnifier
25 | YYTextMagnifierTypeRanged, ///< Round rectangle magnifier
26 | };
27 |
28 | /**
29 | A magnifier view which can be displayed in `YYTextEffectWindow`.
30 |
31 | @discussion Use `magnifierWithType:` to create instance.
32 | Typically, you should not use this class directly.
33 | */
34 | @interface YYTextMagnifier : UIView
35 |
36 | /// Create a mangifier with the specified type. @param type The magnifier type.
37 | + (id)magnifierWithType:(YYTextMagnifierType)type;
38 |
39 | @property (nonatomic, readonly) YYTextMagnifierType type; ///< Type of magnifier
40 | @property (nonatomic, readonly) CGSize fitSize; ///< The 'best' size for magnifier view.
41 | @property (nonatomic, readonly) CGSize snapshotSize; ///< The 'best' snapshot image size for magnifier.
42 | @property (nullable, nonatomic, strong) UIImage *snapshot; ///< The image in magnifier (readwrite).
43 |
44 | @property (nullable, nonatomic, weak) UIView *hostView; ///< The coordinate based view.
45 | @property (nonatomic) CGPoint hostCaptureCenter; ///< The snapshot capture center in `hostView`.
46 | @property (nonatomic) CGPoint hostPopoverCenter; ///< The popover center in `hostView`.
47 | @property (nonatomic) BOOL hostVerticalForm; ///< The host view is vertical form.
48 | @property (nonatomic) BOOL captureDisabled; ///< A hint for `YYTextEffectWindow` to disable capture.
49 | @property (nonatomic) BOOL captureFadeAnimation; ///< Show fade animation when the snapshot image changed.
50 | @end
51 |
52 | NS_ASSUME_NONNULL_END
53 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Component/YYTextSelectionView.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextSelectionView.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/2/25.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | #if __has_include()
15 | #import
16 | #import
17 | #else
18 | #import "YYTextAttribute.h"
19 | #import "YYTextInput.h"
20 | #endif
21 |
22 | NS_ASSUME_NONNULL_BEGIN
23 |
24 | /**
25 | A single dot view. The frame should be foursquare.
26 | Change the background color for display.
27 |
28 | @discussion Typically, you should not use this class directly.
29 | */
30 | @interface YYSelectionGrabberDot : UIView
31 | /// Dont't access this property. It was used by `YYTextEffectWindow`.
32 | @property (nonatomic, strong) UIView *mirror;
33 | @end
34 |
35 |
36 | /**
37 | A grabber (stick with a dot).
38 |
39 | @discussion Typically, you should not use this class directly.
40 | */
41 | @interface YYSelectionGrabber : UIView
42 |
43 | @property (nonatomic, readonly) YYSelectionGrabberDot *dot; ///< the dot view
44 | @property (nonatomic) YYTextDirection dotDirection; ///< don't support composite direction
45 | @property (nullable, nonatomic, strong) UIColor *color; ///< tint color, default is nil
46 |
47 | @end
48 |
49 |
50 | /**
51 | The selection view for text edit and select.
52 |
53 | @discussion Typically, you should not use this class directly.
54 | */
55 | @interface YYTextSelectionView : UIView
56 |
57 | @property (nullable, nonatomic, weak) UIView *hostView; ///< the holder view
58 | @property (nullable, nonatomic, strong) UIColor *color; ///< the tint color
59 | @property (nonatomic, getter = isCaretBlinks) BOOL caretBlinks; ///< whether the caret is blinks
60 | @property (nonatomic, getter = isCaretVisible) BOOL caretVisible; ///< whether the caret is visible
61 | @property (nonatomic, getter = isVerticalForm) BOOL verticalForm; ///< weather the text view is vertical form
62 |
63 | @property (nonatomic) CGRect caretRect; ///< caret rect (width==0 or height==0)
64 | @property (nullable, nonatomic, copy) NSArray *selectionRects; ///< default is nil
65 |
66 | @property (nonatomic, readonly) UIView *caretView;
67 | @property (nonatomic, readonly) YYSelectionGrabber *startGrabber;
68 | @property (nonatomic, readonly) YYSelectionGrabber *endGrabber;
69 |
70 | - (BOOL)isGrabberContainsPoint:(CGPoint)point;
71 | - (BOOL)isStartGrabberContainsPoint:(CGPoint)point;
72 | - (BOOL)isEndGrabberContainsPoint:(CGPoint)point;
73 | - (BOOL)isCaretContainsPoint:(CGPoint)point;
74 | - (BOOL)isSelectionRectsContainsPoint:(CGPoint)point;
75 |
76 | @end
77 |
78 | NS_ASSUME_NONNULL_END
79 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/String/YYTextArchiver.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextArchiver.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/3/16.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | A subclass of `NSKeyedArchiver` which implement `NSKeyedArchiverDelegate` protocol.
18 |
19 | The archiver can encode the object which contains
20 | CGColor/CGImage/CTRunDelegateRef/.. (such as NSAttributedString).
21 | */
22 | @interface YYTextArchiver : NSKeyedArchiver
23 | @end
24 |
25 | /**
26 | A subclass of `NSKeyedUnarchiver` which implement `NSKeyedUnarchiverDelegate`
27 | protocol. The unarchiver can decode the data which is encoded by
28 | `YYTextArchiver` or `NSKeyedArchiver`.
29 | */
30 | @interface YYTextUnarchiver : NSKeyedUnarchiver
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/String/YYTextArchiver.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextArchiver.m
3 | // YYText
4 | //
5 | // Created by ibireme on 15/3/16.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextArchiver.h"
13 | #import "YYTextRunDelegate.h"
14 | #import "YYTextRubyAnnotation.h"
15 |
16 | /**
17 | When call CTRunDelegateGetTypeID() on some devices (runs iOS6), I got the error:
18 | "dyld: lazy symbol binding failed: Symbol not found: _CTRunDelegateGetTypeID"
19 |
20 | Here's a workaround for this issue.
21 | */
22 | static CFTypeID CTRunDelegateTypeID() {
23 | static CFTypeID typeID;
24 | static dispatch_once_t onceToken;
25 | dispatch_once(&onceToken, ^{
26 | /*
27 | if ((long)CTRunDelegateGetTypeID + 1 > 1) { //avoid compiler optimization
28 | typeID = CTRunDelegateGetTypeID();
29 | }
30 | */
31 | YYTextRunDelegate *delegate = [YYTextRunDelegate new];
32 | CTRunDelegateRef ref = delegate.CTRunDelegate;
33 | typeID = CFGetTypeID(ref);
34 | CFRelease(ref);
35 | });
36 | return typeID;
37 | }
38 |
39 | static CFTypeID CTRubyAnnotationTypeID() {
40 | static CFTypeID typeID;
41 | static dispatch_once_t onceToken;
42 | dispatch_once(&onceToken, ^{
43 | if ((long)CTRubyAnnotationGetTypeID + 1 > 1) { //avoid compiler optimization
44 | typeID = CTRunDelegateGetTypeID();
45 | } else {
46 | typeID = kCFNotFound;
47 | }
48 | });
49 | return typeID;
50 | }
51 |
52 | /**
53 | A wrapper for CGColorRef. Used for Archive/Unarchive/Copy.
54 | */
55 | @interface _YYCGColor : NSObject
56 | @property (nonatomic, assign) CGColorRef CGColor;
57 | + (instancetype)colorWithCGColor:(CGColorRef)CGColor;
58 | @end
59 |
60 | @implementation _YYCGColor
61 |
62 | + (instancetype)colorWithCGColor:(CGColorRef)CGColor {
63 | _YYCGColor *color = [self new];
64 | color.CGColor = CGColor;
65 | return color;
66 | }
67 |
68 | - (void)setCGColor:(CGColorRef)CGColor {
69 | if (_CGColor != CGColor) {
70 | if (CGColor) CGColor = (CGColorRef)CFRetain(CGColor);
71 | if (_CGColor) CFRelease(_CGColor);
72 | _CGColor = CGColor;
73 | }
74 | }
75 |
76 | - (void)dealloc {
77 | if (_CGColor) CFRelease(_CGColor);
78 | _CGColor = NULL;
79 | }
80 |
81 | - (id)copyWithZone:(NSZone *)zone {
82 | _YYCGColor *color = [self.class new];
83 | color.CGColor = self.CGColor;
84 | return color;
85 | }
86 |
87 | - (void)encodeWithCoder:(NSCoder *)aCoder {
88 | UIColor *color = [UIColor colorWithCGColor:_CGColor];
89 | [aCoder encodeObject:color forKey:@"color"];
90 | }
91 |
92 | - (id)initWithCoder:(NSCoder *)aDecoder {
93 | self = [self init];
94 | UIColor *color = [aDecoder decodeObjectForKey:@"color"];
95 | self.CGColor = color.CGColor;
96 | return self;
97 | }
98 |
99 | @end
100 |
101 | /**
102 | A wrapper for CGImageRef. Used for Archive/Unarchive/Copy.
103 | */
104 | @interface _YYCGImage : NSObject
105 | @property (nonatomic, assign) CGImageRef CGImage;
106 | + (instancetype)imageWithCGImage:(CGImageRef)CGImage;
107 | @end
108 |
109 | @implementation _YYCGImage
110 |
111 | + (instancetype)imageWithCGImage:(CGImageRef)CGImage {
112 | _YYCGImage *image = [self new];
113 | image.CGImage = CGImage;
114 | return image;
115 | }
116 |
117 | - (void)setCGImage:(CGImageRef)CGImage {
118 | if (_CGImage != CGImage) {
119 | if (CGImage) CGImage = (CGImageRef)CFRetain(CGImage);
120 | if (_CGImage) CFRelease(_CGImage);
121 | _CGImage = CGImage;
122 | }
123 | }
124 |
125 | - (void)dealloc {
126 | if (_CGImage) CFRelease(_CGImage);
127 | }
128 |
129 | - (id)copyWithZone:(NSZone *)zone {
130 | _YYCGImage *image = [self.class new];
131 | image.CGImage = self.CGImage;
132 | return image;
133 | }
134 |
135 | - (void)encodeWithCoder:(NSCoder *)aCoder {
136 | UIImage *image = [UIImage imageWithCGImage:_CGImage];
137 | [aCoder encodeObject:image forKey:@"image"];
138 | }
139 |
140 | - (id)initWithCoder:(NSCoder *)aDecoder {
141 | self = [self init];
142 | UIImage *image = [aDecoder decodeObjectForKey:@"image"];
143 | self.CGImage = image.CGImage;
144 | return self;
145 | }
146 |
147 | @end
148 |
149 |
150 | @implementation YYTextArchiver
151 |
152 | + (NSData *)archivedDataWithRootObject:(id)rootObject {
153 | if (!rootObject) return nil;
154 | NSMutableData *data = [NSMutableData data];
155 | YYTextArchiver *archiver = [[[self class] alloc] initForWritingWithMutableData:data];
156 | [archiver encodeRootObject:rootObject];
157 | [archiver finishEncoding];
158 | return data;
159 | }
160 |
161 | + (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path {
162 | NSData *data = [self archivedDataWithRootObject:rootObject];
163 | if (!data) return NO;
164 | return [data writeToFile:path atomically:YES];
165 | }
166 |
167 | - (instancetype)init {
168 | self = [super init];
169 | self.delegate = self;
170 | return self;
171 | }
172 |
173 | - (instancetype)initForWritingWithMutableData:(NSMutableData *)data {
174 | self = [super initForWritingWithMutableData:data];
175 | self.delegate = self;
176 | return self;
177 | }
178 |
179 | - (id)archiver:(NSKeyedArchiver *)archiver willEncodeObject:(id)object {
180 | CFTypeID typeID = CFGetTypeID((CFTypeRef)object);
181 | if (typeID == CTRunDelegateTypeID()) {
182 | CTRunDelegateRef runDelegate = (__bridge CFTypeRef)(object);
183 | id ref = CTRunDelegateGetRefCon(runDelegate);
184 | if (ref) return ref;
185 | } else if (typeID == CTRubyAnnotationTypeID()) {
186 | CTRubyAnnotationRef ctRuby = (__bridge CFTypeRef)(object);
187 | YYTextRubyAnnotation *ruby = [YYTextRubyAnnotation rubyWithCTRubyRef:ctRuby];
188 | if (ruby) return ruby;
189 | } else if (typeID == CGColorGetTypeID()) {
190 | return [_YYCGColor colorWithCGColor:(CGColorRef)object];
191 | } else if (typeID == CGImageGetTypeID()) {
192 | return [_YYCGImage imageWithCGImage:(CGImageRef)object];
193 | }
194 | return object;
195 | }
196 |
197 | @end
198 |
199 |
200 | @implementation YYTextUnarchiver
201 |
202 | + (id)unarchiveObjectWithData:(NSData *)data {
203 | if (data.length == 0) return nil;
204 | YYTextUnarchiver *unarchiver = [[self alloc] initForReadingWithData:data];
205 | return [unarchiver decodeObject];
206 | }
207 |
208 | + (id)unarchiveObjectWithFile:(NSString *)path {
209 | NSData *data = [NSData dataWithContentsOfFile:path];
210 | return [self unarchiveObjectWithData:data];
211 | }
212 |
213 | - (instancetype)init {
214 | self = [super init];
215 | self.delegate = self;
216 | return self;
217 | }
218 |
219 | - (instancetype)initForReadingWithData:(NSData *)data {
220 | self = [super initForReadingWithData:data];
221 | self.delegate = self;
222 | return self;
223 | }
224 |
225 | - (id)unarchiver:(NSKeyedUnarchiver *)unarchiver didDecodeObject:(id) NS_RELEASES_ARGUMENT object NS_RETURNS_RETAINED {
226 | if ([object class] == [YYTextRunDelegate class]) {
227 | YYTextRunDelegate *runDelegate = object;
228 | CTRunDelegateRef ct = runDelegate.CTRunDelegate;
229 | id ctObj = (__bridge id)ct;
230 | if (ct) CFRelease(ct);
231 | return ctObj;
232 | } else if ([object class] == [YYTextRubyAnnotation class]) {
233 | YYTextRubyAnnotation *ruby = object;
234 | if ([UIDevice currentDevice].systemVersion.floatValue >= 8) {
235 | CTRubyAnnotationRef ct = ruby.CTRubyAnnotation;
236 | id ctObj = (__bridge id)(ct);
237 | if (ct) CFRelease(ct);
238 | return ctObj;
239 | } else {
240 | return object;
241 | }
242 | } else if ([object class] == [_YYCGColor class]) {
243 | _YYCGColor *color = object;
244 | return (id)color.CGColor;
245 | } else if ([object class] == [_YYCGImage class]) {
246 | _YYCGImage *image = object;
247 | return (id)image.CGImage;
248 | }
249 | return object;
250 | }
251 |
252 | @end
253 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/String/YYTextParser.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextParser.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/3/6.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | The YYTextParser protocol declares the required method for YYTextView and YYLabel
18 | to modify the text during editing.
19 |
20 | You can implement this protocol to add code highlighting or emoticon replacement for
21 | YYTextView and YYLabel. See `YYTextSimpleMarkdownParser` and `YYTextSimpleEmoticonParser` for example.
22 | */
23 | @protocol YYTextParser
24 | @required
25 | /**
26 | When text is changed in YYTextView or YYLabel, this method will be called.
27 |
28 | @param text The original attributed string. This method may parse the text and
29 | change the text attributes or content.
30 |
31 | @param selectedRange Current selected range in `text`.
32 | This method should correct the range if the text content is changed. If there's
33 | no selected range (such as YYLabel), this value is NULL.
34 |
35 | @return If the 'text' is modified in this method, returns `YES`, otherwise returns `NO`.
36 | */
37 | - (BOOL)parseText:(nullable NSMutableAttributedString *)text selectedRange:(nullable NSRangePointer)selectedRange;
38 | @end
39 |
40 |
41 |
42 | /**
43 | A simple markdown parser.
44 |
45 | It'a very simple markdown parser, you can use this parser to highlight some
46 | small piece of markdown text.
47 |
48 | This markdown parser use regular expression to parse text, slow and weak.
49 | If you want to write a better parser, try these projests:
50 | https://github.com/NimbusKit/markdown
51 | https://github.com/dreamwieber/AttributedMarkdown
52 | https://github.com/indragiek/CocoaMarkdown
53 |
54 | Or you can use lex/yacc to generate your custom parser.
55 | */
56 | @interface YYTextSimpleMarkdownParser : NSObject
57 | @property (nonatomic) CGFloat fontSize; ///< default is 14
58 | @property (nonatomic) CGFloat headerFontSize; ///< default is 20
59 |
60 | @property (nullable, nonatomic, strong) UIColor *textColor;
61 | @property (nullable, nonatomic, strong) UIColor *controlTextColor;
62 | @property (nullable, nonatomic, strong) UIColor *headerTextColor;
63 | @property (nullable, nonatomic, strong) UIColor *inlineTextColor;
64 | @property (nullable, nonatomic, strong) UIColor *codeTextColor;
65 | @property (nullable, nonatomic, strong) UIColor *linkTextColor;
66 |
67 | - (void)setColorWithBrightTheme; ///< reset the color properties to pre-defined value.
68 | - (void)setColorWithDarkTheme; ///< reset the color properties to pre-defined value.
69 | @end
70 |
71 |
72 |
73 | /**
74 | A simple emoticon parser.
75 |
76 | Use this parser to map some specified piece of string to image emoticon.
77 | Example: "Hello :smile:" -> "Hello 😀"
78 |
79 | It can also be used to extend the "unicode emoticon".
80 | */
81 | @interface YYTextSimpleEmoticonParser : NSObject
82 |
83 | /**
84 | The custom emoticon mapper.
85 | The key is a specified plain string, such as @":smile:".
86 | The value is a UIImage which will replace the specified plain string in text.
87 | */
88 | @property (nullable, copy) NSDictionary *emoticonMapper;
89 | @end
90 |
91 | NS_ASSUME_NONNULL_END
92 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/String/YYTextRubyAnnotation.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextRubyAnnotation.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/24.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 | #import
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | /**
18 | Wrapper for CTRubyAnnotationRef.
19 |
20 | Example:
21 |
22 | YYTextRubyAnnotation *ruby = [YYTextRubyAnnotation new];
23 | ruby.textBefore = @"zhù yīn";
24 | CTRubyAnnotationRef ctRuby = ruby.CTRubyAnnotation;
25 | if (ctRuby) {
26 | /// add to attributed string
27 | CFRelease(ctRuby);
28 | }
29 |
30 | */
31 | @interface YYTextRubyAnnotation : NSObject
32 |
33 | /// Specifies how the ruby text and the base text should be aligned relative to each other.
34 | @property (nonatomic) CTRubyAlignment alignment;
35 |
36 | /// Specifies how the ruby text can overhang adjacent characters.
37 | @property (nonatomic) CTRubyOverhang overhang;
38 |
39 | /// Specifies the size of the annotation text as a percent of the size of the base text.
40 | @property (nonatomic) CGFloat sizeFactor;
41 |
42 |
43 | /// The ruby text is positioned before the base text;
44 | /// i.e. above horizontal text and to the right of vertical text.
45 | @property (nullable, nonatomic, copy) NSString *textBefore;
46 |
47 | /// The ruby text is positioned after the base text;
48 | /// i.e. below horizontal text and to the left of vertical text.
49 | @property (nullable, nonatomic, copy) NSString *textAfter;
50 |
51 | /// The ruby text is positioned to the right of the base text whether it is horizontal or vertical.
52 | /// This is the way that Bopomofo annotations are attached to Chinese text in Taiwan.
53 | @property (nullable, nonatomic, copy) NSString *textInterCharacter;
54 |
55 | /// The ruby text follows the base text with no special styling.
56 | @property (nullable, nonatomic, copy) NSString *textInline;
57 |
58 |
59 | /**
60 | Create a ruby object from CTRuby object.
61 |
62 | @param ctRuby A CTRuby object.
63 |
64 | @return A ruby object, or nil when an error occurs.
65 | */
66 | + (instancetype)rubyWithCTRubyRef:(CTRubyAnnotationRef)ctRuby NS_AVAILABLE_IOS(8_0);
67 |
68 | /**
69 | Create a CTRuby object from the instance.
70 |
71 | @return A new CTRuby object, or NULL when an error occurs.
72 | The returned value should be release after used.
73 | */
74 | - (nullable CTRubyAnnotationRef)CTRubyAnnotation CF_RETURNS_RETAINED NS_AVAILABLE_IOS(8_0);
75 |
76 | @end
77 |
78 | NS_ASSUME_NONNULL_END
79 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/String/YYTextRubyAnnotation.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextRubyAnnotation.m
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/24.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextRubyAnnotation.h"
13 |
14 | @implementation YYTextRubyAnnotation
15 |
16 | - (instancetype)init {
17 | self = super.init;
18 | self.alignment = kCTRubyAlignmentAuto;
19 | self.overhang = kCTRubyOverhangAuto;
20 | self.sizeFactor = 0.5;
21 | return self;
22 | }
23 |
24 | + (instancetype)rubyWithCTRubyRef:(CTRubyAnnotationRef)ctRuby {
25 | if (!ctRuby) return nil;
26 | YYTextRubyAnnotation *one = [self new];
27 | one.alignment = CTRubyAnnotationGetAlignment(ctRuby);
28 | one.overhang = CTRubyAnnotationGetOverhang(ctRuby);
29 | one.sizeFactor = CTRubyAnnotationGetSizeFactor(ctRuby);
30 | one.textBefore = (__bridge NSString *)(CTRubyAnnotationGetTextForPosition(ctRuby, kCTRubyPositionBefore));
31 | one.textAfter = (__bridge NSString *)(CTRubyAnnotationGetTextForPosition(ctRuby, kCTRubyPositionAfter));
32 | one.textInterCharacter = (__bridge NSString *)(CTRubyAnnotationGetTextForPosition(ctRuby, kCTRubyPositionInterCharacter));
33 | one.textInline = (__bridge NSString *)(CTRubyAnnotationGetTextForPosition(ctRuby, kCTRubyPositionInline));
34 | return one;
35 | }
36 |
37 | - (CTRubyAnnotationRef)CTRubyAnnotation CF_RETURNS_RETAINED {
38 | if (((long)CTRubyAnnotationCreate + 1) == 1) return NULL; // system not support
39 |
40 | CFStringRef text[kCTRubyPositionCount];
41 | text[kCTRubyPositionBefore] = (__bridge CFStringRef)(_textBefore);
42 | text[kCTRubyPositionAfter] = (__bridge CFStringRef)(_textAfter);
43 | text[kCTRubyPositionInterCharacter] = (__bridge CFStringRef)(_textInterCharacter);
44 | text[kCTRubyPositionInline] = (__bridge CFStringRef)(_textInline);
45 | CTRubyAnnotationRef ruby = CTRubyAnnotationCreate(_alignment, _overhang, _sizeFactor, text);
46 | return ruby;
47 | }
48 |
49 | - (id)copyWithZone:(NSZone *)zone {
50 | YYTextRubyAnnotation *one = [self.class new];
51 | one.alignment = _alignment;
52 | one.overhang = _overhang;
53 | one.sizeFactor = _sizeFactor;
54 | one.textBefore = _textBefore;
55 | one.textAfter = _textAfter;
56 | one.textInterCharacter = _textInterCharacter;
57 | one.textInline = _textInline;
58 | return one;
59 | }
60 |
61 | - (void)encodeWithCoder:(NSCoder *)aCoder {
62 | [aCoder encodeObject:@(_alignment) forKey:@"alignment"];
63 | [aCoder encodeObject:@(_overhang) forKey:@"overhang"];
64 | [aCoder encodeObject:@(_sizeFactor) forKey:@"sizeFactor"];
65 | [aCoder encodeObject:_textBefore forKey:@"textBefore"];
66 | [aCoder encodeObject:_textAfter forKey:@"textAfter"];
67 | [aCoder encodeObject:_textInterCharacter forKey:@"textInterCharacter"];
68 | [aCoder encodeObject:_textInline forKey:@"textInline"];
69 | }
70 |
71 | - (id)initWithCoder:(NSCoder *)aDecoder {
72 | self = [self init];
73 | _alignment = ((NSNumber *)[aDecoder decodeObjectForKey:@"alignment"]).intValue;
74 | _overhang = ((NSNumber *)[aDecoder decodeObjectForKey:@"overhang"]).intValue;
75 | _sizeFactor = ((NSNumber *)[aDecoder decodeObjectForKey:@"sizeFactor"]).intValue;
76 | _textBefore = [aDecoder decodeObjectForKey:@"textBefore"];
77 | _textAfter = [aDecoder decodeObjectForKey:@"textAfter"];
78 | _textInterCharacter = [aDecoder decodeObjectForKey:@"textInterCharacter"];
79 | _textInline = [aDecoder decodeObjectForKey:@"textInline"];
80 | return self;
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/String/YYTextRunDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextRunDelegate.h
3 | // YYText
4 | //
5 | // Created by ibireme on 14/10/14.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 | #import
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | /**
18 | Wrapper for CTRunDelegateRef.
19 |
20 | Example:
21 |
22 | YYTextRunDelegate *delegate = [YYTextRunDelegate new];
23 | delegate.ascent = 20;
24 | delegate.descent = 4;
25 | delegate.width = 20;
26 | CTRunDelegateRef ctRunDelegate = delegate.CTRunDelegate;
27 | if (ctRunDelegate) {
28 | /// add to attributed string
29 | CFRelease(ctRunDelegate);
30 | }
31 |
32 | */
33 | @interface YYTextRunDelegate : NSObject
34 |
35 | /**
36 | Creates and returns the CTRunDelegate.
37 |
38 | @discussion You need call CFRelease() after used.
39 | The CTRunDelegateRef has a strong reference to this YYTextRunDelegate object.
40 | In CoreText, use CTRunDelegateGetRefCon() to get this YYTextRunDelegate object.
41 |
42 | @return The CTRunDelegate object.
43 | */
44 | - (nullable CTRunDelegateRef)CTRunDelegate CF_RETURNS_RETAINED;
45 |
46 | /**
47 | Additional information about the the run delegate.
48 | */
49 | @property (nullable, nonatomic, strong) NSDictionary *userInfo;
50 |
51 | /**
52 | The typographic ascent of glyphs in the run.
53 | */
54 | @property (nonatomic) CGFloat ascent;
55 |
56 | /**
57 | The typographic descent of glyphs in the run.
58 | */
59 | @property (nonatomic) CGFloat descent;
60 |
61 | /**
62 | The typographic width of glyphs in the run.
63 | */
64 | @property (nonatomic) CGFloat width;
65 |
66 | @end
67 |
68 | NS_ASSUME_NONNULL_END
69 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/String/YYTextRunDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextRunDelegate.m
3 | // YYText
4 | //
5 | // Created by ibireme on 14/10/14.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextRunDelegate.h"
13 |
14 | static void DeallocCallback(void *ref) {
15 | YYTextRunDelegate *self = (__bridge_transfer YYTextRunDelegate *)(ref);
16 | self = nil; // release
17 | }
18 |
19 | static CGFloat GetAscentCallback(void *ref) {
20 | YYTextRunDelegate *self = (__bridge YYTextRunDelegate *)(ref);
21 | return self.ascent;
22 | }
23 |
24 | static CGFloat GetDecentCallback(void *ref) {
25 | YYTextRunDelegate *self = (__bridge YYTextRunDelegate *)(ref);
26 | return self.descent;
27 | }
28 |
29 | static CGFloat GetWidthCallback(void *ref) {
30 | YYTextRunDelegate *self = (__bridge YYTextRunDelegate *)(ref);
31 | return self.width;
32 | }
33 |
34 | @implementation YYTextRunDelegate
35 |
36 | - (CTRunDelegateRef)CTRunDelegate CF_RETURNS_RETAINED {
37 | CTRunDelegateCallbacks callbacks;
38 | callbacks.version = kCTRunDelegateCurrentVersion;
39 | callbacks.dealloc = DeallocCallback;
40 | callbacks.getAscent = GetAscentCallback;
41 | callbacks.getDescent = GetDecentCallback;
42 | callbacks.getWidth = GetWidthCallback;
43 | return CTRunDelegateCreate(&callbacks, (__bridge_retained void *)(self.copy));
44 | }
45 |
46 | - (void)encodeWithCoder:(NSCoder *)aCoder {
47 | [aCoder encodeObject:@(_ascent) forKey:@"ascent"];
48 | [aCoder encodeObject:@(_descent) forKey:@"descent"];
49 | [aCoder encodeObject:@(_width) forKey:@"width"];
50 | [aCoder encodeObject:_userInfo forKey:@"userInfo"];
51 | }
52 |
53 | - (id)initWithCoder:(NSCoder *)aDecoder {
54 | self = [super init];
55 | _ascent = ((NSNumber *)[aDecoder decodeObjectForKey:@"ascent"]).floatValue;
56 | _descent = ((NSNumber *)[aDecoder decodeObjectForKey:@"descent"]).floatValue;
57 | _width = ((NSNumber *)[aDecoder decodeObjectForKey:@"width"]).floatValue;
58 | _userInfo = [aDecoder decodeObjectForKey:@"userInfo"];
59 | return self;
60 | }
61 |
62 | - (id)copyWithZone:(NSZone *)zone {
63 | typeof(self) one = [self.class new];
64 | one.ascent = self.ascent;
65 | one.descent = self.descent;
66 | one.width = self.width;
67 | one.userInfo = self.userInfo;
68 | return one;
69 | }
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/NSParagraphStyle+YYText.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSParagraphStyle+YYText.h
3 | // YYText
4 | //
5 | // Created by ibireme on 14/10/7.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | Provides extensions for `NSParagraphStyle` to work with CoreText.
18 | */
19 | @interface NSParagraphStyle (YYText)
20 |
21 | /**
22 | Creates a new NSParagraphStyle object from the CoreText Style.
23 |
24 | @param CTStyle CoreText Paragraph Style.
25 |
26 | @return a new NSParagraphStyle
27 | */
28 | + (nullable NSParagraphStyle *)yy_styleWithCTStyle:(CTParagraphStyleRef)CTStyle;
29 |
30 | /**
31 | Creates and returns a CoreText Paragraph Style. (need call CFRelease() after used)
32 | */
33 | - (nullable CTParagraphStyleRef)yy_CTStyle CF_RETURNS_RETAINED;
34 |
35 | @end
36 |
37 | NS_ASSUME_NONNULL_END
38 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/UIPasteboard+YYText.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIPasteboard+YYText.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/2.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | Extend UIPasteboard to support image and attributed string.
18 | */
19 | @interface UIPasteboard (YYText)
20 |
21 | @property (nullable, nonatomic, copy) NSData *yy_PNGData; ///< PNG file data
22 | @property (nullable, nonatomic, copy) NSData *yy_JPEGData; ///< JPEG file data
23 | @property (nullable, nonatomic, copy) NSData *yy_GIFData; ///< GIF file data
24 | @property (nullable, nonatomic, copy) NSData *yy_WEBPData; ///< WebP file data
25 | @property (nullable, nonatomic, copy) NSData *yy_ImageData; ///< image file data
26 |
27 | /// Attributed string,
28 | /// Set this attributed will also set the string property which is copy from the attributed string.
29 | /// If the attributed string contains one or more image, it will also set the `images` property.
30 | @property (nullable, nonatomic, copy) NSAttributedString *yy_AttributedString;
31 |
32 | @end
33 |
34 |
35 | /// The name identifying the attributed string in pasteboard.
36 | UIKIT_EXTERN NSString *const YYTextPasteboardTypeAttributedString;
37 |
38 | /// The UTI Type identifying WebP data in pasteboard.
39 | UIKIT_EXTERN NSString *const YYTextUTTypeWEBP;
40 |
41 | NS_ASSUME_NONNULL_END
42 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/UIPasteboard+YYText.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIPasteboard+YYText.m
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/2.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "UIPasteboard+YYText.h"
13 | #import "NSAttributedString+YYText.h"
14 | #import
15 |
16 |
17 | #if __has_include("YYImage.h")
18 | #import "YYImage.h"
19 | #define YYTextAnimatedImageAvailable 1
20 | #elif __has_include()
21 | #import
22 | #define YYTextAnimatedImageAvailable 1
23 | #elif __has_include()
24 | #import
25 | #define YYTextAnimatedImageAvailable 1
26 | #else
27 | #define YYTextAnimatedImageAvailable 0
28 | #endif
29 |
30 |
31 | // Dummy class for category
32 | @interface UIPasteboard_YYText : NSObject @end
33 | @implementation UIPasteboard_YYText @end
34 |
35 |
36 | NSString *const YYTextPasteboardTypeAttributedString = @"com.ibireme.NSAttributedString";
37 | NSString *const YYTextUTTypeWEBP = @"com.google.webp";
38 |
39 | @implementation UIPasteboard (YYText)
40 |
41 |
42 | - (void)setYy_PNGData:(NSData *)PNGData {
43 | [self setData:PNGData forPasteboardType:(id)kUTTypePNG];
44 | }
45 |
46 | - (NSData *)yy_PNGData {
47 | return [self dataForPasteboardType:(id)kUTTypePNG];
48 | }
49 |
50 | - (void)setYy_JPEGData:(NSData *)JPEGData {
51 | [self setData:JPEGData forPasteboardType:(id)kUTTypeJPEG];
52 | }
53 |
54 | - (NSData *)yy_JPEGData {
55 | return [self dataForPasteboardType:(id)kUTTypeJPEG];
56 | }
57 |
58 | - (void)setYy_GIFData:(NSData *)GIFData {
59 | [self setData:GIFData forPasteboardType:(id)kUTTypeGIF];
60 | }
61 |
62 | - (NSData *)yy_GIFData {
63 | return [self dataForPasteboardType:(id)kUTTypeGIF];
64 | }
65 |
66 | - (void)setYy_WEBPData:(NSData *)WEBPData {
67 | [self setData:WEBPData forPasteboardType:YYTextUTTypeWEBP];
68 | }
69 |
70 | - (NSData *)yy_WEBPData {
71 | return [self dataForPasteboardType:YYTextUTTypeWEBP];
72 | }
73 |
74 | - (void)setYy_ImageData:(NSData *)imageData {
75 | [self setData:imageData forPasteboardType:(id)kUTTypeImage];
76 | }
77 |
78 | - (NSData *)yy_ImageData {
79 | return [self dataForPasteboardType:(id)kUTTypeImage];
80 | }
81 |
82 | - (void)setYy_AttributedString:(NSAttributedString *)attributedString {
83 | self.string = [attributedString yy_plainTextForRange:NSMakeRange(0, attributedString.length)];
84 | NSData *data = [attributedString yy_archiveToData];
85 | if (data) {
86 | NSDictionary *item = @{YYTextPasteboardTypeAttributedString : data};
87 | [self addItems:@[item]];
88 | }
89 | [attributedString enumerateAttribute:YYTextAttachmentAttributeName inRange:NSMakeRange(0, attributedString.length) options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:^(YYTextAttachment *attachment, NSRange range, BOOL *stop) {
90 |
91 | // save image
92 | UIImage *simpleImage = nil;
93 | if ([attachment.content isKindOfClass:[UIImage class]]) {
94 | simpleImage = attachment.content;
95 | } else if ([attachment.content isKindOfClass:[UIImageView class]]) {
96 | simpleImage = ((UIImageView *)attachment.content).image;
97 | }
98 | if (simpleImage) {
99 | NSDictionary *item = @{@"com.apple.uikit.image" : simpleImage};
100 | [self addItems:@[item]];
101 | }
102 |
103 | #if YYTextAnimatedImageAvailable
104 | // save animated image
105 | if ([attachment.content isKindOfClass:[UIImageView class]]) {
106 | UIImageView *imageView = attachment.content;
107 | Class aniImageClass = NSClassFromString(@"YYImage");
108 | UIImage *image = imageView.image;
109 | if (aniImageClass && [image isKindOfClass:aniImageClass]) {
110 | NSData *data = [image valueForKey:@"animatedImageData"];
111 | NSNumber *type = [image valueForKey:@"animatedImageType"];
112 | if (data) {
113 | switch (type.unsignedIntegerValue) {
114 | case YYImageTypeGIF: {
115 | NSDictionary *item = @{(id)kUTTypeGIF : data};
116 | [self addItems:@[item]];
117 | } break;
118 | case YYImageTypePNG: { // APNG
119 | NSDictionary *item = @{(id)kUTTypePNG : data};
120 | [self addItems:@[item]];
121 | } break;
122 | case YYImageTypeWebP: {
123 | NSDictionary *item = @{(id)YYTextUTTypeWEBP : data};
124 | [self addItems:@[item]];
125 | } break;
126 | default: break;
127 | }
128 | }
129 | }
130 | }
131 | #endif
132 |
133 | }];
134 | }
135 |
136 | - (NSAttributedString *)yy_AttributedString {
137 | for (NSDictionary *items in self.items) {
138 | NSData *data = items[YYTextPasteboardTypeAttributedString];
139 | if (data) {
140 | return [NSAttributedString yy_unarchiveFromData:data];
141 | }
142 | }
143 | return nil;
144 | }
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/UIView+YYText.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+YYText.h
3 | // YYText
4 | //
5 | // Created by ibireme on 13/4/3.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | Provides extensions for `UIView`.
18 | */
19 | @interface UIView (YYText)
20 |
21 | /**
22 | Returns the view's view controller (may be nil).
23 | */
24 | @property (nullable, nonatomic, readonly) UIViewController *yy_viewController;
25 |
26 | /**
27 | Returns the visible alpha on screen, taking into account superview and window.
28 | */
29 | @property (nonatomic, readonly) CGFloat yy_visibleAlpha;
30 |
31 | /**
32 | Converts a point from the receiver's coordinate system to that of the specified view or window.
33 |
34 | @param point A point specified in the local coordinate system (bounds) of the receiver.
35 | @param view The view or window into whose coordinate system point is to be converted.
36 | If view is nil, this method instead converts to window base coordinates.
37 | @return The point converted to the coordinate system of view.
38 | */
39 | - (CGPoint)yy_convertPoint:(CGPoint)point toViewOrWindow:(UIView *)view;
40 |
41 | /**
42 | Converts a point from the coordinate system of a given view or window to that of the receiver.
43 |
44 | @param point A point specified in the local coordinate system (bounds) of view.
45 | @param view The view or window with point in its coordinate system.
46 | If view is nil, this method instead converts from window base coordinates.
47 | @return The point converted to the local coordinate system (bounds) of the receiver.
48 | */
49 | - (CGPoint)yy_convertPoint:(CGPoint)point fromViewOrWindow:(UIView *)view;
50 |
51 | /**
52 | Converts a rectangle from the receiver's coordinate system to that of another view or window.
53 |
54 | @param rect A rectangle specified in the local coordinate system (bounds) of the receiver.
55 | @param view The view or window that is the target of the conversion operation. If view is nil, this method instead converts to window base coordinates.
56 | @return The converted rectangle.
57 | */
58 | - (CGRect)yy_convertRect:(CGRect)rect toViewOrWindow:(UIView *)view;
59 |
60 | /**
61 | Converts a rectangle from the coordinate system of another view or window to that of the receiver.
62 |
63 | @param rect A rectangle specified in the local coordinate system (bounds) of view.
64 | @param view The view or window with rect in its coordinate system.
65 | If view is nil, this method instead converts from window base coordinates.
66 | @return The converted rectangle.
67 | */
68 | - (CGRect)yy_convertRect:(CGRect)rect fromViewOrWindow:(UIView *)view;
69 |
70 | @end
71 |
72 | NS_ASSUME_NONNULL_END
73 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/UIView+YYText.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+YYText.m
3 | // YYText
4 | //
5 | // Created by ibireme on 13/4/3.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "UIView+YYText.h"
13 |
14 | // Dummy class for category
15 | @interface UIView_YYText : NSObject @end
16 | @implementation UIView_YYText @end
17 |
18 |
19 | @implementation UIView (YYText)
20 |
21 | - (UIViewController *)yy_viewController {
22 | for (UIView *view = self; view; view = view.superview) {
23 | UIResponder *nextResponder = [view nextResponder];
24 | if ([nextResponder isKindOfClass:[UIViewController class]]) {
25 | return (UIViewController *)nextResponder;
26 | }
27 | }
28 | return nil;
29 | }
30 |
31 | - (CGFloat)yy_visibleAlpha {
32 | if ([self isKindOfClass:[UIWindow class]]) {
33 | if (self.hidden) return 0;
34 | return self.alpha;
35 | }
36 | if (!self.window) return 0;
37 | CGFloat alpha = 1;
38 | UIView *v = self;
39 | while (v) {
40 | if (v.hidden) {
41 | alpha = 0;
42 | break;
43 | }
44 | alpha *= v.alpha;
45 | v = v.superview;
46 | }
47 | return alpha;
48 | }
49 |
50 | - (CGPoint)yy_convertPoint:(CGPoint)point toViewOrWindow:(UIView *)view {
51 | if (!view) {
52 | if ([self isKindOfClass:[UIWindow class]]) {
53 | return [((UIWindow *)self) convertPoint:point toWindow:nil];
54 | } else {
55 | return [self convertPoint:point toView:nil];
56 | }
57 | }
58 |
59 | UIWindow *from = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window;
60 | UIWindow *to = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window;
61 | if ((!from || !to) || (from == to)) return [self convertPoint:point toView:view];
62 | point = [self convertPoint:point toView:from];
63 | point = [to convertPoint:point fromWindow:from];
64 | point = [view convertPoint:point fromView:to];
65 | return point;
66 | }
67 |
68 | - (CGPoint)yy_convertPoint:(CGPoint)point fromViewOrWindow:(UIView *)view {
69 | if (!view) {
70 | if ([self isKindOfClass:[UIWindow class]]) {
71 | return [((UIWindow *)self) convertPoint:point fromWindow:nil];
72 | } else {
73 | return [self convertPoint:point fromView:nil];
74 | }
75 | }
76 |
77 | UIWindow *from = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window;
78 | UIWindow *to = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window;
79 | if ((!from || !to) || (from == to)) return [self convertPoint:point fromView:view];
80 | point = [from convertPoint:point fromView:view];
81 | point = [to convertPoint:point fromWindow:from];
82 | point = [self convertPoint:point fromView:to];
83 | return point;
84 | }
85 |
86 | - (CGRect)yy_convertRect:(CGRect)rect toViewOrWindow:(UIView *)view {
87 | if (!view) {
88 | if ([self isKindOfClass:[UIWindow class]]) {
89 | return [((UIWindow *)self) convertRect:rect toWindow:nil];
90 | } else {
91 | return [self convertRect:rect toView:nil];
92 | }
93 | }
94 |
95 | UIWindow *from = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window;
96 | UIWindow *to = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window;
97 | if (!from || !to) return [self convertRect:rect toView:view];
98 | if (from == to) return [self convertRect:rect toView:view];
99 | rect = [self convertRect:rect toView:from];
100 | rect = [to convertRect:rect fromWindow:from];
101 | rect = [view convertRect:rect fromView:to];
102 | return rect;
103 | }
104 |
105 | - (CGRect)yy_convertRect:(CGRect)rect fromViewOrWindow:(UIView *)view {
106 | if (!view) {
107 | if ([self isKindOfClass:[UIWindow class]]) {
108 | return [((UIWindow *)self) convertRect:rect fromWindow:nil];
109 | } else {
110 | return [self convertRect:rect fromView:nil];
111 | }
112 | }
113 |
114 | UIWindow *from = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window;
115 | UIWindow *to = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window;
116 | if ((!from || !to) || (from == to)) return [self convertRect:rect fromView:view];
117 | rect = [from convertRect:rect fromView:view];
118 | rect = [to convertRect:rect fromWindow:from];
119 | rect = [self convertRect:rect fromView:to];
120 | return rect;
121 | }
122 |
123 | @end
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/YYTextAsyncLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextAsyncLayer.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/11.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 | #import
14 |
15 | @class YYTextAsyncLayerDisplayTask;
16 |
17 | NS_ASSUME_NONNULL_BEGIN
18 |
19 | /**
20 | The YYTextAsyncLayer class is a subclass of CALayer used for render contents asynchronously.
21 |
22 | @discussion When the layer need update it's contents, it will ask the delegate
23 | for a async display task to render the contents in a background queue.
24 | */
25 | @interface YYTextAsyncLayer : CALayer
26 | /// Whether the render code is executed in background. Default is YES.
27 | @property BOOL displaysAsynchronously;
28 | @end
29 |
30 |
31 | /**
32 | The YYTextAsyncLayer's delegate protocol. The delegate of the YYTextAsyncLayer (typically a UIView)
33 | must implements the method in this protocol.
34 | */
35 | @protocol YYTextAsyncLayerDelegate
36 | @required
37 | /// This method is called to return a new display task when the layer's contents need update.
38 | - (YYTextAsyncLayerDisplayTask *)newAsyncDisplayTask;
39 | @end
40 |
41 |
42 | /**
43 | A display task used by YYTextAsyncLayer to render the contents in background queue.
44 | */
45 | @interface YYTextAsyncLayerDisplayTask : NSObject
46 |
47 | /**
48 | This block will be called before the asynchronous drawing begins.
49 | It will be called on the main thread.
50 |
51 | @param layer The layer.
52 | */
53 | @property (nullable, nonatomic, copy) void (^willDisplay)(CALayer *layer);
54 |
55 | /**
56 | This block is called to draw the layer's contents.
57 |
58 | @discussion This block may be called on main thread or background thread,
59 | so is should be thread-safe.
60 |
61 | @param context A new bitmap content created by layer.
62 | @param size The content size (typically same as layer's bound size).
63 | @param isCancelled If this block returns `YES`, the method should cancel the
64 | drawing process and return as quickly as possible.
65 | */
66 | @property (nullable, nonatomic, copy) void (^display)(CGContextRef context, CGSize size, BOOL(^isCancelled)(void));
67 |
68 | /**
69 | This block will be called after the asynchronous drawing finished.
70 | It will be called on the main thread.
71 |
72 | @param layer The layer.
73 | @param finished If the draw process is cancelled, it's `NO`, otherwise it's `YES`;
74 | */
75 | @property (nullable, nonatomic, copy) void (^didDisplay)(CALayer *layer, BOOL finished);
76 |
77 | @end
78 |
79 | NS_ASSUME_NONNULL_END
80 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/YYTextTransaction.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextTransaction.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/18.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | YYTextTransaction let you perform a selector once before current runloop sleep.
18 | */
19 | @interface YYTextTransaction : NSObject
20 |
21 | /**
22 | Creates and returns a transaction with a specified target and selector.
23 |
24 | @param target A specified target, the target is retained until runloop end.
25 | @param selector A selector for target.
26 |
27 | @return A new transaction, or nil if an error occurs.
28 | */
29 | + (YYTextTransaction *)transactionWithTarget:(id)target selector:(SEL)selector;
30 |
31 | /**
32 | Commit the trancaction to main runloop.
33 |
34 | @discussion It will perform the selector on the target once before main runloop's
35 | current loop sleep. If the same transaction (same target and same selector) has
36 | already commit to runloop in this loop, this method do nothing.
37 | */
38 | - (void)commit;
39 |
40 | @end
41 |
42 | NS_ASSUME_NONNULL_END
43 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/YYTextTransaction.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextTransaction.m
3 | // YYText
4 | //
5 | // Created by ibireme on 15/4/18.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextTransaction.h"
13 |
14 |
15 | @interface YYTextTransaction()
16 | @property (nonatomic, strong) id target;
17 | @property (nonatomic, assign) SEL selector;
18 | @end
19 |
20 | static NSMutableSet *transactionSet = nil;
21 |
22 | static void YYRunLoopObserverCallBack(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) {
23 | if (transactionSet.count == 0) return;
24 | NSSet *currentSet = transactionSet;
25 | transactionSet = [NSMutableSet new];
26 | [currentSet enumerateObjectsUsingBlock:^(YYTextTransaction *transaction, BOOL *stop) {
27 | #pragma clang diagnostic push
28 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
29 | [transaction.target performSelector:transaction.selector];
30 | #pragma clang diagnostic pop
31 | }];
32 | }
33 |
34 | static void YYTextTransactionSetup() {
35 | static dispatch_once_t onceToken;
36 | dispatch_once(&onceToken, ^{
37 | transactionSet = [NSMutableSet new];
38 | CFRunLoopRef runloop = CFRunLoopGetMain();
39 | CFRunLoopObserverRef observer;
40 |
41 | observer = CFRunLoopObserverCreate(CFAllocatorGetDefault(),
42 | kCFRunLoopBeforeWaiting | kCFRunLoopExit,
43 | true, // repeat
44 | 0xFFFFFF, // after CATransaction(2000000)
45 | YYRunLoopObserverCallBack, NULL);
46 | CFRunLoopAddObserver(runloop, observer, kCFRunLoopCommonModes);
47 | CFRelease(observer);
48 | });
49 | }
50 |
51 |
52 | @implementation YYTextTransaction
53 |
54 | + (YYTextTransaction *)transactionWithTarget:(id)target selector:(SEL)selector{
55 | if (!target || !selector) return nil;
56 | YYTextTransaction *t = [YYTextTransaction new];
57 | t.target = target;
58 | t.selector = selector;
59 | return t;
60 | }
61 |
62 | - (void)commit {
63 | if (!_target || !_selector) return;
64 | YYTextTransactionSetup();
65 | [transactionSet addObject:self];
66 | }
67 |
68 | - (NSUInteger)hash {
69 | long v1 = (long)((void *)_selector);
70 | long v2 = (long)_target;
71 | return v1 ^ v2;
72 | }
73 |
74 | - (BOOL)isEqual:(id)object {
75 | if (self == object) return YES;
76 | if (![object isMemberOfClass:self.class]) return NO;
77 | YYTextTransaction *other = object;
78 | return other.selector == _selector && other.target == _target;
79 | }
80 |
81 | @end
82 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/YYTextWeakProxy.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextWeakProxy.h
3 | // YYText
4 | //
5 | // Created by ibireme on 14/10/18.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | A proxy used to hold a weak object.
18 | It can be used to avoid retain cycles, such as the target in NSTimer or CADisplayLink.
19 |
20 | sample code:
21 |
22 | @implementation MyView {
23 | NSTimer *_timer;
24 | }
25 |
26 | - (void)initTimer {
27 | YYTextWeakProxy *proxy = [YYTextWeakProxy proxyWithTarget:self];
28 | _timer = [NSTimer timerWithTimeInterval:0.1 target:proxy selector:@selector(tick:) userInfo:nil repeats:YES];
29 | }
30 |
31 | - (void)tick:(NSTimer *)timer {...}
32 | @end
33 | */
34 | @interface YYTextWeakProxy : NSProxy
35 |
36 | /**
37 | The proxy target.
38 | */
39 | @property (nullable, nonatomic, weak, readonly) id target;
40 |
41 | /**
42 | Creates a new weak proxy for target.
43 |
44 | @param target Target object.
45 |
46 | @return A new proxy object.
47 | */
48 | - (instancetype)initWithTarget:(id)target;
49 |
50 | /**
51 | Creates a new weak proxy for target.
52 |
53 | @param target Target object.
54 |
55 | @return A new proxy object.
56 | */
57 | + (instancetype)proxyWithTarget:(id)target;
58 |
59 | @end
60 |
61 | NS_ASSUME_NONNULL_END
62 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/Utility/YYTextWeakProxy.m:
--------------------------------------------------------------------------------
1 | //
2 | // YYTextWeakProxy.m
3 | // YYText
4 | //
5 | // Created by ibireme on 14/10/18.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import "YYTextWeakProxy.h"
13 |
14 |
15 | @implementation YYTextWeakProxy
16 |
17 | - (instancetype)initWithTarget:(id)target {
18 | _target = target;
19 | return self;
20 | }
21 |
22 | + (instancetype)proxyWithTarget:(id)target {
23 | return [[YYTextWeakProxy alloc] initWithTarget:target];
24 | }
25 |
26 | - (id)forwardingTargetForSelector:(SEL)selector {
27 | return _target;
28 | }
29 |
30 | - (void)forwardInvocation:(NSInvocation *)invocation {
31 | void *null = NULL;
32 | [invocation setReturnValue:&null];
33 | }
34 |
35 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector {
36 | return [NSObject instanceMethodSignatureForSelector:@selector(init)];
37 | }
38 |
39 | - (BOOL)respondsToSelector:(SEL)aSelector {
40 | return [_target respondsToSelector:aSelector];
41 | }
42 |
43 | - (BOOL)isEqual:(id)object {
44 | return [_target isEqual:object];
45 | }
46 |
47 | - (NSUInteger)hash {
48 | return [_target hash];
49 | }
50 |
51 | - (Class)superclass {
52 | return [_target superclass];
53 | }
54 |
55 | - (Class)class {
56 | return [_target class];
57 | }
58 |
59 | - (BOOL)isKindOfClass:(Class)aClass {
60 | return [_target isKindOfClass:aClass];
61 | }
62 |
63 | - (BOOL)isMemberOfClass:(Class)aClass {
64 | return [_target isMemberOfClass:aClass];
65 | }
66 |
67 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol {
68 | return [_target conformsToProtocol:aProtocol];
69 | }
70 |
71 | - (BOOL)isProxy {
72 | return YES;
73 | }
74 |
75 | - (NSString *)description {
76 | return [_target description];
77 | }
78 |
79 | - (NSString *)debugDescription {
80 | return [_target debugDescription];
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/FSLoopScrollViewDemo/Pods/YYText/YYText/YYText.h:
--------------------------------------------------------------------------------
1 | //
2 | // YYText.h
3 | // YYText
4 | //
5 | // Created by ibireme on 15/2/25.
6 | // Copyright (c) 2015 ibireme.
7 | //
8 | // This source code is licensed under the MIT-style license found in the
9 | // LICENSE file in the root directory of this source tree.
10 | //
11 |
12 | #import
13 |
14 | #if __has_include()
15 | FOUNDATION_EXPORT double YYTextVersionNumber;
16 | FOUNDATION_EXPORT const unsigned char YYTextVersionString[];
17 | #import
18 | #import
19 | #import
20 | #import
21 | #import
22 | #import
23 | #import
24 | #import
25 | #import
26 | #import
27 | #import
28 | #import
29 | #import
30 | #import
31 | #import
32 | #import
33 | #else
34 | #import "YYLabel.h"
35 | #import "YYTextView.h"
36 | #import "YYTextAttribute.h"
37 | #import "YYTextArchiver.h"
38 | #import "YYTextParser.h"
39 | #import "YYTextRunDelegate.h"
40 | #import "YYTextRubyAnnotation.h"
41 | #import "YYTextLayout.h"
42 | #import "YYTextLine.h"
43 | #import "YYTextInput.h"
44 | #import "YYTextDebugOption.h"
45 | #import "YYTextKeyboardManager.h"
46 | #import "YYTextUtilities.h"
47 | #import "NSAttributedString+YYText.h"
48 | #import "NSParagraphStyle+YYText.h"
49 | #import "UIPasteboard+YYText.h"
50 | #endif
51 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FSLoopScrollView
2 | 这是一个无限循环轮播图/This is an infinite loop of rotation
3 | ## 展示图
4 |
5 |
--------------------------------------------------------------------------------
/loopViewDemo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shunFSKi/FSLoopScrollView/5abd539d967d51a68ed70ac5cffe4692d3829fb9/loopViewDemo.gif
--------------------------------------------------------------------------------