diff --git a/.gitignore b/.gitignore index 4c264eef..66bd5336 100755 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,7 @@ xcuserdata/ # you should judge for yourself, the pros and cons are mentioned at: # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control # -# Pods/ +Pods/ # Carthage # diff --git a/README.md b/README.md index d502a084..0bdd1051 100644 --- a/README.md +++ b/README.md @@ -1,142 +1,102 @@
-Github 点个赞↑👍,感谢您的支持! +

在武汉打算换工作啦, 有坑位推荐的朋友请加我微信~谢谢~

+
-GitHub:[NJHu](https://github.com/njhu) | Blog:[NJHu 微博(Chinese)](https://www.weibo.com/njhu) | [feedback](mailto:64hp@163.com):64hp@163.com +

iOSProject

- +
-## iOSProject - -- [开始](#Getting_Started) -- [首页功能列表](#homeList) -- [基础知识](#foundation) - - [多线程,NSThread,,线程同步,GCD,NSOperation,同步锁](#foundationList02) - - [运行时 RunTime, 运行循环 RunLoop](#foundationList01) - - [绘图,核心动画,物理仿真](#foundationList) -- [分享和第三方登录](#homeBaseShareLogin) -- [Demos 综合案例](#demo_s) - - [百思不得姐](#bsj) - - [微博](#wb) - - [QQ 音乐 music](#qqmusic) - - [视频播放](#videos) -- [Others 其他](#other_s) -- [期待](#qidai) - -## 首页功能列表 -| -| - -
-
- -## 基础知识 -| - -
-
- -### 多线程,NSThread,,线程同步,GCD,NSOperation,同步锁 - -
-
- -### 运行时 RunTime, 运行循环 RunLoop -| - + + + + + + + +
+ +
+
  • +GitHub: NJHu +
  • +
  • +简书: NJHu 简书 +
  • +
  • +Blog: NJHu 微博 +
  • +
  • +Email: 64hp@163.com +
  • +
    + +

    首页功能列表

    +
    +||| +


    -### 绘图,核心动画,物理仿真 -| -| - +

    基础知识

    +
    +||| +


    -## 分享和第三方登录 -| - -
    +

    多线程,NSThread,线程同步,GCD,NSOperation,同步锁

    +
    + +


    -## Demos 综合案例 - - -### 百思不得姐 -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - -
    -
    -
    +

    运行时 RunTime, 运行循环 RunLoop

    +
    +| + +


    -### 微博 -| -| -| -| -| -| -| -| - -
    -
    -
    +

    绘图,核心动画,物理仿真

    +
    ||| +


    -### QQ 音乐 music -| -| - -
    -
    -
    +

    分享和第三方登录

    +
    +||| +


    -### 视频播放 -| -| -| -| -| -| -| -| - -
    -
    -
    -
    -
    - -## 其他 -| +

    其他

    +
    + +
    -## 期待 -* 如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的Demo代码看看BUG修复没有) -* 如果在使用过程中发现功能不够用,希望你能Issues我,我非常想为这个Demo增加更多好用的功能,谢谢 -* 如果你想为iOSProject输出代码,请拼命Pull Requests我 +

    期待

    + diff --git a/iOSProject/Podfile b/iOSProject/Podfile index 24a5fc9f..68f7c389 100644 --- a/iOSProject/Podfile +++ b/iOSProject/Podfile @@ -7,7 +7,8 @@ inhibit_all_warnings! # 网络请求 pod 'AFNetworking' -pod 'ASIHTTPRequest' +#pod 'ASIHTTPRequest' + # 网络监控 pod 'Reachability' @@ -17,6 +18,8 @@ pod 'MJExtension' pod 'MJRefresh' # 图片加载 pod 'SDWebImage' +pod 'SDWebImage/GIF' + #用于适配 pod 'Masonry' @@ -28,22 +31,14 @@ pod 'UMengUShare/Social/ReducedWeChat' pod 'UMengUShare/Social/QQ' pod 'UMengUShare/Social/Sina' - #百度地图SDK -pod 'BaiduMapKit' - -# 环信连天包含实时语音版本 -# pod 'Hyphenate' -# pod 'EaseUI', :git => 'https://github.com/easemob/easeui-ios-hyphenate-cocoapods.git' - -pod 'CYLTabBarController' +pod 'BaiduMapKit', '4.1.1' # 表情键盘 -pod 'HMEmoticon' +#pod 'HMEmoticon' # 正则匹配点击 pod 'KILabel' - # YYKit #pod 'YYKit' pod 'YYImage' @@ -51,22 +46,16 @@ pod 'YYText' pod 'YYAsyncLayer' pod 'YYCategories' -# 通用链接跳转 -pod 'MagicWindowSDK' - -# 数据库 新浪微博用 +# 数据库 pod 'FMDB' # 蒙版 pod 'MBProgressHUD' -# h5交互 -pod 'WebViewJavascriptBridge' - # 进度 pod 'M13ProgressSuite' -# 无线轮播 +# 无限轮播 pod 'SDCycleScrollView' # 键盘管理 @@ -75,19 +64,13 @@ pod 'IQKeyboardManager' # 唯一设备标识 pod 'FCUUID' -# 指纹识别 -pod 'TDTouchID' # 三级联动 时间 地址 pod 'MOFSPickerManager' - # 全局滑动 pod 'FDFullscreenPopGesture' -# 数据存储 -pod 'GVUserDefaults' - # toast pod 'Toast' @@ -97,21 +80,27 @@ pod 'HMQRCodeScanner' # 照片 pod 'TZImagePickerController' -# 动态 collectionView -pod 'LxGridView' - -# 脸部识别 -pod 'iflyMSC' - # scrollpageView pod 'ZJScrollPageView' # 列表视频 -pod 'ZFPlayer' -pod 'ZFDownload' +pod 'ZFPlayer', '2.1.6' +#pod 'ZFDownload' # mark- 好玩的 # 泡泡uibutton pod 'DWBubbleMenuButton' +# 动态 collectionView +#pod 'LxGridView' +# 指纹识别 +#pod 'TDTouchID' +# h5交互 +#pod 'WebViewJavascriptBridge' +# 脸部识别 +#pod 'iflyMSC' +# 环信连天包含实时语音版本 +# pod 'Hyphenate' +# pod 'EaseUI', :git => 'https://github.com/easemob/easeui-ios-hyphenate-cocoapods.git' + end diff --git a/iOSProject/Podfile.lock b/iOSProject/Podfile.lock index 157a6d08..9d9c96ef 100644 --- a/iOSProject/Podfile.lock +++ b/iOSProject/Podfile.lock @@ -1,86 +1,67 @@ PODS: - - AFNetworking (3.1.0): - - AFNetworking/NSURLSession (= 3.1.0) - - AFNetworking/Reachability (= 3.1.0) - - AFNetworking/Security (= 3.1.0) - - AFNetworking/Serialization (= 3.1.0) - - AFNetworking/UIKit (= 3.1.0) - - AFNetworking/NSURLSession (3.1.0): + - AFNetworking (4.0.1): + - AFNetworking/NSURLSession (= 4.0.1) + - AFNetworking/Reachability (= 4.0.1) + - AFNetworking/Security (= 4.0.1) + - AFNetworking/Serialization (= 4.0.1) + - AFNetworking/UIKit (= 4.0.1) + - AFNetworking/NSURLSession (4.0.1): - AFNetworking/Reachability - AFNetworking/Security - AFNetworking/Serialization - - AFNetworking/Reachability (3.1.0) - - AFNetworking/Security (3.1.0) - - AFNetworking/Serialization (3.1.0) - - AFNetworking/UIKit (3.1.0): + - AFNetworking/Reachability (4.0.1) + - AFNetworking/Security (4.0.1) + - AFNetworking/Serialization (4.0.1) + - AFNetworking/UIKit (4.0.1): - AFNetworking/NSURLSession - - ASIHTTPRequest (1.8.2): - - ASIHTTPRequest/ASIWebPageRequest (= 1.8.2) - - ASIHTTPRequest/CloudFiles (= 1.8.2) - - ASIHTTPRequest/Core (= 1.8.2) - - ASIHTTPRequest/S3 (= 1.8.2) - - ASIHTTPRequest/ASIWebPageRequest (1.8.2): - - ASIHTTPRequest/Core - - ASIHTTPRequest/CloudFiles (1.8.2): - - ASIHTTPRequest/Core - - ASIHTTPRequest/Core (1.8.2): - - Reachability - - ASIHTTPRequest/S3 (1.8.2): - - ASIHTTPRequest/Core - - BaiduMapKit (3.4.2) - - CYLTabBarController (1.17.6) + - BaiduMapKit (4.1.1) - DWBubbleMenuButton (1.0.1) - FCUUID (1.3.1): - UICKeyChainStore (~> 2.1.0) - FDFullscreenPopGesture (1.1) - - FMDB (2.7.2): - - FMDB/standard (= 2.7.2) - - FMDB/standard (2.7.2) - - GVUserDefaults (1.0.2) - - HMEmoticon (1.0.12) + - FLAnimatedImage (1.0.12) + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) - HMQRCodeScanner (1.0.6) - - iflyMSC (1.144) - - IQKeyboardManager (5.0.7) + - IQKeyboardManager (6.5.6) - KILabel (1.0.1) - - LxGridView (1.0.0) - M13ProgressSuite (1.2.9) - - MagicWindowSDK (4.2.171115): - - WechatOpenSDK - Masonry (1.1.0) - - MBProgressHUD (1.1.0) - - MJExtension (3.0.13) - - MJRefresh (3.1.15.1) - - MOFSPickerManager (1.0.6) + - MBProgressHUD (1.2.0) + - MJExtension (3.2.2) + - MJRefresh (3.5.0) + - MOFSPickerManager (2.2.4) - Reachability (3.2) - SDCycleScrollView (1.75): - SDWebImage (>= 4.0.0) - - SDWebImage (4.2.3): - - SDWebImage/Core (= 4.2.3) - - SDWebImage/Core (4.2.3) - - TDTouchID (1.0.2) + - SDWebImage (4.4.8): + - SDWebImage/Core (= 4.4.8) + - SDWebImage/Core (4.4.8) + - SDWebImage/GIF (4.4.8): + - FLAnimatedImage (~> 1.0) + - SDWebImage/Core - Toast (4.0.0) - - TZImagePickerController (1.9.8) - - UICKeyChainStore (2.1.1) + - TZImagePickerController (3.4.2) + - UICKeyChainStore (2.1.2) - UMengAnalytics (4.2.4) - - UMengUShare/Core (6.4.8): + - UMengUShare/Core (6.4.8.2): - UMengUShare/Network - - UMengUShare/Network (6.4.8) - - UMengUShare/Social/QQ (6.4.8): + - UMengUShare/Network (6.4.8.2) + - UMengUShare/Social/QQ (6.4.8.2): - UMengUShare/Core - UMengUShare/Social/ReducedQQ - - UMengUShare/Social/ReducedQQ (6.4.8): + - UMengUShare/Social/ReducedQQ (6.4.8.2): - UMengUShare/Core - - UMengUShare/Social/ReducedSina (6.4.8): + - UMengUShare/Social/ReducedSina (6.4.8.2): - UMengUShare/Core - - UMengUShare/Social/ReducedWeChat (6.4.8): + - UMengUShare/Social/ReducedWeChat (6.4.8.2): - UMengUShare/Core - - UMengUShare/Social/Sina (6.4.8): + - UMengUShare/Social/Sina (6.4.8.2): - UMengUShare/Core - UMengUShare/Social/ReducedSina - - UMengUShare/UI (6.4.8): + - UMengUShare/UI (6.4.8.2): - UMengUShare/Core - - WebViewJavascriptBridge (6.0.3) - - WechatOpenSDK (1.8.1) - YYAsyncLayer (1.0) - YYCategories (1.0.4): - YYCategories/no-arc (= 1.0.4) @@ -89,30 +70,21 @@ PODS: - YYImage/Core (= 1.0.4) - YYImage/Core (1.0.4) - YYText (1.0.7) - - ZFDownload (1.0.2): - - ASIHTTPRequest - - ZFPlayer (2.1.5): + - ZFPlayer (2.1.6): - Masonry - ZJScrollPageView (0.4.0) DEPENDENCIES: - AFNetworking - - ASIHTTPRequest - - BaiduMapKit - - CYLTabBarController + - BaiduMapKit (= 4.1.1) - DWBubbleMenuButton - FCUUID - FDFullscreenPopGesture - FMDB - - GVUserDefaults - - HMEmoticon - HMQRCodeScanner - - iflyMSC - IQKeyboardManager - KILabel - - LxGridView - M13ProgressSuite - - MagicWindowSDK - Masonry - MBProgressHUD - MJExtension @@ -121,7 +93,7 @@ DEPENDENCIES: - Reachability - SDCycleScrollView - SDWebImage - - TDTouchID + - SDWebImage/GIF - Toast - TZImagePickerController - UMengAnalytics @@ -129,57 +101,78 @@ DEPENDENCIES: - UMengUShare/Social/ReducedWeChat - UMengUShare/Social/Sina - UMengUShare/UI - - WebViewJavascriptBridge - YYAsyncLayer - YYCategories - YYImage - YYText - - ZFDownload - - ZFPlayer + - ZFPlayer (= 2.1.6) - ZJScrollPageView +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - AFNetworking + - BaiduMapKit + - DWBubbleMenuButton + - FCUUID + - FDFullscreenPopGesture + - FLAnimatedImage + - FMDB + - HMQRCodeScanner + - IQKeyboardManager + - KILabel + - M13ProgressSuite + - Masonry + - MBProgressHUD + - MJExtension + - MJRefresh + - MOFSPickerManager + - Reachability + - SDCycleScrollView + - SDWebImage + - Toast + - TZImagePickerController + - UICKeyChainStore + - UMengAnalytics + - UMengUShare + - YYAsyncLayer + - YYCategories + - YYImage + - YYText + - ZFPlayer + - ZJScrollPageView + SPEC CHECKSUMS: - AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 - ASIHTTPRequest: ec013992946676b7978dcbde6396d57312d21db4 - BaiduMapKit: f61b19ecf07a3f2deede72b221b366bf698739ed - CYLTabBarController: c374643dea6dadece8bdff9c70f7387f8ffd7d08 + AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce + BaiduMapKit: 51bba432a28316680676b4d453a70e5031f3a7eb DWBubbleMenuButton: 4d9bdbb9d662bdf65c93ceb7fc65901871143d1e FCUUID: bb054fc90cd7cd99320f9f6ff8e130fe607fba05 FDFullscreenPopGesture: a8a620179e3d9c40e8e00256dcee1c1a27c6d0f0 - FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa - GVUserDefaults: 52d48cf8ba578b40a1a76312b196dfc9134ba36a - HMEmoticon: 7cac18c01b74a2eaf833e2083c0238cb3c29b6a8 + FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31 + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a HMQRCodeScanner: 8db2d317c0e5cbe3b4709fe2b9f26c107d66554e - iflyMSC: 7631cefeb1493b4bf0812a2a9b4fcdc6fe9f782e - IQKeyboardManager: 0bfa4607d39924116b5c0c8b55b5d789288b5cba + IQKeyboardManager: 2a6e97afdafc7becf0cb17a9a8d795e3a980717f KILabel: 4797807cdc0b4992dad8bf91175ddc973c3b569b - LxGridView: af7b9360cce8eec2bcb11aa9d3cb7b9674372b74 M13ProgressSuite: ea9f7263e73e9215e6849dfa54e29ee0ad6a145c - MagicWindowSDK: aa91ae646bb8b1ccd9479ea7fb0f4f7277ef31de Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 - MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9 - MJExtension: 5932755f451458eefa24239358817f8d291240c7 - MJRefresh: 5f8552bc25ca8751c010f621c1098dbdaacbccd6 - MOFSPickerManager: 9eafa3d0230e24a79f6f0d9cf191d7f089d31ee9 + MBProgressHUD: 3ee5efcc380f6a79a7cc9b363dd669c5e1ae7406 + MJExtension: d9b9c74cbdeb724c1e9ecbb157b318276e62e876 + MJRefresh: 6afc955813966afb08305477dd7a0d9ad5e79a16 + MOFSPickerManager: 24c0a437874696622f132c47a351b89df5030f19 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 SDCycleScrollView: 884b88f0266dd4708a0e1934975c69cb971707b1 - SDWebImage: 791bb72962b3492327ddcac4b1880bd1b5458431 - TDTouchID: d40027ed36e3d9f528b9b3f6bb6cf46f4f26f954 + SDWebImage: 783af2c3fa36291a250030c4752ee370a9a51d13 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 - TZImagePickerController: 3b9413ae5d049b1fdc5b0c720ad283f35b679a50 - UICKeyChainStore: 239558492fa260531a0774cfc611ea83a6eaff3a + TZImagePickerController: cc0b74d5f01ab4cddcc24dcdfc3c7d68e6261056 + UICKeyChainStore: 85db518bb1d294366d15ec9b92a416c4e670518f UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2 - UMengUShare: 7a0ab762ccd445ccfcf11bde8e7f81b29b9f5e1c - WebViewJavascriptBridge: 7f5bc4d3581e672e8f32bd0f812d54bc69bb8e29 - WechatOpenSDK: 491d965d79335070328571d3e79f714549e79a5e + UMengUShare: 370d180101e13ee0227ae657ab119ba97243d2b3 YYAsyncLayer: df6b01ebc695c5f6b4c15dd5c23fa3e081eb25c0 YYCategories: 6bcd4314c6661a561410dce4a793379ebd306abd YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 YYText: 5c461d709e24d55a182d1441c41dc639a18a4849 - ZFDownload: a52f94ebb080833b8a8ceb19a409f2941343fe7f - ZFPlayer: 8a80bf8eb4638b97fbceaefcd3ca9978e9f17c9d + ZFPlayer: 833cb3974b619bfd01a0ec1ebaabfe6f629e85b4 ZJScrollPageView: dd8778909cb2413782616ab156e873956f6b0682 -PODFILE CHECKSUM: 5804247614eaead164978ecf12f2683816f723b7 +PODFILE CHECKSUM: eb944b8090833ced99eac8c062404fd534cd2707 -COCOAPODS: 1.2.0 +COCOAPODS: 1.7.1 diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h b/iOSProject/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h deleted file mode 100644 index 5ce279a6..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h +++ /dev/null @@ -1,295 +0,0 @@ -// AFHTTPSessionManager.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#if !TARGET_OS_WATCH -#import -#endif -#import - -#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV -#import -#else -#import -#endif - -#import "AFURLSessionManager.h" - -/** - `AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths. - - ## Subclassing Notes - - Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application. - - For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect. - - ## Methods to Override - - To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:completionHandler:`. - - ## Serialization - - Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to ``. - - Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `` - - ## URL Construction Using Relative Paths - - For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`. - - Below are a few examples of how `baseURL` and relative paths interact: - - NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"]; - [NSURL URLWithString:@"foo" relativeToURL:baseURL]; // http://example.com/v1/foo - [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL]; // http://example.com/v1/foo?bar=baz - [NSURL URLWithString:@"/foo" relativeToURL:baseURL]; // http://example.com/foo - [NSURL URLWithString:@"foo/" relativeToURL:baseURL]; // http://example.com/v1/foo - [NSURL URLWithString:@"/foo/" relativeToURL:baseURL]; // http://example.com/foo/ - [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/ - - Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash. - - @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance. - */ - -NS_ASSUME_NONNULL_BEGIN - -@interface AFHTTPSessionManager : AFURLSessionManager - -/** - The URL used to construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods. - */ -@property (readonly, nonatomic, strong, nullable) NSURL *baseURL; - -/** - Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies. - - @warning `requestSerializer` must not be `nil`. - */ -@property (nonatomic, strong) AFHTTPRequestSerializer * requestSerializer; - -/** - Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`. - - @warning `responseSerializer` must not be `nil`. - */ -@property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; - -///--------------------- -/// @name Initialization -///--------------------- - -/** - Creates and returns an `AFHTTPSessionManager` object. - */ -+ (instancetype)manager; - -/** - Initializes an `AFHTTPSessionManager` object with the specified base URL. - - @param url The base URL for the HTTP client. - - @return The newly-initialized HTTP client - */ -- (instancetype)initWithBaseURL:(nullable NSURL *)url; - -/** - Initializes an `AFHTTPSessionManager` object with the specified base URL. - - This is the designated initializer. - - @param url The base URL for the HTTP client. - @param configuration The configuration used to create the managed session. - - @return The newly-initialized HTTP client - */ -- (instancetype)initWithBaseURL:(nullable NSURL *)url - sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; - -///--------------------------- -/// @name Making HTTP Requests -///--------------------------- - -/** - Creates and runs an `NSURLSessionDataTask` with a `GET` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - - -/** - Creates and runs an `NSURLSessionDataTask` with a `GET` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: - */ -- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(nullable id)parameters - progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; - -/** - Creates and runs an `NSURLSessionDataTask` with a `HEAD` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; - -/** - Creates and runs an `NSURLSessionDataTask` with a `POST` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - -/** - Creates and runs an `NSURLSessionDataTask` with a `POST` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: - */ -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; - -/** - Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - constructingBodyWithBlock:(nullable void (^)(id formData))block - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - -/** - Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. - @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: - */ -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - constructingBodyWithBlock:(nullable void (^)(id formData))block - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; - -/** - Creates and runs an `NSURLSessionDataTask` with a `PUT` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; - -/** - Creates and runs an `NSURLSessionDataTask` with a `PATCH` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; - -/** - Creates and runs an `NSURLSessionDataTask` with a `DELETE` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m b/iOSProject/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m deleted file mode 100644 index 25910706..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m +++ /dev/null @@ -1,361 +0,0 @@ -// AFHTTPSessionManager.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "AFHTTPSessionManager.h" - -#import "AFURLRequestSerialization.h" -#import "AFURLResponseSerialization.h" - -#import -#import -#import - -#import -#import -#import -#import -#import - -#if TARGET_OS_IOS || TARGET_OS_TV -#import -#elif TARGET_OS_WATCH -#import -#endif - -@interface AFHTTPSessionManager () -@property (readwrite, nonatomic, strong) NSURL *baseURL; -@end - -@implementation AFHTTPSessionManager -@dynamic responseSerializer; - -+ (instancetype)manager { - return [[[self class] alloc] initWithBaseURL:nil]; -} - -- (instancetype)init { - return [self initWithBaseURL:nil]; -} - -- (instancetype)initWithBaseURL:(NSURL *)url { - return [self initWithBaseURL:url sessionConfiguration:nil]; -} - -- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration { - return [self initWithBaseURL:nil sessionConfiguration:configuration]; -} - -- (instancetype)initWithBaseURL:(NSURL *)url - sessionConfiguration:(NSURLSessionConfiguration *)configuration -{ - self = [super initWithSessionConfiguration:configuration]; - if (!self) { - return nil; - } - - // Ensure terminal slash for baseURL path, so that NSURL +URLWithString:relativeToURL: works as expected - if ([[url path] length] > 0 && ![[url absoluteString] hasSuffix:@"/"]) { - url = [url URLByAppendingPathComponent:@""]; - } - - self.baseURL = url; - - self.requestSerializer = [AFHTTPRequestSerializer serializer]; - self.responseSerializer = [AFJSONResponseSerializer serializer]; - - return self; -} - -#pragma mark - - -- (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { - NSParameterAssert(requestSerializer); - - _requestSerializer = requestSerializer; -} - -- (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { - NSParameterAssert(responseSerializer); - - [super setResponseSerializer:responseSerializer]; -} - -#pragma mark - - -- (NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - - return [self GET:URLString parameters:parameters progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(id)parameters - progress:(void (^)(NSProgress * _Nonnull))downloadProgress - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure -{ - - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET" - URLString:URLString - parameters:parameters - uploadProgress:nil - downloadProgress:downloadProgress - success:success - failure:failure]; - - [dataTask resume]; - - return dataTask; -} - -- (NSURLSessionDataTask *)HEAD:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) { - if (success) { - success(task); - } - } failure:failure]; - - [dataTask resume]; - - return dataTask; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - return [self POST:URLString parameters:parameters progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - progress:(void (^)(NSProgress * _Nonnull))uploadProgress - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure -{ - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure]; - - [dataTask resume]; - - return dataTask; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - constructingBodyWithBlock:(nullable void (^)(id _Nonnull))block - success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure -{ - return [self POST:URLString parameters:parameters constructingBodyWithBlock:block progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - constructingBodyWithBlock:(void (^)(id formData))block - progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - NSError *serializationError = nil; - NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError]; - if (serializationError) { - if (failure) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ - failure(nil, serializationError); - }); -#pragma clang diagnostic pop - } - - return nil; - } - - __block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:uploadProgress completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) { - if (error) { - if (failure) { - failure(task, error); - } - } else { - if (success) { - success(task, responseObject); - } - } - }]; - - [task resume]; - - return task; -} - -- (NSURLSessionDataTask *)PUT:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; - - [dataTask resume]; - - return dataTask; -} - -- (NSURLSessionDataTask *)PATCH:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; - - [dataTask resume]; - - return dataTask; -} - -- (NSURLSessionDataTask *)DELETE:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; - - [dataTask resume]; - - return dataTask; -} - -- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method - URLString:(NSString *)URLString - parameters:(id)parameters - uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress - downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress - success:(void (^)(NSURLSessionDataTask *, id))success - failure:(void (^)(NSURLSessionDataTask *, NSError *))failure -{ - NSError *serializationError = nil; - NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError]; - if (serializationError) { - if (failure) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ - failure(nil, serializationError); - }); -#pragma clang diagnostic pop - } - - return nil; - } - - __block NSURLSessionDataTask *dataTask = nil; - dataTask = [self dataTaskWithRequest:request - uploadProgress:uploadProgress - downloadProgress:downloadProgress - completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) { - if (error) { - if (failure) { - failure(dataTask, error); - } - } else { - if (success) { - success(dataTask, responseObject); - } - } - }]; - - return dataTask; -} - -#pragma mark - NSObject - -- (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.session, self.operationQueue]; -} - -#pragma mark - NSSecureCoding - -+ (BOOL)supportsSecureCoding { - return YES; -} - -- (instancetype)initWithCoder:(NSCoder *)decoder { - NSURL *baseURL = [decoder decodeObjectOfClass:[NSURL class] forKey:NSStringFromSelector(@selector(baseURL))]; - NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"]; - if (!configuration) { - NSString *configurationIdentifier = [decoder decodeObjectOfClass:[NSString class] forKey:@"identifier"]; - if (configurationIdentifier) { -#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1100) - configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:configurationIdentifier]; -#else - configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:configurationIdentifier]; -#endif - } - } - - self = [self initWithBaseURL:baseURL sessionConfiguration:configuration]; - if (!self) { - return nil; - } - - self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))]; - self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))]; - AFSecurityPolicy *decodedPolicy = [decoder decodeObjectOfClass:[AFSecurityPolicy class] forKey:NSStringFromSelector(@selector(securityPolicy))]; - if (decodedPolicy) { - self.securityPolicy = decodedPolicy; - } - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; - - [coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))]; - if ([self.session.configuration conformsToProtocol:@protocol(NSCoding)]) { - [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"]; - } else { - [coder encodeObject:self.session.configuration.identifier forKey:@"identifier"]; - } - [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))]; - [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))]; - [coder encodeObject:self.securityPolicy forKey:NSStringFromSelector(@selector(securityPolicy))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFHTTPSessionManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL sessionConfiguration:self.session.configuration]; - - HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone]; - HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone]; - HTTPClient.securityPolicy = [self.securityPolicy copyWithZone:zone]; - return HTTPClient; -} - -@end diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h b/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h deleted file mode 100644 index 0feb18d3..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h +++ /dev/null @@ -1,206 +0,0 @@ -// AFNetworkReachabilityManager.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#if !TARGET_OS_WATCH -#import - -typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) { - AFNetworkReachabilityStatusUnknown = -1, - AFNetworkReachabilityStatusNotReachable = 0, - AFNetworkReachabilityStatusReachableViaWWAN = 1, - AFNetworkReachabilityStatusReachableViaWiFi = 2, -}; - -NS_ASSUME_NONNULL_BEGIN - -/** - `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. - - Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability. - - See Apple's Reachability Sample Code ( https://developer.apple.com/library/ios/samplecode/reachability/ ) - - @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined. - */ -@interface AFNetworkReachabilityManager : NSObject - -/** - The current network reachability status. - */ -@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; - -/** - Whether or not the network is currently reachable. - */ -@property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable; - -/** - Whether or not the network is currently reachable via WWAN. - */ -@property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN; - -/** - Whether or not the network is currently reachable via WiFi. - */ -@property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi; - -///--------------------- -/// @name Initialization -///--------------------- - -/** - Returns the shared network reachability manager. - */ -+ (instancetype)sharedManager; - -/** - Creates and returns a network reachability manager with the default socket address. - - @return An initialized network reachability manager, actively monitoring the default socket address. - */ -+ (instancetype)manager; - -/** - Creates and returns a network reachability manager for the specified domain. - - @param domain The domain used to evaluate network reachability. - - @return An initialized network reachability manager, actively monitoring the specified domain. - */ -+ (instancetype)managerForDomain:(NSString *)domain; - -/** - Creates and returns a network reachability manager for the socket address. - - @param address The socket address (`sockaddr_in6`) used to evaluate network reachability. - - @return An initialized network reachability manager, actively monitoring the specified socket address. - */ -+ (instancetype)managerForAddress:(const void *)address; - -/** - Initializes an instance of a network reachability manager from the specified reachability object. - - @param reachability The reachability object to monitor. - - @return An initialized network reachability manager, actively monitoring the specified reachability. - */ -- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER; - -///-------------------------------------------------- -/// @name Starting & Stopping Reachability Monitoring -///-------------------------------------------------- - -/** - Starts monitoring for changes in network reachability status. - */ -- (void)startMonitoring; - -/** - Stops monitoring for changes in network reachability status. - */ -- (void)stopMonitoring; - -///------------------------------------------------- -/// @name Getting Localized Reachability Description -///------------------------------------------------- - -/** - Returns a localized string representation of the current network reachability status. - */ -- (NSString *)localizedNetworkReachabilityStatusString; - -///--------------------------------------------------- -/// @name Setting Network Reachability Change Callback -///--------------------------------------------------- - -/** - Sets a callback to be executed when the network availability of the `baseURL` host changes. - - @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`. - */ -- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block; - -@end - -///---------------- -/// @name Constants -///---------------- - -/** - ## Network Reachability - - The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses. - - enum { - AFNetworkReachabilityStatusUnknown, - AFNetworkReachabilityStatusNotReachable, - AFNetworkReachabilityStatusReachableViaWWAN, - AFNetworkReachabilityStatusReachableViaWiFi, - } - - `AFNetworkReachabilityStatusUnknown` - The `baseURL` host reachability is not known. - - `AFNetworkReachabilityStatusNotReachable` - The `baseURL` host cannot be reached. - - `AFNetworkReachabilityStatusReachableViaWWAN` - The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS. - - `AFNetworkReachabilityStatusReachableViaWiFi` - The `baseURL` host can be reached via a Wi-Fi connection. - - ### Keys for Notification UserInfo Dictionary - - Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification. - - `AFNetworkingReachabilityNotificationStatusItem` - A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification. - The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status. - */ - -///-------------------- -/// @name Notifications -///-------------------- - -/** - Posted when network reachability changes. - This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability. - - @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import ` to the header prefix of the project (`Prefix.pch`). - */ -FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification; -FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem; - -///-------------------- -/// @name Functions -///-------------------- - -/** - Returns a localized string representation of an `AFNetworkReachabilityStatus` value. - */ -FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status); - -NS_ASSUME_NONNULL_END -#endif diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m b/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m deleted file mode 100644 index d4583648..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m +++ /dev/null @@ -1,263 +0,0 @@ -// AFNetworkReachabilityManager.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "AFNetworkReachabilityManager.h" -#if !TARGET_OS_WATCH - -#import -#import -#import -#import -#import - -NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire.networking.reachability.change"; -NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem"; - -typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status); - -NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) { - switch (status) { - case AFNetworkReachabilityStatusNotReachable: - return NSLocalizedStringFromTable(@"Not Reachable", @"AFNetworking", nil); - case AFNetworkReachabilityStatusReachableViaWWAN: - return NSLocalizedStringFromTable(@"Reachable via WWAN", @"AFNetworking", nil); - case AFNetworkReachabilityStatusReachableViaWiFi: - return NSLocalizedStringFromTable(@"Reachable via WiFi", @"AFNetworking", nil); - case AFNetworkReachabilityStatusUnknown: - default: - return NSLocalizedStringFromTable(@"Unknown", @"AFNetworking", nil); - } -} - -static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetworkReachabilityFlags flags) { - BOOL isReachable = ((flags & kSCNetworkReachabilityFlagsReachable) != 0); - BOOL needsConnection = ((flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0); - BOOL canConnectionAutomatically = (((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || ((flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)); - BOOL canConnectWithoutUserInteraction = (canConnectionAutomatically && (flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0); - BOOL isNetworkReachable = (isReachable && (!needsConnection || canConnectWithoutUserInteraction)); - - AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusUnknown; - if (isNetworkReachable == NO) { - status = AFNetworkReachabilityStatusNotReachable; - } -#if TARGET_OS_IPHONE - else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) { - status = AFNetworkReachabilityStatusReachableViaWWAN; - } -#endif - else { - status = AFNetworkReachabilityStatusReachableViaWiFi; - } - - return status; -} - -/** - * Queue a status change notification for the main thread. - * - * This is done to ensure that the notifications are received in the same order - * as they are sent. If notifications are sent directly, it is possible that - * a queued notification (for an earlier status condition) is processed after - * the later update, resulting in the listener being left in the wrong state. - */ -static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusBlock block) { - AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags); - dispatch_async(dispatch_get_main_queue(), ^{ - if (block) { - block(status); - } - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) }; - [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo]; - }); -} - -static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) { - AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusBlock)info); -} - - -static const void * AFNetworkReachabilityRetainCallback(const void *info) { - return Block_copy(info); -} - -static void AFNetworkReachabilityReleaseCallback(const void *info) { - if (info) { - Block_release(info); - } -} - -@interface AFNetworkReachabilityManager () -@property (readonly, nonatomic, assign) SCNetworkReachabilityRef networkReachability; -@property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; -@property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock; -@end - -@implementation AFNetworkReachabilityManager - -+ (instancetype)sharedManager { - static AFNetworkReachabilityManager *_sharedManager = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _sharedManager = [self manager]; - }); - - return _sharedManager; -} - -+ (instancetype)managerForDomain:(NSString *)domain { - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [domain UTF8String]); - - AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability]; - - CFRelease(reachability); - - return manager; -} - -+ (instancetype)managerForAddress:(const void *)address { - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)address); - AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability]; - - CFRelease(reachability); - - return manager; -} - -+ (instancetype)manager -{ -#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - struct sockaddr_in6 address; - bzero(&address, sizeof(address)); - address.sin6_len = sizeof(address); - address.sin6_family = AF_INET6; -#else - struct sockaddr_in address; - bzero(&address, sizeof(address)); - address.sin_len = sizeof(address); - address.sin_family = AF_INET; -#endif - return [self managerForAddress:&address]; -} - -- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability { - self = [super init]; - if (!self) { - return nil; - } - - _networkReachability = CFRetain(reachability); - self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown; - - return self; -} - -- (instancetype)init NS_UNAVAILABLE -{ - return nil; -} - -- (void)dealloc { - [self stopMonitoring]; - - if (_networkReachability != NULL) { - CFRelease(_networkReachability); - } -} - -#pragma mark - - -- (BOOL)isReachable { - return [self isReachableViaWWAN] || [self isReachableViaWiFi]; -} - -- (BOOL)isReachableViaWWAN { - return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWWAN; -} - -- (BOOL)isReachableViaWiFi { - return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWiFi; -} - -#pragma mark - - -- (void)startMonitoring { - [self stopMonitoring]; - - if (!self.networkReachability) { - return; - } - - __weak __typeof(self)weakSelf = self; - AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - - strongSelf.networkReachabilityStatus = status; - if (strongSelf.networkReachabilityStatusBlock) { - strongSelf.networkReachabilityStatusBlock(status); - } - - }; - - SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL}; - SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context); - SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); - - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{ - SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(self.networkReachability, &flags)) { - AFPostReachabilityStatusChange(flags, callback); - } - }); -} - -- (void)stopMonitoring { - if (!self.networkReachability) { - return; - } - - SCNetworkReachabilityUnscheduleFromRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); -} - -#pragma mark - - -- (NSString *)localizedNetworkReachabilityStatusString { - return AFStringFromNetworkReachabilityStatus(self.networkReachabilityStatus); -} - -#pragma mark - - -- (void)setReachabilityStatusChangeBlock:(void (^)(AFNetworkReachabilityStatus status))block { - self.networkReachabilityStatusBlock = block; -} - -#pragma mark - NSKeyValueObserving - -+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key { - if ([key isEqualToString:@"reachable"] || [key isEqualToString:@"reachableViaWWAN"] || [key isEqualToString:@"reachableViaWiFi"]) { - return [NSSet setWithObject:@"networkReachabilityStatus"]; - } - - return [super keyPathsForValuesAffectingValueForKey:key]; -} - -@end -#endif diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworking.h b/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworking.h deleted file mode 100644 index e2fb2f44..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFNetworking.h +++ /dev/null @@ -1,41 +0,0 @@ -// AFNetworking.h -// -// Copyright (c) 2013 AFNetworking (http://afnetworking.com/) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import -#import - -#ifndef _AFNETWORKING_ - #define _AFNETWORKING_ - - #import "AFURLRequestSerialization.h" - #import "AFURLResponseSerialization.h" - #import "AFSecurityPolicy.h" - -#if !TARGET_OS_WATCH - #import "AFNetworkReachabilityManager.h" -#endif - - #import "AFURLSessionManager.h" - #import "AFHTTPSessionManager.h" - -#endif /* _AFNETWORKING_ */ diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h b/iOSProject/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h deleted file mode 100644 index c005efa8..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h +++ /dev/null @@ -1,154 +0,0 @@ -// AFSecurityPolicy.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import - -typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { - AFSSLPinningModeNone, - AFSSLPinningModePublicKey, - AFSSLPinningModeCertificate, -}; - -/** - `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. - - Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. - */ - -NS_ASSUME_NONNULL_BEGIN - -@interface AFSecurityPolicy : NSObject - -/** - The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. - */ -@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; - -/** - The certificates used to evaluate server trust according to the SSL pinning mode. - - By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`. - - Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. - */ -@property (nonatomic, strong, nullable) NSSet *pinnedCertificates; - -/** - Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. - */ -@property (nonatomic, assign) BOOL allowInvalidCertificates; - -/** - Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. - */ -@property (nonatomic, assign) BOOL validatesDomainName; - -///----------------------------------------- -/// @name Getting Certificates from the Bundle -///----------------------------------------- - -/** - Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`. - - @return The certificates included in the given bundle. - */ -+ (NSSet *)certificatesInBundle:(NSBundle *)bundle; - -///----------------------------------------- -/// @name Getting Specific Security Policies -///----------------------------------------- - -/** - Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. - - @return The default security policy. - */ -+ (instancetype)defaultPolicy; - -///--------------------- -/// @name Initialization -///--------------------- - -/** - Creates and returns a security policy with the specified pinning mode. - - @param pinningMode The SSL pinning mode. - - @return A new security policy. - */ -+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; - -/** - Creates and returns a security policy with the specified pinning mode. - - @param pinningMode The SSL pinning mode. - @param pinnedCertificates The certificates to pin against. - - @return A new security policy. - */ -+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates; - -///------------------------------ -/// @name Evaluating Server Trust -///------------------------------ - -/** - Whether or not the specified server trust should be accepted, based on the security policy. - - This method should be used when responding to an authentication challenge from a server. - - @param serverTrust The X.509 certificate trust of the server. - @param domain The domain of serverTrust. If `nil`, the domain will not be validated. - - @return Whether or not to trust the server. - */ -- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust - forDomain:(nullable NSString *)domain; - -@end - -NS_ASSUME_NONNULL_END - -///---------------- -/// @name Constants -///---------------- - -/** - ## SSL Pinning Modes - - The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. - - enum { - AFSSLPinningModeNone, - AFSSLPinningModePublicKey, - AFSSLPinningModeCertificate, - } - - `AFSSLPinningModeNone` - Do not used pinned certificates to validate servers. - - `AFSSLPinningModePublicKey` - Validate host certificates against public keys of pinned certificates. - - `AFSSLPinningModeCertificate` - Validate host certificates against pinned certificates. -*/ diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m b/iOSProject/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m deleted file mode 100644 index ec81d377..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m +++ /dev/null @@ -1,353 +0,0 @@ -// AFSecurityPolicy.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "AFSecurityPolicy.h" - -#import - -#if !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV -static NSData * AFSecKeyGetData(SecKeyRef key) { - CFDataRef data = NULL; - - __Require_noErr_Quiet(SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data), _out); - - return (__bridge_transfer NSData *)data; - -_out: - if (data) { - CFRelease(data); - } - - return nil; -} -#endif - -static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) { -#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV - return [(__bridge id)key1 isEqual:(__bridge id)key2]; -#else - return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)]; -#endif -} - -static id AFPublicKeyForCertificate(NSData *certificate) { - id allowedPublicKey = nil; - SecCertificateRef allowedCertificate; - SecCertificateRef allowedCertificates[1]; - CFArrayRef tempCertificates = nil; - SecPolicyRef policy = nil; - SecTrustRef allowedTrust = nil; - SecTrustResultType result; - - allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate); - __Require_Quiet(allowedCertificate != NULL, _out); - - allowedCertificates[0] = allowedCertificate; - tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL); - - policy = SecPolicyCreateBasicX509(); - __Require_noErr_Quiet(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out); - __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out); - - allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust); - -_out: - if (allowedTrust) { - CFRelease(allowedTrust); - } - - if (policy) { - CFRelease(policy); - } - - if (tempCertificates) { - CFRelease(tempCertificates); - } - - if (allowedCertificate) { - CFRelease(allowedCertificate); - } - - return allowedPublicKey; -} - -static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) { - BOOL isValid = NO; - SecTrustResultType result; - __Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out); - - isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed); - -_out: - return isValid; -} - -static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) { - CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust); - NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount]; - - for (CFIndex i = 0; i < certificateCount; i++) { - SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i); - [trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)]; - } - - return [NSArray arrayWithArray:trustChain]; -} - -static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { - SecPolicyRef policy = SecPolicyCreateBasicX509(); - CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust); - NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount]; - for (CFIndex i = 0; i < certificateCount; i++) { - SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i); - - SecCertificateRef someCertificates[] = {certificate}; - CFArrayRef certificates = CFArrayCreate(NULL, (const void **)someCertificates, 1, NULL); - - SecTrustRef trust; - __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out); - - SecTrustResultType result; - __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out); - - [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)]; - - _out: - if (trust) { - CFRelease(trust); - } - - if (certificates) { - CFRelease(certificates); - } - - continue; - } - CFRelease(policy); - - return [NSArray arrayWithArray:trustChain]; -} - -#pragma mark - - -@interface AFSecurityPolicy() -@property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode; -@property (readwrite, nonatomic, strong) NSSet *pinnedPublicKeys; -@end - -@implementation AFSecurityPolicy - -+ (NSSet *)certificatesInBundle:(NSBundle *)bundle { - NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."]; - - NSMutableSet *certificates = [NSMutableSet setWithCapacity:[paths count]]; - for (NSString *path in paths) { - NSData *certificateData = [NSData dataWithContentsOfFile:path]; - [certificates addObject:certificateData]; - } - - return [NSSet setWithSet:certificates]; -} - -+ (NSSet *)defaultPinnedCertificates { - static NSSet *_defaultPinnedCertificates = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - _defaultPinnedCertificates = [self certificatesInBundle:bundle]; - }); - - return _defaultPinnedCertificates; -} - -+ (instancetype)defaultPolicy { - AFSecurityPolicy *securityPolicy = [[self alloc] init]; - securityPolicy.SSLPinningMode = AFSSLPinningModeNone; - - return securityPolicy; -} - -+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode { - return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]]; -} - -+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates { - AFSecurityPolicy *securityPolicy = [[self alloc] init]; - securityPolicy.SSLPinningMode = pinningMode; - - [securityPolicy setPinnedCertificates:pinnedCertificates]; - - return securityPolicy; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.validatesDomainName = YES; - - return self; -} - -- (void)setPinnedCertificates:(NSSet *)pinnedCertificates { - _pinnedCertificates = pinnedCertificates; - - if (self.pinnedCertificates) { - NSMutableSet *mutablePinnedPublicKeys = [NSMutableSet setWithCapacity:[self.pinnedCertificates count]]; - for (NSData *certificate in self.pinnedCertificates) { - id publicKey = AFPublicKeyForCertificate(certificate); - if (!publicKey) { - continue; - } - [mutablePinnedPublicKeys addObject:publicKey]; - } - self.pinnedPublicKeys = [NSSet setWithSet:mutablePinnedPublicKeys]; - } else { - self.pinnedPublicKeys = nil; - } -} - -#pragma mark - - -- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust - forDomain:(NSString *)domain -{ - if (domain && self.allowInvalidCertificates && self.validatesDomainName && (self.SSLPinningMode == AFSSLPinningModeNone || [self.pinnedCertificates count] == 0)) { - // https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/OverridingSSLChainValidationCorrectly.html - // According to the docs, you should only trust your provided certs for evaluation. - // Pinned certificates are added to the trust. Without pinned certificates, - // there is nothing to evaluate against. - // - // From Apple Docs: - // "Do not implicitly trust self-signed certificates as anchors (kSecTrustOptionImplicitAnchors). - // Instead, add your own (self-signed) CA certificate to the list of trusted anchors." - NSLog(@"In order to validate a domain name for self signed certificates, you MUST use pinning."); - return NO; - } - - NSMutableArray *policies = [NSMutableArray array]; - if (self.validatesDomainName) { - [policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)]; - } else { - [policies addObject:(__bridge_transfer id)SecPolicyCreateBasicX509()]; - } - - SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies); - - if (self.SSLPinningMode == AFSSLPinningModeNone) { - return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust); - } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) { - return NO; - } - - switch (self.SSLPinningMode) { - case AFSSLPinningModeNone: - default: - return NO; - case AFSSLPinningModeCertificate: { - NSMutableArray *pinnedCertificates = [NSMutableArray array]; - for (NSData *certificateData in self.pinnedCertificates) { - [pinnedCertificates addObject:(__bridge_transfer id)SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData)]; - } - SecTrustSetAnchorCertificates(serverTrust, (__bridge CFArrayRef)pinnedCertificates); - - if (!AFServerTrustIsValid(serverTrust)) { - return NO; - } - - // obtain the chain after being validated, which *should* contain the pinned certificate in the last position (if it's the Root CA) - NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust); - - for (NSData *trustChainCertificate in [serverCertificates reverseObjectEnumerator]) { - if ([self.pinnedCertificates containsObject:trustChainCertificate]) { - return YES; - } - } - - return NO; - } - case AFSSLPinningModePublicKey: { - NSUInteger trustedPublicKeyCount = 0; - NSArray *publicKeys = AFPublicKeyTrustChainForServerTrust(serverTrust); - - for (id trustChainPublicKey in publicKeys) { - for (id pinnedPublicKey in self.pinnedPublicKeys) { - if (AFSecKeyIsEqualToKey((__bridge SecKeyRef)trustChainPublicKey, (__bridge SecKeyRef)pinnedPublicKey)) { - trustedPublicKeyCount += 1; - } - } - } - return trustedPublicKeyCount > 0; - } - } - - return NO; -} - -#pragma mark - NSKeyValueObserving - -+ (NSSet *)keyPathsForValuesAffectingPinnedPublicKeys { - return [NSSet setWithObject:@"pinnedCertificates"]; -} - -#pragma mark - NSSecureCoding - -+ (BOOL)supportsSecureCoding { - return YES; -} - -- (instancetype)initWithCoder:(NSCoder *)decoder { - - self = [self init]; - if (!self) { - return nil; - } - - self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue]; - self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))]; - self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))]; - self.pinnedCertificates = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [coder encodeObject:[NSNumber numberWithUnsignedInteger:self.SSLPinningMode] forKey:NSStringFromSelector(@selector(SSLPinningMode))]; - [coder encodeBool:self.allowInvalidCertificates forKey:NSStringFromSelector(@selector(allowInvalidCertificates))]; - [coder encodeBool:self.validatesDomainName forKey:NSStringFromSelector(@selector(validatesDomainName))]; - [coder encodeObject:self.pinnedCertificates forKey:NSStringFromSelector(@selector(pinnedCertificates))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFSecurityPolicy *securityPolicy = [[[self class] allocWithZone:zone] init]; - securityPolicy.SSLPinningMode = self.SSLPinningMode; - securityPolicy.allowInvalidCertificates = self.allowInvalidCertificates; - securityPolicy.validatesDomainName = self.validatesDomainName; - securityPolicy.pinnedCertificates = [self.pinnedCertificates copyWithZone:zone]; - - return securityPolicy; -} - -@end diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h b/iOSProject/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h deleted file mode 100644 index 694696b9..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h +++ /dev/null @@ -1,479 +0,0 @@ -// AFURLRequestSerialization.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import - -#if TARGET_OS_IOS || TARGET_OS_TV -#import -#elif TARGET_OS_WATCH -#import -#endif - -NS_ASSUME_NONNULL_BEGIN - -/** - Returns a percent-escaped string following RFC 3986 for a query string key or value. - RFC 3986 states that the following characters are "reserved" characters. - - General Delimiters: ":", "#", "[", "]", "@", "?", "/" - - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" - - In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow - query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" - should be percent-escaped in the query string. - - @param string The string to be percent-escaped. - - @return The percent-escaped string. - */ -FOUNDATION_EXPORT NSString * AFPercentEscapedStringFromString(NSString *string); - -/** - A helper method to generate encoded url query parameters for appending to the end of a URL. - - @param parameters A dictionary of key/values to be encoded. - - @return A url encoded query string - */ -FOUNDATION_EXPORT NSString * AFQueryStringFromParameters(NSDictionary *parameters); - -/** - The `AFURLRequestSerialization` protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary. - - For example, a JSON request serializer may set the HTTP body of the request to a JSON representation, and set the `Content-Type` HTTP header field value to `application/json`. - */ -@protocol AFURLRequestSerialization - -/** - Returns a request with the specified parameters encoded into a copy of the original request. - - @param request The original request. - @param parameters The parameters to be encoded. - @param error The error that occurred while attempting to encode the request parameters. - - @return A serialized request. - */ -- (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request - withParameters:(nullable id)parameters - error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; - -@end - -#pragma mark - - -/** - - */ -typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) { - AFHTTPRequestQueryStringDefaultStyle = 0, -}; - -@protocol AFMultipartFormData; - -/** - `AFHTTPRequestSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation. - - Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPRequestSerializer` in order to ensure consistent default behavior. - */ -@interface AFHTTPRequestSerializer : NSObject - -/** - The string encoding used to serialize parameters. `NSUTF8StringEncoding` by default. - */ -@property (nonatomic, assign) NSStringEncoding stringEncoding; - -/** - Whether created requests can use the device’s cellular radio (if present). `YES` by default. - - @see NSMutableURLRequest -setAllowsCellularAccess: - */ -@property (nonatomic, assign) BOOL allowsCellularAccess; - -/** - The cache policy of created requests. `NSURLRequestUseProtocolCachePolicy` by default. - - @see NSMutableURLRequest -setCachePolicy: - */ -@property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy; - -/** - Whether created requests should use the default cookie handling. `YES` by default. - - @see NSMutableURLRequest -setHTTPShouldHandleCookies: - */ -@property (nonatomic, assign) BOOL HTTPShouldHandleCookies; - -/** - Whether created requests can continue transmitting data before receiving a response from an earlier transmission. `NO` by default - - @see NSMutableURLRequest -setHTTPShouldUsePipelining: - */ -@property (nonatomic, assign) BOOL HTTPShouldUsePipelining; - -/** - The network service type for created requests. `NSURLNetworkServiceTypeDefault` by default. - - @see NSMutableURLRequest -setNetworkServiceType: - */ -@property (nonatomic, assign) NSURLRequestNetworkServiceType networkServiceType; - -/** - The timeout interval, in seconds, for created requests. The default timeout interval is 60 seconds. - - @see NSMutableURLRequest -setTimeoutInterval: - */ -@property (nonatomic, assign) NSTimeInterval timeoutInterval; - -///--------------------------------------- -/// @name Configuring HTTP Request Headers -///--------------------------------------- - -/** - Default HTTP header field values to be applied to serialized requests. By default, these include the following: - - - `Accept-Language` with the contents of `NSLocale +preferredLanguages` - - `User-Agent` with the contents of various bundle identifiers and OS designations - - @discussion To add or remove default request headers, use `setValue:forHTTPHeaderField:`. - */ -@property (readonly, nonatomic, strong) NSDictionary *HTTPRequestHeaders; - -/** - Creates and returns a serializer with default configuration. - */ -+ (instancetype)serializer; - -/** - Sets the value for the HTTP headers set in request objects made by the HTTP client. If `nil`, removes the existing value for that header. - - @param field The HTTP header to set a default value for - @param value The value set as default for the specified header, or `nil` - */ -- (void)setValue:(nullable NSString *)value -forHTTPHeaderField:(NSString *)field; - -/** - Returns the value for the HTTP headers set in the request serializer. - - @param field The HTTP header to retrieve the default value for - - @return The value set as default for the specified header, or `nil` - */ -- (nullable NSString *)valueForHTTPHeaderField:(NSString *)field; - -/** - Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header. - - @param username The HTTP basic auth username - @param password The HTTP basic auth password - */ -- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username - password:(NSString *)password; - -/** - Clears any existing value for the "Authorization" HTTP header. - */ -- (void)clearAuthorizationHeader; - -///------------------------------------------------------- -/// @name Configuring Query String Parameter Serialization -///------------------------------------------------------- - -/** - HTTP methods for which serialized requests will encode parameters as a query string. `GET`, `HEAD`, and `DELETE` by default. - */ -@property (nonatomic, strong) NSSet *HTTPMethodsEncodingParametersInURI; - -/** - Set the method of query string serialization according to one of the pre-defined styles. - - @param style The serialization style. - - @see AFHTTPRequestQueryStringSerializationStyle - */ -- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style; - -/** - Set the a custom method of query string serialization according to the specified block. - - @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request. - */ -- (void)setQueryStringSerializationWithBlock:(nullable NSString * (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block; - -///------------------------------- -/// @name Creating Request Objects -///------------------------------- - -/** - Creates an `NSMutableURLRequest` object with the specified HTTP method and URL string. - - If the HTTP method is `GET`, `HEAD`, or `DELETE`, the parameters will be used to construct a url-encoded query string that is appended to the request's URL. Otherwise, the parameters will be encoded according to the value of the `parameterEncoding` property, and set as the request body. - - @param method The HTTP method for the request, such as `GET`, `POST`, `PUT`, or `DELETE`. This parameter must not be `nil`. - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be either set as a query string for `GET` requests, or the request HTTP body. - @param error The error that occurred while constructing the request. - - @return An `NSMutableURLRequest` object. - */ -- (NSMutableURLRequest *)requestWithMethod:(NSString *)method - URLString:(NSString *)URLString - parameters:(nullable id)parameters - error:(NSError * _Nullable __autoreleasing *)error; - -/** - Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 - - Multipart form requests are automatically streamed, reading files directly from disk along with in-memory data in a single HTTP body. The resulting `NSMutableURLRequest` object has an `HTTPBodyStream` property, so refrain from setting `HTTPBodyStream` or `HTTPBody` on this request object, as it will clear out the multipart form body stream. - - @param method The HTTP method for the request. This parameter must not be `GET` or `HEAD`, or `nil`. - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded and set in the request HTTP body. - @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. - @param error The error that occurred while constructing the request. - - @return An `NSMutableURLRequest` object - */ -- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method - URLString:(NSString *)URLString - parameters:(nullable NSDictionary *)parameters - constructingBodyWithBlock:(nullable void (^)(id formData))block - error:(NSError * _Nullable __autoreleasing *)error; - -/** - Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished. - - @param request The multipart form request. The `HTTPBodyStream` property of `request` must not be `nil`. - @param fileURL The file URL to write multipart form contents to. - @param handler A handler block to execute. - - @discussion There is a bug in `NSURLSessionTask` that causes requests to not send a `Content-Length` header when streaming contents from an HTTP body, which is notably problematic when interacting with the Amazon S3 webservice. As a workaround, this method takes a request constructed with `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:`, or any other request with an `HTTPBodyStream`, writes the contents to the specified file and returns a copy of the original request with the `HTTPBodyStream` property set to `nil`. From here, the file can either be passed to `AFURLSessionManager -uploadTaskWithRequest:fromFile:progress:completionHandler:`, or have its contents read into an `NSData` that's assigned to the `HTTPBody` property of the request. - - @see https://github.com/AFNetworking/AFNetworking/issues/1398 - */ -- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request - writingStreamContentsToFile:(NSURL *)fileURL - completionHandler:(nullable void (^)(NSError * _Nullable error))handler; - -@end - -#pragma mark - - -/** - The `AFMultipartFormData` protocol defines the methods supported by the parameter in the block argument of `AFHTTPRequestSerializer -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:`. - */ -@protocol AFMultipartFormData - -/** - Appends the HTTP header `Content-Disposition: file; filename=#{generated filename}; name=#{name}"` and `Content-Type: #{generated mimeType}`, followed by the encoded file data and the multipart form boundary. - - The filename and MIME type for this data in the form will be automatically generated, using the last path component of the `fileURL` and system associated MIME type for the `fileURL` extension, respectively. - - @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`. - @param name The name to be associated with the specified data. This parameter must not be `nil`. - @param error If an error occurs, upon return contains an `NSError` object that describes the problem. - - @return `YES` if the file data was successfully appended, otherwise `NO`. - */ -- (BOOL)appendPartWithFileURL:(NSURL *)fileURL - name:(NSString *)name - error:(NSError * _Nullable __autoreleasing *)error; - -/** - Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. - - @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`. - @param name The name to be associated with the specified data. This parameter must not be `nil`. - @param fileName The file name to be used in the `Content-Disposition` header. This parameter must not be `nil`. - @param mimeType The declared MIME type of the file data. This parameter must not be `nil`. - @param error If an error occurs, upon return contains an `NSError` object that describes the problem. - - @return `YES` if the file data was successfully appended otherwise `NO`. - */ -- (BOOL)appendPartWithFileURL:(NSURL *)fileURL - name:(NSString *)name - fileName:(NSString *)fileName - mimeType:(NSString *)mimeType - error:(NSError * _Nullable __autoreleasing *)error; - -/** - Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the data from the input stream and the multipart form boundary. - - @param inputStream The input stream to be appended to the form data - @param name The name to be associated with the specified input stream. This parameter must not be `nil`. - @param fileName The filename to be associated with the specified input stream. This parameter must not be `nil`. - @param length The length of the specified input stream in bytes. - @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. - */ -- (void)appendPartWithInputStream:(nullable NSInputStream *)inputStream - name:(NSString *)name - fileName:(NSString *)fileName - length:(int64_t)length - mimeType:(NSString *)mimeType; - -/** - Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. - - @param data The data to be encoded and appended to the form data. - @param name The name to be associated with the specified data. This parameter must not be `nil`. - @param fileName The filename to be associated with the specified data. This parameter must not be `nil`. - @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. - */ -- (void)appendPartWithFileData:(NSData *)data - name:(NSString *)name - fileName:(NSString *)fileName - mimeType:(NSString *)mimeType; - -/** - Appends the HTTP headers `Content-Disposition: form-data; name=#{name}"`, followed by the encoded data and the multipart form boundary. - - @param data The data to be encoded and appended to the form data. - @param name The name to be associated with the specified data. This parameter must not be `nil`. - */ - -- (void)appendPartWithFormData:(NSData *)data - name:(NSString *)name; - - -/** - Appends HTTP headers, followed by the encoded data and the multipart form boundary. - - @param headers The HTTP headers to be appended to the form data. - @param body The data to be encoded and appended to the form data. This parameter must not be `nil`. - */ -- (void)appendPartWithHeaders:(nullable NSDictionary *)headers - body:(NSData *)body; - -/** - Throttles request bandwidth by limiting the packet size and adding a delay for each chunk read from the upload stream. - - When uploading over a 3G or EDGE connection, requests may fail with "request body stream exhausted". Setting a maximum packet size and delay according to the recommended values (`kAFUploadStream3GSuggestedPacketSize` and `kAFUploadStream3GSuggestedDelay`) lowers the risk of the input stream exceeding its allocated bandwidth. Unfortunately, there is no definite way to distinguish between a 3G, EDGE, or LTE connection over `NSURLConnection`. As such, it is not recommended that you throttle bandwidth based solely on network reachability. Instead, you should consider checking for the "request body stream exhausted" in a failure block, and then retrying the request with throttled bandwidth. - - @param numberOfBytes Maximum packet size, in number of bytes. The default packet size for an input stream is 16kb. - @param delay Duration of delay each time a packet is read. By default, no delay is set. - */ -- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes - delay:(NSTimeInterval)delay; - -@end - -#pragma mark - - -/** - `AFJSONRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSJSONSerialization`, setting the `Content-Type` of the encoded request to `application/json`. - */ -@interface AFJSONRequestSerializer : AFHTTPRequestSerializer - -/** - Options for writing the request JSON data from Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONWritingOptions". `0` by default. - */ -@property (nonatomic, assign) NSJSONWritingOptions writingOptions; - -/** - Creates and returns a JSON serializer with specified reading and writing options. - - @param writingOptions The specified JSON writing options. - */ -+ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions; - -@end - -#pragma mark - - -/** - `AFPropertyListRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSPropertyListSerializer`, setting the `Content-Type` of the encoded request to `application/x-plist`. - */ -@interface AFPropertyListRequestSerializer : AFHTTPRequestSerializer - -/** - The property list format. Possible values are described in "NSPropertyListFormat". - */ -@property (nonatomic, assign) NSPropertyListFormat format; - -/** - @warning The `writeOptions` property is currently unused. - */ -@property (nonatomic, assign) NSPropertyListWriteOptions writeOptions; - -/** - Creates and returns a property list serializer with a specified format, read options, and write options. - - @param format The property list format. - @param writeOptions The property list write options. - - @warning The `writeOptions` property is currently unused. - */ -+ (instancetype)serializerWithFormat:(NSPropertyListFormat)format - writeOptions:(NSPropertyListWriteOptions)writeOptions; - -@end - -#pragma mark - - -///---------------- -/// @name Constants -///---------------- - -/** - ## Error Domains - - The following error domain is predefined. - - - `NSString * const AFURLRequestSerializationErrorDomain` - - ### Constants - - `AFURLRequestSerializationErrorDomain` - AFURLRequestSerializer errors. Error codes for `AFURLRequestSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. - */ -FOUNDATION_EXPORT NSString * const AFURLRequestSerializationErrorDomain; - -/** - ## User info dictionary keys - - These keys may exist in the user info dictionary, in addition to those defined for NSError. - - - `NSString * const AFNetworkingOperationFailingURLRequestErrorKey` - - ### Constants - - `AFNetworkingOperationFailingURLRequestErrorKey` - The corresponding value is an `NSURLRequest` containing the request of the operation associated with an error. This key is only present in the `AFURLRequestSerializationErrorDomain`. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLRequestErrorKey; - -/** - ## Throttling Bandwidth for HTTP Request Input Streams - - @see -throttleBandwidthWithPacketSize:delay: - - ### Constants - - `kAFUploadStream3GSuggestedPacketSize` - Maximum packet size, in number of bytes. Equal to 16kb. - - `kAFUploadStream3GSuggestedDelay` - Duration of delay each time a packet is read. Equal to 0.2 seconds. - */ -FOUNDATION_EXPORT NSUInteger const kAFUploadStream3GSuggestedPacketSize; -FOUNDATION_EXPORT NSTimeInterval const kAFUploadStream3GSuggestedDelay; - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m b/iOSProject/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m deleted file mode 100644 index 9a2ac980..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m +++ /dev/null @@ -1,1376 +0,0 @@ -// AFURLRequestSerialization.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "AFURLRequestSerialization.h" - -#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV -#import -#else -#import -#endif - -NSString * const AFURLRequestSerializationErrorDomain = @"com.alamofire.error.serialization.request"; -NSString * const AFNetworkingOperationFailingURLRequestErrorKey = @"com.alamofire.serialization.request.error.response"; - -typedef NSString * (^AFQueryStringSerializationBlock)(NSURLRequest *request, id parameters, NSError *__autoreleasing *error); - -/** - Returns a percent-escaped string following RFC 3986 for a query string key or value. - RFC 3986 states that the following characters are "reserved" characters. - - General Delimiters: ":", "#", "[", "]", "@", "?", "/" - - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" - - In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow - query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" - should be percent-escaped in the query string. - - parameter string: The string to be percent-escaped. - - returns: The percent-escaped string. - */ -NSString * AFPercentEscapedStringFromString(NSString *string) { - static NSString * const kAFCharactersGeneralDelimitersToEncode = @":#[]@"; // does not include "?" or "/" due to RFC 3986 - Section 3.4 - static NSString * const kAFCharactersSubDelimitersToEncode = @"!$&'()*+,;="; - - NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; - [allowedCharacterSet removeCharactersInString:[kAFCharactersGeneralDelimitersToEncode stringByAppendingString:kAFCharactersSubDelimitersToEncode]]; - - // FIXME: https://github.com/AFNetworking/AFNetworking/pull/3028 - // return [string stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; - - static NSUInteger const batchSize = 50; - - NSUInteger index = 0; - NSMutableString *escaped = @"".mutableCopy; - - while (index < string.length) { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wgnu" - NSUInteger length = MIN(string.length - index, batchSize); -#pragma GCC diagnostic pop - NSRange range = NSMakeRange(index, length); - - // To avoid breaking up character sequences such as 👴🏻👮🏽 - range = [string rangeOfComposedCharacterSequencesForRange:range]; - - NSString *substring = [string substringWithRange:range]; - NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; - [escaped appendString:encoded]; - - index += range.length; - } - - return escaped; -} - -#pragma mark - - -@interface AFQueryStringPair : NSObject -@property (readwrite, nonatomic, strong) id field; -@property (readwrite, nonatomic, strong) id value; - -- (instancetype)initWithField:(id)field value:(id)value; - -- (NSString *)URLEncodedStringValue; -@end - -@implementation AFQueryStringPair - -- (instancetype)initWithField:(id)field value:(id)value { - self = [super init]; - if (!self) { - return nil; - } - - self.field = field; - self.value = value; - - return self; -} - -- (NSString *)URLEncodedStringValue { - if (!self.value || [self.value isEqual:[NSNull null]]) { - return AFPercentEscapedStringFromString([self.field description]); - } else { - return [NSString stringWithFormat:@"%@=%@", AFPercentEscapedStringFromString([self.field description]), AFPercentEscapedStringFromString([self.value description])]; - } -} - -@end - -#pragma mark - - -FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary); -FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value); - -NSString * AFQueryStringFromParameters(NSDictionary *parameters) { - NSMutableArray *mutablePairs = [NSMutableArray array]; - for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) { - [mutablePairs addObject:[pair URLEncodedStringValue]]; - } - - return [mutablePairs componentsJoinedByString:@"&"]; -} - -NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary) { - return AFQueryStringPairsFromKeyAndValue(nil, dictionary); -} - -NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) { - NSMutableArray *mutableQueryStringComponents = [NSMutableArray array]; - - NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"description" ascending:YES selector:@selector(compare:)]; - - if ([value isKindOfClass:[NSDictionary class]]) { - NSDictionary *dictionary = value; - // Sort dictionary keys to ensure consistent ordering in query string, which is important when deserializing potentially ambiguous sequences, such as an array of dictionaries - for (id nestedKey in [dictionary.allKeys sortedArrayUsingDescriptors:@[ sortDescriptor ]]) { - id nestedValue = dictionary[nestedKey]; - if (nestedValue) { - [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue((key ? [NSString stringWithFormat:@"%@[%@]", key, nestedKey] : nestedKey), nestedValue)]; - } - } - } else if ([value isKindOfClass:[NSArray class]]) { - NSArray *array = value; - for (id nestedValue in array) { - [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)]; - } - } else if ([value isKindOfClass:[NSSet class]]) { - NSSet *set = value; - for (id obj in [set sortedArrayUsingDescriptors:@[ sortDescriptor ]]) { - [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue(key, obj)]; - } - } else { - [mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]]; - } - - return mutableQueryStringComponents; -} - -#pragma mark - - -@interface AFStreamingMultipartFormData : NSObject -- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest - stringEncoding:(NSStringEncoding)encoding; - -- (NSMutableURLRequest *)requestByFinalizingMultipartFormData; -@end - -#pragma mark - - -static NSArray * AFHTTPRequestSerializerObservedKeyPaths() { - static NSArray *_AFHTTPRequestSerializerObservedKeyPaths = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _AFHTTPRequestSerializerObservedKeyPaths = @[NSStringFromSelector(@selector(allowsCellularAccess)), NSStringFromSelector(@selector(cachePolicy)), NSStringFromSelector(@selector(HTTPShouldHandleCookies)), NSStringFromSelector(@selector(HTTPShouldUsePipelining)), NSStringFromSelector(@selector(networkServiceType)), NSStringFromSelector(@selector(timeoutInterval))]; - }); - - return _AFHTTPRequestSerializerObservedKeyPaths; -} - -static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerObserverContext; - -@interface AFHTTPRequestSerializer () -@property (readwrite, nonatomic, strong) NSMutableSet *mutableObservedChangedKeyPaths; -@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders; -@property (readwrite, nonatomic, assign) AFHTTPRequestQueryStringSerializationStyle queryStringSerializationStyle; -@property (readwrite, nonatomic, copy) AFQueryStringSerializationBlock queryStringSerialization; -@end - -@implementation AFHTTPRequestSerializer - -+ (instancetype)serializer { - return [[self alloc] init]; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.stringEncoding = NSUTF8StringEncoding; - - self.mutableHTTPRequestHeaders = [NSMutableDictionary dictionary]; - - // Accept-Language HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 - NSMutableArray *acceptLanguagesComponents = [NSMutableArray array]; - [[NSLocale preferredLanguages] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - float q = 1.0f - (idx * 0.1f); - [acceptLanguagesComponents addObject:[NSString stringWithFormat:@"%@;q=%0.1g", obj, q]]; - *stop = q <= 0.5f; - }]; - [self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"]; - - NSString *userAgent = nil; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" -#if TARGET_OS_IOS - // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 - userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]]; -#elif TARGET_OS_WATCH - // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 - userAgent = [NSString stringWithFormat:@"%@/%@ (%@; watchOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[WKInterfaceDevice currentDevice] model], [[WKInterfaceDevice currentDevice] systemVersion], [[WKInterfaceDevice currentDevice] screenScale]]; -#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) - userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]]; -#endif -#pragma clang diagnostic pop - if (userAgent) { - if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) { - NSMutableString *mutableUserAgent = [userAgent mutableCopy]; - if (CFStringTransform((__bridge CFMutableStringRef)(mutableUserAgent), NULL, (__bridge CFStringRef)@"Any-Latin; Latin-ASCII; [:^ASCII:] Remove", false)) { - userAgent = mutableUserAgent; - } - } - [self setValue:userAgent forHTTPHeaderField:@"User-Agent"]; - } - - // HTTP Method Definitions; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - self.HTTPMethodsEncodingParametersInURI = [NSSet setWithObjects:@"GET", @"HEAD", @"DELETE", nil]; - - self.mutableObservedChangedKeyPaths = [NSMutableSet set]; - for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { - if ([self respondsToSelector:NSSelectorFromString(keyPath)]) { - [self addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:AFHTTPRequestSerializerObserverContext]; - } - } - - return self; -} - -- (void)dealloc { - for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { - if ([self respondsToSelector:NSSelectorFromString(keyPath)]) { - [self removeObserver:self forKeyPath:keyPath context:AFHTTPRequestSerializerObserverContext]; - } - } -} - -#pragma mark - - -// Workarounds for crashing behavior using Key-Value Observing with XCTest -// See https://github.com/AFNetworking/AFNetworking/issues/2523 - -- (void)setAllowsCellularAccess:(BOOL)allowsCellularAccess { - [self willChangeValueForKey:NSStringFromSelector(@selector(allowsCellularAccess))]; - _allowsCellularAccess = allowsCellularAccess; - [self didChangeValueForKey:NSStringFromSelector(@selector(allowsCellularAccess))]; -} - -- (void)setCachePolicy:(NSURLRequestCachePolicy)cachePolicy { - [self willChangeValueForKey:NSStringFromSelector(@selector(cachePolicy))]; - _cachePolicy = cachePolicy; - [self didChangeValueForKey:NSStringFromSelector(@selector(cachePolicy))]; -} - -- (void)setHTTPShouldHandleCookies:(BOOL)HTTPShouldHandleCookies { - [self willChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldHandleCookies))]; - _HTTPShouldHandleCookies = HTTPShouldHandleCookies; - [self didChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldHandleCookies))]; -} - -- (void)setHTTPShouldUsePipelining:(BOOL)HTTPShouldUsePipelining { - [self willChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldUsePipelining))]; - _HTTPShouldUsePipelining = HTTPShouldUsePipelining; - [self didChangeValueForKey:NSStringFromSelector(@selector(HTTPShouldUsePipelining))]; -} - -- (void)setNetworkServiceType:(NSURLRequestNetworkServiceType)networkServiceType { - [self willChangeValueForKey:NSStringFromSelector(@selector(networkServiceType))]; - _networkServiceType = networkServiceType; - [self didChangeValueForKey:NSStringFromSelector(@selector(networkServiceType))]; -} - -- (void)setTimeoutInterval:(NSTimeInterval)timeoutInterval { - [self willChangeValueForKey:NSStringFromSelector(@selector(timeoutInterval))]; - _timeoutInterval = timeoutInterval; - [self didChangeValueForKey:NSStringFromSelector(@selector(timeoutInterval))]; -} - -#pragma mark - - -- (NSDictionary *)HTTPRequestHeaders { - return [NSDictionary dictionaryWithDictionary:self.mutableHTTPRequestHeaders]; -} - -- (void)setValue:(NSString *)value -forHTTPHeaderField:(NSString *)field -{ - [self.mutableHTTPRequestHeaders setValue:value forKey:field]; -} - -- (NSString *)valueForHTTPHeaderField:(NSString *)field { - return [self.mutableHTTPRequestHeaders valueForKey:field]; -} - -- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username - password:(NSString *)password -{ - NSData *basicAuthCredentials = [[NSString stringWithFormat:@"%@:%@", username, password] dataUsingEncoding:NSUTF8StringEncoding]; - NSString *base64AuthCredentials = [basicAuthCredentials base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]; - [self setValue:[NSString stringWithFormat:@"Basic %@", base64AuthCredentials] forHTTPHeaderField:@"Authorization"]; -} - -- (void)clearAuthorizationHeader { - [self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"]; -} - -#pragma mark - - -- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style { - self.queryStringSerializationStyle = style; - self.queryStringSerialization = nil; -} - -- (void)setQueryStringSerializationWithBlock:(NSString *(^)(NSURLRequest *, id, NSError *__autoreleasing *))block { - self.queryStringSerialization = block; -} - -#pragma mark - - -- (NSMutableURLRequest *)requestWithMethod:(NSString *)method - URLString:(NSString *)URLString - parameters:(id)parameters - error:(NSError *__autoreleasing *)error -{ - NSParameterAssert(method); - NSParameterAssert(URLString); - - NSURL *url = [NSURL URLWithString:URLString]; - - NSParameterAssert(url); - - NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:url]; - mutableRequest.HTTPMethod = method; - - for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { - if ([self.mutableObservedChangedKeyPaths containsObject:keyPath]) { - [mutableRequest setValue:[self valueForKeyPath:keyPath] forKey:keyPath]; - } - } - - mutableRequest = [[self requestBySerializingRequest:mutableRequest withParameters:parameters error:error] mutableCopy]; - - return mutableRequest; -} - -- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method - URLString:(NSString *)URLString - parameters:(NSDictionary *)parameters - constructingBodyWithBlock:(void (^)(id formData))block - error:(NSError *__autoreleasing *)error -{ - NSParameterAssert(method); - NSParameterAssert(![method isEqualToString:@"GET"] && ![method isEqualToString:@"HEAD"]); - - NSMutableURLRequest *mutableRequest = [self requestWithMethod:method URLString:URLString parameters:nil error:error]; - - __block AFStreamingMultipartFormData *formData = [[AFStreamingMultipartFormData alloc] initWithURLRequest:mutableRequest stringEncoding:NSUTF8StringEncoding]; - - if (parameters) { - for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) { - NSData *data = nil; - if ([pair.value isKindOfClass:[NSData class]]) { - data = pair.value; - } else if ([pair.value isEqual:[NSNull null]]) { - data = [NSData data]; - } else { - data = [[pair.value description] dataUsingEncoding:self.stringEncoding]; - } - - if (data) { - [formData appendPartWithFormData:data name:[pair.field description]]; - } - } - } - - if (block) { - block(formData); - } - - return [formData requestByFinalizingMultipartFormData]; -} - -- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request - writingStreamContentsToFile:(NSURL *)fileURL - completionHandler:(void (^)(NSError *error))handler -{ - NSParameterAssert(request.HTTPBodyStream); - NSParameterAssert([fileURL isFileURL]); - - NSInputStream *inputStream = request.HTTPBodyStream; - NSOutputStream *outputStream = [[NSOutputStream alloc] initWithURL:fileURL append:NO]; - __block NSError *error = nil; - - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - - [inputStream open]; - [outputStream open]; - - while ([inputStream hasBytesAvailable] && [outputStream hasSpaceAvailable]) { - uint8_t buffer[1024]; - - NSInteger bytesRead = [inputStream read:buffer maxLength:1024]; - if (inputStream.streamError || bytesRead < 0) { - error = inputStream.streamError; - break; - } - - NSInteger bytesWritten = [outputStream write:buffer maxLength:(NSUInteger)bytesRead]; - if (outputStream.streamError || bytesWritten < 0) { - error = outputStream.streamError; - break; - } - - if (bytesRead == 0 && bytesWritten == 0) { - break; - } - } - - [outputStream close]; - [inputStream close]; - - if (handler) { - dispatch_async(dispatch_get_main_queue(), ^{ - handler(error); - }); - } - }); - - NSMutableURLRequest *mutableRequest = [request mutableCopy]; - mutableRequest.HTTPBodyStream = nil; - - return mutableRequest; -} - -#pragma mark - AFURLRequestSerialization - -- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request - withParameters:(id)parameters - error:(NSError *__autoreleasing *)error -{ - NSParameterAssert(request); - - NSMutableURLRequest *mutableRequest = [request mutableCopy]; - - [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { - if (![request valueForHTTPHeaderField:field]) { - [mutableRequest setValue:value forHTTPHeaderField:field]; - } - }]; - - NSString *query = nil; - if (parameters) { - if (self.queryStringSerialization) { - NSError *serializationError; - query = self.queryStringSerialization(request, parameters, &serializationError); - - if (serializationError) { - if (error) { - *error = serializationError; - } - - return nil; - } - } else { - switch (self.queryStringSerializationStyle) { - case AFHTTPRequestQueryStringDefaultStyle: - query = AFQueryStringFromParameters(parameters); - break; - } - } - } - - if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { - if (query && query.length > 0) { - mutableRequest.URL = [NSURL URLWithString:[[mutableRequest.URL absoluteString] stringByAppendingFormat:mutableRequest.URL.query ? @"&%@" : @"?%@", query]]; - } - } else { - // #2864: an empty string is a valid x-www-form-urlencoded payload - if (!query) { - query = @""; - } - if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { - [mutableRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; - } - [mutableRequest setHTTPBody:[query dataUsingEncoding:self.stringEncoding]]; - } - - return mutableRequest; -} - -#pragma mark - NSKeyValueObserving - -+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key { - if ([AFHTTPRequestSerializerObservedKeyPaths() containsObject:key]) { - return NO; - } - - return [super automaticallyNotifiesObserversForKey:key]; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(__unused id)object - change:(NSDictionary *)change - context:(void *)context -{ - if (context == AFHTTPRequestSerializerObserverContext) { - if ([change[NSKeyValueChangeNewKey] isEqual:[NSNull null]]) { - [self.mutableObservedChangedKeyPaths removeObject:keyPath]; - } else { - [self.mutableObservedChangedKeyPaths addObject:keyPath]; - } - } -} - -#pragma mark - NSSecureCoding - -+ (BOOL)supportsSecureCoding { - return YES; -} - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [self init]; - if (!self) { - return nil; - } - - self.mutableHTTPRequestHeaders = [[decoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))] mutableCopy]; - self.queryStringSerializationStyle = (AFHTTPRequestQueryStringSerializationStyle)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))]; - [coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFHTTPRequestSerializer *serializer = [[[self class] allocWithZone:zone] init]; - serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone]; - serializer.queryStringSerializationStyle = self.queryStringSerializationStyle; - serializer.queryStringSerialization = self.queryStringSerialization; - - return serializer; -} - -@end - -#pragma mark - - -static NSString * AFCreateMultipartFormBoundary() { - return [NSString stringWithFormat:@"Boundary+%08X%08X", arc4random(), arc4random()]; -} - -static NSString * const kAFMultipartFormCRLF = @"\r\n"; - -static inline NSString * AFMultipartFormInitialBoundary(NSString *boundary) { - return [NSString stringWithFormat:@"--%@%@", boundary, kAFMultipartFormCRLF]; -} - -static inline NSString * AFMultipartFormEncapsulationBoundary(NSString *boundary) { - return [NSString stringWithFormat:@"%@--%@%@", kAFMultipartFormCRLF, boundary, kAFMultipartFormCRLF]; -} - -static inline NSString * AFMultipartFormFinalBoundary(NSString *boundary) { - return [NSString stringWithFormat:@"%@--%@--%@", kAFMultipartFormCRLF, boundary, kAFMultipartFormCRLF]; -} - -static inline NSString * AFContentTypeForPathExtension(NSString *extension) { - NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, NULL); - NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType); - if (!contentType) { - return @"application/octet-stream"; - } else { - return contentType; - } -} - -NSUInteger const kAFUploadStream3GSuggestedPacketSize = 1024 * 16; -NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; - -@interface AFHTTPBodyPart : NSObject -@property (nonatomic, assign) NSStringEncoding stringEncoding; -@property (nonatomic, strong) NSDictionary *headers; -@property (nonatomic, copy) NSString *boundary; -@property (nonatomic, strong) id body; -@property (nonatomic, assign) unsigned long long bodyContentLength; -@property (nonatomic, strong) NSInputStream *inputStream; - -@property (nonatomic, assign) BOOL hasInitialBoundary; -@property (nonatomic, assign) BOOL hasFinalBoundary; - -@property (readonly, nonatomic, assign, getter = hasBytesAvailable) BOOL bytesAvailable; -@property (readonly, nonatomic, assign) unsigned long long contentLength; - -- (NSInteger)read:(uint8_t *)buffer - maxLength:(NSUInteger)length; -@end - -@interface AFMultipartBodyStream : NSInputStream -@property (nonatomic, assign) NSUInteger numberOfBytesInPacket; -@property (nonatomic, assign) NSTimeInterval delay; -@property (nonatomic, strong) NSInputStream *inputStream; -@property (readonly, nonatomic, assign) unsigned long long contentLength; -@property (readonly, nonatomic, assign, getter = isEmpty) BOOL empty; - -- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding; -- (void)setInitialAndFinalBoundaries; -- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart; -@end - -#pragma mark - - -@interface AFStreamingMultipartFormData () -@property (readwrite, nonatomic, copy) NSMutableURLRequest *request; -@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding; -@property (readwrite, nonatomic, copy) NSString *boundary; -@property (readwrite, nonatomic, strong) AFMultipartBodyStream *bodyStream; -@end - -@implementation AFStreamingMultipartFormData - -- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest - stringEncoding:(NSStringEncoding)encoding -{ - self = [super init]; - if (!self) { - return nil; - } - - self.request = urlRequest; - self.stringEncoding = encoding; - self.boundary = AFCreateMultipartFormBoundary(); - self.bodyStream = [[AFMultipartBodyStream alloc] initWithStringEncoding:encoding]; - - return self; -} - -- (BOOL)appendPartWithFileURL:(NSURL *)fileURL - name:(NSString *)name - error:(NSError * __autoreleasing *)error -{ - NSParameterAssert(fileURL); - NSParameterAssert(name); - - NSString *fileName = [fileURL lastPathComponent]; - NSString *mimeType = AFContentTypeForPathExtension([fileURL pathExtension]); - - return [self appendPartWithFileURL:fileURL name:name fileName:fileName mimeType:mimeType error:error]; -} - -- (BOOL)appendPartWithFileURL:(NSURL *)fileURL - name:(NSString *)name - fileName:(NSString *)fileName - mimeType:(NSString *)mimeType - error:(NSError * __autoreleasing *)error -{ - NSParameterAssert(fileURL); - NSParameterAssert(name); - NSParameterAssert(fileName); - NSParameterAssert(mimeType); - - if (![fileURL isFileURL]) { - NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"Expected URL to be a file URL", @"AFNetworking", nil)}; - if (error) { - *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorBadURL userInfo:userInfo]; - } - - return NO; - } else if ([fileURL checkResourceIsReachableAndReturnError:error] == NO) { - NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"File URL not reachable.", @"AFNetworking", nil)}; - if (error) { - *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorBadURL userInfo:userInfo]; - } - - return NO; - } - - NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[fileURL path] error:error]; - if (!fileAttributes) { - return NO; - } - - NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; - [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; - [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; - - AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; - bodyPart.stringEncoding = self.stringEncoding; - bodyPart.headers = mutableHeaders; - bodyPart.boundary = self.boundary; - bodyPart.body = fileURL; - bodyPart.bodyContentLength = [fileAttributes[NSFileSize] unsignedLongLongValue]; - [self.bodyStream appendHTTPBodyPart:bodyPart]; - - return YES; -} - -- (void)appendPartWithInputStream:(NSInputStream *)inputStream - name:(NSString *)name - fileName:(NSString *)fileName - length:(int64_t)length - mimeType:(NSString *)mimeType -{ - NSParameterAssert(name); - NSParameterAssert(fileName); - NSParameterAssert(mimeType); - - NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; - [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; - [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; - - AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; - bodyPart.stringEncoding = self.stringEncoding; - bodyPart.headers = mutableHeaders; - bodyPart.boundary = self.boundary; - bodyPart.body = inputStream; - - bodyPart.bodyContentLength = (unsigned long long)length; - - [self.bodyStream appendHTTPBodyPart:bodyPart]; -} - -- (void)appendPartWithFileData:(NSData *)data - name:(NSString *)name - fileName:(NSString *)fileName - mimeType:(NSString *)mimeType -{ - NSParameterAssert(name); - NSParameterAssert(fileName); - NSParameterAssert(mimeType); - - NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; - [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; - [mutableHeaders setValue:mimeType forKey:@"Content-Type"]; - - [self appendPartWithHeaders:mutableHeaders body:data]; -} - -- (void)appendPartWithFormData:(NSData *)data - name:(NSString *)name -{ - NSParameterAssert(name); - - NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary]; - [mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"", name] forKey:@"Content-Disposition"]; - - [self appendPartWithHeaders:mutableHeaders body:data]; -} - -- (void)appendPartWithHeaders:(NSDictionary *)headers - body:(NSData *)body -{ - NSParameterAssert(body); - - AFHTTPBodyPart *bodyPart = [[AFHTTPBodyPart alloc] init]; - bodyPart.stringEncoding = self.stringEncoding; - bodyPart.headers = headers; - bodyPart.boundary = self.boundary; - bodyPart.bodyContentLength = [body length]; - bodyPart.body = body; - - [self.bodyStream appendHTTPBodyPart:bodyPart]; -} - -- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes - delay:(NSTimeInterval)delay -{ - self.bodyStream.numberOfBytesInPacket = numberOfBytes; - self.bodyStream.delay = delay; -} - -- (NSMutableURLRequest *)requestByFinalizingMultipartFormData { - if ([self.bodyStream isEmpty]) { - return self.request; - } - - // Reset the initial and final boundaries to ensure correct Content-Length - [self.bodyStream setInitialAndFinalBoundaries]; - [self.request setHTTPBodyStream:self.bodyStream]; - - [self.request setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", self.boundary] forHTTPHeaderField:@"Content-Type"]; - [self.request setValue:[NSString stringWithFormat:@"%llu", [self.bodyStream contentLength]] forHTTPHeaderField:@"Content-Length"]; - - return self.request; -} - -@end - -#pragma mark - - -@interface NSStream () -@property (readwrite) NSStreamStatus streamStatus; -@property (readwrite, copy) NSError *streamError; -@end - -@interface AFMultipartBodyStream () -@property (readwrite, nonatomic, assign) NSStringEncoding stringEncoding; -@property (readwrite, nonatomic, strong) NSMutableArray *HTTPBodyParts; -@property (readwrite, nonatomic, strong) NSEnumerator *HTTPBodyPartEnumerator; -@property (readwrite, nonatomic, strong) AFHTTPBodyPart *currentHTTPBodyPart; -@property (readwrite, nonatomic, strong) NSOutputStream *outputStream; -@property (readwrite, nonatomic, strong) NSMutableData *buffer; -@end - -@implementation AFMultipartBodyStream -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wimplicit-atomic-properties" -#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1100) -@synthesize delegate; -#endif -@synthesize streamStatus; -@synthesize streamError; -#pragma clang diagnostic pop - -- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding { - self = [super init]; - if (!self) { - return nil; - } - - self.stringEncoding = encoding; - self.HTTPBodyParts = [NSMutableArray array]; - self.numberOfBytesInPacket = NSIntegerMax; - - return self; -} - -- (void)setInitialAndFinalBoundaries { - if ([self.HTTPBodyParts count] > 0) { - for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { - bodyPart.hasInitialBoundary = NO; - bodyPart.hasFinalBoundary = NO; - } - - [[self.HTTPBodyParts firstObject] setHasInitialBoundary:YES]; - [[self.HTTPBodyParts lastObject] setHasFinalBoundary:YES]; - } -} - -- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart { - [self.HTTPBodyParts addObject:bodyPart]; -} - -- (BOOL)isEmpty { - return [self.HTTPBodyParts count] == 0; -} - -#pragma mark - NSInputStream - -- (NSInteger)read:(uint8_t *)buffer - maxLength:(NSUInteger)length -{ - if ([self streamStatus] == NSStreamStatusClosed) { - return 0; - } - - NSInteger totalNumberOfBytesRead = 0; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - while ((NSUInteger)totalNumberOfBytesRead < MIN(length, self.numberOfBytesInPacket)) { - if (!self.currentHTTPBodyPart || ![self.currentHTTPBodyPart hasBytesAvailable]) { - if (!(self.currentHTTPBodyPart = [self.HTTPBodyPartEnumerator nextObject])) { - break; - } - } else { - NSUInteger maxLength = MIN(length, self.numberOfBytesInPacket) - (NSUInteger)totalNumberOfBytesRead; - NSInteger numberOfBytesRead = [self.currentHTTPBodyPart read:&buffer[totalNumberOfBytesRead] maxLength:maxLength]; - if (numberOfBytesRead == -1) { - self.streamError = self.currentHTTPBodyPart.inputStream.streamError; - break; - } else { - totalNumberOfBytesRead += numberOfBytesRead; - - if (self.delay > 0.0f) { - [NSThread sleepForTimeInterval:self.delay]; - } - } - } - } -#pragma clang diagnostic pop - - return totalNumberOfBytesRead; -} - -- (BOOL)getBuffer:(__unused uint8_t **)buffer - length:(__unused NSUInteger *)len -{ - return NO; -} - -- (BOOL)hasBytesAvailable { - return [self streamStatus] == NSStreamStatusOpen; -} - -#pragma mark - NSStream - -- (void)open { - if (self.streamStatus == NSStreamStatusOpen) { - return; - } - - self.streamStatus = NSStreamStatusOpen; - - [self setInitialAndFinalBoundaries]; - self.HTTPBodyPartEnumerator = [self.HTTPBodyParts objectEnumerator]; -} - -- (void)close { - self.streamStatus = NSStreamStatusClosed; -} - -- (id)propertyForKey:(__unused NSString *)key { - return nil; -} - -- (BOOL)setProperty:(__unused id)property - forKey:(__unused NSString *)key -{ - return NO; -} - -- (void)scheduleInRunLoop:(__unused NSRunLoop *)aRunLoop - forMode:(__unused NSString *)mode -{} - -- (void)removeFromRunLoop:(__unused NSRunLoop *)aRunLoop - forMode:(__unused NSString *)mode -{} - -- (unsigned long long)contentLength { - unsigned long long length = 0; - for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { - length += [bodyPart contentLength]; - } - - return length; -} - -#pragma mark - Undocumented CFReadStream Bridged Methods - -- (void)_scheduleInCFRunLoop:(__unused CFRunLoopRef)aRunLoop - forMode:(__unused CFStringRef)aMode -{} - -- (void)_unscheduleFromCFRunLoop:(__unused CFRunLoopRef)aRunLoop - forMode:(__unused CFStringRef)aMode -{} - -- (BOOL)_setCFClientFlags:(__unused CFOptionFlags)inFlags - callback:(__unused CFReadStreamClientCallBack)inCallback - context:(__unused CFStreamClientContext *)inContext { - return NO; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFMultipartBodyStream *bodyStreamCopy = [[[self class] allocWithZone:zone] initWithStringEncoding:self.stringEncoding]; - - for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { - [bodyStreamCopy appendHTTPBodyPart:[bodyPart copy]]; - } - - [bodyStreamCopy setInitialAndFinalBoundaries]; - - return bodyStreamCopy; -} - -@end - -#pragma mark - - -typedef enum { - AFEncapsulationBoundaryPhase = 1, - AFHeaderPhase = 2, - AFBodyPhase = 3, - AFFinalBoundaryPhase = 4, -} AFHTTPBodyPartReadPhase; - -@interface AFHTTPBodyPart () { - AFHTTPBodyPartReadPhase _phase; - NSInputStream *_inputStream; - unsigned long long _phaseReadOffset; -} - -- (BOOL)transitionToNextPhase; -- (NSInteger)readData:(NSData *)data - intoBuffer:(uint8_t *)buffer - maxLength:(NSUInteger)length; -@end - -@implementation AFHTTPBodyPart - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - [self transitionToNextPhase]; - - return self; -} - -- (void)dealloc { - if (_inputStream) { - [_inputStream close]; - _inputStream = nil; - } -} - -- (NSInputStream *)inputStream { - if (!_inputStream) { - if ([self.body isKindOfClass:[NSData class]]) { - _inputStream = [NSInputStream inputStreamWithData:self.body]; - } else if ([self.body isKindOfClass:[NSURL class]]) { - _inputStream = [NSInputStream inputStreamWithURL:self.body]; - } else if ([self.body isKindOfClass:[NSInputStream class]]) { - _inputStream = self.body; - } else { - _inputStream = [NSInputStream inputStreamWithData:[NSData data]]; - } - } - - return _inputStream; -} - -- (NSString *)stringForHeaders { - NSMutableString *headerString = [NSMutableString string]; - for (NSString *field in [self.headers allKeys]) { - [headerString appendString:[NSString stringWithFormat:@"%@: %@%@", field, [self.headers valueForKey:field], kAFMultipartFormCRLF]]; - } - [headerString appendString:kAFMultipartFormCRLF]; - - return [NSString stringWithString:headerString]; -} - -- (unsigned long long)contentLength { - unsigned long long length = 0; - - NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary(self.boundary) : AFMultipartFormEncapsulationBoundary(self.boundary)) dataUsingEncoding:self.stringEncoding]; - length += [encapsulationBoundaryData length]; - - NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding]; - length += [headersData length]; - - length += _bodyContentLength; - - NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary(self.boundary) dataUsingEncoding:self.stringEncoding] : [NSData data]); - length += [closingBoundaryData length]; - - return length; -} - -- (BOOL)hasBytesAvailable { - // Allows `read:maxLength:` to be called again if `AFMultipartFormFinalBoundary` doesn't fit into the available buffer - if (_phase == AFFinalBoundaryPhase) { - return YES; - } - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wcovered-switch-default" - switch (self.inputStream.streamStatus) { - case NSStreamStatusNotOpen: - case NSStreamStatusOpening: - case NSStreamStatusOpen: - case NSStreamStatusReading: - case NSStreamStatusWriting: - return YES; - case NSStreamStatusAtEnd: - case NSStreamStatusClosed: - case NSStreamStatusError: - default: - return NO; - } -#pragma clang diagnostic pop -} - -- (NSInteger)read:(uint8_t *)buffer - maxLength:(NSUInteger)length -{ - NSInteger totalNumberOfBytesRead = 0; - - if (_phase == AFEncapsulationBoundaryPhase) { - NSData *encapsulationBoundaryData = [([self hasInitialBoundary] ? AFMultipartFormInitialBoundary(self.boundary) : AFMultipartFormEncapsulationBoundary(self.boundary)) dataUsingEncoding:self.stringEncoding]; - totalNumberOfBytesRead += [self readData:encapsulationBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; - } - - if (_phase == AFHeaderPhase) { - NSData *headersData = [[self stringForHeaders] dataUsingEncoding:self.stringEncoding]; - totalNumberOfBytesRead += [self readData:headersData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; - } - - if (_phase == AFBodyPhase) { - NSInteger numberOfBytesRead = 0; - - numberOfBytesRead = [self.inputStream read:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; - if (numberOfBytesRead == -1) { - return -1; - } else { - totalNumberOfBytesRead += numberOfBytesRead; - - if ([self.inputStream streamStatus] >= NSStreamStatusAtEnd) { - [self transitionToNextPhase]; - } - } - } - - if (_phase == AFFinalBoundaryPhase) { - NSData *closingBoundaryData = ([self hasFinalBoundary] ? [AFMultipartFormFinalBoundary(self.boundary) dataUsingEncoding:self.stringEncoding] : [NSData data]); - totalNumberOfBytesRead += [self readData:closingBoundaryData intoBuffer:&buffer[totalNumberOfBytesRead] maxLength:(length - (NSUInteger)totalNumberOfBytesRead)]; - } - - return totalNumberOfBytesRead; -} - -- (NSInteger)readData:(NSData *)data - intoBuffer:(uint8_t *)buffer - maxLength:(NSUInteger)length -{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length)); - [data getBytes:buffer range:range]; -#pragma clang diagnostic pop - - _phaseReadOffset += range.length; - - if (((NSUInteger)_phaseReadOffset) >= [data length]) { - [self transitionToNextPhase]; - } - - return (NSInteger)range.length; -} - -- (BOOL)transitionToNextPhase { - if (![[NSThread currentThread] isMainThread]) { - dispatch_sync(dispatch_get_main_queue(), ^{ - [self transitionToNextPhase]; - }); - return YES; - } - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wcovered-switch-default" - switch (_phase) { - case AFEncapsulationBoundaryPhase: - _phase = AFHeaderPhase; - break; - case AFHeaderPhase: - [self.inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; - [self.inputStream open]; - _phase = AFBodyPhase; - break; - case AFBodyPhase: - [self.inputStream close]; - _phase = AFFinalBoundaryPhase; - break; - case AFFinalBoundaryPhase: - default: - _phase = AFEncapsulationBoundaryPhase; - break; - } - _phaseReadOffset = 0; -#pragma clang diagnostic pop - - return YES; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init]; - - bodyPart.stringEncoding = self.stringEncoding; - bodyPart.headers = self.headers; - bodyPart.bodyContentLength = self.bodyContentLength; - bodyPart.body = self.body; - bodyPart.boundary = self.boundary; - - return bodyPart; -} - -@end - -#pragma mark - - -@implementation AFJSONRequestSerializer - -+ (instancetype)serializer { - return [self serializerWithWritingOptions:(NSJSONWritingOptions)0]; -} - -+ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions -{ - AFJSONRequestSerializer *serializer = [[self alloc] init]; - serializer.writingOptions = writingOptions; - - return serializer; -} - -#pragma mark - AFURLRequestSerialization - -- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request - withParameters:(id)parameters - error:(NSError *__autoreleasing *)error -{ - NSParameterAssert(request); - - if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { - return [super requestBySerializingRequest:request withParameters:parameters error:error]; - } - - NSMutableURLRequest *mutableRequest = [request mutableCopy]; - - [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { - if (![request valueForHTTPHeaderField:field]) { - [mutableRequest setValue:value forHTTPHeaderField:field]; - } - }]; - - if (parameters) { - if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { - [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; - } - - [mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]]; - } - - return mutableRequest; -} - -#pragma mark - NSSecureCoding - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [super initWithCoder:decoder]; - if (!self) { - return nil; - } - - self.writingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writingOptions))] unsignedIntegerValue]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; - - [coder encodeInteger:self.writingOptions forKey:NSStringFromSelector(@selector(writingOptions))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFJSONRequestSerializer *serializer = [super copyWithZone:zone]; - serializer.writingOptions = self.writingOptions; - - return serializer; -} - -@end - -#pragma mark - - -@implementation AFPropertyListRequestSerializer - -+ (instancetype)serializer { - return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 writeOptions:0]; -} - -+ (instancetype)serializerWithFormat:(NSPropertyListFormat)format - writeOptions:(NSPropertyListWriteOptions)writeOptions -{ - AFPropertyListRequestSerializer *serializer = [[self alloc] init]; - serializer.format = format; - serializer.writeOptions = writeOptions; - - return serializer; -} - -#pragma mark - AFURLRequestSerializer - -- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request - withParameters:(id)parameters - error:(NSError *__autoreleasing *)error -{ - NSParameterAssert(request); - - if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) { - return [super requestBySerializingRequest:request withParameters:parameters error:error]; - } - - NSMutableURLRequest *mutableRequest = [request mutableCopy]; - - [self.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { - if (![request valueForHTTPHeaderField:field]) { - [mutableRequest setValue:value forHTTPHeaderField:field]; - } - }]; - - if (parameters) { - if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { - [mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"]; - } - - [mutableRequest setHTTPBody:[NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error]]; - } - - return mutableRequest; -} - -#pragma mark - NSSecureCoding - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [super initWithCoder:decoder]; - if (!self) { - return nil; - } - - self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue]; - self.writeOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writeOptions))] unsignedIntegerValue]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; - - [coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))]; - [coder encodeObject:@(self.writeOptions) forKey:NSStringFromSelector(@selector(writeOptions))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFPropertyListRequestSerializer *serializer = [super copyWithZone:zone]; - serializer.format = self.format; - serializer.writeOptions = self.writeOptions; - - return serializer; -} - -@end diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h b/iOSProject/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h deleted file mode 100644 index a9430add..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h +++ /dev/null @@ -1,311 +0,0 @@ -// AFURLResponseSerialization.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data. - - For example, a JSON response serializer may check for an acceptable status code (`2XX` range) and content type (`application/json`), decoding a valid JSON response into an object. - */ -@protocol AFURLResponseSerialization - -/** - The response object decoded from the data associated with a specified response. - - @param response The response to be processed. - @param data The response data to be decoded. - @param error The error that occurred while attempting to decode the response data. - - @return The object decoded from the specified response data. - */ -- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response - data:(nullable NSData *)data - error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; - -@end - -#pragma mark - - -/** - `AFHTTPResponseSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation. - - Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPResponseSerializer` in order to ensure consistent default behavior. - */ -@interface AFHTTPResponseSerializer : NSObject - -- (instancetype)init; - -/** - The string encoding used to serialize data received from the server, when no string encoding is specified by the response. `NSUTF8StringEncoding` by default. - */ -@property (nonatomic, assign) NSStringEncoding stringEncoding; - -/** - Creates and returns a serializer with default configuration. - */ -+ (instancetype)serializer; - -///----------------------------------------- -/// @name Configuring Response Serialization -///----------------------------------------- - -/** - The acceptable HTTP status codes for responses. When non-`nil`, responses with status codes not contained by the set will result in an error during validation. - - See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html - */ -@property (nonatomic, copy, nullable) NSIndexSet *acceptableStatusCodes; - -/** - The acceptable MIME types for responses. When non-`nil`, responses with a `Content-Type` with MIME types that do not intersect with the set will result in an error during validation. - */ -@property (nonatomic, copy, nullable) NSSet *acceptableContentTypes; - -/** - Validates the specified response and data. - - In its base implementation, this method checks for an acceptable status code and content type. Subclasses may wish to add other domain-specific checks. - - @param response The response to be validated. - @param data The data associated with the response. - @param error The error that occurred while attempting to validate the response. - - @return `YES` if the response is valid, otherwise `NO`. - */ -- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response - data:(nullable NSData *)data - error:(NSError * _Nullable __autoreleasing *)error; - -@end - -#pragma mark - - - -/** - `AFJSONResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes JSON responses. - - By default, `AFJSONResponseSerializer` accepts the following MIME types, which includes the official standard, `application/json`, as well as other commonly-used types: - - - `application/json` - - `text/json` - - `text/javascript` - */ -@interface AFJSONResponseSerializer : AFHTTPResponseSerializer - -- (instancetype)init; - -/** - Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. - */ -@property (nonatomic, assign) NSJSONReadingOptions readingOptions; - -/** - Whether to remove keys with `NSNull` values from response JSON. Defaults to `NO`. - */ -@property (nonatomic, assign) BOOL removesKeysWithNullValues; - -/** - Creates and returns a JSON serializer with specified reading and writing options. - - @param readingOptions The specified JSON reading options. - */ -+ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions; - -@end - -#pragma mark - - -/** - `AFXMLParserResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLParser` objects. - - By default, `AFXMLParserResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types: - - - `application/xml` - - `text/xml` - */ -@interface AFXMLParserResponseSerializer : AFHTTPResponseSerializer - -@end - -#pragma mark - - -#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED - -/** - `AFXMLDocumentResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects. - - By default, `AFXMLDocumentResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types: - - - `application/xml` - - `text/xml` - */ -@interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer - -- (instancetype)init; - -/** - Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. - */ -@property (nonatomic, assign) NSUInteger options; - -/** - Creates and returns an XML document serializer with the specified options. - - @param mask The XML document options. - */ -+ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask; - -@end - -#endif - -#pragma mark - - -/** - `AFPropertyListResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects. - - By default, `AFPropertyListResponseSerializer` accepts the following MIME types: - - - `application/x-plist` - */ -@interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer - -- (instancetype)init; - -/** - The property list format. Possible values are described in "NSPropertyListFormat". - */ -@property (nonatomic, assign) NSPropertyListFormat format; - -/** - The property list reading options. Possible values are described in "NSPropertyListMutabilityOptions." - */ -@property (nonatomic, assign) NSPropertyListReadOptions readOptions; - -/** - Creates and returns a property list serializer with a specified format, read options, and write options. - - @param format The property list format. - @param readOptions The property list reading options. - */ -+ (instancetype)serializerWithFormat:(NSPropertyListFormat)format - readOptions:(NSPropertyListReadOptions)readOptions; - -@end - -#pragma mark - - -/** - `AFImageResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes image responses. - - By default, `AFImageResponseSerializer` accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage: - - - `image/tiff` - - `image/jpeg` - - `image/gif` - - `image/png` - - `image/ico` - - `image/x-icon` - - `image/bmp` - - `image/x-bmp` - - `image/x-xbitmap` - - `image/x-win-bitmap` - */ -@interface AFImageResponseSerializer : AFHTTPResponseSerializer - -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH -/** - The scale factor used when interpreting the image data to construct `responseImage`. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance. - */ -@property (nonatomic, assign) CGFloat imageScale; - -/** - Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with `setCompletionBlockWithSuccess:failure:`, as it allows a bitmap representation to be constructed in the background rather than on the main thread. `YES` by default. - */ -@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage; -#endif - -@end - -#pragma mark - - -/** - `AFCompoundSerializer` is a subclass of `AFHTTPResponseSerializer` that delegates the response serialization to the first `AFHTTPResponseSerializer` object that returns an object for `responseObjectForResponse:data:error:`, falling back on the default behavior of `AFHTTPResponseSerializer`. This is useful for supporting multiple potential types and structures of server responses with a single serializer. - */ -@interface AFCompoundResponseSerializer : AFHTTPResponseSerializer - -/** - The component response serializers. - */ -@property (readonly, nonatomic, copy) NSArray > *responseSerializers; - -/** - Creates and returns a compound serializer comprised of the specified response serializers. - - @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`. - */ -+ (instancetype)compoundSerializerWithResponseSerializers:(NSArray > *)responseSerializers; - -@end - -///---------------- -/// @name Constants -///---------------- - -/** - ## Error Domains - - The following error domain is predefined. - - - `NSString * const AFURLResponseSerializationErrorDomain` - - ### Constants - - `AFURLResponseSerializationErrorDomain` - AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. - */ -FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain; - -/** - ## User info dictionary keys - - These keys may exist in the user info dictionary, in addition to those defined for NSError. - - - `NSString * const AFNetworkingOperationFailingURLResponseErrorKey` - - `NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey` - - ### Constants - - `AFNetworkingOperationFailingURLResponseErrorKey` - The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`. - - `AFNetworkingOperationFailingURLResponseDataErrorKey` - The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseErrorKey; - -FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey; - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m b/iOSProject/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m deleted file mode 100755 index 5e467992..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m +++ /dev/null @@ -1,805 +0,0 @@ -// AFURLResponseSerialization.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "AFURLResponseSerialization.h" - -#import - -#if TARGET_OS_IOS -#import -#elif TARGET_OS_WATCH -#import -#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) -#import -#endif - -NSString * const AFURLResponseSerializationErrorDomain = @"com.alamofire.error.serialization.response"; -NSString * const AFNetworkingOperationFailingURLResponseErrorKey = @"com.alamofire.serialization.response.error.response"; -NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey = @"com.alamofire.serialization.response.error.data"; - -static NSError * AFErrorWithUnderlyingError(NSError *error, NSError *underlyingError) { - if (!error) { - return underlyingError; - } - - if (!underlyingError || error.userInfo[NSUnderlyingErrorKey]) { - return error; - } - - NSMutableDictionary *mutableUserInfo = [error.userInfo mutableCopy]; - mutableUserInfo[NSUnderlyingErrorKey] = underlyingError; - - return [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:mutableUserInfo]; -} - -static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger code, NSString *domain) { - if ([error.domain isEqualToString:domain] && error.code == code) { - return YES; - } else if (error.userInfo[NSUnderlyingErrorKey]) { - return AFErrorOrUnderlyingErrorHasCodeInDomain(error.userInfo[NSUnderlyingErrorKey], code, domain); - } - - return NO; -} - -static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) { - if ([JSONObject isKindOfClass:[NSArray class]]) { - NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]]; - for (id value in (NSArray *)JSONObject) { - [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)]; - } - - return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray]; - } else if ([JSONObject isKindOfClass:[NSDictionary class]]) { - NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionaryWithDictionary:JSONObject]; - for (id key in [(NSDictionary *)JSONObject allKeys]) { - id value = (NSDictionary *)JSONObject[key]; - if (!value || [value isEqual:[NSNull null]]) { - [mutableDictionary removeObjectForKey:key]; - } else if ([value isKindOfClass:[NSArray class]] || [value isKindOfClass:[NSDictionary class]]) { - mutableDictionary[key] = AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions); - } - } - - return (readingOptions & NSJSONReadingMutableContainers) ? mutableDictionary : [NSDictionary dictionaryWithDictionary:mutableDictionary]; - } - - return JSONObject; -} - -@implementation AFHTTPResponseSerializer - -+ (instancetype)serializer { - return [[self alloc] init]; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.stringEncoding = NSUTF8StringEncoding; - - self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)]; - self.acceptableContentTypes = nil; - - return self; -} - -#pragma mark - - -- (BOOL)validateResponse:(NSHTTPURLResponse *)response - data:(NSData *)data - error:(NSError * __autoreleasing *)error -{ - BOOL responseIsValid = YES; - NSError *validationError = nil; - - if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) { - if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]] && - !([response MIMEType] == nil && [data length] == 0)) { - - if ([data length] > 0 && [response URL]) { - NSMutableDictionary *mutableUserInfo = [@{ - NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: unacceptable content-type: %@", @"AFNetworking", nil), [response MIMEType]], - NSURLErrorFailingURLErrorKey:[response URL], - AFNetworkingOperationFailingURLResponseErrorKey: response, - } mutableCopy]; - if (data) { - mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data; - } - - validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:mutableUserInfo], validationError); - } - - responseIsValid = NO; - } - - if (self.acceptableStatusCodes && ![self.acceptableStatusCodes containsIndex:(NSUInteger)response.statusCode] && [response URL]) { - NSMutableDictionary *mutableUserInfo = [@{ - NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: %@ (%ld)", @"AFNetworking", nil), [NSHTTPURLResponse localizedStringForStatusCode:response.statusCode], (long)response.statusCode], - NSURLErrorFailingURLErrorKey:[response URL], - AFNetworkingOperationFailingURLResponseErrorKey: response, - } mutableCopy]; - - if (data) { - mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data; - } - - validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorBadServerResponse userInfo:mutableUserInfo], validationError); - - responseIsValid = NO; - } - } - - if (error && !responseIsValid) { - *error = validationError; - } - - return responseIsValid; -} - -#pragma mark - AFURLResponseSerialization - -- (id)responseObjectForResponse:(NSURLResponse *)response - data:(NSData *)data - error:(NSError *__autoreleasing *)error -{ - [self validateResponse:(NSHTTPURLResponse *)response data:data error:error]; - - return data; -} - -#pragma mark - NSSecureCoding - -+ (BOOL)supportsSecureCoding { - return YES; -} - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [self init]; - if (!self) { - return nil; - } - - self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))]; - self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [coder encodeObject:self.acceptableStatusCodes forKey:NSStringFromSelector(@selector(acceptableStatusCodes))]; - [coder encodeObject:self.acceptableContentTypes forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFHTTPResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; - serializer.acceptableStatusCodes = [self.acceptableStatusCodes copyWithZone:zone]; - serializer.acceptableContentTypes = [self.acceptableContentTypes copyWithZone:zone]; - - return serializer; -} - -@end - -#pragma mark - - -@implementation AFJSONResponseSerializer - -+ (instancetype)serializer { - return [self serializerWithReadingOptions:(NSJSONReadingOptions)0]; -} - -+ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions { - AFJSONResponseSerializer *serializer = [[self alloc] init]; - serializer.readingOptions = readingOptions; - - return serializer; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil]; - - return self; -} - -#pragma mark - AFURLResponseSerialization - -- (id)responseObjectForResponse:(NSURLResponse *)response - data:(NSData *)data - error:(NSError *__autoreleasing *)error -{ - if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { - if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { - return nil; - } - } - - id responseObject = nil; - NSError *serializationError = nil; - // Workaround for behavior of Rails to return a single space for `head :ok` (a workaround for a bug in Safari), which is not interpreted as valid input by NSJSONSerialization. - // See https://github.com/rails/rails/issues/1742 - BOOL isSpace = [data isEqualToData:[NSData dataWithBytes:" " length:1]]; - if (data.length > 0 && !isSpace) { - responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError]; - } else { - return nil; - } - - if (self.removesKeysWithNullValues && responseObject) { - responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions); - } - - if (error) { - *error = AFErrorWithUnderlyingError(serializationError, *error); - } - - return responseObject; -} - -#pragma mark - NSSecureCoding - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [super initWithCoder:decoder]; - if (!self) { - return nil; - } - - self.readingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readingOptions))] unsignedIntegerValue]; - self.removesKeysWithNullValues = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))] boolValue]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; - - [coder encodeObject:@(self.readingOptions) forKey:NSStringFromSelector(@selector(readingOptions))]; - [coder encodeObject:@(self.removesKeysWithNullValues) forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFJSONResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; - serializer.readingOptions = self.readingOptions; - serializer.removesKeysWithNullValues = self.removesKeysWithNullValues; - - return serializer; -} - -@end - -#pragma mark - - -@implementation AFXMLParserResponseSerializer - -+ (instancetype)serializer { - AFXMLParserResponseSerializer *serializer = [[self alloc] init]; - - return serializer; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil]; - - return self; -} - -#pragma mark - AFURLResponseSerialization - -- (id)responseObjectForResponse:(NSHTTPURLResponse *)response - data:(NSData *)data - error:(NSError *__autoreleasing *)error -{ - if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { - if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { - return nil; - } - } - - return [[NSXMLParser alloc] initWithData:data]; -} - -@end - -#pragma mark - - -#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED - -@implementation AFXMLDocumentResponseSerializer - -+ (instancetype)serializer { - return [self serializerWithXMLDocumentOptions:0]; -} - -+ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask { - AFXMLDocumentResponseSerializer *serializer = [[self alloc] init]; - serializer.options = mask; - - return serializer; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil]; - - return self; -} - -#pragma mark - AFURLResponseSerialization - -- (id)responseObjectForResponse:(NSURLResponse *)response - data:(NSData *)data - error:(NSError *__autoreleasing *)error -{ - if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { - if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { - return nil; - } - } - - NSError *serializationError = nil; - NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError]; - - if (error) { - *error = AFErrorWithUnderlyingError(serializationError, *error); - } - - return document; -} - -#pragma mark - NSSecureCoding - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [super initWithCoder:decoder]; - if (!self) { - return nil; - } - - self.options = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(options))] unsignedIntegerValue]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; - - [coder encodeObject:@(self.options) forKey:NSStringFromSelector(@selector(options))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFXMLDocumentResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; - serializer.options = self.options; - - return serializer; -} - -@end - -#endif - -#pragma mark - - -@implementation AFPropertyListResponseSerializer - -+ (instancetype)serializer { - return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 readOptions:0]; -} - -+ (instancetype)serializerWithFormat:(NSPropertyListFormat)format - readOptions:(NSPropertyListReadOptions)readOptions -{ - AFPropertyListResponseSerializer *serializer = [[self alloc] init]; - serializer.format = format; - serializer.readOptions = readOptions; - - return serializer; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/x-plist", nil]; - - return self; -} - -#pragma mark - AFURLResponseSerialization - -- (id)responseObjectForResponse:(NSURLResponse *)response - data:(NSData *)data - error:(NSError *__autoreleasing *)error -{ - if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { - if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { - return nil; - } - } - - id responseObject; - NSError *serializationError = nil; - - if (data) { - responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError]; - } - - if (error) { - *error = AFErrorWithUnderlyingError(serializationError, *error); - } - - return responseObject; -} - -#pragma mark - NSSecureCoding - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [super initWithCoder:decoder]; - if (!self) { - return nil; - } - - self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue]; - self.readOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readOptions))] unsignedIntegerValue]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; - - [coder encodeObject:@(self.format) forKey:NSStringFromSelector(@selector(format))]; - [coder encodeObject:@(self.readOptions) forKey:NSStringFromSelector(@selector(readOptions))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFPropertyListResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; - serializer.format = self.format; - serializer.readOptions = self.readOptions; - - return serializer; -} - -@end - -#pragma mark - - -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH -#import -#import - -@interface UIImage (AFNetworkingSafeImageLoading) -+ (UIImage *)af_safeImageWithData:(NSData *)data; -@end - -static NSLock* imageLock = nil; - -@implementation UIImage (AFNetworkingSafeImageLoading) - -+ (UIImage *)af_safeImageWithData:(NSData *)data { - UIImage* image = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - imageLock = [[NSLock alloc] init]; - }); - - [imageLock lock]; - image = [UIImage imageWithData:data]; - [imageLock unlock]; - return image; -} - -@end - -static UIImage * AFImageWithDataAtScale(NSData *data, CGFloat scale) { - UIImage *image = [UIImage af_safeImageWithData:data]; - if (image.images) { - return image; - } - - return [[UIImage alloc] initWithCGImage:[image CGImage] scale:scale orientation:image.imageOrientation]; -} - -static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *response, NSData *data, CGFloat scale) { - if (!data || [data length] == 0) { - return nil; - } - - CGImageRef imageRef = NULL; - CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data); - - if ([response.MIMEType isEqualToString:@"image/png"]) { - imageRef = CGImageCreateWithPNGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault); - } else if ([response.MIMEType isEqualToString:@"image/jpeg"]) { - imageRef = CGImageCreateWithJPEGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault); - - if (imageRef) { - CGColorSpaceRef imageColorSpace = CGImageGetColorSpace(imageRef); - CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(imageColorSpace); - - // CGImageCreateWithJPEGDataProvider does not properly handle CMKY, so fall back to AFImageWithDataAtScale - if (imageColorSpaceModel == kCGColorSpaceModelCMYK) { - CGImageRelease(imageRef); - imageRef = NULL; - } - } - } - - CGDataProviderRelease(dataProvider); - - UIImage *image = AFImageWithDataAtScale(data, scale); - if (!imageRef) { - if (image.images || !image) { - return image; - } - - imageRef = CGImageCreateCopy([image CGImage]); - if (!imageRef) { - return nil; - } - } - - size_t width = CGImageGetWidth(imageRef); - size_t height = CGImageGetHeight(imageRef); - size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef); - - if (width * height > 1024 * 1024 || bitsPerComponent > 8) { - CGImageRelease(imageRef); - - return image; - } - - // CGImageGetBytesPerRow() calculates incorrectly in iOS 5.0, so defer to CGBitmapContextCreate - size_t bytesPerRow = 0; - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace); - CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); - - if (colorSpaceModel == kCGColorSpaceModelRGB) { - uint32_t alpha = (bitmapInfo & kCGBitmapAlphaInfoMask); -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wassign-enum" - if (alpha == kCGImageAlphaNone) { - bitmapInfo &= ~kCGBitmapAlphaInfoMask; - bitmapInfo |= kCGImageAlphaNoneSkipFirst; - } else if (!(alpha == kCGImageAlphaNoneSkipFirst || alpha == kCGImageAlphaNoneSkipLast)) { - bitmapInfo &= ~kCGBitmapAlphaInfoMask; - bitmapInfo |= kCGImageAlphaPremultipliedFirst; - } -#pragma clang diagnostic pop - } - - CGContextRef context = CGBitmapContextCreate(NULL, width, height, bitsPerComponent, bytesPerRow, colorSpace, bitmapInfo); - - CGColorSpaceRelease(colorSpace); - - if (!context) { - CGImageRelease(imageRef); - - return image; - } - - CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, width, height), imageRef); - CGImageRef inflatedImageRef = CGBitmapContextCreateImage(context); - - CGContextRelease(context); - - UIImage *inflatedImage = [[UIImage alloc] initWithCGImage:inflatedImageRef scale:scale orientation:image.imageOrientation]; - - CGImageRelease(inflatedImageRef); - CGImageRelease(imageRef); - - return inflatedImage; -} -#endif - - -@implementation AFImageResponseSerializer - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap", nil]; - -#if TARGET_OS_IOS || TARGET_OS_TV - self.imageScale = [[UIScreen mainScreen] scale]; - self.automaticallyInflatesResponseImage = YES; -#elif TARGET_OS_WATCH - self.imageScale = [[WKInterfaceDevice currentDevice] screenScale]; - self.automaticallyInflatesResponseImage = YES; -#endif - - return self; -} - -#pragma mark - AFURLResponseSerializer - -- (id)responseObjectForResponse:(NSURLResponse *)response - data:(NSData *)data - error:(NSError *__autoreleasing *)error -{ - if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) { - if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) { - return nil; - } - } - -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH - if (self.automaticallyInflatesResponseImage) { - return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale); - } else { - return AFImageWithDataAtScale(data, self.imageScale); - } -#else - // Ensure that the image is set to it's correct pixel width and height - NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:data]; - NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])]; - [image addRepresentation:bitimage]; - - return image; -#endif - - return nil; -} - -#pragma mark - NSSecureCoding - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [super initWithCoder:decoder]; - if (!self) { - return nil; - } - -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH - NSNumber *imageScale = [decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(imageScale))]; -#if CGFLOAT_IS_DOUBLE - self.imageScale = [imageScale doubleValue]; -#else - self.imageScale = [imageScale floatValue]; -#endif - - self.automaticallyInflatesResponseImage = [decoder decodeBoolForKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))]; -#endif - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; - -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH - [coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))]; - [coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))]; -#endif -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFImageResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; - -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH - serializer.imageScale = self.imageScale; - serializer.automaticallyInflatesResponseImage = self.automaticallyInflatesResponseImage; -#endif - - return serializer; -} - -@end - -#pragma mark - - -@interface AFCompoundResponseSerializer () -@property (readwrite, nonatomic, copy) NSArray *responseSerializers; -@end - -@implementation AFCompoundResponseSerializer - -+ (instancetype)compoundSerializerWithResponseSerializers:(NSArray *)responseSerializers { - AFCompoundResponseSerializer *serializer = [[self alloc] init]; - serializer.responseSerializers = responseSerializers; - - return serializer; -} - -#pragma mark - AFURLResponseSerialization - -- (id)responseObjectForResponse:(NSURLResponse *)response - data:(NSData *)data - error:(NSError *__autoreleasing *)error -{ - for (id serializer in self.responseSerializers) { - if (![serializer isKindOfClass:[AFHTTPResponseSerializer class]]) { - continue; - } - - NSError *serializerError = nil; - id responseObject = [serializer responseObjectForResponse:response data:data error:&serializerError]; - if (responseObject) { - if (error) { - *error = AFErrorWithUnderlyingError(serializerError, *error); - } - - return responseObject; - } - } - - return [super responseObjectForResponse:response data:data error:error]; -} - -#pragma mark - NSSecureCoding - -- (instancetype)initWithCoder:(NSCoder *)decoder { - self = [super initWithCoder:decoder]; - if (!self) { - return nil; - } - - self.responseSerializers = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(responseSerializers))]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; - - [coder encodeObject:self.responseSerializers forKey:NSStringFromSelector(@selector(responseSerializers))]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - AFCompoundResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; - serializer.responseSerializers = self.responseSerializers; - - return serializer; -} - -@end diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h b/iOSProject/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h deleted file mode 100644 index 89909fe4..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLSessionManager.h +++ /dev/null @@ -1,500 +0,0 @@ -// AFURLSessionManager.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - - -#import - -#import "AFURLResponseSerialization.h" -#import "AFURLRequestSerialization.h" -#import "AFSecurityPolicy.h" -#if !TARGET_OS_WATCH -#import "AFNetworkReachabilityManager.h" -#endif - -/** - `AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to ``, ``, ``, and ``. - - ## Subclassing Notes - - This is the base class for `AFHTTPSessionManager`, which adds functionality specific to making HTTP requests. If you are looking to extend `AFURLSessionManager` specifically for HTTP, consider subclassing `AFHTTPSessionManager` instead. - - ## NSURLSession & NSURLSessionTask Delegate Methods - - `AFURLSessionManager` implements the following delegate methods: - - ### `NSURLSessionDelegate` - - - `URLSession:didBecomeInvalidWithError:` - - `URLSession:didReceiveChallenge:completionHandler:` - - `URLSessionDidFinishEventsForBackgroundURLSession:` - - ### `NSURLSessionTaskDelegate` - - - `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:` - - `URLSession:task:didReceiveChallenge:completionHandler:` - - `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:` - - `URLSession:task:needNewBodyStream:` - - `URLSession:task:didCompleteWithError:` - - ### `NSURLSessionDataDelegate` - - - `URLSession:dataTask:didReceiveResponse:completionHandler:` - - `URLSession:dataTask:didBecomeDownloadTask:` - - `URLSession:dataTask:didReceiveData:` - - `URLSession:dataTask:willCacheResponse:completionHandler:` - - ### `NSURLSessionDownloadDelegate` - - - `URLSession:downloadTask:didFinishDownloadingToURL:` - - `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:` - - `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:` - - If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first. - - ## Network Reachability Monitoring - - Network reachability status and change monitoring is available through the `reachabilityManager` property. Applications may choose to monitor network reachability conditions in order to prevent or suspend any outbound requests. See `AFNetworkReachabilityManager` for more details. - - ## NSCoding Caveats - - - Encoded managers do not include any block properties. Be sure to set delegate callback blocks when using `-initWithCoder:` or `NSKeyedUnarchiver`. - - ## NSCopying Caveats - - - `-copy` and `-copyWithZone:` return a new manager with a new `NSURLSession` created from the configuration of the original. - - Operation copies do not include any delegate callback blocks, as they often strongly captures a reference to `self`, which would otherwise have the unintuitive side-effect of pointing to the _original_ session manager when copied. - - @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance. - */ - -NS_ASSUME_NONNULL_BEGIN - -@interface AFURLSessionManager : NSObject - -/** - The managed session. - */ -@property (readonly, nonatomic, strong) NSURLSession *session; - -/** - The operation queue on which delegate callbacks are run. - */ -@property (readonly, nonatomic, strong) NSOperationQueue *operationQueue; - -/** - Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`. - - @warning `responseSerializer` must not be `nil`. - */ -@property (nonatomic, strong) id responseSerializer; - -///------------------------------- -/// @name Managing Security Policy -///------------------------------- - -/** - The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. - */ -@property (nonatomic, strong) AFSecurityPolicy *securityPolicy; - -#if !TARGET_OS_WATCH -///-------------------------------------- -/// @name Monitoring Network Reachability -///-------------------------------------- - -/** - The network reachability manager. `AFURLSessionManager` uses the `sharedManager` by default. - */ -@property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager; -#endif - -///---------------------------- -/// @name Getting Session Tasks -///---------------------------- - -/** - The data, upload, and download tasks currently run by the managed session. - */ -@property (readonly, nonatomic, strong) NSArray *tasks; - -/** - The data tasks currently run by the managed session. - */ -@property (readonly, nonatomic, strong) NSArray *dataTasks; - -/** - The upload tasks currently run by the managed session. - */ -@property (readonly, nonatomic, strong) NSArray *uploadTasks; - -/** - The download tasks currently run by the managed session. - */ -@property (readonly, nonatomic, strong) NSArray *downloadTasks; - -///------------------------------- -/// @name Managing Callback Queues -///------------------------------- - -/** - The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used. - */ -@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue; - -/** - The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used. - */ -@property (nonatomic, strong, nullable) dispatch_group_t completionGroup; - -///--------------------------------- -/// @name Working Around System Bugs -///--------------------------------- - -/** - Whether to attempt to retry creation of upload tasks for background sessions when initial call returns `nil`. `NO` by default. - - @bug As of iOS 7.0, there is a bug where upload tasks created for background tasks are sometimes `nil`. As a workaround, if this property is `YES`, AFNetworking will follow Apple's recommendation to try creating the task again. - - @see https://github.com/AFNetworking/AFNetworking/issues/1675 - */ -@property (nonatomic, assign) BOOL attemptsToRecreateUploadTasksForBackgroundSessions; - -///--------------------- -/// @name Initialization -///--------------------- - -/** - Creates and returns a manager for a session created with the specified configuration. This is the designated initializer. - - @param configuration The configuration used to create the managed session. - - @return A manager for a newly-created session. - */ -- (instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; - -/** - Invalidates the managed session, optionally canceling pending tasks. - - @param cancelPendingTasks Whether or not to cancel pending tasks. - */ -- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks; - -///------------------------- -/// @name Running Data Tasks -///------------------------- - -/** - Creates an `NSURLSessionDataTask` with the specified request. - - @param request The HTTP request for the request. - @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. - */ -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; - -/** - Creates an `NSURLSessionDataTask` with the specified request. - - @param request The HTTP request for the request. - @param uploadProgressBlock A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. - @param downloadProgressBlock A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. - @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. - */ -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request - uploadProgress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock - downloadProgress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; - -///--------------------------- -/// @name Running Upload Tasks -///--------------------------- - -/** - Creates an `NSURLSessionUploadTask` with the specified request for a local file. - - @param request The HTTP request for the request. - @param fileURL A URL to the local file to be uploaded. - @param uploadProgressBlock A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. - @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. - - @see `attemptsToRecreateUploadTasksForBackgroundSessions` - */ -- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request - fromFile:(NSURL *)fileURL - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; - -/** - Creates an `NSURLSessionUploadTask` with the specified request for an HTTP body. - - @param request The HTTP request for the request. - @param bodyData A data object containing the HTTP body to be uploaded. - @param uploadProgressBlock A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. - @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. - */ -- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request - fromData:(nullable NSData *)bodyData - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; - -/** - Creates an `NSURLSessionUploadTask` with the specified streaming request. - - @param request The HTTP request for the request. - @param uploadProgressBlock A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. - @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. - */ -- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; - -///----------------------------- -/// @name Running Download Tasks -///----------------------------- - -/** - Creates an `NSURLSessionDownloadTask` with the specified request. - - @param request The HTTP request for the request. - @param downloadProgressBlock A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. - @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. - @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. - - @warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method. - */ -- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request - progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock - destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination - completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; - -/** - Creates an `NSURLSessionDownloadTask` with the specified resume data. - - @param resumeData The data used to resume downloading. - @param downloadProgressBlock A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. - @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. - @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. - */ -- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData - progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock - destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination - completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; - -///--------------------------------- -/// @name Getting Progress for Tasks -///--------------------------------- - -/** - Returns the upload progress of the specified task. - - @param task The session task. Must not be `nil`. - - @return An `NSProgress` object reporting the upload progress of a task, or `nil` if the progress is unavailable. - */ -- (nullable NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task; - -/** - Returns the download progress of the specified task. - - @param task The session task. Must not be `nil`. - - @return An `NSProgress` object reporting the download progress of a task, or `nil` if the progress is unavailable. - */ -- (nullable NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task; - -///----------------------------------------- -/// @name Setting Session Delegate Callbacks -///----------------------------------------- - -/** - Sets a block to be executed when the managed session becomes invalid, as handled by the `NSURLSessionDelegate` method `URLSession:didBecomeInvalidWithError:`. - - @param block A block object to be executed when the managed session becomes invalid. The block has no return value, and takes two arguments: the session, and the error related to the cause of invalidation. - */ -- (void)setSessionDidBecomeInvalidBlock:(nullable void (^)(NSURLSession *session, NSError *error))block; - -/** - Sets a block to be executed when a connection level authentication challenge has occurred, as handled by the `NSURLSessionDelegate` method `URLSession:didReceiveChallenge:completionHandler:`. - - @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. - */ -- (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; - -///-------------------------------------- -/// @name Setting Task Delegate Callbacks -///-------------------------------------- - -/** - Sets a block to be executed when a task requires a new request body stream to send to the remote server, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:needNewBodyStream:`. - - @param block A block object to be executed when a task requires a new request body stream. - */ -- (void)setTaskNeedNewBodyStreamBlock:(nullable NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block; - -/** - Sets a block to be executed when an HTTP request is attempting to perform a redirection to a different URL, as handled by the `NSURLSessionTaskDelegate` method `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`. - - @param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response. - */ -- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block; - -/** - Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`. - - @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. - */ -- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; - -/** - Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. - - @param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes five arguments: the session, the task, the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times, and will execute on the main thread. - */ -- (void)setTaskDidSendBodyDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block; - -/** - Sets a block to be executed as the last message related to a specific task, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didCompleteWithError:`. - - @param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any error that occurred in the process of executing the task. - */ -- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * _Nullable error))block; - -///------------------------------------------- -/// @name Setting Data Task Delegate Callbacks -///------------------------------------------- - -/** - Sets a block to be executed when a data task has received a response, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveResponse:completionHandler:`. - - @param block A block object to be executed when a data task has received a response. The block returns the disposition of the session response, and takes three arguments: the session, the data task, and the received response. - */ -- (void)setDataTaskDidReceiveResponseBlock:(nullable NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block; - -/** - Sets a block to be executed when a data task has become a download task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didBecomeDownloadTask:`. - - @param block A block object to be executed when a data task has become a download task. The block has no return value, and takes three arguments: the session, the data task, and the download task it has become. - */ -- (void)setDataTaskDidBecomeDownloadTaskBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block; - -/** - Sets a block to be executed when a data task receives data, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveData:`. - - @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the session, the data task, and the data received. This block may be called multiple times, and will execute on the session manager operation queue. - */ -- (void)setDataTaskDidReceiveDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block; - -/** - Sets a block to be executed to determine the caching behavior of a data task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:willCacheResponse:completionHandler:`. - - @param block A block object to be executed to determine the caching behavior of a data task. The block returns the response to cache, and takes three arguments: the session, the data task, and the proposed cached URL response. - */ -- (void)setDataTaskWillCacheResponseBlock:(nullable NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block; - -/** - Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDataDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`. - - @param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session. - */ -- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block; - -///----------------------------------------------- -/// @name Setting Download Task Delegate Callbacks -///----------------------------------------------- - -/** - Sets a block to be executed when a download task has completed a download, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didFinishDownloadingToURL:`. - - @param block A block object to be executed when a download task has completed. The block returns the URL the download should be moved to, and takes three arguments: the session, the download task, and the temporary location of the downloaded file. If the file manager encounters an error while attempting to move the temporary file to the destination, an `AFURLSessionDownloadTaskDidFailToMoveFileNotification` will be posted, with the download task as its object, and the user info of the error. - */ -- (void)setDownloadTaskDidFinishDownloadingBlock:(nullable NSURL * _Nullable (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block; - -/** - Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`. - - @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes five arguments: the session, the download task, the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the session manager operation queue. - */ -- (void)setDownloadTaskDidWriteDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block; - -/** - Sets a block to be executed when a download task has been resumed, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. - - @param block A block object to be executed when a download task has been resumed. The block has no return value and takes four arguments: the session, the download task, the file offset of the resumed download, and the total number of bytes expected to be downloaded. - */ -- (void)setDownloadTaskDidResumeBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block; - -@end - -///-------------------- -/// @name Notifications -///-------------------- - -/** - Posted when a task resumes. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidResumeNotification; - -/** - Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteNotification; - -/** - Posted when a task suspends its execution. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidSuspendNotification; - -/** - Posted when a session is invalidated. - */ -FOUNDATION_EXPORT NSString * const AFURLSessionDidInvalidateNotification; - -/** - Posted when a session download task encountered an error when moving the temporary download file to a specified destination. - */ -FOUNDATION_EXPORT NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification; - -/** - The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if response data exists for the task. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseDataKey; - -/** - The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the response was serialized. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey; - -/** - The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the task has an associated response serializer. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey; - -/** - The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an the response data has been stored directly to disk. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteAssetPathKey; - -/** - Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an error exists. - */ -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteErrorKey; - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m b/iOSProject/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m deleted file mode 100644 index ef2108cd..00000000 --- a/iOSProject/Pods/AFNetworking/AFNetworking/AFURLSessionManager.m +++ /dev/null @@ -1,1244 +0,0 @@ -// AFURLSessionManager.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "AFURLSessionManager.h" -#import - -#ifndef NSFoundationVersionNumber_iOS_8_0 -#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug 1140.11 -#else -#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug NSFoundationVersionNumber_iOS_8_0 -#endif - -static dispatch_queue_t url_session_manager_creation_queue() { - static dispatch_queue_t af_url_session_manager_creation_queue; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - af_url_session_manager_creation_queue = dispatch_queue_create("com.alamofire.networking.session.manager.creation", DISPATCH_QUEUE_SERIAL); - }); - - return af_url_session_manager_creation_queue; -} - -static void url_session_manager_create_task_safely(dispatch_block_t block) { - if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) { - // Fix of bug - // Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8) - // Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093 - dispatch_sync(url_session_manager_creation_queue(), block); - } else { - block(); - } -} - -static dispatch_queue_t url_session_manager_processing_queue() { - static dispatch_queue_t af_url_session_manager_processing_queue; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - af_url_session_manager_processing_queue = dispatch_queue_create("com.alamofire.networking.session.manager.processing", DISPATCH_QUEUE_CONCURRENT); - }); - - return af_url_session_manager_processing_queue; -} - -static dispatch_group_t url_session_manager_completion_group() { - static dispatch_group_t af_url_session_manager_completion_group; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - af_url_session_manager_completion_group = dispatch_group_create(); - }); - - return af_url_session_manager_completion_group; -} - -NSString * const AFNetworkingTaskDidResumeNotification = @"com.alamofire.networking.task.resume"; -NSString * const AFNetworkingTaskDidCompleteNotification = @"com.alamofire.networking.task.complete"; -NSString * const AFNetworkingTaskDidSuspendNotification = @"com.alamofire.networking.task.suspend"; -NSString * const AFURLSessionDidInvalidateNotification = @"com.alamofire.networking.session.invalidate"; -NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification = @"com.alamofire.networking.session.download.file-manager-error"; - -NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; -NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer"; -NSString * const AFNetworkingTaskDidCompleteResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata"; -NSString * const AFNetworkingTaskDidCompleteErrorKey = @"com.alamofire.networking.task.complete.error"; -NSString * const AFNetworkingTaskDidCompleteAssetPathKey = @"com.alamofire.networking.task.complete.assetpath"; - -static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock"; - -static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3; - -static void * AFTaskStateChangedContext = &AFTaskStateChangedContext; - -typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error); -typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); - -typedef NSURLRequest * (^AFURLSessionTaskWillPerformHTTPRedirectionBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request); -typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionTaskDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); -typedef void (^AFURLSessionDidFinishEventsForBackgroundURLSessionBlock)(NSURLSession *session); - -typedef NSInputStream * (^AFURLSessionTaskNeedNewBodyStreamBlock)(NSURLSession *session, NSURLSessionTask *task); -typedef void (^AFURLSessionTaskDidSendBodyDataBlock)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend); -typedef void (^AFURLSessionTaskDidCompleteBlock)(NSURLSession *session, NSURLSessionTask *task, NSError *error); - -typedef NSURLSessionResponseDisposition (^AFURLSessionDataTaskDidReceiveResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response); -typedef void (^AFURLSessionDataTaskDidBecomeDownloadTaskBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask); -typedef void (^AFURLSessionDataTaskDidReceiveDataBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data); -typedef NSCachedURLResponse * (^AFURLSessionDataTaskWillCacheResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse); - -typedef NSURL * (^AFURLSessionDownloadTaskDidFinishDownloadingBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location); -typedef void (^AFURLSessionDownloadTaskDidWriteDataBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite); -typedef void (^AFURLSessionDownloadTaskDidResumeBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes); -typedef void (^AFURLSessionTaskProgressBlock)(NSProgress *); - -typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error); - - -#pragma mark - - -@interface AFURLSessionManagerTaskDelegate : NSObject -@property (nonatomic, weak) AFURLSessionManager *manager; -@property (nonatomic, strong) NSMutableData *mutableData; -@property (nonatomic, strong) NSProgress *uploadProgress; -@property (nonatomic, strong) NSProgress *downloadProgress; -@property (nonatomic, copy) NSURL *downloadFileURL; -@property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; -@property (nonatomic, copy) AFURLSessionTaskProgressBlock uploadProgressBlock; -@property (nonatomic, copy) AFURLSessionTaskProgressBlock downloadProgressBlock; -@property (nonatomic, copy) AFURLSessionTaskCompletionHandler completionHandler; -@end - -@implementation AFURLSessionManagerTaskDelegate - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.mutableData = [NSMutableData data]; - self.uploadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil]; - self.uploadProgress.totalUnitCount = NSURLSessionTransferSizeUnknown; - - self.downloadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil]; - self.downloadProgress.totalUnitCount = NSURLSessionTransferSizeUnknown; - return self; -} - -#pragma mark - NSProgress Tracking - -- (void)setupProgressForTask:(NSURLSessionTask *)task { - __weak __typeof__(task) weakTask = task; - - self.uploadProgress.totalUnitCount = task.countOfBytesExpectedToSend; - self.downloadProgress.totalUnitCount = task.countOfBytesExpectedToReceive; - [self.uploadProgress setCancellable:YES]; - [self.uploadProgress setCancellationHandler:^{ - __typeof__(weakTask) strongTask = weakTask; - [strongTask cancel]; - }]; - [self.uploadProgress setPausable:YES]; - [self.uploadProgress setPausingHandler:^{ - __typeof__(weakTask) strongTask = weakTask; - [strongTask suspend]; - }]; - if ([self.uploadProgress respondsToSelector:@selector(setResumingHandler:)]) { - [self.uploadProgress setResumingHandler:^{ - __typeof__(weakTask) strongTask = weakTask; - [strongTask resume]; - }]; - } - - [self.downloadProgress setCancellable:YES]; - [self.downloadProgress setCancellationHandler:^{ - __typeof__(weakTask) strongTask = weakTask; - [strongTask cancel]; - }]; - [self.downloadProgress setPausable:YES]; - [self.downloadProgress setPausingHandler:^{ - __typeof__(weakTask) strongTask = weakTask; - [strongTask suspend]; - }]; - - if ([self.downloadProgress respondsToSelector:@selector(setResumingHandler:)]) { - [self.downloadProgress setResumingHandler:^{ - __typeof__(weakTask) strongTask = weakTask; - [strongTask resume]; - }]; - } - - [task addObserver:self - forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived)) - options:NSKeyValueObservingOptionNew - context:NULL]; - [task addObserver:self - forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToReceive)) - options:NSKeyValueObservingOptionNew - context:NULL]; - - [task addObserver:self - forKeyPath:NSStringFromSelector(@selector(countOfBytesSent)) - options:NSKeyValueObservingOptionNew - context:NULL]; - [task addObserver:self - forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToSend)) - options:NSKeyValueObservingOptionNew - context:NULL]; - - [self.downloadProgress addObserver:self - forKeyPath:NSStringFromSelector(@selector(fractionCompleted)) - options:NSKeyValueObservingOptionNew - context:NULL]; - [self.uploadProgress addObserver:self - forKeyPath:NSStringFromSelector(@selector(fractionCompleted)) - options:NSKeyValueObservingOptionNew - context:NULL]; -} - -- (void)cleanUpProgressForTask:(NSURLSessionTask *)task { - [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; - [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToReceive))]; - [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; - [task removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesExpectedToSend))]; - [self.downloadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))]; - [self.uploadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))]; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if ([object isKindOfClass:[NSURLSessionTask class]] || [object isKindOfClass:[NSURLSessionDownloadTask class]]) { - if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { - self.downloadProgress.completedUnitCount = [change[NSKeyValueChangeNewKey] longLongValue]; - } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesExpectedToReceive))]) { - self.downloadProgress.totalUnitCount = [change[NSKeyValueChangeNewKey] longLongValue]; - } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { - self.uploadProgress.completedUnitCount = [change[NSKeyValueChangeNewKey] longLongValue]; - } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesExpectedToSend))]) { - self.uploadProgress.totalUnitCount = [change[NSKeyValueChangeNewKey] longLongValue]; - } - } - else if ([object isEqual:self.downloadProgress]) { - if (self.downloadProgressBlock) { - self.downloadProgressBlock(object); - } - } - else if ([object isEqual:self.uploadProgress]) { - if (self.uploadProgressBlock) { - self.uploadProgressBlock(object); - } - } -} - -#pragma mark - NSURLSessionTaskDelegate - -- (void)URLSession:(__unused NSURLSession *)session - task:(NSURLSessionTask *)task -didCompleteWithError:(NSError *)error -{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - __strong AFURLSessionManager *manager = self.manager; - - __block id responseObject = nil; - - __block NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; - userInfo[AFNetworkingTaskDidCompleteResponseSerializerKey] = manager.responseSerializer; - - //Performance Improvement from #2672 - NSData *data = nil; - if (self.mutableData) { - data = [self.mutableData copy]; - //We no longer need the reference, so nil it out to gain back some memory. - self.mutableData = nil; - } - - if (self.downloadFileURL) { - userInfo[AFNetworkingTaskDidCompleteAssetPathKey] = self.downloadFileURL; - } else if (data) { - userInfo[AFNetworkingTaskDidCompleteResponseDataKey] = data; - } - - if (error) { - userInfo[AFNetworkingTaskDidCompleteErrorKey] = error; - - dispatch_group_async(manager.completionGroup ?: url_session_manager_completion_group(), manager.completionQueue ?: dispatch_get_main_queue(), ^{ - if (self.completionHandler) { - self.completionHandler(task.response, responseObject, error); - } - - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo]; - }); - }); - } else { - dispatch_async(url_session_manager_processing_queue(), ^{ - NSError *serializationError = nil; - responseObject = [manager.responseSerializer responseObjectForResponse:task.response data:data error:&serializationError]; - - if (self.downloadFileURL) { - responseObject = self.downloadFileURL; - } - - if (responseObject) { - userInfo[AFNetworkingTaskDidCompleteSerializedResponseKey] = responseObject; - } - - if (serializationError) { - userInfo[AFNetworkingTaskDidCompleteErrorKey] = serializationError; - } - - dispatch_group_async(manager.completionGroup ?: url_session_manager_completion_group(), manager.completionQueue ?: dispatch_get_main_queue(), ^{ - if (self.completionHandler) { - self.completionHandler(task.response, responseObject, serializationError); - } - - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidCompleteNotification object:task userInfo:userInfo]; - }); - }); - }); - } -#pragma clang diagnostic pop -} - -#pragma mark - NSURLSessionDataTaskDelegate - -- (void)URLSession:(__unused NSURLSession *)session - dataTask:(__unused NSURLSessionDataTask *)dataTask - didReceiveData:(NSData *)data -{ - [self.mutableData appendData:data]; -} - -#pragma mark - NSURLSessionDownloadTaskDelegate - -- (void)URLSession:(NSURLSession *)session - downloadTask:(NSURLSessionDownloadTask *)downloadTask -didFinishDownloadingToURL:(NSURL *)location -{ - NSError *fileManagerError = nil; - self.downloadFileURL = nil; - - if (self.downloadTaskDidFinishDownloading) { - self.downloadFileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location); - if (self.downloadFileURL) { - [[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError]; - - if (fileManagerError) { - [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo]; - } - } - } -} - -@end - -#pragma mark - - -/** - * A workaround for issues related to key-value observing the `state` of an `NSURLSessionTask`. - * - * See: - * - https://github.com/AFNetworking/AFNetworking/issues/1477 - * - https://github.com/AFNetworking/AFNetworking/issues/2638 - * - https://github.com/AFNetworking/AFNetworking/pull/2702 - */ - -static inline void af_swizzleSelector(Class theClass, SEL originalSelector, SEL swizzledSelector) { - Method originalMethod = class_getInstanceMethod(theClass, originalSelector); - Method swizzledMethod = class_getInstanceMethod(theClass, swizzledSelector); - method_exchangeImplementations(originalMethod, swizzledMethod); -} - -static inline BOOL af_addMethod(Class theClass, SEL selector, Method method) { - return class_addMethod(theClass, selector, method_getImplementation(method), method_getTypeEncoding(method)); -} - -static NSString * const AFNSURLSessionTaskDidResumeNotification = @"com.alamofire.networking.nsurlsessiontask.resume"; -static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofire.networking.nsurlsessiontask.suspend"; - -@interface _AFURLSessionTaskSwizzling : NSObject - -@end - -@implementation _AFURLSessionTaskSwizzling - -+ (void)load { - /** - WARNING: Trouble Ahead - https://github.com/AFNetworking/AFNetworking/pull/2702 - */ - - if (NSClassFromString(@"NSURLSessionTask")) { - /** - iOS 7 and iOS 8 differ in NSURLSessionTask implementation, which makes the next bit of code a bit tricky. - Many Unit Tests have been built to validate as much of this behavior has possible. - Here is what we know: - - NSURLSessionTasks are implemented with class clusters, meaning the class you request from the API isn't actually the type of class you will get back. - - Simply referencing `[NSURLSessionTask class]` will not work. You need to ask an `NSURLSession` to actually create an object, and grab the class from there. - - On iOS 7, `localDataTask` is a `__NSCFLocalDataTask`, which inherits from `__NSCFLocalSessionTask`, which inherits from `__NSCFURLSessionTask`. - - On iOS 8, `localDataTask` is a `__NSCFLocalDataTask`, which inherits from `__NSCFLocalSessionTask`, which inherits from `NSURLSessionTask`. - - On iOS 7, `__NSCFLocalSessionTask` and `__NSCFURLSessionTask` are the only two classes that have their own implementations of `resume` and `suspend`, and `__NSCFLocalSessionTask` DOES NOT CALL SUPER. This means both classes need to be swizzled. - - On iOS 8, `NSURLSessionTask` is the only class that implements `resume` and `suspend`. This means this is the only class that needs to be swizzled. - - Because `NSURLSessionTask` is not involved in the class hierarchy for every version of iOS, its easier to add the swizzled methods to a dummy class and manage them there. - - Some Assumptions: - - No implementations of `resume` or `suspend` call super. If this were to change in a future version of iOS, we'd need to handle it. - - No background task classes override `resume` or `suspend` - - The current solution: - 1) Grab an instance of `__NSCFLocalDataTask` by asking an instance of `NSURLSession` for a data task. - 2) Grab a pointer to the original implementation of `af_resume` - 3) Check to see if the current class has an implementation of resume. If so, continue to step 4. - 4) Grab the super class of the current class. - 5) Grab a pointer for the current class to the current implementation of `resume`. - 6) Grab a pointer for the super class to the current implementation of `resume`. - 7) If the current class implementation of `resume` is not equal to the super class implementation of `resume` AND the current implementation of `resume` is not equal to the original implementation of `af_resume`, THEN swizzle the methods - 8) Set the current class to the super class, and repeat steps 3-8 - */ - NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration]; - NSURLSession * session = [NSURLSession sessionWithConfiguration:configuration]; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wnonnull" - NSURLSessionDataTask *localDataTask = [session dataTaskWithURL:nil]; -#pragma clang diagnostic pop - IMP originalAFResumeIMP = method_getImplementation(class_getInstanceMethod([self class], @selector(af_resume))); - Class currentClass = [localDataTask class]; - - while (class_getInstanceMethod(currentClass, @selector(resume))) { - Class superClass = [currentClass superclass]; - IMP classResumeIMP = method_getImplementation(class_getInstanceMethod(currentClass, @selector(resume))); - IMP superclassResumeIMP = method_getImplementation(class_getInstanceMethod(superClass, @selector(resume))); - if (classResumeIMP != superclassResumeIMP && - originalAFResumeIMP != classResumeIMP) { - [self swizzleResumeAndSuspendMethodForClass:currentClass]; - } - currentClass = [currentClass superclass]; - } - - [localDataTask cancel]; - [session finishTasksAndInvalidate]; - } -} - -+ (void)swizzleResumeAndSuspendMethodForClass:(Class)theClass { - Method afResumeMethod = class_getInstanceMethod(self, @selector(af_resume)); - Method afSuspendMethod = class_getInstanceMethod(self, @selector(af_suspend)); - - if (af_addMethod(theClass, @selector(af_resume), afResumeMethod)) { - af_swizzleSelector(theClass, @selector(resume), @selector(af_resume)); - } - - if (af_addMethod(theClass, @selector(af_suspend), afSuspendMethod)) { - af_swizzleSelector(theClass, @selector(suspend), @selector(af_suspend)); - } -} - -- (NSURLSessionTaskState)state { - NSAssert(NO, @"State method should never be called in the actual dummy class"); - return NSURLSessionTaskStateCanceling; -} - -- (void)af_resume { - NSAssert([self respondsToSelector:@selector(state)], @"Does not respond to state"); - NSURLSessionTaskState state = [self state]; - [self af_resume]; - - if (state != NSURLSessionTaskStateRunning) { - [[NSNotificationCenter defaultCenter] postNotificationName:AFNSURLSessionTaskDidResumeNotification object:self]; - } -} - -- (void)af_suspend { - NSAssert([self respondsToSelector:@selector(state)], @"Does not respond to state"); - NSURLSessionTaskState state = [self state]; - [self af_suspend]; - - if (state != NSURLSessionTaskStateSuspended) { - [[NSNotificationCenter defaultCenter] postNotificationName:AFNSURLSessionTaskDidSuspendNotification object:self]; - } -} -@end - -#pragma mark - - -@interface AFURLSessionManager () -@property (readwrite, nonatomic, strong) NSURLSessionConfiguration *sessionConfiguration; -@property (readwrite, nonatomic, strong) NSOperationQueue *operationQueue; -@property (readwrite, nonatomic, strong) NSURLSession *session; -@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableTaskDelegatesKeyedByTaskIdentifier; -@property (readonly, nonatomic, copy) NSString *taskDescriptionForSessionTasks; -@property (readwrite, nonatomic, strong) NSLock *lock; -@property (readwrite, nonatomic, copy) AFURLSessionDidBecomeInvalidBlock sessionDidBecomeInvalid; -@property (readwrite, nonatomic, copy) AFURLSessionDidReceiveAuthenticationChallengeBlock sessionDidReceiveAuthenticationChallenge; -@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession; -@property (readwrite, nonatomic, copy) AFURLSessionTaskWillPerformHTTPRedirectionBlock taskWillPerformHTTPRedirection; -@property (readwrite, nonatomic, copy) AFURLSessionTaskDidReceiveAuthenticationChallengeBlock taskDidReceiveAuthenticationChallenge; -@property (readwrite, nonatomic, copy) AFURLSessionTaskNeedNewBodyStreamBlock taskNeedNewBodyStream; -@property (readwrite, nonatomic, copy) AFURLSessionTaskDidSendBodyDataBlock taskDidSendBodyData; -@property (readwrite, nonatomic, copy) AFURLSessionTaskDidCompleteBlock taskDidComplete; -@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveResponseBlock dataTaskDidReceiveResponse; -@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidBecomeDownloadTaskBlock dataTaskDidBecomeDownloadTask; -@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveDataBlock dataTaskDidReceiveData; -@property (readwrite, nonatomic, copy) AFURLSessionDataTaskWillCacheResponseBlock dataTaskWillCacheResponse; -@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; -@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidWriteDataBlock downloadTaskDidWriteData; -@property (readwrite, nonatomic, copy) AFURLSessionDownloadTaskDidResumeBlock downloadTaskDidResume; -@end - -@implementation AFURLSessionManager - -- (instancetype)init { - return [self initWithSessionConfiguration:nil]; -} - -- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration { - self = [super init]; - if (!self) { - return nil; - } - - if (!configuration) { - configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; - } - - self.sessionConfiguration = configuration; - - self.operationQueue = [[NSOperationQueue alloc] init]; - self.operationQueue.maxConcurrentOperationCount = 1; - - self.session = [NSURLSession sessionWithConfiguration:self.sessionConfiguration delegate:self delegateQueue:self.operationQueue]; - - self.responseSerializer = [AFJSONResponseSerializer serializer]; - - self.securityPolicy = [AFSecurityPolicy defaultPolicy]; - -#if !TARGET_OS_WATCH - self.reachabilityManager = [AFNetworkReachabilityManager sharedManager]; -#endif - - self.mutableTaskDelegatesKeyedByTaskIdentifier = [[NSMutableDictionary alloc] init]; - - self.lock = [[NSLock alloc] init]; - self.lock.name = AFURLSessionManagerLockName; - - [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { - for (NSURLSessionDataTask *task in dataTasks) { - [self addDelegateForDataTask:task uploadProgress:nil downloadProgress:nil completionHandler:nil]; - } - - for (NSURLSessionUploadTask *uploadTask in uploadTasks) { - [self addDelegateForUploadTask:uploadTask progress:nil completionHandler:nil]; - } - - for (NSURLSessionDownloadTask *downloadTask in downloadTasks) { - [self addDelegateForDownloadTask:downloadTask progress:nil destination:nil completionHandler:nil]; - } - }]; - - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -#pragma mark - - -- (NSString *)taskDescriptionForSessionTasks { - return [NSString stringWithFormat:@"%p", self]; -} - -- (void)taskDidResume:(NSNotification *)notification { - NSURLSessionTask *task = notification.object; - if ([task respondsToSelector:@selector(taskDescription)]) { - if ([task.taskDescription isEqualToString:self.taskDescriptionForSessionTasks]) { - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidResumeNotification object:task]; - }); - } - } -} - -- (void)taskDidSuspend:(NSNotification *)notification { - NSURLSessionTask *task = notification.object; - if ([task respondsToSelector:@selector(taskDescription)]) { - if ([task.taskDescription isEqualToString:self.taskDescriptionForSessionTasks]) { - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidSuspendNotification object:task]; - }); - } - } -} - -#pragma mark - - -- (AFURLSessionManagerTaskDelegate *)delegateForTask:(NSURLSessionTask *)task { - NSParameterAssert(task); - - AFURLSessionManagerTaskDelegate *delegate = nil; - [self.lock lock]; - delegate = self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)]; - [self.lock unlock]; - - return delegate; -} - -- (void)setDelegate:(AFURLSessionManagerTaskDelegate *)delegate - forTask:(NSURLSessionTask *)task -{ - NSParameterAssert(task); - NSParameterAssert(delegate); - - [self.lock lock]; - self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)] = delegate; - [delegate setupProgressForTask:task]; - [self addNotificationObserverForTask:task]; - [self.lock unlock]; -} - -- (void)addDelegateForDataTask:(NSURLSessionDataTask *)dataTask - uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock - downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock - completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler -{ - AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; - delegate.manager = self; - delegate.completionHandler = completionHandler; - - dataTask.taskDescription = self.taskDescriptionForSessionTasks; - [self setDelegate:delegate forTask:dataTask]; - - delegate.uploadProgressBlock = uploadProgressBlock; - delegate.downloadProgressBlock = downloadProgressBlock; -} - -- (void)addDelegateForUploadTask:(NSURLSessionUploadTask *)uploadTask - progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock - completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler -{ - AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; - delegate.manager = self; - delegate.completionHandler = completionHandler; - - uploadTask.taskDescription = self.taskDescriptionForSessionTasks; - - [self setDelegate:delegate forTask:uploadTask]; - - delegate.uploadProgressBlock = uploadProgressBlock; -} - -- (void)addDelegateForDownloadTask:(NSURLSessionDownloadTask *)downloadTask - progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock - destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination - completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler -{ - AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init]; - delegate.manager = self; - delegate.completionHandler = completionHandler; - - if (destination) { - delegate.downloadTaskDidFinishDownloading = ^NSURL * (NSURLSession * __unused session, NSURLSessionDownloadTask *task, NSURL *location) { - return destination(location, task.response); - }; - } - - downloadTask.taskDescription = self.taskDescriptionForSessionTasks; - - [self setDelegate:delegate forTask:downloadTask]; - - delegate.downloadProgressBlock = downloadProgressBlock; -} - -- (void)removeDelegateForTask:(NSURLSessionTask *)task { - NSParameterAssert(task); - - AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task]; - [self.lock lock]; - [delegate cleanUpProgressForTask:task]; - [self removeNotificationObserverForTask:task]; - [self.mutableTaskDelegatesKeyedByTaskIdentifier removeObjectForKey:@(task.taskIdentifier)]; - [self.lock unlock]; -} - -#pragma mark - - -- (NSArray *)tasksForKeyPath:(NSString *)keyPath { - __block NSArray *tasks = nil; - dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); - [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { - if ([keyPath isEqualToString:NSStringFromSelector(@selector(dataTasks))]) { - tasks = dataTasks; - } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(uploadTasks))]) { - tasks = uploadTasks; - } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(downloadTasks))]) { - tasks = downloadTasks; - } else if ([keyPath isEqualToString:NSStringFromSelector(@selector(tasks))]) { - tasks = [@[dataTasks, uploadTasks, downloadTasks] valueForKeyPath:@"@unionOfArrays.self"]; - } - - dispatch_semaphore_signal(semaphore); - }]; - - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); - - return tasks; -} - -- (NSArray *)tasks { - return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; -} - -- (NSArray *)dataTasks { - return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; -} - -- (NSArray *)uploadTasks { - return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; -} - -- (NSArray *)downloadTasks { - return [self tasksForKeyPath:NSStringFromSelector(_cmd)]; -} - -#pragma mark - - -- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks { - dispatch_async(dispatch_get_main_queue(), ^{ - if (cancelPendingTasks) { - [self.session invalidateAndCancel]; - } else { - [self.session finishTasksAndInvalidate]; - } - }); -} - -#pragma mark - - -- (void)setResponseSerializer:(id )responseSerializer { - NSParameterAssert(responseSerializer); - - _responseSerializer = responseSerializer; -} - -#pragma mark - -- (void)addNotificationObserverForTask:(NSURLSessionTask *)task { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:task]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object:task]; -} - -- (void)removeNotificationObserverForTask:(NSURLSessionTask *)task { - [[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidSuspendNotification object:task]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidResumeNotification object:task]; -} - -#pragma mark - - -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request - completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler -{ - return [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:completionHandler]; -} - -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request - uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock - downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler { - - __block NSURLSessionDataTask *dataTask = nil; - url_session_manager_create_task_safely(^{ - dataTask = [self.session dataTaskWithRequest:request]; - }); - - [self addDelegateForDataTask:dataTask uploadProgress:uploadProgressBlock downloadProgress:downloadProgressBlock completionHandler:completionHandler]; - - return dataTask; -} - -#pragma mark - - -- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request - fromFile:(NSURL *)fileURL - progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock - completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler -{ - __block NSURLSessionUploadTask *uploadTask = nil; - url_session_manager_create_task_safely(^{ - uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; - }); - - if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) { - for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) { - uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; - } - } - - [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; - - return uploadTask; -} - -- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request - fromData:(NSData *)bodyData - progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock - completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler -{ - __block NSURLSessionUploadTask *uploadTask = nil; - url_session_manager_create_task_safely(^{ - uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData]; - }); - - [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; - - return uploadTask; -} - -- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request - progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock - completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler -{ - __block NSURLSessionUploadTask *uploadTask = nil; - url_session_manager_create_task_safely(^{ - uploadTask = [self.session uploadTaskWithStreamedRequest:request]; - }); - - [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; - - return uploadTask; -} - -#pragma mark - - -- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request - progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock - destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination - completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler -{ - __block NSURLSessionDownloadTask *downloadTask = nil; - url_session_manager_create_task_safely(^{ - downloadTask = [self.session downloadTaskWithRequest:request]; - }); - - [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; - - return downloadTask; -} - -- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData - progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock - destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination - completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler -{ - __block NSURLSessionDownloadTask *downloadTask = nil; - url_session_manager_create_task_safely(^{ - downloadTask = [self.session downloadTaskWithResumeData:resumeData]; - }); - - [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; - - return downloadTask; -} - -#pragma mark - -- (NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task { - return [[self delegateForTask:task] uploadProgress]; -} - -- (NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task { - return [[self delegateForTask:task] downloadProgress]; -} - -#pragma mark - - -- (void)setSessionDidBecomeInvalidBlock:(void (^)(NSURLSession *session, NSError *error))block { - self.sessionDidBecomeInvalid = block; -} - -- (void)setSessionDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block { - self.sessionDidReceiveAuthenticationChallenge = block; -} - -- (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block { - self.didFinishEventsForBackgroundURLSession = block; -} - -#pragma mark - - -- (void)setTaskNeedNewBodyStreamBlock:(NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block { - self.taskNeedNewBodyStream = block; -} - -- (void)setTaskWillPerformHTTPRedirectionBlock:(NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block { - self.taskWillPerformHTTPRedirection = block; -} - -- (void)setTaskDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block { - self.taskDidReceiveAuthenticationChallenge = block; -} - -- (void)setTaskDidSendBodyDataBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block { - self.taskDidSendBodyData = block; -} - -- (void)setTaskDidCompleteBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, NSError *error))block { - self.taskDidComplete = block; -} - -#pragma mark - - -- (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block { - self.dataTaskDidReceiveResponse = block; -} - -- (void)setDataTaskDidBecomeDownloadTaskBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block { - self.dataTaskDidBecomeDownloadTask = block; -} - -- (void)setDataTaskDidReceiveDataBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block { - self.dataTaskDidReceiveData = block; -} - -- (void)setDataTaskWillCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block { - self.dataTaskWillCacheResponse = block; -} - -#pragma mark - - -- (void)setDownloadTaskDidFinishDownloadingBlock:(NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block { - self.downloadTaskDidFinishDownloading = block; -} - -- (void)setDownloadTaskDidWriteDataBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block { - self.downloadTaskDidWriteData = block; -} - -- (void)setDownloadTaskDidResumeBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block { - self.downloadTaskDidResume = block; -} - -#pragma mark - NSObject - -- (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, self.session, self.operationQueue]; -} - -- (BOOL)respondsToSelector:(SEL)selector { - if (selector == @selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)) { - return self.taskWillPerformHTTPRedirection != nil; - } else if (selector == @selector(URLSession:dataTask:didReceiveResponse:completionHandler:)) { - return self.dataTaskDidReceiveResponse != nil; - } else if (selector == @selector(URLSession:dataTask:willCacheResponse:completionHandler:)) { - return self.dataTaskWillCacheResponse != nil; - } else if (selector == @selector(URLSessionDidFinishEventsForBackgroundURLSession:)) { - return self.didFinishEventsForBackgroundURLSession != nil; - } - - return [[self class] instancesRespondToSelector:selector]; -} - -#pragma mark - NSURLSessionDelegate - -- (void)URLSession:(NSURLSession *)session -didBecomeInvalidWithError:(NSError *)error -{ - if (self.sessionDidBecomeInvalid) { - self.sessionDidBecomeInvalid(session, error); - } - - [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDidInvalidateNotification object:session]; -} - -- (void)URLSession:(NSURLSession *)session -didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge - completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler -{ - NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; - __block NSURLCredential *credential = nil; - - if (self.sessionDidReceiveAuthenticationChallenge) { - disposition = self.sessionDidReceiveAuthenticationChallenge(session, challenge, &credential); - } else { - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { - credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; - if (credential) { - disposition = NSURLSessionAuthChallengeUseCredential; - } else { - disposition = NSURLSessionAuthChallengePerformDefaultHandling; - } - } else { - disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; - } - } else { - disposition = NSURLSessionAuthChallengePerformDefaultHandling; - } - } - - if (completionHandler) { - completionHandler(disposition, credential); - } -} - -#pragma mark - NSURLSessionTaskDelegate - -- (void)URLSession:(NSURLSession *)session - task:(NSURLSessionTask *)task -willPerformHTTPRedirection:(NSHTTPURLResponse *)response - newRequest:(NSURLRequest *)request - completionHandler:(void (^)(NSURLRequest *))completionHandler -{ - NSURLRequest *redirectRequest = request; - - if (self.taskWillPerformHTTPRedirection) { - redirectRequest = self.taskWillPerformHTTPRedirection(session, task, response, request); - } - - if (completionHandler) { - completionHandler(redirectRequest); - } -} - -- (void)URLSession:(NSURLSession *)session - task:(NSURLSessionTask *)task -didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge - completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler -{ - NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; - __block NSURLCredential *credential = nil; - - if (self.taskDidReceiveAuthenticationChallenge) { - disposition = self.taskDidReceiveAuthenticationChallenge(session, task, challenge, &credential); - } else { - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { - disposition = NSURLSessionAuthChallengeUseCredential; - credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; - } else { - disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; - } - } else { - disposition = NSURLSessionAuthChallengePerformDefaultHandling; - } - } - - if (completionHandler) { - completionHandler(disposition, credential); - } -} - -- (void)URLSession:(NSURLSession *)session - task:(NSURLSessionTask *)task - needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler -{ - NSInputStream *inputStream = nil; - - if (self.taskNeedNewBodyStream) { - inputStream = self.taskNeedNewBodyStream(session, task); - } else if (task.originalRequest.HTTPBodyStream && [task.originalRequest.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) { - inputStream = [task.originalRequest.HTTPBodyStream copy]; - } - - if (completionHandler) { - completionHandler(inputStream); - } -} - -- (void)URLSession:(NSURLSession *)session - task:(NSURLSessionTask *)task - didSendBodyData:(int64_t)bytesSent - totalBytesSent:(int64_t)totalBytesSent -totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend -{ - - int64_t totalUnitCount = totalBytesExpectedToSend; - if(totalUnitCount == NSURLSessionTransferSizeUnknown) { - NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"]; - if(contentLength) { - totalUnitCount = (int64_t) [contentLength longLongValue]; - } - } - - if (self.taskDidSendBodyData) { - self.taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalUnitCount); - } -} - -- (void)URLSession:(NSURLSession *)session - task:(NSURLSessionTask *)task -didCompleteWithError:(NSError *)error -{ - AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task]; - - // delegate may be nil when completing a task in the background - if (delegate) { - [delegate URLSession:session task:task didCompleteWithError:error]; - - [self removeDelegateForTask:task]; - } - - if (self.taskDidComplete) { - self.taskDidComplete(session, task, error); - } -} - -#pragma mark - NSURLSessionDataDelegate - -- (void)URLSession:(NSURLSession *)session - dataTask:(NSURLSessionDataTask *)dataTask -didReceiveResponse:(NSURLResponse *)response - completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler -{ - NSURLSessionResponseDisposition disposition = NSURLSessionResponseAllow; - - if (self.dataTaskDidReceiveResponse) { - disposition = self.dataTaskDidReceiveResponse(session, dataTask, response); - } - - if (completionHandler) { - completionHandler(disposition); - } -} - -- (void)URLSession:(NSURLSession *)session - dataTask:(NSURLSessionDataTask *)dataTask -didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask -{ - AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask]; - if (delegate) { - [self removeDelegateForTask:dataTask]; - [self setDelegate:delegate forTask:downloadTask]; - } - - if (self.dataTaskDidBecomeDownloadTask) { - self.dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask); - } -} - -- (void)URLSession:(NSURLSession *)session - dataTask:(NSURLSessionDataTask *)dataTask - didReceiveData:(NSData *)data -{ - - AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask]; - [delegate URLSession:session dataTask:dataTask didReceiveData:data]; - - if (self.dataTaskDidReceiveData) { - self.dataTaskDidReceiveData(session, dataTask, data); - } -} - -- (void)URLSession:(NSURLSession *)session - dataTask:(NSURLSessionDataTask *)dataTask - willCacheResponse:(NSCachedURLResponse *)proposedResponse - completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler -{ - NSCachedURLResponse *cachedResponse = proposedResponse; - - if (self.dataTaskWillCacheResponse) { - cachedResponse = self.dataTaskWillCacheResponse(session, dataTask, proposedResponse); - } - - if (completionHandler) { - completionHandler(cachedResponse); - } -} - -- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session { - if (self.didFinishEventsForBackgroundURLSession) { - dispatch_async(dispatch_get_main_queue(), ^{ - self.didFinishEventsForBackgroundURLSession(session); - }); - } -} - -#pragma mark - NSURLSessionDownloadDelegate - -- (void)URLSession:(NSURLSession *)session - downloadTask:(NSURLSessionDownloadTask *)downloadTask -didFinishDownloadingToURL:(NSURL *)location -{ - AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask]; - if (self.downloadTaskDidFinishDownloading) { - NSURL *fileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location); - if (fileURL) { - delegate.downloadFileURL = fileURL; - NSError *error = nil; - [[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error]; - if (error) { - [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo]; - } - - return; - } - } - - if (delegate) { - [delegate URLSession:session downloadTask:downloadTask didFinishDownloadingToURL:location]; - } -} - -- (void)URLSession:(NSURLSession *)session - downloadTask:(NSURLSessionDownloadTask *)downloadTask - didWriteData:(int64_t)bytesWritten - totalBytesWritten:(int64_t)totalBytesWritten -totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite -{ - if (self.downloadTaskDidWriteData) { - self.downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); - } -} - -- (void)URLSession:(NSURLSession *)session - downloadTask:(NSURLSessionDownloadTask *)downloadTask - didResumeAtOffset:(int64_t)fileOffset -expectedTotalBytes:(int64_t)expectedTotalBytes -{ - if (self.downloadTaskDidResume) { - self.downloadTaskDidResume(session, downloadTask, fileOffset, expectedTotalBytes); - } -} - -#pragma mark - NSSecureCoding - -+ (BOOL)supportsSecureCoding { - return YES; -} - -- (instancetype)initWithCoder:(NSCoder *)decoder { - NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"]; - - self = [self initWithSessionConfiguration:configuration]; - if (!self) { - return nil; - } - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"]; -} - -#pragma mark - NSCopying - -- (instancetype)copyWithZone:(NSZone *)zone { - return [[[self class] allocWithZone:zone] initWithSessionConfiguration:self.session.configuration]; -} - -@end diff --git a/iOSProject/Pods/AFNetworking/LICENSE b/iOSProject/Pods/AFNetworking/LICENSE deleted file mode 100644 index 3fbc2c9a..00000000 --- a/iOSProject/Pods/AFNetworking/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/iOSProject/Pods/AFNetworking/README.md b/iOSProject/Pods/AFNetworking/README.md deleted file mode 100644 index 53cb2024..00000000 --- a/iOSProject/Pods/AFNetworking/README.md +++ /dev/null @@ -1,320 +0,0 @@ -

    - AFNetworking -

    - -[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/AFNetworking) -[![codecov.io](https://codecov.io/github/AFNetworking/AFNetworking/coverage.svg?branch=master)](https://codecov.io/github/AFNetworking/AFNetworking?branch=master) -[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AFNetworking.svg)](https://img.shields.io/cocoapods/v/AFNetworking.svg) -[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Platform](https://img.shields.io/cocoapods/p/AFNetworking.svg?style=flat)](http://cocoadocs.org/docsets/AFNetworking) -[![Twitter](https://img.shields.io/badge/twitter-@AFNetworking-blue.svg?style=flat)](http://twitter.com/AFNetworking) - -AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of the [Foundation URL Loading System](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use. - -Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac. - -Choose AFNetworking for your next project, or migrate over your existing projects—you'll be happy you did! - -## How To Get Started - -- [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps -- Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki) -- Check out the [documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at all of the APIs available in AFNetworking -- Read the [AFNetworking 3.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide) for an overview of the architectural changes from 2.0. - -## Communication - -- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking). (Tag 'afnetworking') -- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking). -- If you **found a bug**, _and can provide steps to reliably reproduce it_, open an issue. -- If you **have a feature request**, open an issue. -- If you **want to contribute**, submit a pull request. - -## Installation -AFNetworking supports multiple methods for installing the library in a project. - -## Installation with CocoaPods - -[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking). You can install it with the following command: - -```bash -$ gem install cocoapods -``` - -> CocoaPods 0.39.0+ is required to build AFNetworking 3.0.0+. - -#### Podfile - -To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`: - -```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' - -pod 'AFNetworking', '~> 3.0' -``` - -Then, run the following command: - -```bash -$ pod install -``` - -### Installation with Carthage - -[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. - -You can install Carthage with [Homebrew](http://brew.sh/) using the following command: - -```bash -$ brew update -$ brew install carthage -``` - -To integrate AFNetworking into your Xcode project using Carthage, specify it in your `Cartfile`: - -```ogdl -github "AFNetworking/AFNetworking" ~> 3.0 -``` - -Run `carthage` to build the framework and drag the built `AFNetworking.framework` into your Xcode project. - -## Requirements - -| AFNetworking Version | Minimum iOS Target | Minimum OS X Target | Minimum watchOS Target | Minimum tvOS Target | Notes | -|:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:| -| 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. | -| 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. | -| 2.0 -> 2.5.4 | iOS 6 | OS X 10.8 | n/a | n/a | Xcode 5+ is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. | -| 1.x | iOS 5 | Mac OS X 10.7 | n/a | n/a | -| 0.10.x | iOS 4 | Mac OS X 10.6 | n/a | n/a | - -(OS X projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)). - -> Programming in Swift? Try [Alamofire](https://github.com/Alamofire/Alamofire) for a more conventional set of APIs. - -## Architecture - -### NSURLSession - -- `AFURLSessionManager` -- `AFHTTPSessionManager` - -### Serialization - -* `` - - `AFHTTPRequestSerializer` - - `AFJSONRequestSerializer` - - `AFPropertyListRequestSerializer` -* `` - - `AFHTTPResponseSerializer` - - `AFJSONResponseSerializer` - - `AFXMLParserResponseSerializer` - - `AFXMLDocumentResponseSerializer` _(Mac OS X)_ - - `AFPropertyListResponseSerializer` - - `AFImageResponseSerializer` - - `AFCompoundResponseSerializer` - -### Additional Functionality - -- `AFSecurityPolicy` -- `AFNetworkReachabilityManager` - -## Usage - -### AFURLSessionManager - -`AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to ``, ``, ``, and ``. - -#### Creating a Download Task - -```objective-c -NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; -AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; - -NSURL *URL = [NSURL URLWithString:@"http://example.com/download.zip"]; -NSURLRequest *request = [NSURLRequest requestWithURL:URL]; - -NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) { - NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; - return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]]; -} completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) { - NSLog(@"File downloaded to: %@", filePath); -}]; -[downloadTask resume]; -``` - -#### Creating an Upload Task - -```objective-c -NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; -AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; - -NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"]; -NSURLRequest *request = [NSURLRequest requestWithURL:URL]; - -NSURL *filePath = [NSURL fileURLWithPath:@"file://path/to/image.png"]; -NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithRequest:request fromFile:filePath progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - if (error) { - NSLog(@"Error: %@", error); - } else { - NSLog(@"Success: %@ %@", response, responseObject); - } -}]; -[uploadTask resume]; -``` - -#### Creating an Upload Task for a Multi-Part Request, with Progress - -```objective-c -NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id formData) { - [formData appendPartWithFileURL:[NSURL fileURLWithPath:@"file://path/to/image.jpg"] name:@"file" fileName:@"filename.jpg" mimeType:@"image/jpeg" error:nil]; - } error:nil]; - -AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; - -NSURLSessionUploadTask *uploadTask; -uploadTask = [manager - uploadTaskWithStreamedRequest:request - progress:^(NSProgress * _Nonnull uploadProgress) { - // This is not called back on the main queue. - // You are responsible for dispatching to the main queue for UI updates - dispatch_async(dispatch_get_main_queue(), ^{ - //Update the progress view - [progressView setProgress:uploadProgress.fractionCompleted]; - }); - } - completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { - if (error) { - NSLog(@"Error: %@", error); - } else { - NSLog(@"%@ %@", response, responseObject); - } - }]; - -[uploadTask resume]; -``` - -#### Creating a Data Task - -```objective-c -NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; -AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; - -NSURL *URL = [NSURL URLWithString:@"http://httpbin.org/get"]; -NSURLRequest *request = [NSURLRequest requestWithURL:URL]; - -NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - if (error) { - NSLog(@"Error: %@", error); - } else { - NSLog(@"%@ %@", response, responseObject); - } -}]; -[dataTask resume]; -``` - ---- - -### Request Serialization - -Request serializers create requests from URL strings, encoding parameters as either a query string or HTTP body. - -```objective-c -NSString *URLString = @"http://example.com/"; -NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]}; -``` - -#### Query String Parameter Encoding - -```objective-c -[[AFHTTPRequestSerializer serializer] requestWithMethod:@"GET" URLString:URLString parameters:parameters error:nil]; -``` - - GET http://example.com?foo=bar&baz[]=1&baz[]=2&baz[]=3 - -#### URL Form Parameter Encoding - -```objective-c -[[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters error:nil]; -``` - - POST http://example.com/ - Content-Type: application/x-www-form-urlencoded - - foo=bar&baz[]=1&baz[]=2&baz[]=3 - -#### JSON Parameter Encoding - -```objective-c -[[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters error:nil]; -``` - - POST http://example.com/ - Content-Type: application/json - - {"foo": "bar", "baz": [1,2,3]} - ---- - -### Network Reachability Manager - -`AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. - -* Do not use Reachability to determine if the original request should be sent. - * You should try to send it. -* You can use Reachability to determine when a request should be automatically retried. - * Although it may still fail, a Reachability notification that the connectivity is available is a good time to retry something. -* Network reachability is a useful tool for determining why a request might have failed. - * After a network request has failed, telling the user they're offline is better than giving them a more technical but accurate error, such as "request timed out." - -See also [WWDC 2012 session 706, "Networking Best Practices."](https://developer.apple.com/videos/play/wwdc2012-706/). - -#### Shared Network Reachability - -```objective-c -[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { - NSLog(@"Reachability: %@", AFStringFromNetworkReachabilityStatus(status)); -}]; - -[[AFNetworkReachabilityManager sharedManager] startMonitoring]; -``` - ---- - -### Security Policy - -`AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. - -Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. - -#### Allowing Invalid SSL Certificates - -```objective-c -AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; -manager.securityPolicy.allowInvalidCertificates = YES; // not recommended for production -``` - ---- - -## Unit Tests - -AFNetworking includes a suite of unit tests within the Tests subdirectory. These tests can be run simply be executed the test action on the platform framework you would like to test. - -## Credits - -AFNetworking is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). - -AFNetworking was originally created by [Scott Raymond](https://github.com/sco/) and [Mattt Thompson](https://github.com/mattt/) in the development of [Gowalla for iPhone](http://en.wikipedia.org/wiki/Gowalla). - -AFNetworking's logo was designed by [Alan Defibaugh](http://www.alandefibaugh.com/). - -And most of all, thanks to AFNetworking's [growing list of contributors](https://github.com/AFNetworking/AFNetworking/contributors). - -### Security Disclosure - -If you believe you have identified a security vulnerability with AFNetworking, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. - -## License - -AFNetworking is released under the MIT license. See LICENSE for details. diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h deleted file mode 100644 index 9bdc15cc..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h +++ /dev/null @@ -1,149 +0,0 @@ -// AFAutoPurgingImageCache.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import - -#if TARGET_OS_IOS || TARGET_OS_TV -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously. - */ -@protocol AFImageCache - -/** - Adds the image to the cache with the given identifier. - - @param image The image to cache. - @param identifier The unique identifier for the image in the cache. - */ -- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier; - -/** - Removes the image from the cache matching the given identifier. - - @param identifier The unique identifier for the image in the cache. - - @return A BOOL indicating whether or not the image was removed from the cache. - */ -- (BOOL)removeImageWithIdentifier:(NSString *)identifier; - -/** - Removes all images from the cache. - - @return A BOOL indicating whether or not all images were removed from the cache. - */ -- (BOOL)removeAllImages; - -/** - Returns the image in the cache associated with the given identifier. - - @param identifier The unique identifier for the image in the cache. - - @return An image for the matching identifier, or nil. - */ -- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier; -@end - - -/** - The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier. - */ -@protocol AFImageRequestCache - -/** - Adds the image to the cache using an identifier created from the request and additional identifier. - - @param image The image to cache. - @param request The unique URL request identifing the image asset. - @param identifier The additional identifier to apply to the URL request to identify the image. - */ -- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; - -/** - Removes the image from the cache using an identifier created from the request and additional identifier. - - @param request The unique URL request identifing the image asset. - @param identifier The additional identifier to apply to the URL request to identify the image. - - @return A BOOL indicating whether or not all images were removed from the cache. - */ -- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; - -/** - Returns the image from the cache associated with an identifier created from the request and additional identifier. - - @param request The unique URL request identifing the image asset. - @param identifier The additional identifier to apply to the URL request to identify the image. - - @return An image for the matching request and identifier, or nil. - */ -- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; - -@end - -/** - The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated. - */ -@interface AFAutoPurgingImageCache : NSObject - -/** - The total memory capacity of the cache in bytes. - */ -@property (nonatomic, assign) UInt64 memoryCapacity; - -/** - The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit. - */ -@property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge; - -/** - The current total memory usage in bytes of all images stored within the cache. - */ -@property (nonatomic, assign, readonly) UInt64 memoryUsage; - -/** - Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`. - - @return The new `AutoPurgingImageCache` instance. - */ -- (instancetype)init; - -/** - Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage - after purge limit. - - @param memoryCapacity The total memory capacity of the cache in bytes. - @param preferredMemoryCapacity The preferred memory usage after purge in bytes. - - @return The new `AutoPurgingImageCache` instance. - */ -- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity; - -@end - -NS_ASSUME_NONNULL_END - -#endif - diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m deleted file mode 100644 index 1f40715c..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m +++ /dev/null @@ -1,201 +0,0 @@ -// AFAutoPurgingImageCache.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import "AFAutoPurgingImageCache.h" - -@interface AFCachedImage : NSObject - -@property (nonatomic, strong) UIImage *image; -@property (nonatomic, strong) NSString *identifier; -@property (nonatomic, assign) UInt64 totalBytes; -@property (nonatomic, strong) NSDate *lastAccessDate; -@property (nonatomic, assign) UInt64 currentMemoryUsage; - -@end - -@implementation AFCachedImage - --(instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier { - if (self = [self init]) { - self.image = image; - self.identifier = identifier; - - CGSize imageSize = CGSizeMake(image.size.width * image.scale, image.size.height * image.scale); - CGFloat bytesPerPixel = 4.0; - CGFloat bytesPerSize = imageSize.width * imageSize.height; - self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerSize; - self.lastAccessDate = [NSDate date]; - } - return self; -} - -- (UIImage*)accessImage { - self.lastAccessDate = [NSDate date]; - return self.image; -} - -- (NSString *)description { - NSString *descriptionString = [NSString stringWithFormat:@"Idenfitier: %@ lastAccessDate: %@ ", self.identifier, self.lastAccessDate]; - return descriptionString; - -} - -@end - -@interface AFAutoPurgingImageCache () -@property (nonatomic, strong) NSMutableDictionary *cachedImages; -@property (nonatomic, assign) UInt64 currentMemoryUsage; -@property (nonatomic, strong) dispatch_queue_t synchronizationQueue; -@end - -@implementation AFAutoPurgingImageCache - -- (instancetype)init { - return [self initWithMemoryCapacity:100 * 1024 * 1024 preferredMemoryCapacity:60 * 1024 * 1024]; -} - -- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity { - if (self = [super init]) { - self.memoryCapacity = memoryCapacity; - self.preferredMemoryUsageAfterPurge = preferredMemoryCapacity; - self.cachedImages = [[NSMutableDictionary alloc] init]; - - NSString *queueName = [NSString stringWithFormat:@"com.alamofire.autopurgingimagecache-%@", [[NSUUID UUID] UUIDString]]; - self.synchronizationQueue = dispatch_queue_create([queueName cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT); - - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(removeAllImages) - name:UIApplicationDidReceiveMemoryWarningNotification - object:nil]; - - } - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (UInt64)memoryUsage { - __block UInt64 result = 0; - dispatch_sync(self.synchronizationQueue, ^{ - result = self.currentMemoryUsage; - }); - return result; -} - -- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier { - dispatch_barrier_async(self.synchronizationQueue, ^{ - AFCachedImage *cacheImage = [[AFCachedImage alloc] initWithImage:image identifier:identifier]; - - AFCachedImage *previousCachedImage = self.cachedImages[identifier]; - if (previousCachedImage != nil) { - self.currentMemoryUsage -= previousCachedImage.totalBytes; - } - - self.cachedImages[identifier] = cacheImage; - self.currentMemoryUsage += cacheImage.totalBytes; - }); - - dispatch_barrier_async(self.synchronizationQueue, ^{ - if (self.currentMemoryUsage > self.memoryCapacity) { - UInt64 bytesToPurge = self.currentMemoryUsage - self.preferredMemoryUsageAfterPurge; - NSMutableArray *sortedImages = [NSMutableArray arrayWithArray:self.cachedImages.allValues]; - NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastAccessDate" - ascending:YES]; - [sortedImages sortUsingDescriptors:@[sortDescriptor]]; - - UInt64 bytesPurged = 0; - - for (AFCachedImage *cachedImage in sortedImages) { - [self.cachedImages removeObjectForKey:cachedImage.identifier]; - bytesPurged += cachedImage.totalBytes; - if (bytesPurged >= bytesToPurge) { - break ; - } - } - self.currentMemoryUsage -= bytesPurged; - } - }); -} - -- (BOOL)removeImageWithIdentifier:(NSString *)identifier { - __block BOOL removed = NO; - dispatch_barrier_sync(self.synchronizationQueue, ^{ - AFCachedImage *cachedImage = self.cachedImages[identifier]; - if (cachedImage != nil) { - [self.cachedImages removeObjectForKey:identifier]; - self.currentMemoryUsage -= cachedImage.totalBytes; - removed = YES; - } - }); - return removed; -} - -- (BOOL)removeAllImages { - __block BOOL removed = NO; - dispatch_barrier_sync(self.synchronizationQueue, ^{ - if (self.cachedImages.count > 0) { - [self.cachedImages removeAllObjects]; - self.currentMemoryUsage = 0; - removed = YES; - } - }); - return removed; -} - -- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier { - __block UIImage *image = nil; - dispatch_sync(self.synchronizationQueue, ^{ - AFCachedImage *cachedImage = self.cachedImages[identifier]; - image = [cachedImage accessImage]; - }); - return image; -} - -- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { - [self addImage:image withIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; -} - -- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { - return [self removeImageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; -} - -- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { - return [self imageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]]; -} - -- (NSString *)imageCacheKeyFromURLRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)additionalIdentifier { - NSString *key = request.URL.absoluteString; - if (additionalIdentifier != nil) { - key = [key stringByAppendingString:additionalIdentifier]; - } - return key; -} - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h deleted file mode 100644 index 3903eec2..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h +++ /dev/null @@ -1,157 +0,0 @@ -// AFImageDownloader.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import -#import "AFAutoPurgingImageCache.h" -#import "AFHTTPSessionManager.h" - -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { - AFImageDownloadPrioritizationFIFO, - AFImageDownloadPrioritizationLIFO -}; - -/** - The `AFImageDownloadReceipt` is an object vended by the `AFImageDownloader` when starting a data task. It can be used to cancel active tasks running on the `AFImageDownloader` session. As a general rule, image data tasks should be cancelled using the `AFImageDownloadReceipt` instead of calling `cancel` directly on the `task` itself. The `AFImageDownloader` is optimized to handle duplicate task scenarios as well as pending versus active downloads. - */ -@interface AFImageDownloadReceipt : NSObject - -/** - The data task created by the `AFImageDownloader`. -*/ -@property (nonatomic, strong) NSURLSessionDataTask *task; - -/** - The unique identifier for the success and failure blocks when duplicate requests are made. - */ -@property (nonatomic, strong) NSUUID *receiptID; -@end - -/** The `AFImageDownloader` class is responsible for downloading images in parallel on a prioritized queue. Incoming downloads are added to the front or back of the queue depending on the download prioritization. Each downloaded image is cached in the underlying `NSURLCache` as well as the in-memory image cache. By default, any download request with a cached image equivalent in the image cache will automatically be served the cached image representation. - */ -@interface AFImageDownloader : NSObject - -/** - The image cache used to store all downloaded images in. `AFAutoPurgingImageCache` by default. - */ -@property (nonatomic, strong, nullable) id imageCache; - -/** - The `AFHTTPSessionManager` used to download images. By default, this is configured with an `AFImageResponseSerializer`, and a shared `NSURLCache` for all image downloads. - */ -@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; - -/** - Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default. - */ -@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritizaton; - -/** - The shared default instance of `AFImageDownloader` initialized with default values. - */ -+ (instancetype)defaultInstance; - -/** - Creates a default `NSURLCache` with common usage parameter values. - - @returns The default `NSURLCache` instance. - */ -+ (NSURLCache *)defaultURLCache; - -/** - Default initializer - - @return An instance of `AFImageDownloader` initialized with default values. - */ -- (instancetype)init; - -/** - Initializes the `AFImageDownloader` instance with the given session manager, download prioritization, maximum active download count and image cache. - - @param sessionManager The session manager to use to download images. - @param downloadPrioritization The download prioritization of the download queue. - @param maximumActiveDownloads The maximum number of active downloads allowed at any given time. Recommend `4`. - @param imageCache The image cache used to store all downloaded images in. - - @return The new `AFImageDownloader` instance. - */ -- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager - downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization - maximumActiveDownloads:(NSInteger)maximumActiveDownloads - imageCache:(nullable id )imageCache; - -/** - Creates a data task using the `sessionManager` instance for the specified URL request. - - If the same data task is already in the queue or currently being downloaded, the success and failure blocks are - appended to the already existing task. Once the task completes, all success or failure blocks attached to the - task are executed in the order they were added. - - @param request The URL request. - @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. - @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. - - @return The image download receipt for the data task if available. `nil` if the image is stored in the cache. - cache and the URL request cache policy allows the cache to be used. - */ -- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; - -/** - Creates a data task using the `sessionManager` instance for the specified URL request. - - If the same data task is already in the queue or currently being downloaded, the success and failure blocks are - appended to the already existing task. Once the task completes, all success or failure blocks attached to the - task are executed in the order they were added. - - @param request The URL request. - @param receiptID The identifier to use for the download receipt that will be created for this request. This must be a unique identifier that does not represent any other request. - @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. - @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. - - @return The image download receipt for the data task if available. `nil` if the image is stored in the cache. - cache and the URL request cache policy allows the cache to be used. - */ -- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request - withReceiptID:(NSUUID *)receiptID - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; - -/** - Cancels the data task in the receipt by removing the corresponding success and failure blocks and cancelling the data task if necessary. - - If the data task is pending in the queue, it will be cancelled if no other success and failure blocks are registered with the data task. If the data task is currently executing or is already completed, the success and failure blocks are removed and will not be called when the task finishes. - - @param imageDownloadReceipt The image download receipt to cancel. - */ -- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt; - -@end - -#endif - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m deleted file mode 100644 index 78477bf6..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m +++ /dev/null @@ -1,391 +0,0 @@ -// AFImageDownloader.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import "AFImageDownloader.h" -#import "AFHTTPSessionManager.h" - -@interface AFImageDownloaderResponseHandler : NSObject -@property (nonatomic, strong) NSUUID *uuid; -@property (nonatomic, copy) void (^successBlock)(NSURLRequest*, NSHTTPURLResponse*, UIImage*); -@property (nonatomic, copy) void (^failureBlock)(NSURLRequest*, NSHTTPURLResponse*, NSError*); -@end - -@implementation AFImageDownloaderResponseHandler - -- (instancetype)initWithUUID:(NSUUID *)uuid - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure { - if (self = [self init]) { - self.uuid = uuid; - self.successBlock = success; - self.failureBlock = failure; - } - return self; -} - -- (NSString *)description { - return [NSString stringWithFormat: @"UUID: %@", [self.uuid UUIDString]]; -} - -@end - -@interface AFImageDownloaderMergedTask : NSObject -@property (nonatomic, strong) NSString *URLIdentifier; -@property (nonatomic, strong) NSUUID *identifier; -@property (nonatomic, strong) NSURLSessionDataTask *task; -@property (nonatomic, strong) NSMutableArray *responseHandlers; - -@end - -@implementation AFImageDownloaderMergedTask - -- (instancetype)initWithURLIdentifier:(NSString *)URLIdentifier identifier:(NSUUID *)identifier task:(NSURLSessionDataTask *)task { - if (self = [self init]) { - self.URLIdentifier = URLIdentifier; - self.task = task; - self.identifier = identifier; - self.responseHandlers = [[NSMutableArray alloc] init]; - } - return self; -} - -- (void)addResponseHandler:(AFImageDownloaderResponseHandler*)handler { - [self.responseHandlers addObject:handler]; -} - -- (void)removeResponseHandler:(AFImageDownloaderResponseHandler*)handler { - [self.responseHandlers removeObject:handler]; -} - -@end - -@implementation AFImageDownloadReceipt - -- (instancetype)initWithReceiptID:(NSUUID *)receiptID task:(NSURLSessionDataTask *)task { - if (self = [self init]) { - self.receiptID = receiptID; - self.task = task; - } - return self; -} - -@end - -@interface AFImageDownloader () - -@property (nonatomic, strong) dispatch_queue_t synchronizationQueue; -@property (nonatomic, strong) dispatch_queue_t responseQueue; - -@property (nonatomic, assign) NSInteger maximumActiveDownloads; -@property (nonatomic, assign) NSInteger activeRequestCount; - -@property (nonatomic, strong) NSMutableArray *queuedMergedTasks; -@property (nonatomic, strong) NSMutableDictionary *mergedTasks; - -@end - - -@implementation AFImageDownloader - -+ (NSURLCache *)defaultURLCache { - return [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024 - diskCapacity:150 * 1024 * 1024 - diskPath:@"com.alamofire.imagedownloader"]; -} - -+ (NSURLSessionConfiguration *)defaultURLSessionConfiguration { - NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; - - //TODO set the default HTTP headers - - configuration.HTTPShouldSetCookies = YES; - configuration.HTTPShouldUsePipelining = NO; - - configuration.requestCachePolicy = NSURLRequestUseProtocolCachePolicy; - configuration.allowsCellularAccess = YES; - configuration.timeoutIntervalForRequest = 60.0; - configuration.URLCache = [AFImageDownloader defaultURLCache]; - - return configuration; -} - -- (instancetype)init { - NSURLSessionConfiguration *defaultConfiguration = [self.class defaultURLSessionConfiguration]; - AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:defaultConfiguration]; - sessionManager.responseSerializer = [AFImageResponseSerializer serializer]; - - return [self initWithSessionManager:sessionManager - downloadPrioritization:AFImageDownloadPrioritizationFIFO - maximumActiveDownloads:4 - imageCache:[[AFAutoPurgingImageCache alloc] init]]; -} - -- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager - downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization - maximumActiveDownloads:(NSInteger)maximumActiveDownloads - imageCache:(id )imageCache { - if (self = [super init]) { - self.sessionManager = sessionManager; - - self.downloadPrioritizaton = downloadPrioritization; - self.maximumActiveDownloads = maximumActiveDownloads; - self.imageCache = imageCache; - - self.queuedMergedTasks = [[NSMutableArray alloc] init]; - self.mergedTasks = [[NSMutableDictionary alloc] init]; - self.activeRequestCount = 0; - - NSString *name = [NSString stringWithFormat:@"com.alamofire.imagedownloader.synchronizationqueue-%@", [[NSUUID UUID] UUIDString]]; - self.synchronizationQueue = dispatch_queue_create([name cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_SERIAL); - - name = [NSString stringWithFormat:@"com.alamofire.imagedownloader.responsequeue-%@", [[NSUUID UUID] UUIDString]]; - self.responseQueue = dispatch_queue_create([name cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT); - } - - return self; -} - -+ (instancetype)defaultInstance { - static AFImageDownloader *sharedInstance = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedInstance = [[self alloc] init]; - }); - return sharedInstance; -} - -- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request - success:(void (^)(NSURLRequest * _Nonnull, NSHTTPURLResponse * _Nullable, UIImage * _Nonnull))success - failure:(void (^)(NSURLRequest * _Nonnull, NSHTTPURLResponse * _Nullable, NSError * _Nonnull))failure { - return [self downloadImageForURLRequest:request withReceiptID:[NSUUID UUID] success:success failure:failure]; -} - -- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request - withReceiptID:(nonnull NSUUID *)receiptID - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure { - __block NSURLSessionDataTask *task = nil; - dispatch_sync(self.synchronizationQueue, ^{ - NSString *URLIdentifier = request.URL.absoluteString; - if (URLIdentifier == nil) { - if (failure) { - NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil]; - dispatch_async(dispatch_get_main_queue(), ^{ - failure(request, nil, error); - }); - } - return; - } - - // 1) Append the success and failure blocks to a pre-existing request if it already exists - AFImageDownloaderMergedTask *existingMergedTask = self.mergedTasks[URLIdentifier]; - if (existingMergedTask != nil) { - AFImageDownloaderResponseHandler *handler = [[AFImageDownloaderResponseHandler alloc] initWithUUID:receiptID success:success failure:failure]; - [existingMergedTask addResponseHandler:handler]; - task = existingMergedTask.task; - return; - } - - // 2) Attempt to load the image from the image cache if the cache policy allows it - switch (request.cachePolicy) { - case NSURLRequestUseProtocolCachePolicy: - case NSURLRequestReturnCacheDataElseLoad: - case NSURLRequestReturnCacheDataDontLoad: { - UIImage *cachedImage = [self.imageCache imageforRequest:request withAdditionalIdentifier:nil]; - if (cachedImage != nil) { - if (success) { - dispatch_async(dispatch_get_main_queue(), ^{ - success(request, nil, cachedImage); - }); - } - return; - } - break; - } - default: - break; - } - - // 3) Create the request and set up authentication, validation and response serialization - NSUUID *mergedTaskIdentifier = [NSUUID UUID]; - NSURLSessionDataTask *createdTask; - __weak __typeof__(self) weakSelf = self; - - createdTask = [self.sessionManager - dataTaskWithRequest:request - completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { - dispatch_async(self.responseQueue, ^{ - __strong __typeof__(weakSelf) strongSelf = weakSelf; - AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[URLIdentifier]; - if ([mergedTask.identifier isEqual:mergedTaskIdentifier]) { - mergedTask = [strongSelf safelyRemoveMergedTaskWithURLIdentifier:URLIdentifier]; - if (error) { - for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { - if (handler.failureBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - handler.failureBlock(request, (NSHTTPURLResponse*)response, error); - }); - } - } - } else { - [strongSelf.imageCache addImage:responseObject forRequest:request withAdditionalIdentifier:nil]; - - for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { - if (handler.successBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - handler.successBlock(request, (NSHTTPURLResponse*)response, responseObject); - }); - } - } - - } - } - [strongSelf safelyDecrementActiveTaskCount]; - [strongSelf safelyStartNextTaskIfNecessary]; - }); - }]; - - // 4) Store the response handler for use when the request completes - AFImageDownloaderResponseHandler *handler = [[AFImageDownloaderResponseHandler alloc] initWithUUID:receiptID - success:success - failure:failure]; - AFImageDownloaderMergedTask *mergedTask = [[AFImageDownloaderMergedTask alloc] - initWithURLIdentifier:URLIdentifier - identifier:mergedTaskIdentifier - task:createdTask]; - [mergedTask addResponseHandler:handler]; - self.mergedTasks[URLIdentifier] = mergedTask; - - // 5) Either start the request or enqueue it depending on the current active request count - if ([self isActiveRequestCountBelowMaximumLimit]) { - [self startMergedTask:mergedTask]; - } else { - [self enqueueMergedTask:mergedTask]; - } - - task = mergedTask.task; - }); - if (task) { - return [[AFImageDownloadReceipt alloc] initWithReceiptID:receiptID task:task]; - } else { - return nil; - } -} - -- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { - dispatch_sync(self.synchronizationQueue, ^{ - NSString *URLIdentifier = imageDownloadReceipt.task.originalRequest.URL.absoluteString; - AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[URLIdentifier]; - NSUInteger index = [mergedTask.responseHandlers indexOfObjectPassingTest:^BOOL(AFImageDownloaderResponseHandler * _Nonnull handler, __unused NSUInteger idx, __unused BOOL * _Nonnull stop) { - return handler.uuid == imageDownloadReceipt.receiptID; - }]; - - if (index != NSNotFound) { - AFImageDownloaderResponseHandler *handler = mergedTask.responseHandlers[index]; - [mergedTask removeResponseHandler:handler]; - NSString *failureReason = [NSString stringWithFormat:@"ImageDownloader cancelled URL request: %@",imageDownloadReceipt.task.originalRequest.URL.absoluteString]; - NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey:failureReason}; - NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo]; - if (handler.failureBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - handler.failureBlock(imageDownloadReceipt.task.originalRequest, nil, error); - }); - } - } - - if (mergedTask.responseHandlers.count == 0 && mergedTask.task.state == NSURLSessionTaskStateSuspended) { - [mergedTask.task cancel]; - [self removeMergedTaskWithURLIdentifier:URLIdentifier]; - } - }); -} - -- (AFImageDownloaderMergedTask*)safelyRemoveMergedTaskWithURLIdentifier:(NSString *)URLIdentifier { - __block AFImageDownloaderMergedTask *mergedTask = nil; - dispatch_sync(self.synchronizationQueue, ^{ - mergedTask = [self removeMergedTaskWithURLIdentifier:URLIdentifier]; - }); - return mergedTask; -} - -//This method should only be called from safely within the synchronizationQueue -- (AFImageDownloaderMergedTask *)removeMergedTaskWithURLIdentifier:(NSString *)URLIdentifier { - AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[URLIdentifier]; - [self.mergedTasks removeObjectForKey:URLIdentifier]; - return mergedTask; -} - -- (void)safelyDecrementActiveTaskCount { - dispatch_sync(self.synchronizationQueue, ^{ - if (self.activeRequestCount > 0) { - self.activeRequestCount -= 1; - } - }); -} - -- (void)safelyStartNextTaskIfNecessary { - dispatch_sync(self.synchronizationQueue, ^{ - if ([self isActiveRequestCountBelowMaximumLimit]) { - while (self.queuedMergedTasks.count > 0) { - AFImageDownloaderMergedTask *mergedTask = [self dequeueMergedTask]; - if (mergedTask.task.state == NSURLSessionTaskStateSuspended) { - [self startMergedTask:mergedTask]; - break; - } - } - } - }); -} - -- (void)startMergedTask:(AFImageDownloaderMergedTask *)mergedTask { - [mergedTask.task resume]; - ++self.activeRequestCount; -} - -- (void)enqueueMergedTask:(AFImageDownloaderMergedTask *)mergedTask { - switch (self.downloadPrioritizaton) { - case AFImageDownloadPrioritizationFIFO: - [self.queuedMergedTasks addObject:mergedTask]; - break; - case AFImageDownloadPrioritizationLIFO: - [self.queuedMergedTasks insertObject:mergedTask atIndex:0]; - break; - } -} - -- (AFImageDownloaderMergedTask *)dequeueMergedTask { - AFImageDownloaderMergedTask *mergedTask = nil; - mergedTask = [self.queuedMergedTasks firstObject]; - [self.queuedMergedTasks removeObject:mergedTask]; - return mergedTask; -} - -- (BOOL)isActiveRequestCountBelowMaximumLimit { - return self.activeRequestCount < self.maximumActiveDownloads; -} - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h deleted file mode 100644 index 3bcf2895..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h +++ /dev/null @@ -1,103 +0,0 @@ -// AFNetworkActivityIndicatorManager.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if TARGET_OS_IOS - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. - - You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: - - [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; - - By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. - - See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: - http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 - */ -NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") -@interface AFNetworkActivityIndicatorManager : NSObject - -/** - A Boolean value indicating whether the manager is enabled. - - If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. - */ -@property (nonatomic, assign, getter = isEnabled) BOOL enabled; - -/** - A Boolean value indicating whether the network activity indicator manager is currently active. -*/ -@property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; - -/** - A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds. - - Apple's HIG describes the following: - - > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence. - - */ -@property (nonatomic, assign) NSTimeInterval activationDelay; - -/** - A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds. - */ - -@property (nonatomic, assign) NSTimeInterval completionDelay; - -/** - Returns the shared network activity indicator manager object for the system. - - @return The systemwide network activity indicator manager. - */ -+ (instancetype)sharedManager; - -/** - Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. - */ -- (void)incrementActivityCount; - -/** - Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. - */ -- (void)decrementActivityCount; - -/** - Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward. - - @param block A block to be executed when the network activity indicator status changes. - */ -- (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m deleted file mode 100644 index e77508e0..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m +++ /dev/null @@ -1,261 +0,0 @@ -// AFNetworkActivityIndicatorManager.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "AFNetworkActivityIndicatorManager.h" - -#if TARGET_OS_IOS -#import "AFURLSessionManager.h" - -typedef NS_ENUM(NSInteger, AFNetworkActivityManagerState) { - AFNetworkActivityManagerStateNotActive, - AFNetworkActivityManagerStateDelayingStart, - AFNetworkActivityManagerStateActive, - AFNetworkActivityManagerStateDelayingEnd -}; - -static NSTimeInterval const kDefaultAFNetworkActivityManagerActivationDelay = 1.0; -static NSTimeInterval const kDefaultAFNetworkActivityManagerCompletionDelay = 0.17; - -static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) { - if ([[notification object] respondsToSelector:@selector(originalRequest)]) { - return [(NSURLSessionTask *)[notification object] originalRequest]; - } else { - return nil; - } -} - -typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisible); - -@interface AFNetworkActivityIndicatorManager () -@property (readwrite, nonatomic, assign) NSInteger activityCount; -@property (readwrite, nonatomic, strong) NSTimer *activationDelayTimer; -@property (readwrite, nonatomic, strong) NSTimer *completionDelayTimer; -@property (readonly, nonatomic, getter = isNetworkActivityOccurring) BOOL networkActivityOccurring; -@property (nonatomic, copy) AFNetworkActivityActionBlock networkActivityActionBlock; -@property (nonatomic, assign) AFNetworkActivityManagerState currentState; -@property (nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; - -- (void)updateCurrentStateForNetworkActivityChange; -@end - -@implementation AFNetworkActivityIndicatorManager - -+ (instancetype)sharedManager { - static AFNetworkActivityIndicatorManager *_sharedManager = nil; - static dispatch_once_t oncePredicate; - dispatch_once(&oncePredicate, ^{ - _sharedManager = [[self alloc] init]; - }); - - return _sharedManager; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - self.currentState = AFNetworkActivityManagerStateNotActive; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil]; - self.activationDelay = kDefaultAFNetworkActivityManagerActivationDelay; - self.completionDelay = kDefaultAFNetworkActivityManagerCompletionDelay; - - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [_activationDelayTimer invalidate]; - [_completionDelayTimer invalidate]; -} - -- (void)setEnabled:(BOOL)enabled { - _enabled = enabled; - if (enabled == NO) { - [self setCurrentState:AFNetworkActivityManagerStateNotActive]; - } -} - -- (void)setNetworkingActivityActionWithBlock:(void (^)(BOOL networkActivityIndicatorVisible))block { - self.networkActivityActionBlock = block; -} - -- (BOOL)isNetworkActivityOccurring { - @synchronized(self) { - return self.activityCount > 0; - } -} - -- (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible { - if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) { - [self willChangeValueForKey:@"networkActivityIndicatorVisible"]; - @synchronized(self) { - _networkActivityIndicatorVisible = networkActivityIndicatorVisible; - } - [self didChangeValueForKey:@"networkActivityIndicatorVisible"]; - if (self.networkActivityActionBlock) { - self.networkActivityActionBlock(networkActivityIndicatorVisible); - } else { - [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkActivityIndicatorVisible]; - } - } -} - -- (void)setActivityCount:(NSInteger)activityCount { - @synchronized(self) { - _activityCount = activityCount; - } - - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateCurrentStateForNetworkActivityChange]; - }); -} - -- (void)incrementActivityCount { - [self willChangeValueForKey:@"activityCount"]; - @synchronized(self) { - _activityCount++; - } - [self didChangeValueForKey:@"activityCount"]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateCurrentStateForNetworkActivityChange]; - }); -} - -- (void)decrementActivityCount { - [self willChangeValueForKey:@"activityCount"]; - @synchronized(self) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - _activityCount = MAX(_activityCount - 1, 0); -#pragma clang diagnostic pop - } - [self didChangeValueForKey:@"activityCount"]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateCurrentStateForNetworkActivityChange]; - }); -} - -- (void)networkRequestDidStart:(NSNotification *)notification { - if ([AFNetworkRequestFromNotification(notification) URL]) { - [self incrementActivityCount]; - } -} - -- (void)networkRequestDidFinish:(NSNotification *)notification { - if ([AFNetworkRequestFromNotification(notification) URL]) { - [self decrementActivityCount]; - } -} - -#pragma mark - Internal State Management -- (void)setCurrentState:(AFNetworkActivityManagerState)currentState { - @synchronized(self) { - if (_currentState != currentState) { - [self willChangeValueForKey:@"currentState"]; - _currentState = currentState; - switch (currentState) { - case AFNetworkActivityManagerStateNotActive: - [self cancelActivationDelayTimer]; - [self cancelCompletionDelayTimer]; - [self setNetworkActivityIndicatorVisible:NO]; - break; - case AFNetworkActivityManagerStateDelayingStart: - [self startActivationDelayTimer]; - break; - case AFNetworkActivityManagerStateActive: - [self cancelCompletionDelayTimer]; - [self setNetworkActivityIndicatorVisible:YES]; - break; - case AFNetworkActivityManagerStateDelayingEnd: - [self startCompletionDelayTimer]; - break; - } - } - [self didChangeValueForKey:@"currentState"]; - } -} - -- (void)updateCurrentStateForNetworkActivityChange { - if (self.enabled) { - switch (self.currentState) { - case AFNetworkActivityManagerStateNotActive: - if (self.isNetworkActivityOccurring) { - [self setCurrentState:AFNetworkActivityManagerStateDelayingStart]; - } - break; - case AFNetworkActivityManagerStateDelayingStart: - //No op. Let the delay timer finish out. - break; - case AFNetworkActivityManagerStateActive: - if (!self.isNetworkActivityOccurring) { - [self setCurrentState:AFNetworkActivityManagerStateDelayingEnd]; - } - break; - case AFNetworkActivityManagerStateDelayingEnd: - if (self.isNetworkActivityOccurring) { - [self setCurrentState:AFNetworkActivityManagerStateActive]; - } - break; - } - } -} - -- (void)startActivationDelayTimer { - self.activationDelayTimer = [NSTimer - timerWithTimeInterval:self.activationDelay target:self selector:@selector(activationDelayTimerFired) userInfo:nil repeats:NO]; - [[NSRunLoop mainRunLoop] addTimer:self.activationDelayTimer forMode:NSRunLoopCommonModes]; -} - -- (void)activationDelayTimerFired { - if (self.networkActivityOccurring) { - [self setCurrentState:AFNetworkActivityManagerStateActive]; - } else { - [self setCurrentState:AFNetworkActivityManagerStateNotActive]; - } -} - -- (void)startCompletionDelayTimer { - [self.completionDelayTimer invalidate]; - self.completionDelayTimer = [NSTimer timerWithTimeInterval:self.completionDelay target:self selector:@selector(completionDelayTimerFired) userInfo:nil repeats:NO]; - [[NSRunLoop mainRunLoop] addTimer:self.completionDelayTimer forMode:NSRunLoopCommonModes]; -} - -- (void)completionDelayTimerFired { - [self setCurrentState:AFNetworkActivityManagerStateNotActive]; -} - -- (void)cancelActivationDelayTimer { - [self.activationDelayTimer invalidate]; -} - -- (void)cancelCompletionDelayTimer { - [self.completionDelayTimer invalidate]; -} - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h deleted file mode 100644 index d424c9b8..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h +++ /dev/null @@ -1,48 +0,0 @@ -// UIActivityIndicatorView+AFNetworking.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import - -/** - This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. - */ -@interface UIActivityIndicatorView (AFNetworking) - -///---------------------------------- -/// @name Animating for Session Tasks -///---------------------------------- - -/** - Binds the animating state to the state of the specified task. - - @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. - */ -- (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m deleted file mode 100644 index ed704eda..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m +++ /dev/null @@ -1,124 +0,0 @@ -// UIActivityIndicatorView+AFNetworking.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIActivityIndicatorView+AFNetworking.h" -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import "AFURLSessionManager.h" - -@interface AFActivityIndicatorViewNotificationObserver : NSObject -@property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; -- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; - -- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; - -@end - -@implementation UIActivityIndicatorView (AFNetworking) - -- (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver { - AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); - if (notificationObserver == nil) { - notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self]; - objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return notificationObserver; -} - -- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { - [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; -} - -@end - -@implementation AFActivityIndicatorViewNotificationObserver - -- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView -{ - self = [super init]; - if (self) { - _activityIndicatorView = activityIndicatorView; - } - return self; -} - -- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - - [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; - [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; - [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; - - if (task) { - if (task.state != NSURLSessionTaskStateCompleted) { - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" -#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" - if (task.state == NSURLSessionTaskStateRunning) { - [self.activityIndicatorView startAnimating]; - } else { - [self.activityIndicatorView stopAnimating]; - } -#pragma clang diagnostic pop - - [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; - [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task]; - [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task]; - } - } -} - -#pragma mark - - -- (void)af_startAnimating { - dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" - [self.activityIndicatorView startAnimating]; -#pragma clang diagnostic pop - }); -} - -- (void)af_stopAnimating { - dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" - [self.activityIndicatorView stopAnimating]; -#pragma clang diagnostic pop - }); -} - -#pragma mark - - -- (void)dealloc { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - - [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; - [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; - [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; -} - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h deleted file mode 100644 index d33e0d4a..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h +++ /dev/null @@ -1,175 +0,0 @@ -// UIButton+AFNetworking.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class AFImageDownloader; - -/** - This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL. - - @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported. - */ -@interface UIButton (AFNetworking) - -///------------------------------------ -/// @name Accessing the Image Downloader -///------------------------------------ - -/** - Set the shared image downloader used to download images. - - @param imageDownloader The shared image downloader used to download images. -*/ -+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; - -/** - The shared image downloader used to download images. - */ -+ (AFImageDownloader *)sharedImageDownloader; - -///-------------------- -/// @name Setting Image -///-------------------- - -/** - Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - @param state The control state. - @param url The URL used for the image request. - */ -- (void)setImageForState:(UIControlState)state - withURL:(NSURL *)url; - -/** - Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - @param state The control state. - @param url The URL used for the image request. - @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. - */ -- (void)setImageForState:(UIControlState)state - withURL:(NSURL *)url - placeholderImage:(nullable UIImage *)placeholderImage; - -/** - Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied. - - @param state The control state. - @param urlRequest The URL request used for the image request. - @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. - @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. - @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. - */ -- (void)setImageForState:(UIControlState)state - withURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(nullable UIImage *)placeholderImage - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; - - -///------------------------------- -/// @name Setting Background Image -///------------------------------- - -/** - Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled. - - If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished. - - @param state The control state. - @param url The URL used for the background image request. - */ -- (void)setBackgroundImageForState:(UIControlState)state - withURL:(NSURL *)url; - -/** - Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - @param state The control state. - @param url The URL used for the background image request. - @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. - */ -- (void)setBackgroundImageForState:(UIControlState)state - withURL:(NSURL *)url - placeholderImage:(nullable UIImage *)placeholderImage; - -/** - Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied. - - @param state The control state. - @param urlRequest The URL request used for the image request. - @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. - @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. - @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. - */ -- (void)setBackgroundImageForState:(UIControlState)state - withURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(nullable UIImage *)placeholderImage - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; - - -///------------------------------ -/// @name Canceling Image Loading -///------------------------------ - -/** - Cancels any executing image task for the specified control state of the receiver, if one exists. - - @param state The control state. - */ -- (void)cancelImageDownloadTaskForState:(UIControlState)state; - -/** - Cancels any executing background image task for the specified control state of the receiver, if one exists. - - @param state The control state. - */ -- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m deleted file mode 100644 index 5bc49ddf..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m +++ /dev/null @@ -1,305 +0,0 @@ -// UIButton+AFNetworking.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIButton+AFNetworking.h" - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import "UIImageView+AFNetworking.h" -#import "AFImageDownloader.h" - -@interface UIButton (_AFNetworking) -@end - -@implementation UIButton (_AFNetworking) - -#pragma mark - - -static char AFImageDownloadReceiptNormal; -static char AFImageDownloadReceiptHighlighted; -static char AFImageDownloadReceiptSelected; -static char AFImageDownloadReceiptDisabled; - -static const char * af_imageDownloadReceiptKeyForState(UIControlState state) { - switch (state) { - case UIControlStateHighlighted: - return &AFImageDownloadReceiptHighlighted; - case UIControlStateSelected: - return &AFImageDownloadReceiptSelected; - case UIControlStateDisabled: - return &AFImageDownloadReceiptDisabled; - case UIControlStateNormal: - default: - return &AFImageDownloadReceiptNormal; - } -} - -- (AFImageDownloadReceipt *)af_imageDownloadReceiptForState:(UIControlState)state { - return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_imageDownloadReceiptKeyForState(state)); -} - -- (void)af_setImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt - forState:(UIControlState)state -{ - objc_setAssociatedObject(self, af_imageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -static char AFBackgroundImageDownloadReceiptNormal; -static char AFBackgroundImageDownloadReceiptHighlighted; -static char AFBackgroundImageDownloadReceiptSelected; -static char AFBackgroundImageDownloadReceiptDisabled; - -static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState state) { - switch (state) { - case UIControlStateHighlighted: - return &AFBackgroundImageDownloadReceiptHighlighted; - case UIControlStateSelected: - return &AFBackgroundImageDownloadReceiptSelected; - case UIControlStateDisabled: - return &AFBackgroundImageDownloadReceiptDisabled; - case UIControlStateNormal: - default: - return &AFBackgroundImageDownloadReceiptNormal; - } -} - -- (AFImageDownloadReceipt *)af_backgroundImageDownloadReceiptForState:(UIControlState)state { - return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state)); -} - -- (void)af_setBackgroundImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt - forState:(UIControlState)state -{ - objc_setAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -@end - -#pragma mark - - -@implementation UIButton (AFNetworking) - -+ (AFImageDownloader *)sharedImageDownloader { - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; -#pragma clang diagnostic pop -} - -+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { - objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -- (void)setImageForState:(UIControlState)state - withURL:(NSURL *)url -{ - [self setImageForState:state withURL:url placeholderImage:nil]; -} - -- (void)setImageForState:(UIControlState)state - withURL:(NSURL *)url - placeholderImage:(UIImage *)placeholderImage -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; - - [self setImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; -} - -- (void)setImageForState:(UIControlState)state - withURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(nullable UIImage *)placeholderImage - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure -{ - if ([self isActiveTaskURLEqualToURLRequest:urlRequest forState:state]) { - return; - } - - [self cancelImageDownloadTaskForState:state]; - - AFImageDownloader *downloader = [[self class] sharedImageDownloader]; - id imageCache = downloader.imageCache; - - //Use the image from the image cache if it exists - UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; - if (cachedImage) { - if (success) { - success(urlRequest, nil, cachedImage); - } else { - [self setImage:cachedImage forState:state]; - } - [self af_setImageDownloadReceipt:nil forState:state]; - } else { - if (placeholderImage) { - [self setImage:placeholderImage forState:state]; - } - - __weak __typeof(self)weakSelf = self; - NSUUID *downloadID = [NSUUID UUID]; - AFImageDownloadReceipt *receipt; - receipt = [downloader - downloadImageForURLRequest:urlRequest - withReceiptID:downloadID - success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { - if (success) { - success(request, response, responseObject); - } else if(responseObject) { - [strongSelf setImage:responseObject forState:state]; - } - [strongSelf af_setImageDownloadReceipt:nil forState:state]; - } - - } - failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { - if (failure) { - failure(request, response, error); - } - [strongSelf af_setImageDownloadReceipt:nil forState:state]; - } - }]; - - [self af_setImageDownloadReceipt:receipt forState:state]; - } -} - -#pragma mark - - -- (void)setBackgroundImageForState:(UIControlState)state - withURL:(NSURL *)url -{ - [self setBackgroundImageForState:state withURL:url placeholderImage:nil]; -} - -- (void)setBackgroundImageForState:(UIControlState)state - withURL:(NSURL *)url - placeholderImage:(nullable UIImage *)placeholderImage -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; - - [self setBackgroundImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; -} - -- (void)setBackgroundImageForState:(UIControlState)state - withURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(nullable UIImage *)placeholderImage - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure -{ - if ([self isActiveBackgroundTaskURLEqualToURLRequest:urlRequest forState:state]) { - return; - } - - [self cancelBackgroundImageDownloadTaskForState:state]; - - AFImageDownloader *downloader = [[self class] sharedImageDownloader]; - id imageCache = downloader.imageCache; - - //Use the image from the image cache if it exists - UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; - if (cachedImage) { - if (success) { - success(urlRequest, nil, cachedImage); - } else { - [self setBackgroundImage:cachedImage forState:state]; - } - [self af_setBackgroundImageDownloadReceipt:nil forState:state]; - } else { - if (placeholderImage) { - [self setBackgroundImage:placeholderImage forState:state]; - } - - __weak __typeof(self)weakSelf = self; - NSUUID *downloadID = [NSUUID UUID]; - AFImageDownloadReceipt *receipt; - receipt = [downloader - downloadImageForURLRequest:urlRequest - withReceiptID:downloadID - success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { - if (success) { - success(request, response, responseObject); - } else if(responseObject) { - [strongSelf setBackgroundImage:responseObject forState:state]; - } - [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state]; - } - - } - failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { - if (failure) { - failure(request, response, error); - } - [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state]; - } - }]; - - [self af_setBackgroundImageDownloadReceipt:receipt forState:state]; - } -} - -#pragma mark - - -- (void)cancelImageDownloadTaskForState:(UIControlState)state { - AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state]; - if (receipt != nil) { - [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt]; - [self af_setImageDownloadReceipt:nil forState:state]; - } -} - -- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state { - AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state]; - if (receipt != nil) { - [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt]; - [self af_setBackgroundImageDownloadReceipt:nil forState:state]; - } -} - -- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state { - AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state]; - return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; -} - -- (BOOL)isActiveBackgroundTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state { - AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state]; - return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; -} - - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h deleted file mode 100644 index 14744cdd..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// UIImage+AFNetworking.h -// -// -// Created by Paulo Ferreira on 08/07/15. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import - -@interface UIImage (AFNetworking) - -+ (UIImage*) safeImageWithData:(NSData*)data; - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h deleted file mode 100644 index 8929252e..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h +++ /dev/null @@ -1,109 +0,0 @@ -// UIImageView+AFNetworking.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class AFImageDownloader; - -/** - This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL. - */ -@interface UIImageView (AFNetworking) - -///------------------------------------ -/// @name Accessing the Image Downloader -///------------------------------------ - -/** - Set the shared image downloader used to download images. - - @param imageDownloader The shared image downloader used to download images. - */ -+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; - -/** - The shared image downloader used to download images. - */ -+ (AFImageDownloader *)sharedImageDownloader; - -///-------------------- -/// @name Setting Image -///-------------------- - -/** - Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` - - @param url The URL used for the image request. - */ -- (void)setImageWithURL:(NSURL *)url; - -/** - Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` - - @param url The URL used for the image request. - @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. - */ -- (void)setImageWithURL:(NSURL *)url - placeholderImage:(nullable UIImage *)placeholderImage; - -/** - Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. - - If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. - - If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied. - - @param urlRequest The URL request used for the image request. - @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. - @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. - @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. - */ -- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(nullable UIImage *)placeholderImage - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; - -/** - Cancels any executing image operation for the receiver, if one exists. - */ -- (void)cancelImageDownloadTask; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m deleted file mode 100644 index 5934d681..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m +++ /dev/null @@ -1,161 +0,0 @@ -// UIImageView+AFNetworking.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIImageView+AFNetworking.h" - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import "AFImageDownloader.h" - -@interface UIImageView (_AFNetworking) -@property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt; -@end - -@implementation UIImageView (_AFNetworking) - -- (AFImageDownloadReceipt *)af_activeImageDownloadReceipt { - return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt)); -} - -- (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { - objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -@end - -#pragma mark - - -@implementation UIImageView (AFNetworking) - -+ (AFImageDownloader *)sharedImageDownloader { - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; -#pragma clang diagnostic pop -} - -+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { - objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -- (void)setImageWithURL:(NSURL *)url { - [self setImageWithURL:url placeholderImage:nil]; -} - -- (void)setImageWithURL:(NSURL *)url - placeholderImage:(UIImage *)placeholderImage -{ - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; - - [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; -} - -- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest - placeholderImage:(UIImage *)placeholderImage - success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success - failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure -{ - - if ([urlRequest URL] == nil) { - [self cancelImageDownloadTask]; - self.image = placeholderImage; - return; - } - - if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){ - return; - } - - [self cancelImageDownloadTask]; - - AFImageDownloader *downloader = [[self class] sharedImageDownloader]; - id imageCache = downloader.imageCache; - - //Use the image from the image cache if it exists - UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; - if (cachedImage) { - if (success) { - success(urlRequest, nil, cachedImage); - } else { - self.image = cachedImage; - } - [self clearActiveDownloadInformation]; - } else { - if (placeholderImage) { - self.image = placeholderImage; - } - - __weak __typeof(self)weakSelf = self; - NSUUID *downloadID = [NSUUID UUID]; - AFImageDownloadReceipt *receipt; - receipt = [downloader - downloadImageForURLRequest:urlRequest - withReceiptID:downloadID - success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { - if (success) { - success(request, response, responseObject); - } else if(responseObject) { - strongSelf.image = responseObject; - } - [strongSelf clearActiveDownloadInformation]; - } - - } - failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { - __strong __typeof(weakSelf)strongSelf = weakSelf; - if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { - if (failure) { - failure(request, response, error); - } - [strongSelf clearActiveDownloadInformation]; - } - }]; - - self.af_activeImageDownloadReceipt = receipt; - } -} - -- (void)cancelImageDownloadTask { - if (self.af_activeImageDownloadReceipt != nil) { - [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt]; - [self clearActiveDownloadInformation]; - } -} - -- (void)clearActiveDownloadInformation { - self.af_activeImageDownloadReceipt = nil; -} - -- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest { - return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; -} - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h deleted file mode 100644 index febacfc7..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h +++ /dev/null @@ -1,42 +0,0 @@ -// UIKit+AFNetworking.h -// -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#if TARGET_OS_IOS || TARGET_OS_TV -#import - -#ifndef _UIKIT_AFNETWORKING_ - #define _UIKIT_AFNETWORKING_ - -#if TARGET_OS_IOS - #import "AFAutoPurgingImageCache.h" - #import "AFImageDownloader.h" - #import "AFNetworkActivityIndicatorManager.h" - #import "UIRefreshControl+AFNetworking.h" - #import "UIWebView+AFNetworking.h" -#endif - - #import "UIActivityIndicatorView+AFNetworking.h" - #import "UIButton+AFNetworking.h" - #import "UIImageView+AFNetworking.h" - #import "UIProgressView+AFNetworking.h" -#endif /* _UIKIT_AFNETWORKING_ */ -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h deleted file mode 100644 index 8ea0a731..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h +++ /dev/null @@ -1,64 +0,0 @@ -// UIProgressView+AFNetworking.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import - -NS_ASSUME_NONNULL_BEGIN - - -/** - This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. - */ -@interface UIProgressView (AFNetworking) - -///------------------------------------ -/// @name Setting Session Task Progress -///------------------------------------ - -/** - Binds the progress to the upload progress of the specified session task. - - @param task The session task. - @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. - */ -- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task - animated:(BOOL)animated; - -/** - Binds the progress to the download progress of the specified session task. - - @param task The session task. - @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. - */ -- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task - animated:(BOOL)animated; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m deleted file mode 100644 index 058755e2..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m +++ /dev/null @@ -1,118 +0,0 @@ -// UIProgressView+AFNetworking.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIProgressView+AFNetworking.h" - -#import - -#if TARGET_OS_IOS || TARGET_OS_TV - -#import "AFURLSessionManager.h" - -static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; -static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; - -#pragma mark - - -@implementation UIProgressView (AFNetworking) - -- (BOOL)af_uploadProgressAnimated { - return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue]; -} - -- (void)af_setUploadProgressAnimated:(BOOL)animated { - objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (BOOL)af_downloadProgressAnimated { - return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue]; -} - -- (void)af_setDownloadProgressAnimated:(BOOL)animated { - objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task - animated:(BOOL)animated -{ - [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; - [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; - - [self af_setUploadProgressAnimated:animated]; -} - -- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task - animated:(BOOL)animated -{ - [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; - [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; - - [self af_setDownloadProgressAnimated:animated]; -} - -#pragma mark - NSKeyValueObserving - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(__unused NSDictionary *)change - context:(void *)context -{ - if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { - if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { - if ([object countOfBytesExpectedToSend] > 0) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated]; - }); - } - } - - if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { - if ([object countOfBytesExpectedToReceive] > 0) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated]; - }); - } - } - - if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) { - if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) { - @try { - [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))]; - - if (context == AFTaskCountOfBytesSentContext) { - [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; - } - - if (context == AFTaskCountOfBytesReceivedContext) { - [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; - } - } - @catch (NSException * __unused exception) {} - } - } - } -} - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h deleted file mode 100644 index 215eafcf..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h +++ /dev/null @@ -1,53 +0,0 @@ -// UIRefreshControl+AFNetworking.m -// -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if TARGET_OS_IOS - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. - */ -@interface UIRefreshControl (AFNetworking) - -///----------------------------------- -/// @name Refreshing for Session Tasks -///----------------------------------- - -/** - Binds the refreshing state to the state of the specified task. - - @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. - */ -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m deleted file mode 100644 index aba6d61e..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m +++ /dev/null @@ -1,122 +0,0 @@ -// UIRefreshControl+AFNetworking.m -// -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIRefreshControl+AFNetworking.h" -#import - -#if TARGET_OS_IOS - -#import "AFURLSessionManager.h" - -@interface AFRefreshControlNotificationObserver : NSObject -@property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; -- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; - -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; - -@end - -@implementation UIRefreshControl (AFNetworking) - -- (AFRefreshControlNotificationObserver *)af_notificationObserver { - AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); - if (notificationObserver == nil) { - notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self]; - objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return notificationObserver; -} - -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { - [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; -} - -@end - -@implementation AFRefreshControlNotificationObserver - -- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl -{ - self = [super init]; - if (self) { - _refreshControl = refreshControl; - } - return self; -} - -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - - [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; - [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; - [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; - - if (task) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" -#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak" - if (task.state == NSURLSessionTaskStateRunning) { - [self.refreshControl beginRefreshing]; - - [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; - [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; - [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; - } else { - [self.refreshControl endRefreshing]; - } -#pragma clang diagnostic pop - } -} - -#pragma mark - - -- (void)af_beginRefreshing { - dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" - [self.refreshControl beginRefreshing]; -#pragma clang diagnostic pop - }); -} - -- (void)af_endRefreshing { - dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreceiver-is-weak" - [self.refreshControl endRefreshing]; -#pragma clang diagnostic pop - }); -} - -#pragma mark - - -- (void)dealloc { - NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; - - [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; - [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; - [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; -} - -@end - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h deleted file mode 100644 index b9a56af4..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h +++ /dev/null @@ -1,80 +0,0 @@ -// UIWebView+AFNetworking.h -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -#import - -#if TARGET_OS_IOS - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class AFHTTPSessionManager; - -/** - This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. - - @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. - */ -@interface UIWebView (AFNetworking) - -/** - The session manager used to download all requests. - */ -@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; - -/** - Asynchronously loads the specified request. - - @param request A URL request identifying the location of the content to load. This must not be `nil`. - @param progress A progress object monitoring the current download progress. - @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. - @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. - */ -- (void)loadRequest:(NSURLRequest *)request - progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress - success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success - failure:(nullable void (^)(NSError *error))failure; - -/** - Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. - - @param request A URL request identifying the location of the content to load. This must not be `nil`. - @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. - @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. -@param progress A progress object monitoring the current download progress. - @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. - @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. - */ -- (void)loadRequest:(NSURLRequest *)request - MIMEType:(nullable NSString *)MIMEType - textEncodingName:(nullable NSString *)textEncodingName - progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress - success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success - failure:(nullable void (^)(NSError *error))failure; - -@end - -NS_ASSUME_NONNULL_END - -#endif diff --git a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m b/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m deleted file mode 100644 index 751c499e..00000000 --- a/iOSProject/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m +++ /dev/null @@ -1,162 +0,0 @@ -// UIWebView+AFNetworking.m -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIWebView+AFNetworking.h" - -#import - -#if TARGET_OS_IOS - -#import "AFHTTPSessionManager.h" -#import "AFURLResponseSerialization.h" -#import "AFURLRequestSerialization.h" - -@interface UIWebView (_AFNetworking) -@property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask; -@end - -@implementation UIWebView (_AFNetworking) - -- (NSURLSessionDataTask *)af_URLSessionTask { - return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask)); -} - -- (void)af_setURLSessionTask:(NSURLSessionDataTask *)af_URLSessionTask { - objc_setAssociatedObject(self, @selector(af_URLSessionTask), af_URLSessionTask, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -@end - -#pragma mark - - -@implementation UIWebView (AFNetworking) - -- (AFHTTPSessionManager *)sessionManager { - static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _af_defaultHTTPSessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; - _af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer]; - _af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer]; - }); - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager; -#pragma clang diagnostic pop -} - -- (void)setSessionManager:(AFHTTPSessionManager *)sessionManager { - objc_setAssociatedObject(self, @selector(sessionManager), sessionManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (AFHTTPResponseSerializer *)responseSerializer { - static AFHTTPResponseSerializer *_af_defaultResponseSerializer = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer]; - }); - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu" - return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; -#pragma clang diagnostic pop -} - -- (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { - objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - - -- (void)loadRequest:(NSURLRequest *)request - progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress - success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success - failure:(void (^)(NSError *error))failure -{ - [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) { - NSStringEncoding stringEncoding = NSUTF8StringEncoding; - if (response.textEncodingName) { - CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); - if (encoding != kCFStringEncodingInvalidId) { - stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); - } - } - - NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding]; - if (success) { - string = success(response, string); - } - - return [string dataUsingEncoding:stringEncoding]; - } failure:failure]; -} - -- (void)loadRequest:(NSURLRequest *)request - MIMEType:(NSString *)MIMEType - textEncodingName:(NSString *)textEncodingName - progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress - success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success - failure:(void (^)(NSError *error))failure -{ - NSParameterAssert(request); - - if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) { - [self.af_URLSessionTask cancel]; - } - self.af_URLSessionTask = nil; - - __weak __typeof(self)weakSelf = self; - NSURLSessionDataTask *dataTask; - dataTask = [self.sessionManager - GET:request.URL.absoluteString - parameters:nil - progress:nil - success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) { - __strong __typeof(weakSelf) strongSelf = weakSelf; - if (success) { - success((NSHTTPURLResponse *)task.response, responseObject); - } - [strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[task.currentRequest URL]]; - - if ([strongSelf.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { - [strongSelf.delegate webViewDidFinishLoad:strongSelf]; - } - } - failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) { - if (failure) { - failure(error); - } - }]; - self.af_URLSessionTask = dataTask; - if (progress != nil) { - *progress = [self.sessionManager downloadProgressForTask:dataTask]; - } - [self.af_URLSessionTask resume]; - - if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { - [self.delegate webViewDidStartLoad:self]; - } -} - -@end - -#endif \ No newline at end of file diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIAuthenticationDialog.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIAuthenticationDialog.h deleted file mode 100644 index 6bbb2827..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIAuthenticationDialog.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// ASIAuthenticationDialog.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 21/08/2009. -// Copyright 2009 All-Seeing Interactive. All rights reserved. -// - -#import -#import -@class ASIHTTPRequest; - -typedef enum _ASIAuthenticationType { - ASIStandardAuthenticationType = 0, - ASIProxyAuthenticationType = 1 -} ASIAuthenticationType; - -@interface ASIAutorotatingViewController : UIViewController -@end - -@interface ASIAuthenticationDialog : ASIAutorotatingViewController { - ASIHTTPRequest *request; - ASIAuthenticationType type; - UITableView *tableView; - UIViewController *presentingController; - BOOL didEnableRotationNotifications; -} -+ (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request; -+ (void)dismiss; - -@property (retain) ASIHTTPRequest *request; -@property (assign) ASIAuthenticationType type; -@property (assign) BOOL didEnableRotationNotifications; -@property (retain, nonatomic) UIViewController *presentingController; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIAuthenticationDialog.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIAuthenticationDialog.m deleted file mode 100644 index 7fb612ed..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIAuthenticationDialog.m +++ /dev/null @@ -1,520 +0,0 @@ -// -// ASIAuthenticationDialog.m -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 21/08/2009. -// Copyright 2009 All-Seeing Interactive. All rights reserved. -// - -#import "ASIAuthenticationDialog.h" -#import "ASIHTTPRequest.h" -#import - -static ASIAuthenticationDialog *sharedDialog = nil; -BOOL isDismissing = NO; -static NSMutableArray *requestsNeedingAuthentication = nil; - -static const NSUInteger kUsernameRow = 0; -static const NSUInteger kUsernameSection = 0; -static const NSUInteger kPasswordRow = 1; -static const NSUInteger kPasswordSection = 0; -static const NSUInteger kDomainRow = 0; -static const NSUInteger kDomainSection = 1; - - -@implementation ASIAutorotatingViewController - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - return YES; -} - -@end - - -@interface ASIAuthenticationDialog () -- (void)showTitle; -- (void)show; -- (NSArray *)requestsRequiringTheseCredentials; -- (void)presentNextDialog; -- (void)keyboardWillShow:(NSNotification *)notification; -- (void)orientationChanged:(NSNotification *)notification; -- (void)cancelAuthenticationFromDialog:(id)sender; -- (void)loginWithCredentialsFromDialog:(id)sender; -@property (retain) UITableView *tableView; -@end - -@implementation ASIAuthenticationDialog - -#pragma mark init / dealloc - -+ (void)initialize -{ - if (self == [ASIAuthenticationDialog class]) { - requestsNeedingAuthentication = [[NSMutableArray array] retain]; - } -} - -+ (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)theRequest -{ - // No need for a lock here, this will always be called on the main thread - if (!sharedDialog) { - sharedDialog = [[self alloc] init]; - [sharedDialog setRequest:theRequest]; - if ([theRequest authenticationNeeded] == ASIProxyAuthenticationNeeded) { - [sharedDialog setType:ASIProxyAuthenticationType]; - } else { - [sharedDialog setType:ASIStandardAuthenticationType]; - } - [sharedDialog show]; - } else { - [requestsNeedingAuthentication addObject:theRequest]; - } -} - -- (id)init -{ - if ((self = [self initWithNibName:nil bundle:nil])) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 - if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { -#endif - if (![UIDevice currentDevice].generatesDeviceOrientationNotifications) { - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [self setDidEnableRotationNotifications:YES]; - } - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 - } -#endif - } - return self; -} - -- (void)dealloc -{ - if ([self didEnableRotationNotifications]) { - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil]; - } - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; - - [request release]; - [tableView release]; - [presentingController.view removeFromSuperview]; - [presentingController release]; - [super dealloc]; -} - -#pragma mark keyboard notifications - -- (void)keyboardWillShow:(NSNotification *)notification -{ -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 - if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { -#endif -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_2 - NSValue *keyboardBoundsValue = [[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey]; -#else - NSValue *keyboardBoundsValue = [[notification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey]; -#endif - CGRect keyboardBounds; - [keyboardBoundsValue getValue:&keyboardBounds]; - UIEdgeInsets e = UIEdgeInsetsMake(0, 0, keyboardBounds.size.height, 0); - [[self tableView] setScrollIndicatorInsets:e]; - [[self tableView] setContentInset:e]; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 - } -#endif -} - -// Manually handles orientation changes on iPhone -- (void)orientationChanged:(NSNotification *)notification -{ - [self showTitle]; - - UIInterfaceOrientation o = (UIInterfaceOrientation)[[UIApplication sharedApplication] statusBarOrientation]; - CGFloat angle = 0; - switch (o) { - case UIDeviceOrientationLandscapeLeft: angle = 90; break; - case UIDeviceOrientationLandscapeRight: angle = -90; break; - case UIDeviceOrientationPortraitUpsideDown: angle = 180; break; - default: break; - } - - CGRect f = [[UIScreen mainScreen] applicationFrame]; - - // Swap the frame height and width if necessary - if (UIDeviceOrientationIsLandscape(o)) { - CGFloat t; - t = f.size.width; - f.size.width = f.size.height; - f.size.height = t; - } - - CGAffineTransform previousTransform = self.view.layer.affineTransform; - CGAffineTransform newTransform = CGAffineTransformMakeRotation((CGFloat)(angle * M_PI / 180.0)); - - // Reset the transform so we can set the size - self.view.layer.affineTransform = CGAffineTransformIdentity; - self.view.frame = (CGRect){ { 0, 0 }, f.size}; - - // Revert to the previous transform for correct animation - self.view.layer.affineTransform = previousTransform; - - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationDuration:0.3]; - - // Set the new transform - self.view.layer.affineTransform = newTransform; - - // Fix the view origin - self.view.frame = (CGRect){ { f.origin.x, f.origin.y },self.view.frame.size}; - [UIView commitAnimations]; -} - -#pragma mark utilities - -- (UIViewController *)presentingController -{ - if (!presentingController) { - presentingController = [[ASIAutorotatingViewController alloc] initWithNibName:nil bundle:nil]; - - // Attach to the window, but don't interfere. - UIWindow *window = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; - [window addSubview:[presentingController view]]; - [[presentingController view] setFrame:CGRectZero]; - [[presentingController view] setUserInteractionEnabled:NO]; - } - - return presentingController; -} - -- (UITextField *)textFieldInRow:(NSUInteger)row section:(NSUInteger)section -{ - return [[[[[self tableView] cellForRowAtIndexPath: - [NSIndexPath indexPathForRow:row inSection:section]] - contentView] subviews] objectAtIndex:0]; -} - -- (UITextField *)usernameField -{ - return [self textFieldInRow:kUsernameRow section:kUsernameSection]; -} - -- (UITextField *)passwordField -{ - return [self textFieldInRow:kPasswordRow section:kPasswordSection]; -} - -- (UITextField *)domainField -{ - return [self textFieldInRow:kDomainRow section:kDomainSection]; -} - -#pragma mark show / dismiss - -+ (void)dismiss -{ - UIViewController* dismisser = nil; - if ([sharedDialog respondsToSelector:@selector(presentingViewController)]){ - dismisser = [sharedDialog presentingViewController]; - }else{ - dismisser = [sharedDialog parentViewController]; - } - if([dismisser respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]){ - [dismisser dismissViewControllerAnimated:YES completion:nil]; - }else{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [dismisser dismissModalViewControllerAnimated:YES]; -#pragma clang diagnostic pop - } -} - -- (void)viewDidDisappear:(BOOL)animated -{ - [self retain]; - [sharedDialog release]; - sharedDialog = nil; - [self performSelector:@selector(presentNextDialog) withObject:nil afterDelay:0]; - [self release]; -} - -- (void)dismiss -{ - if (self == sharedDialog) { - [[self class] dismiss]; - } else { - UIViewController* dismisser = nil; - if ([self respondsToSelector:@selector(presentingViewController)]){ - dismisser = [self presentingViewController]; - }else{ - dismisser = [self parentViewController]; - } - if([dismisser respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]){ - [dismisser dismissViewControllerAnimated:YES completion:nil]; - }else{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [dismisser dismissModalViewControllerAnimated:YES]; -#pragma clang diagnostic pop - } - } -} - -- (void)showTitle -{ - UINavigationBar *navigationBar = [[[self view] subviews] objectAtIndex:0]; - UINavigationItem *navItem = [[navigationBar items] objectAtIndex:0]; - if (UIInterfaceOrientationIsPortrait([[UIDevice currentDevice] orientation])) { - // Setup the title - if ([self type] == ASIProxyAuthenticationType) { - [navItem setPrompt:@"Login to this secure proxy server."]; - } else { - [navItem setPrompt:@"Login to this secure server."]; - } - } else { - [navItem setPrompt:nil]; - } - [navigationBar sizeToFit]; - CGRect f = [[self view] bounds]; - f.origin.y = [navigationBar frame].size.height; - f.size.height -= f.origin.y; - [[self tableView] setFrame:f]; -} - -- (void)show -{ - // Remove all subviews - UIView *v; - while ((v = [[[self view] subviews] lastObject])) { - [v removeFromSuperview]; - } - - // Setup toolbar - UINavigationBar *bar = [[[UINavigationBar alloc] init] autorelease]; - [bar setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; - - UINavigationItem *navItem = [[[UINavigationItem alloc] init] autorelease]; - bar.items = [NSArray arrayWithObject:navItem]; - - [[self view] addSubview:bar]; - - [self showTitle]; - - // Setup toolbar buttons - if ([self type] == ASIProxyAuthenticationType) { - [navItem setTitle:[[self request] proxyHost]]; - } else { - [navItem setTitle:[[[self request] url] host]]; - } - - [navItem setLeftBarButtonItem:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelAuthenticationFromDialog:)] autorelease]]; - [navItem setRightBarButtonItem:[[[UIBarButtonItem alloc] initWithTitle:@"Login" style:UIBarButtonItemStyleDone target:self action:@selector(loginWithCredentialsFromDialog:)] autorelease]]; - - // We show the login form in a table view, similar to Safari's authentication dialog - [bar sizeToFit]; - CGRect f = [[self view] bounds]; - f.origin.y = [bar frame].size.height; - f.size.height -= f.origin.y; - - [self setTableView:[[[UITableView alloc] initWithFrame:f style:UITableViewStyleGrouped] autorelease]]; - [[self tableView] setDelegate:self]; - [[self tableView] setDataSource:self]; - [[self tableView] setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; - [[self view] addSubview:[self tableView]]; - - // Force reload the table content, and focus the first field to show the keyboard - [[self tableView] reloadData]; - [[[[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]].contentView subviews] objectAtIndex:0] becomeFirstResponder]; - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 - if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { - [self setModalPresentationStyle:UIModalPresentationFormSheet]; - } -#endif - - if([[self presentingController] respondsToSelector:@selector(presentViewController:animated:completion:)]){ - [[self presentingController] presentViewController:self animated:YES completion:nil]; - }else{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [[self presentingController] presentModalViewController:self animated:YES]; -#pragma clang diagnostic pop - } -} - -#pragma mark button callbacks - -- (void)cancelAuthenticationFromDialog:(id)sender -{ - for (ASIHTTPRequest *theRequest in [self requestsRequiringTheseCredentials]) { - [theRequest cancelAuthentication]; - [requestsNeedingAuthentication removeObject:theRequest]; - } - [self dismiss]; -} - -- (NSArray *)requestsRequiringTheseCredentials -{ - NSMutableArray *requestsRequiringTheseCredentials = [NSMutableArray array]; - NSURL *requestURL = [[self request] url]; - for (ASIHTTPRequest *otherRequest in requestsNeedingAuthentication) { - NSURL *theURL = [otherRequest url]; - if (([otherRequest authenticationNeeded] == [[self request] authenticationNeeded]) && [[theURL host] isEqualToString:[requestURL host]] && ([theURL port] == [requestURL port] || ([requestURL port] && [[theURL port] isEqualToNumber:[requestURL port]])) && [[theURL scheme] isEqualToString:[requestURL scheme]] && ((![otherRequest authenticationRealm] && ![[self request] authenticationRealm]) || ([otherRequest authenticationRealm] && [[self request] authenticationRealm] && [[[self request] authenticationRealm] isEqualToString:[otherRequest authenticationRealm]]))) { - [requestsRequiringTheseCredentials addObject:otherRequest]; - } - } - [requestsRequiringTheseCredentials addObject:[self request]]; - return requestsRequiringTheseCredentials; -} - -- (void)presentNextDialog -{ - if ([requestsNeedingAuthentication count]) { - ASIHTTPRequest *nextRequest = [requestsNeedingAuthentication objectAtIndex:0]; - [requestsNeedingAuthentication removeObjectAtIndex:0]; - [[self class] presentAuthenticationDialogForRequest:nextRequest]; - } -} - - -- (void)loginWithCredentialsFromDialog:(id)sender -{ - for (ASIHTTPRequest *theRequest in [self requestsRequiringTheseCredentials]) { - - NSString *username = [[self usernameField] text]; - NSString *password = [[self passwordField] text]; - - if (username == nil) { username = @""; } - if (password == nil) { password = @""; } - - if ([self type] == ASIProxyAuthenticationType) { - [theRequest setProxyUsername:username]; - [theRequest setProxyPassword:password]; - } else { - [theRequest setUsername:username]; - [theRequest setPassword:password]; - } - - // Handle NTLM domains - NSString *scheme = ([self type] == ASIStandardAuthenticationType) ? [[self request] authenticationScheme] : [[self request] proxyAuthenticationScheme]; - if ([scheme isEqualToString:(NSString *)kCFHTTPAuthenticationSchemeNTLM]) { - NSString *domain = [[self domainField] text]; - if ([self type] == ASIProxyAuthenticationType) { - [theRequest setProxyDomain:domain]; - } else { - [theRequest setDomain:domain]; - } - } - - [theRequest retryUsingSuppliedCredentials]; - [requestsNeedingAuthentication removeObject:theRequest]; - } - [self dismiss]; -} - -#pragma mark table view data source - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView -{ - NSString *scheme = ([self type] == ASIStandardAuthenticationType) ? [[self request] authenticationScheme] : [[self request] proxyAuthenticationScheme]; - if ([scheme isEqualToString:(NSString *)kCFHTTPAuthenticationSchemeNTLM]) { - return 2; - } - return 1; -} - -- (CGFloat)tableView:(UITableView *)aTableView heightForFooterInSection:(NSInteger)section -{ - if (section == [self numberOfSectionsInTableView:aTableView]-1) { - return 30; - } - return 0; -} - -- (CGFloat)tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger)section -{ - if (section == 0) { -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 - if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { - return 54; - } -#endif - return 30; - } - return 0; -} - -- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section -{ - if (section == 0) { - return [[self request] authenticationRealm]; - } - return nil; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0 - UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease]; -#else - UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CGRectMake(0,0,0,0) reuseIdentifier:nil] autorelease]; -#endif - - [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; - - CGRect f = CGRectInset([cell bounds], 10, 10); - UITextField *textField = [[[UITextField alloc] initWithFrame:f] autorelease]; - [textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; - [textField setAutocapitalizationType:UITextAutocapitalizationTypeNone]; - [textField setAutocorrectionType:UITextAutocorrectionTypeNo]; - - NSUInteger s = [indexPath section]; - NSUInteger r = [indexPath row]; - - if (s == kUsernameSection && r == kUsernameRow) { - [textField setPlaceholder:@"User"]; - } else if (s == kPasswordSection && r == kPasswordRow) { - [textField setPlaceholder:@"Password"]; - [textField setSecureTextEntry:YES]; - } else if (s == kDomainSection && r == kDomainRow) { - [textField setPlaceholder:@"Domain"]; - } - [cell.contentView addSubview:textField]; - - return cell; -} - -- (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section -{ - if (section == 0) { - return 2; - } else { - return 1; - } -} - -- (NSString *)tableView:(UITableView *)aTableView titleForFooterInSection:(NSInteger)section -{ - if (section == [self numberOfSectionsInTableView:aTableView]-1) { - // If we're using Basic authentication and the connection is not using SSL, we'll show the plain text message - if ([[[self request] authenticationScheme] isEqualToString:(NSString *)kCFHTTPAuthenticationSchemeBasic] && ![[[[self request] url] scheme] isEqualToString:@"https"]) { - return @"Password will be sent in the clear."; - // We are using Digest, NTLM, or any scheme over SSL - } else { - return @"Password will be sent securely."; - } - } - return nil; -} - -#pragma mark - - -@synthesize request; -@synthesize type; -@synthesize tableView; -@synthesize didEnableRotationNotifications; -@synthesize presentingController; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASICacheDelegate.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASICacheDelegate.h deleted file mode 100644 index 060cda59..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASICacheDelegate.h +++ /dev/null @@ -1,103 +0,0 @@ -// -// ASICacheDelegate.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 01/05/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -#import -@class ASIHTTPRequest; - -// Cache policies control the behaviour of a cache and how requests use the cache -// When setting a cache policy, you can use a combination of these values as a bitmask -// For example: [request setCachePolicy:ASIAskServerIfModifiedCachePolicy|ASIFallbackToCacheIfLoadFailsCachePolicy|ASIDoNotWriteToCacheCachePolicy]; -// Note that some of the behaviours below are mutally exclusive - you cannot combine ASIAskServerIfModifiedWhenStaleCachePolicy and ASIAskServerIfModifiedCachePolicy, for example. -typedef enum _ASICachePolicy { - - // The default cache policy. When you set a request to use this, it will use the cache's defaultCachePolicy - // ASIDownloadCache's default cache policy is 'ASIAskServerIfModifiedWhenStaleCachePolicy' - ASIUseDefaultCachePolicy = 0, - - // Tell the request not to read from the cache - ASIDoNotReadFromCacheCachePolicy = 1, - - // The the request not to write to the cache - ASIDoNotWriteToCacheCachePolicy = 2, - - // Ask the server if there is an updated version of this resource (using a conditional GET) ONLY when the cached data is stale - ASIAskServerIfModifiedWhenStaleCachePolicy = 4, - - // Always ask the server if there is an updated version of this resource (using a conditional GET) - ASIAskServerIfModifiedCachePolicy = 8, - - // If cached data exists, use it even if it is stale. This means requests will not talk to the server unless the resource they are requesting is not in the cache - ASIOnlyLoadIfNotCachedCachePolicy = 16, - - // If cached data exists, use it even if it is stale. If cached data does not exist, stop (will not set an error on the request) - ASIDontLoadCachePolicy = 32, - - // Specifies that cached data may be used if the request fails. If cached data is used, the request will succeed without error. Usually used in combination with other options above. - ASIFallbackToCacheIfLoadFailsCachePolicy = 64 -} ASICachePolicy; - -// Cache storage policies control whether cached data persists between application launches (ASICachePermanentlyCacheStoragePolicy) or not (ASICacheForSessionDurationCacheStoragePolicy) -// Calling [ASIHTTPRequest clearSession] will remove any data stored using ASICacheForSessionDurationCacheStoragePolicy -typedef enum _ASICacheStoragePolicy { - ASICacheForSessionDurationCacheStoragePolicy = 0, - ASICachePermanentlyCacheStoragePolicy = 1 -} ASICacheStoragePolicy; - - -@protocol ASICacheDelegate - -@required - -// Should return the cache policy that will be used when requests have their cache policy set to ASIUseDefaultCachePolicy -- (ASICachePolicy)defaultCachePolicy; - -// Returns the date a cached response should expire on. Pass a non-zero max age to specify a custom date. -- (NSDate *)expiryDateForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterval)maxAge; - -// Updates cached response headers with a new expiry date. Pass a non-zero max age to specify a custom date. -- (void)updateExpiryForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterval)maxAge; - -// Looks at the request's cache policy and any cached headers to determine if the cache data is still valid -- (BOOL)canUseCachedDataForRequest:(ASIHTTPRequest *)request; - -// Removes cached data for a particular request -- (void)removeCachedDataForRequest:(ASIHTTPRequest *)request; - -// Should return YES if the cache considers its cached response current for the request -// Should return NO is the data is not cached, or (for example) if the cached headers state the request should have expired -- (BOOL)isCachedDataCurrentForRequest:(ASIHTTPRequest *)request; - -// Should store the response for the passed request in the cache -// When a non-zero maxAge is passed, it should be used as the expiry time for the cached response -- (void)storeResponseForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterval)maxAge; - -// Removes cached data for a particular url -- (void)removeCachedDataForURL:(NSURL *)url; - -// Should return an NSDictionary of cached headers for the passed URL, if it is stored in the cache -- (NSDictionary *)cachedResponseHeadersForURL:(NSURL *)url; - -// Should return the cached body of a response for the passed URL, if it is stored in the cache -- (NSData *)cachedResponseDataForURL:(NSURL *)url; - -// Returns a path to the cached response data, if it exists -- (NSString *)pathToCachedResponseDataForURL:(NSURL *)url; - -// Returns a path to the cached response headers, if they url -- (NSString *)pathToCachedResponseHeadersForURL:(NSURL *)url; - -// Returns the location to use to store cached response headers for a particular request -- (NSString *)pathToStoreCachedResponseHeadersForRequest:(ASIHTTPRequest *)request; - -// Returns the location to use to store a cached response body for a particular request -- (NSString *)pathToStoreCachedResponseDataForRequest:(ASIHTTPRequest *)request; - -// Clear cached data stored for the passed storage policy -- (void)clearCachedResponsesForStoragePolicy:(ASICacheStoragePolicy)cachePolicy; - -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataCompressor.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataCompressor.h deleted file mode 100644 index ae0e441a..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataCompressor.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// ASIDataCompressor.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 17/08/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -// This is a helper class used by ASIHTTPRequest to handle deflating (compressing) data in memory and on disk -// You may also find it helpful if you need to deflate data and files yourself - see the class methods below -// Most of the zlib stuff is based on the sample code by Mark Adler available at http://zlib.net - -#import -#import - -@interface ASIDataCompressor : NSObject { - BOOL streamReady; - z_stream zStream; -} - -// Convenience constructor will call setupStream for you -+ (id)compressor; - -// Compress the passed chunk of data -// Passing YES for shouldFinish will finalize the deflated data - you must pass YES when you are on the last chunk of data -- (NSData *)compressBytes:(Bytef *)bytes length:(NSUInteger)length error:(NSError **)err shouldFinish:(BOOL)shouldFinish; - -// Convenience method - pass it some data, and you'll get deflated data back -+ (NSData *)compressData:(NSData*)uncompressedData error:(NSError **)err; - -// Convenience method - pass it a file containing the data to compress in sourcePath, and it will write deflated data to destinationPath -+ (BOOL)compressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinationPath error:(NSError **)err; - -// Sets up zlib to handle the inflating. You only need to call this yourself if you aren't using the convenience constructor 'compressor' -- (NSError *)setupStream; - -// Tells zlib to clean up. You need to call this if you need to cancel deflating part way through -// If deflating finishes or fails, this method will be called automatically -- (NSError *)closeStream; - -@property (assign, readonly) BOOL streamReady; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataCompressor.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataCompressor.m deleted file mode 100644 index c9a5cd55..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataCompressor.m +++ /dev/null @@ -1,219 +0,0 @@ -// -// ASIDataCompressor.m -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 17/08/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -#import "ASIDataCompressor.h" -#import "ASIHTTPRequest.h" - -#define DATA_CHUNK_SIZE 262144 // Deal with gzipped data in 256KB chunks -#define COMPRESSION_AMOUNT Z_DEFAULT_COMPRESSION - -@interface ASIDataCompressor () -+ (NSError *)deflateErrorWithCode:(int)code; -@end - -@implementation ASIDataCompressor - -+ (id)compressor -{ - ASIDataCompressor *compressor = [[[self alloc] init] autorelease]; - [compressor setupStream]; - return compressor; -} - -- (void)dealloc -{ - if (streamReady) { - [self closeStream]; - } - [super dealloc]; -} - -- (NSError *)setupStream -{ - if (streamReady) { - return nil; - } - // Setup the inflate stream - zStream.zalloc = Z_NULL; - zStream.zfree = Z_NULL; - zStream.opaque = Z_NULL; - zStream.avail_in = 0; - zStream.next_in = 0; - int status = deflateInit2(&zStream, COMPRESSION_AMOUNT, Z_DEFLATED, (15+16), 8, Z_DEFAULT_STRATEGY); - if (status != Z_OK) { - return [[self class] deflateErrorWithCode:status]; - } - streamReady = YES; - return nil; -} - -- (NSError *)closeStream -{ - if (!streamReady) { - return nil; - } - // Close the deflate stream - streamReady = NO; - int status = deflateEnd(&zStream); - if (status != Z_OK) { - return [[self class] deflateErrorWithCode:status]; - } - return nil; -} - -- (NSData *)compressBytes:(Bytef *)bytes length:(NSUInteger)length error:(NSError **)err shouldFinish:(BOOL)shouldFinish -{ - if (length == 0) return nil; - - NSUInteger halfLength = length/2; - - // We'll take a guess that the compressed data will fit in half the size of the original (ie the max to compress at once is half DATA_CHUNK_SIZE), if not, we'll increase it below - NSMutableData *outputData = [NSMutableData dataWithLength:length/2]; - - int status; - - zStream.next_in = bytes; - zStream.avail_in = (unsigned int)length; - zStream.avail_out = 0; - - NSInteger bytesProcessedAlready = zStream.total_out; - while (zStream.avail_out == 0) { - - if (zStream.total_out-bytesProcessedAlready >= [outputData length]) { - [outputData increaseLengthBy:halfLength]; - } - - zStream.next_out = (Bytef*)[outputData mutableBytes] + zStream.total_out-bytesProcessedAlready; - zStream.avail_out = (unsigned int)([outputData length] - (zStream.total_out-bytesProcessedAlready)); - status = deflate(&zStream, shouldFinish ? Z_FINISH : Z_NO_FLUSH); - - if (status == Z_STREAM_END) { - break; - } else if (status != Z_OK) { - if (err) { - *err = [[self class] deflateErrorWithCode:status]; - } - return NO; - } - } - - // Set real length - [outputData setLength: zStream.total_out-bytesProcessedAlready]; - return outputData; -} - - -+ (NSData *)compressData:(NSData*)uncompressedData error:(NSError **)err -{ - NSError *theError = nil; - NSData *outputData = [[ASIDataCompressor compressor] compressBytes:(Bytef *)[uncompressedData bytes] length:[uncompressedData length] error:&theError shouldFinish:YES]; - if (theError) { - if (err) { - *err = theError; - } - return nil; - } - return outputData; -} - - - -+ (BOOL)compressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinationPath error:(NSError **)err -{ - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - // Create an empty file at the destination path - if (![fileManager createFileAtPath:destinationPath contents:[NSData data] attributes:nil]) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were to create a file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,nil]]; - } - return NO; - } - - // Ensure the source file exists - if (![fileManager fileExistsAtPath:sourcePath]) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed the file does not exist",sourcePath],NSLocalizedDescriptionKey,nil]]; - } - return NO; - } - - UInt8 inputData[DATA_CHUNK_SIZE]; - NSData *outputData; - NSInteger readLength; - NSError *theError = nil; - - ASIDataCompressor *compressor = [ASIDataCompressor compressor]; - - NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:sourcePath]; - [inputStream open]; - NSOutputStream *outputStream = [NSOutputStream outputStreamToFileAtPath:destinationPath append:NO]; - [outputStream open]; - - while ([compressor streamReady]) { - - // Read some data from the file - readLength = [inputStream read:inputData maxLength:DATA_CHUNK_SIZE]; - - // Make sure nothing went wrong - if ([inputStream streamStatus] == NSStreamStatusError) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to read from the source data file",sourcePath],NSLocalizedDescriptionKey,[inputStream streamError],NSUnderlyingErrorKey,nil]]; - } - [compressor closeStream]; - return NO; - } - // Have we reached the end of the input data? - if (!readLength) { - break; - } - - // Attempt to deflate the chunk of data - outputData = [compressor compressBytes:inputData length:readLength error:&theError shouldFinish:readLength < DATA_CHUNK_SIZE ]; - if (theError) { - if (err) { - *err = theError; - } - [compressor closeStream]; - return NO; - } - - // Write the deflated data out to the destination file - [outputStream write:(const uint8_t *)[outputData bytes] maxLength:[outputData length]]; - - // Make sure nothing went wrong - if ([inputStream streamStatus] == NSStreamStatusError) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to write to the destination data file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]]; - } - [compressor closeStream]; - return NO; - } - - } - [inputStream close]; - [outputStream close]; - - NSError *error = [compressor closeStream]; - if (error) { - if (err) { - *err = error; - } - return NO; - } - - return YES; -} - -+ (NSError *)deflateErrorWithCode:(int)code -{ - return [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of data failed with code %d",code],NSLocalizedDescriptionKey,nil]]; -} - -@synthesize streamReady; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataDecompressor.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataDecompressor.h deleted file mode 100644 index 8be8f9b5..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataDecompressor.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// ASIDataDecompressor.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 17/08/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -// This is a helper class used by ASIHTTPRequest to handle inflating (decompressing) data in memory and on disk -// You may also find it helpful if you need to inflate data and files yourself - see the class methods below -// Most of the zlib stuff is based on the sample code by Mark Adler available at http://zlib.net - -#import -#import - -@interface ASIDataDecompressor : NSObject { - BOOL streamReady; - z_stream zStream; -} - -// Convenience constructor will call setupStream for you -+ (id)decompressor; - -// Uncompress the passed chunk of data -- (NSData *)uncompressBytes:(Bytef *)bytes length:(NSUInteger)length error:(NSError **)err; - -// Convenience method - pass it some deflated data, and you'll get inflated data back -+ (NSData *)uncompressData:(NSData*)compressedData error:(NSError **)err; - -// Convenience method - pass it a file containing deflated data in sourcePath, and it will write inflated data to destinationPath -+ (BOOL)uncompressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinationPath error:(NSError **)err; - -// Sets up zlib to handle the inflating. You only need to call this yourself if you aren't using the convenience constructor 'decompressor' -- (NSError *)setupStream; - -// Tells zlib to clean up. You need to call this if you need to cancel inflating part way through -// If inflating finishes or fails, this method will be called automatically -- (NSError *)closeStream; - -@property (assign, readonly) BOOL streamReady; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataDecompressor.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataDecompressor.m deleted file mode 100644 index e84a1e31..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDataDecompressor.m +++ /dev/null @@ -1,218 +0,0 @@ -// -// ASIDataDecompressor.m -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 17/08/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -#import "ASIDataDecompressor.h" -#import "ASIHTTPRequest.h" - -#define DATA_CHUNK_SIZE 262144 // Deal with gzipped data in 256KB chunks - -@interface ASIDataDecompressor () -+ (NSError *)inflateErrorWithCode:(int)code; -@end; - -@implementation ASIDataDecompressor - -+ (id)decompressor -{ - ASIDataDecompressor *decompressor = [[[self alloc] init] autorelease]; - [decompressor setupStream]; - return decompressor; -} - -- (void)dealloc -{ - if (streamReady) { - [self closeStream]; - } - [super dealloc]; -} - -- (NSError *)setupStream -{ - if (streamReady) { - return nil; - } - // Setup the inflate stream - zStream.zalloc = Z_NULL; - zStream.zfree = Z_NULL; - zStream.opaque = Z_NULL; - zStream.avail_in = 0; - zStream.next_in = 0; - int status = inflateInit2(&zStream, (15+32)); - if (status != Z_OK) { - return [[self class] inflateErrorWithCode:status]; - } - streamReady = YES; - return nil; -} - -- (NSError *)closeStream -{ - if (!streamReady) { - return nil; - } - // Close the inflate stream - streamReady = NO; - int status = inflateEnd(&zStream); - if (status != Z_OK) { - return [[self class] inflateErrorWithCode:status]; - } - return nil; -} - -- (NSData *)uncompressBytes:(Bytef *)bytes length:(NSUInteger)length error:(NSError **)err -{ - if (length == 0) return nil; - - NSUInteger halfLength = length/2; - NSMutableData *outputData = [NSMutableData dataWithLength:length+halfLength]; - - int status; - - zStream.next_in = bytes; - zStream.avail_in = (unsigned int)length; - zStream.avail_out = 0; - - NSInteger bytesProcessedAlready = zStream.total_out; - while (zStream.avail_in != 0) { - - if (zStream.total_out-bytesProcessedAlready >= [outputData length]) { - [outputData increaseLengthBy:halfLength]; - } - - zStream.next_out = (Bytef*)[outputData mutableBytes] + zStream.total_out-bytesProcessedAlready; - zStream.avail_out = (unsigned int)([outputData length] - (zStream.total_out-bytesProcessedAlready)); - - status = inflate(&zStream, Z_NO_FLUSH); - - if (status == Z_STREAM_END) { - break; - } else if (status != Z_OK) { - if (err) { - *err = [[self class] inflateErrorWithCode:status]; - } - return nil; - } - } - - // Set real length - [outputData setLength: zStream.total_out-bytesProcessedAlready]; - return outputData; -} - - -+ (NSData *)uncompressData:(NSData*)compressedData error:(NSError **)err -{ - NSError *theError = nil; - NSData *outputData = [[ASIDataDecompressor decompressor] uncompressBytes:(Bytef *)[compressedData bytes] length:[compressedData length] error:&theError]; - if (theError) { - if (err) { - *err = theError; - } - return nil; - } - return outputData; -} - -+ (BOOL)uncompressDataFromFile:(NSString *)sourcePath toFile:(NSString *)destinationPath error:(NSError **)err -{ - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - // Create an empty file at the destination path - if (![fileManager createFileAtPath:destinationPath contents:[NSData data] attributes:nil]) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of %@ failed because we were to create a file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,nil]]; - } - return NO; - } - - // Ensure the source file exists - if (![fileManager fileExistsAtPath:sourcePath]) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of %@ failed the file does not exist",sourcePath],NSLocalizedDescriptionKey,nil]]; - } - return NO; - } - - UInt8 inputData[DATA_CHUNK_SIZE]; - NSData *outputData; - NSInteger readLength; - NSError *theError = nil; - - - ASIDataDecompressor *decompressor = [ASIDataDecompressor decompressor]; - - NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:sourcePath]; - [inputStream open]; - NSOutputStream *outputStream = [NSOutputStream outputStreamToFileAtPath:destinationPath append:NO]; - [outputStream open]; - - while ([decompressor streamReady]) { - - // Read some data from the file - readLength = [inputStream read:inputData maxLength:DATA_CHUNK_SIZE]; - - // Make sure nothing went wrong - if ([inputStream streamStatus] == NSStreamStatusError) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of %@ failed because we were unable to read from the source data file",sourcePath],NSLocalizedDescriptionKey,[inputStream streamError],NSUnderlyingErrorKey,nil]]; - } - [decompressor closeStream]; - return NO; - } - // Have we reached the end of the input data? - if (!readLength) { - break; - } - - // Attempt to inflate the chunk of data - outputData = [decompressor uncompressBytes:inputData length:readLength error:&theError]; - if (theError) { - if (err) { - *err = theError; - } - [decompressor closeStream]; - return NO; - } - - // Write the inflated data out to the destination file - [outputStream write:(Bytef*)[outputData bytes] maxLength:[outputData length]]; - - // Make sure nothing went wrong - if ([inputStream streamStatus] == NSStreamStatusError) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of %@ failed because we were unable to write to the destination data file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]]; - } - [decompressor closeStream]; - return NO; - } - - } - - [inputStream close]; - [outputStream close]; - - NSError *error = [decompressor closeStream]; - if (error) { - if (err) { - *err = error; - } - return NO; - } - - return YES; -} - - -+ (NSError *)inflateErrorWithCode:(int)code -{ - return [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Decompression of data failed with code %d",code],NSLocalizedDescriptionKey,nil]]; -} - -@synthesize streamReady; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDownloadCache.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDownloadCache.h deleted file mode 100644 index a2df9084..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDownloadCache.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// ASIDownloadCache.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 01/05/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -#import -#import "ASICacheDelegate.h" - -@interface ASIDownloadCache : NSObject { - - // The default cache policy for this cache - // Requests that store data in the cache will use this cache policy if their cache policy is set to ASIUseDefaultCachePolicy - // Defaults to ASIAskServerIfModifiedWhenStaleCachePolicy - ASICachePolicy defaultCachePolicy; - - // The directory in which cached data will be stored - // Defaults to a directory called 'ASIHTTPRequestCache' in the temporary directory - NSString *storagePath; - - // Mediates access to the cache - NSRecursiveLock *accessLock; - - // When YES, the cache will look for cache-control / pragma: no-cache headers, and won't reuse store responses if it finds them - BOOL shouldRespectCacheControlHeaders; -} - -// Returns a static instance of an ASIDownloadCache -// In most circumstances, it will make sense to use this as a global cache, rather than creating your own cache -// To make ASIHTTPRequests use it automatically, use [ASIHTTPRequest setDefaultCache:[ASIDownloadCache sharedCache]]; -+ (id)sharedCache; - -// A helper function that determines if the server has requested data should not be cached by looking at the request's response headers -+ (BOOL)serverAllowsResponseCachingForRequest:(ASIHTTPRequest *)request; - -// A list of file extensions that we know won't be readable by a webview when accessed locally -// If we're asking for a path to cache a particular url and it has one of these extensions, we change it to '.html' -+ (NSArray *)fileExtensionsToHandleAsHTML; - -@property (assign, nonatomic) ASICachePolicy defaultCachePolicy; -@property (retain, nonatomic) NSString *storagePath; -@property (retain) NSRecursiveLock *accessLock; -@property (assign) BOOL shouldRespectCacheControlHeaders; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDownloadCache.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDownloadCache.m deleted file mode 100644 index 93da36fb..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIDownloadCache.m +++ /dev/null @@ -1,514 +0,0 @@ -// -// ASIDownloadCache.m -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 01/05/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -#import "ASIDownloadCache.h" -#import "ASIHTTPRequest.h" -#import - -static ASIDownloadCache *sharedCache = nil; - -static NSString *sessionCacheFolder = @"SessionStore"; -static NSString *permanentCacheFolder = @"PermanentStore"; -static NSArray *fileExtensionsToHandleAsHTML = nil; - -@interface ASIDownloadCache () -+ (NSString *)keyForURL:(NSURL *)url; -- (NSString *)pathToFile:(NSString *)file; -@end - -@implementation ASIDownloadCache - -+ (void)initialize -{ - if (self == [ASIDownloadCache class]) { - // Obviously this is not an exhaustive list, but hopefully these are the most commonly used and this will 'just work' for the widest range of people - // I imagine many web developers probably use url rewriting anyway - fileExtensionsToHandleAsHTML = [[NSArray alloc] initWithObjects:@"asp",@"aspx",@"jsp",@"php",@"rb",@"py",@"pl",@"cgi", nil]; - } -} - -- (id)init -{ - self = [super init]; - [self setShouldRespectCacheControlHeaders:YES]; - [self setDefaultCachePolicy:ASIUseDefaultCachePolicy]; - [self setAccessLock:[[[NSRecursiveLock alloc] init] autorelease]]; - return self; -} - -+ (id)sharedCache -{ - if (!sharedCache) { - @synchronized(self) { - if (!sharedCache) { - sharedCache = [[self alloc] init]; - [sharedCache setStoragePath:[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"ASIHTTPRequestCache"]]; - } - } - } - return sharedCache; -} - -- (void)dealloc -{ - [storagePath release]; - [accessLock release]; - [super dealloc]; -} - -- (NSString *)storagePath -{ - [[self accessLock] lock]; - NSString *p = [[storagePath retain] autorelease]; - [[self accessLock] unlock]; - return p; -} - - -- (void)setStoragePath:(NSString *)path -{ - [[self accessLock] lock]; - [self clearCachedResponsesForStoragePolicy:ASICacheForSessionDurationCacheStoragePolicy]; - [storagePath release]; - storagePath = [path retain]; - - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - BOOL isDirectory = NO; - NSArray *directories = [NSArray arrayWithObjects:path,[path stringByAppendingPathComponent:sessionCacheFolder],[path stringByAppendingPathComponent:permanentCacheFolder],nil]; - for (NSString *directory in directories) { - BOOL exists = [fileManager fileExistsAtPath:directory isDirectory:&isDirectory]; - if (exists && !isDirectory) { - [[self accessLock] unlock]; - [NSException raise:@"FileExistsAtCachePath" format:@"Cannot create a directory for the cache at '%@', because a file already exists",directory]; - } else if (!exists) { - [fileManager createDirectoryAtPath:directory withIntermediateDirectories:NO attributes:nil error:nil]; - if (![fileManager fileExistsAtPath:directory]) { - [[self accessLock] unlock]; - [NSException raise:@"FailedToCreateCacheDirectory" format:@"Failed to create a directory for the cache at '%@'",directory]; - } - } - } - [self clearCachedResponsesForStoragePolicy:ASICacheForSessionDurationCacheStoragePolicy]; - [[self accessLock] unlock]; -} - -- (void)updateExpiryForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterval)maxAge -{ - NSString *headerPath = [self pathToStoreCachedResponseHeadersForRequest:request]; - NSMutableDictionary *cachedHeaders = [NSMutableDictionary dictionaryWithContentsOfFile:headerPath]; - if (!cachedHeaders) { - return; - } - NSDate *expires = [self expiryDateForRequest:request maxAge:maxAge]; - if (!expires) { - return; - } - [cachedHeaders setObject:[NSNumber numberWithDouble:[expires timeIntervalSince1970]] forKey:@"X-ASIHTTPRequest-Expires"]; - [cachedHeaders writeToFile:headerPath atomically:NO]; -} - -- (NSDate *)expiryDateForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterval)maxAge -{ - return [ASIHTTPRequest expiryDateForRequest:request maxAge:maxAge]; -} - -- (void)storeResponseForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterval)maxAge -{ - [[self accessLock] lock]; - - if ([request error] || ![request responseHeaders] || ([request cachePolicy] & ASIDoNotWriteToCacheCachePolicy)) { - [[self accessLock] unlock]; - return; - } - - // We only cache 200/OK or redirect reponses (redirect responses are cached so the cache works better with no internet connection) - int responseCode = [request responseStatusCode]; - if (responseCode != 200 && responseCode != 301 && responseCode != 302 && responseCode != 303 && responseCode != 307) { - [[self accessLock] unlock]; - return; - } - - if ([self shouldRespectCacheControlHeaders] && ![[self class] serverAllowsResponseCachingForRequest:request]) { - [[self accessLock] unlock]; - return; - } - - NSString *headerPath = [self pathToStoreCachedResponseHeadersForRequest:request]; - NSString *dataPath = [self pathToStoreCachedResponseDataForRequest:request]; - - NSMutableDictionary *responseHeaders = [NSMutableDictionary dictionaryWithDictionary:[request responseHeaders]]; - if ([request isResponseCompressed]) { - [responseHeaders removeObjectForKey:@"Content-Encoding"]; - } - - // Create a special 'X-ASIHTTPRequest-Expires' header - // This is what we use for deciding if cached data is current, rather than parsing the expires / max-age headers individually each time - // We store this as a timestamp to make reading it easier as NSDateFormatter is quite expensive - - NSDate *expires = [self expiryDateForRequest:request maxAge:maxAge]; - if (expires) { - [responseHeaders setObject:[NSNumber numberWithDouble:[expires timeIntervalSince1970]] forKey:@"X-ASIHTTPRequest-Expires"]; - } - - // Store the response code in a custom header so we can reuse it later - - // We'll change 304/Not Modified to 200/OK because this is likely to be us updating the cached headers with a conditional GET - int statusCode = [request responseStatusCode]; - if (statusCode == 304) { - statusCode = 200; - } - [responseHeaders setObject:[NSNumber numberWithInt:statusCode] forKey:@"X-ASIHTTPRequest-Response-Status-Code"]; - - [responseHeaders writeToFile:headerPath atomically:NO]; - - if ([request responseData]) { - [[request responseData] writeToFile:dataPath atomically:NO]; - } else if ([request downloadDestinationPath] && ![[request downloadDestinationPath] isEqualToString:dataPath]) { - NSError *error = nil; - NSFileManager* manager = [[NSFileManager alloc] init]; - if ([manager fileExistsAtPath:dataPath]) { - [manager removeItemAtPath:dataPath error:&error]; - } - [manager copyItemAtPath:[request downloadDestinationPath] toPath:dataPath error:&error]; - [manager release]; - } - [[self accessLock] unlock]; -} - -- (NSDictionary *)cachedResponseHeadersForURL:(NSURL *)url -{ - NSString *path = [self pathToCachedResponseHeadersForURL:url]; - if (path) { - return [NSDictionary dictionaryWithContentsOfFile:path]; - } - return nil; -} - -- (NSData *)cachedResponseDataForURL:(NSURL *)url -{ - NSString *path = [self pathToCachedResponseDataForURL:url]; - if (path) { - return [NSData dataWithContentsOfFile:path]; - } - return nil; -} - -- (NSString *)pathToCachedResponseDataForURL:(NSURL *)url -{ - // Grab the file extension, if there is one. We do this so we can save the cached response with the same file extension - this is important if you want to display locally cached data in a web view - NSString *extension = [[url path] pathExtension]; - - // If the url doesn't have an extension, we'll add one so a webview can read it when locally cached - // If the url has the extension of a common web scripting language, we'll change the extension on the cached path to html for the same reason - if (![extension length] || [[[self class] fileExtensionsToHandleAsHTML] containsObject:[extension lowercaseString]]) { - extension = @"html"; - } - return [self pathToFile:[[[self class] keyForURL:url] stringByAppendingPathExtension:extension]]; -} - -+ (NSArray *)fileExtensionsToHandleAsHTML -{ - return fileExtensionsToHandleAsHTML; -} - - -- (NSString *)pathToCachedResponseHeadersForURL:(NSURL *)url -{ - return [self pathToFile:[[[self class] keyForURL:url] stringByAppendingPathExtension:@"cachedheaders"]]; -} - -- (NSString *)pathToFile:(NSString *)file -{ - [[self accessLock] lock]; - if (![self storagePath]) { - [[self accessLock] unlock]; - return nil; - } - - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - // Look in the session store - NSString *dataPath = [[[self storagePath] stringByAppendingPathComponent:sessionCacheFolder] stringByAppendingPathComponent:file]; - if ([fileManager fileExistsAtPath:dataPath]) { - [[self accessLock] unlock]; - return dataPath; - } - // Look in the permanent store - dataPath = [[[self storagePath] stringByAppendingPathComponent:permanentCacheFolder] stringByAppendingPathComponent:file]; - if ([fileManager fileExistsAtPath:dataPath]) { - [[self accessLock] unlock]; - return dataPath; - } - [[self accessLock] unlock]; - return nil; -} - - -- (NSString *)pathToStoreCachedResponseDataForRequest:(ASIHTTPRequest *)request -{ - [[self accessLock] lock]; - if (![self storagePath]) { - [[self accessLock] unlock]; - return nil; - } - - NSString *path = [[self storagePath] stringByAppendingPathComponent:([request cacheStoragePolicy] == ASICacheForSessionDurationCacheStoragePolicy ? sessionCacheFolder : permanentCacheFolder)]; - - // Grab the file extension, if there is one. We do this so we can save the cached response with the same file extension - this is important if you want to display locally cached data in a web view - NSString *extension = [[[request url] path] pathExtension]; - - // If the url doesn't have an extension, we'll add one so a webview can read it when locally cached - // If the url has the extension of a common web scripting language, we'll change the extension on the cached path to html for the same reason - if (![extension length] || [[[self class] fileExtensionsToHandleAsHTML] containsObject:[extension lowercaseString]]) { - extension = @"html"; - } - path = [path stringByAppendingPathComponent:[[[self class] keyForURL:[request url]] stringByAppendingPathExtension:extension]]; - [[self accessLock] unlock]; - return path; -} - -- (NSString *)pathToStoreCachedResponseHeadersForRequest:(ASIHTTPRequest *)request -{ - [[self accessLock] lock]; - if (![self storagePath]) { - [[self accessLock] unlock]; - return nil; - } - NSString *path = [[self storagePath] stringByAppendingPathComponent:([request cacheStoragePolicy] == ASICacheForSessionDurationCacheStoragePolicy ? sessionCacheFolder : permanentCacheFolder)]; - path = [path stringByAppendingPathComponent:[[[self class] keyForURL:[request url]] stringByAppendingPathExtension:@"cachedheaders"]]; - [[self accessLock] unlock]; - return path; -} - -- (void)removeCachedDataForURL:(NSURL *)url -{ - [[self accessLock] lock]; - if (![self storagePath]) { - [[self accessLock] unlock]; - return; - } - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - NSString *path = [self pathToCachedResponseHeadersForURL:url]; - if (path) { - [fileManager removeItemAtPath:path error:NULL]; - } - - path = [self pathToCachedResponseDataForURL:url]; - if (path) { - [fileManager removeItemAtPath:path error:NULL]; - } - [[self accessLock] unlock]; -} - -- (void)removeCachedDataForRequest:(ASIHTTPRequest *)request -{ - [self removeCachedDataForURL:[request url]]; -} - -- (BOOL)isCachedDataCurrentForRequest:(ASIHTTPRequest *)request -{ - [[self accessLock] lock]; - if (![self storagePath]) { - [[self accessLock] unlock]; - return NO; - } - NSDictionary *cachedHeaders = [self cachedResponseHeadersForURL:[request url]]; - if (!cachedHeaders) { - [[self accessLock] unlock]; - return NO; - } - NSString *dataPath = [self pathToCachedResponseDataForURL:[request url]]; - if (!dataPath) { - [[self accessLock] unlock]; - return NO; - } - - // New content is not different - if ([request responseStatusCode] == 304) { - [[self accessLock] unlock]; - return YES; - } - - // If we already have response headers for this request, check to see if the new content is different - // We check [request complete] so that we don't end up comparing response headers from a redirection with these - if ([request responseHeaders] && [request complete]) { - - // If the Etag or Last-Modified date are different from the one we have, we'll have to fetch this resource again - NSArray *headersToCompare = [NSArray arrayWithObjects:@"Etag",@"Last-Modified",nil]; - for (NSString *header in headersToCompare) { - if (![[[request responseHeaders] objectForKey:header] isEqualToString:[cachedHeaders objectForKey:header]]) { - [[self accessLock] unlock]; - return NO; - } - } - } - - if ([self shouldRespectCacheControlHeaders]) { - - // Look for X-ASIHTTPRequest-Expires header to see if the content is out of date - NSNumber *expires = [cachedHeaders objectForKey:@"X-ASIHTTPRequest-Expires"]; - if (expires) { - if ([[NSDate dateWithTimeIntervalSince1970:[expires doubleValue]] timeIntervalSinceNow] >= 0) { - [[self accessLock] unlock]; - return YES; - } - } - - // No explicit expiration time sent by the server - [[self accessLock] unlock]; - return NO; - } - - - [[self accessLock] unlock]; - return YES; -} - -- (ASICachePolicy)defaultCachePolicy -{ - [[self accessLock] lock]; - ASICachePolicy cp = defaultCachePolicy; - [[self accessLock] unlock]; - return cp; -} - - -- (void)setDefaultCachePolicy:(ASICachePolicy)cachePolicy -{ - [[self accessLock] lock]; - if (!cachePolicy) { - defaultCachePolicy = ASIAskServerIfModifiedWhenStaleCachePolicy; - } else { - defaultCachePolicy = cachePolicy; - } - [[self accessLock] unlock]; -} - -- (void)clearCachedResponsesForStoragePolicy:(ASICacheStoragePolicy)storagePolicy -{ - [[self accessLock] lock]; - if (![self storagePath]) { - [[self accessLock] unlock]; - return; - } - NSString *path = [[self storagePath] stringByAppendingPathComponent:(storagePolicy == ASICacheForSessionDurationCacheStoragePolicy ? sessionCacheFolder : permanentCacheFolder)]; - - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - BOOL isDirectory = NO; - BOOL exists = [fileManager fileExistsAtPath:path isDirectory:&isDirectory]; - if (!exists || !isDirectory) { - [[self accessLock] unlock]; - return; - } - NSError *error = nil; - NSArray *cacheFiles = [fileManager contentsOfDirectoryAtPath:path error:&error]; - if (error) { - [[self accessLock] unlock]; - [NSException raise:@"FailedToTraverseCacheDirectory" format:@"Listing cache directory failed at path '%@'",path]; - } - for (NSString *file in cacheFiles) { - [fileManager removeItemAtPath:[path stringByAppendingPathComponent:file] error:&error]; - if (error) { - [[self accessLock] unlock]; - [NSException raise:@"FailedToRemoveCacheFile" format:@"Failed to remove cached data at path '%@'",path]; - } - } - [[self accessLock] unlock]; -} - -+ (BOOL)serverAllowsResponseCachingForRequest:(ASIHTTPRequest *)request -{ - NSString *cacheControl = [[[request responseHeaders] objectForKey:@"Cache-Control"] lowercaseString]; - if (cacheControl) { - if ([cacheControl isEqualToString:@"no-cache"] || [cacheControl isEqualToString:@"no-store"]) { - return NO; - } - } - NSString *pragma = [[[request responseHeaders] objectForKey:@"Pragma"] lowercaseString]; - if (pragma) { - if ([pragma isEqualToString:@"no-cache"]) { - return NO; - } - } - return YES; -} - -+ (NSString *)keyForURL:(NSURL *)url -{ - NSString *urlString = [url absoluteString]; - if ([urlString length] == 0) { - return nil; - } - - // Strip trailing slashes so http://allseeing-i.com/ASIHTTPRequest/ is cached the same as http://allseeing-i.com/ASIHTTPRequest - if ([[urlString substringFromIndex:[urlString length]-1] isEqualToString:@"/"]) { - urlString = [urlString substringToIndex:[urlString length]-1]; - } - - // Borrowed from: http://stackoverflow.com/questions/652300/using-md5-hash-on-a-string-in-cocoa - const char *cStr = [urlString UTF8String]; - unsigned char result[16]; - CC_MD5(cStr, (CC_LONG)strlen(cStr), result); - return [NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7],result[8], result[9], result[10], result[11],result[12], result[13], result[14], result[15]]; -} - -- (BOOL)canUseCachedDataForRequest:(ASIHTTPRequest *)request -{ - // Ensure the request is allowed to read from the cache - if ([request cachePolicy] & ASIDoNotReadFromCacheCachePolicy) { - return NO; - - // If we don't want to load the request whatever happens, always pretend we have cached data even if we don't - } else if ([request cachePolicy] & ASIDontLoadCachePolicy) { - return YES; - } - - NSDictionary *headers = [self cachedResponseHeadersForURL:[request url]]; - if (!headers) { - return NO; - } - NSString *dataPath = [self pathToCachedResponseDataForURL:[request url]]; - if (!dataPath) { - return NO; - } - - // If we get here, we have cached data - - // If we have cached data, we can use it - if ([request cachePolicy] & ASIOnlyLoadIfNotCachedCachePolicy) { - return YES; - - // If we want to fallback to the cache after an error - } else if ([request complete] && [request cachePolicy] & ASIFallbackToCacheIfLoadFailsCachePolicy) { - return YES; - - // If we have cached data that is current, we can use it - } else if ([request cachePolicy] & ASIAskServerIfModifiedWhenStaleCachePolicy) { - if ([self isCachedDataCurrentForRequest:request]) { - return YES; - } - - // If we've got headers from a conditional GET and the cached data is still current, we can use it - } else if ([request cachePolicy] & ASIAskServerIfModifiedCachePolicy) { - if (![request responseHeaders]) { - return NO; - } else if ([self isCachedDataCurrentForRequest:request]) { - return YES; - } - } - return NO; -} - -@synthesize storagePath; -@synthesize defaultCachePolicy; -@synthesize accessLock; -@synthesize shouldRespectCacheControlHeaders; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIFormDataRequest.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIFormDataRequest.h deleted file mode 100644 index 670995f1..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIFormDataRequest.h +++ /dev/null @@ -1,76 +0,0 @@ -// -// ASIFormDataRequest.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 07/11/2008. -// Copyright 2008-2009 All-Seeing Interactive. All rights reserved. -// - -#import -#import "ASIHTTPRequest.h" -#import "ASIHTTPRequestConfig.h" - -typedef enum _ASIPostFormat { - ASIMultipartFormDataPostFormat = 0, - ASIURLEncodedPostFormat = 1 - -} ASIPostFormat; - -@interface ASIFormDataRequest : ASIHTTPRequest { - - // Parameters that will be POSTed to the url - NSMutableArray *postData; - - // Files that will be POSTed to the url - NSMutableArray *fileData; - - ASIPostFormat postFormat; - - NSStringEncoding stringEncoding; - -#if DEBUG_FORM_DATA_REQUEST - // Will store a string version of the request body that will be printed to the console when ASIHTTPREQUEST_DEBUG is set in GCC_PREPROCESSOR_DEFINITIONS - NSString *debugBodyString; -#endif - -} - -#pragma mark utilities -- (NSString*)encodeURL:(NSString *)string; - -#pragma mark setup request - -// Add a POST variable to the request -- (void)addPostValue:(id )value forKey:(NSString *)key; - -// Set a POST variable for this request, clearing any others with the same key -- (void)setPostValue:(id )value forKey:(NSString *)key; - -// Add the contents of a local file to the request -- (void)addFile:(NSString *)filePath forKey:(NSString *)key; - -// Same as above, but you can specify the content-type and file name -- (void)addFile:(NSString *)filePath withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key; - -// Add the contents of a local file to the request, clearing any others with the same key -- (void)setFile:(NSString *)filePath forKey:(NSString *)key; - -// Same as above, but you can specify the content-type and file name -- (void)setFile:(NSString *)filePath withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key; - -// Add the contents of an NSData object to the request -- (void)addData:(NSData *)data forKey:(NSString *)key; - -// Same as above, but you can specify the content-type and file name -- (void)addData:(id)data withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key; - -// Add the contents of an NSData object to the request, clearing any others with the same key -- (void)setData:(NSData *)data forKey:(NSString *)key; - -// Same as above, but you can specify the content-type and file name -- (void)setData:(id)data withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key; - - -@property (assign) ASIPostFormat postFormat; -@property (assign) NSStringEncoding stringEncoding; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIFormDataRequest.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIFormDataRequest.m deleted file mode 100644 index 2d812a04..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIFormDataRequest.m +++ /dev/null @@ -1,362 +0,0 @@ -// -// ASIFormDataRequest.m -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 07/11/2008. -// Copyright 2008-2009 All-Seeing Interactive. All rights reserved. -// - -#import "ASIFormDataRequest.h" - - -// Private stuff -@interface ASIFormDataRequest () -- (void)buildMultipartFormDataPostBody; -- (void)buildURLEncodedPostBody; -- (void)appendPostString:(NSString *)string; - -@property (retain) NSMutableArray *postData; -@property (retain) NSMutableArray *fileData; - -#if DEBUG_FORM_DATA_REQUEST -- (void)addToDebugBody:(NSString *)string; -@property (retain, nonatomic) NSString *debugBodyString; -#endif - -@end - -@implementation ASIFormDataRequest - -#pragma mark utilities -- (NSString*)encodeURL:(NSString *)string -{ - NSString *newString = [NSMakeCollectable(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR(":/?#[]@!$ &'()*+,;=\"<>%{}|\\^~`"), CFStringConvertNSStringEncodingToEncoding([self stringEncoding]))) autorelease]; - if (newString) { - return newString; - } - return @""; -} - -#pragma mark init / dealloc - -+ (id)requestWithURL:(NSURL *)newURL -{ - return [[[self alloc] initWithURL:newURL] autorelease]; -} - -- (id)initWithURL:(NSURL *)newURL -{ - self = [super initWithURL:newURL]; - [self setPostFormat:ASIURLEncodedPostFormat]; - [self setStringEncoding:NSUTF8StringEncoding]; - [self setRequestMethod:@"POST"]; - return self; -} - -- (void)dealloc -{ -#if DEBUG_FORM_DATA_REQUEST - [debugBodyString release]; -#endif - - [postData release]; - [fileData release]; - [super dealloc]; -} - -#pragma mark setup request - -- (void)addPostValue:(id )value forKey:(NSString *)key -{ - if (!key) { - return; - } - if (![self postData]) { - [self setPostData:[NSMutableArray array]]; - } - NSMutableDictionary *keyValuePair = [NSMutableDictionary dictionaryWithCapacity:2]; - [keyValuePair setValue:key forKey:@"key"]; - [keyValuePair setValue:[value description] forKey:@"value"]; - [[self postData] addObject:keyValuePair]; -} - -- (void)setPostValue:(id )value forKey:(NSString *)key -{ - // Remove any existing value - NSUInteger i; - for (i=0; i<[[self postData] count]; i++) { - NSDictionary *val = [[self postData] objectAtIndex:i]; - if ([[val objectForKey:@"key"] isEqualToString:key]) { - [[self postData] removeObjectAtIndex:i]; - i--; - } - } - [self addPostValue:value forKey:key]; -} - - -- (void)addFile:(NSString *)filePath forKey:(NSString *)key -{ - [self addFile:filePath withFileName:nil andContentType:nil forKey:key]; -} - -- (void)addFile:(NSString *)filePath withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key -{ - BOOL isDirectory = NO; - BOOL fileExists = [[[[NSFileManager alloc] init] autorelease] fileExistsAtPath:filePath isDirectory:&isDirectory]; - if (!fileExists || isDirectory) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileBuildingRequestType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"No file exists at %@",filePath],NSLocalizedDescriptionKey,nil]]]; - } - - // If the caller didn't specify a custom file name, we'll use the file name of the file we were passed - if (!fileName) { - fileName = [filePath lastPathComponent]; - } - - // If we were given the path to a file, and the user didn't specify a mime type, we can detect it from the file extension - if (!contentType) { - contentType = [ASIHTTPRequest mimeTypeForFileAtPath:filePath]; - } - [self addData:filePath withFileName:fileName andContentType:contentType forKey:key]; -} - -- (void)setFile:(NSString *)filePath forKey:(NSString *)key -{ - [self setFile:filePath withFileName:nil andContentType:nil forKey:key]; -} - -- (void)setFile:(id)data withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key -{ - // Remove any existing value - NSUInteger i; - for (i=0; i<[[self fileData] count]; i++) { - NSDictionary *val = [[self fileData] objectAtIndex:i]; - if ([[val objectForKey:@"key"] isEqualToString:key]) { - [[self fileData] removeObjectAtIndex:i]; - i--; - } - } - [self addFile:data withFileName:fileName andContentType:contentType forKey:key]; -} - -- (void)addData:(NSData *)data forKey:(NSString *)key -{ - [self addData:data withFileName:@"file" andContentType:nil forKey:key]; -} - -- (void)addData:(id)data withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key -{ - if (![self fileData]) { - [self setFileData:[NSMutableArray array]]; - } - if (!contentType) { - contentType = @"application/octet-stream"; - } - - NSMutableDictionary *fileInfo = [NSMutableDictionary dictionaryWithCapacity:4]; - [fileInfo setValue:key forKey:@"key"]; - [fileInfo setValue:fileName forKey:@"fileName"]; - [fileInfo setValue:contentType forKey:@"contentType"]; - [fileInfo setValue:data forKey:@"data"]; - - [[self fileData] addObject:fileInfo]; -} - -- (void)setData:(NSData *)data forKey:(NSString *)key -{ - [self setData:data withFileName:@"file" andContentType:nil forKey:key]; -} - -- (void)setData:(id)data withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key -{ - // Remove any existing value - NSUInteger i; - for (i=0; i<[[self fileData] count]; i++) { - NSDictionary *val = [[self fileData] objectAtIndex:i]; - if ([[val objectForKey:@"key"] isEqualToString:key]) { - [[self fileData] removeObjectAtIndex:i]; - i--; - } - } - [self addData:data withFileName:fileName andContentType:contentType forKey:key]; -} - -- (void)buildPostBody -{ - if ([self haveBuiltPostBody]) { - return; - } - -#if DEBUG_FORM_DATA_REQUEST - [self setDebugBodyString:@""]; -#endif - - if (![self postData] && ![self fileData]) { - [super buildPostBody]; - return; - } - if ([[self fileData] count] > 0) { - [self setShouldStreamPostDataFromDisk:YES]; - } - - if ([self postFormat] == ASIURLEncodedPostFormat) { - [self buildURLEncodedPostBody]; - } else { - [self buildMultipartFormDataPostBody]; - } - - [super buildPostBody]; - -#if DEBUG_FORM_DATA_REQUEST - ASI_DEBUG_LOG(@"%@",[self debugBodyString]); - [self setDebugBodyString:nil]; -#endif -} - - -- (void)buildMultipartFormDataPostBody -{ -#if DEBUG_FORM_DATA_REQUEST - [self addToDebugBody:@"\r\n==== Building a multipart/form-data body ====\r\n"]; -#endif - - NSString *charset = (NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding([self stringEncoding])); - - // We don't bother to check if post data contains the boundary, since it's pretty unlikely that it does. - CFUUIDRef uuid = CFUUIDCreate(nil); - NSString *uuidString = [(NSString*)CFUUIDCreateString(nil, uuid) autorelease]; - CFRelease(uuid); - NSString *stringBoundary = [NSString stringWithFormat:@"0xKhTmLbOuNdArY-%@",uuidString]; - - [self addRequestHeader:@"Content-Type" value:[NSString stringWithFormat:@"multipart/form-data; charset=%@; boundary=%@", charset, stringBoundary]]; - - [self appendPostString:[NSString stringWithFormat:@"--%@\r\n",stringBoundary]]; - - // Adds post data - NSString *endItemBoundary = [NSString stringWithFormat:@"\r\n--%@\r\n",stringBoundary]; - NSUInteger i=0; - for (NSDictionary *val in [self postData]) { - [self appendPostString:[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n",[val objectForKey:@"key"]]]; - [self appendPostString:[val objectForKey:@"value"]]; - i++; - if (i != [[self postData] count] || [[self fileData] count] > 0) { //Only add the boundary if this is not the last item in the post body - [self appendPostString:endItemBoundary]; - } - } - - // Adds files to upload - i=0; - for (NSDictionary *val in [self fileData]) { - - [self appendPostString:[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n", [val objectForKey:@"key"], [val objectForKey:@"fileName"]]]; - [self appendPostString:[NSString stringWithFormat:@"Content-Type: %@\r\n\r\n", [val objectForKey:@"contentType"]]]; - - id data = [val objectForKey:@"data"]; - if ([data isKindOfClass:[NSString class]]) { - [self appendPostDataFromFile:data]; - } else { - [self appendPostData:data]; - } - i++; - // Only add the boundary if this is not the last item in the post body - if (i != [[self fileData] count]) { - [self appendPostString:endItemBoundary]; - } - } - - [self appendPostString:[NSString stringWithFormat:@"\r\n--%@--\r\n",stringBoundary]]; - -#if DEBUG_FORM_DATA_REQUEST - [self addToDebugBody:@"==== End of multipart/form-data body ====\r\n"]; -#endif -} - -- (void)buildURLEncodedPostBody -{ - - // We can't post binary data using application/x-www-form-urlencoded - if ([[self fileData] count] > 0) { - [self setPostFormat:ASIMultipartFormDataPostFormat]; - [self buildMultipartFormDataPostBody]; - return; - } - -#if DEBUG_FORM_DATA_REQUEST - [self addToDebugBody:@"\r\n==== Building an application/x-www-form-urlencoded body ====\r\n"]; -#endif - - - NSString *charset = (NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding([self stringEncoding])); - - [self addRequestHeader:@"Content-Type" value:[NSString stringWithFormat:@"application/x-www-form-urlencoded; charset=%@",charset]]; - - - NSUInteger i=0; - NSUInteger count = [[self postData] count]-1; - for (NSDictionary *val in [self postData]) { - NSString *data = [NSString stringWithFormat:@"%@=%@%@", [self encodeURL:[val objectForKey:@"key"]], [self encodeURL:[val objectForKey:@"value"]],(i -#if TARGET_OS_IPHONE - #import - #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 - #import // Necessary for background task support - #endif -#endif - -#import -#import "ASIHTTPRequestConfig.h" -#import "ASIHTTPRequestDelegate.h" -#import "ASIProgressDelegate.h" -#import "ASICacheDelegate.h" - -@class ASIDataDecompressor; - -extern NSString *ASIHTTPRequestVersion; - -// Make targeting different platforms more reliable -// See: http://www.blumtnwerx.com/blog/2009/06/cross-sdk-code-hygiene-in-xcode/ -#ifndef __IPHONE_3_2 - #define __IPHONE_3_2 30200 -#endif -#ifndef __IPHONE_4_0 - #define __IPHONE_4_0 40000 -#endif -#ifndef __MAC_10_5 - #define __MAC_10_5 1050 -#endif -#ifndef __MAC_10_6 - #define __MAC_10_6 1060 -#endif - -typedef enum _ASIAuthenticationState { - ASINoAuthenticationNeededYet = 0, - ASIHTTPAuthenticationNeeded = 1, - ASIProxyAuthenticationNeeded = 2 -} ASIAuthenticationState; - -typedef enum _ASINetworkErrorType { - ASIConnectionFailureErrorType = 1, - ASIRequestTimedOutErrorType = 2, - ASIAuthenticationErrorType = 3, - ASIRequestCancelledErrorType = 4, - ASIUnableToCreateRequestErrorType = 5, - ASIInternalErrorWhileBuildingRequestType = 6, - ASIInternalErrorWhileApplyingCredentialsType = 7, - ASIFileManagementError = 8, - ASITooMuchRedirectionErrorType = 9, - ASIUnhandledExceptionError = 10, - ASICompressionError = 11 - -} ASINetworkErrorType; - - -// The error domain that all errors generated by ASIHTTPRequest use -extern NSString* const NetworkRequestErrorDomain; - -// You can use this number to throttle upload and download bandwidth in iPhone OS apps send or receive a large amount of data -// This may help apps that might otherwise be rejected for inclusion into the app store for using excessive bandwidth -// This number is not official, as far as I know there is no officially documented bandwidth limit -extern unsigned long const ASIWWANBandwidthThrottleAmount; - -#if NS_BLOCKS_AVAILABLE -typedef void (^ASIBasicBlock)(void); -typedef void (^ASIHeadersBlock)(NSDictionary *responseHeaders); -typedef void (^ASISizeBlock)(long long size); -typedef void (^ASIProgressBlock)(unsigned long long size, unsigned long long total); -typedef void (^ASIDataBlock)(NSData *data); -#endif - -@interface ASIHTTPRequest : NSOperation { - - // The url for this operation, should include GET params in the query string where appropriate - NSURL *url; - - // Will always contain the original url used for making the request (the value of url can change when a request is redirected) - NSURL *originalURL; - - // Temporarily stores the url we are about to redirect to. Will be nil again when we do redirect - NSURL *redirectURL; - - // The delegate - will be notified of various changes in state via the ASIHTTPRequestDelegate protocol - id delegate; - - // Another delegate that is also notified of request status changes and progress updates - // Generally, you won't use this directly, but ASINetworkQueue sets itself as the queue so it can proxy updates to its own delegates - // NOTE: WILL BE RETAINED BY THE REQUEST - id queue; - - // HTTP method to use (eg: GET / POST / PUT / DELETE / HEAD etc). Defaults to GET - NSString *requestMethod; - - // Request body - only used when the whole body is stored in memory (shouldStreamPostDataFromDisk is false) - NSMutableData *postBody; - - // gzipped request body used when shouldCompressRequestBody is YES - NSData *compressedPostBody; - - // When true, post body will be streamed from a file on disk, rather than loaded into memory at once (useful for large uploads) - // Automatically set to true in ASIFormDataRequests when using setFile:forKey: - BOOL shouldStreamPostDataFromDisk; - - // Path to file used to store post body (when shouldStreamPostDataFromDisk is true) - // You can set this yourself - useful if you want to PUT a file from local disk - NSString *postBodyFilePath; - - // Path to a temporary file used to store a deflated post body (when shouldCompressPostBody is YES) - NSString *compressedPostBodyFilePath; - - // Set to true when ASIHTTPRequest automatically created a temporary file containing the request body (when true, the file at postBodyFilePath will be deleted at the end of the request) - BOOL didCreateTemporaryPostDataFile; - - // Used when writing to the post body when shouldStreamPostDataFromDisk is true (via appendPostData: or appendPostDataFromFile:) - NSOutputStream *postBodyWriteStream; - - // Used for reading from the post body when sending the request - NSInputStream *postBodyReadStream; - - // Dictionary for custom HTTP request headers - NSMutableDictionary *requestHeaders; - - // Set to YES when the request header dictionary has been populated, used to prevent this happening more than once - BOOL haveBuiltRequestHeaders; - - // Will be populated with HTTP response headers from the server - NSDictionary *responseHeaders; - - // Can be used to manually insert cookie headers to a request, but it's more likely that sessionCookies will do this for you - NSMutableArray *requestCookies; - - // Will be populated with cookies - NSArray *responseCookies; - - // If use useCookiePersistence is true, network requests will present valid cookies from previous requests - BOOL useCookiePersistence; - - // If useKeychainPersistence is true, network requests will attempt to read credentials from the keychain, and will save them in the keychain when they are successfully presented - BOOL useKeychainPersistence; - - // If useSessionPersistence is true, network requests will save credentials and reuse for the duration of the session (until clearSession is called) - BOOL useSessionPersistence; - - // If allowCompressedResponse is true, requests will inform the server they can accept compressed data, and will automatically decompress gzipped responses. Default is true. - BOOL allowCompressedResponse; - - // If shouldCompressRequestBody is true, the request body will be gzipped. Default is false. - // You will probably need to enable this feature on your webserver to make this work. Tested with apache only. - BOOL shouldCompressRequestBody; - - // When downloadDestinationPath is set, the result of this request will be downloaded to the file at this location - // If downloadDestinationPath is not set, download data will be stored in memory - NSString *downloadDestinationPath; - - // The location that files will be downloaded to. Once a download is complete, files will be decompressed (if necessary) and moved to downloadDestinationPath - NSString *temporaryFileDownloadPath; - - // If the response is gzipped and shouldWaitToInflateCompressedResponses is NO, a file will be created at this path containing the inflated response as it comes in - NSString *temporaryUncompressedDataDownloadPath; - - // Used for writing data to a file when downloadDestinationPath is set - NSOutputStream *fileDownloadOutputStream; - - NSOutputStream *inflatedFileDownloadOutputStream; - - // When the request fails or completes successfully, complete will be true - BOOL complete; - - // external "finished" indicator, subject of KVO notifications; updates after 'complete' - BOOL finished; - - // True if our 'cancel' selector has been called - BOOL cancelled; - - // If an error occurs, error will contain an NSError - // If error code is = ASIConnectionFailureErrorType (1, Connection failure occurred) - inspect [[error userInfo] objectForKey:NSUnderlyingErrorKey] for more information - NSError *error; - - // Username and password used for authentication - NSString *username; - NSString *password; - - // User-Agent for this request - NSString *userAgentString; - - // Domain used for NTLM authentication - NSString *domain; - - // Username and password used for proxy authentication - NSString *proxyUsername; - NSString *proxyPassword; - - // Domain used for NTLM proxy authentication - NSString *proxyDomain; - - // Delegate for displaying upload progress (usually an NSProgressIndicator, but you can supply a different object and handle this yourself) - id uploadProgressDelegate; - - // Delegate for displaying download progress (usually an NSProgressIndicator, but you can supply a different object and handle this yourself) - id downloadProgressDelegate; - - // Whether we've seen the headers of the response yet - BOOL haveExaminedHeaders; - - // Data we receive will be stored here. Data may be compressed unless allowCompressedResponse is false - you should use [request responseData] instead in most cases - NSMutableData *rawResponseData; - - // Used for sending and receiving data - CFHTTPMessageRef request; - NSInputStream *readStream; - - // Used for authentication - CFHTTPAuthenticationRef requestAuthentication; - NSDictionary *requestCredentials; - - // Used during NTLM authentication - int authenticationRetryCount; - - // Authentication scheme (Basic, Digest, NTLM) - // If you are using Basic authentication and want to force ASIHTTPRequest to send an authorization header without waiting for a 401, you must set this to (NSString *)kCFHTTPAuthenticationSchemeBasic - NSString *authenticationScheme; - - // Realm for authentication when credentials are required - NSString *authenticationRealm; - - // When YES, ASIHTTPRequest will present a dialog allowing users to enter credentials when no-matching credentials were found for a server that requires authentication - // The dialog will not be shown if your delegate responds to authenticationNeededForRequest: - // Default is NO. - BOOL shouldPresentAuthenticationDialog; - - // When YES, ASIHTTPRequest will present a dialog allowing users to enter credentials when no-matching credentials were found for a proxy server that requires authentication - // The dialog will not be shown if your delegate responds to proxyAuthenticationNeededForRequest: - // Default is YES (basically, because most people won't want the hassle of adding support for authenticating proxies to their apps) - BOOL shouldPresentProxyAuthenticationDialog; - - // Used for proxy authentication - CFHTTPAuthenticationRef proxyAuthentication; - NSDictionary *proxyCredentials; - - // Used during authentication with an NTLM proxy - int proxyAuthenticationRetryCount; - - // Authentication scheme for the proxy (Basic, Digest, NTLM) - NSString *proxyAuthenticationScheme; - - // Realm for proxy authentication when credentials are required - NSString *proxyAuthenticationRealm; - - // HTTP status code, eg: 200 = OK, 404 = Not found etc - int responseStatusCode; - - // Description of the HTTP status code - NSString *responseStatusMessage; - - // Size of the response - unsigned long long contentLength; - - // Size of the partially downloaded content - unsigned long long partialDownloadSize; - - // Size of the POST payload - unsigned long long postLength; - - // The total amount of downloaded data - unsigned long long totalBytesRead; - - // The total amount of uploaded data - unsigned long long totalBytesSent; - - // Last amount of data read (used for incrementing progress) - unsigned long long lastBytesRead; - - // Last amount of data sent (used for incrementing progress) - unsigned long long lastBytesSent; - - // This lock prevents the operation from being cancelled at an inopportune moment - NSRecursiveLock *cancelledLock; - - // Called on the delegate (if implemented) when the request starts. Default is requestStarted: - SEL didStartSelector; - - // Called on the delegate (if implemented) when the request receives response headers. Default is request:didReceiveResponseHeaders: - SEL didReceiveResponseHeadersSelector; - - // Called on the delegate (if implemented) when the request receives a Location header and shouldRedirect is YES - // The delegate can then change the url if needed, and can restart the request by calling [request redirectToURL:], or simply cancel it - SEL willRedirectSelector; - - // Called on the delegate (if implemented) when the request completes successfully. Default is requestFinished: - SEL didFinishSelector; - - // Called on the delegate (if implemented) when the request fails. Default is requestFailed: - SEL didFailSelector; - - // Called on the delegate (if implemented) when the request receives data. Default is request:didReceiveData: - // If you set this and implement the method in your delegate, you must handle the data yourself - ASIHTTPRequest will not populate responseData or write the data to downloadDestinationPath - SEL didReceiveDataSelector; - - // Used for recording when something last happened during the request, we will compare this value with the current date to time out requests when appropriate - NSDate *lastActivityTime; - - // Number of seconds to wait before timing out - default is 10 - NSTimeInterval timeOutSeconds; - - // Will be YES when a HEAD request will handle the content-length before this request starts - BOOL shouldResetUploadProgress; - BOOL shouldResetDownloadProgress; - - // Used by HEAD requests when showAccurateProgress is YES to preset the content-length for this request - ASIHTTPRequest *mainRequest; - - // When NO, this request will only update the progress indicator when it completes - // When YES, this request will update the progress indicator according to how much data it has received so far - // The default for requests is YES - // Also see the comments in ASINetworkQueue.h - BOOL showAccurateProgress; - - // Used to ensure the progress indicator is only incremented once when showAccurateProgress = NO - BOOL updatedProgress; - - // Prevents the body of the post being built more than once (largely for subclasses) - BOOL haveBuiltPostBody; - - // Used internally, may reflect the size of the internal buffer used by CFNetwork - // POST / PUT operations with body sizes greater than uploadBufferSize will not timeout unless more than uploadBufferSize bytes have been sent - // Likely to be 32KB on iPhone 3.0, 128KB on Mac OS X Leopard and iPhone 2.2.x - unsigned long long uploadBufferSize; - - // Text encoding for responses that do not send a Content-Type with a charset value. Defaults to NSISOLatin1StringEncoding - NSStringEncoding defaultResponseEncoding; - - // The text encoding of the response, will be defaultResponseEncoding if the server didn't specify. Can't be set. - NSStringEncoding responseEncoding; - - // Tells ASIHTTPRequest not to delete partial downloads, and allows it to use an existing file to resume a download. Defaults to NO. - BOOL allowResumeForFileDownloads; - - // Custom user information associated with the request (not sent to the server) - NSDictionary *userInfo; - NSInteger tag; - - // Use HTTP 1.0 rather than 1.1 (defaults to false) - BOOL useHTTPVersionOne; - - // When YES, requests will automatically redirect when they get a HTTP 30x header (defaults to YES) - BOOL shouldRedirect; - - // Used internally to tell the main loop we need to stop and retry with a new url - BOOL needsRedirect; - - // Incremented every time this request redirects. When it reaches 5, we give up - int redirectCount; - - // When NO, requests will not check the secure certificate is valid (use for self-signed certificates during development, DO NOT USE IN PRODUCTION) Default is YES - BOOL validatesSecureCertificate; - - // If not nil and the URL scheme is https, CFNetwork configured to supply a client certificate - SecIdentityRef clientCertificateIdentity; - NSArray *clientCertificates; - - // Details on the proxy to use - you could set these yourself, but it's probably best to let ASIHTTPRequest detect the system proxy settings - NSString *proxyHost; - int proxyPort; - - // ASIHTTPRequest will assume kCFProxyTypeHTTP if the proxy type could not be automatically determined - // Set to kCFProxyTypeSOCKS if you are manually configuring a SOCKS proxy - NSString *proxyType; - - // URL for a PAC (Proxy Auto Configuration) file. If you want to set this yourself, it's probably best if you use a local file - NSURL *PACurl; - - // See ASIAuthenticationState values above. 0 == default == No authentication needed yet - ASIAuthenticationState authenticationNeeded; - - // When YES, ASIHTTPRequests will present credentials from the session store for requests to the same server before being asked for them - // This avoids an extra round trip for requests after authentication has succeeded, which is much for efficient for authenticated requests with large bodies, or on slower connections - // Set to NO to only present credentials when explicitly asked for them - // This only affects credentials stored in the session cache when useSessionPersistence is YES. Credentials from the keychain are never presented unless the server asks for them - // Default is YES - // For requests using Basic authentication, set authenticationScheme to (NSString *)kCFHTTPAuthenticationSchemeBasic, and credentials can be sent on the very first request when shouldPresentCredentialsBeforeChallenge is YES - BOOL shouldPresentCredentialsBeforeChallenge; - - // YES when the request hasn't finished yet. Will still be YES even if the request isn't doing anything (eg it's waiting for delegate authentication). READ-ONLY - BOOL inProgress; - - // Used internally to track whether the stream is scheduled on the run loop or not - // Bandwidth throttling can unschedule the stream to slow things down while a request is in progress - BOOL readStreamIsScheduled; - - // Set to allow a request to automatically retry itself on timeout - // Default is zero - timeout will stop the request - int numberOfTimesToRetryOnTimeout; - - // The number of times this request has retried (when numberOfTimesToRetryOnTimeout > 0) - int retryCount; - - // Temporarily set to YES when a closed connection forces a retry (internally, this stops ASIHTTPRequest cleaning up a temporary post body) - BOOL willRetryRequest; - - // When YES, requests will keep the connection to the server alive for a while to allow subsequent requests to re-use it for a substantial speed-boost - // Persistent connections will not be used if the server explicitly closes the connection - // Default is YES - BOOL shouldAttemptPersistentConnection; - - // Number of seconds to keep an inactive persistent connection open on the client side - // Default is 60 - // If we get a keep-alive header, this is this value is replaced with how long the server told us to keep the connection around - // A future date is created from this and used for expiring the connection, this is stored in connectionInfo's expires value - NSTimeInterval persistentConnectionTimeoutSeconds; - - // Set to yes when an appropriate keep-alive header is found - BOOL connectionCanBeReused; - - // Stores information about the persistent connection that is currently in use. - // It may contain: - // * The id we set for a particular connection, incremented every time we want to specify that we need a new connection - // * The date that connection should expire - // * A host, port and scheme for the connection. These are used to determine whether that connection can be reused by a subsequent request (all must match the new request) - // * An id for the request that is currently using the connection. This is used for determining if a connection is available or not (we store a number rather than a reference to the request so we don't need to hang onto a request until the connection expires) - // * A reference to the stream that is currently using the connection. This is necessary because we need to keep the old stream open until we've opened a new one. - // The stream will be closed + released either when another request comes to use the connection, or when the timer fires to tell the connection to expire - NSMutableDictionary *connectionInfo; - - // When set to YES, 301 and 302 automatic redirects will use the original method and and body, according to the HTTP 1.1 standard - // Default is NO (to follow the behaviour of most browsers) - BOOL shouldUseRFC2616RedirectBehaviour; - - // Used internally to record when a request has finished downloading data - BOOL downloadComplete; - - // An ID that uniquely identifies this request - primarily used for debugging persistent connections - NSNumber *requestID; - - // Will be ASIHTTPRequestRunLoopMode for synchronous requests, NSDefaultRunLoopMode for all other requests - NSString *runLoopMode; - - // This timer checks up on the request every 0.25 seconds, and updates progress - NSTimer *statusTimer; - - // The download cache that will be used for this request (use [ASIHTTPRequest setDefaultCache:cache] to configure a default cache - id downloadCache; - - // The cache policy that will be used for this request - See ASICacheDelegate.h for possible values - ASICachePolicy cachePolicy; - - // The cache storage policy that will be used for this request - See ASICacheDelegate.h for possible values - ASICacheStoragePolicy cacheStoragePolicy; - - // Will be true when the response was pulled from the cache rather than downloaded - BOOL didUseCachedResponse; - - // Set secondsToCache to use a custom time interval for expiring the response when it is stored in a cache - NSTimeInterval secondsToCache; - - #if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 - BOOL shouldContinueWhenAppEntersBackground; - UIBackgroundTaskIdentifier backgroundTask; - #endif - - // When downloading a gzipped response, the request will use this helper object to inflate the response - ASIDataDecompressor *dataDecompressor; - - // Controls how responses with a gzipped encoding are inflated (decompressed) - // When set to YES (This is the default): - // * gzipped responses for requests without a downloadDestinationPath will be inflated only when [request responseData] / [request responseString] is called - // * gzipped responses for requests with a downloadDestinationPath set will be inflated only when the request completes - // - // When set to NO - // All requests will inflate the response as it comes in - // * If the request has no downloadDestinationPath set, the raw (compressed) response is discarded and rawResponseData will contain the decompressed response - // * If the request has a downloadDestinationPath, the raw response will be stored in temporaryFileDownloadPath as normal, the inflated response will be stored in temporaryUncompressedDataDownloadPath - // Once the request completes successfully, the contents of temporaryUncompressedDataDownloadPath are moved into downloadDestinationPath - // - // Setting this to NO may be especially useful for users using ASIHTTPRequest in conjunction with a streaming parser, as it will allow partial gzipped responses to be inflated and passed on to the parser while the request is still running - BOOL shouldWaitToInflateCompressedResponses; - - // Will be YES if this is a request created behind the scenes to download a PAC file - these requests do not attempt to configure their own proxies - BOOL isPACFileRequest; - - // Used for downloading PAC files from http / https webservers - ASIHTTPRequest *PACFileRequest; - - // Used for asynchronously reading PAC files from file:// URLs - NSInputStream *PACFileReadStream; - - // Used for storing PAC data from file URLs as it is downloaded - NSMutableData *PACFileData; - - // Set to YES in startSynchronous. Currently used by proxy detection to download PAC files synchronously when appropriate - BOOL isSynchronous; - - #if NS_BLOCKS_AVAILABLE - //block to execute when request starts - ASIBasicBlock startedBlock; - - //block to execute when headers are received - ASIHeadersBlock headersReceivedBlock; - - //block to execute when request completes successfully - ASIBasicBlock completionBlock; - - //block to execute when request fails - ASIBasicBlock failureBlock; - - //block for when bytes are received - ASIProgressBlock bytesReceivedBlock; - - //block for when bytes are sent - ASIProgressBlock bytesSentBlock; - - //block for when download size is incremented - ASISizeBlock downloadSizeIncrementedBlock; - - //block for when upload size is incremented - ASISizeBlock uploadSizeIncrementedBlock; - - //block for handling raw bytes received - ASIDataBlock dataReceivedBlock; - - //block for handling authentication - ASIBasicBlock authenticationNeededBlock; - - //block for handling proxy authentication - ASIBasicBlock proxyAuthenticationNeededBlock; - - //block for handling redirections, if you want to - ASIBasicBlock requestRedirectedBlock; - #endif -} - -#pragma mark init / dealloc - -// Should be an HTTP or HTTPS url, may include username and password if appropriate -- (id)initWithURL:(NSURL *)newURL; - -// Convenience constructor -+ (id)requestWithURL:(NSURL *)newURL; - -+ (id)requestWithURL:(NSURL *)newURL usingCache:(id )cache; -+ (id)requestWithURL:(NSURL *)newURL usingCache:(id )cache andCachePolicy:(ASICachePolicy)policy; - -#if NS_BLOCKS_AVAILABLE -- (void)setStartedBlock:(ASIBasicBlock)aStartedBlock; -- (void)setHeadersReceivedBlock:(ASIHeadersBlock)aReceivedBlock; -- (void)setCompletionBlock:(ASIBasicBlock)aCompletionBlock; -- (void)setFailedBlock:(ASIBasicBlock)aFailedBlock; -- (void)setBytesReceivedBlock:(ASIProgressBlock)aBytesReceivedBlock; -- (void)setBytesSentBlock:(ASIProgressBlock)aBytesSentBlock; -- (void)setDownloadSizeIncrementedBlock:(ASISizeBlock) aDownloadSizeIncrementedBlock; -- (void)setUploadSizeIncrementedBlock:(ASISizeBlock) anUploadSizeIncrementedBlock; -- (void)setDataReceivedBlock:(ASIDataBlock)aReceivedBlock; -- (void)setAuthenticationNeededBlock:(ASIBasicBlock)anAuthenticationBlock; -- (void)setProxyAuthenticationNeededBlock:(ASIBasicBlock)aProxyAuthenticationBlock; -- (void)setRequestRedirectedBlock:(ASIBasicBlock)aRedirectBlock; -#endif - -#pragma mark setup request - -// Add a custom header to the request -- (void)addRequestHeader:(NSString *)header value:(NSString *)value; - -// Called during buildRequestHeaders and after a redirect to create a cookie header from request cookies and the global store -- (void)applyCookieHeader; - -// Populate the request headers dictionary. Called before a request is started, or by a HEAD request that needs to borrow them -- (void)buildRequestHeaders; - -// Used to apply authorization header to a request before it is sent (when shouldPresentCredentialsBeforeChallenge is YES) -- (void)applyAuthorizationHeader; - - -// Create the post body -- (void)buildPostBody; - -// Called to add data to the post body. Will append to postBody when shouldStreamPostDataFromDisk is false, or write to postBodyWriteStream when true -- (void)appendPostData:(NSData *)data; -- (void)appendPostDataFromFile:(NSString *)file; - -#pragma mark get information about this request - -// Returns the contents of the result as an NSString (not appropriate for binary data - used responseData instead) -- (NSString *)responseString; - -// Response data, automatically uncompressed where appropriate -- (NSData *)responseData; - -// Returns true if the response was gzip compressed -- (BOOL)isResponseCompressed; - -#pragma mark running a request - - -// Run a request synchronously, and return control when the request completes or fails -- (void)startSynchronous; - -// Run request in the background -- (void)startAsynchronous; - -// Clears all delegates and blocks, then cancels the request -- (void)clearDelegatesAndCancel; - -#pragma mark HEAD request - -// Used by ASINetworkQueue to create a HEAD request appropriate for this request with the same headers (though you can use it yourself) -- (ASIHTTPRequest *)HEADRequest; - -#pragma mark upload/download progress - -// Called approximately every 0.25 seconds to update the progress delegates -- (void)updateProgressIndicators; - -// Updates upload progress (notifies the queue and/or uploadProgressDelegate of this request) -- (void)updateUploadProgress; - -// Updates download progress (notifies the queue and/or uploadProgressDelegate of this request) -- (void)updateDownloadProgress; - -// Called when authorisation is needed, as we only find out we don't have permission to something when the upload is complete -- (void)removeUploadProgressSoFar; - -// Called when we get a content-length header and shouldResetDownloadProgress is true -- (void)incrementDownloadSizeBy:(long long)length; - -// Called when a request starts and shouldResetUploadProgress is true -// Also called (with a negative length) to remove the size of the underlying buffer used for uploading -- (void)incrementUploadSizeBy:(long long)length; - -// Helper method for interacting with progress indicators to abstract the details of different APIS (NSProgressIndicator and UIProgressView) -+ (void)updateProgressIndicator:(id *)indicator withProgress:(unsigned long long)progress ofTotal:(unsigned long long)total; - -// Helper method used for performing invocations on the main thread (used for progress) -+ (void)performSelector:(SEL)selector onTarget:(id *)target withObject:(id)object amount:(void *)amount callerToRetain:(id)caller; - -#pragma mark talking to delegates - -// Called when a request starts, lets the delegate know via didStartSelector -- (void)requestStarted; - -// Called when a request receives response headers, lets the delegate know via didReceiveResponseHeadersSelector -- (void)requestReceivedResponseHeaders:(NSDictionary *)newHeaders; - -// Called when a request completes successfully, lets the delegate know via didFinishSelector -- (void)requestFinished; - -// Called when a request fails, and lets the delegate know via didFailSelector -- (void)failWithError:(NSError *)theError; - -// Called to retry our request when our persistent connection is closed -// Returns YES if we haven't already retried, and connection will be restarted -// Otherwise, returns NO, and nothing will happen -- (BOOL)retryUsingNewConnection; - -// Can be called by delegates from inside their willRedirectSelector implementations to restart the request with a new url -- (void)redirectToURL:(NSURL *)newURL; - -#pragma mark parsing HTTP response headers - -// Reads the response headers to find the content length, encoding, cookies for the session -// Also initiates request redirection when shouldRedirect is true -// And works out if HTTP auth is required -- (void)readResponseHeaders; - -// Attempts to set the correct encoding by looking at the Content-Type header, if this is one -- (void)parseStringEncodingFromHeaders; - -+ (void)parseMimeType:(NSString **)mimeType andResponseEncoding:(NSStringEncoding *)stringEncoding fromContentType:(NSString *)contentType; - -#pragma mark http authentication stuff - -// Apply credentials to this request -- (BOOL)applyCredentials:(NSDictionary *)newCredentials; -- (BOOL)applyProxyCredentials:(NSDictionary *)newCredentials; - -// Attempt to obtain credentials for this request from the URL, username and password or keychain -- (NSMutableDictionary *)findCredentials; -- (NSMutableDictionary *)findProxyCredentials; - -// Unlock (unpause) the request thread so it can resume the request -// Should be called by delegates when they have populated the authentication information after an authentication challenge -- (void)retryUsingSuppliedCredentials; - -// Should be called by delegates when they wish to cancel authentication and stop -- (void)cancelAuthentication; - -// Apply authentication information and resume the request after an authentication challenge -- (void)attemptToApplyCredentialsAndResume; -- (void)attemptToApplyProxyCredentialsAndResume; - -// Attempt to show the built-in authentication dialog, returns YES if credentials were supplied, NO if user cancelled dialog / dialog is disabled / running on main thread -// Currently only used on iPhone OS -- (BOOL)showProxyAuthenticationDialog; -- (BOOL)showAuthenticationDialog; - -// Construct a basic authentication header from the username and password supplied, and add it to the request headers -// Used when shouldPresentCredentialsBeforeChallenge is YES -- (void)addBasicAuthenticationHeaderWithUsername:(NSString *)theUsername andPassword:(NSString *)thePassword; - -#pragma mark stream status handlers - -// CFnetwork event handlers -- (void)handleNetworkEvent:(CFStreamEventType)type; -- (void)handleBytesAvailable; -- (void)handleStreamComplete; -- (void)handleStreamError; - -#pragma mark cleanup - -// Cleans up and lets the queue know this operation is finished. -// Appears in this header for subclassing only, do not call this method from outside your request! -- (void)markAsFinished; - -// Cleans up temporary files. There's normally no reason to call these yourself, they are called automatically when a request completes or fails - -// Clean up the temporary file used to store the downloaded data when it comes in (if downloadDestinationPath is set) -- (BOOL)removeTemporaryDownloadFile; - -// Clean up the temporary file used to store data that is inflated (decompressed) as it comes in -- (BOOL)removeTemporaryUncompressedDownloadFile; - -// Clean up the temporary file used to store the request body (when shouldStreamPostDataFromDisk is YES) -- (BOOL)removeTemporaryUploadFile; - -// Clean up the temporary file used to store a deflated (compressed) request body when shouldStreamPostDataFromDisk is YES -- (BOOL)removeTemporaryCompressedUploadFile; - -// Remove a file on disk, returning NO and populating the passed error pointer if it fails -+ (BOOL)removeFileAtPath:(NSString *)path error:(NSError **)err; - -#pragma mark persistent connections - -// Get the ID of the connection this request used (only really useful in tests and debugging) -- (NSNumber *)connectionID; - -// Called automatically when a request is started to clean up any persistent connections that have expired -+ (void)expirePersistentConnections; - -#pragma mark default time out - -+ (NSTimeInterval)defaultTimeOutSeconds; -+ (void)setDefaultTimeOutSeconds:(NSTimeInterval)newTimeOutSeconds; - -#pragma mark client certificate - -- (void)setClientCertificateIdentity:(SecIdentityRef)anIdentity; - -#pragma mark session credentials - -+ (NSMutableArray *)sessionProxyCredentialsStore; -+ (NSMutableArray *)sessionCredentialsStore; - -+ (void)storeProxyAuthenticationCredentialsInSessionStore:(NSDictionary *)credentials; -+ (void)storeAuthenticationCredentialsInSessionStore:(NSDictionary *)credentials; - -+ (void)removeProxyAuthenticationCredentialsFromSessionStore:(NSDictionary *)credentials; -+ (void)removeAuthenticationCredentialsFromSessionStore:(NSDictionary *)credentials; - -- (NSDictionary *)findSessionProxyAuthenticationCredentials; -- (NSDictionary *)findSessionAuthenticationCredentials; - -#pragma mark keychain storage - -// Save credentials for this request to the keychain -- (void)saveCredentialsToKeychain:(NSDictionary *)newCredentials; - -// Save credentials to the keychain -+ (void)saveCredentials:(NSURLCredential *)credentials forHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm; -+ (void)saveCredentials:(NSURLCredential *)credentials forProxy:(NSString *)host port:(int)port realm:(NSString *)realm; - -// Return credentials from the keychain -+ (NSURLCredential *)savedCredentialsForHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm; -+ (NSURLCredential *)savedCredentialsForProxy:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm; - -// Remove credentials from the keychain -+ (void)removeCredentialsForHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm; -+ (void)removeCredentialsForProxy:(NSString *)host port:(int)port realm:(NSString *)realm; - -// We keep track of any cookies we accept, so that we can remove them from the persistent store later -+ (void)setSessionCookies:(NSMutableArray *)newSessionCookies; -+ (NSMutableArray *)sessionCookies; - -// Adds a cookie to our list of cookies we've accepted, checking first for an old version of the same cookie and removing that -+ (void)addSessionCookie:(NSHTTPCookie *)newCookie; - -// Dump all session data (authentication and cookies) -+ (void)clearSession; - -#pragma mark get user agent - -// Will be used as a user agent if requests do not specify a custom user agent -// Is only used when you have specified a Bundle Display Name (CFDisplayBundleName) or Bundle Name (CFBundleName) in your plist -+ (NSString *)defaultUserAgentString; -+ (void)setDefaultUserAgentString:(NSString *)agent; - -#pragma mark mime-type detection - -// Return the mime type for a file -+ (NSString *)mimeTypeForFileAtPath:(NSString *)path; - -#pragma mark bandwidth measurement / throttling - -// The maximum number of bytes ALL requests can send / receive in a second -// This is a rough figure. The actual amount used will be slightly more, this does not include HTTP headers -+ (unsigned long)maxBandwidthPerSecond; -+ (void)setMaxBandwidthPerSecond:(unsigned long)bytes; - -// Get a rough average (for the last 5 seconds) of how much bandwidth is being used, in bytes -+ (unsigned long)averageBandwidthUsedPerSecond; - -- (void)performThrottling; - -// Will return YES is bandwidth throttling is currently in use -+ (BOOL)isBandwidthThrottled; - -// Used internally to record bandwidth use, and by ASIInputStreams when uploading. It's probably best if you don't mess with this. -+ (void)incrementBandwidthUsedInLastSecond:(unsigned long)bytes; - -// On iPhone, ASIHTTPRequest can automatically turn throttling on and off as the connection type changes between WWAN and WiFi - -#if TARGET_OS_IPHONE -// Set to YES to automatically turn on throttling when WWAN is connected, and automatically turn it off when it isn't -+ (void)setShouldThrottleBandwidthForWWAN:(BOOL)throttle; - -// Turns on throttling automatically when WWAN is connected using a custom limit, and turns it off automatically when it isn't -+ (void)throttleBandwidthForWWANUsingLimit:(unsigned long)limit; - -#pragma mark reachability - -// Returns YES when an iPhone OS device is connected via WWAN, false when connected via WIFI or not connected -+ (BOOL)isNetworkReachableViaWWAN; - -#endif - -#pragma mark queue - -// Returns the shared queue -+ (NSOperationQueue *)sharedQueue; - -#pragma mark cache - -+ (void)setDefaultCache:(id )cache; -+ (id )defaultCache; - -// Returns the maximum amount of data we can read as part of the current measurement period, and sleeps this thread if our allowance is used up -+ (unsigned long)maxUploadReadLength; - -#pragma mark network activity - -+ (BOOL)isNetworkInUse; - -+ (void)setShouldUpdateNetworkActivityIndicator:(BOOL)shouldUpdate; - -// Shows the network activity spinner thing on iOS. You may wish to override this to do something else in Mac projects -+ (void)showNetworkActivityIndicator; - -// Hides the network activity spinner thing on iOS -+ (void)hideNetworkActivityIndicator; - -#pragma mark miscellany - -// Used for generating Authorization header when using basic authentication when shouldPresentCredentialsBeforeChallenge is true -// And also by ASIS3Request -+ (NSString *)base64forData:(NSData *)theData; - -// Returns the expiration date for the request. -// Calculated from the Expires response header property, unless maxAge is non-zero or -// there exists a non-zero max-age property in the Cache-Control response header. -+ (NSDate *)expiryDateForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterval)maxAge; - -// Returns a date from a string in RFC1123 format -+ (NSDate *)dateFromRFC1123String:(NSString *)string; - - -// Used for detecting multitasking support at runtime (for backgrounding requests) -#if TARGET_OS_IPHONE -+ (BOOL)isMultitaskingSupported; -#endif - -#pragma mark threading behaviour - -// In the default implementation, all requests run in a single background thread -// Advanced users only: Override this method in a subclass for a different threading behaviour -// Eg: return [NSThread mainThread] to run all requests in the main thread -// Alternatively, you can create a thread on demand, or manage a pool of threads -// Threads returned by this method will need to run the runloop in default mode (eg CFRunLoopRun()) -// Requests will stop the runloop when they complete -// If you have multiple requests sharing the thread you'll need to restart the runloop when this happens -+ (NSThread *)threadForRequest:(ASIHTTPRequest *)request; - - -#pragma mark === - -@property (retain) NSString *username; -@property (retain) NSString *password; -@property (retain) NSString *userAgentString; -@property (retain) NSString *domain; - -@property (retain) NSString *proxyUsername; -@property (retain) NSString *proxyPassword; -@property (retain) NSString *proxyDomain; - -@property (retain) NSString *proxyHost; -@property (assign) int proxyPort; -@property (retain) NSString *proxyType; - -@property (retain,setter=setURL:, nonatomic) NSURL *url; -@property (retain) NSURL *originalURL; -@property (assign, nonatomic) id delegate; -@property (retain, nonatomic) id queue; -@property (assign, nonatomic) id uploadProgressDelegate; -@property (assign, nonatomic) id downloadProgressDelegate; -@property (assign) BOOL useKeychainPersistence; -@property (assign) BOOL useSessionPersistence; -@property (retain) NSString *downloadDestinationPath; -@property (retain) NSString *temporaryFileDownloadPath; -@property (retain) NSString *temporaryUncompressedDataDownloadPath; -@property (assign) SEL didStartSelector; -@property (assign) SEL didReceiveResponseHeadersSelector; -@property (assign) SEL willRedirectSelector; -@property (assign) SEL didFinishSelector; -@property (assign) SEL didFailSelector; -@property (assign) SEL didReceiveDataSelector; -@property (retain,readonly) NSString *authenticationRealm; -@property (retain,readonly) NSString *proxyAuthenticationRealm; -@property (retain) NSError *error; -@property (assign,readonly) BOOL complete; -@property (retain) NSDictionary *responseHeaders; -@property (retain) NSMutableDictionary *requestHeaders; -@property (retain) NSMutableArray *requestCookies; -@property (retain,readonly) NSArray *responseCookies; -@property (assign) BOOL useCookiePersistence; -@property (retain) NSDictionary *requestCredentials; -@property (retain) NSDictionary *proxyCredentials; -@property (assign,readonly) int responseStatusCode; -@property (retain,readonly) NSString *responseStatusMessage; -@property (retain) NSMutableData *rawResponseData; -@property (assign) NSTimeInterval timeOutSeconds; -@property (retain, nonatomic) NSString *requestMethod; -@property (retain) NSMutableData *postBody; -@property (assign) unsigned long long contentLength; -@property (assign) unsigned long long postLength; -@property (assign) BOOL shouldResetDownloadProgress; -@property (assign) BOOL shouldResetUploadProgress; -@property (assign) ASIHTTPRequest *mainRequest; -@property (assign) BOOL showAccurateProgress; -@property (assign) unsigned long long totalBytesRead; -@property (assign) unsigned long long totalBytesSent; -@property (assign) NSStringEncoding defaultResponseEncoding; -@property (assign) NSStringEncoding responseEncoding; -@property (assign) BOOL allowCompressedResponse; -@property (assign) BOOL allowResumeForFileDownloads; -@property (retain) NSDictionary *userInfo; -@property (assign) NSInteger tag; -@property (retain) NSString *postBodyFilePath; -@property (assign) BOOL shouldStreamPostDataFromDisk; -@property (assign) BOOL didCreateTemporaryPostDataFile; -@property (assign) BOOL useHTTPVersionOne; -@property (assign, readonly) unsigned long long partialDownloadSize; -@property (assign) BOOL shouldRedirect; -@property (assign) BOOL validatesSecureCertificate; -@property (assign) BOOL shouldCompressRequestBody; -@property (retain) NSURL *PACurl; -@property (retain) NSString *authenticationScheme; -@property (retain) NSString *proxyAuthenticationScheme; -@property (assign) BOOL shouldPresentAuthenticationDialog; -@property (assign) BOOL shouldPresentProxyAuthenticationDialog; -@property (assign, readonly) ASIAuthenticationState authenticationNeeded; -@property (assign) BOOL shouldPresentCredentialsBeforeChallenge; -@property (assign, readonly) int authenticationRetryCount; -@property (assign, readonly) int proxyAuthenticationRetryCount; -@property (assign) BOOL haveBuiltRequestHeaders; -@property (assign, nonatomic) BOOL haveBuiltPostBody; -@property (assign, readonly) BOOL inProgress; -@property (assign) int numberOfTimesToRetryOnTimeout; -@property (assign, readonly) int retryCount; -@property (assign) BOOL shouldAttemptPersistentConnection; -@property (assign) NSTimeInterval persistentConnectionTimeoutSeconds; -@property (assign) BOOL shouldUseRFC2616RedirectBehaviour; -@property (assign, readonly) BOOL connectionCanBeReused; -@property (retain, readonly) NSNumber *requestID; -@property (assign) id downloadCache; -@property (assign) ASICachePolicy cachePolicy; -@property (assign) ASICacheStoragePolicy cacheStoragePolicy; -@property (assign, readonly) BOOL didUseCachedResponse; -@property (assign) NSTimeInterval secondsToCache; -@property (retain) NSArray *clientCertificates; -#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 -@property (assign) BOOL shouldContinueWhenAppEntersBackground; -#endif -@property (retain) ASIDataDecompressor *dataDecompressor; -@property (assign) BOOL shouldWaitToInflateCompressedResponses; - -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequest.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequest.m deleted file mode 100644 index ece66b8a..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequest.m +++ /dev/null @@ -1,5134 +0,0 @@ -// -// ASIHTTPRequest.m -// -// Created by Ben Copsey on 04/10/2007. -// Copyright 2007-2011 All-Seeing Interactive. All rights reserved. -// -// A guide to the main features is available at: -// http://allseeing-i.com/ASIHTTPRequest -// -// Portions are based on the ImageClient example from Apple: -// See: http://developer.apple.com/samplecode/ImageClient/listing37.html - -#import "ASIHTTPRequest.h" - -#if TARGET_OS_IPHONE -#import "Reachability.h" -#import "ASIAuthenticationDialog.h" -#import -#else -#import -#endif -#import "ASIInputStream.h" -#import "ASIDataDecompressor.h" -#import "ASIDataCompressor.h" - -// Automatically set on build -NSString *ASIHTTPRequestVersion = @"v1.8.1-61 2011-09-19"; - -static NSString *defaultUserAgent = nil; - -NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; - -static NSString *ASIHTTPRequestRunLoopMode = @"ASIHTTPRequestRunLoopMode"; - -static const CFOptionFlags kNetworkEvents = kCFStreamEventHasBytesAvailable | kCFStreamEventEndEncountered | kCFStreamEventErrorOccurred; - -// In memory caches of credentials, used on when useSessionPersistence is YES -static NSMutableArray *sessionCredentialsStore = nil; -static NSMutableArray *sessionProxyCredentialsStore = nil; - -// This lock mediates access to session credentials -static NSRecursiveLock *sessionCredentialsLock = nil; - -// We keep track of cookies we have received here so we can remove them from the sharedHTTPCookieStorage later -static NSMutableArray *sessionCookies = nil; - -// The number of times we will allow requests to redirect before we fail with a redirection error -const int RedirectionLimit = 5; - -// The default number of seconds to use for a timeout -static NSTimeInterval defaultTimeOutSeconds = 10; - -static void ReadStreamClientCallBack(CFReadStreamRef readStream, CFStreamEventType type, void *clientCallBackInfo) { - [((ASIHTTPRequest*)clientCallBackInfo) handleNetworkEvent: type]; -} - -// This lock prevents the operation from being cancelled while it is trying to update the progress, and vice versa -static NSRecursiveLock *progressLock; - -static NSError *ASIRequestCancelledError; -static NSError *ASIRequestTimedOutError; -static NSError *ASIAuthenticationError; -static NSError *ASIUnableToCreateRequestError; -static NSError *ASITooMuchRedirectionError; - -static NSMutableArray *bandwidthUsageTracker = nil; -static unsigned long averageBandwidthUsedPerSecond = 0; - -// These are used for queuing persistent connections on the same connection - -// Incremented every time we specify we want a new connection -static unsigned int nextConnectionNumberToCreate = 0; - -// An array of connectionInfo dictionaries. -// When attempting a persistent connection, we look here to try to find an existing connection to the same server that is currently not in use -static NSMutableArray *persistentConnectionsPool = nil; - -// Mediates access to the persistent connections pool -static NSRecursiveLock *connectionsLock = nil; - -// Each request gets a new id, we store this rather than a ref to the request itself in the connectionInfo dictionary. -// We do this so we don't have to keep the request around while we wait for the connection to expire -static unsigned int nextRequestID = 0; - -// Records how much bandwidth all requests combined have used in the last second -static unsigned long bandwidthUsedInLastSecond = 0; - -// A date one second in the future from the time it was created -static NSDate *bandwidthMeasurementDate = nil; - -// Since throttling variables are shared among all requests, we'll use a lock to mediate access -static NSLock *bandwidthThrottlingLock = nil; - -// the maximum number of bytes that can be transmitted in one second -static unsigned long maxBandwidthPerSecond = 0; - -// A default figure for throttling bandwidth on mobile devices -unsigned long const ASIWWANBandwidthThrottleAmount = 14800; - -#if TARGET_OS_IPHONE -// YES when bandwidth throttling is active -// This flag does not denote whether throttling is turned on - rather whether it is currently in use -// It will be set to NO when throttling was turned on with setShouldThrottleBandwidthForWWAN, but a WI-FI connection is active -static BOOL isBandwidthThrottled = NO; - -// When YES, bandwidth will be automatically throttled when using WWAN (3G/Edge/GPRS) -// Wifi will not be throttled -static BOOL shouldThrottleBandwidthForWWANOnly = NO; -#endif - -// Mediates access to the session cookies so requests -static NSRecursiveLock *sessionCookiesLock = nil; - -// This lock ensures delegates only receive one notification that authentication is required at once -// When using ASIAuthenticationDialogs, it also ensures only one dialog is shown at once -// If a request can't acquire the lock immediately, it means a dialog is being shown or a delegate is handling the authentication challenge -// Once it gets the lock, it will try to look for existing credentials again rather than showing the dialog / notifying the delegate -// This is so it can make use of any credentials supplied for the other request, if they are appropriate -static NSRecursiveLock *delegateAuthenticationLock = nil; - -// When throttling bandwidth, Set to a date in future that we will allow all requests to wake up and reschedule their streams -static NSDate *throttleWakeUpTime = nil; - -static id defaultCache = nil; - -// Used for tracking when requests are using the network -static unsigned int runningRequestCount = 0; - -// You can use [ASIHTTPRequest setShouldUpdateNetworkActivityIndicator:NO] if you want to manage it yourself -// Alternatively, override showNetworkActivityIndicator / hideNetworkActivityIndicator -// By default this does nothing on Mac OS X, but again override the above methods for a different behaviour -static BOOL shouldUpdateNetworkActivityIndicator = YES; - -// The thread all requests will run on -// Hangs around forever, but will be blocked unless there are requests underway -static NSThread *networkThread = nil; - -static NSOperationQueue *sharedQueue = nil; - -// Private stuff -@interface ASIHTTPRequest () - -- (void)cancelLoad; - -- (void)destroyReadStream; -- (void)scheduleReadStream; -- (void)unscheduleReadStream; - -- (BOOL)willAskDelegateForCredentials; -- (BOOL)willAskDelegateForProxyCredentials; -- (void)askDelegateForProxyCredentials; -- (void)askDelegateForCredentials; -- (void)failAuthentication; - -+ (void)measureBandwidthUsage; -+ (void)recordBandwidthUsage; - -- (void)startRequest; -- (void)updateStatus:(NSTimer *)timer; -- (void)checkRequestStatus; -- (void)reportFailure; -- (void)reportFinished; -- (void)markAsFinished; -- (void)performRedirect; -- (BOOL)shouldTimeOut; -- (BOOL)willRedirect; -- (BOOL)willAskDelegateToConfirmRedirect; - -+ (void)performInvocation:(NSInvocation *)invocation onTarget:(id *)target releasingObject:(id)objectToRelease; -+ (void)hideNetworkActivityIndicatorAfterDelay; -+ (void)hideNetworkActivityIndicatorIfNeeeded; -+ (void)runRequests; - -// Handling Proxy autodetection and PAC file downloads -- (BOOL)configureProxies; -- (void)fetchPACFile; -- (void)finishedDownloadingPACFile:(ASIHTTPRequest *)theRequest; -- (void)runPACScript:(NSString *)script; -- (void)timeOutPACRead; - -- (void)useDataFromCache; - -// Called to update the size of a partial download when starting a request, or retrying after a timeout -- (void)updatePartialDownloadSize; - -#if TARGET_OS_IPHONE -+ (void)registerForNetworkReachabilityNotifications; -+ (void)unsubscribeFromNetworkReachabilityNotifications; -// Called when the status of the network changes -+ (void)reachabilityChanged:(NSNotification *)note; -#endif - -#if NS_BLOCKS_AVAILABLE -- (void)performBlockOnMainThread:(ASIBasicBlock)block; -- (void)releaseBlocksOnMainThread; -+ (void)releaseBlocks:(NSArray *)blocks; -- (void)callBlock:(ASIBasicBlock)block; -#endif - - - - - -@property (assign) BOOL complete; -@property (retain) NSArray *responseCookies; -@property (assign) int responseStatusCode; -@property (retain, nonatomic) NSDate *lastActivityTime; - -@property (assign) unsigned long long partialDownloadSize; -@property (assign, nonatomic) unsigned long long uploadBufferSize; -@property (retain, nonatomic) NSOutputStream *postBodyWriteStream; -@property (retain, nonatomic) NSInputStream *postBodyReadStream; -@property (assign, nonatomic) unsigned long long lastBytesRead; -@property (assign, nonatomic) unsigned long long lastBytesSent; -@property (retain) NSRecursiveLock *cancelledLock; -@property (retain, nonatomic) NSOutputStream *fileDownloadOutputStream; -@property (retain, nonatomic) NSOutputStream *inflatedFileDownloadOutputStream; -@property (assign) int authenticationRetryCount; -@property (assign) int proxyAuthenticationRetryCount; -@property (assign, nonatomic) BOOL updatedProgress; -@property (assign, nonatomic) BOOL needsRedirect; -@property (assign, nonatomic) int redirectCount; -@property (retain, nonatomic) NSData *compressedPostBody; -@property (retain, nonatomic) NSString *compressedPostBodyFilePath; -@property (retain) NSString *authenticationRealm; -@property (retain) NSString *proxyAuthenticationRealm; -@property (retain) NSString *responseStatusMessage; -@property (assign) BOOL inProgress; -@property (assign) int retryCount; -@property (assign) BOOL willRetryRequest; -@property (assign) BOOL connectionCanBeReused; -@property (retain, nonatomic) NSMutableDictionary *connectionInfo; -@property (retain, nonatomic) NSInputStream *readStream; -@property (assign) ASIAuthenticationState authenticationNeeded; -@property (assign, nonatomic) BOOL readStreamIsScheduled; -@property (assign, nonatomic) BOOL downloadComplete; -@property (retain) NSNumber *requestID; -@property (assign, nonatomic) NSString *runLoopMode; -@property (retain, nonatomic) NSTimer *statusTimer; -@property (assign) BOOL didUseCachedResponse; -@property (retain, nonatomic) NSURL *redirectURL; - -@property (assign, nonatomic) BOOL isPACFileRequest; -@property (retain, nonatomic) ASIHTTPRequest *PACFileRequest; -@property (retain, nonatomic) NSInputStream *PACFileReadStream; -@property (retain, nonatomic) NSMutableData *PACFileData; - -@property (assign, nonatomic, setter=setSynchronous:) BOOL isSynchronous; -@end - - -@implementation ASIHTTPRequest - -#pragma mark init / dealloc - -+ (void)initialize -{ - if (self == [ASIHTTPRequest class]) { - persistentConnectionsPool = [[NSMutableArray alloc] init]; - connectionsLock = [[NSRecursiveLock alloc] init]; - progressLock = [[NSRecursiveLock alloc] init]; - bandwidthThrottlingLock = [[NSLock alloc] init]; - sessionCookiesLock = [[NSRecursiveLock alloc] init]; - sessionCredentialsLock = [[NSRecursiveLock alloc] init]; - delegateAuthenticationLock = [[NSRecursiveLock alloc] init]; - bandwidthUsageTracker = [[NSMutableArray alloc] initWithCapacity:5]; - ASIRequestTimedOutError = [[NSError alloc] initWithDomain:NetworkRequestErrorDomain code:ASIRequestTimedOutErrorType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"The request timed out",NSLocalizedDescriptionKey,nil]]; - ASIAuthenticationError = [[NSError alloc] initWithDomain:NetworkRequestErrorDomain code:ASIAuthenticationErrorType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Authentication needed",NSLocalizedDescriptionKey,nil]]; - ASIRequestCancelledError = [[NSError alloc] initWithDomain:NetworkRequestErrorDomain code:ASIRequestCancelledErrorType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"The request was cancelled",NSLocalizedDescriptionKey,nil]]; - ASIUnableToCreateRequestError = [[NSError alloc] initWithDomain:NetworkRequestErrorDomain code:ASIUnableToCreateRequestErrorType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Unable to create request (bad url?)",NSLocalizedDescriptionKey,nil]]; - ASITooMuchRedirectionError = [[NSError alloc] initWithDomain:NetworkRequestErrorDomain code:ASITooMuchRedirectionErrorType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"The request failed because it redirected too many times",NSLocalizedDescriptionKey,nil]]; - sharedQueue = [[NSOperationQueue alloc] init]; - [sharedQueue setMaxConcurrentOperationCount:4]; - - } -} - - -- (id)initWithURL:(NSURL *)newURL -{ - self = [self init]; - [self setRequestMethod:@"GET"]; - - [self setRunLoopMode:NSDefaultRunLoopMode]; - [self setShouldAttemptPersistentConnection:YES]; - [self setPersistentConnectionTimeoutSeconds:60.0]; - [self setShouldPresentCredentialsBeforeChallenge:YES]; - [self setShouldRedirect:YES]; - [self setShowAccurateProgress:YES]; - [self setShouldResetDownloadProgress:YES]; - [self setShouldResetUploadProgress:YES]; - [self setAllowCompressedResponse:YES]; - [self setShouldWaitToInflateCompressedResponses:YES]; - [self setDefaultResponseEncoding:NSISOLatin1StringEncoding]; - [self setShouldPresentProxyAuthenticationDialog:YES]; - - [self setTimeOutSeconds:[ASIHTTPRequest defaultTimeOutSeconds]]; - [self setUseSessionPersistence:YES]; - [self setUseCookiePersistence:YES]; - [self setValidatesSecureCertificate:YES]; - [self setRequestCookies:[[[NSMutableArray alloc] init] autorelease]]; - [self setDidStartSelector:@selector(requestStarted:)]; - [self setDidReceiveResponseHeadersSelector:@selector(request:didReceiveResponseHeaders:)]; - [self setWillRedirectSelector:@selector(request:willRedirectToURL:)]; - [self setDidFinishSelector:@selector(requestFinished:)]; - [self setDidFailSelector:@selector(requestFailed:)]; - [self setDidReceiveDataSelector:@selector(request:didReceiveData:)]; - [self setURL:newURL]; - [self setCancelledLock:[[[NSRecursiveLock alloc] init] autorelease]]; - [self setDownloadCache:[[self class] defaultCache]]; - return self; -} - -+ (id)requestWithURL:(NSURL *)newURL -{ - return [[[self alloc] initWithURL:newURL] autorelease]; -} - -+ (id)requestWithURL:(NSURL *)newURL usingCache:(id )cache -{ - return [self requestWithURL:newURL usingCache:cache andCachePolicy:ASIUseDefaultCachePolicy]; -} - -+ (id)requestWithURL:(NSURL *)newURL usingCache:(id )cache andCachePolicy:(ASICachePolicy)policy -{ - ASIHTTPRequest *request = [[[self alloc] initWithURL:newURL] autorelease]; - [request setDownloadCache:cache]; - [request setCachePolicy:policy]; - return request; -} - -- (void)dealloc -{ - [self setAuthenticationNeeded:ASINoAuthenticationNeededYet]; - if (requestAuthentication) { - CFRelease(requestAuthentication); - } - if (proxyAuthentication) { - CFRelease(proxyAuthentication); - } - if (request) { - CFRelease(request); - } - if (clientCertificateIdentity) { - CFRelease(clientCertificateIdentity); - } - [self cancelLoad]; - [redirectURL release]; - [statusTimer invalidate]; - [statusTimer release]; - [queue release]; - [userInfo release]; - [postBody release]; - [compressedPostBody release]; - [error release]; - [requestHeaders release]; - [requestCookies release]; - [downloadDestinationPath release]; - [temporaryFileDownloadPath release]; - [temporaryUncompressedDataDownloadPath release]; - [fileDownloadOutputStream release]; - [inflatedFileDownloadOutputStream release]; - [username release]; - [password release]; - [domain release]; - [authenticationRealm release]; - [authenticationScheme release]; - [requestCredentials release]; - [proxyHost release]; - [proxyType release]; - [proxyUsername release]; - [proxyPassword release]; - [proxyDomain release]; - [proxyAuthenticationRealm release]; - [proxyAuthenticationScheme release]; - [proxyCredentials release]; - [url release]; - [originalURL release]; - [lastActivityTime release]; - [responseCookies release]; - [rawResponseData release]; - [responseHeaders release]; - [requestMethod release]; - [cancelledLock release]; - [postBodyFilePath release]; - [compressedPostBodyFilePath release]; - [postBodyWriteStream release]; - [postBodyReadStream release]; - [PACurl release]; - [clientCertificates release]; - [responseStatusMessage release]; - [connectionInfo release]; - [requestID release]; - [dataDecompressor release]; - [userAgentString release]; - - #if NS_BLOCKS_AVAILABLE - [self releaseBlocksOnMainThread]; - #endif - - [super dealloc]; -} - -#if NS_BLOCKS_AVAILABLE -- (void)releaseBlocksOnMainThread -{ - NSMutableArray *blocks = [NSMutableArray array]; - if (completionBlock) { - [blocks addObject:completionBlock]; - [completionBlock release]; - completionBlock = nil; - } - if (failureBlock) { - [blocks addObject:failureBlock]; - [failureBlock release]; - failureBlock = nil; - } - if (startedBlock) { - [blocks addObject:startedBlock]; - [startedBlock release]; - startedBlock = nil; - } - if (headersReceivedBlock) { - [blocks addObject:headersReceivedBlock]; - [headersReceivedBlock release]; - headersReceivedBlock = nil; - } - if (bytesReceivedBlock) { - [blocks addObject:bytesReceivedBlock]; - [bytesReceivedBlock release]; - bytesReceivedBlock = nil; - } - if (bytesSentBlock) { - [blocks addObject:bytesSentBlock]; - [bytesSentBlock release]; - bytesSentBlock = nil; - } - if (downloadSizeIncrementedBlock) { - [blocks addObject:downloadSizeIncrementedBlock]; - [downloadSizeIncrementedBlock release]; - downloadSizeIncrementedBlock = nil; - } - if (uploadSizeIncrementedBlock) { - [blocks addObject:uploadSizeIncrementedBlock]; - [uploadSizeIncrementedBlock release]; - uploadSizeIncrementedBlock = nil; - } - if (dataReceivedBlock) { - [blocks addObject:dataReceivedBlock]; - [dataReceivedBlock release]; - dataReceivedBlock = nil; - } - if (proxyAuthenticationNeededBlock) { - [blocks addObject:proxyAuthenticationNeededBlock]; - [proxyAuthenticationNeededBlock release]; - proxyAuthenticationNeededBlock = nil; - } - if (authenticationNeededBlock) { - [blocks addObject:authenticationNeededBlock]; - [authenticationNeededBlock release]; - authenticationNeededBlock = nil; - } - if (requestRedirectedBlock) { - [blocks addObject:requestRedirectedBlock]; - [requestRedirectedBlock release]; - requestRedirectedBlock = nil; - } - [[self class] performSelectorOnMainThread:@selector(releaseBlocks:) withObject:blocks waitUntilDone:[NSThread isMainThread]]; -} -// Always called on main thread -+ (void)releaseBlocks:(NSArray *)blocks -{ - // Blocks will be released when this method exits -} -#endif - - -#pragma mark setup request - -- (void)addRequestHeader:(NSString *)header value:(NSString *)value -{ - if (!requestHeaders) { - [self setRequestHeaders:[NSMutableDictionary dictionaryWithCapacity:1]]; - } - [requestHeaders setObject:value forKey:header]; -} - -// This function will be called either just before a request starts, or when postLength is needed, whichever comes first -// postLength must be set by the time this function is complete -- (void)buildPostBody -{ - - if ([self haveBuiltPostBody]) { - return; - } - - // Are we submitting the request body from a file on disk - if ([self postBodyFilePath]) { - - // If we were writing to the post body via appendPostData or appendPostDataFromFile, close the write stream - if ([self postBodyWriteStream]) { - [[self postBodyWriteStream] close]; - [self setPostBodyWriteStream:nil]; - } - - - NSString *path; - if ([self shouldCompressRequestBody]) { - if (![self compressedPostBodyFilePath]) { - [self setCompressedPostBodyFilePath:[NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]]; - - NSError *err = nil; - if (![ASIDataCompressor compressDataFromFile:[self postBodyFilePath] toFile:[self compressedPostBodyFilePath] error:&err]) { - [self failWithError:err]; - return; - } - } - path = [self compressedPostBodyFilePath]; - } else { - path = [self postBodyFilePath]; - } - NSError *err = nil; - [self setPostLength:[[[[[NSFileManager alloc] init] autorelease] attributesOfItemAtPath:path error:&err] fileSize]]; - if (err) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIFileManagementError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Failed to get attributes for file at path '%@'",path],NSLocalizedDescriptionKey,error,NSUnderlyingErrorKey,nil]]]; - return; - } - - // Otherwise, we have an in-memory request body - } else { - if ([self shouldCompressRequestBody]) { - NSError *err = nil; - NSData *compressedBody = [ASIDataCompressor compressData:[self postBody] error:&err]; - if (err) { - [self failWithError:err]; - return; - } - [self setCompressedPostBody:compressedBody]; - [self setPostLength:[[self compressedPostBody] length]]; - } else { - [self setPostLength:[[self postBody] length]]; - } - } - - if ([self postLength] > 0) { - if ([requestMethod isEqualToString:@"GET"] || [requestMethod isEqualToString:@"DELETE"] || [requestMethod isEqualToString:@"HEAD"]) { - [self setRequestMethod:@"POST"]; - } - [self addRequestHeader:@"Content-Length" value:[NSString stringWithFormat:@"%llu",[self postLength]]]; - } - [self setHaveBuiltPostBody:YES]; - -} - -// Sets up storage for the post body -- (void)setupPostBody -{ - if ([self shouldStreamPostDataFromDisk]) { - if (![self postBodyFilePath]) { - [self setPostBodyFilePath:[NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]]; - [self setDidCreateTemporaryPostDataFile:YES]; - } - if (![self postBodyWriteStream]) { - [self setPostBodyWriteStream:[[[NSOutputStream alloc] initToFileAtPath:[self postBodyFilePath] append:NO] autorelease]]; - [[self postBodyWriteStream] open]; - } - } else { - if (![self postBody]) { - [self setPostBody:[[[NSMutableData alloc] init] autorelease]]; - } - } -} - -- (void)appendPostData:(NSData *)data -{ - [self setupPostBody]; - if ([data length] == 0) { - return; - } - if ([self shouldStreamPostDataFromDisk]) { - [[self postBodyWriteStream] write:[data bytes] maxLength:[data length]]; - } else { - [[self postBody] appendData:data]; - } -} - -- (void)appendPostDataFromFile:(NSString *)file -{ - [self setupPostBody]; - NSInputStream *stream = [[[NSInputStream alloc] initWithFileAtPath:file] autorelease]; - [stream open]; - NSUInteger bytesRead; - while ([stream hasBytesAvailable]) { - - unsigned char buffer[1024*256]; - bytesRead = [stream read:buffer maxLength:sizeof(buffer)]; - if (bytesRead == 0) { - break; - } - if ([self shouldStreamPostDataFromDisk]) { - [[self postBodyWriteStream] write:buffer maxLength:bytesRead]; - } else { - [[self postBody] appendData:[NSData dataWithBytes:buffer length:bytesRead]]; - } - } - [stream close]; -} - -- (NSString *)requestMethod -{ - [[self cancelledLock] lock]; - NSString *m = requestMethod; - [[self cancelledLock] unlock]; - return m; -} - -- (void)setRequestMethod:(NSString *)newRequestMethod -{ - [[self cancelledLock] lock]; - if (requestMethod != newRequestMethod) { - [requestMethod release]; - requestMethod = [newRequestMethod retain]; - if ([requestMethod isEqualToString:@"POST"] || [requestMethod isEqualToString:@"PUT"] || [postBody length] || postBodyFilePath) { - [self setShouldAttemptPersistentConnection:NO]; - } - } - [[self cancelledLock] unlock]; -} - -- (NSURL *)url -{ - [[self cancelledLock] lock]; - NSURL *u = url; - [[self cancelledLock] unlock]; - return u; -} - - -- (void)setURL:(NSURL *)newURL -{ - [[self cancelledLock] lock]; - if ([newURL isEqual:[self url]]) { - [[self cancelledLock] unlock]; - return; - } - [url release]; - url = [newURL retain]; - if (requestAuthentication) { - CFRelease(requestAuthentication); - requestAuthentication = NULL; - } - if (proxyAuthentication) { - CFRelease(proxyAuthentication); - proxyAuthentication = NULL; - } - if (request) { - CFRelease(request); - request = NULL; - } - [self setRedirectURL:nil]; - [[self cancelledLock] unlock]; -} - -- (id)delegate -{ - [[self cancelledLock] lock]; - id d = delegate; - [[self cancelledLock] unlock]; - return d; -} - -- (void)setDelegate:(id)newDelegate -{ - [[self cancelledLock] lock]; - delegate = newDelegate; - [[self cancelledLock] unlock]; -} - -- (id)queue -{ - [[self cancelledLock] lock]; - id q = queue; - [[self cancelledLock] unlock]; - return q; -} - - -- (void)setQueue:(id)newQueue -{ - [[self cancelledLock] lock]; - if (newQueue != queue) { - [queue release]; - queue = [newQueue retain]; - } - [[self cancelledLock] unlock]; -} - -#pragma mark get information about this request - -// cancel the request - this must be run on the same thread as the request is running on -- (void)cancelOnRequestThread -{ - #if DEBUG_REQUEST_STATUS - ASI_DEBUG_LOG(@"[STATUS] Request cancelled: %@",self); - #endif - - [[self cancelledLock] lock]; - - if ([self isCancelled] || [self complete]) { - [[self cancelledLock] unlock]; - return; - } - [self failWithError:ASIRequestCancelledError]; - [self setComplete:YES]; - [self cancelLoad]; - - CFRetain(self); - [self willChangeValueForKey:@"isCancelled"]; - cancelled = YES; - [self didChangeValueForKey:@"isCancelled"]; - - [[self cancelledLock] unlock]; - CFRelease(self); -} - -- (void)cancel -{ - [self performSelector:@selector(cancelOnRequestThread) onThread:[[self class] threadForRequest:self] withObject:nil waitUntilDone:NO]; -} - -- (void)clearDelegatesAndCancel -{ - [[self cancelledLock] lock]; - - // Clear delegates - [self setDelegate:nil]; - [self setQueue:nil]; - [self setDownloadProgressDelegate:nil]; - [self setUploadProgressDelegate:nil]; - - #if NS_BLOCKS_AVAILABLE - // Clear blocks - [self releaseBlocksOnMainThread]; - #endif - - [[self cancelledLock] unlock]; - [self cancel]; -} - - -- (BOOL)isCancelled -{ - BOOL result; - - [[self cancelledLock] lock]; - result = cancelled; - [[self cancelledLock] unlock]; - - return result; -} - -// Call this method to get the received data as an NSString. Don't use for binary data! -- (NSString *)responseString -{ - NSData *data = [self responseData]; - if (!data) { - return nil; - } - - return [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:[self responseEncoding]] autorelease]; -} - -- (BOOL)isResponseCompressed -{ - NSString *encoding = [[self responseHeaders] objectForKey:@"Content-Encoding"]; - return encoding && [encoding rangeOfString:@"gzip"].location != NSNotFound; -} - -- (NSData *)responseData -{ - if ([self isResponseCompressed] && [self shouldWaitToInflateCompressedResponses]) { - return [ASIDataDecompressor uncompressData:[self rawResponseData] error:NULL]; - } else { - return [self rawResponseData]; - } - return nil; -} - -#pragma mark running a request - -- (void)startSynchronous -{ -#if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING - ASI_DEBUG_LOG(@"[STATUS] Starting synchronous request %@",self); -#endif - [self setSynchronous:YES]; - [self setRunLoopMode:ASIHTTPRequestRunLoopMode]; - [self setInProgress:YES]; - - if (![self isCancelled] && ![self complete]) { - [self main]; - while (!complete) { - [[NSRunLoop currentRunLoop] runMode:[self runLoopMode] beforeDate:[NSDate distantFuture]]; - } - } - - [self setInProgress:NO]; -} - -- (void)start -{ - [self setInProgress:YES]; - [self performSelector:@selector(main) onThread:[[self class] threadForRequest:self] withObject:nil waitUntilDone:NO]; -} - -- (void)startAsynchronous -{ -#if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING - ASI_DEBUG_LOG(@"[STATUS] Starting asynchronous request %@",self); -#endif - [sharedQueue addOperation:self]; -} - -#pragma mark concurrency - -- (BOOL)isConcurrent -{ - return YES; -} - -- (BOOL)isFinished -{ - return finished; -} - -- (BOOL)isExecuting { - return [self inProgress]; -} - -#pragma mark request logic - -// Create the request -- (void)main -{ - @try { - - [[self cancelledLock] lock]; - - #if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 - if ([ASIHTTPRequest isMultitaskingSupported] && [self shouldContinueWhenAppEntersBackground]) { - if (!backgroundTask || backgroundTask == UIBackgroundTaskInvalid) { - backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ - // Synchronize the cleanup call on the main thread in case - // the task actually finishes at around the same time. - dispatch_async(dispatch_get_main_queue(), ^{ - if (backgroundTask != UIBackgroundTaskInvalid) - { - [[UIApplication sharedApplication] endBackgroundTask:backgroundTask]; - backgroundTask = UIBackgroundTaskInvalid; - [self cancel]; - } - }); - }]; - } - } - #endif - - - // A HEAD request generated by an ASINetworkQueue may have set the error already. If so, we should not proceed. - if ([self error]) { - [self setComplete:YES]; - [self markAsFinished]; - return; - } - - [self setComplete:NO]; - [self setDidUseCachedResponse:NO]; - - if (![self url]) { - [self failWithError:ASIUnableToCreateRequestError]; - return; - } - - // Must call before we create the request so that the request method can be set if needs be - if (![self mainRequest]) { - [self buildPostBody]; - } - - if (![[self requestMethod] isEqualToString:@"GET"]) { - [self setDownloadCache:nil]; - } - - - // If we're redirecting, we'll already have a CFHTTPMessageRef - if (request) { - CFRelease(request); - } - - // Create a new HTTP request. - request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)[self requestMethod], (CFURLRef)[self url], [self useHTTPVersionOne] ? kCFHTTPVersion1_0 : kCFHTTPVersion1_1); - if (!request) { - [self failWithError:ASIUnableToCreateRequestError]; - return; - } - - //If this is a HEAD request generated by an ASINetworkQueue, we need to let the main request generate its headers first so we can use them - if ([self mainRequest]) { - [[self mainRequest] buildRequestHeaders]; - } - - // Even if this is a HEAD request with a mainRequest, we still need to call to give subclasses a chance to add their own to HEAD requests (ASIS3Request does this) - [self buildRequestHeaders]; - - if ([self downloadCache]) { - - // If this request should use the default policy, set its policy to the download cache's default policy - if (![self cachePolicy]) { - [self setCachePolicy:[[self downloadCache] defaultCachePolicy]]; - } - - // If have have cached data that is valid for this request, use that and stop - if ([[self downloadCache] canUseCachedDataForRequest:self]) { - [self useDataFromCache]; - return; - } - - // If cached data is stale, or we have been told to ask the server if it has been modified anyway, we need to add headers for a conditional GET - if ([self cachePolicy] & (ASIAskServerIfModifiedWhenStaleCachePolicy|ASIAskServerIfModifiedCachePolicy)) { - - NSDictionary *cachedHeaders = [[self downloadCache] cachedResponseHeadersForURL:[self url]]; - if (cachedHeaders) { - NSString *etag = [cachedHeaders objectForKey:@"Etag"]; - if (etag) { - [[self requestHeaders] setObject:etag forKey:@"If-None-Match"]; - } - NSString *lastModified = [cachedHeaders objectForKey:@"Last-Modified"]; - if (lastModified) { - [[self requestHeaders] setObject:lastModified forKey:@"If-Modified-Since"]; - } - } - } - } - - [self applyAuthorizationHeader]; - - - NSString *header; - for (header in [self requestHeaders]) { - CFHTTPMessageSetHeaderFieldValue(request, (CFStringRef)header, (CFStringRef)[[self requestHeaders] objectForKey:header]); - } - - // If we immediately have access to proxy settings, start the request - // Otherwise, we'll start downloading the proxy PAC file, and call startRequest once that process is complete - if ([self configureProxies]) { - [self startRequest]; - } - - } @catch (NSException *exception) { - NSError *underlyingError = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASIUnhandledExceptionError userInfo:[exception userInfo]]; - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIUnhandledExceptionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[exception name],NSLocalizedDescriptionKey,[exception reason],NSLocalizedFailureReasonErrorKey,underlyingError,NSUnderlyingErrorKey,nil]]]; - - } @finally { - [[self cancelledLock] unlock]; - } -} - -- (void)applyAuthorizationHeader -{ - // Do we want to send credentials before we are asked for them? - if (![self shouldPresentCredentialsBeforeChallenge]) { - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will not send credentials to the server until it asks for them",self); - #endif - return; - } - - NSDictionary *credentials = nil; - - // Do we already have an auth header? - if (![[self requestHeaders] objectForKey:@"Authorization"]) { - - // If we have basic authentication explicitly set and a username and password set on the request, add a basic auth header - if ([self username] && [self password] && [[self authenticationScheme] isEqualToString:(NSString *)kCFHTTPAuthenticationSchemeBasic]) { - [self addBasicAuthenticationHeaderWithUsername:[self username] andPassword:[self password]]; - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ has a username and password set, and was manually configured to use BASIC. Will send credentials without waiting for an authentication challenge",self); - #endif - - } else { - - // See if we have any cached credentials we can use in the session store - if ([self useSessionPersistence]) { - credentials = [self findSessionAuthenticationCredentials]; - - if (credentials) { - - // When the Authentication key is set, the credentials were stored after an authentication challenge, so we can let CFNetwork apply them - // (credentials for Digest and NTLM will always be stored like this) - if ([credentials objectForKey:@"Authentication"]) { - - // If we've already talked to this server and have valid credentials, let's apply them to the request - if (CFHTTPMessageApplyCredentialDictionary(request, (CFHTTPAuthenticationRef)[credentials objectForKey:@"Authentication"], (CFDictionaryRef)[credentials objectForKey:@"Credentials"], NULL)) { - [self setAuthenticationScheme:[credentials objectForKey:@"AuthenticationScheme"]]; - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ found cached credentials (%@), will reuse without waiting for an authentication challenge",self,[credentials objectForKey:@"AuthenticationScheme"]); - #endif - } else { - [[self class] removeAuthenticationCredentialsFromSessionStore:[credentials objectForKey:@"Credentials"]]; - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Failed to apply cached credentials to request %@. These will be removed from the session store, and this request will wait for an authentication challenge",self); - #endif - } - - // If the Authentication key is not set, these credentials were stored after a username and password set on a previous request passed basic authentication - // When this happens, we'll need to create the Authorization header ourselves - } else { - NSDictionary *usernameAndPassword = [credentials objectForKey:@"Credentials"]; - [self addBasicAuthenticationHeaderWithUsername:[usernameAndPassword objectForKey:(NSString *)kCFHTTPAuthenticationUsername] andPassword:[usernameAndPassword objectForKey:(NSString *)kCFHTTPAuthenticationPassword]]; - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ found cached BASIC credentials from a previous request. Will send credentials without waiting for an authentication challenge",self); - #endif - } - } - } - } - } - - // Apply proxy authentication credentials - if ([self useSessionPersistence]) { - credentials = [self findSessionProxyAuthenticationCredentials]; - if (credentials) { - if (!CFHTTPMessageApplyCredentialDictionary(request, (CFHTTPAuthenticationRef)[credentials objectForKey:@"Authentication"], (CFDictionaryRef)[credentials objectForKey:@"Credentials"], NULL)) { - [[self class] removeProxyAuthenticationCredentialsFromSessionStore:[credentials objectForKey:@"Credentials"]]; - } - } - } -} - -- (void)applyCookieHeader -{ - // Add cookies from the persistent (mac os global) store - if ([self useCookiePersistence]) { - NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:[[self url] absoluteURL]]; - if (cookies) { - [[self requestCookies] addObjectsFromArray:cookies]; - } - } - - // Apply request cookies - NSArray *cookies; - if ([self mainRequest]) { - cookies = [[self mainRequest] requestCookies]; - } else { - cookies = [self requestCookies]; - } - if ([cookies count] > 0) { - NSHTTPCookie *cookie; - NSString *cookieHeader = nil; - for (cookie in cookies) { - if (!cookieHeader) { - cookieHeader = [NSString stringWithFormat: @"%@=%@",[cookie name],[cookie value]]; - } else { - cookieHeader = [NSString stringWithFormat: @"%@; %@=%@",cookieHeader,[cookie name],[cookie value]]; - } - } - if (cookieHeader) { - [self addRequestHeader:@"Cookie" value:cookieHeader]; - } - } -} - -- (void)buildRequestHeaders -{ - if ([self haveBuiltRequestHeaders]) { - return; - } - [self setHaveBuiltRequestHeaders:YES]; - - if ([self mainRequest]) { - for (NSString *header in [[self mainRequest] requestHeaders]) { - [self addRequestHeader:header value:[[[self mainRequest] requestHeaders] valueForKey:header]]; - } - return; - } - - [self applyCookieHeader]; - - // Build and set the user agent string if the request does not already have a custom user agent specified - if (![[self requestHeaders] objectForKey:@"User-Agent"]) { - NSString *tempUserAgentString = [self userAgentString]; - if (!tempUserAgentString) { - tempUserAgentString = [ASIHTTPRequest defaultUserAgentString]; - } - if (tempUserAgentString) { - [self addRequestHeader:@"User-Agent" value:tempUserAgentString]; - } - } - - - // Accept a compressed response - if ([self allowCompressedResponse]) { - [self addRequestHeader:@"Accept-Encoding" value:@"gzip"]; - } - - // Configure a compressed request body - if ([self shouldCompressRequestBody]) { - [self addRequestHeader:@"Content-Encoding" value:@"gzip"]; - } - - // Should this request resume an existing download? - [self updatePartialDownloadSize]; - if ([self partialDownloadSize]) { - [self addRequestHeader:@"Range" value:[NSString stringWithFormat:@"bytes=%llu-",[self partialDownloadSize]]]; - } -} - -- (void)updatePartialDownloadSize -{ - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - if ([self allowResumeForFileDownloads] && [self downloadDestinationPath] && [self temporaryFileDownloadPath] && [fileManager fileExistsAtPath:[self temporaryFileDownloadPath]]) { - NSError *err = nil; - [self setPartialDownloadSize:[[fileManager attributesOfItemAtPath:[self temporaryFileDownloadPath] error:&err] fileSize]]; - if (err) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIFileManagementError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Failed to get attributes for file at path '%@'",[self temporaryFileDownloadPath]],NSLocalizedDescriptionKey,error,NSUnderlyingErrorKey,nil]]]; - return; - } - } -} - -- (void)startRequest -{ - if ([self isCancelled]) { - return; - } - - [self performSelectorOnMainThread:@selector(requestStarted) withObject:nil waitUntilDone:[NSThread isMainThread]]; - - [self setDownloadComplete:NO]; - [self setComplete:NO]; - [self setTotalBytesRead:0]; - [self setLastBytesRead:0]; - - if ([self redirectCount] == 0) { - [self setOriginalURL:[self url]]; - } - - // If we're retrying a request, let's remove any progress we made - if ([self lastBytesSent] > 0) { - [self removeUploadProgressSoFar]; - } - - [self setLastBytesSent:0]; - [self setContentLength:0]; - [self setResponseHeaders:nil]; - if (![self downloadDestinationPath]) { - [self setRawResponseData:[[[NSMutableData alloc] init] autorelease]]; - } - - - // - // Create the stream for the request - // - - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - [self setReadStreamIsScheduled:NO]; - - // Do we need to stream the request body from disk - if ([self shouldStreamPostDataFromDisk] && [self postBodyFilePath] && [fileManager fileExistsAtPath:[self postBodyFilePath]]) { - - // Are we gzipping the request body? - if ([self compressedPostBodyFilePath] && [fileManager fileExistsAtPath:[self compressedPostBodyFilePath]]) { - [self setPostBodyReadStream:[ASIInputStream inputStreamWithFileAtPath:[self compressedPostBodyFilePath] request:self]]; - } else { - [self setPostBodyReadStream:[ASIInputStream inputStreamWithFileAtPath:[self postBodyFilePath] request:self]]; - } - [self setReadStream:[NSMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]]; - } else { - - // If we have a request body, we'll stream it from memory using our custom stream, so that we can measure bandwidth use and it can be bandwidth-throttled if necessary - if ([self postBody] && [[self postBody] length] > 0) { - if ([self shouldCompressRequestBody] && [self compressedPostBody]) { - [self setPostBodyReadStream:[ASIInputStream inputStreamWithData:[self compressedPostBody] request:self]]; - } else if ([self postBody]) { - [self setPostBodyReadStream:[ASIInputStream inputStreamWithData:[self postBody] request:self]]; - } - [self setReadStream:[NSMakeCollectable(CFReadStreamCreateForStreamedHTTPRequest(kCFAllocatorDefault, request,(CFReadStreamRef)[self postBodyReadStream])) autorelease]]; - - } else { - [self setReadStream:[NSMakeCollectable(CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, request)) autorelease]]; - } - } - - if (![self readStream]) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileBuildingRequestType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Unable to create read stream",NSLocalizedDescriptionKey,nil]]]; - return; - } - - - - - // - // Handle SSL certificate settings - // - - if([[[[self url] scheme] lowercaseString] isEqualToString:@"https"]) { - - // Tell CFNetwork not to validate SSL certificates - if (![self validatesSecureCertificate]) { - // see: http://iphonedevelopment.blogspot.com/2010/05/nsstream-tcp-and-ssl.html - - NSDictionary *sslProperties = [[NSDictionary alloc] initWithObjectsAndKeys: - [NSNumber numberWithBool:YES], kCFStreamSSLAllowsExpiredCertificates, - [NSNumber numberWithBool:YES], kCFStreamSSLAllowsAnyRoot, - [NSNumber numberWithBool:NO], kCFStreamSSLValidatesCertificateChain, - kCFNull,kCFStreamSSLPeerName, - nil]; - - CFReadStreamSetProperty((CFReadStreamRef)[self readStream], - kCFStreamPropertySSLSettings, - (CFTypeRef)sslProperties); - [sslProperties release]; - } - - // Tell CFNetwork to use a client certificate - if (clientCertificateIdentity) { - NSMutableDictionary *sslProperties = [NSMutableDictionary dictionaryWithCapacity:1]; - - NSMutableArray *certificates = [NSMutableArray arrayWithCapacity:[clientCertificates count]+1]; - - // The first object in the array is our SecIdentityRef - [certificates addObject:(id)clientCertificateIdentity]; - - // If we've added any additional certificates, add them too - for (id cert in clientCertificates) { - [certificates addObject:cert]; - } - - [sslProperties setObject:certificates forKey:(NSString *)kCFStreamSSLCertificates]; - - CFReadStreamSetProperty((CFReadStreamRef)[self readStream], kCFStreamPropertySSLSettings, sslProperties); - } - - } - - // - // Handle proxy settings - // - - if ([self proxyHost] && [self proxyPort]) { - NSString *hostKey; - NSString *portKey; - - if (![self proxyType]) { - [self setProxyType:(NSString *)kCFProxyTypeHTTP]; - } - - if ([[self proxyType] isEqualToString:(NSString *)kCFProxyTypeSOCKS]) { - hostKey = (NSString *)kCFStreamPropertySOCKSProxyHost; - portKey = (NSString *)kCFStreamPropertySOCKSProxyPort; - } else { - hostKey = (NSString *)kCFStreamPropertyHTTPProxyHost; - portKey = (NSString *)kCFStreamPropertyHTTPProxyPort; - if ([[[[self url] scheme] lowercaseString] isEqualToString:@"https"]) { - hostKey = (NSString *)kCFStreamPropertyHTTPSProxyHost; - portKey = (NSString *)kCFStreamPropertyHTTPSProxyPort; - } - } - NSMutableDictionary *proxyToUse = [NSMutableDictionary dictionaryWithObjectsAndKeys:[self proxyHost],hostKey,[NSNumber numberWithInt:[self proxyPort]],portKey,nil]; - - if ([[self proxyType] isEqualToString:(NSString *)kCFProxyTypeSOCKS]) { - CFReadStreamSetProperty((CFReadStreamRef)[self readStream], kCFStreamPropertySOCKSProxy, proxyToUse); - } else { - CFReadStreamSetProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPProxy, proxyToUse); - } - } - - - // - // Handle persistent connections - // - - [ASIHTTPRequest expirePersistentConnections]; - - [connectionsLock lock]; - - - if (![[self url] host] || ![[self url] scheme]) { - [self setConnectionInfo:nil]; - [self setShouldAttemptPersistentConnection:NO]; - } - - // Will store the old stream that was using this connection (if there was one) so we can clean it up once we've opened our own stream - NSInputStream *oldStream = nil; - - // Use a persistent connection if possible - if ([self shouldAttemptPersistentConnection]) { - - - // If we are redirecting, we will re-use the current connection only if we are connecting to the same server - if ([self connectionInfo]) { - - if (![[[self connectionInfo] objectForKey:@"host"] isEqualToString:[[self url] host]] || ![[[self connectionInfo] objectForKey:@"scheme"] isEqualToString:[[self url] scheme]] || [(NSNumber *)[[self connectionInfo] objectForKey:@"port"] intValue] != [[[self url] port] intValue]) { - [self setConnectionInfo:nil]; - - // Check if we should have expired this connection - } else if ([[[self connectionInfo] objectForKey:@"expires"] timeIntervalSinceNow] < 0) { - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Not re-using connection #%i because it has expired",[[[self connectionInfo] objectForKey:@"id"] intValue]); - #endif - [persistentConnectionsPool removeObject:[self connectionInfo]]; - [self setConnectionInfo:nil]; - - } else if ([[self connectionInfo] objectForKey:@"request"] != nil) { - //Some other request reused this connection already - we'll have to create a new one - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"%@ - Not re-using connection #%i for request #%i because it is already used by request #%i",self,[[[self connectionInfo] objectForKey:@"id"] intValue],[[self requestID] intValue],[[[self connectionInfo] objectForKey:@"request"] intValue]); - #endif - [self setConnectionInfo:nil]; - } - } - - - - if (![self connectionInfo] && [[self url] host] && [[self url] scheme]) { // We must have a proper url with a host and scheme, or this will explode - - // Look for a connection to the same server in the pool - for (NSMutableDictionary *existingConnection in persistentConnectionsPool) { - if (![existingConnection objectForKey:@"request"] && [[existingConnection objectForKey:@"host"] isEqualToString:[[self url] host]] && [[existingConnection objectForKey:@"scheme"] isEqualToString:[[self url] scheme]] && [(NSNumber *)[existingConnection objectForKey:@"port"] intValue] == [[[self url] port] intValue]) { - [self setConnectionInfo:existingConnection]; - } - } - } - - if ([[self connectionInfo] objectForKey:@"stream"]) { - oldStream = [[[self connectionInfo] objectForKey:@"stream"] retain]; - - } - - // No free connection was found in the pool matching the server/scheme/port we're connecting to, we'll need to create a new one - if (![self connectionInfo]) { - [self setConnectionInfo:[NSMutableDictionary dictionary]]; - nextConnectionNumberToCreate++; - [[self connectionInfo] setObject:[NSNumber numberWithInt:nextConnectionNumberToCreate] forKey:@"id"]; - [[self connectionInfo] setObject:[[self url] host] forKey:@"host"]; - [[self connectionInfo] setObject:[NSNumber numberWithInt:[[[self url] port] intValue]] forKey:@"port"]; - [[self connectionInfo] setObject:[[self url] scheme] forKey:@"scheme"]; - [persistentConnectionsPool addObject:[self connectionInfo]]; - } - - // If we are retrying this request, it will already have a requestID - if (![self requestID]) { - nextRequestID++; - [self setRequestID:[NSNumber numberWithUnsignedInt:nextRequestID]]; - } - [[self connectionInfo] setObject:[self requestID] forKey:@"request"]; - [[self connectionInfo] setObject:[self readStream] forKey:@"stream"]; - CFReadStreamSetProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPAttemptPersistentConnection, kCFBooleanTrue); - - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Request #%@ will use connection #%i",[self requestID],[[[self connectionInfo] objectForKey:@"id"] intValue]); - #endif - - - // Tag the stream with an id that tells it which connection to use behind the scenes - // See http://lists.apple.com/archives/macnetworkprog/2008/Dec/msg00001.html for details on this approach - - CFReadStreamSetProperty((CFReadStreamRef)[self readStream], CFSTR("ASIStreamID"), [[self connectionInfo] objectForKey:@"id"]); - - } else { - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Request %@ will not use a persistent connection",self); - #endif - } - - [connectionsLock unlock]; - - // Schedule the stream - if (![self readStreamIsScheduled] && (!throttleWakeUpTime || [throttleWakeUpTime timeIntervalSinceDate:[NSDate date]] < 0)) { - [self scheduleReadStream]; - } - - BOOL streamSuccessfullyOpened = NO; - - - // Start the HTTP connection - CFStreamClientContext ctxt = {0, self, NULL, NULL, NULL}; - if (CFReadStreamSetClient((CFReadStreamRef)[self readStream], kNetworkEvents, ReadStreamClientCallBack, &ctxt)) { - if (CFReadStreamOpen((CFReadStreamRef)[self readStream])) { - streamSuccessfullyOpened = YES; - } - } - - // Here, we'll close the stream that was previously using this connection, if there was one - // We've kept it open until now (when we've just opened a new stream) so that the new stream can make use of the old connection - // http://lists.apple.com/archives/Macnetworkprog/2006/Mar/msg00119.html - if (oldStream) { - [oldStream close]; - [oldStream release]; - oldStream = nil; - } - - if (!streamSuccessfullyOpened) { - [self setConnectionCanBeReused:NO]; - [self destroyReadStream]; - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileBuildingRequestType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Unable to start HTTP connection",NSLocalizedDescriptionKey,nil]]]; - return; - } - - if (![self mainRequest]) { - if ([self shouldResetUploadProgress]) { - if ([self showAccurateProgress]) { - [self incrementUploadSizeBy:[self postLength]]; - } else { - [self incrementUploadSizeBy:1]; - } - [ASIHTTPRequest updateProgressIndicator:&uploadProgressDelegate withProgress:0 ofTotal:1]; - } - if ([self shouldResetDownloadProgress] && ![self partialDownloadSize]) { - [ASIHTTPRequest updateProgressIndicator:&downloadProgressDelegate withProgress:0 ofTotal:1]; - } - } - - - // Record when the request started, so we can timeout if nothing happens - [self setLastActivityTime:[NSDate date]]; - [self setStatusTimer:[NSTimer timerWithTimeInterval:0.25 target:self selector:@selector(updateStatus:) userInfo:nil repeats:YES]]; - [[NSRunLoop currentRunLoop] addTimer:[self statusTimer] forMode:[self runLoopMode]]; -} - -- (void)setStatusTimer:(NSTimer *)timer -{ - CFRetain(self); - // We must invalidate the old timer here, not before we've created and scheduled a new timer - // This is because the timer may be the only thing retaining an asynchronous request - if (statusTimer && timer != statusTimer) { - [statusTimer invalidate]; - [statusTimer release]; - } - statusTimer = [timer retain]; - CFRelease(self); -} - -// This gets fired every 1/4 of a second to update the progress and work out if we need to timeout -- (void)updateStatus:(NSTimer*)timer -{ - [self checkRequestStatus]; - if (![self inProgress]) { - [self setStatusTimer:nil]; - } -} - -- (void)performRedirect -{ - [self setURL:[self redirectURL]]; - [self setComplete:YES]; - [self setNeedsRedirect:NO]; - [self setRedirectCount:[self redirectCount]+1]; - - if ([self redirectCount] > RedirectionLimit) { - // Some naughty / badly coded website is trying to force us into a redirection loop. This is not cool. - [self failWithError:ASITooMuchRedirectionError]; - [self setComplete:YES]; - } else { - // Go all the way back to the beginning and build the request again, so that we can apply any new cookies - [self main]; - } -} - -// Called by delegate to resume loading with a new url after the delegate received request:willRedirectToURL: -- (void)redirectToURL:(NSURL *)newURL -{ - [self setRedirectURL:newURL]; - [self performSelector:@selector(performRedirect) onThread:[[self class] threadForRequest:self] withObject:nil waitUntilDone:NO]; -} - -- (BOOL)shouldTimeOut -{ - NSTimeInterval secondsSinceLastActivity = [[NSDate date] timeIntervalSinceDate:lastActivityTime]; - // See if we need to timeout - if ([self readStream] && [self readStreamIsScheduled] && [self lastActivityTime] && [self timeOutSeconds] > 0 && secondsSinceLastActivity > [self timeOutSeconds]) { - - // We have no body, or we've sent more than the upload buffer size,so we can safely time out here - if ([self postLength] == 0 || ([self uploadBufferSize] > 0 && [self totalBytesSent] > [self uploadBufferSize])) { - return YES; - - // ***Black magic warning*** - // We have a body, but we've taken longer than timeOutSeconds to upload the first small chunk of data - // Since there's no reliable way to track upload progress for the first 32KB (iPhone) or 128KB (Mac) with CFNetwork, we'll be slightly more forgiving on the timeout, as there's a strong chance our connection is just very slow. - } else if (secondsSinceLastActivity > [self timeOutSeconds]*1.5) { - return YES; - } - } - return NO; -} - -- (void)checkRequestStatus -{ - // We won't let the request cancel while we're updating progress / checking for a timeout - [[self cancelledLock] lock]; - // See if our NSOperationQueue told us to cancel - if ([self isCancelled] || [self complete]) { - [[self cancelledLock] unlock]; - return; - } - - [self performThrottling]; - - if ([self shouldTimeOut]) { - // Do we need to auto-retry this request? - if ([self numberOfTimesToRetryOnTimeout] > [self retryCount]) { - - // If we are resuming a download, we may need to update the Range header to take account of data we've just downloaded - [self updatePartialDownloadSize]; - if ([self partialDownloadSize]) { - CFHTTPMessageSetHeaderFieldValue(request, (CFStringRef)@"Range", (CFStringRef)[NSString stringWithFormat:@"bytes=%llu-",[self partialDownloadSize]]); - } - [self setRetryCount:[self retryCount]+1]; - [self unscheduleReadStream]; - [[self cancelledLock] unlock]; - [self startRequest]; - return; - } - [self failWithError:ASIRequestTimedOutError]; - [self cancelLoad]; - [self setComplete:YES]; - [[self cancelledLock] unlock]; - return; - } - - // readStream will be null if we aren't currently running (perhaps we're waiting for a delegate to supply credentials) - if ([self readStream]) { - - // If we have a post body - if ([self postLength]) { - - [self setLastBytesSent:totalBytesSent]; - - // Find out how much data we've uploaded so far - [self setTotalBytesSent:[[NSMakeCollectable(CFReadStreamCopyProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPRequestBytesWrittenCount)) autorelease] unsignedLongLongValue]]; - if (totalBytesSent > lastBytesSent) { - - // We've uploaded more data, reset the timeout - [self setLastActivityTime:[NSDate date]]; - [ASIHTTPRequest incrementBandwidthUsedInLastSecond:(unsigned long)(totalBytesSent-lastBytesSent)]; - - #if DEBUG_REQUEST_STATUS - if ([self totalBytesSent] == [self postLength]) { - ASI_DEBUG_LOG(@"[STATUS] Request %@ finished uploading data",self); - } - #endif - } - } - - [self updateProgressIndicators]; - - } - - [[self cancelledLock] unlock]; -} - - -// Cancel loading and clean up. DO NOT USE THIS TO CANCEL REQUESTS - use [request cancel] instead -- (void)cancelLoad -{ - // If we're in the middle of downloading a PAC file, let's stop that first - if (PACFileReadStream) { - [PACFileReadStream setDelegate:nil]; - [PACFileReadStream close]; - [self setPACFileReadStream:nil]; - [self setPACFileData:nil]; - } else if (PACFileRequest) { - [PACFileRequest setDelegate:nil]; - [PACFileRequest cancel]; - [self setPACFileRequest:nil]; - } - - [self destroyReadStream]; - - [[self postBodyReadStream] close]; - [self setPostBodyReadStream:nil]; - - if ([self rawResponseData]) { - if (![self complete]) { - [self setRawResponseData:nil]; - } - // If we were downloading to a file - } else if ([self temporaryFileDownloadPath]) { - [[self fileDownloadOutputStream] close]; - [self setFileDownloadOutputStream:nil]; - - [[self inflatedFileDownloadOutputStream] close]; - [self setInflatedFileDownloadOutputStream:nil]; - - // If we haven't said we might want to resume, let's remove the temporary file too - if (![self complete]) { - if (![self allowResumeForFileDownloads]) { - [self removeTemporaryDownloadFile]; - } - [self removeTemporaryUncompressedDownloadFile]; - } - } - - // Clean up any temporary file used to store request body for streaming - if (![self authenticationNeeded] && ![self willRetryRequest] && [self didCreateTemporaryPostDataFile]) { - [self removeTemporaryUploadFile]; - [self removeTemporaryCompressedUploadFile]; - [self setDidCreateTemporaryPostDataFile:NO]; - } -} - -#pragma mark HEAD request - -// Used by ASINetworkQueue to create a HEAD request appropriate for this request with the same headers (though you can use it yourself) -- (ASIHTTPRequest *)HEADRequest -{ - ASIHTTPRequest *headRequest = [[self class] requestWithURL:[self url]]; - - // Copy the properties that make sense for a HEAD request - [headRequest setRequestHeaders:[[[self requestHeaders] mutableCopy] autorelease]]; - [headRequest setRequestCookies:[[[self requestCookies] mutableCopy] autorelease]]; - [headRequest setUseCookiePersistence:[self useCookiePersistence]]; - [headRequest setUseKeychainPersistence:[self useKeychainPersistence]]; - [headRequest setUseSessionPersistence:[self useSessionPersistence]]; - [headRequest setAllowCompressedResponse:[self allowCompressedResponse]]; - [headRequest setUsername:[self username]]; - [headRequest setPassword:[self password]]; - [headRequest setDomain:[self domain]]; - [headRequest setProxyUsername:[self proxyUsername]]; - [headRequest setProxyPassword:[self proxyPassword]]; - [headRequest setProxyDomain:[self proxyDomain]]; - [headRequest setProxyHost:[self proxyHost]]; - [headRequest setProxyPort:[self proxyPort]]; - [headRequest setProxyType:[self proxyType]]; - [headRequest setShouldPresentAuthenticationDialog:[self shouldPresentAuthenticationDialog]]; - [headRequest setShouldPresentProxyAuthenticationDialog:[self shouldPresentProxyAuthenticationDialog]]; - [headRequest setTimeOutSeconds:[self timeOutSeconds]]; - [headRequest setUseHTTPVersionOne:[self useHTTPVersionOne]]; - [headRequest setValidatesSecureCertificate:[self validatesSecureCertificate]]; - [headRequest setClientCertificateIdentity:clientCertificateIdentity]; - [headRequest setClientCertificates:[[clientCertificates copy] autorelease]]; - [headRequest setPACurl:[self PACurl]]; - [headRequest setShouldPresentCredentialsBeforeChallenge:[self shouldPresentCredentialsBeforeChallenge]]; - [headRequest setNumberOfTimesToRetryOnTimeout:[self numberOfTimesToRetryOnTimeout]]; - [headRequest setShouldUseRFC2616RedirectBehaviour:[self shouldUseRFC2616RedirectBehaviour]]; - [headRequest setShouldAttemptPersistentConnection:[self shouldAttemptPersistentConnection]]; - [headRequest setPersistentConnectionTimeoutSeconds:[self persistentConnectionTimeoutSeconds]]; - - [headRequest setMainRequest:self]; - [headRequest setRequestMethod:@"HEAD"]; - return headRequest; -} - - -#pragma mark upload/download progress - - -- (void)updateProgressIndicators -{ - //Only update progress if this isn't a HEAD request used to preset the content-length - if (![self mainRequest]) { - if ([self showAccurateProgress] || ([self complete] && ![self updatedProgress])) { - [self updateUploadProgress]; - [self updateDownloadProgress]; - } - } -} - -- (id)uploadProgressDelegate -{ - [[self cancelledLock] lock]; - id d = [[uploadProgressDelegate retain] autorelease]; - [[self cancelledLock] unlock]; - return d; -} - -- (void)setUploadProgressDelegate:(id)newDelegate -{ - [[self cancelledLock] lock]; - uploadProgressDelegate = newDelegate; - - #if !TARGET_OS_IPHONE - // If the uploadProgressDelegate is an NSProgressIndicator, we set its MaxValue to 1.0 so we can update it as if it were a UIProgressView - double max = 1.0; - [ASIHTTPRequest performSelector:@selector(setMaxValue:) onTarget:&uploadProgressDelegate withObject:nil amount:&max callerToRetain:nil]; - #endif - [[self cancelledLock] unlock]; -} - -- (id)downloadProgressDelegate -{ - [[self cancelledLock] lock]; - id d = [[downloadProgressDelegate retain] autorelease]; - [[self cancelledLock] unlock]; - return d; -} - -- (void)setDownloadProgressDelegate:(id)newDelegate -{ - [[self cancelledLock] lock]; - downloadProgressDelegate = newDelegate; - - #if !TARGET_OS_IPHONE - // If the downloadProgressDelegate is an NSProgressIndicator, we set its MaxValue to 1.0 so we can update it as if it were a UIProgressView - double max = 1.0; - [ASIHTTPRequest performSelector:@selector(setMaxValue:) onTarget:&downloadProgressDelegate withObject:nil amount:&max callerToRetain:nil]; - #endif - [[self cancelledLock] unlock]; -} - - -- (void)updateDownloadProgress -{ - // We won't update download progress until we've examined the headers, since we might need to authenticate - if (![self responseHeaders] || [self needsRedirect] || !([self contentLength] || [self complete])) { - return; - } - - unsigned long long bytesReadSoFar = [self totalBytesRead]+[self partialDownloadSize]; - unsigned long long value = 0; - - if ([self showAccurateProgress] && [self contentLength]) { - value = bytesReadSoFar-[self lastBytesRead]; - if (value == 0) { - return; - } - } else { - value = 1; - [self setUpdatedProgress:YES]; - } - if (!value) { - return; - } - - [ASIHTTPRequest performSelector:@selector(request:didReceiveBytes:) onTarget:&queue withObject:self amount:&value callerToRetain:self]; - [ASIHTTPRequest performSelector:@selector(request:didReceiveBytes:) onTarget:&downloadProgressDelegate withObject:self amount:&value callerToRetain:self]; - - [ASIHTTPRequest updateProgressIndicator:&downloadProgressDelegate withProgress:[self totalBytesRead]+[self partialDownloadSize] ofTotal:[self contentLength]+[self partialDownloadSize]]; - - #if NS_BLOCKS_AVAILABLE - if (bytesReceivedBlock) { - unsigned long long totalSize = [self contentLength] + [self partialDownloadSize]; - [self performBlockOnMainThread:^{ if (bytesReceivedBlock) { bytesReceivedBlock(value, totalSize); }}]; - } - #endif - [self setLastBytesRead:bytesReadSoFar]; -} - -- (void)updateUploadProgress -{ - if ([self isCancelled] || [self totalBytesSent] == 0) { - return; - } - - // If this is the first time we've written to the buffer, totalBytesSent will be the size of the buffer (currently seems to be 128KB on both Leopard and iPhone 2.2.1, 32KB on iPhone 3.0) - // If request body is less than the buffer size, totalBytesSent will be the total size of the request body - // We will remove this from any progress display, as kCFStreamPropertyHTTPRequestBytesWrittenCount does not tell us how much data has actually be written - if ([self uploadBufferSize] == 0 && [self totalBytesSent] != [self postLength]) { - [self setUploadBufferSize:[self totalBytesSent]]; - [self incrementUploadSizeBy:-[self uploadBufferSize]]; - } - - unsigned long long value = 0; - - if ([self showAccurateProgress]) { - if ([self totalBytesSent] == [self postLength] || [self lastBytesSent] > 0) { - value = [self totalBytesSent]-[self lastBytesSent]; - } else { - return; - } - } else { - value = 1; - [self setUpdatedProgress:YES]; - } - - if (!value) { - return; - } - - [ASIHTTPRequest performSelector:@selector(request:didSendBytes:) onTarget:&queue withObject:self amount:&value callerToRetain:self]; - [ASIHTTPRequest performSelector:@selector(request:didSendBytes:) onTarget:&uploadProgressDelegate withObject:self amount:&value callerToRetain:self]; - [ASIHTTPRequest updateProgressIndicator:&uploadProgressDelegate withProgress:[self totalBytesSent]-[self uploadBufferSize] ofTotal:[self postLength]-[self uploadBufferSize]]; - - #if NS_BLOCKS_AVAILABLE - if(bytesSentBlock){ - unsigned long long totalSize = [self postLength]; - [self performBlockOnMainThread:^{ if (bytesSentBlock) { bytesSentBlock(value, totalSize); }}]; - } - #endif -} - - -- (void)incrementDownloadSizeBy:(long long)length -{ - [ASIHTTPRequest performSelector:@selector(request:incrementDownloadSizeBy:) onTarget:&queue withObject:self amount:&length callerToRetain:self]; - [ASIHTTPRequest performSelector:@selector(request:incrementDownloadSizeBy:) onTarget:&downloadProgressDelegate withObject:self amount:&length callerToRetain:self]; - - #if NS_BLOCKS_AVAILABLE - if(downloadSizeIncrementedBlock){ - [self performBlockOnMainThread:^{ if (downloadSizeIncrementedBlock) { downloadSizeIncrementedBlock(length); }}]; - } - #endif -} - -- (void)incrementUploadSizeBy:(long long)length -{ - [ASIHTTPRequest performSelector:@selector(request:incrementUploadSizeBy:) onTarget:&queue withObject:self amount:&length callerToRetain:self]; - [ASIHTTPRequest performSelector:@selector(request:incrementUploadSizeBy:) onTarget:&uploadProgressDelegate withObject:self amount:&length callerToRetain:self]; - - #if NS_BLOCKS_AVAILABLE - if(uploadSizeIncrementedBlock) { - [self performBlockOnMainThread:^{ if (uploadSizeIncrementedBlock) { uploadSizeIncrementedBlock(length); }}]; - } - #endif -} - - --(void)removeUploadProgressSoFar -{ - long long progressToRemove = -[self totalBytesSent]; - [ASIHTTPRequest performSelector:@selector(request:didSendBytes:) onTarget:&queue withObject:self amount:&progressToRemove callerToRetain:self]; - [ASIHTTPRequest performSelector:@selector(request:didSendBytes:) onTarget:&uploadProgressDelegate withObject:self amount:&progressToRemove callerToRetain:self]; - [ASIHTTPRequest updateProgressIndicator:&uploadProgressDelegate withProgress:0 ofTotal:[self postLength]]; - - #if NS_BLOCKS_AVAILABLE - if(bytesSentBlock){ - unsigned long long totalSize = [self postLength]; - [self performBlockOnMainThread:^{ if (bytesSentBlock) { bytesSentBlock(progressToRemove, totalSize); }}]; - } - #endif -} - -#if NS_BLOCKS_AVAILABLE -- (void)performBlockOnMainThread:(ASIBasicBlock)block -{ - [self performSelectorOnMainThread:@selector(callBlock:) withObject:[[block copy] autorelease] waitUntilDone:[NSThread isMainThread]]; -} - -- (void)callBlock:(ASIBasicBlock)block -{ - block(); -} -#endif - - -+ (void)performSelector:(SEL)selector onTarget:(id *)target withObject:(id)object amount:(void *)amount callerToRetain:(id)callerToRetain -{ - if ([*target respondsToSelector:selector]) { - NSMethodSignature *signature = nil; - signature = [*target methodSignatureForSelector:selector]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; - - [invocation setSelector:selector]; - - int argumentNumber = 2; - - // If we got an object parameter, we pass a pointer to the object pointer - if (object) { - [invocation setArgument:&object atIndex:argumentNumber]; - argumentNumber++; - } - - // For the amount we'll just pass the pointer directly so NSInvocation will call the method using the number itself rather than a pointer to it - if (amount) { - [invocation setArgument:amount atIndex:argumentNumber]; - } - - SEL callback = @selector(performInvocation:onTarget:releasingObject:); - NSMethodSignature *cbSignature = [ASIHTTPRequest methodSignatureForSelector:callback]; - NSInvocation *cbInvocation = [NSInvocation invocationWithMethodSignature:cbSignature]; - [cbInvocation setSelector:callback]; - [cbInvocation setTarget:self]; - [cbInvocation setArgument:&invocation atIndex:2]; - [cbInvocation setArgument:&target atIndex:3]; - if (callerToRetain) { - [cbInvocation setArgument:&callerToRetain atIndex:4]; - } - - CFRetain(invocation); - - // Used to pass in a request that we must retain until after the call - // We're using CFRetain rather than [callerToRetain retain] so things to avoid earthquakes when using garbage collection - if (callerToRetain) { - CFRetain(callerToRetain); - } - [cbInvocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:[NSThread isMainThread]]; - } -} - -+ (void)performInvocation:(NSInvocation *)invocation onTarget:(id *)target releasingObject:(id)objectToRelease -{ - if (*target && [*target respondsToSelector:[invocation selector]]) { - [invocation invokeWithTarget:*target]; - } - CFRelease(invocation); - if (objectToRelease) { - CFRelease(objectToRelease); - } -} - - -+ (void)updateProgressIndicator:(id *)indicator withProgress:(unsigned long long)progress ofTotal:(unsigned long long)total -{ - #if TARGET_OS_IPHONE - // Cocoa Touch: UIProgressView - SEL selector = @selector(setProgress:); - float progressAmount = (float)((progress*1.0)/(total*1.0)); - - #else - // Cocoa: NSProgressIndicator - double progressAmount = progressAmount = (progress*1.0)/(total*1.0); - SEL selector = @selector(setDoubleValue:); - #endif - - if (![*indicator respondsToSelector:selector]) { - return; - } - - [progressLock lock]; - [ASIHTTPRequest performSelector:selector onTarget:indicator withObject:nil amount:&progressAmount callerToRetain:nil]; - [progressLock unlock]; -} - - -#pragma mark talking to delegates / calling blocks - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)requestStarted -{ - if ([self error] || [self mainRequest]) { - return; - } - if (delegate && [delegate respondsToSelector:didStartSelector]) { - [delegate performSelector:didStartSelector withObject:self]; - } - #if NS_BLOCKS_AVAILABLE - if(startedBlock){ - startedBlock(); - } - #endif - if (queue && [queue respondsToSelector:@selector(requestStarted:)]) { - [queue performSelector:@selector(requestStarted:) withObject:self]; - } -} - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)requestRedirected -{ - if ([self error] || [self mainRequest]) { - return; - } - - if([[self delegate] respondsToSelector:@selector(requestRedirected:)]){ - [[self delegate] performSelector:@selector(requestRedirected:) withObject:self]; - } - - #if NS_BLOCKS_AVAILABLE - if(requestRedirectedBlock){ - requestRedirectedBlock(); - } - #endif -} - - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)requestReceivedResponseHeaders:(NSMutableDictionary *)newResponseHeaders -{ - if ([self error] || [self mainRequest]) { - return; - } - - if (delegate && [delegate respondsToSelector:didReceiveResponseHeadersSelector]) { - [delegate performSelector:didReceiveResponseHeadersSelector withObject:self withObject:newResponseHeaders]; - } - - #if NS_BLOCKS_AVAILABLE - if(headersReceivedBlock){ - headersReceivedBlock(newResponseHeaders); - } - #endif - - if (queue && [queue respondsToSelector:@selector(request:didReceiveResponseHeaders:)]) { - [queue performSelector:@selector(request:didReceiveResponseHeaders:) withObject:self withObject:newResponseHeaders]; - } -} - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)requestWillRedirectToURL:(NSURL *)newURL -{ - if ([self error] || [self mainRequest]) { - return; - } - if (delegate && [delegate respondsToSelector:willRedirectSelector]) { - [delegate performSelector:willRedirectSelector withObject:self withObject:newURL]; - } - if (queue && [queue respondsToSelector:@selector(request:willRedirectToURL:)]) { - [queue performSelector:@selector(request:willRedirectToURL:) withObject:self withObject:newURL]; - } -} - -// Subclasses might override this method to process the result in the same thread -// If you do this, don't forget to call [super requestFinished] to let the queue / delegate know we're done -- (void)requestFinished -{ -#if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING - ASI_DEBUG_LOG(@"[STATUS] Request finished: %@",self); -#endif - if ([self error] || [self mainRequest]) { - return; - } - if ([self isPACFileRequest]) { - [self reportFinished]; - } else { - [self performSelectorOnMainThread:@selector(reportFinished) withObject:nil waitUntilDone:[NSThread isMainThread]]; - } -} - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)reportFinished -{ - if (delegate && [delegate respondsToSelector:didFinishSelector]) { - [delegate performSelector:didFinishSelector withObject:self]; - } - - #if NS_BLOCKS_AVAILABLE - if(completionBlock){ - completionBlock(); - } - #endif - - if (queue && [queue respondsToSelector:@selector(requestFinished:)]) { - [queue performSelector:@selector(requestFinished:) withObject:self]; - } -} - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)reportFailure -{ - if (delegate && [delegate respondsToSelector:didFailSelector]) { - [delegate performSelector:didFailSelector withObject:self]; - } - - #if NS_BLOCKS_AVAILABLE - if(failureBlock){ - failureBlock(); - } - #endif - - if (queue && [queue respondsToSelector:@selector(requestFailed:)]) { - [queue performSelector:@selector(requestFailed:) withObject:self]; - } -} - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)passOnReceivedData:(NSData *)data -{ - if (delegate && [delegate respondsToSelector:didReceiveDataSelector]) { - [delegate performSelector:didReceiveDataSelector withObject:self withObject:data]; - } - - #if NS_BLOCKS_AVAILABLE - if (dataReceivedBlock) { - dataReceivedBlock(data); - } - #endif -} - -// Subclasses might override this method to perform error handling in the same thread -// If you do this, don't forget to call [super failWithError:] to let the queue / delegate know we're done -- (void)failWithError:(NSError *)theError -{ -#if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING - ASI_DEBUG_LOG(@"[STATUS] Request %@: %@",self,(theError == ASIRequestCancelledError ? @"Cancelled" : @"Failed")); -#endif - [self setComplete:YES]; - - // Invalidate the current connection so subsequent requests don't attempt to reuse it - if (theError && [theError code] != ASIAuthenticationErrorType && [theError code] != ASITooMuchRedirectionErrorType) { - [connectionsLock lock]; - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Request #%@ failed and will invalidate connection #%@",[self requestID],[[self connectionInfo] objectForKey:@"id"]); - #endif - [[self connectionInfo] removeObjectForKey:@"request"]; - [persistentConnectionsPool removeObject:[self connectionInfo]]; - [connectionsLock unlock]; - [self destroyReadStream]; - } - if ([self connectionCanBeReused]) { - [[self connectionInfo] setObject:[NSDate dateWithTimeIntervalSinceNow:[self persistentConnectionTimeoutSeconds]] forKey:@"expires"]; - } - - if ([self isCancelled] || [self error]) { - return; - } - - // If we have cached data, use it and ignore the error when using ASIFallbackToCacheIfLoadFailsCachePolicy - if ([self downloadCache] && ([self cachePolicy] & ASIFallbackToCacheIfLoadFailsCachePolicy)) { - if ([[self downloadCache] canUseCachedDataForRequest:self]) { - [self useDataFromCache]; - return; - } - } - - - [self setError:theError]; - - ASIHTTPRequest *failedRequest = self; - - // If this is a HEAD request created by an ASINetworkQueue or compatible queue delegate, make the main request fail - if ([self mainRequest]) { - failedRequest = [self mainRequest]; - [failedRequest setError:theError]; - } - - if ([self isPACFileRequest]) { - [failedRequest reportFailure]; - } else { - [failedRequest performSelectorOnMainThread:@selector(reportFailure) withObject:nil waitUntilDone:[NSThread isMainThread]]; - } - - if (!inProgress) - { - // if we're not in progress, we can't notify the queue we've finished (doing so can cause a crash later on) - // "markAsFinished" will be at the start of main() when we are started - return; - } - [self markAsFinished]; -} - -#pragma mark parsing HTTP response headers - -- (void)readResponseHeaders -{ - [self setAuthenticationNeeded:ASINoAuthenticationNeededYet]; - - CFHTTPMessageRef message = (CFHTTPMessageRef)CFReadStreamCopyProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPResponseHeader); - if (!message) { - return; - } - - // Make sure we've received all the headers - if (!CFHTTPMessageIsHeaderComplete(message)) { - CFRelease(message); - return; - } - - #if DEBUG_REQUEST_STATUS - if ([self totalBytesSent] == [self postLength]) { - ASI_DEBUG_LOG(@"[STATUS] Request %@ received response headers",self); - } - #endif - - [self setResponseHeaders:[NSMakeCollectable(CFHTTPMessageCopyAllHeaderFields(message)) autorelease]]; - [self setResponseStatusCode:(int)CFHTTPMessageGetResponseStatusCode(message)]; - [self setResponseStatusMessage:[NSMakeCollectable(CFHTTPMessageCopyResponseStatusLine(message)) autorelease]]; - - if ([self downloadCache] && ([[self downloadCache] canUseCachedDataForRequest:self])) { - - // Update the expiry date - [[self downloadCache] updateExpiryForRequest:self maxAge:[self secondsToCache]]; - - // Read the response from the cache - [self useDataFromCache]; - - CFRelease(message); - return; - } - - // Is the server response a challenge for credentials? - if ([self responseStatusCode] == 401) { - [self setAuthenticationNeeded:ASIHTTPAuthenticationNeeded]; - } else if ([self responseStatusCode] == 407) { - [self setAuthenticationNeeded:ASIProxyAuthenticationNeeded]; - } else { - #if DEBUG_HTTP_AUTHENTICATION - if ([self authenticationScheme]) { - ASI_DEBUG_LOG(@"[AUTH] Request %@ has passed %@ authentication",self,[self authenticationScheme]); - } - #endif - } - - // Authentication succeeded, or no authentication was required - if (![self authenticationNeeded]) { - - // Did we get here without an authentication challenge? (which can happen when shouldPresentCredentialsBeforeChallenge is YES and basic auth was successful) - if (!requestAuthentication && [[self authenticationScheme] isEqualToString:(NSString *)kCFHTTPAuthenticationSchemeBasic] && [self username] && [self password] && [self useSessionPersistence]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ passed BASIC authentication, and will save credentials in the session store for future use",self); - #endif - - NSMutableDictionary *newCredentials = [NSMutableDictionary dictionaryWithCapacity:2]; - [newCredentials setObject:[self username] forKey:(NSString *)kCFHTTPAuthenticationUsername]; - [newCredentials setObject:[self password] forKey:(NSString *)kCFHTTPAuthenticationPassword]; - - // Store the credentials in the session - NSMutableDictionary *sessionCredentials = [NSMutableDictionary dictionary]; - [sessionCredentials setObject:newCredentials forKey:@"Credentials"]; - [sessionCredentials setObject:[self url] forKey:@"URL"]; - [sessionCredentials setObject:(NSString *)kCFHTTPAuthenticationSchemeBasic forKey:@"AuthenticationScheme"]; - [[self class] storeAuthenticationCredentialsInSessionStore:sessionCredentials]; - } - } - - // Read response textEncoding - [self parseStringEncodingFromHeaders]; - - // Handle cookies - NSArray *newCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:[self responseHeaders] forURL:[self url]]; - [self setResponseCookies:newCookies]; - - if ([self useCookiePersistence]) { - - // Store cookies in global persistent store - [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:newCookies forURL:[self url] mainDocumentURL:nil]; - - // We also keep any cookies in the sessionCookies array, so that we have a reference to them if we need to remove them later - NSHTTPCookie *cookie; - for (cookie in newCookies) { - [ASIHTTPRequest addSessionCookie:cookie]; - } - } - - // Do we need to redirect? - if (![self willRedirect]) { - // See if we got a Content-length header - NSString *cLength = [responseHeaders valueForKey:@"Content-Length"]; - ASIHTTPRequest *theRequest = self; - if ([self mainRequest]) { - theRequest = [self mainRequest]; - } - - if (cLength) { - unsigned long long length = strtoull([cLength UTF8String], NULL, 0); - - // Workaround for Apache HEAD requests for dynamically generated content returning the wrong Content-Length when using gzip - if ([self mainRequest] && [self allowCompressedResponse] && length == 20 && [self showAccurateProgress] && [self shouldResetDownloadProgress]) { - [[self mainRequest] setShowAccurateProgress:NO]; - [[self mainRequest] incrementDownloadSizeBy:1]; - - } else { - [theRequest setContentLength:length]; - if ([self showAccurateProgress] && [self shouldResetDownloadProgress]) { - [theRequest incrementDownloadSizeBy:[theRequest contentLength]+[theRequest partialDownloadSize]]; - } - } - - } else if ([self showAccurateProgress] && [self shouldResetDownloadProgress]) { - [theRequest setShowAccurateProgress:NO]; - [theRequest incrementDownloadSizeBy:1]; - } - } - - // Handle connection persistence - if ([self shouldAttemptPersistentConnection]) { - - NSString *connectionHeader = [[[self responseHeaders] objectForKey:@"Connection"] lowercaseString]; - - NSString *httpVersion = [NSMakeCollectable(CFHTTPMessageCopyVersion(message)) autorelease]; - - // Don't re-use the connection if the server is HTTP 1.0 and didn't send Connection: Keep-Alive - if (![httpVersion isEqualToString:(NSString *)kCFHTTPVersion1_0] || [connectionHeader isEqualToString:@"keep-alive"]) { - - // See if server explicitly told us to close the connection - if (![connectionHeader isEqualToString:@"close"]) { - - NSString *keepAliveHeader = [[self responseHeaders] objectForKey:@"Keep-Alive"]; - - // If we got a keep alive header, we'll reuse the connection for as long as the server tells us - if (keepAliveHeader) { - int timeout = 0; - int max = 0; - NSScanner *scanner = [NSScanner scannerWithString:keepAliveHeader]; - [scanner scanString:@"timeout=" intoString:NULL]; - [scanner scanInt:&timeout]; - [scanner scanUpToString:@"max=" intoString:NULL]; - [scanner scanString:@"max=" intoString:NULL]; - [scanner scanInt:&max]; - if (max > 5) { - [self setConnectionCanBeReused:YES]; - [self setPersistentConnectionTimeoutSeconds:timeout]; - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Got a keep-alive header, will keep this connection open for %f seconds", [self persistentConnectionTimeoutSeconds]); - #endif - } - - // Otherwise, we'll assume we can keep this connection open - } else { - [self setConnectionCanBeReused:YES]; - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Got no keep-alive header, will keep this connection open for %f seconds", [self persistentConnectionTimeoutSeconds]); - #endif - } - } - } - } - - CFRelease(message); - [self performSelectorOnMainThread:@selector(requestReceivedResponseHeaders:) withObject:[[[self responseHeaders] copy] autorelease] waitUntilDone:[NSThread isMainThread]]; -} - -- (BOOL)willRedirect -{ - // Do we need to redirect? - if (![self shouldRedirect] || ![responseHeaders valueForKey:@"Location"]) { - return NO; - } - - // Note that ASIHTTPRequest does not currently support 305 Use Proxy - int responseCode = [self responseStatusCode]; - if (responseCode != 301 && responseCode != 302 && responseCode != 303 && responseCode != 307) { - return NO; - } - - [self performSelectorOnMainThread:@selector(requestRedirected) withObject:nil waitUntilDone:[NSThread isMainThread]]; - - // By default, we redirect 301 and 302 response codes as GET requests - // According to RFC 2616 this is wrong, but this is what most browsers do, so it's probably what you're expecting to happen - // See also: - // http://allseeing-i.lighthouseapp.com/projects/27881/tickets/27-302-redirection-issue - - if (responseCode != 307 && (![self shouldUseRFC2616RedirectBehaviour] || responseCode == 303)) { - [self setRequestMethod:@"GET"]; - [self setPostBody:nil]; - [self setPostLength:0]; - - // Perhaps there are other headers we should be preserving, but it's hard to know what we need to keep and what to throw away. - NSString *userAgentHeader = [[self requestHeaders] objectForKey:@"User-Agent"]; - NSString *acceptHeader = [[self requestHeaders] objectForKey:@"Accept"]; - [self setRequestHeaders:nil]; - if (userAgentHeader) { - [self addRequestHeader:@"User-Agent" value:userAgentHeader]; - } - if (acceptHeader) { - [self addRequestHeader:@"Accept" value:acceptHeader]; - } - [self setHaveBuiltRequestHeaders:NO]; - - } else { - // Force rebuild the cookie header incase we got some new cookies from this request - // All other request headers will remain as they are for 301 / 302 redirects - [self applyCookieHeader]; - } - - // Force the redirected request to rebuild the request headers (if not a 303, it will re-use old ones, and add any new ones) - [self setRedirectURL:[[NSURL URLWithString:[responseHeaders valueForKey:@"Location"] relativeToURL:[self url]] absoluteURL]]; - [self setNeedsRedirect:YES]; - - // Clear the request cookies - // This means manually added cookies will not be added to the redirect request - only those stored in the global persistent store - // But, this is probably the safest option - we might be redirecting to a different domain - [self setRequestCookies:[NSMutableArray array]]; - - #if DEBUG_REQUEST_STATUS - ASI_DEBUG_LOG(@"[STATUS] Request will redirect (code: %i): %@",responseCode,self); - #endif - - return YES; -} - -- (void)parseStringEncodingFromHeaders -{ - // Handle response text encoding - NSStringEncoding charset = 0; - NSString *mimeType = nil; - [[self class] parseMimeType:&mimeType andResponseEncoding:&charset fromContentType:[[self responseHeaders] valueForKey:@"Content-Type"]]; - if (charset != 0) { - [self setResponseEncoding:charset]; - } else { - [self setResponseEncoding:[self defaultResponseEncoding]]; - } -} - -#pragma mark http authentication - -- (void)saveProxyCredentialsToKeychain:(NSDictionary *)newCredentials -{ - NSURLCredential *authenticationCredentials = [NSURLCredential credentialWithUser:[newCredentials objectForKey:(NSString *)kCFHTTPAuthenticationUsername] password:[newCredentials objectForKey:(NSString *)kCFHTTPAuthenticationPassword] persistence:NSURLCredentialPersistencePermanent]; - if (authenticationCredentials) { - [ASIHTTPRequest saveCredentials:authenticationCredentials forProxy:[self proxyHost] port:[self proxyPort] realm:[self proxyAuthenticationRealm]]; - } -} - - -- (void)saveCredentialsToKeychain:(NSDictionary *)newCredentials -{ - NSURLCredential *authenticationCredentials = [NSURLCredential credentialWithUser:[newCredentials objectForKey:(NSString *)kCFHTTPAuthenticationUsername] password:[newCredentials objectForKey:(NSString *)kCFHTTPAuthenticationPassword] persistence:NSURLCredentialPersistencePermanent]; - - if (authenticationCredentials) { - [ASIHTTPRequest saveCredentials:authenticationCredentials forHost:[[self url] host] port:[[[self url] port] intValue] protocol:[[self url] scheme] realm:[self authenticationRealm]]; - } -} - -- (BOOL)applyProxyCredentials:(NSDictionary *)newCredentials -{ - [self setProxyAuthenticationRetryCount:[self proxyAuthenticationRetryCount]+1]; - - if (newCredentials && proxyAuthentication && request) { - - // Apply whatever credentials we've built up to the old request - if (CFHTTPMessageApplyCredentialDictionary(request, proxyAuthentication, (CFMutableDictionaryRef)newCredentials, NULL)) { - - //If we have credentials and they're ok, let's save them to the keychain - if (useKeychainPersistence) { - [self saveProxyCredentialsToKeychain:newCredentials]; - } - if (useSessionPersistence) { - NSMutableDictionary *sessionProxyCredentials = [NSMutableDictionary dictionary]; - [sessionProxyCredentials setObject:(id)proxyAuthentication forKey:@"Authentication"]; - [sessionProxyCredentials setObject:newCredentials forKey:@"Credentials"]; - [sessionProxyCredentials setObject:[self proxyHost] forKey:@"Host"]; - [sessionProxyCredentials setObject:[NSNumber numberWithInt:[self proxyPort]] forKey:@"Port"]; - [sessionProxyCredentials setObject:[self proxyAuthenticationScheme] forKey:@"AuthenticationScheme"]; - [[self class] storeProxyAuthenticationCredentialsInSessionStore:sessionProxyCredentials]; - } - [self setProxyCredentials:newCredentials]; - return YES; - } else { - [[self class] removeProxyAuthenticationCredentialsFromSessionStore:newCredentials]; - } - } - return NO; -} - -- (BOOL)applyCredentials:(NSDictionary *)newCredentials -{ - [self setAuthenticationRetryCount:[self authenticationRetryCount]+1]; - - if (newCredentials && requestAuthentication && request) { - // Apply whatever credentials we've built up to the old request - if (CFHTTPMessageApplyCredentialDictionary(request, requestAuthentication, (CFMutableDictionaryRef)newCredentials, NULL)) { - - //If we have credentials and they're ok, let's save them to the keychain - if (useKeychainPersistence) { - [self saveCredentialsToKeychain:newCredentials]; - } - if (useSessionPersistence) { - - NSMutableDictionary *sessionCredentials = [NSMutableDictionary dictionary]; - [sessionCredentials setObject:(id)requestAuthentication forKey:@"Authentication"]; - [sessionCredentials setObject:newCredentials forKey:@"Credentials"]; - [sessionCredentials setObject:[self url] forKey:@"URL"]; - [sessionCredentials setObject:[self authenticationScheme] forKey:@"AuthenticationScheme"]; - if ([self authenticationRealm]) { - [sessionCredentials setObject:[self authenticationRealm] forKey:@"AuthenticationRealm"]; - } - [[self class] storeAuthenticationCredentialsInSessionStore:sessionCredentials]; - - } - [self setRequestCredentials:newCredentials]; - return YES; - } else { - [[self class] removeAuthenticationCredentialsFromSessionStore:newCredentials]; - } - } - return NO; -} - -- (NSMutableDictionary *)findProxyCredentials -{ - NSMutableDictionary *newCredentials = [[[NSMutableDictionary alloc] init] autorelease]; - - NSString *user = nil; - NSString *pass = nil; - - ASIHTTPRequest *theRequest = [self mainRequest]; - // If this is a HEAD request generated by an ASINetworkQueue, we'll try to use the details from the main request - if ([theRequest proxyUsername] && [theRequest proxyPassword]) { - user = [theRequest proxyUsername]; - pass = [theRequest proxyPassword]; - - // Let's try to use the ones set in this object - } else if ([self proxyUsername] && [self proxyPassword]) { - user = [self proxyUsername]; - pass = [self proxyPassword]; - } - - // When we connect to a website using NTLM via a proxy, we will use the main credentials - if ((!user || !pass) && [self proxyAuthenticationScheme] == (NSString *)kCFHTTPAuthenticationSchemeNTLM) { - user = [self username]; - pass = [self password]; - } - - - - // Ok, that didn't work, let's try the keychain - // For authenticating proxies, we'll look in the keychain regardless of the value of useKeychainPersistence - if ((!user || !pass)) { - NSURLCredential *authenticationCredentials = [ASIHTTPRequest savedCredentialsForProxy:[self proxyHost] port:[self proxyPort] protocol:[[self url] scheme] realm:[self proxyAuthenticationRealm]]; - if (authenticationCredentials) { - user = [authenticationCredentials user]; - pass = [authenticationCredentials password]; - } - - } - - // Handle NTLM, which requires a domain to be set too - if (CFHTTPAuthenticationRequiresAccountDomain(proxyAuthentication)) { - - NSString *ntlmDomain = [self proxyDomain]; - - // If we have no domain yet - if (!ntlmDomain || [ntlmDomain length] == 0) { - - // Let's try to extract it from the username - NSArray* ntlmComponents = [user componentsSeparatedByString:@"\\"]; - if ([ntlmComponents count] == 2) { - ntlmDomain = [ntlmComponents objectAtIndex:0]; - user = [ntlmComponents objectAtIndex:1]; - - // If we are connecting to a website using NTLM, but we are connecting via a proxy, the string we need may be in the domain property - } else { - ntlmDomain = [self domain]; - } - if (!ntlmDomain) { - ntlmDomain = @""; - } - } - [newCredentials setObject:ntlmDomain forKey:(NSString *)kCFHTTPAuthenticationAccountDomain]; - } - - - // If we have a username and password, let's apply them to the request and continue - if (user && pass) { - [newCredentials setObject:user forKey:(NSString *)kCFHTTPAuthenticationUsername]; - [newCredentials setObject:pass forKey:(NSString *)kCFHTTPAuthenticationPassword]; - return newCredentials; - } - return nil; -} - - -- (NSMutableDictionary *)findCredentials -{ - NSMutableDictionary *newCredentials = [[[NSMutableDictionary alloc] init] autorelease]; - - // First, let's look at the url to see if the username and password were included - NSString *user = [[self url] user]; - NSString *pass = [[self url] password]; - - if (user && pass) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will use credentials set on its url",self); - #endif - - } else { - - // If this is a HEAD request generated by an ASINetworkQueue, we'll try to use the details from the main request - if ([self mainRequest] && [[self mainRequest] username] && [[self mainRequest] password]) { - user = [[self mainRequest] username]; - pass = [[self mainRequest] password]; - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will use credentials from its parent request",self); - #endif - - // Let's try to use the ones set in this object - } else if ([self username] && [self password]) { - user = [self username]; - pass = [self password]; - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will use username and password properties as credentials",self); - #endif - } - } - - // Ok, that didn't work, let's try the keychain - if ((!user || !pass) && useKeychainPersistence) { - NSURLCredential *authenticationCredentials = [ASIHTTPRequest savedCredentialsForHost:[[self url] host] port:[[[self url] port] intValue] protocol:[[self url] scheme] realm:[self authenticationRealm]]; - if (authenticationCredentials) { - user = [authenticationCredentials user]; - pass = [authenticationCredentials password]; - #if DEBUG_HTTP_AUTHENTICATION - if (user && pass) { - ASI_DEBUG_LOG(@"[AUTH] Request %@ will use credentials from the keychain",self); - } - #endif - } - } - - // Handle NTLM, which requires a domain to be set too - if (CFHTTPAuthenticationRequiresAccountDomain(requestAuthentication)) { - - NSString *ntlmDomain = [self domain]; - - // If we have no domain yet, let's try to extract it from the username - if (!ntlmDomain || [ntlmDomain length] == 0) { - ntlmDomain = @""; - NSArray* ntlmComponents = [user componentsSeparatedByString:@"\\"]; - if ([ntlmComponents count] == 2) { - ntlmDomain = [ntlmComponents objectAtIndex:0]; - user = [ntlmComponents objectAtIndex:1]; - } - } - [newCredentials setObject:ntlmDomain forKey:(NSString *)kCFHTTPAuthenticationAccountDomain]; - } - - // If we have a username and password, let's apply them to the request and continue - if (user && pass) { - [newCredentials setObject:user forKey:(NSString *)kCFHTTPAuthenticationUsername]; - [newCredentials setObject:pass forKey:(NSString *)kCFHTTPAuthenticationPassword]; - return newCredentials; - } - return nil; -} - -// Called by delegate or authentication dialog to resume loading once authentication info has been populated -- (void)retryUsingSuppliedCredentials -{ - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ received credentials from its delegate or an ASIAuthenticationDialog, will retry",self); - #endif - //If the url was changed by the delegate, our CFHTTPMessageRef will be NULL and we'll go back to the start - if (!request) { - [self performSelector:@selector(main) onThread:[[self class] threadForRequest:self] withObject:nil waitUntilDone:NO]; - return; - } - [self performSelector:@selector(attemptToApplyCredentialsAndResume) onThread:[[self class] threadForRequest:self] withObject:nil waitUntilDone:NO]; -} - -// Called by delegate or authentication dialog to cancel authentication -- (void)cancelAuthentication -{ - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ had authentication cancelled by its delegate or an ASIAuthenticationDialog",self); - #endif - [self performSelector:@selector(failAuthentication) onThread:[[self class] threadForRequest:self] withObject:nil waitUntilDone:NO]; -} - -- (void)failAuthentication -{ - [self failWithError:ASIAuthenticationError]; -} - -- (BOOL)showProxyAuthenticationDialog -{ - if ([self isSynchronous]) { - return NO; - } - - // Mac authentication dialog coming soon! - #if TARGET_OS_IPHONE - if ([self shouldPresentProxyAuthenticationDialog]) { - [ASIAuthenticationDialog performSelectorOnMainThread:@selector(presentAuthenticationDialogForRequest:) withObject:self waitUntilDone:[NSThread isMainThread]]; - return YES; - } - return NO; - #else - return NO; - #endif -} - - -- (BOOL)willAskDelegateForProxyCredentials -{ - if ([self isSynchronous]) { - return NO; - } - - // If we have a delegate, we'll see if it can handle proxyAuthenticationNeededForRequest:. - // Otherwise, we'll try the queue (if this request is part of one) and it will pass the message on to its own delegate - id authenticationDelegate = [self delegate]; - if (!authenticationDelegate) { - authenticationDelegate = [self queue]; - } - - BOOL delegateOrBlockWillHandleAuthentication = NO; - - if ([authenticationDelegate respondsToSelector:@selector(proxyAuthenticationNeededForRequest:)]) { - delegateOrBlockWillHandleAuthentication = YES; - } - - #if NS_BLOCKS_AVAILABLE - if(proxyAuthenticationNeededBlock){ - delegateOrBlockWillHandleAuthentication = YES; - } - #endif - - if (delegateOrBlockWillHandleAuthentication) { - [self performSelectorOnMainThread:@selector(askDelegateForProxyCredentials) withObject:nil waitUntilDone:NO]; - } - - return delegateOrBlockWillHandleAuthentication; -} - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)askDelegateForProxyCredentials -{ - id authenticationDelegate = [self delegate]; - if (!authenticationDelegate) { - authenticationDelegate = [self queue]; - } - if ([authenticationDelegate respondsToSelector:@selector(proxyAuthenticationNeededForRequest:)]) { - [authenticationDelegate performSelector:@selector(proxyAuthenticationNeededForRequest:) withObject:self]; - return; - } - #if NS_BLOCKS_AVAILABLE - if(proxyAuthenticationNeededBlock){ - proxyAuthenticationNeededBlock(); - } - #endif -} - - -- (BOOL)willAskDelegateForCredentials -{ - if ([self isSynchronous]) { - return NO; - } - - // If we have a delegate, we'll see if it can handle proxyAuthenticationNeededForRequest:. - // Otherwise, we'll try the queue (if this request is part of one) and it will pass the message on to its own delegate - id authenticationDelegate = [self delegate]; - if (!authenticationDelegate) { - authenticationDelegate = [self queue]; - } - - BOOL delegateOrBlockWillHandleAuthentication = NO; - - if ([authenticationDelegate respondsToSelector:@selector(authenticationNeededForRequest:)]) { - delegateOrBlockWillHandleAuthentication = YES; - } - - #if NS_BLOCKS_AVAILABLE - if (authenticationNeededBlock) { - delegateOrBlockWillHandleAuthentication = YES; - } - #endif - - if (delegateOrBlockWillHandleAuthentication) { - [self performSelectorOnMainThread:@selector(askDelegateForCredentials) withObject:nil waitUntilDone:NO]; - } - return delegateOrBlockWillHandleAuthentication; -} - -/* ALWAYS CALLED ON MAIN THREAD! */ -- (void)askDelegateForCredentials -{ - id authenticationDelegate = [self delegate]; - if (!authenticationDelegate) { - authenticationDelegate = [self queue]; - } - - if ([authenticationDelegate respondsToSelector:@selector(authenticationNeededForRequest:)]) { - [authenticationDelegate performSelector:@selector(authenticationNeededForRequest:) withObject:self]; - return; - } - - #if NS_BLOCKS_AVAILABLE - if (authenticationNeededBlock) { - authenticationNeededBlock(); - } - #endif -} - -- (void)attemptToApplyProxyCredentialsAndResume -{ - - if ([self error] || [self isCancelled]) { - return; - } - - // Read authentication data - if (!proxyAuthentication) { - CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty((CFReadStreamRef)[self readStream],kCFStreamPropertyHTTPResponseHeader); - proxyAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader); - CFRelease(responseHeader); - [self setProxyAuthenticationScheme:[NSMakeCollectable(CFHTTPAuthenticationCopyMethod(proxyAuthentication)) autorelease]]; - } - - // If we haven't got a CFHTTPAuthenticationRef by now, something is badly wrong, so we'll have to give up - if (!proxyAuthentication) { - [self cancelLoad]; - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileApplyingCredentialsType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Failed to get authentication object from response headers",NSLocalizedDescriptionKey,nil]]]; - return; - } - - // Get the authentication realm - [self setProxyAuthenticationRealm:nil]; - if (!CFHTTPAuthenticationRequiresAccountDomain(proxyAuthentication)) { - [self setProxyAuthenticationRealm:[NSMakeCollectable(CFHTTPAuthenticationCopyRealm(proxyAuthentication)) autorelease]]; - } - - // See if authentication is valid - CFStreamError err; - if (!CFHTTPAuthenticationIsValid(proxyAuthentication, &err)) { - - CFRelease(proxyAuthentication); - proxyAuthentication = NULL; - - // check for bad credentials, so we can give the delegate a chance to replace them - if (err.domain == kCFStreamErrorDomainHTTP && (err.error == kCFStreamErrorHTTPAuthenticationBadUserName || err.error == kCFStreamErrorHTTPAuthenticationBadPassword)) { - - // Prevent more than one request from asking for credentials at once - [delegateAuthenticationLock lock]; - - // We know the credentials we just presented are bad, we should remove them from the session store too - [[self class] removeProxyAuthenticationCredentialsFromSessionStore:proxyCredentials]; - [self setProxyCredentials:nil]; - - - // If the user cancelled authentication via a dialog presented by another request, our queue may have cancelled us - if ([self error] || [self isCancelled]) { - [delegateAuthenticationLock unlock]; - return; - } - - - // Now we've acquired the lock, it may be that the session contains credentials we can re-use for this request - if ([self useSessionPersistence]) { - NSDictionary *credentials = [self findSessionProxyAuthenticationCredentials]; - if (credentials && [self applyProxyCredentials:[credentials objectForKey:@"Credentials"]]) { - [delegateAuthenticationLock unlock]; - [self startRequest]; - return; - } - } - - [self setLastActivityTime:nil]; - - if ([self willAskDelegateForProxyCredentials]) { - [self attemptToApplyProxyCredentialsAndResume]; - [delegateAuthenticationLock unlock]; - return; - } - if ([self showProxyAuthenticationDialog]) { - [self attemptToApplyProxyCredentialsAndResume]; - [delegateAuthenticationLock unlock]; - return; - } - [delegateAuthenticationLock unlock]; - } - [self cancelLoad]; - [self failWithError:ASIAuthenticationError]; - return; - } - - [self cancelLoad]; - - if (proxyCredentials) { - - // We use startRequest rather than starting all over again in load request because NTLM requires we reuse the request - if ((([self proxyAuthenticationScheme] != (NSString *)kCFHTTPAuthenticationSchemeNTLM) || [self proxyAuthenticationRetryCount] < 2) && [self applyProxyCredentials:proxyCredentials]) { - [self startRequest]; - - // We've failed NTLM authentication twice, we should assume our credentials are wrong - } else if ([self proxyAuthenticationScheme] == (NSString *)kCFHTTPAuthenticationSchemeNTLM && [self proxyAuthenticationRetryCount] == 2) { - [self failWithError:ASIAuthenticationError]; - - // Something went wrong, we'll have to give up - } else { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileApplyingCredentialsType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Failed to apply proxy credentials to request",NSLocalizedDescriptionKey,nil]]]; - } - - // Are a user name & password needed? - } else if (CFHTTPAuthenticationRequiresUserNameAndPassword(proxyAuthentication)) { - - // Prevent more than one request from asking for credentials at once - [delegateAuthenticationLock lock]; - - // If the user cancelled authentication via a dialog presented by another request, our queue may have cancelled us - if ([self error] || [self isCancelled]) { - [delegateAuthenticationLock unlock]; - return; - } - - // Now we've acquired the lock, it may be that the session contains credentials we can re-use for this request - if ([self useSessionPersistence]) { - NSDictionary *credentials = [self findSessionProxyAuthenticationCredentials]; - if (credentials && [self applyProxyCredentials:[credentials objectForKey:@"Credentials"]]) { - [delegateAuthenticationLock unlock]; - [self startRequest]; - return; - } - } - - NSMutableDictionary *newCredentials = [self findProxyCredentials]; - - //If we have some credentials to use let's apply them to the request and continue - if (newCredentials) { - - if ([self applyProxyCredentials:newCredentials]) { - [delegateAuthenticationLock unlock]; - [self startRequest]; - } else { - [delegateAuthenticationLock unlock]; - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileApplyingCredentialsType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Failed to apply proxy credentials to request",NSLocalizedDescriptionKey,nil]]]; - } - - return; - } - - if ([self willAskDelegateForProxyCredentials]) { - [delegateAuthenticationLock unlock]; - return; - } - - if ([self showProxyAuthenticationDialog]) { - [delegateAuthenticationLock unlock]; - return; - } - [delegateAuthenticationLock unlock]; - - // The delegate isn't interested and we aren't showing the authentication dialog, we'll have to give up - [self failWithError:ASIAuthenticationError]; - return; - } - -} - -- (BOOL)showAuthenticationDialog -{ - if ([self isSynchronous]) { - return NO; - } - // Mac authentication dialog coming soon! - #if TARGET_OS_IPHONE - if ([self shouldPresentAuthenticationDialog]) { - [ASIAuthenticationDialog performSelectorOnMainThread:@selector(presentAuthenticationDialogForRequest:) withObject:self waitUntilDone:[NSThread isMainThread]]; - return YES; - } - return NO; - #else - return NO; - #endif -} - -- (void)attemptToApplyCredentialsAndResume -{ - if ([self error] || [self isCancelled]) { - return; - } - - // Do we actually need to authenticate with a proxy? - if ([self authenticationNeeded] == ASIProxyAuthenticationNeeded) { - [self attemptToApplyProxyCredentialsAndResume]; - return; - } - - // Read authentication data - if (!requestAuthentication) { - CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty((CFReadStreamRef)[self readStream],kCFStreamPropertyHTTPResponseHeader); - requestAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader); - CFRelease(responseHeader); - [self setAuthenticationScheme:[NSMakeCollectable(CFHTTPAuthenticationCopyMethod(requestAuthentication)) autorelease]]; - } - - if (!requestAuthentication) { - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ failed to read authentication information from response headers",self); - #endif - - [self cancelLoad]; - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileApplyingCredentialsType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Failed to get authentication object from response headers",NSLocalizedDescriptionKey,nil]]]; - return; - } - - // Get the authentication realm - [self setAuthenticationRealm:nil]; - if (!CFHTTPAuthenticationRequiresAccountDomain(requestAuthentication)) { - [self setAuthenticationRealm:[NSMakeCollectable(CFHTTPAuthenticationCopyRealm(requestAuthentication)) autorelease]]; - } - - #if DEBUG_HTTP_AUTHENTICATION - NSString *realm = [self authenticationRealm]; - if (realm) { - realm = [NSString stringWithFormat:@" (Realm: %@)",realm]; - } else { - realm = @""; - } - if ([self authenticationScheme] != (NSString *)kCFHTTPAuthenticationSchemeNTLM || [self authenticationRetryCount] == 0) { - ASI_DEBUG_LOG(@"[AUTH] Request %@ received 401 challenge and must authenticate using %@%@",self,[self authenticationScheme],realm); - } else { - ASI_DEBUG_LOG(@"[AUTH] Request %@ NTLM handshake step %i",self,[self authenticationRetryCount]+1); - } - #endif - - // See if authentication is valid - CFStreamError err; - if (!CFHTTPAuthenticationIsValid(requestAuthentication, &err)) { - - CFRelease(requestAuthentication); - requestAuthentication = NULL; - - // check for bad credentials, so we can give the delegate a chance to replace them - if (err.domain == kCFStreamErrorDomainHTTP && (err.error == kCFStreamErrorHTTPAuthenticationBadUserName || err.error == kCFStreamErrorHTTPAuthenticationBadPassword)) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ had bad credentials, will remove them from the session store if they are cached",self); - #endif - - // Prevent more than one request from asking for credentials at once - [delegateAuthenticationLock lock]; - - // We know the credentials we just presented are bad, we should remove them from the session store too - [[self class] removeAuthenticationCredentialsFromSessionStore:requestCredentials]; - [self setRequestCredentials:nil]; - - // If the user cancelled authentication via a dialog presented by another request, our queue may have cancelled us - if ([self error] || [self isCancelled]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ failed or was cancelled while waiting to access credentials",self); - #endif - - [delegateAuthenticationLock unlock]; - return; - } - - // Now we've acquired the lock, it may be that the session contains credentials we can re-use for this request - if ([self useSessionPersistence]) { - NSDictionary *credentials = [self findSessionAuthenticationCredentials]; - if (credentials && [self applyCredentials:[credentials objectForKey:@"Credentials"]]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will reuse cached credentials from the session (%@)",self,[credentials objectForKey:@"AuthenticationScheme"]); - #endif - - [delegateAuthenticationLock unlock]; - [self startRequest]; - return; - } - } - - [self setLastActivityTime:nil]; - - if ([self willAskDelegateForCredentials]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will ask its delegate for credentials to use",self); - #endif - - [delegateAuthenticationLock unlock]; - return; - } - if ([self showAuthenticationDialog]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will ask ASIAuthenticationDialog for credentials",self); - #endif - - [delegateAuthenticationLock unlock]; - return; - } - [delegateAuthenticationLock unlock]; - } - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ has no credentials to present and must give up",self); - #endif - - [self cancelLoad]; - [self failWithError:ASIAuthenticationError]; - return; - } - - [self cancelLoad]; - - if (requestCredentials) { - - if ((([self authenticationScheme] != (NSString *)kCFHTTPAuthenticationSchemeNTLM) || [self authenticationRetryCount] < 2) && [self applyCredentials:requestCredentials]) { - [self startRequest]; - - // We've failed NTLM authentication twice, we should assume our credentials are wrong - } else if ([self authenticationScheme] == (NSString *)kCFHTTPAuthenticationSchemeNTLM && [self authenticationRetryCount ] == 2) { - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ has failed NTLM authentication",self); - #endif - - [self failWithError:ASIAuthenticationError]; - - } else { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ had credentials and they were not marked as bad, but we got a 401 all the same.",self); - #endif - - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileApplyingCredentialsType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Failed to apply credentials to request",NSLocalizedDescriptionKey,nil]]]; - } - - // Are a user name & password needed? - } else if (CFHTTPAuthenticationRequiresUserNameAndPassword(requestAuthentication)) { - - // Prevent more than one request from asking for credentials at once - [delegateAuthenticationLock lock]; - - // If the user cancelled authentication via a dialog presented by another request, our queue may have cancelled us - if ([self error] || [self isCancelled]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ failed or was cancelled while waiting to access credentials",self); - #endif - - [delegateAuthenticationLock unlock]; - return; - } - - // Now we've acquired the lock, it may be that the session contains credentials we can re-use for this request - if ([self useSessionPersistence]) { - NSDictionary *credentials = [self findSessionAuthenticationCredentials]; - if (credentials && [self applyCredentials:[credentials objectForKey:@"Credentials"]]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will reuse cached credentials from the session (%@)",self,[credentials objectForKey:@"AuthenticationScheme"]); - #endif - - [delegateAuthenticationLock unlock]; - [self startRequest]; - return; - } - } - - - NSMutableDictionary *newCredentials = [self findCredentials]; - - //If we have some credentials to use let's apply them to the request and continue - if (newCredentials) { - - if ([self applyCredentials:newCredentials]) { - [delegateAuthenticationLock unlock]; - [self startRequest]; - } else { - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ failed to apply credentials",self); - #endif - [delegateAuthenticationLock unlock]; - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileApplyingCredentialsType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Failed to apply credentials to request",NSLocalizedDescriptionKey,nil]]]; - } - return; - } - if ([self willAskDelegateForCredentials]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will ask its delegate for credentials to use",self); - #endif - - [delegateAuthenticationLock unlock]; - return; - } - if ([self showAuthenticationDialog]) { - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ will ask ASIAuthenticationDialog for credentials",self); - #endif - - [delegateAuthenticationLock unlock]; - return; - } - - #if DEBUG_HTTP_AUTHENTICATION - ASI_DEBUG_LOG(@"[AUTH] Request %@ has no credentials to present and must give up",self); - #endif - [delegateAuthenticationLock unlock]; - [self failWithError:ASIAuthenticationError]; - return; - } - -} - -- (void)addBasicAuthenticationHeaderWithUsername:(NSString *)theUsername andPassword:(NSString *)thePassword -{ - [self addRequestHeader:@"Authorization" value:[NSString stringWithFormat:@"Basic %@",[ASIHTTPRequest base64forData:[[NSString stringWithFormat:@"%@:%@",theUsername,thePassword] dataUsingEncoding:NSUTF8StringEncoding]]]]; - [self setAuthenticationScheme:(NSString *)kCFHTTPAuthenticationSchemeBasic]; - -} - - -#pragma mark stream status handlers - -- (void)handleNetworkEvent:(CFStreamEventType)type -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [[self cancelledLock] lock]; - - if ([self complete] || [self isCancelled]) { - [[self cancelledLock] unlock]; - [pool drain]; - return; - } - - CFRetain(self); - - // Dispatch the stream events. - switch (type) { - case kCFStreamEventHasBytesAvailable: - [self handleBytesAvailable]; - break; - - case kCFStreamEventEndEncountered: - [self handleStreamComplete]; - break; - - case kCFStreamEventErrorOccurred: - [self handleStreamError]; - break; - - default: - break; - } - - [self performThrottling]; - - [[self cancelledLock] unlock]; - - if ([self downloadComplete] && [self needsRedirect]) { - if (![self willAskDelegateToConfirmRedirect]) { - [self performRedirect]; - } - } else if ([self downloadComplete] && [self authenticationNeeded]) { - [self attemptToApplyCredentialsAndResume]; - } - - CFRelease(self); - [pool drain]; -} - -- (BOOL)willAskDelegateToConfirmRedirect -{ - // We must lock to ensure delegate / queue aren't changed while we check them - [[self cancelledLock] lock]; - - // Here we perform an initial check to see if either the delegate or the queue wants to be asked about the redirect, because if not we should redirect straight away - // We will check again on the main thread later - BOOL needToAskDelegateAboutRedirect = (([self delegate] && [[self delegate] respondsToSelector:[self willRedirectSelector]]) || ([self queue] && [[self queue] respondsToSelector:@selector(request:willRedirectToURL:)])); - - [[self cancelledLock] unlock]; - - // Either the delegate or the queue's delegate is interested in being told when we are about to redirect - if (needToAskDelegateAboutRedirect) { - NSURL *newURL = [[[self redirectURL] copy] autorelease]; - [self setRedirectURL:nil]; - [self performSelectorOnMainThread:@selector(requestWillRedirectToURL:) withObject:newURL waitUntilDone:[NSThread isMainThread]]; - return true; - } - return false; -} - -- (void)handleBytesAvailable -{ - if (![self responseHeaders]) { - [self readResponseHeaders]; - } - - // If we've cancelled the load part way through (for example, after deciding to use a cached version) - if ([self complete]) { - return; - } - - // In certain (presumably very rare) circumstances, handleBytesAvailable seems to be called when there isn't actually any data available - // We'll check that there is actually data available to prevent blocking on CFReadStreamRead() - // So far, I've only seen this in the stress tests, so it might never happen in real-world situations. - if (!CFReadStreamHasBytesAvailable((CFReadStreamRef)[self readStream])) { - return; - } - - long long bufferSize = 16384; - if (contentLength > 262144) { - bufferSize = 262144; - } else if (contentLength > 65536) { - bufferSize = 65536; - } - - // Reduce the buffer size if we're receiving data too quickly when bandwidth throttling is active - // This just augments the throttling done in measureBandwidthUsage to reduce the amount we go over the limit - - if ([[self class] isBandwidthThrottled]) { - [bandwidthThrottlingLock lock]; - if (maxBandwidthPerSecond > 0) { - long long maxiumumSize = (long long)maxBandwidthPerSecond-(long long)bandwidthUsedInLastSecond; - if (maxiumumSize < 0) { - // We aren't supposed to read any more data right now, but we'll read a single byte anyway so the CFNetwork's buffer isn't full - bufferSize = 1; - } else if (maxiumumSize/4 < bufferSize) { - // We were going to fetch more data that we should be allowed, so we'll reduce the size of our read - bufferSize = maxiumumSize/4; - } - } - if (bufferSize < 1) { - bufferSize = 1; - } - [bandwidthThrottlingLock unlock]; - } - - - UInt8 buffer[bufferSize]; - NSInteger bytesRead = [[self readStream] read:buffer maxLength:sizeof(buffer)]; - - // Less than zero is an error - if (bytesRead < 0) { - [self handleStreamError]; - - // If zero bytes were read, wait for the EOF to come. - } else if (bytesRead) { - - // If we are inflating the response on the fly - NSData *inflatedData = nil; - if ([self isResponseCompressed] && ![self shouldWaitToInflateCompressedResponses]) { - if (![self dataDecompressor]) { - [self setDataDecompressor:[ASIDataDecompressor decompressor]]; - } - NSError *err = nil; - inflatedData = [[self dataDecompressor] uncompressBytes:buffer length:bytesRead error:&err]; - if (err) { - [self failWithError:err]; - return; - } - } - - [self setTotalBytesRead:[self totalBytesRead]+bytesRead]; - [self setLastActivityTime:[NSDate date]]; - - // For bandwidth measurement / throttling - [ASIHTTPRequest incrementBandwidthUsedInLastSecond:bytesRead]; - - // If we need to redirect, and have automatic redirect on, and might be resuming a download, let's do nothing with the content - if ([self needsRedirect] && [self shouldRedirect] && [self allowResumeForFileDownloads]) { - return; - } - - BOOL dataWillBeHandledExternally = NO; - if ([[self delegate] respondsToSelector:[self didReceiveDataSelector]]) { - dataWillBeHandledExternally = YES; - } - #if NS_BLOCKS_AVAILABLE - if (dataReceivedBlock) { - dataWillBeHandledExternally = YES; - } - #endif - // Does the delegate want to handle the data manually? - if (dataWillBeHandledExternally) { - - NSData *data = nil; - if ([self isResponseCompressed] && ![self shouldWaitToInflateCompressedResponses]) { - data = inflatedData; - } else { - data = [NSData dataWithBytes:buffer length:bytesRead]; - } - [self performSelectorOnMainThread:@selector(passOnReceivedData:) withObject:data waitUntilDone:[NSThread isMainThread]]; - - // Are we downloading to a file? - } else if ([self downloadDestinationPath]) { - BOOL append = NO; - if (![self fileDownloadOutputStream]) { - if (![self temporaryFileDownloadPath]) { - [self setTemporaryFileDownloadPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]]; - } else if ([self allowResumeForFileDownloads] && [[self requestHeaders] objectForKey:@"Range"]) { - if ([[self responseHeaders] objectForKey:@"Content-Range"]) { - append = YES; - } else { - [self incrementDownloadSizeBy:-[self partialDownloadSize]]; - [self setPartialDownloadSize:0]; - } - } - - [self setFileDownloadOutputStream:[[[NSOutputStream alloc] initToFileAtPath:[self temporaryFileDownloadPath] append:append] autorelease]]; - [[self fileDownloadOutputStream] open]; - - } - [[self fileDownloadOutputStream] write:buffer maxLength:bytesRead]; - - if ([self isResponseCompressed] && ![self shouldWaitToInflateCompressedResponses]) { - - if (![self inflatedFileDownloadOutputStream]) { - if (![self temporaryUncompressedDataDownloadPath]) { - [self setTemporaryUncompressedDataDownloadPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]]; - } - - [self setInflatedFileDownloadOutputStream:[[[NSOutputStream alloc] initToFileAtPath:[self temporaryUncompressedDataDownloadPath] append:append] autorelease]]; - [[self inflatedFileDownloadOutputStream] open]; - } - - [[self inflatedFileDownloadOutputStream] write:[inflatedData bytes] maxLength:[inflatedData length]]; - } - - - //Otherwise, let's add the data to our in-memory store - } else { - if ([self isResponseCompressed] && ![self shouldWaitToInflateCompressedResponses]) { - [rawResponseData appendData:inflatedData]; - } else { - [rawResponseData appendBytes:buffer length:bytesRead]; - } - } - } -} - -- (void)handleStreamComplete -{ - -#if DEBUG_REQUEST_STATUS - ASI_DEBUG_LOG(@"[STATUS] Request %@ finished downloading data (%qu bytes)",self, [self totalBytesRead]); -#endif - [self setStatusTimer:nil]; - [self setDownloadComplete:YES]; - - if (![self responseHeaders]) { - [self readResponseHeaders]; - } - - [progressLock lock]; - // Find out how much data we've uploaded so far - [self setLastBytesSent:totalBytesSent]; - [self setTotalBytesSent:[[NSMakeCollectable(CFReadStreamCopyProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPRequestBytesWrittenCount)) autorelease] unsignedLongLongValue]]; - [self setComplete:YES]; - if (![self contentLength]) { - [self setContentLength:[self totalBytesRead]]; - } - [self updateProgressIndicators]; - - - [[self postBodyReadStream] close]; - [self setPostBodyReadStream:nil]; - - [self setDataDecompressor:nil]; - - NSError *fileError = nil; - - // Delete up the request body temporary file, if it exists - if ([self didCreateTemporaryPostDataFile] && ![self authenticationNeeded]) { - [self removeTemporaryUploadFile]; - [self removeTemporaryCompressedUploadFile]; - } - - // Close the output stream as we're done writing to the file - if ([self temporaryFileDownloadPath]) { - - [[self fileDownloadOutputStream] close]; - [self setFileDownloadOutputStream:nil]; - - [[self inflatedFileDownloadOutputStream] close]; - [self setInflatedFileDownloadOutputStream:nil]; - - // If we are going to redirect and we are resuming, let's ignore this download - if ([self shouldRedirect] && [self needsRedirect] && [self allowResumeForFileDownloads]) { - - } else if ([self isResponseCompressed]) { - - // Decompress the file directly to the destination path - if ([self shouldWaitToInflateCompressedResponses]) { - [ASIDataDecompressor uncompressDataFromFile:[self temporaryFileDownloadPath] toFile:[self downloadDestinationPath] error:&fileError]; - - // Response should already have been inflated, move the temporary file to the destination path - } else { - NSError *moveError = nil; - [[[[NSFileManager alloc] init] autorelease] moveItemAtPath:[self temporaryUncompressedDataDownloadPath] toPath:[self downloadDestinationPath] error:&moveError]; - if (moveError) { - fileError = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASIFileManagementError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Failed to move file from '%@' to '%@'",[self temporaryFileDownloadPath],[self downloadDestinationPath]],NSLocalizedDescriptionKey,moveError,NSUnderlyingErrorKey,nil]]; - } - [self setTemporaryUncompressedDataDownloadPath:nil]; - - } - [self removeTemporaryDownloadFile]; - - } else { - - //Remove any file at the destination path - NSError *moveError = nil; - if (![[self class] removeFileAtPath:[self downloadDestinationPath] error:&moveError]) { - fileError = moveError; - - } - - //Move the temporary file to the destination path - if (!fileError) { - [[[[NSFileManager alloc] init] autorelease] moveItemAtPath:[self temporaryFileDownloadPath] toPath:[self downloadDestinationPath] error:&moveError]; - if (moveError) { - fileError = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASIFileManagementError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Failed to move file from '%@' to '%@'",[self temporaryFileDownloadPath],[self downloadDestinationPath]],NSLocalizedDescriptionKey,moveError,NSUnderlyingErrorKey,nil]]; - } - [self setTemporaryFileDownloadPath:nil]; - } - - } - } - - // Save to the cache - if ([self downloadCache] && ![self didUseCachedResponse]) { - [[self downloadCache] storeResponseForRequest:self maxAge:[self secondsToCache]]; - } - - [progressLock unlock]; - - - [connectionsLock lock]; - if (![self connectionCanBeReused]) { - [self unscheduleReadStream]; - } - #if DEBUG_PERSISTENT_CONNECTIONS - if ([self requestID]) { - ASI_DEBUG_LOG(@"[CONNECTION] Request #%@ finished using connection #%@",[self requestID], [[self connectionInfo] objectForKey:@"id"]); - } - #endif - [[self connectionInfo] removeObjectForKey:@"request"]; - [[self connectionInfo] setObject:[NSDate dateWithTimeIntervalSinceNow:[self persistentConnectionTimeoutSeconds]] forKey:@"expires"]; - [connectionsLock unlock]; - - if (![self authenticationNeeded]) { - [self destroyReadStream]; - } - - - if (![self needsRedirect] && ![self authenticationNeeded] && ![self didUseCachedResponse]) { - - if (fileError) { - [self failWithError:fileError]; - } else { - [self requestFinished]; - } - - [self markAsFinished]; - - // If request has asked delegate or ASIAuthenticationDialog for credentials - } else if ([self authenticationNeeded]) { - // Do nothing. - } - -} - -- (void)markAsFinished -{ - // Autoreleased requests may well be dealloced here otherwise - CFRetain(self); - - // dealloc won't be called when running with GC, so we'll clean these up now - if (request) { - CFRelease(request); - request = nil; - } - if (requestAuthentication) { - CFRelease(requestAuthentication); - requestAuthentication = nil; - } - if (proxyAuthentication) { - CFRelease(proxyAuthentication); - proxyAuthentication = nil; - } - - BOOL wasInProgress = inProgress; - BOOL wasFinished = finished; - - if (!wasFinished) - [self willChangeValueForKey:@"isFinished"]; - if (wasInProgress) - [self willChangeValueForKey:@"isExecuting"]; - - [self setInProgress:NO]; - finished = YES; - - if (wasInProgress) - [self didChangeValueForKey:@"isExecuting"]; - if (!wasFinished) - [self didChangeValueForKey:@"isFinished"]; - - #if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 - if ([ASIHTTPRequest isMultitaskingSupported] && [self shouldContinueWhenAppEntersBackground]) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (backgroundTask != UIBackgroundTaskInvalid) { - [[UIApplication sharedApplication] endBackgroundTask:backgroundTask]; - backgroundTask = UIBackgroundTaskInvalid; - } - }); - } - #endif - CFRelease(self); -} - -- (void)useDataFromCache -{ - NSDictionary *headers = [[self downloadCache] cachedResponseHeadersForURL:[self url]]; - NSString *dataPath = [[self downloadCache] pathToCachedResponseDataForURL:[self url]]; - - ASIHTTPRequest *theRequest = self; - if ([self mainRequest]) { - theRequest = [self mainRequest]; - } - - if (headers && dataPath) { - - [self setResponseStatusCode:[[headers objectForKey:@"X-ASIHTTPRequest-Response-Status-Code"] intValue]]; - [self setDidUseCachedResponse:YES]; - [theRequest setResponseHeaders:headers]; - - if ([theRequest downloadDestinationPath]) { - [theRequest setDownloadDestinationPath:dataPath]; - } else { - [theRequest setRawResponseData:[NSMutableData dataWithData:[[self downloadCache] cachedResponseDataForURL:[self url]]]]; - } - [theRequest setContentLength:[[[self responseHeaders] objectForKey:@"Content-Length"] longLongValue]]; - [theRequest setTotalBytesRead:[self contentLength]]; - - [theRequest parseStringEncodingFromHeaders]; - - [theRequest setResponseCookies:[NSHTTPCookie cookiesWithResponseHeaderFields:headers forURL:[self url]]]; - - // See if we need to redirect - if ([self willRedirect]) { - if (![self willAskDelegateToConfirmRedirect]) { - [self performRedirect]; - } - return; - } - } - - [theRequest setComplete:YES]; - [theRequest setDownloadComplete:YES]; - - // If we're pulling data from the cache without contacting the server at all, we won't have set originalURL yet - if ([self redirectCount] == 0) { - [theRequest setOriginalURL:[theRequest url]]; - } - - [theRequest updateProgressIndicators]; - [theRequest requestFinished]; - [theRequest markAsFinished]; - if ([self mainRequest]) { - [self markAsFinished]; - } -} - -- (BOOL)retryUsingNewConnection -{ - if ([self retryCount] == 0) { - - [self setWillRetryRequest:YES]; - [self cancelLoad]; - [self setWillRetryRequest:NO]; - - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Request attempted to use connection #%@, but it has been closed - will retry with a new connection", [[self connectionInfo] objectForKey:@"id"]); - #endif - [connectionsLock lock]; - [[self connectionInfo] removeObjectForKey:@"request"]; - [persistentConnectionsPool removeObject:[self connectionInfo]]; - [self setConnectionInfo:nil]; - [connectionsLock unlock]; - [self setRetryCount:[self retryCount]+1]; - [self startRequest]; - return YES; - } - #if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Request attempted to use connection #%@, but it has been closed - we have already retried with a new connection, so we must give up", [[self connectionInfo] objectForKey:@"id"]); - #endif - return NO; -} - -- (void)handleStreamError - -{ - NSError *underlyingError = [NSMakeCollectable(CFReadStreamCopyError((CFReadStreamRef)[self readStream])) autorelease]; - - if (![self error]) { // We may already have handled this error - - // First, check for a 'socket not connected', 'broken pipe' or 'connection lost' error - // This may occur when we've attempted to reuse a connection that should have been closed - // If we get this, we need to retry the request - // We'll only do this once - if it happens again on retry, we'll give up - // -1005 = kCFURLErrorNetworkConnectionLost - this doesn't seem to be declared on Mac OS 10.5 - if (([[underlyingError domain] isEqualToString:NSPOSIXErrorDomain] && ([underlyingError code] == ENOTCONN || [underlyingError code] == EPIPE)) - || ([[underlyingError domain] isEqualToString:(NSString *)kCFErrorDomainCFNetwork] && [underlyingError code] == -1005)) { - if ([self retryUsingNewConnection]) { - return; - } - } - - NSString *reason = @"A connection failure occurred"; - - // We'll use a custom error message for SSL errors, but you should always check underlying error if you want more details - // For some reason SecureTransport.h doesn't seem to be available on iphone, so error codes hard-coded - // Also, iPhone seems to handle errors differently from Mac OS X - a self-signed certificate returns a different error code on each platform, so we'll just provide a general error - if ([[underlyingError domain] isEqualToString:NSOSStatusErrorDomain]) { - if ([underlyingError code] <= -9800 && [underlyingError code] >= -9818) { - reason = [NSString stringWithFormat:@"%@: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)",reason]; - } - } - [self cancelLoad]; - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIConnectionFailureErrorType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:reason,NSLocalizedDescriptionKey,underlyingError,NSUnderlyingErrorKey,nil]]]; - } else { - [self cancelLoad]; - } - [self checkRequestStatus]; -} - -#pragma mark managing the read stream - -- (void)destroyReadStream -{ - if ([self readStream]) { - [self unscheduleReadStream]; - if (![self connectionCanBeReused]) { - [[self readStream] removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:[self runLoopMode]]; - [[self readStream] close]; - } - [self setReadStream:nil]; - } -} - -- (void)scheduleReadStream -{ - if ([self readStream] && ![self readStreamIsScheduled]) { - - [connectionsLock lock]; - runningRequestCount++; - if (shouldUpdateNetworkActivityIndicator) { - [[self class] showNetworkActivityIndicator]; - } - [connectionsLock unlock]; - - // Reset the timeout - [self setLastActivityTime:[NSDate date]]; - CFStreamClientContext ctxt = {0, self, NULL, NULL, NULL}; - CFReadStreamSetClient((CFReadStreamRef)[self readStream], kNetworkEvents, ReadStreamClientCallBack, &ctxt); - [[self readStream] scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:[self runLoopMode]]; - [self setReadStreamIsScheduled:YES]; - } -} - - -- (void)unscheduleReadStream -{ - if ([self readStream] && [self readStreamIsScheduled]) { - - [connectionsLock lock]; - runningRequestCount--; - if (shouldUpdateNetworkActivityIndicator && runningRequestCount == 0) { - // This call will wait half a second before turning off the indicator - // This can prevent flicker when you have a single request finish and then immediately start another request - // We run this on the main thread because we have no guarantee this thread will have a runloop in 0.5 seconds time - // We don't bother the cancel this call if we start a new request, because we'll check if requests are running before we hide it - [[self class] performSelectorOnMainThread:@selector(hideNetworkActivityIndicatorAfterDelay) withObject:nil waitUntilDone:[NSThread isMainThread]]; - } - [connectionsLock unlock]; - - CFReadStreamSetClient((CFReadStreamRef)[self readStream], kCFStreamEventNone, NULL, NULL); - [[self readStream] removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:[self runLoopMode]]; - [self setReadStreamIsScheduled:NO]; - } -} - -#pragma mark cleanup - -- (BOOL)removeTemporaryDownloadFile -{ - NSError *err = nil; - if ([self temporaryFileDownloadPath]) { - if (![[self class] removeFileAtPath:[self temporaryFileDownloadPath] error:&err]) { - [self failWithError:err]; - } - [self setTemporaryFileDownloadPath:nil]; - } - return (!err); -} - -- (BOOL)removeTemporaryUncompressedDownloadFile -{ - NSError *err = nil; - if ([self temporaryUncompressedDataDownloadPath]) { - if (![[self class] removeFileAtPath:[self temporaryUncompressedDataDownloadPath] error:&err]) { - [self failWithError:err]; - } - [self setTemporaryUncompressedDataDownloadPath:nil]; - } - return (!err); -} - -- (BOOL)removeTemporaryUploadFile -{ - NSError *err = nil; - if ([self postBodyFilePath]) { - if (![[self class] removeFileAtPath:[self postBodyFilePath] error:&err]) { - [self failWithError:err]; - } - [self setPostBodyFilePath:nil]; - } - return (!err); -} - -- (BOOL)removeTemporaryCompressedUploadFile -{ - NSError *err = nil; - if ([self compressedPostBodyFilePath]) { - if (![[self class] removeFileAtPath:[self compressedPostBodyFilePath] error:&err]) { - [self failWithError:err]; - } - [self setCompressedPostBodyFilePath:nil]; - } - return (!err); -} - -+ (BOOL)removeFileAtPath:(NSString *)path error:(NSError **)err -{ - NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; - - if ([fileManager fileExistsAtPath:path]) { - NSError *removeError = nil; - [fileManager removeItemAtPath:path error:&removeError]; - if (removeError) { - if (err) { - *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASIFileManagementError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Failed to delete file at path '%@'",path],NSLocalizedDescriptionKey,removeError,NSUnderlyingErrorKey,nil]]; - } - return NO; - } - } - return YES; -} - -#pragma mark Proxies - -- (BOOL)configureProxies -{ - // Have details of the proxy been set on this request - if (![self isPACFileRequest] && (![self proxyHost] && ![self proxyPort])) { - - // If not, we need to figure out what they'll be - NSArray *proxies = nil; - - // Have we been given a proxy auto config file? - if ([self PACurl]) { - - // If yes, we'll need to fetch the PAC file asynchronously, so we stop this request to wait until we have the proxy details. - [self fetchPACFile]; - return NO; - - // Detect proxy settings and apply them - } else { - -#if TARGET_OS_IPHONE - NSDictionary *proxySettings = [NSMakeCollectable(CFNetworkCopySystemProxySettings()) autorelease]; -#else - NSDictionary *proxySettings = [NSMakeCollectable(SCDynamicStoreCopyProxies(NULL)) autorelease]; -#endif - - proxies = [NSMakeCollectable(CFNetworkCopyProxiesForURL((CFURLRef)[self url], (CFDictionaryRef)proxySettings)) autorelease]; - - // Now check to see if the proxy settings contained a PAC url, we need to run the script to get the real list of proxies if so - NSDictionary *settings = [proxies objectAtIndex:0]; - if ([settings objectForKey:(NSString *)kCFProxyAutoConfigurationURLKey]) { - [self setPACurl:[settings objectForKey:(NSString *)kCFProxyAutoConfigurationURLKey]]; - [self fetchPACFile]; - return NO; - } - } - - if (!proxies) { - [self setReadStream:nil]; - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:ASIInternalErrorWhileBuildingRequestType userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Unable to obtain information on proxy servers needed for request",NSLocalizedDescriptionKey,nil]]]; - return NO; - } - // I don't really understand why the dictionary returned by CFNetworkCopyProxiesForURL uses different key names from CFNetworkCopySystemProxySettings/SCDynamicStoreCopyProxies - // and why its key names are documented while those we actually need to use don't seem to be (passing the kCF* keys doesn't seem to work) - if ([proxies count] > 0) { - NSDictionary *settings = [proxies objectAtIndex:0]; - [self setProxyHost:[settings objectForKey:(NSString *)kCFProxyHostNameKey]]; - [self setProxyPort:[[settings objectForKey:(NSString *)kCFProxyPortNumberKey] intValue]]; - [self setProxyType:[settings objectForKey:(NSString *)kCFProxyTypeKey]]; - } - } - return YES; -} - - - -// Attempts to download a PAC (Proxy Auto-Configuration) file -// PAC files at file://, http:// and https:// addresses are supported -- (void)fetchPACFile -{ - // For file:// urls, we'll use an async NSInputStream (ASIHTTPRequest does not support file:// urls) - if ([[self PACurl] isFileURL]) { - NSInputStream *stream = [[[NSInputStream alloc] initWithFileAtPath:[[self PACurl] path]] autorelease]; - [self setPACFileReadStream:stream]; - [stream setDelegate:(id)self]; - [stream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:[self runLoopMode]]; - [stream open]; - // If it takes more than timeOutSeconds to read the PAC, we'll just give up and assume no proxies - // We won't bother to handle cases where the first part of the PAC is read within timeOutSeconds, but the whole thing takes longer - // Either our PAC file is in easy reach, or it's going to slow things down to the point that it's probably better requests fail - [self performSelector:@selector(timeOutPACRead) withObject:nil afterDelay:[self timeOutSeconds]]; - return; - } - - NSString *scheme = [[[self PACurl] scheme] lowercaseString]; - if (![scheme isEqualToString:@"http"] && ![scheme isEqualToString:@"https"]) { - // Don't know how to read data from this URL, we'll have to give up - // We'll simply assume no proxies, and start the request as normal - [self startRequest]; - return; - } - - // Create an ASIHTTPRequest to fetch the PAC file - ASIHTTPRequest *PACRequest = [ASIHTTPRequest requestWithURL:[self PACurl]]; - - // Will prevent this request attempting to configure proxy settings for itself - [PACRequest setIsPACFileRequest:YES]; - - [PACRequest setTimeOutSeconds:[self timeOutSeconds]]; - - // If we're a synchronous request, we'll download the PAC file synchronously - if ([self isSynchronous]) { - [PACRequest startSynchronous]; - if (![PACRequest error] && [PACRequest responseString]) { - [self runPACScript:[PACRequest responseString]]; - } - [self startRequest]; - return; - } - - [self setPACFileRequest:PACRequest]; - - // Force this request to run before others in the shared queue - [PACRequest setQueuePriority:NSOperationQueuePriorityHigh]; - - // We'll treat failure to download the PAC file the same as success - if we were unable to fetch a PAC file, we proceed as if we have no proxy server and let this request fail itself if necessary - [PACRequest setDelegate:self]; - [PACRequest setDidFinishSelector:@selector(finishedDownloadingPACFile:)]; - [PACRequest setDidFailSelector:@selector(finishedDownloadingPACFile:)]; - [PACRequest startAsynchronous]; - - // Temporarily increase the number of operations in the shared queue to give our request a chance to run - [connectionsLock lock]; - [sharedQueue setMaxConcurrentOperationCount:[sharedQueue maxConcurrentOperationCount]+1]; - [connectionsLock unlock]; -} - -// Called as we read the PAC file from a file:// url -- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode -{ - if (![self PACFileReadStream]) { - return; - } - if (eventCode == NSStreamEventHasBytesAvailable) { - - if (![self PACFileData]) { - [self setPACFileData:[NSMutableData data]]; - } - // If your PAC file is larger than 16KB, you're just being cruel. - uint8_t buf[16384]; - NSInteger len = [(NSInputStream *)stream read:buf maxLength:16384]; - if (len) { - [[self PACFileData] appendBytes:(const void *)buf length:len]; - } - - } else if (eventCode == NSStreamEventErrorOccurred || eventCode == NSStreamEventEndEncountered) { - - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(timeOutPACRead) object:nil]; - - [stream close]; - [stream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:[self runLoopMode]]; - [self setPACFileReadStream:nil]; - - if (eventCode == NSStreamEventEndEncountered) { - // It sounds as though we have no idea what encoding a PAC file will use - static NSStringEncoding encodingsToTry[2] = {NSUTF8StringEncoding,NSISOLatin1StringEncoding}; - NSUInteger i; - for (i=0; i<2; i++) { - NSString *pacScript = [[[NSString alloc] initWithBytes:[[self PACFileData] bytes] length:[[self PACFileData] length] encoding:encodingsToTry[i]] autorelease]; - if (pacScript) { - [self runPACScript:pacScript]; - break; - } - } - } - [self setPACFileData:nil]; - [self startRequest]; - } -} - -// Called if it takes longer than timeOutSeconds to read the whole PAC file (when reading from a file:// url) -- (void)timeOutPACRead -{ - [self stream:[self PACFileReadStream] handleEvent:NSStreamEventErrorOccurred]; -} - -// Runs the downloaded PAC script -- (void)runPACScript:(NSString *)script -{ - if (script) { - // From: http://developer.apple.com/samplecode/CFProxySupportTool/listing1.html - // Work around . This dummy call to - // CFNetworkCopyProxiesForURL initialise some state within CFNetwork - // that is required by CFNetworkCopyProxiesForAutoConfigurationScript. - CFRelease(CFNetworkCopyProxiesForURL((CFURLRef)[self url], NULL)); - - // Obtain the list of proxies by running the autoconfiguration script - CFErrorRef err = NULL; - NSArray *proxies = [NSMakeCollectable(CFNetworkCopyProxiesForAutoConfigurationScript((CFStringRef)script,(CFURLRef)[self url], &err)) autorelease]; - if (!err && [proxies count] > 0) { - NSDictionary *settings = [proxies objectAtIndex:0]; - [self setProxyHost:[settings objectForKey:(NSString *)kCFProxyHostNameKey]]; - [self setProxyPort:[[settings objectForKey:(NSString *)kCFProxyPortNumberKey] intValue]]; - [self setProxyType:[settings objectForKey:(NSString *)kCFProxyTypeKey]]; - } - } -} - -// Called if we successfully downloaded a PAC file from a webserver -- (void)finishedDownloadingPACFile:(ASIHTTPRequest *)theRequest -{ - if (![theRequest error] && [theRequest responseString]) { - [self runPACScript:[theRequest responseString]]; - } - - // Set the shared queue's maxConcurrentOperationCount back to normal - [connectionsLock lock]; - [sharedQueue setMaxConcurrentOperationCount:[sharedQueue maxConcurrentOperationCount]-1]; - [connectionsLock unlock]; - - // We no longer need our PAC file request - [self setPACFileRequest:nil]; - - // Start the request - [self startRequest]; -} - - -#pragma mark persistent connections - -- (NSNumber *)connectionID -{ - return [[self connectionInfo] objectForKey:@"id"]; -} - -+ (void)expirePersistentConnections -{ - [connectionsLock lock]; - NSUInteger i; - for (i=0; i<[persistentConnectionsPool count]; i++) { - NSDictionary *existingConnection = [persistentConnectionsPool objectAtIndex:i]; - if (![existingConnection objectForKey:@"request"] && [[existingConnection objectForKey:@"expires"] timeIntervalSinceNow] <= 0) { -#if DEBUG_PERSISTENT_CONNECTIONS - ASI_DEBUG_LOG(@"[CONNECTION] Closing connection #%i because it has expired",[[existingConnection objectForKey:@"id"] intValue]); -#endif - NSInputStream *stream = [existingConnection objectForKey:@"stream"]; - if (stream) { - [stream close]; - } - [persistentConnectionsPool removeObject:existingConnection]; - i--; - } - } - [connectionsLock unlock]; -} - -#pragma mark NSCopying -- (id)copyWithZone:(NSZone *)zone -{ - // Don't forget - this will return a retained copy! - ASIHTTPRequest *newRequest = [[[self class] alloc] initWithURL:[self url]]; - [newRequest setDelegate:[self delegate]]; - [newRequest setRequestMethod:[self requestMethod]]; - [newRequest setPostBody:[self postBody]]; - [newRequest setShouldStreamPostDataFromDisk:[self shouldStreamPostDataFromDisk]]; - [newRequest setPostBodyFilePath:[self postBodyFilePath]]; - [newRequest setRequestHeaders:[[[self requestHeaders] mutableCopyWithZone:zone] autorelease]]; - [newRequest setRequestCookies:[[[self requestCookies] mutableCopyWithZone:zone] autorelease]]; - [newRequest setUseCookiePersistence:[self useCookiePersistence]]; - [newRequest setUseKeychainPersistence:[self useKeychainPersistence]]; - [newRequest setUseSessionPersistence:[self useSessionPersistence]]; - [newRequest setAllowCompressedResponse:[self allowCompressedResponse]]; - [newRequest setDownloadDestinationPath:[self downloadDestinationPath]]; - [newRequest setTemporaryFileDownloadPath:[self temporaryFileDownloadPath]]; - [newRequest setUsername:[self username]]; - [newRequest setPassword:[self password]]; - [newRequest setDomain:[self domain]]; - [newRequest setProxyUsername:[self proxyUsername]]; - [newRequest setProxyPassword:[self proxyPassword]]; - [newRequest setProxyDomain:[self proxyDomain]]; - [newRequest setProxyHost:[self proxyHost]]; - [newRequest setProxyPort:[self proxyPort]]; - [newRequest setProxyType:[self proxyType]]; - [newRequest setUploadProgressDelegate:[self uploadProgressDelegate]]; - [newRequest setDownloadProgressDelegate:[self downloadProgressDelegate]]; - [newRequest setShouldPresentAuthenticationDialog:[self shouldPresentAuthenticationDialog]]; - [newRequest setShouldPresentProxyAuthenticationDialog:[self shouldPresentProxyAuthenticationDialog]]; - [newRequest setPostLength:[self postLength]]; - [newRequest setHaveBuiltPostBody:[self haveBuiltPostBody]]; - [newRequest setDidStartSelector:[self didStartSelector]]; - [newRequest setDidFinishSelector:[self didFinishSelector]]; - [newRequest setDidFailSelector:[self didFailSelector]]; - [newRequest setTimeOutSeconds:[self timeOutSeconds]]; - [newRequest setShouldResetDownloadProgress:[self shouldResetDownloadProgress]]; - [newRequest setShouldResetUploadProgress:[self shouldResetUploadProgress]]; - [newRequest setShowAccurateProgress:[self showAccurateProgress]]; - [newRequest setDefaultResponseEncoding:[self defaultResponseEncoding]]; - [newRequest setAllowResumeForFileDownloads:[self allowResumeForFileDownloads]]; - [newRequest setUserInfo:[[[self userInfo] copyWithZone:zone] autorelease]]; - [newRequest setTag:[self tag]]; - [newRequest setUseHTTPVersionOne:[self useHTTPVersionOne]]; - [newRequest setShouldRedirect:[self shouldRedirect]]; - [newRequest setValidatesSecureCertificate:[self validatesSecureCertificate]]; - [newRequest setClientCertificateIdentity:clientCertificateIdentity]; - [newRequest setClientCertificates:[[clientCertificates copy] autorelease]]; - [newRequest setPACurl:[self PACurl]]; - [newRequest setShouldPresentCredentialsBeforeChallenge:[self shouldPresentCredentialsBeforeChallenge]]; - [newRequest setNumberOfTimesToRetryOnTimeout:[self numberOfTimesToRetryOnTimeout]]; - [newRequest setShouldUseRFC2616RedirectBehaviour:[self shouldUseRFC2616RedirectBehaviour]]; - [newRequest setShouldAttemptPersistentConnection:[self shouldAttemptPersistentConnection]]; - [newRequest setPersistentConnectionTimeoutSeconds:[self persistentConnectionTimeoutSeconds]]; - [newRequest setAuthenticationScheme:[self authenticationScheme]]; - return newRequest; -} - -#pragma mark default time out - -+ (NSTimeInterval)defaultTimeOutSeconds -{ - return defaultTimeOutSeconds; -} - -+ (void)setDefaultTimeOutSeconds:(NSTimeInterval)newTimeOutSeconds -{ - defaultTimeOutSeconds = newTimeOutSeconds; -} - - -#pragma mark client certificate - -- (void)setClientCertificateIdentity:(SecIdentityRef)anIdentity { - if(clientCertificateIdentity) { - CFRelease(clientCertificateIdentity); - } - - clientCertificateIdentity = anIdentity; - - if (clientCertificateIdentity) { - CFRetain(clientCertificateIdentity); - } -} - - -#pragma mark session credentials - -+ (NSMutableArray *)sessionProxyCredentialsStore -{ - [sessionCredentialsLock lock]; - if (!sessionProxyCredentialsStore) { - sessionProxyCredentialsStore = [[NSMutableArray alloc] init]; - } - [sessionCredentialsLock unlock]; - return sessionProxyCredentialsStore; -} - -+ (NSMutableArray *)sessionCredentialsStore -{ - [sessionCredentialsLock lock]; - if (!sessionCredentialsStore) { - sessionCredentialsStore = [[NSMutableArray alloc] init]; - } - [sessionCredentialsLock unlock]; - return sessionCredentialsStore; -} - -+ (void)storeProxyAuthenticationCredentialsInSessionStore:(NSDictionary *)credentials -{ - [sessionCredentialsLock lock]; - [self removeProxyAuthenticationCredentialsFromSessionStore:[credentials objectForKey:@"Credentials"]]; - [[[self class] sessionProxyCredentialsStore] addObject:credentials]; - [sessionCredentialsLock unlock]; -} - -+ (void)storeAuthenticationCredentialsInSessionStore:(NSDictionary *)credentials -{ - [sessionCredentialsLock lock]; - [self removeAuthenticationCredentialsFromSessionStore:[credentials objectForKey:@"Credentials"]]; - [[[self class] sessionCredentialsStore] addObject:credentials]; - [sessionCredentialsLock unlock]; -} - -+ (void)removeProxyAuthenticationCredentialsFromSessionStore:(NSDictionary *)credentials -{ - [sessionCredentialsLock lock]; - NSMutableArray *sessionCredentialsList = [[self class] sessionProxyCredentialsStore]; - NSUInteger i; - for (i=0; i<[sessionCredentialsList count]; i++) { - NSDictionary *theCredentials = [sessionCredentialsList objectAtIndex:i]; - if ([theCredentials objectForKey:@"Credentials"] == credentials) { - [sessionCredentialsList removeObjectAtIndex:i]; - [sessionCredentialsLock unlock]; - return; - } - } - [sessionCredentialsLock unlock]; -} - -+ (void)removeAuthenticationCredentialsFromSessionStore:(NSDictionary *)credentials -{ - [sessionCredentialsLock lock]; - NSMutableArray *sessionCredentialsList = [[self class] sessionCredentialsStore]; - NSUInteger i; - for (i=0; i<[sessionCredentialsList count]; i++) { - NSDictionary *theCredentials = [sessionCredentialsList objectAtIndex:i]; - if ([theCredentials objectForKey:@"Credentials"] == credentials) { - [sessionCredentialsList removeObjectAtIndex:i]; - [sessionCredentialsLock unlock]; - return; - } - } - [sessionCredentialsLock unlock]; -} - -- (NSDictionary *)findSessionProxyAuthenticationCredentials -{ - [sessionCredentialsLock lock]; - NSMutableArray *sessionCredentialsList = [[self class] sessionProxyCredentialsStore]; - for (NSDictionary *theCredentials in sessionCredentialsList) { - if ([[theCredentials objectForKey:@"Host"] isEqualToString:[self proxyHost]] && [[theCredentials objectForKey:@"Port"] intValue] == [self proxyPort]) { - [sessionCredentialsLock unlock]; - return theCredentials; - } - } - [sessionCredentialsLock unlock]; - return nil; -} - - -- (NSDictionary *)findSessionAuthenticationCredentials -{ - [sessionCredentialsLock lock]; - NSMutableArray *sessionCredentialsList = [[self class] sessionCredentialsStore]; - NSURL *requestURL = [self url]; - - BOOL haveFoundExactMatch; - NSDictionary *closeMatch = nil; - - // Loop through all the cached credentials we have, looking for the best match for this request - for (NSDictionary *theCredentials in sessionCredentialsList) { - - haveFoundExactMatch = NO; - NSURL *cachedCredentialsURL = [theCredentials objectForKey:@"URL"]; - - // Find an exact match (same url) - if ([cachedCredentialsURL isEqual:[self url]]) { - haveFoundExactMatch = YES; - - // This is not an exact match for the url, and we already have a close match we can use - } else if (closeMatch) { - continue; - - // Find a close match (same host, scheme and port) - } else if ([[cachedCredentialsURL host] isEqualToString:[requestURL host]] && ([cachedCredentialsURL port] == [requestURL port] || ([requestURL port] && [[cachedCredentialsURL port] isEqualToNumber:[requestURL port]])) && [[cachedCredentialsURL scheme] isEqualToString:[requestURL scheme]]) { - } else { - continue; - } - - // Just a sanity check to ensure we never choose credentials from a different realm. Can't really do more than that, as either this request or the stored credentials may not have a realm when the other does - if ([self authenticationRealm] && ([theCredentials objectForKey:@"AuthenticationRealm"] && ![[theCredentials objectForKey:@"AuthenticationRealm"] isEqualToString:[self authenticationRealm]])) { - continue; - } - - // If we have a username and password set on the request, check that they are the same as the cached ones - if ([self username] && [self password]) { - NSDictionary *usernameAndPassword = [theCredentials objectForKey:@"Credentials"]; - NSString *storedUsername = [usernameAndPassword objectForKey:(NSString *)kCFHTTPAuthenticationUsername]; - NSString *storedPassword = [usernameAndPassword objectForKey:(NSString *)kCFHTTPAuthenticationPassword]; - if (![storedUsername isEqualToString:[self username]] || ![storedPassword isEqualToString:[self password]]) { - continue; - } - } - - // If we have an exact match for the url, use those credentials - if (haveFoundExactMatch) { - [sessionCredentialsLock unlock]; - return theCredentials; - } - - // We have no exact match, let's remember that we have a good match for this server, and we'll use it at the end if we don't find an exact match - closeMatch = theCredentials; - } - [sessionCredentialsLock unlock]; - - // Return credentials that matched on host, port and scheme, or nil if we didn't find any - return closeMatch; -} - -#pragma mark keychain storage - -+ (void)saveCredentials:(NSURLCredential *)credentials forHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm -{ - NSURLProtectionSpace *protectionSpace = [[[NSURLProtectionSpace alloc] initWithHost:host port:port protocol:protocol realm:realm authenticationMethod:NSURLAuthenticationMethodDefault] autorelease]; - [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credentials forProtectionSpace:protectionSpace]; -} - -+ (void)saveCredentials:(NSURLCredential *)credentials forProxy:(NSString *)host port:(int)port realm:(NSString *)realm -{ - NSURLProtectionSpace *protectionSpace = [[[NSURLProtectionSpace alloc] initWithProxyHost:host port:port type:NSURLProtectionSpaceHTTPProxy realm:realm authenticationMethod:NSURLAuthenticationMethodDefault] autorelease]; - [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credentials forProtectionSpace:protectionSpace]; -} - -+ (NSURLCredential *)savedCredentialsForHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm -{ - NSURLProtectionSpace *protectionSpace = [[[NSURLProtectionSpace alloc] initWithHost:host port:port protocol:protocol realm:realm authenticationMethod:NSURLAuthenticationMethodDefault] autorelease]; - return [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace]; -} - -+ (NSURLCredential *)savedCredentialsForProxy:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm -{ - NSURLProtectionSpace *protectionSpace = [[[NSURLProtectionSpace alloc] initWithProxyHost:host port:port type:NSURLProtectionSpaceHTTPProxy realm:realm authenticationMethod:NSURLAuthenticationMethodDefault] autorelease]; - return [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace]; -} - -+ (void)removeCredentialsForHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm -{ - NSURLProtectionSpace *protectionSpace = [[[NSURLProtectionSpace alloc] initWithHost:host port:port protocol:protocol realm:realm authenticationMethod:NSURLAuthenticationMethodDefault] autorelease]; - NSURLCredential *credential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace]; - if (credential) { - [[NSURLCredentialStorage sharedCredentialStorage] removeCredential:credential forProtectionSpace:protectionSpace]; - } -} - -+ (void)removeCredentialsForProxy:(NSString *)host port:(int)port realm:(NSString *)realm -{ - NSURLProtectionSpace *protectionSpace = [[[NSURLProtectionSpace alloc] initWithProxyHost:host port:port type:NSURLProtectionSpaceHTTPProxy realm:realm authenticationMethod:NSURLAuthenticationMethodDefault] autorelease]; - NSURLCredential *credential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace]; - if (credential) { - [[NSURLCredentialStorage sharedCredentialStorage] removeCredential:credential forProtectionSpace:protectionSpace]; - } -} - -+ (NSMutableArray *)sessionCookies -{ - [sessionCookiesLock lock]; - if (!sessionCookies) { - [ASIHTTPRequest setSessionCookies:[NSMutableArray array]]; - } - NSMutableArray *cookies = [[sessionCookies retain] autorelease]; - [sessionCookiesLock unlock]; - return cookies; -} - -+ (void)setSessionCookies:(NSMutableArray *)newSessionCookies -{ - [sessionCookiesLock lock]; - // Remove existing cookies from the persistent store - for (NSHTTPCookie *cookie in sessionCookies) { - [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie]; - } - [sessionCookies release]; - sessionCookies = [newSessionCookies retain]; - [sessionCookiesLock unlock]; -} - -+ (void)addSessionCookie:(NSHTTPCookie *)newCookie -{ - [sessionCookiesLock lock]; - NSHTTPCookie *cookie; - NSUInteger i; - NSUInteger max = [[ASIHTTPRequest sessionCookies] count]; - for (i=0; i 0) { - if ([self readStreamIsScheduled]) { - [self unscheduleReadStream]; - #if DEBUG_THROTTLING - ASI_DEBUG_LOG(@"[THROTTLING] Sleeping request %@ until after %@",self,throttleWakeUpTime); - #endif - } - } else { - if (![self readStreamIsScheduled]) { - [self scheduleReadStream]; - #if DEBUG_THROTTLING - ASI_DEBUG_LOG(@"[THROTTLING] Waking up request %@",self); - #endif - } - } - } - [bandwidthThrottlingLock unlock]; - - // Bandwidth throttling must have been turned off since we last looked, let's re-schedule the stream - } else if (![self readStreamIsScheduled]) { - [self scheduleReadStream]; - } -} - -+ (BOOL)isBandwidthThrottled -{ -#if TARGET_OS_IPHONE - [bandwidthThrottlingLock lock]; - - BOOL throttle = isBandwidthThrottled || (!shouldThrottleBandwidthForWWANOnly && (maxBandwidthPerSecond > 0)); - [bandwidthThrottlingLock unlock]; - return throttle; -#else - [bandwidthThrottlingLock lock]; - BOOL throttle = (maxBandwidthPerSecond > 0); - [bandwidthThrottlingLock unlock]; - return throttle; -#endif -} - -+ (unsigned long)maxBandwidthPerSecond -{ - [bandwidthThrottlingLock lock]; - unsigned long amount = maxBandwidthPerSecond; - [bandwidthThrottlingLock unlock]; - return amount; -} - -+ (void)setMaxBandwidthPerSecond:(unsigned long)bytes -{ - [bandwidthThrottlingLock lock]; - maxBandwidthPerSecond = bytes; - [bandwidthThrottlingLock unlock]; -} - -+ (void)incrementBandwidthUsedInLastSecond:(unsigned long)bytes -{ - [bandwidthThrottlingLock lock]; - bandwidthUsedInLastSecond += bytes; - [bandwidthThrottlingLock unlock]; -} - -+ (void)recordBandwidthUsage -{ - if (bandwidthUsedInLastSecond == 0) { - [bandwidthUsageTracker removeAllObjects]; - } else { - NSTimeInterval interval = [bandwidthMeasurementDate timeIntervalSinceNow]; - while ((interval < 0 || [bandwidthUsageTracker count] > 5) && [bandwidthUsageTracker count] > 0) { - [bandwidthUsageTracker removeObjectAtIndex:0]; - interval++; - } - } - #if DEBUG_THROTTLING - ASI_DEBUG_LOG(@"[THROTTLING] ===Used: %u bytes of bandwidth in last measurement period===",bandwidthUsedInLastSecond); - #endif - [bandwidthUsageTracker addObject:[NSNumber numberWithUnsignedLong:bandwidthUsedInLastSecond]]; - [bandwidthMeasurementDate release]; - bandwidthMeasurementDate = [[NSDate dateWithTimeIntervalSinceNow:1] retain]; - bandwidthUsedInLastSecond = 0; - - NSUInteger measurements = [bandwidthUsageTracker count]; - unsigned long totalBytes = 0; - for (NSNumber *bytes in bandwidthUsageTracker) { - totalBytes += [bytes unsignedLongValue]; - } - if (measurements > 0) - averageBandwidthUsedPerSecond = totalBytes/measurements; -} - -+ (unsigned long)averageBandwidthUsedPerSecond -{ - [bandwidthThrottlingLock lock]; - unsigned long amount = averageBandwidthUsedPerSecond; - [bandwidthThrottlingLock unlock]; - return amount; -} - -+ (void)measureBandwidthUsage -{ - // Other requests may have to wait for this lock if we're sleeping, but this is fine, since in that case we already know they shouldn't be sending or receiving data - [bandwidthThrottlingLock lock]; - - if (!bandwidthMeasurementDate || [bandwidthMeasurementDate timeIntervalSinceNow] < -0) { - [ASIHTTPRequest recordBandwidthUsage]; - } - - // Are we performing bandwidth throttling? - if ( - #if TARGET_OS_IPHONE - isBandwidthThrottled || (!shouldThrottleBandwidthForWWANOnly && (maxBandwidthPerSecond)) - #else - maxBandwidthPerSecond - #endif - ) { - // How much data can we still send or receive this second? - long long bytesRemaining = (long long)maxBandwidthPerSecond - (long long)bandwidthUsedInLastSecond; - - // Have we used up our allowance? - if (bytesRemaining < 0) { - - // Yes, put this request to sleep until a second is up, with extra added punishment sleeping time for being very naughty (we have used more bandwidth than we were allowed) - double extraSleepyTime = (-bytesRemaining/(maxBandwidthPerSecond*1.0)); - [throttleWakeUpTime release]; - throttleWakeUpTime = [[NSDate alloc] initWithTimeInterval:extraSleepyTime sinceDate:bandwidthMeasurementDate]; - } - } - [bandwidthThrottlingLock unlock]; -} - -+ (unsigned long)maxUploadReadLength -{ - [bandwidthThrottlingLock lock]; - - // We'll split our bandwidth allowance into 4 (which is the default for an ASINetworkQueue's max concurrent operations count) to give all running requests a fighting chance of reading data this cycle - long long toRead = maxBandwidthPerSecond/4; - if (maxBandwidthPerSecond > 0 && (bandwidthUsedInLastSecond + toRead > maxBandwidthPerSecond)) { - toRead = (long long)maxBandwidthPerSecond-(long long)bandwidthUsedInLastSecond; - if (toRead < 0) { - toRead = 0; - } - } - - if (toRead == 0 || !bandwidthMeasurementDate || [bandwidthMeasurementDate timeIntervalSinceNow] < -0) { - [throttleWakeUpTime release]; - throttleWakeUpTime = [bandwidthMeasurementDate retain]; - } - [bandwidthThrottlingLock unlock]; - return (unsigned long)toRead; -} - - -#if TARGET_OS_IPHONE -+ (void)setShouldThrottleBandwidthForWWAN:(BOOL)throttle -{ - if (throttle) { - [ASIHTTPRequest throttleBandwidthForWWANUsingLimit:ASIWWANBandwidthThrottleAmount]; - } else { - [ASIHTTPRequest unsubscribeFromNetworkReachabilityNotifications]; - [ASIHTTPRequest setMaxBandwidthPerSecond:0]; - [bandwidthThrottlingLock lock]; - isBandwidthThrottled = NO; - shouldThrottleBandwidthForWWANOnly = NO; - [bandwidthThrottlingLock unlock]; - } -} - -+ (void)throttleBandwidthForWWANUsingLimit:(unsigned long)limit -{ - [bandwidthThrottlingLock lock]; - shouldThrottleBandwidthForWWANOnly = YES; - maxBandwidthPerSecond = limit; - [ASIHTTPRequest registerForNetworkReachabilityNotifications]; - [bandwidthThrottlingLock unlock]; - [ASIHTTPRequest reachabilityChanged:nil]; -} - -#pragma mark reachability - -+ (void)registerForNetworkReachabilityNotifications -{ - [[Reachability reachabilityForInternetConnection] startNotifier]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil]; -} - - -+ (void)unsubscribeFromNetworkReachabilityNotifications -{ - [[NSNotificationCenter defaultCenter] removeObserver:self name:kReachabilityChangedNotification object:nil]; -} - -+ (BOOL)isNetworkReachableViaWWAN -{ - return ([[Reachability reachabilityForInternetConnection] currentReachabilityStatus] == ReachableViaWWAN); -} - -+ (void)reachabilityChanged:(NSNotification *)note -{ - [bandwidthThrottlingLock lock]; - isBandwidthThrottled = [ASIHTTPRequest isNetworkReachableViaWWAN]; - [bandwidthThrottlingLock unlock]; -} -#endif - -#pragma mark queue - -// Returns the shared queue -+ (NSOperationQueue *)sharedQueue -{ - return [[sharedQueue retain] autorelease]; -} - -#pragma mark cache - -+ (void)setDefaultCache:(id )cache -{ - @synchronized (self) { - [cache retain]; - [defaultCache release]; - defaultCache = cache; - } -} - -+ (id )defaultCache -{ - @synchronized(self) { - return [[defaultCache retain] autorelease]; - } - return nil; -} - - -#pragma mark network activity - -+ (BOOL)isNetworkInUse -{ - [connectionsLock lock]; - BOOL inUse = (runningRequestCount > 0); - [connectionsLock unlock]; - return inUse; -} - -+ (void)setShouldUpdateNetworkActivityIndicator:(BOOL)shouldUpdate -{ - [connectionsLock lock]; - shouldUpdateNetworkActivityIndicator = shouldUpdate; - [connectionsLock unlock]; -} - -+ (void)showNetworkActivityIndicator -{ -#if TARGET_OS_IPHONE - [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; -#endif -} - -+ (void)hideNetworkActivityIndicator -{ -#if TARGET_OS_IPHONE - [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; -#endif -} - - -/* Always called on main thread */ -+ (void)hideNetworkActivityIndicatorAfterDelay -{ - [self performSelector:@selector(hideNetworkActivityIndicatorIfNeeeded) withObject:nil afterDelay:0.5]; -} - -+ (void)hideNetworkActivityIndicatorIfNeeeded -{ - [connectionsLock lock]; - if (runningRequestCount == 0) { - [self hideNetworkActivityIndicator]; - } - [connectionsLock unlock]; -} - - -#pragma mark threading behaviour - -// In the default implementation, all requests run in a single background thread -// Advanced users only: Override this method in a subclass for a different threading behaviour -// Eg: return [NSThread mainThread] to run all requests in the main thread -// Alternatively, you can create a thread on demand, or manage a pool of threads -// Threads returned by this method will need to run the runloop in default mode (eg CFRunLoopRun()) -// Requests will stop the runloop when they complete -// If you have multiple requests sharing the thread or you want to re-use the thread, you'll need to restart the runloop -+ (NSThread *)threadForRequest:(ASIHTTPRequest *)request -{ - if (networkThread == nil) { - @synchronized(self) { - if (networkThread == nil) { - networkThread = [[NSThread alloc] initWithTarget:self selector:@selector(runRequests) object:nil]; - [networkThread start]; - } - } - } - return networkThread; -} - -+ (void)runRequests -{ - // Should keep the runloop from exiting - CFRunLoopSourceContext context = {0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; - CFRunLoopSourceRef source = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &context); - CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode); - - BOOL runAlways = YES; // Introduced to cheat Static Analyzer - while (runAlways) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.0e10, true); - [pool drain]; - } - - // Should never be called, but anyway - CFRunLoopRemoveSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode); - CFRelease(source); -} - -#pragma mark miscellany - -#if TARGET_OS_IPHONE -+ (BOOL)isMultitaskingSupported -{ - BOOL multiTaskingSupported = NO; - if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]) { - multiTaskingSupported = [(id)[UIDevice currentDevice] isMultitaskingSupported]; - } - return multiTaskingSupported; -} -#endif - -// From: http://www.cocoadev.com/index.pl?BaseSixtyFour - -+ (NSString*)base64forData:(NSData*)theData { - - const uint8_t* input = (const uint8_t*)[theData bytes]; - NSInteger length = [theData length]; - - static char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - - NSMutableData* data = [NSMutableData dataWithLength:((length + 2) / 3) * 4]; - uint8_t* output = (uint8_t*)data.mutableBytes; - - NSInteger i,i2; - for (i=0; i < length; i += 3) { - NSInteger value = 0; - for (i2=0; i2<3; i2++) { - value <<= 8; - if (i+i2 < length) { - value |= (0xFF & input[i+i2]); - } - } - - NSInteger theIndex = (i / 3) * 4; - output[theIndex + 0] = table[(value >> 18) & 0x3F]; - output[theIndex + 1] = table[(value >> 12) & 0x3F]; - output[theIndex + 2] = (i + 1) < length ? table[(value >> 6) & 0x3F] : '='; - output[theIndex + 3] = (i + 2) < length ? table[(value >> 0) & 0x3F] : '='; - } - - return [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease]; -} - -+ (NSDate *)expiryDateForRequest:(ASIHTTPRequest *)request maxAge:(NSTimeInterval)maxAge -{ - NSDictionary *responseHeaders = [request responseHeaders]; - - // If we weren't given a custom max-age, lets look for one in the response headers - if (!maxAge) { - NSString *cacheControl = [[responseHeaders objectForKey:@"Cache-Control"] lowercaseString]; - if (cacheControl) { - NSScanner *scanner = [NSScanner scannerWithString:cacheControl]; - [scanner scanUpToString:@"max-age" intoString:NULL]; - if ([scanner scanString:@"max-age" intoString:NULL]) { - [scanner scanString:@"=" intoString:NULL]; - [scanner scanDouble:&maxAge]; - } - } - } - - // RFC 2612 says max-age must override any Expires header - if (maxAge) { - NSDate *date = [NSDate date]; - if ([date respondsToSelector:@selector(dateByAddingTimeInterval:)]) { - return [date dateByAddingTimeInterval:maxAge]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - return [date addTimeInterval:maxAge]; -#pragma clang diagnostic pop - } - } else { - NSString *expires = [responseHeaders objectForKey:@"Expires"]; - if (expires) { - return [ASIHTTPRequest dateFromRFC1123String:expires]; - } - } - return nil; -} - -// Based on hints from http://stackoverflow.com/questions/1850824/parsing-a-rfc-822-date-with-nsdateformatter -+ (NSDate *)dateFromRFC1123String:(NSString *)string -{ - NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; - [formatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]]; - // Does the string include a week day? - NSString *day = @""; - if ([string rangeOfString:@","].location != NSNotFound) { - day = @"EEE, "; - } - // Does the string include seconds? - NSString *seconds = @""; - if ([[string componentsSeparatedByString:@":"] count] == 3) { - seconds = @":ss"; - } - [formatter setDateFormat:[NSString stringWithFormat:@"%@dd MMM yyyy HH:mm%@ z",day,seconds]]; - return [formatter dateFromString:string]; -} - -+ (void)parseMimeType:(NSString **)mimeType andResponseEncoding:(NSStringEncoding *)stringEncoding fromContentType:(NSString *)contentType -{ - if (!contentType) { - return; - } - NSScanner *charsetScanner = [NSScanner scannerWithString: contentType]; - if (![charsetScanner scanUpToString:@";" intoString:mimeType] || [charsetScanner scanLocation] == [contentType length]) { - *mimeType = [contentType stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; - return; - } - *mimeType = [*mimeType stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; - NSString *charsetSeparator = @"charset="; - NSString *IANAEncoding = nil; - - if ([charsetScanner scanUpToString: charsetSeparator intoString: NULL] && [charsetScanner scanLocation] < [contentType length]) { - [charsetScanner setScanLocation: [charsetScanner scanLocation] + [charsetSeparator length]]; - [charsetScanner scanUpToString: @";" intoString: &IANAEncoding]; - } - - if (IANAEncoding) { - CFStringEncoding cfEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)IANAEncoding); - if (cfEncoding != kCFStringEncodingInvalidId) { - *stringEncoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding); - } - } -} - -#pragma mark - -#pragma mark blocks -#if NS_BLOCKS_AVAILABLE -- (void)setStartedBlock:(ASIBasicBlock)aStartedBlock -{ - [startedBlock release]; - startedBlock = [aStartedBlock copy]; -} - -- (void)setHeadersReceivedBlock:(ASIHeadersBlock)aReceivedBlock -{ - [headersReceivedBlock release]; - headersReceivedBlock = [aReceivedBlock copy]; -} - -- (void)setCompletionBlock:(ASIBasicBlock)aCompletionBlock -{ - [completionBlock release]; - completionBlock = [aCompletionBlock copy]; -} - -- (void)setFailedBlock:(ASIBasicBlock)aFailedBlock -{ - [failureBlock release]; - failureBlock = [aFailedBlock copy]; -} - -- (void)setBytesReceivedBlock:(ASIProgressBlock)aBytesReceivedBlock -{ - [bytesReceivedBlock release]; - bytesReceivedBlock = [aBytesReceivedBlock copy]; -} - -- (void)setBytesSentBlock:(ASIProgressBlock)aBytesSentBlock -{ - [bytesSentBlock release]; - bytesSentBlock = [aBytesSentBlock copy]; -} - -- (void)setDownloadSizeIncrementedBlock:(ASISizeBlock)aDownloadSizeIncrementedBlock{ - [downloadSizeIncrementedBlock release]; - downloadSizeIncrementedBlock = [aDownloadSizeIncrementedBlock copy]; -} - -- (void)setUploadSizeIncrementedBlock:(ASISizeBlock)anUploadSizeIncrementedBlock -{ - [uploadSizeIncrementedBlock release]; - uploadSizeIncrementedBlock = [anUploadSizeIncrementedBlock copy]; -} - -- (void)setDataReceivedBlock:(ASIDataBlock)aReceivedBlock -{ - [dataReceivedBlock release]; - dataReceivedBlock = [aReceivedBlock copy]; -} - -- (void)setAuthenticationNeededBlock:(ASIBasicBlock)anAuthenticationBlock -{ - [authenticationNeededBlock release]; - authenticationNeededBlock = [anAuthenticationBlock copy]; -} -- (void)setProxyAuthenticationNeededBlock:(ASIBasicBlock)aProxyAuthenticationBlock -{ - [proxyAuthenticationNeededBlock release]; - proxyAuthenticationNeededBlock = [aProxyAuthenticationBlock copy]; -} -- (void)setRequestRedirectedBlock:(ASIBasicBlock)aRedirectBlock -{ - [requestRedirectedBlock release]; - requestRedirectedBlock = [aRedirectBlock copy]; -} -#endif - -#pragma mark === - -@synthesize username; -@synthesize password; -@synthesize userAgentString; -@synthesize domain; -@synthesize proxyUsername; -@synthesize proxyPassword; -@synthesize proxyDomain; -@synthesize url; -@synthesize originalURL; -@synthesize delegate; -@synthesize queue; -@synthesize uploadProgressDelegate; -@synthesize downloadProgressDelegate; -@synthesize useKeychainPersistence; -@synthesize useSessionPersistence; -@synthesize useCookiePersistence; -@synthesize downloadDestinationPath; -@synthesize temporaryFileDownloadPath; -@synthesize temporaryUncompressedDataDownloadPath; -@synthesize didStartSelector; -@synthesize didReceiveResponseHeadersSelector; -@synthesize willRedirectSelector; -@synthesize didFinishSelector; -@synthesize didFailSelector; -@synthesize didReceiveDataSelector; -@synthesize authenticationRealm; -@synthesize proxyAuthenticationRealm; -@synthesize error; -@synthesize complete; -@synthesize requestHeaders; -@synthesize responseHeaders; -@synthesize responseCookies; -@synthesize requestCookies; -@synthesize requestCredentials; -@synthesize responseStatusCode; -@synthesize rawResponseData; -@synthesize lastActivityTime; -@synthesize timeOutSeconds; -@synthesize requestMethod; -@synthesize postBody; -@synthesize compressedPostBody; -@synthesize contentLength; -@synthesize partialDownloadSize; -@synthesize postLength; -@synthesize shouldResetDownloadProgress; -@synthesize shouldResetUploadProgress; -@synthesize mainRequest; -@synthesize totalBytesRead; -@synthesize totalBytesSent; -@synthesize showAccurateProgress; -@synthesize uploadBufferSize; -@synthesize defaultResponseEncoding; -@synthesize responseEncoding; -@synthesize allowCompressedResponse; -@synthesize allowResumeForFileDownloads; -@synthesize userInfo; -@synthesize tag; -@synthesize postBodyFilePath; -@synthesize compressedPostBodyFilePath; -@synthesize postBodyWriteStream; -@synthesize postBodyReadStream; -@synthesize shouldStreamPostDataFromDisk; -@synthesize didCreateTemporaryPostDataFile; -@synthesize useHTTPVersionOne; -@synthesize lastBytesRead; -@synthesize lastBytesSent; -@synthesize cancelledLock; -@synthesize haveBuiltPostBody; -@synthesize fileDownloadOutputStream; -@synthesize inflatedFileDownloadOutputStream; -@synthesize authenticationRetryCount; -@synthesize proxyAuthenticationRetryCount; -@synthesize updatedProgress; -@synthesize shouldRedirect; -@synthesize validatesSecureCertificate; -@synthesize needsRedirect; -@synthesize redirectCount; -@synthesize shouldCompressRequestBody; -@synthesize proxyCredentials; -@synthesize proxyHost; -@synthesize proxyPort; -@synthesize proxyType; -@synthesize PACurl; -@synthesize authenticationScheme; -@synthesize proxyAuthenticationScheme; -@synthesize shouldPresentAuthenticationDialog; -@synthesize shouldPresentProxyAuthenticationDialog; -@synthesize authenticationNeeded; -@synthesize responseStatusMessage; -@synthesize shouldPresentCredentialsBeforeChallenge; -@synthesize haveBuiltRequestHeaders; -@synthesize inProgress; -@synthesize numberOfTimesToRetryOnTimeout; -@synthesize retryCount; -@synthesize willRetryRequest; -@synthesize shouldAttemptPersistentConnection; -@synthesize persistentConnectionTimeoutSeconds; -@synthesize connectionCanBeReused; -@synthesize connectionInfo; -@synthesize readStream; -@synthesize readStreamIsScheduled; -@synthesize shouldUseRFC2616RedirectBehaviour; -@synthesize downloadComplete; -@synthesize requestID; -@synthesize runLoopMode; -@synthesize statusTimer; -@synthesize downloadCache; -@synthesize cachePolicy; -@synthesize cacheStoragePolicy; -@synthesize didUseCachedResponse; -@synthesize secondsToCache; -@synthesize clientCertificates; -@synthesize redirectURL; -#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 -@synthesize shouldContinueWhenAppEntersBackground; -#endif -@synthesize dataDecompressor; -@synthesize shouldWaitToInflateCompressedResponses; - -@synthesize isPACFileRequest; -@synthesize PACFileRequest; -@synthesize PACFileReadStream; -@synthesize PACFileData; - -@synthesize isSynchronous; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequestConfig.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequestConfig.h deleted file mode 100644 index 3f6c5870..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequestConfig.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// ASIHTTPRequestConfig.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 14/12/2009. -// Copyright 2009 All-Seeing Interactive. All rights reserved. -// - - -// ====== -// Debug output configuration options -// ====== - -// If defined will use the specified function for debug logging -// Otherwise use NSLog -#ifndef ASI_DEBUG_LOG - #define ASI_DEBUG_LOG NSLog -#endif - -// When set to 1 ASIHTTPRequests will print information about what a request is doing -#ifndef DEBUG_REQUEST_STATUS - #define DEBUG_REQUEST_STATUS 0 -#endif - -// When set to 1, ASIFormDataRequests will print information about the request body to the console -#ifndef DEBUG_FORM_DATA_REQUEST - #define DEBUG_FORM_DATA_REQUEST 0 -#endif - -// When set to 1, ASIHTTPRequests will print information about bandwidth throttling to the console -#ifndef DEBUG_THROTTLING - #define DEBUG_THROTTLING 0 -#endif - -// When set to 1, ASIHTTPRequests will print information about persistent connections to the console -#ifndef DEBUG_PERSISTENT_CONNECTIONS - #define DEBUG_PERSISTENT_CONNECTIONS 0 -#endif - -// When set to 1, ASIHTTPRequests will print information about HTTP authentication (Basic, Digest or NTLM) to the console -#ifndef DEBUG_HTTP_AUTHENTICATION - #define DEBUG_HTTP_AUTHENTICATION 0 -#endif diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequestDelegate.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequestDelegate.h deleted file mode 100644 index c495a275..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIHTTPRequestDelegate.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// ASIHTTPRequestDelegate.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 13/04/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -@class ASIHTTPRequest; - -@protocol ASIHTTPRequestDelegate - -@optional - -// These are the default delegate methods for request status -// You can use different ones by setting didStartSelector / didFinishSelector / didFailSelector -- (void)requestStarted:(ASIHTTPRequest *)request; -- (void)request:(ASIHTTPRequest *)request didReceiveResponseHeaders:(NSDictionary *)responseHeaders; -- (void)request:(ASIHTTPRequest *)request willRedirectToURL:(NSURL *)newURL; -- (void)requestFinished:(ASIHTTPRequest *)request; -- (void)requestFailed:(ASIHTTPRequest *)request; -- (void)requestRedirected:(ASIHTTPRequest *)request; - -// When a delegate implements this method, it is expected to process all incoming data itself -// This means that responseData / responseString / downloadDestinationPath etc are ignored -// You can have the request call a different method by setting didReceiveDataSelector -- (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data; - -// If a delegate implements one of these, it will be asked to supply credentials when none are available -// The delegate can then either restart the request ([request retryUsingSuppliedCredentials]) once credentials have been set -// or cancel it ([request cancelAuthentication]) -- (void)authenticationNeededForRequest:(ASIHTTPRequest *)request; -- (void)proxyAuthenticationNeededForRequest:(ASIHTTPRequest *)request; - -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIInputStream.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIInputStream.h deleted file mode 100644 index 7b9f93ed..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIInputStream.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// ASIInputStream.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 10/08/2009. -// Copyright 2009 All-Seeing Interactive. All rights reserved. -// - -#import - -@class ASIHTTPRequest; - -// This is a wrapper for NSInputStream that pretends to be an NSInputStream itself -// Subclassing NSInputStream seems to be tricky, and may involve overriding undocumented methods, so we'll cheat instead. -// It is used by ASIHTTPRequest whenever we have a request body, and handles measuring and throttling the bandwidth used for uploading - -@interface ASIInputStream : NSObject { - NSInputStream *stream; - ASIHTTPRequest *request; -} -+ (id)inputStreamWithFileAtPath:(NSString *)path request:(ASIHTTPRequest *)request; -+ (id)inputStreamWithData:(NSData *)data request:(ASIHTTPRequest *)request; - -@property (retain, nonatomic) NSInputStream *stream; -@property (assign, nonatomic) ASIHTTPRequest *request; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIInputStream.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIInputStream.m deleted file mode 100644 index d2b84288..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIInputStream.m +++ /dev/null @@ -1,138 +0,0 @@ -// -// ASIInputStream.m -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 10/08/2009. -// Copyright 2009 All-Seeing Interactive. All rights reserved. -// - -#import "ASIInputStream.h" -#import "ASIHTTPRequest.h" - -// Used to ensure only one request can read data at once -static NSLock *readLock = nil; - -@implementation ASIInputStream - -+ (void)initialize -{ - if (self == [ASIInputStream class]) { - readLock = [[NSLock alloc] init]; - } -} - -+ (id)inputStreamWithFileAtPath:(NSString *)path request:(ASIHTTPRequest *)theRequest -{ - ASIInputStream *theStream = [[[self alloc] init] autorelease]; - [theStream setRequest:theRequest]; - [theStream setStream:[NSInputStream inputStreamWithFileAtPath:path]]; - return theStream; -} - -+ (id)inputStreamWithData:(NSData *)data request:(ASIHTTPRequest *)theRequest -{ - ASIInputStream *theStream = [[[self alloc] init] autorelease]; - [theStream setRequest:theRequest]; - [theStream setStream:[NSInputStream inputStreamWithData:data]]; - return theStream; -} - -- (void)dealloc -{ - [stream release]; - [super dealloc]; -} - -// Called when CFNetwork wants to read more of our request body -// When throttling is on, we ask ASIHTTPRequest for the maximum amount of data we can read -- (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len -{ - [readLock lock]; - unsigned long toRead = len; - if ([ASIHTTPRequest isBandwidthThrottled]) { - toRead = [ASIHTTPRequest maxUploadReadLength]; - if (toRead > len) { - toRead = len; - } else if (toRead == 0) { - toRead = 1; - } - [request performThrottling]; - } - [readLock unlock]; - NSInteger rv = [stream read:buffer maxLength:toRead]; - if (rv > 0) - [ASIHTTPRequest incrementBandwidthUsedInLastSecond:rv]; - return rv; -} - -/* - * Implement NSInputStream mandatory methods to make sure they are implemented - * (necessary for MacRuby for example) and avoid the overhead of method - * forwarding for these common methods. - */ -- (void)open -{ - [stream open]; -} - -- (void)close -{ - [stream close]; -} - -- (id)delegate -{ - return [stream delegate]; -} - -- (void)setDelegate:(id)delegate -{ - [stream setDelegate:delegate]; -} - -- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode -{ - [stream scheduleInRunLoop:aRunLoop forMode:mode]; -} - -- (void)removeFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode -{ - [stream removeFromRunLoop:aRunLoop forMode:mode]; -} - -- (id)propertyForKey:(NSString *)key -{ - return [stream propertyForKey:key]; -} - -- (BOOL)setProperty:(id)property forKey:(NSString *)key -{ - return [stream setProperty:property forKey:key]; -} - -- (NSStreamStatus)streamStatus -{ - return [stream streamStatus]; -} - -- (NSError *)streamError -{ - return [stream streamError]; -} - -// If we get asked to perform a method we don't have (probably internal ones), -// we'll just forward the message to our stream - -- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector -{ - return [stream methodSignatureForSelector:aSelector]; -} - -- (void)forwardInvocation:(NSInvocation *)anInvocation -{ - [anInvocation invokeWithTarget:stream]; -} - -@synthesize stream; -@synthesize request; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASINetworkQueue.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASINetworkQueue.h deleted file mode 100644 index 787f391e..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASINetworkQueue.h +++ /dev/null @@ -1,108 +0,0 @@ -// -// ASINetworkQueue.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 07/11/2008. -// Copyright 2008-2009 All-Seeing Interactive. All rights reserved. -// - -#import -#import "ASIHTTPRequestDelegate.h" -#import "ASIProgressDelegate.h" - -@interface ASINetworkQueue : NSOperationQueue { - - // Delegate will get didFail + didFinish messages (if set) - id delegate; - - // Will be called when a request starts with the request as the argument - SEL requestDidStartSelector; - - // Will be called when a request receives response headers - // Should take the form request:didRecieveResponseHeaders:, where the first argument is the request, and the second the headers dictionary - SEL requestDidReceiveResponseHeadersSelector; - - // Will be called when a request is about to redirect - // Should take the form request:willRedirectToURL:, where the first argument is the request, and the second the new url - SEL requestWillRedirectSelector; - - // Will be called when a request completes with the request as the argument - SEL requestDidFinishSelector; - - // Will be called when a request fails with the request as the argument - SEL requestDidFailSelector; - - // Will be called when the queue finishes with the queue as the argument - SEL queueDidFinishSelector; - - // Upload progress indicator, probably an NSProgressIndicator or UIProgressView - id uploadProgressDelegate; - - // Total amount uploaded so far for all requests in this queue - unsigned long long bytesUploadedSoFar; - - // Total amount to be uploaded for all requests in this queue - requests add to this figure as they work out how much data they have to transmit - unsigned long long totalBytesToUpload; - - // Download progress indicator, probably an NSProgressIndicator or UIProgressView - id downloadProgressDelegate; - - // Total amount downloaded so far for all requests in this queue - unsigned long long bytesDownloadedSoFar; - - // Total amount to be downloaded for all requests in this queue - requests add to this figure as they receive Content-Length headers - unsigned long long totalBytesToDownload; - - // When YES, the queue will cancel all requests when a request fails. Default is YES - BOOL shouldCancelAllRequestsOnFailure; - - //Number of real requests (excludes HEAD requests created to manage showAccurateProgress) - int requestsCount; - - // When NO, this request will only update the progress indicator when it completes - // When YES, this request will update the progress indicator according to how much data it has received so far - // When YES, the queue will first perform HEAD requests for all GET requests in the queue, so it can calculate the total download size before it starts - // NO means better performance, because it skips this step for GET requests, and it won't waste time updating the progress indicator until a request completes - // Set to YES if the size of a requests in the queue varies greatly for much more accurate results - // Default for requests in the queue is NO - BOOL showAccurateProgress; - - // Storage container for additional queue information. - NSDictionary *userInfo; - -} - -// Convenience constructor -+ (id)queue; - -// Call this to reset a queue - it will cancel all operations, clear delegates, and suspend operation -- (void)reset; - -// Used internally to manage HEAD requests when showAccurateProgress is YES, do not use! -- (void)addHEADOperation:(NSOperation *)operation; - -// All ASINetworkQueues are paused when created so that total size can be calculated before the queue starts -// This method will start the queue -- (void)go; - -@property (assign, nonatomic, setter=setUploadProgressDelegate:) id uploadProgressDelegate; -@property (assign, nonatomic, setter=setDownloadProgressDelegate:) id downloadProgressDelegate; - -@property (assign) SEL requestDidStartSelector; -@property (assign) SEL requestDidReceiveResponseHeadersSelector; -@property (assign) SEL requestWillRedirectSelector; -@property (assign) SEL requestDidFinishSelector; -@property (assign) SEL requestDidFailSelector; -@property (assign) SEL queueDidFinishSelector; -@property (assign) BOOL shouldCancelAllRequestsOnFailure; -@property (assign) id delegate; -@property (assign) BOOL showAccurateProgress; -@property (assign, readonly) int requestsCount; -@property (retain) NSDictionary *userInfo; - -@property (assign) unsigned long long bytesUploadedSoFar; -@property (assign) unsigned long long totalBytesToUpload; -@property (assign) unsigned long long bytesDownloadedSoFar; -@property (assign) unsigned long long totalBytesToDownload; - -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASINetworkQueue.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASINetworkQueue.m deleted file mode 100644 index b24076db..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASINetworkQueue.m +++ /dev/null @@ -1,343 +0,0 @@ -// -// ASINetworkQueue.m -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 07/11/2008. -// Copyright 2008-2009 All-Seeing Interactive. All rights reserved. -// - -#import "ASINetworkQueue.h" -#import "ASIHTTPRequest.h" - -// Private stuff -@interface ASINetworkQueue () - - (void)resetProgressDelegate:(id *)progressDelegate; - @property (assign) int requestsCount; -@end - -@implementation ASINetworkQueue - -- (id)init -{ - self = [super init]; - [self setShouldCancelAllRequestsOnFailure:YES]; - [self setMaxConcurrentOperationCount:4]; - [self setSuspended:YES]; - - return self; -} - -+ (id)queue -{ - return [[[self alloc] init] autorelease]; -} - -- (void)dealloc -{ - //We need to clear the queue on any requests that haven't got around to cleaning up yet, as otherwise they'll try to let us know if something goes wrong, and we'll be long gone by then - for (ASIHTTPRequest *request in [self operations]) { - [request setQueue:nil]; - } - [userInfo release]; - [super dealloc]; -} - -- (void)setSuspended:(BOOL)suspend -{ - [super setSuspended:suspend]; -} - -- (void)reset -{ - [self cancelAllOperations]; - [self setDelegate:nil]; - [self setDownloadProgressDelegate:nil]; - [self setUploadProgressDelegate:nil]; - [self setRequestDidStartSelector:NULL]; - [self setRequestDidReceiveResponseHeadersSelector:NULL]; - [self setRequestDidFailSelector:NULL]; - [self setRequestDidFinishSelector:NULL]; - [self setQueueDidFinishSelector:NULL]; - [self setSuspended:YES]; -} - - -- (void)go -{ - [self setSuspended:NO]; -} - -- (void)cancelAllOperations -{ - [self setBytesUploadedSoFar:0]; - [self setTotalBytesToUpload:0]; - [self setBytesDownloadedSoFar:0]; - [self setTotalBytesToDownload:0]; - [super cancelAllOperations]; -} - -- (void)setUploadProgressDelegate:(id)newDelegate -{ - uploadProgressDelegate = newDelegate; - [self resetProgressDelegate:&uploadProgressDelegate]; - -} - -- (void)setDownloadProgressDelegate:(id)newDelegate -{ - downloadProgressDelegate = newDelegate; - [self resetProgressDelegate:&downloadProgressDelegate]; -} - -- (void)resetProgressDelegate:(id *)progressDelegate -{ -#if !TARGET_OS_IPHONE - // If the uploadProgressDelegate is an NSProgressIndicator, we set its MaxValue to 1.0 so we can treat it similarly to UIProgressViews - SEL selector = @selector(setMaxValue:); - if ([*progressDelegate respondsToSelector:selector]) { - double max = 1.0; - [ASIHTTPRequest performSelector:selector onTarget:progressDelegate withObject:nil amount:&max callerToRetain:nil]; - } - selector = @selector(setDoubleValue:); - if ([*progressDelegate respondsToSelector:selector]) { - double value = 0.0; - [ASIHTTPRequest performSelector:selector onTarget:progressDelegate withObject:nil amount:&value callerToRetain:nil]; - } -#else - SEL selector = @selector(setProgress:); - if ([*progressDelegate respondsToSelector:selector]) { - float value = 0.0f; - [ASIHTTPRequest performSelector:selector onTarget:progressDelegate withObject:nil amount:&value callerToRetain:nil]; - } -#endif -} - -- (void)addHEADOperation:(NSOperation *)operation -{ - if ([operation isKindOfClass:[ASIHTTPRequest class]]) { - - ASIHTTPRequest *request = (ASIHTTPRequest *)operation; - [request setRequestMethod:@"HEAD"]; - [request setQueuePriority:10]; - [request setShowAccurateProgress:YES]; - [request setQueue:self]; - - // Important - we are calling NSOperation's add method - we don't want to add this as a normal request! - [super addOperation:request]; - } -} - -// Only add ASIHTTPRequests to this queue!! -- (void)addOperation:(NSOperation *)operation -{ - if (![operation isKindOfClass:[ASIHTTPRequest class]]) { - [NSException raise:@"AttemptToAddInvalidRequest" format:@"Attempted to add an object that was not an ASIHTTPRequest to an ASINetworkQueue"]; - } - - [self setRequestsCount:[self requestsCount]+1]; - - ASIHTTPRequest *request = (ASIHTTPRequest *)operation; - - if ([self showAccurateProgress]) { - - // Force the request to build its body (this may change requestMethod) - [request buildPostBody]; - - // If this is a GET request and we want accurate progress, perform a HEAD request first to get the content-length - // We'll only do this before the queue is started - // If requests are added after the queue is started they will probably move the overall progress backwards anyway, so there's no value performing the HEAD requests first - // Instead, they'll update the total progress if and when they receive a content-length header - if ([[request requestMethod] isEqualToString:@"GET"]) { - if ([self isSuspended]) { - ASIHTTPRequest *HEADRequest = [request HEADRequest]; - [self addHEADOperation:HEADRequest]; - [request addDependency:HEADRequest]; - if ([request shouldResetDownloadProgress]) { - [self resetProgressDelegate:&downloadProgressDelegate]; - [request setShouldResetDownloadProgress:NO]; - } - } - } - [request buildPostBody]; - [self request:nil incrementUploadSizeBy:[request postLength]]; - - - } else { - [self request:nil incrementDownloadSizeBy:1]; - [self request:nil incrementUploadSizeBy:1]; - } - // Tell the request not to increment the upload size when it starts, as we've already added its length - if ([request shouldResetUploadProgress]) { - [self resetProgressDelegate:&uploadProgressDelegate]; - [request setShouldResetUploadProgress:NO]; - } - - [request setShowAccurateProgress:[self showAccurateProgress]]; - - [request setQueue:self]; - [super addOperation:request]; - -} - -- (void)requestStarted:(ASIHTTPRequest *)request -{ - if ([self requestDidStartSelector]) { - [[self delegate] performSelector:[self requestDidStartSelector] withObject:request]; - } -} - -- (void)request:(ASIHTTPRequest *)request didReceiveResponseHeaders:(NSDictionary *)responseHeaders -{ - if ([self requestDidReceiveResponseHeadersSelector]) { - [[self delegate] performSelector:[self requestDidReceiveResponseHeadersSelector] withObject:request withObject:responseHeaders]; - } -} - -- (void)request:(ASIHTTPRequest *)request willRedirectToURL:(NSURL *)newURL -{ - if ([self requestWillRedirectSelector]) { - [[self delegate] performSelector:[self requestWillRedirectSelector] withObject:request withObject:newURL]; - } -} - -- (void)requestFinished:(ASIHTTPRequest *)request -{ - [self setRequestsCount:[self requestsCount]-1]; - if ([self requestDidFinishSelector]) { - [[self delegate] performSelector:[self requestDidFinishSelector] withObject:request]; - } - if ([self requestsCount] == 0) { - if ([self queueDidFinishSelector]) { - [[self delegate] performSelector:[self queueDidFinishSelector] withObject:self]; - } - } -} - -- (void)requestFailed:(ASIHTTPRequest *)request -{ - [self setRequestsCount:[self requestsCount]-1]; - if ([self requestDidFailSelector]) { - [[self delegate] performSelector:[self requestDidFailSelector] withObject:request]; - } - if ([self requestsCount] == 0) { - if ([self queueDidFinishSelector]) { - [[self delegate] performSelector:[self queueDidFinishSelector] withObject:self]; - } - } - if ([self shouldCancelAllRequestsOnFailure] && [self requestsCount] > 0) { - [self cancelAllOperations]; - } - -} - - -- (void)request:(ASIHTTPRequest *)request didReceiveBytes:(long long)bytes -{ - [self setBytesDownloadedSoFar:[self bytesDownloadedSoFar]+bytes]; - if ([self downloadProgressDelegate]) { - [ASIHTTPRequest updateProgressIndicator:&downloadProgressDelegate withProgress:[self bytesDownloadedSoFar] ofTotal:[self totalBytesToDownload]]; - } -} - -- (void)request:(ASIHTTPRequest *)request didSendBytes:(long long)bytes -{ - [self setBytesUploadedSoFar:[self bytesUploadedSoFar]+bytes]; - if ([self uploadProgressDelegate]) { - [ASIHTTPRequest updateProgressIndicator:&uploadProgressDelegate withProgress:[self bytesUploadedSoFar] ofTotal:[self totalBytesToUpload]]; - } -} - -- (void)request:(ASIHTTPRequest *)request incrementDownloadSizeBy:(long long)newLength -{ - [self setTotalBytesToDownload:[self totalBytesToDownload]+newLength]; -} - -- (void)request:(ASIHTTPRequest *)request incrementUploadSizeBy:(long long)newLength -{ - [self setTotalBytesToUpload:[self totalBytesToUpload]+newLength]; -} - - -// Since this queue takes over as the delegate for all requests it contains, it should forward authorisation requests to its own delegate -- (void)authenticationNeededForRequest:(ASIHTTPRequest *)request -{ - if ([[self delegate] respondsToSelector:@selector(authenticationNeededForRequest:)]) { - [[self delegate] performSelector:@selector(authenticationNeededForRequest:) withObject:request]; - } -} - -- (void)proxyAuthenticationNeededForRequest:(ASIHTTPRequest *)request -{ - if ([[self delegate] respondsToSelector:@selector(proxyAuthenticationNeededForRequest:)]) { - [[self delegate] performSelector:@selector(proxyAuthenticationNeededForRequest:) withObject:request]; - } -} - - -- (BOOL)respondsToSelector:(SEL)selector -{ - // We handle certain methods differently because whether our delegate implements them or not can affect how the request should behave - - // If the delegate implements this, the request will stop to wait for credentials - if (selector == @selector(authenticationNeededForRequest:)) { - if ([[self delegate] respondsToSelector:@selector(authenticationNeededForRequest:)]) { - return YES; - } - return NO; - - // If the delegate implements this, the request will to wait for credentials - } else if (selector == @selector(proxyAuthenticationNeededForRequest:)) { - if ([[self delegate] respondsToSelector:@selector(proxyAuthenticationNeededForRequest:)]) { - return YES; - } - return NO; - - // If the delegate implements requestWillRedirectSelector, the request will stop to allow the delegate to change the url - } else if (selector == @selector(request:willRedirectToURL:)) { - if ([self requestWillRedirectSelector] && [[self delegate] respondsToSelector:[self requestWillRedirectSelector]]) { - return YES; - } - return NO; - } - return [super respondsToSelector:selector]; -} - -#pragma mark NSCopying - -- (id)copyWithZone:(NSZone *)zone -{ - ASINetworkQueue *newQueue = [[[self class] alloc] init]; - [newQueue setDelegate:[self delegate]]; - [newQueue setRequestDidStartSelector:[self requestDidStartSelector]]; - [newQueue setRequestWillRedirectSelector:[self requestWillRedirectSelector]]; - [newQueue setRequestDidReceiveResponseHeadersSelector:[self requestDidReceiveResponseHeadersSelector]]; - [newQueue setRequestDidFinishSelector:[self requestDidFinishSelector]]; - [newQueue setRequestDidFailSelector:[self requestDidFailSelector]]; - [newQueue setQueueDidFinishSelector:[self queueDidFinishSelector]]; - [newQueue setUploadProgressDelegate:[self uploadProgressDelegate]]; - [newQueue setDownloadProgressDelegate:[self downloadProgressDelegate]]; - [newQueue setShouldCancelAllRequestsOnFailure:[self shouldCancelAllRequestsOnFailure]]; - [newQueue setShowAccurateProgress:[self showAccurateProgress]]; - [newQueue setUserInfo:[[[self userInfo] copyWithZone:zone] autorelease]]; - return newQueue; -} - - -@synthesize requestsCount; -@synthesize bytesUploadedSoFar; -@synthesize totalBytesToUpload; -@synthesize bytesDownloadedSoFar; -@synthesize totalBytesToDownload; -@synthesize shouldCancelAllRequestsOnFailure; -@synthesize uploadProgressDelegate; -@synthesize downloadProgressDelegate; -@synthesize requestDidStartSelector; -@synthesize requestDidReceiveResponseHeadersSelector; -@synthesize requestWillRedirectSelector; -@synthesize requestDidFinishSelector; -@synthesize requestDidFailSelector; -@synthesize queueDidFinishSelector; -@synthesize delegate; -@synthesize showAccurateProgress; -@synthesize userInfo; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIProgressDelegate.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIProgressDelegate.h deleted file mode 100644 index e2bb0cf4..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIProgressDelegate.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// ASIProgressDelegate.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 13/04/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// - -@class ASIHTTPRequest; - -@protocol ASIProgressDelegate - -@optional - -// These methods are used to update UIProgressViews (iPhone OS) or NSProgressIndicators (Mac OS X) -// If you are using a custom progress delegate, you may find it easier to implement didReceiveBytes / didSendBytes instead -#if TARGET_OS_IPHONE -- (void)setProgress:(float)newProgress; -#else -- (void)setDoubleValue:(double)newProgress; -- (void)setMaxValue:(double)newMax; -#endif - -// Called when the request receives some data - bytes is the length of that data -- (void)request:(ASIHTTPRequest *)request didReceiveBytes:(long long)bytes; - -// Called when the request sends some data -// The first 32KB (128KB on older platforms) of data sent is not included in this amount because of limitations with the CFNetwork API -// bytes may be less than zero if a request needs to remove upload progress (probably because the request needs to run again) -- (void)request:(ASIHTTPRequest *)request didSendBytes:(long long)bytes; - -// Called when a request needs to change the length of the content to download -- (void)request:(ASIHTTPRequest *)request incrementDownloadSizeBy:(long long)newLength; - -// Called when a request needs to change the length of the content to upload -// newLength may be less than zero when a request needs to remove the size of the internal buffer from progress tracking -- (void)request:(ASIHTTPRequest *)request incrementUploadSizeBy:(long long)newLength; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIWebPageRequest/ASIWebPageRequest.h b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIWebPageRequest/ASIWebPageRequest.h deleted file mode 100644 index b82f4408..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIWebPageRequest/ASIWebPageRequest.h +++ /dev/null @@ -1,80 +0,0 @@ -// -// ASIWebPageRequest.h -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 29/06/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// -// This is an EXPERIMENTAL class - use at your own risk! -// It is strongly recommend to set a downloadDestinationPath when using ASIWebPageRequest -// Also, performance will be better if your ASIWebPageRequest has a downloadCache setup -// Known issue: You cannot use startSychronous with an ASIWebPageRequest - -#import "ASIHTTPRequest.h" - -@class ASINetworkQueue; - -// Used internally for storing what type of data we got from the server -typedef enum _ASIWebContentType { - ASINotParsedWebContentType = 0, - ASIHTMLWebContentType = 1, - ASICSSWebContentType = 2 -} ASIWebContentType; - -// These correspond with the urlReplacementMode property of ASIWebPageRequest -typedef enum _ASIURLReplacementMode { - - // Don't modify html or css content at all - ASIDontModifyURLs = 0, - - // Replace external resources urls (images, stylesheets etc) with data uris, so their content is embdedded directly in the html/css - ASIReplaceExternalResourcesWithData = 1, - - // Replace external resource urls with the url of locally cached content - // You must set the baseURL of a WebView / UIWebView to a file url pointing at the downloadDestinationPath of the main ASIWebPageRequest if you want to display your content - // See the Mac or iPhone example projects for a demonstration of how to do this - // The hrefs of all hyperlinks are changed to use absolute urls when using this mode - ASIReplaceExternalResourcesWithLocalURLs = 2 -} ASIURLReplacementMode; - - - -@interface ASIWebPageRequest : ASIHTTPRequest { - - // Each ASIWebPageRequest for an HTML or CSS file creates its own internal queue to download external resources - ASINetworkQueue *externalResourceQueue; - - // This dictionary stores a list of external resources to download, along with their content-type data or a path to the data - NSMutableDictionary *resourceList; - - // Used internally for parsing HTML (with libxml) - struct _xmlDoc *doc; - - // If the response is an HTML or CSS file, this will be set so the content can be correctly parsed when it has finished fetching external resources - ASIWebContentType webContentType; - - // Stores a reference to the ASIWebPageRequest that created this request - // Note that a parentRequest can also have a parent request because ASIWebPageRequests parse their contents to look for external resources recursively - // For example, a request for an image can be created by a request for a stylesheet which was created by a request for a web page - ASIWebPageRequest *parentRequest; - - // Controls what ASIWebPageRequest does with external resources. See the notes above for more. - ASIURLReplacementMode urlReplacementMode; - - // When set to NO, loading will stop when an external resource fails to load. Defaults to YES - BOOL shouldIgnoreExternalResourceErrors; -} - -// Will return a data URI that contains a base64 version of the content at this url -// This is used when replacing urls in the html and css with actual data -// If you subclass ASIWebPageRequest, you can override this function to return different content or a url pointing at another location -- (NSString *)contentForExternalURL:(NSString *)theURL; - -// Returns the location that a downloaded external resource's content will be stored in -- (NSString *)cachePathForRequest:(ASIWebPageRequest *)theRequest; - - -@property (retain, nonatomic) ASIWebPageRequest *parentRequest; -@property (assign, nonatomic) ASIURLReplacementMode urlReplacementMode; -@property (assign, nonatomic) BOOL shouldIgnoreExternalResourceErrors; -@end diff --git a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIWebPageRequest/ASIWebPageRequest.m b/iOSProject/Pods/ASIHTTPRequest/Classes/ASIWebPageRequest/ASIWebPageRequest.m deleted file mode 100644 index eccac6a8..00000000 --- a/iOSProject/Pods/ASIHTTPRequest/Classes/ASIWebPageRequest/ASIWebPageRequest.m +++ /dev/null @@ -1,722 +0,0 @@ -// -// ASIWebPageRequest.m -// Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest -// -// Created by Ben Copsey on 29/06/2010. -// Copyright 2010 All-Seeing Interactive. All rights reserved. -// -// This is an EXPERIMENTAL class - use at your own risk! - -#import "ASIWebPageRequest.h" -#import "ASINetworkQueue.h" -#import -#import -#import -#import -#import - -// An xPath query that controls the external resources ASIWebPageRequest will fetch -// By default, it will fetch stylesheets, javascript files, images, frames, iframes, and html 5 video / audio -static xmlChar *xpathExpr = (xmlChar *)"//link/@href|//a/@href|//script/@src|//img/@src|//frame/@src|//iframe/@src|//style|//*/@style|//source/@src|//video/@poster|//audio/@src"; - -static NSLock *xmlParsingLock = nil; -static NSMutableArray *requestsUsingXMLParser = nil; - -@interface ASIWebPageRequest () -- (void)readResourceURLs; -- (void)updateResourceURLs; -- (void)parseAsHTML; -- (void)parseAsCSS; -- (void)addURLToFetch:(NSString *)newURL; -+ (NSArray *)CSSURLsFromString:(NSString *)string; -- (NSString *)relativePathTo:(NSString *)destinationPath fromPath:(NSString *)sourcePath; - -- (void)finishedFetchingExternalResources:(ASINetworkQueue *)queue; -- (void)externalResourceFetchSucceeded:(ASIHTTPRequest *)externalResourceRequest; -- (void)externalResourceFetchFailed:(ASIHTTPRequest *)externalResourceRequest; - -@property (retain, nonatomic) ASINetworkQueue *externalResourceQueue; -@property (retain, nonatomic) NSMutableDictionary *resourceList; -@end - -@implementation ASIWebPageRequest - -+ (void)initialize -{ - if (self == [ASIWebPageRequest class]) { - xmlParsingLock = [[NSLock alloc] init]; - requestsUsingXMLParser = [[NSMutableArray alloc] init]; - } -} - -- (id)initWithURL:(NSURL *)newURL -{ - self = [super initWithURL:newURL]; - [self setShouldIgnoreExternalResourceErrors:YES]; - return self; -} - -- (void)dealloc -{ - [externalResourceQueue cancelAllOperations]; - [externalResourceQueue release]; - [resourceList release]; - [parentRequest release]; - [super dealloc]; -} - -// This is a bit of a hack -// The role of this method in normal ASIHTTPRequests is to tell the queue we are done with the request, and perform some cleanup -// We override it to stop that happening, and instead do that work in the bottom of finishedFetchingExternalResources: -- (void)markAsFinished -{ - if ([self error]) { - [super markAsFinished]; - } -} - -// This method is normally responsible for telling delegates we are done, but it happens to be the most convenient place to parse the responses -// Again, we call the super implementation in finishedFetchingExternalResources:, or here if this download was not an HTML or CSS file -- (void)requestFinished -{ - complete = NO; - if ([self mainRequest] || [self didUseCachedResponse]) { - [super requestFinished]; - [super markAsFinished]; - return; - } - webContentType = ASINotParsedWebContentType; - NSString *contentType = [[[self responseHeaders] objectForKey:@"Content-Type"] lowercaseString]; - contentType = [[contentType componentsSeparatedByString:@";"] objectAtIndex:0]; - if ([contentType isEqualToString:@"text/html"] || [contentType isEqualToString:@"text/xhtml"] || [contentType isEqualToString:@"text/xhtml+xml"] || [contentType isEqualToString:@"application/xhtml+xml"]) { - [self parseAsHTML]; - return; - } else if ([contentType isEqualToString:@"text/css"]) { - [self parseAsCSS]; - return; - } - [super requestFinished]; - [super markAsFinished]; -} - -- (void)parseAsCSS -{ - webContentType = ASICSSWebContentType; - - NSString *responseCSS = nil; - NSError *err = nil; - if ([self downloadDestinationPath]) { - responseCSS = [NSString stringWithContentsOfFile:[self downloadDestinationPath] encoding:[self responseEncoding] error:&err]; - } else { - responseCSS = [self responseString]; - } - if (err) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:100 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Unable to read HTML string from response",NSLocalizedDescriptionKey,err,NSUnderlyingErrorKey,nil]]]; - return; - } else if (!responseCSS) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:100 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Unable to read HTML string from response",NSLocalizedDescriptionKey,nil]]]; - return; - } - NSArray *urls = [[self class] CSSURLsFromString:responseCSS]; - - [self setResourceList:[NSMutableDictionary dictionary]]; - - for (NSString *theURL in urls) { - [self addURLToFetch:theURL]; - } - if (![[self resourceList] count]) { - [super requestFinished]; - [super markAsFinished]; - return; - } - - // Create a new request for every item in the queue - [[self externalResourceQueue] cancelAllOperations]; - [self setExternalResourceQueue:[ASINetworkQueue queue]]; - [[self externalResourceQueue] setDelegate:self]; - [[self externalResourceQueue] setShouldCancelAllRequestsOnFailure:[self shouldIgnoreExternalResourceErrors]]; - [[self externalResourceQueue] setShowAccurateProgress:[self showAccurateProgress]]; - [[self externalResourceQueue] setQueueDidFinishSelector:@selector(finishedFetchingExternalResources:)]; - [[self externalResourceQueue] setRequestDidFinishSelector:@selector(externalResourceFetchSucceeded:)]; - [[self externalResourceQueue] setRequestDidFailSelector:@selector(externalResourceFetchFailed:)]; - for (NSString *theURL in [[self resourceList] keyEnumerator]) { - ASIWebPageRequest *externalResourceRequest = [ASIWebPageRequest requestWithURL:[NSURL URLWithString:theURL relativeToURL:[self url]]]; - [externalResourceRequest setRequestHeaders:[self requestHeaders]]; - [externalResourceRequest setDownloadCache:[self downloadCache]]; - [externalResourceRequest setCachePolicy:[self cachePolicy]]; - [externalResourceRequest setCacheStoragePolicy:[self cacheStoragePolicy]]; - [externalResourceRequest setUserInfo:[NSDictionary dictionaryWithObject:theURL forKey:@"Path"]]; - [externalResourceRequest setParentRequest:self]; - [externalResourceRequest setUrlReplacementMode:[self urlReplacementMode]]; - [externalResourceRequest setShouldResetDownloadProgress:NO]; - [externalResourceRequest setDelegate:self]; - [externalResourceRequest setUploadProgressDelegate:self]; - [externalResourceRequest setDownloadProgressDelegate:self]; - if ([self downloadDestinationPath]) { - [externalResourceRequest setDownloadDestinationPath:[self cachePathForRequest:externalResourceRequest]]; - } - [[self externalResourceQueue] addOperation:externalResourceRequest]; - } - [[self externalResourceQueue] go]; -} - -- (const char *)encodingName -{ - xmlCharEncoding encoding = XML_CHAR_ENCODING_NONE; - switch ([self responseEncoding]) - { - case NSASCIIStringEncoding: - encoding = XML_CHAR_ENCODING_ASCII; - break; - case NSJapaneseEUCStringEncoding: - encoding = XML_CHAR_ENCODING_EUC_JP; - break; - case NSUTF8StringEncoding: - encoding = XML_CHAR_ENCODING_UTF8; - break; - case NSISOLatin1StringEncoding: - encoding = XML_CHAR_ENCODING_8859_1; - break; - case NSShiftJISStringEncoding: - encoding = XML_CHAR_ENCODING_SHIFT_JIS; - break; - case NSISOLatin2StringEncoding: - encoding = XML_CHAR_ENCODING_8859_2; - break; - case NSISO2022JPStringEncoding: - encoding = XML_CHAR_ENCODING_2022_JP; - break; - case NSUTF16BigEndianStringEncoding: - encoding = XML_CHAR_ENCODING_UTF16BE; - break; - case NSUTF16LittleEndianStringEncoding: - encoding = XML_CHAR_ENCODING_UTF16LE; - break; - case NSUTF32BigEndianStringEncoding: - encoding = XML_CHAR_ENCODING_UCS4BE; - break; - case NSUTF32LittleEndianStringEncoding: - encoding = XML_CHAR_ENCODING_UCS4LE; - break; - case NSNEXTSTEPStringEncoding: - case NSSymbolStringEncoding: - case NSNonLossyASCIIStringEncoding: - case NSUnicodeStringEncoding: - case NSMacOSRomanStringEncoding: - case NSUTF32StringEncoding: - default: - encoding = XML_CHAR_ENCODING_ERROR; - break; - } - return xmlGetCharEncodingName(encoding); -} - -- (void)parseAsHTML -{ - webContentType = ASIHTMLWebContentType; - - // Only allow parsing of a single document at a time - [xmlParsingLock lock]; - - if (![requestsUsingXMLParser count]) { - xmlInitParser(); - } - [requestsUsingXMLParser addObject:self]; - - - /* Load XML document */ - if ([self downloadDestinationPath]) { - doc = htmlReadFile([[self downloadDestinationPath] cStringUsingEncoding:NSUTF8StringEncoding], [self encodingName], HTML_PARSE_NONET | HTML_PARSE_NOWARNING | HTML_PARSE_NOERROR); - } else { - NSData *data = [self responseData]; - doc = htmlReadMemory([data bytes], (int)[data length], "", [self encodingName], HTML_PARSE_NONET | HTML_PARSE_NOWARNING | HTML_PARSE_NOERROR); - } - if (doc == NULL) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:101 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Error: unable to parse reponse XML",NSLocalizedDescriptionKey,nil]]]; - return; - } - - [self setResourceList:[NSMutableDictionary dictionary]]; - - // Populate the list of URLS to download - [self readResourceURLs]; - - if ([self error] || ![[self resourceList] count]) { - [requestsUsingXMLParser removeObject:self]; - xmlFreeDoc(doc); - doc = NULL; - } - - [xmlParsingLock unlock]; - - if ([self error]) { - return; - } else if (![[self resourceList] count]) { - [super requestFinished]; - [super markAsFinished]; - return; - } - - // Create a new request for every item in the queue - [[self externalResourceQueue] cancelAllOperations]; - [self setExternalResourceQueue:[ASINetworkQueue queue]]; - [[self externalResourceQueue] setDelegate:self]; - [[self externalResourceQueue] setShouldCancelAllRequestsOnFailure:[self shouldIgnoreExternalResourceErrors]]; - [[self externalResourceQueue] setShowAccurateProgress:[self showAccurateProgress]]; - [[self externalResourceQueue] setQueueDidFinishSelector:@selector(finishedFetchingExternalResources:)]; - [[self externalResourceQueue] setRequestDidFinishSelector:@selector(externalResourceFetchSucceeded:)]; - [[self externalResourceQueue] setRequestDidFailSelector:@selector(externalResourceFetchFailed:)]; - for (NSString *theURL in [[self resourceList] keyEnumerator]) { - ASIWebPageRequest *externalResourceRequest = [ASIWebPageRequest requestWithURL:[NSURL URLWithString:theURL relativeToURL:[self url]]]; - [externalResourceRequest setRequestHeaders:[self requestHeaders]]; - [externalResourceRequest setDownloadCache:[self downloadCache]]; - [externalResourceRequest setCachePolicy:[self cachePolicy]]; - [externalResourceRequest setCacheStoragePolicy:[self cacheStoragePolicy]]; - [externalResourceRequest setUserInfo:[NSDictionary dictionaryWithObject:theURL forKey:@"Path"]]; - [externalResourceRequest setParentRequest:self]; - [externalResourceRequest setUrlReplacementMode:[self urlReplacementMode]]; - [externalResourceRequest setShouldResetDownloadProgress:NO]; - [externalResourceRequest setDelegate:self]; - [externalResourceRequest setUploadProgressDelegate:self]; - [externalResourceRequest setDownloadProgressDelegate:self]; - if ([self downloadDestinationPath]) { - [externalResourceRequest setDownloadDestinationPath:[self cachePathForRequest:externalResourceRequest]]; - } - [[self externalResourceQueue] addOperation:externalResourceRequest]; - } - [[self externalResourceQueue] go]; -} - -- (void)externalResourceFetchSucceeded:(ASIHTTPRequest *)externalResourceRequest -{ - NSString *originalPath = [[externalResourceRequest userInfo] objectForKey:@"Path"]; - NSMutableDictionary *requestResponse = [[self resourceList] objectForKey:originalPath]; - NSString *contentType = [[externalResourceRequest responseHeaders] objectForKey:@"Content-Type"]; - if (!contentType) { - contentType = @"application/octet-stream"; - } - [requestResponse setObject:contentType forKey:@"ContentType"]; - if ([self downloadDestinationPath]) { - [requestResponse setObject:[externalResourceRequest downloadDestinationPath] forKey:@"DataPath"]; - } else { - NSData *data = [externalResourceRequest responseData]; - if (data) { - [requestResponse setObject:data forKey:@"Data"]; - } - } -} - -- (void)externalResourceFetchFailed:(ASIHTTPRequest *)externalResourceRequest -{ - if ([[self externalResourceQueue] shouldCancelAllRequestsOnFailure]) { - [self failWithError:[externalResourceRequest error]]; - } -} - -- (void)finishedFetchingExternalResources:(ASINetworkQueue *)queue -{ - if ([self urlReplacementMode] != ASIDontModifyURLs) { - if (webContentType == ASICSSWebContentType) { - NSMutableString *parsedResponse; - NSError *err = nil; - if ([self downloadDestinationPath]) { - parsedResponse = [NSMutableString stringWithContentsOfFile:[self downloadDestinationPath] encoding:[self responseEncoding] error:&err]; - } else { - parsedResponse = [[[self responseString] mutableCopy] autorelease]; - } - if (err) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:101 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Error: unable to read response CSS from disk",NSLocalizedDescriptionKey,nil]]]; - return; - } - if (![self error]) { - for (NSString *resource in [[self resourceList] keyEnumerator]) { - if ([parsedResponse rangeOfString:resource].location != NSNotFound) { - NSString *newURL = [self contentForExternalURL:resource]; - if (newURL) { - [parsedResponse replaceOccurrencesOfString:resource withString:newURL options:0 range:NSMakeRange(0, [parsedResponse length])]; - } - } - } - } - if ([self downloadDestinationPath]) { - [parsedResponse writeToFile:[self downloadDestinationPath] atomically:NO encoding:[self responseEncoding] error:&err]; - if (err) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:101 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Error: unable to write response CSS to disk",NSLocalizedDescriptionKey,nil]]]; - return; - } - } else { - [self setRawResponseData:(id)[parsedResponse dataUsingEncoding:[self responseEncoding]]]; - } - } else { - [xmlParsingLock lock]; - - [self updateResourceURLs]; - - if (![self error]) { - - // We'll use the xmlsave API so we can strip the xml declaration - xmlSaveCtxtPtr saveContext; - - if ([self downloadDestinationPath]) { - - // Truncate the file first - [[[[NSFileManager alloc] init] autorelease] createFileAtPath:[self downloadDestinationPath] contents:nil attributes:nil]; - - saveContext = xmlSaveToFd([[NSFileHandle fileHandleForWritingAtPath:[self downloadDestinationPath]] fileDescriptor],NULL,2); // 2 == XML_SAVE_NO_DECL, this isn't declared on Mac OS 10.5 - xmlSaveDoc(saveContext, doc); - xmlSaveClose(saveContext); - - } else { - #if TARGET_OS_MAC && MAC_OS_X_VERSION_MAX_ALLOWED <= __MAC_10_5 - // xmlSaveToBuffer() is not implemented in the 10.5 version of libxml - NSString *tempPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]; - [[[[NSFileManager alloc] init] autorelease] createFileAtPath:tempPath contents:nil attributes:nil]; - saveContext = xmlSaveToFd([[NSFileHandle fileHandleForWritingAtPath:tempPath] fileDescriptor],NULL,2); // 2 == XML_SAVE_NO_DECL, this isn't declared on Mac OS 10.5 - xmlSaveDoc(saveContext, doc); - xmlSaveClose(saveContext); - [self setRawResponseData:[NSMutableData dataWithContentsOfFile:tempPath]]; - #else - xmlBufferPtr buffer = xmlBufferCreate(); - saveContext = xmlSaveToBuffer(buffer,NULL,2); // 2 == XML_SAVE_NO_DECL, this isn't declared on Mac OS 10.5 - xmlSaveDoc(saveContext, doc); - xmlSaveClose(saveContext); - [self setRawResponseData:[[[NSMutableData alloc] initWithBytes:buffer->content length:buffer->use] autorelease]]; - xmlBufferFree(buffer); - #endif - } - - // Strip the content encoding if the original response was gzipped - if ([self isResponseCompressed]) { - NSMutableDictionary *headers = [[[self responseHeaders] mutableCopy] autorelease]; - [headers removeObjectForKey:@"Content-Encoding"]; - [self setResponseHeaders:headers]; - } - } - - xmlFreeDoc(doc); - doc = nil; - - [requestsUsingXMLParser removeObject:self]; - if (![requestsUsingXMLParser count]) { - xmlCleanupParser(); - } - [xmlParsingLock unlock]; - } - } - if (![self parentRequest]) { - [[self class] updateProgressIndicator:&downloadProgressDelegate withProgress:contentLength ofTotal:contentLength]; - } - - NSMutableDictionary *newHeaders = [[[self responseHeaders] mutableCopy] autorelease]; - [newHeaders removeObjectForKey:@"Content-Encoding"]; - [self setResponseHeaders:newHeaders]; - - // Write the parsed content back to the cache - if ([self urlReplacementMode] != ASIDontModifyURLs) { - [[self downloadCache] storeResponseForRequest:self maxAge:[self secondsToCache]]; - } - - [super requestFinished]; - [super markAsFinished]; -} - -- (void)readResourceURLs -{ - // Create xpath evaluation context - xmlXPathContextPtr xpathCtx = xmlXPathNewContext(doc); - if(xpathCtx == NULL) { - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:101 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Error: unable to create new XPath context",NSLocalizedDescriptionKey,nil]]]; - return; - } - - // Evaluate xpath expression - xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); - if(xpathObj == NULL) { - xmlXPathFreeContext(xpathCtx); - [self failWithError:[NSError errorWithDomain:NetworkRequestErrorDomain code:101 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Error: unable to evaluate XPath expression!",NSLocalizedDescriptionKey,nil]]]; - return; - } - - // Now loop through our matches - xmlNodeSetPtr nodes = xpathObj->nodesetval; - - int size = (nodes) ? nodes->nodeNr : 0; - int i; - for(i = size - 1; i >= 0; i--) { - assert(nodes->nodeTab[i]); - NSString *parentName = [NSString stringWithCString:(char *)nodes->nodeTab[i]->parent->name encoding:[self responseEncoding]]; - NSString *nodeName = [NSString stringWithCString:(char *)nodes->nodeTab[i]->name encoding:[self responseEncoding]]; - - xmlChar *nodeValue = xmlNodeGetContent(nodes->nodeTab[i]); - NSString *value = [NSString stringWithCString:(char *)nodeValue encoding:[self responseEncoding]]; - xmlFree(nodeValue); - - // Our xpath query matched all elements, but we're only interested in stylesheets - // We do the work here rather than in the xPath query because the query is case-sensitive, and we want to match on 'stylesheet', 'StyleSHEEt' etc - if ([[parentName lowercaseString] isEqualToString:@"link"]) { - xmlChar *relAttribute = xmlGetNoNsProp(nodes->nodeTab[i]->parent,(xmlChar *)"rel"); - if (relAttribute) { - NSString *rel = [NSString stringWithCString:(char *)relAttribute encoding:[self responseEncoding]]; - xmlFree(relAttribute); - if ([[rel lowercaseString] isEqualToString:@"stylesheet"]) { - [self addURLToFetch:value]; - } - } - - // Parse the content of - - - -
    -

    Your browser fingerprint with default settings (canvas, screen resolutin, activeX disabled)

    -

    -
    -
    -

    Your browser fingerprint with canvas enabled is:

    -

    -
    -
    -

    Your browser fingerprint with ie_activex enabled is:

    -

    -
    -
    -

    Your browser fingerprint with screen_resolution enabled is:

    -

    -
    - - - \ No newline at end of file diff --git a/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle/Contents/Resources/fingerprint.js b/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle/Contents/Resources/fingerprint.js deleted file mode 100644 index e1d758af..00000000 --- a/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle/Contents/Resources/fingerprint.js +++ /dev/null @@ -1,285 +0,0 @@ -/* -* fingerprintJS 0.5.4 - Fast browser fingerprint library -* https://github.com/Valve/fingerprintjs -* Copyright (c) 2013 Valentin Vasilyev (valentin.vasilyev@outlook.com) -* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -;(function (name, context, definition) { - if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); } - else if (typeof define === 'function' && define.amd) { define(definition); } - else { context[name] = definition(); } -})('Fingerprint', this, function () { - 'use strict'; - - var Fingerprint = function (options) { - var nativeForEach, nativeMap; - nativeForEach = Array.prototype.forEach; - nativeMap = Array.prototype.map; - - this.each = function (obj, iterator, context) { - if (obj === null) { - return; - } - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === {}) return; - } - } else { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if (iterator.call(context, obj[key], key, obj) === {}) return; - } - } - } - }; - - this.map = function(obj, iterator, context) { - var results = []; - // Not using strict equality so that this acts as a - // shortcut to checking for `null` and `undefined`. - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - this.each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - if (typeof options == 'object'){ - this.hasher = options.hasher; - this.screen_resolution = options.screen_resolution; - this.screen_orientation = options.screen_orientation; - this.canvas = options.canvas; - this.ie_activex = options.ie_activex; - } else if(typeof options == 'function'){ - this.hasher = options; - } - }; - - Fingerprint.prototype = { - get: function(){ - var keys = []; - keys.push(navigator.userAgent); - keys.push(navigator.language); - keys.push(screen.colorDepth); - if (this.screen_resolution) { - var resolution = this.getScreenResolution(); - if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs - keys.push(this.getScreenResolution().join('x')); - } - } - keys.push(new Date().getTimezoneOffset()); - keys.push(this.hasSessionStorage()); - keys.push(this.hasLocalStorage()); - keys.push(!!window.indexedDB); - //body might not be defined at this point or removed programmatically - if(document.body){ - keys.push(typeof(document.body.addBehavior)); - } else { - keys.push(typeof undefined); - } - keys.push(typeof(window.openDatabase)); - keys.push(navigator.cpuClass); - keys.push(navigator.platform); - keys.push(navigator.doNotTrack); - keys.push(this.getPluginsString()); - if(this.canvas && this.isCanvasSupported()){ - keys.push(this.getCanvasFingerprint()); - } - if(this.hasher){ - return this.hasher(keys.join('###'), 31); - } else { - return this.murmurhash3_32_gc(keys.join('###'), 31); - } - }, - - /** - * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011) - * - * @author Gary Court - * @see http://github.com/garycourt/murmurhash-js - * @author Austin Appleby - * @see http://sites.google.com/site/murmurhash/ - * - * @param {string} key ASCII only - * @param {number} seed Positive integer only - * @return {number} 32-bit positive integer hash - */ - - murmurhash3_32_gc: function(key, seed) { - var remainder, bytes, h1, h1b, c1, c2, k1, i; - - remainder = key.length & 3; // key.length % 4 - bytes = key.length - remainder; - h1 = seed; - c1 = 0xcc9e2d51; - c2 = 0x1b873593; - i = 0; - - while (i < bytes) { - k1 = - ((key.charCodeAt(i) & 0xff)) | - ((key.charCodeAt(++i) & 0xff) << 8) | - ((key.charCodeAt(++i) & 0xff) << 16) | - ((key.charCodeAt(++i) & 0xff) << 24); - ++i; - - k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff; - k1 = (k1 << 15) | (k1 >>> 17); - k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); - h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff; - h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16)); - } - - k1 = 0; - - switch (remainder) { - case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16; - case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8; - case 1: k1 ^= (key.charCodeAt(i) & 0xff); - - k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff; - k1 = (k1 << 15) | (k1 >>> 17); - k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff; - h1 ^= k1; - } - - h1 ^= key.length; - - h1 ^= h1 >>> 16; - h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff; - h1 ^= h1 >>> 13; - h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff; - h1 ^= h1 >>> 16; - - return h1 >>> 0; - }, - - // https://bugzilla.mozilla.org/show_bug.cgi?id=781447 - hasLocalStorage: function () { - try{ - return !!window.localStorage; - } catch(e) { - return true; // SecurityError when referencing it means it exists - } - }, - - hasSessionStorage: function () { - try{ - return !!window.sessionStorage; - } catch(e) { - return true; // SecurityError when referencing it means it exists - } - }, - - isCanvasSupported: function () { - var elem = document.createElement('canvas'); - return !!(elem.getContext && elem.getContext('2d')); - }, - - isIE: function () { - if(navigator.appName === 'Microsoft Internet Explorer') { - return true; - } else if(navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)){// IE 11 - return true; - } - return false; - }, - - getPluginsString: function () { - if(this.isIE() && this.ie_activex){ - return this.getIEPluginsString(); - } else { - return this.getRegularPluginsString(); - } - }, - - getRegularPluginsString: function () { - return this.map(navigator.plugins, function (p) { - var mimeTypes = this.map(p, function(mt){ - return [mt.type, mt.suffixes].join('~'); - }).join(','); - return [p.name, p.description, mimeTypes].join('::'); - }, this).join(';'); - }, - - getIEPluginsString: function () { - if(window.ActiveXObject){ - var names = ['ShockwaveFlash.ShockwaveFlash',//flash plugin - 'AcroPDF.PDF', // Adobe PDF reader 7+ - 'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr - 'QuickTime.QuickTime', // QuickTime - // 5 versions of real players - 'rmocx.RealPlayer G2 Control', - 'rmocx.RealPlayer G2 Control.1', - 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)', - 'RealVideo.RealVideo(tm) ActiveX Control (32-bit)', - 'RealPlayer', - 'SWCtl.SWCtl', // ShockWave player - 'WMPlayer.OCX', // Windows media player - 'AgControl.AgControl', // Silverlight - 'Skype.Detection']; - - // starting to detect plugins in IE - return this.map(names, function(name){ - try{ - new ActiveXObject(name); - return name; - } catch(e){ - return null; - } - }).join(';'); - } else { - return ""; // behavior prior version 0.5.0, not breaking backwards compat. - } - }, - - getScreenResolution: function () { - var resolution; - if(this.screen_orientation){ - resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height]; - }else{ - resolution = [screen.height, screen.width]; - } - return resolution; - }, - - getCanvasFingerprint: function () { - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); - // https://www.browserleaks.com/canvas#how-does-it-work - var txt = 'http://valve.github.io/'; - ctx.textBaseline = "top"; - ctx.font = "14px 'Arial'"; - ctx.textBaseline = "alphabetic"; - ctx.fillStyle = "#f60"; - ctx.fillRect(125,1,62,20); - ctx.fillStyle = "#069"; - ctx.fillText(txt, 2, 15); - ctx.fillStyle = "rgba(102, 204, 0, 0.7)"; - ctx.fillText(txt, 4, 17); - return canvas.toDataURL(); - } - }; - - - return Fingerprint; - -}); \ No newline at end of file diff --git a/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle/Contents/Resources/zh-Hans.lproj/MWLocalizable.strings b/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle/Contents/Resources/zh-Hans.lproj/MWLocalizable.strings deleted file mode 100644 index 9ad5f750..00000000 Binary files a/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle/Contents/Resources/zh-Hans.lproj/MWLocalizable.strings and /dev/null differ diff --git a/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/libMagicWindowSDK.a b/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/libMagicWindowSDK.a deleted file mode 100644 index d840a308..00000000 Binary files a/iOSProject/Pods/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/libMagicWindowSDK.a and /dev/null differ diff --git a/iOSProject/Pods/MagicWindowSDK/README.md b/iOSProject/Pods/MagicWindowSDK/README.md deleted file mode 100644 index c6107529..00000000 --- a/iOSProject/Pods/MagicWindowSDK/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# mw-iossdk -魔窗iOS SDK
    -Mirror for Cocoapods
    -官方下载地址:http://documentation.magicwindow.cn/?sdk-ios - -#Installation -pod ‘MagicWindowSDK’ \ No newline at end of file diff --git a/iOSProject/Pods/Manifest.lock b/iOSProject/Pods/Manifest.lock deleted file mode 100644 index 157a6d08..00000000 --- a/iOSProject/Pods/Manifest.lock +++ /dev/null @@ -1,185 +0,0 @@ -PODS: - - AFNetworking (3.1.0): - - AFNetworking/NSURLSession (= 3.1.0) - - AFNetworking/Reachability (= 3.1.0) - - AFNetworking/Security (= 3.1.0) - - AFNetworking/Serialization (= 3.1.0) - - AFNetworking/UIKit (= 3.1.0) - - AFNetworking/NSURLSession (3.1.0): - - AFNetworking/Reachability - - AFNetworking/Security - - AFNetworking/Serialization - - AFNetworking/Reachability (3.1.0) - - AFNetworking/Security (3.1.0) - - AFNetworking/Serialization (3.1.0) - - AFNetworking/UIKit (3.1.0): - - AFNetworking/NSURLSession - - ASIHTTPRequest (1.8.2): - - ASIHTTPRequest/ASIWebPageRequest (= 1.8.2) - - ASIHTTPRequest/CloudFiles (= 1.8.2) - - ASIHTTPRequest/Core (= 1.8.2) - - ASIHTTPRequest/S3 (= 1.8.2) - - ASIHTTPRequest/ASIWebPageRequest (1.8.2): - - ASIHTTPRequest/Core - - ASIHTTPRequest/CloudFiles (1.8.2): - - ASIHTTPRequest/Core - - ASIHTTPRequest/Core (1.8.2): - - Reachability - - ASIHTTPRequest/S3 (1.8.2): - - ASIHTTPRequest/Core - - BaiduMapKit (3.4.2) - - CYLTabBarController (1.17.6) - - DWBubbleMenuButton (1.0.1) - - FCUUID (1.3.1): - - UICKeyChainStore (~> 2.1.0) - - FDFullscreenPopGesture (1.1) - - FMDB (2.7.2): - - FMDB/standard (= 2.7.2) - - FMDB/standard (2.7.2) - - GVUserDefaults (1.0.2) - - HMEmoticon (1.0.12) - - HMQRCodeScanner (1.0.6) - - iflyMSC (1.144) - - IQKeyboardManager (5.0.7) - - KILabel (1.0.1) - - LxGridView (1.0.0) - - M13ProgressSuite (1.2.9) - - MagicWindowSDK (4.2.171115): - - WechatOpenSDK - - Masonry (1.1.0) - - MBProgressHUD (1.1.0) - - MJExtension (3.0.13) - - MJRefresh (3.1.15.1) - - MOFSPickerManager (1.0.6) - - Reachability (3.2) - - SDCycleScrollView (1.75): - - SDWebImage (>= 4.0.0) - - SDWebImage (4.2.3): - - SDWebImage/Core (= 4.2.3) - - SDWebImage/Core (4.2.3) - - TDTouchID (1.0.2) - - Toast (4.0.0) - - TZImagePickerController (1.9.8) - - UICKeyChainStore (2.1.1) - - UMengAnalytics (4.2.4) - - UMengUShare/Core (6.4.8): - - UMengUShare/Network - - UMengUShare/Network (6.4.8) - - UMengUShare/Social/QQ (6.4.8): - - UMengUShare/Core - - UMengUShare/Social/ReducedQQ - - UMengUShare/Social/ReducedQQ (6.4.8): - - UMengUShare/Core - - UMengUShare/Social/ReducedSina (6.4.8): - - UMengUShare/Core - - UMengUShare/Social/ReducedWeChat (6.4.8): - - UMengUShare/Core - - UMengUShare/Social/Sina (6.4.8): - - UMengUShare/Core - - UMengUShare/Social/ReducedSina - - UMengUShare/UI (6.4.8): - - UMengUShare/Core - - WebViewJavascriptBridge (6.0.3) - - WechatOpenSDK (1.8.1) - - YYAsyncLayer (1.0) - - YYCategories (1.0.4): - - YYCategories/no-arc (= 1.0.4) - - YYCategories/no-arc (1.0.4) - - YYImage (1.0.4): - - YYImage/Core (= 1.0.4) - - YYImage/Core (1.0.4) - - YYText (1.0.7) - - ZFDownload (1.0.2): - - ASIHTTPRequest - - ZFPlayer (2.1.5): - - Masonry - - ZJScrollPageView (0.4.0) - -DEPENDENCIES: - - AFNetworking - - ASIHTTPRequest - - BaiduMapKit - - CYLTabBarController - - DWBubbleMenuButton - - FCUUID - - FDFullscreenPopGesture - - FMDB - - GVUserDefaults - - HMEmoticon - - HMQRCodeScanner - - iflyMSC - - IQKeyboardManager - - KILabel - - LxGridView - - M13ProgressSuite - - MagicWindowSDK - - Masonry - - MBProgressHUD - - MJExtension - - MJRefresh - - MOFSPickerManager - - Reachability - - SDCycleScrollView - - SDWebImage - - TDTouchID - - Toast - - TZImagePickerController - - UMengAnalytics - - UMengUShare/Social/QQ - - UMengUShare/Social/ReducedWeChat - - UMengUShare/Social/Sina - - UMengUShare/UI - - WebViewJavascriptBridge - - YYAsyncLayer - - YYCategories - - YYImage - - YYText - - ZFDownload - - ZFPlayer - - ZJScrollPageView - -SPEC CHECKSUMS: - AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 - ASIHTTPRequest: ec013992946676b7978dcbde6396d57312d21db4 - BaiduMapKit: f61b19ecf07a3f2deede72b221b366bf698739ed - CYLTabBarController: c374643dea6dadece8bdff9c70f7387f8ffd7d08 - DWBubbleMenuButton: 4d9bdbb9d662bdf65c93ceb7fc65901871143d1e - FCUUID: bb054fc90cd7cd99320f9f6ff8e130fe607fba05 - FDFullscreenPopGesture: a8a620179e3d9c40e8e00256dcee1c1a27c6d0f0 - FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa - GVUserDefaults: 52d48cf8ba578b40a1a76312b196dfc9134ba36a - HMEmoticon: 7cac18c01b74a2eaf833e2083c0238cb3c29b6a8 - HMQRCodeScanner: 8db2d317c0e5cbe3b4709fe2b9f26c107d66554e - iflyMSC: 7631cefeb1493b4bf0812a2a9b4fcdc6fe9f782e - IQKeyboardManager: 0bfa4607d39924116b5c0c8b55b5d789288b5cba - KILabel: 4797807cdc0b4992dad8bf91175ddc973c3b569b - LxGridView: af7b9360cce8eec2bcb11aa9d3cb7b9674372b74 - M13ProgressSuite: ea9f7263e73e9215e6849dfa54e29ee0ad6a145c - MagicWindowSDK: aa91ae646bb8b1ccd9479ea7fb0f4f7277ef31de - Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 - MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9 - MJExtension: 5932755f451458eefa24239358817f8d291240c7 - MJRefresh: 5f8552bc25ca8751c010f621c1098dbdaacbccd6 - MOFSPickerManager: 9eafa3d0230e24a79f6f0d9cf191d7f089d31ee9 - Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - SDCycleScrollView: 884b88f0266dd4708a0e1934975c69cb971707b1 - SDWebImage: 791bb72962b3492327ddcac4b1880bd1b5458431 - TDTouchID: d40027ed36e3d9f528b9b3f6bb6cf46f4f26f954 - Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 - TZImagePickerController: 3b9413ae5d049b1fdc5b0c720ad283f35b679a50 - UICKeyChainStore: 239558492fa260531a0774cfc611ea83a6eaff3a - UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2 - UMengUShare: 7a0ab762ccd445ccfcf11bde8e7f81b29b9f5e1c - WebViewJavascriptBridge: 7f5bc4d3581e672e8f32bd0f812d54bc69bb8e29 - WechatOpenSDK: 491d965d79335070328571d3e79f714549e79a5e - YYAsyncLayer: df6b01ebc695c5f6b4c15dd5c23fa3e081eb25c0 - YYCategories: 6bcd4314c6661a561410dce4a793379ebd306abd - YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 - YYText: 5c461d709e24d55a182d1441c41dc639a18a4849 - ZFDownload: a52f94ebb080833b8a8ceb19a409f2941343fe7f - ZFPlayer: 8a80bf8eb4638b97fbceaefcd3ca9978e9f17c9d - ZJScrollPageView: dd8778909cb2413782616ab156e873956f6b0682 - -PODFILE CHECKSUM: 5804247614eaead164978ecf12f2683816f723b7 - -COCOAPODS: 1.2.0 diff --git a/iOSProject/Pods/Masonry/LICENSE b/iOSProject/Pods/Masonry/LICENSE deleted file mode 100644 index a843c00c..00000000 --- a/iOSProject/Pods/Masonry/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/iOSProject/Pods/Masonry/Masonry/MASCompositeConstraint.h b/iOSProject/Pods/Masonry/Masonry/MASCompositeConstraint.h deleted file mode 100644 index 934c6f16..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASCompositeConstraint.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// MASCompositeConstraint.h -// Masonry -// -// Created by Jonas Budelmann on 21/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASConstraint.h" -#import "MASUtilities.h" - -/** - * A group of MASConstraint objects - */ -@interface MASCompositeConstraint : MASConstraint - -/** - * Creates a composite with a predefined array of children - * - * @param children child MASConstraints - * - * @return a composite constraint - */ -- (id)initWithChildren:(NSArray *)children; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASCompositeConstraint.m b/iOSProject/Pods/Masonry/Masonry/MASCompositeConstraint.m deleted file mode 100644 index 2002a405..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASCompositeConstraint.m +++ /dev/null @@ -1,183 +0,0 @@ -// -// MASCompositeConstraint.m -// Masonry -// -// Created by Jonas Budelmann on 21/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASCompositeConstraint.h" -#import "MASConstraint+Private.h" - -@interface MASCompositeConstraint () - -@property (nonatomic, strong) id mas_key; -@property (nonatomic, strong) NSMutableArray *childConstraints; - -@end - -@implementation MASCompositeConstraint - -- (id)initWithChildren:(NSArray *)children { - self = [super init]; - if (!self) return nil; - - _childConstraints = [children mutableCopy]; - for (MASConstraint *constraint in _childConstraints) { - constraint.delegate = self; - } - - return self; -} - -#pragma mark - MASConstraintDelegate - -- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { - NSUInteger index = [self.childConstraints indexOfObject:constraint]; - NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); - [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint]; -} - -- (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { - id strongDelegate = self.delegate; - MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; - newConstraint.delegate = self; - [self.childConstraints addObject:newConstraint]; - return newConstraint; -} - -#pragma mark - NSLayoutConstraint multiplier proxies - -- (MASConstraint * (^)(CGFloat))multipliedBy { - return ^id(CGFloat multiplier) { - for (MASConstraint *constraint in self.childConstraints) { - constraint.multipliedBy(multiplier); - } - return self; - }; -} - -- (MASConstraint * (^)(CGFloat))dividedBy { - return ^id(CGFloat divider) { - for (MASConstraint *constraint in self.childConstraints) { - constraint.dividedBy(divider); - } - return self; - }; -} - -#pragma mark - MASLayoutPriority proxy - -- (MASConstraint * (^)(MASLayoutPriority))priority { - return ^id(MASLayoutPriority priority) { - for (MASConstraint *constraint in self.childConstraints) { - constraint.priority(priority); - } - return self; - }; -} - -#pragma mark - NSLayoutRelation proxy - -- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { - return ^id(id attr, NSLayoutRelation relation) { - for (MASConstraint *constraint in self.childConstraints.copy) { - constraint.equalToWithRelation(attr, relation); - } - return self; - }; -} - -#pragma mark - attribute chaining - -- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { - [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; - return self; -} - -#pragma mark - Animator proxy - -#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) - -- (MASConstraint *)animator { - for (MASConstraint *constraint in self.childConstraints) { - [constraint animator]; - } - return self; -} - -#endif - -#pragma mark - debug helpers - -- (MASConstraint * (^)(id))key { - return ^id(id key) { - self.mas_key = key; - int i = 0; - for (MASConstraint *constraint in self.childConstraints) { - constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]); - } - return self; - }; -} - -#pragma mark - NSLayoutConstraint constant setters - -- (void)setInsets:(MASEdgeInsets)insets { - for (MASConstraint *constraint in self.childConstraints) { - constraint.insets = insets; - } -} - -- (void)setInset:(CGFloat)inset { - for (MASConstraint *constraint in self.childConstraints) { - constraint.inset = inset; - } -} - -- (void)setOffset:(CGFloat)offset { - for (MASConstraint *constraint in self.childConstraints) { - constraint.offset = offset; - } -} - -- (void)setSizeOffset:(CGSize)sizeOffset { - for (MASConstraint *constraint in self.childConstraints) { - constraint.sizeOffset = sizeOffset; - } -} - -- (void)setCenterOffset:(CGPoint)centerOffset { - for (MASConstraint *constraint in self.childConstraints) { - constraint.centerOffset = centerOffset; - } -} - -#pragma mark - MASConstraint - -- (void)activate { - for (MASConstraint *constraint in self.childConstraints) { - [constraint activate]; - } -} - -- (void)deactivate { - for (MASConstraint *constraint in self.childConstraints) { - [constraint deactivate]; - } -} - -- (void)install { - for (MASConstraint *constraint in self.childConstraints) { - constraint.updateExisting = self.updateExisting; - [constraint install]; - } -} - -- (void)uninstall { - for (MASConstraint *constraint in self.childConstraints) { - [constraint uninstall]; - } -} - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASConstraint+Private.h b/iOSProject/Pods/Masonry/Masonry/MASConstraint+Private.h deleted file mode 100644 index ee0fd960..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASConstraint+Private.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// MASConstraint+Private.h -// Masonry -// -// Created by Nick Tymchenko on 29/04/14. -// Copyright (c) 2014 cloudling. All rights reserved. -// - -#import "MASConstraint.h" - -@protocol MASConstraintDelegate; - - -@interface MASConstraint () - -/** - * Whether or not to check for an existing constraint instead of adding constraint - */ -@property (nonatomic, assign) BOOL updateExisting; - -/** - * Usually MASConstraintMaker but could be a parent MASConstraint - */ -@property (nonatomic, weak) id delegate; - -/** - * Based on a provided value type, is equal to calling: - * NSNumber - setOffset: - * NSValue with CGPoint - setPointOffset: - * NSValue with CGSize - setSizeOffset: - * NSValue with MASEdgeInsets - setInsets: - */ -- (void)setLayoutConstantWithValue:(NSValue *)value; - -@end - - -@interface MASConstraint (Abstract) - -/** - * Sets the constraint relation to given NSLayoutRelation - * returns a block which accepts one of the following: - * MASViewAttribute, UIView, NSValue, NSArray - * see readme for more details. - */ -- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; - -/** - * Override to set a custom chaining behaviour - */ -- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; - -@end - - -@protocol MASConstraintDelegate - -/** - * Notifies the delegate when the constraint needs to be replaced with another constraint. For example - * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks - */ -- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; - -- (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASConstraint.h b/iOSProject/Pods/Masonry/Masonry/MASConstraint.h deleted file mode 100644 index 3eaa8a10..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASConstraint.h +++ /dev/null @@ -1,272 +0,0 @@ -// -// MASConstraint.h -// Masonry -// -// Created by Jonas Budelmann on 22/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASUtilities.h" - -/** - * Enables Constraints to be created with chainable syntax - * Constraint can represent single NSLayoutConstraint (MASViewConstraint) - * or a group of NSLayoutConstraints (MASComposisteConstraint) - */ -@interface MASConstraint : NSObject - -// Chaining Support - -/** - * Modifies the NSLayoutConstraint constant, - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following - * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight - */ -- (MASConstraint * (^)(MASEdgeInsets insets))insets; - -/** - * Modifies the NSLayoutConstraint constant, - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following - * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight - */ -- (MASConstraint * (^)(CGFloat inset))inset; - -/** - * Modifies the NSLayoutConstraint constant, - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following - * NSLayoutAttributeWidth, NSLayoutAttributeHeight - */ -- (MASConstraint * (^)(CGSize offset))sizeOffset; - -/** - * Modifies the NSLayoutConstraint constant, - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following - * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY - */ -- (MASConstraint * (^)(CGPoint offset))centerOffset; - -/** - * Modifies the NSLayoutConstraint constant - */ -- (MASConstraint * (^)(CGFloat offset))offset; - -/** - * Modifies the NSLayoutConstraint constant based on a value type - */ -- (MASConstraint * (^)(NSValue *value))valueOffset; - -/** - * Sets the NSLayoutConstraint multiplier property - */ -- (MASConstraint * (^)(CGFloat multiplier))multipliedBy; - -/** - * Sets the NSLayoutConstraint multiplier to 1.0/dividedBy - */ -- (MASConstraint * (^)(CGFloat divider))dividedBy; - -/** - * Sets the NSLayoutConstraint priority to a float or MASLayoutPriority - */ -- (MASConstraint * (^)(MASLayoutPriority priority))priority; - -/** - * Sets the NSLayoutConstraint priority to MASLayoutPriorityLow - */ -- (MASConstraint * (^)(void))priorityLow; - -/** - * Sets the NSLayoutConstraint priority to MASLayoutPriorityMedium - */ -- (MASConstraint * (^)(void))priorityMedium; - -/** - * Sets the NSLayoutConstraint priority to MASLayoutPriorityHigh - */ -- (MASConstraint * (^)(void))priorityHigh; - -/** - * Sets the constraint relation to NSLayoutRelationEqual - * returns a block which accepts one of the following: - * MASViewAttribute, UIView, NSValue, NSArray - * see readme for more details. - */ -- (MASConstraint * (^)(id attr))equalTo; - -/** - * Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual - * returns a block which accepts one of the following: - * MASViewAttribute, UIView, NSValue, NSArray - * see readme for more details. - */ -- (MASConstraint * (^)(id attr))greaterThanOrEqualTo; - -/** - * Sets the constraint relation to NSLayoutRelationLessThanOrEqual - * returns a block which accepts one of the following: - * MASViewAttribute, UIView, NSValue, NSArray - * see readme for more details. - */ -- (MASConstraint * (^)(id attr))lessThanOrEqualTo; - -/** - * Optional semantic property which has no effect but improves the readability of constraint - */ -- (MASConstraint *)with; - -/** - * Optional semantic property which has no effect but improves the readability of constraint - */ -- (MASConstraint *)and; - -/** - * Creates a new MASCompositeConstraint with the called attribute and reciever - */ -- (MASConstraint *)left; -- (MASConstraint *)top; -- (MASConstraint *)right; -- (MASConstraint *)bottom; -- (MASConstraint *)leading; -- (MASConstraint *)trailing; -- (MASConstraint *)width; -- (MASConstraint *)height; -- (MASConstraint *)centerX; -- (MASConstraint *)centerY; -- (MASConstraint *)baseline; - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - -- (MASConstraint *)firstBaseline; -- (MASConstraint *)lastBaseline; - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - -- (MASConstraint *)leftMargin; -- (MASConstraint *)rightMargin; -- (MASConstraint *)topMargin; -- (MASConstraint *)bottomMargin; -- (MASConstraint *)leadingMargin; -- (MASConstraint *)trailingMargin; -- (MASConstraint *)centerXWithinMargins; -- (MASConstraint *)centerYWithinMargins; - -#endif - - -/** - * Sets the constraint debug name - */ -- (MASConstraint * (^)(id key))key; - -// NSLayoutConstraint constant Setters -// for use outside of mas_updateConstraints/mas_makeConstraints blocks - -/** - * Modifies the NSLayoutConstraint constant, - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following - * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight - */ -- (void)setInsets:(MASEdgeInsets)insets; - -/** - * Modifies the NSLayoutConstraint constant, - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following - * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight - */ -- (void)setInset:(CGFloat)inset; - -/** - * Modifies the NSLayoutConstraint constant, - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following - * NSLayoutAttributeWidth, NSLayoutAttributeHeight - */ -- (void)setSizeOffset:(CGSize)sizeOffset; - -/** - * Modifies the NSLayoutConstraint constant, - * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following - * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY - */ -- (void)setCenterOffset:(CGPoint)centerOffset; - -/** - * Modifies the NSLayoutConstraint constant - */ -- (void)setOffset:(CGFloat)offset; - - -// NSLayoutConstraint Installation support - -#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) -/** - * Whether or not to go through the animator proxy when modifying the constraint - */ -@property (nonatomic, copy, readonly) MASConstraint *animator; -#endif - -/** - * Activates an NSLayoutConstraint if it's supported by an OS. - * Invokes install otherwise. - */ -- (void)activate; - -/** - * Deactivates previously installed/activated NSLayoutConstraint. - */ -- (void)deactivate; - -/** - * Creates a NSLayoutConstraint and adds it to the appropriate view. - */ -- (void)install; - -/** - * Removes previously installed NSLayoutConstraint - */ -- (void)uninstall; - -@end - - -/** - * Convenience auto-boxing macros for MASConstraint methods. - * - * Defining MAS_SHORTHAND_GLOBALS will turn on auto-boxing for default syntax. - * A potential drawback of this is that the unprefixed macros will appear in global scope. - */ -#define mas_equalTo(...) equalTo(MASBoxValue((__VA_ARGS__))) -#define mas_greaterThanOrEqualTo(...) greaterThanOrEqualTo(MASBoxValue((__VA_ARGS__))) -#define mas_lessThanOrEqualTo(...) lessThanOrEqualTo(MASBoxValue((__VA_ARGS__))) - -#define mas_offset(...) valueOffset(MASBoxValue((__VA_ARGS__))) - - -#ifdef MAS_SHORTHAND_GLOBALS - -#define equalTo(...) mas_equalTo(__VA_ARGS__) -#define greaterThanOrEqualTo(...) mas_greaterThanOrEqualTo(__VA_ARGS__) -#define lessThanOrEqualTo(...) mas_lessThanOrEqualTo(__VA_ARGS__) - -#define offset(...) mas_offset(__VA_ARGS__) - -#endif - - -@interface MASConstraint (AutoboxingSupport) - -/** - * Aliases to corresponding relation methods (for shorthand macros) - * Also needed to aid autocompletion - */ -- (MASConstraint * (^)(id attr))mas_equalTo; -- (MASConstraint * (^)(id attr))mas_greaterThanOrEqualTo; -- (MASConstraint * (^)(id attr))mas_lessThanOrEqualTo; - -/** - * A dummy method to aid autocompletion - */ -- (MASConstraint * (^)(id offset))mas_offset; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASConstraint.m b/iOSProject/Pods/Masonry/Masonry/MASConstraint.m deleted file mode 100644 index 52de590c..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASConstraint.m +++ /dev/null @@ -1,301 +0,0 @@ -// -// MASConstraint.m -// Masonry -// -// Created by Nick Tymchenko on 1/20/14. -// - -#import "MASConstraint.h" -#import "MASConstraint+Private.h" - -#define MASMethodNotImplemented() \ - @throw [NSException exceptionWithName:NSInternalInconsistencyException \ - reason:[NSString stringWithFormat:@"You must override %@ in a subclass.", NSStringFromSelector(_cmd)] \ - userInfo:nil] - -@implementation MASConstraint - -#pragma mark - Init - -- (id)init { - NSAssert(![self isMemberOfClass:[MASConstraint class]], @"MASConstraint is an abstract class, you should not instantiate it directly."); - return [super init]; -} - -#pragma mark - NSLayoutRelation proxies - -- (MASConstraint * (^)(id))equalTo { - return ^id(id attribute) { - return self.equalToWithRelation(attribute, NSLayoutRelationEqual); - }; -} - -- (MASConstraint * (^)(id))mas_equalTo { - return ^id(id attribute) { - return self.equalToWithRelation(attribute, NSLayoutRelationEqual); - }; -} - -- (MASConstraint * (^)(id))greaterThanOrEqualTo { - return ^id(id attribute) { - return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual); - }; -} - -- (MASConstraint * (^)(id))mas_greaterThanOrEqualTo { - return ^id(id attribute) { - return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual); - }; -} - -- (MASConstraint * (^)(id))lessThanOrEqualTo { - return ^id(id attribute) { - return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual); - }; -} - -- (MASConstraint * (^)(id))mas_lessThanOrEqualTo { - return ^id(id attribute) { - return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual); - }; -} - -#pragma mark - MASLayoutPriority proxies - -- (MASConstraint * (^)(void))priorityLow { - return ^id{ - self.priority(MASLayoutPriorityDefaultLow); - return self; - }; -} - -- (MASConstraint * (^)(void))priorityMedium { - return ^id{ - self.priority(MASLayoutPriorityDefaultMedium); - return self; - }; -} - -- (MASConstraint * (^)(void))priorityHigh { - return ^id{ - self.priority(MASLayoutPriorityDefaultHigh); - return self; - }; -} - -#pragma mark - NSLayoutConstraint constant proxies - -- (MASConstraint * (^)(MASEdgeInsets))insets { - return ^id(MASEdgeInsets insets){ - self.insets = insets; - return self; - }; -} - -- (MASConstraint * (^)(CGFloat))inset { - return ^id(CGFloat inset){ - self.inset = inset; - return self; - }; -} - -- (MASConstraint * (^)(CGSize))sizeOffset { - return ^id(CGSize offset) { - self.sizeOffset = offset; - return self; - }; -} - -- (MASConstraint * (^)(CGPoint))centerOffset { - return ^id(CGPoint offset) { - self.centerOffset = offset; - return self; - }; -} - -- (MASConstraint * (^)(CGFloat))offset { - return ^id(CGFloat offset){ - self.offset = offset; - return self; - }; -} - -- (MASConstraint * (^)(NSValue *value))valueOffset { - return ^id(NSValue *offset) { - NSAssert([offset isKindOfClass:NSValue.class], @"expected an NSValue offset, got: %@", offset); - [self setLayoutConstantWithValue:offset]; - return self; - }; -} - -- (MASConstraint * (^)(id offset))mas_offset { - // Will never be called due to macro - return nil; -} - -#pragma mark - NSLayoutConstraint constant setter - -- (void)setLayoutConstantWithValue:(NSValue *)value { - if ([value isKindOfClass:NSNumber.class]) { - self.offset = [(NSNumber *)value doubleValue]; - } else if (strcmp(value.objCType, @encode(CGPoint)) == 0) { - CGPoint point; - [value getValue:&point]; - self.centerOffset = point; - } else if (strcmp(value.objCType, @encode(CGSize)) == 0) { - CGSize size; - [value getValue:&size]; - self.sizeOffset = size; - } else if (strcmp(value.objCType, @encode(MASEdgeInsets)) == 0) { - MASEdgeInsets insets; - [value getValue:&insets]; - self.insets = insets; - } else { - NSAssert(NO, @"attempting to set layout constant with unsupported value: %@", value); - } -} - -#pragma mark - Semantic properties - -- (MASConstraint *)with { - return self; -} - -- (MASConstraint *)and { - return self; -} - -#pragma mark - Chaining - -- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute __unused)layoutAttribute { - MASMethodNotImplemented(); -} - -- (MASConstraint *)left { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft]; -} - -- (MASConstraint *)top { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop]; -} - -- (MASConstraint *)right { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight]; -} - -- (MASConstraint *)bottom { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom]; -} - -- (MASConstraint *)leading { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading]; -} - -- (MASConstraint *)trailing { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing]; -} - -- (MASConstraint *)width { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth]; -} - -- (MASConstraint *)height { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight]; -} - -- (MASConstraint *)centerX { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX]; -} - -- (MASConstraint *)centerY { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY]; -} - -- (MASConstraint *)baseline { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline]; -} - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - -- (MASConstraint *)firstBaseline { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline]; -} -- (MASConstraint *)lastBaseline { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline]; -} - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - -- (MASConstraint *)leftMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin]; -} - -- (MASConstraint *)rightMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin]; -} - -- (MASConstraint *)topMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin]; -} - -- (MASConstraint *)bottomMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin]; -} - -- (MASConstraint *)leadingMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin]; -} - -- (MASConstraint *)trailingMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin]; -} - -- (MASConstraint *)centerXWithinMargins { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins]; -} - -- (MASConstraint *)centerYWithinMargins { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins]; -} - -#endif - -#pragma mark - Abstract - -- (MASConstraint * (^)(CGFloat multiplier))multipliedBy { MASMethodNotImplemented(); } - -- (MASConstraint * (^)(CGFloat divider))dividedBy { MASMethodNotImplemented(); } - -- (MASConstraint * (^)(MASLayoutPriority priority))priority { MASMethodNotImplemented(); } - -- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { MASMethodNotImplemented(); } - -- (MASConstraint * (^)(id key))key { MASMethodNotImplemented(); } - -- (void)setInsets:(MASEdgeInsets __unused)insets { MASMethodNotImplemented(); } - -- (void)setInset:(CGFloat __unused)inset { MASMethodNotImplemented(); } - -- (void)setSizeOffset:(CGSize __unused)sizeOffset { MASMethodNotImplemented(); } - -- (void)setCenterOffset:(CGPoint __unused)centerOffset { MASMethodNotImplemented(); } - -- (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); } - -#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) - -- (MASConstraint *)animator { MASMethodNotImplemented(); } - -#endif - -- (void)activate { MASMethodNotImplemented(); } - -- (void)deactivate { MASMethodNotImplemented(); } - -- (void)install { MASMethodNotImplemented(); } - -- (void)uninstall { MASMethodNotImplemented(); } - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASConstraintMaker.h b/iOSProject/Pods/Masonry/Masonry/MASConstraintMaker.h deleted file mode 100644 index d9b58f4f..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASConstraintMaker.h +++ /dev/null @@ -1,146 +0,0 @@ -// -// MASConstraintMaker.h -// Masonry -// -// Created by Jonas Budelmann on 20/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASConstraint.h" -#import "MASUtilities.h" - -typedef NS_OPTIONS(NSInteger, MASAttribute) { - MASAttributeLeft = 1 << NSLayoutAttributeLeft, - MASAttributeRight = 1 << NSLayoutAttributeRight, - MASAttributeTop = 1 << NSLayoutAttributeTop, - MASAttributeBottom = 1 << NSLayoutAttributeBottom, - MASAttributeLeading = 1 << NSLayoutAttributeLeading, - MASAttributeTrailing = 1 << NSLayoutAttributeTrailing, - MASAttributeWidth = 1 << NSLayoutAttributeWidth, - MASAttributeHeight = 1 << NSLayoutAttributeHeight, - MASAttributeCenterX = 1 << NSLayoutAttributeCenterX, - MASAttributeCenterY = 1 << NSLayoutAttributeCenterY, - MASAttributeBaseline = 1 << NSLayoutAttributeBaseline, - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - - MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline, - MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline, - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - - MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin, - MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin, - MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin, - MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin, - MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin, - MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin, - MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins, - MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins, - -#endif - -}; - -/** - * Provides factory methods for creating MASConstraints. - * Constraints are collected until they are ready to be installed - * - */ -@interface MASConstraintMaker : NSObject - -/** - * The following properties return a new MASViewConstraint - * with the first item set to the makers associated view and the appropriate MASViewAttribute - */ -@property (nonatomic, strong, readonly) MASConstraint *left; -@property (nonatomic, strong, readonly) MASConstraint *top; -@property (nonatomic, strong, readonly) MASConstraint *right; -@property (nonatomic, strong, readonly) MASConstraint *bottom; -@property (nonatomic, strong, readonly) MASConstraint *leading; -@property (nonatomic, strong, readonly) MASConstraint *trailing; -@property (nonatomic, strong, readonly) MASConstraint *width; -@property (nonatomic, strong, readonly) MASConstraint *height; -@property (nonatomic, strong, readonly) MASConstraint *centerX; -@property (nonatomic, strong, readonly) MASConstraint *centerY; -@property (nonatomic, strong, readonly) MASConstraint *baseline; - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - -@property (nonatomic, strong, readonly) MASConstraint *firstBaseline; -@property (nonatomic, strong, readonly) MASConstraint *lastBaseline; - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - -@property (nonatomic, strong, readonly) MASConstraint *leftMargin; -@property (nonatomic, strong, readonly) MASConstraint *rightMargin; -@property (nonatomic, strong, readonly) MASConstraint *topMargin; -@property (nonatomic, strong, readonly) MASConstraint *bottomMargin; -@property (nonatomic, strong, readonly) MASConstraint *leadingMargin; -@property (nonatomic, strong, readonly) MASConstraint *trailingMargin; -@property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins; -@property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins; - -#endif - -/** - * Returns a block which creates a new MASCompositeConstraint with the first item set - * to the makers associated view and children corresponding to the set bits in the - * MASAttribute parameter. Combine multiple attributes via binary-or. - */ -@property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs); - -/** - * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges - * which generates the appropriate MASViewConstraint children (top, left, bottom, right) - * with the first item set to the makers associated view - */ -@property (nonatomic, strong, readonly) MASConstraint *edges; - -/** - * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize - * which generates the appropriate MASViewConstraint children (width, height) - * with the first item set to the makers associated view - */ -@property (nonatomic, strong, readonly) MASConstraint *size; - -/** - * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter - * which generates the appropriate MASViewConstraint children (centerX, centerY) - * with the first item set to the makers associated view - */ -@property (nonatomic, strong, readonly) MASConstraint *center; - -/** - * Whether or not to check for an existing constraint instead of adding constraint - */ -@property (nonatomic, assign) BOOL updateExisting; - -/** - * Whether or not to remove existing constraints prior to installing - */ -@property (nonatomic, assign) BOOL removeExisting; - -/** - * initialises the maker with a default view - * - * @param view any MASConstraint are created with this view as the first item - * - * @return a new MASConstraintMaker - */ -- (id)initWithView:(MAS_VIEW *)view; - -/** - * Calls install method on any MASConstraints which have been created by this maker - * - * @return an array of all the installed MASConstraints - */ -- (NSArray *)install; - -- (MASConstraint * (^)(dispatch_block_t))group; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASConstraintMaker.m b/iOSProject/Pods/Masonry/Masonry/MASConstraintMaker.m deleted file mode 100644 index f11492ab..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASConstraintMaker.m +++ /dev/null @@ -1,273 +0,0 @@ -// -// MASConstraintMaker.m -// Masonry -// -// Created by Jonas Budelmann on 20/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASConstraintMaker.h" -#import "MASViewConstraint.h" -#import "MASCompositeConstraint.h" -#import "MASConstraint+Private.h" -#import "MASViewAttribute.h" -#import "View+MASAdditions.h" - -@interface MASConstraintMaker () - -@property (nonatomic, weak) MAS_VIEW *view; -@property (nonatomic, strong) NSMutableArray *constraints; - -@end - -@implementation MASConstraintMaker - -- (id)initWithView:(MAS_VIEW *)view { - self = [super init]; - if (!self) return nil; - - self.view = view; - self.constraints = NSMutableArray.new; - - return self; -} - -- (NSArray *)install { - if (self.removeExisting) { - NSArray *installedConstraints = [MASViewConstraint installedConstraintsForView:self.view]; - for (MASConstraint *constraint in installedConstraints) { - [constraint uninstall]; - } - } - NSArray *constraints = self.constraints.copy; - for (MASConstraint *constraint in constraints) { - constraint.updateExisting = self.updateExisting; - [constraint install]; - } - [self.constraints removeAllObjects]; - return constraints; -} - -#pragma mark - MASConstraintDelegate - -- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { - NSUInteger index = [self.constraints indexOfObject:constraint]; - NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); - [self.constraints replaceObjectAtIndex:index withObject:replacementConstraint]; -} - -- (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { - MASViewAttribute *viewAttribute = [[MASViewAttribute alloc] initWithView:self.view layoutAttribute:layoutAttribute]; - MASViewConstraint *newConstraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:viewAttribute]; - if ([constraint isKindOfClass:MASViewConstraint.class]) { - //replace with composite constraint - NSArray *children = @[constraint, newConstraint]; - MASCompositeConstraint *compositeConstraint = [[MASCompositeConstraint alloc] initWithChildren:children]; - compositeConstraint.delegate = self; - [self constraint:constraint shouldBeReplacedWithConstraint:compositeConstraint]; - return compositeConstraint; - } - if (!constraint) { - newConstraint.delegate = self; - [self.constraints addObject:newConstraint]; - } - return newConstraint; -} - -- (MASConstraint *)addConstraintWithAttributes:(MASAttribute)attrs { - __unused MASAttribute anyAttribute = (MASAttributeLeft | MASAttributeRight | MASAttributeTop | MASAttributeBottom | MASAttributeLeading - | MASAttributeTrailing | MASAttributeWidth | MASAttributeHeight | MASAttributeCenterX - | MASAttributeCenterY | MASAttributeBaseline -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - | MASAttributeFirstBaseline | MASAttributeLastBaseline -#endif -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - | MASAttributeLeftMargin | MASAttributeRightMargin | MASAttributeTopMargin | MASAttributeBottomMargin - | MASAttributeLeadingMargin | MASAttributeTrailingMargin | MASAttributeCenterXWithinMargins - | MASAttributeCenterYWithinMargins -#endif - ); - - NSAssert((attrs & anyAttribute) != 0, @"You didn't pass any attribute to make.attributes(...)"); - - NSMutableArray *attributes = [NSMutableArray array]; - - if (attrs & MASAttributeLeft) [attributes addObject:self.view.mas_left]; - if (attrs & MASAttributeRight) [attributes addObject:self.view.mas_right]; - if (attrs & MASAttributeTop) [attributes addObject:self.view.mas_top]; - if (attrs & MASAttributeBottom) [attributes addObject:self.view.mas_bottom]; - if (attrs & MASAttributeLeading) [attributes addObject:self.view.mas_leading]; - if (attrs & MASAttributeTrailing) [attributes addObject:self.view.mas_trailing]; - if (attrs & MASAttributeWidth) [attributes addObject:self.view.mas_width]; - if (attrs & MASAttributeHeight) [attributes addObject:self.view.mas_height]; - if (attrs & MASAttributeCenterX) [attributes addObject:self.view.mas_centerX]; - if (attrs & MASAttributeCenterY) [attributes addObject:self.view.mas_centerY]; - if (attrs & MASAttributeBaseline) [attributes addObject:self.view.mas_baseline]; - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - - if (attrs & MASAttributeFirstBaseline) [attributes addObject:self.view.mas_firstBaseline]; - if (attrs & MASAttributeLastBaseline) [attributes addObject:self.view.mas_lastBaseline]; - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - - if (attrs & MASAttributeLeftMargin) [attributes addObject:self.view.mas_leftMargin]; - if (attrs & MASAttributeRightMargin) [attributes addObject:self.view.mas_rightMargin]; - if (attrs & MASAttributeTopMargin) [attributes addObject:self.view.mas_topMargin]; - if (attrs & MASAttributeBottomMargin) [attributes addObject:self.view.mas_bottomMargin]; - if (attrs & MASAttributeLeadingMargin) [attributes addObject:self.view.mas_leadingMargin]; - if (attrs & MASAttributeTrailingMargin) [attributes addObject:self.view.mas_trailingMargin]; - if (attrs & MASAttributeCenterXWithinMargins) [attributes addObject:self.view.mas_centerXWithinMargins]; - if (attrs & MASAttributeCenterYWithinMargins) [attributes addObject:self.view.mas_centerYWithinMargins]; - -#endif - - NSMutableArray *children = [NSMutableArray arrayWithCapacity:attributes.count]; - - for (MASViewAttribute *a in attributes) { - [children addObject:[[MASViewConstraint alloc] initWithFirstViewAttribute:a]]; - } - - MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithChildren:children]; - constraint.delegate = self; - [self.constraints addObject:constraint]; - return constraint; -} - -#pragma mark - standard Attributes - -- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { - return [self constraint:nil addConstraintWithLayoutAttribute:layoutAttribute]; -} - -- (MASConstraint *)left { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft]; -} - -- (MASConstraint *)top { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop]; -} - -- (MASConstraint *)right { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight]; -} - -- (MASConstraint *)bottom { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom]; -} - -- (MASConstraint *)leading { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading]; -} - -- (MASConstraint *)trailing { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing]; -} - -- (MASConstraint *)width { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth]; -} - -- (MASConstraint *)height { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight]; -} - -- (MASConstraint *)centerX { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX]; -} - -- (MASConstraint *)centerY { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY]; -} - -- (MASConstraint *)baseline { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline]; -} - -- (MASConstraint *(^)(MASAttribute))attributes { - return ^(MASAttribute attrs){ - return [self addConstraintWithAttributes:attrs]; - }; -} - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - -- (MASConstraint *)firstBaseline { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline]; -} - -- (MASConstraint *)lastBaseline { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline]; -} - -#endif - - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - -- (MASConstraint *)leftMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin]; -} - -- (MASConstraint *)rightMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin]; -} - -- (MASConstraint *)topMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin]; -} - -- (MASConstraint *)bottomMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin]; -} - -- (MASConstraint *)leadingMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin]; -} - -- (MASConstraint *)trailingMargin { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin]; -} - -- (MASConstraint *)centerXWithinMargins { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins]; -} - -- (MASConstraint *)centerYWithinMargins { - return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins]; -} - -#endif - - -#pragma mark - composite Attributes - -- (MASConstraint *)edges { - return [self addConstraintWithAttributes:MASAttributeTop | MASAttributeLeft | MASAttributeRight | MASAttributeBottom]; -} - -- (MASConstraint *)size { - return [self addConstraintWithAttributes:MASAttributeWidth | MASAttributeHeight]; -} - -- (MASConstraint *)center { - return [self addConstraintWithAttributes:MASAttributeCenterX | MASAttributeCenterY]; -} - -#pragma mark - grouping - -- (MASConstraint *(^)(dispatch_block_t group))group { - return ^id(dispatch_block_t group) { - NSInteger previousCount = self.constraints.count; - group(); - - NSArray *children = [self.constraints subarrayWithRange:NSMakeRange(previousCount, self.constraints.count - previousCount)]; - MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithChildren:children]; - constraint.delegate = self; - return constraint; - }; -} - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASLayoutConstraint.h b/iOSProject/Pods/Masonry/Masonry/MASLayoutConstraint.h deleted file mode 100644 index 699041cb..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASLayoutConstraint.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// MASLayoutConstraint.h -// Masonry -// -// Created by Jonas Budelmann on 3/08/13. -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. -// - -#import "MASUtilities.h" - -/** - * When you are debugging or printing the constraints attached to a view this subclass - * makes it easier to identify which constraints have been created via Masonry - */ -@interface MASLayoutConstraint : NSLayoutConstraint - -/** - * a key to associate with this constraint - */ -@property (nonatomic, strong) id mas_key; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASLayoutConstraint.m b/iOSProject/Pods/Masonry/Masonry/MASLayoutConstraint.m deleted file mode 100644 index 3483f026..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASLayoutConstraint.m +++ /dev/null @@ -1,13 +0,0 @@ -// -// MASLayoutConstraint.m -// Masonry -// -// Created by Jonas Budelmann on 3/08/13. -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. -// - -#import "MASLayoutConstraint.h" - -@implementation MASLayoutConstraint - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASUtilities.h b/iOSProject/Pods/Masonry/Masonry/MASUtilities.h deleted file mode 100644 index 1dbfd938..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASUtilities.h +++ /dev/null @@ -1,136 +0,0 @@ -// -// MASUtilities.h -// Masonry -// -// Created by Jonas Budelmann on 19/08/13. -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. -// - -#import - - - -#if TARGET_OS_IPHONE || TARGET_OS_TV - - #import - #define MAS_VIEW UIView - #define MAS_VIEW_CONTROLLER UIViewController - #define MASEdgeInsets UIEdgeInsets - - typedef UILayoutPriority MASLayoutPriority; - static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired; - static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh; - static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500; - static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow; - static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel; - -#elif TARGET_OS_MAC - - #import - #define MAS_VIEW NSView - #define MASEdgeInsets NSEdgeInsets - - typedef NSLayoutPriority MASLayoutPriority; - static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired; - static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh; - static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow; - static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501; - static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut; - static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow; - static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow; - static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression; - -#endif - -/** - * Allows you to attach keys to objects matching the variable names passed. - * - * view1.mas_key = @"view1", view2.mas_key = @"view2"; - * - * is equivalent to: - * - * MASAttachKeys(view1, view2); - */ -#define MASAttachKeys(...) \ - { \ - NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \ - for (id key in keyPairs.allKeys) { \ - id obj = keyPairs[key]; \ - NSAssert([obj respondsToSelector:@selector(setMas_key:)], \ - @"Cannot attach mas_key to %@", obj); \ - [obj setMas_key:key]; \ - } \ - } - -/** - * Used to create object hashes - * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html - */ -#define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger)) -#define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch))) - -/** - * Given a scalar or struct value, wraps it in NSValue - * Based on EXPObjectify: https://github.com/specta/expecta - */ -static inline id _MASBoxValue(const char *type, ...) { - va_list v; - va_start(v, type); - id obj = nil; - if (strcmp(type, @encode(id)) == 0) { - id actual = va_arg(v, id); - obj = actual; - } else if (strcmp(type, @encode(CGPoint)) == 0) { - CGPoint actual = (CGPoint)va_arg(v, CGPoint); - obj = [NSValue value:&actual withObjCType:type]; - } else if (strcmp(type, @encode(CGSize)) == 0) { - CGSize actual = (CGSize)va_arg(v, CGSize); - obj = [NSValue value:&actual withObjCType:type]; - } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) { - MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets); - obj = [NSValue value:&actual withObjCType:type]; - } else if (strcmp(type, @encode(double)) == 0) { - double actual = (double)va_arg(v, double); - obj = [NSNumber numberWithDouble:actual]; - } else if (strcmp(type, @encode(float)) == 0) { - float actual = (float)va_arg(v, double); - obj = [NSNumber numberWithFloat:actual]; - } else if (strcmp(type, @encode(int)) == 0) { - int actual = (int)va_arg(v, int); - obj = [NSNumber numberWithInt:actual]; - } else if (strcmp(type, @encode(long)) == 0) { - long actual = (long)va_arg(v, long); - obj = [NSNumber numberWithLong:actual]; - } else if (strcmp(type, @encode(long long)) == 0) { - long long actual = (long long)va_arg(v, long long); - obj = [NSNumber numberWithLongLong:actual]; - } else if (strcmp(type, @encode(short)) == 0) { - short actual = (short)va_arg(v, int); - obj = [NSNumber numberWithShort:actual]; - } else if (strcmp(type, @encode(char)) == 0) { - char actual = (char)va_arg(v, int); - obj = [NSNumber numberWithChar:actual]; - } else if (strcmp(type, @encode(bool)) == 0) { - bool actual = (bool)va_arg(v, int); - obj = [NSNumber numberWithBool:actual]; - } else if (strcmp(type, @encode(unsigned char)) == 0) { - unsigned char actual = (unsigned char)va_arg(v, unsigned int); - obj = [NSNumber numberWithUnsignedChar:actual]; - } else if (strcmp(type, @encode(unsigned int)) == 0) { - unsigned int actual = (unsigned int)va_arg(v, unsigned int); - obj = [NSNumber numberWithUnsignedInt:actual]; - } else if (strcmp(type, @encode(unsigned long)) == 0) { - unsigned long actual = (unsigned long)va_arg(v, unsigned long); - obj = [NSNumber numberWithUnsignedLong:actual]; - } else if (strcmp(type, @encode(unsigned long long)) == 0) { - unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); - obj = [NSNumber numberWithUnsignedLongLong:actual]; - } else if (strcmp(type, @encode(unsigned short)) == 0) { - unsigned short actual = (unsigned short)va_arg(v, unsigned int); - obj = [NSNumber numberWithUnsignedShort:actual]; - } - va_end(v); - return obj; -} - -#define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value)) diff --git a/iOSProject/Pods/Masonry/Masonry/MASViewAttribute.h b/iOSProject/Pods/Masonry/Masonry/MASViewAttribute.h deleted file mode 100644 index 601c25d1..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASViewAttribute.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// MASViewAttribute.h -// Masonry -// -// Created by Jonas Budelmann on 21/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASUtilities.h" - -/** - * An immutable tuple which stores the view and the related NSLayoutAttribute. - * Describes part of either the left or right hand side of a constraint equation - */ -@interface MASViewAttribute : NSObject - -/** - * The view which the reciever relates to. Can be nil if item is not a view. - */ -@property (nonatomic, weak, readonly) MAS_VIEW *view; - -/** - * The item which the reciever relates to. - */ -@property (nonatomic, weak, readonly) id item; - -/** - * The attribute which the reciever relates to - */ -@property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; - -/** - * Convenience initializer. - */ -- (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; - -/** - * The designated initializer. - */ -- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; - -/** - * Determine whether the layoutAttribute is a size attribute - * - * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight - */ -- (BOOL)isSizeAttribute; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASViewAttribute.m b/iOSProject/Pods/Masonry/Masonry/MASViewAttribute.m deleted file mode 100644 index e573e8bd..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASViewAttribute.m +++ /dev/null @@ -1,46 +0,0 @@ -// -// MASViewAttribute.m -// Masonry -// -// Created by Jonas Budelmann on 21/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASViewAttribute.h" - -@implementation MASViewAttribute - -- (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { - self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; - return self; -} - -- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { - self = [super init]; - if (!self) return nil; - - _view = view; - _item = item; - _layoutAttribute = layoutAttribute; - - return self; -} - -- (BOOL)isSizeAttribute { - return self.layoutAttribute == NSLayoutAttributeWidth - || self.layoutAttribute == NSLayoutAttributeHeight; -} - -- (BOOL)isEqual:(MASViewAttribute *)viewAttribute { - if ([viewAttribute isKindOfClass:self.class]) { - return self.view == viewAttribute.view - && self.layoutAttribute == viewAttribute.layoutAttribute; - } - return [super isEqual:viewAttribute]; -} - -- (NSUInteger)hash { - return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; -} - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASViewConstraint.h b/iOSProject/Pods/Masonry/Masonry/MASViewConstraint.h deleted file mode 100644 index ec390d15..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASViewConstraint.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// MASViewConstraint.h -// Masonry -// -// Created by Jonas Budelmann on 20/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASViewAttribute.h" -#import "MASConstraint.h" -#import "MASLayoutConstraint.h" -#import "MASUtilities.h" - -/** - * A single constraint. - * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view - */ -@interface MASViewConstraint : MASConstraint - -/** - * First item/view and first attribute of the NSLayoutConstraint - */ -@property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; - -/** - * Second item/view and second attribute of the NSLayoutConstraint - */ -@property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; - -/** - * initialises the MASViewConstraint with the first part of the equation - * - * @param firstViewAttribute view.mas_left, view.mas_width etc. - * - * @return a new view constraint - */ -- (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; - -/** - * Returns all MASViewConstraints installed with this view as a first item. - * - * @param view A view to retrieve constraints for. - * - * @return An array of MASViewConstraints. - */ -+ (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/MASViewConstraint.m b/iOSProject/Pods/Masonry/Masonry/MASViewConstraint.m deleted file mode 100644 index 173eec16..00000000 --- a/iOSProject/Pods/Masonry/Masonry/MASViewConstraint.m +++ /dev/null @@ -1,401 +0,0 @@ -// -// MASViewConstraint.m -// Masonry -// -// Created by Jonas Budelmann on 20/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASViewConstraint.h" -#import "MASConstraint+Private.h" -#import "MASCompositeConstraint.h" -#import "MASLayoutConstraint.h" -#import "View+MASAdditions.h" -#import - -@interface MAS_VIEW (MASConstraints) - -@property (nonatomic, readonly) NSMutableSet *mas_installedConstraints; - -@end - -@implementation MAS_VIEW (MASConstraints) - -static char kInstalledConstraintsKey; - -- (NSMutableSet *)mas_installedConstraints { - NSMutableSet *constraints = objc_getAssociatedObject(self, &kInstalledConstraintsKey); - if (!constraints) { - constraints = [NSMutableSet set]; - objc_setAssociatedObject(self, &kInstalledConstraintsKey, constraints, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return constraints; -} - -@end - - -@interface MASViewConstraint () - -@property (nonatomic, strong, readwrite) MASViewAttribute *secondViewAttribute; -@property (nonatomic, weak) MAS_VIEW *installedView; -@property (nonatomic, weak) MASLayoutConstraint *layoutConstraint; -@property (nonatomic, assign) NSLayoutRelation layoutRelation; -@property (nonatomic, assign) MASLayoutPriority layoutPriority; -@property (nonatomic, assign) CGFloat layoutMultiplier; -@property (nonatomic, assign) CGFloat layoutConstant; -@property (nonatomic, assign) BOOL hasLayoutRelation; -@property (nonatomic, strong) id mas_key; -@property (nonatomic, assign) BOOL useAnimator; - -@end - -@implementation MASViewConstraint - -- (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute { - self = [super init]; - if (!self) return nil; - - _firstViewAttribute = firstViewAttribute; - self.layoutPriority = MASLayoutPriorityRequired; - self.layoutMultiplier = 1; - - return self; -} - -#pragma mark - NSCoping - -- (id)copyWithZone:(NSZone __unused *)zone { - MASViewConstraint *constraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:self.firstViewAttribute]; - constraint.layoutConstant = self.layoutConstant; - constraint.layoutRelation = self.layoutRelation; - constraint.layoutPriority = self.layoutPriority; - constraint.layoutMultiplier = self.layoutMultiplier; - constraint.delegate = self.delegate; - return constraint; -} - -#pragma mark - Public - -+ (NSArray *)installedConstraintsForView:(MAS_VIEW *)view { - return [view.mas_installedConstraints allObjects]; -} - -#pragma mark - Private - -- (void)setLayoutConstant:(CGFloat)layoutConstant { - _layoutConstant = layoutConstant; - -#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) - if (self.useAnimator) { - [self.layoutConstraint.animator setConstant:layoutConstant]; - } else { - self.layoutConstraint.constant = layoutConstant; - } -#else - self.layoutConstraint.constant = layoutConstant; -#endif -} - -- (void)setLayoutRelation:(NSLayoutRelation)layoutRelation { - _layoutRelation = layoutRelation; - self.hasLayoutRelation = YES; -} - -- (BOOL)supportsActiveProperty { - return [self.layoutConstraint respondsToSelector:@selector(isActive)]; -} - -- (BOOL)isActive { - BOOL active = YES; - if ([self supportsActiveProperty]) { - active = [self.layoutConstraint isActive]; - } - - return active; -} - -- (BOOL)hasBeenInstalled { - return (self.layoutConstraint != nil) && [self isActive]; -} - -- (void)setSecondViewAttribute:(id)secondViewAttribute { - if ([secondViewAttribute isKindOfClass:NSValue.class]) { - [self setLayoutConstantWithValue:secondViewAttribute]; - } else if ([secondViewAttribute isKindOfClass:MAS_VIEW.class]) { - _secondViewAttribute = [[MASViewAttribute alloc] initWithView:secondViewAttribute layoutAttribute:self.firstViewAttribute.layoutAttribute]; - } else if ([secondViewAttribute isKindOfClass:MASViewAttribute.class]) { - _secondViewAttribute = secondViewAttribute; - } else { - NSAssert(NO, @"attempting to add unsupported attribute: %@", secondViewAttribute); - } -} - -#pragma mark - NSLayoutConstraint multiplier proxies - -- (MASConstraint * (^)(CGFloat))multipliedBy { - return ^id(CGFloat multiplier) { - NSAssert(!self.hasBeenInstalled, - @"Cannot modify constraint multiplier after it has been installed"); - - self.layoutMultiplier = multiplier; - return self; - }; -} - - -- (MASConstraint * (^)(CGFloat))dividedBy { - return ^id(CGFloat divider) { - NSAssert(!self.hasBeenInstalled, - @"Cannot modify constraint multiplier after it has been installed"); - - self.layoutMultiplier = 1.0/divider; - return self; - }; -} - -#pragma mark - MASLayoutPriority proxy - -- (MASConstraint * (^)(MASLayoutPriority))priority { - return ^id(MASLayoutPriority priority) { - NSAssert(!self.hasBeenInstalled, - @"Cannot modify constraint priority after it has been installed"); - - self.layoutPriority = priority; - return self; - }; -} - -#pragma mark - NSLayoutRelation proxy - -- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { - return ^id(id attribute, NSLayoutRelation relation) { - if ([attribute isKindOfClass:NSArray.class]) { - NSAssert(!self.hasLayoutRelation, @"Redefinition of constraint relation"); - NSMutableArray *children = NSMutableArray.new; - for (id attr in attribute) { - MASViewConstraint *viewConstraint = [self copy]; - viewConstraint.layoutRelation = relation; - viewConstraint.secondViewAttribute = attr; - [children addObject:viewConstraint]; - } - MASCompositeConstraint *compositeConstraint = [[MASCompositeConstraint alloc] initWithChildren:children]; - compositeConstraint.delegate = self.delegate; - [self.delegate constraint:self shouldBeReplacedWithConstraint:compositeConstraint]; - return compositeConstraint; - } else { - NSAssert(!self.hasLayoutRelation || self.layoutRelation == relation && [attribute isKindOfClass:NSValue.class], @"Redefinition of constraint relation"); - self.layoutRelation = relation; - self.secondViewAttribute = attribute; - return self; - } - }; -} - -#pragma mark - Semantic properties - -- (MASConstraint *)with { - return self; -} - -- (MASConstraint *)and { - return self; -} - -#pragma mark - attribute chaining - -- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { - NSAssert(!self.hasLayoutRelation, @"Attributes should be chained before defining the constraint relation"); - - return [self.delegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; -} - -#pragma mark - Animator proxy - -#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) - -- (MASConstraint *)animator { - self.useAnimator = YES; - return self; -} - -#endif - -#pragma mark - debug helpers - -- (MASConstraint * (^)(id))key { - return ^id(id key) { - self.mas_key = key; - return self; - }; -} - -#pragma mark - NSLayoutConstraint constant setters - -- (void)setInsets:(MASEdgeInsets)insets { - NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute; - switch (layoutAttribute) { - case NSLayoutAttributeLeft: - case NSLayoutAttributeLeading: - self.layoutConstant = insets.left; - break; - case NSLayoutAttributeTop: - self.layoutConstant = insets.top; - break; - case NSLayoutAttributeBottom: - self.layoutConstant = -insets.bottom; - break; - case NSLayoutAttributeRight: - case NSLayoutAttributeTrailing: - self.layoutConstant = -insets.right; - break; - default: - break; - } -} - -- (void)setInset:(CGFloat)inset { - [self setInsets:(MASEdgeInsets){.top = inset, .left = inset, .bottom = inset, .right = inset}]; -} - -- (void)setOffset:(CGFloat)offset { - self.layoutConstant = offset; -} - -- (void)setSizeOffset:(CGSize)sizeOffset { - NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute; - switch (layoutAttribute) { - case NSLayoutAttributeWidth: - self.layoutConstant = sizeOffset.width; - break; - case NSLayoutAttributeHeight: - self.layoutConstant = sizeOffset.height; - break; - default: - break; - } -} - -- (void)setCenterOffset:(CGPoint)centerOffset { - NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute; - switch (layoutAttribute) { - case NSLayoutAttributeCenterX: - self.layoutConstant = centerOffset.x; - break; - case NSLayoutAttributeCenterY: - self.layoutConstant = centerOffset.y; - break; - default: - break; - } -} - -#pragma mark - MASConstraint - -- (void)activate { - [self install]; -} - -- (void)deactivate { - [self uninstall]; -} - -- (void)install { - if (self.hasBeenInstalled) { - return; - } - - if ([self supportsActiveProperty] && self.layoutConstraint) { - self.layoutConstraint.active = YES; - [self.firstViewAttribute.view.mas_installedConstraints addObject:self]; - return; - } - - MAS_VIEW *firstLayoutItem = self.firstViewAttribute.item; - NSLayoutAttribute firstLayoutAttribute = self.firstViewAttribute.layoutAttribute; - MAS_VIEW *secondLayoutItem = self.secondViewAttribute.item; - NSLayoutAttribute secondLayoutAttribute = self.secondViewAttribute.layoutAttribute; - - // alignment attributes must have a secondViewAttribute - // therefore we assume that is refering to superview - // eg make.left.equalTo(@10) - if (!self.firstViewAttribute.isSizeAttribute && !self.secondViewAttribute) { - secondLayoutItem = self.firstViewAttribute.view.superview; - secondLayoutAttribute = firstLayoutAttribute; - } - - MASLayoutConstraint *layoutConstraint - = [MASLayoutConstraint constraintWithItem:firstLayoutItem - attribute:firstLayoutAttribute - relatedBy:self.layoutRelation - toItem:secondLayoutItem - attribute:secondLayoutAttribute - multiplier:self.layoutMultiplier - constant:self.layoutConstant]; - - layoutConstraint.priority = self.layoutPriority; - layoutConstraint.mas_key = self.mas_key; - - if (self.secondViewAttribute.view) { - MAS_VIEW *closestCommonSuperview = [self.firstViewAttribute.view mas_closestCommonSuperview:self.secondViewAttribute.view]; - NSAssert(closestCommonSuperview, - @"couldn't find a common superview for %@ and %@", - self.firstViewAttribute.view, self.secondViewAttribute.view); - self.installedView = closestCommonSuperview; - } else if (self.firstViewAttribute.isSizeAttribute) { - self.installedView = self.firstViewAttribute.view; - } else { - self.installedView = self.firstViewAttribute.view.superview; - } - - - MASLayoutConstraint *existingConstraint = nil; - if (self.updateExisting) { - existingConstraint = [self layoutConstraintSimilarTo:layoutConstraint]; - } - if (existingConstraint) { - // just update the constant - existingConstraint.constant = layoutConstraint.constant; - self.layoutConstraint = existingConstraint; - } else { - [self.installedView addConstraint:layoutConstraint]; - self.layoutConstraint = layoutConstraint; - [firstLayoutItem.mas_installedConstraints addObject:self]; - } -} - -- (MASLayoutConstraint *)layoutConstraintSimilarTo:(MASLayoutConstraint *)layoutConstraint { - // check if any constraints are the same apart from the only mutable property constant - - // go through constraints in reverse as we do not want to match auto-resizing or interface builder constraints - // and they are likely to be added first. - for (NSLayoutConstraint *existingConstraint in self.installedView.constraints.reverseObjectEnumerator) { - if (![existingConstraint isKindOfClass:MASLayoutConstraint.class]) continue; - if (existingConstraint.firstItem != layoutConstraint.firstItem) continue; - if (existingConstraint.secondItem != layoutConstraint.secondItem) continue; - if (existingConstraint.firstAttribute != layoutConstraint.firstAttribute) continue; - if (existingConstraint.secondAttribute != layoutConstraint.secondAttribute) continue; - if (existingConstraint.relation != layoutConstraint.relation) continue; - if (existingConstraint.multiplier != layoutConstraint.multiplier) continue; - if (existingConstraint.priority != layoutConstraint.priority) continue; - - return (id)existingConstraint; - } - return nil; -} - -- (void)uninstall { - if ([self supportsActiveProperty]) { - self.layoutConstraint.active = NO; - [self.firstViewAttribute.view.mas_installedConstraints removeObject:self]; - return; - } - - [self.installedView removeConstraint:self.layoutConstraint]; - self.layoutConstraint = nil; - self.installedView = nil; - - [self.firstViewAttribute.view.mas_installedConstraints removeObject:self]; -} - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/Masonry.h b/iOSProject/Pods/Masonry/Masonry/Masonry.h deleted file mode 100644 index d1bd579d..00000000 --- a/iOSProject/Pods/Masonry/Masonry/Masonry.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// Masonry.h -// Masonry -// -// Created by Jonas Budelmann on 20/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import - -//! Project version number for Masonry. -FOUNDATION_EXPORT double MasonryVersionNumber; - -//! Project version string for Masonry. -FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; - -#import "MASUtilities.h" -#import "View+MASAdditions.h" -#import "View+MASShorthandAdditions.h" -#import "ViewController+MASAdditions.h" -#import "NSArray+MASAdditions.h" -#import "NSArray+MASShorthandAdditions.h" -#import "MASConstraint.h" -#import "MASCompositeConstraint.h" -#import "MASViewAttribute.h" -#import "MASViewConstraint.h" -#import "MASConstraintMaker.h" -#import "MASLayoutConstraint.h" -#import "NSLayoutConstraint+MASDebugAdditions.h" diff --git a/iOSProject/Pods/Masonry/Masonry/NSArray+MASAdditions.h b/iOSProject/Pods/Masonry/Masonry/NSArray+MASAdditions.h deleted file mode 100644 index 587618d9..00000000 --- a/iOSProject/Pods/Masonry/Masonry/NSArray+MASAdditions.h +++ /dev/null @@ -1,72 +0,0 @@ -// -// NSArray+MASAdditions.h -// -// -// Created by Daniel Hammond on 11/26/13. -// -// - -#import "MASUtilities.h" -#import "MASConstraintMaker.h" -#import "MASViewAttribute.h" - -typedef NS_ENUM(NSUInteger, MASAxisType) { - MASAxisTypeHorizontal, - MASAxisTypeVertical -}; - -@interface NSArray (MASAdditions) - -/** - * Creates a MASConstraintMaker with each view in the callee. - * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view - * - * @param block scope within which you can build up the constraints which you wish to apply to each view. - * - * @return Array of created MASConstraints - */ -- (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; - -/** - * Creates a MASConstraintMaker with each view in the callee. - * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. - * If an existing constraint exists then it will be updated instead. - * - * @param block scope within which you can build up the constraints which you wish to apply to each view. - * - * @return Array of created/updated MASConstraints - */ -- (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; - -/** - * Creates a MASConstraintMaker with each view in the callee. - * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. - * All constraints previously installed for the views will be removed. - * - * @param block scope within which you can build up the constraints which you wish to apply to each view. - * - * @return Array of created/updated MASConstraints - */ -- (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; - -/** - * distribute with fixed spacing - * - * @param axisType which axis to distribute items along - * @param fixedSpacing the spacing between each item - * @param leadSpacing the spacing before the first item and the container - * @param tailSpacing the spacing after the last item and the container - */ -- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; - -/** - * distribute with fixed item size - * - * @param axisType which axis to distribute items along - * @param fixedItemLength the fixed length of each item - * @param leadSpacing the spacing before the first item and the container - * @param tailSpacing the spacing after the last item and the container - */ -- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/NSArray+MASAdditions.m b/iOSProject/Pods/Masonry/Masonry/NSArray+MASAdditions.m deleted file mode 100644 index 831d8cda..00000000 --- a/iOSProject/Pods/Masonry/Masonry/NSArray+MASAdditions.m +++ /dev/null @@ -1,162 +0,0 @@ -// -// NSArray+MASAdditions.m -// -// -// Created by Daniel Hammond on 11/26/13. -// -// - -#import "NSArray+MASAdditions.h" -#import "View+MASAdditions.h" - -@implementation NSArray (MASAdditions) - -- (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block { - NSMutableArray *constraints = [NSMutableArray array]; - for (MAS_VIEW *view in self) { - NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); - [constraints addObjectsFromArray:[view mas_makeConstraints:block]]; - } - return constraints; -} - -- (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block { - NSMutableArray *constraints = [NSMutableArray array]; - for (MAS_VIEW *view in self) { - NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); - [constraints addObjectsFromArray:[view mas_updateConstraints:block]]; - } - return constraints; -} - -- (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { - NSMutableArray *constraints = [NSMutableArray array]; - for (MAS_VIEW *view in self) { - NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); - [constraints addObjectsFromArray:[view mas_remakeConstraints:block]]; - } - return constraints; -} - -- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { - if (self.count < 2) { - NSAssert(self.count>1,@"views to distribute need to bigger than one"); - return; - } - - MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; - if (axisType == MASAxisTypeHorizontal) { - MAS_VIEW *prev; - for (int i = 0; i < self.count; i++) { - MAS_VIEW *v = self[i]; - [v mas_makeConstraints:^(MASConstraintMaker *make) { - if (prev) { - make.width.equalTo(prev); - make.left.equalTo(prev.mas_right).offset(fixedSpacing); - if (i == self.count - 1) {//last one - make.right.equalTo(tempSuperView).offset(-tailSpacing); - } - } - else {//first one - make.left.equalTo(tempSuperView).offset(leadSpacing); - } - - }]; - prev = v; - } - } - else { - MAS_VIEW *prev; - for (int i = 0; i < self.count; i++) { - MAS_VIEW *v = self[i]; - [v mas_makeConstraints:^(MASConstraintMaker *make) { - if (prev) { - make.height.equalTo(prev); - make.top.equalTo(prev.mas_bottom).offset(fixedSpacing); - if (i == self.count - 1) {//last one - make.bottom.equalTo(tempSuperView).offset(-tailSpacing); - } - } - else {//first one - make.top.equalTo(tempSuperView).offset(leadSpacing); - } - - }]; - prev = v; - } - } -} - -- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { - if (self.count < 2) { - NSAssert(self.count>1,@"views to distribute need to bigger than one"); - return; - } - - MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; - if (axisType == MASAxisTypeHorizontal) { - MAS_VIEW *prev; - for (int i = 0; i < self.count; i++) { - MAS_VIEW *v = self[i]; - [v mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.equalTo(@(fixedItemLength)); - if (prev) { - if (i == self.count - 1) {//last one - make.right.equalTo(tempSuperView).offset(-tailSpacing); - } - else { - CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); - make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); - } - } - else {//first one - make.left.equalTo(tempSuperView).offset(leadSpacing); - } - }]; - prev = v; - } - } - else { - MAS_VIEW *prev; - for (int i = 0; i < self.count; i++) { - MAS_VIEW *v = self[i]; - [v mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.equalTo(@(fixedItemLength)); - if (prev) { - if (i == self.count - 1) {//last one - make.bottom.equalTo(tempSuperView).offset(-tailSpacing); - } - else { - CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); - make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); - } - } - else {//first one - make.top.equalTo(tempSuperView).offset(leadSpacing); - } - }]; - prev = v; - } - } -} - -- (MAS_VIEW *)mas_commonSuperviewOfViews -{ - MAS_VIEW *commonSuperview = nil; - MAS_VIEW *previousView = nil; - for (id object in self) { - if ([object isKindOfClass:[MAS_VIEW class]]) { - MAS_VIEW *view = (MAS_VIEW *)object; - if (previousView) { - commonSuperview = [view mas_closestCommonSuperview:commonSuperview]; - } else { - commonSuperview = view; - } - previousView = view; - } - } - NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy."); - return commonSuperview; -} - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h b/iOSProject/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h deleted file mode 100644 index 8b473697..00000000 --- a/iOSProject/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// NSArray+MASShorthandAdditions.h -// Masonry -// -// Created by Jonas Budelmann on 22/07/13. -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. -// - -#import "NSArray+MASAdditions.h" - -#ifdef MAS_SHORTHAND - -/** - * Shorthand array additions without the 'mas_' prefixes, - * only enabled if MAS_SHORTHAND is defined - */ -@interface NSArray (MASShorthandAdditions) - -- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; -- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; -- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; - -@end - -@implementation NSArray (MASShorthandAdditions) - -- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { - return [self mas_makeConstraints:block]; -} - -- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { - return [self mas_updateConstraints:block]; -} - -- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { - return [self mas_remakeConstraints:block]; -} - -@end - -#endif diff --git a/iOSProject/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h b/iOSProject/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h deleted file mode 100644 index 1279b4fd..00000000 --- a/iOSProject/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSLayoutConstraint+MASDebugAdditions.h -// Masonry -// -// Created by Jonas Budelmann on 3/08/13. -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. -// - -#import "MASUtilities.h" - -/** - * makes debug and log output of NSLayoutConstraints more readable - */ -@interface NSLayoutConstraint (MASDebugAdditions) - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m b/iOSProject/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m deleted file mode 100644 index ab539a21..00000000 --- a/iOSProject/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m +++ /dev/null @@ -1,146 +0,0 @@ -// -// NSLayoutConstraint+MASDebugAdditions.m -// Masonry -// -// Created by Jonas Budelmann on 3/08/13. -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. -// - -#import "NSLayoutConstraint+MASDebugAdditions.h" -#import "MASConstraint.h" -#import "MASLayoutConstraint.h" - -@implementation NSLayoutConstraint (MASDebugAdditions) - -#pragma mark - description maps - -+ (NSDictionary *)layoutRelationDescriptionsByValue { - static dispatch_once_t once; - static NSDictionary *descriptionMap; - dispatch_once(&once, ^{ - descriptionMap = @{ - @(NSLayoutRelationEqual) : @"==", - @(NSLayoutRelationGreaterThanOrEqual) : @">=", - @(NSLayoutRelationLessThanOrEqual) : @"<=", - }; - }); - return descriptionMap; -} - -+ (NSDictionary *)layoutAttributeDescriptionsByValue { - static dispatch_once_t once; - static NSDictionary *descriptionMap; - dispatch_once(&once, ^{ - descriptionMap = @{ - @(NSLayoutAttributeTop) : @"top", - @(NSLayoutAttributeLeft) : @"left", - @(NSLayoutAttributeBottom) : @"bottom", - @(NSLayoutAttributeRight) : @"right", - @(NSLayoutAttributeLeading) : @"leading", - @(NSLayoutAttributeTrailing) : @"trailing", - @(NSLayoutAttributeWidth) : @"width", - @(NSLayoutAttributeHeight) : @"height", - @(NSLayoutAttributeCenterX) : @"centerX", - @(NSLayoutAttributeCenterY) : @"centerY", - @(NSLayoutAttributeBaseline) : @"baseline", - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - @(NSLayoutAttributeFirstBaseline) : @"firstBaseline", - @(NSLayoutAttributeLastBaseline) : @"lastBaseline", -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - @(NSLayoutAttributeLeftMargin) : @"leftMargin", - @(NSLayoutAttributeRightMargin) : @"rightMargin", - @(NSLayoutAttributeTopMargin) : @"topMargin", - @(NSLayoutAttributeBottomMargin) : @"bottomMargin", - @(NSLayoutAttributeLeadingMargin) : @"leadingMargin", - @(NSLayoutAttributeTrailingMargin) : @"trailingMargin", - @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins", - @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins", -#endif - - }; - - }); - return descriptionMap; -} - - -+ (NSDictionary *)layoutPriorityDescriptionsByValue { - static dispatch_once_t once; - static NSDictionary *descriptionMap; - dispatch_once(&once, ^{ -#if TARGET_OS_IPHONE || TARGET_OS_TV - descriptionMap = @{ - @(MASLayoutPriorityDefaultHigh) : @"high", - @(MASLayoutPriorityDefaultLow) : @"low", - @(MASLayoutPriorityDefaultMedium) : @"medium", - @(MASLayoutPriorityRequired) : @"required", - @(MASLayoutPriorityFittingSizeLevel) : @"fitting size", - }; -#elif TARGET_OS_MAC - descriptionMap = @{ - @(MASLayoutPriorityDefaultHigh) : @"high", - @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window", - @(MASLayoutPriorityDefaultMedium) : @"medium", - @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put", - @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window", - @(MASLayoutPriorityDefaultLow) : @"low", - @(MASLayoutPriorityFittingSizeCompression) : @"fitting size", - @(MASLayoutPriorityRequired) : @"required", - }; -#endif - }); - return descriptionMap; -} - -#pragma mark - description override - -+ (NSString *)descriptionForObject:(id)obj { - if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) { - return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]]; - } - return [NSString stringWithFormat:@"%@:%p", [obj class], obj]; -} - -- (NSString *)description { - NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"]; - - [description appendString:[self.class descriptionForObject:self]]; - - [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]]; - if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) { - [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]]; - } - - [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]]; - - if (self.secondItem) { - [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]]; - } - if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) { - [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]]; - } - - if (self.multiplier != 1) { - [description appendFormat:@" * %g", self.multiplier]; - } - - if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) { - [description appendFormat:@" %g", self.constant]; - } else { - if (self.constant) { - [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)]; - } - } - - if (self.priority != MASLayoutPriorityRequired) { - [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]]; - } - - [description appendString:@">"]; - return description; -} - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/View+MASAdditions.h b/iOSProject/Pods/Masonry/Masonry/View+MASAdditions.h deleted file mode 100644 index f7343d26..00000000 --- a/iOSProject/Pods/Masonry/Masonry/View+MASAdditions.h +++ /dev/null @@ -1,111 +0,0 @@ -// -// UIView+MASAdditions.h -// Masonry -// -// Created by Jonas Budelmann on 20/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "MASUtilities.h" -#import "MASConstraintMaker.h" -#import "MASViewAttribute.h" - -/** - * Provides constraint maker block - * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs - */ -@interface MAS_VIEW (MASAdditions) - -/** - * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute - */ -@property (nonatomic, strong, readonly) MASViewAttribute *mas_left; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_top; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_right; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_width; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_height; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; -@property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - -@property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - -@property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; - -#endif - -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) - -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0)); -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); -@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); - -#endif - -/** - * a key to associate with this view - */ -@property (nonatomic, strong) id mas_key; - -/** - * Finds the closest common superview between this view and another view - * - * @param view other view - * - * @return returns nil if common superview could not be found - */ -- (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; - -/** - * Creates a MASConstraintMaker with the callee view. - * Any constraints defined are added to the view or the appropriate superview once the block has finished executing - * - * @param block scope within which you can build up the constraints which you wish to apply to the view. - * - * @return Array of created MASConstraints - */ -- (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; - -/** - * Creates a MASConstraintMaker with the callee view. - * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. - * If an existing constraint exists then it will be updated instead. - * - * @param block scope within which you can build up the constraints which you wish to apply to the view. - * - * @return Array of created/updated MASConstraints - */ -- (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; - -/** - * Creates a MASConstraintMaker with the callee view. - * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. - * All constraints previously installed for the view will be removed. - * - * @param block scope within which you can build up the constraints which you wish to apply to the view. - * - * @return Array of created/updated MASConstraints - */ -- (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/View+MASAdditions.m b/iOSProject/Pods/Masonry/Masonry/View+MASAdditions.m deleted file mode 100644 index 4fa07b4f..00000000 --- a/iOSProject/Pods/Masonry/Masonry/View+MASAdditions.m +++ /dev/null @@ -1,186 +0,0 @@ -// -// UIView+MASAdditions.m -// Masonry -// -// Created by Jonas Budelmann on 20/07/13. -// Copyright (c) 2013 cloudling. All rights reserved. -// - -#import "View+MASAdditions.h" -#import - -@implementation MAS_VIEW (MASAdditions) - -- (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *))block { - self.translatesAutoresizingMaskIntoConstraints = NO; - MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; - block(constraintMaker); - return [constraintMaker install]; -} - -- (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *))block { - self.translatesAutoresizingMaskIntoConstraints = NO; - MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; - constraintMaker.updateExisting = YES; - block(constraintMaker); - return [constraintMaker install]; -} - -- (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { - self.translatesAutoresizingMaskIntoConstraints = NO; - MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; - constraintMaker.removeExisting = YES; - block(constraintMaker); - return [constraintMaker install]; -} - -#pragma mark - NSLayoutAttribute properties - -- (MASViewAttribute *)mas_left { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeft]; -} - -- (MASViewAttribute *)mas_top { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTop]; -} - -- (MASViewAttribute *)mas_right { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRight]; -} - -- (MASViewAttribute *)mas_bottom { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottom]; -} - -- (MASViewAttribute *)mas_leading { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeading]; -} - -- (MASViewAttribute *)mas_trailing { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailing]; -} - -- (MASViewAttribute *)mas_width { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeWidth]; -} - -- (MASViewAttribute *)mas_height { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeHeight]; -} - -- (MASViewAttribute *)mas_centerX { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterX]; -} - -- (MASViewAttribute *)mas_centerY { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterY]; -} - -- (MASViewAttribute *)mas_baseline { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBaseline]; -} - -- (MASViewAttribute *(^)(NSLayoutAttribute))mas_attribute -{ - return ^(NSLayoutAttribute attr) { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:attr]; - }; -} - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - -- (MASViewAttribute *)mas_firstBaseline { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeFirstBaseline]; -} -- (MASViewAttribute *)mas_lastBaseline { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLastBaseline]; -} - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - -- (MASViewAttribute *)mas_leftMargin { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin]; -} - -- (MASViewAttribute *)mas_rightMargin { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRightMargin]; -} - -- (MASViewAttribute *)mas_topMargin { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTopMargin]; -} - -- (MASViewAttribute *)mas_bottomMargin { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottomMargin]; -} - -- (MASViewAttribute *)mas_leadingMargin { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeadingMargin]; -} - -- (MASViewAttribute *)mas_trailingMargin { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailingMargin]; -} - -- (MASViewAttribute *)mas_centerXWithinMargins { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterXWithinMargins]; -} - -- (MASViewAttribute *)mas_centerYWithinMargins { - return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterYWithinMargins]; -} - -#endif - -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) - -- (MASViewAttribute *)mas_safeAreaLayoutGuide { - return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; -} -- (MASViewAttribute *)mas_safeAreaLayoutGuideTop { - return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeTop]; -} -- (MASViewAttribute *)mas_safeAreaLayoutGuideBottom { - return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; -} -- (MASViewAttribute *)mas_safeAreaLayoutGuideLeft { - return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeLeft]; -} -- (MASViewAttribute *)mas_safeAreaLayoutGuideRight { - return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeRight]; -} - -#endif - -#pragma mark - associated properties - -- (id)mas_key { - return objc_getAssociatedObject(self, @selector(mas_key)); -} - -- (void)setMas_key:(id)key { - objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - heirachy - -- (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view { - MAS_VIEW *closestCommonSuperview = nil; - - MAS_VIEW *secondViewSuperview = view; - while (!closestCommonSuperview && secondViewSuperview) { - MAS_VIEW *firstViewSuperview = self; - while (!closestCommonSuperview && firstViewSuperview) { - if (secondViewSuperview == firstViewSuperview) { - closestCommonSuperview = secondViewSuperview; - } - firstViewSuperview = firstViewSuperview.superview; - } - secondViewSuperview = secondViewSuperview.superview; - } - return closestCommonSuperview; -} - -@end diff --git a/iOSProject/Pods/Masonry/Masonry/View+MASShorthandAdditions.h b/iOSProject/Pods/Masonry/Masonry/View+MASShorthandAdditions.h deleted file mode 100644 index 1c19a942..00000000 --- a/iOSProject/Pods/Masonry/Masonry/View+MASShorthandAdditions.h +++ /dev/null @@ -1,133 +0,0 @@ -// -// UIView+MASShorthandAdditions.h -// Masonry -// -// Created by Jonas Budelmann on 22/07/13. -// Copyright (c) 2013 Jonas Budelmann. All rights reserved. -// - -#import "View+MASAdditions.h" - -#ifdef MAS_SHORTHAND - -/** - * Shorthand view additions without the 'mas_' prefixes, - * only enabled if MAS_SHORTHAND is defined - */ -@interface MAS_VIEW (MASShorthandAdditions) - -@property (nonatomic, strong, readonly) MASViewAttribute *left; -@property (nonatomic, strong, readonly) MASViewAttribute *top; -@property (nonatomic, strong, readonly) MASViewAttribute *right; -@property (nonatomic, strong, readonly) MASViewAttribute *bottom; -@property (nonatomic, strong, readonly) MASViewAttribute *leading; -@property (nonatomic, strong, readonly) MASViewAttribute *trailing; -@property (nonatomic, strong, readonly) MASViewAttribute *width; -@property (nonatomic, strong, readonly) MASViewAttribute *height; -@property (nonatomic, strong, readonly) MASViewAttribute *centerX; -@property (nonatomic, strong, readonly) MASViewAttribute *centerY; -@property (nonatomic, strong, readonly) MASViewAttribute *baseline; -@property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - -@property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; -@property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - -@property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *topMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; -@property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; -@property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; - -#endif - -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) - -@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); -@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); -@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); -@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); - -#endif - -- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; -- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; -- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; - -@end - -#define MAS_ATTR_FORWARD(attr) \ -- (MASViewAttribute *)attr { \ - return [self mas_##attr]; \ -} - -@implementation MAS_VIEW (MASShorthandAdditions) - -MAS_ATTR_FORWARD(top); -MAS_ATTR_FORWARD(left); -MAS_ATTR_FORWARD(bottom); -MAS_ATTR_FORWARD(right); -MAS_ATTR_FORWARD(leading); -MAS_ATTR_FORWARD(trailing); -MAS_ATTR_FORWARD(width); -MAS_ATTR_FORWARD(height); -MAS_ATTR_FORWARD(centerX); -MAS_ATTR_FORWARD(centerY); -MAS_ATTR_FORWARD(baseline); - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) - -MAS_ATTR_FORWARD(firstBaseline); -MAS_ATTR_FORWARD(lastBaseline); - -#endif - -#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) - -MAS_ATTR_FORWARD(leftMargin); -MAS_ATTR_FORWARD(rightMargin); -MAS_ATTR_FORWARD(topMargin); -MAS_ATTR_FORWARD(bottomMargin); -MAS_ATTR_FORWARD(leadingMargin); -MAS_ATTR_FORWARD(trailingMargin); -MAS_ATTR_FORWARD(centerXWithinMargins); -MAS_ATTR_FORWARD(centerYWithinMargins); - -#endif - -#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) - -MAS_ATTR_FORWARD(safeAreaLayoutGuideTop); -MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom); -MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft); -MAS_ATTR_FORWARD(safeAreaLayoutGuideRight); - -#endif - -- (MASViewAttribute *(^)(NSLayoutAttribute))attribute { - return [self mas_attribute]; -} - -- (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { - return [self mas_makeConstraints:block]; -} - -- (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { - return [self mas_updateConstraints:block]; -} - -- (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { - return [self mas_remakeConstraints:block]; -} - -@end - -#endif diff --git a/iOSProject/Pods/Masonry/Masonry/ViewController+MASAdditions.h b/iOSProject/Pods/Masonry/Masonry/ViewController+MASAdditions.h deleted file mode 100644 index 79fd1fa7..00000000 --- a/iOSProject/Pods/Masonry/Masonry/ViewController+MASAdditions.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// UIViewController+MASAdditions.h -// Masonry -// -// Created by Craig Siemens on 2015-06-23. -// -// - -#import "MASUtilities.h" -#import "MASConstraintMaker.h" -#import "MASViewAttribute.h" - -#ifdef MAS_VIEW_CONTROLLER - -@interface MAS_VIEW_CONTROLLER (MASAdditions) - -/** - * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute - */ -@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; -@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; - - -@end - -#endif diff --git a/iOSProject/Pods/Masonry/Masonry/ViewController+MASAdditions.m b/iOSProject/Pods/Masonry/Masonry/ViewController+MASAdditions.m deleted file mode 100644 index 2f5139fa..00000000 --- a/iOSProject/Pods/Masonry/Masonry/ViewController+MASAdditions.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// UIViewController+MASAdditions.m -// Masonry -// -// Created by Craig Siemens on 2015-06-23. -// -// - -#import "ViewController+MASAdditions.h" - -#ifdef MAS_VIEW_CONTROLLER - -@implementation MAS_VIEW_CONTROLLER (MASAdditions) - -- (MASViewAttribute *)mas_topLayoutGuide { - return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; -} -- (MASViewAttribute *)mas_topLayoutGuideTop { - return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; -} -- (MASViewAttribute *)mas_topLayoutGuideBottom { - return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; -} - -- (MASViewAttribute *)mas_bottomLayoutGuide { - return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; -} -- (MASViewAttribute *)mas_bottomLayoutGuideTop { - return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; -} -- (MASViewAttribute *)mas_bottomLayoutGuideBottom { - return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; -} - - - -@end - -#endif diff --git a/iOSProject/Pods/Masonry/README.md b/iOSProject/Pods/Masonry/README.md deleted file mode 100644 index d4286576..00000000 --- a/iOSProject/Pods/Masonry/README.md +++ /dev/null @@ -1,415 +0,0 @@ -# Masonry [![Build Status](https://travis-ci.org/SnapKit/Masonry.svg?branch=master)](https://travis-ci.org/SnapKit/Masonry) [![Coverage Status](https://img.shields.io/coveralls/SnapKit/Masonry.svg?style=flat-square)](https://coveralls.io/r/SnapKit/Masonry) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) ![Pod Version](https://img.shields.io/cocoapods/v/Masonry.svg?style=flat) - -**Masonry is still actively maintained, we are committed to fixing bugs and merging good quality PRs from the wider community. However if you're using Swift in your project, we recommend using [SnapKit](https://github.com/SnapKit/SnapKit) as it provides better type safety with a simpler API.** - -Masonry is a light-weight layout framework which wraps AutoLayout with a nicer syntax. Masonry has its own layout DSL which provides a chainable way of describing your NSLayoutConstraints which results in layout code that is more concise and readable. -Masonry supports iOS and Mac OS X. - -For examples take a look at the **Masonry iOS Examples** project in the Masonry workspace. You will need to run `pod install` after downloading. - -## What's wrong with NSLayoutConstraints? - -Under the hood Auto Layout is a powerful and flexible way of organising and laying out your views. However creating constraints from code is verbose and not very descriptive. -Imagine a simple example in which you want to have a view fill its superview but inset by 10 pixels on every side -```obj-c -UIView *superview = self.view; - -UIView *view1 = [[UIView alloc] init]; -view1.translatesAutoresizingMaskIntoConstraints = NO; -view1.backgroundColor = [UIColor greenColor]; -[superview addSubview:view1]; - -UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10); - -[superview addConstraints:@[ - - //view1 constraints - [NSLayoutConstraint constraintWithItem:view1 - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:superview - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:padding.top], - - [NSLayoutConstraint constraintWithItem:view1 - attribute:NSLayoutAttributeLeft - relatedBy:NSLayoutRelationEqual - toItem:superview - attribute:NSLayoutAttributeLeft - multiplier:1.0 - constant:padding.left], - - [NSLayoutConstraint constraintWithItem:view1 - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:superview - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:-padding.bottom], - - [NSLayoutConstraint constraintWithItem:view1 - attribute:NSLayoutAttributeRight - relatedBy:NSLayoutRelationEqual - toItem:superview - attribute:NSLayoutAttributeRight - multiplier:1 - constant:-padding.right], - - ]]; -``` -Even with such a simple example the code needed is quite verbose and quickly becomes unreadable when you have more than 2 or 3 views. -Another option is to use Visual Format Language (VFL), which is a bit less long winded. -However the ASCII type syntax has its own pitfalls and its also a bit harder to animate as `NSLayoutConstraint constraintsWithVisualFormat:` returns an array. - -## Prepare to meet your Maker! - -Heres the same constraints created using MASConstraintMaker - -```obj-c -UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10); - -[view1 mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(superview.mas_top).with.offset(padding.top); //with is an optional semantic filler - make.left.equalTo(superview.mas_left).with.offset(padding.left); - make.bottom.equalTo(superview.mas_bottom).with.offset(-padding.bottom); - make.right.equalTo(superview.mas_right).with.offset(-padding.right); -}]; -``` -Or even shorter - -```obj-c -[view1 mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(superview).with.insets(padding); -}]; -``` - -Also note in the first example we had to add the constraints to the superview `[superview addConstraints:...`. -Masonry however will automagically add constraints to the appropriate view. - -Masonry will also call `view1.translatesAutoresizingMaskIntoConstraints = NO;` for you. - -## Not all things are created equal - -> `.equalTo` equivalent to **NSLayoutRelationEqual** - -> `.lessThanOrEqualTo` equivalent to **NSLayoutRelationLessThanOrEqual** - -> `.greaterThanOrEqualTo` equivalent to **NSLayoutRelationGreaterThanOrEqual** - -These three equality constraints accept one argument which can be any of the following: - -#### 1. MASViewAttribute - -```obj-c -make.centerX.lessThanOrEqualTo(view2.mas_left); -``` - -MASViewAttribute | NSLayoutAttribute -------------------------- | -------------------------- -view.mas_left | NSLayoutAttributeLeft -view.mas_right | NSLayoutAttributeRight -view.mas_top | NSLayoutAttributeTop -view.mas_bottom | NSLayoutAttributeBottom -view.mas_leading | NSLayoutAttributeLeading -view.mas_trailing | NSLayoutAttributeTrailing -view.mas_width | NSLayoutAttributeWidth -view.mas_height | NSLayoutAttributeHeight -view.mas_centerX | NSLayoutAttributeCenterX -view.mas_centerY | NSLayoutAttributeCenterY -view.mas_baseline | NSLayoutAttributeBaseline - -#### 2. UIView/NSView - -if you want view.left to be greater than or equal to label.left : -```obj-c -//these two constraints are exactly the same -make.left.greaterThanOrEqualTo(label); -make.left.greaterThanOrEqualTo(label.mas_left); -``` - -#### 3. NSNumber - -Auto Layout allows width and height to be set to constant values. -if you want to set view to have a minimum and maximum width you could pass a number to the equality blocks: -```obj-c -//width >= 200 && width <= 400 -make.width.greaterThanOrEqualTo(@200); -make.width.lessThanOrEqualTo(@400) -``` - -However Auto Layout does not allow alignment attributes such as left, right, centerY etc to be set to constant values. -So if you pass a NSNumber for these attributes Masonry will turn these into constraints relative to the view’s superview ie: -```obj-c -//creates view.left = view.superview.left + 10 -make.left.lessThanOrEqualTo(@10) -``` - -Instead of using NSNumber, you can use primitives and structs to build your constraints, like so: -```obj-c -make.top.mas_equalTo(42); -make.height.mas_equalTo(20); -make.size.mas_equalTo(CGSizeMake(50, 100)); -make.edges.mas_equalTo(UIEdgeInsetsMake(10, 0, 10, 0)); -make.left.mas_equalTo(view).mas_offset(UIEdgeInsetsMake(10, 0, 10, 0)); -``` - -By default, macros which support [autoboxing](https://en.wikipedia.org/wiki/Autoboxing#Autoboxing) are prefixed with `mas_`. Unprefixed versions are available by defining `MAS_SHORTHAND_GLOBALS` before importing Masonry. - -#### 4. NSArray - -An array of a mixture of any of the previous types -```obj-c -make.height.equalTo(@[view1.mas_height, view2.mas_height]); -make.height.equalTo(@[view1, view2]); -make.left.equalTo(@[view1, @100, view3.right]); -```` - -## Learn to prioritize - -> `.priority` allows you to specify an exact priority - -> `.priorityHigh` equivalent to **UILayoutPriorityDefaultHigh** - -> `.priorityMedium` is half way between high and low - -> `.priorityLow` equivalent to **UILayoutPriorityDefaultLow** - -Priorities are can be tacked on to the end of a constraint chain like so: -```obj-c -make.left.greaterThanOrEqualTo(label.mas_left).with.priorityLow(); - -make.top.equalTo(label.mas_top).with.priority(600); -``` - -## Composition, composition, composition - -Masonry also gives you a few convenience methods which create multiple constraints at the same time. These are called MASCompositeConstraints - -#### edges - -```obj-c -// make top, left, bottom, right equal view2 -make.edges.equalTo(view2); - -// make top = superview.top + 5, left = superview.left + 10, -// bottom = superview.bottom - 15, right = superview.right - 20 -make.edges.equalTo(superview).insets(UIEdgeInsetsMake(5, 10, 15, 20)) -``` - -#### size - -```obj-c -// make width and height greater than or equal to titleLabel -make.size.greaterThanOrEqualTo(titleLabel) - -// make width = superview.width + 100, height = superview.height - 50 -make.size.equalTo(superview).sizeOffset(CGSizeMake(100, -50)) -``` - -#### center -```obj-c -// make centerX and centerY = button1 -make.center.equalTo(button1) - -// make centerX = superview.centerX - 5, centerY = superview.centerY + 10 -make.center.equalTo(superview).centerOffset(CGPointMake(-5, 10)) -``` - -You can chain view attributes for increased readability: - -```obj-c -// All edges but the top should equal those of the superview -make.left.right.and.bottom.equalTo(superview); -make.top.equalTo(otherView); -``` - -## Hold on for dear life - -Sometimes you need modify existing constraints in order to animate or remove/replace constraints. -In Masonry there are a few different approaches to updating constraints. - -#### 1. References -You can hold on to a reference of a particular constraint by assigning the result of a constraint make expression to a local variable or a class property. -You could also reference multiple constraints by storing them away in an array. - -```obj-c -// in public/private interface -@property (nonatomic, strong) MASConstraint *topConstraint; - -... - -// when making constraints -[view1 mas_makeConstraints:^(MASConstraintMaker *make) { - self.topConstraint = make.top.equalTo(superview.mas_top).with.offset(padding.top); - make.left.equalTo(superview.mas_left).with.offset(padding.left); -}]; - -... -// then later you can call -[self.topConstraint uninstall]; -``` - -#### 2. mas_updateConstraints -Alternatively if you are only updating the constant value of the constraint you can use the convience method `mas_updateConstraints` instead of `mas_makeConstraints` - -```obj-c -// this is Apple's recommended place for adding/updating constraints -// this method can get called multiple times in response to setNeedsUpdateConstraints -// which can be called by UIKit internally or in your code if you need to trigger an update to your constraints -- (void)updateConstraints { - [self.growingButton mas_updateConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self); - make.width.equalTo(@(self.buttonSize.width)).priorityLow(); - make.height.equalTo(@(self.buttonSize.height)).priorityLow(); - make.width.lessThanOrEqualTo(self); - make.height.lessThanOrEqualTo(self); - }]; - - //according to apple super should be called at end of method - [super updateConstraints]; -} -``` - -### 3. mas_remakeConstraints -`mas_updateConstraints` is useful for updating a set of constraints, but doing anything beyond updating constant values can get exhausting. That's where `mas_remakeConstraints` comes in. - -`mas_remakeConstraints` is similar to `mas_updateConstraints`, but instead of updating constant values, it will remove all of its constraints before installing them again. This lets you provide different constraints without having to keep around references to ones which you want to remove. - -```obj-c -- (void)changeButtonPosition { - [self.button mas_remakeConstraints:^(MASConstraintMaker *make) { - make.size.equalTo(self.buttonSize); - - if (topLeft) { - make.top.and.left.offset(10); - } else { - make.bottom.and.right.offset(-10); - } - }]; -} -``` - -You can find more detailed examples of all three approaches in the **Masonry iOS Examples** project. - -## When the ^&*!@ hits the fan! - -Laying out your views doesn't always goto plan. So when things literally go pear shaped, you don't want to be looking at console output like this: - -```obj-c -Unable to simultaneously satisfy constraints.....blah blah blah.... -( - "=5000)]>", - "", - "", - "" -) - -Will attempt to recover by breaking constraint -=5000)]> -``` - -Masonry adds a category to NSLayoutConstraint which overrides the default implementation of `- (NSString *)description`. -Now you can give meaningful names to views and constraints, and also easily pick out the constraints created by Masonry. - -which means your console output can now look like this: - -```obj-c -Unable to simultaneously satisfy constraints......blah blah blah.... -( - "", - "= 5000>", - "", - "" -) - -Will attempt to recover by breaking constraint -= 5000> -``` - -For an example of how to set this up take a look at the **Masonry iOS Examples** project in the Masonry workspace. - -## Where should I create my constraints? - -```objc -@implementation DIYCustomView - -- (id)init { - self = [super init]; - if (!self) return nil; - - // --- Create your views here --- - self.button = [[UIButton alloc] init]; - - return self; -} - -// tell UIKit that you are using AutoLayout -+ (BOOL)requiresConstraintBasedLayout { - return YES; -} - -// this is Apple's recommended place for adding/updating constraints -- (void)updateConstraints { - - // --- remake/update constraints here - [self.button remakeConstraints:^(MASConstraintMaker *make) { - make.width.equalTo(@(self.buttonSize.width)); - make.height.equalTo(@(self.buttonSize.height)); - }]; - - //according to apple super should be called at end of method - [super updateConstraints]; -} - -- (void)didTapButton:(UIButton *)button { - // --- Do your changes ie change variables that affect your layout etc --- - self.buttonSize = CGSize(200, 200); - - // tell constraints they need updating - [self setNeedsUpdateConstraints]; -} - -@end -``` - -## Installation -Use the [orsome](http://www.youtube.com/watch?v=YaIZF8uUTtk) [CocoaPods](http://github.com/CocoaPods/CocoaPods). - -In your Podfile ->`pod 'Masonry'` - -If you want to use masonry without all those pesky 'mas_' prefixes. Add #define MAS_SHORTHAND to your prefix.pch before importing Masonry ->`#define MAS_SHORTHAND` - -Get busy Masoning ->`#import "Masonry.h"` - -## Code Snippets - -Copy the included code snippets to ``~/Library/Developer/Xcode/UserData/CodeSnippets`` to write your masonry blocks at lightning speed! - -`mas_make` -> ` [<#view#> mas_makeConstraints:^(MASConstraintMaker *make) { - <#code#> - }];` - -`mas_update` -> ` [<#view#> mas_updateConstraints:^(MASConstraintMaker *make) { - <#code#> - }];` - -`mas_remake` -> ` [<#view#> mas_remakeConstraints:^(MASConstraintMaker *make) { - <#code#> - }];` - -## Features -* Not limited to subset of Auto Layout. Anything NSLayoutConstraint can do, Masonry can do too! -* Great debug support, give your views and constraints meaningful names. -* Constraints read like sentences. -* No crazy macro magic. Masonry won't pollute the global namespace with macros. -* Not string or dictionary based and hence you get compile time checking. - -## TODO -* Eye candy -* Mac example project -* More tests and examples - diff --git a/iOSProject/Pods/Pods.xcodeproj/project.pbxproj b/iOSProject/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 8b56200b..00000000 --- a/iOSProject/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,8485 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 48; - objects = { - -/* Begin PBXBuildFile section */ - 00165B02644225D503F585E39D462662 /* MJRefreshHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA561E62E1A699F737E182D351E7C23 /* MJRefreshHeader.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0067C699B121BB4499BBAC71CEA9895B /* YYFrameImage.m in Sources */ = {isa = PBXBuildFile; fileRef = EBE6E45C88F154504A9B57EE06FD6C07 /* YYFrameImage.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 016C19531EE6B86129B36462C79EC7C6 /* SDWebImageCoderHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FC10A478D3C23161950BC7BED2403715 /* SDWebImageCoderHelper.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 018965FB43AF7526BDC561C15D5D55B4 /* MOFSDatePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E7218A358355763AC5FBF1584E8A81 /* MOFSDatePicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 01D4B0F5EA31B158325E058CF6623B9A /* NSBundle+HMEmoticon.m in Sources */ = {isa = PBXBuildFile; fileRef = 836836CA6D3F03D96B7730D86E1CB4F7 /* NSBundle+HMEmoticon.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 01E09711F001C49F92A97060414E262B /* MASCompositeConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E8932FE2CB1AD5AAF2E285EABBD88DE /* MASCompositeConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0214246CCB1FF7182F7222B9CCDF8FCB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 0222F804E01CA646D7805E98684CCBF0 /* YYTextLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 322A1C7F7847A547D10AD82008EB11A8 /* YYTextLayout.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 026C9CD242D3321B12D50F933B708688 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A56F90BCB402100D8F205FD69ED7973 /* MobileCoreServices.framework */; }; - 02FEF1136F0F1F4B62851155E156AB41 /* UIFont+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = DB8D0BF01287F2DF52ABB6E1615CEDEF /* UIFont+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 035A654BF7AA40B3F24E21C081EEEC07 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 03AA64D95C34F164CF97D589E8367C75 /* Pods-iOSProject-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 52313425657EDC5AB8D7BB5EC8C33668 /* Pods-iOSProject-dummy.m */; }; - 0407F59BDF3F4BD9362D3CD26345BC3D /* UIView+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3D65892EB04B2A3DF6669C296945A9 /* UIView+CYLTabBarControllerExtention.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 04CC3AD81FB82495F493DCB081D85046 /* ZFPlayerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3114E396DC236CB92EE5BECE8FAA0A9E /* ZFPlayerView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 064EC4AA8FCCD08F2037037B1E672DBF /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 90EF5233DEA29F718102E78CCAB6025A /* AFURLSessionManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 066C90C3BF551D839E70586BC140B2AD /* YYTextEffectWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 69BC0BB38D607E4184FA10ECAD8BB6EA /* YYTextEffectWindow.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0678243B17657532638883CAAA4194C3 /* UIViewController+ZJScrollPageController.m in Sources */ = {isa = PBXBuildFile; fileRef = E01B2B13841239604210F7F14F96771F /* UIViewController+ZJScrollPageController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 06DCFD8FE8131173C2ACCA6659386D50 /* LxGridView-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F4D8903EA1B84828CDDF6572E1E4003 /* LxGridView-dummy.m */; }; - 07590E4B7A95D750BC55AB8892847CD8 /* ASIS3ServiceRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = AC0B9573AF130E0F34E2BEA61B549AF5 /* ASIS3ServiceRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 08C263DF6F9031C2ED55A0D16722652A /* IQUIView+IQKeyboardToolbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 747F9F799F0B700694CD85F5719AD19A /* IQUIView+IQKeyboardToolbar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 08F608084CBF01ECF45F66ED9F1FA92F /* SDWebImageCompat.m in Sources */ = {isa = PBXBuildFile; fileRef = 411BD4C6AFD29EC701C3AB1C32B17537 /* SDWebImageCompat.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 08FDC2AD7ED2C97EDF4AF85066B3FE1F /* HMScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7CF876D689038F6E9030FEA7AAA45AE3 /* HMScannerViewController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 091508594F0B139F62092E2A2B805575 /* YYSpriteSheetImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 602EC22D332F11DA4F99856D7EBE98A6 /* YYSpriteSheetImage.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 097AE45DBDF26E2A1345907C83748EBA /* UIImage+MultiFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = FF7F1C10A7E7EE3B2022487B7830384D /* UIImage+MultiFormat.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 09D84B5D8051B29A9522E0073B750B47 /* UIDevice+FCUUID.m in Sources */ = {isa = PBXBuildFile; fileRef = C68109483041F5637F46917C4C46E50E /* UIDevice+FCUUID.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0A1CE7CE58B28609B573D4058ABDD616 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E8CE76232520EC945D8EB7C70E9D7CE /* AFSecurityPolicy.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0A3A685BD9A56E789E9EA83A1FECBBAE /* MJRefreshAutoGifFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = B7A46EEAF5B07F8DE4BC0A75CA833A0E /* MJRefreshAutoGifFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0AA98DE9CDD7B040834F813A5D1E89EF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 0ADBFEB0D1D6E1355492BD048A29DC1C /* HMEmoticonToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA4174F7C9D7FE7F4B092CE3335EAEB1 /* HMEmoticonToolbar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0B76DE56DB38A989F4BB7AD3D611EA2A /* UIView+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = C7C1F1F3C2116488C1773F31B2D890A9 /* UIView+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0BB77BAC640E11231C16AAC1A7B426E6 /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5987A0D6BB3B5276E79A941A8128426B /* ASIHTTPRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0CBC841F08772C6B4B4F92089A510439 /* YYTextParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 39221870455CF6CFF22802E4CBFE154E /* YYTextParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0CBD7DB26ABF8C8A145AEDA8A2F3F3BE /* YYCategories-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A7B0E469DA766E168AE1E1F39E2077F /* YYCategories-dummy.m */; }; - 0CDEEC3BC3F3EE9215EFDBB570803626 /* YYSentinel.h in Headers */ = {isa = PBXBuildFile; fileRef = D75EB3ADB8BFF8779BC1C9CDD3F32B32 /* YYSentinel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0D5D421EC36C0CE69E9554EBA2395E7C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 0DA584019CB7E88806A81CBED9CA678F /* WebViewJavascriptBridge_JS.h in Headers */ = {isa = PBXBuildFile; fileRef = 904E0A05C386FEC170BA291A01763992 /* WebViewJavascriptBridge_JS.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 0DAE61EE8CFDFB7FB297590A54105F92 /* MJPropertyType.m in Sources */ = {isa = PBXBuildFile; fileRef = A01E2C9D4FB430587CF8DB12688FC64B /* MJPropertyType.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0E5FCF4816B3FD49DF71E68490C3D951 /* HMEmoticonTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 79B786935968F91659410E8D541C2BE6 /* HMEmoticonTextView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0ED58D2A5AAECE08B4C17BF909301570 /* CYLTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = DDADBA7FED7FBCF110FBB90862F5BA94 /* CYLTabBarController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0F1BE281A5D6542F9B71A485F8571EE6 /* YYTextRubyAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 96A2061E7EC002E7ED34D69C34E9840F /* YYTextRubyAnnotation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 0F400B5F556C93860ED272376FEDAAAD /* ASIS3BucketRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = D91930F62D6B374E87FF3CC43A5CF96B /* ASIS3BucketRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0F71F9B33F0C5B4C94C3CFA7C094824A /* HMScannerBorder.h in Headers */ = {isa = PBXBuildFile; fileRef = C98AD50296926635DE7E049376578798 /* HMScannerBorder.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0FF11CB7F99180F4519D7B3CE43AC4E7 /* YYTextInput.m in Sources */ = {isa = PBXBuildFile; fileRef = D41D1D8DE274C2E5BC0EC3A325CD2EA7 /* YYTextInput.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 1040375FC84808800647F8DAEDB20B41 /* UIApplication+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = EE2BD7300079355731FF4FC5BF955307 /* UIApplication+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 10CCE3EE77476C2DA31FCE8FA547E723 /* ASIS3Request.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D665BA14DC1E5EDE0C741E763664C7F /* ASIS3Request.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 10E31F30686982D46E83B9BE1938D344 /* NSParagraphStyle+YYText.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DB0FEA16DA960E07BBD3F783C4C5963 /* NSParagraphStyle+YYText.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 118833C5C94188CFCB56FFF900ACC011 /* NSData+ImageContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = A1241B4C4C1FAB0163D05E3A3BF6B4CF /* NSData+ImageContentType.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 11B73E65816ACF42E0EC7D407FAFFFD8 /* TDHomeViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C5AB013AAF6D7E9A137A4CE3A3FE3AC /* TDHomeViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 11EAFFFF93AEB5E3C77BB9BFBB9D2890 /* NSBundle+TZImagePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 926F78A88F80F6A64D53C9CB664DC29F /* NSBundle+TZImagePicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 11F2A5CEE35A985066119917D56180B2 /* TZAssetCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1CA718CE0F5EAA1648BFE8E3188F2B /* TZAssetCell.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 122FB01A3242CACC75C211532547EBEA /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCE7E808EF0C8820E9A3408AB0953738 /* CoreText.framework */; }; - 126962DF9E1FA4A64F0C1F601F952301 /* TZVideoPlayerController.h in Headers */ = {isa = PBXBuildFile; fileRef = C180ED52EE520A2F430DCC25BB5220D2 /* TZVideoPlayerController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 12B3F6AFD21972962AC57986FF842EFF /* ASValueTrackingSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = D9A19C6D1C2C1D33214AA19144F0ACF7 /* ASValueTrackingSlider.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 12FCB056A2B7051B0D91B16CAFE85C1D /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 585206702AEABCBC79D3D609DD122D60 /* UIRefreshControl+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 1341A7AC2439CB63D459D32EF985A414 /* UIImage+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = B060D0EE1DBCDC43B10B0789807E247F /* UIImage+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1386EEB86AEAB2F38CC689CCB85DA169 /* FCUUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 2FBA809DCC713C050568DD18E2485752 /* FCUUID.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 139A9583FCF407CBC6E944BCFEBCC0F5 /* NSAttributedString+YYText.h in Headers */ = {isa = PBXBuildFile; fileRef = 8739AF26D66A7EFF1080289B8766A59D /* NSAttributedString+YYText.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 149E5412AC3CAF625BE3BDDD01FAAA4E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 14B65CE3038761FA8F6F5D1ECED6A562 /* NSArray+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1A8EE7F66FAFAE9FC1ABDFCF1155CD /* NSArray+MASAdditions.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 15252B85DC915BFA75AF6555C3B43B2A /* NSData+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 95EEF74C2E88FEFD843FBD70D1C298E2 /* NSData+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 1615F44139A14CEC7C82D546361B0609 /* MJRefresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 928E2B8EFD048DDCFDED1C6B326B3610 /* MJRefresh.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 161B3785F561102FEFC4411D7F83DD50 /* MJRefreshStateHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = BE7CC8625902334CF2F1BEA59955B8A5 /* MJRefreshStateHeader.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 1640FA08AD4AF25C3E122354EDA931EA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C05F18C0A82CFACE63D733D13171AE /* AppDelegate.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 16E50B9593E4B30DB2F2E2718A0DD2A6 /* UIImage+MultiFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = C6CFE3543084BBA2BCFFF7B7D4E9D7FB /* UIImage+MultiFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 17045EA58EB53C66039B73AFDA4BB11F /* IQUITextFieldView+Additions.h in Headers */ = {isa = PBXBuildFile; fileRef = A54E2FE69927E9C4208E88CC7B6F4ACF /* IQUITextFieldView+Additions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 17172BE942E3D58BB8127724D38F6A66 /* UINavigationController+M13ProgressViewBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 1986E9400068DB3E067D656307FE950F /* UINavigationController+M13ProgressViewBar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 17843C0E2C8339405FF8566A9B6D2280 /* ASICacheDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D47FAEBB9BAD519D7C2DEA46391DC3F /* ASICacheDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 17D8B1FA2067822FFA036A682158CBD9 /* TAPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A27F9B1580F6F7102D9AC20780D119 /* TAPageControl.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 17E74D623462991F19748A7F99CF8ED6 /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F7166F8E6DD66D9E46AE595884AE4247 /* UIWebView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 18003F425F34BC62C8906C8B52156ECD /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAB6C2DC371C13844619BA332C5074FE /* CoreImage.framework */; }; - 182B0B2D096D15F9A991DBF6B3CE8BE8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 18C8E34C86A7647F7E7949E3293E5E08 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 19CFCF718B674B91847980FA20429558 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DF7859AD9FCF8D5D9A3C2A3202B969B4 /* AFNetworkReachabilityManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 19F42D3113709CD44DA3923884774BB8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 1A0522ACF2781856CBA1500F7D1893CF /* CYLConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A434D7CB260C42DFBF5C8B5E6D390F3 /* CYLConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1A12AC09DAEE727DBD9D111A2B098516 /* IQKeyboardReturnKeyHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A4049539B1D6D0012835DFC6E51FF2D /* IQKeyboardReturnKeyHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1AB4C21977AAE6A5970EE847DBC031A2 /* ZFFileModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 283622CC1F8E1C4A04F1B4EFC0AAFF84 /* ZFFileModel.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 1AC6DFA672F1EA3E557892813E04D84C /* Reachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 858458E87A836152AFF15601508CB689 /* Reachability.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1AF513D8D71B663D5422760106B13723 /* MASConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DEBCE6460C2A1F5E42D198F8EE2778E /* MASConstraint.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 1C23A9A31EAA38A4D9BE3E3DB73CDEDC /* ZJScrollSegmentView.h in Headers */ = {isa = PBXBuildFile; fileRef = F342C67D8302079E15C156D5D674D324 /* ZJScrollSegmentView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1C31F1075C96DDED3254C34270D2E9FD /* YYImage.h in Headers */ = {isa = PBXBuildFile; fileRef = DE3409D14D7C231F37989DE430640304 /* YYImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1C76817FA5353D989D7BC33E8C5997B5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */; }; - 1CFAD8FA586B84F3F6F8F56A79B98608 /* UIView+ZJFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EE21F66DA87504043B8A7C86F94E1FC /* UIView+ZJFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1D962112402DD432D933424B9AAC845F /* ASIFormDataRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BABB4DEC01A24250E13622C900A1E59 /* ASIFormDataRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1E1B34EBFE53DAE6B7D58FA84E33172B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3CEABA08CDCFD39F7C438F7A0AB9740 /* MediaPlayer.framework */; }; - 1F3BD3BC28432BB5E2F73501E06E4579 /* MASUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0592F2A4396E17E230F396DA96FA02 /* MASUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1F8FEA93407CEC682A2C0C282CDEAD89 /* MJProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = FC92409872C374DFC270DF1E67EC5CFC /* MJProperty.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1F9C28BF73EBA28DFF93D84C3CA4406E /* UIFont+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 822B6730C5495CD6416157D79B01DA61 /* UIFont+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 2000F4189F47E6AEE3E0930D3C80BD24 /* MOFSToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 048823A9FB7BB13C5F4793501E8B35A2 /* MOFSToolbar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 2012864C735C3DD88ECE425F6C981F6B /* FMDatabasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = A0C50DEE4F91E086B449D8BD39366118 /* FMDatabasePool.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2059D33DEBB8EB19DE50C7AD81FA20F7 /* M13ProgressViewStripedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = E2366AE40114E5F92A6EFABE706E86CC /* M13ProgressViewStripedBar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 20ACFAE2D5798B1BA89EBB82477CF4B4 /* YYTextLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 1006C24C3948018333AB91D69A2264F0 /* YYTextLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 20D60D89A4C3BC199835F099ED7EECB2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 20EB55C7F6500666DA055783E6803BCE /* MJExtension-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 774BAF6634C4F95BE5FB8BA104E883D6 /* MJExtension-dummy.m */; }; - 211646AEE68A3577495B0DF917A0DCDC /* AFImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = B1BFACFE06813FC13873055948130CB5 /* AFImageDownloader.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 21E06336EFC07A67E0B24791D89B61FE /* YYTextRunDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AD0CF66E275F4EFBAD0B13DD283E28A /* YYTextRunDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 229FB7EB87B33AAAB8DE0F7DC1D9B1FB /* Toast.h in Headers */ = {isa = PBXBuildFile; fileRef = E4847F643EF5321DA6B8472EDEABD54A /* Toast.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 22A494F78AA11235934C2D1F93DE4B7B /* TZImageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A902DCEC79AEC6280BCDAA3F36453A9A /* TZImageManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 23244F8C874C9E74D6B65AF973C485DE /* MMMaterialDesignSpinner.m in Sources */ = {isa = PBXBuildFile; fileRef = D6CABFE8A0532E0815E9719529A59933 /* MMMaterialDesignSpinner.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 234E79261AC257C75B8644DA099FF1C2 /* MJRefreshFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 07ADBC18852169F59915CE309643D077 /* MJRefreshFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 2357DDC85500B4F45E37E411B596F562 /* NSObject+MJKeyValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 11B1A3C787AA83676DAA6C04BB7B5C10 /* NSObject+MJKeyValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 236524396AB978EB013E1EDB702DB0D4 /* MJRefreshBackNormalFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = C91D64ED65F125A48C77B0341F50B98D /* MJRefreshBackNormalFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 248C1B7EDBBF40C0C580F32E34313C12 /* HMEmoticonCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 37112105D58885CF692E67995B289BCA /* HMEmoticonCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24D30F880C12CCB385A502BB9FC3D5A6 /* ZFCommonHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 84FFE1E3C74972FE2F4EC9C87402600A /* ZFCommonHelper.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 24D62FF5048CF5339C87189530FFE3D4 /* MJRefreshBackStateFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B435BD95081871A2E057C3F9F5689F8 /* MJRefreshBackStateFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 255900005B71B3B1CCF27BDDBF13EDA6 /* SDWebImageCodersManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 82C1A6930B5503E5FF3B94BA51FD9310 /* SDWebImageCodersManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 25F8785E8720975E1BC807D5CBAE1711 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 2612D2B9BEA56B8CB2B361AA0BAB599F /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = B99EB8A6BFF4D7A22BEE8BB79624ED66 /* UIButton+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 262F09111C574E80A4C77C5FC75D2FC5 /* IQUITextFieldView+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = E082A8E295AB6093829176DDC77D1996 /* IQUITextFieldView+Additions.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 265C8428AEA2239BAF160746DC75D269 /* TAAnimatedDotView.h in Headers */ = {isa = PBXBuildFile; fileRef = 601E8D270F8B1698017F4C325FA1EFD6 /* TAAnimatedDotView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 271AE5A47E1BEC9EF4B0FCC26A783092 /* M13ProgressViewPie.m in Sources */ = {isa = PBXBuildFile; fileRef = BE280BA53112A96F310420776A78E6D7 /* M13ProgressViewPie.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 272C9D917150C329E01B03CDD05CD7DF /* ASICloudFilesRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 898FB3B98A4E9F506A5B19DA7EFB124B /* ASICloudFilesRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 27A19A74901197C453148CF5ADDF16D3 /* Toast-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 634BB9F175B46CBE6155C5F159CCE537 /* Toast-dummy.m */; }; - 284C694DEC772709AC30C4F716679890 /* M13ProgressViewRadiative.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C86828CC51CDE0A5996A774CAE23B46 /* M13ProgressViewRadiative.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 28B30D7AF077B7BBD7361FB6AC3AA2BC /* IQBarButtonItem.h in Headers */ = {isa = PBXBuildFile; fileRef = A3BE083BB10468DDFE0DCA6CC58C8B73 /* IQBarButtonItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 29E64E4E61EDC1DE1DD532D24388CD2C /* YYImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F91F9216AEC900D928FAC8DF17F6B24 /* YYImage.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 2AC677C7D32F72030B81CA00F24F65FD /* MJRefreshHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = FD38D97321405B64F47430E1380AD1F7 /* MJRefreshHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2B1CC3DEC1BDF26E12315CCFA89366E3 /* HMEmoticonTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D9AD1C76B43E04E0B7F8A1375AA58F /* HMEmoticonTipView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 2B20A7A457F69EA4CFEC2DB9CFB37FC9 /* NSBundle+MJRefresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 046432722C1F2197151D62219498F9EB /* NSBundle+MJRefresh.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2B39DFC8035B900C53C033C9C071B88F /* TZImageCropManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E71B72FCFDE8D0777AFD22FC842B23F /* TZImageCropManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2B64DE0094F838E57AF929C406EE60C7 /* UIDevice+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = B86A01A7E22D5470F30A0115DEA77FB1 /* UIDevice+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2BAE1C17B8C1948A8B06E4A97CA50794 /* TZAssetModel.h in Headers */ = {isa = PBXBuildFile; fileRef = C0BB60818347CFE32CEBDB113779A891 /* TZAssetModel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2BB5AD6F438779BEE675D0D93ABBAEE6 /* SDWebImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AE6177E60B9D4FA2C3C684EEC9E9AA94 /* SDWebImageManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 2BCD3F861A5F4CF448072C4692AD130D /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CE816BC163F9E7124C5CD2372072AA7 /* UIImageView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 2C41E93CF9F63753E9F5D4AF7410C9E6 /* FMDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = DE62A0661EA434BA8836B2148A6BA4BF /* FMDatabase.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 2DB40A53BA9F7123F16CF6852BFA5138 /* HMEmoticon.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C42811AB134EBEB0BB6F333E9C79400 /* HMEmoticon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2DF08EB0B649C1647F6BA03431F30D5E /* HMEmoticonInputView.h in Headers */ = {isa = PBXBuildFile; fileRef = C8493B091ABAFAD6044260858CA7AB1C /* HMEmoticonInputView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2E41E97A12C14653C0946A443B7150B9 /* UIButton+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB040A0795B9BF944B255F2BF1A054C /* UIButton+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2EA3F0B6F3F7E034227EC992AA4CCC6E /* NSDictionary+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 442C285D8F51F732D1875188CB60E9DD /* NSDictionary+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2EBAA518CB8B2DAF89A63637091D4615 /* UIButton+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = CF0CD53305BC85F133C04AB2A3050A7E /* UIButton+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2ED7C634876890E81867A3A62E01B2F0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */; }; - 2F6085166A2CDCE306BBE2DDDF737BE8 /* M13ProgressViewSegmentedBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D2F73D1100411165702F071A2405DFD /* M13ProgressViewSegmentedBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2FA1225772B1465912FC130D9AA70512 /* M13ProgressViewImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F56D148B50DC60B1FA459981F027070 /* M13ProgressViewImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 302CD6E1132D7C6ABDB789ED4BF3551A /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 34C9F06C68029BADDDAA3F989CCEF3B2 /* WebViewJavascriptBridge.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3046977628F90F18E0C16226B3E9CC66 /* MJRefreshNormalHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A9FADFA65C3CAF11B0CFE468E9A5D43 /* MJRefreshNormalHeader.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3110520F43E052EEB23A57FF7A874B79 /* ASIProgressDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B55E4CC5C651EA27F71065F61C61AEF2 /* ASIProgressDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 318D2F03BC67B5A390F4803923C7B269 /* HMEmoticonToolbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 27584B3B58CC2FA142B0267FC6512F5E /* HMEmoticonToolbar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 31A9E5DFDE1507AE1CD807EFDE72FF25 /* DWBubbleMenuButton-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B907F5092804F49D8050CFB4B78A58A /* DWBubbleMenuButton-dummy.m */; }; - 325BF84530FBB7EEB6A95361EA69DCE8 /* YYCategories.h in Headers */ = {isa = PBXBuildFile; fileRef = D753604D87F7781A6B9B89DC579984BF /* YYCategories.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 33502CA64BCF5D88E90C4721FDFAD79B /* NSThread+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = B9A61749C05FC41C56BCBFCE5B440DAF /* NSThread+YYAdd.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 340D0175144A79304C3869341F0D1957 /* TADotView.m in Sources */ = {isa = PBXBuildFile; fileRef = A4A448BA3C82A65BDC33D47DE59AC744 /* TADotView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 34B22D755CA7E16A822E9C09ACFBECD9 /* NSObject+MJKeyValue.m in Sources */ = {isa = PBXBuildFile; fileRef = BC2856C8B301AB0A243B66C17A1F356F /* NSObject+MJKeyValue.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 350FB2B6ADD5C12735ACE581EAAB30B5 /* MOFSPickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 30ABD7956C35F060AD4FF103820F28B6 /* MOFSPickerManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3521D1A2D58CF061E3EE1DD41B9450C7 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E82B140EA99038E1AFB7EC301C91B2 /* ImageIO.framework */; }; - 3627A172165A56A2E020DCAFECC5B61E /* TZLocationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CC9B12DF3458832BF9970F1288E40011 /* TZLocationManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 36DF9FAD178F987F4EBE91DCEDF8542E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 37AD6D1BC7A7B63C2BA7B38DB1B7A1F5 /* M13ProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = 64CDF2B74590D417E77483B0557C395D /* M13ProgressHUD.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 38755177CB6FCEECF5B94FAAFE6B54F1 /* UIApplication+M13ProgressSuite.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F515A320FEDD07E998069523FCCAC17 /* UIApplication+M13ProgressSuite.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3882FE4E010F4E8CAAA6C62094BE2BFD /* UIView+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 370A38ED08983AFC12268A6293D65FB9 /* UIView+Layout.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 391427C49ACE54B991567FB2112733AA /* ZJSegmentStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A2EAB51A89FD8CCA3B07A7E73F510B6 /* ZJSegmentStyle.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 398A5C11EFB816892FD5E18AD24F03D4 /* FMResultSet.h in Headers */ = {isa = PBXBuildFile; fileRef = D5FC73682194D54EF2437A7C07B9295F /* FMResultSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 39A79DD6C7781F9550ACA2F6B7E6C025 /* WebViewJavascriptBridge-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E1D840749E3227A5B7F9602B936BD634 /* WebViewJavascriptBridge-dummy.m */; }; - 39C9BEF6A8CFDA39A702CE10EB423609 /* HMEmoticonManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AA8B21DFE43CD9F290F6C8F6D9001F3 /* HMEmoticonManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 39F761091E283830FB06FF3F1411CDC6 /* UIBezierPath+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = E5DF33518F3C1D5FB8684D9D36790FBF /* UIBezierPath+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 39FC626F56E3A6753F9ED5681950AB4B /* NSObject+YYAddForKVO.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DF8DCC596367595B76B7524E5504D5B /* NSObject+YYAddForKVO.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3A00D3DC2BE5370FB717E57DCDAF80E2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 3A12A8E49A17C94B3A8CB36E6B10E8DE /* UIPasteboard+YYText.m in Sources */ = {isa = PBXBuildFile; fileRef = FB27FD60C7AC57A17AB2E8EAEC956D48 /* UIPasteboard+YYText.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3A135E858450F155E28A1F19CF0D0332 /* NSObject+MJProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 39261A9C29C19403297C88DA37C2FB4C /* NSObject+MJProperty.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3A94AB6947C689C0F50FF79BEA6D1350 /* HMQRCodeScanner-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E7D3E8B5C2A2C9AA699AF6CED10C489B /* HMQRCodeScanner-dummy.m */; }; - 3AB3A7BF3DFD8205B119FC73E421D55C /* MMMaterialDesignSpinner.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B87D071428437E4E596E097F29DEE8B /* MMMaterialDesignSpinner.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3AC4FE82018D43615FEB7EBF25133503 /* UIViewController+ZFPlayerRotation.m in Sources */ = {isa = PBXBuildFile; fileRef = D247A195202A5C77AC8B0F92A540ED47 /* UIViewController+ZFPlayerRotation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3B3D8651714B980D3CB82D80BA9FAC33 /* SDWebImageFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE78575F484C9556087F5799E026B14 /* SDWebImageFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3B8BDFC4402CE965474003299DF415A6 /* UIImageView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CC3905753CA39110BB71FBF85DF2FEC /* UIImageView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3BD0A703D4A22A494572399EC411B647 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C04096FC91CE40B6991D04A9CFF0A18A /* Security.framework */; }; - 3C7EF1D2AEC29B9D59500FF99805A65A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 3CE218638D274EB343D3800A33FA7569 /* UIApplication+M13ProgressSuite.h in Headers */ = {isa = PBXBuildFile; fileRef = 6907255A28D24C41C7A558CF3CE783E8 /* UIApplication+M13ProgressSuite.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3CEC16FD15563EF33A7922C28ACAEC80 /* YYTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 595CF889C0406EEEFA1595C7CBB100D0 /* YYTextView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3D05531F7D98CB83A5E30295EC1CA5ED /* GVUserDefaults.h in Headers */ = {isa = PBXBuildFile; fileRef = E63CD75603E23077B63CE98668916A48 /* GVUserDefaults.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3D2D665F1A94CA1283684699F1CC880D /* M13ProgressConsole.m in Sources */ = {isa = PBXBuildFile; fileRef = 07709766C62F078D0712AED1EF7BCAE2 /* M13ProgressConsole.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3D51A7D14E04DEA3F615267326D9DF39 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 3D8CE388A3265267C496FD023AAADF03 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F01F59E9E9E5D8EABD190F4954B8E8ED /* AssetsLibrary.framework */; }; - 3DC28D7C95618F5FA2A516A8BA11C6D1 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13E1FA4A5CFFBCD4C3C81BA77009FC14 /* CoreFoundation.framework */; }; - 3E83B48800BE69AEB51EF882BF0228ED /* ZJContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ECA81B3F9CF5671F90DC6E8881725B1 /* ZJContentView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3F9B7B96F95416ABF95F00E750EDB4FC /* IQUIView+Hierarchy.m in Sources */ = {isa = PBXBuildFile; fileRef = F6285D643ED016FAB0C92D119FE01FBC /* IQUIView+Hierarchy.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3FE54E601C84BA38C879412CBC08BA7B /* UIButton+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EB84E4F71F1A20373C5927F16B9C3BD /* UIButton+WebCache.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 3FECFDE87253334FA356C4898AA1478D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 400A503998B8B681E66DC5A484A049B8 /* ASIHTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = F65C11AC0721B2A15DCF4A359A7D0D2D /* ASIHTTPRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 405C60186C5D7BADBF698A8B2210A8C7 /* ASINSXMLParserCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = E1AD8649AE776041AC6080AC3A78C9A0 /* ASINSXMLParserCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4092F70848E9407F2EFB655F3647B375 /* SDWebImageOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8349CE1F55F82141AA7EEBC0926DBD12 /* SDWebImageOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4140D98EFA34F19E4D2A885A34C28B66 /* CALayer+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EABE59547892AC3F2525B405242B6CA /* CALayer+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4142D40D641DA8AFF5F8B81B2529E66B /* UIView+SDExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 60426ED0D1C2CCF640F5CDE9712F06B2 /* UIView+SDExtension.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4165D8B139A63C9697508A678E579C80 /* ASIAuthenticationDialog.h in Headers */ = {isa = PBXBuildFile; fileRef = 1172D3802B188B8D4966ED5202AC6D71 /* ASIAuthenticationDialog.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 41A2A2DE9908D4AA737BDAEB0F48FABC /* SDWebImageImageIOCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = B7979D2F763F637BF0A8FAE3B93AF8CE /* SDWebImageImageIOCoder.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4260A32EF33F1EE3E3BAF577C7F7ABE6 /* M13ProgressViewMetro.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A758CBD50F53938C1EA8864CF9732B /* M13ProgressViewMetro.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 429A5351F947A4C1DBEEA2EA405903EA /* YYTextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = FF4EE9D7B19F6CD2C0EFEA24502D31B6 /* YYTextInput.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 432DD4D64F82A8102F300273FF319B9F /* LxGridViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = FCE7DCF929068DDA22856C03E2B13337 /* LxGridViewCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4348D4606EBC040B051D7C705CF11C82 /* GDataXMLNode.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B82406C4CF2F3E41C951F375FDFC45 /* GDataXMLNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4356505F4CA29DEAB3A7081A1DAD66A3 /* NSArray+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = E3D07FA37E68C7FBC5D4AE3CF05ECF2F /* NSArray+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 43643239F78BFE4405AD5092ACC1B176 /* IQPreviousNextView.h in Headers */ = {isa = PBXBuildFile; fileRef = E5DDF5437AF1228F6E7364B135CDF4A7 /* IQPreviousNextView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 43BB3CC17FFE6B04E64DDF0057F649CA /* NSNumber+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CB97EBFB89EE626A7905D8A427626C6 /* NSNumber+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 43BC67837AA0A22C5EC3D93CB1FC3945 /* YYTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = FB426B4B7E37EF030D11702F62CE2029 /* YYTransaction.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 44B02C1031D0E64D42278B2E8BCEF40F /* Reachability-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FAAEFBD3BED098B6EE7DFBC7477503A /* Reachability-dummy.m */; }; - 45003396B3D21475F6CF7B3E582AB0A6 /* YYCGUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 086EDCDD88AEE798BF922F4ABB249BC6 /* YYCGUtilities.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 45539DE0654B869A6229507CCC743263 /* ZJContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C71009EF54A4F4DB4D6B4BE10B10F34 /* ZJContentView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 457A167D598A42BEB0F1D94345BA3AC1 /* TZAssetModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 56D5CFA757E346D2AE905A50475E6103 /* TZAssetModel.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 46401F3C7FF0B0CFE2E9B14914780835 /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B1D2478ABB83ABD0A6ABA98A67EB320 /* AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 466869E41EB306F74C8A6E87CC1539BF /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA6845120F2D053B76D55EB874BEFDE8 /* ViewController+MASAdditions.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4767F697CD3F2B59EF4E421FABE74D6E /* M13ProgressViewPie.h in Headers */ = {isa = PBXBuildFile; fileRef = FF646CF3EF8EF32A3B4A758C694C8F5D /* M13ProgressViewPie.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 478820AC4F097839804FEE3F4C3EE38C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 479CB538F248C324C2BB4348BCFB8318 /* UITabBarController+ZFPlayerRotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FCD177C2E293B3CB16FAF50E58E15D9 /* UITabBarController+ZFPlayerRotation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 47A96DDD9D7CD5E6B3C032F2FAB25835 /* YYLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6798CFFDA1BA99912BE8F189EA297759 /* YYLabel.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 47BCD56DE74472D94359FAE1CB7C69E5 /* HMScannerController.h in Headers */ = {isa = PBXBuildFile; fileRef = B9224432A4FA3345BBA89B785672AA62 /* HMScannerController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 47F8C7B786F283256FF744B2AB7608D6 /* YYText.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FBD84457C9F49BADCC0EF122697BB92 /* YYText.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4861750CF29F04F5CEE6016947C24A49 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 4893A1231FE1BBD188E65987D46A2874 /* GDataXMLNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 1359B5BB443E263CAA214CCA4E4E03C7 /* GDataXMLNode.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 490CA524521F7D444EA58FA915D7E99C /* NSArray+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83ED8416FEE1D8215CE8CFDDE52FD284 /* NSArray+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 49176D32491D6B016567A6F71CFC030B /* ASIS3ObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B4A7E13A3B22034EA5F46F657FFF7421 /* ASIS3ObjectRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 49B903D576E09560C52AA92FDCC31A68 /* Masonry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EC331CA0AE9BE9D8A1CB272DB69FA14 /* Masonry.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 49E1B9C5F10F80E82C3CF8D2B344DEDC /* YYTextKeyboardManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D8841C9B97FA08E9F9DCE1D7AA2D0C69 /* YYTextKeyboardManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4A49D2D82248088CA84188952B9E69BA /* IQToolbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C3031D0C47787DEBEC6131AA8ED1361 /* IQToolbar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4A658AACD7DC9B7012BFA2A1E21A524E /* MJExtensionConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 316B30550D18BE25FB597B989E062461 /* MJExtensionConst.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4AA1C335A5152F60E15CB51A2E9FFA69 /* SDWebImageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA08F10F27A1DDE4DB27F6392DC500E /* SDWebImageManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4AF78C9F41D715F3D982770CE4BA393C /* FCUUID-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DCD420F6DD8A8D294CA854535C45814 /* FCUUID-dummy.m */; }; - 4B0E2A3FCD260DDC14AC986F7DC9A433 /* IQTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7941FAD8F23E54FA41D6378BBB715F5C /* IQTextView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4B16715A33860CE835A36CD5340E47B8 /* UIView+ZJFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = CD498DA948CE3B9E3856C76E268A95F8 /* UIView+ZJFrame.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4B66DC931B4AB8ECD2B005A5B3259908 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 96DB4CDF47B803249D77E04E9C1168C4 /* ASIInputStream.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4B7B2AFFCB7ACEE27E331AA44B72BCC8 /* TAPageControl.h in Headers */ = {isa = PBXBuildFile; fileRef = A4DF0467D37373C07AEDF598CB9FC82F /* TAPageControl.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4BBAFFA76E6475106B55F490C9A152EF /* NSString+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = DED459F9AB6C939FD4CDE6B906807379 /* NSString+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4BCBFE2E406D1916EC0DF8C5DD6C66F1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 4C6BFB4C1F6CF71C99E1FB270F0FEDAF /* MJPropertyKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AD8EB34771A3B03AF7E57CB95DC0D27 /* MJPropertyKey.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4C9E0882571AC4FF99FA5697CB6B29B5 /* SDImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = F2BE00B4BBBCF3F78526A4EA7A421121 /* SDImageCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CB328620EFF45F27A462D71AE22E644 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85EA4ACB7B84D0B5CAECB523A132C6AB /* Photos.framework */; }; - 4CBE1B46550A3FB90FDD1CB9CBA7B7FE /* MASConstraint+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 87B0B3E4DD1456825662552E4ACE5E65 /* MASConstraint+Private.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CC9C69E797A8B66E96A7A1C1B1B51CC /* MJExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 75E12DAFF497E75A9AF20D09111782DA /* MJExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CF1E8010B40B80D65369475F77ADEFE /* TAAbstractDotView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4886DC156E54016E72A53D18AD55FF20 /* TAAbstractDotView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4D213CA3C6256131073EB91F8C32F280 /* UINavigationController+FDFullscreenPopGesture.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BC5EB8981152119B28CA27FB6426252 /* UINavigationController+FDFullscreenPopGesture.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4D86C4F0861D54DB96A6AC0A1D059340 /* ZFBrightnessView.h in Headers */ = {isa = PBXBuildFile; fileRef = F9EE0AE2B7D6BEAB9162FA8FCB522B63 /* ZFBrightnessView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4D89A8635D7444A224AAFEE5B753EC90 /* YYTextUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = D9ED212E30859F02BA751F281B64200F /* YYTextUtilities.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4E0819264698C01F09B4B3FB21DE391C /* HMEmoticon-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E8212299AC119A1D9F1ADD42A30B7FF /* HMEmoticon-dummy.m */; }; - 4EA9D88610CCECD546B772A8F3DC55E9 /* M13ProgressViewFilteredImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1325A6A04B4183FCAA94EB1EC095693E /* M13ProgressViewFilteredImage.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4F1A9770FFF940421A3A8AC2BE64A564 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 4F2C1B2EE6B9EF25393DB2C13E7C0DB4 /* YYTextKeyboardManager.h in Headers */ = {isa = PBXBuildFile; fileRef = AC4FBD89395F58149669ADB565A66FCD /* YYTextKeyboardManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4F7D46D6C54A463482DA5CE067E5CBD9 /* YYTextDebugOption.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E547ABAE925AA7981D8150F5625FC52 /* YYTextDebugOption.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 4FF9A1EC630C78046B6AC476A76E1275 /* HMEmoticonButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 657D0BD0E60B2F4401966AF787F89C10 /* HMEmoticonButton.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5007B2C48DDA5DB0B214883FD15A40C6 /* NSString+HMEmoji.m in Sources */ = {isa = PBXBuildFile; fileRef = A777E2AE95FB5E00503CF13FDC64E6AB /* NSString+HMEmoji.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 50650BB1E2D3709A51FEB06105760E0B /* TDTouchID.m in Sources */ = {isa = PBXBuildFile; fileRef = 05B4EBF9AD94F2D92C2CEA38A9ED168F /* TDTouchID.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 506C84DCF34A8AB90A649C452EFA00C1 /* NSNotificationCenter+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 738FB7783397F62FF295A854ECA84AF6 /* NSNotificationCenter+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 50CCB89003194D1903DA7C82CBB2AF84 /* SDWebImageCoderHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 834769C7A5D1752C1177897B62EFC999 /* SDWebImageCoderHelper.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 514663D13BAD254F684191EA8897EDA8 /* MJRefreshBackFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F941C586C6F190BA180C2DF570A959A /* MJRefreshBackFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 51534247A1560905791D7DD0F9B7F30A /* SDWebImagePrefetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E729ECD06AC0AC67CE15607887CFB60 /* SDWebImagePrefetcher.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 515596BBA3E24B832603F670A98F1D0E /* MOFSAddressPickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 91784E91C2D2E979489C70900DE72B38 /* MOFSAddressPickerView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 519A1E91BA9DADF8D5449137AA94EE7F /* YYTextContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 88C03FA01A4A7580A8E3E8CAA682165F /* YYTextContainerView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 523D07593B355E66C882FE7B6CA6B214 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCE7E808EF0C8820E9A3408AB0953738 /* CoreText.framework */; }; - 524B4326D968E2DCC0A17C4504DCF50F /* KILabel.h in Headers */ = {isa = PBXBuildFile; fileRef = FAD58B841004CBA55CC3F9C0C52DCB07 /* KILabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 525F64EDD9803AB30C758CAB78CEDB7A /* YYTextDebugOption.h in Headers */ = {isa = PBXBuildFile; fileRef = ADAD4FA6C139DCC759AE8D845BFA1139 /* YYTextDebugOption.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 529D5BFABE3D5B73E6DD628670FE6DE3 /* ASIHTTPRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = DBA1620313C404180273D68AF852D276 /* ASIHTTPRequestDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 52BA5ED3898FD3C7571E9B74782158A5 /* MJPropertyType.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C0CE5B41DE6A3427FBDCE786A38AC56 /* MJPropertyType.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 52E28A0A333684B80D6CD7FFD42865E2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 53E16175D3F285FCD0AA297379790B78 /* IQTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BFF8B7C2362C818B8DCBDA2E02F87BC /* IQTextView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 547C3B80F7310050C99DE906CA19F0CB /* ASIInputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AE7F0F063A830934040C72387C0A5D /* ASIInputStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 548BBD5B63FA097F419829C3EE8EA068 /* View+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = E4622B57B2DD2FFA8648088913059F1C /* View+MASAdditions.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5553BC4EEE47924861AB5D66F064A53F /* UIImageView+ZFCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E4DE38CE6F33B2BC30DF9BB210FD738 /* UIImageView+ZFCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 559BD4598368E629F69870DBB9642C34 /* M13ProgressViewMetroDotPolygon.m in Sources */ = {isa = PBXBuildFile; fileRef = 972B7A93BEE915F435C8D41C813E6C8F /* M13ProgressViewMetroDotPolygon.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 559CFB17EC0E61F61687D0117F388C8C /* UITabBarItem+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = E9483A8947C9F5324EBCEAB2DDE8EAB3 /* UITabBarItem+CYLTabBarControllerExtention.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 55EBDF14C787E8AD7FE4153669116877 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 55FB06435CBBECAF8ED79AE811353261 /* YYTextMagnifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 0103A3F5D62C039696F62041EFAB6928 /* YYTextMagnifier.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 56E9D3B53FDEE02F30ADEB0B079F39EF /* TDMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E62574E7B64FBEFECD764FCE83E4D40 /* TDMainViewController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5713AE9534A4F008C8DC23DC87781E8F /* ASICloudFilesContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = BB20416582DF011644A3E5CC3E1E2BE3 /* ASICloudFilesContainer.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5719F06B809080CDEF7E6BC75DEA1A3C /* UIKit+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = C56DB930C0F4D0AEC130E4CC2B6CE8E9 /* UIKit+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5733584BA9A77C817060A2B02F7B55CF /* UIApplication+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = C1E420E4EB35D9FEF74950CFDA50DC09 /* UIApplication+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5788E0688BC7472F89F6BCCCD9B9CB0A /* UIView+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 755191A5599D8DBFEF1BCBB075070BD7 /* UIView+Layout.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 57F9AEB4A350C6B8C21E6681B88E40E6 /* NSParagraphStyle+YYText.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7DE9563474AB0AAE9747A5EA5A189 /* NSParagraphStyle+YYText.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 57FF101F13F2AC67427105C6332EB867 /* SDWebImageCodersManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FC249F4CE2C9101B221059AC15BAE5B /* SDWebImageCodersManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 583AEAC800E8D8762DDCFB198A0FFB68 /* YYTextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C4BFB60F019B70647B4DA0A8511BEDF7 /* YYTextAsyncLayer.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 58A358EDAB67CEA0048A2D35F628EAAB /* HMEmoticonAttachment.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A134922D87F578222A0C47D4FA8A9D8 /* HMEmoticonAttachment.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5930AACCC898FE30E20BEAEFDB9C7824 /* UIView+YYText.h in Headers */ = {isa = PBXBuildFile; fileRef = CB410D61C473507B77A4392A6FF51E16 /* UIView+YYText.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 597CEE76562EB4D948504B07655C54D6 /* MJRefreshStateHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BF5306FAF1B363933A99C3F9A39D92 /* MJRefreshStateHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 59A78F08AADC37538C1419F1A8848038 /* HMEmoticonPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 09D6485A2092909A8D24790F5696CB31 /* HMEmoticonPackage.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 59CF9E95314C2B98CD4E53BA7FE282E4 /* MJRefreshBackStateFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = BAA7581F8CEE180BEA98039E8FF41CDF /* MJRefreshBackStateFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 59D24ED7149E9CBF24456D55FD5D038A /* FDFullscreenPopGesture-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4592E7448E71600432AF62B752E8F68C /* FDFullscreenPopGesture-dummy.m */; }; - 5A2FF5F16ABBFABA5EC18B9AF230429E /* IQUIWindow+Hierarchy.h in Headers */ = {isa = PBXBuildFile; fileRef = 2372B9B2E44A26EDA2CC93E2E659F95F /* IQUIWindow+Hierarchy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5A6A9330314958802126A876CC0976D1 /* MOFSPickerView.h in Headers */ = {isa = PBXBuildFile; fileRef = AC2D7DC2FB4F93FECED44C49520A35C9 /* MOFSPickerView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5AA54B8EFEA34BDD1E8F9BD697985138 /* ASIS3BucketObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2CC20F6F9946F41C9A91712B847F6D /* ASIS3BucketObject.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5B01221C692F708A8120F4F3B99A626D /* LocalAuthentication.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BDD0F90A15F131F24E8DBAA03085A37A /* LocalAuthentication.framework */; }; - 5B018B99B71F022CF2E2C3FFE7CD8152 /* SDCycleScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5ABE10B7074DCB7134A2E78CCD4AA17F /* SDCycleScrollView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5B16D4533A374C7F7826BC1470DAE0B3 /* ASICloudFilesContainerXMLParserDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 889A65E897585299D32585E0E294A8C0 /* ASICloudFilesContainerXMLParserDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5B46C39A3F939EDB676981756CC24007 /* Masonry-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E652EB54294622C8973F3FB6C4903993 /* Masonry-dummy.m */; }; - 5B6ABE193594524DDB8ABE7DB61FB766 /* UIView+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CA93E524C8D0D37A23828D3D9FD63C5 /* UIView+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5C1D95A8C44B48A3427F554773BB8F77 /* ZJTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 90D1DF80221CDD48D614884D9374EF3F /* ZJTitleView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5C9694CB2661A04D50EAD21265A16022 /* M13ProgressViewImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 90C10DE39B0CED5F660E686C0701D4A2 /* M13ProgressViewImage.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5D5F6A52DF125BCEED5E82117EB20A8D /* HMEmoticonManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 24B5DA25321A4A42BE2857558E6FF1A5 /* HMEmoticonManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5D61851F78D0D2578EDB311F6518D1CB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 5D8724DF29BB2330854EA9911CA08A28 /* UIView+CustomControlView.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF0BA67A24609FD158EC0AC71318AB9 /* UIView+CustomControlView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5DB33204843B77A2565611715C32396C /* M13ProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = E49865B0E17A3021437F96B154D96D7B /* M13ProgressView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5E895F5326C30841E5E8512B10EA24E2 /* SDWebImageCompat.h in Headers */ = {isa = PBXBuildFile; fileRef = 4586FC5846E73EE1EAB3D5199F98B6DC /* SDWebImageCompat.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5E952397B5F31DDC92B3F9AF94C30CD6 /* SDImageCacheConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 149368EE975530009F2A6A30E87EE969 /* SDImageCacheConfig.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5E9DBA9B095B2B28272F78AD107CAE01 /* HMEmoticonInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F319BB5CAD5F18506E1C0D395104372A /* HMEmoticonInputView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 5F0AE2A8A89AA79F4F30BF54E75127D2 /* NSDate+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = D0E100F6C54E64F9BC93EC27C4FDE928 /* NSDate+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5F2C1B0AEF2EE92FE02B707B513D3640 /* SDImageCacheConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 723C8A2359030A14743D8A463F83322D /* SDImageCacheConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5F5F82F0074D04D16AB53247CEB6C37C /* UINavigationController+M13ProgressViewBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BCF20A5415D3CB162A199DC3FF6781C /* UINavigationController+M13ProgressViewBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5FBD075B703CCD048BF782A75BDEBBDF /* NSImage+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D3AAE460ECC00ADD498963FDF7650E0 /* NSImage+WebCache.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 608EA65073136FADD97D6243DAFF0BC9 /* NSTimer+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = E6D81E4F4E43362819414515C641CDAE /* NSTimer+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 60917DACD8AEC6C7F1CE0587A5047899 /* YYTextArchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = CF35FB7BD6628404DBF50B2530023030 /* YYTextArchiver.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 60A005A90B31577CFBAEC502942B64FE /* ASICloudFilesCDNRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = AF7F7E239A9FE1CE65DB4E37333C5182 /* ASICloudFilesCDNRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 60A7F17CAB8A71425D8375D26396D901 /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EEC9E77FA3372FE30A20FB6665D5022 /* ASIFormDataRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 60C3652F7F2BF0B4A17FFB445BDB4671 /* TZAssetCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AE37559593AA7FE338FEB3FCF450872 /* TZAssetCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 612C8FE4EEB65624AF3AF5BF605C3B67 /* ASIS3Request.m in Sources */ = {isa = PBXBuildFile; fileRef = 5925CF13424B1E4D99CCD97FE1FCDB3A /* ASIS3Request.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 612D7698019865805EFC789DCE5858AF /* IQUIView+Hierarchy.h in Headers */ = {isa = PBXBuildFile; fileRef = 428BE3001071D5152741D2340F784D3D /* IQUIView+Hierarchy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 61BA6FA0E9DAE389E65C5AA72057A9AB /* UIImage+ForceDecode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FCF2E7D6D6233B980D4BBF9D9CEE81D /* UIImage+ForceDecode.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 61C611ABFFC5FFF35ACE70883CB8F523 /* MASLayoutConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 38C2D3ED00390A6B157A8B2AE4CA7635 /* MASLayoutConstraint.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6209E20926D79222E59F58B962BFAA1E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 6246A05C7F564705142A9ABB7031332E /* NSKeyedUnarchiver+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E460D17504CEB737282594FB33C067 /* NSKeyedUnarchiver+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6249770A7D163B0F3001D5A76C5FA01C /* MASConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = A37333678AF8E15234FBE3DB155255B3 /* MASConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 629393440ABCD73AD3D16C75C633B585 /* IQNSArray+Sort.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F6344E7609F9F1FA1AA4CB86C01530A /* IQNSArray+Sort.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 62E6194188E5F621F3B68D94C9847BA0 /* NSObject+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 09109A23B5B75450B2043CC030916FA1 /* NSObject+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 62F3B911FC0EF1913F1F702349AFB429 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 63156594F4E4B79AD1AF5A5EDF196502 /* SDWebImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 09CE9BC0AF0C802777F6D69FF01A2699 /* SDWebImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 63157671B6B124E396B71551F43F695F /* HMScanerCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 99D8328D1CF55D65BBC02C207521F0D7 /* HMScanerCardViewController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 63299DE5DEA29075FADA35711169188E /* AFNetworking-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F8B5A5B9684B799689D004846052D51C /* AFNetworking-dummy.m */; }; - 63EE8F31D87D7F1A37281DA14099474A /* ASICloudFilesContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 181C5747E232624E725EEF6347BE2782 /* ASICloudFilesContainer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6435A921D5FDC8ECD6CEC87BDC1E893A /* ZFDownloadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C5946455BCFD49E087A1A6F2C72D9DAB /* ZFDownloadManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 645E7F583120665A9BED4832325B0891 /* MOFSAddressPickerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 326AD7805BA3D8D0C9D9DC3EBB4CB09A /* MOFSAddressPickerView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6581AA6C141207907EDB0484A45F6519 /* TZLocationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C2CF55708FA0B880DE44475E5F883F0 /* TZLocationManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 65E7311207C5F9CABE891B6A34C27C77 /* ASICloudFilesObjectRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 820E857FA0AEA6F2BCBBA1D90FCD0C3B /* ASICloudFilesObjectRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 66635EAAE52FF5571DBCDC626FB8CA86 /* AFURLResponseSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FAE651A3D0222E82C506B6F88FE31EA /* AFURLResponseSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6667774426C74EFA7316F5F52B3C74A8 /* YYCGUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = A4ADD5E02FF48CB45EF0B551B0744C86 /* YYCGUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 669834D87A6D8AC2F647CD6488951C46 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 020CAF58911879ECA04F6905CFC1450F /* ASIDataDecompressor.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 66A408AD945FC607B22AB940A69F1C86 /* ZFDownloadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = E4961060D13AC76CFF611DC5AA3FEB9D /* ZFDownloadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 66F2E1FA47B9A5D0B42B7CDBEC9A2EFB /* HMScannerMaskView.h in Headers */ = {isa = PBXBuildFile; fileRef = 96130353A2F26AC0C4D283B2173901DA /* HMScannerMaskView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 66F90F1015BB4523671823FAE42F38E2 /* NSData+ImageContentType.m in Sources */ = {isa = PBXBuildFile; fileRef = C5515127AAF151594AEC4AAE86A700A6 /* NSData+ImageContentType.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 67990B0D5E187F8D7070763C77C649F9 /* UIView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = EC55195132A8AD00DB092FC5167432CC /* UIView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 67E7C0D0179BCEEB5DAEE4B22A0D3934 /* TZPhotoPickerController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE46F8430E8598867104B25A08F09079 /* TZPhotoPickerController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 681EA0A96B513B01DC38B06C179ED89A /* HMEmoticonButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C0B38101048C1750021153D340AFF5B /* HMEmoticonButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 682B0E603612B6ADBCCF30580F9A4B09 /* UIActivityIndicatorView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B3C039D052A2B29863E20147BD5CE07 /* UIActivityIndicatorView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6837AD005926AB2974513453DB787C5A /* MBProgressHUD-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 44CC44A9E8D457B6AD32067B5B008808 /* MBProgressHUD-dummy.m */; }; - 691E26B624EDF016E870622965A7B9D0 /* UIImage+ForceDecode.m in Sources */ = {isa = PBXBuildFile; fileRef = 49D863896AE8FDD6F71F6919EE319181 /* UIImage+ForceDecode.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 69814A6E1E5B8D45B4AED27F4CD31409 /* UIViewController+ZJScrollPageController.h in Headers */ = {isa = PBXBuildFile; fileRef = 723D37C0E0011CC095BE253816725CA6 /* UIViewController+ZJScrollPageController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 69D903E8BD02A121BFC6E8F0475B5115 /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = B8D0B2BF62814A9210751C2106B13DED /* UIImage+ImageEffects.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6A0484FF4A1F83E78507025DE58A07B5 /* WebViewJavascriptBridgeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 45FB3B94DBFDF5C5C55F7CF5D0974CC2 /* WebViewJavascriptBridgeBase.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6AED92638A9897C3045ACB5F44773522 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13E1FA4A5CFFBCD4C3C81BA77009FC14 /* CoreFoundation.framework */; }; - 6B71CE5BA32574F407349C1DA20605B4 /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 614C722F31B43E33726D248055FF8A05 /* AFHTTPSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6BA0E87964FA25A06E00EC637105AE14 /* M13ProgressViewLetterpress.m in Sources */ = {isa = PBXBuildFile; fileRef = 74E82C3ACA672B9D99875AED2D00DDE2 /* M13ProgressViewLetterpress.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6BBAF3CBDF5E15EB8EF39C84660F08F1 /* UIImageView+HighlightedWebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 45B081E1FC4211E6FE014D6829F9733E /* UIImageView+HighlightedWebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6BE1FCE325DE9A035D417E8FE01181D7 /* ASIHTTPRequestConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 03565DFCD60ACBE954C117FAAE9F3D1A /* ASIHTTPRequestConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6CA5641617C855A7102C7787BB154D89 /* MJRefreshAutoStateFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F66D09EEC30C497C0047C58E232ABCA /* MJRefreshAutoStateFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6D630E377B0361624556CF02C06F0BBB /* UIImageView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 8674EA2A09213456DE2CA226AB6F3157 /* UIImageView+WebCache.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6DA8E496DAC1A2A68756F02AFFC91857 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 6DD7A82ED48E61FD8C2BA3EA9649DD2E /* IQNSArray+Sort.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AE19DCDE3F0A8434893883870D280D5 /* IQNSArray+Sort.h */; settings = {ATTRIBUTES = (Project, ); }; }; - 6DE6052F364A6556936EA55D9B5CE15F /* NSNotificationCenter+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B890D9F31833483AF305E64B00E5DCA /* NSNotificationCenter+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6E5227ED07F8DE88B48D2F00AE7F741D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */; }; - 6FAB193AE0B9F07C659C03E690727C5F /* ASICloudFilesObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F9BA36B729727D0B4BA20B59C7D01A83 /* ASICloudFilesObject.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 6FE96818920132E3ACD9E70083FB2116 /* HMEmoticonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C60FB6E10469C0998260150B0CB15066 /* HMEmoticonCell.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 700B72413D6A1F80135507E0BD553EA6 /* TZImagePickerController-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 376E611E7554508960AE7A8CC964AEDD /* TZImagePickerController-dummy.m */; }; - 701043245D0EFC6EF4CBC897F0102A6D /* UIView+Toast.h in Headers */ = {isa = PBXBuildFile; fileRef = D2D5024C9096AB99551D3ADA6F1EC9A2 /* UIView+Toast.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 707E818332E5033501DF2D7826C639DF /* AFImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = F5EDA3929262A3F8D0DB902CA6B94295 /* AFImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 70B86197660896AA837D8E46367F084A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 70D3C6B70193289EB0952E712AC24A9D /* NSBundle+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = F9CFD260C7BA10536E86EB26625D8B62 /* NSBundle+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 71DFF4FCF490E7C2983380C32C3E05A6 /* IQKeyboardManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F4BBA883C0223B21603B3B652705A8B2 /* IQKeyboardManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 724A18CA4450D2AE1F741221C16BD4A8 /* NSDictionary+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = F282A59BC15D626666FF5E19AF348181 /* NSDictionary+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 7291E906AE8A3C1F92183154FE65DCDD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */; }; - 729B628E992E517000943F0B724DEDCB /* UIView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CCCDF9F83091A7172ADF28D28CFD09 /* UIView+MJExtension.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 72C1A3655230C92A41821933BF686764 /* ZJTitleView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A2E70D45295C469AB76D752A3089B2B /* ZJTitleView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 72E8C11E0390835E8A78EDA98DAEDD38 /* MOFSDatePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 139706189654753892C916A80A4A8A7A /* MOFSDatePicker.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 7324315EF0CE156CB808FDA26B532D30 /* SDWebImageImageIOCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 835D7DB3E8BEF0E2968FC9808AC5CC92 /* SDWebImageImageIOCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7331DE41D397397F8DA2EA0064EC209E /* ASIS3Bucket.m in Sources */ = {isa = PBXBuildFile; fileRef = B6814A5F28DC1F14D13602A7CC421EB4 /* ASIS3Bucket.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 7338EF83DA050BFFE7318187ADFF3183 /* UIImage+GIF.h in Headers */ = {isa = PBXBuildFile; fileRef = F1099ACE2D34FFD8D5E628315D88AFF8 /* UIImage+GIF.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7344691FB8F44FC12F901745E0D229B8 /* UIImageView+ZFCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 63F1CE555CBC4D3297D21289F14AF32B /* UIImageView+ZFCache.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 73FE3D89F284D4156A7E8DB12B3B5CB9 /* HMScannerBorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DE5AE88E195687F83D81C7EC20725A2 /* HMScannerBorder.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 74150F02234E1E9CF39FC5FAD5526F02 /* SDWebImageDownloaderOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 37C879A74B09A3DC3588B9BD7A609C84 /* SDWebImageDownloaderOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 742650B580A6B1B55EA8765F316DC4A2 /* ASIDataDecompressor.h in Headers */ = {isa = PBXBuildFile; fileRef = AF75E7145AE53F1E45F700B894E09793 /* ASIDataDecompressor.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 750863ACFB2EECFC0D06A000ED7C64A2 /* ZJScrollPageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 87A39FCC499DC60F3AD5325D6EE2060F /* ZJScrollPageView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 75453456BA18D6C475929B2FD7E6889D /* YYTextArchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = F9D63FFBE0B03CDFD38D9A538C64D17A /* YYTextArchiver.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 75FE2FE0B0177B4BE9A4C13DF24202D9 /* NSDate+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = B23EA59D178623F454E6FB75DB6866C1 /* NSDate+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 76009037D1CBA7CD48F91A635A22E94E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */; }; - 7617045583CCEBBCFFF5268D080D760E /* ASIHTTPRequest-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C2889261727391FA0DE3EDD89C1ACDE6 /* ASIHTTPRequest-dummy.m */; }; - 7626699B2AC44EBA7F2A73772EEE798E /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E82B140EA99038E1AFB7EC301C91B2 /* ImageIO.framework */; }; - 762D830B7D515C83827F21EF1A4DA8E6 /* GVUserDefaults-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F0D7DB8A3612D19E63E4B44BFE126C57 /* GVUserDefaults-dummy.m */; }; - 766F1BCDB7FF10F14B2D5ABD16108434 /* TZImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 949A99854C0D6FA613FE574C25956447 /* TZImagePickerController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 77B764A5E6476E36E8CF7811B23C421E /* ZFPlayerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8EE4EC787816F0F55B19334A11B42642 /* ZFPlayerModel.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 77CA93753D830C9DBC675A8F0FAE6DFA /* HMEmoticonTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BC07B5F152D297A3282C37424F4116D /* HMEmoticonTextView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 77F21E90EF101B64CA739DC9E95C39DF /* UINavigationController+ZFPlayerRotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A7D90B3D9D521DB644E9C3F780CD150 /* UINavigationController+ZFPlayerRotation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 78B89E3CA5DC1F485E0AA5A4D990D462 /* NSThread+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CDBC8B0D0C36C5BA8F374B00AEECCF6 /* NSThread+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 795A820E28A4C608DE5CB582177FE5E7 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAB6C2DC371C13844619BA332C5074FE /* CoreImage.framework */; }; - 797AADAFCC84AB79F7273A4FD698383C /* UIView+CustomControlView.m in Sources */ = {isa = PBXBuildFile; fileRef = A23C76376D57D9E5DFCCB72F3369202F /* UIView+CustomControlView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 79C41510B2AAD4818ED053836CDA2DB7 /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 54CA8928573B72E2BFCDCEE606BC9EDB /* WebViewJavascriptBridgeBase.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 7B12269BEFA5305C78EC3D22AB2B1CEC /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = EC4FB9391CAAE7625A4776A0947225B1 /* UIActivityIndicatorView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 7B13FFC5732EB497241BB39F343AD3E2 /* YYLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F86FAF093165EDEDFFBAF302169EBEE /* YYLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7B2ED9E571E4E51168F7157F2EAE6199 /* MJRefreshAutoFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1902867C791F9F9BA6E5F6FC26517BCA /* MJRefreshAutoFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7BBAE335CA7667E51CFA81BF17DD861C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */; }; - 7C4D0D41E17C1D4909EA5FB89878BE40 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 7CDBF7EA5C30D66F866F8E3BA32F1712 /* FMDatabaseAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = E955452C1A55EA0F76892868F7F731AD /* FMDatabaseAdditions.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 7E7C7FFBA9E1B3951057E18104DE7C7A /* KILabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 94AA55B9F427B64DC02E14C27195D5E0 /* KILabel.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 7EA91DF1C86DD20C387CBCEB95F8C002 /* TZPhotoPreviewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 673881C48EF78A45CA7A1B0B460C571F /* TZPhotoPreviewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7F2616C57B31757B86A8A30B1D272BFE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 7FC55339729B1E7641C33D2AEEBA550F /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = DFA98F9E55C032369DC4ABE593A762CB /* ASIAuthenticationDialog.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8052B84AB0483A6EA322D81E038407D6 /* UIPasteboard+YYText.h in Headers */ = {isa = PBXBuildFile; fileRef = 051BCB0150B8DC7C07058127A3D9BDDE /* UIPasteboard+YYText.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 80C000D286D7A11FAC14AEA7A97A0283 /* ASICloudFilesObject.h in Headers */ = {isa = PBXBuildFile; fileRef = ED1AA238B33BED792F6B66C19D9C995F /* ASICloudFilesObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 81A1E5ABF3E3E82AB846492BB87B4152 /* YYTextWeakProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = D38B38B363B400D2A2DB2586A5B80986 /* YYTextWeakProxy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 81B935448068E6CC49874011EE9D6BCA /* ASIWebPageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D6680EAAD2588E3EEDDD917F8648E7 /* ASIWebPageRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 82BA014C81EE79BD7F043D96AB562DB6 /* IQUIScrollView+Additions.h in Headers */ = {isa = PBXBuildFile; fileRef = CFBC0FC0798BB96D4D4E80C65F13C360 /* IQUIScrollView+Additions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 832652AEFC186D053C28EA943E59E45D /* ASIS3ServiceRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 36E895F90E9430FC321F70DE72B2CAA6 /* ASIS3ServiceRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 832B55A221F73D0DF96D3BDF18DB81B9 /* LxGridViewFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CC7F124AED1B4CA930A1CE05462E6F0 /* LxGridViewFlowLayout.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 84B235E9310D015A6F322F7EE1F46C91 /* TZGifPhotoPreviewController.h in Headers */ = {isa = PBXBuildFile; fileRef = EE485D95A6DCE075F9E9120F30E34C71 /* TZGifPhotoPreviewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8565C66644D656C7361B9BF8B18F6AD5 /* LxGridView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C94FA31711E5F02E058194BC4FB781 /* LxGridView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 85B231E7CC388C5CE7B5528724D5630D /* HMScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A0C765C78168CE1BF58F4CF1189F739 /* HMScanner.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 85BBFB5F0008B8304BF840AA6449C61F /* MJRefreshAutoNormalFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = E50FEE149C07C320B43A9DE892D8A0CF /* MJRefreshAutoNormalFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 85C945C6D2459FF0C0333F5923A6C49C /* YYCategoriesMacro.h in Headers */ = {isa = PBXBuildFile; fileRef = 626814BB0D43C8E27E1B09C855CD5170 /* YYCategoriesMacro.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 85C98166513D2C69864D07C8DD50949C /* ZJScrollPageView-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 25C5889608B88CF85C7E02CB64D3E806 /* ZJScrollPageView-dummy.m */; }; - 862C0F5FA8CC683F098A233AF04D7FE1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 86EE1CB5473A4A07081D8DE3A2C45924 /* View+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 39EED10624702BD9A5A7EC170BD6E789 /* View+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86F5C64D3B4D664DF346FE2409EEBDB7 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF6DBAEB7CEF3E6BBA0ADAC20DCDD1F8 /* Accelerate.framework */; }; - 874BF4D6D3E4F0878FE43BBA40D0C495 /* TZPhotoPreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 75C43CEC25CB9D70DF963905C8C19C35 /* TZPhotoPreviewCell.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8770BF47F0CC10836CA84E36F50C0959 /* YYAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F86D364B0C24E6411FBD679DD0E619A /* YYAsyncLayer.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 87B2AD4F978086A0CA90D0AA41D60B5F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 87C786744791F25DCA4CAF9C375B1D12 /* ASICloudFilesContainerXMLParserDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 35E12FD87666C01C6212FF779A816FE3 /* ASICloudFilesContainerXMLParserDelegate.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 88162D6722D9C0401904632FADFFB0CA /* UIImage+GIF.m in Sources */ = {isa = PBXBuildFile; fileRef = 82F221262275DA2601458C534C50FAF4 /* UIImage+GIF.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 88290D5C90C12F48F09E6AC463737F1F /* MJRefreshComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = E2AB052EB8FE7BF466E75F13C92D021E /* MJRefreshComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 889D48A9B81ADF617C1D4E4E9473E3A9 /* FMDB.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F73DE73818A59A85FB8CE74C5BF5EE4 /* FMDB.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8958F2453EEBAF71BFEBD78FB48986EC /* UIWebView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 05AFA2A81611E199928EE527B87FCB47 /* UIWebView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 895E2B6C974E15A648B972C525FCE35F /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F01F59E9E9E5D8EABD190F4954B8E8ED /* AssetsLibrary.framework */; }; - 899739FB840197BE6A7083510FA8BBA6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */; }; - 89A6C934FB5DF36501311C8B90A46774 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 89E683A53684CE0F517F50A43F21A5C7 /* YYSpriteSheetImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 7F37E7D3C942466AB58F16EE63D7E28E /* YYSpriteSheetImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8A6B322E66CE36DD79E4D0092A6B5E39 /* UIScrollView+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = CF518E2361B4275CB590E7ED8B3F81A2 /* UIScrollView+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8AC903B7FD452FB7B1B727B75113F962 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A56F90BCB402100D8F205FD69ED7973 /* MobileCoreServices.framework */; }; - 8AEBE0E0C80A9F06E712642CEDFF690E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 8B35D94F9C649FD2FFC42C5255AA3ABF /* HMEmoticonTipView.h in Headers */ = {isa = PBXBuildFile; fileRef = F013A62FBCDA60BA85A0E76F8601EC62 /* HMEmoticonTipView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8B68E5A9391FF383C11A9686959F9451 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF6DBAEB7CEF3E6BBA0ADAC20DCDD1F8 /* Accelerate.framework */; }; - 8B69136349EE8441473CCC2FEB1DC764 /* TAAnimatedDotView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3559FB681694634974CA14916E1B5F84 /* TAAnimatedDotView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8BE30B72D3E9BFF954B9208B3F7D656F /* UIScrollView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 197B51C963997017C2D740A82FC30B50 /* UIScrollView+MJExtension.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8C4F5BEB11C839B2E36045A8A96BD4CE /* M13ProgressViewFilteredImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 96197C2131E4EAE7DD8A46EBFD9F806A /* M13ProgressViewFilteredImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8C569AF82A859DAF60CEFBCDC065D992 /* UITabBarController+ZFPlayerRotation.h in Headers */ = {isa = PBXBuildFile; fileRef = F9504BBCB2850E1AD0A299210BC6DF49 /* UITabBarController+ZFPlayerRotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8CE10A5057878449923E8EF3AC420145 /* UITextField+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 15BBD333C32F28BC1F90ABCB800349B6 /* UITextField+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8D07EF21DFE86700C9FDD90CD32F6F8F /* TDMainViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C564B469D1D78D835835F734FB75952 /* TDMainViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8D9983D10250B93580E933AE682697E9 /* TADotView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C244B148DA4A290B37320D5C5CD9AF6 /* TADotView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8DCADD590BE6C4ED74918486BAC63A19 /* MOFSPickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 687DB7E1316864FBBC3A5A9E1A5A202D /* MOFSPickerManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8DF60FE7B4C0EEFB4C4A2325DECF6EC4 /* M13ProgressViewSegmentedRing.m in Sources */ = {isa = PBXBuildFile; fileRef = CA7FCAEA592B83C9113FEE8D9C06AE41 /* M13ProgressViewSegmentedRing.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8E08BFD468ABFD9A71053DB23F3A3036 /* NSData+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 6AA73B0FB3C97F30C239DC6F744C9DA4 /* NSData+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8E109750DB28D08879CC3AB4C1D57441 /* NSObject+YYAddForARC.m in Sources */ = {isa = PBXBuildFile; fileRef = 65E63F3FD5902987B7EEBC76F1DDBD74 /* NSObject+YYAddForARC.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8E384CD06B5FEFBE0EB52E7D0A43C860 /* YYAnimatedImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD06B183B7E1671DC5A854D8DB47EAF /* YYAnimatedImageView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8E3DC47D9C8F8C484B8B535FB46BF78A /* IQBarButtonItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B1C63A9A04378F43408869297AC6258 /* IQBarButtonItem.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8E7BC04EF0E086E356FF20FB72CFCF02 /* MJProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = BE00E35FFE84A49CB48DBDB2BCA6305F /* MJProperty.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 8F51F1B625B4DC90142B4C866629EB92 /* ASValueTrackingSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C9E75F4EDB25948B73BFC35C3A760EB /* ASValueTrackingSlider.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 901E9EB2FE0E99CAD8AD8BC9C6C9A7EC /* UIAlertController+ZFPlayerRotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 932D6B99DB0DDE128563B8BFD13618CA /* UIAlertController+ZFPlayerRotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 903158692A045396106CA22C0DD13BA6 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE8106C13A82B213FE63A220B4F9394 /* SystemConfiguration.framework */; }; - 903D16EEE10FFB91B8B4742586EDC09F /* FMDatabaseQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 907367704B3A7979A8B8A96B804E02B3 /* FMDatabaseQueue.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 905C84FEAC3414BACB5231F9655560CE /* YYTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF9E2016048033CBB2FFA2BDF531BC1 /* YYTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 91070BE6CD32596F7001DE213BB67BA2 /* LxGridViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 61ECA0F0888DDC036CE8BC7170617F50 /* LxGridViewCell.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 918004218BE3091146B8D545B74A06FE /* YYTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = EF4F622A8C7ED8ECCD87E7844763B35D /* YYTextView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 91BBA41BC82E3997B8936D74FBA5219B /* TZProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C658D9A114CB4D99679160C0495B8B1 /* TZProgressView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 91F08BF429646D7F4A1009F3596045BE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 91F2867A20507A2A9C75FD0A5A0B7679 /* ASValuePopUpView.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B99BCC3C78EC080F1B764A281193D8 /* ASValuePopUpView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 9216E6BF8AF8A584B78667EA7D41DE2F /* IQKeyboardManagerConstantsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A3AC7CFD06DFA683EA173BD28BA6C10 /* IQKeyboardManagerConstantsInternal.h */; settings = {ATTRIBUTES = (Project, ); }; }; - 9257BC6F2F12584F352153E992BD718F /* UIWindow+CurrentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50CDB35644BAC5E86EC745E5793E0E81 /* UIWindow+CurrentViewController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 925EBB6CDAA2E17791E1DDCDA62A3375 /* MJRefreshConst.h in Headers */ = {isa = PBXBuildFile; fileRef = B8D16A905F8322D99CB33522D6334B9C /* MJRefreshConst.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 92937DC066543122186195A2941D3C60 /* MJFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A21105BF4BE00AFC745EDD4031455A0 /* MJFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 92CCB2F2DE3CE64DACBF4C2722E7B292 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - 93F12B05D8333C37D9CBEA3D1782CC04 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 94AF2965FE1E259CA024A868718DFDEF /* TZProgressView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CAB69580B74E84DEA3EDA3A8D29AE48 /* TZProgressView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 94D6FC9E345F03396C02EEF2AD6A25B7 /* IQKeyboardReturnKeyHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = DF09C24F9D1BDF5A214EFD8EB1F3CAA9 /* IQKeyboardReturnKeyHandler.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 9561B327AB56D1CC92608003416079A8 /* SDWebImageCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B8706D66A8CB70653005CB4910F1194 /* SDWebImageCoder.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 95F90F972DFDFBC3E012F069A6E24C33 /* MJRefreshGifHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B19C255AF9C9F46B6A854B7A95EB0D0 /* MJRefreshGifHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 965C34EF44F507C418CF2547ECD7E16B /* UIColor+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 26A5D8463162A73D52409A89781605AD /* UIColor+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 9750CDA836E267674F716B7D7E4ED03B /* ASIS3BucketRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 10CA835B856161136BB0C29617DA51E9 /* ASIS3BucketRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 97CA04C5B77CB7773C7F0871D0E1C581 /* MJRefreshAutoFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B37278A9F6380B135BB4CD0F58CB7A7 /* MJRefreshAutoFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 983CB852CBBFBC04C2A6BA407E34F59B /* View+MASShorthandAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 80218C39F0AF089C4A1008AB91F566BF /* View+MASShorthandAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 98FF79A5FD2EBF34ABE949E78EFE7803 /* UIImage+ImageEffects.h in Headers */ = {isa = PBXBuildFile; fileRef = 386BF5D8CA58DF95AED3B5C8164EEB56 /* UIImage+ImageEffects.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9934AEA2C891C201D8ED5746FF42FE1B /* NSLayoutConstraint+MASDebugAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9948E074A9AB7B7BAC4F08A2E1A21167 /* NSLayoutConstraint+MASDebugAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 99364D96200D03FC3229E6A956E10ADB /* MJRefreshFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2093B87350850B95D168886873AB99E9 /* MJRefreshFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9938F046B9B68AFF70BD045D2CC5F2AF /* NSObject+YYAddForKVO.h in Headers */ = {isa = PBXBuildFile; fileRef = 28D9E939466D7A5E461493F0BE983B94 /* NSObject+YYAddForKVO.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 99714143FA44A34F87D1F2AA6D254177 /* FMDatabaseQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E95F9C1F91B8336C1D68C38E8EF2A3D /* FMDatabaseQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 99DADD929B0A4EEE77EC3CBE574C68FF /* HMScanerCardViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 11BD4C690CCA715847ED86957649499A /* HMScanerCardViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 99E00D593F76D7E6C96300345E211282 /* MASConstraintMaker.m in Sources */ = {isa = PBXBuildFile; fileRef = AC57916ACB65E363F705C4AD694929C0 /* MASConstraintMaker.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 9A1820FEBBF042DC6D946AEA50BB12A1 /* M13ProgressViewBar.h in Headers */ = {isa = PBXBuildFile; fileRef = E04361DD95A2E79F600320FA1F8F170B /* M13ProgressViewBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9AC6F308C3C9E3E4C5AF0AD9CAFF9002 /* UIImageView+HighlightedWebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EB49719C67E66CBADC0406E00899A41 /* UIImageView+HighlightedWebCache.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 9B00BC65F8ADC243F0E441846CCAFD81 /* SDWebImageDownloaderOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 37DFF12B9AA9EDE5E2532087F5B1E9D1 /* SDWebImageDownloaderOperation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 9C0908154FC1320D13F5FA40C47E47D7 /* FMDatabasePool.m in Sources */ = {isa = PBXBuildFile; fileRef = B5894DB14787DBFB05B9551859CBF17E /* FMDatabasePool.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - 9C4724E70EF8C0685E84BE95817F0BF0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - 9C93F7A25E2E2F0E18CD51C708B2A693 /* YYTextContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 7825A59274382A259ADEC182B87C8EDA /* YYTextContainerView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9CB8CDC7B89DBFC7B4E9FF289E690DBE /* UIViewController+CYLTabBarControllerExtention.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4E16E3BB4C2872A115E05628C7B5D2 /* UIViewController+CYLTabBarControllerExtention.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DDC888AA9FE29CD96DCB574AF125142 /* MJRefreshNormalHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E25218D47A79CC35EBF6E2B65534E0D /* MJRefreshNormalHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9F39FCC5EFE5F66AFA01AB0F2E9065FA /* MJPropertyKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A7E1A5B536768A212AE9A8E28DE448A /* MJPropertyKey.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A06916C704AC2C155B942F6CFA130B3E /* ZJScrollPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00804A1A1DF2C2DEB83F41FB728EE48C /* ZJScrollPageView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A0ACA8BFF6A0BF1FF85EF113B91335A6 /* M13ProgressViewMetroDotPolygon.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F90DE8A5EFF4F5A88960322DBD3DAE0 /* M13ProgressViewMetroDotPolygon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A0FBB343BF33E05A08C92761DAA3101C /* SDWebImage-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E165A0459022BF0F5C7B2113F461C52 /* SDWebImage-dummy.m */; }; - A1474150318867763C065082EFBAAF75 /* SDCycleScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CBC579CAA38E919A439CBE3ACACFF72 /* SDCycleScrollView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A1AF541F95C341B54A6B14F2417FAF20 /* ASValuePopUpView.h in Headers */ = {isa = PBXBuildFile; fileRef = 857C79F693A88C01F8948523F6E4BA2B /* ASValuePopUpView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A1D8EB2F38369C610D3B520E55B243BB /* YYAsyncLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0535A6E99C084C2B06C2EBE0CB8A5EA2 /* YYAsyncLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A28DC8A4D0B50B5D84E90B318E8A5FF6 /* UIImage+HMEmoticon.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F7A0498916C233871F3361E6F723709 /* UIImage+HMEmoticon.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A2B227AEB355C65CD324CA132E06E9B7 /* ASIS3ObjectRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 5281D214632B617FBCA000A78B36F01E /* ASIS3ObjectRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A2D66725D5603A535C9D6933DFFE8B81 /* ZFPlayerControlView.h in Headers */ = {isa = PBXBuildFile; fileRef = EE6D761F944A7BF7D4EBF59961AAEFE6 /* ZFPlayerControlView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A2DEECEDBDC78BAA15B7819716BAA42C /* NSBundle+HMEmoticon.h in Headers */ = {isa = PBXBuildFile; fileRef = 36A30E0722E147FAF9FAAEC5FCF220F4 /* NSBundle+HMEmoticon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A30D7F59C5641AEE0DF21658B69DD93A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - A388D258BCEE3E78005749771328E21A /* TZPhotoPreviewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 723F731BCEE8CA3044F702507BD104D7 /* TZPhotoPreviewCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A3891F0BC676AB38A3BB0C94D702F0E1 /* ASIDataCompressor.h in Headers */ = {isa = PBXBuildFile; fileRef = B4B7FB2DEBAE1E8B784B7294DD3180A2 /* ASIDataCompressor.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A4223E648086FEF52D8BEF6BC331EDC9 /* IQUIViewController+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = DB48503A298BAC12499F5310ABCAD9D4 /* IQUIViewController+Additions.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A4CBE2F01A74542D6B37FDE20762C33A /* UIScrollView+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 830512F9C57D252126830818EAD9AD4A /* UIScrollView+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A594DB973B9405359A05F06CF9830A70 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4230BD2D890B5A02D7C2B474B002084 /* CFNetwork.framework */; }; - A5CC736BE68ABCDF971C27B076E538AB /* MJRefreshAutoGifFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E4EDFA4227198F220DEE9FEBAE5ED8 /* MJRefreshAutoGifFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A6436E3CFFCBFE591E2D2A68ED90CAC6 /* MASLayoutConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = B20F4C8ABED7B78200EE7E28613DC243 /* MASLayoutConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A660DE8B25F03617707E12D6541807D4 /* ASIDownloadCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CAB8FE95F0621A33143581C84DDBB26 /* ASIDownloadCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A67059B6451EE4D4C8827F52621E54A3 /* UIScrollView+MJExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F3FF708DA1F87CAED9B8493747FADA /* UIScrollView+MJExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A74871CDEC4743637083F996ECDE4981 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = E9DCCABDB3C3D7BF839D285C77348268 /* UICKeyChainStore.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A76C713C86A5CCDAC314506474DD8F70 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE8106C13A82B213FE63A220B4F9394 /* SystemConfiguration.framework */; }; - A7C8A31EF4E6A0DCBBCC49182551E771 /* UINavigationController+ZFPlayerRotation.h in Headers */ = {isa = PBXBuildFile; fileRef = F0DF052F1732FACBB5EE96DC8B776F22 /* UINavigationController+ZFPlayerRotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A83991D7C1373DF66020C2FDFC5D7564 /* MASViewConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C0B96B99666FE6DD54C12FD2825A9BA /* MASViewConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A8A7FFD7170E6EDF638A15E54C2AC6EE /* YYText-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 49E3824D64F8F973A6EB45F1CBF07560 /* YYText-dummy.m */; }; - A8B24A7F54E8FFE86264CFBBB25971F7 /* ZFHttpRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 90ACC274A4C37EDF36F43FACAF8967AB /* ZFHttpRequest.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A8D23C82F47999E97963F1AAE062482A /* ASIS3Bucket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B990E9DA980F0A07EEB232B9BA49862 /* ASIS3Bucket.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A906A376A93C1C83BB89E8F63A663F43 /* AFAutoPurgingImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E8C6BA6067D3CF4B76C54E473FDE3D /* AFAutoPurgingImageCache.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A974DE47B402E6956FB9B85EAEBE8426 /* MJRefreshGifHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F54987B1668C79EFE99199DC9097569 /* MJRefreshGifHeader.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - A9EF8701C5F3C7202F922B209E97CE79 /* SDWebImageCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = AEFD60B9E6C72E511FC2498ACF3DA4C1 /* SDWebImageCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AA3A71F563BBEE532223C0DA90DE32D6 /* YYTextTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 37FA9D3B39581ABA211EF9899373B56E /* YYTextTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AA8657572F1AF74F280B03F644129657 /* M13ProgressViewBorderedBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A67E99FAFE3D33F5C74F52AF4C9A38 /* M13ProgressViewBorderedBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AAB8C5D58383B69F7D158448130D2770 /* TZPhotoPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D9615C08F01783E110DD1574B0DAAB3 /* TZPhotoPickerController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - AADE982ED263D4792883CC905583CA86 /* NSObject+YYAddForARC.h in Headers */ = {isa = PBXBuildFile; fileRef = BF00D6726BF4FEFEBEABA6ED4735E8FA /* NSObject+YYAddForARC.h */; settings = {ATTRIBUTES = (Public, ); }; }; - ABBA76366E9A097FC21D773579E3E2A4 /* HMScannerController.m in Sources */ = {isa = PBXBuildFile; fileRef = EA7C55578789C3FABB216A82744CA3DD /* HMScannerController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - AC8DC828EFE77EFEACDFC340BE3686D8 /* UITableView+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D4B9C607B51548470755E37632C2584 /* UITableView+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - ACA404356DBBDA233F421EE4BA814040 /* YYTextAttribute.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DA931C657D5097DDDAF01A95E73B1CD /* YYTextAttribute.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - ACED284762F9340A078A7AA6D1142B13 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 39150030131DCE5B741A6BCF703EB72C /* Reachability.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - ADADE54CA35B3E34A4BFDC86DCD2E31D /* M13ProgressSuite-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DA29B793BD344BA4D24FCABFE3D38F3 /* M13ProgressSuite-dummy.m */; }; - ADD69BFB0A0F3F7B7E162E410A67CF05 /* MJRefreshBackFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = D027DBECC2B7E30C2D968BA0C26CFF9A /* MJRefreshBackFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AE7243DF0817407BF8287237429309B6 /* UIGestureRecognizer+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DBD0D4771B1AA1DD8D98BD52AEA1143 /* UIGestureRecognizer+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - AF98613A2E16B158F083A50CACACACB8 /* CYLTabBar.h in Headers */ = {isa = PBXBuildFile; fileRef = B0CACF3D768CDF43C47FC1D51450DF67 /* CYLTabBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B0C13321D8E8246F0213C8EF755503E3 /* MJRefreshComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = D845C9D31C13C1EC374B7B3744F75F8B /* MJRefreshComponent.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B0D173D0608F3470567F14951B063A7D /* ASICloudFilesRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D6710E98DF308484487D266C607F8F5 /* ASICloudFilesRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B0E19F56F4D6D005917011E36062ECA5 /* UIAlertController+ZFPlayerRotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 019014BC45649802DDF83E6007F3085C /* UIAlertController+ZFPlayerRotation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B0ECB2B27DEDE4F88356E3361BD25FDC /* ZFDownload-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 29848F154041E6427AC5277CE477609B /* ZFDownload-dummy.m */; }; - B0EE417551C6C35CC5449418D15A646D /* TZGifPhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 118A806EF73C911687A7BF9D81D1EDF7 /* TZGifPhotoPreviewController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B113E6A7E0CDE87500BAB176E2F87145 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - B228AD2E4B81E0CFE3EEECAF0D89C1DC /* M13ProgressViewSegmentedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = E24FBC0B316FBF1EEC175AD3C425DFDA /* M13ProgressViewSegmentedBar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B35857B270D29EB11EB875ED9D3433EB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */; }; - B374684075DE1BF926B2000FF5C74A9A /* UIView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FF9B42F97E3E4D8900456D85CFFD5BC /* UIView+WebCache.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B3A6235D661F70BB8D33265485FD1EA9 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */; }; - B3E6E0C6FCD7A7938D8CD72D701E6162 /* YYTextParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F5D10CD82376756DF85D2C8F0A486E /* YYTextParser.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B40756412613B53C80EE77C4C223990F /* UIProgressView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = F4511F1AA3D059CCDAD3569FDF4CFEE1 /* UIProgressView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B44385B9C3D3067B30210D3B735BEFE7 /* ZFPlayerControlViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 62BA41A4C26D5F10CCFF25A35DF57C31 /* ZFPlayerControlViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B56DF024B8E971C64418AE42915E2B3E /* ZFPlayer-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B9072784B64495ED47AEE9C4095EA4A2 /* ZFPlayer-dummy.m */; }; - B6497577DF23ABAF97751EB99734E310 /* ASICloudFilesObjectRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5B580837E3442E0B7FF3BC3976DFEB /* ASICloudFilesObjectRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B69F47477A7A892F0185011363F212EA /* IQUIScrollView+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = C0D597B98B58A9E6D134DD9C9344D9CD /* IQUIScrollView+Additions.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B6A40531013EFF76967F838D68D4C01D /* TAAbstractDotView.m in Sources */ = {isa = PBXBuildFile; fileRef = E078B3B2BC6653367343D5C40F4B8185 /* TAAbstractDotView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - B7E3D801920F436FDDDA9B49730D4E1B /* M13ProgressViewRing.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A7F8B5CD8F574C6537622DB7AA459CA /* M13ProgressViewRing.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B7F31547E82DD6E398C717A1BD3688AE /* NSBundle+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = ADA3D41AAE0EDFC89AA891B96C8D43B7 /* NSBundle+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B80FB47C1659331E00A154568E2ABFE1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - B87E1D604585E129671829D094F83179 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - B901DC7B9DE7933E44A3D1EBBF503CF8 /* AddressModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 9225394628921FCF98D0B2156F0E62E6 /* AddressModel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B915E3CFDFBA7B99411BC5430162868F /* NSObject+MJClass.h in Headers */ = {isa = PBXBuildFile; fileRef = E0C5555C49754B9AA5CF88F233BD3E00 /* NSObject+MJClass.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B953667D411D1DCD919CBD314F568A92 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 76AC8F4FC8B79501A3AE8B2AACC88E45 /* NSLayoutConstraint+MASDebugAdditions.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - BB6C6B7A51BBC59137283CA0C2588B69 /* M13ProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = E4ABF11ED3AF7DE8100A6DD26AE00226 /* M13ProgressHUD.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - BC04BC7CCC9DE1E6F262CCDEB98A3588 /* IQPreviousNextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DCD9801AE18FF59DAEADA204C6F9476 /* IQPreviousNextView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - BC899C44B9E724C9629DC655BCB8837C /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A56F90BCB402100D8F205FD69ED7973 /* MobileCoreServices.framework */; }; - BCC810F4BF3C8431FF04B44BA7010E30 /* CYLPlusButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 172552B7997A8DD1BB3FAAD30C874E7A /* CYLPlusButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BD35528AF6A5D15D4BAE46A5D414177F /* NSString+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A919DC45F39DB0AD5E7478F11AE3BBA /* NSString+MJExtension.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - BD9F745169ADBBD029EE0C69E68E60D4 /* NSBundle+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C644483AAFFA869AC8985C917A08923 /* NSBundle+MJRefresh.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - BE55E6CA41B94B735275119D91CC67C3 /* IQKeyboardManager-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EB2CA434E1A9885D2D950B7DD58FCFD /* IQKeyboardManager-dummy.m */; }; - BF772D81E718C2690DD69E80C46AFD4A /* MOFSPickerManager-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 95D56AE972CAD5F1447C07D0BBB35C92 /* MOFSPickerManager-dummy.m */; }; - BF8165F578E449953F94600BE6AA9114 /* IQKeyboardManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3A79FB3A49131B618917506A72D107 /* IQKeyboardManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - BFDE29CCA1C8B4656ECA8C5E98D05507 /* ASINetworkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 2315CA205E9BB7D8D644F26A26521EF6 /* ASINetworkQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C1093F4FCB1CDCDBF5F094ADBF95F809 /* NSAttributedString+YYText.m in Sources */ = {isa = PBXBuildFile; fileRef = A87D4C6056DD78F0306956089BF40068 /* NSAttributedString+YYText.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C127AAADF5EE85544ED8B578CAB94CAF /* TZImagePickerController.h in Headers */ = {isa = PBXBuildFile; fileRef = 28B5E9F25214A44CE763DC0BB701541D /* TZImagePickerController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C16FDBA2BC10E28B8D59DE5CCF4758EC /* MJRefreshBackNormalFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A49E4FA47367B244B954AFBDB47FEC /* MJRefreshBackNormalFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C176A23166E147849485E017AEAFE889 /* UITabBarItem+CYLTabBarControllerExtention.h in Headers */ = {isa = PBXBuildFile; fileRef = D62AA5D5E65FF686EE078856B4DA19EB /* UITabBarItem+CYLTabBarControllerExtention.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C1C0D7C93BF3DE14A26757273598D0FA /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = C560946B4C93C0C0A8AFB719428F8F7B /* AFURLRequestSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C214E3582DE2BE5E85F81912A8D66702 /* NSObject+MJClass.m in Sources */ = {isa = PBXBuildFile; fileRef = A874BA24B6EA2F2A280F183A0F035C88 /* NSObject+MJClass.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C2BB4AD69433B10C2D930E85DB32F7DC /* IQToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = E0774C96DF193FDD29D3A2E0AFAB9BE9 /* IQToolbar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C2D6671A94EECD8D8E8A2B5984ADBA51 /* UIViewController+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BB1EDC34A33E9EF497D5711CAC9A255 /* UIViewController+CYLTabBarControllerExtention.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C2E4D724938849FF093D70BD855285A9 /* HMEmoticonPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 70DB5BDBFDA994701594468414E70873 /* HMEmoticonPackage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C31F154CC47EC67EFE3D61A9626E9513 /* ZFCommonHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BD6F6F61469F8B7406056D5FDC64EFD /* ZFCommonHelper.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C3328396BFC65BB712096C8940700007 /* KILabel-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 6702197BCD72026897FEFD1679017795 /* KILabel-dummy.m */; }; - C3FB4F117C9CE2928CE6FB66BAF784D9 /* UINavigationController+FDFullscreenPopGesture.h in Headers */ = {isa = PBXBuildFile; fileRef = F9BCC6348FCACABABE79321B10BE5ED9 /* UINavigationController+FDFullscreenPopGesture.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C40CFE1274D588CA1A9DF9394BF76EAE /* FMDB-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 500964AC4B9B451E5C54E710E893D861 /* FMDB-dummy.m */; }; - C4A4C6FD9A1B3A5C995E07E4405659C7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - C4D12D56B5E4323CDE6A77AEF30D4D9F /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = D2FFA8CD812797A9DC97473B60433930 /* AFURLResponseSerialization.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C4D9FDAC0BD8ACC241CF9286AFB66FA0 /* ASIDownloadCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 23AF62AA93085C0709D200DB5CF36938 /* ASIDownloadCache.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C61E6B605BA4324039110756194E588F /* UIImage+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABDAEBD145D1FBE989709FB053C6619 /* UIImage+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C634F239D93A1722D8DF7530C4CAA030 /* MOFSPickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E5D2D600ADFB0DF9CBD1A071EA9BB71 /* MOFSPickerView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C7174D3BCD4CAF6F6A1224E864CBFF9B /* YYTextLine.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8D1FFB2198E9D73711DF991A0FA8D7 /* YYTextLine.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C723C4FAB031AF6811A4B1DC5D105AF6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FC8D5450C7A3E49B3DCE5805044BC56F /* main.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C7E3CADF7FE1173E046AEFCD5B158CE6 /* ZFDownloadManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1947701CC5128684FDDAD7AE102E56F3 /* ZFDownloadManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C7E9365CF4ECF4A47DF34B9DF5772825 /* HMScannerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C8889B5FEFC5431D539841612835197 /* HMScannerViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C84740BE8BBC382F39E7AEA621764661 /* YYTextRubyAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = F2A5308FFAD6259437B3456B446167ED /* YYTextRubyAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C88F85D3200060BD98FC13EA58121706 /* ViewController+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 430A7D48553284031AD60352AB854BFA /* ViewController+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C8DDC4B63C11BF34C10A8EBC1C805CD8 /* NSString+HMEmoji.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E344AE4EC41ADCB5B47512BCDEB3E95 /* NSString+HMEmoji.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C91F6D563D6EBA13E9598550FDF99113 /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = C355D3AF680A4A6D242CABF5DE03BFC7 /* ASINetworkQueue.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C97820EF4206BF1B1A8284DF0CB1ADE8 /* ZFPlayerControlView.m in Sources */ = {isa = PBXBuildFile; fileRef = CB681269ADE54CC89D5C2707874D3DC2 /* ZFPlayerControlView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C97FA164F7B64715FB1C3FE4B5D43D18 /* NSBundle+TZImagePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 90DC9253D37E4E2C185640670407D6B4 /* NSBundle+TZImagePicker.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C9871E3CBA7E8D383B27E98B22BF06E2 /* YYTextSelectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = FD21193449D14257E5635AF480CD9CB1 /* YYTextSelectionView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C9B1A8DEF594E5ECF9AF26D1EB80E6FB /* LxGridViewFlowLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FF0536139D0D2F2B332EBEFEE52B82F /* LxGridViewFlowLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C9BD84BA5D6A5744A4DF9AC36B7753D1 /* UIScreen+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = A474F5FC81F488A6BC9A2BCE2F988F48 /* UIScreen+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C9D62A960CE7DDE668B9362BE2275B39 /* TZPhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 12D14DCE47B28B09508C19AAB5F890B2 /* TZPhotoPreviewController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - C9EC4BB079D2ECF42C71E63D99796F95 /* NSImage+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 6150F3150DD46F840DD43FAA845733E6 /* NSImage+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C9F6937BC265DA8CDB70746F57C570AE /* UIScrollView+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 3693E4C9E6D5A593369CFA3B5BA1F919 /* UIScrollView+MJRefresh.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - CA0DDE24CBC41075A243BFA3DA09ABE3 /* HMEmoticonAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = DB6E28C03530C7D88F16ECB119D799A6 /* HMEmoticonAttachment.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CAB9278C010D1B7788F0620C0CC8624F /* M13ProgressViewRing.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AFA40940EB9DBE725360C223ADB5550 /* M13ProgressViewRing.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - CB253797348DD0011735781AFB9A1D0B /* ASIWebPageRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E30160F59176A0177C3C8214453F0AE /* ASIWebPageRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CBA073485222F5F656AAF745EB499742 /* NSObject+MJCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 62CE364E24912DA736C087CD437E89F1 /* NSObject+MJCoding.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CBA35129E1CA915285664AD0876E939B /* ZFPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = B8ABB86E040E236941AB5A500527F4CC /* ZFPlayerView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - CBCCEAD402645565401CA93924736979 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */; }; - CC598A2A06D29B9BDD63D5282D942296 /* M13ProgressViewSegmentedRing.h in Headers */ = {isa = PBXBuildFile; fileRef = F7A92E7DD6A360DB4542FDF826D1EF40 /* M13ProgressViewSegmentedRing.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CDD283707BC02BF42AB32281ADBFDC4A /* CYLTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = FA00755278ADADB7B59F491B43714090 /* CYLTabBar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - CE4486E65F9154EB7DBB411389EEE23A /* TZImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A46113BA07919AC815F0A34111D4ED3 /* TZImageManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - CE9BE96158CDC0784F47DD1340F1C274 /* ASICloudFilesContainerRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C97EF58930E6CCC8CAA6D63FED4CD53 /* ASICloudFilesContainerRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - CEE65BBC1DB3B5FAFFCA02FA29CE7CC1 /* M13ProgressViewBar.m in Sources */ = {isa = PBXBuildFile; fileRef = A80EBFE3D040C675CB28E4150713A0A0 /* M13ProgressViewBar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - CEF7E139022FFA4F5C99D4DC5DE67990 /* MASViewAttribute.m in Sources */ = {isa = PBXBuildFile; fileRef = 08F0F37DFADECCDB9990A61F8AF70417 /* MASViewAttribute.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - CF87F341328F0B8653946EF1A0E4FDB8 /* SDWebImagePrefetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 711A3553D661350700DC15B69CDEF655 /* SDWebImagePrefetcher.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CFEC5ED91E651362786759FA7778F81B /* UIControl+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CF482922F43A0132EDFD72000708C5B /* UIControl+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D03727B22AC2FDBEFC30BC22E1C2A1FA /* YYTextLine.m in Sources */ = {isa = PBXBuildFile; fileRef = 34048ECB850241A4FEB134C95C46B7D0 /* YYTextLine.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D23C9A6607D23F06E64E72A6106FE9D6 /* UIGestureRecognizer+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = BFE9A872F3071983A402730E2C61E481 /* UIGestureRecognizer+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D23F3D9A40C330DB14FD968A9FF319AF /* YYTextAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 766A06A961038E6C17D52EB657C8C37E /* YYTextAttribute.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D24C9EC5E5C43E20A04A994AEB7E4F6F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */; }; - D3885BDB2E96C02D809EB5169AFBE72B /* TDTouchID.h in Headers */ = {isa = PBXBuildFile; fileRef = 8681D87B0661E7C6DA9BB9051203CC7E /* TDTouchID.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D41FF7179EBCF62481A135195B27DB45 /* UIView+Toast.m in Sources */ = {isa = PBXBuildFile; fileRef = 4980EAC703BDF1E2090EB34195400DD2 /* UIView+Toast.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D486C538AE3151018303619712539B4C /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = CC91B725E543C8039090BA3B74FF1B46 /* UIProgressView+AFNetworking.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D511CE68D3DB1CD20967C9FFBA0ECFCC /* DWBubbleMenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 1510755022B8418490930CAB538634E9 /* DWBubbleMenuButton.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D52809383B616254553BEC467B188F6A /* SDWebImageGIFCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 616B540C1CBB33C3D622B9A91B8E447F /* SDWebImageGIFCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D5841E6383359116F1E1FD71402D06F6 /* WKWebViewJavascriptBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = B962AE77A71731CC4DD3E1922C4472BF /* WKWebViewJavascriptBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D59FC98A74E440C4725B6FDC28F5951E /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F83FAD6D30C8F16490E2368B4F9F03E5 /* AFSecurityPolicy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D5B7D8C76ECDAE3675FED3DDD52A1A1F /* IQKeyboardManagerConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = FE390C2639DA306FA2613036D88EEB0C /* IQKeyboardManagerConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D5C23F13FBA569DC28A6B1E37EC17D42 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09EB2BB890544D6A6555E6A5CEB513D6 /* AVFoundation.framework */; }; - D5CB999FB5FC80FC126A38AB4DF12227 /* UIImageView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = EF7A825BE2B277747B7ABEAF66F22851 /* UIImageView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D5E13A1C8C6E6F18961810E8E22562E7 /* YYAnimatedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 616054214C2A180EEFF6667FCFFA3262 /* YYAnimatedImageView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D5EAB6FF212B2BE8AA8814281F74523A /* M13ProgressViewStripedBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 17D5CED96DEC6FD427A9E41F007F20E5 /* M13ProgressViewStripedBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D677F96B1493AB9AD035049332C2C315 /* ASICloudFilesCDNRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F60334DC40582E5840C3C33C780C962 /* ASICloudFilesCDNRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D67A05C3863D02245CF65544E73F5BE7 /* WebViewJavascriptBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = E0C1BBF34352112BEE7697CA2E2D450E /* WebViewJavascriptBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D6859BDE12AD37ECEE6E7AA00A25FAA9 /* NSArray+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = C24B4071D2A05BD37B24DEE3676B37F1 /* NSArray+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D69C5D75C9FB4D120704102AEB479B88 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13E1FA4A5CFFBCD4C3C81BA77009FC14 /* CoreFoundation.framework */; }; - D6A3D98C4A1998D9F3A92FCF681D9F45 /* UIImage+HMEmoticon.h in Headers */ = {isa = PBXBuildFile; fileRef = 88A59317FE11D5F45DBFE398732786F0 /* UIImage+HMEmoticon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D7296EA3985C37EA9CD0824DD778C1B9 /* YYTextEffectWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 9689B78DD54EF73E7E36F84661B44D99 /* YYTextEffectWindow.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D72EB9B09E1BE79110C342F74A20BFE6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - D73761F1FC096B8845D7BBCEA6A814F8 /* TDTouchID-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 52F346A3FA3095FAB9E2C02586456232 /* TDTouchID-dummy.m */; }; - D75560FE213D1D2E74C479A06DDFCD5E /* UITextField+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 56B65A371093C0C9C912F74B8A2458C1 /* UITextField+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D7664531973544D035CE33B05D291A61 /* M13ProgressViewRadiative.m in Sources */ = {isa = PBXBuildFile; fileRef = 9666A17BF647274684CBA7A3CD099F1D /* M13ProgressViewRadiative.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D783F8BB2FFBB2F142FA2034CDB9A335 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */; }; - D7BF4DBA76F12C797027E90648D9AEE0 /* MJExtensionConst.h in Headers */ = {isa = PBXBuildFile; fileRef = 43D4D3B47684C382DBFD03600D725126 /* MJExtensionConst.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D852415DFD46E85C293E0DDE01868EA2 /* FMDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 21777A9BC63C71373596B99A8F5CCA68 /* FMDatabase.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D87E061A6A7D6083B1244FF21DA5D474 /* CYLPlusButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F5050007CB960717E6E796A3269181C8 /* CYLPlusButton.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D88A0E44D048C32D7E5FBAE2929E462A /* GVUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CD6813DDF5259FD84AB9CFB8757D956 /* GVUserDefaults.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D8D72BEC4364E9F77BCC6B8AB4E30DF3 /* MASViewConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ACEF5BC58524646C2F80494DA6222 /* MASViewConstraint.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D91A44E187477241B893D258E3F67A58 /* UIScrollView+MJRefresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 9170E0800F85B07540547A48787B562D /* UIScrollView+MJRefresh.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D9B528173A257A79D57345A1F26E2688 /* YYTextSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FFD396D9E7483F96D459512C1044011 /* YYTextSelectionView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - D9D6E770BD027615D160CEAF9ABA0A2A /* YYTextRunDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F9C449539B26FD898DC31C71282BBA4 /* YYTextRunDelegate.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DA1A145A92D246BA165FC54A1B61A734 /* HMScannerMaskView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A82DA0B8EFDF97F622E7DD3923C5EE8 /* HMScannerMaskView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DAD232C2B183547937FCBF309C6F26F5 /* YYSentinel.m in Sources */ = {isa = PBXBuildFile; fileRef = E62D6DA770E3C8DF3B9F2CC678B53305 /* YYSentinel.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DAFF453818AAC491DA49A5562DBB7B9B /* YYTextWeakProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 595611A562D2A4A2A88E04A832F1576C /* YYTextWeakProxy.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DBDCE948DF1D74806D9D319F636A0E8B /* NSString+MJExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 76EFD90C792711CBE554C6F1F02C8768 /* NSString+MJExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DC125A20E2FFA8206AB6F6FAB0F26EB8 /* UIView+WebCacheOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 09BE95EB07D408FB91D66EC3A1A5CF90 /* UIView+WebCacheOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DC138E6C97EC1B9D3E58A7335E6CADD1 /* UICKeyChainStore.h in Headers */ = {isa = PBXBuildFile; fileRef = E2951AC3C7F36A27CD10DC136186F761 /* UICKeyChainStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DC1ADB355BC44128B31442ACA38EA99F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - DC3F788B3CCFAAEC642ACC6AE1A236E5 /* IQUIWindow+Hierarchy.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F52E54A1217692C3E1F2C2464AA454A /* IQUIWindow+Hierarchy.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DC9A6D69D8187A64E6C68D9718D70309 /* UIWindow+CurrentViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3069F9070FE360DF1229E8678F000B74 /* UIWindow+CurrentViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DCF830479F7620B86623FE8828153A76 /* UIView+YYText.m in Sources */ = {isa = PBXBuildFile; fileRef = 823207BD4B7C3DFDF405A905C6BD13F4 /* UIView+YYText.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DD0AA9E8B308E45F90AD7A01F8BBC4DC /* NSObject+MJProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 68BAFD3D3D229AB2E3C9EF0E5D67346F /* NSObject+MJProperty.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DD4C7B0BECD308F74C264154101A3AB8 /* UITableView+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D949E7E1EA68F3B139E44B2DB145146 /* UITableView+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DD9A9BB121CA19489BC85D397F5F0BDB /* NSObject+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 779818BABC265B3F17CC3486E2B09D4F /* NSObject+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DDF77D6617B736D4D5FE616FBA9BB1EE /* M13ProgressConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 963CAF06FDF246AC115C91C99DD862E8 /* M13ProgressConsole.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DE130FE41810425BC7D6AE496D9F217A /* MJRefreshBackGifFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A50DC3DB07280449145748D5AC12959 /* MJRefreshBackGifFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DE31BBF6A7963C5871A19655EF5532BE /* AFNetworkReachabilityManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B7B6F69431CB1AB8590D539666BA1CBF /* AFNetworkReachabilityManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DE6263ED4AA8854DE3AFB371E261FF5F /* ZFPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DBD6B801CDE33FFA8475FDDFEDCD9F32 /* ZFPlayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DE825B8F32AB823F4BE5492CAC6FCB4B /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C04096FC91CE40B6991D04A9CFF0A18A /* Security.framework */; }; - DED2713E4D3222E1BFE8126988746FF5 /* YYTextMagnifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B197B69F3593E41384E017A55F8DDB6 /* YYTextMagnifier.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DF7E8F56866EFB1A2C4E44782CA49632 /* SDCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 389198E626BFB390A19FB501A62C30FA /* SDCollectionViewCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DFB0845B833B1689F43DC38583F5654E /* ASIS3BucketObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F7B3D47B9DD8B31FABB807DE5A1A57C6 /* ASIS3BucketObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DFC94EC4975587EE15BEACCD1C54E25E /* YYImageCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 731152B3CB8EB179FADE8AD61DFE96E7 /* YYImageCoder.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DFCDFF9F5C38F6E0905EA02A3C7E1202 /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = B9D2AA27F8CD64D33B07F19CC473C52C /* WKWebViewJavascriptBridge.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - DFF1E9D33A211AEEF751BB78D2B25752 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */; }; - E033AFDC08C8EA92B1FBCD61C6B82E9F /* DWBubbleMenuButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 07191289A9BFF9BA43028EF4A345F7D9 /* DWBubbleMenuButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E070BA3C995B4D69F609C598A7C2F0B5 /* YYTextAsyncLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5438F952A655240194038B21BF0DB1AC /* YYTextAsyncLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E072DA57403C4BFF9B10467BE05604C5 /* NSArray+MASShorthandAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BCC322F7D6A48B084E48B747DB1F4AC /* NSArray+MASShorthandAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E0D47ED026920AD701E0A8A5D8AA935B /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = DF7E15545CF4DCD9E601402845800E9E /* ASIDataCompressor.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E1186EA8C23C77CDF32DFCE7B4C2A744 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E790A5DCC08463F86F12E23CA4289C30 /* WebKit.framework */; }; - E1DBB69DA659E9CC4C52F45A50AACC8B /* LxGridView.m in Sources */ = {isa = PBXBuildFile; fileRef = A741DF0D26884201FA22CD42DF68C556 /* LxGridView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E1E771349813022263F549BDF33CB4BB /* MASViewAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC975587C57D95E4171139F585495EF /* MASViewAttribute.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E25B1BADFD408EC752C7295C16CBAE14 /* UIControl+CYLTabBarControllerExtention.h in Headers */ = {isa = PBXBuildFile; fileRef = 5375DBACF559A32DC389A5B232BA8D5E /* UIControl+CYLTabBarControllerExtention.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E28E77149F65BEE996E2209670A93BAD /* TZVideoPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9AE8FDC2DF7791AE06C5C8B47F3561 /* TZVideoPlayerController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E29BABB6DB1A6E5C3F2E468436CD3DC7 /* YYTextTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FCC5C8AC75261E1DEF300A7760FA20 /* YYTextTransaction.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E29EAC3768E043B012D7F9C7FDBF13C9 /* CYLTabBarController.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FAAAED0A44FDAEB27D10106C69A5C4 /* CYLTabBarController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E2A9FEF620828FE58DF7A2C322A1CC0B /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E09144C685D9243772BA53F16F82735 /* WebViewJavascriptBridge_JS.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E3C599129A54AA7C1F664D4897B734CE /* YYTextUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 30B10F211DB136E7CF86F869350545D8 /* YYTextUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E3D78C20D648BB0234F93D8C9E69ED4D /* IQUIView+IQKeyboardToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 1738D668B8205B80DFC8A5FA6B58B071 /* IQUIView+IQKeyboardToolbar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E433F3B13C8489709BD5314FD419E7CB /* TDHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0701B52620850F40FE81E056D3080A22 /* TDHomeViewController.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E49EE1E3FF9065337C5CA294C924B996 /* TZImageCropManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DD5B045EF5611D9E253BFA51D3648D1A /* TZImageCropManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E55DD1E2FB668F7184151F9F86B4EC72 /* MOFSToolbar.h in Headers */ = {isa = PBXBuildFile; fileRef = B8ECEA46932BC6BCA5414238155E1756 /* MOFSToolbar.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E596D5751EE96A9FE593CC4AFF3CB50B /* UICKeyChainStore-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A630A4E6D435AAC37445B39A3C07D22C /* UICKeyChainStore-dummy.m */; }; - E5B2B953D499F03FCF963326D46465E5 /* SDCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 279FC32943EB0622AF4AD148AEF94F99 /* SDCollectionViewCell.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E5DA015D1355883836E22B2D529BC275 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF6DBAEB7CEF3E6BBA0ADAC20DCDD1F8 /* Accelerate.framework */; }; - E5EB57C251C7441BD4FED030A14AF18B /* FCUUID.m in Sources */ = {isa = PBXBuildFile; fileRef = D9BDC5C8A446EADAEDA5463EBB93D6BF /* FCUUID.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E6EB93F9F0E4C5727BFC3147BA91C599 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = F2EF5A9B328255D68D8749D1DC424833 /* MBProgressHUD.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E7598111BA326DBE0DFACA74193FA154 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */; }; - E75AA2C4BB7D17C32BBDDA339AEEF59C /* SDWebImageFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 578F22B2ED2327A4E20E49D7B4C4D8C4 /* SDWebImageFrame.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E7B0270BEDCBE116DDD853F76E27B0BA /* AFNetworkActivityIndicatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E85284A511AB575C25B582AF8ADF8DE3 /* AFNetworkActivityIndicatorManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E80BF769F55BBBABD79434997076F603 /* UIDevice+FCUUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 838214E5745FE9BEBD09000EA5D65ABD /* UIDevice+FCUUID.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E81A3DDBBA7965126D98EEA4C35E7363 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F58CBFD6BB26DBAD742A0994ABAEE53 /* AFHTTPSessionManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E84220DA381DDDD7BEE27BDBB7D3D0D9 /* ASICloudFilesContainerRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 68D94A49E92917958FF339CC47578244 /* ASICloudFilesContainerRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E863BB0FF031A14926EF168323C6A80A /* AddressModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 847411DE20A5A1C6EC5CA15DFB45E17E /* AddressModel.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E8775E965F4050F8CC0FFDD17FA76523 /* ZFBrightnessView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AB9B5F626C85BE4E94E30317721C063 /* ZFBrightnessView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - E8DABF3880447F9FDB251EA82F819B68 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - E92CC2015B7B9C30B91455FA436876A7 /* YYFrameImage.h in Headers */ = {isa = PBXBuildFile; fileRef = FB6E31D2C7D4B867E7CCF5397927352B /* YYFrameImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E93760A84D9888FDCD70CF53B3645827 /* UIBezierPath+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = BA33818C92432A78A2B1FCA5D7EA3CFF /* UIBezierPath+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EA321C98029015AA4895C0B26891D8F8 /* MBProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = C8ADDB23425AE8FD0E37C1B707037C79 /* MBProgressHUD.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EA5F93ED742A35475733A6D45595F062 /* NSTimer+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B7A314924964C5A5B5E551289D93381 /* NSTimer+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EABA6C9D227100BFC79ED5821E0EA5D3 /* UIControl+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = F2556069BFEC1720BA72A3E878732253 /* UIControl+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EAEEC5EDA062152C206B868F228B2D08 /* NSObject+MJCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = F2C783FDF782B9B9634F9421728D508D /* NSObject+MJCoding.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EB559AF9B00D1BD0211B0AE2B799717B /* ZJScrollPageViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A22F604B840D19080E962B03ECAE74C1 /* ZJScrollPageViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EB65DEF61D1C41868F0033E286D4396A /* UIColor+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = CF47B11BB289765E7CEBAAC8E8D273D0 /* UIColor+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EBA632EA41470F059E86A82C018FCC6E /* MJRefreshAutoNormalFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = DF2C714C40FD7B32455999DB84EC2A0B /* MJRefreshAutoNormalFooter.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EC112E5A29750E7528EAD8C558533317 /* HMScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 846AA219C9AD8C3953FCC34976C430FA /* HMScanner.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EC42104464D7D3394F5843296D83A221 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - EC48DE078CA5E55922CCE02354D475CD /* MASConstraintMaker.h in Headers */ = {isa = PBXBuildFile; fileRef = A3CAB37C9FD75D2F91CEB00270CF0291 /* MASConstraintMaker.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EC4C13D361196AE89B42FC529418FA6A /* SDImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 62F6BC0BC8A6BD2BE8B8A67822F162C6 /* SDImageCache.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EC654A843A69FB9FE234CBDEF0527B1E /* YYImage-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1809491F7EE6906ACD46D05326AF9693 /* YYImage-dummy.m */; }; - ED19C2E9DBE2021430CEA9CB23C92875 /* UIBarButtonItem+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 586ACEBF08E01CD755B966EF900D8E35 /* UIBarButtonItem+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - ED1E1D78F84B9388491D4BE42977C785 /* SDWebImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = CBC7119C4211A824CD0EA7AF22DD523B /* SDWebImageDownloader.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - ED26EBF7F6D4BF6B0C15EEBC92691C34 /* AppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = E45A74DA50A44C43E78D3A6714BA44D9 /* AppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - ED6ECDAC666C83CB13B7ECAB19641C20 /* M13ProgressViewLetterpress.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A09DBE8FA9BAA2EA404827D3B0FCA9E /* M13ProgressViewLetterpress.h */; settings = {ATTRIBUTES = (Public, ); }; }; - ED89F1A48BA44D203A2C4B9C6F53AC0B /* MJRefreshBackGifFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 147A74010AB23752331523AE50342658 /* MJRefreshBackGifFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EDA000DFA5E7524CF6263443D093AD4B /* ZJSegmentStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = B07F074D97C92517D644E2C29E02C8C8 /* ZJSegmentStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EE32ABBD09EA664116291D6EB00E673A /* ZFHttpRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 2543896A6FB91F5F554E958C47327CD8 /* ZFHttpRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EEC5B4B07B961E37F32DF019E0C3B69E /* UIView+CYLTabBarControllerExtention.h in Headers */ = {isa = PBXBuildFile; fileRef = 04E1481F8F992CBBCBE0E3354F79297D /* UIView+CYLTabBarControllerExtention.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EF1B01D84E0EDE8A16D29F8817D53C0B /* SDWebImageGIFCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 10B3D94C627D087A3D2147FB5378FA03 /* SDWebImageGIFCoder.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EF489065C359317B134DE8220154ED4B /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 88E82B140EA99038E1AFB7EC301C91B2 /* ImageIO.framework */; }; - EF84F20F8F09C26FBA8D610DBCABB6D1 /* ZJScrollSegmentView.m in Sources */ = {isa = PBXBuildFile; fileRef = F87EE37990BF8B482F5953FAF5411A7E /* ZJScrollSegmentView.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EF95C02CDABFA19A1E779C031B917FFB /* NSString+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 80926BF9B9C958F3938D475452D52AF2 /* NSString+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - EFC6C00AA25F727156BCCF53C5B56D26 /* SDCycleScrollView-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B7BB646B178AFDCC018FB11E198DD8A0 /* SDCycleScrollView-dummy.m */; }; - F00CCFAB93A4F18419CD91217B1D5F66 /* FMDatabaseAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C3C3E5DEF8D29C063E1CAE528BCD74 /* FMDatabaseAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F02320ABC117E8ACC68CA867458B20F5 /* IQUIViewController+Additions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7000B1BA4FEC9D83E0E4B25AA5DE978D /* IQUIViewController+Additions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F099E5987DD80E8D78E909AF81D3C587 /* UIRefreshControl+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C66868B3BCE18CCA6FBB3488A9C51BD /* UIRefreshControl+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F0A828EC72CD7FB7ABFDD5B5736EF7F8 /* MJFoundation.m in Sources */ = {isa = PBXBuildFile; fileRef = D17BE6DA6066916F77227E105ADB1FDA /* MJFoundation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F0B56A7D38A399A2F67F9920C9526A66 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - F10BCB335B079D7BF31A8C7140D1E600 /* UIView+WebCacheOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 60A505C8E06B1775743CD5DA29EA83FF /* UIView+WebCacheOperation.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F1428FF0F4A7C4769364134ABFEE4B44 /* YYImageCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC2536F46DCEABBA8916C12059449F6 /* YYImageCoder.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F16DF184B375D8E5305B3563486DBA5E /* ZFPlayerModel.h in Headers */ = {isa = PBXBuildFile; fileRef = ABAD685D1448375FB1C3692E3DBAA916 /* ZFPlayerModel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F1DB510414B920325BCEBFBB830C48A7 /* UIBarButtonItem+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B1E8242CA8B5B01FB20438CB5F8A0 /* UIBarButtonItem+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F1F93EE1AA5E870F2CE81325CE9EB643 /* AFAutoPurgingImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A351302198A655351E2AE6EE1BBFBE82 /* AFAutoPurgingImageCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F2B5C5B8FB2306B5FB06F1D38D3E79AD /* UIView+SDExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E1BE344E7658E804E2872A8411D5AB6 /* UIView+SDExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F32335F0241E5B31F687B6D7E7772179 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */; }; - F390D582745DF3516ADD4D910A2ACFFA /* MASCompositeConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A55E93EF311004E23D6189573CA229E /* MASCompositeConstraint.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F39CBB7A920B2884F5637C36E8819033 /* M13ProgressViewBorderedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E22E77F4551FB4B00ED0081853DE7D8 /* M13ProgressViewBorderedBar.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F42D3D33B0FD8814A3C33FC46FE1690A /* FMResultSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F9FE321FB2D4CF72518A9CD79F503637 /* FMResultSet.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F462278FF31AADADC6C5803231C48F4C /* M13ProgressViewMetro.h in Headers */ = {isa = PBXBuildFile; fileRef = BB46940BF9718153BFF8816AF87101A6 /* M13ProgressViewMetro.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F56F1AD0D978F250A30E1980549A7EB6 /* MJRefresh-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 71C293857462202C683B389A55EC1778 /* MJRefresh-dummy.m */; }; - F5CC06F3E0C232483A72DCCFAF393BE0 /* AFURLSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C3DE628916339FE09F34E04AC204E8 /* AFURLSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F65005F3BA971FE1877ADDE49A494052 /* IQTitleBarButtonItem.m in Sources */ = {isa = PBXBuildFile; fileRef = DFCF134F6C3ED793B0111249F8AF2DB3 /* IQTitleBarButtonItem.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F71530448B7A282746853F4718DCA267 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - F752B2BA995A71489A451CF59BB53824 /* UIViewController+ZFPlayerRotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 72092789A81DED056915185928C46406 /* UIViewController+ZFPlayerRotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F82C942D62F249510BCF073FA64A64C1 /* UIImage+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = BEA62832F22A2354281D335511F277CA /* UIImage+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F88580E07538A44A13193CA98E37ADCA /* UIView+MJExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 900771E247DD0F0F938E07AB63BBF51C /* UIView+MJExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F88EBCF213D5CDC9DD9761F38AC8851A /* IQTitleBarButtonItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 719C47543AF80968CE454D97F832A3E2 /* IQTitleBarButtonItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F8B71BB9667E21385D7AAEFEC796BAE4 /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2318788E9F0009F5773E71FB439E18 /* AFNetworkActivityIndicatorManager.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - F8DCA6C3C05A59B2C95A1B5F1CBD8C99 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A56F90BCB402100D8F205FD69ED7973 /* MobileCoreServices.framework */; }; - F8F5EF8E6DBDEFFEBF4D710558A5FA75 /* HMEmoticon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FF6503D5CE126099935102283C2FB96 /* HMEmoticon.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - FA5F501EBA3074D9A0F9C3106FB1A346 /* NSKeyedUnarchiver+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 71926658EFC9069B2C26929BE11F90C7 /* NSKeyedUnarchiver+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FB3B1C394E03597F615EDAE8731669E6 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C04096FC91CE40B6991D04A9CFF0A18A /* Security.framework */; }; - FB5D1E8F50E7878F89EE4946AF10D734 /* M13ProgressView.h in Headers */ = {isa = PBXBuildFile; fileRef = DC44859CBA28F8EA574DB5CE062C685F /* M13ProgressView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FB9AA5207284E33FFC55FEB308BFA71F /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5061CB166F6F474AAB91AD6984F408 /* AFURLRequestSerialization.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - FBFE53983A247600ECF47853C2F01D4D /* MJRefreshConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 06237DE26B0BAC06B73089E0A9B28B32 /* MJRefreshConst.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - FC43D19FE6B8DFC05EBEC9408D4CEF82 /* UIDevice+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4122946AD5F17EB885B9333A74496168 /* UIDevice+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - FC4920CF955DBA6DC6685933C96FFE1D /* CALayer+YYAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = BD7054AC108CD6C419E8B9D98172FB71 /* CALayer+YYAdd.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - FCE0158B69F7AECDB41CC6E27A88185D /* ZFFileModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 66DEFBE8BA9DEDB2C1106F5EC6FBE268 /* ZFFileModel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FD5F4725614AF2B0D0D87840258DC53F /* YYAsyncLayer-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A70A59D5D83726124E1DF4784BBFB6E0 /* YYAsyncLayer-dummy.m */; }; - FD973B06C50DE5A6865550E319E7113B /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF6DBAEB7CEF3E6BBA0ADAC20DCDD1F8 /* Accelerate.framework */; }; - FDBE699FBFBC5B8C2BDA86A99DB319ED /* CYLTabBarController-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 16EA0A6D5AF3CD3190CD7020A902D0ED /* CYLTabBarController-dummy.m */; }; - FE01A3B572C748157BF7FEB4687610E1 /* UIControl+CYLTabBarControllerExtention.m in Sources */ = {isa = PBXBuildFile; fileRef = F68F70DE81F8F93798E273460EEDE0F0 /* UIControl+CYLTabBarControllerExtention.m */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-all-checks"; }; }; - FE17F6EC1578F24F70B5D47B8E472310 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */; }; - FE9226E85B0D7906C1687DCFFD30D252 /* UIScreen+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 914F27DD9F4364E6A074E894E6874E8E /* UIScreen+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF1B68BB2C26B49D0DB408D77BF73D8C /* MJRefreshAutoStateFooter.h in Headers */ = {isa = PBXBuildFile; fileRef = C733E41935B85103D48AB3FF8247211F /* MJRefreshAutoStateFooter.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF248EDD135FE1AE3F990E3AE2C2E6A2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */; }; - FF78454EFB2810B20BC14D4DFCD47595 /* NSNumber+YYAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = 98BB0134772D94E31AFE00D20A71A2B8 /* NSNumber+YYAdd.h */; settings = {ATTRIBUTES = (Public, ); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 00DEA7EEDE75F9DC08E26C1BB0A67A10 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 92BA053EDCAD49E6DB97E83B24319F48; - remoteInfo = SDWebImage; - }; - 0CA9C4ED088C3D97FE5F5B954491EEB6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 586F2DFA9BDCC6675C2546793A69E5CC; - remoteInfo = MBProgressHUD; - }; - 15AC0AB532D3A36847874730554B1AEF /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = F0EA78F8F3362DEBC9840500226DA5E7; - remoteInfo = ASIHTTPRequest; - }; - 160CC89D5E06BB3AA2CFA1C5A17F956D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 78E8E726824C97E61A093458715C042A; - remoteInfo = ZFDownload; - }; - 1B29A9F707FC421A60E0B3CD227F7D58 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 52E7BDC90E6F2E284172E8317EDA09AF; - remoteInfo = WebViewJavascriptBridge; - }; - 2741483DF0EFA5708C76A63C39378820 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = DA192B47B547BB1AA408F674C3A089B2; - remoteInfo = LxGridView; - }; - 3867F926E0FA4D5BF8C45A0A1E210B32 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2A22C4445F8FB3853FF5036E64CED171; - remoteInfo = TDTouchID; - }; - 387E615BC50180386EC4F86AB1C9E418 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 325E0F928F4D0842ECDF259F63F1D842; - remoteInfo = GVUserDefaults; - }; - 3A615A534EA2AAA393DBAE2324C6C8E5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = EE366E1E6962F82E6AEC8AE66FA66CBF; - remoteInfo = FDFullscreenPopGesture; - }; - 3CE98DA9AF93AC85335ADC6B9066F1CF /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = E0C2B1D1DA662576BF72BB3F3EBEF660; - remoteInfo = TZImagePickerController; - }; - 4E0D93160123BCAF196E5D62949B36A3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 272B6902EC233437C8C814A53CD3E70D; - remoteInfo = CYLTabBarController; - }; - 584D67106988BDDBE05A11CA6639133D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8C603CC4B51BC8FB05654BF104CB6C64; - remoteInfo = SDCycleScrollView; - }; - 5BDBB974BF409E062FD1FE52882BF470 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9DC8D9E02903E93BD0B2FEC9D846EA20; - remoteInfo = Masonry; - }; - 611EB321051676445AFBB0914231074D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 04CF549EBEEE7BC87AEAE35397184D94; - remoteInfo = MJRefresh; - }; - 67AAB6531359D087C4E1A18704661BB4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 1D2C839B3013830CA2082E7574526716; - remoteInfo = UICKeyChainStore; - }; - 72B3D99E8A4DFCD36B957B47A3AA4D35 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2B91E81D8B4FCB63BB9F963DC1B6BDC8; - remoteInfo = YYText; - }; - 74795D79E5424F6385749DDE32F7267E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9C623D1AF8229419BA603B3C66BE24B9; - remoteInfo = Reachability; - }; - 7678BD72BDE35133574AF96B10574996 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = BDB45DD6D41488A346190E17DEF63592; - remoteInfo = M13ProgressSuite; - }; - 788D58FA420E25E17722FE9C3FFC9377 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 904F4F27FD314010A3812EB2A9306183; - remoteInfo = IQKeyboardManager; - }; - 78CC810ADAD2BEAF212D2E62B6385C53 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8642CC820CE8C5B88C113D7F47AF4BC3; - remoteInfo = FMDB; - }; - 83F2CC41C4DDE84846AA1FC1487437EC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 956D15E751CE0B7A4B2A712076C19498; - remoteInfo = Toast; - }; - 8492FB125648E08B94F8FFD935C6C407 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = D51A7C33D6CB5BFE4110037FB616A385; - remoteInfo = ZFPlayer; - }; - 84AC77B5EBE473D0E23BFC3A4C70A9A4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4DB8DEC4D389AEFE4B3A80E3C5B7DFC0; - remoteInfo = HMQRCodeScanner; - }; - 98FE5853D9DBA8D69CF08732BD229514 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 081C5DFBFB255EFA239E2A10EED8389F; - remoteInfo = YYImage; - }; - AE1D9B42831F54912F1BA4F78DE313C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6EC166B8BFAEC80A53C7B88AD9D967E6; - remoteInfo = FCUUID; - }; - B9F3E3B49114BF0AF59B6AF54D3C85E8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 1D2C839B3013830CA2082E7574526716; - remoteInfo = UICKeyChainStore; - }; - C1B8C3AC720EAF82FE20FC7FF338D911 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = A08CF8B6B4281979AD047CC2A26962D0; - remoteInfo = YYAsyncLayer; - }; - E039191CC54095AA28E635741EDDD414 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 66AB20B3D6E7648A21FE0FACD999D7E0; - remoteInfo = ZJScrollPageView; - }; - E1D4B67465FA62FDD0F22B7E7DC4C39F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9DC8D9E02903E93BD0B2FEC9D846EA20; - remoteInfo = Masonry; - }; - E5185BBD6DBC003CD836BDA99B9AADDE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 92BA053EDCAD49E6DB97E83B24319F48; - remoteInfo = SDWebImage; - }; - E6D55A858C1C2821752F5528AA7223AC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9E033EDB5EC0819481B0546434FA577B; - remoteInfo = AFNetworking; - }; - E93327BAF52D8E67FA9AE772573F8767 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = F0EA78F8F3362DEBC9840500226DA5E7; - remoteInfo = ASIHTTPRequest; - }; - EBEEA2E24A6D6D7A6A20DECB5A754FA3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9C623D1AF8229419BA603B3C66BE24B9; - remoteInfo = Reachability; - }; - ED03FAE7CE4515A94A86537CBDF225FF /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 5531A66C90D28B1F40553C98CB7E53D9; - remoteInfo = DWBubbleMenuButton; - }; - ED8F4DE1A243B18BB4694A72A9503DC9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = C1FD7413DA4D1D8C453C6C0DF2243636; - remoteInfo = MOFSPickerManager; - }; - F3E6AAF49DB39A7542C65CF93A960137 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = A316B54C67E947D23CECD230FA5BFAEF; - remoteInfo = MJExtension; - }; - F4C32523C88C7E3D8A0A564B8C51B14A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = C93D9A8CEE42F2E461C1A028CBA3E5A3; - remoteInfo = KILabel; - }; - F61720CAF5B19469E006CDB32A210CCE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = BCB3669B52B845FD733208787CD024E2; - remoteInfo = HMEmoticon; - }; - F7E2C7EAC45C2594AA3822027647A115 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 77429824F3675AB1A2CE34A6E0BDD468; - remoteInfo = YYCategories; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 00804A1A1DF2C2DEB83F41FB728EE48C /* ZJScrollPageView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZJScrollPageView.m; path = ZJScrollPageView/ZJScrollPageView/ZJScrollPageView.m; sourceTree = ""; }; - 00C2335B7BC1D5ECECBDEB53CD04F3B1 /* BMKGeocodeSearch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKGeocodeSearch.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKGeocodeSearch.h; sourceTree = ""; }; - 00E022313FC07DC246814838B5508BD9 /* ZJScrollPageView.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ZJScrollPageView.xcconfig; sourceTree = ""; }; - 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; - 0103A3F5D62C039696F62041EFAB6928 /* YYTextMagnifier.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextMagnifier.h; path = YYText/Component/YYTextMagnifier.h; sourceTree = ""; }; - 019014BC45649802DDF83E6007F3085C /* UIAlertController+ZFPlayerRotation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIAlertController+ZFPlayerRotation.m"; path = "ZFPlayer/Category/UIAlertController+ZFPlayerRotation.m"; sourceTree = ""; }; - 01BA20968ECD06E6A7C6C469FC1C6C69 /* ZJScrollPageView-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ZJScrollPageView-prefix.pch"; sourceTree = ""; }; - 020CAF58911879ECA04F6905CFC1450F /* ASIDataDecompressor.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIDataDecompressor.m; path = Classes/ASIDataDecompressor.m; sourceTree = ""; }; - 023C4CC9577CB7E5F8A0CACBC2FF7E12 /* MOFSPickerManager.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MOFSPickerManager.xcconfig; sourceTree = ""; }; - 03565DFCD60ACBE954C117FAAE9F3D1A /* ASIHTTPRequestConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIHTTPRequestConfig.h; path = Classes/ASIHTTPRequestConfig.h; sourceTree = ""; }; - 044CB32193A74917C321AD0A10B612D3 /* BMKMapView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKMapView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKMapView.h; sourceTree = ""; }; - 046432722C1F2197151D62219498F9EB /* NSBundle+MJRefresh.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSBundle+MJRefresh.h"; path = "MJRefresh/NSBundle+MJRefresh.h"; sourceTree = ""; }; - 048823A9FB7BB13C5F4793501E8B35A2 /* MOFSToolbar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MOFSToolbar.m; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSToolbar.m; sourceTree = ""; }; - 04E1481F8F992CBBCBE0E3354F79297D /* UIView+CYLTabBarControllerExtention.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+CYLTabBarControllerExtention.h"; path = "CYLTabBarController/UIView+CYLTabBarControllerExtention.h"; sourceTree = ""; }; - 051BCB0150B8DC7C07058127A3D9BDDE /* UIPasteboard+YYText.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIPasteboard+YYText.h"; path = "YYText/Utility/UIPasteboard+YYText.h"; sourceTree = ""; }; - 0521D4F71531296A6C5B6131C1C02AF7 /* IFlyISVDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyISVDelegate.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyISVDelegate.h; sourceTree = ""; }; - 0535A6E99C084C2B06C2EBE0CB8A5EA2 /* YYAsyncLayer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYAsyncLayer.h; path = YYAsyncLayer/YYAsyncLayer.h; sourceTree = ""; }; - 05461D33462B58C6CAEB5296CEF40314 /* BMKMapComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKMapComponent.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKMapComponent.h; sourceTree = ""; }; - 0549F37D6BD368263C3343FAB9AEF1B2 /* iflyMSC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iflyMSC.framework; path = RX3_iflyMSC/iflyMSC.framework; sourceTree = ""; }; - 05AFA2A81611E199928EE527B87FCB47 /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIWebView+AFNetworking.h"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.h"; sourceTree = ""; }; - 05B4EBF9AD94F2D92C2CEA38A9ED168F /* TDTouchID.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TDTouchID.m; path = TDTouchID/TDTouchID/TDTouchID/TDTouchID.m; sourceTree = ""; }; - 06237DE26B0BAC06B73089E0A9B28B32 /* MJRefreshConst.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshConst.m; path = MJRefresh/MJRefreshConst.m; sourceTree = ""; }; - 065E1EA74216DA778ED07019B9CF4C28 /* FCUUID-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FCUUID-prefix.pch"; sourceTree = ""; }; - 0701B52620850F40FE81E056D3080A22 /* TDHomeViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TDHomeViewController.m; path = TDTouchID/TDTouchID/TDHomeViewController.m; sourceTree = ""; }; - 07191289A9BFF9BA43028EF4A345F7D9 /* DWBubbleMenuButton.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = DWBubbleMenuButton.h; path = Source/DWBubbleMenuButton.h; sourceTree = ""; }; - 07709766C62F078D0712AED1EF7BCAE2 /* M13ProgressConsole.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressConsole.m; path = Classes/Console/M13ProgressConsole.m; sourceTree = ""; }; - 07ADBC18852169F59915CE309643D077 /* MJRefreshFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshFooter.m; path = MJRefresh/Base/MJRefreshFooter.m; sourceTree = ""; }; - 07B790856B0E0DD1D7DAA065D8EB1AEF /* GVUserDefaults-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GVUserDefaults-prefix.pch"; sourceTree = ""; }; - 07F3FF708DA1F87CAED9B8493747FADA /* UIScrollView+MJExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIScrollView+MJExtension.h"; path = "MJRefresh/UIScrollView+MJExtension.h"; sourceTree = ""; }; - 086EDCDD88AEE798BF922F4ABB249BC6 /* YYCGUtilities.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYCGUtilities.m; path = YYCategories/Quartz/YYCGUtilities.m; sourceTree = ""; }; - 08F0F37DFADECCDB9990A61F8AF70417 /* MASViewAttribute.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASViewAttribute.m; path = Masonry/MASViewAttribute.m; sourceTree = ""; }; - 09109A23B5B75450B2043CC030916FA1 /* NSObject+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSObject+YYAdd.m"; path = "YYCategories/Foundation/NSObject+YYAdd.m"; sourceTree = ""; }; - 09251D836AB765B4EB13C20590AB7BCB /* HMEmoticon.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = HMEmoticon.bundle; path = "表情键盘/Emoticon/HMEmoticon.bundle"; sourceTree = ""; }; - 0992AA9FD4408B190D505B6D13ED1245 /* TDTouchID-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "TDTouchID-prefix.pch"; sourceTree = ""; }; - 09BE95EB07D408FB91D66EC3A1A5CF90 /* UIView+WebCacheOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCacheOperation.h"; path = "SDWebImage/UIView+WebCacheOperation.h"; sourceTree = ""; }; - 09CE9BC0AF0C802777F6D69FF01A2699 /* SDWebImageDownloader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloader.h; path = SDWebImage/SDWebImageDownloader.h; sourceTree = ""; }; - 09D6485A2092909A8D24790F5696CB31 /* HMEmoticonPackage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonPackage.m; path = "表情键盘/Emoticon/HMEmoticonPackage.m"; sourceTree = ""; }; - 09EB2BB890544D6A6555E6A5CEB513D6 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; }; - 09EFF64097E60896A3B19EEDA4B8C446 /* MJRefresh.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = MJRefresh.bundle; path = MJRefresh/MJRefresh.bundle; sourceTree = ""; }; - 0A0C765C78168CE1BF58F4CF1189F739 /* HMScanner.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMScanner.h; path = HMQRCodeScanner/QRCode/HMScanner.h; sourceTree = ""; }; - 0A2B81143ED0FD2CAA713AE6525180DA /* ZFDownload.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ZFDownload.xcconfig; sourceTree = ""; }; - 0A4E16E3BB4C2872A115E05628C7B5D2 /* UIViewController+CYLTabBarControllerExtention.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+CYLTabBarControllerExtention.h"; path = "CYLTabBarController/UIViewController+CYLTabBarControllerExtention.h"; sourceTree = ""; }; - 0A516C89E800F6996156F3C0C2BCC4F1 /* libTZImagePickerController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTZImagePickerController.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 0A919DC45F39DB0AD5E7478F11AE3BBA /* NSString+MJExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSString+MJExtension.m"; path = "MJExtension/NSString+MJExtension.m"; sourceTree = ""; }; - 0AA8B21DFE43CD9F290F6C8F6D9001F3 /* HMEmoticonManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonManager.m; path = "表情键盘/Emoticon/HMEmoticonManager.m"; sourceTree = ""; }; - 0BC07B5F152D297A3282C37424F4116D /* HMEmoticonTextView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonTextView.m; path = "表情键盘/Emoticon/HMEmoticonTextView.m"; sourceTree = ""; }; - 0C0B96B99666FE6DD54C12FD2825A9BA /* MASViewConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASViewConstraint.h; path = Masonry/MASViewConstraint.h; sourceTree = ""; }; - 0C98419A03ABBAF14B4848662D28663C /* BMKCloudSearchInfo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKCloudSearchInfo.h; path = BaiduMapKit/BaiduMapAPI_Cloud.framework/Headers/BMKCloudSearchInfo.h; sourceTree = ""; }; - 0CEB024F16F81EF26966E8EBD844DEBF /* BMKOverlayPathView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOverlayPathView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKOverlayPathView.h; sourceTree = ""; }; - 0DBA354C7658DE536B57DF1637A6C6D2 /* MWApi.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MWApi.h; path = MagicWindowSDK/MagicWindowSDK/MWApi.h; sourceTree = ""; }; - 0E4DE38CE6F33B2BC30DF9BB210FD738 /* UIImageView+ZFCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+ZFCache.h"; path = "ZFPlayer/Category/UIImageView+ZFCache.h"; sourceTree = ""; }; - 0EC331CA0AE9BE9D8A1CB272DB69FA14 /* Masonry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Masonry.h; path = Masonry/Masonry.h; sourceTree = ""; }; - 0F54987B1668C79EFE99199DC9097569 /* MJRefreshGifHeader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshGifHeader.m; path = MJRefresh/Custom/Header/MJRefreshGifHeader.m; sourceTree = ""; }; - 0F6344E7609F9F1FA1AA4CB86C01530A /* IQNSArray+Sort.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "IQNSArray+Sort.m"; path = "IQKeyboardManager/Categories/IQNSArray+Sort.m"; sourceTree = ""; }; - 0F84FE2B1ED09804709BF32C8EE4884D /* libFDFullscreenPopGesture.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFDFullscreenPopGesture.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 0FF9B42F97E3E4D8900456D85CFFD5BC /* UIView+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+WebCache.m"; path = "SDWebImage/UIView+WebCache.m"; sourceTree = ""; }; - 1006C24C3948018333AB91D69A2264F0 /* YYTextLayout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextLayout.h; path = YYText/Component/YYTextLayout.h; sourceTree = ""; }; - 1044474C3ABBC525F856317E301218DD /* IFlySpeechEvaluator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechEvaluator.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvaluator.h; sourceTree = ""; }; - 10B3D94C627D087A3D2147FB5378FA03 /* SDWebImageGIFCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageGIFCoder.m; path = SDWebImage/SDWebImageGIFCoder.m; sourceTree = ""; }; - 10CA835B856161136BB0C29617DA51E9 /* ASIS3BucketRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIS3BucketRequest.m; path = Classes/S3/ASIS3BucketRequest.m; sourceTree = ""; }; - 10D2736631BC42AD36C7B879C7DCA815 /* libcrypto.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libcrypto.a; path = BaiduMapKit/thirdlibs/libcrypto.a; sourceTree = ""; }; - 1172D3802B188B8D4966ED5202AC6D71 /* ASIAuthenticationDialog.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIAuthenticationDialog.h; path = Classes/ASIAuthenticationDialog.h; sourceTree = ""; }; - 118A806EF73C911687A7BF9D81D1EDF7 /* TZGifPhotoPreviewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZGifPhotoPreviewController.m; path = TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.m; sourceTree = ""; }; - 11B1A3C787AA83676DAA6C04BB7B5C10 /* NSObject+MJKeyValue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+MJKeyValue.h"; path = "MJExtension/NSObject+MJKeyValue.h"; sourceTree = ""; }; - 11BD4C690CCA715847ED86957649499A /* HMScanerCardViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMScanerCardViewController.h; path = HMQRCodeScanner/QRCode/HMScanerCardViewController.h; sourceTree = ""; }; - 11D1B2E44091F2CF9E8FB28EFA74782D /* BMKSearchBase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKSearchBase.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKSearchBase.h; sourceTree = ""; }; - 12D14DCE47B28B09508C19AAB5F890B2 /* TZPhotoPreviewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZPhotoPreviewController.m; path = TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m; sourceTree = ""; }; - 131B1E8242CA8B5B01FB20438CB5F8A0 /* UIBarButtonItem+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIBarButtonItem+YYAdd.m"; path = "YYCategories/UIKit/UIBarButtonItem+YYAdd.m"; sourceTree = ""; }; - 1325A6A04B4183FCAA94EB1EC095693E /* M13ProgressViewFilteredImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewFilteredImage.m; path = Classes/ProgressViews/M13ProgressViewFilteredImage.m; sourceTree = ""; }; - 1359B5BB443E263CAA214CCA4E4E03C7 /* GDataXMLNode.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GDataXMLNode.m; path = MOFSPickerManagerDemo/GDataXMLNode/GDataXMLNode.m; sourceTree = ""; }; - 139706189654753892C916A80A4A8A7A /* MOFSDatePicker.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MOFSDatePicker.m; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSDatePicker.m; sourceTree = ""; }; - 13E1FA4A5CFFBCD4C3C81BA77009FC14 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; }; - 147A74010AB23752331523AE50342658 /* MJRefreshBackGifFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshBackGifFooter.h; path = MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h; sourceTree = ""; }; - 149368EE975530009F2A6A30E87EE969 /* SDImageCacheConfig.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCacheConfig.m; path = SDWebImage/SDImageCacheConfig.m; sourceTree = ""; }; - 14BE48AB74B30AE1814DCDD4B8D4DCFF /* BMKPolygon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPolygon.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKPolygon.h; sourceTree = ""; }; - 1510755022B8418490930CAB538634E9 /* DWBubbleMenuButton.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = DWBubbleMenuButton.m; path = Source/DWBubbleMenuButton.m; sourceTree = ""; }; - 152D5A3E030B920CB1B67DBF5E6595B9 /* BMKDistrictSearch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKDistrictSearch.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKDistrictSearch.h; sourceTree = ""; }; - 15A07B4076009D5884DD58629769954E /* LxGridView.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = LxGridView.xcconfig; sourceTree = ""; }; - 15BBD333C32F28BC1F90ABCB800349B6 /* UITextField+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UITextField+YYAdd.h"; path = "YYCategories/UIKit/UITextField+YYAdd.h"; sourceTree = ""; }; - 160CC95B98AE2FBA00DF2E4EA5410A1C /* Pods-iOSProject-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-iOSProject-resources.sh"; sourceTree = ""; }; - 16EA0A6D5AF3CD3190CD7020A902D0ED /* CYLTabBarController-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "CYLTabBarController-dummy.m"; sourceTree = ""; }; - 172552B7997A8DD1BB3FAAD30C874E7A /* CYLPlusButton.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CYLPlusButton.h; path = CYLTabBarController/CYLPlusButton.h; sourceTree = ""; }; - 1738D668B8205B80DFC8A5FA6B58B071 /* IQUIView+IQKeyboardToolbar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "IQUIView+IQKeyboardToolbar.m"; path = "IQKeyboardManager/IQToolbar/IQUIView+IQKeyboardToolbar.m"; sourceTree = ""; }; - 179C1848315B94F71DE6C5A8A1076B2C /* BMKUtilsComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKUtilsComponent.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKUtilsComponent.h; sourceTree = ""; }; - 17D5CED96DEC6FD427A9E41F007F20E5 /* M13ProgressViewStripedBar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewStripedBar.h; path = Classes/ProgressViews/M13ProgressViewStripedBar.h; sourceTree = ""; }; - 1809491F7EE6906ACD46D05326AF9693 /* YYImage-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "YYImage-dummy.m"; sourceTree = ""; }; - 181C5747E232624E725EEF6347BE2782 /* ASICloudFilesContainer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASICloudFilesContainer.h; path = Classes/CloudFiles/ASICloudFilesContainer.h; sourceTree = ""; }; - 183FD1C716DA1C48DC0131CC3E217B67 /* BMKOpenRouteOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOpenRouteOption.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKOpenRouteOption.h; sourceTree = ""; }; - 1880C85B086D35C9E5F6528F9CE38CC0 /* MJRefresh.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MJRefresh.xcconfig; sourceTree = ""; }; - 1902867C791F9F9BA6E5F6FC26517BCA /* MJRefreshAutoFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshAutoFooter.h; path = MJRefresh/Base/MJRefreshAutoFooter.h; sourceTree = ""; }; - 1947701CC5128684FDDAD7AE102E56F3 /* ZFDownloadManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFDownloadManager.h; path = ZFDownload/ZFDownloadManager.h; sourceTree = ""; }; - 1975A741AB5C26754D0AF143A6E35E44 /* IFlyTextUnderstander.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyTextUnderstander.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyTextUnderstander.h; sourceTree = ""; }; - 197B51C963997017C2D740A82FC30B50 /* UIScrollView+MJExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIScrollView+MJExtension.m"; path = "MJRefresh/UIScrollView+MJExtension.m"; sourceTree = ""; }; - 1986E9400068DB3E067D656307FE950F /* UINavigationController+M13ProgressViewBar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UINavigationController+M13ProgressViewBar.m"; path = "Classes/NavigationController/UINavigationController+M13ProgressViewBar.m"; sourceTree = ""; }; - 19C654510C6C4D312FE2CED00534C7D3 /* BMKGroundOverlay.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKGroundOverlay.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKGroundOverlay.h; sourceTree = ""; }; - 1A56F90BCB402100D8F205FD69ED7973 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; }; - 1AB040A0795B9BF944B255F2BF1A054C /* UIButton+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+WebCache.h"; path = "SDWebImage/UIButton+WebCache.h"; sourceTree = ""; }; - 1AB9B5F626C85BE4E94E30317721C063 /* ZFBrightnessView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZFBrightnessView.m; path = ZFPlayer/ZFBrightnessView.m; sourceTree = ""; }; - 1ABDAEBD145D1FBE989709FB053C6619 /* UIImage+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+YYAdd.h"; path = "YYCategories/UIKit/UIImage+YYAdd.h"; sourceTree = ""; }; - 1AC975587C57D95E4171139F585495EF /* MASViewAttribute.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASViewAttribute.h; path = Masonry/MASViewAttribute.h; sourceTree = ""; }; - 1B435BD95081871A2E057C3F9F5689F8 /* MJRefreshBackStateFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshBackStateFooter.m; path = MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.m; sourceTree = ""; }; - 1B8706D66A8CB70653005CB4910F1194 /* SDWebImageCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCoder.m; path = SDWebImage/SDWebImageCoder.m; sourceTree = ""; }; - 1B990E9DA980F0A07EEB232B9BA49862 /* ASIS3Bucket.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIS3Bucket.h; path = Classes/S3/ASIS3Bucket.h; sourceTree = ""; }; - 1C3CB970A008F1F94860F842B7183004 /* IFlySpeechRecognizer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechRecognizer.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechRecognizer.h; sourceTree = ""; }; - 1C4A04B7E165F1DA59948AB160DC91EF /* IFlyResourceUtil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyResourceUtil.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyResourceUtil.h; sourceTree = ""; }; - 1C5061CB166F6F474AAB91AD6984F408 /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLRequestSerialization.m; path = AFNetworking/AFURLRequestSerialization.m; sourceTree = ""; }; - 1C5AB013AAF6D7E9A137A4CE3A3FE3AC /* TDHomeViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TDHomeViewController.h; path = TDTouchID/TDTouchID/TDHomeViewController.h; sourceTree = ""; }; - 1C86828CC51CDE0A5996A774CAE23B46 /* M13ProgressViewRadiative.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewRadiative.h; path = Classes/ProgressViews/M13ProgressViewRadiative.h; sourceTree = ""; }; - 1C8889B5FEFC5431D539841612835197 /* HMScannerViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMScannerViewController.h; path = HMQRCodeScanner/QRCode/HMScannerViewController.h; sourceTree = ""; }; - 1CEAA11E52161F83D04D9F0EE72D55DC /* MJExtension-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MJExtension-prefix.pch"; sourceTree = ""; }; - 1CFF73EFEE36A5D85DF2EC79CEFE2E8A /* BMKMapManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKMapManager.h; path = BaiduMapKit/BaiduMapAPI_Base.framework/Headers/BMKMapManager.h; sourceTree = ""; }; - 1D2F73D1100411165702F071A2405DFD /* M13ProgressViewSegmentedBar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewSegmentedBar.h; path = Classes/ProgressViews/M13ProgressViewSegmentedBar.h; sourceTree = ""; }; - 1D47FAEBB9BAD519D7C2DEA46391DC3F /* ASICacheDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASICacheDelegate.h; path = Classes/ASICacheDelegate.h; sourceTree = ""; }; - 1DB0FEA16DA960E07BBD3F783C4C5963 /* NSParagraphStyle+YYText.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSParagraphStyle+YYText.h"; path = "YYText/Utility/NSParagraphStyle+YYText.h"; sourceTree = ""; }; - 1E344AE4EC41ADCB5B47512BCDEB3E95 /* NSString+HMEmoji.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSString+HMEmoji.h"; path = "表情键盘/Emoticon/NSString+HMEmoji.h"; sourceTree = ""; }; - 1EE977CAC994CD42956C9D2AFDCF7C3B /* BMKOpenOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOpenOption.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKOpenOption.h; sourceTree = ""; }; - 1F73DE73818A59A85FB8CE74C5BF5EE4 /* FMDB.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDB.h; path = src/fmdb/FMDB.h; sourceTree = ""; }; - 1FAE651A3D0222E82C506B6F88FE31EA /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLResponseSerialization.h; path = AFNetworking/AFURLResponseSerialization.h; sourceTree = ""; }; - 1FCF2E7D6D6233B980D4BBF9D9CEE81D /* UIImage+ForceDecode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+ForceDecode.h"; path = "SDWebImage/UIImage+ForceDecode.h"; sourceTree = ""; }; - 2093B87350850B95D168886873AB99E9 /* MJRefreshFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshFooter.h; path = MJRefresh/Base/MJRefreshFooter.h; sourceTree = ""; }; - 212FF0C33765D441889A0A894499608C /* YYCategories-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "YYCategories-prefix.pch"; sourceTree = ""; }; - 21777A9BC63C71373596B99A8F5CCA68 /* FMDatabase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDatabase.h; path = src/fmdb/FMDatabase.h; sourceTree = ""; }; - 22276690AB3B218397EEFE25A427DEA5 /* IFlyDataUploader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyDataUploader.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyDataUploader.h; sourceTree = ""; }; - 229B7F36FCD835D22A61D2E7CC90B7E0 /* AFNetworking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AFNetworking-prefix.pch"; sourceTree = ""; }; - 22E460D17504CEB737282594FB33C067 /* NSKeyedUnarchiver+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSKeyedUnarchiver+YYAdd.m"; path = "YYCategories/Foundation/NSKeyedUnarchiver+YYAdd.m"; sourceTree = ""; }; - 22E8C6BA6067D3CF4B76C54E473FDE3D /* AFAutoPurgingImageCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFAutoPurgingImageCache.m; path = "UIKit+AFNetworking/AFAutoPurgingImageCache.m"; sourceTree = ""; }; - 2315CA205E9BB7D8D644F26A26521EF6 /* ASINetworkQueue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASINetworkQueue.h; path = Classes/ASINetworkQueue.h; sourceTree = ""; }; - 2372B9B2E44A26EDA2CC93E2E659F95F /* IQUIWindow+Hierarchy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "IQUIWindow+Hierarchy.h"; path = "IQKeyboardManager/Categories/IQUIWindow+Hierarchy.h"; sourceTree = ""; }; - 23AF62AA93085C0709D200DB5CF36938 /* ASIDownloadCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIDownloadCache.m; path = Classes/ASIDownloadCache.m; sourceTree = ""; }; - 23EDE043C83BA88486BB596E398260CF /* BMKLocationComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKLocationComponent.h; path = BaiduMapKit/BaiduMapAPI_Location.framework/Headers/BMKLocationComponent.h; sourceTree = ""; }; - 24B5DA25321A4A42BE2857558E6FF1A5 /* HMEmoticonManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonManager.h; path = "表情键盘/Emoticon/HMEmoticonManager.h"; sourceTree = ""; }; - 24DB260A228FC5F2660D06F7475E98F8 /* UMSocialNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UMSocialNetwork.framework; path = UShareSDK/UMSocialSDK/UMSocialNetwork.framework; sourceTree = ""; }; - 2543896A6FB91F5F554E958C47327CD8 /* ZFHttpRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFHttpRequest.h; path = ZFDownload/ZFHttpRequest.h; sourceTree = ""; }; - 25C5889608B88CF85C7E02CB64D3E806 /* ZJScrollPageView-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ZJScrollPageView-dummy.m"; sourceTree = ""; }; - 25DD7BBECD9451469980D224CBA32AAA /* M13ProgressSuite-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "M13ProgressSuite-prefix.pch"; sourceTree = ""; }; - 26A5D8463162A73D52409A89781605AD /* UIColor+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIColor+YYAdd.m"; path = "YYCategories/UIKit/UIColor+YYAdd.m"; sourceTree = ""; }; - 27584B3B58CC2FA142B0267FC6512F5E /* HMEmoticonToolbar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonToolbar.h; path = "表情键盘/Emoticon/HMEmoticonToolbar.h"; sourceTree = ""; }; - 279FC32943EB0622AF4AD148AEF94F99 /* SDCollectionViewCell.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDCollectionViewCell.m; path = SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.m; sourceTree = ""; }; - 2820A3D0243F910D475EDA711A603C53 /* ZFPlayer-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ZFPlayer-prefix.pch"; sourceTree = ""; }; - 283622CC1F8E1C4A04F1B4EFC0AAFF84 /* ZFFileModel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZFFileModel.m; path = ZFDownload/ZFFileModel.m; sourceTree = ""; }; - 28B5E9F25214A44CE763DC0BB701541D /* TZImagePickerController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZImagePickerController.h; path = TZImagePickerController/TZImagePickerController/TZImagePickerController.h; sourceTree = ""; }; - 28D9AD1C76B43E04E0B7F8A1375AA58F /* HMEmoticonTipView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonTipView.m; path = "表情键盘/Emoticon/HMEmoticonTipView.m"; sourceTree = ""; }; - 28D9E939466D7A5E461493F0BE983B94 /* NSObject+YYAddForKVO.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+YYAddForKVO.h"; path = "YYCategories/Foundation/NSObject+YYAddForKVO.h"; sourceTree = ""; }; - 2981833DCCE11BFC4C1BD4A85EE693F2 /* libYYText.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libYYText.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 29848F154041E6427AC5277CE477609B /* ZFDownload-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ZFDownload-dummy.m"; sourceTree = ""; }; - 2A09DBE8FA9BAA2EA404827D3B0FCA9E /* M13ProgressViewLetterpress.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewLetterpress.h; path = Classes/ProgressViews/M13ProgressViewLetterpress.h; sourceTree = ""; }; - 2A21105BF4BE00AFC745EDD4031455A0 /* MJFoundation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJFoundation.h; path = MJExtension/MJFoundation.h; sourceTree = ""; }; - 2A6A421E372666B626776FE143A6EB39 /* BMKTileLayer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKTileLayer.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKTileLayer.h; sourceTree = ""; }; - 2AD8EB34771A3B03AF7E57CB95DC0D27 /* MJPropertyKey.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJPropertyKey.h; path = MJExtension/MJPropertyKey.h; sourceTree = ""; }; - 2B3C039D052A2B29863E20147BD5CE07 /* UIActivityIndicatorView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIActivityIndicatorView+AFNetworking.h"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h"; sourceTree = ""; }; - 2B877CA80ECE571A26E986BBD116B0F8 /* KILabel.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = KILabel.xcconfig; sourceTree = ""; }; - 2C0CE5B41DE6A3427FBDCE786A38AC56 /* MJPropertyType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJPropertyType.h; path = MJExtension/MJPropertyType.h; sourceTree = ""; }; - 2C1C9D4B49CD59C7ABBACB54F8203D56 /* IFlySpeechConstant.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechConstant.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechConstant.h; sourceTree = ""; }; - 2C71009EF54A4F4DB4D6B4BE10B10F34 /* ZJContentView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZJContentView.h; path = ZJScrollPageView/ZJScrollPageView/ZJContentView.h; sourceTree = ""; }; - 2CBC579CAA38E919A439CBE3ACACFF72 /* SDCycleScrollView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDCycleScrollView.h; path = SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.h; sourceTree = ""; }; - 2CC3905753CA39110BB71FBF85DF2FEC /* UIImageView+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+WebCache.h"; path = "SDWebImage/UIImageView+WebCache.h"; sourceTree = ""; }; - 2CD6813DDF5259FD84AB9CFB8757D956 /* GVUserDefaults.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GVUserDefaults.m; path = GVUserDefaults/GVUserDefaults.m; sourceTree = ""; }; - 2DA29B793BD344BA4D24FCABFE3D38F3 /* M13ProgressSuite-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "M13ProgressSuite-dummy.m"; sourceTree = ""; }; - 2E43A5920D5114A2C2373A720201B659 /* BMKLocationService.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKLocationService.h; path = BaiduMapKit/BaiduMapAPI_Location.framework/Headers/BMKLocationService.h; sourceTree = ""; }; - 2E71B72FCFDE8D0777AFD22FC842B23F /* TZImageCropManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZImageCropManager.h; path = TZImagePickerController/TZImagePickerController/TZImageCropManager.h; sourceTree = ""; }; - 2EB1C2161FB529386F2B945D7DFB6627 /* YYCategories.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = YYCategories.xcconfig; sourceTree = ""; }; - 2EE6D33DB39283F1D12803691C1A9690 /* HMQRCodeScanner.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = HMQRCodeScanner.xcconfig; sourceTree = ""; }; - 2F58CBFD6BB26DBAD742A0994ABAEE53 /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPSessionManager.m; path = AFNetworking/AFHTTPSessionManager.m; sourceTree = ""; }; - 2FBA809DCC713C050568DD18E2485752 /* FCUUID.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FCUUID.h; path = FCUUID/FCUUID.h; sourceTree = ""; }; - 301D35D0B2632B6775364C55BD76C308 /* IFlyISVRecognizer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyISVRecognizer.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyISVRecognizer.h; sourceTree = ""; }; - 3069F9070FE360DF1229E8678F000B74 /* UIWindow+CurrentViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIWindow+CurrentViewController.h"; path = "ZFPlayer/Category/UIWindow+CurrentViewController.h"; sourceTree = ""; }; - 309BCCA47832745DB9BBC9594C616752 /* YYText-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "YYText-prefix.pch"; sourceTree = ""; }; - 30ABD7956C35F060AD4FF103820F28B6 /* MOFSPickerManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MOFSPickerManager.h; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSPickerManager.h; sourceTree = ""; }; - 30B10F211DB136E7CF86F869350545D8 /* YYTextUtilities.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextUtilities.h; path = YYText/Utility/YYTextUtilities.h; sourceTree = ""; }; - 3114E396DC236CB92EE5BECE8FAA0A9E /* ZFPlayerView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFPlayerView.h; path = ZFPlayer/ZFPlayerView.h; sourceTree = ""; }; - 316B30550D18BE25FB597B989E062461 /* MJExtensionConst.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJExtensionConst.m; path = MJExtension/MJExtensionConst.m; sourceTree = ""; }; - 322A1C7F7847A547D10AD82008EB11A8 /* YYTextLayout.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextLayout.m; path = YYText/Component/YYTextLayout.m; sourceTree = ""; }; - 326AD7805BA3D8D0C9D9DC3EBB4CB09A /* MOFSAddressPickerView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MOFSAddressPickerView.h; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSAddressPickerView.h; sourceTree = ""; }; - 32A67E99FAFE3D33F5C74F52AF4C9A38 /* M13ProgressViewBorderedBar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewBorderedBar.h; path = Classes/ProgressViews/M13ProgressViewBorderedBar.h; sourceTree = ""; }; - 32B9B3125F87B726C421B0DC395C7790 /* BMKShareURLSearch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKShareURLSearch.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKShareURLSearch.h; sourceTree = ""; }; - 32D6680EAAD2588E3EEDDD917F8648E7 /* ASIWebPageRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIWebPageRequest.m; path = Classes/ASIWebPageRequest/ASIWebPageRequest.m; sourceTree = ""; }; - 34048ECB850241A4FEB134C95C46B7D0 /* YYTextLine.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextLine.m; path = YYText/Component/YYTextLine.m; sourceTree = ""; }; - 34B6FD8FA9461758A77F7C7EBEACB9B1 /* TencentOpenAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TencentOpenAPI.framework; path = UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework; sourceTree = ""; }; - 34C9F06C68029BADDDAA3F989CCEF3B2 /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = WebViewJavascriptBridge.m; path = WebViewJavascriptBridge/WebViewJavascriptBridge.m; sourceTree = ""; }; - 3559FB681694634974CA14916E1B5F84 /* TAAnimatedDotView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TAAnimatedDotView.m; path = SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.m; sourceTree = ""; }; - 356B8D85D8A6B5F2036CDA48E58BA132 /* BaiduMapAPI_Cloud.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Cloud.framework; path = BaiduMapKit/BaiduMapAPI_Cloud.framework; sourceTree = ""; }; - 35CCCDF9F83091A7172ADF28D28CFD09 /* UIView+MJExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+MJExtension.m"; path = "MJRefresh/UIView+MJExtension.m"; sourceTree = ""; }; - 35E12FD87666C01C6212FF779A816FE3 /* ASICloudFilesContainerXMLParserDelegate.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASICloudFilesContainerXMLParserDelegate.m; path = Classes/CloudFiles/ASICloudFilesContainerXMLParserDelegate.m; sourceTree = ""; }; - 35E7218A358355763AC5FBF1584E8A81 /* MOFSDatePicker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MOFSDatePicker.h; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSDatePicker.h; sourceTree = ""; }; - 3693E4C9E6D5A593369CFA3B5BA1F919 /* UIScrollView+MJRefresh.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIScrollView+MJRefresh.m"; path = "MJRefresh/UIScrollView+MJRefresh.m"; sourceTree = ""; }; - 36A30E0722E147FAF9FAAEC5FCF220F4 /* NSBundle+HMEmoticon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSBundle+HMEmoticon.h"; path = "表情键盘/Emoticon/NSBundle+HMEmoticon.h"; sourceTree = ""; }; - 36B3099D08D46D39364C35161B90D5DA /* libM13ProgressSuite.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libM13ProgressSuite.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 36E895F90E9430FC321F70DE72B2CAA6 /* ASIS3ServiceRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIS3ServiceRequest.h; path = Classes/S3/ASIS3ServiceRequest.h; sourceTree = ""; }; - 370A38ED08983AFC12268A6293D65FB9 /* UIView+Layout.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+Layout.m"; path = "TZImagePickerController/TZImagePickerController/UIView+Layout.m"; sourceTree = ""; }; - 37112105D58885CF692E67995B289BCA /* HMEmoticonCell.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonCell.h; path = "表情键盘/Emoticon/HMEmoticonCell.h"; sourceTree = ""; }; - 376E611E7554508960AE7A8CC964AEDD /* TZImagePickerController-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "TZImagePickerController-dummy.m"; sourceTree = ""; }; - 37A11299A8AEBFDCD51BE4CECAB4CF0F /* IFlySpeechUtility.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechUtility.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechUtility.h; sourceTree = ""; }; - 37C879A74B09A3DC3588B9BD7A609C84 /* SDWebImageDownloaderOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloaderOperation.h; path = SDWebImage/SDWebImageDownloaderOperation.h; sourceTree = ""; }; - 37DFF12B9AA9EDE5E2532087F5B1E9D1 /* SDWebImageDownloaderOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloaderOperation.m; path = SDWebImage/SDWebImageDownloaderOperation.m; sourceTree = ""; }; - 37FA9D3B39581ABA211EF9899373B56E /* YYTextTransaction.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextTransaction.h; path = YYText/Utility/YYTextTransaction.h; sourceTree = ""; }; - 382FD13E4C98FB28B10B4A7C8707DFDC /* BMKShape.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKShape.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKShape.h; sourceTree = ""; }; - 38355552C1618C98BC03DC84F8739D3A /* libMJRefresh.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMJRefresh.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 386BF5D8CA58DF95AED3B5C8164EEB56 /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+ImageEffects.h"; path = "Classes/HUD/UIImage+ImageEffects.h"; sourceTree = ""; }; - 3882ECEEB940692306090D44BA97408E /* BMKCloudSearchComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKCloudSearchComponent.h; path = BaiduMapKit/BaiduMapAPI_Cloud.framework/Headers/BMKCloudSearchComponent.h; sourceTree = ""; }; - 388A3D4E626D16D2FFC3D4ACC2877016 /* BMKGeocodeType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKGeocodeType.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKGeocodeType.h; sourceTree = ""; }; - 389198E626BFB390A19FB501A62C30FA /* SDCollectionViewCell.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDCollectionViewCell.h; path = SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.h; sourceTree = ""; }; - 38C2D3ED00390A6B157A8B2AE4CA7635 /* MASLayoutConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASLayoutConstraint.m; path = Masonry/MASLayoutConstraint.m; sourceTree = ""; }; - 39150030131DCE5B741A6BCF703EB72C /* Reachability.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = ""; }; - 39221870455CF6CFF22802E4CBFE154E /* YYTextParser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextParser.h; path = YYText/String/YYTextParser.h; sourceTree = ""; }; - 39261A9C29C19403297C88DA37C2FB4C /* NSObject+MJProperty.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSObject+MJProperty.m"; path = "MJExtension/NSObject+MJProperty.m"; sourceTree = ""; }; - 39D30DF56100E8FF992F600B4A1307ED /* IFlyContact.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyContact.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyContact.h; sourceTree = ""; }; - 39EED10624702BD9A5A7EC170BD6E789 /* View+MASAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "View+MASAdditions.h"; path = "Masonry/View+MASAdditions.h"; sourceTree = ""; }; - 3A2E70D45295C469AB76D752A3089B2B /* ZJTitleView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZJTitleView.h; path = ZJScrollPageView/ZJScrollPageView/ZJTitleView.h; sourceTree = ""; }; - 3A36F0C2C74FBAA2BE7140E1CC039547 /* libZFDownload.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libZFDownload.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 3AD0CF66E275F4EFBAD0B13DD283E28A /* YYTextRunDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextRunDelegate.h; path = YYText/String/YYTextRunDelegate.h; sourceTree = ""; }; - 3AE19DCDE3F0A8434893883870D280D5 /* IQNSArray+Sort.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "IQNSArray+Sort.h"; path = "IQKeyboardManager/Categories/IQNSArray+Sort.h"; sourceTree = ""; }; - 3AE37559593AA7FE338FEB3FCF450872 /* TZAssetCell.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZAssetCell.h; path = TZImagePickerController/TZImagePickerController/TZAssetCell.h; sourceTree = ""; }; - 3AF73D974F1E74DC956525817A9F5DD4 /* WechatAuthSDK.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WechatAuthSDK.h; path = OpenSDK1.8.1/WechatAuthSDK.h; sourceTree = ""; }; - 3B086968F218A6AFF91792FBDDC5E500 /* IFlySpeechSynthesizer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechSynthesizer.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechSynthesizer.h; sourceTree = ""; }; - 3C658D9A114CB4D99679160C0495B8B1 /* TZProgressView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZProgressView.m; path = TZImagePickerController/TZImagePickerController/TZProgressView.m; sourceTree = ""; }; - 3CAB8FE95F0621A33143581C84DDBB26 /* ASIDownloadCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIDownloadCache.h; path = Classes/ASIDownloadCache.h; sourceTree = ""; }; - 3E6E540E74178FA3B475564EC9414466 /* libYYCategories.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libYYCategories.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 3E95F9C1F91B8336C1D68C38E8EF2A3D /* FMDatabaseQueue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDatabaseQueue.h; path = src/fmdb/FMDatabaseQueue.h; sourceTree = ""; }; - 3EB2CA434E1A9885D2D950B7DD58FCFD /* IQKeyboardManager-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "IQKeyboardManager-dummy.m"; sourceTree = ""; }; - 3F3858BFB8D4C6C65B45044E910C4F6C /* BMKGeneralDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKGeneralDelegate.h; path = BaiduMapKit/BaiduMapAPI_Base.framework/Headers/BMKGeneralDelegate.h; sourceTree = ""; }; - 3F56D148B50DC60B1FA459981F027070 /* M13ProgressViewImage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewImage.h; path = Classes/ProgressViews/M13ProgressViewImage.h; sourceTree = ""; }; - 3F7A0498916C233871F3361E6F723709 /* UIImage+HMEmoticon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+HMEmoticon.m"; path = "表情键盘/Emoticon/UIImage+HMEmoticon.m"; sourceTree = ""; }; - 3F86D364B0C24E6411FBD679DD0E619A /* YYAsyncLayer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYAsyncLayer.m; path = YYAsyncLayer/YYAsyncLayer.m; sourceTree = ""; }; - 3F86FAF093165EDEDFFBAF302169EBEE /* YYLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYLabel.h; path = YYText/YYLabel.h; sourceTree = ""; }; - 3F90DE8A5EFF4F5A88960322DBD3DAE0 /* M13ProgressViewMetroDotPolygon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewMetroDotPolygon.h; path = Classes/ProgressViews/M13ProgressViewMetroDotPolygon.h; sourceTree = ""; }; - 3F9736A575785DBB56C5C59FB62B7ED5 /* IQKeyboardManager.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = IQKeyboardManager.bundle; path = IQKeyboardManager/Resources/IQKeyboardManager.bundle; sourceTree = ""; }; - 3FA26AA6F0CD1055A5F0DBC564D1D068 /* libLxGridView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLxGridView.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 3FC249F4CE2C9101B221059AC15BAE5B /* SDWebImageCodersManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCodersManager.m; path = SDWebImage/SDWebImageCodersManager.m; sourceTree = ""; }; - 3FCD177C2E293B3CB16FAF50E58E15D9 /* UITabBarController+ZFPlayerRotation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UITabBarController+ZFPlayerRotation.m"; path = "ZFPlayer/Category/UITabBarController+ZFPlayerRotation.m"; sourceTree = ""; }; - 3FFD396D9E7483F96D459512C1044011 /* YYTextSelectionView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextSelectionView.m; path = YYText/Component/YYTextSelectionView.m; sourceTree = ""; }; - 40F2704B5342C6A3B3E7FD01D3E0EEB7 /* AFNetworking.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = AFNetworking.xcconfig; sourceTree = ""; }; - 411BD4C6AFD29EC701C3AB1C32B17537 /* SDWebImageCompat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCompat.m; path = SDWebImage/SDWebImageCompat.m; sourceTree = ""; }; - 4122946AD5F17EB885B9333A74496168 /* UIDevice+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIDevice+YYAdd.m"; path = "YYCategories/UIKit/UIDevice+YYAdd.m"; sourceTree = ""; }; - 418B172287A3B2DC4B566CC376D14A45 /* libTDTouchID.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTDTouchID.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 4195F560F59E5FB735943D689110A8D8 /* BaiduMapAPI_Utils.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Utils.framework; path = BaiduMapKit/BaiduMapAPI_Utils.framework; sourceTree = ""; }; - 428BE3001071D5152741D2340F784D3D /* IQUIView+Hierarchy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "IQUIView+Hierarchy.h"; path = "IQKeyboardManager/Categories/IQUIView+Hierarchy.h"; sourceTree = ""; }; - 42F5FA6E7FCA3D341F404BD60840A093 /* libCYLTabBarController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCYLTabBarController.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 430A7D48553284031AD60352AB854BFA /* ViewController+MASAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "ViewController+MASAdditions.h"; path = "Masonry/ViewController+MASAdditions.h"; sourceTree = ""; }; - 43D4D3B47684C382DBFD03600D725126 /* MJExtensionConst.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJExtensionConst.h; path = MJExtension/MJExtensionConst.h; sourceTree = ""; }; - 442C285D8F51F732D1875188CB60E9DD /* NSDictionary+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+YYAdd.h"; path = "YYCategories/Foundation/NSDictionary+YYAdd.h"; sourceTree = ""; }; - 44CC44A9E8D457B6AD32067B5B008808 /* MBProgressHUD-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MBProgressHUD-dummy.m"; sourceTree = ""; }; - 45002705BC7338D6F7750C5804E2646F /* BMKRouteSearch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKRouteSearch.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKRouteSearch.h; sourceTree = ""; }; - 45580AD579EED023106F243FBBBF4603 /* libWebViewJavascriptBridge.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWebViewJavascriptBridge.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 4586FC5846E73EE1EAB3D5199F98B6DC /* SDWebImageCompat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCompat.h; path = SDWebImage/SDWebImageCompat.h; sourceTree = ""; }; - 4592E7448E71600432AF62B752E8F68C /* FDFullscreenPopGesture-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FDFullscreenPopGesture-dummy.m"; sourceTree = ""; }; - 45B081E1FC4211E6FE014D6829F9733E /* UIImageView+HighlightedWebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+HighlightedWebCache.h"; path = "SDWebImage/UIImageView+HighlightedWebCache.h"; sourceTree = ""; }; - 45FB3B94DBFDF5C5C55F7CF5D0974CC2 /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WebViewJavascriptBridgeBase.h; path = WebViewJavascriptBridge/WebViewJavascriptBridgeBase.h; sourceTree = ""; }; - 46225F936A05E21E797072A324BC1F46 /* BMKBaseComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKBaseComponent.h; path = BaiduMapKit/BaiduMapAPI_Base.framework/Headers/BMKBaseComponent.h; sourceTree = ""; }; - 4676C38F5C6FABDA1DC8F87BAE771B09 /* BMKVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKVersion.h; path = BaiduMapKit/BaiduMapAPI_Base.framework/Headers/BMKVersion.h; sourceTree = ""; }; - 46CDE033B21D92EEA829B7D90EA5D866 /* BMKGradient.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKGradient.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKGradient.h; sourceTree = ""; }; - 4751B85044EACE0595F89C99F03B56DC /* MBProgressHUD-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MBProgressHUD-prefix.pch"; sourceTree = ""; }; - 47E21BDEF90FC1859A2136459414D467 /* BaiduMapAPI_Map.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Map.framework; path = BaiduMapKit/BaiduMapAPI_Map.framework; sourceTree = ""; }; - 4886DC156E54016E72A53D18AD55FF20 /* TAAbstractDotView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TAAbstractDotView.h; path = SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.h; sourceTree = ""; }; - 491D7FC822A8EDFC3CD51EAEE8A87743 /* IFlySpeechError.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechError.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechError.h; sourceTree = ""; }; - 4980EAC703BDF1E2090EB34195400DD2 /* UIView+Toast.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+Toast.m"; path = "Toast/UIView+Toast.m"; sourceTree = ""; }; - 49D863896AE8FDD6F71F6919EE319181 /* UIImage+ForceDecode.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+ForceDecode.m"; path = "SDWebImage/UIImage+ForceDecode.m"; sourceTree = ""; }; - 49E3824D64F8F973A6EB45F1CBF07560 /* YYText-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "YYText-dummy.m"; sourceTree = ""; }; - 4A434D7CB260C42DFBF5C8B5E6D390F3 /* CYLConstants.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CYLConstants.h; path = CYLTabBarController/CYLConstants.h; sourceTree = ""; }; - 4A46113BA07919AC815F0A34111D4ED3 /* TZImageManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZImageManager.m; path = TZImagePickerController/TZImagePickerController/TZImageManager.m; sourceTree = ""; }; - 4A5B580837E3442E0B7FF3BC3976DFEB /* ASICloudFilesObjectRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASICloudFilesObjectRequest.m; path = Classes/CloudFiles/ASICloudFilesObjectRequest.m; sourceTree = ""; }; - 4A7B0E469DA766E168AE1E1F39E2077F /* YYCategories-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "YYCategories-dummy.m"; sourceTree = ""; }; - 4A7D90B3D9D521DB644E9C3F780CD150 /* UINavigationController+ZFPlayerRotation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UINavigationController+ZFPlayerRotation.m"; path = "ZFPlayer/Category/UINavigationController+ZFPlayerRotation.m"; sourceTree = ""; }; - 4A7F8B5CD8F574C6537622DB7AA459CA /* M13ProgressViewRing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewRing.h; path = Classes/ProgressViews/M13ProgressViewRing.h; sourceTree = ""; }; - 4AE1C037ED6678753CDDB1FED40CD12D /* UICKeyChainStore-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UICKeyChainStore-prefix.pch"; sourceTree = ""; }; - 4BABB4DEC01A24250E13622C900A1E59 /* ASIFormDataRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIFormDataRequest.h; path = Classes/ASIFormDataRequest.h; sourceTree = ""; }; - 4BC60E7EE4E8FED932B19B607D46ECD5 /* Pods-iOSProject.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-iOSProject.debug.xcconfig"; sourceTree = ""; }; - 4BCF20A5415D3CB162A199DC3FF6781C /* UINavigationController+M13ProgressViewBar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UINavigationController+M13ProgressViewBar.h"; path = "Classes/NavigationController/UINavigationController+M13ProgressViewBar.h"; sourceTree = ""; }; - 4BE8106C13A82B213FE63A220B4F9394 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; - 4BF9E2016048033CBB2FFA2BDF531BC1 /* YYTransaction.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTransaction.h; path = YYAsyncLayer/YYTransaction.h; sourceTree = ""; }; - 4C3031D0C47787DEBEC6131AA8ED1361 /* IQToolbar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQToolbar.h; path = IQKeyboardManager/IQToolbar/IQToolbar.h; sourceTree = ""; }; - 4C9AE8FDC2DF7791AE06C5C8B47F3561 /* TZVideoPlayerController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZVideoPlayerController.m; path = TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m; sourceTree = ""; }; - 4CAB69580B74E84DEA3EDA3A8D29AE48 /* TZProgressView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZProgressView.h; path = TZImagePickerController/TZImagePickerController/TZProgressView.h; sourceTree = ""; }; - 4CDBC8B0D0C36C5BA8F374B00AEECCF6 /* NSThread+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSThread+YYAdd.h"; path = "YYCategories/Foundation/NSThread+YYAdd.h"; sourceTree = ""; }; - 4D45D169F15014C0D5C6BF92853D8686 /* Masonry-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Masonry-prefix.pch"; sourceTree = ""; }; - 4D4B9C607B51548470755E37632C2584 /* UITableView+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UITableView+YYAdd.m"; path = "YYCategories/UIKit/UITableView+YYAdd.m"; sourceTree = ""; }; - 4DCD420F6DD8A8D294CA854535C45814 /* FCUUID-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FCUUID-dummy.m"; sourceTree = ""; }; - 4DEE452B406137B63D566DA132AD7FC6 /* UMSocialSinaHandler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UMSocialSinaHandler.h; path = UShareSDK/SocialLibraries/Sina/UMSocialSinaHandler.h; sourceTree = ""; }; - 4DF8DCC596367595B76B7524E5504D5B /* NSObject+YYAddForKVO.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSObject+YYAddForKVO.m"; path = "YYCategories/Foundation/NSObject+YYAddForKVO.m"; sourceTree = ""; }; - 4E2B34688FA008B5631B594362A4B865 /* BMKLocationViewDisplayParam.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKLocationViewDisplayParam.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKLocationViewDisplayParam.h; sourceTree = ""; }; - 4E62574E7B64FBEFECD764FCE83E4D40 /* TDMainViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TDMainViewController.m; path = TDTouchID/TDTouchID/TDMainViewController.m; sourceTree = ""; }; - 4EB49719C67E66CBADC0406E00899A41 /* UIImageView+HighlightedWebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+HighlightedWebCache.m"; path = "SDWebImage/UIImageView+HighlightedWebCache.m"; sourceTree = ""; }; - 4ECA81B3F9CF5671F90DC6E8881725B1 /* ZJContentView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZJContentView.m; path = ZJScrollPageView/ZJScrollPageView/ZJContentView.m; sourceTree = ""; }; - 4F2E943FC93B46DA65D77ED338CC83F6 /* BMKActionPaopaoView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKActionPaopaoView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKActionPaopaoView.h; sourceTree = ""; }; - 4F4D8903EA1B84828CDDF6572E1E4003 /* LxGridView-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "LxGridView-dummy.m"; sourceTree = ""; }; - 4FAAEFBD3BED098B6EE7DFBC7477503A /* Reachability-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Reachability-dummy.m"; sourceTree = ""; }; - 500964AC4B9B451E5C54E710E893D861 /* FMDB-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FMDB-dummy.m"; sourceTree = ""; }; - 504D8B47515545DBCC16F7B867D0A612 /* BMKUserLocation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKUserLocation.h; path = BaiduMapKit/BaiduMapAPI_Base.framework/Headers/BMKUserLocation.h; sourceTree = ""; }; - 50CDB35644BAC5E86EC745E5793E0E81 /* UIWindow+CurrentViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIWindow+CurrentViewController.m"; path = "ZFPlayer/Category/UIWindow+CurrentViewController.m"; sourceTree = ""; }; - 52313425657EDC5AB8D7BB5EC8C33668 /* Pods-iOSProject-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-iOSProject-dummy.m"; sourceTree = ""; }; - 5281D214632B617FBCA000A78B36F01E /* ASIS3ObjectRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIS3ObjectRequest.h; path = Classes/S3/ASIS3ObjectRequest.h; sourceTree = ""; }; - 52F346A3FA3095FAB9E2C02586456232 /* TDTouchID-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "TDTouchID-dummy.m"; sourceTree = ""; }; - 5375DBACF559A32DC389A5B232BA8D5E /* UIControl+CYLTabBarControllerExtention.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIControl+CYLTabBarControllerExtention.h"; path = "CYLTabBarController/UIControl+CYLTabBarControllerExtention.h"; sourceTree = ""; }; - 5438F952A655240194038B21BF0DB1AC /* YYTextAsyncLayer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextAsyncLayer.h; path = YYText/Utility/YYTextAsyncLayer.h; sourceTree = ""; }; - 54CA8928573B72E2BFCDCEE606BC9EDB /* WebViewJavascriptBridgeBase.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = WebViewJavascriptBridgeBase.m; path = WebViewJavascriptBridge/WebViewJavascriptBridgeBase.m; sourceTree = ""; }; - 54DABCF6EA0D70917D4C35862D86C15E /* IFlyPcmRecorder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyPcmRecorder.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyPcmRecorder.h; sourceTree = ""; }; - 55A8F2683775E9096AFDE9E4F45BE1B6 /* HMQRCodeScanner-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "HMQRCodeScanner-prefix.pch"; sourceTree = ""; }; - 55AC9D14F2D6FA75ACD22F6F740BD78B /* ASIHTTPRequest-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ASIHTTPRequest-prefix.pch"; sourceTree = ""; }; - 560F6CDFE0EDADC15962E6D461276AF9 /* libPods-iOSProject.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-iOSProject.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 56572A7E4016ED7DB3B439EA592E9985 /* FMDB.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FMDB.xcconfig; sourceTree = ""; }; - 5678650B327F3A34C944E809BDF44C24 /* TDTouchID.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = TDTouchID.xcconfig; sourceTree = ""; }; - 56B65A371093C0C9C912F74B8A2458C1 /* UITextField+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UITextField+YYAdd.m"; path = "YYCategories/UIKit/UITextField+YYAdd.m"; sourceTree = ""; }; - 56D5CFA757E346D2AE905A50475E6103 /* TZAssetModel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZAssetModel.m; path = TZImagePickerController/TZImagePickerController/TZAssetModel.m; sourceTree = ""; }; - 578F22B2ED2327A4E20E49D7B4C4D8C4 /* SDWebImageFrame.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageFrame.m; path = SDWebImage/SDWebImageFrame.m; sourceTree = ""; }; - 57B5CEC38C62D24CC2032DAACAFB7570 /* WeiboSDK+Statistics.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "WeiboSDK+Statistics.h"; path = "UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK+Statistics.h"; sourceTree = ""; }; - 57F77641012CB1E327263325533174E5 /* MWFloatView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MWFloatView.h; path = MagicWindowSDK/MagicWindowSDK/MWFloatView.h; sourceTree = ""; }; - 585206702AEABCBC79D3D609DD122D60 /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIRefreshControl+AFNetworking.m"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.m"; sourceTree = ""; }; - 586ACEBF08E01CD755B966EF900D8E35 /* UIBarButtonItem+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIBarButtonItem+YYAdd.h"; path = "YYCategories/UIKit/UIBarButtonItem+YYAdd.h"; sourceTree = ""; }; - 58CA64EB1FA511FB7726592383FF9AFA /* BMKRouteSearchOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKRouteSearchOption.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKRouteSearchOption.h; sourceTree = ""; }; - 58D4E15F844FF5BF36101445BFC8CAF6 /* ASIHTTPRequest.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ASIHTTPRequest.xcconfig; sourceTree = ""; }; - 5925CF13424B1E4D99CCD97FE1FCDB3A /* ASIS3Request.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIS3Request.m; path = Classes/S3/ASIS3Request.m; sourceTree = ""; }; - 595611A562D2A4A2A88E04A832F1576C /* YYTextWeakProxy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextWeakProxy.m; path = YYText/Utility/YYTextWeakProxy.m; sourceTree = ""; }; - 595CF889C0406EEEFA1595C7CBB100D0 /* YYTextView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextView.m; path = YYText/YYTextView.m; sourceTree = ""; }; - 5987A0D6BB3B5276E79A941A8128426B /* ASIHTTPRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIHTTPRequest.m; path = Classes/ASIHTTPRequest.m; sourceTree = ""; }; - 598FA6A04D58841119AD2914D139748B /* BMKBusLineSearchOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKBusLineSearchOption.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKBusLineSearchOption.h; sourceTree = ""; }; - 5ABE10B7074DCB7134A2E78CCD4AA17F /* SDCycleScrollView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDCycleScrollView.m; path = SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m; sourceTree = ""; }; - 5AFA40940EB9DBE725360C223ADB5550 /* M13ProgressViewRing.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewRing.m; path = Classes/ProgressViews/M13ProgressViewRing.m; sourceTree = ""; }; - 5B21BD8AD289FC14222CEF5D51B7AE00 /* BMKPolyline.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPolyline.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKPolyline.h; sourceTree = ""; }; - 5B7A314924964C5A5B5E551289D93381 /* NSTimer+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSTimer+YYAdd.h"; path = "YYCategories/Foundation/NSTimer+YYAdd.h"; sourceTree = ""; }; - 5C448986E95932C8E76061C5D377B32B /* Pods-iOSProject-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-iOSProject-frameworks.sh"; sourceTree = ""; }; - 5C564B469D1D78D835835F734FB75952 /* TDMainViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TDMainViewController.h; path = TDTouchID/TDTouchID/TDMainViewController.h; sourceTree = ""; }; - 5CC7F124AED1B4CA930A1CE05462E6F0 /* LxGridViewFlowLayout.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = LxGridViewFlowLayout.m; path = LxGridView/LxGridViewFlowLayout.m; sourceTree = ""; }; - 5CE78575F484C9556087F5799E026B14 /* SDWebImageFrame.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageFrame.h; path = SDWebImage/SDWebImageFrame.h; sourceTree = ""; }; - 5CE816BC163F9E7124C5CD2372072AA7 /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+AFNetworking.m"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.m"; sourceTree = ""; }; - 5CF482922F43A0132EDFD72000708C5B /* UIControl+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIControl+YYAdd.h"; path = "YYCategories/UIKit/UIControl+YYAdd.h"; sourceTree = ""; }; - 5D1CDBC2850AABFC6AD84E95236BEB14 /* libDWBubbleMenuButton.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDWBubbleMenuButton.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E3A79FB3A49131B618917506A72D107 /* IQKeyboardManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = IQKeyboardManager.m; path = IQKeyboardManager/IQKeyboardManager.m; sourceTree = ""; }; - 5E438BF4BEB9B7901D34F238BB7F7C91 /* HMEmoticon.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = HMEmoticon.xcconfig; sourceTree = ""; }; - 5E729ECD06AC0AC67CE15607887CFB60 /* SDWebImagePrefetcher.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImagePrefetcher.m; path = SDWebImage/SDWebImagePrefetcher.m; sourceTree = ""; }; - 5EEAA9BD6C855FE00716EB2940A456DB /* libYYImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libYYImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 5F515A320FEDD07E998069523FCCAC17 /* UIApplication+M13ProgressSuite.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIApplication+M13ProgressSuite.m"; path = "Classes/Application/UIApplication+M13ProgressSuite.m"; sourceTree = ""; }; - 5F6E42404EFF164F4A413DF0F93E167A /* DWBubbleMenuButton.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = DWBubbleMenuButton.xcconfig; sourceTree = ""; }; - 5FBD84457C9F49BADCC0EF122697BB92 /* YYText.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYText.h; path = YYText/YYText.h; sourceTree = ""; }; - 601E8D270F8B1698017F4C325FA1EFD6 /* TAAnimatedDotView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TAAnimatedDotView.h; path = SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.h; sourceTree = ""; }; - 602EC22D332F11DA4F99856D7EBE98A6 /* YYSpriteSheetImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYSpriteSheetImage.m; path = YYImage/YYSpriteSheetImage.m; sourceTree = ""; }; - 60426ED0D1C2CCF640F5CDE9712F06B2 /* UIView+SDExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+SDExtension.m"; path = "SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.m"; sourceTree = ""; }; - 60A505C8E06B1775743CD5DA29EA83FF /* UIView+WebCacheOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+WebCacheOperation.m"; path = "SDWebImage/UIView+WebCacheOperation.m"; sourceTree = ""; }; - 61064FA074EFFD50147C8E44EBB7A695 /* libUMSocialLog.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libUMSocialLog.a; path = UShareSDK/UMSocialSDKPlugin/libUMSocialLog.a; sourceTree = ""; }; - 614C722F31B43E33726D248055FF8A05 /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFHTTPSessionManager.h; path = AFNetworking/AFHTTPSessionManager.h; sourceTree = ""; }; - 6150F3150DD46F840DD43FAA845733E6 /* NSImage+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSImage+WebCache.h"; path = "SDWebImage/NSImage+WebCache.h"; sourceTree = ""; }; - 616054214C2A180EEFF6667FCFFA3262 /* YYAnimatedImageView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYAnimatedImageView.m; path = YYImage/YYAnimatedImageView.m; sourceTree = ""; }; - 616B540C1CBB33C3D622B9A91B8E447F /* SDWebImageGIFCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageGIFCoder.h; path = SDWebImage/SDWebImageGIFCoder.h; sourceTree = ""; }; - 617C4C14104EE1854D08AB83CAAD8C2E /* BMKShareUrlSearchOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKShareUrlSearchOption.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKShareUrlSearchOption.h; sourceTree = ""; }; - 61843CD8F09FBA7CF403BCC05D33BA62 /* BMKOverlayView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOverlayView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKOverlayView.h; sourceTree = ""; }; - 61E8CE13F8E04628F8AAB85AC43F0BC7 /* BMKMultiPoint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKMultiPoint.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKMultiPoint.h; sourceTree = ""; }; - 61ECA0F0888DDC036CE8BC7170617F50 /* LxGridViewCell.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = LxGridViewCell.m; path = LxGridView/LxGridViewCell.m; sourceTree = ""; }; - 626814BB0D43C8E27E1B09C855CD5170 /* YYCategoriesMacro.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYCategoriesMacro.h; path = YYCategories/YYCategoriesMacro.h; sourceTree = ""; }; - 6280AC1707A75E995D09994C02800BF2 /* libIQKeyboardManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libIQKeyboardManager.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 62BA41A4C26D5F10CCFF25A35DF57C31 /* ZFPlayerControlViewDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFPlayerControlViewDelegate.h; path = ZFPlayer/ZFPlayerControlViewDelegate.h; sourceTree = ""; }; - 62BD954F90E291411F1BBDBE77FA6446 /* mapapi.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = mapapi.bundle; path = BaiduMapKit/BaiduMapAPI_Map.framework/Resources/mapapi.bundle; sourceTree = ""; }; - 62CE364E24912DA736C087CD437E89F1 /* NSObject+MJCoding.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+MJCoding.h"; path = "MJExtension/NSObject+MJCoding.h"; sourceTree = ""; }; - 62F6BC0BC8A6BD2BE8B8A67822F162C6 /* SDImageCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCache.m; path = SDWebImage/SDImageCache.m; sourceTree = ""; }; - 634BB9F175B46CBE6155C5F159CCE537 /* Toast-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Toast-dummy.m"; sourceTree = ""; }; - 636BD41BB7BF75FCBCF8A9F7E68F278E /* libMOFSPickerManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMOFSPickerManager.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 63F1CE555CBC4D3297D21289F14AF32B /* UIImageView+ZFCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+ZFCache.m"; path = "ZFPlayer/Category/UIImageView+ZFCache.m"; sourceTree = ""; }; - 64C299A38AF8C4DBD1EE52BFA5F4B304 /* libASIHTTPRequest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libASIHTTPRequest.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 64CDF2B74590D417E77483B0557C395D /* M13ProgressHUD.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressHUD.h; path = Classes/HUD/M13ProgressHUD.h; sourceTree = ""; }; - 64FC5A2C4A4E2E66DB59BB5F3AD8E18D /* YYAsyncLayer-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "YYAsyncLayer-prefix.pch"; sourceTree = ""; }; - 657D0BD0E60B2F4401966AF787F89C10 /* HMEmoticonButton.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonButton.m; path = "表情键盘/Emoticon/HMEmoticonButton.m"; sourceTree = ""; }; - 658411AF6A74942DE6218CF6396E69F6 /* TZImagePickerController-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "TZImagePickerController-prefix.pch"; sourceTree = ""; }; - 65C3DE628916339FE09F34E04AC204E8 /* AFURLSessionManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLSessionManager.h; path = AFNetworking/AFURLSessionManager.h; sourceTree = ""; }; - 65E54B7FA06BAF3ED3D17A42A70DBADA /* BMKTileLayerView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKTileLayerView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKTileLayerView.h; sourceTree = ""; }; - 65E63F3FD5902987B7EEBC76F1DDBD74 /* NSObject+YYAddForARC.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSObject+YYAddForARC.m"; path = "YYCategories/Foundation/NSObject+YYAddForARC.m"; sourceTree = ""; }; - 660F7A2D558A86E5552D7FB3399A6562 /* SDCycleScrollView.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SDCycleScrollView.xcconfig; sourceTree = ""; }; - 66DEFBE8BA9DEDB2C1106F5EC6FBE268 /* ZFFileModel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFFileModel.h; path = ZFDownload/ZFFileModel.h; sourceTree = ""; }; - 66FD74BFA11E4E1B53DEE8E451F947FF /* SDWebImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SDWebImage-prefix.pch"; sourceTree = ""; }; - 6702197BCD72026897FEFD1679017795 /* KILabel-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "KILabel-dummy.m"; sourceTree = ""; }; - 673881C48EF78A45CA7A1B0B460C571F /* TZPhotoPreviewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZPhotoPreviewController.h; path = TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.h; sourceTree = ""; }; - 676F5D06F4237F94D9015FB16B0068E2 /* FCUUID.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FCUUID.xcconfig; sourceTree = ""; }; - 6798CFFDA1BA99912BE8F189EA297759 /* YYLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYLabel.m; path = YYText/YYLabel.m; sourceTree = ""; }; - 687719BE12B3EE3050383D964C71E42B /* UMSocialQQHandler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UMSocialQQHandler.h; path = UShareSDK/SocialLibraries/QQ/UMSocialQQHandler.h; sourceTree = ""; }; - 687DB7E1316864FBBC3A5A9E1A5A202D /* MOFSPickerManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MOFSPickerManager.m; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSPickerManager.m; sourceTree = ""; }; - 688F15D55EFC65486396874256C3AF97 /* BMKRadarOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKRadarOption.h; path = BaiduMapKit/BaiduMapAPI_Radar.framework/Headers/BMKRadarOption.h; sourceTree = ""; }; - 68BAFD3D3D229AB2E3C9EF0E5D67346F /* NSObject+MJProperty.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+MJProperty.h"; path = "MJExtension/NSObject+MJProperty.h"; sourceTree = ""; }; - 68D94A49E92917958FF339CC47578244 /* ASICloudFilesContainerRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASICloudFilesContainerRequest.h; path = Classes/CloudFiles/ASICloudFilesContainerRequest.h; sourceTree = ""; }; - 68FCC5C8AC75261E1DEF300A7760FA20 /* YYTextTransaction.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextTransaction.m; path = YYText/Utility/YYTextTransaction.m; sourceTree = ""; }; - 6907255A28D24C41C7A558CF3CE783E8 /* UIApplication+M13ProgressSuite.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIApplication+M13ProgressSuite.h"; path = "Classes/Application/UIApplication+M13ProgressSuite.h"; sourceTree = ""; }; - 69BC0BB38D607E4184FA10ECAD8BB6EA /* YYTextEffectWindow.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextEffectWindow.m; path = YYText/Component/YYTextEffectWindow.m; sourceTree = ""; }; - 6A82DA0B8EFDF97F622E7DD3923C5EE8 /* HMScannerMaskView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMScannerMaskView.m; path = HMQRCodeScanner/QRCode/HMScannerMaskView.m; sourceTree = ""; }; - 6AA561E62E1A699F737E182D351E7C23 /* MJRefreshHeader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshHeader.m; path = MJRefresh/Base/MJRefreshHeader.m; sourceTree = ""; }; - 6AA73B0FB3C97F30C239DC6F744C9DA4 /* NSData+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSData+YYAdd.h"; path = "YYCategories/Foundation/NSData+YYAdd.h"; sourceTree = ""; }; - 6B197B69F3593E41384E017A55F8DDB6 /* YYTextMagnifier.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextMagnifier.m; path = YYText/Component/YYTextMagnifier.m; sourceTree = ""; }; - 6BB1EDC34A33E9EF497D5711CAC9A255 /* UIViewController+CYLTabBarControllerExtention.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+CYLTabBarControllerExtention.m"; path = "CYLTabBarController/UIViewController+CYLTabBarControllerExtention.m"; sourceTree = ""; }; - 6C0B38101048C1750021153D340AFF5B /* HMEmoticonButton.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonButton.h; path = "表情键盘/Emoticon/HMEmoticonButton.h"; sourceTree = ""; }; - 6C244B148DA4A290B37320D5C5CD9AF6 /* TADotView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TADotView.h; path = SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.h; sourceTree = ""; }; - 6C56289FC944AEC08D3D4CD1703136A3 /* Pods-iOSProject.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-iOSProject.release.xcconfig"; sourceTree = ""; }; - 6CA93E524C8D0D37A23828D3D9FD63C5 /* UIView+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+YYAdd.h"; path = "YYCategories/UIKit/UIView+YYAdd.h"; sourceTree = ""; }; - 6DCD9801AE18FF59DAEADA204C6F9476 /* IQPreviousNextView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = IQPreviousNextView.m; path = IQKeyboardManager/IQToolbar/IQPreviousNextView.m; sourceTree = ""; }; - 6E09144C685D9243772BA53F16F82735 /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = WebViewJavascriptBridge_JS.m; path = WebViewJavascriptBridge/WebViewJavascriptBridge_JS.m; sourceTree = ""; }; - 6EB84E4F71F1A20373C5927F16B9C3BD /* UIButton+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+WebCache.m"; path = "SDWebImage/UIButton+WebCache.m"; sourceTree = ""; }; - 6F52E54A1217692C3E1F2C2464AA454A /* IQUIWindow+Hierarchy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "IQUIWindow+Hierarchy.m"; path = "IQKeyboardManager/Categories/IQUIWindow+Hierarchy.m"; sourceTree = ""; }; - 6F66D09EEC30C497C0047C58E232ABCA /* MJRefreshAutoStateFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshAutoStateFooter.m; path = MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.m; sourceTree = ""; }; - 6F91F9216AEC900D928FAC8DF17F6B24 /* YYImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYImage.m; path = YYImage/YYImage.m; sourceTree = ""; }; - 6F9C449539B26FD898DC31C71282BBA4 /* YYTextRunDelegate.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextRunDelegate.m; path = YYText/String/YYTextRunDelegate.m; sourceTree = ""; }; - 6FF0536139D0D2F2B332EBEFEE52B82F /* LxGridViewFlowLayout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LxGridViewFlowLayout.h; path = LxGridView/LxGridViewFlowLayout.h; sourceTree = ""; }; - 7000B1BA4FEC9D83E0E4B25AA5DE978D /* IQUIViewController+Additions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "IQUIViewController+Additions.h"; path = "IQKeyboardManager/Categories/IQUIViewController+Additions.h"; sourceTree = ""; }; - 70947D4FB20E4D893C5DF889839EC551 /* BMKPolylineView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPolylineView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKPolylineView.h; sourceTree = ""; }; - 70DB5BDBFDA994701594468414E70873 /* HMEmoticonPackage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonPackage.h; path = "表情键盘/Emoticon/HMEmoticonPackage.h"; sourceTree = ""; }; - 711A3553D661350700DC15B69CDEF655 /* SDWebImagePrefetcher.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImagePrefetcher.h; path = SDWebImage/SDWebImagePrefetcher.h; sourceTree = ""; }; - 71926658EFC9069B2C26929BE11F90C7 /* NSKeyedUnarchiver+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSKeyedUnarchiver+YYAdd.h"; path = "YYCategories/Foundation/NSKeyedUnarchiver+YYAdd.h"; sourceTree = ""; }; - 719C47543AF80968CE454D97F832A3E2 /* IQTitleBarButtonItem.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQTitleBarButtonItem.h; path = IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.h; sourceTree = ""; }; - 71C293857462202C683B389A55EC1778 /* MJRefresh-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MJRefresh-dummy.m"; sourceTree = ""; }; - 72092789A81DED056915185928C46406 /* UIViewController+ZFPlayerRotation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+ZFPlayerRotation.h"; path = "ZFPlayer/Category/UIViewController+ZFPlayerRotation.h"; sourceTree = ""; }; - 723C8A2359030A14743D8A463F83322D /* SDImageCacheConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageCacheConfig.h; path = SDWebImage/SDImageCacheConfig.h; sourceTree = ""; }; - 723D37C0E0011CC095BE253816725CA6 /* UIViewController+ZJScrollPageController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+ZJScrollPageController.h"; path = "ZJScrollPageView/ZJScrollPageView/UIViewController+ZJScrollPageController.h"; sourceTree = ""; }; - 723F731BCEE8CA3044F702507BD104D7 /* TZPhotoPreviewCell.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZPhotoPreviewCell.h; path = TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.h; sourceTree = ""; }; - 72A1731853B7BE82F471C795E3A33612 /* BMKOpenPanorama.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOpenPanorama.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKOpenPanorama.h; sourceTree = ""; }; - 731152B3CB8EB179FADE8AD61DFE96E7 /* YYImageCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYImageCoder.m; path = YYImage/YYImageCoder.m; sourceTree = ""; }; - 73149727F9CF5BE11CEFB827282F7ACC /* libSDCycleScrollView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDCycleScrollView.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 738FB7783397F62FF295A854ECA84AF6 /* NSNotificationCenter+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSNotificationCenter+YYAdd.h"; path = "YYCategories/Foundation/NSNotificationCenter+YYAdd.h"; sourceTree = ""; }; - 747F9F799F0B700694CD85F5719AD19A /* IQUIView+IQKeyboardToolbar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "IQUIView+IQKeyboardToolbar.h"; path = "IQKeyboardManager/IQToolbar/IQUIView+IQKeyboardToolbar.h"; sourceTree = ""; }; - 74E82C3ACA672B9D99875AED2D00DDE2 /* M13ProgressViewLetterpress.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewLetterpress.m; path = Classes/ProgressViews/M13ProgressViewLetterpress.m; sourceTree = ""; }; - 7515224E8E29ECAE1392EA169B8E760D /* BMKMapVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKMapVersion.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKMapVersion.h; sourceTree = ""; }; - 755191A5599D8DBFEF1BCBB075070BD7 /* UIView+Layout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+Layout.h"; path = "TZImagePickerController/TZImagePickerController/UIView+Layout.h"; sourceTree = ""; }; - 75C43CEC25CB9D70DF963905C8C19C35 /* TZPhotoPreviewCell.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZPhotoPreviewCell.m; path = TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m; sourceTree = ""; }; - 75E12DAFF497E75A9AF20D09111782DA /* MJExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJExtension.h; path = MJExtension/MJExtension.h; sourceTree = ""; }; - 75EA44527183DB95CFA18D4ECA1FFD79 /* UMSocialSDKPromptResources.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = UMSocialSDKPromptResources.bundle; path = UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle; sourceTree = ""; }; - 766A06A961038E6C17D52EB657C8C37E /* YYTextAttribute.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextAttribute.h; path = YYText/String/YYTextAttribute.h; sourceTree = ""; }; - 76AC8F4FC8B79501A3AE8B2AACC88E45 /* NSLayoutConstraint+MASDebugAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSLayoutConstraint+MASDebugAdditions.m"; path = "Masonry/NSLayoutConstraint+MASDebugAdditions.m"; sourceTree = ""; }; - 76EFD40BC2AC71C7B10AB24B6C5E40A7 /* ZFDownload-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ZFDownload-prefix.pch"; sourceTree = ""; }; - 76EFD90C792711CBE554C6F1F02C8768 /* NSString+MJExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSString+MJExtension.h"; path = "MJExtension/NSString+MJExtension.h"; sourceTree = ""; }; - 770317683A6E9F643B4E43752B921DDC /* CYLTabBarController-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "CYLTabBarController-prefix.pch"; sourceTree = ""; }; - 771DEDA94B416D0F47972164D65F23EA /* BMKOverlay.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOverlay.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKOverlay.h; sourceTree = ""; }; - 774BAF6634C4F95BE5FB8BA104E883D6 /* MJExtension-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MJExtension-dummy.m"; sourceTree = ""; }; - 779818BABC265B3F17CC3486E2B09D4F /* NSObject+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+YYAdd.h"; path = "YYCategories/Foundation/NSObject+YYAdd.h"; sourceTree = ""; }; - 77C02733674F84530B1378C076717D9A /* BMKPoiSearchOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPoiSearchOption.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKPoiSearchOption.h; sourceTree = ""; }; - 77E4EDFA4227198F220DEE9FEBAE5ED8 /* MJRefreshAutoGifFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshAutoGifFooter.m; path = MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.m; sourceTree = ""; }; - 7825A59274382A259ADEC182B87C8EDA /* YYTextContainerView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextContainerView.h; path = YYText/Component/YYTextContainerView.h; sourceTree = ""; }; - 7941FAD8F23E54FA41D6378BBB715F5C /* IQTextView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = IQTextView.m; path = IQKeyboardManager/IQTextView/IQTextView.m; sourceTree = ""; }; - 79B786935968F91659410E8D541C2BE6 /* HMEmoticonTextView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonTextView.h; path = "表情键盘/Emoticon/HMEmoticonTextView.h"; sourceTree = ""; }; - 7A03C187AD057B76DAE09889A0B870CB /* MagicWindow.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = MagicWindow.bundle; path = MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle; sourceTree = ""; }; - 7A134922D87F578222A0C47D4FA8A9D8 /* HMEmoticonAttachment.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonAttachment.m; path = "表情键盘/Emoticon/HMEmoticonAttachment.m"; sourceTree = ""; }; - 7A2EAB51A89FD8CCA3B07A7E73F510B6 /* ZJSegmentStyle.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZJSegmentStyle.m; path = ZJScrollPageView/ZJScrollPageView/ZJSegmentStyle.m; sourceTree = ""; }; - 7A3AC7CFD06DFA683EA173BD28BA6C10 /* IQKeyboardManagerConstantsInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQKeyboardManagerConstantsInternal.h; path = IQKeyboardManager/Constants/IQKeyboardManagerConstantsInternal.h; sourceTree = ""; }; - 7A55E93EF311004E23D6189573CA229E /* MASCompositeConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASCompositeConstraint.m; path = Masonry/MASCompositeConstraint.m; sourceTree = ""; }; - 7A5A73F8DA2CBBE37C8F8A1367FC7A25 /* IFlyMSC.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyMSC.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyMSC.h; sourceTree = ""; }; - 7A7E1A5B536768A212AE9A8E28DE448A /* MJPropertyKey.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJPropertyKey.m; path = MJExtension/MJPropertyKey.m; sourceTree = ""; }; - 7B1C63A9A04378F43408869297AC6258 /* IQBarButtonItem.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = IQBarButtonItem.m; path = IQKeyboardManager/IQToolbar/IQBarButtonItem.m; sourceTree = ""; }; - 7B1D2478ABB83ABD0A6ABA98A67EB320 /* AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = AFNetworking/AFNetworking.h; sourceTree = ""; }; - 7BD6F6F61469F8B7406056D5FDC64EFD /* ZFCommonHelper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFCommonHelper.h; path = ZFDownload/ZFCommonHelper.h; sourceTree = ""; }; - 7BD99D6C53EB0267B77830604A533909 /* BMKRouteSearchType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKRouteSearchType.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKRouteSearchType.h; sourceTree = ""; }; - 7C42811AB134EBEB0BB6F333E9C79400 /* HMEmoticon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticon.h; path = "表情键盘/Emoticon/HMEmoticon.h"; sourceTree = ""; }; - 7C470EC78502D024FE56BA3BC0C2795F /* IFlyDebugLog.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyDebugLog.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyDebugLog.h; sourceTree = ""; }; - 7C66868B3BCE18CCA6FBB3488A9C51BD /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIRefreshControl+AFNetworking.h"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.h"; sourceTree = ""; }; - 7CF876D689038F6E9030FEA7AAA45AE3 /* HMScannerViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMScannerViewController.m; path = HMQRCodeScanner/QRCode/HMScannerViewController.m; sourceTree = ""; }; - 7D5F35384A1CABA1784B2B17184D4415 /* libZFPlayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libZFPlayer.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 7D665BA14DC1E5EDE0C741E763664C7F /* ASIS3Request.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIS3Request.h; path = Classes/S3/ASIS3Request.h; sourceTree = ""; }; - 7D6710E98DF308484487D266C607F8F5 /* ASICloudFilesRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASICloudFilesRequest.h; path = Classes/CloudFiles/ASICloudFilesRequest.h; sourceTree = ""; }; - 7D9615C08F01783E110DD1574B0DAAB3 /* TZPhotoPickerController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZPhotoPickerController.m; path = TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m; sourceTree = ""; }; - 7DA931C657D5097DDDAF01A95E73B1CD /* YYTextAttribute.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextAttribute.m; path = YYText/String/YYTextAttribute.m; sourceTree = ""; }; - 7DDE576222B6214DF4C7F57EB7D77DFC /* BMKPinAnnotationView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPinAnnotationView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKPinAnnotationView.h; sourceTree = ""; }; - 7E1BE344E7658E804E2872A8411D5AB6 /* UIView+SDExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+SDExtension.h"; path = "SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.h"; sourceTree = ""; }; - 7E4C3816BDE813991CB777F5C9CA8B4B /* libSocialWeChat.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libSocialWeChat.a; path = UShareSDK/SocialLibraries/WeChat/libSocialWeChat.a; sourceTree = ""; }; - 7E8212299AC119A1D9F1ADD42A30B7FF /* HMEmoticon-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "HMEmoticon-dummy.m"; sourceTree = ""; }; - 7E8932FE2CB1AD5AAF2E285EABBD88DE /* MASCompositeConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASCompositeConstraint.h; path = Masonry/MASCompositeConstraint.h; sourceTree = ""; }; - 7E8CE76232520EC945D8EB7C70E9D7CE /* AFSecurityPolicy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFSecurityPolicy.m; path = AFNetworking/AFSecurityPolicy.m; sourceTree = ""; }; - 7EEC9E77FA3372FE30A20FB6665D5022 /* ASIFormDataRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIFormDataRequest.m; path = Classes/ASIFormDataRequest.m; sourceTree = ""; }; - 7F37E7D3C942466AB58F16EE63D7E28E /* YYSpriteSheetImage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYSpriteSheetImage.h; path = YYImage/YYSpriteSheetImage.h; sourceTree = ""; }; - 7FACD66124DEDA424E36923656366128 /* BaiduMapAPI_Search.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Search.framework; path = BaiduMapKit/BaiduMapAPI_Search.framework; sourceTree = ""; }; - 7FF6503D5CE126099935102283C2FB96 /* HMEmoticon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticon.m; path = "表情键盘/Emoticon/HMEmoticon.m"; sourceTree = ""; }; - 80218C39F0AF089C4A1008AB91F566BF /* View+MASShorthandAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "View+MASShorthandAdditions.h"; path = "Masonry/View+MASShorthandAdditions.h"; sourceTree = ""; }; - 805139F0F604BBFBA1CA5DF8CE9B2877 /* FDFullscreenPopGesture-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FDFullscreenPopGesture-prefix.pch"; sourceTree = ""; }; - 8090E059E89B637FE9CFE0D3FED61C68 /* WebViewJavascriptBridge.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = WebViewJavascriptBridge.xcconfig; sourceTree = ""; }; - 80926BF9B9C958F3938D475452D52AF2 /* NSString+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSString+YYAdd.m"; path = "YYCategories/Foundation/NSString+YYAdd.m"; sourceTree = ""; }; - 809C1C342242FF73A762242FC405EAF5 /* IFlySpeechRecognizerDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechRecognizerDelegate.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechRecognizerDelegate.h; sourceTree = ""; }; - 817542211EA857584373395E6EC78370 /* libHMQRCodeScanner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libHMQRCodeScanner.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 81CD280EF61DE4C207AC96480DA158B3 /* YYAsyncLayer.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = YYAsyncLayer.xcconfig; sourceTree = ""; }; - 81D1FE4DD10E7BC42C567A3CDA273314 /* BMKOverlayGLBasicView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOverlayGLBasicView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKOverlayGLBasicView.h; sourceTree = ""; }; - 8201E076239969D7F31FCB24D2FA6BFC /* UMSocialSDKResources.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = UMSocialSDKResources.bundle; path = UShareSDK/UMSocialUI/UMSocialSDKResources.bundle; sourceTree = ""; }; - 820E857FA0AEA6F2BCBBA1D90FCD0C3B /* ASICloudFilesObjectRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASICloudFilesObjectRequest.h; path = Classes/CloudFiles/ASICloudFilesObjectRequest.h; sourceTree = ""; }; - 822B6730C5495CD6416157D79B01DA61 /* UIFont+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIFont+YYAdd.m"; path = "YYCategories/UIKit/UIFont+YYAdd.m"; sourceTree = ""; }; - 823207BD4B7C3DFDF405A905C6BD13F4 /* UIView+YYText.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+YYText.m"; path = "YYText/Utility/UIView+YYText.m"; sourceTree = ""; }; - 82C1A6930B5503E5FF3B94BA51FD9310 /* SDWebImageCodersManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCodersManager.h; path = SDWebImage/SDWebImageCodersManager.h; sourceTree = ""; }; - 82DCFE6193484D7A630839A4AD3315DE /* UMMobClick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UMMobClick.framework; path = umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework; sourceTree = ""; }; - 82F1D01FB7AFE09B11119768CC2E423F /* BMKHeatMap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKHeatMap.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKHeatMap.h; sourceTree = ""; }; - 82F221262275DA2601458C534C50FAF4 /* UIImage+GIF.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+GIF.m"; path = "SDWebImage/UIImage+GIF.m"; sourceTree = ""; }; - 830512F9C57D252126830818EAD9AD4A /* UIScrollView+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIScrollView+YYAdd.m"; path = "YYCategories/UIKit/UIScrollView+YYAdd.m"; sourceTree = ""; }; - 8329D81ACDFE123ABD8E650CE5D5DA1E /* libSocialQQ.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libSocialQQ.a; path = UShareSDK/SocialLibraries/QQ/libSocialQQ.a; sourceTree = ""; }; - 83366A1B2B7425448492B9BB441A5CA6 /* libAFNetworking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAFNetworking.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 834769C7A5D1752C1177897B62EFC999 /* SDWebImageCoderHelper.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageCoderHelper.m; path = SDWebImage/SDWebImageCoderHelper.m; sourceTree = ""; }; - 8349CE1F55F82141AA7EEBC0926DBD12 /* SDWebImageOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageOperation.h; path = SDWebImage/SDWebImageOperation.h; sourceTree = ""; }; - 8354BEB75032E57CB018D23E5083B079 /* MWApiObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MWApiObject.h; path = MagicWindowSDK/MagicWindowSDK/MWApiObject.h; sourceTree = ""; }; - 835D7DB3E8BEF0E2968FC9808AC5CC92 /* SDWebImageImageIOCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageImageIOCoder.h; path = SDWebImage/SDWebImageImageIOCoder.h; sourceTree = ""; }; - 836836CA6D3F03D96B7730D86E1CB4F7 /* NSBundle+HMEmoticon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSBundle+HMEmoticon.m"; path = "表情键盘/Emoticon/NSBundle+HMEmoticon.m"; sourceTree = ""; }; - 837D41C6AF10832E4F66F70DA1B81590 /* WeiboSDK.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = WeiboSDK.bundle; path = UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle; sourceTree = ""; }; - 838214E5745FE9BEBD09000EA5D65ABD /* UIDevice+FCUUID.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIDevice+FCUUID.h"; path = "FCUUID/UIDevice+FCUUID.h"; sourceTree = ""; }; - 83AE7F0F063A830934040C72387C0A5D /* ASIInputStream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIInputStream.h; path = Classes/ASIInputStream.h; sourceTree = ""; }; - 83C3C3E5DEF8D29C063E1CAE528BCD74 /* FMDatabaseAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDatabaseAdditions.h; path = src/fmdb/FMDatabaseAdditions.h; sourceTree = ""; }; - 83ED8416FEE1D8215CE8CFDDE52FD284 /* NSArray+MASAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSArray+MASAdditions.h"; path = "Masonry/NSArray+MASAdditions.h"; sourceTree = ""; }; - 846AA219C9AD8C3953FCC34976C430FA /* HMScanner.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMScanner.m; path = HMQRCodeScanner/QRCode/HMScanner.m; sourceTree = ""; }; - 847411DE20A5A1C6EC5CA15DFB45E17E /* AddressModel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AddressModel.m; path = MOFSPickerManagerDemo/MOFSPickerManager/AddressModel.m; sourceTree = ""; }; - 84FFE1E3C74972FE2F4EC9C87402600A /* ZFCommonHelper.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZFCommonHelper.m; path = ZFDownload/ZFCommonHelper.m; sourceTree = ""; }; - 857C79F693A88C01F8948523F6E4BA2B /* ASValuePopUpView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASValuePopUpView.h; path = ZFPlayer/ASValuePopUpView.h; sourceTree = ""; }; - 858458E87A836152AFF15601508CB689 /* Reachability.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; - 85EA4ACB7B84D0B5CAECB523A132C6AB /* Photos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Photos.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Photos.framework; sourceTree = DEVELOPER_DIR; }; - 85FAAAED0A44FDAEB27D10106C69A5C4 /* CYLTabBarController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CYLTabBarController.h; path = CYLTabBarController/CYLTabBarController.h; sourceTree = ""; }; - 86070A01EE63C0EE45CB578B885812C8 /* BMKRadarComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKRadarComponent.h; path = BaiduMapKit/BaiduMapAPI_Radar.framework/Headers/BMKRadarComponent.h; sourceTree = ""; }; - 8674EA2A09213456DE2CA226AB6F3157 /* UIImageView+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImageView+WebCache.m"; path = "SDWebImage/UIImageView+WebCache.m"; sourceTree = ""; }; - 8681D87B0661E7C6DA9BB9051203CC7E /* TDTouchID.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TDTouchID.h; path = TDTouchID/TDTouchID/TDTouchID/TDTouchID.h; sourceTree = ""; }; - 86BF5306FAF1B363933A99C3F9A39D92 /* MJRefreshStateHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshStateHeader.h; path = MJRefresh/Custom/Header/MJRefreshStateHeader.h; sourceTree = ""; }; - 8723512E1088A6DED9A3CB75EDEA929A /* BMKFavPoiManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKFavPoiManager.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKFavPoiManager.h; sourceTree = ""; }; - 8739AF26D66A7EFF1080289B8766A59D /* NSAttributedString+YYText.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSAttributedString+YYText.h"; path = "YYText/Utility/NSAttributedString+YYText.h"; sourceTree = ""; }; - 877B94AE7FC09A2BDFF3B8E72D2C307B /* ZFPlayer.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = ZFPlayer.bundle; path = ZFPlayer/ZFPlayer.bundle; sourceTree = ""; }; - 878A686D826B5CD6CE34C33FE3152FA0 /* TZImagePickerController.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = TZImagePickerController.xcconfig; sourceTree = ""; }; - 87A39FCC499DC60F3AD5325D6EE2060F /* ZJScrollPageView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZJScrollPageView.h; path = ZJScrollPageView/ZJScrollPageView/ZJScrollPageView.h; sourceTree = ""; }; - 87B0B3E4DD1456825662552E4ACE5E65 /* MASConstraint+Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MASConstraint+Private.h"; path = "Masonry/MASConstraint+Private.h"; sourceTree = ""; }; - 889A65E897585299D32585E0E294A8C0 /* ASICloudFilesContainerXMLParserDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASICloudFilesContainerXMLParserDelegate.h; path = Classes/CloudFiles/ASICloudFilesContainerXMLParserDelegate.h; sourceTree = ""; }; - 88A59317FE11D5F45DBFE398732786F0 /* UIImage+HMEmoticon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+HMEmoticon.h"; path = "表情键盘/Emoticon/UIImage+HMEmoticon.h"; sourceTree = ""; }; - 88AFC3B399D2A3B89836677BB828D5AB /* YYText.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = YYText.xcconfig; sourceTree = ""; }; - 88C03FA01A4A7580A8E3E8CAA682165F /* YYTextContainerView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextContainerView.m; path = YYText/Component/YYTextContainerView.m; sourceTree = ""; }; - 88D566EA9A2EE097E665ECDAE5112E15 /* LxGridView-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "LxGridView-prefix.pch"; sourceTree = ""; }; - 88E82B140EA99038E1AFB7EC301C91B2 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/ImageIO.framework; sourceTree = DEVELOPER_DIR; }; - 89184E8EFDBF59682964A79C09B74446 /* MOFSPickerManager-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MOFSPickerManager-prefix.pch"; sourceTree = ""; }; - 898FB3B98A4E9F506A5B19DA7EFB124B /* ASICloudFilesRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASICloudFilesRequest.m; path = Classes/CloudFiles/ASICloudFilesRequest.m; sourceTree = ""; }; - 8A4049539B1D6D0012835DFC6E51FF2D /* IQKeyboardReturnKeyHandler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQKeyboardReturnKeyHandler.h; path = IQKeyboardManager/IQKeyboardReturnKeyHandler.h; sourceTree = ""; }; - 8A61B5655C952B41B0F030EBEB156CBA /* HMScanner.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = HMScanner.bundle; path = HMQRCodeScanner/QRCode/HMScanner.bundle; sourceTree = ""; }; - 8B37278A9F6380B135BB4CD0F58CB7A7 /* MJRefreshAutoFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshAutoFooter.m; path = MJRefresh/Base/MJRefreshAutoFooter.m; sourceTree = ""; }; - 8B87D071428437E4E596E097F29DEE8B /* MMMaterialDesignSpinner.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MMMaterialDesignSpinner.h; path = ZFPlayer/MMMaterialDesignSpinner.h; sourceTree = ""; }; - 8B890D9F31833483AF305E64B00E5DCA /* NSNotificationCenter+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSNotificationCenter+YYAdd.m"; path = "YYCategories/Foundation/NSNotificationCenter+YYAdd.m"; sourceTree = ""; }; - 8B907F5092804F49D8050CFB4B78A58A /* DWBubbleMenuButton-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "DWBubbleMenuButton-dummy.m"; sourceTree = ""; }; - 8BC33D8D476858531C320EC5F7A3C2CD /* UMSocialCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UMSocialCore.framework; path = UShareSDK/UMSocialSDK/UMSocialCore.framework; sourceTree = ""; }; - 8BC5EB8981152119B28CA27FB6426252 /* UINavigationController+FDFullscreenPopGesture.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UINavigationController+FDFullscreenPopGesture.m"; path = "FDFullscreenPopGesture/UINavigationController+FDFullscreenPopGesture.m"; sourceTree = ""; }; - 8BFF8B7C2362C818B8DCBDA2E02F87BC /* IQTextView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQTextView.h; path = IQKeyboardManager/IQTextView/IQTextView.h; sourceTree = ""; }; - 8C2CC20F6F9946F41C9A91712B847F6D /* ASIS3BucketObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIS3BucketObject.m; path = Classes/S3/ASIS3BucketObject.m; sourceTree = ""; }; - 8CB97EBFB89EE626A7905D8A427626C6 /* NSNumber+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSNumber+YYAdd.m"; path = "YYCategories/Foundation/NSNumber+YYAdd.m"; sourceTree = ""; }; - 8D3AAE460ECC00ADD498963FDF7650E0 /* NSImage+WebCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSImage+WebCache.m"; path = "SDWebImage/NSImage+WebCache.m"; sourceTree = ""; }; - 8D5A700F0142106AE9EE9119D77E7BEA /* BMKUtilsVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKUtilsVersion.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKUtilsVersion.h; sourceTree = ""; }; - 8DBD0D4771B1AA1DD8D98BD52AEA1143 /* UIGestureRecognizer+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIGestureRecognizer+YYAdd.m"; path = "YYCategories/UIKit/UIGestureRecognizer+YYAdd.m"; sourceTree = ""; }; - 8DE5AE88E195687F83D81C7EC20725A2 /* HMScannerBorder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMScannerBorder.m; path = HMQRCodeScanner/QRCode/HMScannerBorder.m; sourceTree = ""; }; - 8E165A0459022BF0F5C7B2113F461C52 /* SDWebImage-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SDWebImage-dummy.m"; sourceTree = ""; }; - 8E25218D47A79CC35EBF6E2B65534E0D /* MJRefreshNormalHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshNormalHeader.h; path = MJRefresh/Custom/Header/MJRefreshNormalHeader.h; sourceTree = ""; }; - 8E30160F59176A0177C3C8214453F0AE /* ASIWebPageRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIWebPageRequest.h; path = Classes/ASIWebPageRequest/ASIWebPageRequest.h; sourceTree = ""; }; - 8E547ABAE925AA7981D8150F5625FC52 /* YYTextDebugOption.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextDebugOption.m; path = YYText/Component/YYTextDebugOption.m; sourceTree = ""; }; - 8E55B14473EEF98BD17CEA79086C2E50 /* BMKCloudPOIList.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKCloudPOIList.h; path = BaiduMapKit/BaiduMapAPI_Cloud.framework/Headers/BMKCloudPOIList.h; sourceTree = ""; }; - 8EABE59547892AC3F2525B405242B6CA /* CALayer+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CALayer+YYAdd.h"; path = "YYCategories/Quartz/CALayer+YYAdd.h"; sourceTree = ""; }; - 8EE4EC787816F0F55B19334A11B42642 /* ZFPlayerModel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZFPlayerModel.m; path = ZFPlayer/ZFPlayerModel.m; sourceTree = ""; }; - 8F941C586C6F190BA180C2DF570A959A /* MJRefreshBackFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshBackFooter.m; path = MJRefresh/Base/MJRefreshBackFooter.m; sourceTree = ""; }; - 900771E247DD0F0F938E07AB63BBF51C /* UIView+MJExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+MJExtension.h"; path = "MJRefresh/UIView+MJExtension.h"; sourceTree = ""; }; - 904E0A05C386FEC170BA291A01763992 /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WebViewJavascriptBridge_JS.h; path = WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h; sourceTree = ""; }; - 906380BAF545040FF42B138142A30E6F /* WXApi.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WXApi.h; path = OpenSDK1.8.1/WXApi.h; sourceTree = ""; }; - 907367704B3A7979A8B8A96B804E02B3 /* FMDatabaseQueue.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMDatabaseQueue.m; path = src/fmdb/FMDatabaseQueue.m; sourceTree = ""; }; - 90ACC274A4C37EDF36F43FACAF8967AB /* ZFHttpRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZFHttpRequest.m; path = ZFDownload/ZFHttpRequest.m; sourceTree = ""; }; - 90C10DE39B0CED5F660E686C0701D4A2 /* M13ProgressViewImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewImage.m; path = Classes/ProgressViews/M13ProgressViewImage.m; sourceTree = ""; }; - 90D1DF80221CDD48D614884D9374EF3F /* ZJTitleView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZJTitleView.m; path = ZJScrollPageView/ZJScrollPageView/ZJTitleView.m; sourceTree = ""; }; - 90DC9253D37E4E2C185640670407D6B4 /* NSBundle+TZImagePicker.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSBundle+TZImagePicker.m"; path = "TZImagePickerController/TZImagePickerController/NSBundle+TZImagePicker.m"; sourceTree = ""; }; - 90EF5233DEA29F718102E78CCAB6025A /* AFURLSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLSessionManager.m; path = AFNetworking/AFURLSessionManager.m; sourceTree = ""; }; - 91330B5BDFA577EA85E35A83BE861606 /* ZFPlayer.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ZFPlayer.xcconfig; sourceTree = ""; }; - 914F27DD9F4364E6A074E894E6874E8E /* UIScreen+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIScreen+YYAdd.h"; path = "YYCategories/UIKit/UIScreen+YYAdd.h"; sourceTree = ""; }; - 9170E0800F85B07540547A48787B562D /* UIScrollView+MJRefresh.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIScrollView+MJRefresh.h"; path = "MJRefresh/UIScrollView+MJRefresh.h"; sourceTree = ""; }; - 91784E91C2D2E979489C70900DE72B38 /* MOFSAddressPickerView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MOFSAddressPickerView.m; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSAddressPickerView.m; sourceTree = ""; }; - 91BF69C5BBD958E1079A5D580349930D /* UMSocialWechatHandler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UMSocialWechatHandler.h; path = UShareSDK/SocialLibraries/WeChat/UMSocialWechatHandler.h; sourceTree = ""; }; - 9225394628921FCF98D0B2156F0E62E6 /* AddressModel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AddressModel.h; path = MOFSPickerManagerDemo/MOFSPickerManager/AddressModel.h; sourceTree = ""; }; - 926F78A88F80F6A64D53C9CB664DC29F /* NSBundle+TZImagePicker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSBundle+TZImagePicker.h"; path = "TZImagePickerController/TZImagePickerController/NSBundle+TZImagePicker.h"; sourceTree = ""; }; - 927B8BB33759614C9564AC367A832230 /* BMKOfflineMap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOfflineMap.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKOfflineMap.h; sourceTree = ""; }; - 928536D1C6ACBCC3D0DC9C4F222979F1 /* FDFullscreenPopGesture.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FDFullscreenPopGesture.xcconfig; sourceTree = ""; }; - 928E2B8EFD048DDCFDED1C6B326B3610 /* MJRefresh.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefresh.h; path = MJRefresh/MJRefresh.h; sourceTree = ""; }; - 92ADC9AC8D5CFF4ACB60CA854B2D1711 /* IFlySpeechEvent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechEvent.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvent.h; sourceTree = ""; }; - 932D6B99DB0DDE128563B8BFD13618CA /* UIAlertController+ZFPlayerRotation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIAlertController+ZFPlayerRotation.h"; path = "ZFPlayer/Category/UIAlertController+ZFPlayerRotation.h"; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 949A99854C0D6FA613FE574C25956447 /* TZImagePickerController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZImagePickerController.m; path = TZImagePickerController/TZImagePickerController/TZImagePickerController.m; sourceTree = ""; }; - 94AA55B9F427B64DC02E14C27195D5E0 /* KILabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = KILabel.m; path = KILabel/Source/KILabel.m; sourceTree = ""; }; - 95D56AE972CAD5F1447C07D0BBB35C92 /* MOFSPickerManager-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MOFSPickerManager-dummy.m"; sourceTree = ""; }; - 95EEF74C2E88FEFD843FBD70D1C298E2 /* NSData+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSData+YYAdd.m"; path = "YYCategories/Foundation/NSData+YYAdd.m"; sourceTree = ""; }; - 96130353A2F26AC0C4D283B2173901DA /* HMScannerMaskView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMScannerMaskView.h; path = HMQRCodeScanner/QRCode/HMScannerMaskView.h; sourceTree = ""; }; - 96197C2131E4EAE7DD8A46EBFD9F806A /* M13ProgressViewFilteredImage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewFilteredImage.h; path = Classes/ProgressViews/M13ProgressViewFilteredImage.h; sourceTree = ""; }; - 963CAF06FDF246AC115C91C99DD862E8 /* M13ProgressConsole.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressConsole.h; path = Classes/Console/M13ProgressConsole.h; sourceTree = ""; }; - 9666A17BF647274684CBA7A3CD099F1D /* M13ProgressViewRadiative.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewRadiative.m; path = Classes/ProgressViews/M13ProgressViewRadiative.m; sourceTree = ""; }; - 9686DB23109726069F4F55F431BA4C6F /* MBProgressHUD.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MBProgressHUD.xcconfig; sourceTree = ""; }; - 9689B78DD54EF73E7E36F84661B44D99 /* YYTextEffectWindow.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextEffectWindow.h; path = YYText/Component/YYTextEffectWindow.h; sourceTree = ""; }; - 96A2061E7EC002E7ED34D69C34E9840F /* YYTextRubyAnnotation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextRubyAnnotation.m; path = YYText/String/YYTextRubyAnnotation.m; sourceTree = ""; }; - 96DB4CDF47B803249D77E04E9C1168C4 /* ASIInputStream.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIInputStream.m; path = Classes/ASIInputStream.m; sourceTree = ""; }; - 96E2389E2858EFBBBE22A0BE6D0A8E79 /* Masonry.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Masonry.xcconfig; sourceTree = ""; }; - 971DE64AD3DF111442CD2986B27AE91C /* BMKGeometry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKGeometry.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKGeometry.h; sourceTree = ""; }; - 972B7A93BEE915F435C8D41C813E6C8F /* M13ProgressViewMetroDotPolygon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewMetroDotPolygon.m; path = Classes/ProgressViews/M13ProgressViewMetroDotPolygon.m; sourceTree = ""; }; - 978C47FABAE17B50FA1401E468B7FF9D /* BMKArcline.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKArcline.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKArcline.h; sourceTree = ""; }; - 97D526A0F5203B61F13149E89A44323A /* BMKCircleView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKCircleView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKCircleView.h; sourceTree = ""; }; - 980ED939BAB7016DFFC1FE932CA9A81A /* IFlySpeechSynthesizerDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechSynthesizerDelegate.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechSynthesizerDelegate.h; sourceTree = ""; }; - 98BB0134772D94E31AFE00D20A71A2B8 /* NSNumber+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSNumber+YYAdd.h"; path = "YYCategories/Foundation/NSNumber+YYAdd.h"; sourceTree = ""; }; - 9948E074A9AB7B7BAC4F08A2E1A21167 /* NSLayoutConstraint+MASDebugAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSLayoutConstraint+MASDebugAdditions.h"; path = "Masonry/NSLayoutConstraint+MASDebugAdditions.h"; sourceTree = ""; }; - 9981C0BE9286CDAFB514DC9DCEAED7C2 /* BMKFavPoiInfo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKFavPoiInfo.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKFavPoiInfo.h; sourceTree = ""; }; - 99D8328D1CF55D65BBC02C207521F0D7 /* HMScanerCardViewController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMScanerCardViewController.m; path = HMQRCodeScanner/QRCode/HMScanerCardViewController.m; sourceTree = ""; }; - 9A1CA718CE0F5EAA1648BFE8E3188F2B /* TZAssetCell.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZAssetCell.m; path = TZImagePickerController/TZImagePickerController/TZAssetCell.m; sourceTree = ""; }; - 9A50DC3DB07280449145748D5AC12959 /* MJRefreshBackGifFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshBackGifFooter.m; path = MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.m; sourceTree = ""; }; - 9A9FADFA65C3CAF11B0CFE468E9A5D43 /* MJRefreshNormalHeader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshNormalHeader.m; path = MJRefresh/Custom/Header/MJRefreshNormalHeader.m; sourceTree = ""; }; - 9B046A137EBB66062317F71C42E817CD /* IFlySetting.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySetting.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySetting.h; sourceTree = ""; }; - 9B19C255AF9C9F46B6A854B7A95EB0D0 /* MJRefreshGifHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshGifHeader.h; path = MJRefresh/Custom/Header/MJRefreshGifHeader.h; sourceTree = ""; }; - 9B63CA319398D2602FDA50048EA1A84B /* BMKNavigation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKNavigation.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKNavigation.h; sourceTree = ""; }; - 9BCC322F7D6A48B084E48B747DB1F4AC /* NSArray+MASShorthandAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSArray+MASShorthandAdditions.h"; path = "Masonry/NSArray+MASShorthandAdditions.h"; sourceTree = ""; }; - 9C2CF55708FA0B880DE44475E5F883F0 /* TZLocationManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZLocationManager.h; path = TZImagePickerController/TZImagePickerController/TZLocationManager.h; sourceTree = ""; }; - 9C644483AAFFA869AC8985C917A08923 /* NSBundle+MJRefresh.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSBundle+MJRefresh.m"; path = "MJRefresh/NSBundle+MJRefresh.m"; sourceTree = ""; }; - 9C84517C38768FC987E319DA6E7892EE /* BMKOpenPoiOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOpenPoiOption.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKOpenPoiOption.h; sourceTree = ""; }; - 9C97EF58930E6CCC8CAA6D63FED4CD53 /* ASICloudFilesContainerRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASICloudFilesContainerRequest.m; path = Classes/CloudFiles/ASICloudFilesContainerRequest.m; sourceTree = ""; }; - 9C9E75F4EDB25948B73BFC35C3A760EB /* ASValueTrackingSlider.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASValueTrackingSlider.h; path = ZFPlayer/ASValueTrackingSlider.h; sourceTree = ""; }; - 9D1A8EE7F66FAFAE9FC1ABDFCF1155CD /* NSArray+MASAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSArray+MASAdditions.m"; path = "Masonry/NSArray+MASAdditions.m"; sourceTree = ""; }; - 9D8619E43AEC84CFB309710291A655BB /* YYImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "YYImage-prefix.pch"; sourceTree = ""; }; - 9D949E7E1EA68F3B139E44B2DB145146 /* UITableView+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UITableView+YYAdd.h"; path = "YYCategories/UIKit/UITableView+YYAdd.h"; sourceTree = ""; }; - 9DEBCE6460C2A1F5E42D198F8EE2778E /* MASConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASConstraint.m; path = Masonry/MASConstraint.m; sourceTree = ""; }; - 9DF7DE9563474AB0AAE9747A5EA5A189 /* NSParagraphStyle+YYText.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSParagraphStyle+YYText.m"; path = "YYText/Utility/NSParagraphStyle+YYText.m"; sourceTree = ""; }; - 9E22E77F4551FB4B00ED0081853DE7D8 /* M13ProgressViewBorderedBar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewBorderedBar.m; path = Classes/ProgressViews/M13ProgressViewBorderedBar.m; sourceTree = ""; }; - 9E5D2D600ADFB0DF9CBD1A071EA9BB71 /* MOFSPickerView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MOFSPickerView.m; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSPickerView.m; sourceTree = ""; }; - 9E9ACEF5BC58524646C2F80494DA6222 /* MASViewConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASViewConstraint.m; path = Masonry/MASViewConstraint.m; sourceTree = ""; }; - 9EE21F66DA87504043B8A7C86F94E1FC /* UIView+ZJFrame.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+ZJFrame.h"; path = "ZJScrollPageView/ZJScrollPageView/UIView+ZJFrame.h"; sourceTree = ""; }; - 9F60334DC40582E5840C3C33C780C962 /* ASICloudFilesCDNRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASICloudFilesCDNRequest.h; path = Classes/CloudFiles/ASICloudFilesCDNRequest.h; sourceTree = ""; }; - A0173FDF2B0A82B773D97578498421D0 /* BaiduMapAPI_Radar.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Radar.framework; path = BaiduMapKit/BaiduMapAPI_Radar.framework; sourceTree = ""; }; - A01E2C9D4FB430587CF8DB12688FC64B /* MJPropertyType.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJPropertyType.m; path = MJExtension/MJPropertyType.m; sourceTree = ""; }; - A0C50DEE4F91E086B449D8BD39366118 /* FMDatabasePool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDatabasePool.h; path = src/fmdb/FMDatabasePool.h; sourceTree = ""; }; - A0C713E1ED57D3EE1F7DD972FBEAD4C7 /* MJRefresh-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MJRefresh-prefix.pch"; sourceTree = ""; }; - A1241B4C4C1FAB0163D05E3A3BF6B4CF /* NSData+ImageContentType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSData+ImageContentType.h"; path = "SDWebImage/NSData+ImageContentType.h"; sourceTree = ""; }; - A22F604B840D19080E962B03ECAE74C1 /* ZJScrollPageViewDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZJScrollPageViewDelegate.h; path = ZJScrollPageView/ZJScrollPageView/ZJScrollPageViewDelegate.h; sourceTree = ""; }; - A23C76376D57D9E5DFCCB72F3369202F /* UIView+CustomControlView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+CustomControlView.m"; path = "ZFPlayer/Category/UIView+CustomControlView.m"; sourceTree = ""; }; - A351302198A655351E2AE6EE1BBFBE82 /* AFAutoPurgingImageCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFAutoPurgingImageCache.h; path = "UIKit+AFNetworking/AFAutoPurgingImageCache.h"; sourceTree = ""; }; - A37333678AF8E15234FBE3DB155255B3 /* MASConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraint.h; path = Masonry/MASConstraint.h; sourceTree = ""; }; - A3827D91B89DE3921FA773C63BDAAA66 /* libWeiboSDK.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libWeiboSDK.a; path = UShareSDK/SocialLibraries/Sina/SinaSDK/libWeiboSDK.a; sourceTree = ""; }; - A3BE083BB10468DDFE0DCA6CC58C8B73 /* IQBarButtonItem.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQBarButtonItem.h; path = IQKeyboardManager/IQToolbar/IQBarButtonItem.h; sourceTree = ""; }; - A3CAB37C9FD75D2F91CEB00270CF0291 /* MASConstraintMaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraintMaker.h; path = Masonry/MASConstraintMaker.h; sourceTree = ""; }; - A44A24FDB7B8D3FD947BB43FCF4268DC /* BMKGeocodeSearchOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKGeocodeSearchOption.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKGeocodeSearchOption.h; sourceTree = ""; }; - A474F5FC81F488A6BC9A2BCE2F988F48 /* UIScreen+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIScreen+YYAdd.m"; path = "YYCategories/UIKit/UIScreen+YYAdd.m"; sourceTree = ""; }; - A4A448BA3C82A65BDC33D47DE59AC744 /* TADotView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TADotView.m; path = SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.m; sourceTree = ""; }; - A4ADD5E02FF48CB45EF0B551B0744C86 /* YYCGUtilities.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYCGUtilities.h; path = YYCategories/Quartz/YYCGUtilities.h; sourceTree = ""; }; - A4DF0467D37373C07AEDF598CB9FC82F /* TAPageControl.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TAPageControl.h; path = SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.h; sourceTree = ""; }; - A521D5CDE091E2A44A4D7A4CEDC3278E /* libFMDB.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFMDB.a; sourceTree = BUILT_PRODUCTS_DIR; }; - A54E2FE69927E9C4208E88CC7B6F4ACF /* IQUITextFieldView+Additions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "IQUITextFieldView+Additions.h"; path = "IQKeyboardManager/Categories/IQUITextFieldView+Additions.h"; sourceTree = ""; }; - A630A4E6D435AAC37445B39A3C07D22C /* UICKeyChainStore-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UICKeyChainStore-dummy.m"; sourceTree = ""; }; - A70A59D5D83726124E1DF4784BBFB6E0 /* YYAsyncLayer-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "YYAsyncLayer-dummy.m"; sourceTree = ""; }; - A741DF0D26884201FA22CD42DF68C556 /* LxGridView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = LxGridView.m; path = LxGridView/LxGridView.m; sourceTree = ""; }; - A74D8A332B6D556AD143D8B012F60EA0 /* IFlyUserWords.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyUserWords.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyUserWords.h; sourceTree = ""; }; - A777E2AE95FB5E00503CF13FDC64E6AB /* NSString+HMEmoji.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSString+HMEmoji.m"; path = "表情键盘/Emoticon/NSString+HMEmoji.m"; sourceTree = ""; }; - A7A1B5DC3C64D8E14B39057FD2C21C1A /* libGVUserDefaults.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libGVUserDefaults.a; sourceTree = BUILT_PRODUCTS_DIR; }; - A7B82406C4CF2F3E41C951F375FDFC45 /* GDataXMLNode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GDataXMLNode.h; path = MOFSPickerManagerDemo/GDataXMLNode/GDataXMLNode.h; sourceTree = ""; }; - A80EBFE3D040C675CB28E4150713A0A0 /* M13ProgressViewBar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewBar.m; path = Classes/ProgressViews/M13ProgressViewBar.m; sourceTree = ""; }; - A874BA24B6EA2F2A280F183A0F035C88 /* NSObject+MJClass.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSObject+MJClass.m"; path = "MJExtension/NSObject+MJClass.m"; sourceTree = ""; }; - A87D4C6056DD78F0306956089BF40068 /* NSAttributedString+YYText.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSAttributedString+YYText.m"; path = "YYText/Utility/NSAttributedString+YYText.m"; sourceTree = ""; }; - A902DCEC79AEC6280BCDAA3F36453A9A /* TZImageManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZImageManager.h; path = TZImagePickerController/TZImagePickerController/TZImageManager.h; sourceTree = ""; }; - AAD06B183B7E1671DC5A854D8DB47EAF /* YYAnimatedImageView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYAnimatedImageView.h; path = YYImage/YYAnimatedImageView.h; sourceTree = ""; }; - ABAD685D1448375FB1C3692E3DBAA916 /* ZFPlayerModel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFPlayerModel.h; path = ZFPlayer/ZFPlayerModel.h; sourceTree = ""; }; - AC0B9573AF130E0F34E2BEA61B549AF5 /* ASIS3ServiceRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIS3ServiceRequest.m; path = Classes/S3/ASIS3ServiceRequest.m; sourceTree = ""; }; - AC2D7DC2FB4F93FECED44C49520A35C9 /* MOFSPickerView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MOFSPickerView.h; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSPickerView.h; sourceTree = ""; }; - AC4FBD89395F58149669ADB565A66FCD /* YYTextKeyboardManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextKeyboardManager.h; path = YYText/Component/YYTextKeyboardManager.h; sourceTree = ""; }; - AC57916ACB65E363F705C4AD694929C0 /* MASConstraintMaker.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASConstraintMaker.m; path = Masonry/MASConstraintMaker.m; sourceTree = ""; }; - ACD7B2A68D29A52108AA5460A460A3A1 /* WBHttpRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WBHttpRequest.h; path = UShareSDK/SocialLibraries/Sina/SinaSDK/WBHttpRequest.h; sourceTree = ""; }; - AD73CC2EAF5D6A818E00F87EE2142B72 /* BMKSuggestionSearchOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKSuggestionSearchOption.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKSuggestionSearchOption.h; sourceTree = ""; }; - ADA3D41AAE0EDFC89AA891B96C8D43B7 /* NSBundle+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSBundle+YYAdd.h"; path = "YYCategories/Foundation/NSBundle+YYAdd.h"; sourceTree = ""; }; - ADABB01943FB8EB3D02DE02975B3ED57 /* WebViewJavascriptBridge-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WebViewJavascriptBridge-prefix.pch"; sourceTree = ""; }; - ADAD4FA6C139DCC759AE8D845BFA1139 /* YYTextDebugOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextDebugOption.h; path = YYText/Component/YYTextDebugOption.h; sourceTree = ""; }; - AE6177E60B9D4FA2C3C684EEC9E9AA94 /* SDWebImageManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageManager.m; path = SDWebImage/SDWebImageManager.m; sourceTree = ""; }; - AEFD60B9E6C72E511FC2498ACF3DA4C1 /* SDWebImageCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCoder.h; path = SDWebImage/SDWebImageCoder.h; sourceTree = ""; }; - AF0BBABE09F0D1A1B173F1260A6309E0 /* TencentOpenApi_IOS_Bundle.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = TencentOpenApi_IOS_Bundle.bundle; path = UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle; sourceTree = ""; }; - AF56D378632660728F7D734B743243CE /* Pods-iOSProject-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-iOSProject-acknowledgements.markdown"; sourceTree = ""; }; - AF75E7145AE53F1E45F700B894E09793 /* ASIDataDecompressor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIDataDecompressor.h; path = Classes/ASIDataDecompressor.h; sourceTree = ""; }; - AF7F7E239A9FE1CE65DB4E37333C5182 /* ASICloudFilesCDNRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASICloudFilesCDNRequest.m; path = Classes/CloudFiles/ASICloudFilesCDNRequest.m; sourceTree = ""; }; - AF97720774C04744411F9B823011C29C /* Pods-iOSProject-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-iOSProject-acknowledgements.plist"; sourceTree = ""; }; - AFC326400B99DCF165EA8F0C481EE33A /* FMDB-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FMDB-prefix.pch"; sourceTree = ""; }; - B060D0EE1DBCDC43B10B0789807E247F /* UIImage+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+AFNetworking.h"; path = "UIKit+AFNetworking/UIImage+AFNetworking.h"; sourceTree = ""; }; - B07F074D97C92517D644E2C29E02C8C8 /* ZJSegmentStyle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZJSegmentStyle.h; path = ZJScrollPageView/ZJScrollPageView/ZJSegmentStyle.h; sourceTree = ""; }; - B0CACF3D768CDF43C47FC1D51450DF67 /* CYLTabBar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CYLTabBar.h; path = CYLTabBarController/CYLTabBar.h; sourceTree = ""; }; - B1BFACFE06813FC13873055948130CB5 /* AFImageDownloader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFImageDownloader.m; path = "UIKit+AFNetworking/AFImageDownloader.m"; sourceTree = ""; }; - B20F4C8ABED7B78200EE7E28613DC243 /* MASLayoutConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASLayoutConstraint.h; path = Masonry/MASLayoutConstraint.h; sourceTree = ""; }; - B23EA59D178623F454E6FB75DB6866C1 /* NSDate+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSDate+YYAdd.m"; path = "YYCategories/Foundation/NSDate+YYAdd.m"; sourceTree = ""; }; - B4A7E13A3B22034EA5F46F657FFF7421 /* ASIS3ObjectRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIS3ObjectRequest.m; path = Classes/S3/ASIS3ObjectRequest.m; sourceTree = ""; }; - B4B7FB2DEBAE1E8B784B7294DD3180A2 /* ASIDataCompressor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIDataCompressor.h; path = Classes/ASIDataCompressor.h; sourceTree = ""; }; - B4E0EA056E01EDF71080E5F50FB30D7A /* libReachability.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReachability.a; sourceTree = BUILT_PRODUCTS_DIR; }; - B55E4CC5C651EA27F71065F61C61AEF2 /* ASIProgressDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIProgressDelegate.h; path = Classes/ASIProgressDelegate.h; sourceTree = ""; }; - B5894DB14787DBFB05B9551859CBF17E /* FMDatabasePool.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMDatabasePool.m; path = src/fmdb/FMDatabasePool.m; sourceTree = ""; }; - B6814A5F28DC1F14D13602A7CC421EB4 /* ASIS3Bucket.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIS3Bucket.m; path = Classes/S3/ASIS3Bucket.m; sourceTree = ""; }; - B6A54290DB1B3C0A9156C3D75AB7673F /* BMKArclineView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKArclineView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKArclineView.h; sourceTree = ""; }; - B762D82AC8E941BDEA95C952BA99C239 /* BMKRadarVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKRadarVersion.h; path = BaiduMapKit/BaiduMapAPI_Radar.framework/Headers/BMKRadarVersion.h; sourceTree = ""; }; - B7979D2F763F637BF0A8FAE3B93AF8CE /* SDWebImageImageIOCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageImageIOCoder.m; path = SDWebImage/SDWebImageImageIOCoder.m; sourceTree = ""; }; - B7A46EEAF5B07F8DE4BC0A75CA833A0E /* MJRefreshAutoGifFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshAutoGifFooter.h; path = MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h; sourceTree = ""; }; - B7B6F69431CB1AB8590D539666BA1CBF /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkReachabilityManager.h; path = AFNetworking/AFNetworkReachabilityManager.h; sourceTree = ""; }; - B7BB646B178AFDCC018FB11E198DD8A0 /* SDCycleScrollView-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SDCycleScrollView-dummy.m"; sourceTree = ""; }; - B86A01A7E22D5470F30A0115DEA77FB1 /* UIDevice+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIDevice+YYAdd.h"; path = "YYCategories/UIKit/UIDevice+YYAdd.h"; sourceTree = ""; }; - B8ABB86E040E236941AB5A500527F4CC /* ZFPlayerView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZFPlayerView.m; path = ZFPlayer/ZFPlayerView.m; sourceTree = ""; }; - B8B99BCC3C78EC080F1B764A281193D8 /* ASValuePopUpView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASValuePopUpView.m; path = ZFPlayer/ASValuePopUpView.m; sourceTree = ""; }; - B8D0B2BF62814A9210751C2106B13DED /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+ImageEffects.m"; path = "Classes/HUD/UIImage+ImageEffects.m"; sourceTree = ""; }; - B8D16A905F8322D99CB33522D6334B9C /* MJRefreshConst.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshConst.h; path = MJRefresh/MJRefreshConst.h; sourceTree = ""; }; - B8ECEA46932BC6BCA5414238155E1756 /* MOFSToolbar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MOFSToolbar.h; path = MOFSPickerManagerDemo/MOFSPickerManager/MOFSToolbar.h; sourceTree = ""; }; - B9072784B64495ED47AEE9C4095EA4A2 /* ZFPlayer-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ZFPlayer-dummy.m"; sourceTree = ""; }; - B9224432A4FA3345BBA89B785672AA62 /* HMScannerController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMScannerController.h; path = HMQRCodeScanner/QRCode/HMScannerController.h; sourceTree = ""; }; - B962AE77A71731CC4DD3E1922C4472BF /* WKWebViewJavascriptBridge.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WKWebViewJavascriptBridge.h; path = WebViewJavascriptBridge/WKWebViewJavascriptBridge.h; sourceTree = ""; }; - B99EB8A6BFF4D7A22BEE8BB79624ED66 /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+AFNetworking.m"; path = "UIKit+AFNetworking/UIButton+AFNetworking.m"; sourceTree = ""; }; - B9A61749C05FC41C56BCBFCE5B440DAF /* NSThread+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSThread+YYAdd.m"; path = "YYCategories/Foundation/NSThread+YYAdd.m"; sourceTree = ""; }; - B9D2AA27F8CD64D33B07F19CC473C52C /* WKWebViewJavascriptBridge.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = WKWebViewJavascriptBridge.m; path = WebViewJavascriptBridge/WKWebViewJavascriptBridge.m; sourceTree = ""; }; - B9F3BE60A1F49D87A55261B0C9D85B1B /* libMJExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMJExtension.a; sourceTree = BUILT_PRODUCTS_DIR; }; - BA15EA515951F6EE09FFF8A3FB40586F /* province_data.xml */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = province_data.xml; path = MOFSPickerManagerDemo/MOFSPickerManager/province_data.xml; sourceTree = ""; }; - BA33818C92432A78A2B1FCA5D7EA3CFF /* UIBezierPath+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIBezierPath+YYAdd.m"; path = "YYCategories/UIKit/UIBezierPath+YYAdd.m"; sourceTree = ""; }; - BA8D1FFB2198E9D73711DF991A0FA8D7 /* YYTextLine.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextLine.h; path = YYText/Component/YYTextLine.h; sourceTree = ""; }; - BAA7581F8CEE180BEA98039E8FF41CDF /* MJRefreshBackStateFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshBackStateFooter.h; path = MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h; sourceTree = ""; }; - BAB6C2DC371C13844619BA332C5074FE /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/CoreImage.framework; sourceTree = DEVELOPER_DIR; }; - BB20416582DF011644A3E5CC3E1E2BE3 /* ASICloudFilesContainer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASICloudFilesContainer.m; path = Classes/CloudFiles/ASICloudFilesContainer.m; sourceTree = ""; }; - BB42235187E716169F4544EE5BC1F115 /* UShareUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UShareUI.framework; path = UShareSDK/UMSocialUI/UShareUI.framework; sourceTree = ""; }; - BB46940BF9718153BFF8816AF87101A6 /* M13ProgressViewMetro.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewMetro.h; path = Classes/ProgressViews/M13ProgressViewMetro.h; sourceTree = ""; }; - BC2856C8B301AB0A243B66C17A1F356F /* NSObject+MJKeyValue.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSObject+MJKeyValue.m"; path = "MJExtension/NSObject+MJKeyValue.m"; sourceTree = ""; }; - BD7054AC108CD6C419E8B9D98172FB71 /* CALayer+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CALayer+YYAdd.m"; path = "YYCategories/Quartz/CALayer+YYAdd.m"; sourceTree = ""; }; - BDD0F90A15F131F24E8DBAA03085A37A /* LocalAuthentication.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LocalAuthentication.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/LocalAuthentication.framework; sourceTree = DEVELOPER_DIR; }; - BDF9BDBCCC0C59E9BDBB6B738BDB2C7E /* Toast-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Toast-prefix.pch"; sourceTree = ""; }; - BE00E35FFE84A49CB48DBDB2BCA6305F /* MJProperty.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJProperty.m; path = MJExtension/MJProperty.m; sourceTree = ""; }; - BE280BA53112A96F310420776A78E6D7 /* M13ProgressViewPie.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewPie.m; path = Classes/ProgressViews/M13ProgressViewPie.m; sourceTree = ""; }; - BE4A022473B1260E1789AC891C7EEBE9 /* libUICKeyChainStore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUICKeyChainStore.a; sourceTree = BUILT_PRODUCTS_DIR; }; - BE7CC8625902334CF2F1BEA59955B8A5 /* MJRefreshStateHeader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshStateHeader.m; path = MJRefresh/Custom/Header/MJRefreshStateHeader.m; sourceTree = ""; }; - BEA62832F22A2354281D335511F277CA /* UIImage+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+YYAdd.m"; path = "YYCategories/UIKit/UIImage+YYAdd.m"; sourceTree = ""; }; - BECD552238F972255302C0AAC040C8F0 /* Toast.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Toast.xcconfig; sourceTree = ""; }; - BED7B3E38283727B4366B7A0742AF091 /* M13ProgressSuite.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = M13ProgressSuite.xcconfig; sourceTree = ""; }; - BF00D6726BF4FEFEBEABA6ED4735E8FA /* NSObject+YYAddForARC.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+YYAddForARC.h"; path = "YYCategories/Foundation/NSObject+YYAddForARC.h"; sourceTree = ""; }; - BFE9A872F3071983A402730E2C61E481 /* UIGestureRecognizer+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIGestureRecognizer+YYAdd.h"; path = "YYCategories/UIKit/UIGestureRecognizer+YYAdd.h"; sourceTree = ""; }; - C03ADD5D4AA353860861070DA18F2F01 /* BMKLocationVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKLocationVersion.h; path = BaiduMapKit/BaiduMapAPI_Location.framework/Headers/BMKLocationVersion.h; sourceTree = ""; }; - C04096FC91CE40B6991D04A9CFF0A18A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; - C0BB60818347CFE32CEBDB113779A891 /* TZAssetModel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZAssetModel.h; path = TZImagePickerController/TZImagePickerController/TZAssetModel.h; sourceTree = ""; }; - C0D597B98B58A9E6D134DD9C9344D9CD /* IQUIScrollView+Additions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "IQUIScrollView+Additions.m"; path = "IQKeyboardManager/Categories/IQUIScrollView+Additions.m"; sourceTree = ""; }; - C180ED52EE520A2F430DCC25BB5220D2 /* TZVideoPlayerController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZVideoPlayerController.h; path = TZImagePickerController/TZImagePickerController/TZVideoPlayerController.h; sourceTree = ""; }; - C1E420E4EB35D9FEF74950CFDA50DC09 /* UIApplication+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIApplication+YYAdd.m"; path = "YYCategories/UIKit/UIApplication+YYAdd.m"; sourceTree = ""; }; - C1F41036274DCC0D33871FF66C9E065A /* BaiduMapAPI_Location.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Location.framework; path = BaiduMapKit/BaiduMapAPI_Location.framework; sourceTree = ""; }; - C24B4071D2A05BD37B24DEE3676B37F1 /* NSArray+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSArray+YYAdd.m"; path = "YYCategories/Foundation/NSArray+YYAdd.m"; sourceTree = ""; }; - C2889261727391FA0DE3EDD89C1ACDE6 /* ASIHTTPRequest-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ASIHTTPRequest-dummy.m"; sourceTree = ""; }; - C355D3AF680A4A6D242CABF5DE03BFC7 /* ASINetworkQueue.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASINetworkQueue.m; path = Classes/ASINetworkQueue.m; sourceTree = ""; }; - C3E26E8FBE4C20F80143EBF740F0741A /* SDWebImage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SDWebImage.xcconfig; sourceTree = ""; }; - C49B4CD148973E43968F996FABE95189 /* libKILabel.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libKILabel.a; sourceTree = BUILT_PRODUCTS_DIR; }; - C4BFB60F019B70647B4DA0A8511BEDF7 /* YYTextAsyncLayer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextAsyncLayer.m; path = YYText/Utility/YYTextAsyncLayer.m; sourceTree = ""; }; - C5515127AAF151594AEC4AAE86A700A6 /* NSData+ImageContentType.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSData+ImageContentType.m"; path = "SDWebImage/NSData+ImageContentType.m"; sourceTree = ""; }; - C560946B4C93C0C0A8AFB719428F8F7B /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLRequestSerialization.h; path = AFNetworking/AFURLRequestSerialization.h; sourceTree = ""; }; - C56DB930C0F4D0AEC130E4CC2B6CE8E9 /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIKit+AFNetworking.h"; path = "UIKit+AFNetworking/UIKit+AFNetworking.h"; sourceTree = ""; }; - C5946455BCFD49E087A1A6F2C72D9DAB /* ZFDownloadManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZFDownloadManager.m; path = ZFDownload/ZFDownloadManager.m; sourceTree = ""; }; - C5B61B464F7D6D177735DAE0A58DB329 /* MWCampaignConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MWCampaignConfig.h; path = MagicWindowSDK/MagicWindowSDK/MWCampaignConfig.h; sourceTree = ""; }; - C60FB6E10469C0998260150B0CB15066 /* HMEmoticonCell.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonCell.m; path = "表情键盘/Emoticon/HMEmoticonCell.m"; sourceTree = ""; }; - C68109483041F5637F46917C4C46E50E /* UIDevice+FCUUID.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIDevice+FCUUID.m"; path = "FCUUID/UIDevice+FCUUID.m"; sourceTree = ""; }; - C6CFE3543084BBA2BCFFF7B7D4E9D7FB /* UIImage+MultiFormat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+MultiFormat.h"; path = "SDWebImage/UIImage+MultiFormat.h"; sourceTree = ""; }; - C733E41935B85103D48AB3FF8247211F /* MJRefreshAutoStateFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshAutoStateFooter.h; path = MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h; sourceTree = ""; }; - C7C1F1F3C2116488C1773F31B2D890A9 /* UIView+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+YYAdd.m"; path = "YYCategories/UIKit/UIView+YYAdd.m"; sourceTree = ""; }; - C811C9B927DC910A682FECEB2D5C6F04 /* DWBubbleMenuButton-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "DWBubbleMenuButton-prefix.pch"; sourceTree = ""; }; - C837989DC08952A81D04A36D1208F1EC /* IFlyRecognizerViewDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyRecognizerViewDelegate.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyRecognizerViewDelegate.h; sourceTree = ""; }; - C8493B091ABAFAD6044260858CA7AB1C /* HMEmoticonInputView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonInputView.h; path = "表情键盘/Emoticon/HMEmoticonInputView.h"; sourceTree = ""; }; - C88DA684D2E09FF64159D6692174F821 /* BMKOpenPoi.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOpenPoi.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKOpenPoi.h; sourceTree = ""; }; - C8ADDB23425AE8FD0E37C1B707037C79 /* MBProgressHUD.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = ""; }; - C91D64ED65F125A48C77B0341F50B98D /* MJRefreshBackNormalFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshBackNormalFooter.m; path = MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.m; sourceTree = ""; }; - C98AD50296926635DE7E049376578798 /* HMScannerBorder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMScannerBorder.h; path = HMQRCodeScanner/QRCode/HMScannerBorder.h; sourceTree = ""; }; - CA4174F7C9D7FE7F4B092CE3335EAEB1 /* HMEmoticonToolbar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonToolbar.m; path = "表情键盘/Emoticon/HMEmoticonToolbar.m"; sourceTree = ""; }; - CA7FCAEA592B83C9113FEE8D9C06AE41 /* M13ProgressViewSegmentedRing.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewSegmentedRing.m; path = Classes/ProgressViews/M13ProgressViewSegmentedRing.m; sourceTree = ""; }; - CAC3C1C1A60503937CB2890F64848127 /* BMKCloudVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKCloudVersion.h; path = BaiduMapKit/BaiduMapAPI_Cloud.framework/Headers/BMKCloudVersion.h; sourceTree = ""; }; - CB03B824DA08E7E9F8323C9D62CB8818 /* libssl.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libssl.a; path = BaiduMapKit/thirdlibs/libssl.a; sourceTree = ""; }; - CB0592F2A4396E17E230F396DA96FA02 /* MASUtilities.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASUtilities.h; path = Masonry/MASUtilities.h; sourceTree = ""; }; - CB410D61C473507B77A4392A6FF51E16 /* UIView+YYText.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+YYText.h"; path = "YYText/Utility/UIView+YYText.h"; sourceTree = ""; }; - CB681269ADE54CC89D5C2707874D3DC2 /* ZFPlayerControlView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZFPlayerControlView.m; path = ZFPlayer/ZFPlayerControlView.m; sourceTree = ""; }; - CB6CD635AD78C2FED48EE114F69CF115 /* libMBProgressHUD.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMBProgressHUD.a; sourceTree = BUILT_PRODUCTS_DIR; }; - CBC7119C4211A824CD0EA7AF22DD523B /* SDWebImageDownloader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloader.m; path = SDWebImage/SDWebImageDownloader.m; sourceTree = ""; }; - CBDA0013296C31B0F1C6E8502ED40E6D /* WeiboSDK.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WeiboSDK.h; path = UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.h; sourceTree = ""; }; - CC119B460B33AB158CFD3D80EE6A03B3 /* GVUserDefaults.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GVUserDefaults.xcconfig; sourceTree = ""; }; - CC91B725E543C8039090BA3B74FF1B46 /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIProgressView+AFNetworking.m"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.m"; sourceTree = ""; }; - CC9B12DF3458832BF9970F1288E40011 /* TZLocationManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZLocationManager.m; path = TZImagePickerController/TZImagePickerController/TZLocationManager.m; sourceTree = ""; }; - CCE7399A1C49191DF63CB6C0199DA0DB /* IFlySpeechUnderstander.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechUnderstander.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechUnderstander.h; sourceTree = ""; }; - CD498DA948CE3B9E3856C76E268A95F8 /* UIView+ZJFrame.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+ZJFrame.m"; path = "ZJScrollPageView/ZJScrollPageView/UIView+ZJFrame.m"; sourceTree = ""; }; - CD817388507D7FDB70C67912A8670D2C /* BMKPoiSearchType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPoiSearchType.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKPoiSearchType.h; sourceTree = ""; }; - CDBCC678B5B737B51FD30AA756EBAA22 /* IQKeyboardManager.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = IQKeyboardManager.xcconfig; sourceTree = ""; }; - CE21E6472F04525948979D760BEC45BA /* BMKSuggestionSearch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKSuggestionSearch.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKSuggestionSearch.h; sourceTree = ""; }; - CE27BB59D2FA55EE3A130CD504CEE35B /* WBHttpRequest+WeiboToken.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "WBHttpRequest+WeiboToken.h"; path = "UShareSDK/SocialLibraries/Sina/SinaSDK/WBHttpRequest+WeiboToken.h"; sourceTree = ""; }; - CE46F8430E8598867104B25A08F09079 /* TZPhotoPickerController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZPhotoPickerController.h; path = TZImagePickerController/TZImagePickerController/TZPhotoPickerController.h; sourceTree = ""; }; - CED4E3E291179745022F34F7B60F876F /* YYImage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = YYImage.xcconfig; sourceTree = ""; }; - CF0CD53305BC85F133C04AB2A3050A7E /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+AFNetworking.h"; path = "UIKit+AFNetworking/UIButton+AFNetworking.h"; sourceTree = ""; }; - CF35FB7BD6628404DBF50B2530023030 /* YYTextArchiver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextArchiver.h; path = YYText/String/YYTextArchiver.h; sourceTree = ""; }; - CF47B11BB289765E7CEBAAC8E8D273D0 /* UIColor+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIColor+YYAdd.h"; path = "YYCategories/UIKit/UIColor+YYAdd.h"; sourceTree = ""; }; - CF518E2361B4275CB590E7ED8B3F81A2 /* UIScrollView+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIScrollView+YYAdd.h"; path = "YYCategories/UIKit/UIScrollView+YYAdd.h"; sourceTree = ""; }; - CFBC0FC0798BB96D4D4E80C65F13C360 /* IQUIScrollView+Additions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "IQUIScrollView+Additions.h"; path = "IQKeyboardManager/Categories/IQUIScrollView+Additions.h"; sourceTree = ""; }; - D027DBECC2B7E30C2D968BA0C26CFF9A /* MJRefreshBackFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshBackFooter.h; path = MJRefresh/Base/MJRefreshBackFooter.h; sourceTree = ""; }; - D0C94FA31711E5F02E058194BC4FB781 /* LxGridView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LxGridView.h; path = LxGridView/LxGridView.h; sourceTree = ""; }; - D0E100F6C54E64F9BC93EC27C4FDE928 /* NSDate+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSDate+YYAdd.h"; path = "YYCategories/Foundation/NSDate+YYAdd.h"; sourceTree = ""; }; - D17BE6DA6066916F77227E105ADB1FDA /* MJFoundation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJFoundation.m; path = MJExtension/MJFoundation.m; sourceTree = ""; }; - D1FB390F5EAB8D94A04917576BA09D88 /* libWeChatSDK.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libWeChatSDK.a; path = OpenSDK1.8.1/libWeChatSDK.a; sourceTree = ""; }; - D2275338BA59EB642B6C797797DC81D2 /* BMKOpenRoute.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOpenRoute.h; path = BaiduMapKit/BaiduMapAPI_Utils.framework/Headers/BMKOpenRoute.h; sourceTree = ""; }; - D247A195202A5C77AC8B0F92A540ED47 /* UIViewController+ZFPlayerRotation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+ZFPlayerRotation.m"; path = "ZFPlayer/Category/UIViewController+ZFPlayerRotation.m"; sourceTree = ""; }; - D27F2CC14C10465F885D8EA9802E83B5 /* IFlySpeechEvaluatorDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlySpeechEvaluatorDelegate.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvaluatorDelegate.h; sourceTree = ""; }; - D2D5024C9096AB99551D3ADA6F1EC9A2 /* UIView+Toast.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+Toast.h"; path = "Toast/UIView+Toast.h"; sourceTree = ""; }; - D2FFA8CD812797A9DC97473B60433930 /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLResponseSerialization.m; path = AFNetworking/AFURLResponseSerialization.m; sourceTree = ""; }; - D38B38B363B400D2A2DB2586A5B80986 /* YYTextWeakProxy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextWeakProxy.h; path = YYText/Utility/YYTextWeakProxy.h; sourceTree = ""; }; - D41D1D8DE274C2E5BC0EC3A325CD2EA7 /* YYTextInput.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextInput.m; path = YYText/Component/YYTextInput.m; sourceTree = ""; }; - D4E7D7F36CE6034AF50178B59FF1016A /* BMKCloudSearch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKCloudSearch.h; path = BaiduMapKit/BaiduMapAPI_Cloud.framework/Headers/BMKCloudSearch.h; sourceTree = ""; }; - D5DCE39B3EE32DB29F81A3A8F0739156 /* BMKAnnotationView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKAnnotationView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKAnnotationView.h; sourceTree = ""; }; - D5FC73682194D54EF2437A7C07B9295F /* FMResultSet.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMResultSet.h; path = src/fmdb/FMResultSet.h; sourceTree = ""; }; - D61810C22B9B58AC3B5C76FD43643FF6 /* IFlyRecognizerView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IFlyRecognizerView.h; path = RX3_iflyMSC/iflyMSC.framework/Headers/IFlyRecognizerView.h; sourceTree = ""; }; - D62AA5D5E65FF686EE078856B4DA19EB /* UITabBarItem+CYLTabBarControllerExtention.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UITabBarItem+CYLTabBarControllerExtention.h"; path = "CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.h"; sourceTree = ""; }; - D6CABFE8A0532E0815E9719529A59933 /* MMMaterialDesignSpinner.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MMMaterialDesignSpinner.m; path = ZFPlayer/MMMaterialDesignSpinner.m; sourceTree = ""; }; - D753604D87F7781A6B9B89DC579984BF /* YYCategories.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYCategories.h; path = YYCategories/YYCategories.h; sourceTree = ""; }; - D75EB3ADB8BFF8779BC1C9CDD3F32B32 /* YYSentinel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYSentinel.h; path = YYAsyncLayer/YYSentinel.h; sourceTree = ""; }; - D845C9D31C13C1EC374B7B3744F75F8B /* MJRefreshComponent.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshComponent.m; path = MJRefresh/Base/MJRefreshComponent.m; sourceTree = ""; }; - D8841C9B97FA08E9F9DCE1D7AA2D0C69 /* YYTextKeyboardManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextKeyboardManager.m; path = YYText/Component/YYTextKeyboardManager.m; sourceTree = ""; }; - D91930F62D6B374E87FF3CC43A5CF96B /* ASIS3BucketRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIS3BucketRequest.h; path = Classes/S3/ASIS3BucketRequest.h; sourceTree = ""; }; - D97210D3B27649D2764515FA73A81B78 /* UICKeyChainStore.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = UICKeyChainStore.xcconfig; sourceTree = ""; }; - D9A19C6D1C2C1D33214AA19144F0ACF7 /* ASValueTrackingSlider.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASValueTrackingSlider.m; path = ZFPlayer/ASValueTrackingSlider.m; sourceTree = ""; }; - D9BDC5C8A446EADAEDA5463EBB93D6BF /* FCUUID.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FCUUID.m; path = FCUUID/FCUUID.m; sourceTree = ""; }; - D9ED212E30859F02BA751F281B64200F /* YYTextUtilities.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextUtilities.m; path = YYText/Utility/YYTextUtilities.m; sourceTree = ""; }; - DA6845120F2D053B76D55EB874BEFDE8 /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "ViewController+MASAdditions.m"; path = "Masonry/ViewController+MASAdditions.m"; sourceTree = ""; }; - DAC2536F46DCEABBA8916C12059449F6 /* YYImageCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYImageCoder.h; path = YYImage/YYImageCoder.h; sourceTree = ""; }; - DB48503A298BAC12499F5310ABCAD9D4 /* IQUIViewController+Additions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "IQUIViewController+Additions.m"; path = "IQKeyboardManager/Categories/IQUIViewController+Additions.m"; sourceTree = ""; }; - DB6E28C03530C7D88F16ECB119D799A6 /* HMEmoticonAttachment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonAttachment.h; path = "表情键盘/Emoticon/HMEmoticonAttachment.h"; sourceTree = ""; }; - DB8D0BF01287F2DF52ABB6E1615CEDEF /* UIFont+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIFont+YYAdd.h"; path = "YYCategories/UIKit/UIFont+YYAdd.h"; sourceTree = ""; }; - DBA1620313C404180273D68AF852D276 /* ASIHTTPRequestDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIHTTPRequestDelegate.h; path = Classes/ASIHTTPRequestDelegate.h; sourceTree = ""; }; - DBD6B801CDE33FFA8475FDDFEDCD9F32 /* ZFPlayer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFPlayer.h; path = ZFPlayer/ZFPlayer.h; sourceTree = ""; }; - DC44859CBA28F8EA574DB5CE062C685F /* M13ProgressView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressView.h; path = Classes/ProgressViews/M13ProgressView.h; sourceTree = ""; }; - DC9D8982F97FE5F9A6042FC2B6C9100A /* libZJScrollPageView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libZJScrollPageView.a; sourceTree = BUILT_PRODUCTS_DIR; }; - DCE7E808EF0C8820E9A3408AB0953738 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/CoreText.framework; sourceTree = DEVELOPER_DIR; }; - DD3D65892EB04B2A3DF6669C296945A9 /* UIView+CYLTabBarControllerExtention.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+CYLTabBarControllerExtention.m"; path = "CYLTabBarController/UIView+CYLTabBarControllerExtention.m"; sourceTree = ""; }; - DD5B045EF5611D9E253BFA51D3648D1A /* TZImageCropManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TZImageCropManager.m; path = TZImagePickerController/TZImagePickerController/TZImageCropManager.m; sourceTree = ""; }; - DDADBA7FED7FBCF110FBB90862F5BA94 /* CYLTabBarController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = CYLTabBarController.m; path = CYLTabBarController/CYLTabBarController.m; sourceTree = ""; }; - DE3409D14D7C231F37989DE430640304 /* YYImage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYImage.h; path = YYImage/YYImage.h; sourceTree = ""; }; - DE62A0661EA434BA8836B2148A6BA4BF /* FMDatabase.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMDatabase.m; path = src/fmdb/FMDatabase.m; sourceTree = ""; }; - DED459F9AB6C939FD4CDE6B906807379 /* NSString+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSString+YYAdd.h"; path = "YYCategories/Foundation/NSString+YYAdd.h"; sourceTree = ""; }; - DF09C24F9D1BDF5A214EFD8EB1F3CAA9 /* IQKeyboardReturnKeyHandler.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = IQKeyboardReturnKeyHandler.m; path = IQKeyboardManager/IQKeyboardReturnKeyHandler.m; sourceTree = ""; }; - DF2C714C40FD7B32455999DB84EC2A0B /* MJRefreshAutoNormalFooter.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MJRefreshAutoNormalFooter.m; path = MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.m; sourceTree = ""; }; - DF7859AD9FCF8D5D9A3C2A3202B969B4 /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkReachabilityManager.m; path = AFNetworking/AFNetworkReachabilityManager.m; sourceTree = ""; }; - DF7E15545CF4DCD9E601402845800E9E /* ASIDataCompressor.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIDataCompressor.m; path = Classes/ASIDataCompressor.m; sourceTree = ""; }; - DFA98F9E55C032369DC4ABE593A762CB /* ASIAuthenticationDialog.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASIAuthenticationDialog.m; path = Classes/ASIAuthenticationDialog.m; sourceTree = ""; }; - DFCF134F6C3ED793B0111249F8AF2DB3 /* IQTitleBarButtonItem.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = IQTitleBarButtonItem.m; path = IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.m; sourceTree = ""; }; - E0174ED2E174086D42F530876E0E9FEA /* BMKOfflineMapType.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKOfflineMapType.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKOfflineMapType.h; sourceTree = ""; }; - E01B2B13841239604210F7F14F96771F /* UIViewController+ZJScrollPageController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+ZJScrollPageController.m"; path = "ZJScrollPageView/ZJScrollPageView/UIViewController+ZJScrollPageController.m"; sourceTree = ""; }; - E04361DD95A2E79F600320FA1F8F170B /* M13ProgressViewBar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewBar.h; path = Classes/ProgressViews/M13ProgressViewBar.h; sourceTree = ""; }; - E0774C96DF193FDD29D3A2E0AFAB9BE9 /* IQToolbar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = IQToolbar.m; path = IQKeyboardManager/IQToolbar/IQToolbar.m; sourceTree = ""; }; - E078B3B2BC6653367343D5C40F4B8185 /* TAAbstractDotView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TAAbstractDotView.m; path = SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.m; sourceTree = ""; }; - E082A8E295AB6093829176DDC77D1996 /* IQUITextFieldView+Additions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "IQUITextFieldView+Additions.m"; path = "IQKeyboardManager/Categories/IQUITextFieldView+Additions.m"; sourceTree = ""; }; - E0C1BBF34352112BEE7697CA2E2D450E /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WebViewJavascriptBridge.h; path = WebViewJavascriptBridge/WebViewJavascriptBridge.h; sourceTree = ""; }; - E0C5555C49754B9AA5CF88F233BD3E00 /* NSObject+MJClass.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSObject+MJClass.h"; path = "MJExtension/NSObject+MJClass.h"; sourceTree = ""; }; - E1AD8649AE776041AC6080AC3A78C9A0 /* ASINSXMLParserCompat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASINSXMLParserCompat.h; path = Classes/S3/ASINSXMLParserCompat.h; sourceTree = ""; }; - E1D840749E3227A5B7F9602B936BD634 /* WebViewJavascriptBridge-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "WebViewJavascriptBridge-dummy.m"; sourceTree = ""; }; - E2366AE40114E5F92A6EFABE706E86CC /* M13ProgressViewStripedBar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewStripedBar.m; path = Classes/ProgressViews/M13ProgressViewStripedBar.m; sourceTree = ""; }; - E24FBC0B316FBF1EEC175AD3C425DFDA /* M13ProgressViewSegmentedBar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewSegmentedBar.m; path = Classes/ProgressViews/M13ProgressViewSegmentedBar.m; sourceTree = ""; }; - E2951AC3C7F36A27CD10DC136186F761 /* UICKeyChainStore.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = UICKeyChainStore.h; path = Lib/UICKeyChainStore/UICKeyChainStore.h; sourceTree = ""; }; - E2AB052EB8FE7BF466E75F13C92D021E /* MJRefreshComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshComponent.h; path = MJRefresh/Base/MJRefreshComponent.h; sourceTree = ""; }; - E2C05F18C0A82CFACE63D733D13171AE /* AppDelegate.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = TDTouchID/TDTouchID/AppDelegate.m; sourceTree = ""; }; - E3D07FA37E68C7FBC5D4AE3CF05ECF2F /* NSArray+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSArray+YYAdd.h"; path = "YYCategories/Foundation/NSArray+YYAdd.h"; sourceTree = ""; }; - E4230BD2D890B5A02D7C2B474B002084 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; }; - E45A74DA50A44C43E78D3A6714BA44D9 /* AppDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = TDTouchID/TDTouchID/AppDelegate.h; sourceTree = ""; }; - E4622B57B2DD2FFA8648088913059F1C /* View+MASAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "View+MASAdditions.m"; path = "Masonry/View+MASAdditions.m"; sourceTree = ""; }; - E4847F643EF5321DA6B8472EDEABD54A /* Toast.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Toast.h; path = "Toast-Framework/Toast.h"; sourceTree = ""; }; - E4961060D13AC76CFF611DC5AA3FEB9D /* ZFDownloadDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFDownloadDelegate.h; path = ZFDownload/ZFDownloadDelegate.h; sourceTree = ""; }; - E49865B0E17A3021437F96B154D96D7B /* M13ProgressView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressView.m; path = Classes/ProgressViews/M13ProgressView.m; sourceTree = ""; }; - E4AAF325EF42567853AB95AB6B4783F2 /* libMagicWindowSDK.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libMagicWindowSDK.a; path = MagicWindowSDK/MagicWindowSDK/libMagicWindowSDK.a; sourceTree = ""; }; - E4ABF11ED3AF7DE8100A6DD26AE00226 /* M13ProgressHUD.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressHUD.m; path = Classes/HUD/M13ProgressHUD.m; sourceTree = ""; }; - E50D52985D25AC6E32F36B75F726F4D0 /* BMKRadarResult.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKRadarResult.h; path = BaiduMapKit/BaiduMapAPI_Radar.framework/Headers/BMKRadarResult.h; sourceTree = ""; }; - E50FEE149C07C320B43A9DE892D8A0CF /* MJRefreshAutoNormalFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshAutoNormalFooter.h; path = MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h; sourceTree = ""; }; - E598105AA2E0055D66981E4607DE8573 /* BMKBusLineSearch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKBusLineSearch.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKBusLineSearch.h; sourceTree = ""; }; - E5DDF5437AF1228F6E7364B135CDF4A7 /* IQPreviousNextView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQPreviousNextView.h; path = IQKeyboardManager/IQToolbar/IQPreviousNextView.h; sourceTree = ""; }; - E5DF33518F3C1D5FB8684D9D36790FBF /* UIBezierPath+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIBezierPath+YYAdd.h"; path = "YYCategories/UIKit/UIBezierPath+YYAdd.h"; sourceTree = ""; }; - E62D6DA770E3C8DF3B9F2CC678B53305 /* YYSentinel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYSentinel.m; path = YYAsyncLayer/YYSentinel.m; sourceTree = ""; }; - E63BB8B8D760F528A339C365EC818878 /* BMKRadarManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKRadarManager.h; path = BaiduMapKit/BaiduMapAPI_Radar.framework/Headers/BMKRadarManager.h; sourceTree = ""; }; - E63CD75603E23077B63CE98668916A48 /* GVUserDefaults.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GVUserDefaults.h; path = GVUserDefaults/GVUserDefaults.h; sourceTree = ""; }; - E652EB54294622C8973F3FB6C4903993 /* Masonry-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Masonry-dummy.m"; sourceTree = ""; }; - E6A49E4FA47367B244B954AFBDB47FEC /* MJRefreshBackNormalFooter.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshBackNormalFooter.h; path = MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h; sourceTree = ""; }; - E6D81E4F4E43362819414515C641CDAE /* NSTimer+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSTimer+YYAdd.m"; path = "YYCategories/Foundation/NSTimer+YYAdd.m"; sourceTree = ""; }; - E769B7FEE89B9ADC7679ACEA06E9ECF8 /* IQKeyboardManager-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "IQKeyboardManager-prefix.pch"; sourceTree = ""; }; - E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - E790A5DCC08463F86F12E23CA4289C30 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/WebKit.framework; sourceTree = DEVELOPER_DIR; }; - E7D3E8B5C2A2C9AA699AF6CED10C489B /* HMQRCodeScanner-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "HMQRCodeScanner-dummy.m"; sourceTree = ""; }; - E85284A511AB575C25B582AF8ADF8DE3 /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFNetworkActivityIndicatorManager.h; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h"; sourceTree = ""; }; - E8A27F9B1580F6F7102D9AC20780D119 /* TAPageControl.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TAPageControl.m; path = SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.m; sourceTree = ""; }; - E8F5D10CD82376756DF85D2C8F0A486E /* YYTextParser.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextParser.m; path = YYText/String/YYTextParser.m; sourceTree = ""; }; - E9483A8947C9F5324EBCEAB2DDE8EAB3 /* UITabBarItem+CYLTabBarControllerExtention.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UITabBarItem+CYLTabBarControllerExtention.m"; path = "CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.m"; sourceTree = ""; }; - E955452C1A55EA0F76892868F7F731AD /* FMDatabaseAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMDatabaseAdditions.m; path = src/fmdb/FMDatabaseAdditions.m; sourceTree = ""; }; - E9947B34ED2E82EA97602CC7AC545A77 /* libSDWebImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDWebImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; - E9C80FFBB79B3AF9974EECC83EA74CD0 /* libMasonry.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMasonry.a; sourceTree = BUILT_PRODUCTS_DIR; }; - E9DCCABDB3C3D7BF839D285C77348268 /* UICKeyChainStore.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = UICKeyChainStore.m; path = Lib/UICKeyChainStore/UICKeyChainStore.m; sourceTree = ""; }; - EA23106A230033A453CCFABE8E2F3EAE /* BMKPoiSearch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPoiSearch.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKPoiSearch.h; sourceTree = ""; }; - EA5EC071A7ED9F51B4A40F99E9541AA1 /* Reachability.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Reachability.xcconfig; sourceTree = ""; }; - EA75EC8B3CF1812B48530A5210B8FEDF /* MJExtension.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MJExtension.xcconfig; sourceTree = ""; }; - EA7C55578789C3FABB216A82744CA3DD /* HMScannerController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMScannerController.m; path = HMQRCodeScanner/QRCode/HMScannerController.m; sourceTree = ""; }; - EB2318788E9F0009F5773E71FB439E18 /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkActivityIndicatorManager.m; path = "UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m"; sourceTree = ""; }; - EBE6E45C88F154504A9B57EE06FD6C07 /* YYFrameImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYFrameImage.m; path = YYImage/YYFrameImage.m; sourceTree = ""; }; - EC31AC91F513FAE2B6676DBB3C98CF29 /* BMKAnnotation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKAnnotation.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKAnnotation.h; sourceTree = ""; }; - EC4FB9391CAAE7625A4776A0947225B1 /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIActivityIndicatorView+AFNetworking.m"; path = "UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m"; sourceTree = ""; }; - EC55195132A8AD00DB092FC5167432CC /* UIView+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCache.h"; path = "SDWebImage/UIView+WebCache.h"; sourceTree = ""; }; - EC79C86ADF44C0B7FE0ED4F9C866F996 /* BaiduMapAPI_Base.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Base.framework; path = BaiduMapKit/BaiduMapAPI_Base.framework; sourceTree = ""; }; - ECAC23D1B877D674E089FC42BCF4DE67 /* libYYAsyncLayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libYYAsyncLayer.a; sourceTree = BUILT_PRODUCTS_DIR; }; - ECB8EDD88E810B84D2CC507AA30E9251 /* WXApiObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = WXApiObject.h; path = OpenSDK1.8.1/WXApiObject.h; sourceTree = ""; }; - ECD59E946768500B6621358FABA1678C /* BMKGroundOverlayView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKGroundOverlayView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKGroundOverlayView.h; sourceTree = ""; }; - ED1AA238B33BED792F6B66C19D9C995F /* ASICloudFilesObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASICloudFilesObject.h; path = Classes/CloudFiles/ASICloudFilesObject.h; sourceTree = ""; }; - EE23BC0C16AE7D0E6D2C4CDCE5BA4E4B /* KILabel-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "KILabel-prefix.pch"; sourceTree = ""; }; - EE2BD7300079355731FF4FC5BF955307 /* UIApplication+YYAdd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIApplication+YYAdd.h"; path = "YYCategories/UIKit/UIApplication+YYAdd.h"; sourceTree = ""; }; - EE485D95A6DCE075F9E9120F30E34C71 /* TZGifPhotoPreviewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TZGifPhotoPreviewController.h; path = TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.h; sourceTree = ""; }; - EE6D761F944A7BF7D4EBF59961AAEFE6 /* ZFPlayerControlView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFPlayerControlView.h; path = ZFPlayer/ZFPlayerControlView.h; sourceTree = ""; }; - EEF23E5C6AC348346DA8285056798688 /* libSocialSina.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libSocialSina.a; path = UShareSDK/SocialLibraries/Sina/libSocialSina.a; sourceTree = ""; }; - EEFA43DED626C5EC3F2EEAA32463176E /* CYLTabBarController.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = CYLTabBarController.xcconfig; sourceTree = ""; }; - EF2A544450A7CC299D69FA18E6BECD28 /* SDCycleScrollView-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SDCycleScrollView-prefix.pch"; sourceTree = ""; }; - EF4F622A8C7ED8ECCD87E7844763B35D /* YYTextView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextView.h; path = YYText/YYTextView.h; sourceTree = ""; }; - EF6DBAEB7CEF3E6BBA0ADAC20DCDD1F8 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Accelerate.framework; sourceTree = DEVELOPER_DIR; }; - EF7A825BE2B277747B7ABEAF66F22851 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImageView+AFNetworking.h"; path = "UIKit+AFNetworking/UIImageView+AFNetworking.h"; sourceTree = ""; }; - F013A62FBCDA60BA85A0E76F8601EC62 /* HMEmoticonTipView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = HMEmoticonTipView.h; path = "表情键盘/Emoticon/HMEmoticonTipView.h"; sourceTree = ""; }; - F01F59E9E9E5D8EABD190F4954B8E8ED /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/AssetsLibrary.framework; sourceTree = DEVELOPER_DIR; }; - F08C73BF7EB81552B0585C17FE1276CD /* Reachability-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Reachability-prefix.pch"; sourceTree = ""; }; - F0D7DB8A3612D19E63E4B44BFE126C57 /* GVUserDefaults-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GVUserDefaults-dummy.m"; sourceTree = ""; }; - F0DD9E857638216395D0352D4053B688 /* libToast.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libToast.a; sourceTree = BUILT_PRODUCTS_DIR; }; - F0DF052F1732FACBB5EE96DC8B776F22 /* UINavigationController+ZFPlayerRotation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UINavigationController+ZFPlayerRotation.h"; path = "ZFPlayer/Category/UINavigationController+ZFPlayerRotation.h"; sourceTree = ""; }; - F0F2271E95625E09CAF2C433E53FEB94 /* libHMEmoticon.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libHMEmoticon.a; sourceTree = BUILT_PRODUCTS_DIR; }; - F1099ACE2D34FFD8D5E628315D88AFF8 /* UIImage+GIF.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+GIF.h"; path = "SDWebImage/UIImage+GIF.h"; sourceTree = ""; }; - F2556069BFEC1720BA72A3E878732253 /* UIControl+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIControl+YYAdd.m"; path = "YYCategories/UIKit/UIControl+YYAdd.m"; sourceTree = ""; }; - F2566BA4ED67A4DFC4907B906E163E6D /* BMKTypes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKTypes.h; path = BaiduMapKit/BaiduMapAPI_Base.framework/Headers/BMKTypes.h; sourceTree = ""; }; - F282A59BC15D626666FF5E19AF348181 /* NSDictionary+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+YYAdd.m"; path = "YYCategories/Foundation/NSDictionary+YYAdd.m"; sourceTree = ""; }; - F2A5308FFAD6259437B3456B446167ED /* YYTextRubyAnnotation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextRubyAnnotation.h; path = YYText/String/YYTextRubyAnnotation.h; sourceTree = ""; }; - F2BE00B4BBBCF3F78526A4EA7A421121 /* SDImageCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageCache.h; path = SDWebImage/SDImageCache.h; sourceTree = ""; }; - F2C783FDF782B9B9634F9421728D508D /* NSObject+MJCoding.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSObject+MJCoding.m"; path = "MJExtension/NSObject+MJCoding.m"; sourceTree = ""; }; - F2EF5A9B328255D68D8749D1DC424833 /* MBProgressHUD.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = ""; }; - F319BB5CAD5F18506E1C0D395104372A /* HMEmoticonInputView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = HMEmoticonInputView.m; path = "表情键盘/Emoticon/HMEmoticonInputView.m"; sourceTree = ""; }; - F342C67D8302079E15C156D5D674D324 /* ZJScrollSegmentView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZJScrollSegmentView.h; path = ZJScrollPageView/ZJScrollPageView/ZJScrollSegmentView.h; sourceTree = ""; }; - F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; - F3CEABA08CDCFD39F7C438F7A0AB9740 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; }; - F4511F1AA3D059CCDAD3569FDF4CFEE1 /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIProgressView+AFNetworking.h"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.h"; sourceTree = ""; }; - F4A0611096A004BB4310549F32789EFA /* BMKMapStatus.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKMapStatus.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKMapStatus.h; sourceTree = ""; }; - F4A2592D9454BC58A3D22CE3F2D6DEA7 /* BMKPointAnnotation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPointAnnotation.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKPointAnnotation.h; sourceTree = ""; }; - F4A758CBD50F53938C1EA8864CF9732B /* M13ProgressViewMetro.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewMetro.m; path = Classes/ProgressViews/M13ProgressViewMetro.m; sourceTree = ""; }; - F4BBA883C0223B21603B3B652705A8B2 /* IQKeyboardManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQKeyboardManager.h; path = IQKeyboardManager/IQKeyboardManager.h; sourceTree = ""; }; - F5050007CB960717E6E796A3269181C8 /* CYLPlusButton.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = CYLPlusButton.m; path = CYLTabBarController/CYLPlusButton.m; sourceTree = ""; }; - F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; - F598F0E5AD7DC1A50E0F7C8F49F12515 /* HMEmoticon-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "HMEmoticon-prefix.pch"; sourceTree = ""; }; - F5EDA3929262A3F8D0DB902CA6B94295 /* AFImageDownloader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFImageDownloader.h; path = "UIKit+AFNetworking/AFImageDownloader.h"; sourceTree = ""; }; - F6285D643ED016FAB0C92D119FE01FBC /* IQUIView+Hierarchy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "IQUIView+Hierarchy.m"; path = "IQKeyboardManager/Categories/IQUIView+Hierarchy.m"; sourceTree = ""; }; - F629125664F1602B7ACCBDD69B1C2589 /* BMKPolygonView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKPolygonView.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKPolygonView.h; sourceTree = ""; }; - F65C11AC0721B2A15DCF4A359A7D0D2D /* ASIHTTPRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIHTTPRequest.h; path = Classes/ASIHTTPRequest.h; sourceTree = ""; }; - F68F70DE81F8F93798E273460EEDE0F0 /* UIControl+CYLTabBarControllerExtention.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIControl+CYLTabBarControllerExtention.m"; path = "CYLTabBarController/UIControl+CYLTabBarControllerExtention.m"; sourceTree = ""; }; - F6CD4886EAA634DAF6C5448D3B51970C /* BMKBaseIndoorMapInfo.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKBaseIndoorMapInfo.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKBaseIndoorMapInfo.h; sourceTree = ""; }; - F7166F8E6DD66D9E46AE595884AE4247 /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIWebView+AFNetworking.m"; path = "UIKit+AFNetworking/UIWebView+AFNetworking.m"; sourceTree = ""; }; - F7A92E7DD6A360DB4542FDF826D1EF40 /* M13ProgressViewSegmentedRing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewSegmentedRing.h; path = Classes/ProgressViews/M13ProgressViewSegmentedRing.h; sourceTree = ""; }; - F7B3D47B9DD8B31FABB807DE5A1A57C6 /* ASIS3BucketObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ASIS3BucketObject.h; path = Classes/S3/ASIS3BucketObject.h; sourceTree = ""; }; - F83FAD6D30C8F16490E2368B4F9F03E5 /* AFSecurityPolicy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFSecurityPolicy.h; path = AFNetworking/AFSecurityPolicy.h; sourceTree = ""; }; - F874FD77E56BD26B4C5C7758A1F357C7 /* TZImagePickerController.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; name = TZImagePickerController.bundle; path = TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle; sourceTree = ""; }; - F87EE37990BF8B482F5953FAF5411A7E /* ZJScrollSegmentView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZJScrollSegmentView.m; path = ZJScrollPageView/ZJScrollPageView/ZJScrollSegmentView.m; sourceTree = ""; }; - F8A55E0CEAD8B5103CBB65E63409C887 /* BMKSearchVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKSearchVersion.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKSearchVersion.h; sourceTree = ""; }; - F8B5A5B9684B799689D004846052D51C /* AFNetworking-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "AFNetworking-dummy.m"; sourceTree = ""; }; - F9504BBCB2850E1AD0A299210BC6DF49 /* UITabBarController+ZFPlayerRotation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UITabBarController+ZFPlayerRotation.h"; path = "ZFPlayer/Category/UITabBarController+ZFPlayerRotation.h"; sourceTree = ""; }; - F9BA36B729727D0B4BA20B59C7D01A83 /* ASICloudFilesObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ASICloudFilesObject.m; path = Classes/CloudFiles/ASICloudFilesObject.m; sourceTree = ""; }; - F9BCC6348FCACABABE79321B10BE5ED9 /* UINavigationController+FDFullscreenPopGesture.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UINavigationController+FDFullscreenPopGesture.h"; path = "FDFullscreenPopGesture/UINavigationController+FDFullscreenPopGesture.h"; sourceTree = ""; }; - F9CFD260C7BA10536E86EB26625D8B62 /* NSBundle+YYAdd.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSBundle+YYAdd.m"; path = "YYCategories/Foundation/NSBundle+YYAdd.m"; sourceTree = ""; }; - F9D63FFBE0B03CDFD38D9A538C64D17A /* YYTextArchiver.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTextArchiver.m; path = YYText/String/YYTextArchiver.m; sourceTree = ""; }; - F9EE0AE2B7D6BEAB9162FA8FCB522B63 /* ZFBrightnessView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZFBrightnessView.h; path = ZFPlayer/ZFBrightnessView.h; sourceTree = ""; }; - F9FE321FB2D4CF72518A9CD79F503637 /* FMResultSet.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMResultSet.m; path = src/fmdb/FMResultSet.m; sourceTree = ""; }; - FA00755278ADADB7B59F491B43714090 /* CYLTabBar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = CYLTabBar.m; path = CYLTabBarController/CYLTabBar.m; sourceTree = ""; }; - FAD58B841004CBA55CC3F9C0C52DCB07 /* KILabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = KILabel.h; path = KILabel/Source/KILabel.h; sourceTree = ""; }; - FB18F429F2175A81FB358B7C3AAA3F16 /* BMKCircle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKCircle.h; path = BaiduMapKit/BaiduMapAPI_Map.framework/Headers/BMKCircle.h; sourceTree = ""; }; - FB27FD60C7AC57A17AB2E8EAEC956D48 /* UIPasteboard+YYText.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIPasteboard+YYText.m"; path = "YYText/Utility/UIPasteboard+YYText.m"; sourceTree = ""; }; - FB426B4B7E37EF030D11702F62CE2029 /* YYTransaction.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = YYTransaction.m; path = YYAsyncLayer/YYTransaction.m; sourceTree = ""; }; - FB6E31D2C7D4B867E7CCF5397927352B /* YYFrameImage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYFrameImage.h; path = YYImage/YYFrameImage.h; sourceTree = ""; }; - FC10A478D3C23161950BC7BED2403715 /* SDWebImageCoderHelper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCoderHelper.h; path = SDWebImage/SDWebImageCoderHelper.h; sourceTree = ""; }; - FC8D5450C7A3E49B3DCE5805044BC56F /* main.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = main.m; path = TDTouchID/TDTouchID/main.m; sourceTree = ""; }; - FC92409872C374DFC270DF1E67EC5CFC /* MJProperty.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJProperty.h; path = MJExtension/MJProperty.h; sourceTree = ""; }; - FCE7DCF929068DDA22856C03E2B13337 /* LxGridViewCell.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LxGridViewCell.h; path = LxGridView/LxGridViewCell.h; sourceTree = ""; }; - FD21193449D14257E5635AF480CD9CB1 /* YYTextSelectionView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextSelectionView.h; path = YYText/Component/YYTextSelectionView.h; sourceTree = ""; }; - FD38D97321405B64F47430E1380AD1F7 /* MJRefreshHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MJRefreshHeader.h; path = MJRefresh/Base/MJRefreshHeader.h; sourceTree = ""; }; - FDA08F10F27A1DDE4DB27F6392DC500E /* SDWebImageManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageManager.h; path = SDWebImage/SDWebImageManager.h; sourceTree = ""; }; - FE390C2639DA306FA2613036D88EEB0C /* IQKeyboardManagerConstants.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = IQKeyboardManagerConstants.h; path = IQKeyboardManager/Constants/IQKeyboardManagerConstants.h; sourceTree = ""; }; - FECD1385947157F0113B98994A52CEFA /* libFCUUID.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFCUUID.a; sourceTree = BUILT_PRODUCTS_DIR; }; - FEF0BA67A24609FD158EC0AC71318AB9 /* UIView+CustomControlView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+CustomControlView.h"; path = "ZFPlayer/Category/UIView+CustomControlView.h"; sourceTree = ""; }; - FEFF2E3597811870854E0079D617BD20 /* BMKSearchComponent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BMKSearchComponent.h; path = BaiduMapKit/BaiduMapAPI_Search.framework/Headers/BMKSearchComponent.h; sourceTree = ""; }; - FF4EE9D7B19F6CD2C0EFEA24502D31B6 /* YYTextInput.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = YYTextInput.h; path = YYText/Component/YYTextInput.h; sourceTree = ""; }; - FF646CF3EF8EF32A3B4A758C694C8F5D /* M13ProgressViewPie.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewPie.h; path = Classes/ProgressViews/M13ProgressViewPie.h; sourceTree = ""; }; - FF7F1C10A7E7EE3B2022487B7830384D /* UIImage+MultiFormat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIImage+MultiFormat.m"; path = "SDWebImage/UIImage+MultiFormat.m"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 020C057685C0595261B66343DB01E359 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D8CE388A3265267C496FD023AAADF03 /* AssetsLibrary.framework in Frameworks */, - A30D7F59C5641AEE0DF21658B69DD93A /* Foundation.framework in Frameworks */, - 4CB328620EFF45F27A462D71AE22E644 /* Photos.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 025694188CB9A7D96CC58750018B4FFC /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3FECFDE87253334FA356C4898AA1478D /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 026D5C5C76439F83BEF1B3B1ADB191E5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 182B0B2D096D15F9A991DBF6B3CE8BE8 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 08BE874A82C94F12BEAAF4E24BBAD110 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D5C23F13FBA569DC28A6B1E37EC17D42 /* AVFoundation.framework in Frameworks */, - 87B2AD4F978086A0CA90D0AA41D60B5F /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 0C7E176709FF10E17328ACB8AFE69014 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 70B86197660896AA837D8E46367F084A /* Foundation.framework in Frameworks */, - 6E5227ED07F8DE88B48D2F00AE7F741D /* QuartzCore.framework in Frameworks */, - 0AA98DE9CDD7B040834F813A5D1E89EF /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2A0F08D7678206505DAD63BD722A643E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 55EBDF14C787E8AD7FE4153669116877 /* Foundation.framework in Frameworks */, - 89A6C934FB5DF36501311C8B90A46774 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2F53E11B780BCFB348E6374C74EA86B2 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A594DB973B9405359A05F06CF9830A70 /* CFNetwork.framework in Frameworks */, - B35857B270D29EB11EB875ED9D3433EB /* CoreGraphics.framework in Frameworks */, - 3C7EF1D2AEC29B9D59500FF99805A65A /* Foundation.framework in Frameworks */, - 026C9CD242D3321B12D50F933B708688 /* MobileCoreServices.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 31023900B5572A6758634CFEC4360EF1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7C4D0D41E17C1D4909EA5FB89878BE40 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3CC67E767A0BDC077552344530C2E810 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 86F5C64D3B4D664DF346FE2409EEBDB7 /* Accelerate.framework in Frameworks */, - DFF1E9D33A211AEEF751BB78D2B25752 /* CoreGraphics.framework in Frameworks */, - 795A820E28A4C608DE5CB582177FE5E7 /* CoreImage.framework in Frameworks */, - FF248EDD135FE1AE3F990E3AE2C2E6A2 /* Foundation.framework in Frameworks */, - FE17F6EC1578F24F70B5D47B8E472310 /* QuartzCore.framework in Frameworks */, - 6DA8E496DAC1A2A68756F02AFFC91857 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 588865044F7CAA5963FF67F83E12FB16 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E8DABF3880447F9FDB251EA82F819B68 /* Foundation.framework in Frameworks */, - 7626699B2AC44EBA7F2A73772EEE798E /* ImageIO.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 5A3883154EE20A6C0C832DF202024333 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 25F8785E8720975E1BC807D5CBAE1711 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 5E0BF02B022752CE24FAA0CAF404FB9D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8B68E5A9391FF383C11A9686959F9451 /* Accelerate.framework in Frameworks */, - 3DC28D7C95618F5FA2A516A8BA11C6D1 /* CoreFoundation.framework in Frameworks */, - 122FB01A3242CACC75C211532547EBEA /* CoreText.framework in Frameworks */, - 19F42D3113709CD44DA3923884774BB8 /* Foundation.framework in Frameworks */, - 8AC903B7FD452FB7B1B727B75113F962 /* MobileCoreServices.framework in Frameworks */, - 2ED7C634876890E81867A3A62E01B2F0 /* QuartzCore.framework in Frameworks */, - 4F1A9770FFF940421A3A8AC2BE64A564 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 5EE46175C854FEDD9C7D7BD336469B9D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E5DA015D1355883836E22B2D529BC275 /* Accelerate.framework in Frameworks */, - 895E2B6C974E15A648B972C525FCE35F /* AssetsLibrary.framework in Frameworks */, - 6AED92638A9897C3045ACB5F44773522 /* CoreFoundation.framework in Frameworks */, - C4A4C6FD9A1B3A5C995E07E4405659C7 /* Foundation.framework in Frameworks */, - EF489065C359317B134DE8220154ED4B /* ImageIO.framework in Frameworks */, - BC899C44B9E724C9629DC655BCB8837C /* MobileCoreServices.framework in Frameworks */, - D24C9EC5E5C43E20A04A994AEB7E4F6F /* QuartzCore.framework in Frameworks */, - DC1ADB355BC44128B31442ACA38EA99F /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 64786C9E4ED20F0FD5D947A7C759FE3B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7BBAE335CA7667E51CFA81BF17DD861C /* CoreGraphics.framework in Frameworks */, - 3D51A7D14E04DEA3F615267326D9DF39 /* Foundation.framework in Frameworks */, - B3A6235D661F70BB8D33265485FD1EA9 /* QuartzCore.framework in Frameworks */, - 149E5412AC3CAF625BE3BDDD01FAAA4E /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6797EE802466FB38B4E3401FAE2E5B6A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - EC42104464D7D3394F5843296D83A221 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 69DF017CCB3AF38467F09AEE4EF57354 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4861750CF29F04F5CEE6016947C24A49 /* Foundation.framework in Frameworks */, - 1E1B34EBFE53DAE6B7D58FA84E33172B /* MediaPlayer.framework in Frameworks */, - 7F2616C57B31757B86A8A30B1D272BFE /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6E54AE8468E565E966E1CF8B5582638C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 862C0F5FA8CC683F098A233AF04D7FE1 /* Foundation.framework in Frameworks */, - B87E1D604585E129671829D094F83179 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6FD8312A1AEB348F49A81C438DB25115 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F0B56A7D38A399A2F67F9920C9526A66 /* Foundation.framework in Frameworks */, - 6209E20926D79222E59F58B962BFAA1E /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 785B9F26C4F380B2D40F99738AB65AB7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 478820AC4F097839804FEE3F4C3EE38C /* Foundation.framework in Frameworks */, - 92CCB2F2DE3CE64DACBF4C2722E7B292 /* UIKit.framework in Frameworks */, - E1186EA8C23C77CDF32DFCE7B4C2A744 /* WebKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7B26109EBAAEEF711430A5725B7BBD52 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B80FB47C1659331E00A154568E2ABFE1 /* Foundation.framework in Frameworks */, - 5B01221C692F708A8120F4F3B99A626D /* LocalAuthentication.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7EC16DA88EC957C6C5852917E403CDE7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 91F08BF429646D7F4A1009F3596045BE /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A6A43C84AE422587C780462ED3F1FE59 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D72EB9B09E1BE79110C342F74A20BFE6 /* Foundation.framework in Frameworks */, - A76C713C86A5CCDAC314506474DD8F70 /* SystemConfiguration.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A7DAC0D935C218C8922C4376A0C60E8C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - FD973B06C50DE5A6865550E319E7113B /* Accelerate.framework in Frameworks */, - D69C5D75C9FB4D120704102AEB479B88 /* CoreFoundation.framework in Frameworks */, - 76009037D1CBA7CD48F91A635A22E94E /* CoreGraphics.framework in Frameworks */, - 18003F425F34BC62C8906C8B52156ECD /* CoreImage.framework in Frameworks */, - 523D07593B355E66C882FE7B6CA6B214 /* CoreText.framework in Frameworks */, - 9C4724E70EF8C0685E84BE95817F0BF0 /* Foundation.framework in Frameworks */, - 3521D1A2D58CF061E3EE1DD41B9450C7 /* ImageIO.framework in Frameworks */, - F32335F0241E5B31F687B6D7E7772179 /* QuartzCore.framework in Frameworks */, - B113E6A7E0CDE87500BAB176E2F87145 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AF3387F0D14D899AE7942AE67F266DD7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D783F8BB2FFBB2F142FA2034CDB9A335 /* CoreGraphics.framework in Frameworks */, - 3A00D3DC2BE5370FB717E57DCDAF80E2 /* Foundation.framework in Frameworks */, - 20D60D89A4C3BC199835F099ED7EECB2 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B57134F14D0B782971053CD2EB92CC0C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 52E28A0A333684B80D6CD7FFD42865E2 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B6FB090EFCCE9245B0F784159C89BDB5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BCBFE2E406D1916EC0DF8C5DD6C66F1 /* Foundation.framework in Frameworks */, - 899739FB840197BE6A7083510FA8BBA6 /* QuartzCore.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C18929AFC5A0277C896CBBBBF89154A8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 0D5D421EC36C0CE69E9554EBA2395E7C /* Foundation.framework in Frameworks */, - 3BD0A703D4A22A494572399EC411B647 /* Security.framework in Frameworks */, - 62F3B911FC0EF1913F1F702349AFB429 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D8686559EDC73C3296BEAC60DDBA4797 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8AEBE0E0C80A9F06E712642CEDFF690E /* Foundation.framework in Frameworks */, - E7598111BA326DBE0DFACA74193FA154 /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DB226AECEC053458FE2449D96CE2F7ED /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 035A654BF7AA40B3F24E21C081EEEC07 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E0E612D52E04F721E04A92C8605A3864 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5D61851F78D0D2578EDB311F6518D1CB /* Foundation.framework in Frameworks */, - FB3B1C394E03597F615EDAE8731669E6 /* Security.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E1FFA9BD201F7FCE2311B14D2E5AA8C0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F71530448B7A282746853F4718DCA267 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E206E1BC3D328D29ADDF81FC717125FB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 18C8E34C86A7647F7E7949E3293E5E08 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E587BD80F986EDFC117AEFA8B72A36B2 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 36DF9FAD178F987F4EBE91DCEDF8542E /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F3284DBE3CA8932733932AD2A48445B2 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - CBCCEAD402645565401CA93924736979 /* CoreGraphics.framework in Frameworks */, - 0214246CCB1FF7182F7222B9CCDF8FCB /* Foundation.framework in Frameworks */, - F8DCA6C3C05A59B2C95A1B5F1CBD8C99 /* MobileCoreServices.framework in Frameworks */, - DE825B8F32AB823F4BE5492CAC6FCB4B /* Security.framework in Frameworks */, - 903158692A045396106CA22C0DD13BA6 /* SystemConfiguration.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F9AC974E3329F79899A7B3BE290FC894 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1C76817FA5353D989D7BC33E8C5997B5 /* CoreGraphics.framework in Frameworks */, - 93F12B05D8333C37D9CBEA3D1782CC04 /* Foundation.framework in Frameworks */, - 7291E906AE8A3C1F92183154FE65DCDD /* QuartzCore.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0066443AD6BA86F3429C18E390BEFBE8 /* Support Files */ = { - isa = PBXGroup; - children = ( - 5F6E42404EFF164F4A413DF0F93E167A /* DWBubbleMenuButton.xcconfig */, - 8B907F5092804F49D8050CFB4B78A58A /* DWBubbleMenuButton-dummy.m */, - C811C9B927DC910A682FECEB2D5C6F04 /* DWBubbleMenuButton-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/DWBubbleMenuButton"; - sourceTree = ""; - }; - 05AB60D8040F3960066C5B216EB1DAD7 /* Sina */ = { - isa = PBXGroup; - children = ( - ACD7B2A68D29A52108AA5460A460A3A1 /* WBHttpRequest.h */, - CE27BB59D2FA55EE3A130CD504CEE35B /* WBHttpRequest+WeiboToken.h */, - CBDA0013296C31B0F1C6E8502ED40E6D /* WeiboSDK.h */, - 57B5CEC38C62D24CC2032DAACAFB7570 /* WeiboSDK+Statistics.h */, - D252B0AD6A9071CB35CDA77AF552999B /* Frameworks */, - 949252F0EBDFC611A7A21512B71395AC /* Resources */, - ); - name = Sina; - sourceTree = ""; - }; - 083FEF0687A4E23AD8F917968B812312 /* QQ */ = { - isa = PBXGroup; - children = ( - 416D882138BC03BF7C8F0BB9CE84AA9F /* Frameworks */, - D3819C99B66D8A24F6EFE7D42E243879 /* Resources */, - ); - name = QQ; - sourceTree = ""; - }; - 0970BED7D442D201CD9C39BF9263FC66 /* Resources */ = { - isa = PBXGroup; - children = ( - 8201E076239969D7F31FCB24D2FA6BFC /* UMSocialSDKResources.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - 0E5B01C0310BD007F6F67F1FF047D5EF /* Support Files */ = { - isa = PBXGroup; - children = ( - 56572A7E4016ED7DB3B439EA592E9985 /* FMDB.xcconfig */, - 500964AC4B9B451E5C54E710E893D861 /* FMDB-dummy.m */, - AFC326400B99DCF165EA8F0C481EE33A /* FMDB-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/FMDB"; - sourceTree = ""; - }; - 0E73834927B5E33B533FC918FFAE8C2E /* ASIWebPageRequest */ = { - isa = PBXGroup; - children = ( - 8E30160F59176A0177C3C8214453F0AE /* ASIWebPageRequest.h */, - 32D6680EAAD2588E3EEDDD917F8648E7 /* ASIWebPageRequest.m */, - ); - name = ASIWebPageRequest; - sourceTree = ""; - }; - 0FC7F41A02E3BD9E934D4FA69774FCAD /* MJExtension */ = { - isa = PBXGroup; - children = ( - 75E12DAFF497E75A9AF20D09111782DA /* MJExtension.h */, - 43D4D3B47684C382DBFD03600D725126 /* MJExtensionConst.h */, - 316B30550D18BE25FB597B989E062461 /* MJExtensionConst.m */, - 2A21105BF4BE00AFC745EDD4031455A0 /* MJFoundation.h */, - D17BE6DA6066916F77227E105ADB1FDA /* MJFoundation.m */, - FC92409872C374DFC270DF1E67EC5CFC /* MJProperty.h */, - BE00E35FFE84A49CB48DBDB2BCA6305F /* MJProperty.m */, - 2AD8EB34771A3B03AF7E57CB95DC0D27 /* MJPropertyKey.h */, - 7A7E1A5B536768A212AE9A8E28DE448A /* MJPropertyKey.m */, - 2C0CE5B41DE6A3427FBDCE786A38AC56 /* MJPropertyType.h */, - A01E2C9D4FB430587CF8DB12688FC64B /* MJPropertyType.m */, - E0C5555C49754B9AA5CF88F233BD3E00 /* NSObject+MJClass.h */, - A874BA24B6EA2F2A280F183A0F035C88 /* NSObject+MJClass.m */, - 62CE364E24912DA736C087CD437E89F1 /* NSObject+MJCoding.h */, - F2C783FDF782B9B9634F9421728D508D /* NSObject+MJCoding.m */, - 11B1A3C787AA83676DAA6C04BB7B5C10 /* NSObject+MJKeyValue.h */, - BC2856C8B301AB0A243B66C17A1F356F /* NSObject+MJKeyValue.m */, - 68BAFD3D3D229AB2E3C9EF0E5D67346F /* NSObject+MJProperty.h */, - 39261A9C29C19403297C88DA37C2FB4C /* NSObject+MJProperty.m */, - 76EFD90C792711CBE554C6F1F02C8768 /* NSString+MJExtension.h */, - 0A919DC45F39DB0AD5E7478F11AE3BBA /* NSString+MJExtension.m */, - EF121C764A47BDEE56BC624B885D1361 /* Support Files */, - ); - path = MJExtension; - sourceTree = ""; - }; - 1240AFC0E97AFA91FB8CE14FA1F3F3B8 /* Support Files */ = { - isa = PBXGroup; - children = ( - CC119B460B33AB158CFD3D80EE6A03B3 /* GVUserDefaults.xcconfig */, - F0D7DB8A3612D19E63E4B44BFE126C57 /* GVUserDefaults-dummy.m */, - 07B790856B0E0DD1D7DAA065D8EB1AEF /* GVUserDefaults-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/GVUserDefaults"; - sourceTree = ""; - }; - 1478F4839775D43939E760A35AB7AC78 /* Support Files */ = { - isa = PBXGroup; - children = ( - CDBCC678B5B737B51FD30AA756EBAA22 /* IQKeyboardManager.xcconfig */, - 3EB2CA434E1A9885D2D950B7DD58FCFD /* IQKeyboardManager-dummy.m */, - E769B7FEE89B9ADC7679ACEA06E9ECF8 /* IQKeyboardManager-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/IQKeyboardManager"; - sourceTree = ""; - }; - 15E9AA2904D274227FC1BC48446ABE45 /* Support Files */ = { - isa = PBXGroup; - children = ( - 2EE6D33DB39283F1D12803691C1A9690 /* HMQRCodeScanner.xcconfig */, - E7D3E8B5C2A2C9AA699AF6CED10C489B /* HMQRCodeScanner-dummy.m */, - 55A8F2683775E9096AFDE9E4F45BE1B6 /* HMQRCodeScanner-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/HMQRCodeScanner"; - sourceTree = ""; - }; - 164E330D5DBFE5BFD96EFFE6DB0C2961 /* Social */ = { - isa = PBXGroup; - children = ( - 083FEF0687A4E23AD8F917968B812312 /* QQ */, - AAFD24CFE2DB4010B9C703F25A36F7AE /* ReducedQQ */, - 3A0D0DED77E3D49C6A89A02637DCB9A8 /* ReducedSina */, - 8648A45901CA1CCB3AE5F64229B66187 /* ReducedWeChat */, - 05AB60D8040F3960066C5B216EB1DAD7 /* Sina */, - ); - name = Social; - sourceTree = ""; - }; - 19F4B6FCD9AB01AAE6B0C11480FFF727 /* WebViewJavascriptBridge */ = { - isa = PBXGroup; - children = ( - E0C1BBF34352112BEE7697CA2E2D450E /* WebViewJavascriptBridge.h */, - 34C9F06C68029BADDDAA3F989CCEF3B2 /* WebViewJavascriptBridge.m */, - 904E0A05C386FEC170BA291A01763992 /* WebViewJavascriptBridge_JS.h */, - 6E09144C685D9243772BA53F16F82735 /* WebViewJavascriptBridge_JS.m */, - 45FB3B94DBFDF5C5C55F7CF5D0974CC2 /* WebViewJavascriptBridgeBase.h */, - 54CA8928573B72E2BFCDCEE606BC9EDB /* WebViewJavascriptBridgeBase.m */, - B962AE77A71731CC4DD3E1922C4472BF /* WKWebViewJavascriptBridge.h */, - B9D2AA27F8CD64D33B07F19CC473C52C /* WKWebViewJavascriptBridge.m */, - 392210F6525960A7A0C2C2C1148CE144 /* Support Files */, - ); - path = WebViewJavascriptBridge; - sourceTree = ""; - }; - 1DB5C3B9CDF2FAC2D526109A0E67B18E /* UMengUShare */ = { - isa = PBXGroup; - children = ( - 8B84836417E9828877F29BB80B215FF6 /* Core */, - BF87A1F102D1F9D5D9527CF2C71F099A /* Network */, - 164E330D5DBFE5BFD96EFFE6DB0C2961 /* Social */, - 52254900C482E325E19A07DB73120497 /* UI */, - ); - path = UMengUShare; - sourceTree = ""; - }; - 1EBBCCB868C18B4F3B2FB4D3C14B400D /* CYLTabBarController */ = { - isa = PBXGroup; - children = ( - 4A434D7CB260C42DFBF5C8B5E6D390F3 /* CYLConstants.h */, - 172552B7997A8DD1BB3FAAD30C874E7A /* CYLPlusButton.h */, - F5050007CB960717E6E796A3269181C8 /* CYLPlusButton.m */, - B0CACF3D768CDF43C47FC1D51450DF67 /* CYLTabBar.h */, - FA00755278ADADB7B59F491B43714090 /* CYLTabBar.m */, - 85FAAAED0A44FDAEB27D10106C69A5C4 /* CYLTabBarController.h */, - DDADBA7FED7FBCF110FBB90862F5BA94 /* CYLTabBarController.m */, - 5375DBACF559A32DC389A5B232BA8D5E /* UIControl+CYLTabBarControllerExtention.h */, - F68F70DE81F8F93798E273460EEDE0F0 /* UIControl+CYLTabBarControllerExtention.m */, - D62AA5D5E65FF686EE078856B4DA19EB /* UITabBarItem+CYLTabBarControllerExtention.h */, - E9483A8947C9F5324EBCEAB2DDE8EAB3 /* UITabBarItem+CYLTabBarControllerExtention.m */, - 04E1481F8F992CBBCBE0E3354F79297D /* UIView+CYLTabBarControllerExtention.h */, - DD3D65892EB04B2A3DF6669C296945A9 /* UIView+CYLTabBarControllerExtention.m */, - 0A4E16E3BB4C2872A115E05628C7B5D2 /* UIViewController+CYLTabBarControllerExtention.h */, - 6BB1EDC34A33E9EF497D5711CAC9A255 /* UIViewController+CYLTabBarControllerExtention.m */, - 2E43FF03B80B27888EADEBBAE4A43640 /* Support Files */, - ); - path = CYLTabBarController; - sourceTree = ""; - }; - 1F20321B8339A0CCAE29671CEA05E452 /* Support Files */ = { - isa = PBXGroup; - children = ( - 88AFC3B399D2A3B89836677BB828D5AB /* YYText.xcconfig */, - 49E3824D64F8F973A6EB45F1CBF07560 /* YYText-dummy.m */, - 309BCCA47832745DB9BBC9594C616752 /* YYText-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/YYText"; - sourceTree = ""; - }; - 22854D7C55D1CE7A93745C7F20401CC0 /* Resources */ = { - isa = PBXGroup; - children = ( - 7A03C187AD057B76DAE09889A0B870CB /* MagicWindow.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - 23A13230B8A997F8700BCB18015CD927 /* Support Files */ = { - isa = PBXGroup; - children = ( - BED7B3E38283727B4366B7A0742AF091 /* M13ProgressSuite.xcconfig */, - 2DA29B793BD344BA4D24FCABFE3D38F3 /* M13ProgressSuite-dummy.m */, - 25DD7BBECD9451469980D224CBA32AAA /* M13ProgressSuite-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/M13ProgressSuite"; - sourceTree = ""; - }; - 25346C38C126C6A0081A5A878341BE12 /* YYText */ = { - isa = PBXGroup; - children = ( - 8739AF26D66A7EFF1080289B8766A59D /* NSAttributedString+YYText.h */, - A87D4C6056DD78F0306956089BF40068 /* NSAttributedString+YYText.m */, - 1DB0FEA16DA960E07BBD3F783C4C5963 /* NSParagraphStyle+YYText.h */, - 9DF7DE9563474AB0AAE9747A5EA5A189 /* NSParagraphStyle+YYText.m */, - 051BCB0150B8DC7C07058127A3D9BDDE /* UIPasteboard+YYText.h */, - FB27FD60C7AC57A17AB2E8EAEC956D48 /* UIPasteboard+YYText.m */, - CB410D61C473507B77A4392A6FF51E16 /* UIView+YYText.h */, - 823207BD4B7C3DFDF405A905C6BD13F4 /* UIView+YYText.m */, - 3F86FAF093165EDEDFFBAF302169EBEE /* YYLabel.h */, - 6798CFFDA1BA99912BE8F189EA297759 /* YYLabel.m */, - 5FBD84457C9F49BADCC0EF122697BB92 /* YYText.h */, - CF35FB7BD6628404DBF50B2530023030 /* YYTextArchiver.h */, - F9D63FFBE0B03CDFD38D9A538C64D17A /* YYTextArchiver.m */, - 5438F952A655240194038B21BF0DB1AC /* YYTextAsyncLayer.h */, - C4BFB60F019B70647B4DA0A8511BEDF7 /* YYTextAsyncLayer.m */, - 766A06A961038E6C17D52EB657C8C37E /* YYTextAttribute.h */, - 7DA931C657D5097DDDAF01A95E73B1CD /* YYTextAttribute.m */, - 7825A59274382A259ADEC182B87C8EDA /* YYTextContainerView.h */, - 88C03FA01A4A7580A8E3E8CAA682165F /* YYTextContainerView.m */, - ADAD4FA6C139DCC759AE8D845BFA1139 /* YYTextDebugOption.h */, - 8E547ABAE925AA7981D8150F5625FC52 /* YYTextDebugOption.m */, - 9689B78DD54EF73E7E36F84661B44D99 /* YYTextEffectWindow.h */, - 69BC0BB38D607E4184FA10ECAD8BB6EA /* YYTextEffectWindow.m */, - FF4EE9D7B19F6CD2C0EFEA24502D31B6 /* YYTextInput.h */, - D41D1D8DE274C2E5BC0EC3A325CD2EA7 /* YYTextInput.m */, - AC4FBD89395F58149669ADB565A66FCD /* YYTextKeyboardManager.h */, - D8841C9B97FA08E9F9DCE1D7AA2D0C69 /* YYTextKeyboardManager.m */, - 1006C24C3948018333AB91D69A2264F0 /* YYTextLayout.h */, - 322A1C7F7847A547D10AD82008EB11A8 /* YYTextLayout.m */, - BA8D1FFB2198E9D73711DF991A0FA8D7 /* YYTextLine.h */, - 34048ECB850241A4FEB134C95C46B7D0 /* YYTextLine.m */, - 0103A3F5D62C039696F62041EFAB6928 /* YYTextMagnifier.h */, - 6B197B69F3593E41384E017A55F8DDB6 /* YYTextMagnifier.m */, - 39221870455CF6CFF22802E4CBFE154E /* YYTextParser.h */, - E8F5D10CD82376756DF85D2C8F0A486E /* YYTextParser.m */, - F2A5308FFAD6259437B3456B446167ED /* YYTextRubyAnnotation.h */, - 96A2061E7EC002E7ED34D69C34E9840F /* YYTextRubyAnnotation.m */, - 3AD0CF66E275F4EFBAD0B13DD283E28A /* YYTextRunDelegate.h */, - 6F9C449539B26FD898DC31C71282BBA4 /* YYTextRunDelegate.m */, - FD21193449D14257E5635AF480CD9CB1 /* YYTextSelectionView.h */, - 3FFD396D9E7483F96D459512C1044011 /* YYTextSelectionView.m */, - 37FA9D3B39581ABA211EF9899373B56E /* YYTextTransaction.h */, - 68FCC5C8AC75261E1DEF300A7760FA20 /* YYTextTransaction.m */, - 30B10F211DB136E7CF86F869350545D8 /* YYTextUtilities.h */, - D9ED212E30859F02BA751F281B64200F /* YYTextUtilities.m */, - EF4F622A8C7ED8ECCD87E7844763B35D /* YYTextView.h */, - 595CF889C0406EEEFA1595C7CBB100D0 /* YYTextView.m */, - D38B38B363B400D2A2DB2586A5B80986 /* YYTextWeakProxy.h */, - 595611A562D2A4A2A88E04A832F1576C /* YYTextWeakProxy.m */, - 1F20321B8339A0CCAE29671CEA05E452 /* Support Files */, - ); - path = YYText; - sourceTree = ""; - }; - 2B274B8803B8D101017ADDA567D62B23 /* MOFSPickerManager */ = { - isa = PBXGroup; - children = ( - 9225394628921FCF98D0B2156F0E62E6 /* AddressModel.h */, - 847411DE20A5A1C6EC5CA15DFB45E17E /* AddressModel.m */, - A7B82406C4CF2F3E41C951F375FDFC45 /* GDataXMLNode.h */, - 1359B5BB443E263CAA214CCA4E4E03C7 /* GDataXMLNode.m */, - 326AD7805BA3D8D0C9D9DC3EBB4CB09A /* MOFSAddressPickerView.h */, - 91784E91C2D2E979489C70900DE72B38 /* MOFSAddressPickerView.m */, - 35E7218A358355763AC5FBF1584E8A81 /* MOFSDatePicker.h */, - 139706189654753892C916A80A4A8A7A /* MOFSDatePicker.m */, - 30ABD7956C35F060AD4FF103820F28B6 /* MOFSPickerManager.h */, - 687DB7E1316864FBBC3A5A9E1A5A202D /* MOFSPickerManager.m */, - AC2D7DC2FB4F93FECED44C49520A35C9 /* MOFSPickerView.h */, - 9E5D2D600ADFB0DF9CBD1A071EA9BB71 /* MOFSPickerView.m */, - B8ECEA46932BC6BCA5414238155E1756 /* MOFSToolbar.h */, - 048823A9FB7BB13C5F4793501E8B35A2 /* MOFSToolbar.m */, - EE63250D81751B3BB89BAECA1A0FA2DE /* Resources */, - 8ADB55B00E9C5DF300FA1503C5AA9193 /* Support Files */, - ); - path = MOFSPickerManager; - sourceTree = ""; - }; - 2C42EC2FAFC2466747E2168F48BF51D6 /* KILabel */ = { - isa = PBXGroup; - children = ( - FAD58B841004CBA55CC3F9C0C52DCB07 /* KILabel.h */, - 94AA55B9F427B64DC02E14C27195D5E0 /* KILabel.m */, - 6CB8A541F65D0FE339AE62AE54F756AC /* Support Files */, - ); - path = KILabel; - sourceTree = ""; - }; - 2DC277AF6C114B09E3037EE4C5AC373A /* Frameworks */ = { - isa = PBXGroup; - children = ( - D1FB390F5EAB8D94A04917576BA09D88 /* libWeChatSDK.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 2E43FF03B80B27888EADEBBAE4A43640 /* Support Files */ = { - isa = PBXGroup; - children = ( - EEFA43DED626C5EC3F2EEAA32463176E /* CYLTabBarController.xcconfig */, - 16EA0A6D5AF3CD3190CD7020A902D0ED /* CYLTabBarController-dummy.m */, - 770317683A6E9F643B4E43752B921DDC /* CYLTabBarController-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/CYLTabBarController"; - sourceTree = ""; - }; - 3613072690ECB983A2AB97ECBCF731D2 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 82DCFE6193484D7A630839A4AD3315DE /* UMMobClick.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 37058FB332B144035D50CD321A795331 /* Resources */ = { - isa = PBXGroup; - children = ( - 877B94AE7FC09A2BDFF3B8E72D2C307B /* ZFPlayer.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - 392210F6525960A7A0C2C2C1148CE144 /* Support Files */ = { - isa = PBXGroup; - children = ( - 8090E059E89B637FE9CFE0D3FED61C68 /* WebViewJavascriptBridge.xcconfig */, - E1D840749E3227A5B7F9602B936BD634 /* WebViewJavascriptBridge-dummy.m */, - ADABB01943FB8EB3D02DE02975B3ED57 /* WebViewJavascriptBridge-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/WebViewJavascriptBridge"; - sourceTree = ""; - }; - 3A0D0DED77E3D49C6A89A02637DCB9A8 /* ReducedSina */ = { - isa = PBXGroup; - children = ( - 4DEE452B406137B63D566DA132AD7FC6 /* UMSocialSinaHandler.h */, - 894FF40CEDD0306B1913E315526BA359 /* Frameworks */, - ); - name = ReducedSina; - sourceTree = ""; - }; - 3DA651348A2678E249A427E6E3FC7385 /* Masonry */ = { - isa = PBXGroup; - children = ( - 7E8932FE2CB1AD5AAF2E285EABBD88DE /* MASCompositeConstraint.h */, - 7A55E93EF311004E23D6189573CA229E /* MASCompositeConstraint.m */, - A37333678AF8E15234FBE3DB155255B3 /* MASConstraint.h */, - 9DEBCE6460C2A1F5E42D198F8EE2778E /* MASConstraint.m */, - 87B0B3E4DD1456825662552E4ACE5E65 /* MASConstraint+Private.h */, - A3CAB37C9FD75D2F91CEB00270CF0291 /* MASConstraintMaker.h */, - AC57916ACB65E363F705C4AD694929C0 /* MASConstraintMaker.m */, - B20F4C8ABED7B78200EE7E28613DC243 /* MASLayoutConstraint.h */, - 38C2D3ED00390A6B157A8B2AE4CA7635 /* MASLayoutConstraint.m */, - 0EC331CA0AE9BE9D8A1CB272DB69FA14 /* Masonry.h */, - CB0592F2A4396E17E230F396DA96FA02 /* MASUtilities.h */, - 1AC975587C57D95E4171139F585495EF /* MASViewAttribute.h */, - 08F0F37DFADECCDB9990A61F8AF70417 /* MASViewAttribute.m */, - 0C0B96B99666FE6DD54C12FD2825A9BA /* MASViewConstraint.h */, - 9E9ACEF5BC58524646C2F80494DA6222 /* MASViewConstraint.m */, - 83ED8416FEE1D8215CE8CFDDE52FD284 /* NSArray+MASAdditions.h */, - 9D1A8EE7F66FAFAE9FC1ABDFCF1155CD /* NSArray+MASAdditions.m */, - 9BCC322F7D6A48B084E48B747DB1F4AC /* NSArray+MASShorthandAdditions.h */, - 9948E074A9AB7B7BAC4F08A2E1A21167 /* NSLayoutConstraint+MASDebugAdditions.h */, - 76AC8F4FC8B79501A3AE8B2AACC88E45 /* NSLayoutConstraint+MASDebugAdditions.m */, - 39EED10624702BD9A5A7EC170BD6E789 /* View+MASAdditions.h */, - E4622B57B2DD2FFA8648088913059F1C /* View+MASAdditions.m */, - 80218C39F0AF089C4A1008AB91F566BF /* View+MASShorthandAdditions.h */, - 430A7D48553284031AD60352AB854BFA /* ViewController+MASAdditions.h */, - DA6845120F2D053B76D55EB874BEFDE8 /* ViewController+MASAdditions.m */, - 78863C9CF316145433A4338CB375743A /* Support Files */, - ); - path = Masonry; - sourceTree = ""; - }; - 3E78686018971F01A34530E41A186EEF /* UIKit */ = { - isa = PBXGroup; - children = ( - A351302198A655351E2AE6EE1BBFBE82 /* AFAutoPurgingImageCache.h */, - 22E8C6BA6067D3CF4B76C54E473FDE3D /* AFAutoPurgingImageCache.m */, - F5EDA3929262A3F8D0DB902CA6B94295 /* AFImageDownloader.h */, - B1BFACFE06813FC13873055948130CB5 /* AFImageDownloader.m */, - E85284A511AB575C25B582AF8ADF8DE3 /* AFNetworkActivityIndicatorManager.h */, - EB2318788E9F0009F5773E71FB439E18 /* AFNetworkActivityIndicatorManager.m */, - 2B3C039D052A2B29863E20147BD5CE07 /* UIActivityIndicatorView+AFNetworking.h */, - EC4FB9391CAAE7625A4776A0947225B1 /* UIActivityIndicatorView+AFNetworking.m */, - CF0CD53305BC85F133C04AB2A3050A7E /* UIButton+AFNetworking.h */, - B99EB8A6BFF4D7A22BEE8BB79624ED66 /* UIButton+AFNetworking.m */, - B060D0EE1DBCDC43B10B0789807E247F /* UIImage+AFNetworking.h */, - EF7A825BE2B277747B7ABEAF66F22851 /* UIImageView+AFNetworking.h */, - 5CE816BC163F9E7124C5CD2372072AA7 /* UIImageView+AFNetworking.m */, - C56DB930C0F4D0AEC130E4CC2B6CE8E9 /* UIKit+AFNetworking.h */, - F4511F1AA3D059CCDAD3569FDF4CFEE1 /* UIProgressView+AFNetworking.h */, - CC91B725E543C8039090BA3B74FF1B46 /* UIProgressView+AFNetworking.m */, - 7C66868B3BCE18CCA6FBB3488A9C51BD /* UIRefreshControl+AFNetworking.h */, - 585206702AEABCBC79D3D609DD122D60 /* UIRefreshControl+AFNetworking.m */, - 05AFA2A81611E199928EE527B87FCB47 /* UIWebView+AFNetworking.h */, - F7166F8E6DD66D9E46AE595884AE4247 /* UIWebView+AFNetworking.m */, - ); - name = UIKit; - sourceTree = ""; - }; - 416D882138BC03BF7C8F0BB9CE84AA9F /* Frameworks */ = { - isa = PBXGroup; - children = ( - 34B6FD8FA9461758A77F7C7EBEACB9B1 /* TencentOpenAPI.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 422B7574BFC64D7F63B102CF19EA5ED0 /* Resources */ = { - isa = PBXGroup; - children = ( - 09EFF64097E60896A3B19EEDA4B8C446 /* MJRefresh.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - 46DDD468DB0F54C3D7F8031A89D7836E /* DWBubbleMenuButton */ = { - isa = PBXGroup; - children = ( - 07191289A9BFF9BA43028EF4A345F7D9 /* DWBubbleMenuButton.h */, - 1510755022B8418490930CAB538634E9 /* DWBubbleMenuButton.m */, - 0066443AD6BA86F3429C18E390BEFBE8 /* Support Files */, - ); - path = DWBubbleMenuButton; - sourceTree = ""; - }; - 48A36CD0CD67F62252AD5DA5E7197BE0 /* Resources */ = { - isa = PBXGroup; - children = ( - 3F9736A575785DBB56C5C59FB62B7ED5 /* IQKeyboardManager.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - 4A6F8E73AAAB93A05C9FC834102C6CC9 /* Toast */ = { - isa = PBXGroup; - children = ( - E4847F643EF5321DA6B8472EDEABD54A /* Toast.h */, - D2D5024C9096AB99551D3ADA6F1EC9A2 /* UIView+Toast.h */, - 4980EAC703BDF1E2090EB34195400DD2 /* UIView+Toast.m */, - 614FFD0B68CF25F65ABE1EDA9C2E4D45 /* Support Files */, - ); - path = Toast; - sourceTree = ""; - }; - 4CB877E8C61173E1D23DDF89DD6489E9 /* TDTouchID */ = { - isa = PBXGroup; - children = ( - E45A74DA50A44C43E78D3A6714BA44D9 /* AppDelegate.h */, - E2C05F18C0A82CFACE63D733D13171AE /* AppDelegate.m */, - FC8D5450C7A3E49B3DCE5805044BC56F /* main.m */, - 1C5AB013AAF6D7E9A137A4CE3A3FE3AC /* TDHomeViewController.h */, - 0701B52620850F40FE81E056D3080A22 /* TDHomeViewController.m */, - 5C564B469D1D78D835835F734FB75952 /* TDMainViewController.h */, - 4E62574E7B64FBEFECD764FCE83E4D40 /* TDMainViewController.m */, - 8681D87B0661E7C6DA9BB9051203CC7E /* TDTouchID.h */, - 05B4EBF9AD94F2D92C2CEA38A9ED168F /* TDTouchID.m */, - F989FCD098C929254E1CAF39144DBD6E /* Support Files */, - ); - path = TDTouchID; - sourceTree = ""; - }; - 4E1851A8ADBE3C97633C0A0207C5DEF9 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A255545CF4F3AF16CE7D7AEB55EB4F5A /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - 52254900C482E325E19A07DB73120497 /* UI */ = { - isa = PBXGroup; - children = ( - 77CD2F488F82B321858E1115DD4BF105 /* Frameworks */, - 0970BED7D442D201CD9C39BF9263FC66 /* Resources */, - ); - name = UI; - sourceTree = ""; - }; - 54334A54E15859D5E5DCED777EC1E290 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 61064FA074EFFD50147C8E44EBB7A695 /* libUMSocialLog.a */, - 8BC33D8D476858531C320EC5F7A3C2CD /* UMSocialCore.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 5ACD28FEC98BD24E66249A7343766CDF /* Support Files */ = { - isa = PBXGroup; - children = ( - 0A2B81143ED0FD2CAA713AE6525180DA /* ZFDownload.xcconfig */, - 29848F154041E6427AC5277CE477609B /* ZFDownload-dummy.m */, - 76EFD40BC2AC71C7B10AB24B6C5E40A7 /* ZFDownload-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/ZFDownload"; - sourceTree = ""; - }; - 5B142FE2542815D3DCB309FE360921F4 /* Support Files */ = { - isa = PBXGroup; - children = ( - D97210D3B27649D2764515FA73A81B78 /* UICKeyChainStore.xcconfig */, - A630A4E6D435AAC37445B39A3C07D22C /* UICKeyChainStore-dummy.m */, - 4AE1C037ED6678753CDDB1FED40CD12D /* UICKeyChainStore-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/UICKeyChainStore"; - sourceTree = ""; - }; - 614FFD0B68CF25F65ABE1EDA9C2E4D45 /* Support Files */ = { - isa = PBXGroup; - children = ( - BECD552238F972255302C0AAC040C8F0 /* Toast.xcconfig */, - 634BB9F175B46CBE6155C5F159CCE537 /* Toast-dummy.m */, - BDF9BDBCCC0C59E9BDBB6B738BDB2C7E /* Toast-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/Toast"; - sourceTree = ""; - }; - 6268C20850E6E7C18F8CDB32B1914125 /* standard */ = { - isa = PBXGroup; - children = ( - 21777A9BC63C71373596B99A8F5CCA68 /* FMDatabase.h */, - DE62A0661EA434BA8836B2148A6BA4BF /* FMDatabase.m */, - 83C3C3E5DEF8D29C063E1CAE528BCD74 /* FMDatabaseAdditions.h */, - E955452C1A55EA0F76892868F7F731AD /* FMDatabaseAdditions.m */, - A0C50DEE4F91E086B449D8BD39366118 /* FMDatabasePool.h */, - B5894DB14787DBFB05B9551859CBF17E /* FMDatabasePool.m */, - 3E95F9C1F91B8336C1D68C38E8EF2A3D /* FMDatabaseQueue.h */, - 907367704B3A7979A8B8A96B804E02B3 /* FMDatabaseQueue.m */, - 1F73DE73818A59A85FB8CE74C5BF5EE4 /* FMDB.h */, - D5FC73682194D54EF2437A7C07B9295F /* FMResultSet.h */, - F9FE321FB2D4CF72518A9CD79F503637 /* FMResultSet.m */, - ); - name = standard; - sourceTree = ""; - }; - 6348363FBD14083A7075BC521B84189E /* Support Files */ = { - isa = PBXGroup; - children = ( - 9686DB23109726069F4F55F431BA4C6F /* MBProgressHUD.xcconfig */, - 44CC44A9E8D457B6AD32067B5B008808 /* MBProgressHUD-dummy.m */, - 4751B85044EACE0595F89C99F03B56DC /* MBProgressHUD-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/MBProgressHUD"; - sourceTree = ""; - }; - 649E482F7E8132E3B3B5F7730A9C281A /* Support Files */ = { - isa = PBXGroup; - children = ( - 15A07B4076009D5884DD58629769954E /* LxGridView.xcconfig */, - 4F4D8903EA1B84828CDDF6572E1E4003 /* LxGridView-dummy.m */, - 88D566EA9A2EE097E665ECDAE5112E15 /* LxGridView-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/LxGridView"; - sourceTree = ""; - }; - 6537E5341D8ACC3949F402167D0A59FA /* Support Files */ = { - isa = PBXGroup; - children = ( - EA5EC071A7ED9F51B4A40F99E9541AA1 /* Reachability.xcconfig */, - 4FAAEFBD3BED098B6EE7DFBC7477503A /* Reachability-dummy.m */, - F08C73BF7EB81552B0585C17FE1276CD /* Reachability-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/Reachability"; - sourceTree = ""; - }; - 6723AA731B800F78F9B22416301D6250 /* GVUserDefaults */ = { - isa = PBXGroup; - children = ( - E63CD75603E23077B63CE98668916A48 /* GVUserDefaults.h */, - 2CD6813DDF5259FD84AB9CFB8757D956 /* GVUserDefaults.m */, - 1240AFC0E97AFA91FB8CE14FA1F3F3B8 /* Support Files */, - ); - path = GVUserDefaults; - sourceTree = ""; - }; - 67C079D1C9B1B95C531DAA0D6DD93A20 /* ZFDownload */ = { - isa = PBXGroup; - children = ( - 7BD6F6F61469F8B7406056D5FDC64EFD /* ZFCommonHelper.h */, - 84FFE1E3C74972FE2F4EC9C87402600A /* ZFCommonHelper.m */, - E4961060D13AC76CFF611DC5AA3FEB9D /* ZFDownloadDelegate.h */, - 1947701CC5128684FDDAD7AE102E56F3 /* ZFDownloadManager.h */, - C5946455BCFD49E087A1A6F2C72D9DAB /* ZFDownloadManager.m */, - 66DEFBE8BA9DEDB2C1106F5EC6FBE268 /* ZFFileModel.h */, - 283622CC1F8E1C4A04F1B4EFC0AAFF84 /* ZFFileModel.m */, - 2543896A6FB91F5F554E958C47327CD8 /* ZFHttpRequest.h */, - 90ACC274A4C37EDF36F43FACAF8967AB /* ZFHttpRequest.m */, - 5ACD28FEC98BD24E66249A7343766CDF /* Support Files */, - ); - path = ZFDownload; - sourceTree = ""; - }; - 6824D23F086CBE41AD2422066DE9DFC9 /* SDCycleScrollView */ = { - isa = PBXGroup; - children = ( - 389198E626BFB390A19FB501A62C30FA /* SDCollectionViewCell.h */, - 279FC32943EB0622AF4AD148AEF94F99 /* SDCollectionViewCell.m */, - 2CBC579CAA38E919A439CBE3ACACFF72 /* SDCycleScrollView.h */, - 5ABE10B7074DCB7134A2E78CCD4AA17F /* SDCycleScrollView.m */, - 4886DC156E54016E72A53D18AD55FF20 /* TAAbstractDotView.h */, - E078B3B2BC6653367343D5C40F4B8185 /* TAAbstractDotView.m */, - 601E8D270F8B1698017F4C325FA1EFD6 /* TAAnimatedDotView.h */, - 3559FB681694634974CA14916E1B5F84 /* TAAnimatedDotView.m */, - 6C244B148DA4A290B37320D5C5CD9AF6 /* TADotView.h */, - A4A448BA3C82A65BDC33D47DE59AC744 /* TADotView.m */, - A4DF0467D37373C07AEDF598CB9FC82F /* TAPageControl.h */, - E8A27F9B1580F6F7102D9AC20780D119 /* TAPageControl.m */, - 7E1BE344E7658E804E2872A8411D5AB6 /* UIView+SDExtension.h */, - 60426ED0D1C2CCF640F5CDE9712F06B2 /* UIView+SDExtension.m */, - E8B92CC6BFE6FC75651E592FF14B65AE /* Support Files */, - ); - path = SDCycleScrollView; - sourceTree = ""; - }; - 684319EF1E382AC479981B513887769E /* LxGridView */ = { - isa = PBXGroup; - children = ( - D0C94FA31711E5F02E058194BC4FB781 /* LxGridView.h */, - A741DF0D26884201FA22CD42DF68C556 /* LxGridView.m */, - FCE7DCF929068DDA22856C03E2B13337 /* LxGridViewCell.h */, - 61ECA0F0888DDC036CE8BC7170617F50 /* LxGridViewCell.m */, - 6FF0536139D0D2F2B332EBEFEE52B82F /* LxGridViewFlowLayout.h */, - 5CC7F124AED1B4CA930A1CE05462E6F0 /* LxGridViewFlowLayout.m */, - 649E482F7E8132E3B3B5F7730A9C281A /* Support Files */, - ); - path = LxGridView; - sourceTree = ""; - }; - 6BAF021DB8D1F8F3ADE9669411F9F170 /* ZFPlayer */ = { - isa = PBXGroup; - children = ( - 857C79F693A88C01F8948523F6E4BA2B /* ASValuePopUpView.h */, - B8B99BCC3C78EC080F1B764A281193D8 /* ASValuePopUpView.m */, - 9C9E75F4EDB25948B73BFC35C3A760EB /* ASValueTrackingSlider.h */, - D9A19C6D1C2C1D33214AA19144F0ACF7 /* ASValueTrackingSlider.m */, - 8B87D071428437E4E596E097F29DEE8B /* MMMaterialDesignSpinner.h */, - D6CABFE8A0532E0815E9719529A59933 /* MMMaterialDesignSpinner.m */, - 932D6B99DB0DDE128563B8BFD13618CA /* UIAlertController+ZFPlayerRotation.h */, - 019014BC45649802DDF83E6007F3085C /* UIAlertController+ZFPlayerRotation.m */, - 0E4DE38CE6F33B2BC30DF9BB210FD738 /* UIImageView+ZFCache.h */, - 63F1CE555CBC4D3297D21289F14AF32B /* UIImageView+ZFCache.m */, - F0DF052F1732FACBB5EE96DC8B776F22 /* UINavigationController+ZFPlayerRotation.h */, - 4A7D90B3D9D521DB644E9C3F780CD150 /* UINavigationController+ZFPlayerRotation.m */, - F9504BBCB2850E1AD0A299210BC6DF49 /* UITabBarController+ZFPlayerRotation.h */, - 3FCD177C2E293B3CB16FAF50E58E15D9 /* UITabBarController+ZFPlayerRotation.m */, - FEF0BA67A24609FD158EC0AC71318AB9 /* UIView+CustomControlView.h */, - A23C76376D57D9E5DFCCB72F3369202F /* UIView+CustomControlView.m */, - 72092789A81DED056915185928C46406 /* UIViewController+ZFPlayerRotation.h */, - D247A195202A5C77AC8B0F92A540ED47 /* UIViewController+ZFPlayerRotation.m */, - 3069F9070FE360DF1229E8678F000B74 /* UIWindow+CurrentViewController.h */, - 50CDB35644BAC5E86EC745E5793E0E81 /* UIWindow+CurrentViewController.m */, - F9EE0AE2B7D6BEAB9162FA8FCB522B63 /* ZFBrightnessView.h */, - 1AB9B5F626C85BE4E94E30317721C063 /* ZFBrightnessView.m */, - DBD6B801CDE33FFA8475FDDFEDCD9F32 /* ZFPlayer.h */, - EE6D761F944A7BF7D4EBF59961AAEFE6 /* ZFPlayerControlView.h */, - CB681269ADE54CC89D5C2707874D3DC2 /* ZFPlayerControlView.m */, - 62BA41A4C26D5F10CCFF25A35DF57C31 /* ZFPlayerControlViewDelegate.h */, - ABAD685D1448375FB1C3692E3DBAA916 /* ZFPlayerModel.h */, - 8EE4EC787816F0F55B19334A11B42642 /* ZFPlayerModel.m */, - 3114E396DC236CB92EE5BECE8FAA0A9E /* ZFPlayerView.h */, - B8ABB86E040E236941AB5A500527F4CC /* ZFPlayerView.m */, - 37058FB332B144035D50CD321A795331 /* Resources */, - 757FF12BE99796D3444E856616AD1BC6 /* Support Files */, - ); - path = ZFPlayer; - sourceTree = ""; - }; - 6CB8A541F65D0FE339AE62AE54F756AC /* Support Files */ = { - isa = PBXGroup; - children = ( - 2B877CA80ECE571A26E986BBD116B0F8 /* KILabel.xcconfig */, - 6702197BCD72026897FEFD1679017795 /* KILabel-dummy.m */, - EE23BC0C16AE7D0E6D2C4CDCE5BA4E4B /* KILabel-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/KILabel"; - sourceTree = ""; - }; - 6D55BDD722E4F5E581F03887C927AB6C /* Core */ = { - isa = PBXGroup; - children = ( - 1172D3802B188B8D4966ED5202AC6D71 /* ASIAuthenticationDialog.h */, - DFA98F9E55C032369DC4ABE593A762CB /* ASIAuthenticationDialog.m */, - 1D47FAEBB9BAD519D7C2DEA46391DC3F /* ASICacheDelegate.h */, - B4B7FB2DEBAE1E8B784B7294DD3180A2 /* ASIDataCompressor.h */, - DF7E15545CF4DCD9E601402845800E9E /* ASIDataCompressor.m */, - AF75E7145AE53F1E45F700B894E09793 /* ASIDataDecompressor.h */, - 020CAF58911879ECA04F6905CFC1450F /* ASIDataDecompressor.m */, - 3CAB8FE95F0621A33143581C84DDBB26 /* ASIDownloadCache.h */, - 23AF62AA93085C0709D200DB5CF36938 /* ASIDownloadCache.m */, - 4BABB4DEC01A24250E13622C900A1E59 /* ASIFormDataRequest.h */, - 7EEC9E77FA3372FE30A20FB6665D5022 /* ASIFormDataRequest.m */, - F65C11AC0721B2A15DCF4A359A7D0D2D /* ASIHTTPRequest.h */, - 5987A0D6BB3B5276E79A941A8128426B /* ASIHTTPRequest.m */, - 03565DFCD60ACBE954C117FAAE9F3D1A /* ASIHTTPRequestConfig.h */, - DBA1620313C404180273D68AF852D276 /* ASIHTTPRequestDelegate.h */, - 83AE7F0F063A830934040C72387C0A5D /* ASIInputStream.h */, - 96DB4CDF47B803249D77E04E9C1168C4 /* ASIInputStream.m */, - 2315CA205E9BB7D8D644F26A26521EF6 /* ASINetworkQueue.h */, - C355D3AF680A4A6D242CABF5DE03BFC7 /* ASINetworkQueue.m */, - B55E4CC5C651EA27F71065F61C61AEF2 /* ASIProgressDelegate.h */, - ); - name = Core; - sourceTree = ""; - }; - 6FEE65D05909DF82D4C7DD91DBE1DE34 /* Security */ = { - isa = PBXGroup; - children = ( - F83FAD6D30C8F16490E2368B4F9F03E5 /* AFSecurityPolicy.h */, - 7E8CE76232520EC945D8EB7C70E9D7CE /* AFSecurityPolicy.m */, - ); - name = Security; - sourceTree = ""; - }; - 7017B5865BDACC4E0CA4A718CD64F2DA /* Support Files */ = { - isa = PBXGroup; - children = ( - C3E26E8FBE4C20F80143EBF740F0741A /* SDWebImage.xcconfig */, - 8E165A0459022BF0F5C7B2113F461C52 /* SDWebImage-dummy.m */, - 66FD74BFA11E4E1B53DEE8E451F947FF /* SDWebImage-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/SDWebImage"; - sourceTree = ""; - }; - 71B10211F30D5B9355D1154393EDE35F /* Frameworks */ = { - isa = PBXGroup; - children = ( - E4AAF325EF42567853AB95AB6B4783F2 /* libMagicWindowSDK.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 73579AEB38B788B5686BE3FD421510FE /* AFNetworking */ = { - isa = PBXGroup; - children = ( - 7B1D2478ABB83ABD0A6ABA98A67EB320 /* AFNetworking.h */, - ECB883CA45AA7CCB7ACCC7EAC1D19DBB /* NSURLSession */, - AE90A720F3F577E0FE5920AA4D456F9F /* Reachability */, - 6FEE65D05909DF82D4C7DD91DBE1DE34 /* Security */, - CF038AEB8FBBF8313D2E90BA347182E4 /* Serialization */, - 8AEF3B10C2A802A1B03D9B76D1263ED1 /* Support Files */, - 3E78686018971F01A34530E41A186EEF /* UIKit */, - ); - path = AFNetworking; - sourceTree = ""; - }; - 7422E9EC1CE80B6695044412D323808B /* FMDB */ = { - isa = PBXGroup; - children = ( - 6268C20850E6E7C18F8CDB32B1914125 /* standard */, - 0E5B01C0310BD007F6F67F1FF047D5EF /* Support Files */, - ); - path = FMDB; - sourceTree = ""; - }; - 744C11A59BBA8BB2B3FC7ECEA6470A50 /* S3 */ = { - isa = PBXGroup; - children = ( - 1B990E9DA980F0A07EEB232B9BA49862 /* ASIS3Bucket.h */, - B6814A5F28DC1F14D13602A7CC421EB4 /* ASIS3Bucket.m */, - F7B3D47B9DD8B31FABB807DE5A1A57C6 /* ASIS3BucketObject.h */, - 8C2CC20F6F9946F41C9A91712B847F6D /* ASIS3BucketObject.m */, - D91930F62D6B374E87FF3CC43A5CF96B /* ASIS3BucketRequest.h */, - 10CA835B856161136BB0C29617DA51E9 /* ASIS3BucketRequest.m */, - 5281D214632B617FBCA000A78B36F01E /* ASIS3ObjectRequest.h */, - B4A7E13A3B22034EA5F46F657FFF7421 /* ASIS3ObjectRequest.m */, - 7D665BA14DC1E5EDE0C741E763664C7F /* ASIS3Request.h */, - 5925CF13424B1E4D99CCD97FE1FCDB3A /* ASIS3Request.m */, - 36E895F90E9430FC321F70DE72B2CAA6 /* ASIS3ServiceRequest.h */, - AC0B9573AF130E0F34E2BEA61B549AF5 /* ASIS3ServiceRequest.m */, - ); - name = S3; - sourceTree = ""; - }; - 74A040836D44E409C3EFB0C121DB7F93 /* YYCategories */ = { - isa = PBXGroup; - children = ( - 8EABE59547892AC3F2525B405242B6CA /* CALayer+YYAdd.h */, - BD7054AC108CD6C419E8B9D98172FB71 /* CALayer+YYAdd.m */, - E3D07FA37E68C7FBC5D4AE3CF05ECF2F /* NSArray+YYAdd.h */, - C24B4071D2A05BD37B24DEE3676B37F1 /* NSArray+YYAdd.m */, - ADA3D41AAE0EDFC89AA891B96C8D43B7 /* NSBundle+YYAdd.h */, - F9CFD260C7BA10536E86EB26625D8B62 /* NSBundle+YYAdd.m */, - 6AA73B0FB3C97F30C239DC6F744C9DA4 /* NSData+YYAdd.h */, - 95EEF74C2E88FEFD843FBD70D1C298E2 /* NSData+YYAdd.m */, - D0E100F6C54E64F9BC93EC27C4FDE928 /* NSDate+YYAdd.h */, - B23EA59D178623F454E6FB75DB6866C1 /* NSDate+YYAdd.m */, - 442C285D8F51F732D1875188CB60E9DD /* NSDictionary+YYAdd.h */, - F282A59BC15D626666FF5E19AF348181 /* NSDictionary+YYAdd.m */, - 71926658EFC9069B2C26929BE11F90C7 /* NSKeyedUnarchiver+YYAdd.h */, - 22E460D17504CEB737282594FB33C067 /* NSKeyedUnarchiver+YYAdd.m */, - 738FB7783397F62FF295A854ECA84AF6 /* NSNotificationCenter+YYAdd.h */, - 8B890D9F31833483AF305E64B00E5DCA /* NSNotificationCenter+YYAdd.m */, - 98BB0134772D94E31AFE00D20A71A2B8 /* NSNumber+YYAdd.h */, - 8CB97EBFB89EE626A7905D8A427626C6 /* NSNumber+YYAdd.m */, - 779818BABC265B3F17CC3486E2B09D4F /* NSObject+YYAdd.h */, - 09109A23B5B75450B2043CC030916FA1 /* NSObject+YYAdd.m */, - 28D9E939466D7A5E461493F0BE983B94 /* NSObject+YYAddForKVO.h */, - 4DF8DCC596367595B76B7524E5504D5B /* NSObject+YYAddForKVO.m */, - DED459F9AB6C939FD4CDE6B906807379 /* NSString+YYAdd.h */, - 80926BF9B9C958F3938D475452D52AF2 /* NSString+YYAdd.m */, - 5B7A314924964C5A5B5E551289D93381 /* NSTimer+YYAdd.h */, - E6D81E4F4E43362819414515C641CDAE /* NSTimer+YYAdd.m */, - EE2BD7300079355731FF4FC5BF955307 /* UIApplication+YYAdd.h */, - C1E420E4EB35D9FEF74950CFDA50DC09 /* UIApplication+YYAdd.m */, - 586ACEBF08E01CD755B966EF900D8E35 /* UIBarButtonItem+YYAdd.h */, - 131B1E8242CA8B5B01FB20438CB5F8A0 /* UIBarButtonItem+YYAdd.m */, - E5DF33518F3C1D5FB8684D9D36790FBF /* UIBezierPath+YYAdd.h */, - BA33818C92432A78A2B1FCA5D7EA3CFF /* UIBezierPath+YYAdd.m */, - CF47B11BB289765E7CEBAAC8E8D273D0 /* UIColor+YYAdd.h */, - 26A5D8463162A73D52409A89781605AD /* UIColor+YYAdd.m */, - 5CF482922F43A0132EDFD72000708C5B /* UIControl+YYAdd.h */, - F2556069BFEC1720BA72A3E878732253 /* UIControl+YYAdd.m */, - B86A01A7E22D5470F30A0115DEA77FB1 /* UIDevice+YYAdd.h */, - 4122946AD5F17EB885B9333A74496168 /* UIDevice+YYAdd.m */, - DB8D0BF01287F2DF52ABB6E1615CEDEF /* UIFont+YYAdd.h */, - 822B6730C5495CD6416157D79B01DA61 /* UIFont+YYAdd.m */, - BFE9A872F3071983A402730E2C61E481 /* UIGestureRecognizer+YYAdd.h */, - 8DBD0D4771B1AA1DD8D98BD52AEA1143 /* UIGestureRecognizer+YYAdd.m */, - 1ABDAEBD145D1FBE989709FB053C6619 /* UIImage+YYAdd.h */, - BEA62832F22A2354281D335511F277CA /* UIImage+YYAdd.m */, - 914F27DD9F4364E6A074E894E6874E8E /* UIScreen+YYAdd.h */, - A474F5FC81F488A6BC9A2BCE2F988F48 /* UIScreen+YYAdd.m */, - CF518E2361B4275CB590E7ED8B3F81A2 /* UIScrollView+YYAdd.h */, - 830512F9C57D252126830818EAD9AD4A /* UIScrollView+YYAdd.m */, - 9D949E7E1EA68F3B139E44B2DB145146 /* UITableView+YYAdd.h */, - 4D4B9C607B51548470755E37632C2584 /* UITableView+YYAdd.m */, - 15BBD333C32F28BC1F90ABCB800349B6 /* UITextField+YYAdd.h */, - 56B65A371093C0C9C912F74B8A2458C1 /* UITextField+YYAdd.m */, - 6CA93E524C8D0D37A23828D3D9FD63C5 /* UIView+YYAdd.h */, - C7C1F1F3C2116488C1773F31B2D890A9 /* UIView+YYAdd.m */, - D753604D87F7781A6B9B89DC579984BF /* YYCategories.h */, - 626814BB0D43C8E27E1B09C855CD5170 /* YYCategoriesMacro.h */, - A4ADD5E02FF48CB45EF0B551B0744C86 /* YYCGUtilities.h */, - 086EDCDD88AEE798BF922F4ABB249BC6 /* YYCGUtilities.m */, - BE3660D96B6467FD83E2871A5EE9CCA4 /* no-arc */, - C015CE9D14000C3E858EADE1B33BC7DC /* Support Files */, - ); - path = YYCategories; - sourceTree = ""; - }; - 757FF12BE99796D3444E856616AD1BC6 /* Support Files */ = { - isa = PBXGroup; - children = ( - 91330B5BDFA577EA85E35A83BE861606 /* ZFPlayer.xcconfig */, - B9072784B64495ED47AEE9C4095EA4A2 /* ZFPlayer-dummy.m */, - 2820A3D0243F910D475EDA711A603C53 /* ZFPlayer-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/ZFPlayer"; - sourceTree = ""; - }; - 7731300CE93B61ED71286C3A10C3A24F /* Support Files */ = { - isa = PBXGroup; - children = ( - 81CD280EF61DE4C207AC96480DA158B3 /* YYAsyncLayer.xcconfig */, - A70A59D5D83726124E1DF4784BBFB6E0 /* YYAsyncLayer-dummy.m */, - 64FC5A2C4A4E2E66DB59BB5F3AD8E18D /* YYAsyncLayer-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/YYAsyncLayer"; - sourceTree = ""; - }; - 77CD2F488F82B321858E1115DD4BF105 /* Frameworks */ = { - isa = PBXGroup; - children = ( - BB42235187E716169F4544EE5BC1F115 /* UShareUI.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 7834C94A281300A8F94FADC937A783DA /* ZJScrollPageView */ = { - isa = PBXGroup; - children = ( - 9EE21F66DA87504043B8A7C86F94E1FC /* UIView+ZJFrame.h */, - CD498DA948CE3B9E3856C76E268A95F8 /* UIView+ZJFrame.m */, - 723D37C0E0011CC095BE253816725CA6 /* UIViewController+ZJScrollPageController.h */, - E01B2B13841239604210F7F14F96771F /* UIViewController+ZJScrollPageController.m */, - 2C71009EF54A4F4DB4D6B4BE10B10F34 /* ZJContentView.h */, - 4ECA81B3F9CF5671F90DC6E8881725B1 /* ZJContentView.m */, - 87A39FCC499DC60F3AD5325D6EE2060F /* ZJScrollPageView.h */, - 00804A1A1DF2C2DEB83F41FB728EE48C /* ZJScrollPageView.m */, - A22F604B840D19080E962B03ECAE74C1 /* ZJScrollPageViewDelegate.h */, - F342C67D8302079E15C156D5D674D324 /* ZJScrollSegmentView.h */, - F87EE37990BF8B482F5953FAF5411A7E /* ZJScrollSegmentView.m */, - B07F074D97C92517D644E2C29E02C8C8 /* ZJSegmentStyle.h */, - 7A2EAB51A89FD8CCA3B07A7E73F510B6 /* ZJSegmentStyle.m */, - 3A2E70D45295C469AB76D752A3089B2B /* ZJTitleView.h */, - 90D1DF80221CDD48D614884D9374EF3F /* ZJTitleView.m */, - 97D51B0A5C8666B1F271B0C72128719F /* Support Files */, - ); - path = ZJScrollPageView; - sourceTree = ""; - }; - 78863C9CF316145433A4338CB375743A /* Support Files */ = { - isa = PBXGroup; - children = ( - 96E2389E2858EFBBBE22A0BE6D0A8E79 /* Masonry.xcconfig */, - E652EB54294622C8973F3FB6C4903993 /* Masonry-dummy.m */, - 4D45D169F15014C0D5C6BF92853D8686 /* Masonry-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/Masonry"; - sourceTree = ""; - }; - 78932D5EDA6ECE9DB63BA1C774018EA7 /* Resources */ = { - isa = PBXGroup; - children = ( - F874FD77E56BD26B4C5C7758A1F357C7 /* TZImagePickerController.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - 78BC1D21F699D6D0E04CB8CFA022C962 /* MBProgressHUD */ = { - isa = PBXGroup; - children = ( - C8ADDB23425AE8FD0E37C1B707037C79 /* MBProgressHUD.h */, - F2EF5A9B328255D68D8749D1DC424833 /* MBProgressHUD.m */, - 6348363FBD14083A7075BC521B84189E /* Support Files */, - ); - path = MBProgressHUD; - sourceTree = ""; - }; - 7DB346D0F39D3F0E887471402A8071AB = { - isa = PBXGroup; - children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 4E1851A8ADBE3C97633C0A0207C5DEF9 /* Frameworks */, - BA3F1628290698EB069571262CB8376C /* Pods */, - E0B4D7908B7E5292209E24F2082030E4 /* Products */, - A3BA476580C0D9F6C401BDBB0396548D /* Targets Support Files */, - ); - sourceTree = ""; - }; - 830892F2CC3BCC86C89E2B068CA17082 /* UICKeyChainStore */ = { - isa = PBXGroup; - children = ( - E2951AC3C7F36A27CD10DC136186F761 /* UICKeyChainStore.h */, - E9DCCABDB3C3D7BF839D285C77348268 /* UICKeyChainStore.m */, - 5B142FE2542815D3DCB309FE360921F4 /* Support Files */, - ); - path = UICKeyChainStore; - sourceTree = ""; - }; - 83251F388D3F24FB5C273CB05524B9B4 /* Core */ = { - isa = PBXGroup; - children = ( - AAD06B183B7E1671DC5A854D8DB47EAF /* YYAnimatedImageView.h */, - 616054214C2A180EEFF6667FCFFA3262 /* YYAnimatedImageView.m */, - FB6E31D2C7D4B867E7CCF5397927352B /* YYFrameImage.h */, - EBE6E45C88F154504A9B57EE06FD6C07 /* YYFrameImage.m */, - DE3409D14D7C231F37989DE430640304 /* YYImage.h */, - 6F91F9216AEC900D928FAC8DF17F6B24 /* YYImage.m */, - DAC2536F46DCEABBA8916C12059449F6 /* YYImageCoder.h */, - 731152B3CB8EB179FADE8AD61DFE96E7 /* YYImageCoder.m */, - 7F37E7D3C942466AB58F16EE63D7E28E /* YYSpriteSheetImage.h */, - 602EC22D332F11DA4F99856D7EBE98A6 /* YYSpriteSheetImage.m */, - ); - name = Core; - sourceTree = ""; - }; - 84AEC3EC41ACA99F2EF4A0C57F090E43 /* Support Files */ = { - isa = PBXGroup; - children = ( - 5E438BF4BEB9B7901D34F238BB7F7C91 /* HMEmoticon.xcconfig */, - 7E8212299AC119A1D9F1ADD42A30B7FF /* HMEmoticon-dummy.m */, - F598F0E5AD7DC1A50E0F7C8F49F12515 /* HMEmoticon-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/HMEmoticon"; - sourceTree = ""; - }; - 8601BC132E7CEEBECED08C68F083CFDC /* HMQRCodeScanner */ = { - isa = PBXGroup; - children = ( - 11BD4C690CCA715847ED86957649499A /* HMScanerCardViewController.h */, - 99D8328D1CF55D65BBC02C207521F0D7 /* HMScanerCardViewController.m */, - 0A0C765C78168CE1BF58F4CF1189F739 /* HMScanner.h */, - 846AA219C9AD8C3953FCC34976C430FA /* HMScanner.m */, - C98AD50296926635DE7E049376578798 /* HMScannerBorder.h */, - 8DE5AE88E195687F83D81C7EC20725A2 /* HMScannerBorder.m */, - B9224432A4FA3345BBA89B785672AA62 /* HMScannerController.h */, - EA7C55578789C3FABB216A82744CA3DD /* HMScannerController.m */, - 96130353A2F26AC0C4D283B2173901DA /* HMScannerMaskView.h */, - 6A82DA0B8EFDF97F622E7DD3923C5EE8 /* HMScannerMaskView.m */, - 1C8889B5FEFC5431D539841612835197 /* HMScannerViewController.h */, - 7CF876D689038F6E9030FEA7AAA45AE3 /* HMScannerViewController.m */, - B268F4A1147F0F86F1CD5A8CB6A76EEC /* Resources */, - 15E9AA2904D274227FC1BC48446ABE45 /* Support Files */, - ); - path = HMQRCodeScanner; - sourceTree = ""; - }; - 8648A45901CA1CCB3AE5F64229B66187 /* ReducedWeChat */ = { - isa = PBXGroup; - children = ( - 91BF69C5BBD958E1079A5D580349930D /* UMSocialWechatHandler.h */, - D8AFAA5E8311ED392979DFA249E4473D /* Frameworks */, - ); - name = ReducedWeChat; - sourceTree = ""; - }; - 894FF40CEDD0306B1913E315526BA359 /* Frameworks */ = { - isa = PBXGroup; - children = ( - EEF23E5C6AC348346DA8285056798688 /* libSocialSina.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 8ADB55B00E9C5DF300FA1503C5AA9193 /* Support Files */ = { - isa = PBXGroup; - children = ( - 023C4CC9577CB7E5F8A0CACBC2FF7E12 /* MOFSPickerManager.xcconfig */, - 95D56AE972CAD5F1447C07D0BBB35C92 /* MOFSPickerManager-dummy.m */, - 89184E8EFDBF59682964A79C09B74446 /* MOFSPickerManager-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/MOFSPickerManager"; - sourceTree = ""; - }; - 8AEF3B10C2A802A1B03D9B76D1263ED1 /* Support Files */ = { - isa = PBXGroup; - children = ( - 40F2704B5342C6A3B3E7FD01D3E0EEB7 /* AFNetworking.xcconfig */, - F8B5A5B9684B799689D004846052D51C /* AFNetworking-dummy.m */, - 229B7F36FCD835D22A61D2E7CC90B7E0 /* AFNetworking-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/AFNetworking"; - sourceTree = ""; - }; - 8B84836417E9828877F29BB80B215FF6 /* Core */ = { - isa = PBXGroup; - children = ( - 54334A54E15859D5E5DCED777EC1E290 /* Frameworks */, - 9CB1D3ECA59F5AE57B45AA04FB34A746 /* Resources */, - ); - name = Core; - sourceTree = ""; - }; - 907335F80633B259B1F81C4EA6D837F8 /* Pods-iOSProject */ = { - isa = PBXGroup; - children = ( - AF56D378632660728F7D734B743243CE /* Pods-iOSProject-acknowledgements.markdown */, - AF97720774C04744411F9B823011C29C /* Pods-iOSProject-acknowledgements.plist */, - 52313425657EDC5AB8D7BB5EC8C33668 /* Pods-iOSProject-dummy.m */, - 5C448986E95932C8E76061C5D377B32B /* Pods-iOSProject-frameworks.sh */, - 160CC95B98AE2FBA00DF2E4EA5410A1C /* Pods-iOSProject-resources.sh */, - 4BC60E7EE4E8FED932B19B607D46ECD5 /* Pods-iOSProject.debug.xcconfig */, - 6C56289FC944AEC08D3D4CD1703136A3 /* Pods-iOSProject.release.xcconfig */, - ); - name = "Pods-iOSProject"; - path = "Target Support Files/Pods-iOSProject"; - sourceTree = ""; - }; - 936724C6732CA25B46CB0A39CC719A80 /* Support Files */ = { - isa = PBXGroup; - children = ( - CED4E3E291179745022F34F7B60F876F /* YYImage.xcconfig */, - 1809491F7EE6906ACD46D05326AF9693 /* YYImage-dummy.m */, - 9D8619E43AEC84CFB309710291A655BB /* YYImage-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/YYImage"; - sourceTree = ""; - }; - 949252F0EBDFC611A7A21512B71395AC /* Resources */ = { - isa = PBXGroup; - children = ( - 837D41C6AF10832E4F66F70DA1B81590 /* WeiboSDK.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - 963D98D3CFC245C44CD0D0A552084FC4 /* HMEmoticon */ = { - isa = PBXGroup; - children = ( - 7C42811AB134EBEB0BB6F333E9C79400 /* HMEmoticon.h */, - 7FF6503D5CE126099935102283C2FB96 /* HMEmoticon.m */, - DB6E28C03530C7D88F16ECB119D799A6 /* HMEmoticonAttachment.h */, - 7A134922D87F578222A0C47D4FA8A9D8 /* HMEmoticonAttachment.m */, - 6C0B38101048C1750021153D340AFF5B /* HMEmoticonButton.h */, - 657D0BD0E60B2F4401966AF787F89C10 /* HMEmoticonButton.m */, - 37112105D58885CF692E67995B289BCA /* HMEmoticonCell.h */, - C60FB6E10469C0998260150B0CB15066 /* HMEmoticonCell.m */, - C8493B091ABAFAD6044260858CA7AB1C /* HMEmoticonInputView.h */, - F319BB5CAD5F18506E1C0D395104372A /* HMEmoticonInputView.m */, - 24B5DA25321A4A42BE2857558E6FF1A5 /* HMEmoticonManager.h */, - 0AA8B21DFE43CD9F290F6C8F6D9001F3 /* HMEmoticonManager.m */, - 70DB5BDBFDA994701594468414E70873 /* HMEmoticonPackage.h */, - 09D6485A2092909A8D24790F5696CB31 /* HMEmoticonPackage.m */, - 79B786935968F91659410E8D541C2BE6 /* HMEmoticonTextView.h */, - 0BC07B5F152D297A3282C37424F4116D /* HMEmoticonTextView.m */, - F013A62FBCDA60BA85A0E76F8601EC62 /* HMEmoticonTipView.h */, - 28D9AD1C76B43E04E0B7F8A1375AA58F /* HMEmoticonTipView.m */, - 27584B3B58CC2FA142B0267FC6512F5E /* HMEmoticonToolbar.h */, - CA4174F7C9D7FE7F4B092CE3335EAEB1 /* HMEmoticonToolbar.m */, - 36A30E0722E147FAF9FAAEC5FCF220F4 /* NSBundle+HMEmoticon.h */, - 836836CA6D3F03D96B7730D86E1CB4F7 /* NSBundle+HMEmoticon.m */, - 1E344AE4EC41ADCB5B47512BCDEB3E95 /* NSString+HMEmoji.h */, - A777E2AE95FB5E00503CF13FDC64E6AB /* NSString+HMEmoji.m */, - 88A59317FE11D5F45DBFE398732786F0 /* UIImage+HMEmoticon.h */, - 3F7A0498916C233871F3361E6F723709 /* UIImage+HMEmoticon.m */, - B83A8F171526460B5FE62A3E14289EB8 /* Resources */, - 84AEC3EC41ACA99F2EF4A0C57F090E43 /* Support Files */, - ); - path = HMEmoticon; - sourceTree = ""; - }; - 97D51B0A5C8666B1F271B0C72128719F /* Support Files */ = { - isa = PBXGroup; - children = ( - 00E022313FC07DC246814838B5508BD9 /* ZJScrollPageView.xcconfig */, - 25C5889608B88CF85C7E02CB64D3E806 /* ZJScrollPageView-dummy.m */, - 01BA20968ECD06E6A7C6C469FC1C6C69 /* ZJScrollPageView-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/ZJScrollPageView"; - sourceTree = ""; - }; - 9C3E687076060298532E62A25DB19665 /* Support Files */ = { - isa = PBXGroup; - children = ( - 878A686D826B5CD6CE34C33FE3152FA0 /* TZImagePickerController.xcconfig */, - 376E611E7554508960AE7A8CC964AEDD /* TZImagePickerController-dummy.m */, - 658411AF6A74942DE6218CF6396E69F6 /* TZImagePickerController-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/TZImagePickerController"; - sourceTree = ""; - }; - 9CB1D3ECA59F5AE57B45AA04FB34A746 /* Resources */ = { - isa = PBXGroup; - children = ( - 75EA44527183DB95CFA18D4ECA1FFD79 /* UMSocialSDKPromptResources.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - 9D455DA4605AB33FBF89F542007EE81D /* M13ProgressSuite */ = { - isa = PBXGroup; - children = ( - 963CAF06FDF246AC115C91C99DD862E8 /* M13ProgressConsole.h */, - 07709766C62F078D0712AED1EF7BCAE2 /* M13ProgressConsole.m */, - 64CDF2B74590D417E77483B0557C395D /* M13ProgressHUD.h */, - E4ABF11ED3AF7DE8100A6DD26AE00226 /* M13ProgressHUD.m */, - DC44859CBA28F8EA574DB5CE062C685F /* M13ProgressView.h */, - E49865B0E17A3021437F96B154D96D7B /* M13ProgressView.m */, - E04361DD95A2E79F600320FA1F8F170B /* M13ProgressViewBar.h */, - A80EBFE3D040C675CB28E4150713A0A0 /* M13ProgressViewBar.m */, - 32A67E99FAFE3D33F5C74F52AF4C9A38 /* M13ProgressViewBorderedBar.h */, - 9E22E77F4551FB4B00ED0081853DE7D8 /* M13ProgressViewBorderedBar.m */, - 96197C2131E4EAE7DD8A46EBFD9F806A /* M13ProgressViewFilteredImage.h */, - 1325A6A04B4183FCAA94EB1EC095693E /* M13ProgressViewFilteredImage.m */, - 3F56D148B50DC60B1FA459981F027070 /* M13ProgressViewImage.h */, - 90C10DE39B0CED5F660E686C0701D4A2 /* M13ProgressViewImage.m */, - 2A09DBE8FA9BAA2EA404827D3B0FCA9E /* M13ProgressViewLetterpress.h */, - 74E82C3ACA672B9D99875AED2D00DDE2 /* M13ProgressViewLetterpress.m */, - BB46940BF9718153BFF8816AF87101A6 /* M13ProgressViewMetro.h */, - F4A758CBD50F53938C1EA8864CF9732B /* M13ProgressViewMetro.m */, - 3F90DE8A5EFF4F5A88960322DBD3DAE0 /* M13ProgressViewMetroDotPolygon.h */, - 972B7A93BEE915F435C8D41C813E6C8F /* M13ProgressViewMetroDotPolygon.m */, - FF646CF3EF8EF32A3B4A758C694C8F5D /* M13ProgressViewPie.h */, - BE280BA53112A96F310420776A78E6D7 /* M13ProgressViewPie.m */, - 1C86828CC51CDE0A5996A774CAE23B46 /* M13ProgressViewRadiative.h */, - 9666A17BF647274684CBA7A3CD099F1D /* M13ProgressViewRadiative.m */, - 4A7F8B5CD8F574C6537622DB7AA459CA /* M13ProgressViewRing.h */, - 5AFA40940EB9DBE725360C223ADB5550 /* M13ProgressViewRing.m */, - 1D2F73D1100411165702F071A2405DFD /* M13ProgressViewSegmentedBar.h */, - E24FBC0B316FBF1EEC175AD3C425DFDA /* M13ProgressViewSegmentedBar.m */, - F7A92E7DD6A360DB4542FDF826D1EF40 /* M13ProgressViewSegmentedRing.h */, - CA7FCAEA592B83C9113FEE8D9C06AE41 /* M13ProgressViewSegmentedRing.m */, - 17D5CED96DEC6FD427A9E41F007F20E5 /* M13ProgressViewStripedBar.h */, - E2366AE40114E5F92A6EFABE706E86CC /* M13ProgressViewStripedBar.m */, - 6907255A28D24C41C7A558CF3CE783E8 /* UIApplication+M13ProgressSuite.h */, - 5F515A320FEDD07E998069523FCCAC17 /* UIApplication+M13ProgressSuite.m */, - 386BF5D8CA58DF95AED3B5C8164EEB56 /* UIImage+ImageEffects.h */, - B8D0B2BF62814A9210751C2106B13DED /* UIImage+ImageEffects.m */, - 4BCF20A5415D3CB162A199DC3FF6781C /* UINavigationController+M13ProgressViewBar.h */, - 1986E9400068DB3E067D656307FE950F /* UINavigationController+M13ProgressViewBar.m */, - 23A13230B8A997F8700BCB18015CD927 /* Support Files */, - ); - path = M13ProgressSuite; - sourceTree = ""; - }; - A255545CF4F3AF16CE7D7AEB55EB4F5A /* iOS */ = { - isa = PBXGroup; - children = ( - EF6DBAEB7CEF3E6BBA0ADAC20DCDD1F8 /* Accelerate.framework */, - F01F59E9E9E5D8EABD190F4954B8E8ED /* AssetsLibrary.framework */, - 09EB2BB890544D6A6555E6A5CEB513D6 /* AVFoundation.framework */, - E4230BD2D890B5A02D7C2B474B002084 /* CFNetwork.framework */, - 13E1FA4A5CFFBCD4C3C81BA77009FC14 /* CoreFoundation.framework */, - F34AC312E1C9471400CACC421C8DD04C /* CoreGraphics.framework */, - BAB6C2DC371C13844619BA332C5074FE /* CoreImage.framework */, - DCE7E808EF0C8820E9A3408AB0953738 /* CoreText.framework */, - E77C2F90794FBDECB7F99F7754EDFC88 /* Foundation.framework */, - 88E82B140EA99038E1AFB7EC301C91B2 /* ImageIO.framework */, - BDD0F90A15F131F24E8DBAA03085A37A /* LocalAuthentication.framework */, - F3CEABA08CDCFD39F7C438F7A0AB9740 /* MediaPlayer.framework */, - 1A56F90BCB402100D8F205FD69ED7973 /* MobileCoreServices.framework */, - 85EA4ACB7B84D0B5CAECB523A132C6AB /* Photos.framework */, - F5871709D11652AC0F4564CE2EC23D82 /* QuartzCore.framework */, - C04096FC91CE40B6991D04A9CFF0A18A /* Security.framework */, - 4BE8106C13A82B213FE63A220B4F9394 /* SystemConfiguration.framework */, - 00EDA9D816D2D502A4743DD472656085 /* UIKit.framework */, - E790A5DCC08463F86F12E23CA4289C30 /* WebKit.framework */, - ); - name = iOS; - sourceTree = ""; - }; - A32699401164C8F0F7AF82D749478496 /* YYAsyncLayer */ = { - isa = PBXGroup; - children = ( - 0535A6E99C084C2B06C2EBE0CB8A5EA2 /* YYAsyncLayer.h */, - 3F86D364B0C24E6411FBD679DD0E619A /* YYAsyncLayer.m */, - D75EB3ADB8BFF8779BC1C9CDD3F32B32 /* YYSentinel.h */, - E62D6DA770E3C8DF3B9F2CC678B53305 /* YYSentinel.m */, - 4BF9E2016048033CBB2FFA2BDF531BC1 /* YYTransaction.h */, - FB426B4B7E37EF030D11702F62CE2029 /* YYTransaction.m */, - 7731300CE93B61ED71286C3A10C3A24F /* Support Files */, - ); - path = YYAsyncLayer; - sourceTree = ""; - }; - A395B67BB45A95DFD0166BC9BD37CEC4 /* Reachability */ = { - isa = PBXGroup; - children = ( - 858458E87A836152AFF15601508CB689 /* Reachability.h */, - 39150030131DCE5B741A6BCF703EB72C /* Reachability.m */, - 6537E5341D8ACC3949F402167D0A59FA /* Support Files */, - ); - path = Reachability; - sourceTree = ""; - }; - A3BA476580C0D9F6C401BDBB0396548D /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - 907335F80633B259B1F81C4EA6D837F8 /* Pods-iOSProject */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - A40B450970BA620320469097C3FF077B /* Support Files */ = { - isa = PBXGroup; - children = ( - 928536D1C6ACBCC3D0DC9C4F222979F1 /* FDFullscreenPopGesture.xcconfig */, - 4592E7448E71600432AF62B752E8F68C /* FDFullscreenPopGesture-dummy.m */, - 805139F0F604BBFBA1CA5DF8CE9B2877 /* FDFullscreenPopGesture-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/FDFullscreenPopGesture"; - sourceTree = ""; - }; - A4DC6ABD3A0C99BAF2F7F987FE41B37D /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8329D81ACDFE123ABD8E650CE5D5DA1E /* libSocialQQ.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - A8E612B93C607AF99FD5052E58E4AFE9 /* CloudFiles */ = { - isa = PBXGroup; - children = ( - 9F60334DC40582E5840C3C33C780C962 /* ASICloudFilesCDNRequest.h */, - AF7F7E239A9FE1CE65DB4E37333C5182 /* ASICloudFilesCDNRequest.m */, - 181C5747E232624E725EEF6347BE2782 /* ASICloudFilesContainer.h */, - BB20416582DF011644A3E5CC3E1E2BE3 /* ASICloudFilesContainer.m */, - 68D94A49E92917958FF339CC47578244 /* ASICloudFilesContainerRequest.h */, - 9C97EF58930E6CCC8CAA6D63FED4CD53 /* ASICloudFilesContainerRequest.m */, - 889A65E897585299D32585E0E294A8C0 /* ASICloudFilesContainerXMLParserDelegate.h */, - 35E12FD87666C01C6212FF779A816FE3 /* ASICloudFilesContainerXMLParserDelegate.m */, - ED1AA238B33BED792F6B66C19D9C995F /* ASICloudFilesObject.h */, - F9BA36B729727D0B4BA20B59C7D01A83 /* ASICloudFilesObject.m */, - 820E857FA0AEA6F2BCBBA1D90FCD0C3B /* ASICloudFilesObjectRequest.h */, - 4A5B580837E3442E0B7FF3BC3976DFEB /* ASICloudFilesObjectRequest.m */, - 7D6710E98DF308484487D266C607F8F5 /* ASICloudFilesRequest.h */, - 898FB3B98A4E9F506A5B19DA7EFB124B /* ASICloudFilesRequest.m */, - E1AD8649AE776041AC6080AC3A78C9A0 /* ASINSXMLParserCompat.h */, - ); - name = CloudFiles; - sourceTree = ""; - }; - AAFD24CFE2DB4010B9C703F25A36F7AE /* ReducedQQ */ = { - isa = PBXGroup; - children = ( - 687719BE12B3EE3050383D964C71E42B /* UMSocialQQHandler.h */, - A4DC6ABD3A0C99BAF2F7F987FE41B37D /* Frameworks */, - ); - name = ReducedQQ; - sourceTree = ""; - }; - AD5ACE6BBE6DA4B025FD47AE0C17E7E6 /* Resources */ = { - isa = PBXGroup; - children = ( - 62BD954F90E291411F1BBDBE77FA6446 /* mapapi.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - AE90A720F3F577E0FE5920AA4D456F9F /* Reachability */ = { - isa = PBXGroup; - children = ( - B7B6F69431CB1AB8590D539666BA1CBF /* AFNetworkReachabilityManager.h */, - DF7859AD9FCF8D5D9A3C2A3202B969B4 /* AFNetworkReachabilityManager.m */, - ); - name = Reachability; - sourceTree = ""; - }; - AF6BB537BB7387BD2FCB1657499BCA76 /* Core */ = { - isa = PBXGroup; - children = ( - A1241B4C4C1FAB0163D05E3A3BF6B4CF /* NSData+ImageContentType.h */, - C5515127AAF151594AEC4AAE86A700A6 /* NSData+ImageContentType.m */, - 6150F3150DD46F840DD43FAA845733E6 /* NSImage+WebCache.h */, - 8D3AAE460ECC00ADD498963FDF7650E0 /* NSImage+WebCache.m */, - F2BE00B4BBBCF3F78526A4EA7A421121 /* SDImageCache.h */, - 62F6BC0BC8A6BD2BE8B8A67822F162C6 /* SDImageCache.m */, - 723C8A2359030A14743D8A463F83322D /* SDImageCacheConfig.h */, - 149368EE975530009F2A6A30E87EE969 /* SDImageCacheConfig.m */, - AEFD60B9E6C72E511FC2498ACF3DA4C1 /* SDWebImageCoder.h */, - 1B8706D66A8CB70653005CB4910F1194 /* SDWebImageCoder.m */, - FC10A478D3C23161950BC7BED2403715 /* SDWebImageCoderHelper.h */, - 834769C7A5D1752C1177897B62EFC999 /* SDWebImageCoderHelper.m */, - 82C1A6930B5503E5FF3B94BA51FD9310 /* SDWebImageCodersManager.h */, - 3FC249F4CE2C9101B221059AC15BAE5B /* SDWebImageCodersManager.m */, - 4586FC5846E73EE1EAB3D5199F98B6DC /* SDWebImageCompat.h */, - 411BD4C6AFD29EC701C3AB1C32B17537 /* SDWebImageCompat.m */, - 09CE9BC0AF0C802777F6D69FF01A2699 /* SDWebImageDownloader.h */, - CBC7119C4211A824CD0EA7AF22DD523B /* SDWebImageDownloader.m */, - 37C879A74B09A3DC3588B9BD7A609C84 /* SDWebImageDownloaderOperation.h */, - 37DFF12B9AA9EDE5E2532087F5B1E9D1 /* SDWebImageDownloaderOperation.m */, - 5CE78575F484C9556087F5799E026B14 /* SDWebImageFrame.h */, - 578F22B2ED2327A4E20E49D7B4C4D8C4 /* SDWebImageFrame.m */, - 616B540C1CBB33C3D622B9A91B8E447F /* SDWebImageGIFCoder.h */, - 10B3D94C627D087A3D2147FB5378FA03 /* SDWebImageGIFCoder.m */, - 835D7DB3E8BEF0E2968FC9808AC5CC92 /* SDWebImageImageIOCoder.h */, - B7979D2F763F637BF0A8FAE3B93AF8CE /* SDWebImageImageIOCoder.m */, - FDA08F10F27A1DDE4DB27F6392DC500E /* SDWebImageManager.h */, - AE6177E60B9D4FA2C3C684EEC9E9AA94 /* SDWebImageManager.m */, - 8349CE1F55F82141AA7EEBC0926DBD12 /* SDWebImageOperation.h */, - 711A3553D661350700DC15B69CDEF655 /* SDWebImagePrefetcher.h */, - 5E729ECD06AC0AC67CE15607887CFB60 /* SDWebImagePrefetcher.m */, - 1AB040A0795B9BF944B255F2BF1A054C /* UIButton+WebCache.h */, - 6EB84E4F71F1A20373C5927F16B9C3BD /* UIButton+WebCache.m */, - 1FCF2E7D6D6233B980D4BBF9D9CEE81D /* UIImage+ForceDecode.h */, - 49D863896AE8FDD6F71F6919EE319181 /* UIImage+ForceDecode.m */, - F1099ACE2D34FFD8D5E628315D88AFF8 /* UIImage+GIF.h */, - 82F221262275DA2601458C534C50FAF4 /* UIImage+GIF.m */, - C6CFE3543084BBA2BCFFF7B7D4E9D7FB /* UIImage+MultiFormat.h */, - FF7F1C10A7E7EE3B2022487B7830384D /* UIImage+MultiFormat.m */, - 45B081E1FC4211E6FE014D6829F9733E /* UIImageView+HighlightedWebCache.h */, - 4EB49719C67E66CBADC0406E00899A41 /* UIImageView+HighlightedWebCache.m */, - 2CC3905753CA39110BB71FBF85DF2FEC /* UIImageView+WebCache.h */, - 8674EA2A09213456DE2CA226AB6F3157 /* UIImageView+WebCache.m */, - EC55195132A8AD00DB092FC5167432CC /* UIView+WebCache.h */, - 0FF9B42F97E3E4D8900456D85CFFD5BC /* UIView+WebCache.m */, - 09BE95EB07D408FB91D66EC3A1A5CF90 /* UIView+WebCacheOperation.h */, - 60A505C8E06B1775743CD5DA29EA83FF /* UIView+WebCacheOperation.m */, - ); - name = Core; - sourceTree = ""; - }; - B268F4A1147F0F86F1CD5A8CB6A76EEC /* Resources */ = { - isa = PBXGroup; - children = ( - 8A61B5655C952B41B0F030EBEB156CBA /* HMScanner.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - B41A360D8BDBA98F2B08F7EF352C2B8A /* FCUUID */ = { - isa = PBXGroup; - children = ( - 2FBA809DCC713C050568DD18E2485752 /* FCUUID.h */, - D9BDC5C8A446EADAEDA5463EBB93D6BF /* FCUUID.m */, - 838214E5745FE9BEBD09000EA5D65ABD /* UIDevice+FCUUID.h */, - C68109483041F5637F46917C4C46E50E /* UIDevice+FCUUID.m */, - CFD05FF2233BF504B8D2A311FB3F685D /* Support Files */, - ); - path = FCUUID; - sourceTree = ""; - }; - B83A8F171526460B5FE62A3E14289EB8 /* Resources */ = { - isa = PBXGroup; - children = ( - 09251D836AB765B4EB13C20590AB7BCB /* HMEmoticon.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - BA3F1628290698EB069571262CB8376C /* Pods */ = { - isa = PBXGroup; - children = ( - 73579AEB38B788B5686BE3FD421510FE /* AFNetworking */, - D1ED872AAC2B671D0B87341726D6B926 /* ASIHTTPRequest */, - C0AEF456F82A9A1074C76A4C52A8D05D /* BaiduMapKit */, - 1EBBCCB868C18B4F3B2FB4D3C14B400D /* CYLTabBarController */, - 46DDD468DB0F54C3D7F8031A89D7836E /* DWBubbleMenuButton */, - B41A360D8BDBA98F2B08F7EF352C2B8A /* FCUUID */, - F103B33EF425D9B455FA4BC08CE02AD0 /* FDFullscreenPopGesture */, - 7422E9EC1CE80B6695044412D323808B /* FMDB */, - 6723AA731B800F78F9B22416301D6250 /* GVUserDefaults */, - 963D98D3CFC245C44CD0D0A552084FC4 /* HMEmoticon */, - 8601BC132E7CEEBECED08C68F083CFDC /* HMQRCodeScanner */, - D6DD6D6629ABB93B0AE72FC4E5230835 /* iflyMSC */, - E2E11E95E32110B43C2A32F8EEC26944 /* IQKeyboardManager */, - 2C42EC2FAFC2466747E2168F48BF51D6 /* KILabel */, - 684319EF1E382AC479981B513887769E /* LxGridView */, - 9D455DA4605AB33FBF89F542007EE81D /* M13ProgressSuite */, - C8121C4A3C9D2EF702D05BBE10236A58 /* MagicWindowSDK */, - 3DA651348A2678E249A427E6E3FC7385 /* Masonry */, - 78BC1D21F699D6D0E04CB8CFA022C962 /* MBProgressHUD */, - 0FC7F41A02E3BD9E934D4FA69774FCAD /* MJExtension */, - C30B0C8B1AEE9C7890012836BC1C391F /* MJRefresh */, - 2B274B8803B8D101017ADDA567D62B23 /* MOFSPickerManager */, - A395B67BB45A95DFD0166BC9BD37CEC4 /* Reachability */, - 6824D23F086CBE41AD2422066DE9DFC9 /* SDCycleScrollView */, - CE5BC7ACAFDE4CF44034540993928FCD /* SDWebImage */, - 4CB877E8C61173E1D23DDF89DD6489E9 /* TDTouchID */, - 4A6F8E73AAAB93A05C9FC834102C6CC9 /* Toast */, - CBE5300F4974C32647DD18740D293745 /* TZImagePickerController */, - 830892F2CC3BCC86C89E2B068CA17082 /* UICKeyChainStore */, - C35E8A08665D1350CC36FA3860196E09 /* UMengAnalytics */, - 1DB5C3B9CDF2FAC2D526109A0E67B18E /* UMengUShare */, - 19F4B6FCD9AB01AAE6B0C11480FFF727 /* WebViewJavascriptBridge */, - E4E25887D3B2B0D4A6A796E30DB607B3 /* WechatOpenSDK */, - A32699401164C8F0F7AF82D749478496 /* YYAsyncLayer */, - 74A040836D44E409C3EFB0C121DB7F93 /* YYCategories */, - E691EC5E8E38D5FCB18AFDCEF7677977 /* YYImage */, - 25346C38C126C6A0081A5A878341BE12 /* YYText */, - 67C079D1C9B1B95C531DAA0D6DD93A20 /* ZFDownload */, - 6BAF021DB8D1F8F3ADE9669411F9F170 /* ZFPlayer */, - 7834C94A281300A8F94FADC937A783DA /* ZJScrollPageView */, - ); - name = Pods; - sourceTree = ""; - }; - BE3660D96B6467FD83E2871A5EE9CCA4 /* no-arc */ = { - isa = PBXGroup; - children = ( - BF00D6726BF4FEFEBEABA6ED4735E8FA /* NSObject+YYAddForARC.h */, - 65E63F3FD5902987B7EEBC76F1DDBD74 /* NSObject+YYAddForARC.m */, - 4CDBC8B0D0C36C5BA8F374B00AEECCF6 /* NSThread+YYAdd.h */, - B9A61749C05FC41C56BCBFCE5B440DAF /* NSThread+YYAdd.m */, - ); - name = "no-arc"; - sourceTree = ""; - }; - BF87A1F102D1F9D5D9527CF2C71F099A /* Network */ = { - isa = PBXGroup; - children = ( - ECEEAE4C01D76A4F2A5E7CE2BE1E1F0A /* Frameworks */, - ); - name = Network; - sourceTree = ""; - }; - C015CE9D14000C3E858EADE1B33BC7DC /* Support Files */ = { - isa = PBXGroup; - children = ( - 2EB1C2161FB529386F2B945D7DFB6627 /* YYCategories.xcconfig */, - 4A7B0E469DA766E168AE1E1F39E2077F /* YYCategories-dummy.m */, - 212FF0C33765D441889A0A894499608C /* YYCategories-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/YYCategories"; - sourceTree = ""; - }; - C0AEF456F82A9A1074C76A4C52A8D05D /* BaiduMapKit */ = { - isa = PBXGroup; - children = ( - 4F2E943FC93B46DA65D77ED338CC83F6 /* BMKActionPaopaoView.h */, - EC31AC91F513FAE2B6676DBB3C98CF29 /* BMKAnnotation.h */, - D5DCE39B3EE32DB29F81A3A8F0739156 /* BMKAnnotationView.h */, - 978C47FABAE17B50FA1401E468B7FF9D /* BMKArcline.h */, - B6A54290DB1B3C0A9156C3D75AB7673F /* BMKArclineView.h */, - 46225F936A05E21E797072A324BC1F46 /* BMKBaseComponent.h */, - F6CD4886EAA634DAF6C5448D3B51970C /* BMKBaseIndoorMapInfo.h */, - E598105AA2E0055D66981E4607DE8573 /* BMKBusLineSearch.h */, - 598FA6A04D58841119AD2914D139748B /* BMKBusLineSearchOption.h */, - FB18F429F2175A81FB358B7C3AAA3F16 /* BMKCircle.h */, - 97D526A0F5203B61F13149E89A44323A /* BMKCircleView.h */, - 8E55B14473EEF98BD17CEA79086C2E50 /* BMKCloudPOIList.h */, - D4E7D7F36CE6034AF50178B59FF1016A /* BMKCloudSearch.h */, - 3882ECEEB940692306090D44BA97408E /* BMKCloudSearchComponent.h */, - 0C98419A03ABBAF14B4848662D28663C /* BMKCloudSearchInfo.h */, - CAC3C1C1A60503937CB2890F64848127 /* BMKCloudVersion.h */, - 152D5A3E030B920CB1B67DBF5E6595B9 /* BMKDistrictSearch.h */, - 9981C0BE9286CDAFB514DC9DCEAED7C2 /* BMKFavPoiInfo.h */, - 8723512E1088A6DED9A3CB75EDEA929A /* BMKFavPoiManager.h */, - 3F3858BFB8D4C6C65B45044E910C4F6C /* BMKGeneralDelegate.h */, - 00C2335B7BC1D5ECECBDEB53CD04F3B1 /* BMKGeocodeSearch.h */, - A44A24FDB7B8D3FD947BB43FCF4268DC /* BMKGeocodeSearchOption.h */, - 388A3D4E626D16D2FFC3D4ACC2877016 /* BMKGeocodeType.h */, - 971DE64AD3DF111442CD2986B27AE91C /* BMKGeometry.h */, - 46CDE033B21D92EEA829B7D90EA5D866 /* BMKGradient.h */, - 19C654510C6C4D312FE2CED00534C7D3 /* BMKGroundOverlay.h */, - ECD59E946768500B6621358FABA1678C /* BMKGroundOverlayView.h */, - 82F1D01FB7AFE09B11119768CC2E423F /* BMKHeatMap.h */, - 23EDE043C83BA88486BB596E398260CF /* BMKLocationComponent.h */, - 2E43A5920D5114A2C2373A720201B659 /* BMKLocationService.h */, - C03ADD5D4AA353860861070DA18F2F01 /* BMKLocationVersion.h */, - 4E2B34688FA008B5631B594362A4B865 /* BMKLocationViewDisplayParam.h */, - 05461D33462B58C6CAEB5296CEF40314 /* BMKMapComponent.h */, - 1CFF73EFEE36A5D85DF2EC79CEFE2E8A /* BMKMapManager.h */, - F4A0611096A004BB4310549F32789EFA /* BMKMapStatus.h */, - 7515224E8E29ECAE1392EA169B8E760D /* BMKMapVersion.h */, - 044CB32193A74917C321AD0A10B612D3 /* BMKMapView.h */, - 61E8CE13F8E04628F8AAB85AC43F0BC7 /* BMKMultiPoint.h */, - 9B63CA319398D2602FDA50048EA1A84B /* BMKNavigation.h */, - 927B8BB33759614C9564AC367A832230 /* BMKOfflineMap.h */, - E0174ED2E174086D42F530876E0E9FEA /* BMKOfflineMapType.h */, - 1EE977CAC994CD42956C9D2AFDCF7C3B /* BMKOpenOption.h */, - 72A1731853B7BE82F471C795E3A33612 /* BMKOpenPanorama.h */, - C88DA684D2E09FF64159D6692174F821 /* BMKOpenPoi.h */, - 9C84517C38768FC987E319DA6E7892EE /* BMKOpenPoiOption.h */, - D2275338BA59EB642B6C797797DC81D2 /* BMKOpenRoute.h */, - 183FD1C716DA1C48DC0131CC3E217B67 /* BMKOpenRouteOption.h */, - 771DEDA94B416D0F47972164D65F23EA /* BMKOverlay.h */, - 81D1FE4DD10E7BC42C567A3CDA273314 /* BMKOverlayGLBasicView.h */, - 0CEB024F16F81EF26966E8EBD844DEBF /* BMKOverlayPathView.h */, - 61843CD8F09FBA7CF403BCC05D33BA62 /* BMKOverlayView.h */, - 7DDE576222B6214DF4C7F57EB7D77DFC /* BMKPinAnnotationView.h */, - F4A2592D9454BC58A3D22CE3F2D6DEA7 /* BMKPointAnnotation.h */, - EA23106A230033A453CCFABE8E2F3EAE /* BMKPoiSearch.h */, - 77C02733674F84530B1378C076717D9A /* BMKPoiSearchOption.h */, - CD817388507D7FDB70C67912A8670D2C /* BMKPoiSearchType.h */, - 14BE48AB74B30AE1814DCDD4B8D4DCFF /* BMKPolygon.h */, - F629125664F1602B7ACCBDD69B1C2589 /* BMKPolygonView.h */, - 5B21BD8AD289FC14222CEF5D51B7AE00 /* BMKPolyline.h */, - 70947D4FB20E4D893C5DF889839EC551 /* BMKPolylineView.h */, - 86070A01EE63C0EE45CB578B885812C8 /* BMKRadarComponent.h */, - E63BB8B8D760F528A339C365EC818878 /* BMKRadarManager.h */, - 688F15D55EFC65486396874256C3AF97 /* BMKRadarOption.h */, - E50D52985D25AC6E32F36B75F726F4D0 /* BMKRadarResult.h */, - B762D82AC8E941BDEA95C952BA99C239 /* BMKRadarVersion.h */, - 45002705BC7338D6F7750C5804E2646F /* BMKRouteSearch.h */, - 58CA64EB1FA511FB7726592383FF9AFA /* BMKRouteSearchOption.h */, - 7BD99D6C53EB0267B77830604A533909 /* BMKRouteSearchType.h */, - 11D1B2E44091F2CF9E8FB28EFA74782D /* BMKSearchBase.h */, - FEFF2E3597811870854E0079D617BD20 /* BMKSearchComponent.h */, - F8A55E0CEAD8B5103CBB65E63409C887 /* BMKSearchVersion.h */, - 382FD13E4C98FB28B10B4A7C8707DFDC /* BMKShape.h */, - 32B9B3125F87B726C421B0DC395C7790 /* BMKShareURLSearch.h */, - 617C4C14104EE1854D08AB83CAAD8C2E /* BMKShareUrlSearchOption.h */, - CE21E6472F04525948979D760BEC45BA /* BMKSuggestionSearch.h */, - AD73CC2EAF5D6A818E00F87EE2142B72 /* BMKSuggestionSearchOption.h */, - 2A6A421E372666B626776FE143A6EB39 /* BMKTileLayer.h */, - 65E54B7FA06BAF3ED3D17A42A70DBADA /* BMKTileLayerView.h */, - F2566BA4ED67A4DFC4907B906E163E6D /* BMKTypes.h */, - 504D8B47515545DBCC16F7B867D0A612 /* BMKUserLocation.h */, - 179C1848315B94F71DE6C5A8A1076B2C /* BMKUtilsComponent.h */, - 8D5A700F0142106AE9EE9119D77E7BEA /* BMKUtilsVersion.h */, - 4676C38F5C6FABDA1DC8F87BAE771B09 /* BMKVersion.h */, - DB846F63E6FC8F827E9F3D3D506BA8E6 /* Frameworks */, - AD5ACE6BBE6DA4B025FD47AE0C17E7E6 /* Resources */, - ); - path = BaiduMapKit; - sourceTree = ""; - }; - C30B0C8B1AEE9C7890012836BC1C391F /* MJRefresh */ = { - isa = PBXGroup; - children = ( - 928E2B8EFD048DDCFDED1C6B326B3610 /* MJRefresh.h */, - 1902867C791F9F9BA6E5F6FC26517BCA /* MJRefreshAutoFooter.h */, - 8B37278A9F6380B135BB4CD0F58CB7A7 /* MJRefreshAutoFooter.m */, - B7A46EEAF5B07F8DE4BC0A75CA833A0E /* MJRefreshAutoGifFooter.h */, - 77E4EDFA4227198F220DEE9FEBAE5ED8 /* MJRefreshAutoGifFooter.m */, - E50FEE149C07C320B43A9DE892D8A0CF /* MJRefreshAutoNormalFooter.h */, - DF2C714C40FD7B32455999DB84EC2A0B /* MJRefreshAutoNormalFooter.m */, - C733E41935B85103D48AB3FF8247211F /* MJRefreshAutoStateFooter.h */, - 6F66D09EEC30C497C0047C58E232ABCA /* MJRefreshAutoStateFooter.m */, - D027DBECC2B7E30C2D968BA0C26CFF9A /* MJRefreshBackFooter.h */, - 8F941C586C6F190BA180C2DF570A959A /* MJRefreshBackFooter.m */, - 147A74010AB23752331523AE50342658 /* MJRefreshBackGifFooter.h */, - 9A50DC3DB07280449145748D5AC12959 /* MJRefreshBackGifFooter.m */, - E6A49E4FA47367B244B954AFBDB47FEC /* MJRefreshBackNormalFooter.h */, - C91D64ED65F125A48C77B0341F50B98D /* MJRefreshBackNormalFooter.m */, - BAA7581F8CEE180BEA98039E8FF41CDF /* MJRefreshBackStateFooter.h */, - 1B435BD95081871A2E057C3F9F5689F8 /* MJRefreshBackStateFooter.m */, - E2AB052EB8FE7BF466E75F13C92D021E /* MJRefreshComponent.h */, - D845C9D31C13C1EC374B7B3744F75F8B /* MJRefreshComponent.m */, - B8D16A905F8322D99CB33522D6334B9C /* MJRefreshConst.h */, - 06237DE26B0BAC06B73089E0A9B28B32 /* MJRefreshConst.m */, - 2093B87350850B95D168886873AB99E9 /* MJRefreshFooter.h */, - 07ADBC18852169F59915CE309643D077 /* MJRefreshFooter.m */, - 9B19C255AF9C9F46B6A854B7A95EB0D0 /* MJRefreshGifHeader.h */, - 0F54987B1668C79EFE99199DC9097569 /* MJRefreshGifHeader.m */, - FD38D97321405B64F47430E1380AD1F7 /* MJRefreshHeader.h */, - 6AA561E62E1A699F737E182D351E7C23 /* MJRefreshHeader.m */, - 8E25218D47A79CC35EBF6E2B65534E0D /* MJRefreshNormalHeader.h */, - 9A9FADFA65C3CAF11B0CFE468E9A5D43 /* MJRefreshNormalHeader.m */, - 86BF5306FAF1B363933A99C3F9A39D92 /* MJRefreshStateHeader.h */, - BE7CC8625902334CF2F1BEA59955B8A5 /* MJRefreshStateHeader.m */, - 046432722C1F2197151D62219498F9EB /* NSBundle+MJRefresh.h */, - 9C644483AAFFA869AC8985C917A08923 /* NSBundle+MJRefresh.m */, - 07F3FF708DA1F87CAED9B8493747FADA /* UIScrollView+MJExtension.h */, - 197B51C963997017C2D740A82FC30B50 /* UIScrollView+MJExtension.m */, - 9170E0800F85B07540547A48787B562D /* UIScrollView+MJRefresh.h */, - 3693E4C9E6D5A593369CFA3B5BA1F919 /* UIScrollView+MJRefresh.m */, - 900771E247DD0F0F938E07AB63BBF51C /* UIView+MJExtension.h */, - 35CCCDF9F83091A7172ADF28D28CFD09 /* UIView+MJExtension.m */, - 422B7574BFC64D7F63B102CF19EA5ED0 /* Resources */, - E1B6FCE5D374575A89F0E263CF4CB2E3 /* Support Files */, - ); - path = MJRefresh; - sourceTree = ""; - }; - C35E8A08665D1350CC36FA3860196E09 /* UMengAnalytics */ = { - isa = PBXGroup; - children = ( - 3613072690ECB983A2AB97ECBCF731D2 /* Frameworks */, - ); - path = UMengAnalytics; - sourceTree = ""; - }; - C60DE3E2D925A5A8A53B082F23C1DE15 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 0549F37D6BD368263C3343FAB9AEF1B2 /* iflyMSC.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - C8121C4A3C9D2EF702D05BBE10236A58 /* MagicWindowSDK */ = { - isa = PBXGroup; - children = ( - 0DBA354C7658DE536B57DF1637A6C6D2 /* MWApi.h */, - 8354BEB75032E57CB018D23E5083B079 /* MWApiObject.h */, - C5B61B464F7D6D177735DAE0A58DB329 /* MWCampaignConfig.h */, - 57F77641012CB1E327263325533174E5 /* MWFloatView.h */, - 71B10211F30D5B9355D1154393EDE35F /* Frameworks */, - 22854D7C55D1CE7A93745C7F20401CC0 /* Resources */, - ); - path = MagicWindowSDK; - sourceTree = ""; - }; - CBE5300F4974C32647DD18740D293745 /* TZImagePickerController */ = { - isa = PBXGroup; - children = ( - 926F78A88F80F6A64D53C9CB664DC29F /* NSBundle+TZImagePicker.h */, - 90DC9253D37E4E2C185640670407D6B4 /* NSBundle+TZImagePicker.m */, - 3AE37559593AA7FE338FEB3FCF450872 /* TZAssetCell.h */, - 9A1CA718CE0F5EAA1648BFE8E3188F2B /* TZAssetCell.m */, - C0BB60818347CFE32CEBDB113779A891 /* TZAssetModel.h */, - 56D5CFA757E346D2AE905A50475E6103 /* TZAssetModel.m */, - EE485D95A6DCE075F9E9120F30E34C71 /* TZGifPhotoPreviewController.h */, - 118A806EF73C911687A7BF9D81D1EDF7 /* TZGifPhotoPreviewController.m */, - 2E71B72FCFDE8D0777AFD22FC842B23F /* TZImageCropManager.h */, - DD5B045EF5611D9E253BFA51D3648D1A /* TZImageCropManager.m */, - A902DCEC79AEC6280BCDAA3F36453A9A /* TZImageManager.h */, - 4A46113BA07919AC815F0A34111D4ED3 /* TZImageManager.m */, - 28B5E9F25214A44CE763DC0BB701541D /* TZImagePickerController.h */, - 949A99854C0D6FA613FE574C25956447 /* TZImagePickerController.m */, - 9C2CF55708FA0B880DE44475E5F883F0 /* TZLocationManager.h */, - CC9B12DF3458832BF9970F1288E40011 /* TZLocationManager.m */, - CE46F8430E8598867104B25A08F09079 /* TZPhotoPickerController.h */, - 7D9615C08F01783E110DD1574B0DAAB3 /* TZPhotoPickerController.m */, - 723F731BCEE8CA3044F702507BD104D7 /* TZPhotoPreviewCell.h */, - 75C43CEC25CB9D70DF963905C8C19C35 /* TZPhotoPreviewCell.m */, - 673881C48EF78A45CA7A1B0B460C571F /* TZPhotoPreviewController.h */, - 12D14DCE47B28B09508C19AAB5F890B2 /* TZPhotoPreviewController.m */, - 4CAB69580B74E84DEA3EDA3A8D29AE48 /* TZProgressView.h */, - 3C658D9A114CB4D99679160C0495B8B1 /* TZProgressView.m */, - C180ED52EE520A2F430DCC25BB5220D2 /* TZVideoPlayerController.h */, - 4C9AE8FDC2DF7791AE06C5C8B47F3561 /* TZVideoPlayerController.m */, - 755191A5599D8DBFEF1BCBB075070BD7 /* UIView+Layout.h */, - 370A38ED08983AFC12268A6293D65FB9 /* UIView+Layout.m */, - 78932D5EDA6ECE9DB63BA1C774018EA7 /* Resources */, - 9C3E687076060298532E62A25DB19665 /* Support Files */, - ); - path = TZImagePickerController; - sourceTree = ""; - }; - CE5BC7ACAFDE4CF44034540993928FCD /* SDWebImage */ = { - isa = PBXGroup; - children = ( - AF6BB537BB7387BD2FCB1657499BCA76 /* Core */, - 7017B5865BDACC4E0CA4A718CD64F2DA /* Support Files */, - ); - path = SDWebImage; - sourceTree = ""; - }; - CF038AEB8FBBF8313D2E90BA347182E4 /* Serialization */ = { - isa = PBXGroup; - children = ( - C560946B4C93C0C0A8AFB719428F8F7B /* AFURLRequestSerialization.h */, - 1C5061CB166F6F474AAB91AD6984F408 /* AFURLRequestSerialization.m */, - 1FAE651A3D0222E82C506B6F88FE31EA /* AFURLResponseSerialization.h */, - D2FFA8CD812797A9DC97473B60433930 /* AFURLResponseSerialization.m */, - ); - name = Serialization; - sourceTree = ""; - }; - CFD05FF2233BF504B8D2A311FB3F685D /* Support Files */ = { - isa = PBXGroup; - children = ( - 676F5D06F4237F94D9015FB16B0068E2 /* FCUUID.xcconfig */, - 4DCD420F6DD8A8D294CA854535C45814 /* FCUUID-dummy.m */, - 065E1EA74216DA778ED07019B9CF4C28 /* FCUUID-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/FCUUID"; - sourceTree = ""; - }; - D1ED872AAC2B671D0B87341726D6B926 /* ASIHTTPRequest */ = { - isa = PBXGroup; - children = ( - 0E73834927B5E33B533FC918FFAE8C2E /* ASIWebPageRequest */, - A8E612B93C607AF99FD5052E58E4AFE9 /* CloudFiles */, - 6D55BDD722E4F5E581F03887C927AB6C /* Core */, - 744C11A59BBA8BB2B3FC7ECEA6470A50 /* S3 */, - D873DF4430C093E1FBACBA8BA84BDD97 /* Support Files */, - ); - path = ASIHTTPRequest; - sourceTree = ""; - }; - D252B0AD6A9071CB35CDA77AF552999B /* Frameworks */ = { - isa = PBXGroup; - children = ( - A3827D91B89DE3921FA773C63BDAAA66 /* libWeiboSDK.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - D3819C99B66D8A24F6EFE7D42E243879 /* Resources */ = { - isa = PBXGroup; - children = ( - AF0BBABE09F0D1A1B173F1260A6309E0 /* TencentOpenApi_IOS_Bundle.bundle */, - ); - name = Resources; - sourceTree = ""; - }; - D6DD6D6629ABB93B0AE72FC4E5230835 /* iflyMSC */ = { - isa = PBXGroup; - children = ( - 39D30DF56100E8FF992F600B4A1307ED /* IFlyContact.h */, - 22276690AB3B218397EEFE25A427DEA5 /* IFlyDataUploader.h */, - 7C470EC78502D024FE56BA3BC0C2795F /* IFlyDebugLog.h */, - 0521D4F71531296A6C5B6131C1C02AF7 /* IFlyISVDelegate.h */, - 301D35D0B2632B6775364C55BD76C308 /* IFlyISVRecognizer.h */, - 7A5A73F8DA2CBBE37C8F8A1367FC7A25 /* IFlyMSC.h */, - 54DABCF6EA0D70917D4C35862D86C15E /* IFlyPcmRecorder.h */, - D61810C22B9B58AC3B5C76FD43643FF6 /* IFlyRecognizerView.h */, - C837989DC08952A81D04A36D1208F1EC /* IFlyRecognizerViewDelegate.h */, - 1C4A04B7E165F1DA59948AB160DC91EF /* IFlyResourceUtil.h */, - 9B046A137EBB66062317F71C42E817CD /* IFlySetting.h */, - 2C1C9D4B49CD59C7ABBACB54F8203D56 /* IFlySpeechConstant.h */, - 491D7FC822A8EDFC3CD51EAEE8A87743 /* IFlySpeechError.h */, - 1044474C3ABBC525F856317E301218DD /* IFlySpeechEvaluator.h */, - D27F2CC14C10465F885D8EA9802E83B5 /* IFlySpeechEvaluatorDelegate.h */, - 92ADC9AC8D5CFF4ACB60CA854B2D1711 /* IFlySpeechEvent.h */, - 1C3CB970A008F1F94860F842B7183004 /* IFlySpeechRecognizer.h */, - 809C1C342242FF73A762242FC405EAF5 /* IFlySpeechRecognizerDelegate.h */, - 3B086968F218A6AFF91792FBDDC5E500 /* IFlySpeechSynthesizer.h */, - 980ED939BAB7016DFFC1FE932CA9A81A /* IFlySpeechSynthesizerDelegate.h */, - CCE7399A1C49191DF63CB6C0199DA0DB /* IFlySpeechUnderstander.h */, - 37A11299A8AEBFDCD51BE4CECAB4CF0F /* IFlySpeechUtility.h */, - 1975A741AB5C26754D0AF143A6E35E44 /* IFlyTextUnderstander.h */, - A74D8A332B6D556AD143D8B012F60EA0 /* IFlyUserWords.h */, - C60DE3E2D925A5A8A53B082F23C1DE15 /* Frameworks */, - ); - path = iflyMSC; - sourceTree = ""; - }; - D873DF4430C093E1FBACBA8BA84BDD97 /* Support Files */ = { - isa = PBXGroup; - children = ( - 58D4E15F844FF5BF36101445BFC8CAF6 /* ASIHTTPRequest.xcconfig */, - C2889261727391FA0DE3EDD89C1ACDE6 /* ASIHTTPRequest-dummy.m */, - 55AC9D14F2D6FA75ACD22F6F740BD78B /* ASIHTTPRequest-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/ASIHTTPRequest"; - sourceTree = ""; - }; - D8AFAA5E8311ED392979DFA249E4473D /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7E4C3816BDE813991CB777F5C9CA8B4B /* libSocialWeChat.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - DB846F63E6FC8F827E9F3D3D506BA8E6 /* Frameworks */ = { - isa = PBXGroup; - children = ( - EC79C86ADF44C0B7FE0ED4F9C866F996 /* BaiduMapAPI_Base.framework */, - 356B8D85D8A6B5F2036CDA48E58BA132 /* BaiduMapAPI_Cloud.framework */, - C1F41036274DCC0D33871FF66C9E065A /* BaiduMapAPI_Location.framework */, - 47E21BDEF90FC1859A2136459414D467 /* BaiduMapAPI_Map.framework */, - A0173FDF2B0A82B773D97578498421D0 /* BaiduMapAPI_Radar.framework */, - 7FACD66124DEDA424E36923656366128 /* BaiduMapAPI_Search.framework */, - 4195F560F59E5FB735943D689110A8D8 /* BaiduMapAPI_Utils.framework */, - 10D2736631BC42AD36C7B879C7DCA815 /* libcrypto.a */, - CB03B824DA08E7E9F8323C9D62CB8818 /* libssl.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - E0B4D7908B7E5292209E24F2082030E4 /* Products */ = { - isa = PBXGroup; - children = ( - 83366A1B2B7425448492B9BB441A5CA6 /* libAFNetworking.a */, - 64C299A38AF8C4DBD1EE52BFA5F4B304 /* libASIHTTPRequest.a */, - 42F5FA6E7FCA3D341F404BD60840A093 /* libCYLTabBarController.a */, - 5D1CDBC2850AABFC6AD84E95236BEB14 /* libDWBubbleMenuButton.a */, - FECD1385947157F0113B98994A52CEFA /* libFCUUID.a */, - 0F84FE2B1ED09804709BF32C8EE4884D /* libFDFullscreenPopGesture.a */, - A521D5CDE091E2A44A4D7A4CEDC3278E /* libFMDB.a */, - A7A1B5DC3C64D8E14B39057FD2C21C1A /* libGVUserDefaults.a */, - F0F2271E95625E09CAF2C433E53FEB94 /* libHMEmoticon.a */, - 817542211EA857584373395E6EC78370 /* libHMQRCodeScanner.a */, - 6280AC1707A75E995D09994C02800BF2 /* libIQKeyboardManager.a */, - C49B4CD148973E43968F996FABE95189 /* libKILabel.a */, - 3FA26AA6F0CD1055A5F0DBC564D1D068 /* libLxGridView.a */, - 36B3099D08D46D39364C35161B90D5DA /* libM13ProgressSuite.a */, - E9C80FFBB79B3AF9974EECC83EA74CD0 /* libMasonry.a */, - CB6CD635AD78C2FED48EE114F69CF115 /* libMBProgressHUD.a */, - B9F3BE60A1F49D87A55261B0C9D85B1B /* libMJExtension.a */, - 38355552C1618C98BC03DC84F8739D3A /* libMJRefresh.a */, - 636BD41BB7BF75FCBCF8A9F7E68F278E /* libMOFSPickerManager.a */, - 560F6CDFE0EDADC15962E6D461276AF9 /* libPods-iOSProject.a */, - B4E0EA056E01EDF71080E5F50FB30D7A /* libReachability.a */, - 73149727F9CF5BE11CEFB827282F7ACC /* libSDCycleScrollView.a */, - E9947B34ED2E82EA97602CC7AC545A77 /* libSDWebImage.a */, - 418B172287A3B2DC4B566CC376D14A45 /* libTDTouchID.a */, - F0DD9E857638216395D0352D4053B688 /* libToast.a */, - 0A516C89E800F6996156F3C0C2BCC4F1 /* libTZImagePickerController.a */, - BE4A022473B1260E1789AC891C7EEBE9 /* libUICKeyChainStore.a */, - 45580AD579EED023106F243FBBBF4603 /* libWebViewJavascriptBridge.a */, - ECAC23D1B877D674E089FC42BCF4DE67 /* libYYAsyncLayer.a */, - 3E6E540E74178FA3B475564EC9414466 /* libYYCategories.a */, - 5EEAA9BD6C855FE00716EB2940A456DB /* libYYImage.a */, - 2981833DCCE11BFC4C1BD4A85EE693F2 /* libYYText.a */, - 3A36F0C2C74FBAA2BE7140E1CC039547 /* libZFDownload.a */, - 7D5F35384A1CABA1784B2B17184D4415 /* libZFPlayer.a */, - DC9D8982F97FE5F9A6042FC2B6C9100A /* libZJScrollPageView.a */, - ); - name = Products; - sourceTree = ""; - }; - E1B6FCE5D374575A89F0E263CF4CB2E3 /* Support Files */ = { - isa = PBXGroup; - children = ( - 1880C85B086D35C9E5F6528F9CE38CC0 /* MJRefresh.xcconfig */, - 71C293857462202C683B389A55EC1778 /* MJRefresh-dummy.m */, - A0C713E1ED57D3EE1F7DD972FBEAD4C7 /* MJRefresh-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/MJRefresh"; - sourceTree = ""; - }; - E2E11E95E32110B43C2A32F8EEC26944 /* IQKeyboardManager */ = { - isa = PBXGroup; - children = ( - A3BE083BB10468DDFE0DCA6CC58C8B73 /* IQBarButtonItem.h */, - 7B1C63A9A04378F43408869297AC6258 /* IQBarButtonItem.m */, - F4BBA883C0223B21603B3B652705A8B2 /* IQKeyboardManager.h */, - 5E3A79FB3A49131B618917506A72D107 /* IQKeyboardManager.m */, - FE390C2639DA306FA2613036D88EEB0C /* IQKeyboardManagerConstants.h */, - 7A3AC7CFD06DFA683EA173BD28BA6C10 /* IQKeyboardManagerConstantsInternal.h */, - 8A4049539B1D6D0012835DFC6E51FF2D /* IQKeyboardReturnKeyHandler.h */, - DF09C24F9D1BDF5A214EFD8EB1F3CAA9 /* IQKeyboardReturnKeyHandler.m */, - 3AE19DCDE3F0A8434893883870D280D5 /* IQNSArray+Sort.h */, - 0F6344E7609F9F1FA1AA4CB86C01530A /* IQNSArray+Sort.m */, - E5DDF5437AF1228F6E7364B135CDF4A7 /* IQPreviousNextView.h */, - 6DCD9801AE18FF59DAEADA204C6F9476 /* IQPreviousNextView.m */, - 8BFF8B7C2362C818B8DCBDA2E02F87BC /* IQTextView.h */, - 7941FAD8F23E54FA41D6378BBB715F5C /* IQTextView.m */, - 719C47543AF80968CE454D97F832A3E2 /* IQTitleBarButtonItem.h */, - DFCF134F6C3ED793B0111249F8AF2DB3 /* IQTitleBarButtonItem.m */, - 4C3031D0C47787DEBEC6131AA8ED1361 /* IQToolbar.h */, - E0774C96DF193FDD29D3A2E0AFAB9BE9 /* IQToolbar.m */, - CFBC0FC0798BB96D4D4E80C65F13C360 /* IQUIScrollView+Additions.h */, - C0D597B98B58A9E6D134DD9C9344D9CD /* IQUIScrollView+Additions.m */, - A54E2FE69927E9C4208E88CC7B6F4ACF /* IQUITextFieldView+Additions.h */, - E082A8E295AB6093829176DDC77D1996 /* IQUITextFieldView+Additions.m */, - 428BE3001071D5152741D2340F784D3D /* IQUIView+Hierarchy.h */, - F6285D643ED016FAB0C92D119FE01FBC /* IQUIView+Hierarchy.m */, - 747F9F799F0B700694CD85F5719AD19A /* IQUIView+IQKeyboardToolbar.h */, - 1738D668B8205B80DFC8A5FA6B58B071 /* IQUIView+IQKeyboardToolbar.m */, - 7000B1BA4FEC9D83E0E4B25AA5DE978D /* IQUIViewController+Additions.h */, - DB48503A298BAC12499F5310ABCAD9D4 /* IQUIViewController+Additions.m */, - 2372B9B2E44A26EDA2CC93E2E659F95F /* IQUIWindow+Hierarchy.h */, - 6F52E54A1217692C3E1F2C2464AA454A /* IQUIWindow+Hierarchy.m */, - 48A36CD0CD67F62252AD5DA5E7197BE0 /* Resources */, - 1478F4839775D43939E760A35AB7AC78 /* Support Files */, - ); - path = IQKeyboardManager; - sourceTree = ""; - }; - E4E25887D3B2B0D4A6A796E30DB607B3 /* WechatOpenSDK */ = { - isa = PBXGroup; - children = ( - 3AF73D974F1E74DC956525817A9F5DD4 /* WechatAuthSDK.h */, - 906380BAF545040FF42B138142A30E6F /* WXApi.h */, - ECB8EDD88E810B84D2CC507AA30E9251 /* WXApiObject.h */, - 2DC277AF6C114B09E3037EE4C5AC373A /* Frameworks */, - ); - path = WechatOpenSDK; - sourceTree = ""; - }; - E691EC5E8E38D5FCB18AFDCEF7677977 /* YYImage */ = { - isa = PBXGroup; - children = ( - 83251F388D3F24FB5C273CB05524B9B4 /* Core */, - 936724C6732CA25B46CB0A39CC719A80 /* Support Files */, - ); - path = YYImage; - sourceTree = ""; - }; - E8B92CC6BFE6FC75651E592FF14B65AE /* Support Files */ = { - isa = PBXGroup; - children = ( - 660F7A2D558A86E5552D7FB3399A6562 /* SDCycleScrollView.xcconfig */, - B7BB646B178AFDCC018FB11E198DD8A0 /* SDCycleScrollView-dummy.m */, - EF2A544450A7CC299D69FA18E6BECD28 /* SDCycleScrollView-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/SDCycleScrollView"; - sourceTree = ""; - }; - ECB883CA45AA7CCB7ACCC7EAC1D19DBB /* NSURLSession */ = { - isa = PBXGroup; - children = ( - 614C722F31B43E33726D248055FF8A05 /* AFHTTPSessionManager.h */, - 2F58CBFD6BB26DBAD742A0994ABAEE53 /* AFHTTPSessionManager.m */, - 65C3DE628916339FE09F34E04AC204E8 /* AFURLSessionManager.h */, - 90EF5233DEA29F718102E78CCAB6025A /* AFURLSessionManager.m */, - ); - name = NSURLSession; - sourceTree = ""; - }; - ECEEAE4C01D76A4F2A5E7CE2BE1E1F0A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 24DB260A228FC5F2660D06F7475E98F8 /* UMSocialNetwork.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - EE63250D81751B3BB89BAECA1A0FA2DE /* Resources */ = { - isa = PBXGroup; - children = ( - BA15EA515951F6EE09FFF8A3FB40586F /* province_data.xml */, - ); - name = Resources; - sourceTree = ""; - }; - EF121C764A47BDEE56BC624B885D1361 /* Support Files */ = { - isa = PBXGroup; - children = ( - EA75EC8B3CF1812B48530A5210B8FEDF /* MJExtension.xcconfig */, - 774BAF6634C4F95BE5FB8BA104E883D6 /* MJExtension-dummy.m */, - 1CEAA11E52161F83D04D9F0EE72D55DC /* MJExtension-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/MJExtension"; - sourceTree = ""; - }; - F103B33EF425D9B455FA4BC08CE02AD0 /* FDFullscreenPopGesture */ = { - isa = PBXGroup; - children = ( - F9BCC6348FCACABABE79321B10BE5ED9 /* UINavigationController+FDFullscreenPopGesture.h */, - 8BC5EB8981152119B28CA27FB6426252 /* UINavigationController+FDFullscreenPopGesture.m */, - A40B450970BA620320469097C3FF077B /* Support Files */, - ); - path = FDFullscreenPopGesture; - sourceTree = ""; - }; - F989FCD098C929254E1CAF39144DBD6E /* Support Files */ = { - isa = PBXGroup; - children = ( - 5678650B327F3A34C944E809BDF44C24 /* TDTouchID.xcconfig */, - 52F346A3FA3095FAB9E2C02586456232 /* TDTouchID-dummy.m */, - 0992AA9FD4408B190D505B6D13ED1245 /* TDTouchID-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/TDTouchID"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 01DF1C039BBD224F5E639EEB968B69CD /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1386EEB86AEAB2F38CC689CCB85DA169 /* FCUUID.h in Headers */, - E80BF769F55BBBABD79434997076F603 /* UIDevice+FCUUID.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 05C1BB9626797C7B65BB4D5282B448DD /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4140D98EFA34F19E4D2A885A34C28B66 /* CALayer+YYAdd.h in Headers */, - 4356505F4CA29DEAB3A7081A1DAD66A3 /* NSArray+YYAdd.h in Headers */, - B7F31547E82DD6E398C717A1BD3688AE /* NSBundle+YYAdd.h in Headers */, - 8E08BFD468ABFD9A71053DB23F3A3036 /* NSData+YYAdd.h in Headers */, - 5F0AE2A8A89AA79F4F30BF54E75127D2 /* NSDate+YYAdd.h in Headers */, - 2EA3F0B6F3F7E034227EC992AA4CCC6E /* NSDictionary+YYAdd.h in Headers */, - FA5F501EBA3074D9A0F9C3106FB1A346 /* NSKeyedUnarchiver+YYAdd.h in Headers */, - 506C84DCF34A8AB90A649C452EFA00C1 /* NSNotificationCenter+YYAdd.h in Headers */, - FF78454EFB2810B20BC14D4DFCD47595 /* NSNumber+YYAdd.h in Headers */, - DD9A9BB121CA19489BC85D397F5F0BDB /* NSObject+YYAdd.h in Headers */, - AADE982ED263D4792883CC905583CA86 /* NSObject+YYAddForARC.h in Headers */, - 9938F046B9B68AFF70BD045D2CC5F2AF /* NSObject+YYAddForKVO.h in Headers */, - 4BBAFFA76E6475106B55F490C9A152EF /* NSString+YYAdd.h in Headers */, - 78B89E3CA5DC1F485E0AA5A4D990D462 /* NSThread+YYAdd.h in Headers */, - EA5F93ED742A35475733A6D45595F062 /* NSTimer+YYAdd.h in Headers */, - 1040375FC84808800647F8DAEDB20B41 /* UIApplication+YYAdd.h in Headers */, - ED19C2E9DBE2021430CEA9CB23C92875 /* UIBarButtonItem+YYAdd.h in Headers */, - 39F761091E283830FB06FF3F1411CDC6 /* UIBezierPath+YYAdd.h in Headers */, - EB65DEF61D1C41868F0033E286D4396A /* UIColor+YYAdd.h in Headers */, - CFEC5ED91E651362786759FA7778F81B /* UIControl+YYAdd.h in Headers */, - 2B64DE0094F838E57AF929C406EE60C7 /* UIDevice+YYAdd.h in Headers */, - 02FEF1136F0F1F4B62851155E156AB41 /* UIFont+YYAdd.h in Headers */, - D23C9A6607D23F06E64E72A6106FE9D6 /* UIGestureRecognizer+YYAdd.h in Headers */, - C61E6B605BA4324039110756194E588F /* UIImage+YYAdd.h in Headers */, - FE9226E85B0D7906C1687DCFFD30D252 /* UIScreen+YYAdd.h in Headers */, - 8A6B322E66CE36DD79E4D0092A6B5E39 /* UIScrollView+YYAdd.h in Headers */, - DD4C7B0BECD308F74C264154101A3AB8 /* UITableView+YYAdd.h in Headers */, - 8CE10A5057878449923E8EF3AC420145 /* UITextField+YYAdd.h in Headers */, - 5B6ABE193594524DDB8ABE7DB61FB766 /* UIView+YYAdd.h in Headers */, - 325BF84530FBB7EEB6A95361EA69DCE8 /* YYCategories.h in Headers */, - 85C945C6D2459FF0C0333F5923A6C49C /* YYCategoriesMacro.h in Headers */, - 6667774426C74EFA7316F5F52B3C74A8 /* YYCGUtilities.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 0A1C2B07813030B0D51EB1D804A4439E /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - F1F93EE1AA5E870F2CE81325CE9EB643 /* AFAutoPurgingImageCache.h in Headers */, - 6B71CE5BA32574F407349C1DA20605B4 /* AFHTTPSessionManager.h in Headers */, - 707E818332E5033501DF2D7826C639DF /* AFImageDownloader.h in Headers */, - E7B0270BEDCBE116DDD853F76E27B0BA /* AFNetworkActivityIndicatorManager.h in Headers */, - 46401F3C7FF0B0CFE2E9B14914780835 /* AFNetworking.h in Headers */, - DE31BBF6A7963C5871A19655EF5532BE /* AFNetworkReachabilityManager.h in Headers */, - D59FC98A74E440C4725B6FDC28F5951E /* AFSecurityPolicy.h in Headers */, - C1C0D7C93BF3DE14A26757273598D0FA /* AFURLRequestSerialization.h in Headers */, - 66635EAAE52FF5571DBCDC626FB8CA86 /* AFURLResponseSerialization.h in Headers */, - F5CC06F3E0C232483A72DCCFAF393BE0 /* AFURLSessionManager.h in Headers */, - 682B0E603612B6ADBCCF30580F9A4B09 /* UIActivityIndicatorView+AFNetworking.h in Headers */, - 2EBAA518CB8B2DAF89A63637091D4615 /* UIButton+AFNetworking.h in Headers */, - 1341A7AC2439CB63D459D32EF985A414 /* UIImage+AFNetworking.h in Headers */, - D5CB999FB5FC80FC126A38AB4DF12227 /* UIImageView+AFNetworking.h in Headers */, - 5719F06B809080CDEF7E6BC75DEA1A3C /* UIKit+AFNetworking.h in Headers */, - B40756412613B53C80EE77C4C223990F /* UIProgressView+AFNetworking.h in Headers */, - F099E5987DD80E8D78E909AF81D3C587 /* UIRefreshControl+AFNetworking.h in Headers */, - 8958F2453EEBAF71BFEBD78FB48986EC /* UIWebView+AFNetworking.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 0DB27FFA0E1E539569F6BF31263A9041 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 11EAFFFF93AEB5E3C77BB9BFBB9D2890 /* NSBundle+TZImagePicker.h in Headers */, - 60C3652F7F2BF0B4A17FFB445BDB4671 /* TZAssetCell.h in Headers */, - 2BAE1C17B8C1948A8B06E4A97CA50794 /* TZAssetModel.h in Headers */, - 84B235E9310D015A6F322F7EE1F46C91 /* TZGifPhotoPreviewController.h in Headers */, - 2B39DFC8035B900C53C033C9C071B88F /* TZImageCropManager.h in Headers */, - 22A494F78AA11235934C2D1F93DE4B7B /* TZImageManager.h in Headers */, - C127AAADF5EE85544ED8B578CAB94CAF /* TZImagePickerController.h in Headers */, - 6581AA6C141207907EDB0484A45F6519 /* TZLocationManager.h in Headers */, - 67E7C0D0179BCEEB5DAEE4B22A0D3934 /* TZPhotoPickerController.h in Headers */, - A388D258BCEE3E78005749771328E21A /* TZPhotoPreviewCell.h in Headers */, - 7EA91DF1C86DD20C387CBCEB95F8C002 /* TZPhotoPreviewController.h in Headers */, - 94AF2965FE1E259CA024A868718DFDEF /* TZProgressView.h in Headers */, - 126962DF9E1FA4A64F0C1F601F952301 /* TZVideoPlayerController.h in Headers */, - 5788E0688BC7472F89F6BCCCD9B9CB0A /* UIView+Layout.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 1B1D84BCA4F7BDAE79C37DF88C9DCE23 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - EA321C98029015AA4895C0B26891D8F8 /* MBProgressHUD.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 233833543E0ADA3BF9FE1381C3DC4923 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 118833C5C94188CFCB56FFF900ACC011 /* NSData+ImageContentType.h in Headers */, - C9EC4BB079D2ECF42C71E63D99796F95 /* NSImage+WebCache.h in Headers */, - 4C9E0882571AC4FF99FA5697CB6B29B5 /* SDImageCache.h in Headers */, - 5F2C1B0AEF2EE92FE02B707B513D3640 /* SDImageCacheConfig.h in Headers */, - A9EF8701C5F3C7202F922B209E97CE79 /* SDWebImageCoder.h in Headers */, - 016C19531EE6B86129B36462C79EC7C6 /* SDWebImageCoderHelper.h in Headers */, - 255900005B71B3B1CCF27BDDBF13EDA6 /* SDWebImageCodersManager.h in Headers */, - 5E895F5326C30841E5E8512B10EA24E2 /* SDWebImageCompat.h in Headers */, - 63156594F4E4B79AD1AF5A5EDF196502 /* SDWebImageDownloader.h in Headers */, - 74150F02234E1E9CF39FC5FAD5526F02 /* SDWebImageDownloaderOperation.h in Headers */, - 3B3D8651714B980D3CB82D80BA9FAC33 /* SDWebImageFrame.h in Headers */, - D52809383B616254553BEC467B188F6A /* SDWebImageGIFCoder.h in Headers */, - 7324315EF0CE156CB808FDA26B532D30 /* SDWebImageImageIOCoder.h in Headers */, - 4AA1C335A5152F60E15CB51A2E9FFA69 /* SDWebImageManager.h in Headers */, - 4092F70848E9407F2EFB655F3647B375 /* SDWebImageOperation.h in Headers */, - CF87F341328F0B8653946EF1A0E4FDB8 /* SDWebImagePrefetcher.h in Headers */, - 2E41E97A12C14653C0946A443B7150B9 /* UIButton+WebCache.h in Headers */, - 61BA6FA0E9DAE389E65C5AA72057A9AB /* UIImage+ForceDecode.h in Headers */, - 7338EF83DA050BFFE7318187ADFF3183 /* UIImage+GIF.h in Headers */, - 16E50B9593E4B30DB2F2E2718A0DD2A6 /* UIImage+MultiFormat.h in Headers */, - 6BBAF3CBDF5E15EB8EF39C84660F08F1 /* UIImageView+HighlightedWebCache.h in Headers */, - 3B8BDFC4402CE965474003299DF415A6 /* UIImageView+WebCache.h in Headers */, - 67990B0D5E187F8D7070763C77C649F9 /* UIView+WebCache.h in Headers */, - DC125A20E2FFA8206AB6F6FAB0F26EB8 /* UIView+WebCacheOperation.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 27AA85537B99F71630A4A26DC3E7C663 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D05531F7D98CB83A5E30295EC1CA5ED /* GVUserDefaults.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2AF88DFD5EF7625AEDD51366BAA1BE5F /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4165D8B139A63C9697508A678E579C80 /* ASIAuthenticationDialog.h in Headers */, - 17843C0E2C8339405FF8566A9B6D2280 /* ASICacheDelegate.h in Headers */, - D677F96B1493AB9AD035049332C2C315 /* ASICloudFilesCDNRequest.h in Headers */, - 63EE8F31D87D7F1A37281DA14099474A /* ASICloudFilesContainer.h in Headers */, - E84220DA381DDDD7BEE27BDBB7D3D0D9 /* ASICloudFilesContainerRequest.h in Headers */, - 5B16D4533A374C7F7826BC1470DAE0B3 /* ASICloudFilesContainerXMLParserDelegate.h in Headers */, - 80C000D286D7A11FAC14AEA7A97A0283 /* ASICloudFilesObject.h in Headers */, - 65E7311207C5F9CABE891B6A34C27C77 /* ASICloudFilesObjectRequest.h in Headers */, - B0D173D0608F3470567F14951B063A7D /* ASICloudFilesRequest.h in Headers */, - A3891F0BC676AB38A3BB0C94D702F0E1 /* ASIDataCompressor.h in Headers */, - 742650B580A6B1B55EA8765F316DC4A2 /* ASIDataDecompressor.h in Headers */, - A660DE8B25F03617707E12D6541807D4 /* ASIDownloadCache.h in Headers */, - 1D962112402DD432D933424B9AAC845F /* ASIFormDataRequest.h in Headers */, - 400A503998B8B681E66DC5A484A049B8 /* ASIHTTPRequest.h in Headers */, - 6BE1FCE325DE9A035D417E8FE01181D7 /* ASIHTTPRequestConfig.h in Headers */, - 529D5BFABE3D5B73E6DD628670FE6DE3 /* ASIHTTPRequestDelegate.h in Headers */, - 547C3B80F7310050C99DE906CA19F0CB /* ASIInputStream.h in Headers */, - BFDE29CCA1C8B4656ECA8C5E98D05507 /* ASINetworkQueue.h in Headers */, - 405C60186C5D7BADBF698A8B2210A8C7 /* ASINSXMLParserCompat.h in Headers */, - 3110520F43E052EEB23A57FF7A874B79 /* ASIProgressDelegate.h in Headers */, - A8D23C82F47999E97963F1AAE062482A /* ASIS3Bucket.h in Headers */, - DFB0845B833B1689F43DC38583F5654E /* ASIS3BucketObject.h in Headers */, - 0F400B5F556C93860ED272376FEDAAAD /* ASIS3BucketRequest.h in Headers */, - A2B227AEB355C65CD324CA132E06E9B7 /* ASIS3ObjectRequest.h in Headers */, - 10CCE3EE77476C2DA31FCE8FA547E723 /* ASIS3Request.h in Headers */, - 832652AEFC186D053C28EA943E59E45D /* ASIS3ServiceRequest.h in Headers */, - CB253797348DD0011735781AFB9A1D0B /* ASIWebPageRequest.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3B43650D180636CE1DD02ABED51A0611 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1AC6DFA672F1EA3E557892813E04D84C /* Reachability.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3BB32FFA9CFEC89EF803C6A9C28804EC /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 28B30D7AF077B7BBD7361FB6AC3AA2BC /* IQBarButtonItem.h in Headers */, - 71DFF4FCF490E7C2983380C32C3E05A6 /* IQKeyboardManager.h in Headers */, - D5B7D8C76ECDAE3675FED3DDD52A1A1F /* IQKeyboardManagerConstants.h in Headers */, - 9216E6BF8AF8A584B78667EA7D41DE2F /* IQKeyboardManagerConstantsInternal.h in Headers */, - 1A12AC09DAEE727DBD9D111A2B098516 /* IQKeyboardReturnKeyHandler.h in Headers */, - 6DD7A82ED48E61FD8C2BA3EA9649DD2E /* IQNSArray+Sort.h in Headers */, - 43643239F78BFE4405AD5092ACC1B176 /* IQPreviousNextView.h in Headers */, - 53E16175D3F285FCD0AA297379790B78 /* IQTextView.h in Headers */, - F88EBCF213D5CDC9DD9761F38AC8851A /* IQTitleBarButtonItem.h in Headers */, - 4A49D2D82248088CA84188952B9E69BA /* IQToolbar.h in Headers */, - 82BA014C81EE79BD7F043D96AB562DB6 /* IQUIScrollView+Additions.h in Headers */, - 17045EA58EB53C66039B73AFDA4BB11F /* IQUITextFieldView+Additions.h in Headers */, - 612D7698019865805EFC789DCE5858AF /* IQUIView+Hierarchy.h in Headers */, - 08C263DF6F9031C2ED55A0D16722652A /* IQUIView+IQKeyboardToolbar.h in Headers */, - F02320ABC117E8ACC68CA867458B20F5 /* IQUIViewController+Additions.h in Headers */, - 5A2FF5F16ABBFABA5EC18B9AF230429E /* IQUIWindow+Hierarchy.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4066C15D14D3EA454B28E0A3BDBE657C /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - DF7E8F56866EFB1A2C4E44782CA49632 /* SDCollectionViewCell.h in Headers */, - A1474150318867763C065082EFBAAF75 /* SDCycleScrollView.h in Headers */, - 4CF1E8010B40B80D65369475F77ADEFE /* TAAbstractDotView.h in Headers */, - 265C8428AEA2239BAF160746DC75D269 /* TAAnimatedDotView.h in Headers */, - 8D9983D10250B93580E933AE682697E9 /* TADotView.h in Headers */, - 4B7B2AFFCB7ACEE27E331AA44B72BCC8 /* TAPageControl.h in Headers */, - F2B5C5B8FB2306B5FB06F1D38D3E79AD /* UIView+SDExtension.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 425B7B3A149EACD8B0407F073D8E6E7B /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 524B4326D968E2DCC0A17C4504DCF50F /* KILabel.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 46C230273D71A42D904C198481E8AEB2 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D67A05C3863D02245CF65544E73F5BE7 /* WebViewJavascriptBridge.h in Headers */, - 0DA584019CB7E88806A81CBED9CA678F /* WebViewJavascriptBridge_JS.h in Headers */, - 6A0484FF4A1F83E78507025DE58A07B5 /* WebViewJavascriptBridgeBase.h in Headers */, - D5841E6383359116F1E1FD71402D06F6 /* WKWebViewJavascriptBridge.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 48CD6296E8279D9ECDE1DD6BC212C2CA /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 8E384CD06B5FEFBE0EB52E7D0A43C860 /* YYAnimatedImageView.h in Headers */, - E92CC2015B7B9C30B91455FA436876A7 /* YYFrameImage.h in Headers */, - 1C31F1075C96DDED3254C34270D2E9FD /* YYImage.h in Headers */, - F1428FF0F4A7C4769364134ABFEE4B44 /* YYImageCoder.h in Headers */, - 89E683A53684CE0F517F50A43F21A5C7 /* YYSpriteSheetImage.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4A99AD916B0D025A576A79FB67655B5F /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - B901DC7B9DE7933E44A3D1EBBF503CF8 /* AddressModel.h in Headers */, - 4348D4606EBC040B051D7C705CF11C82 /* GDataXMLNode.h in Headers */, - 645E7F583120665A9BED4832325B0891 /* MOFSAddressPickerView.h in Headers */, - 018965FB43AF7526BDC561C15D5D55B4 /* MOFSDatePicker.h in Headers */, - 350FB2B6ADD5C12735ACE581EAAB30B5 /* MOFSPickerManager.h in Headers */, - 5A6A9330314958802126A876CC0976D1 /* MOFSPickerView.h in Headers */, - E55DD1E2FB668F7184151F9F86B4EC72 /* MOFSToolbar.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CCC7158BB1557CFF1E76238D0B2B3C0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - A1D8EB2F38369C610D3B520E55B243BB /* YYAsyncLayer.h in Headers */, - 0CDEEC3BC3F3EE9215EFDBB570803626 /* YYSentinel.h in Headers */, - 905C84FEAC3414BACB5231F9655560CE /* YYTransaction.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 54609028CACFCC88962C2E9D034F30B8 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 229FB7EB87B33AAAB8DE0F7DC1D9B1FB /* Toast.h in Headers */, - 701043245D0EFC6EF4CBC897F0102A6D /* UIView+Toast.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 54ABE24AD389F736D63043E31F3F36B8 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C31F154CC47EC67EFE3D61A9626E9513 /* ZFCommonHelper.h in Headers */, - 66A408AD945FC607B22AB940A69F1C86 /* ZFDownloadDelegate.h in Headers */, - C7E3CADF7FE1173E046AEFCD5B158CE6 /* ZFDownloadManager.h in Headers */, - FCE0158B69F7AECDB41CC6E27A88185D /* ZFFileModel.h in Headers */, - EE32ABBD09EA664116291D6EB00E673A /* ZFHttpRequest.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 5CA28E205743E7F6152AC8603EF43445 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - E033AFDC08C8EA92B1FBCD61C6B82E9F /* DWBubbleMenuButton.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6331C6E381FCAD4D09D878562F820C35 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 8565C66644D656C7361B9BF8B18F6AD5 /* LxGridView.h in Headers */, - 432DD4D64F82A8102F300273FF319B9F /* LxGridViewCell.h in Headers */, - C9B1A8DEF594E5ECF9AF26D1EB80E6FB /* LxGridViewFlowLayout.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6528D49BBCDEB5E0F7B2BDF1992AD226 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C3FB4F117C9CE2928CE6FB66BAF784D9 /* UINavigationController+FDFullscreenPopGesture.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6F303F481354D8C781219154BA59C3EB /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 99DADD929B0A4EEE77EC3CBE574C68FF /* HMScanerCardViewController.h in Headers */, - 85B231E7CC388C5CE7B5528724D5630D /* HMScanner.h in Headers */, - 0F71F9B33F0C5B4C94C3CFA7C094824A /* HMScannerBorder.h in Headers */, - 47BCD56DE74472D94359FAE1CB7C69E5 /* HMScannerController.h in Headers */, - 66F2E1FA47B9A5D0B42B7CDBEC9A2EFB /* HMScannerMaskView.h in Headers */, - C7E9365CF4ECF4A47DF34B9DF5772825 /* HMScannerViewController.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 77BB1FD0E164E723835AE30CBF108138 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1CFAD8FA586B84F3F6F8F56A79B98608 /* UIView+ZJFrame.h in Headers */, - 69814A6E1E5B8D45B4AED27F4CD31409 /* UIViewController+ZJScrollPageController.h in Headers */, - 45539DE0654B869A6229507CCC743263 /* ZJContentView.h in Headers */, - 750863ACFB2EECFC0D06A000ED7C64A2 /* ZJScrollPageView.h in Headers */, - EB559AF9B00D1BD0211B0AE2B799717B /* ZJScrollPageViewDelegate.h in Headers */, - 1C23A9A31EAA38A4D9BE3E3DB73CDEDC /* ZJScrollSegmentView.h in Headers */, - EDA000DFA5E7524CF6263443D093AD4B /* ZJSegmentStyle.h in Headers */, - 72C1A3655230C92A41821933BF686764 /* ZJTitleView.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 82114A1344B338BA2E02AE4AFFDD95CE /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ED26EBF7F6D4BF6B0C15EEBC92691C34 /* AppDelegate.h in Headers */, - 11B73E65816ACF42E0EC7D407FAFFFD8 /* TDHomeViewController.h in Headers */, - 8D07EF21DFE86700C9FDD90CD32F6F8F /* TDMainViewController.h in Headers */, - D3885BDB2E96C02D809EB5169AFBE72B /* TDTouchID.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 864D7FF60E899EA81A55C0B7F82FC174 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CC9C69E797A8B66E96A7A1C1B1B51CC /* MJExtension.h in Headers */, - D7BF4DBA76F12C797027E90648D9AEE0 /* MJExtensionConst.h in Headers */, - 92937DC066543122186195A2941D3C60 /* MJFoundation.h in Headers */, - 1F8FEA93407CEC682A2C0C282CDEAD89 /* MJProperty.h in Headers */, - 4C6BFB4C1F6CF71C99E1FB270F0FEDAF /* MJPropertyKey.h in Headers */, - 52BA5ED3898FD3C7571E9B74782158A5 /* MJPropertyType.h in Headers */, - B915E3CFDFBA7B99411BC5430162868F /* NSObject+MJClass.h in Headers */, - CBA073485222F5F656AAF745EB499742 /* NSObject+MJCoding.h in Headers */, - 2357DDC85500B4F45E37E411B596F562 /* NSObject+MJKeyValue.h in Headers */, - DD0AA9E8B308E45F90AD7A01F8BBC4DC /* NSObject+MJProperty.h in Headers */, - DBDCE948DF1D74806D9D319F636A0E8B /* NSString+MJExtension.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 886A6AF4D99ACC18E1BBB27D70026109 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 139A9583FCF407CBC6E944BCFEBCC0F5 /* NSAttributedString+YYText.h in Headers */, - 10E31F30686982D46E83B9BE1938D344 /* NSParagraphStyle+YYText.h in Headers */, - 8052B84AB0483A6EA322D81E038407D6 /* UIPasteboard+YYText.h in Headers */, - 5930AACCC898FE30E20BEAEFDB9C7824 /* UIView+YYText.h in Headers */, - 7B13FFC5732EB497241BB39F343AD3E2 /* YYLabel.h in Headers */, - 47F8C7B786F283256FF744B2AB7608D6 /* YYText.h in Headers */, - 60917DACD8AEC6C7F1CE0587A5047899 /* YYTextArchiver.h in Headers */, - E070BA3C995B4D69F609C598A7C2F0B5 /* YYTextAsyncLayer.h in Headers */, - D23F3D9A40C330DB14FD968A9FF319AF /* YYTextAttribute.h in Headers */, - 9C93F7A25E2E2F0E18CD51C708B2A693 /* YYTextContainerView.h in Headers */, - 525F64EDD9803AB30C758CAB78CEDB7A /* YYTextDebugOption.h in Headers */, - D7296EA3985C37EA9CD0824DD778C1B9 /* YYTextEffectWindow.h in Headers */, - 429A5351F947A4C1DBEEA2EA405903EA /* YYTextInput.h in Headers */, - 4F2C1B2EE6B9EF25393DB2C13E7C0DB4 /* YYTextKeyboardManager.h in Headers */, - 20ACFAE2D5798B1BA89EBB82477CF4B4 /* YYTextLayout.h in Headers */, - C7174D3BCD4CAF6F6A1224E864CBFF9B /* YYTextLine.h in Headers */, - 55FB06435CBBECAF8ED79AE811353261 /* YYTextMagnifier.h in Headers */, - 0CBC841F08772C6B4B4F92089A510439 /* YYTextParser.h in Headers */, - C84740BE8BBC382F39E7AEA621764661 /* YYTextRubyAnnotation.h in Headers */, - 21E06336EFC07A67E0B24791D89B61FE /* YYTextRunDelegate.h in Headers */, - C9871E3CBA7E8D383B27E98B22BF06E2 /* YYTextSelectionView.h in Headers */, - AA3A71F563BBEE532223C0DA90DE32D6 /* YYTextTransaction.h in Headers */, - E3C599129A54AA7C1F664D4897B734CE /* YYTextUtilities.h in Headers */, - 918004218BE3091146B8D545B74A06FE /* YYTextView.h in Headers */, - 81A1E5ABF3E3E82AB846492BB87B4152 /* YYTextWeakProxy.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D4D43186038F8CEEC0C677112F102D7 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 2DB40A53BA9F7123F16CF6852BFA5138 /* HMEmoticon.h in Headers */, - CA0DDE24CBC41075A243BFA3DA09ABE3 /* HMEmoticonAttachment.h in Headers */, - 681EA0A96B513B01DC38B06C179ED89A /* HMEmoticonButton.h in Headers */, - 248C1B7EDBBF40C0C580F32E34313C12 /* HMEmoticonCell.h in Headers */, - 2DF08EB0B649C1647F6BA03431F30D5E /* HMEmoticonInputView.h in Headers */, - 5D5F6A52DF125BCEED5E82117EB20A8D /* HMEmoticonManager.h in Headers */, - C2E4D724938849FF093D70BD855285A9 /* HMEmoticonPackage.h in Headers */, - 0E5FCF4816B3FD49DF71E68490C3D951 /* HMEmoticonTextView.h in Headers */, - 8B35D94F9C649FD2FFC42C5255AA3ABF /* HMEmoticonTipView.h in Headers */, - 318D2F03BC67B5A390F4803923C7B269 /* HMEmoticonToolbar.h in Headers */, - A2DEECEDBDC78BAA15B7819716BAA42C /* NSBundle+HMEmoticon.h in Headers */, - C8DDC4B63C11BF34C10A8EBC1C805CD8 /* NSString+HMEmoji.h in Headers */, - D6A3D98C4A1998D9F3A92FCF681D9F45 /* UIImage+HMEmoticon.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A93D3ABB603D66C647446B37AA29FE64 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D852415DFD46E85C293E0DDE01868EA2 /* FMDatabase.h in Headers */, - F00CCFAB93A4F18419CD91217B1D5F66 /* FMDatabaseAdditions.h in Headers */, - 2012864C735C3DD88ECE425F6C981F6B /* FMDatabasePool.h in Headers */, - 99714143FA44A34F87D1F2AA6D254177 /* FMDatabaseQueue.h in Headers */, - 889D48A9B81ADF617C1D4E4E9473E3A9 /* FMDB.h in Headers */, - 398A5C11EFB816892FD5E18AD24F03D4 /* FMResultSet.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BCF57EC6DF4DD2736C7C216D9CEB9428 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1615F44139A14CEC7C82D546361B0609 /* MJRefresh.h in Headers */, - 7B2ED9E571E4E51168F7157F2EAE6199 /* MJRefreshAutoFooter.h in Headers */, - 0A3A685BD9A56E789E9EA83A1FECBBAE /* MJRefreshAutoGifFooter.h in Headers */, - 85BBFB5F0008B8304BF840AA6449C61F /* MJRefreshAutoNormalFooter.h in Headers */, - FF1B68BB2C26B49D0DB408D77BF73D8C /* MJRefreshAutoStateFooter.h in Headers */, - ADD69BFB0A0F3F7B7E162E410A67CF05 /* MJRefreshBackFooter.h in Headers */, - ED89F1A48BA44D203A2C4B9C6F53AC0B /* MJRefreshBackGifFooter.h in Headers */, - C16FDBA2BC10E28B8D59DE5CCF4758EC /* MJRefreshBackNormalFooter.h in Headers */, - 59CF9E95314C2B98CD4E53BA7FE282E4 /* MJRefreshBackStateFooter.h in Headers */, - 88290D5C90C12F48F09E6AC463737F1F /* MJRefreshComponent.h in Headers */, - 925EBB6CDAA2E17791E1DDCDA62A3375 /* MJRefreshConst.h in Headers */, - 99364D96200D03FC3229E6A956E10ADB /* MJRefreshFooter.h in Headers */, - 95F90F972DFDFBC3E012F069A6E24C33 /* MJRefreshGifHeader.h in Headers */, - 2AC677C7D32F72030B81CA00F24F65FD /* MJRefreshHeader.h in Headers */, - 9DDC888AA9FE29CD96DCB574AF125142 /* MJRefreshNormalHeader.h in Headers */, - 597CEE76562EB4D948504B07655C54D6 /* MJRefreshStateHeader.h in Headers */, - 2B20A7A457F69EA4CFEC2DB9CFB37FC9 /* NSBundle+MJRefresh.h in Headers */, - A67059B6451EE4D4C8827F52621E54A3 /* UIScrollView+MJExtension.h in Headers */, - D91A44E187477241B893D258E3F67A58 /* UIScrollView+MJRefresh.h in Headers */, - F88580E07538A44A13193CA98E37ADCA /* UIView+MJExtension.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BDF73468622762862D2FB76ED4AC0D8E /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 01E09711F001C49F92A97060414E262B /* MASCompositeConstraint.h in Headers */, - 4CBE1B46550A3FB90FDD1CB9CBA7B7FE /* MASConstraint+Private.h in Headers */, - 6249770A7D163B0F3001D5A76C5FA01C /* MASConstraint.h in Headers */, - EC48DE078CA5E55922CCE02354D475CD /* MASConstraintMaker.h in Headers */, - A6436E3CFFCBFE591E2D2A68ED90CAC6 /* MASLayoutConstraint.h in Headers */, - 49B903D576E09560C52AA92FDCC31A68 /* Masonry.h in Headers */, - 1F3BD3BC28432BB5E2F73501E06E4579 /* MASUtilities.h in Headers */, - E1E771349813022263F549BDF33CB4BB /* MASViewAttribute.h in Headers */, - A83991D7C1373DF66020C2FDFC5D7564 /* MASViewConstraint.h in Headers */, - 490CA524521F7D444EA58FA915D7E99C /* NSArray+MASAdditions.h in Headers */, - E072DA57403C4BFF9B10467BE05604C5 /* NSArray+MASShorthandAdditions.h in Headers */, - 9934AEA2C891C201D8ED5746FF42FE1B /* NSLayoutConstraint+MASDebugAdditions.h in Headers */, - 86EE1CB5473A4A07081D8DE3A2C45924 /* View+MASAdditions.h in Headers */, - 983CB852CBBFBC04C2A6BA407E34F59B /* View+MASShorthandAdditions.h in Headers */, - C88F85D3200060BD98FC13EA58121706 /* ViewController+MASAdditions.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C868F0ACCAEEF6A280F67220FA841F18 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A0522ACF2781856CBA1500F7D1893CF /* CYLConstants.h in Headers */, - BCC810F4BF3C8431FF04B44BA7010E30 /* CYLPlusButton.h in Headers */, - AF98613A2E16B158F083A50CACACACB8 /* CYLTabBar.h in Headers */, - E29EAC3768E043B012D7F9C7FDBF13C9 /* CYLTabBarController.h in Headers */, - E25B1BADFD408EC752C7295C16CBAE14 /* UIControl+CYLTabBarControllerExtention.h in Headers */, - C176A23166E147849485E017AEAFE889 /* UITabBarItem+CYLTabBarControllerExtention.h in Headers */, - EEC5B4B07B961E37F32DF019E0C3B69E /* UIView+CYLTabBarControllerExtention.h in Headers */, - 9CB8CDC7B89DBFC7B4E9FF289E690DBE /* UIViewController+CYLTabBarControllerExtention.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DA45582207DB67477A2F9BF65FAD0D95 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - A1AF541F95C341B54A6B14F2417FAF20 /* ASValuePopUpView.h in Headers */, - 8F51F1B625B4DC90142B4C866629EB92 /* ASValueTrackingSlider.h in Headers */, - 3AB3A7BF3DFD8205B119FC73E421D55C /* MMMaterialDesignSpinner.h in Headers */, - 901E9EB2FE0E99CAD8AD8BC9C6C9A7EC /* UIAlertController+ZFPlayerRotation.h in Headers */, - 5553BC4EEE47924861AB5D66F064A53F /* UIImageView+ZFCache.h in Headers */, - A7C8A31EF4E6A0DCBBCC49182551E771 /* UINavigationController+ZFPlayerRotation.h in Headers */, - 8C569AF82A859DAF60CEFBCDC065D992 /* UITabBarController+ZFPlayerRotation.h in Headers */, - 5D8724DF29BB2330854EA9911CA08A28 /* UIView+CustomControlView.h in Headers */, - F752B2BA995A71489A451CF59BB53824 /* UIViewController+ZFPlayerRotation.h in Headers */, - DC9A6D69D8187A64E6C68D9718D70309 /* UIWindow+CurrentViewController.h in Headers */, - 4D86C4F0861D54DB96A6AC0A1D059340 /* ZFBrightnessView.h in Headers */, - DE6263ED4AA8854DE3AFB371E261FF5F /* ZFPlayer.h in Headers */, - A2D66725D5603A535C9D6933DFFE8B81 /* ZFPlayerControlView.h in Headers */, - B44385B9C3D3067B30210D3B735BEFE7 /* ZFPlayerControlViewDelegate.h in Headers */, - F16DF184B375D8E5305B3563486DBA5E /* ZFPlayerModel.h in Headers */, - 04CC3AD81FB82495F493DCB081D85046 /* ZFPlayerView.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EC5AAAA93E19969D88570EA3E023DF62 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - DDF77D6617B736D4D5FE616FBA9BB1EE /* M13ProgressConsole.h in Headers */, - 37AD6D1BC7A7B63C2BA7B38DB1B7A1F5 /* M13ProgressHUD.h in Headers */, - FB5D1E8F50E7878F89EE4946AF10D734 /* M13ProgressView.h in Headers */, - 9A1820FEBBF042DC6D946AEA50BB12A1 /* M13ProgressViewBar.h in Headers */, - AA8657572F1AF74F280B03F644129657 /* M13ProgressViewBorderedBar.h in Headers */, - 8C4F5BEB11C839B2E36045A8A96BD4CE /* M13ProgressViewFilteredImage.h in Headers */, - 2FA1225772B1465912FC130D9AA70512 /* M13ProgressViewImage.h in Headers */, - ED6ECDAC666C83CB13B7ECAB19641C20 /* M13ProgressViewLetterpress.h in Headers */, - F462278FF31AADADC6C5803231C48F4C /* M13ProgressViewMetro.h in Headers */, - A0ACA8BFF6A0BF1FF85EF113B91335A6 /* M13ProgressViewMetroDotPolygon.h in Headers */, - 4767F697CD3F2B59EF4E421FABE74D6E /* M13ProgressViewPie.h in Headers */, - 284C694DEC772709AC30C4F716679890 /* M13ProgressViewRadiative.h in Headers */, - B7E3D801920F436FDDDA9B49730D4E1B /* M13ProgressViewRing.h in Headers */, - 2F6085166A2CDCE306BBE2DDDF737BE8 /* M13ProgressViewSegmentedBar.h in Headers */, - CC598A2A06D29B9BDD63D5282D942296 /* M13ProgressViewSegmentedRing.h in Headers */, - D5EAB6FF212B2BE8AA8814281F74523A /* M13ProgressViewStripedBar.h in Headers */, - 3CE218638D274EB343D3800A33FA7569 /* UIApplication+M13ProgressSuite.h in Headers */, - 98FF79A5FD2EBF34ABE949E78EFE7803 /* UIImage+ImageEffects.h in Headers */, - 5F5F82F0074D04D16AB53247CEB6C37C /* UINavigationController+M13ProgressViewBar.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F062D09345D9E91A078540DCD730FA43 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - DC138E6C97EC1B9D3E58A7335E6CADD1 /* UICKeyChainStore.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 04CF549EBEEE7BC87AEAE35397184D94 /* MJRefresh */ = { - isa = PBXNativeTarget; - buildConfigurationList = 35FA3F9D780F0A57E55222615ED55C72 /* Build configuration list for PBXNativeTarget "MJRefresh" */; - buildPhases = ( - E742ED1631851E8E4DF869C1ECDD955D /* Sources */, - E1FFA9BD201F7FCE2311B14D2E5AA8C0 /* Frameworks */, - BCF57EC6DF4DD2736C7C216D9CEB9428 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = MJRefresh; - productName = MJRefresh; - productReference = 38355552C1618C98BC03DC84F8739D3A /* libMJRefresh.a */; - productType = "com.apple.product-type.library.static"; - }; - 081C5DFBFB255EFA239E2A10EED8389F /* YYImage */ = { - isa = PBXNativeTarget; - buildConfigurationList = 98D437F6CC36812FAA64FE7E71C95C14 /* Build configuration list for PBXNativeTarget "YYImage" */; - buildPhases = ( - EDE1FA8B9DBF594D67E79BC004A59057 /* Sources */, - 5EE46175C854FEDD9C7D7BD336469B9D /* Frameworks */, - 48CD6296E8279D9ECDE1DD6BC212C2CA /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = YYImage; - productName = YYImage; - productReference = 5EEAA9BD6C855FE00716EB2940A456DB /* libYYImage.a */; - productType = "com.apple.product-type.library.static"; - }; - 1D2C839B3013830CA2082E7574526716 /* UICKeyChainStore */ = { - isa = PBXNativeTarget; - buildConfigurationList = 99FA678F14C4FC4F24DAFE231A318E5A /* Build configuration list for PBXNativeTarget "UICKeyChainStore" */; - buildPhases = ( - A5EFCF1749177D5E86BCF15F965D52CD /* Sources */, - E0E612D52E04F721E04A92C8605A3864 /* Frameworks */, - F062D09345D9E91A078540DCD730FA43 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = UICKeyChainStore; - productName = UICKeyChainStore; - productReference = BE4A022473B1260E1789AC891C7EEBE9 /* libUICKeyChainStore.a */; - productType = "com.apple.product-type.library.static"; - }; - 272B6902EC233437C8C814A53CD3E70D /* CYLTabBarController */ = { - isa = PBXNativeTarget; - buildConfigurationList = 92FEB1DD0BE395A76B5AF3D9139E078D /* Build configuration list for PBXNativeTarget "CYLTabBarController" */; - buildPhases = ( - 0799A6B09341C0AC1C22A5570303A5BB /* Sources */, - 6797EE802466FB38B4E3401FAE2E5B6A /* Frameworks */, - C868F0ACCAEEF6A280F67220FA841F18 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = CYLTabBarController; - productName = CYLTabBarController; - productReference = 42F5FA6E7FCA3D341F404BD60840A093 /* libCYLTabBarController.a */; - productType = "com.apple.product-type.library.static"; - }; - 2A22C4445F8FB3853FF5036E64CED171 /* TDTouchID */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1B9814DB59BF9387E1D479D7740809EA /* Build configuration list for PBXNativeTarget "TDTouchID" */; - buildPhases = ( - 0A76E5CB9E857AC00B67010B13807B8D /* Sources */, - 7B26109EBAAEEF711430A5725B7BBD52 /* Frameworks */, - 82114A1344B338BA2E02AE4AFFDD95CE /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TDTouchID; - productName = TDTouchID; - productReference = 418B172287A3B2DC4B566CC376D14A45 /* libTDTouchID.a */; - productType = "com.apple.product-type.library.static"; - }; - 2B91E81D8B4FCB63BB9F963DC1B6BDC8 /* YYText */ = { - isa = PBXNativeTarget; - buildConfigurationList = 50617C5FF2D8F394A228922DD738E27F /* Build configuration list for PBXNativeTarget "YYText" */; - buildPhases = ( - 87BFC41EC91ABD51BA511DC8DF1E865D /* Sources */, - 5E0BF02B022752CE24FAA0CAF404FB9D /* Frameworks */, - 886A6AF4D99ACC18E1BBB27D70026109 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = YYText; - productName = YYText; - productReference = 2981833DCCE11BFC4C1BD4A85EE693F2 /* libYYText.a */; - productType = "com.apple.product-type.library.static"; - }; - 325E0F928F4D0842ECDF259F63F1D842 /* GVUserDefaults */ = { - isa = PBXNativeTarget; - buildConfigurationList = 40EFAD85AD923A5CD33C91605CE38145 /* Build configuration list for PBXNativeTarget "GVUserDefaults" */; - buildPhases = ( - F2D4A52A499692354A19BD3E5EE17CDC /* Sources */, - 31023900B5572A6758634CFEC4360EF1 /* Frameworks */, - 27AA85537B99F71630A4A26DC3E7C663 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = GVUserDefaults; - productName = GVUserDefaults; - productReference = A7A1B5DC3C64D8E14B39057FD2C21C1A /* libGVUserDefaults.a */; - productType = "com.apple.product-type.library.static"; - }; - 4A8E51A0A93E9C040D40A734DBE550D0 /* Pods-iOSProject */ = { - isa = PBXNativeTarget; - buildConfigurationList = D4CDDA4916AAFC52C7FEB9B636E97C27 /* Build configuration list for PBXNativeTarget "Pods-iOSProject" */; - buildPhases = ( - AB7DE498CE7BF75F34DEB27691DB7184 /* Sources */, - 026D5C5C76439F83BEF1B3B1ADB191E5 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 1491F97F45B75D2537A037370AC69E40 /* PBXTargetDependency */, - 490430042308253E2FD0A6AF2643E8C2 /* PBXTargetDependency */, - 5CDAE252641B93C22489114CD48D9EE9 /* PBXTargetDependency */, - ECAD628B15E8E00FAC76B4594DAA07E8 /* PBXTargetDependency */, - CAE96A6283935E28A1F85F631AADC0F5 /* PBXTargetDependency */, - 70025B8DD531E4BCC9F8757516FF92F0 /* PBXTargetDependency */, - AFF7B4F517A43DF8865445F45EFDD0C0 /* PBXTargetDependency */, - 58439DFF5A701E1CB3A30467510B4157 /* PBXTargetDependency */, - 0BE96B4D0F7365638472FFDF393B2652 /* PBXTargetDependency */, - F17727E2DC28416BD2079295D0851D5B /* PBXTargetDependency */, - 4A0FD592B42FE6B4E31DC463ECD3D8FA /* PBXTargetDependency */, - 6D9EB04316D448848D1631814877467C /* PBXTargetDependency */, - C96ACFD56F88AFDFEAF4AAB250399E76 /* PBXTargetDependency */, - 0DD442407FC039934D30F70DC8DD6BD4 /* PBXTargetDependency */, - 7CF99B28C4D7A2E1521E30CDD9285C0D /* PBXTargetDependency */, - 95932F18AF5760ADC5DF5EADAA5B06E3 /* PBXTargetDependency */, - 4DBB5849DFABB81D90700EED6217DAF4 /* PBXTargetDependency */, - 06690631605E797A29BC695D60EB5080 /* PBXTargetDependency */, - 053D976033CCFE1C289B40A000E9F7D1 /* PBXTargetDependency */, - 706951034F7AD28C654F9F31A992CB65 /* PBXTargetDependency */, - 3B0BF5FE17040B54838A252BE99D87A0 /* PBXTargetDependency */, - FAC46C60E7115C4344C1C8F8713EF341 /* PBXTargetDependency */, - 927F1BD6F6E4AA337F11F2582E4AAE18 /* PBXTargetDependency */, - 2A43A347FDEA7D303A2B6C24E0C089B5 /* PBXTargetDependency */, - BDD38F026F3234325FCEB5C564423291 /* PBXTargetDependency */, - D1128142C772E06366B95AE58E92022E /* PBXTargetDependency */, - E7379C873586A2C1F05F454215FD4651 /* PBXTargetDependency */, - AF2CE25E1CDA6D0D2158F945F0AF621D /* PBXTargetDependency */, - ED38BA1D5D384B424D6B323016E75614 /* PBXTargetDependency */, - 27BF91D43A0FDF285EA532ED461F246F /* PBXTargetDependency */, - 54588C30678CE58DB05C17FF74397B99 /* PBXTargetDependency */, - 29CAD7DD7093159096FBCA4A54617750 /* PBXTargetDependency */, - 1764E11BB4EB75FCB34FB83B5ECED234 /* PBXTargetDependency */, - 0FA22D4B9A73CCC4CF8CC16ADB267041 /* PBXTargetDependency */, - ); - name = "Pods-iOSProject"; - productName = "Pods-iOSProject"; - productReference = 560F6CDFE0EDADC15962E6D461276AF9 /* libPods-iOSProject.a */; - productType = "com.apple.product-type.library.static"; - }; - 4DB8DEC4D389AEFE4B3A80E3C5B7DFC0 /* HMQRCodeScanner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 16FDD2EC731A981B24437193C522C1C3 /* Build configuration list for PBXNativeTarget "HMQRCodeScanner" */; - buildPhases = ( - 6DEB693B0445763363D5BEB85199A9F0 /* Sources */, - 08BE874A82C94F12BEAAF4E24BBAD110 /* Frameworks */, - 6F303F481354D8C781219154BA59C3EB /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = HMQRCodeScanner; - productName = HMQRCodeScanner; - productReference = 817542211EA857584373395E6EC78370 /* libHMQRCodeScanner.a */; - productType = "com.apple.product-type.library.static"; - }; - 52E7BDC90E6F2E284172E8317EDA09AF /* WebViewJavascriptBridge */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9AB8C5CE64D248AD4D8360850AEF7D09 /* Build configuration list for PBXNativeTarget "WebViewJavascriptBridge" */; - buildPhases = ( - 657E1257CC37E979815DFBBA2BC38DF5 /* Sources */, - 785B9F26C4F380B2D40F99738AB65AB7 /* Frameworks */, - 46C230273D71A42D904C198481E8AEB2 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = WebViewJavascriptBridge; - productName = WebViewJavascriptBridge; - productReference = 45580AD579EED023106F243FBBBF4603 /* libWebViewJavascriptBridge.a */; - productType = "com.apple.product-type.library.static"; - }; - 5531A66C90D28B1F40553C98CB7E53D9 /* DWBubbleMenuButton */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7EC6DAE07638ECBEF222E34E80139168 /* Build configuration list for PBXNativeTarget "DWBubbleMenuButton" */; - buildPhases = ( - 080766366AB71B4BF28E8527B0CF35AE /* Sources */, - 5A3883154EE20A6C0C832DF202024333 /* Frameworks */, - 5CA28E205743E7F6152AC8603EF43445 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = DWBubbleMenuButton; - productName = DWBubbleMenuButton; - productReference = 5D1CDBC2850AABFC6AD84E95236BEB14 /* libDWBubbleMenuButton.a */; - productType = "com.apple.product-type.library.static"; - }; - 586F2DFA9BDCC6675C2546793A69E5CC /* MBProgressHUD */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6B44251FA50022CA55D4B2FBE1468C76 /* Build configuration list for PBXNativeTarget "MBProgressHUD" */; - buildPhases = ( - FCC28E36A289F7E991B78A63CD0251F9 /* Sources */, - F9AC974E3329F79899A7B3BE290FC894 /* Frameworks */, - 1B1D84BCA4F7BDAE79C37DF88C9DCE23 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = MBProgressHUD; - productName = MBProgressHUD; - productReference = CB6CD635AD78C2FED48EE114F69CF115 /* libMBProgressHUD.a */; - productType = "com.apple.product-type.library.static"; - }; - 66AB20B3D6E7648A21FE0FACD999D7E0 /* ZJScrollPageView */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2E5216327B72AF0403A34732C4E08CB4 /* Build configuration list for PBXNativeTarget "ZJScrollPageView" */; - buildPhases = ( - 7D5A96ED2B6AAC1F94658251DCB100D9 /* Sources */, - 6E54AE8468E565E966E1CF8B5582638C /* Frameworks */, - 77BB1FD0E164E723835AE30CBF108138 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ZJScrollPageView; - productName = ZJScrollPageView; - productReference = DC9D8982F97FE5F9A6042FC2B6C9100A /* libZJScrollPageView.a */; - productType = "com.apple.product-type.library.static"; - }; - 6EC166B8BFAEC80A53C7B88AD9D967E6 /* FCUUID */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8BA5F9CB4F4935C86F2BAD30D3F7B423 /* Build configuration list for PBXNativeTarget "FCUUID" */; - buildPhases = ( - 6D271F7B19A2A87C50EE739DC781951F /* Sources */, - C18929AFC5A0277C896CBBBBF89154A8 /* Frameworks */, - 01DF1C039BBD224F5E639EEB968B69CD /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 08CCA64C81FEB56F3BD699C587418B93 /* PBXTargetDependency */, - ); - name = FCUUID; - productName = FCUUID; - productReference = FECD1385947157F0113B98994A52CEFA /* libFCUUID.a */; - productType = "com.apple.product-type.library.static"; - }; - 77429824F3675AB1A2CE34A6E0BDD468 /* YYCategories */ = { - isa = PBXNativeTarget; - buildConfigurationList = E804C582F5CDA98B4E014AD4EBB9040F /* Build configuration list for PBXNativeTarget "YYCategories" */; - buildPhases = ( - 87F91C7DEE875EF47FA556ACFC7D2C4E /* Sources */, - A7DAC0D935C218C8922C4376A0C60E8C /* Frameworks */, - 05C1BB9626797C7B65BB4D5282B448DD /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = YYCategories; - productName = YYCategories; - productReference = 3E6E540E74178FA3B475564EC9414466 /* libYYCategories.a */; - productType = "com.apple.product-type.library.static"; - }; - 78E8E726824C97E61A093458715C042A /* ZFDownload */ = { - isa = PBXNativeTarget; - buildConfigurationList = FD53E3A93BF3BCD466A2D70FB183DF35 /* Build configuration list for PBXNativeTarget "ZFDownload" */; - buildPhases = ( - 7CADB3B68ADDD7322372BD860055AD65 /* Sources */, - 2A0F08D7678206505DAD63BD722A643E /* Frameworks */, - 54ABE24AD389F736D63043E31F3F36B8 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 78DC4997A444AA369D8785D4838678D7 /* PBXTargetDependency */, - ); - name = ZFDownload; - productName = ZFDownload; - productReference = 3A36F0C2C74FBAA2BE7140E1CC039547 /* libZFDownload.a */; - productType = "com.apple.product-type.library.static"; - }; - 8642CC820CE8C5B88C113D7F47AF4BC3 /* FMDB */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1BA066B3D32C553BF37E3322F9113F02 /* Build configuration list for PBXNativeTarget "FMDB" */; - buildPhases = ( - ADE36E87832B736E1FAF9E50036C1530 /* Sources */, - 025694188CB9A7D96CC58750018B4FFC /* Frameworks */, - A93D3ABB603D66C647446B37AA29FE64 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = FMDB; - productName = FMDB; - productReference = A521D5CDE091E2A44A4D7A4CEDC3278E /* libFMDB.a */; - productType = "com.apple.product-type.library.static"; - }; - 8C603CC4B51BC8FB05654BF104CB6C64 /* SDCycleScrollView */ = { - isa = PBXNativeTarget; - buildConfigurationList = CF3B4F9D4BA5E6D4A796083F07999888 /* Build configuration list for PBXNativeTarget "SDCycleScrollView" */; - buildPhases = ( - CDCD5EA2A7FF27ECFDED2AA5F184EAF8 /* Sources */, - DB226AECEC053458FE2449D96CE2F7ED /* Frameworks */, - 4066C15D14D3EA454B28E0A3BDBE657C /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 28FAC1F471ECD708FEBC9560A353359F /* PBXTargetDependency */, - ); - name = SDCycleScrollView; - productName = SDCycleScrollView; - productReference = 73149727F9CF5BE11CEFB827282F7ACC /* libSDCycleScrollView.a */; - productType = "com.apple.product-type.library.static"; - }; - 904F4F27FD314010A3812EB2A9306183 /* IQKeyboardManager */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3A073C78D19617C74EEAEA91C3038721 /* Build configuration list for PBXNativeTarget "IQKeyboardManager" */; - buildPhases = ( - D7C932479C1FCEB09BB1AD1D3D44A87C /* Sources */, - 64786C9E4ED20F0FD5D947A7C759FE3B /* Frameworks */, - 3BB32FFA9CFEC89EF803C6A9C28804EC /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = IQKeyboardManager; - productName = IQKeyboardManager; - productReference = 6280AC1707A75E995D09994C02800BF2 /* libIQKeyboardManager.a */; - productType = "com.apple.product-type.library.static"; - }; - 92BA053EDCAD49E6DB97E83B24319F48 /* SDWebImage */ = { - isa = PBXNativeTarget; - buildConfigurationList = 10437A8EAAC4147D3BC67D27D9BFE9BE /* Build configuration list for PBXNativeTarget "SDWebImage" */; - buildPhases = ( - 847008116AAC51263D1FD39A82BAE81F /* Sources */, - 588865044F7CAA5963FF67F83E12FB16 /* Frameworks */, - 233833543E0ADA3BF9FE1381C3DC4923 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SDWebImage; - productName = SDWebImage; - productReference = E9947B34ED2E82EA97602CC7AC545A77 /* libSDWebImage.a */; - productType = "com.apple.product-type.library.static"; - }; - 956D15E751CE0B7A4B2A712076C19498 /* Toast */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1FD3606E6C5C793CD00615035B413FAA /* Build configuration list for PBXNativeTarget "Toast" */; - buildPhases = ( - 4098E05CCA0B0CE5388825A8C581562D /* Sources */, - B6FB090EFCCE9245B0F784159C89BDB5 /* Frameworks */, - 54609028CACFCC88962C2E9D034F30B8 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Toast; - productName = Toast; - productReference = F0DD9E857638216395D0352D4053B688 /* libToast.a */; - productType = "com.apple.product-type.library.static"; - }; - 9C623D1AF8229419BA603B3C66BE24B9 /* Reachability */ = { - isa = PBXNativeTarget; - buildConfigurationList = D4DBEC0E8F0235A283B222254D95CF85 /* Build configuration list for PBXNativeTarget "Reachability" */; - buildPhases = ( - 73DE491DD5AABE8390F4CC5AD47B2FCE /* Sources */, - A6A43C84AE422587C780462ED3F1FE59 /* Frameworks */, - 3B43650D180636CE1DD02ABED51A0611 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Reachability; - productName = Reachability; - productReference = B4E0EA056E01EDF71080E5F50FB30D7A /* libReachability.a */; - productType = "com.apple.product-type.library.static"; - }; - 9DC8D9E02903E93BD0B2FEC9D846EA20 /* Masonry */ = { - isa = PBXNativeTarget; - buildConfigurationList = 34CAE1CB89EDBF2E53735CC5D4E5E69F /* Build configuration list for PBXNativeTarget "Masonry" */; - buildPhases = ( - 27E8E3A06AAFF112FF7BC4F0117165D8 /* Sources */, - 6FD8312A1AEB348F49A81C438DB25115 /* Frameworks */, - BDF73468622762862D2FB76ED4AC0D8E /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Masonry; - productName = Masonry; - productReference = E9C80FFBB79B3AF9974EECC83EA74CD0 /* libMasonry.a */; - productType = "com.apple.product-type.library.static"; - }; - 9E033EDB5EC0819481B0546434FA577B /* AFNetworking */ = { - isa = PBXNativeTarget; - buildConfigurationList = 483FBC4A668BF7F1A8767452E7E188AC /* Build configuration list for PBXNativeTarget "AFNetworking" */; - buildPhases = ( - AAEE4C1DF970D446DF57CA3DDD16AD00 /* Sources */, - F3284DBE3CA8932733932AD2A48445B2 /* Frameworks */, - 0A1C2B07813030B0D51EB1D804A4439E /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AFNetworking; - productName = AFNetworking; - productReference = 83366A1B2B7425448492B9BB441A5CA6 /* libAFNetworking.a */; - productType = "com.apple.product-type.library.static"; - }; - A08CF8B6B4281979AD047CC2A26962D0 /* YYAsyncLayer */ = { - isa = PBXNativeTarget; - buildConfigurationList = 14A04CEA87E6B0707FAEA26DB217F398 /* Build configuration list for PBXNativeTarget "YYAsyncLayer" */; - buildPhases = ( - B0FD6081B70EE563466D789DAF67B146 /* Sources */, - 0C7E176709FF10E17328ACB8AFE69014 /* Frameworks */, - 4CCC7158BB1557CFF1E76238D0B2B3C0 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = YYAsyncLayer; - productName = YYAsyncLayer; - productReference = ECAC23D1B877D674E089FC42BCF4DE67 /* libYYAsyncLayer.a */; - productType = "com.apple.product-type.library.static"; - }; - A316B54C67E947D23CECD230FA5BFAEF /* MJExtension */ = { - isa = PBXNativeTarget; - buildConfigurationList = 64EE246612F53A73C8FBFCEC3A61508A /* Build configuration list for PBXNativeTarget "MJExtension" */; - buildPhases = ( - 9087206CF402094899352A19C262EFF6 /* Sources */, - B57134F14D0B782971053CD2EB92CC0C /* Frameworks */, - 864D7FF60E899EA81A55C0B7F82FC174 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = MJExtension; - productName = MJExtension; - productReference = B9F3BE60A1F49D87A55261B0C9D85B1B /* libMJExtension.a */; - productType = "com.apple.product-type.library.static"; - }; - BCB3669B52B845FD733208787CD024E2 /* HMEmoticon */ = { - isa = PBXNativeTarget; - buildConfigurationList = B478497FCC9A8F71855DE7736ECEBD4F /* Build configuration list for PBXNativeTarget "HMEmoticon" */; - buildPhases = ( - 196458DF9CCE9F994AB89EE987F81C4C /* Sources */, - E206E1BC3D328D29ADDF81FC717125FB /* Frameworks */, - 8D4D43186038F8CEEC0C677112F102D7 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = HMEmoticon; - productName = HMEmoticon; - productReference = F0F2271E95625E09CAF2C433E53FEB94 /* libHMEmoticon.a */; - productType = "com.apple.product-type.library.static"; - }; - BDB45DD6D41488A346190E17DEF63592 /* M13ProgressSuite */ = { - isa = PBXNativeTarget; - buildConfigurationList = 0E4219F8F2B7C117EB0957B505EB1ABE /* Build configuration list for PBXNativeTarget "M13ProgressSuite" */; - buildPhases = ( - 981E1388D48765ADC17E45170B5642C4 /* Sources */, - 3CC67E767A0BDC077552344530C2E810 /* Frameworks */, - EC5AAAA93E19969D88570EA3E023DF62 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = M13ProgressSuite; - productName = M13ProgressSuite; - productReference = 36B3099D08D46D39364C35161B90D5DA /* libM13ProgressSuite.a */; - productType = "com.apple.product-type.library.static"; - }; - C1FD7413DA4D1D8C453C6C0DF2243636 /* MOFSPickerManager */ = { - isa = PBXNativeTarget; - buildConfigurationList = CF49B975B14CD821044B4E857E9AD07F /* Build configuration list for PBXNativeTarget "MOFSPickerManager" */; - buildPhases = ( - 13B84D876935610AF86D3CBE38251919 /* Sources */, - E587BD80F986EDFC117AEFA8B72A36B2 /* Frameworks */, - 4A99AD916B0D025A576A79FB67655B5F /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = MOFSPickerManager; - productName = MOFSPickerManager; - productReference = 636BD41BB7BF75FCBCF8A9F7E68F278E /* libMOFSPickerManager.a */; - productType = "com.apple.product-type.library.static"; - }; - C93D9A8CEE42F2E461C1A028CBA3E5A3 /* KILabel */ = { - isa = PBXNativeTarget; - buildConfigurationList = 85BC96F4431110E0E0DCEF117BEDCC13 /* Build configuration list for PBXNativeTarget "KILabel" */; - buildPhases = ( - 49F638280EC0E173C956EA07930800DB /* Sources */, - D8686559EDC73C3296BEAC60DDBA4797 /* Frameworks */, - 425B7B3A149EACD8B0407F073D8E6E7B /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = KILabel; - productName = KILabel; - productReference = C49B4CD148973E43968F996FABE95189 /* libKILabel.a */; - productType = "com.apple.product-type.library.static"; - }; - D51A7C33D6CB5BFE4110037FB616A385 /* ZFPlayer */ = { - isa = PBXNativeTarget; - buildConfigurationList = E00BEBACD2DAE8C7C1CEDEDD6327F8E9 /* Build configuration list for PBXNativeTarget "ZFPlayer" */; - buildPhases = ( - 9E2A650DF17D57B60D78DD3741B48CCC /* Sources */, - 69DF017CCB3AF38467F09AEE4EF57354 /* Frameworks */, - DA45582207DB67477A2F9BF65FAD0D95 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 4B13AE9BA1A417BFDD401EA91934EC73 /* PBXTargetDependency */, - ); - name = ZFPlayer; - productName = ZFPlayer; - productReference = 7D5F35384A1CABA1784B2B17184D4415 /* libZFPlayer.a */; - productType = "com.apple.product-type.library.static"; - }; - DA192B47B547BB1AA408F674C3A089B2 /* LxGridView */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4ADEEC86E8BBACEDB89D0383E538F6CA /* Build configuration list for PBXNativeTarget "LxGridView" */; - buildPhases = ( - FE59CBEDF54E73172C678ADB71FD1923 /* Sources */, - AF3387F0D14D899AE7942AE67F266DD7 /* Frameworks */, - 6331C6E381FCAD4D09D878562F820C35 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = LxGridView; - productName = LxGridView; - productReference = 3FA26AA6F0CD1055A5F0DBC564D1D068 /* libLxGridView.a */; - productType = "com.apple.product-type.library.static"; - }; - E0C2B1D1DA662576BF72BB3F3EBEF660 /* TZImagePickerController */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7485A782F38B3888D93D5B9617864D6D /* Build configuration list for PBXNativeTarget "TZImagePickerController" */; - buildPhases = ( - 4BBC93DF0461D8BF6596B670CAC3DBAF /* Sources */, - 020C057685C0595261B66343DB01E359 /* Frameworks */, - 0DB27FFA0E1E539569F6BF31263A9041 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TZImagePickerController; - productName = TZImagePickerController; - productReference = 0A516C89E800F6996156F3C0C2BCC4F1 /* libTZImagePickerController.a */; - productType = "com.apple.product-type.library.static"; - }; - EE366E1E6962F82E6AEC8AE66FA66CBF /* FDFullscreenPopGesture */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1375982388E24238B8AA563D203E6661 /* Build configuration list for PBXNativeTarget "FDFullscreenPopGesture" */; - buildPhases = ( - 12A8BCA3116C4E83541DBCE7C0AA0B86 /* Sources */, - 7EC16DA88EC957C6C5852917E403CDE7 /* Frameworks */, - 6528D49BBCDEB5E0F7B2BDF1992AD226 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = FDFullscreenPopGesture; - productName = FDFullscreenPopGesture; - productReference = 0F84FE2B1ED09804709BF32C8EE4884D /* libFDFullscreenPopGesture.a */; - productType = "com.apple.product-type.library.static"; - }; - F0EA78F8F3362DEBC9840500226DA5E7 /* ASIHTTPRequest */ = { - isa = PBXNativeTarget; - buildConfigurationList = 168208ED59AC780D09813BE050F09789 /* Build configuration list for PBXNativeTarget "ASIHTTPRequest" */; - buildPhases = ( - FC7004C9F8C5DF68752BDF9DBE905CC4 /* Sources */, - 2F53E11B780BCFB348E6374C74EA86B2 /* Frameworks */, - 2AF88DFD5EF7625AEDD51366BAA1BE5F /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 5572CE11D4CE5662B2156FE53D1FDBB9 /* PBXTargetDependency */, - ); - name = ASIHTTPRequest; - productName = ASIHTTPRequest; - productReference = 64C299A38AF8C4DBD1EE52BFA5F4B304 /* libASIHTTPRequest.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = ""; - LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0920; - }; - buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 8.0"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = E0B4D7908B7E5292209E24F2082030E4 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 9E033EDB5EC0819481B0546434FA577B /* AFNetworking */, - F0EA78F8F3362DEBC9840500226DA5E7 /* ASIHTTPRequest */, - 272B6902EC233437C8C814A53CD3E70D /* CYLTabBarController */, - 5531A66C90D28B1F40553C98CB7E53D9 /* DWBubbleMenuButton */, - 6EC166B8BFAEC80A53C7B88AD9D967E6 /* FCUUID */, - EE366E1E6962F82E6AEC8AE66FA66CBF /* FDFullscreenPopGesture */, - 8642CC820CE8C5B88C113D7F47AF4BC3 /* FMDB */, - 325E0F928F4D0842ECDF259F63F1D842 /* GVUserDefaults */, - BCB3669B52B845FD733208787CD024E2 /* HMEmoticon */, - 4DB8DEC4D389AEFE4B3A80E3C5B7DFC0 /* HMQRCodeScanner */, - 904F4F27FD314010A3812EB2A9306183 /* IQKeyboardManager */, - C93D9A8CEE42F2E461C1A028CBA3E5A3 /* KILabel */, - DA192B47B547BB1AA408F674C3A089B2 /* LxGridView */, - BDB45DD6D41488A346190E17DEF63592 /* M13ProgressSuite */, - 9DC8D9E02903E93BD0B2FEC9D846EA20 /* Masonry */, - 586F2DFA9BDCC6675C2546793A69E5CC /* MBProgressHUD */, - A316B54C67E947D23CECD230FA5BFAEF /* MJExtension */, - 04CF549EBEEE7BC87AEAE35397184D94 /* MJRefresh */, - C1FD7413DA4D1D8C453C6C0DF2243636 /* MOFSPickerManager */, - 4A8E51A0A93E9C040D40A734DBE550D0 /* Pods-iOSProject */, - 9C623D1AF8229419BA603B3C66BE24B9 /* Reachability */, - 8C603CC4B51BC8FB05654BF104CB6C64 /* SDCycleScrollView */, - 92BA053EDCAD49E6DB97E83B24319F48 /* SDWebImage */, - 2A22C4445F8FB3853FF5036E64CED171 /* TDTouchID */, - 956D15E751CE0B7A4B2A712076C19498 /* Toast */, - E0C2B1D1DA662576BF72BB3F3EBEF660 /* TZImagePickerController */, - 1D2C839B3013830CA2082E7574526716 /* UICKeyChainStore */, - 52E7BDC90E6F2E284172E8317EDA09AF /* WebViewJavascriptBridge */, - A08CF8B6B4281979AD047CC2A26962D0 /* YYAsyncLayer */, - 77429824F3675AB1A2CE34A6E0BDD468 /* YYCategories */, - 081C5DFBFB255EFA239E2A10EED8389F /* YYImage */, - 2B91E81D8B4FCB63BB9F963DC1B6BDC8 /* YYText */, - 78E8E726824C97E61A093458715C042A /* ZFDownload */, - D51A7C33D6CB5BFE4110037FB616A385 /* ZFPlayer */, - 66AB20B3D6E7648A21FE0FACD999D7E0 /* ZJScrollPageView */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 0799A6B09341C0AC1C22A5570303A5BB /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D87E061A6A7D6083B1244FF21DA5D474 /* CYLPlusButton.m in Sources */, - CDD283707BC02BF42AB32281ADBFDC4A /* CYLTabBar.m in Sources */, - FDBE699FBFBC5B8C2BDA86A99DB319ED /* CYLTabBarController-dummy.m in Sources */, - 0ED58D2A5AAECE08B4C17BF909301570 /* CYLTabBarController.m in Sources */, - FE01A3B572C748157BF7FEB4687610E1 /* UIControl+CYLTabBarControllerExtention.m in Sources */, - 559CFB17EC0E61F61687D0117F388C8C /* UITabBarItem+CYLTabBarControllerExtention.m in Sources */, - 0407F59BDF3F4BD9362D3CD26345BC3D /* UIView+CYLTabBarControllerExtention.m in Sources */, - C2D6671A94EECD8D8E8A2B5984ADBA51 /* UIViewController+CYLTabBarControllerExtention.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 080766366AB71B4BF28E8527B0CF35AE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 31A9E5DFDE1507AE1CD807EFDE72FF25 /* DWBubbleMenuButton-dummy.m in Sources */, - D511CE68D3DB1CD20967C9FFBA0ECFCC /* DWBubbleMenuButton.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 0A76E5CB9E857AC00B67010B13807B8D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1640FA08AD4AF25C3E122354EDA931EA /* AppDelegate.m in Sources */, - C723C4FAB031AF6811A4B1DC5D105AF6 /* main.m in Sources */, - E433F3B13C8489709BD5314FD419E7CB /* TDHomeViewController.m in Sources */, - 56E9D3B53FDEE02F30ADEB0B079F39EF /* TDMainViewController.m in Sources */, - D73761F1FC096B8845D7BBCEA6A814F8 /* TDTouchID-dummy.m in Sources */, - 50650BB1E2D3709A51FEB06105760E0B /* TDTouchID.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 12A8BCA3116C4E83541DBCE7C0AA0B86 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 59D24ED7149E9CBF24456D55FD5D038A /* FDFullscreenPopGesture-dummy.m in Sources */, - 4D213CA3C6256131073EB91F8C32F280 /* UINavigationController+FDFullscreenPopGesture.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 13B84D876935610AF86D3CBE38251919 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E863BB0FF031A14926EF168323C6A80A /* AddressModel.m in Sources */, - 4893A1231FE1BBD188E65987D46A2874 /* GDataXMLNode.m in Sources */, - 515596BBA3E24B832603F670A98F1D0E /* MOFSAddressPickerView.m in Sources */, - 72E8C11E0390835E8A78EDA98DAEDD38 /* MOFSDatePicker.m in Sources */, - BF772D81E718C2690DD69E80C46AFD4A /* MOFSPickerManager-dummy.m in Sources */, - 8DCADD590BE6C4ED74918486BAC63A19 /* MOFSPickerManager.m in Sources */, - C634F239D93A1722D8DF7530C4CAA030 /* MOFSPickerView.m in Sources */, - 2000F4189F47E6AEE3E0930D3C80BD24 /* MOFSToolbar.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 196458DF9CCE9F994AB89EE987F81C4C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4E0819264698C01F09B4B3FB21DE391C /* HMEmoticon-dummy.m in Sources */, - F8F5EF8E6DBDEFFEBF4D710558A5FA75 /* HMEmoticon.m in Sources */, - 58A358EDAB67CEA0048A2D35F628EAAB /* HMEmoticonAttachment.m in Sources */, - 4FF9A1EC630C78046B6AC476A76E1275 /* HMEmoticonButton.m in Sources */, - 6FE96818920132E3ACD9E70083FB2116 /* HMEmoticonCell.m in Sources */, - 5E9DBA9B095B2B28272F78AD107CAE01 /* HMEmoticonInputView.m in Sources */, - 39C9BEF6A8CFDA39A702CE10EB423609 /* HMEmoticonManager.m in Sources */, - 59A78F08AADC37538C1419F1A8848038 /* HMEmoticonPackage.m in Sources */, - 77CA93753D830C9DBC675A8F0FAE6DFA /* HMEmoticonTextView.m in Sources */, - 2B1CC3DEC1BDF26E12315CCFA89366E3 /* HMEmoticonTipView.m in Sources */, - 0ADBFEB0D1D6E1355492BD048A29DC1C /* HMEmoticonToolbar.m in Sources */, - 01D4B0F5EA31B158325E058CF6623B9A /* NSBundle+HMEmoticon.m in Sources */, - 5007B2C48DDA5DB0B214883FD15A40C6 /* NSString+HMEmoji.m in Sources */, - A28DC8A4D0B50B5D84E90B318E8A5FF6 /* UIImage+HMEmoticon.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 27E8E3A06AAFF112FF7BC4F0117165D8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F390D582745DF3516ADD4D910A2ACFFA /* MASCompositeConstraint.m in Sources */, - 1AF513D8D71B663D5422760106B13723 /* MASConstraint.m in Sources */, - 99E00D593F76D7E6C96300345E211282 /* MASConstraintMaker.m in Sources */, - 61C611ABFFC5FFF35ACE70883CB8F523 /* MASLayoutConstraint.m in Sources */, - 5B46C39A3F939EDB676981756CC24007 /* Masonry-dummy.m in Sources */, - CEF7E139022FFA4F5C99D4DC5DE67990 /* MASViewAttribute.m in Sources */, - D8D72BEC4364E9F77BCC6B8AB4E30DF3 /* MASViewConstraint.m in Sources */, - 14B65CE3038761FA8F6F5D1ECED6A562 /* NSArray+MASAdditions.m in Sources */, - B953667D411D1DCD919CBD314F568A92 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */, - 548BBD5B63FA097F419829C3EE8EA068 /* View+MASAdditions.m in Sources */, - 466869E41EB306F74C8A6E87CC1539BF /* ViewController+MASAdditions.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4098E05CCA0B0CE5388825A8C581562D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 27A19A74901197C453148CF5ADDF16D3 /* Toast-dummy.m in Sources */, - D41FF7179EBCF62481A135195B27DB45 /* UIView+Toast.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 49F638280EC0E173C956EA07930800DB /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C3328396BFC65BB712096C8940700007 /* KILabel-dummy.m in Sources */, - 7E7C7FFBA9E1B3951057E18104DE7C7A /* KILabel.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BBC93DF0461D8BF6596B670CAC3DBAF /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C97FA164F7B64715FB1C3FE4B5D43D18 /* NSBundle+TZImagePicker.m in Sources */, - 11F2A5CEE35A985066119917D56180B2 /* TZAssetCell.m in Sources */, - 457A167D598A42BEB0F1D94345BA3AC1 /* TZAssetModel.m in Sources */, - B0EE417551C6C35CC5449418D15A646D /* TZGifPhotoPreviewController.m in Sources */, - E49EE1E3FF9065337C5CA294C924B996 /* TZImageCropManager.m in Sources */, - CE4486E65F9154EB7DBB411389EEE23A /* TZImageManager.m in Sources */, - 700B72413D6A1F80135507E0BD553EA6 /* TZImagePickerController-dummy.m in Sources */, - 766F1BCDB7FF10F14B2D5ABD16108434 /* TZImagePickerController.m in Sources */, - 3627A172165A56A2E020DCAFECC5B61E /* TZLocationManager.m in Sources */, - AAB8C5D58383B69F7D158448130D2770 /* TZPhotoPickerController.m in Sources */, - 874BF4D6D3E4F0878FE43BBA40D0C495 /* TZPhotoPreviewCell.m in Sources */, - C9D62A960CE7DDE668B9362BE2275B39 /* TZPhotoPreviewController.m in Sources */, - 91BBA41BC82E3997B8936D74FBA5219B /* TZProgressView.m in Sources */, - E28E77149F65BEE996E2209670A93BAD /* TZVideoPlayerController.m in Sources */, - 3882FE4E010F4E8CAAA6C62094BE2BFD /* UIView+Layout.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 657E1257CC37E979815DFBBA2BC38DF5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 39A79DD6C7781F9550ACA2F6B7E6C025 /* WebViewJavascriptBridge-dummy.m in Sources */, - 302CD6E1132D7C6ABDB789ED4BF3551A /* WebViewJavascriptBridge.m in Sources */, - E2A9FEF620828FE58DF7A2C322A1CC0B /* WebViewJavascriptBridge_JS.m in Sources */, - 79C41510B2AAD4818ED053836CDA2DB7 /* WebViewJavascriptBridgeBase.m in Sources */, - DFCDFF9F5C38F6E0905EA02A3C7E1202 /* WKWebViewJavascriptBridge.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D271F7B19A2A87C50EE739DC781951F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4AF78C9F41D715F3D982770CE4BA393C /* FCUUID-dummy.m in Sources */, - E5EB57C251C7441BD4FED030A14AF18B /* FCUUID.m in Sources */, - 09D84B5D8051B29A9522E0073B750B47 /* UIDevice+FCUUID.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6DEB693B0445763363D5BEB85199A9F0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3A94AB6947C689C0F50FF79BEA6D1350 /* HMQRCodeScanner-dummy.m in Sources */, - 63157671B6B124E396B71551F43F695F /* HMScanerCardViewController.m in Sources */, - EC112E5A29750E7528EAD8C558533317 /* HMScanner.m in Sources */, - 73FE3D89F284D4156A7E8DB12B3B5CB9 /* HMScannerBorder.m in Sources */, - ABBA76366E9A097FC21D773579E3E2A4 /* HMScannerController.m in Sources */, - DA1A145A92D246BA165FC54A1B61A734 /* HMScannerMaskView.m in Sources */, - 08FDC2AD7ED2C97EDF4AF85066B3FE1F /* HMScannerViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 73DE491DD5AABE8390F4CC5AD47B2FCE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 44B02C1031D0E64D42278B2E8BCEF40F /* Reachability-dummy.m in Sources */, - ACED284762F9340A078A7AA6D1142B13 /* Reachability.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7CADB3B68ADDD7322372BD860055AD65 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 24D30F880C12CCB385A502BB9FC3D5A6 /* ZFCommonHelper.m in Sources */, - B0ECB2B27DEDE4F88356E3361BD25FDC /* ZFDownload-dummy.m in Sources */, - 6435A921D5FDC8ECD6CEC87BDC1E893A /* ZFDownloadManager.m in Sources */, - 1AB4C21977AAE6A5970EE847DBC031A2 /* ZFFileModel.m in Sources */, - A8B24A7F54E8FFE86264CFBBB25971F7 /* ZFHttpRequest.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7D5A96ED2B6AAC1F94658251DCB100D9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B16715A33860CE835A36CD5340E47B8 /* UIView+ZJFrame.m in Sources */, - 0678243B17657532638883CAAA4194C3 /* UIViewController+ZJScrollPageController.m in Sources */, - 3E83B48800BE69AEB51EF882BF0228ED /* ZJContentView.m in Sources */, - 85C98166513D2C69864D07C8DD50949C /* ZJScrollPageView-dummy.m in Sources */, - A06916C704AC2C155B942F6CFA130B3E /* ZJScrollPageView.m in Sources */, - EF84F20F8F09C26FBA8D610DBCABB6D1 /* ZJScrollSegmentView.m in Sources */, - 391427C49ACE54B991567FB2112733AA /* ZJSegmentStyle.m in Sources */, - 5C1D95A8C44B48A3427F554773BB8F77 /* ZJTitleView.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 847008116AAC51263D1FD39A82BAE81F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 66F90F1015BB4523671823FAE42F38E2 /* NSData+ImageContentType.m in Sources */, - 5FBD075B703CCD048BF782A75BDEBBDF /* NSImage+WebCache.m in Sources */, - EC4C13D361196AE89B42FC529418FA6A /* SDImageCache.m in Sources */, - 5E952397B5F31DDC92B3F9AF94C30CD6 /* SDImageCacheConfig.m in Sources */, - A0FBB343BF33E05A08C92761DAA3101C /* SDWebImage-dummy.m in Sources */, - 9561B327AB56D1CC92608003416079A8 /* SDWebImageCoder.m in Sources */, - 50CCB89003194D1903DA7C82CBB2AF84 /* SDWebImageCoderHelper.m in Sources */, - 57FF101F13F2AC67427105C6332EB867 /* SDWebImageCodersManager.m in Sources */, - 08F608084CBF01ECF45F66ED9F1FA92F /* SDWebImageCompat.m in Sources */, - ED1E1D78F84B9388491D4BE42977C785 /* SDWebImageDownloader.m in Sources */, - 9B00BC65F8ADC243F0E441846CCAFD81 /* SDWebImageDownloaderOperation.m in Sources */, - E75AA2C4BB7D17C32BBDDA339AEEF59C /* SDWebImageFrame.m in Sources */, - EF1B01D84E0EDE8A16D29F8817D53C0B /* SDWebImageGIFCoder.m in Sources */, - 41A2A2DE9908D4AA737BDAEB0F48FABC /* SDWebImageImageIOCoder.m in Sources */, - 2BB5AD6F438779BEE675D0D93ABBAEE6 /* SDWebImageManager.m in Sources */, - 51534247A1560905791D7DD0F9B7F30A /* SDWebImagePrefetcher.m in Sources */, - 3FE54E601C84BA38C879412CBC08BA7B /* UIButton+WebCache.m in Sources */, - 691E26B624EDF016E870622965A7B9D0 /* UIImage+ForceDecode.m in Sources */, - 88162D6722D9C0401904632FADFFB0CA /* UIImage+GIF.m in Sources */, - 097AE45DBDF26E2A1345907C83748EBA /* UIImage+MultiFormat.m in Sources */, - 9AC6F308C3C9E3E4C5AF0AD9CAFF9002 /* UIImageView+HighlightedWebCache.m in Sources */, - 6D630E377B0361624556CF02C06F0BBB /* UIImageView+WebCache.m in Sources */, - B374684075DE1BF926B2000FF5C74A9A /* UIView+WebCache.m in Sources */, - F10BCB335B079D7BF31A8C7140D1E600 /* UIView+WebCacheOperation.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 87BFC41EC91ABD51BA511DC8DF1E865D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C1093F4FCB1CDCDBF5F094ADBF95F809 /* NSAttributedString+YYText.m in Sources */, - 57F9AEB4A350C6B8C21E6681B88E40E6 /* NSParagraphStyle+YYText.m in Sources */, - 3A12A8E49A17C94B3A8CB36E6B10E8DE /* UIPasteboard+YYText.m in Sources */, - DCF830479F7620B86623FE8828153A76 /* UIView+YYText.m in Sources */, - 47A96DDD9D7CD5E6B3C032F2FAB25835 /* YYLabel.m in Sources */, - A8A7FFD7170E6EDF638A15E54C2AC6EE /* YYText-dummy.m in Sources */, - 75453456BA18D6C475929B2FD7E6889D /* YYTextArchiver.m in Sources */, - 583AEAC800E8D8762DDCFB198A0FFB68 /* YYTextAsyncLayer.m in Sources */, - ACA404356DBBDA233F421EE4BA814040 /* YYTextAttribute.m in Sources */, - 519A1E91BA9DADF8D5449137AA94EE7F /* YYTextContainerView.m in Sources */, - 4F7D46D6C54A463482DA5CE067E5CBD9 /* YYTextDebugOption.m in Sources */, - 066C90C3BF551D839E70586BC140B2AD /* YYTextEffectWindow.m in Sources */, - 0FF11CB7F99180F4519D7B3CE43AC4E7 /* YYTextInput.m in Sources */, - 49E1B9C5F10F80E82C3CF8D2B344DEDC /* YYTextKeyboardManager.m in Sources */, - 0222F804E01CA646D7805E98684CCBF0 /* YYTextLayout.m in Sources */, - D03727B22AC2FDBEFC30BC22E1C2A1FA /* YYTextLine.m in Sources */, - DED2713E4D3222E1BFE8126988746FF5 /* YYTextMagnifier.m in Sources */, - B3E6E0C6FCD7A7938D8CD72D701E6162 /* YYTextParser.m in Sources */, - 0F1BE281A5D6542F9B71A485F8571EE6 /* YYTextRubyAnnotation.m in Sources */, - D9D6E770BD027615D160CEAF9ABA0A2A /* YYTextRunDelegate.m in Sources */, - D9B528173A257A79D57345A1F26E2688 /* YYTextSelectionView.m in Sources */, - E29BABB6DB1A6E5C3F2E468436CD3DC7 /* YYTextTransaction.m in Sources */, - 4D89A8635D7444A224AAFEE5B753EC90 /* YYTextUtilities.m in Sources */, - 3CEC16FD15563EF33A7922C28ACAEC80 /* YYTextView.m in Sources */, - DAFF453818AAC491DA49A5562DBB7B9B /* YYTextWeakProxy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 87F91C7DEE875EF47FA556ACFC7D2C4E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FC4920CF955DBA6DC6685933C96FFE1D /* CALayer+YYAdd.m in Sources */, - D6859BDE12AD37ECEE6E7AA00A25FAA9 /* NSArray+YYAdd.m in Sources */, - 70D3C6B70193289EB0952E712AC24A9D /* NSBundle+YYAdd.m in Sources */, - 15252B85DC915BFA75AF6555C3B43B2A /* NSData+YYAdd.m in Sources */, - 75FE2FE0B0177B4BE9A4C13DF24202D9 /* NSDate+YYAdd.m in Sources */, - 724A18CA4450D2AE1F741221C16BD4A8 /* NSDictionary+YYAdd.m in Sources */, - 6246A05C7F564705142A9ABB7031332E /* NSKeyedUnarchiver+YYAdd.m in Sources */, - 6DE6052F364A6556936EA55D9B5CE15F /* NSNotificationCenter+YYAdd.m in Sources */, - 43BB3CC17FFE6B04E64DDF0057F649CA /* NSNumber+YYAdd.m in Sources */, - 62E6194188E5F621F3B68D94C9847BA0 /* NSObject+YYAdd.m in Sources */, - 8E109750DB28D08879CC3AB4C1D57441 /* NSObject+YYAddForARC.m in Sources */, - 39FC626F56E3A6753F9ED5681950AB4B /* NSObject+YYAddForKVO.m in Sources */, - EF95C02CDABFA19A1E779C031B917FFB /* NSString+YYAdd.m in Sources */, - 33502CA64BCF5D88E90C4721FDFAD79B /* NSThread+YYAdd.m in Sources */, - 608EA65073136FADD97D6243DAFF0BC9 /* NSTimer+YYAdd.m in Sources */, - 5733584BA9A77C817060A2B02F7B55CF /* UIApplication+YYAdd.m in Sources */, - F1DB510414B920325BCEBFBB830C48A7 /* UIBarButtonItem+YYAdd.m in Sources */, - E93760A84D9888FDCD70CF53B3645827 /* UIBezierPath+YYAdd.m in Sources */, - 965C34EF44F507C418CF2547ECD7E16B /* UIColor+YYAdd.m in Sources */, - EABA6C9D227100BFC79ED5821E0EA5D3 /* UIControl+YYAdd.m in Sources */, - FC43D19FE6B8DFC05EBEC9408D4CEF82 /* UIDevice+YYAdd.m in Sources */, - 1F9C28BF73EBA28DFF93D84C3CA4406E /* UIFont+YYAdd.m in Sources */, - AE7243DF0817407BF8287237429309B6 /* UIGestureRecognizer+YYAdd.m in Sources */, - F82C942D62F249510BCF073FA64A64C1 /* UIImage+YYAdd.m in Sources */, - C9BD84BA5D6A5744A4DF9AC36B7753D1 /* UIScreen+YYAdd.m in Sources */, - A4CBE2F01A74542D6B37FDE20762C33A /* UIScrollView+YYAdd.m in Sources */, - AC8DC828EFE77EFEACDFC340BE3686D8 /* UITableView+YYAdd.m in Sources */, - D75560FE213D1D2E74C479A06DDFCD5E /* UITextField+YYAdd.m in Sources */, - 0B76DE56DB38A989F4BB7AD3D611EA2A /* UIView+YYAdd.m in Sources */, - 0CBD7DB26ABF8C8A145AEDA8A2F3F3BE /* YYCategories-dummy.m in Sources */, - 45003396B3D21475F6CF7B3E582AB0A6 /* YYCGUtilities.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9087206CF402094899352A19C262EFF6 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 20EB55C7F6500666DA055783E6803BCE /* MJExtension-dummy.m in Sources */, - 4A658AACD7DC9B7012BFA2A1E21A524E /* MJExtensionConst.m in Sources */, - F0A828EC72CD7FB7ABFDD5B5736EF7F8 /* MJFoundation.m in Sources */, - 8E7BC04EF0E086E356FF20FB72CFCF02 /* MJProperty.m in Sources */, - 9F39FCC5EFE5F66AFA01AB0F2E9065FA /* MJPropertyKey.m in Sources */, - 0DAE61EE8CFDFB7FB297590A54105F92 /* MJPropertyType.m in Sources */, - C214E3582DE2BE5E85F81912A8D66702 /* NSObject+MJClass.m in Sources */, - EAEEC5EDA062152C206B868F228B2D08 /* NSObject+MJCoding.m in Sources */, - 34B22D755CA7E16A822E9C09ACFBECD9 /* NSObject+MJKeyValue.m in Sources */, - 3A135E858450F155E28A1F19CF0D0332 /* NSObject+MJProperty.m in Sources */, - BD35528AF6A5D15D4BAE46A5D414177F /* NSString+MJExtension.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 981E1388D48765ADC17E45170B5642C4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D2D665F1A94CA1283684699F1CC880D /* M13ProgressConsole.m in Sources */, - BB6C6B7A51BBC59137283CA0C2588B69 /* M13ProgressHUD.m in Sources */, - ADADE54CA35B3E34A4BFDC86DCD2E31D /* M13ProgressSuite-dummy.m in Sources */, - 5DB33204843B77A2565611715C32396C /* M13ProgressView.m in Sources */, - CEE65BBC1DB3B5FAFFCA02FA29CE7CC1 /* M13ProgressViewBar.m in Sources */, - F39CBB7A920B2884F5637C36E8819033 /* M13ProgressViewBorderedBar.m in Sources */, - 4EA9D88610CCECD546B772A8F3DC55E9 /* M13ProgressViewFilteredImage.m in Sources */, - 5C9694CB2661A04D50EAD21265A16022 /* M13ProgressViewImage.m in Sources */, - 6BA0E87964FA25A06E00EC637105AE14 /* M13ProgressViewLetterpress.m in Sources */, - 4260A32EF33F1EE3E3BAF577C7F7ABE6 /* M13ProgressViewMetro.m in Sources */, - 559BD4598368E629F69870DBB9642C34 /* M13ProgressViewMetroDotPolygon.m in Sources */, - 271AE5A47E1BEC9EF4B0FCC26A783092 /* M13ProgressViewPie.m in Sources */, - D7664531973544D035CE33B05D291A61 /* M13ProgressViewRadiative.m in Sources */, - CAB9278C010D1B7788F0620C0CC8624F /* M13ProgressViewRing.m in Sources */, - B228AD2E4B81E0CFE3EEECAF0D89C1DC /* M13ProgressViewSegmentedBar.m in Sources */, - 8DF60FE7B4C0EEFB4C4A2325DECF6EC4 /* M13ProgressViewSegmentedRing.m in Sources */, - 2059D33DEBB8EB19DE50C7AD81FA20F7 /* M13ProgressViewStripedBar.m in Sources */, - 38755177CB6FCEECF5B94FAAFE6B54F1 /* UIApplication+M13ProgressSuite.m in Sources */, - 69D903E8BD02A121BFC6E8F0475B5115 /* UIImage+ImageEffects.m in Sources */, - 17172BE942E3D58BB8127724D38F6A66 /* UINavigationController+M13ProgressViewBar.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9E2A650DF17D57B60D78DD3741B48CCC /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 91F2867A20507A2A9C75FD0A5A0B7679 /* ASValuePopUpView.m in Sources */, - 12B3F6AFD21972962AC57986FF842EFF /* ASValueTrackingSlider.m in Sources */, - 23244F8C874C9E74D6B65AF973C485DE /* MMMaterialDesignSpinner.m in Sources */, - B0E19F56F4D6D005917011E36062ECA5 /* UIAlertController+ZFPlayerRotation.m in Sources */, - 7344691FB8F44FC12F901745E0D229B8 /* UIImageView+ZFCache.m in Sources */, - 77F21E90EF101B64CA739DC9E95C39DF /* UINavigationController+ZFPlayerRotation.m in Sources */, - 479CB538F248C324C2BB4348BCFB8318 /* UITabBarController+ZFPlayerRotation.m in Sources */, - 797AADAFCC84AB79F7273A4FD698383C /* UIView+CustomControlView.m in Sources */, - 3AC4FE82018D43615FEB7EBF25133503 /* UIViewController+ZFPlayerRotation.m in Sources */, - 9257BC6F2F12584F352153E992BD718F /* UIWindow+CurrentViewController.m in Sources */, - E8775E965F4050F8CC0FFDD17FA76523 /* ZFBrightnessView.m in Sources */, - B56DF024B8E971C64418AE42915E2B3E /* ZFPlayer-dummy.m in Sources */, - C97820EF4206BF1B1A8284DF0CB1ADE8 /* ZFPlayerControlView.m in Sources */, - 77B764A5E6476E36E8CF7811B23C421E /* ZFPlayerModel.m in Sources */, - CBA35129E1CA915285664AD0876E939B /* ZFPlayerView.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A5EFCF1749177D5E86BCF15F965D52CD /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E596D5751EE96A9FE593CC4AFF3CB50B /* UICKeyChainStore-dummy.m in Sources */, - A74871CDEC4743637083F996ECDE4981 /* UICKeyChainStore.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AAEE4C1DF970D446DF57CA3DDD16AD00 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A906A376A93C1C83BB89E8F63A663F43 /* AFAutoPurgingImageCache.m in Sources */, - E81A3DDBBA7965126D98EEA4C35E7363 /* AFHTTPSessionManager.m in Sources */, - 211646AEE68A3577495B0DF917A0DCDC /* AFImageDownloader.m in Sources */, - F8B71BB9667E21385D7AAEFEC796BAE4 /* AFNetworkActivityIndicatorManager.m in Sources */, - 63299DE5DEA29075FADA35711169188E /* AFNetworking-dummy.m in Sources */, - 19CFCF718B674B91847980FA20429558 /* AFNetworkReachabilityManager.m in Sources */, - 0A1CE7CE58B28609B573D4058ABDD616 /* AFSecurityPolicy.m in Sources */, - FB9AA5207284E33FFC55FEB308BFA71F /* AFURLRequestSerialization.m in Sources */, - C4D12D56B5E4323CDE6A77AEF30D4D9F /* AFURLResponseSerialization.m in Sources */, - 064EC4AA8FCCD08F2037037B1E672DBF /* AFURLSessionManager.m in Sources */, - 7B12269BEFA5305C78EC3D22AB2B1CEC /* UIActivityIndicatorView+AFNetworking.m in Sources */, - 2612D2B9BEA56B8CB2B361AA0BAB599F /* UIButton+AFNetworking.m in Sources */, - 2BCD3F861A5F4CF448072C4692AD130D /* UIImageView+AFNetworking.m in Sources */, - D486C538AE3151018303619712539B4C /* UIProgressView+AFNetworking.m in Sources */, - 12FCB056A2B7051B0D91B16CAFE85C1D /* UIRefreshControl+AFNetworking.m in Sources */, - 17E74D623462991F19748A7F99CF8ED6 /* UIWebView+AFNetworking.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AB7DE498CE7BF75F34DEB27691DB7184 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 03AA64D95C34F164CF97D589E8367C75 /* Pods-iOSProject-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - ADE36E87832B736E1FAF9E50036C1530 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2C41E93CF9F63753E9F5D4AF7410C9E6 /* FMDatabase.m in Sources */, - 7CDBF7EA5C30D66F866F8E3BA32F1712 /* FMDatabaseAdditions.m in Sources */, - 9C0908154FC1320D13F5FA40C47E47D7 /* FMDatabasePool.m in Sources */, - 903D16EEE10FFB91B8B4742586EDC09F /* FMDatabaseQueue.m in Sources */, - C40CFE1274D588CA1A9DF9394BF76EAE /* FMDB-dummy.m in Sources */, - F42D3D33B0FD8814A3C33FC46FE1690A /* FMResultSet.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B0FD6081B70EE563466D789DAF67B146 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FD5F4725614AF2B0D0D87840258DC53F /* YYAsyncLayer-dummy.m in Sources */, - 8770BF47F0CC10836CA84E36F50C0959 /* YYAsyncLayer.m in Sources */, - DAD232C2B183547937FCBF309C6F26F5 /* YYSentinel.m in Sources */, - 43BC67837AA0A22C5EC3D93CB1FC3945 /* YYTransaction.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CDCD5EA2A7FF27ECFDED2AA5F184EAF8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E5B2B953D499F03FCF963326D46465E5 /* SDCollectionViewCell.m in Sources */, - EFC6C00AA25F727156BCCF53C5B56D26 /* SDCycleScrollView-dummy.m in Sources */, - 5B018B99B71F022CF2E2C3FFE7CD8152 /* SDCycleScrollView.m in Sources */, - B6A40531013EFF76967F838D68D4C01D /* TAAbstractDotView.m in Sources */, - 8B69136349EE8441473CCC2FEB1DC764 /* TAAnimatedDotView.m in Sources */, - 340D0175144A79304C3869341F0D1957 /* TADotView.m in Sources */, - 17D8B1FA2067822FFA036A682158CBD9 /* TAPageControl.m in Sources */, - 4142D40D641DA8AFF5F8B81B2529E66B /* UIView+SDExtension.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D7C932479C1FCEB09BB1AD1D3D44A87C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8E3DC47D9C8F8C484B8B535FB46BF78A /* IQBarButtonItem.m in Sources */, - BE55E6CA41B94B735275119D91CC67C3 /* IQKeyboardManager-dummy.m in Sources */, - BF8165F578E449953F94600BE6AA9114 /* IQKeyboardManager.m in Sources */, - 94D6FC9E345F03396C02EEF2AD6A25B7 /* IQKeyboardReturnKeyHandler.m in Sources */, - 629393440ABCD73AD3D16C75C633B585 /* IQNSArray+Sort.m in Sources */, - BC04BC7CCC9DE1E6F262CCDEB98A3588 /* IQPreviousNextView.m in Sources */, - 4B0E2A3FCD260DDC14AC986F7DC9A433 /* IQTextView.m in Sources */, - F65005F3BA971FE1877ADDE49A494052 /* IQTitleBarButtonItem.m in Sources */, - C2BB4AD69433B10C2D930E85DB32F7DC /* IQToolbar.m in Sources */, - B69F47477A7A892F0185011363F212EA /* IQUIScrollView+Additions.m in Sources */, - 262F09111C574E80A4C77C5FC75D2FC5 /* IQUITextFieldView+Additions.m in Sources */, - 3F9B7B96F95416ABF95F00E750EDB4FC /* IQUIView+Hierarchy.m in Sources */, - E3D78C20D648BB0234F93D8C9E69ED4D /* IQUIView+IQKeyboardToolbar.m in Sources */, - A4223E648086FEF52D8BEF6BC331EDC9 /* IQUIViewController+Additions.m in Sources */, - DC3F788B3CCFAAEC642ACC6AE1A236E5 /* IQUIWindow+Hierarchy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E742ED1631851E8E4DF869C1ECDD955D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F56F1AD0D978F250A30E1980549A7EB6 /* MJRefresh-dummy.m in Sources */, - 97CA04C5B77CB7773C7F0871D0E1C581 /* MJRefreshAutoFooter.m in Sources */, - A5CC736BE68ABCDF971C27B076E538AB /* MJRefreshAutoGifFooter.m in Sources */, - EBA632EA41470F059E86A82C018FCC6E /* MJRefreshAutoNormalFooter.m in Sources */, - 6CA5641617C855A7102C7787BB154D89 /* MJRefreshAutoStateFooter.m in Sources */, - 514663D13BAD254F684191EA8897EDA8 /* MJRefreshBackFooter.m in Sources */, - DE130FE41810425BC7D6AE496D9F217A /* MJRefreshBackGifFooter.m in Sources */, - 236524396AB978EB013E1EDB702DB0D4 /* MJRefreshBackNormalFooter.m in Sources */, - 24D62FF5048CF5339C87189530FFE3D4 /* MJRefreshBackStateFooter.m in Sources */, - B0C13321D8E8246F0213C8EF755503E3 /* MJRefreshComponent.m in Sources */, - FBFE53983A247600ECF47853C2F01D4D /* MJRefreshConst.m in Sources */, - 234E79261AC257C75B8644DA099FF1C2 /* MJRefreshFooter.m in Sources */, - A974DE47B402E6956FB9B85EAEBE8426 /* MJRefreshGifHeader.m in Sources */, - 00165B02644225D503F585E39D462662 /* MJRefreshHeader.m in Sources */, - 3046977628F90F18E0C16226B3E9CC66 /* MJRefreshNormalHeader.m in Sources */, - 161B3785F561102FEFC4411D7F83DD50 /* MJRefreshStateHeader.m in Sources */, - BD9F745169ADBBD029EE0C69E68E60D4 /* NSBundle+MJRefresh.m in Sources */, - 8BE30B72D3E9BFF954B9208B3F7D656F /* UIScrollView+MJExtension.m in Sources */, - C9F6937BC265DA8CDB70746F57C570AE /* UIScrollView+MJRefresh.m in Sources */, - 729B628E992E517000943F0B724DEDCB /* UIView+MJExtension.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EDE1FA8B9DBF594D67E79BC004A59057 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D5E13A1C8C6E6F18961810E8E22562E7 /* YYAnimatedImageView.m in Sources */, - 0067C699B121BB4499BBAC71CEA9895B /* YYFrameImage.m in Sources */, - EC654A843A69FB9FE234CBDEF0527B1E /* YYImage-dummy.m in Sources */, - 29E64E4E61EDC1DE1DD532D24388CD2C /* YYImage.m in Sources */, - DFC94EC4975587EE15BEACCD1C54E25E /* YYImageCoder.m in Sources */, - 091508594F0B139F62092E2A2B805575 /* YYSpriteSheetImage.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F2D4A52A499692354A19BD3E5EE17CDC /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 762D830B7D515C83827F21EF1A4DA8E6 /* GVUserDefaults-dummy.m in Sources */, - D88A0E44D048C32D7E5FBAE2929E462A /* GVUserDefaults.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FC7004C9F8C5DF68752BDF9DBE905CC4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7FC55339729B1E7641C33D2AEEBA550F /* ASIAuthenticationDialog.m in Sources */, - 60A005A90B31577CFBAEC502942B64FE /* ASICloudFilesCDNRequest.m in Sources */, - 5713AE9534A4F008C8DC23DC87781E8F /* ASICloudFilesContainer.m in Sources */, - CE9BE96158CDC0784F47DD1340F1C274 /* ASICloudFilesContainerRequest.m in Sources */, - 87C786744791F25DCA4CAF9C375B1D12 /* ASICloudFilesContainerXMLParserDelegate.m in Sources */, - 6FAB193AE0B9F07C659C03E690727C5F /* ASICloudFilesObject.m in Sources */, - B6497577DF23ABAF97751EB99734E310 /* ASICloudFilesObjectRequest.m in Sources */, - 272C9D917150C329E01B03CDD05CD7DF /* ASICloudFilesRequest.m in Sources */, - E0D47ED026920AD701E0A8A5D8AA935B /* ASIDataCompressor.m in Sources */, - 669834D87A6D8AC2F647CD6488951C46 /* ASIDataDecompressor.m in Sources */, - C4D9FDAC0BD8ACC241CF9286AFB66FA0 /* ASIDownloadCache.m in Sources */, - 60A7F17CAB8A71425D8375D26396D901 /* ASIFormDataRequest.m in Sources */, - 7617045583CCEBBCFFF5268D080D760E /* ASIHTTPRequest-dummy.m in Sources */, - 0BB77BAC640E11231C16AAC1A7B426E6 /* ASIHTTPRequest.m in Sources */, - 4B66DC931B4AB8ECD2B005A5B3259908 /* ASIInputStream.m in Sources */, - C91F6D563D6EBA13E9598550FDF99113 /* ASINetworkQueue.m in Sources */, - 7331DE41D397397F8DA2EA0064EC209E /* ASIS3Bucket.m in Sources */, - 5AA54B8EFEA34BDD1E8F9BD697985138 /* ASIS3BucketObject.m in Sources */, - 9750CDA836E267674F716B7D7E4ED03B /* ASIS3BucketRequest.m in Sources */, - 49176D32491D6B016567A6F71CFC030B /* ASIS3ObjectRequest.m in Sources */, - 612C8FE4EEB65624AF3AF5BF605C3B67 /* ASIS3Request.m in Sources */, - 07590E4B7A95D750BC55AB8892847CD8 /* ASIS3ServiceRequest.m in Sources */, - 81B935448068E6CC49874011EE9D6BCA /* ASIWebPageRequest.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FCC28E36A289F7E991B78A63CD0251F9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6837AD005926AB2974513453DB787C5A /* MBProgressHUD-dummy.m in Sources */, - E6EB93F9F0E4C5727BFC3147BA91C599 /* MBProgressHUD.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FE59CBEDF54E73172C678ADB71FD1923 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 06DCFD8FE8131173C2ACCA6659386D50 /* LxGridView-dummy.m in Sources */, - E1DBB69DA659E9CC4C52F45A50AACC8B /* LxGridView.m in Sources */, - 91070BE6CD32596F7001DE213BB67BA2 /* LxGridViewCell.m in Sources */, - 832B55A221F73D0DF96D3BDF18DB81B9 /* LxGridViewFlowLayout.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 053D976033CCFE1C289B40A000E9F7D1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Masonry; - target = 9DC8D9E02903E93BD0B2FEC9D846EA20 /* Masonry */; - targetProxy = 5BDBB974BF409E062FD1FE52882BF470 /* PBXContainerItemProxy */; - }; - 06690631605E797A29BC695D60EB5080 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = MOFSPickerManager; - target = C1FD7413DA4D1D8C453C6C0DF2243636 /* MOFSPickerManager */; - targetProxy = ED8F4DE1A243B18BB4694A72A9503DC9 /* PBXContainerItemProxy */; - }; - 08CCA64C81FEB56F3BD699C587418B93 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = UICKeyChainStore; - target = 1D2C839B3013830CA2082E7574526716 /* UICKeyChainStore */; - targetProxy = 67AAB6531359D087C4E1A18704661BB4 /* PBXContainerItemProxy */; - }; - 0BE96B4D0F7365638472FFDF393B2652 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = HMEmoticon; - target = BCB3669B52B845FD733208787CD024E2 /* HMEmoticon */; - targetProxy = F61720CAF5B19469E006CDB32A210CCE /* PBXContainerItemProxy */; - }; - 0DD442407FC039934D30F70DC8DD6BD4 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = M13ProgressSuite; - target = BDB45DD6D41488A346190E17DEF63592 /* M13ProgressSuite */; - targetProxy = 7678BD72BDE35133574AF96B10574996 /* PBXContainerItemProxy */; - }; - 0FA22D4B9A73CCC4CF8CC16ADB267041 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = ZJScrollPageView; - target = 66AB20B3D6E7648A21FE0FACD999D7E0 /* ZJScrollPageView */; - targetProxy = E039191CC54095AA28E635741EDDD414 /* PBXContainerItemProxy */; - }; - 1491F97F45B75D2537A037370AC69E40 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = AFNetworking; - target = 9E033EDB5EC0819481B0546434FA577B /* AFNetworking */; - targetProxy = E6D55A858C1C2821752F5528AA7223AC /* PBXContainerItemProxy */; - }; - 1764E11BB4EB75FCB34FB83B5ECED234 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = ZFPlayer; - target = D51A7C33D6CB5BFE4110037FB616A385 /* ZFPlayer */; - targetProxy = 8492FB125648E08B94F8FFD935C6C407 /* PBXContainerItemProxy */; - }; - 27BF91D43A0FDF285EA532ED461F246F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = YYImage; - target = 081C5DFBFB255EFA239E2A10EED8389F /* YYImage */; - targetProxy = 98FE5853D9DBA8D69CF08732BD229514 /* PBXContainerItemProxy */; - }; - 28FAC1F471ECD708FEBC9560A353359F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SDWebImage; - target = 92BA053EDCAD49E6DB97E83B24319F48 /* SDWebImage */; - targetProxy = E5185BBD6DBC003CD836BDA99B9AADDE /* PBXContainerItemProxy */; - }; - 29CAD7DD7093159096FBCA4A54617750 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = ZFDownload; - target = 78E8E726824C97E61A093458715C042A /* ZFDownload */; - targetProxy = 160CC89D5E06BB3AA2CFA1C5A17F956D /* PBXContainerItemProxy */; - }; - 2A43A347FDEA7D303A2B6C24E0C089B5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = TZImagePickerController; - target = E0C2B1D1DA662576BF72BB3F3EBEF660 /* TZImagePickerController */; - targetProxy = 3CE98DA9AF93AC85335ADC6B9066F1CF /* PBXContainerItemProxy */; - }; - 3B0BF5FE17040B54838A252BE99D87A0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SDCycleScrollView; - target = 8C603CC4B51BC8FB05654BF104CB6C64 /* SDCycleScrollView */; - targetProxy = 584D67106988BDDBE05A11CA6639133D /* PBXContainerItemProxy */; - }; - 490430042308253E2FD0A6AF2643E8C2 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = ASIHTTPRequest; - target = F0EA78F8F3362DEBC9840500226DA5E7 /* ASIHTTPRequest */; - targetProxy = E93327BAF52D8E67FA9AE772573F8767 /* PBXContainerItemProxy */; - }; - 4A0FD592B42FE6B4E31DC463ECD3D8FA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = IQKeyboardManager; - target = 904F4F27FD314010A3812EB2A9306183 /* IQKeyboardManager */; - targetProxy = 788D58FA420E25E17722FE9C3FFC9377 /* PBXContainerItemProxy */; - }; - 4B13AE9BA1A417BFDD401EA91934EC73 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Masonry; - target = 9DC8D9E02903E93BD0B2FEC9D846EA20 /* Masonry */; - targetProxy = E1D4B67465FA62FDD0F22B7E7DC4C39F /* PBXContainerItemProxy */; - }; - 4DBB5849DFABB81D90700EED6217DAF4 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = MJRefresh; - target = 04CF549EBEEE7BC87AEAE35397184D94 /* MJRefresh */; - targetProxy = 611EB321051676445AFBB0914231074D /* PBXContainerItemProxy */; - }; - 54588C30678CE58DB05C17FF74397B99 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = YYText; - target = 2B91E81D8B4FCB63BB9F963DC1B6BDC8 /* YYText */; - targetProxy = 72B3D99E8A4DFCD36B957B47A3AA4D35 /* PBXContainerItemProxy */; - }; - 5572CE11D4CE5662B2156FE53D1FDBB9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Reachability; - target = 9C623D1AF8229419BA603B3C66BE24B9 /* Reachability */; - targetProxy = 74795D79E5424F6385749DDE32F7267E /* PBXContainerItemProxy */; - }; - 58439DFF5A701E1CB3A30467510B4157 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = GVUserDefaults; - target = 325E0F928F4D0842ECDF259F63F1D842 /* GVUserDefaults */; - targetProxy = 387E615BC50180386EC4F86AB1C9E418 /* PBXContainerItemProxy */; - }; - 5CDAE252641B93C22489114CD48D9EE9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = CYLTabBarController; - target = 272B6902EC233437C8C814A53CD3E70D /* CYLTabBarController */; - targetProxy = 4E0D93160123BCAF196E5D62949B36A3 /* PBXContainerItemProxy */; - }; - 6D9EB04316D448848D1631814877467C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = KILabel; - target = C93D9A8CEE42F2E461C1A028CBA3E5A3 /* KILabel */; - targetProxy = F4C32523C88C7E3D8A0A564B8C51B14A /* PBXContainerItemProxy */; - }; - 70025B8DD531E4BCC9F8757516FF92F0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = FDFullscreenPopGesture; - target = EE366E1E6962F82E6AEC8AE66FA66CBF /* FDFullscreenPopGesture */; - targetProxy = 3A615A534EA2AAA393DBAE2324C6C8E5 /* PBXContainerItemProxy */; - }; - 706951034F7AD28C654F9F31A992CB65 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Reachability; - target = 9C623D1AF8229419BA603B3C66BE24B9 /* Reachability */; - targetProxy = EBEEA2E24A6D6D7A6A20DECB5A754FA3 /* PBXContainerItemProxy */; - }; - 78DC4997A444AA369D8785D4838678D7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = ASIHTTPRequest; - target = F0EA78F8F3362DEBC9840500226DA5E7 /* ASIHTTPRequest */; - targetProxy = 15AC0AB532D3A36847874730554B1AEF /* PBXContainerItemProxy */; - }; - 7CF99B28C4D7A2E1521E30CDD9285C0D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = MBProgressHUD; - target = 586F2DFA9BDCC6675C2546793A69E5CC /* MBProgressHUD */; - targetProxy = 0CA9C4ED088C3D97FE5F5B954491EEB6 /* PBXContainerItemProxy */; - }; - 927F1BD6F6E4AA337F11F2582E4AAE18 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = TDTouchID; - target = 2A22C4445F8FB3853FF5036E64CED171 /* TDTouchID */; - targetProxy = 3867F926E0FA4D5BF8C45A0A1E210B32 /* PBXContainerItemProxy */; - }; - 95932F18AF5760ADC5DF5EADAA5B06E3 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = MJExtension; - target = A316B54C67E947D23CECD230FA5BFAEF /* MJExtension */; - targetProxy = F3E6AAF49DB39A7542C65CF93A960137 /* PBXContainerItemProxy */; - }; - AF2CE25E1CDA6D0D2158F945F0AF621D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = YYAsyncLayer; - target = A08CF8B6B4281979AD047CC2A26962D0 /* YYAsyncLayer */; - targetProxy = C1B8C3AC720EAF82FE20FC7FF338D911 /* PBXContainerItemProxy */; - }; - AFF7B4F517A43DF8865445F45EFDD0C0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = FMDB; - target = 8642CC820CE8C5B88C113D7F47AF4BC3 /* FMDB */; - targetProxy = 78CC810ADAD2BEAF212D2E62B6385C53 /* PBXContainerItemProxy */; - }; - BDD38F026F3234325FCEB5C564423291 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Toast; - target = 956D15E751CE0B7A4B2A712076C19498 /* Toast */; - targetProxy = 83F2CC41C4DDE84846AA1FC1487437EC /* PBXContainerItemProxy */; - }; - C96ACFD56F88AFDFEAF4AAB250399E76 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = LxGridView; - target = DA192B47B547BB1AA408F674C3A089B2 /* LxGridView */; - targetProxy = 2741483DF0EFA5708C76A63C39378820 /* PBXContainerItemProxy */; - }; - CAE96A6283935E28A1F85F631AADC0F5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = FCUUID; - target = 6EC166B8BFAEC80A53C7B88AD9D967E6 /* FCUUID */; - targetProxy = AE1D9B42831F54912F1BA4F78DE313C8 /* PBXContainerItemProxy */; - }; - D1128142C772E06366B95AE58E92022E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = UICKeyChainStore; - target = 1D2C839B3013830CA2082E7574526716 /* UICKeyChainStore */; - targetProxy = B9F3E3B49114BF0AF59B6AF54D3C85E8 /* PBXContainerItemProxy */; - }; - E7379C873586A2C1F05F454215FD4651 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = WebViewJavascriptBridge; - target = 52E7BDC90E6F2E284172E8317EDA09AF /* WebViewJavascriptBridge */; - targetProxy = 1B29A9F707FC421A60E0B3CD227F7D58 /* PBXContainerItemProxy */; - }; - ECAD628B15E8E00FAC76B4594DAA07E8 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = DWBubbleMenuButton; - target = 5531A66C90D28B1F40553C98CB7E53D9 /* DWBubbleMenuButton */; - targetProxy = ED03FAE7CE4515A94A86537CBDF225FF /* PBXContainerItemProxy */; - }; - ED38BA1D5D384B424D6B323016E75614 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = YYCategories; - target = 77429824F3675AB1A2CE34A6E0BDD468 /* YYCategories */; - targetProxy = F7E2C7EAC45C2594AA3822027647A115 /* PBXContainerItemProxy */; - }; - F17727E2DC28416BD2079295D0851D5B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = HMQRCodeScanner; - target = 4DB8DEC4D389AEFE4B3A80E3C5B7DFC0 /* HMQRCodeScanner */; - targetProxy = 84AC77B5EBE473D0E23BFC3A4C70A9A4 /* PBXContainerItemProxy */; - }; - FAC46C60E7115C4344C1C8F8713EF341 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SDWebImage; - target = 92BA053EDCAD49E6DB97E83B24319F48 /* SDWebImage */; - targetProxy = 00DEA7EEDE75F9DC08E26C1BB0A67A10 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 00044B9FDB1495E8F6B35A542936C710 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8090E059E89B637FE9CFE0D3FED61C68 /* WebViewJavascriptBridge.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 003E4D320B9A9A39F8B652FFACCE22CC /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 88AFC3B399D2A3B89836677BB828D5AB /* YYText.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/YYText/YYText-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 07E3F166F8181CBEB4BC2044EBE34FCD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 00E022313FC07DC246814838B5508BD9 /* ZJScrollPageView.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ZJScrollPageView/ZJScrollPageView-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 08D693E935775C06C9CA6CF6B281D9DA /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 00E022313FC07DC246814838B5508BD9 /* ZJScrollPageView.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ZJScrollPageView/ZJScrollPageView-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 0B7A0332EB5EAE506EDBCB4FD15F2176 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 0A2B81143ED0FD2CAA713AE6525180DA /* ZFDownload.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ZFDownload/ZFDownload-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 0C4380E38E15B83C6EF2F047483B31BE /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3E26E8FBE4C20F80143EBF740F0741A /* SDWebImage.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 11D837E9061713962DAFC1C3FD7C40E3 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CDBCC678B5B737B51FD30AA756EBAA22 /* IQKeyboardManager.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/IQKeyboardManager/IQKeyboardManager-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 1417816978E406CD99C5564CD95946C1 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 676F5D06F4237F94D9015FB16B0068E2 /* FCUUID.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/FCUUID/FCUUID-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 14DC5BAF9F2D73AE90C675175085A05D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 56572A7E4016ED7DB3B439EA592E9985 /* FMDB.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/FMDB/FMDB-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 163D87BE96A63549B0EACF1CC31A2E90 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - 178F52D09092CB8020645E85731F079A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 58D4E15F844FF5BF36101445BFC8CAF6 /* ASIHTTPRequest.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ASIHTTPRequest/ASIHTTPRequest-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 18D1D6D48F56552C772D52C87BD2EE6D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2B877CA80ECE571A26E986BBD116B0F8 /* KILabel.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/KILabel/KILabel-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 1AA2BEE83B33EC2D64DF7655FEF3622E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 660F7A2D558A86E5552D7FB3399A6562 /* SDCycleScrollView.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SDCycleScrollView/SDCycleScrollView-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 1C69432B261AB60C30D4163322E6A62B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EA5EC071A7ED9F51B4A40F99E9541AA1 /* Reachability.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Reachability/Reachability-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 1DB8B1C918C251A2AE89205C4C3B54B5 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 6C56289FC944AEC08D3D4CD1703136A3 /* Pods-iOSProject.release.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - MACH_O_TYPE = staticlib; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 208B88FFAFE46606F9BDB01044C1FD8C /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 023C4CC9577CB7E5F8A0CACBC2FF7E12 /* MOFSPickerManager.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/MOFSPickerManager/MOFSPickerManager-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 24455948D3A3C98235995A605DB59FFB /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EA75EC8B3CF1812B48530A5210B8FEDF /* MJExtension.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/MJExtension/MJExtension-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 2B14B11887182D5C343DD7F87AFE5961 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1880C85B086D35C9E5F6528F9CE38CC0 /* MJRefresh.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/MJRefresh/MJRefresh-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 2C38265A528EA86807DC75ACCE3BDDED /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 91330B5BDFA577EA85E35A83BE861606 /* ZFPlayer.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ZFPlayer/ZFPlayer-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 2D5F3918269D6A1E05186CE28019B6F7 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2EB1C2161FB529386F2B945D7DFB6627 /* YYCategories.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/YYCategories/YYCategories-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 309098DCEAFDAA066FD021D074068414 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 81CD280EF61DE4C207AC96480DA158B3 /* YYAsyncLayer.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/YYAsyncLayer/YYAsyncLayer-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 31A616FBF617626BD56A5347E486256E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BED7B3E38283727B4366B7A0742AF091 /* M13ProgressSuite.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/M13ProgressSuite/M13ProgressSuite-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 32425ED62ABC47FBFE47E9FC3B6D3EEE /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 676F5D06F4237F94D9015FB16B0068E2 /* FCUUID.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/FCUUID/FCUUID-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 3E5C9484B91D83C623E96302FFFCAEE1 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3E26E8FBE4C20F80143EBF740F0741A /* SDWebImage.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SDWebImage/SDWebImage-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 401787AB53D7605C7488E88D145AEB7D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9686DB23109726069F4F55F431BA4C6F /* MBProgressHUD.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 405186D1A95DCF9873465C417DC808C4 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1880C85B086D35C9E5F6528F9CE38CC0 /* MJRefresh.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/MJRefresh/MJRefresh-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 41599EC5CF8BA0E345E5E271370E3A25 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5F6E42404EFF164F4A413DF0F93E167A /* DWBubbleMenuButton.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 43D8F30A2AD61288885A3F3E9E375C3F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5678650B327F3A34C944E809BDF44C24 /* TDTouchID.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/TDTouchID/TDTouchID-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 4AD93B692F3BB5615F6BE4EA08078C2E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9686DB23109726069F4F55F431BA4C6F /* MBProgressHUD.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 4D3DBD94F9C95390908F0DA2E9BFB9D6 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2EE6D33DB39283F1D12803691C1A9690 /* HMQRCodeScanner.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/HMQRCodeScanner/HMQRCodeScanner-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 4E7BC20119C4ECE52388AA345FD45CE5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 878A686D826B5CD6CE34C33FE3152FA0 /* TZImagePickerController.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/TZImagePickerController/TZImagePickerController-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 4EC6C83B1FF1C33809EF6BF290417410 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2B877CA80ECE571A26E986BBD116B0F8 /* KILabel.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/KILabel/KILabel-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 5229B290C11EBDDEC9963AEA3A065B2A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D97210D3B27649D2764515FA73A81B78 /* UICKeyChainStore.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/UICKeyChainStore/UICKeyChainStore-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 530BD7CDDF700AD80FF2932650DE0A75 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EA5EC071A7ED9F51B4A40F99E9541AA1 /* Reachability.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Reachability/Reachability-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 578D397173318D04B839F2BF6193473D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8090E059E89B637FE9CFE0D3FED61C68 /* WebViewJavascriptBridge.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 59BD0D33FF8B533FF68E68855839A581 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2EB1C2161FB529386F2B945D7DFB6627 /* YYCategories.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/YYCategories/YYCategories-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 5A6ACE61C4D128598EA7472C87982601 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 96E2389E2858EFBBBE22A0BE6D0A8E79 /* Masonry.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Masonry/Masonry-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 5C904CBAB4B7329769F0DE715E99DEB2 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D97210D3B27649D2764515FA73A81B78 /* UICKeyChainStore.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/UICKeyChainStore/UICKeyChainStore-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 5E19821B98548E6D0443E7FD3765BE57 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2EE6D33DB39283F1D12803691C1A9690 /* HMQRCodeScanner.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/HMQRCodeScanner/HMQRCodeScanner-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 5E2F95937BD27829D299193A3165F929 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 56572A7E4016ED7DB3B439EA592E9985 /* FMDB.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/FMDB/FMDB-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 635021243DF200AECD44465EB553811F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 91330B5BDFA577EA85E35A83BE861606 /* ZFPlayer.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ZFPlayer/ZFPlayer-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 6CA42F62CE0652819ED46936FE31E065 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 96E2389E2858EFBBBE22A0BE6D0A8E79 /* Masonry.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Masonry/Masonry-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 707B86CFB21B645E37109F39754D4051 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 72D1B831316303C2E356BBAC53FEF78A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 40F2704B5342C6A3B3E7FD01D3E0EEB7 /* AFNetworking.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/AFNetworking/AFNetworking-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 7C7585EE90BD26E65247CB8B389B3907 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 15A07B4076009D5884DD58629769954E /* LxGridView.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/LxGridView/LxGridView-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 7E0E88F00D56AECE97AF0201ECE619E1 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CED4E3E291179745022F34F7B60F876F /* YYImage.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/YYImage/YYImage-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 7FFA2AA969E5420A4A834F4A531CBF52 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 928536D1C6ACBCC3D0DC9C4F222979F1 /* FDFullscreenPopGesture.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 864257C72797C3D88C7F59CD746CD135 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EA75EC8B3CF1812B48530A5210B8FEDF /* MJExtension.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/MJExtension/MJExtension-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 8D4FB189E1087E83CDB3FA07C8DEE227 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 88AFC3B399D2A3B89836677BB828D5AB /* YYText.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/YYText/YYText-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 8E82EC513E2049E19DE36B591CEA95D9 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EEFA43DED626C5EC3F2EEAA32463176E /* CYLTabBarController.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/CYLTabBarController/CYLTabBarController-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 92F415033A0E6011D4C9F2D59DB4F419 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CDBCC678B5B737B51FD30AA756EBAA22 /* IQKeyboardManager.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/IQKeyboardManager/IQKeyboardManager-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 9B7D459D0ACDE0382149165B4A5DBD38 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CED4E3E291179745022F34F7B60F876F /* YYImage.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/YYImage/YYImage-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - A0D45F8BFB41B69AEB5F77C42D74CAE4 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 0A2B81143ED0FD2CAA713AE6525180DA /* ZFDownload.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ZFDownload/ZFDownload-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - A7C5173B35A4852C7E9BF63D290B7D7F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 81CD280EF61DE4C207AC96480DA158B3 /* YYAsyncLayer.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/YYAsyncLayer/YYAsyncLayer-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - A9FB479C9495614CD66A00229D458BEC /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BECD552238F972255302C0AAC040C8F0 /* Toast.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Toast/Toast-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - B1ED343615C6888C7F0FF77A05BBD1F0 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5E438BF4BEB9B7901D34F238BB7F7C91 /* HMEmoticon.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/HMEmoticon/HMEmoticon-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - B8DB2F35BB2E6EF7B0AD3A35AD2A0D59 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5678650B327F3A34C944E809BDF44C24 /* TDTouchID.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/TDTouchID/TDTouchID-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - BCA15881B9D766D4129C6C575963944B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 58D4E15F844FF5BF36101445BFC8CAF6 /* ASIHTTPRequest.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ASIHTTPRequest/ASIHTTPRequest-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - C475850F2C0FF9A63DE198003A8C76D8 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4BC60E7EE4E8FED932B19B607D46ECD5 /* Pods-iOSProject.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - MACH_O_TYPE = staticlib; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - CD84655759E45644F240F9B929FD3205 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 023C4CC9577CB7E5F8A0CACBC2FF7E12 /* MOFSPickerManager.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/MOFSPickerManager/MOFSPickerManager-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - D1E774E8E59E68DB42725F1AE6EF68FB /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CC119B460B33AB158CFD3D80EE6A03B3 /* GVUserDefaults.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/GVUserDefaults/GVUserDefaults-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - D287C30A3D087051FE6D59A91C8EA9A7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 15A07B4076009D5884DD58629769954E /* LxGridView.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/LxGridView/LxGridView-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - E8BF7A5DC0C8F5927680C0A7EFA1B0C4 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BECD552238F972255302C0AAC040C8F0 /* Toast.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Toast/Toast-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - EA1961AADD258FBC5385B565BBAF4879 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 878A686D826B5CD6CE34C33FE3152FA0 /* TZImagePickerController.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/TZImagePickerController/TZImagePickerController-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - EA8D1740D8DA93487F100D421FF195C8 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5E438BF4BEB9B7901D34F238BB7F7C91 /* HMEmoticon.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/HMEmoticon/HMEmoticon-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - F47DC500E351A2E723B2E908857B3CE3 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 928536D1C6ACBCC3D0DC9C4F222979F1 /* FDFullscreenPopGesture.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Release; - }; - F6125DC69610755E016085C4E061514B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EEFA43DED626C5EC3F2EEAA32463176E /* CYLTabBarController.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/CYLTabBarController/CYLTabBarController-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - F78D349D16097323BF2F92B3C3167992 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BED7B3E38283727B4366B7A0742AF091 /* M13ProgressSuite.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/M13ProgressSuite/M13ProgressSuite-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - F845E36721DDC49CA6D9D3736A9CDFBC /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 660F7A2D558A86E5552D7FB3399A6562 /* SDCycleScrollView.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SDCycleScrollView/SDCycleScrollView-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - FE12617937772339101F1ED6CF18A4C4 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5F6E42404EFF164F4A413DF0F93E167A /* DWBubbleMenuButton.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - FE5215CEE1CC2877E0A0AC8F316D69DB /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CC119B460B33AB158CFD3D80EE6A03B3 /* GVUserDefaults.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/GVUserDefaults/GVUserDefaults-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - FF778088B62C05BE1205DAE628D151DF /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 40F2704B5342C6A3B3E7FD01D3E0EEB7 /* AFNetworking.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/AFNetworking/AFNetworking-prefix.pch"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PRIVATE_HEADERS_FOLDER_PATH = ""; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - }; - name = Debug; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 0E4219F8F2B7C117EB0957B505EB1ABE /* Build configuration list for PBXNativeTarget "M13ProgressSuite" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F78D349D16097323BF2F92B3C3167992 /* Debug */, - 31A616FBF617626BD56A5347E486256E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 10437A8EAAC4147D3BC67D27D9BFE9BE /* Build configuration list for PBXNativeTarget "SDWebImage" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0C4380E38E15B83C6EF2F047483B31BE /* Debug */, - 3E5C9484B91D83C623E96302FFFCAEE1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1375982388E24238B8AA563D203E6661 /* Build configuration list for PBXNativeTarget "FDFullscreenPopGesture" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7FFA2AA969E5420A4A834F4A531CBF52 /* Debug */, - F47DC500E351A2E723B2E908857B3CE3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 14A04CEA87E6B0707FAEA26DB217F398 /* Build configuration list for PBXNativeTarget "YYAsyncLayer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 309098DCEAFDAA066FD021D074068414 /* Debug */, - A7C5173B35A4852C7E9BF63D290B7D7F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 168208ED59AC780D09813BE050F09789 /* Build configuration list for PBXNativeTarget "ASIHTTPRequest" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 178F52D09092CB8020645E85731F079A /* Debug */, - BCA15881B9D766D4129C6C575963944B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 16FDD2EC731A981B24437193C522C1C3 /* Build configuration list for PBXNativeTarget "HMQRCodeScanner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4D3DBD94F9C95390908F0DA2E9BFB9D6 /* Debug */, - 5E19821B98548E6D0443E7FD3765BE57 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1B9814DB59BF9387E1D479D7740809EA /* Build configuration list for PBXNativeTarget "TDTouchID" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 43D8F30A2AD61288885A3F3E9E375C3F /* Debug */, - B8DB2F35BB2E6EF7B0AD3A35AD2A0D59 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1BA066B3D32C553BF37E3322F9113F02 /* Build configuration list for PBXNativeTarget "FMDB" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E2F95937BD27829D299193A3165F929 /* Debug */, - 14DC5BAF9F2D73AE90C675175085A05D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1FD3606E6C5C793CD00615035B413FAA /* Build configuration list for PBXNativeTarget "Toast" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A9FB479C9495614CD66A00229D458BEC /* Debug */, - E8BF7A5DC0C8F5927680C0A7EFA1B0C4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 163D87BE96A63549B0EACF1CC31A2E90 /* Debug */, - 707B86CFB21B645E37109F39754D4051 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2E5216327B72AF0403A34732C4E08CB4 /* Build configuration list for PBXNativeTarget "ZJScrollPageView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 08D693E935775C06C9CA6CF6B281D9DA /* Debug */, - 07E3F166F8181CBEB4BC2044EBE34FCD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 34CAE1CB89EDBF2E53735CC5D4E5E69F /* Build configuration list for PBXNativeTarget "Masonry" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5A6ACE61C4D128598EA7472C87982601 /* Debug */, - 6CA42F62CE0652819ED46936FE31E065 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 35FA3F9D780F0A57E55222615ED55C72 /* Build configuration list for PBXNativeTarget "MJRefresh" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2B14B11887182D5C343DD7F87AFE5961 /* Debug */, - 405186D1A95DCF9873465C417DC808C4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3A073C78D19617C74EEAEA91C3038721 /* Build configuration list for PBXNativeTarget "IQKeyboardManager" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 11D837E9061713962DAFC1C3FD7C40E3 /* Debug */, - 92F415033A0E6011D4C9F2D59DB4F419 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 40EFAD85AD923A5CD33C91605CE38145 /* Build configuration list for PBXNativeTarget "GVUserDefaults" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FE5215CEE1CC2877E0A0AC8F316D69DB /* Debug */, - D1E774E8E59E68DB42725F1AE6EF68FB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 483FBC4A668BF7F1A8767452E7E188AC /* Build configuration list for PBXNativeTarget "AFNetworking" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FF778088B62C05BE1205DAE628D151DF /* Debug */, - 72D1B831316303C2E356BBAC53FEF78A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4ADEEC86E8BBACEDB89D0383E538F6CA /* Build configuration list for PBXNativeTarget "LxGridView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D287C30A3D087051FE6D59A91C8EA9A7 /* Debug */, - 7C7585EE90BD26E65247CB8B389B3907 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 50617C5FF2D8F394A228922DD738E27F /* Build configuration list for PBXNativeTarget "YYText" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8D4FB189E1087E83CDB3FA07C8DEE227 /* Debug */, - 003E4D320B9A9A39F8B652FFACCE22CC /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 64EE246612F53A73C8FBFCEC3A61508A /* Build configuration list for PBXNativeTarget "MJExtension" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 864257C72797C3D88C7F59CD746CD135 /* Debug */, - 24455948D3A3C98235995A605DB59FFB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6B44251FA50022CA55D4B2FBE1468C76 /* Build configuration list for PBXNativeTarget "MBProgressHUD" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4AD93B692F3BB5615F6BE4EA08078C2E /* Debug */, - 401787AB53D7605C7488E88D145AEB7D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7485A782F38B3888D93D5B9617864D6D /* Build configuration list for PBXNativeTarget "TZImagePickerController" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4E7BC20119C4ECE52388AA345FD45CE5 /* Debug */, - EA1961AADD258FBC5385B565BBAF4879 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7EC6DAE07638ECBEF222E34E80139168 /* Build configuration list for PBXNativeTarget "DWBubbleMenuButton" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FE12617937772339101F1ED6CF18A4C4 /* Debug */, - 41599EC5CF8BA0E345E5E271370E3A25 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 85BC96F4431110E0E0DCEF117BEDCC13 /* Build configuration list for PBXNativeTarget "KILabel" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4EC6C83B1FF1C33809EF6BF290417410 /* Debug */, - 18D1D6D48F56552C772D52C87BD2EE6D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 8BA5F9CB4F4935C86F2BAD30D3F7B423 /* Build configuration list for PBXNativeTarget "FCUUID" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 32425ED62ABC47FBFE47E9FC3B6D3EEE /* Debug */, - 1417816978E406CD99C5564CD95946C1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 92FEB1DD0BE395A76B5AF3D9139E078D /* Build configuration list for PBXNativeTarget "CYLTabBarController" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F6125DC69610755E016085C4E061514B /* Debug */, - 8E82EC513E2049E19DE36B591CEA95D9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 98D437F6CC36812FAA64FE7E71C95C14 /* Build configuration list for PBXNativeTarget "YYImage" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9B7D459D0ACDE0382149165B4A5DBD38 /* Debug */, - 7E0E88F00D56AECE97AF0201ECE619E1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 99FA678F14C4FC4F24DAFE231A318E5A /* Build configuration list for PBXNativeTarget "UICKeyChainStore" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5229B290C11EBDDEC9963AEA3A065B2A /* Debug */, - 5C904CBAB4B7329769F0DE715E99DEB2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 9AB8C5CE64D248AD4D8360850AEF7D09 /* Build configuration list for PBXNativeTarget "WebViewJavascriptBridge" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00044B9FDB1495E8F6B35A542936C710 /* Debug */, - 578D397173318D04B839F2BF6193473D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B478497FCC9A8F71855DE7736ECEBD4F /* Build configuration list for PBXNativeTarget "HMEmoticon" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B1ED343615C6888C7F0FF77A05BBD1F0 /* Debug */, - EA8D1740D8DA93487F100D421FF195C8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CF3B4F9D4BA5E6D4A796083F07999888 /* Build configuration list for PBXNativeTarget "SDCycleScrollView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F845E36721DDC49CA6D9D3736A9CDFBC /* Debug */, - 1AA2BEE83B33EC2D64DF7655FEF3622E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CF49B975B14CD821044B4E857E9AD07F /* Build configuration list for PBXNativeTarget "MOFSPickerManager" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 208B88FFAFE46606F9BDB01044C1FD8C /* Debug */, - CD84655759E45644F240F9B929FD3205 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D4CDDA4916AAFC52C7FEB9B636E97C27 /* Build configuration list for PBXNativeTarget "Pods-iOSProject" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C475850F2C0FF9A63DE198003A8C76D8 /* Debug */, - 1DB8B1C918C251A2AE89205C4C3B54B5 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D4DBEC0E8F0235A283B222254D95CF85 /* Build configuration list for PBXNativeTarget "Reachability" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1C69432B261AB60C30D4163322E6A62B /* Debug */, - 530BD7CDDF700AD80FF2932650DE0A75 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E00BEBACD2DAE8C7C1CEDEDD6327F8E9 /* Build configuration list for PBXNativeTarget "ZFPlayer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 635021243DF200AECD44465EB553811F /* Debug */, - 2C38265A528EA86807DC75ACCE3BDDED /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E804C582F5CDA98B4E014AD4EBB9040F /* Build configuration list for PBXNativeTarget "YYCategories" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 59BD0D33FF8B533FF68E68855839A581 /* Debug */, - 2D5F3918269D6A1E05186CE28019B6F7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - FD53E3A93BF3BCD466A2D70FB183DF35 /* Build configuration list for PBXNativeTarget "ZFDownload" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A0D45F8BFB41B69AEB5F77C42D74CAE4 /* Debug */, - 0B7A0332EB5EAE506EDBCB4FD15F2176 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; -} diff --git a/iOSProject/Pods/RAlertView/LICENSE b/iOSProject/Pods/RAlertView/LICENSE deleted file mode 100644 index bdce7edf..00000000 --- a/iOSProject/Pods/RAlertView/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2012 - 2016, GitHub, Inc. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/iOSProject/Pods/RAlertView/RAlertView/RAlertView.h b/iOSProject/Pods/RAlertView/RAlertView/RAlertView.h deleted file mode 100644 index 986713dd..00000000 --- a/iOSProject/Pods/RAlertView/RAlertView/RAlertView.h +++ /dev/null @@ -1,107 +0,0 @@ -// -// RAlertView.h -// RAlert -// -// Created by roycms on 2016/10/11. -// Copyright © 2016年 roycms. All rights reserved. -// - -#import -#import "Masonry.h" -#import "RRGB.h" -#import "TextHelper.h" - -/** - 弹窗类型 - - - SimpleAlert: 简单样式 无按钮 - - ConfirmAlert: 只有一个确认按钮的 弹窗样式 - - CancelAndConfirmAlert: 有两个按钮的弹窗样式 - */ -typedef NS_ENUM(NSInteger,AlertStyle) { - SimpleAlert = 0, - ConfirmAlert, - CancelAndConfirmAlert, -}; - -@interface RAlertView : UIView - -/** - init - - @param style style description - @return return value description - */ -- (instancetype)initWithStyle:(AlertStyle)style; - -/** - Description - - @param style style description - @param width width description - @return return value description - */ -- (instancetype)initWithStyle:(AlertStyle)style width:(CGFloat)width; - -/** - 销毁页面 - */ -- (void)exit; - -/** - 确认按钮 block - */ -@property (nonatomic, copy) void(^confirm)(); - -/** - 取消按钮 block - */ -@property (nonatomic, copy) void(^cancel)(); - -/** - 主题 - */ -@property (nonatomic,assign)UIColor *theme; - -/** - 弹窗 view - */ -@property(nonatomic,strong)UIView *mainView; - - -/** - 弹窗内容的View - */ -@property (nonatomic,strong)UIView *contentView; - -/** - 头部的标题 label - */ -@property(nonatomic,strong)UILabel *headerTitleLabel; - -/** - 弹窗内容 label - */ -@property(nonatomic,strong)UILabel *contentTextLabel; - -/** - 关闭按钮 button - - */ -@property(nonatomic,strong)UIButton *closedButton; -/** - 确认按钮 button - */ -@property(nonatomic,strong)UIButton *confirmButton; - -/** - 取消按钮 button - */ -@property(nonatomic,strong)UIButton *cancelButton; - -/** - 点击背景是否可关闭弹窗 - */ -@property (nonatomic,assign)BOOL isClickBackgroundCloseWindow; - -@end diff --git a/iOSProject/Pods/RAlertView/RAlertView/RAlertView.m b/iOSProject/Pods/RAlertView/RAlertView/RAlertView.m deleted file mode 100644 index 99203934..00000000 --- a/iOSProject/Pods/RAlertView/RAlertView/RAlertView.m +++ /dev/null @@ -1,383 +0,0 @@ -// -// RAlertView.m -// RAlert -// -// Created by roycms on 2016/10/11. -// Copyright © 2016年 roycms. All rights reserved. -// - -#import "RAlertView.h" - -@interface RAlertView () - -@property (nonatomic,strong)NSArray *themeArray; - -@end -@implementation RAlertView - - -/** - init - - @param style style description - @return return value description - */ -- (instancetype)initWithStyle:(AlertStyle)style { - self = [super init]; - if (self) { - [self initWindow:style]; - } - return self; -} - -/** - init - - @param style style description - @param width width description - @return return value description - */ -- (instancetype)initWithStyle:(AlertStyle)style width:(CGFloat)width{ - self = [super init]; - if (self) { - [self initWindow:style]; - [self setAlertWidth:width]; - } - return self; -} - -/** - 准备默认数据 - */ --(void)prepareData{ - - self.themeArray = @[RGB16(0X1abc9c), - RGB16(0X27ae60), - RGB16(0X2980b9), - RGB16(0X2c3e50), - RGB16(0Xf39c12), - RGB16(0Xc0392b), - RGB16(0X7f8c8d), - RGB16(0X8e44ad)]; - - [self.confirmButton setBackgroundColor:self.themeArray[(arc4random() % 8)]]; - [self.confirmButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; -} - -/** - 设置弹框的宽度 - - @param width width 宽度值 范围 0-1 百分比 - */ --(void)setAlertWidth:(CGFloat)width{ - - [self.mainView mas_updateConstraints:^(MASConstraintMaker *make) { - if (width > 1) { - make.width.offset(width); - } - else if(width > 0 && width <= 1){ - make.width.offset([UIScreen mainScreen].bounds.size.width * width); - } - else{ - make.width.offset([UIScreen mainScreen].bounds.size.width * 0.7); - } - }]; -} - -/** - 设置 主题的 set 方法 - - @param theme theme description - */ --(void)setTheme:(UIColor*)theme{ - - [self.confirmButton setBackgroundColor:theme]; - [self.confirmButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; -} - - -/** - 单击 背景 是否关闭弹窗 - - @param isClickBackgroundCloseWindow isClickBackgroundCloseWindow description - */ --(void)setIsClickBackgroundCloseWindow:(BOOL)isClickBackgroundCloseWindow{ - if(isClickBackgroundCloseWindow){ - UITapGestureRecognizer*tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(exit)]; - [self addGestureRecognizer:tapGesture]; - } -} - --(void)initWindow:(AlertStyle)style{ - - [self viewInitUI]; - - switch (style) { - case SimpleAlert: - [self simpleAlertViewInitUI]; - break; - case ConfirmAlert: - [self confirmAlertViewInitUI]; - - break; - case CancelAndConfirmAlert: - [self cancelAndConfirmAlertViewInitUI]; - break; - } - - [self animateSenior]; - [self prepareData]; -} - -/** - view 初始化 - */ --(void)viewInitUI{ - - UIWindow *window = [[[UIApplication sharedApplication] delegate] window]; - - [window addSubview:self]; - [self addSubview:self.mainView]; - [self setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.8]]; - [self.mainView insertSubview:self.closedButton atIndex:999]; - [self.mainView addSubview:self.headerTitleLabel]; - [self.mainView insertSubview:self.contentView atIndex:0]; - - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(window); - }]; - self.mainView.translatesAutoresizingMaskIntoConstraints =NO; - - [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self.mainView.superview); - make.width.offset([UIScreen mainScreen].bounds.size.width * 0.7); - }]; - - [self.closedButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.mainView); - make.right.equalTo(self.mainView); - make.width.height.offset(35); - }]; - [self.headerTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.mainView).offset(10); - make.left.equalTo(self.mainView).offset(15); - make.right.equalTo(self.mainView).offset(-30); - }]; - [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.headerTitleLabel.mas_bottom).offset(5); - make.left.equalTo(self.headerTitleLabel); - make.right.equalTo(self.mainView).offset(-15); - make.bottom.equalTo(self.mainView).offset(-10); - }]; -} - -/** - 无按钮 弹窗样式 - */ --(void)simpleAlertViewInitUI{ - - [self.contentTextLabel setFont:[UIFont systemFontOfSize:15]]; - [self.contentView addSubview:self.contentTextLabel]; - [self.contentTextLabel sizeToFit]; - - [self.contentTextLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.contentView).offset(10); - make.left.equalTo(self.contentView); - make.right.equalTo(self.contentView); - make.bottom.equalTo(self.contentView).offset(-10); - }]; -} - -/** - 只有确认按钮 的弹窗样式 - */ --(void)confirmAlertViewInitUI{ - - [self.mainView addSubview:self.confirmButton]; - [self.contentView addSubview:self.contentTextLabel]; - - [self.contentTextLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.contentView).offset(10); - make.left.equalTo(self.contentView); - make.right.equalTo(self.contentView); - }]; - [self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.contentTextLabel.mas_bottom).offset(10); - make.left.right.equalTo(self.mainView); - make.bottom.equalTo(self.mainView); - make.height.offset(40); - }]; -} - -/** - 有取消 按钮 和 确认按钮的弹窗样式 - */ --(void)cancelAndConfirmAlertViewInitUI{ - [self.mainView addSubview:self.cancelButton]; - [self.mainView addSubview:self.confirmButton]; - [self.contentView addSubview:self.contentTextLabel]; - - [self.contentTextLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.contentView).offset(10); - make.left.equalTo(self.contentView); - make.right.equalTo(self.contentView); - }]; - - NSMutableArray *arrayM = @[].mutableCopy; - [arrayM addObject:self.cancelButton]; - [arrayM addObject:self.confirmButton]; - - [arrayM mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedSpacing:0 leadSpacing:0 tailSpacing:0]; - [arrayM mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.equalTo(@40); - make.bottom.equalTo(self.mainView); - make.top.equalTo(self.contentTextLabel.mas_bottom).offset(10); - }]; -} - -/** - 弹窗飞入 动画 - */ --(void)animate{ - - [self setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0]]; - [UIView animateWithDuration:0.12 animations:^{ - [self setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.8]]; - }]; - - self.mainView.transform = CGAffineTransformMakeTranslation(0, 600); - [UIView animateWithDuration:0.12 animations:^{ - self.mainView.transform = CGAffineTransformMakeTranslation(0, 0); - }]; -} - -/** - 弹窗飞入 渐变 动画 - */ --(void)animateSenior{ - - self.mainView.transform = CGAffineTransformMakeTranslation(0, 600); - [UIView animateWithDuration:0.2 delay:0 usingSpringWithDamping:0.35 initialSpringVelocity:0.5 options:UIViewAnimationOptionCurveLinear animations:^{ - self.mainView.transform = CGAffineTransformMakeTranslation(0, 0); - } completion:^(BOOL finished) { - }]; -} - -#pragma make 事件 - -/** - 销毁弹窗 方法 - */ --(void)exit{ - [self removeFromSuperview]; -} - -/** - 关闭按钮事件 - - @param sender sender description - */ --(void)closedButtonClick:(UIButton *)sender{ - [self exit]; -} - -/** - 确定按钮的事件 - - @param sender sender description - */ --(void)confirmButtonClick:(UIButton*)sender{ - - if(self.confirm){ - self.confirm(); - } - [self exit]; -} - -/** - 取消按钮的 事件 - - @param sender sender description - */ --(void)cancelButtonClick:(UIButton*)sender{ - if(self.cancel){ - self.cancel(); - } - [self exit]; -} - -#pragma make 懒加载 - --(UIView*)mainView{ - if (_mainView == nil) { - _mainView = [[UIView alloc]init]; - [_mainView setBackgroundColor:[UIColor whiteColor]]; - [_mainView.layer setMasksToBounds:YES]; - [_mainView.layer setCornerRadius:4]; - } - return _mainView; -} --(UIButton *)confirmButton{ - if(_confirmButton == nil){ - _confirmButton = [[UIButton alloc]init]; - [_confirmButton setBackgroundColor:RGB16(0Xfddb43)]; - [_confirmButton setTitle:@"Ok" forState:UIControlStateNormal]; - [_confirmButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; - [_confirmButton setTitleColor:RGB16(0X3d3d3d) forState:UIControlStateNormal]; - [_confirmButton.titleLabel setFont:[UIFont systemFontOfSize:15]]; - [_confirmButton addTarget:self action:@selector(confirmButtonClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _confirmButton; -} --(UIButton *)cancelButton{ - if(_cancelButton == nil){ - _cancelButton = [[UIButton alloc]init]; - [_cancelButton setBackgroundColor:RGB16(0XEBECED)]; - [_cancelButton setTitle:@"Cancel" forState:UIControlStateNormal]; - [_cancelButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; - [_cancelButton setTitleColor:RGB16(0X3d3d3d) forState:UIControlStateNormal]; - [_cancelButton.titleLabel setFont:[UIFont systemFontOfSize:15]]; - [_cancelButton addTarget:self action:@selector(cancelButtonClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _cancelButton; -} - --(UIButton *)closedButton{ - if(_closedButton == nil){ - _closedButton = [[UIButton alloc]init]; - [_closedButton setImage:[UIImage imageNamed:@"closed.png"] forState:UIControlStateNormal]; - [_closedButton addTarget:self action:@selector(closedButtonClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _closedButton; -} - --(UILabel*)headerTitleLabel { - if (_headerTitleLabel == nil) { - _headerTitleLabel = [[UILabel alloc]init]; - [_headerTitleLabel setFont:[UIFont systemFontOfSize:15]]; - [_headerTitleLabel setTextAlignment:NSTextAlignmentCenter]; - [_headerTitleLabel setTextColor:RGB16(0X3d3d3d)]; - } - return _headerTitleLabel; -} - --(UIView *)contentView{ - if(_contentView==nil){ - _contentView =[[UIView alloc]init]; - [_contentView setBackgroundColor:[UIColor whiteColor]]; - } - return _contentView; -} - --(UILabel*)contentTextLabel { - if (_contentTextLabel == nil) { - _contentTextLabel = [[UILabel alloc]init]; - [_contentTextLabel setFont:[UIFont systemFontOfSize:13]]; - [_contentTextLabel setTextAlignment:NSTextAlignmentCenter]; - [_contentTextLabel setTextColor:RGB16(0X898989)]; - _contentTextLabel.numberOfLines = 0; - } - return _contentTextLabel; -} - -@end diff --git a/iOSProject/Pods/RAlertView/RAlertView/TextHelper.h b/iOSProject/Pods/RAlertView/RAlertView/TextHelper.h deleted file mode 100644 index 5caf67ff..00000000 --- a/iOSProject/Pods/RAlertView/RAlertView/TextHelper.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// TextHelper.h -// RAlert -// -// Created by roycms on 2016/11/26. -// Copyright © 2016年 roycms. All rights reserved. -// -#import -#import - -@interface TextHelper : NSObject - -/** - 返回 attributedStringForString 格式的str - - @param str str description - @param lineSpacing lineSpacing description - @return return value description - */ -+ (NSMutableAttributedString *)attributedStringForString:(NSString *)str lineSpacing:(CGFloat)lineSpacing; -@end diff --git a/iOSProject/Pods/RAlertView/RAlertView/TextHelper.m b/iOSProject/Pods/RAlertView/RAlertView/TextHelper.m deleted file mode 100644 index 971491ad..00000000 --- a/iOSProject/Pods/RAlertView/RAlertView/TextHelper.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// TextHelper.m -// RAlert -// -// Created by roycms on 2016/11/26. -// Copyright © 2016年 roycms. All rights reserved. -// - -#import "TextHelper.h" - - -@implementation TextHelper - -+ (NSMutableAttributedString *)attributedStringForString:(NSString *)str lineSpacing:(CGFloat)lineSpacing{ - - NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:str]; - NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init]; - [paragraphStyle setLineSpacing:lineSpacing]; - [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [str length])]; - return attributedString; -} - -@end diff --git a/iOSProject/Pods/RAlertView/RAlertView/closed.png b/iOSProject/Pods/RAlertView/RAlertView/closed.png deleted file mode 100644 index 6c520dd4..00000000 Binary files a/iOSProject/Pods/RAlertView/RAlertView/closed.png and /dev/null differ diff --git a/iOSProject/Pods/RAlertView/RAlertView/closed@2x.png b/iOSProject/Pods/RAlertView/RAlertView/closed@2x.png deleted file mode 100644 index 0f7b59cc..00000000 Binary files a/iOSProject/Pods/RAlertView/RAlertView/closed@2x.png and /dev/null differ diff --git a/iOSProject/Pods/RAlertView/RAlertView/closed@3x.png b/iOSProject/Pods/RAlertView/RAlertView/closed@3x.png deleted file mode 100644 index f67c5f7d..00000000 Binary files a/iOSProject/Pods/RAlertView/RAlertView/closed@3x.png and /dev/null differ diff --git a/iOSProject/Pods/RAlertView/README-CN.md b/iOSProject/Pods/RAlertView/README-CN.md deleted file mode 100644 index ab1b60d7..00000000 --- a/iOSProject/Pods/RAlertView/README-CN.md +++ /dev/null @@ -1,94 +0,0 @@ - ![Logo](https://roycms.github.io/AlertView/RAlert/logo.png) - RAlertView ios弹窗 -=== -AlertView 是一个ios弹窗框架,可以很简单的集成到自己的项目内,支持pod. - -[![Shippable](https://img.shields.io/shippable/5444c5ecb904a4b21567b0ff.svg?maxAge=2592000?style=flat-square)](https://github.com/roycms/RAlertView) -[![CocoaPods](https://img.shields.io/badge/pod-0.0.1-red.svg)](http://cocoapods.org/?q=RAlertView) -[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=flat-square)](https://github.com/roycms/RAlertView/blob/master/LICENSE) -[![email](https://img.shields.io/badge/%20email%20-%20roycms%40qq.com%20-yellowgreen.svg)](mailto:roycms@qq.com) - -## 动画预览 - ![Warning content](https://roycms.github.io/AlertView/RAlert/RAlert.gif) - -## 安装 -- 手动安装依赖 ` Masonry ` 和 ` HexColors ` 框架,如果项目没有引入请导入这两个框架 -- 在需要的地方导入:`#import "RAlertView.h"` 你懂的 - -## cocoapods 安装 -` pod 'AlertView' ` - -## 弹窗类型 AlertStyle -```objective-c -typedef NS_ENUM(NSInteger,AlertStyle) { - SimpleAlert = 0, - ConfirmAlert, - CancelAndConfirmAlert, -}; -``` -![RAlertView Preview](https://roycms.github.io/AlertView/RAlert/AlertStyle.jpg) -## 弹窗主题效果 AlertTheme -```objective-c - RAlertView *alert = [[RAlertView alloc] initWithStyle:CancelAndConfirmAlert]; - alert.theme =[UIColor redColor]; -``` -![RAlertView Preview](https://roycms.github.io/AlertView/RAlert/Theme.jpg) - -## 一些属性设置 -* 设置单击背景或者任意位置都可以关闭弹窗 -```objective-c -alert.isClickBackgroundCloseWindow = YES; -``` -* 设置弹窗内容的文字的对齐是否居中 -```objective-c -alert.contentTextLabel.text =@"SimpleAlert \nAlertView A pop-up framework, Can be simple and convenient to join your project"; - -alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5]; -``` - -## 初始化弹窗 RAlertView -* 按照样式初始化 initWithStyle AlertStyle -```objective-c -RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert]; -``` -* 按照样式和宽度初始化 width的值可以设置0-1表示小对于屏幕宽度的百分比,如果大于1的值则按照px像素处理 initWithStyle AlertStyle and width -```objective-c -RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert width:0.8]; -``` -## SimpleAlert -```objective-c -RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert width:0.8]; -alert.isClickBackgroundCloseWindow = YES; -alert.contentTextLabel.text =@"SimpleAlert \nAlertView A pop-up framework, Can be simple and convenient to join your project"; -``` -## ConfirmAlert -```objective-c -RAlertView *alert = [[RAlertView alloc] initWithStyle:ConfirmAlert]; -alert.headerTitleLabel.text = @"ConfirmAlert"; -alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5]; -[alert.confirmButton setTitle:@"Ok" forState:UIControlStateNormal]; -alert.confirm = ^(){ - NSLog(@"Click on the Ok"); - }; - -``` -## CancelAndConfirmAlert -```objective-c -RAlertView *alert = [[RAlertView alloc] initWithStyle:CancelAndConfirmAlert]; -alert.headerTitleLabel.text = @"CancelAndConfirmAlert"; -alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];; -[alert.confirmButton setTitle:@"Ok" forState:UIControlStateNormal]; -[alert.cancelButton setTitle:@"Cancel" forState:UIControlStateNormal]; -alert.confirm = ^(){ - NSLog(@"Click on the Ok"); - }; -alert.cancel = ^(){ - NSLog(@"Click on the Cancel"); - }; -``` -## 期待 -* 如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的框架代码看看BUG修复没有) -* 如果在使用过程中发现功能不够用,希望你能Issues我,我非常想为这个框架增加更多好用的功能,谢谢 -* 如果你想为RAlertView输出代码,请拼命Pull Requests我 - -排版规范参考 https://github.com/sparanoid/chinese-copywriting-guidelines diff --git a/iOSProject/Pods/RGB/LICENSE b/iOSProject/Pods/RGB/LICENSE deleted file mode 100644 index 75cf0d8c..00000000 --- a/iOSProject/Pods/RGB/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 ROYcms最佳C#开源CMS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/iOSProject/Pods/RGB/README.md b/iOSProject/Pods/RGB/README.md deleted file mode 100644 index 03379031..00000000 --- a/iOSProject/Pods/RGB/README.md +++ /dev/null @@ -1,27 +0,0 @@ - ![Logo](https://github.com/roycms/RGB/blob/master/RGB/logo.png) - RGB -=== -RGB color value to the UIColor conversion kit. - -[![Shippable](https://img.shields.io/shippable/5444c5ecb904a4b21567b0ff.svg?maxAge=2592000?style=flat-square)](https://github.com/roycms/RAlertView) -[![CocoaPods](https://img.shields.io/badge/pod-0.0.1-red.svg)](http://cocoapods.org/?q=RAlertView) -[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=flat-square)](https://github.com/roycms/RAlertView/blob/master/LICENSE) -[![email](https://img.shields.io/badge/%20email%20-%20roycms%40qq.com%20-yellowgreen.svg)](mailto:roycms@qq.com) - -## Installation -- Import the main header file:`#import "RRGB.h"` - -## cocoapods -` pod 'RGB' ` - -## Use -return type UIColor -```objective-c -[self.view setBackgroundColor:RGB(@"#1abc9d")]; -[self.view setBackgroundColor:RGB16(0x1abc9d)]; -``` - -## 期待 -* 如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的框架代码看看BUG修复没有) -* 如果在使用过程中发现功能不够用,希望你能Issues我,我非常想为这个框架增加更多好用的功能,谢谢 -* 如果你想为RAlertView输出代码,请拼命Pull Requests我 diff --git a/iOSProject/Pods/RGB/RGBClassess/RRGB.h b/iOSProject/Pods/RGB/RGBClassess/RRGB.h deleted file mode 100644 index 1e68272c..00000000 --- a/iOSProject/Pods/RGB/RGBClassess/RRGB.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// RRGB.h -// RGB -// -// Created by roycms on 2016/10/19. -// Copyright © 2016年 roycms. All rights reserved. -// - -#define RGB(rgbValue) [RRGB colorWithRGBFromString:(rgbValue)] -#define RGB16(rgbValue) [RRGB colorWithRGB16:(rgbValue)] - -#import -#import -@interface RRGB : NSObject -+ (UIColor *)colorWithRGB16:(int)rgb; -+ (UIColor *)colorWithRGBFromString:(NSString *)rgb; -@end diff --git a/iOSProject/Pods/RGB/RGBClassess/RRGB.m b/iOSProject/Pods/RGB/RGBClassess/RRGB.m deleted file mode 100644 index 46ff4cca..00000000 --- a/iOSProject/Pods/RGB/RGBClassess/RRGB.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// RRGB.m -// RGB -// -// Created by roycms on 2016/10/19. -// Copyright © 2016年 roycms. All rights reserved. -// - -#import "RRGB.h" -@implementation RRGB - -+ (UIColor *)colorWithRGB16:(int)rgb { - return [UIColor colorWithRed:((rgb & 0xFF0000) >> 16) / 255.0f - green:((rgb & 0xFF00) >> 8) / 255.0f - blue:((rgb & 0xFF)) / 255.0f - alpha:1.0f]; -} -+ (UIColor *)colorWithRGBFromString:(NSString *)rgb { - if ([rgb rangeOfString:@"#"].location != NSNotFound) { - rgb = [rgb substringFromIndex:1]; - } - rgb = [NSString stringWithFormat:@"0x%@",rgb]; - unsigned long rgb16 = strtoul([rgb UTF8String],0,16); - - return [self colorWithRGB16:(int)rgb16]; -} -@end diff --git a/iOSProject/Pods/Reachability/LICENCE.txt b/iOSProject/Pods/Reachability/LICENCE.txt deleted file mode 100644 index 12b7844c..00000000 --- a/iOSProject/Pods/Reachability/LICENCE.txt +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011-2013, Tony Million. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/iOSProject/Pods/Reachability/README.md b/iOSProject/Pods/Reachability/README.md deleted file mode 100644 index 4814e6d4..00000000 --- a/iOSProject/Pods/Reachability/README.md +++ /dev/null @@ -1,75 +0,0 @@ -[![Reference Status](https://www.versioneye.com/objective-c/reachability/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/reachability/references) - -# Reachability - -This is a drop-in replacement for Apple's `Reachability` class. It is ARC-compatible, and it uses the new GCD methods to notify of network interface changes. - -In addition to the standard `NSNotification`, it supports the use of blocks for when the network becomes reachable and unreachable. - -Finally, you can specify whether a WWAN connection is considered "reachable". - -*DO NOT OPEN BUGS UNTIL YOU HAVE TESTED ON DEVICE* - -## Requirements - -Once you have added the `.h/m` files to your project, simply: - -* Go to the `Project->TARGETS->Build Phases->Link Binary With Libraries`. -* Press the plus in the lower left of the list. -* Add `SystemConfiguration.framework`. - -Boom, you're done. - -## Examples - -### Block Example - -This sample uses blocks to notify when the interface state has changed. The blocks will be called on a **BACKGROUND THREAD**, so you need to dispatch UI updates onto the main thread. - - // Allocate a reachability object - Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"]; - - // Set the blocks - reach.reachableBlock = ^(Reachability*reach) - { - // keep in mind this is called on a background thread - // and if you are updating the UI it needs to happen - // on the main thread, like this: - - dispatch_async(dispatch_get_main_queue(), ^{ - NSLog(@"REACHABLE!"); - }); - }; - - reach.unreachableBlock = ^(Reachability*reach) - { - NSLog(@"UNREACHABLE!"); - }; - - // Start the notifier, which will cause the reachability object to retain itself! - [reach startNotifier]; - -### `NSNotification` Example - -This sample will use `NSNotification`s to notify when the interface has changed. They will be delivered on the **MAIN THREAD**, so you *can* do UI updates from within the function. - -In addition, it asks the `Reachability` object to consider the WWAN (3G/EDGE/CDMA) as a non-reachable connection (you might use this if you are writing a video streaming app, for example, to save the user's data plan). - - // Allocate a reachability object - Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"]; - - // Tell the reachability that we DON'T want to be reachable on 3G/EDGE/CDMA - reach.reachableOnWWAN = NO; - - // Here we set up a NSNotification observer. The Reachability that caused the notification - // is passed in the object parameter - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(reachabilityChanged:) - name:kReachabilityChangedNotification - object:nil]; - - [reach startNotifier]; - -## Tell the world - -Head over to [Projects using Reachability](https://github.com/tonymillion/Reachability/wiki/Projects-using-Reachability) and add your project for "Maximum Wins!". diff --git a/iOSProject/Pods/Reachability/Reachability.h b/iOSProject/Pods/Reachability/Reachability.h deleted file mode 100644 index c4321523..00000000 --- a/iOSProject/Pods/Reachability/Reachability.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (c) 2011, Tony Million. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ - -#import -#import - - -/** - * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X. - * - * @see http://nshipster.com/ns_enum-ns_options/ - **/ -#ifndef NS_ENUM -#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type -#endif - -extern NSString *const kReachabilityChangedNotification; - -typedef NS_ENUM(NSInteger, NetworkStatus) { - // Apple NetworkStatus Compatible Names. - NotReachable = 0, - ReachableViaWiFi = 2, - ReachableViaWWAN = 1 -}; - -@class Reachability; - -typedef void (^NetworkReachable)(Reachability * reachability); -typedef void (^NetworkUnreachable)(Reachability * reachability); - - -@interface Reachability : NSObject - -@property (nonatomic, copy) NetworkReachable reachableBlock; -@property (nonatomic, copy) NetworkUnreachable unreachableBlock; - -@property (nonatomic, assign) BOOL reachableOnWWAN; - - -+(Reachability*)reachabilityWithHostname:(NSString*)hostname; -// This is identical to the function above, but is here to maintain -//compatibility with Apples original code. (see .m) -+(Reachability*)reachabilityWithHostName:(NSString*)hostname; -+(Reachability*)reachabilityForInternetConnection; -+(Reachability*)reachabilityWithAddress:(void *)hostAddress; -+(Reachability*)reachabilityForLocalWiFi; - --(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; - --(BOOL)startNotifier; --(void)stopNotifier; - --(BOOL)isReachable; --(BOOL)isReachableViaWWAN; --(BOOL)isReachableViaWiFi; - -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. --(BOOL)isConnectionRequired; // Identical DDG variant. --(BOOL)connectionRequired; // Apple's routine. -// Dynamic, on demand connection? --(BOOL)isConnectionOnDemand; -// Is user intervention required? --(BOOL)isInterventionRequired; - --(NetworkStatus)currentReachabilityStatus; --(SCNetworkReachabilityFlags)reachabilityFlags; --(NSString*)currentReachabilityString; --(NSString*)currentReachabilityFlags; - -@end diff --git a/iOSProject/Pods/Reachability/Reachability.m b/iOSProject/Pods/Reachability/Reachability.m deleted file mode 100644 index f2952d93..00000000 --- a/iOSProject/Pods/Reachability/Reachability.m +++ /dev/null @@ -1,469 +0,0 @@ -/* - Copyright (c) 2011, Tony Million. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ - -#import "Reachability.h" - -#import -#import -#import -#import -#import -#import - - -NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification"; - - -@interface Reachability () - -@property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; -@property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; -@property (nonatomic, strong) id reachabilityObject; - --(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags; --(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags; - -@end - - -static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags) -{ - return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c", -#if TARGET_OS_IPHONE - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', -#else - 'X', -#endif - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-']; -} - -// Start listening for reachability notifications on the current run loop -static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) -{ -#pragma unused (target) - - Reachability *reachability = ((__bridge Reachability*)info); - - // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool, - // but what the heck eh? - @autoreleasepool - { - [reachability reachabilityChanged:flags]; - } -} - - -@implementation Reachability - -#pragma mark - Class Constructor Methods - -+(Reachability*)reachabilityWithHostName:(NSString*)hostname -{ - return [Reachability reachabilityWithHostname:hostname]; -} - -+(Reachability*)reachabilityWithHostname:(NSString*)hostname -{ - SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]); - if (ref) - { - id reachability = [[self alloc] initWithReachabilityRef:ref]; - - return reachability; - } - - return nil; -} - -+(Reachability *)reachabilityWithAddress:(void *)hostAddress -{ - SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); - if (ref) - { - id reachability = [[self alloc] initWithReachabilityRef:ref]; - - return reachability; - } - - return nil; -} - -+(Reachability *)reachabilityForInternetConnection -{ - struct sockaddr_in zeroAddress; - bzero(&zeroAddress, sizeof(zeroAddress)); - zeroAddress.sin_len = sizeof(zeroAddress); - zeroAddress.sin_family = AF_INET; - - return [self reachabilityWithAddress:&zeroAddress]; -} - -+(Reachability*)reachabilityForLocalWiFi -{ - struct sockaddr_in localWifiAddress; - bzero(&localWifiAddress, sizeof(localWifiAddress)); - localWifiAddress.sin_len = sizeof(localWifiAddress); - localWifiAddress.sin_family = AF_INET; - // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 - localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); - - return [self reachabilityWithAddress:&localWifiAddress]; -} - - -// Initialization methods - --(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref -{ - self = [super init]; - if (self != nil) - { - self.reachableOnWWAN = YES; - self.reachabilityRef = ref; - - // We need to create a serial queue. - // We allocate this once for the lifetime of the notifier. - - self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL); - } - - return self; -} - --(void)dealloc -{ - [self stopNotifier]; - - if(self.reachabilityRef) - { - CFRelease(self.reachabilityRef); - self.reachabilityRef = nil; - } - - self.reachableBlock = nil; - self.unreachableBlock = nil; - self.reachabilitySerialQueue = nil; -} - -#pragma mark - Notifier Methods - -// Notifier -// NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD -// - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS. -// INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want) - --(BOOL)startNotifier -{ - // allow start notifier to be called multiple times - if(self.reachabilityObject && (self.reachabilityObject == self)) - { - return YES; - } - - - SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL }; - context.info = (__bridge void *)self; - - if(SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context)) - { - // Set it as our reachability queue, which will retain the queue - if(SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue)) - { - // this should do a retain on ourself, so as long as we're in notifier mode we shouldn't disappear out from under ourselves - // woah - self.reachabilityObject = self; - return YES; - } - else - { -#ifdef DEBUG - NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError())); -#endif - - // UH OH - FAILURE - stop any callbacks! - SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); - } - } - else - { -#ifdef DEBUG - NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError())); -#endif - } - - // if we get here we fail at the internet - self.reachabilityObject = nil; - return NO; -} - --(void)stopNotifier -{ - // First stop, any callbacks! - SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); - - // Unregister target from the GCD serial dispatch queue. - SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL); - - self.reachabilityObject = nil; -} - -#pragma mark - reachability tests - -// This is for the case where you flick the airplane mode; -// you end up getting something like this: -//Reachability: WR ct----- -//Reachability: -- ------- -//Reachability: WR ct----- -//Reachability: -- ------- -// We treat this as 4 UNREACHABLE triggers - really apple should do better than this - -#define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection) - --(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags -{ - BOOL connectionUP = YES; - - if(!(flags & kSCNetworkReachabilityFlagsReachable)) - connectionUP = NO; - - if( (flags & testcase) == testcase ) - connectionUP = NO; - -#if TARGET_OS_IPHONE - if(flags & kSCNetworkReachabilityFlagsIsWWAN) - { - // We're on 3G. - if(!self.reachableOnWWAN) - { - // We don't want to connect when on 3G. - connectionUP = NO; - } - } -#endif - - return connectionUP; -} - --(BOOL)isReachable -{ - SCNetworkReachabilityFlags flags; - - if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - return NO; - - return [self isReachableWithFlags:flags]; -} - --(BOOL)isReachableViaWWAN -{ -#if TARGET_OS_IPHONE - - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - // Check we're REACHABLE - if(flags & kSCNetworkReachabilityFlagsReachable) - { - // Now, check we're on WWAN - if(flags & kSCNetworkReachabilityFlagsIsWWAN) - { - return YES; - } - } - } -#endif - - return NO; -} - --(BOOL)isReachableViaWiFi -{ - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - // Check we're reachable - if((flags & kSCNetworkReachabilityFlagsReachable)) - { -#if TARGET_OS_IPHONE - // Check we're NOT on WWAN - if((flags & kSCNetworkReachabilityFlagsIsWWAN)) - { - return NO; - } -#endif - return YES; - } - } - - return NO; -} - - -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. --(BOOL)isConnectionRequired -{ - return [self connectionRequired]; -} - --(BOOL)connectionRequired -{ - SCNetworkReachabilityFlags flags; - - if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - return (flags & kSCNetworkReachabilityFlagsConnectionRequired); - } - - return NO; -} - -// Dynamic, on demand connection? --(BOOL)isConnectionOnDemand -{ - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && - (flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand))); - } - - return NO; -} - -// Is user intervention required? --(BOOL)isInterventionRequired -{ - SCNetworkReachabilityFlags flags; - - if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && - (flags & kSCNetworkReachabilityFlagsInterventionRequired)); - } - - return NO; -} - - -#pragma mark - reachability status stuff - --(NetworkStatus)currentReachabilityStatus -{ - if([self isReachable]) - { - if([self isReachableViaWiFi]) - return ReachableViaWiFi; - -#if TARGET_OS_IPHONE - return ReachableViaWWAN; -#endif - } - - return NotReachable; -} - --(SCNetworkReachabilityFlags)reachabilityFlags -{ - SCNetworkReachabilityFlags flags = 0; - - if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) - { - return flags; - } - - return 0; -} - --(NSString*)currentReachabilityString -{ - NetworkStatus temp = [self currentReachabilityStatus]; - - if(temp == ReachableViaWWAN) - { - // Updated for the fact that we have CDMA phones now! - return NSLocalizedString(@"Cellular", @""); - } - if (temp == ReachableViaWiFi) - { - return NSLocalizedString(@"WiFi", @""); - } - - return NSLocalizedString(@"No Connection", @""); -} - --(NSString*)currentReachabilityFlags -{ - return reachabilityFlags([self reachabilityFlags]); -} - -#pragma mark - Callback function calls this method - --(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags -{ - if([self isReachableWithFlags:flags]) - { - if(self.reachableBlock) - { - self.reachableBlock(self); - } - } - else - { - if(self.unreachableBlock) - { - self.unreachableBlock(self); - } - } - - // this makes sure the change notification happens on the MAIN THREAD - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification - object:self]; - }); -} - -#pragma mark - Debug Description - -- (NSString *) description -{ - NSString *description = [NSString stringWithFormat:@"<%@: %#x (%@)>", - NSStringFromClass([self class]), (unsigned int) self, [self currentReachabilityFlags]]; - return description; -} - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/LICENSE b/iOSProject/Pods/SDCycleScrollView/LICENSE deleted file mode 100755 index 75db35c0..00000000 --- a/iOSProject/Pods/SDCycleScrollView/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 GSD_iOS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/iOSProject/Pods/SDCycleScrollView/README.md b/iOSProject/Pods/SDCycleScrollView/README.md deleted file mode 100644 index 71908640..00000000 --- a/iOSProject/Pods/SDCycleScrollView/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# SDCycleScrollView(新建QQ交流群:185534916、675995250) -## ☆☆☆ “iOS图片、文字轮播器” ☆☆☆ - -### 支持pod导入 -pod 'SDCycleScrollView','~> 1.73' - - 如果发现pod search SDCycleScrollView 搜索出来的不是最新版本,需要在终端执行cd转换文件路径命令退回到desktop,然后执行pod setup命令更新本地spec缓存(可能需要几分钟),然后再搜索就可以了 - -### 我的公众号 -主要用于编程经验分享+SD系列开源库答疑解惑,有需要的请关注! - ![](https://github.com/gsdios/SDCycleScrollView/blob/master/qrcode_for_gh_a69e5c4e13c4_430.jpg?raw=true) - - -### 更改记录: - -2017.11.26 -- 增加滚动到指定index接口 - -2017.10.28 -- 更新对SDWebImage的版本依赖 - -2017.06.23 -- 1.增加支持轮播自定义cell的代理方法 2.增加禁止拖动手势api - -2016.05.27 -- 新增纯文字轮播、增加viewController在来回push时候出现的图片卡在中间的解决方案“解决viewWillAppear时出现时轮播图卡在一半的问题,在控制器viewWillAppear时调用 adjustWhenControllerViewWillAppera” - -2016.04.21 -- 修复自定义图片的pagecontrol刷新图片数据时崩溃bug;设置单张图片时停止轮播 - -2016.03.31 -- 增加垂直方向滚动功能 - -2016.01.21 -- 修复加载时出现item size zero提示问题 - -2016.01.15 -- 兼容assets存放的本地图片 - -2016.01.06 -- 0.图片管理使用SDWebImage;1.优化内存,提升性能;2.添加图片contentmode接口;3.block监听点击接口;4.滚动到某张图片监听;5.增加自定义图片pageControl接口;6.其他等等。其中有一处接口改动:pagecontrol的小圆点自定义接口改为:currentPageDotColor、pageDotColor、currentPageDotImage、pageDotImage。 - - -### 无限循环自动图片轮播器(一步设置即可使用) - - // 网络加载图片的轮播器 - SDCycleScrollView *cycleScrollView = [cycleScrollViewWithFrame:frame delegate:delegate placeholderImage:placeholderImage]; - cycleScrollView.imageURLStringsGroup = imagesURLStrings; - - // 本地加载图片的轮播器 - SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame: imagesGroup:图片数组]; - - - --------------------------------------------------------------------------------------------------------------- - -## ??? 为什么我用这个轮播期会在顶部出现一块空白区域 -以下是本库的使用者给出的一些解决方法放在这里供大家参考: -在iOS 7以后,controller 会对其中唯一的scrollView或其子类调整内边距,从而导致位置不准确。设置self.automaticallyAdjustsScrollViewInsets = NO;或者controller中放置不止一个scrollView或其子类时,就不会出现这种问题。以上原因是我的猜测,只要我设置了 self.automaticallyAdjustsScrollViewInsets = NO就没有那个问题了。 - -#PS: - - 如需更详细的设置,参考如下: - - 1. cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight; // 设置pageControl居右,默认居中 - - 2. cycleScrollView.titlesGroup = 标题数组(数组元素个数必须和图片数组元素个数保持一致); // 如果设置title数组,则会在图片下面添加标题 - - 3. cycleScrollView.delegate = ; // 如需监听图片点击,请设置代理,实现代理方法 - - 4. cycleScrollView.autoScrollTimeInterval = ;// 自定义轮播时间间隔 - -![](http://ww4.sinaimg.cn/bmiddle/9b8146edjw1esvytq7lwrg208p0fce82.gif) - -![](http://cdn.cocimg.com/bbs/attachment/Fid_19/19_441660_d01407e9c4b63d1.gif) diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.h b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.h deleted file mode 100755 index bcf91f35..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// TAAbstractDotView.h -// TAPageControl -// -// Created by Tanguy Aladenise on 2015-01-22. -// Copyright (c) 2015 Tanguy Aladenise. All rights reserved. -// - -#import - - -@interface TAAbstractDotView : UIView - - -/** - * A method call let view know which state appearance it should take. Active meaning it's current page. Inactive not the current page. - * - * @param active BOOL to tell if view is active or not - */ -- (void)changeActivityState:(BOOL)active; - - -@end - diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.m b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.m deleted file mode 100755 index d39c4b5f..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAbstractDotView.m +++ /dev/null @@ -1,30 +0,0 @@ -// -// TAAbstractDotView.m -// TAPageControl -// -// Created by Tanguy Aladenise on 2015-01-22. -// Copyright (c) 2015 Tanguy Aladenise. All rights reserved. -// - -#import "TAAbstractDotView.h" - - -@implementation TAAbstractDotView - - -- (id)init -{ - @throw [NSException exceptionWithName:NSInternalInconsistencyException - reason:[NSString stringWithFormat:@"You must override %@ in %@", NSStringFromSelector(_cmd), self.class] - userInfo:nil]; -} - - -- (void)changeActivityState:(BOOL)active -{ - @throw [NSException exceptionWithName:NSInternalInconsistencyException - reason:[NSString stringWithFormat:@"You must override %@ in %@", NSStringFromSelector(_cmd), self.class] - userInfo:nil]; -} - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.h b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.h deleted file mode 100755 index 7214e06b..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// TAAnimatedDotView.h -// TAPageControl -// -// Created by Tanguy Aladenise on 2015-01-22. -// Copyright (c) 2015 Tanguy Aladenise. All rights reserved. -// - -#import "TAAbstractDotView.h" - -@interface TAAnimatedDotView : TAAbstractDotView - -@property (nonatomic, strong) UIColor *dotColor; - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.m b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.m deleted file mode 100755 index e6202bbf..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAAnimatedDotView.m +++ /dev/null @@ -1,88 +0,0 @@ -// -// TAAnimatedDotView.m -// TAPageControl -// -// Created by Tanguy Aladenise on 2015-01-22. -// Copyright (c) 2015 Tanguy Aladenise. All rights reserved. -// - -#import "TAAnimatedDotView.h" - -static CGFloat const kAnimateDuration = 1; - -@implementation TAAnimatedDotView - -- (instancetype)init -{ - self = [super init]; - if (self) { - [self initialization]; - } - - return self; -} - - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - [self initialization]; - } - return self; -} - - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - self = [super initWithCoder:aDecoder]; - if (self) { - [self initialization]; - } - - return self; -} - -- (void)setDotColor:(UIColor *)dotColor -{ - _dotColor = dotColor; - self.layer.borderColor = dotColor.CGColor; -} - -- (void)initialization -{ - _dotColor = [UIColor whiteColor]; - self.backgroundColor = [UIColor clearColor]; - self.layer.cornerRadius = CGRectGetWidth(self.frame) / 2; - self.layer.borderColor = [UIColor whiteColor].CGColor; - self.layer.borderWidth = 2; -} - - -- (void)changeActivityState:(BOOL)active -{ - if (active) { - [self animateToActiveState]; - } else { - [self animateToDeactiveState]; - } -} - - -- (void)animateToActiveState -{ - [UIView animateWithDuration:kAnimateDuration delay:0 usingSpringWithDamping:.5 initialSpringVelocity:-20 options:UIViewAnimationOptionCurveLinear animations:^{ - self.backgroundColor = _dotColor; - self.transform = CGAffineTransformMakeScale(1.4, 1.4); - } completion:nil]; -} - -- (void)animateToDeactiveState -{ - [UIView animateWithDuration:kAnimateDuration delay:0 usingSpringWithDamping:.5 initialSpringVelocity:0 options:UIViewAnimationOptionCurveLinear animations:^{ - self.backgroundColor = [UIColor clearColor]; - self.transform = CGAffineTransformIdentity; - } completion:nil]; -} - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.h b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.h deleted file mode 100755 index cf984ccb..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// TADotView.h -// TAPageControl -// -// Created by Tanguy Aladenise on 2015-01-22. -// Copyright (c) 2015 Tanguy Aladenise. All rights reserved. -// - -#import "TAAbstractDotView.h" - -@interface TADotView : TAAbstractDotView - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.m b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.m deleted file mode 100755 index 092170ad..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TADotView.m +++ /dev/null @@ -1,63 +0,0 @@ -// -// TADotView.m -// TAPageControl -// -// Created by Tanguy Aladenise on 2015-01-22. -// Copyright (c) 2015 Tanguy Aladenise. All rights reserved. -// - -#import "TADotView.h" - -@implementation TADotView - - -- (instancetype)init -{ - self = [super init]; - if (self) { - [self initialization]; - } - - return self; -} - - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - [self initialization]; - } - return self; -} - - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - self = [super initWithCoder:aDecoder]; - if (self) { - [self initialization]; - } - - return self; -} - -- (void)initialization -{ - self.backgroundColor = [UIColor clearColor]; - self.layer.cornerRadius = CGRectGetWidth(self.frame) / 2; - self.layer.borderColor = [UIColor whiteColor].CGColor; - self.layer.borderWidth = 2; -} - - -- (void)changeActivityState:(BOOL)active -{ - if (active) { - self.backgroundColor = [UIColor whiteColor]; - } else { - self.backgroundColor = [UIColor clearColor]; - } -} - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.h b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.h deleted file mode 100755 index 366ff47d..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.h +++ /dev/null @@ -1,106 +0,0 @@ -// -// TAPageControl.h -// TAPageControl -// -// Created by Tanguy Aladenise on 2015-01-21. -// Copyright (c) 2015 Tanguy Aladenise. All rights reserved. -// - -#import - -@protocol TAPageControlDelegate; - - -@interface TAPageControl : UIControl - - -/** - * Dot view customization properties - */ - -/** - * The Class of your custom UIView, make sure to respect the TAAbstractDotView class. - */ -@property (nonatomic) Class dotViewClass; - - -/** - * UIImage to represent a dot. - */ -@property (nonatomic) UIImage *dotImage; - - -/** - * UIImage to represent current page dot. - */ -@property (nonatomic) UIImage *currentDotImage; - - -/** - * Dot size for dot views. Default is 8 by 8. - */ -@property (nonatomic) CGSize dotSize; - - -@property (nonatomic, strong) UIColor *dotColor; - -/** - * Spacing between two dot views. Default is 8. - */ -@property (nonatomic) NSInteger spacingBetweenDots; - - -/** - * Page control setup properties - */ - - -/** - * Delegate for TAPageControl - */ -@property(nonatomic,assign) id delegate; - - -/** - * Number of pages for control. Default is 0. - */ -@property (nonatomic) NSInteger numberOfPages; - - -/** - * Current page on which control is active. Default is 0. - */ -@property (nonatomic) NSInteger currentPage; - - -/** - * Hide the control if there is only one page. Default is NO. - */ -@property (nonatomic) BOOL hidesForSinglePage; - - -/** - * Let the control know if should grow bigger by keeping center, or just get longer (right side expanding). By default YES. - */ -@property (nonatomic) BOOL shouldResizeFromCenter; - - -/** - * Return the minimum size required to display control properly for the given page count. - * - * @param pageCount Number of dots that will require display - * - * @return The CGSize being the minimum size required. - */ -- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount; - - -@end - - -@protocol TAPageControlDelegate - -@optional -- (void)TAPageControl:(TAPageControl *)pageControl didSelectPageAtIndex:(NSInteger)index; - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.m b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.m deleted file mode 100755 index 44755175..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/PageControl/TAPageControl.m +++ /dev/null @@ -1,364 +0,0 @@ -// -// TAPageControl.m -// TAPageControl -// -// Created by Tanguy Aladenise on 2015-01-21. -// Copyright (c) 2015 Tanguy Aladenise. All rights reserved. -// - -#import "TAPageControl.h" -#import "TAAbstractDotView.h" -#import "TAAnimatedDotView.h" -#import "TADotView.h" - -/** - * Default number of pages for initialization - */ -static NSInteger const kDefaultNumberOfPages = 0; - -/** - * Default current page for initialization - */ -static NSInteger const kDefaultCurrentPage = 0; - -/** - * Default setting for hide for single page feature. For initialization - */ -static BOOL const kDefaultHideForSinglePage = NO; - -/** - * Default setting for shouldResizeFromCenter. For initialiation - */ -static BOOL const kDefaultShouldResizeFromCenter = YES; - -/** - * Default spacing between dots - */ -static NSInteger const kDefaultSpacingBetweenDots = 8; - -/** - * Default dot size - */ -static CGSize const kDefaultDotSize = {8, 8}; - - -@interface TAPageControl() - - -/** - * Array of dot views for reusability and touch events. - */ -@property (strong, nonatomic) NSMutableArray *dots; - - -@end - -@implementation TAPageControl - - -#pragma mark - Lifecycle - - -- (id)init -{ - self = [super init]; - if (self) { - [self initialization]; - } - - return self; -} - - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - [self initialization]; - } - return self; -} - - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - self = [super initWithCoder:aDecoder]; - if (self) { - [self initialization]; - } - - return self; -} - - -/** - * Default setup when initiating control - */ -- (void)initialization -{ - self.dotViewClass = [TAAnimatedDotView class]; - self.spacingBetweenDots = kDefaultSpacingBetweenDots; - self.numberOfPages = kDefaultNumberOfPages; - self.currentPage = kDefaultCurrentPage; - self.hidesForSinglePage = kDefaultHideForSinglePage; - self.shouldResizeFromCenter = kDefaultShouldResizeFromCenter; -} - - -#pragma mark - Touch event - -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -{ - UITouch *touch = [touches anyObject]; - if (touch.view != self) { - NSInteger index = [self.dots indexOfObject:touch.view]; - if ([self.delegate respondsToSelector:@selector(TAPageControl:didSelectPageAtIndex:)]) { - [self.delegate TAPageControl:self didSelectPageAtIndex:index]; - } - } -} - -#pragma mark - Layout - - -/** - * Resizes and moves the receiver view so it just encloses its subviews. - */ -- (void)sizeToFit -{ - [self updateFrame:YES]; -} - - -- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount -{ - return CGSizeMake((self.dotSize.width + self.spacingBetweenDots) * pageCount - self.spacingBetweenDots , self.dotSize.height); -} - - -/** - * Will update dots display and frame. Reuse existing views or instantiate one if required. Update their position in case frame changed. - */ -- (void)updateDots -{ - if (self.numberOfPages == 0) { - return; - } - - for (NSInteger i = 0; i < self.numberOfPages; i++) { - - UIView *dot; - if (i < self.dots.count) { - dot = [self.dots objectAtIndex:i]; - } else { - dot = [self generateDotView]; - } - - [self updateDotFrame:dot atIndex:i]; - } - - [self changeActivity:YES atIndex:self.currentPage]; - - [self hideForSinglePage]; -} - - -/** - * Update frame control to fit current number of pages. It will apply required size if authorize and required. - * - * @param overrideExistingFrame BOOL to allow frame to be overriden. Meaning the required size will be apply no mattter what. - */ -- (void)updateFrame:(BOOL)overrideExistingFrame -{ - CGPoint center = self.center; - CGSize requiredSize = [self sizeForNumberOfPages:self.numberOfPages]; - - // We apply requiredSize only if authorize to and necessary - if (overrideExistingFrame || ((CGRectGetWidth(self.frame) < requiredSize.width || CGRectGetHeight(self.frame) < requiredSize.height) && !overrideExistingFrame)) { - self.frame = CGRectMake(CGRectGetMinX(self.frame), CGRectGetMinY(self.frame), requiredSize.width, requiredSize.height); - if (self.shouldResizeFromCenter) { - self.center = center; - } - } - - [self resetDotViews]; -} - - -/** - * Update the frame of a specific dot at a specific index - * - * @param dot Dot view - * @param index Page index of dot - */ -- (void)updateDotFrame:(UIView *)dot atIndex:(NSInteger)index -{ - // Dots are always centered within view - CGFloat x = (self.dotSize.width + self.spacingBetweenDots) * index + ( (CGRectGetWidth(self.frame) - [self sizeForNumberOfPages:self.numberOfPages].width) / 2); - CGFloat y = (CGRectGetHeight(self.frame) - self.dotSize.height) / 2; - - dot.frame = CGRectMake(x, y, self.dotSize.width, self.dotSize.height); -} - - -#pragma mark - Utils - - -/** - * Generate a dot view and add it to the collection - * - * @return The UIView object representing a dot - */ -- (UIView *)generateDotView -{ - UIView *dotView; - - if (self.dotViewClass) { - dotView = [[self.dotViewClass alloc] initWithFrame:CGRectMake(0, 0, self.dotSize.width, self.dotSize.height)]; - if ([dotView isKindOfClass:[TAAnimatedDotView class]] && self.dotColor) { - ((TAAnimatedDotView *)dotView).dotColor = self.dotColor; - } - } else { - dotView = [[UIImageView alloc] initWithImage:self.dotImage]; - dotView.frame = CGRectMake(0, 0, self.dotSize.width, self.dotSize.height); - } - - if (dotView) { - [self addSubview:dotView]; - [self.dots addObject:dotView]; - } - - dotView.userInteractionEnabled = YES; - return dotView; -} - - -/** - * Change activity state of a dot view. Current/not currrent. - * - * @param active Active state to apply - * @param index Index of dot for state update - */ -- (void)changeActivity:(BOOL)active atIndex:(NSInteger)index -{ - if (self.dotViewClass) { - TAAbstractDotView *abstractDotView = (TAAbstractDotView *)[self.dots objectAtIndex:index]; - if ([abstractDotView respondsToSelector:@selector(changeActivityState:)]) { - [abstractDotView changeActivityState:active]; - } else { - NSLog(@"Custom view : %@ must implement an 'changeActivityState' method or you can subclass %@ to help you.", self.dotViewClass, [TAAbstractDotView class]); - } - } else if (self.dotImage && self.currentDotImage) { - UIImageView *dotView = (UIImageView *)[self.dots objectAtIndex:index]; - dotView.image = (active) ? self.currentDotImage : self.dotImage; - } -} - - -- (void)resetDotViews -{ - for (UIView *dotView in self.dots) { - [dotView removeFromSuperview]; - } - - [self.dots removeAllObjects]; - [self updateDots]; -} - - -- (void)hideForSinglePage -{ - if (self.dots.count == 1 && self.hidesForSinglePage) { - self.hidden = YES; - } else { - self.hidden = NO; - } -} - -#pragma mark - Setters - - -- (void)setNumberOfPages:(NSInteger)numberOfPages -{ - _numberOfPages = numberOfPages; - - // Update dot position to fit new number of pages - [self resetDotViews]; -} - - -- (void)setSpacingBetweenDots:(NSInteger)spacingBetweenDots -{ - _spacingBetweenDots = spacingBetweenDots; - - [self resetDotViews]; -} - - -- (void)setCurrentPage:(NSInteger)currentPage -{ - // If no pages, no current page to treat. - if (self.numberOfPages == 0 || currentPage == _currentPage) { - _currentPage = currentPage; - return; - } - - // Pre set - [self changeActivity:NO atIndex:_currentPage]; - _currentPage = currentPage; - // Post set - [self changeActivity:YES atIndex:_currentPage]; -} - - -- (void)setDotImage:(UIImage *)dotImage -{ - _dotImage = dotImage; - [self resetDotViews]; - self.dotViewClass = nil; -} - - -- (void)setCurrentDotImage:(UIImage *)currentDotimage -{ - _currentDotImage = currentDotimage; - [self resetDotViews]; - self.dotViewClass = nil; -} - - -- (void)setDotViewClass:(Class)dotViewClass -{ - _dotViewClass = dotViewClass; - self.dotSize = CGSizeZero; - [self resetDotViews]; -} - - -#pragma mark - Getters - - -- (NSMutableArray *)dots -{ - if (!_dots) { - _dots = [[NSMutableArray alloc] init]; - } - - return _dots; -} - - -- (CGSize)dotSize -{ - // Dot size logic depending on the source of the dot view - if (self.dotImage && CGSizeEqualToSize(_dotSize, CGSizeZero)) { - _dotSize = self.dotImage.size; - } else if (self.dotViewClass && CGSizeEqualToSize(_dotSize, CGSizeZero)) { - _dotSize = kDefaultDotSize; - return _dotSize; - } - - return _dotSize; -} - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.h b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.h deleted file mode 100644 index 3a229bac..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// SDCollectionViewCell.h -// SDCycleScrollView -// -// Created by aier on 15-3-22. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -/* - - ********************************************************************************* - * - * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 - * - * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 - * 帮您解决问题。 - * 新浪微博:GSD_iOS - * Email : gsdios@126.com - * GitHub: https://github.com/gsdios - * - * 另(我的自动布局库SDAutoLayout): - * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 - * 做最简单易用的AutoLayout库。 - * 视频教程:http://www.letv.com/ptv/vplay/24038772.html - * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md - * GitHub:https://github.com/gsdios/SDAutoLayout - ********************************************************************************* - - */ - - - -#import - -@interface SDCollectionViewCell : UICollectionViewCell - -@property (weak, nonatomic) UIImageView *imageView; -@property (copy, nonatomic) NSString *title; - -@property (nonatomic, strong) UIColor *titleLabelTextColor; -@property (nonatomic, strong) UIFont *titleLabelTextFont; -@property (nonatomic, strong) UIColor *titleLabelBackgroundColor; -@property (nonatomic, assign) CGFloat titleLabelHeight; -@property (nonatomic, assign) NSTextAlignment titleLabelTextAlignment; - -@property (nonatomic, assign) BOOL hasConfigured; - -/** 只展示文字轮播 */ -@property (nonatomic, assign) BOOL onlyDisplayText; - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.m b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.m deleted file mode 100644 index 83f8ee06..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCollectionViewCell.m +++ /dev/null @@ -1,116 +0,0 @@ -// -// SDCollectionViewCell.m -// SDCycleScrollView -// -// Created by aier on 15-3-22. -// Copyright (c) 2015年 GSD. All rights reserved. -// - - -/* - - ********************************************************************************* - * - * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 - * - * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 - * 帮您解决问题。 - * 新浪微博:GSD_iOS - * Email : gsdios@126.com - * GitHub: https://github.com/gsdios - * - * 另(我的自动布局库SDAutoLayout): - * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 - * 做最简单易用的AutoLayout库。 - * 视频教程:http://www.letv.com/ptv/vplay/24038772.html - * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md - * GitHub:https://github.com/gsdios/SDAutoLayout - ********************************************************************************* - - */ - - -#import "SDCollectionViewCell.h" -#import "UIView+SDExtension.h" - -@implementation SDCollectionViewCell -{ - __weak UILabel *_titleLabel; -} - - -- (instancetype)initWithFrame:(CGRect)frame -{ - if (self = [super initWithFrame:frame]) { - [self setupImageView]; - [self setupTitleLabel]; - } - - return self; -} - -- (void)setTitleLabelBackgroundColor:(UIColor *)titleLabelBackgroundColor -{ - _titleLabelBackgroundColor = titleLabelBackgroundColor; - _titleLabel.backgroundColor = titleLabelBackgroundColor; -} - -- (void)setTitleLabelTextColor:(UIColor *)titleLabelTextColor -{ - _titleLabelTextColor = titleLabelTextColor; - _titleLabel.textColor = titleLabelTextColor; -} - -- (void)setTitleLabelTextFont:(UIFont *)titleLabelTextFont -{ - _titleLabelTextFont = titleLabelTextFont; - _titleLabel.font = titleLabelTextFont; -} - -- (void)setupImageView -{ - UIImageView *imageView = [[UIImageView alloc] init]; - _imageView = imageView; - [self.contentView addSubview:imageView]; -} - -- (void)setupTitleLabel -{ - UILabel *titleLabel = [[UILabel alloc] init]; - _titleLabel = titleLabel; - _titleLabel.hidden = YES; - [self.contentView addSubview:titleLabel]; -} - -- (void)setTitle:(NSString *)title -{ - _title = [title copy]; - _titleLabel.text = [NSString stringWithFormat:@" %@", title]; - if (_titleLabel.hidden) { - _titleLabel.hidden = NO; - } -} - --(void)setTitleLabelTextAlignment:(NSTextAlignment)titleLabelTextAlignment -{ - _titleLabelTextAlignment = titleLabelTextAlignment; - _titleLabel.textAlignment = titleLabelTextAlignment; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - - if (self.onlyDisplayText) { - _titleLabel.frame = self.bounds; - } else { - _imageView.frame = self.bounds; - CGFloat titleLabelW = self.sd_width; - CGFloat titleLabelH = _titleLabelHeight; - CGFloat titleLabelX = 0; - CGFloat titleLabelY = self.sd_height - titleLabelH; - _titleLabel.frame = CGRectMake(titleLabelX, titleLabelY, titleLabelW, titleLabelH); - } -} - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.h b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.h deleted file mode 100644 index 817b2f6a..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.h +++ /dev/null @@ -1,211 +0,0 @@ -// -// SDCycleScrollView.h -// SDCycleScrollView -// -// Created by aier on 15-3-22. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -/* - - ********************************************************************************* - * - * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 - * - * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 - * 帮您解决问题。 - * 新浪微博:GSD_iOS - * Email : gsdios@126.com - * GitHub: https://github.com/gsdios - * - * 另(我的自动布局库SDAutoLayout): - * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 - * 做最简单易用的AutoLayout库。 - * 视频教程:http://www.letv.com/ptv/vplay/24038772.html - * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md - * GitHub:https://github.com/gsdios/SDAutoLayout - ********************************************************************************* - - */ - -/* - * 当前版本为1.62 - * 更新日期:2016.04.21 - */ - -#import - -typedef enum { - SDCycleScrollViewPageContolAlimentRight, - SDCycleScrollViewPageContolAlimentCenter -} SDCycleScrollViewPageContolAliment; - -typedef enum { - SDCycleScrollViewPageContolStyleClassic, // 系统自带经典样式 - SDCycleScrollViewPageContolStyleAnimated, // 动画效果pagecontrol - SDCycleScrollViewPageContolStyleNone // 不显示pagecontrol -} SDCycleScrollViewPageContolStyle; - -@class SDCycleScrollView; - -@protocol SDCycleScrollViewDelegate - -@optional - -/** 点击图片回调 */ -- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index; - -/** 图片滚动回调 */ -- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index; - - - - - - -// 不需要自定义轮播cell的请忽略以下两个的代理方法 - -// ========== 轮播自定义cell ========== - -/** 如果你需要自定义cell样式,请在实现此代理方法返回你的自定义cell的class。 */ -- (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view; - -/** 如果你需要自定义cell样式,请在实现此代理方法返回你的自定义cell的Nib。 */ -- (UINib *)customCollectionViewCellNibForCycleScrollView:(SDCycleScrollView *)view; - -/** 如果你自定义了cell样式,请在实现此代理方法为你的cell填充数据以及其它一系列设置 */ -- (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view; - -@end - -@interface SDCycleScrollView : UIView - - -/** 初始轮播图(推荐使用) */ -+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame delegate:(id)delegate placeholderImage:(UIImage *)placeholderImage; - -+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame imageURLStringsGroup:(NSArray *)imageURLStringsGroup; - - -/** 本地图片轮播初始化方式 */ -+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame imageNamesGroup:(NSArray *)imageNamesGroup; - -/** 本地图片轮播初始化方式2,infiniteLoop:是否无限循环 */ -+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame shouldInfiniteLoop:(BOOL)infiniteLoop imageNamesGroup:(NSArray *)imageNamesGroup; - - -////////////////////// 数据源API ////////////////////// - -/** 网络图片 url string 数组 */ -@property (nonatomic, strong) NSArray *imageURLStringsGroup; - -/** 每张图片对应要显示的文字数组 */ -@property (nonatomic, strong) NSArray *titlesGroup; - -/** 本地图片数组 */ -@property (nonatomic, strong) NSArray *localizationImageNamesGroup; - - - - - -////////////////////// 滚动控制API ////////////////////// - -/** 自动滚动间隔时间,默认2s */ -@property (nonatomic, assign) CGFloat autoScrollTimeInterval; - -/** 是否无限循环,默认Yes */ -@property (nonatomic,assign) BOOL infiniteLoop; - -/** 是否自动滚动,默认Yes */ -@property (nonatomic,assign) BOOL autoScroll; - -/** 图片滚动方向,默认为水平滚动 */ -@property (nonatomic, assign) UICollectionViewScrollDirection scrollDirection; - -@property (nonatomic, weak) id delegate; - -/** block方式监听点击 */ -@property (nonatomic, copy) void (^clickItemOperationBlock)(NSInteger currentIndex); - -/** block方式监听滚动 */ -@property (nonatomic, copy) void (^itemDidScrollOperationBlock)(NSInteger currentIndex); - -/** 可以调用此方法手动控制滚动到哪一个index */ -- (void)makeScrollViewScrollToIndex:(NSInteger)index; - -/** 解决viewWillAppear时出现时轮播图卡在一半的问题,在控制器viewWillAppear时调用此方法 */ -- (void)adjustWhenControllerViewWillAppera; - -////////////////////// 自定义样式API ////////////////////// - -/** 轮播图片的ContentMode,默认为 UIViewContentModeScaleToFill */ -@property (nonatomic, assign) UIViewContentMode bannerImageViewContentMode; - -/** 占位图,用于网络未加载到图片时 */ -@property (nonatomic, strong) UIImage *placeholderImage; - -/** 是否显示分页控件 */ -@property (nonatomic, assign) BOOL showPageControl; - -/** 是否在只有一张图时隐藏pagecontrol,默认为YES */ -@property(nonatomic) BOOL hidesForSinglePage; - -/** 只展示文字轮播 */ -@property (nonatomic, assign) BOOL onlyDisplayText; - -/** pagecontrol 样式,默认为动画样式 */ -@property (nonatomic, assign) SDCycleScrollViewPageContolStyle pageControlStyle; - -/** 分页控件位置 */ -@property (nonatomic, assign) SDCycleScrollViewPageContolAliment pageControlAliment; - -/** 分页控件距离轮播图的底部间距(在默认间距基础上)的偏移量 */ -@property (nonatomic, assign) CGFloat pageControlBottomOffset; - -/** 分页控件距离轮播图的右边间距(在默认间距基础上)的偏移量 */ -@property (nonatomic, assign) CGFloat pageControlRightOffset; - -/** 分页控件小圆标大小 */ -@property (nonatomic, assign) CGSize pageControlDotSize; - -/** 当前分页控件小圆标颜色 */ -@property (nonatomic, strong) UIColor *currentPageDotColor; - -/** 其他分页控件小圆标颜色 */ -@property (nonatomic, strong) UIColor *pageDotColor; - -/** 当前分页控件小圆标图片 */ -@property (nonatomic, strong) UIImage *currentPageDotImage; - -/** 其他分页控件小圆标图片 */ -@property (nonatomic, strong) UIImage *pageDotImage; - -/** 轮播文字label字体颜色 */ -@property (nonatomic, strong) UIColor *titleLabelTextColor; - -/** 轮播文字label字体大小 */ -@property (nonatomic, strong) UIFont *titleLabelTextFont; - -/** 轮播文字label背景颜色 */ -@property (nonatomic, strong) UIColor *titleLabelBackgroundColor; - -/** 轮播文字label高度 */ -@property (nonatomic, assign) CGFloat titleLabelHeight; - -/** 轮播文字label对齐方式 */ -@property (nonatomic, assign) NSTextAlignment titleLabelTextAlignment; - -/** 滚动手势禁用(文字轮播较实用) */ -- (void)disableScrollGesture; - - -////////////////////// 清除缓存API ////////////////////// - -/** 清除图片缓存(此次升级后统一使用SDWebImage管理图片加载和缓存) */ -+ (void)clearImagesCache; - -/** 清除图片缓存(兼容旧版本方法) */ -- (void)clearCache; - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m deleted file mode 100644 index 9ccd0ecd..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/SDCycleScrollView.m +++ /dev/null @@ -1,693 +0,0 @@ -// -// SDCycleScrollView.m -// SDCycleScrollView -// -// Created by aier on 15-3-22. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -/* - - ********************************************************************************* - * - * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 - * - * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 - * 帮您解决问题。 - * 新浪微博:GSD_iOS - * Email : gsdios@126.com - * GitHub: https://github.com/gsdios - * - * 另(我的自动布局库SDAutoLayout): - * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 - * 做最简单易用的AutoLayout库。 - * 视频教程:http://www.letv.com/ptv/vplay/24038772.html - * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md - * GitHub:https://github.com/gsdios/SDAutoLayout - ********************************************************************************* - - */ - - -#import "SDCycleScrollView.h" -#import "SDCollectionViewCell.h" -#import "UIView+SDExtension.h" -#import "TAPageControl.h" -#import "SDWebImageManager.h" -#import "UIImageView+WebCache.h" - -#define kCycleScrollViewInitialPageControlDotSize CGSizeMake(10, 10) - -NSString * const ID = @"SDCycleScrollViewCell"; - -@interface SDCycleScrollView () - - -@property (nonatomic, weak) UICollectionView *mainView; // 显示图片的collectionView -@property (nonatomic, weak) UICollectionViewFlowLayout *flowLayout; -@property (nonatomic, strong) NSArray *imagePathsGroup; -@property (nonatomic, weak) NSTimer *timer; -@property (nonatomic, assign) NSInteger totalItemsCount; -@property (nonatomic, weak) UIControl *pageControl; - -@property (nonatomic, strong) UIImageView *backgroundImageView; // 当imageURLs为空时的背景图 - -@end - -@implementation SDCycleScrollView - -- (instancetype)initWithFrame:(CGRect)frame -{ - if (self = [super initWithFrame:frame]) { - [self initialization]; - [self setupMainView]; - } - return self; -} - -- (void)awakeFromNib -{ - [super awakeFromNib]; - [self initialization]; - [self setupMainView]; -} - -- (void)initialization -{ - _pageControlAliment = SDCycleScrollViewPageContolAlimentCenter; - _autoScrollTimeInterval = 2.0; - _titleLabelTextColor = [UIColor whiteColor]; - _titleLabelTextFont= [UIFont systemFontOfSize:14]; - _titleLabelBackgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5]; - _titleLabelHeight = 30; - _titleLabelTextAlignment = NSTextAlignmentLeft; - _autoScroll = YES; - _infiniteLoop = YES; - _showPageControl = YES; - _pageControlDotSize = kCycleScrollViewInitialPageControlDotSize; - _pageControlBottomOffset = 0; - _pageControlRightOffset = 0; - _pageControlStyle = SDCycleScrollViewPageContolStyleClassic; - _hidesForSinglePage = YES; - _currentPageDotColor = [UIColor whiteColor]; - _pageDotColor = [UIColor lightGrayColor]; - _bannerImageViewContentMode = UIViewContentModeScaleToFill; - - self.backgroundColor = [UIColor lightGrayColor]; - -} - -+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame imageNamesGroup:(NSArray *)imageNamesGroup -{ - SDCycleScrollView *cycleScrollView = [[self alloc] initWithFrame:frame]; - cycleScrollView.localizationImageNamesGroup = [NSMutableArray arrayWithArray:imageNamesGroup]; - return cycleScrollView; -} - -+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame shouldInfiniteLoop:(BOOL)infiniteLoop imageNamesGroup:(NSArray *)imageNamesGroup -{ - SDCycleScrollView *cycleScrollView = [[self alloc] initWithFrame:frame]; - cycleScrollView.infiniteLoop = infiniteLoop; - cycleScrollView.localizationImageNamesGroup = [NSMutableArray arrayWithArray:imageNamesGroup]; - return cycleScrollView; -} - -+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame imageURLStringsGroup:(NSArray *)imageURLsGroup -{ - SDCycleScrollView *cycleScrollView = [[self alloc] initWithFrame:frame]; - cycleScrollView.imageURLStringsGroup = [NSMutableArray arrayWithArray:imageURLsGroup]; - return cycleScrollView; -} - -+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame delegate:(id)delegate placeholderImage:(UIImage *)placeholderImage -{ - SDCycleScrollView *cycleScrollView = [[self alloc] initWithFrame:frame]; - cycleScrollView.delegate = delegate; - cycleScrollView.placeholderImage = placeholderImage; - - return cycleScrollView; -} - -// 设置显示图片的collectionView -- (void)setupMainView -{ - UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init]; - flowLayout.minimumLineSpacing = 0; - flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; - _flowLayout = flowLayout; - - UICollectionView *mainView = [[UICollectionView alloc] initWithFrame:self.bounds collectionViewLayout:flowLayout]; - mainView.backgroundColor = [UIColor clearColor]; - mainView.pagingEnabled = YES; - mainView.showsHorizontalScrollIndicator = NO; - mainView.showsVerticalScrollIndicator = NO; - [mainView registerClass:[SDCollectionViewCell class] forCellWithReuseIdentifier:ID]; - - mainView.dataSource = self; - mainView.delegate = self; - mainView.scrollsToTop = NO; - [self addSubview:mainView]; - _mainView = mainView; -} - - -#pragma mark - properties - -- (void)setDelegate:(id)delegate -{ - _delegate = delegate; - - if ([self.delegate respondsToSelector:@selector(customCollectionViewCellClassForCycleScrollView:)] && [self.delegate customCollectionViewCellClassForCycleScrollView:self]) { - [self.mainView registerClass:[self.delegate customCollectionViewCellClassForCycleScrollView:self] forCellWithReuseIdentifier:ID]; - }else if ([self.delegate respondsToSelector:@selector(customCollectionViewCellNibForCycleScrollView:)] && [self.delegate customCollectionViewCellNibForCycleScrollView:self]) { - [self.mainView registerNib:[self.delegate customCollectionViewCellNibForCycleScrollView:self] forCellWithReuseIdentifier:ID]; - } -} - -- (void)setPlaceholderImage:(UIImage *)placeholderImage -{ - _placeholderImage = placeholderImage; - - if (!self.backgroundImageView) { - UIImageView *bgImageView = [UIImageView new]; - bgImageView.contentMode = UIViewContentModeScaleAspectFit; - [self insertSubview:bgImageView belowSubview:self.mainView]; - self.backgroundImageView = bgImageView; - } - - self.backgroundImageView.image = placeholderImage; -} - -- (void)setPageControlDotSize:(CGSize)pageControlDotSize -{ - _pageControlDotSize = pageControlDotSize; - [self setupPageControl]; - if ([self.pageControl isKindOfClass:[TAPageControl class]]) { - TAPageControl *pageContol = (TAPageControl *)_pageControl; - pageContol.dotSize = pageControlDotSize; - } -} - -- (void)setShowPageControl:(BOOL)showPageControl -{ - _showPageControl = showPageControl; - - _pageControl.hidden = !showPageControl; -} - -- (void)setCurrentPageDotColor:(UIColor *)currentPageDotColor -{ - _currentPageDotColor = currentPageDotColor; - if ([self.pageControl isKindOfClass:[TAPageControl class]]) { - TAPageControl *pageControl = (TAPageControl *)_pageControl; - pageControl.dotColor = currentPageDotColor; - } else { - UIPageControl *pageControl = (UIPageControl *)_pageControl; - pageControl.currentPageIndicatorTintColor = currentPageDotColor; - } - -} - -- (void)setPageDotColor:(UIColor *)pageDotColor -{ - _pageDotColor = pageDotColor; - - if ([self.pageControl isKindOfClass:[UIPageControl class]]) { - UIPageControl *pageControl = (UIPageControl *)_pageControl; - pageControl.pageIndicatorTintColor = pageDotColor; - } -} - -- (void)setCurrentPageDotImage:(UIImage *)currentPageDotImage -{ - _currentPageDotImage = currentPageDotImage; - - if (self.pageControlStyle != SDCycleScrollViewPageContolStyleAnimated) { - self.pageControlStyle = SDCycleScrollViewPageContolStyleAnimated; - } - - [self setCustomPageControlDotImage:currentPageDotImage isCurrentPageDot:YES]; -} - -- (void)setPageDotImage:(UIImage *)pageDotImage -{ - _pageDotImage = pageDotImage; - - if (self.pageControlStyle != SDCycleScrollViewPageContolStyleAnimated) { - self.pageControlStyle = SDCycleScrollViewPageContolStyleAnimated; - } - - [self setCustomPageControlDotImage:pageDotImage isCurrentPageDot:NO]; -} - -- (void)setCustomPageControlDotImage:(UIImage *)image isCurrentPageDot:(BOOL)isCurrentPageDot -{ - if (!image || !self.pageControl) return; - - if ([self.pageControl isKindOfClass:[TAPageControl class]]) { - TAPageControl *pageControl = (TAPageControl *)_pageControl; - if (isCurrentPageDot) { - pageControl.currentDotImage = image; - } else { - pageControl.dotImage = image; - } - } -} - -- (void)setInfiniteLoop:(BOOL)infiniteLoop -{ - _infiniteLoop = infiniteLoop; - - if (self.imagePathsGroup.count) { - self.imagePathsGroup = self.imagePathsGroup; - } -} - --(void)setAutoScroll:(BOOL)autoScroll{ - _autoScroll = autoScroll; - - [self invalidateTimer]; - - if (_autoScroll) { - [self setupTimer]; - } -} - -- (void)setScrollDirection:(UICollectionViewScrollDirection)scrollDirection -{ - _scrollDirection = scrollDirection; - - _flowLayout.scrollDirection = scrollDirection; -} - -- (void)setAutoScrollTimeInterval:(CGFloat)autoScrollTimeInterval -{ - _autoScrollTimeInterval = autoScrollTimeInterval; - - [self setAutoScroll:self.autoScroll]; -} - -- (void)setPageControlStyle:(SDCycleScrollViewPageContolStyle)pageControlStyle -{ - _pageControlStyle = pageControlStyle; - - [self setupPageControl]; -} - -- (void)setImagePathsGroup:(NSArray *)imagePathsGroup -{ - [self invalidateTimer]; - - _imagePathsGroup = imagePathsGroup; - - _totalItemsCount = self.infiniteLoop ? self.imagePathsGroup.count * 100 : self.imagePathsGroup.count; - - if (imagePathsGroup.count > 1) { // 由于 !=1 包含count == 0等情况 - self.mainView.scrollEnabled = YES; - [self setAutoScroll:self.autoScroll]; - } else { - self.mainView.scrollEnabled = NO; - [self invalidateTimer]; - } - - [self setupPageControl]; - [self.mainView reloadData]; -} - -- (void)setImageURLStringsGroup:(NSArray *)imageURLStringsGroup -{ - _imageURLStringsGroup = imageURLStringsGroup; - - NSMutableArray *temp = [NSMutableArray new]; - [_imageURLStringsGroup enumerateObjectsUsingBlock:^(NSString * obj, NSUInteger idx, BOOL * stop) { - NSString *urlString; - if ([obj isKindOfClass:[NSString class]]) { - urlString = obj; - } else if ([obj isKindOfClass:[NSURL class]]) { - NSURL *url = (NSURL *)obj; - urlString = [url absoluteString]; - } - if (urlString) { - [temp addObject:urlString]; - } - }]; - self.imagePathsGroup = [temp copy]; -} - -- (void)setLocalizationImageNamesGroup:(NSArray *)localizationImageNamesGroup -{ - _localizationImageNamesGroup = localizationImageNamesGroup; - self.imagePathsGroup = [localizationImageNamesGroup copy]; -} - -- (void)setTitlesGroup:(NSArray *)titlesGroup -{ - _titlesGroup = titlesGroup; - if (self.onlyDisplayText) { - NSMutableArray *temp = [NSMutableArray new]; - for (int i = 0; i < _titlesGroup.count; i++) { - [temp addObject:@""]; - } - self.backgroundColor = [UIColor clearColor]; - self.imageURLStringsGroup = [temp copy]; - } -} - -- (void)disableScrollGesture { - self.mainView.canCancelContentTouches = NO; - for (UIGestureRecognizer *gesture in self.mainView.gestureRecognizers) { - if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]) { - [self.mainView removeGestureRecognizer:gesture]; - } - } -} - -#pragma mark - actions - -- (void)setupTimer -{ - [self invalidateTimer]; // 创建定时器前先停止定时器,不然会出现僵尸定时器,导致轮播频率错误 - - NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:self.autoScrollTimeInterval target:self selector:@selector(automaticScroll) userInfo:nil repeats:YES]; - _timer = timer; - [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; -} - -- (void)invalidateTimer -{ - [_timer invalidate]; - _timer = nil; -} - -- (void)setupPageControl -{ - if (_pageControl) [_pageControl removeFromSuperview]; // 重新加载数据时调整 - - if (self.imagePathsGroup.count == 0 || self.onlyDisplayText) return; - - if ((self.imagePathsGroup.count == 1) && self.hidesForSinglePage) return; - - int indexOnPageControl = [self pageControlIndexWithCurrentCellIndex:[self currentIndex]]; - - switch (self.pageControlStyle) { - case SDCycleScrollViewPageContolStyleAnimated: - { - TAPageControl *pageControl = [[TAPageControl alloc] init]; - pageControl.numberOfPages = self.imagePathsGroup.count; - pageControl.dotColor = self.currentPageDotColor; - pageControl.userInteractionEnabled = NO; - pageControl.currentPage = indexOnPageControl; - [self addSubview:pageControl]; - _pageControl = pageControl; - } - break; - - case SDCycleScrollViewPageContolStyleClassic: - { - UIPageControl *pageControl = [[UIPageControl alloc] init]; - pageControl.numberOfPages = self.imagePathsGroup.count; - pageControl.currentPageIndicatorTintColor = self.currentPageDotColor; - pageControl.pageIndicatorTintColor = self.pageDotColor; - pageControl.userInteractionEnabled = NO; - pageControl.currentPage = indexOnPageControl; - [self addSubview:pageControl]; - _pageControl = pageControl; - } - break; - - default: - break; - } - - // 重设pagecontroldot图片 - if (self.currentPageDotImage) { - self.currentPageDotImage = self.currentPageDotImage; - } - if (self.pageDotImage) { - self.pageDotImage = self.pageDotImage; - } -} - - -- (void)automaticScroll -{ - if (0 == _totalItemsCount) return; - int currentIndex = [self currentIndex]; - int targetIndex = currentIndex + 1; - [self scrollToIndex:targetIndex]; -} - -- (void)scrollToIndex:(int)targetIndex -{ - if (targetIndex >= _totalItemsCount) { - if (self.infiniteLoop) { - targetIndex = _totalItemsCount * 0.5; - [_mainView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:targetIndex inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:NO]; - } - return; - } - [_mainView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:targetIndex inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:YES]; -} - -- (int)currentIndex -{ - if (_mainView.sd_width == 0 || _mainView.sd_height == 0) { - return 0; - } - - int index = 0; - if (_flowLayout.scrollDirection == UICollectionViewScrollDirectionHorizontal) { - index = (_mainView.contentOffset.x + _flowLayout.itemSize.width * 0.5) / _flowLayout.itemSize.width; - } else { - index = (_mainView.contentOffset.y + _flowLayout.itemSize.height * 0.5) / _flowLayout.itemSize.height; - } - - return MAX(0, index); -} - -- (int)pageControlIndexWithCurrentCellIndex:(NSInteger)index -{ - return (int)index % self.imagePathsGroup.count; -} - -- (void)clearCache -{ - [[self class] clearImagesCache]; -} - -+ (void)clearImagesCache -{ - [[[SDWebImageManager sharedManager] imageCache] clearDiskOnCompletion:nil]; -} - -#pragma mark - life circles - -- (void)layoutSubviews -{ - self.delegate = self.delegate; - - [super layoutSubviews]; - - _flowLayout.itemSize = self.frame.size; - - _mainView.frame = self.bounds; - if (_mainView.contentOffset.x == 0 && _totalItemsCount) { - int targetIndex = 0; - if (self.infiniteLoop) { - targetIndex = _totalItemsCount * 0.5; - }else{ - targetIndex = 0; - } - [_mainView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:targetIndex inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:NO]; - } - - CGSize size = CGSizeZero; - if ([self.pageControl isKindOfClass:[TAPageControl class]]) { - TAPageControl *pageControl = (TAPageControl *)_pageControl; - if (!(self.pageDotImage && self.currentPageDotImage && CGSizeEqualToSize(kCycleScrollViewInitialPageControlDotSize, self.pageControlDotSize))) { - pageControl.dotSize = self.pageControlDotSize; - } - size = [pageControl sizeForNumberOfPages:self.imagePathsGroup.count]; - } else { - size = CGSizeMake(self.imagePathsGroup.count * self.pageControlDotSize.width * 1.5, self.pageControlDotSize.height); - } - CGFloat x = (self.sd_width - size.width) * 0.5; - if (self.pageControlAliment == SDCycleScrollViewPageContolAlimentRight) { - x = self.mainView.sd_width - size.width - 10; - } - CGFloat y = self.mainView.sd_height - size.height - 10; - - if ([self.pageControl isKindOfClass:[TAPageControl class]]) { - TAPageControl *pageControl = (TAPageControl *)_pageControl; - [pageControl sizeToFit]; - } - - CGRect pageControlFrame = CGRectMake(x, y, size.width, size.height); - pageControlFrame.origin.y -= self.pageControlBottomOffset; - pageControlFrame.origin.x -= self.pageControlRightOffset; - self.pageControl.frame = pageControlFrame; - self.pageControl.hidden = !_showPageControl; - - if (self.backgroundImageView) { - self.backgroundImageView.frame = self.bounds; - } - -} - -//解决当父View释放时,当前视图因为被Timer强引用而不能释放的问题 -- (void)willMoveToSuperview:(UIView *)newSuperview -{ - if (!newSuperview) { - [self invalidateTimer]; - } -} - -//解决当timer释放后 回调scrollViewDidScroll时访问野指针导致崩溃 -- (void)dealloc { - _mainView.delegate = nil; - _mainView.dataSource = nil; -} - -#pragma mark - public actions - -- (void)adjustWhenControllerViewWillAppera -{ - long targetIndex = [self currentIndex]; - if (targetIndex < _totalItemsCount) { - [_mainView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:targetIndex inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:NO]; - } -} - - -#pragma mark - UICollectionViewDataSource - -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section -{ - return _totalItemsCount; -} - -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath -{ - SDCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; - - long itemIndex = [self pageControlIndexWithCurrentCellIndex:indexPath.item]; - - if ([self.delegate respondsToSelector:@selector(setupCustomCell:forIndex:cycleScrollView:)] && - [self.delegate respondsToSelector:@selector(customCollectionViewCellClassForCycleScrollView:)] && [self.delegate customCollectionViewCellClassForCycleScrollView:self]) { - [self.delegate setupCustomCell:cell forIndex:itemIndex cycleScrollView:self]; - return cell; - }else if ([self.delegate respondsToSelector:@selector(setupCustomCell:forIndex:cycleScrollView:)] && - [self.delegate respondsToSelector:@selector(customCollectionViewCellNibForCycleScrollView:)] && [self.delegate customCollectionViewCellNibForCycleScrollView:self]) { - [self.delegate setupCustomCell:cell forIndex:itemIndex cycleScrollView:self]; - return cell; - } - - NSString *imagePath = self.imagePathsGroup[itemIndex]; - - if (!self.onlyDisplayText && [imagePath isKindOfClass:[NSString class]]) { - if ([imagePath hasPrefix:@"http"]) { - [cell.imageView sd_setImageWithURL:[NSURL URLWithString:imagePath] placeholderImage:self.placeholderImage]; - } else { - UIImage *image = [UIImage imageNamed:imagePath]; - if (!image) { - image = [UIImage imageWithContentsOfFile:imagePath]; - } - cell.imageView.image = image; - } - } else if (!self.onlyDisplayText && [imagePath isKindOfClass:[UIImage class]]) { - cell.imageView.image = (UIImage *)imagePath; - } - - if (_titlesGroup.count && itemIndex < _titlesGroup.count) { - cell.title = _titlesGroup[itemIndex]; - } - - if (!cell.hasConfigured) { - cell.titleLabelBackgroundColor = self.titleLabelBackgroundColor; - cell.titleLabelHeight = self.titleLabelHeight; - cell.titleLabelTextAlignment = self.titleLabelTextAlignment; - cell.titleLabelTextColor = self.titleLabelTextColor; - cell.titleLabelTextFont = self.titleLabelTextFont; - cell.hasConfigured = YES; - cell.imageView.contentMode = self.bannerImageViewContentMode; - cell.clipsToBounds = YES; - cell.onlyDisplayText = self.onlyDisplayText; - } - - return cell; -} - -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath -{ - if ([self.delegate respondsToSelector:@selector(cycleScrollView:didSelectItemAtIndex:)]) { - [self.delegate cycleScrollView:self didSelectItemAtIndex:[self pageControlIndexWithCurrentCellIndex:indexPath.item]]; - } - if (self.clickItemOperationBlock) { - self.clickItemOperationBlock([self pageControlIndexWithCurrentCellIndex:indexPath.item]); - } -} - - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView -{ - if (!self.imagePathsGroup.count) return; // 解决清除timer时偶尔会出现的问题 - int itemIndex = [self currentIndex]; - int indexOnPageControl = [self pageControlIndexWithCurrentCellIndex:itemIndex]; - - if ([self.pageControl isKindOfClass:[TAPageControl class]]) { - TAPageControl *pageControl = (TAPageControl *)_pageControl; - pageControl.currentPage = indexOnPageControl; - } else { - UIPageControl *pageControl = (UIPageControl *)_pageControl; - pageControl.currentPage = indexOnPageControl; - } -} - -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView -{ - if (self.autoScroll) { - [self invalidateTimer]; - } -} - -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate -{ - if (self.autoScroll) { - [self setupTimer]; - } -} - -- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView -{ - [self scrollViewDidEndScrollingAnimation:self.mainView]; -} - -- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView -{ - if (!self.imagePathsGroup.count) return; // 解决清除timer时偶尔会出现的问题 - int itemIndex = [self currentIndex]; - int indexOnPageControl = [self pageControlIndexWithCurrentCellIndex:itemIndex]; - - if ([self.delegate respondsToSelector:@selector(cycleScrollView:didScrollToIndex:)]) { - [self.delegate cycleScrollView:self didScrollToIndex:indexOnPageControl]; - } else if (self.itemDidScrollOperationBlock) { - self.itemDidScrollOperationBlock(indexOnPageControl); - } -} - -- (void)makeScrollViewScrollToIndex:(NSInteger)index{ - if (self.autoScroll) { - [self invalidateTimer]; - } - if (0 == _totalItemsCount) return; - - [self scrollToIndex:(int)(_totalItemsCount * 0.5 + index)]; - - if (self.autoScroll) { - [self setupTimer]; - } -} - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.h b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.h deleted file mode 100644 index 7fa220e8..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// UIView+SDExtension.h -// SDRefreshView -// -// Created by aier on 15-2-23. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -/* - - ********************************************************************************* - * - * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 - * - * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 - * 帮您解决问题。 - * 新浪微博:GSD_iOS - * Email : gsdios@126.com - * GitHub: https://github.com/gsdios - * - * 另(我的自动布局库SDAutoLayout): - * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 - * 做最简单易用的AutoLayout库。 - * 视频教程:http://www.letv.com/ptv/vplay/24038772.html - * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md - * GitHub:https://github.com/gsdios/SDAutoLayout - ********************************************************************************* - - */ - -#import - -#define SDColorCreater(r, g, b, a) [UIColor colorWithRed:(r / 255.0) green:(g / 255.0) blue:(b / 255.0) alpha:a] - - -@interface UIView (SDExtension) - -@property (nonatomic, assign) CGFloat sd_height; -@property (nonatomic, assign) CGFloat sd_width; - -@property (nonatomic, assign) CGFloat sd_y; -@property (nonatomic, assign) CGFloat sd_x; - -@end diff --git a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.m b/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.m deleted file mode 100644 index 1be615dc..00000000 --- a/iOSProject/Pods/SDCycleScrollView/SDCycleScrollView/Lib/SDCycleScrollView/UIView+SDExtension.m +++ /dev/null @@ -1,107 +0,0 @@ -// -// UIView+SDExtension.m -// SDRefreshView -// -// Created by aier on 15-2-23. -// Copyright (c) 2015年 GSD. All rights reserved. -// - -/* - - ********************************************************************************* - * - * 🌟🌟🌟 新建SDCycleScrollView交流QQ群:185534916 🌟🌟🌟 - * - * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 - * 帮您解决问题。 - * 新浪微博:GSD_iOS - * Email : gsdios@126.com - * GitHub: https://github.com/gsdios - * - * 另(我的自动布局库SDAutoLayout): - * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 - * 做最简单易用的AutoLayout库。 - * 视频教程:http://www.letv.com/ptv/vplay/24038772.html - * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md - * GitHub:https://github.com/gsdios/SDAutoLayout - ********************************************************************************* - - */ - -/* - - ********************************************************************************* - * - * 在您使用此自动轮播库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并 - * 帮您解决问题。 - * 新浪微博:GSD_iOS - * Email : gsdios@126.com - * GitHub: https://github.com/gsdios - * - * 另(我的自动布局库SDAutoLayout): - * 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于 - * 做最简单易用的AutoLayout库。 - * 视频教程:http://www.letv.com/ptv/vplay/24038772.html - * 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md - * GitHub:https://github.com/gsdios/SDAutoLayout - ********************************************************************************* - - */ - - -#import "UIView+SDExtension.h" - -@implementation UIView (SDExtension) - -- (CGFloat)sd_height -{ - return self.frame.size.height; -} - -- (void)setSd_height:(CGFloat)sd_height -{ - CGRect temp = self.frame; - temp.size.height = sd_height; - self.frame = temp; -} - -- (CGFloat)sd_width -{ - return self.frame.size.width; -} - -- (void)setSd_width:(CGFloat)sd_width -{ - CGRect temp = self.frame; - temp.size.width = sd_width; - self.frame = temp; -} - - -- (CGFloat)sd_y -{ - return self.frame.origin.y; -} - -- (void)setSd_y:(CGFloat)sd_y -{ - CGRect temp = self.frame; - temp.origin.y = sd_y; - self.frame = temp; -} - -- (CGFloat)sd_x -{ - return self.frame.origin.x; -} - -- (void)setSd_x:(CGFloat)sd_x -{ - CGRect temp = self.frame; - temp.origin.x = sd_x; - self.frame = temp; -} - - - -@end diff --git a/iOSProject/Pods/SDWebImage/LICENSE b/iOSProject/Pods/SDWebImage/LICENSE deleted file mode 100644 index 92a252a9..00000000 --- a/iOSProject/Pods/SDWebImage/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/iOSProject/Pods/SDWebImage/README.md b/iOSProject/Pods/SDWebImage/README.md deleted file mode 100644 index 1922e9e6..00000000 --- a/iOSProject/Pods/SDWebImage/README.md +++ /dev/null @@ -1,214 +0,0 @@ -

    - -

    - - -[![Build Status](http://img.shields.io/travis/rs/SDWebImage/master.svg?style=flat)](https://travis-ci.org/rs/SDWebImage) -[![Pod Version](http://img.shields.io/cocoapods/v/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) -[![Pod Platform](http://img.shields.io/cocoapods/p/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) -[![Pod License](http://img.shields.io/cocoapods/l/SDWebImage.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html) -[![Dependency Status](https://www.versioneye.com/objective-c/sdwebimage/badge.svg?style=flat)](https://www.versioneye.com/objective-c/sdwebimage) -[![Reference Status](https://www.versioneye.com/objective-c/sdwebimage/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/sdwebimage/references) -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/rs/SDWebImage) -[![codecov](https://codecov.io/gh/rs/SDWebImage/branch/master/graph/badge.svg)](https://codecov.io/gh/rs/SDWebImage) - -This library provides an async image downloader with cache support. For convenience, we added categories for UI elements like `UIImageView`, `UIButton`, `MKAnnotationView`. - -## Features - -- [x] Categories for `UIImageView`, `UIButton`, `MKAnnotationView` adding web image and cache management -- [x] An asynchronous image downloader -- [x] An asynchronous memory + disk image caching with automatic cache expiration handling -- [x] A background image decompression -- [x] A guarantee that the same URL won't be downloaded several times -- [x] A guarantee that bogus URLs won't be retried again and again -- [x] A guarantee that main thread will never be blocked -- [x] Performances! -- [x] Use GCD and ARC - -## Supported Image Formats - -- Image formats supported by UIImage (JPEG, PNG, ...), including GIF -- WebP format, including animated WebP (use the `WebP` subspec) - -## Requirements - -- iOS 7.0 or later -- tvOS 9.0 or later -- watchOS 2.0 or later -- OS X 10.8 or later -- Xcode 7.3 or later - -#### Backwards compatibility - -- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/rs/SDWebImage/tree/3.7.6) -- For iOS < 5.0, please use the last [2.0 version](https://github.com/rs/SDWebImage/tree/2.0-compat). - -## Getting Started - -- Read this Readme doc -- Read the [How to use section](https://github.com/rs/SDWebImage#how-to-use) -- Read the [documentation @ CocoaDocs](http://cocoadocs.org/docsets/SDWebImage/) -- Read [How is SDWebImage better than X?](https://github.com/rs/SDWebImage/wiki/How-is-SDWebImage-better-than-X%3F) -- Try the example by downloading the project from Github or even easier using CocoaPods try `pod try SDWebImage` -- Get to the [installation steps](https://github.com/rs/SDWebImage#installation) -- Read the [SDWebImage 4.0 Migration Guide](Docs/SDWebImage-4.0-Migration-guide.md) to get an idea of the changes from 3.x to 4.x - -## Who Uses It -- Find out [who uses SDWebImage](https://github.com/rs/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list. - -## Communication - -- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/sdwebimage). (Tag 'sdwebimage') -- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/sdwebimage). -- If you **found a bug**, open an issue. -- If you **have a feature request**, open an issue. -- If you **want to contribute**, submit a pull request. - -## How To Use - -```objective-c -Objective-C: - -#import -... -[imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] - placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; -``` - -```swift -Swift: - -import SDWebImage - -imageView.sd_setImage(with: URL(string: "http://www.domain.com/path/to/image.jpg"), placeholderImage: UIImage(named: "placeholder.png")) -``` - -- For details about how to use the library and clear examples, see [The detailed How to use](Docs/HowToUse.md) - -## Animated Images (GIF) support - -- Starting with the 4.0 version, we rely on [FLAnimatedImage](https://github.com/Flipboard/FLAnimatedImage) to take care of our animated images. -- If you use cocoapods, add `pod 'SDWebImage/GIF'` to your podfile. -- To use it, simply make sure you use `FLAnimatedImageView` instead of `UIImageView`. -- **Note**: there is a backwards compatible feature, so if you are still trying to load a GIF into a `UIImageView`, it will only show the 1st frame as a static image. -- **Important**: FLAnimatedImage only works on the iOS platform. For OS X, use `NSImageView` with `animates` set to `YES` to show the entire animated images and `NO` to only show the 1st frame. For all the other platforms (tvOS, watchOS) we will fallback to the backwards compatibility feature described above - -## Common Problems - -### Using dynamic image size with UITableViewCell - -UITableView determines the size of the image by the first image set for a cell. If your remote images -don't have the same size as your placeholder image, you may experience strange anamorphic scaling issue. -The following article gives a way to workaround this issue: - -[http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/](http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/) - - -### Handle image refresh - -SDWebImage does very aggressive caching by default. It ignores all kind of caching control header returned by the HTTP server and cache the returned images with no time restriction. It implies your images URLs are static URLs pointing to images that never change. If the pointed image happen to change, some parts of the URL should change accordingly. - -If you don't control the image server you're using, you may not be able to change the URL when its content is updated. This is the case for Facebook avatar URLs for instance. In such case, you may use the `SDWebImageRefreshCached` flag. This will slightly degrade the performance but will respect the HTTP caching control headers: - -``` objective-c -[imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"] - placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"] - options:SDWebImageRefreshCached]; -``` - -### Add a progress indicator - -Add these before you call ```sd_setImageWithURL``` - -``` objective-c -[imageView sd_setShowActivityIndicatorView:YES]; -[imageView sd_setIndicatorStyle:UIActivityIndicatorViewStyleGray]; -``` - -``` swift -imageView.sd_setShowActivityIndicatorView(true) -imageView.sd_setIndicatorStyle(.Gray) -``` - -## Installation - -There are three ways to use SDWebImage in your project: -- using CocoaPods -- using Carthage -- by cloning the project into your repository - -### Installation with CocoaPods - -[CocoaPods](http://cocoapods.org/) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the [Get Started](http://cocoapods.org/#get_started) section for more details. - -#### Podfile -``` -platform :ios, '7.0' -pod 'SDWebImage', '~> 4.0' -``` - -If you are using Swift, be sure to add `use_frameworks!` and set your target to iOS 8+: -``` -platform :ios, '8.0' -use_frameworks! -``` - -#### Subspecs - -There are 4 subspecs available now: `Core`, `MapKit`, `GIF` and `WebP` (this means you can install only some of the SDWebImage modules. By default, you get just `Core`, so if you need `WebP`, you need to specify it). - -Podfile example: -``` -pod 'SDWebImage/WebP' -``` - -### Installation with Carthage (iOS 8+) - -[Carthage](https://github.com/Carthage/Carthage) is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods. - -To install with carthage, follow the instruction on [Carthage](https://github.com/Carthage/Carthage) - -#### Cartfile -``` -github "rs/SDWebImage" -``` - -### Installation by cloning the repository -- see [Manual install](Docs/ManualInstallation.md) - -### Import headers in your source files - -In the source files where you need to use the library, import the header file: - -```objective-c -#import -``` - -### Build Project - -At this point your workspace should build without error. If you are having problem, post to the Issue and the -community can help you solve it. - -## Author -- [Olivier Poitrey](https://github.com/rs) - -## Collaborators -- [Konstantinos K.](https://github.com/mythodeia) -- [Bogdan Poplauschi](https://github.com/bpoplauschi) -- [Chester Liu](https://github.com/skyline75489) -- [DreamPiggy](https://github.com/dreampiggy) - -## Licenses - -All source code is licensed under the [MIT License](https://raw.github.com/rs/SDWebImage/master/LICENSE). - -## Architecture - -

    - -

    - -

    - -

    diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h b/iOSProject/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h deleted file mode 100644 index 0ca226d8..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * (c) Fabrice Aneche - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCompat.h" - -typedef NS_ENUM(NSInteger, SDImageFormat) { - SDImageFormatUndefined = -1, - SDImageFormatJPEG = 0, - SDImageFormatPNG, - SDImageFormatGIF, - SDImageFormatTIFF, - SDImageFormatWebP, - SDImageFormatHEIC -}; - -@interface NSData (ImageContentType) - -/** - * Return image format - * - * @param data the input image data - * - * @return the image format as `SDImageFormat` (enum) - */ -+ (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; - -/** - Convert SDImageFormat to UTType - - @param format Format as SDImageFormat - @return The UTType as CFStringRef - */ -+ (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m b/iOSProject/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m deleted file mode 100644 index 6a590611..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * (c) Fabrice Aneche - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "NSData+ImageContentType.h" -#if SD_MAC -#import -#else -#import -#endif - -// Currently Image/IO does not support WebP -#define kSDUTTypeWebP ((__bridge CFStringRef)@"public.webp") -// AVFileTypeHEIC is defined in AVFoundation via iOS 11, we use this without import AVFoundation -#define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic") - -@implementation NSData (ImageContentType) - -+ (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data { - if (!data) { - return SDImageFormatUndefined; - } - - // File signatures table: http://www.garykessler.net/library/file_sigs.html - uint8_t c; - [data getBytes:&c length:1]; - switch (c) { - case 0xFF: - return SDImageFormatJPEG; - case 0x89: - return SDImageFormatPNG; - case 0x47: - return SDImageFormatGIF; - case 0x49: - case 0x4D: - return SDImageFormatTIFF; - case 0x52: { - if (data.length >= 12) { - //RIFF....WEBP - NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; - if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { - return SDImageFormatWebP; - } - } - break; - } - case 0x00: { - if (data.length >= 12) { - //....ftypheic ....ftypheix ....ftyphevc ....ftyphevx - NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(4, 8)] encoding:NSASCIIStringEncoding]; - if ([testString isEqualToString:@"ftypheic"] - || [testString isEqualToString:@"ftypheix"] - || [testString isEqualToString:@"ftyphevc"] - || [testString isEqualToString:@"ftyphevx"]) { - return SDImageFormatHEIC; - } - } - break; - } - } - return SDImageFormatUndefined; -} - -+ (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format { - CFStringRef UTType; - switch (format) { - case SDImageFormatJPEG: - UTType = kUTTypeJPEG; - break; - case SDImageFormatPNG: - UTType = kUTTypePNG; - break; - case SDImageFormatGIF: - UTType = kUTTypeGIF; - break; - case SDImageFormatTIFF: - UTType = kUTTypeTIFF; - break; - case SDImageFormatWebP: - UTType = kSDUTTypeWebP; - break; - case SDImageFormatHEIC: - UTType = kSDUTTypeHEIC; - break; - default: - // default is kUTTypePNG - UTType = kUTTypePNG; - break; - } - return UTType; -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h b/iOSProject/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h deleted file mode 100644 index 7515d407..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" - -#if SD_MAC - -#import - -@interface NSImage (WebCache) - -- (CGImageRef)CGImage; -- (NSArray *)images; -- (BOOL)isGIF; - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m b/iOSProject/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m deleted file mode 100644 index 140ed6ce..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "NSImage+WebCache.h" - -#if SD_MAC - -@implementation NSImage (WebCache) - -- (CGImageRef)CGImage { - NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height); - CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil]; - return cgImage; -} - -- (NSArray *)images { - return nil; -} - -- (BOOL)isGIF { - BOOL isGIF = NO; - for (NSImageRep *rep in self.representations) { - if ([rep isKindOfClass:[NSBitmapImageRep class]]) { - NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; - NSUInteger frameCount = [[bitmapRep valueForProperty:NSImageFrameCount] unsignedIntegerValue]; - isGIF = frameCount > 1 ? YES : NO; - break; - } - } - return isGIF; -} - -@end - -#endif - diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCache.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCache.h deleted file mode 100644 index 70ee6cea..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCache.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCompat.h" -#import "SDImageCacheConfig.h" - -typedef NS_ENUM(NSInteger, SDImageCacheType) { - /** - * The image wasn't available the SDWebImage caches, but was downloaded from the web. - */ - SDImageCacheTypeNone, - /** - * The image was obtained from the disk cache. - */ - SDImageCacheTypeDisk, - /** - * The image was obtained from the memory cache. - */ - SDImageCacheTypeMemory -}; - -typedef void(^SDCacheQueryCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType); - -typedef void(^SDWebImageCheckCacheCompletionBlock)(BOOL isInCache); - -typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger totalSize); - - -/** - * SDImageCache maintains a memory cache and an optional disk cache. Disk cache write operations are performed - * asynchronous so it doesn’t add unnecessary latency to the UI. - */ -@interface SDImageCache : NSObject - -#pragma mark - Properties - -/** - * Cache Config object - storing all kind of settings - */ -@property (nonatomic, nonnull, readonly) SDImageCacheConfig *config; - -/** - * The maximum "total cost" of the in-memory image cache. The cost function is the number of pixels held in memory. - */ -@property (assign, nonatomic) NSUInteger maxMemoryCost; - -/** - * The maximum number of objects the cache should hold. - */ -@property (assign, nonatomic) NSUInteger maxMemoryCountLimit; - -#pragma mark - Singleton and initialization - -/** - * Returns global shared cache instance - * - * @return SDImageCache global instance - */ -+ (nonnull instancetype)sharedImageCache; - -/** - * Init a new cache store with a specific namespace - * - * @param ns The namespace to use for this cache store - */ -- (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns; - -/** - * Init a new cache store with a specific namespace and directory - * - * @param ns The namespace to use for this cache store - * @param directory Directory to cache disk images in - */ -- (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns - diskCacheDirectory:(nonnull NSString *)directory NS_DESIGNATED_INITIALIZER; - -#pragma mark - Cache paths - -- (nullable NSString *)makeDiskCachePath:(nonnull NSString*)fullNamespace; - -/** - * Add a read-only cache path to search for images pre-cached by SDImageCache - * Useful if you want to bundle pre-loaded images with your app - * - * @param path The path to use for this read-only cache path - */ -- (void)addReadOnlyCachePath:(nonnull NSString *)path; - -#pragma mark - Store Ops - -/** - * Asynchronously store an image into memory and disk cache at the given key. - * - * @param image The image to store - * @param key The unique image cache key, usually it's image absolute URL - * @param completionBlock A block executed after the operation is finished - */ -- (void)storeImage:(nullable UIImage *)image - forKey:(nullable NSString *)key - completion:(nullable SDWebImageNoParamsBlock)completionBlock; - -/** - * Asynchronously store an image into memory and disk cache at the given key. - * - * @param image The image to store - * @param key The unique image cache key, usually it's image absolute URL - * @param toDisk Store the image to disk cache if YES - * @param completionBlock A block executed after the operation is finished - */ -- (void)storeImage:(nullable UIImage *)image - forKey:(nullable NSString *)key - toDisk:(BOOL)toDisk - completion:(nullable SDWebImageNoParamsBlock)completionBlock; - -/** - * Asynchronously store an image into memory and disk cache at the given key. - * - * @param image The image to store - * @param imageData The image data as returned by the server, this representation will be used for disk storage - * instead of converting the given image object into a storable/compressed image format in order - * to save quality and CPU - * @param key The unique image cache key, usually it's image absolute URL - * @param toDisk Store the image to disk cache if YES - * @param completionBlock A block executed after the operation is finished - */ -- (void)storeImage:(nullable UIImage *)image - imageData:(nullable NSData *)imageData - forKey:(nullable NSString *)key - toDisk:(BOOL)toDisk - completion:(nullable SDWebImageNoParamsBlock)completionBlock; - -/** - * Synchronously store image NSData into disk cache at the given key. - * - * @warning This method is synchronous, make sure to call it from the ioQueue - * - * @param imageData The image data to store - * @param key The unique image cache key, usually it's image absolute URL - */ -- (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key; - -#pragma mark - Query and Retrieve Ops - -/** - * Async check if image exists in disk cache already (does not load the image) - * - * @param key the key describing the url - * @param completionBlock the block to be executed when the check is done. - * @note the completion block will be always executed on the main queue - */ -- (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; - -/** - * Operation that queries the cache asynchronously and call the completion when done. - * - * @param key The unique key used to store the wanted image - * @param doneBlock The completion block. Will not get called if the operation is cancelled - * - * @return a NSOperation instance containing the cache op - */ -- (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock; - -/** - * Query the memory cache synchronously. - * - * @param key The unique key used to store the image - */ -- (nullable UIImage *)imageFromMemoryCacheForKey:(nullable NSString *)key; - -/** - * Query the disk cache synchronously. - * - * @param key The unique key used to store the image - */ -- (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key; - -/** - * Query the cache (memory and or disk) synchronously after checking the memory cache. - * - * @param key The unique key used to store the image - */ -- (nullable UIImage *)imageFromCacheForKey:(nullable NSString *)key; - -#pragma mark - Remove Ops - -/** - * Remove the image from memory and disk cache asynchronously - * - * @param key The unique image cache key - * @param completion A block that should be executed after the image has been removed (optional) - */ -- (void)removeImageForKey:(nullable NSString *)key withCompletion:(nullable SDWebImageNoParamsBlock)completion; - -/** - * Remove the image from memory and optionally disk cache asynchronously - * - * @param key The unique image cache key - * @param fromDisk Also remove cache entry from disk if YES - * @param completion A block that should be executed after the image has been removed (optional) - */ -- (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(nullable SDWebImageNoParamsBlock)completion; - -#pragma mark - Cache clean Ops - -/** - * Clear all memory cached images - */ -- (void)clearMemory; - -/** - * Async clear all disk cached images. Non-blocking method - returns immediately. - * @param completion A block that should be executed after cache expiration completes (optional) - */ -- (void)clearDiskOnCompletion:(nullable SDWebImageNoParamsBlock)completion; - -/** - * Async remove all expired cached image from disk. Non-blocking method - returns immediately. - * @param completionBlock A block that should be executed after cache expiration completes (optional) - */ -- (void)deleteOldFilesWithCompletionBlock:(nullable SDWebImageNoParamsBlock)completionBlock; - -#pragma mark - Cache Info - -/** - * Get the size used by the disk cache - */ -- (NSUInteger)getSize; - -/** - * Get the number of images in the disk cache - */ -- (NSUInteger)getDiskCount; - -/** - * Asynchronously calculate the disk cache's size. - */ -- (void)calculateSizeWithCompletionBlock:(nullable SDWebImageCalculateSizeBlock)completionBlock; - -#pragma mark - Cache Paths - -/** - * Get the cache path for a certain key (needs the cache path root folder) - * - * @param key the key (can be obtained from url using cacheKeyForURL) - * @param path the cache path root folder - * - * @return the cache path - */ -- (nullable NSString *)cachePathForKey:(nullable NSString *)key inPath:(nonnull NSString *)path; - -/** - * Get the default cache path for a certain key - * - * @param key the key (can be obtained from url using cacheKeyForURL) - * - * @return the default cache path - */ -- (nullable NSString *)defaultCachePathForKey:(nullable NSString *)key; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCache.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCache.m deleted file mode 100644 index e7c84957..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCache.m +++ /dev/null @@ -1,641 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDImageCache.h" -#import -#import "NSImage+WebCache.h" -#import "SDWebImageCodersManager.h" - -// See https://github.com/rs/SDWebImage/pull/1141 for discussion -@interface AutoPurgeCache : NSCache -@end - -@implementation AutoPurgeCache - -- (nonnull instancetype)init { - self = [super init]; - if (self) { -#if SD_UIKIT - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAllObjects) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; -#endif - } - return self; -} - -- (void)dealloc { -#if SD_UIKIT - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; -#endif -} - -@end - - -FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { -#if SD_MAC - return image.size.height * image.size.width; -#elif SD_UIKIT || SD_WATCH - return image.size.height * image.size.width * image.scale * image.scale; -#endif -} - -@interface SDImageCache () - -#pragma mark - Properties -@property (strong, nonatomic, nonnull) NSCache *memCache; -@property (strong, nonatomic, nonnull) NSString *diskCachePath; -@property (strong, nonatomic, nullable) NSMutableArray *customPaths; -@property (strong, nonatomic, nullable) dispatch_queue_t ioQueue; - -@end - - -@implementation SDImageCache { - NSFileManager *_fileManager; -} - -#pragma mark - Singleton, init, dealloc - -+ (nonnull instancetype)sharedImageCache { - static dispatch_once_t once; - static id instance; - dispatch_once(&once, ^{ - instance = [self new]; - }); - return instance; -} - -- (instancetype)init { - return [self initWithNamespace:@"default"]; -} - -- (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns { - NSString *path = [self makeDiskCachePath:ns]; - return [self initWithNamespace:ns diskCacheDirectory:path]; -} - -- (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns - diskCacheDirectory:(nonnull NSString *)directory { - if ((self = [super init])) { - NSString *fullNamespace = [@"com.hackemist.SDWebImageCache." stringByAppendingString:ns]; - - // Create IO serial queue - _ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL); - - _config = [[SDImageCacheConfig alloc] init]; - - // Init the memory cache - _memCache = [[AutoPurgeCache alloc] init]; - _memCache.name = fullNamespace; - - // Init the disk cache - if (directory != nil) { - _diskCachePath = [directory stringByAppendingPathComponent:fullNamespace]; - } else { - NSString *path = [self makeDiskCachePath:ns]; - _diskCachePath = path; - } - - dispatch_sync(_ioQueue, ^{ - _fileManager = [NSFileManager new]; - }); - -#if SD_UIKIT - // Subscribe to app events - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(clearMemory) - name:UIApplicationDidReceiveMemoryWarningNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(deleteOldFiles) - name:UIApplicationWillTerminateNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(backgroundDeleteOldFiles) - name:UIApplicationDidEnterBackgroundNotification - object:nil]; -#endif - } - - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)checkIfQueueIsIOQueue { - const char *currentQueueLabel = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); - const char *ioQueueLabel = dispatch_queue_get_label(self.ioQueue); - if (strcmp(currentQueueLabel, ioQueueLabel) != 0) { - NSLog(@"This method should be called from the ioQueue"); - } -} - -#pragma mark - Cache paths - -- (void)addReadOnlyCachePath:(nonnull NSString *)path { - if (!self.customPaths) { - self.customPaths = [NSMutableArray new]; - } - - if (![self.customPaths containsObject:path]) { - [self.customPaths addObject:path]; - } -} - -- (nullable NSString *)cachePathForKey:(nullable NSString *)key inPath:(nonnull NSString *)path { - NSString *filename = [self cachedFileNameForKey:key]; - return [path stringByAppendingPathComponent:filename]; -} - -- (nullable NSString *)defaultCachePathForKey:(nullable NSString *)key { - return [self cachePathForKey:key inPath:self.diskCachePath]; -} - -- (nullable NSString *)cachedFileNameForKey:(nullable NSString *)key { - const char *str = key.UTF8String; - if (str == NULL) { - str = ""; - } - unsigned char r[CC_MD5_DIGEST_LENGTH]; - CC_MD5(str, (CC_LONG)strlen(str), r); - NSURL *keyURL = [NSURL URLWithString:key]; - NSString *ext = keyURL ? keyURL.pathExtension : key.pathExtension; - NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%@", - r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], - r[11], r[12], r[13], r[14], r[15], ext.length == 0 ? @"" : [NSString stringWithFormat:@".%@", ext]]; - return filename; -} - -- (nullable NSString *)makeDiskCachePath:(nonnull NSString*)fullNamespace { - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); - return [paths[0] stringByAppendingPathComponent:fullNamespace]; -} - -#pragma mark - Store Ops - -- (void)storeImage:(nullable UIImage *)image - forKey:(nullable NSString *)key - completion:(nullable SDWebImageNoParamsBlock)completionBlock { - [self storeImage:image imageData:nil forKey:key toDisk:YES completion:completionBlock]; -} - -- (void)storeImage:(nullable UIImage *)image - forKey:(nullable NSString *)key - toDisk:(BOOL)toDisk - completion:(nullable SDWebImageNoParamsBlock)completionBlock { - [self storeImage:image imageData:nil forKey:key toDisk:toDisk completion:completionBlock]; -} - -- (void)storeImage:(nullable UIImage *)image - imageData:(nullable NSData *)imageData - forKey:(nullable NSString *)key - toDisk:(BOOL)toDisk - completion:(nullable SDWebImageNoParamsBlock)completionBlock { - if (!image || !key) { - if (completionBlock) { - completionBlock(); - } - return; - } - // if memory cache is enabled - if (self.config.shouldCacheImagesInMemory) { - NSUInteger cost = SDCacheCostForImage(image); - [self.memCache setObject:image forKey:key cost:cost]; - } - - if (toDisk) { - dispatch_async(self.ioQueue, ^{ - @autoreleasepool { - NSData *data = imageData; - if (!data && image) { - // If we do not have any data to detect image format, check whether it contains alpha channel to use PNG or JPEG format - SDImageFormat format; - if (SDCGImageRefContainsAlpha(image.CGImage)) { - format = SDImageFormatPNG; - } else { - format = SDImageFormatJPEG; - } - data = [[SDWebImageCodersManager sharedInstance] encodedDataWithImage:image format:format]; - } - [self storeImageDataToDisk:data forKey:key]; - } - - if (completionBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - completionBlock(); - }); - } - }); - } else { - if (completionBlock) { - completionBlock(); - } - } -} - -- (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key { - if (!imageData || !key) { - return; - } - - [self checkIfQueueIsIOQueue]; - - if (![_fileManager fileExistsAtPath:_diskCachePath]) { - [_fileManager createDirectoryAtPath:_diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL]; - } - - // get cache Path for image key - NSString *cachePathForKey = [self defaultCachePathForKey:key]; - // transform to NSUrl - NSURL *fileURL = [NSURL fileURLWithPath:cachePathForKey]; - - [_fileManager createFileAtPath:cachePathForKey contents:imageData attributes:nil]; - - // disable iCloud backup - if (self.config.shouldDisableiCloud) { - [fileURL setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil]; - } -} - -#pragma mark - Query and Retrieve Ops - -- (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock { - dispatch_async(_ioQueue, ^{ - BOOL exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key]]; - - // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name - // checking the key with and without the extension - if (!exists) { - exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key].stringByDeletingPathExtension]; - } - - if (completionBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - completionBlock(exists); - }); - } - }); -} - -- (nullable UIImage *)imageFromMemoryCacheForKey:(nullable NSString *)key { - return [self.memCache objectForKey:key]; -} - -- (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key { - UIImage *diskImage = [self diskImageForKey:key]; - if (diskImage && self.config.shouldCacheImagesInMemory) { - NSUInteger cost = SDCacheCostForImage(diskImage); - [self.memCache setObject:diskImage forKey:key cost:cost]; - } - - return diskImage; -} - -- (nullable UIImage *)imageFromCacheForKey:(nullable NSString *)key { - // First check the in-memory cache... - UIImage *image = [self imageFromMemoryCacheForKey:key]; - if (image) { - return image; - } - - // Second check the disk cache... - image = [self imageFromDiskCacheForKey:key]; - return image; -} - -- (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString *)key { - NSString *defaultPath = [self defaultCachePathForKey:key]; - NSData *data = [NSData dataWithContentsOfFile:defaultPath options:self.config.diskCacheReadingOptions error:nil]; - if (data) { - return data; - } - - // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name - // checking the key with and without the extension - data = [NSData dataWithContentsOfFile:defaultPath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil]; - if (data) { - return data; - } - - NSArray *customPaths = [self.customPaths copy]; - for (NSString *path in customPaths) { - NSString *filePath = [self cachePathForKey:key inPath:path]; - NSData *imageData = [NSData dataWithContentsOfFile:filePath options:self.config.diskCacheReadingOptions error:nil]; - if (imageData) { - return imageData; - } - - // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name - // checking the key with and without the extension - imageData = [NSData dataWithContentsOfFile:filePath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil]; - if (imageData) { - return imageData; - } - } - - return nil; -} - -- (nullable UIImage *)diskImageForKey:(nullable NSString *)key { - NSData *data = [self diskImageDataBySearchingAllPathsForKey:key]; - if (data) { - UIImage *image = [[SDWebImageCodersManager sharedInstance] decodedImageWithData:data]; - image = [self scaledImageForKey:key image:image]; - if (self.config.shouldDecompressImages) { - image = [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&data options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; - } - return image; - } else { - return nil; - } -} - -- (nullable UIImage *)scaledImageForKey:(nullable NSString *)key image:(nullable UIImage *)image { - return SDScaledImageForKey(key, image); -} - -- (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock { - if (!key) { - if (doneBlock) { - doneBlock(nil, nil, SDImageCacheTypeNone); - } - return nil; - } - - // First check the in-memory cache... - UIImage *image = [self imageFromMemoryCacheForKey:key]; - if (image) { - NSData *diskData = nil; - if (image.images) { - diskData = [self diskImageDataBySearchingAllPathsForKey:key]; - } - if (doneBlock) { - doneBlock(image, diskData, SDImageCacheTypeMemory); - } - return nil; - } - - NSOperation *operation = [NSOperation new]; - dispatch_async(self.ioQueue, ^{ - if (operation.isCancelled) { - // do not call the completion if cancelled - return; - } - - @autoreleasepool { - NSData *diskData = [self diskImageDataBySearchingAllPathsForKey:key]; - UIImage *diskImage = [self diskImageForKey:key]; - if (diskImage && self.config.shouldCacheImagesInMemory) { - NSUInteger cost = SDCacheCostForImage(diskImage); - [self.memCache setObject:diskImage forKey:key cost:cost]; - } - - if (doneBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - doneBlock(diskImage, diskData, SDImageCacheTypeDisk); - }); - } - } - }); - - return operation; -} - -#pragma mark - Remove Ops - -- (void)removeImageForKey:(nullable NSString *)key withCompletion:(nullable SDWebImageNoParamsBlock)completion { - [self removeImageForKey:key fromDisk:YES withCompletion:completion]; -} - -- (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(nullable SDWebImageNoParamsBlock)completion { - if (key == nil) { - return; - } - - if (self.config.shouldCacheImagesInMemory) { - [self.memCache removeObjectForKey:key]; - } - - if (fromDisk) { - dispatch_async(self.ioQueue, ^{ - [_fileManager removeItemAtPath:[self defaultCachePathForKey:key] error:nil]; - - if (completion) { - dispatch_async(dispatch_get_main_queue(), ^{ - completion(); - }); - } - }); - } else if (completion){ - completion(); - } - -} - -# pragma mark - Mem Cache settings - -- (void)setMaxMemoryCost:(NSUInteger)maxMemoryCost { - self.memCache.totalCostLimit = maxMemoryCost; -} - -- (NSUInteger)maxMemoryCost { - return self.memCache.totalCostLimit; -} - -- (NSUInteger)maxMemoryCountLimit { - return self.memCache.countLimit; -} - -- (void)setMaxMemoryCountLimit:(NSUInteger)maxCountLimit { - self.memCache.countLimit = maxCountLimit; -} - -#pragma mark - Cache clean Ops - -- (void)clearMemory { - [self.memCache removeAllObjects]; -} - -- (void)clearDiskOnCompletion:(nullable SDWebImageNoParamsBlock)completion { - dispatch_async(self.ioQueue, ^{ - [_fileManager removeItemAtPath:self.diskCachePath error:nil]; - [_fileManager createDirectoryAtPath:self.diskCachePath - withIntermediateDirectories:YES - attributes:nil - error:NULL]; - - if (completion) { - dispatch_async(dispatch_get_main_queue(), ^{ - completion(); - }); - } - }); -} - -- (void)deleteOldFiles { - [self deleteOldFilesWithCompletionBlock:nil]; -} - -- (void)deleteOldFilesWithCompletionBlock:(nullable SDWebImageNoParamsBlock)completionBlock { - dispatch_async(self.ioQueue, ^{ - NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; - NSArray *resourceKeys = @[NSURLIsDirectoryKey, NSURLContentModificationDateKey, NSURLTotalFileAllocatedSizeKey]; - - // This enumerator prefetches useful properties for our cache files. - NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL - includingPropertiesForKeys:resourceKeys - options:NSDirectoryEnumerationSkipsHiddenFiles - errorHandler:NULL]; - - NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-self.config.maxCacheAge]; - NSMutableDictionary *> *cacheFiles = [NSMutableDictionary dictionary]; - NSUInteger currentCacheSize = 0; - - // Enumerate all of the files in the cache directory. This loop has two purposes: - // - // 1. Removing files that are older than the expiration date. - // 2. Storing file attributes for the size-based cleanup pass. - NSMutableArray *urlsToDelete = [[NSMutableArray alloc] init]; - for (NSURL *fileURL in fileEnumerator) { - NSError *error; - NSDictionary *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:&error]; - - // Skip directories and errors. - if (error || !resourceValues || [resourceValues[NSURLIsDirectoryKey] boolValue]) { - continue; - } - - // Remove files that are older than the expiration date; - NSDate *modificationDate = resourceValues[NSURLContentModificationDateKey]; - if ([[modificationDate laterDate:expirationDate] isEqualToDate:expirationDate]) { - [urlsToDelete addObject:fileURL]; - continue; - } - - // Store a reference to this file and account for its total size. - NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey]; - currentCacheSize += totalAllocatedSize.unsignedIntegerValue; - cacheFiles[fileURL] = resourceValues; - } - - for (NSURL *fileURL in urlsToDelete) { - [_fileManager removeItemAtURL:fileURL error:nil]; - } - - // If our remaining disk cache exceeds a configured maximum size, perform a second - // size-based cleanup pass. We delete the oldest files first. - if (self.config.maxCacheSize > 0 && currentCacheSize > self.config.maxCacheSize) { - // Target half of our maximum cache size for this cleanup pass. - const NSUInteger desiredCacheSize = self.config.maxCacheSize / 2; - - // Sort the remaining cache files by their last modification time (oldest first). - NSArray *sortedFiles = [cacheFiles keysSortedByValueWithOptions:NSSortConcurrent - usingComparator:^NSComparisonResult(id obj1, id obj2) { - return [obj1[NSURLContentModificationDateKey] compare:obj2[NSURLContentModificationDateKey]]; - }]; - - // Delete files until we fall below our desired cache size. - for (NSURL *fileURL in sortedFiles) { - if ([_fileManager removeItemAtURL:fileURL error:nil]) { - NSDictionary *resourceValues = cacheFiles[fileURL]; - NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey]; - currentCacheSize -= totalAllocatedSize.unsignedIntegerValue; - - if (currentCacheSize < desiredCacheSize) { - break; - } - } - } - } - if (completionBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - completionBlock(); - }); - } - }); -} - -#if SD_UIKIT -- (void)backgroundDeleteOldFiles { - Class UIApplicationClass = NSClassFromString(@"UIApplication"); - if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { - return; - } - UIApplication *application = [UIApplication performSelector:@selector(sharedApplication)]; - __block UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler:^{ - // Clean up any unfinished task business by marking where you - // stopped or ending the task outright. - [application endBackgroundTask:bgTask]; - bgTask = UIBackgroundTaskInvalid; - }]; - - // Start the long-running task and return immediately. - [self deleteOldFilesWithCompletionBlock:^{ - [application endBackgroundTask:bgTask]; - bgTask = UIBackgroundTaskInvalid; - }]; -} -#endif - -#pragma mark - Cache Info - -- (NSUInteger)getSize { - __block NSUInteger size = 0; - dispatch_sync(self.ioQueue, ^{ - NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath]; - for (NSString *fileName in fileEnumerator) { - NSString *filePath = [self.diskCachePath stringByAppendingPathComponent:fileName]; - NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil]; - size += [attrs fileSize]; - } - }); - return size; -} - -- (NSUInteger)getDiskCount { - __block NSUInteger count = 0; - dispatch_sync(self.ioQueue, ^{ - NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath]; - count = fileEnumerator.allObjects.count; - }); - return count; -} - -- (void)calculateSizeWithCompletionBlock:(nullable SDWebImageCalculateSizeBlock)completionBlock { - NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES]; - - dispatch_async(self.ioQueue, ^{ - NSUInteger fileCount = 0; - NSUInteger totalSize = 0; - - NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL - includingPropertiesForKeys:@[NSFileSize] - options:NSDirectoryEnumerationSkipsHiddenFiles - errorHandler:NULL]; - - for (NSURL *fileURL in fileEnumerator) { - NSNumber *fileSize; - [fileURL getResourceValue:&fileSize forKey:NSURLFileSizeKey error:NULL]; - totalSize += fileSize.unsignedIntegerValue; - fileCount += 1; - } - - if (completionBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - completionBlock(fileCount, totalSize); - }); - } - }); -} - -@end - diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h deleted file mode 100644 index 20f2d108..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCompat.h" - -@interface SDImageCacheConfig : NSObject - -/** - * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. - * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. - */ -@property (assign, nonatomic) BOOL shouldDecompressImages; - -/** - * disable iCloud backup [defaults to YES] - */ -@property (assign, nonatomic) BOOL shouldDisableiCloud; - -/** - * use memory cache [defaults to YES] - */ -@property (assign, nonatomic) BOOL shouldCacheImagesInMemory; - -/** - * The reading options while reading cache from disk. - * Defaults to 0. You can set this to mapped file to improve performance. - */ -@property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions; - -/** - * The maximum length of time to keep an image in the cache, in seconds. - */ -@property (assign, nonatomic) NSInteger maxCacheAge; - -/** - * The maximum size of the cache, in bytes. - */ -@property (assign, nonatomic) NSUInteger maxCacheSize; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m deleted file mode 100644 index 7a5af6cb..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDImageCacheConfig.h" - -static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week - -@implementation SDImageCacheConfig - -- (instancetype)init { - if (self = [super init]) { - _shouldDecompressImages = YES; - _shouldDisableiCloud = YES; - _shouldCacheImagesInMemory = YES; - _diskCacheReadingOptions = 0; - _maxCacheAge = kDefaultCacheMaxCacheAge; - _maxCacheSize = 0; - } - return self; -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoder.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoder.h deleted file mode 100644 index 7c0a63f2..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoder.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCompat.h" -#import "NSData+ImageContentType.h" - -/** - A Boolean value indicating whether to scale down large images during decompressing. (NSNumber) - */ -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageCoderScaleDownLargeImagesKey; - -/** - Return the shared device-dependent RGB color space created with CGColorSpaceCreateDeviceRGB. - - @return The device-dependent RGB color space - */ -CG_EXTERN CGColorSpaceRef _Nonnull SDCGColorSpaceGetDeviceRGB(void); - -/** - Check whether CGImageRef contains alpha channel. - - @param imageRef The CGImageRef - @return Return YES if CGImageRef contains alpha channel, otherwise return NO - */ -CG_EXTERN BOOL SDCGImageRefContainsAlpha(_Nullable CGImageRef imageRef); - - -/** - This is the image coder protocol to provide custom image decoding/encoding. - These methods are all required to implement. - @note Pay attention that these methods are not called from main queue. - */ -@protocol SDWebImageCoder - -@required -#pragma mark - Decoding -/** - Returns YES if this coder can decode some data. Otherwise, the data should be passed to another coder. - - @param data The image data so we can look at it - @return YES if this coder can decode the data, NO otherwise - */ -- (BOOL)canDecodeFromData:(nullable NSData *)data; - -/** - Decode the image data to image. - - @param data The image data to be decoded - @return The decoded image from data - */ -- (nullable UIImage *)decodedImageWithData:(nullable NSData *)data; - -/** - Decompress the image with original image and image data. - - @param image The original image to be decompressed - @param data The pointer to original image data. The pointer itself is nonnull but image data can be null. This data will set to cache if needed. If you do not need to modify data at the sametime, ignore this param. - @param optionsDict A dictionary containing any decompressing options. Pass {SDWebImageCoderScaleDownLargeImagesKey: @(YES)} to scale down large images - @return The decompressed image - */ -- (nullable UIImage *)decompressedImageWithImage:(nullable UIImage *)image - data:(NSData * _Nullable * _Nonnull)data - options:(nullable NSDictionary*)optionsDict; - -#pragma mark - Encoding - -/** - Returns YES if this coder can encode some image. Otherwise, it should be passed to another coder. - - @param format The image format - @return YES if this coder can encode the image, NO otherwise - */ -- (BOOL)canEncodeToFormat:(SDImageFormat)format; - -/** - Encode the image to image data. - - @param image The image to be encoded - @param format The image format to encode, you should note `SDImageFormatUndefined` format is also possible - @return The encoded image data - */ -- (nullable NSData *)encodedDataWithImage:(nullable UIImage *)image format:(SDImageFormat)format; - -@end - - -/** - This is the image coder protocol to provide custom progressive image decoding. - These methods are all required to implement. - @note Pay attention that these methods are not called from main queue. - */ -@protocol SDWebImageProgressiveCoder - -@required -/** - Returns YES if this coder can incremental decode some data. Otherwise, it should be passed to another coder. - - @param data The image data so we can look at it - @return YES if this coder can decode the data, NO otherwise - */ -- (BOOL)canIncrementallyDecodeFromData:(nullable NSData *)data; - -/** - Incremental decode the image data to image. - - @param data The image data has been downloaded so far - @param finished Whether the download has finished - @warning because incremental decoding need to keep the decoded context, we will alloc a new instance with the same class for each download operation to avoid conflicts - @return The decoded image from data - */ -- (nullable UIImage *)incrementallyDecodedImageWithData:(nullable NSData *)data finished:(BOOL)finished; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m deleted file mode 100644 index 9357fe52..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCoder.h" - -NSString * const SDWebImageCoderScaleDownLargeImagesKey = @"scaleDownLargeImages"; - -CGColorSpaceRef SDCGColorSpaceGetDeviceRGB(void) { - static CGColorSpaceRef colorSpace; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - colorSpace = CGColorSpaceCreateDeviceRGB(); - }); - return colorSpace; -} - -BOOL SDCGImageRefContainsAlpha(CGImageRef imageRef) { - if (!imageRef) { - return NO; - } - CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef); - BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || - alphaInfo == kCGImageAlphaNoneSkipFirst || - alphaInfo == kCGImageAlphaNoneSkipLast); - return hasAlpha; -} diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h deleted file mode 100644 index cdafd88d..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCompat.h" -#import "SDWebImageFrame.h" - -@interface SDWebImageCoderHelper : NSObject - -/** - Return an animated image with frames array. - For UIKit, this will apply the patch and then create animated UIImage. The patch is because that `+[UIImage animatedImageWithImages:duration:]` just use the averate of duration for each image. So it will not work if different frame has different duration. Therefore we repeat the specify frame for specify times to let it work. - For AppKit, NSImage does not support animates other than GIF. This will try to encode the frames to GIF format and then create an animated NSImage for rendering. - - @param frames The frames array. If no frames or frames is empty, return nil - @return A animated image for rendering on UIImageView(UIKit) or NSImageView(AppKit) - */ -+ (UIImage * _Nullable)animatedImageWithFrames:(NSArray * _Nullable)frames; - -/** - Return frames array from an animated image. - For UIKit, this will unapply the patch for the description above and then create frames array. This will also work for normal animated UIImage. - For AppKit, NSImage does not support animates other than GIF. This will try to decode the GIF imageRep and then create frames array. - - @param animatedImage A animated image. If it's not animated, return nil - @return The frames array - */ -+ (NSArray * _Nullable)framesFromAnimatedImage:(UIImage * _Nullable)animatedImage; - -#if SD_UIKIT || SD_WATCH -/** - Convert an EXIF image orientation to an iOS one. - - @param exifOrientation EXIF orientation - @return iOS orientation - */ -+ (UIImageOrientation)imageOrientationFromEXIFOrientation:(NSInteger)exifOrientation; -/** - Convert an iOS orientation to an EXIF image orientation. - - @param imageOrientation iOS orientation - @return EXIF orientation - */ -+ (NSInteger)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation; -#endif - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.m deleted file mode 100644 index b2b651a2..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.m +++ /dev/null @@ -1,255 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCoderHelper.h" -#import "SDWebImageFrame.h" -#import "UIImage+MultiFormat.h" -#import "NSImage+WebCache.h" -#import - -@implementation SDWebImageCoderHelper - -+ (UIImage *)animatedImageWithFrames:(NSArray *)frames { - NSUInteger frameCount = frames.count; - if (frameCount == 0) { - return nil; - } - - UIImage *animatedImage; - -#if SD_UIKIT || SD_WATCH - NSUInteger durations[frameCount]; - for (size_t i = 0; i < frameCount; i++) { - durations[i] = frames[i].duration * 1000; - } - NSUInteger const gcd = gcdArray(frameCount, durations); - __block NSUInteger totalDuration = 0; - NSMutableArray *animatedImages = [NSMutableArray arrayWithCapacity:frameCount]; - [frames enumerateObjectsUsingBlock:^(SDWebImageFrame * _Nonnull frame, NSUInteger idx, BOOL * _Nonnull stop) { - UIImage *image = frame.image; - NSUInteger duration = frame.duration * 1000; - totalDuration += duration; - NSUInteger repeatCount; - if (gcd) { - repeatCount = duration / gcd; - } else { - repeatCount = 1; - } - for (size_t i = 0; i < repeatCount; ++i) { - [animatedImages addObject:image]; - } - }]; - - animatedImage = [UIImage animatedImageWithImages:animatedImages duration:totalDuration / 1000.f]; - -#else - - NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatGIF]; - // Create an image destination. GIF does not support EXIF image orientation - CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, frameCount, NULL); - if (!imageDestination) { - // Handle failure. - return nil; - } - - for (size_t i = 0; i < frameCount; i++) { - @autoreleasepool { - SDWebImageFrame *frame = frames[i]; - float frameDuration = frame.duration; - CGImageRef frameImageRef = frame.image.CGImage; - NSDictionary *frameProperties = @{(__bridge_transfer NSString *)kCGImagePropertyGIFDictionary : @{(__bridge_transfer NSString *)kCGImagePropertyGIFUnclampedDelayTime : @(frameDuration)}}; - CGImageDestinationAddImage(imageDestination, frameImageRef, (__bridge CFDictionaryRef)frameProperties); - } - } - // Finalize the destination. - if (CGImageDestinationFinalize(imageDestination) == NO) { - // Handle failure. - CFRelease(imageDestination); - return nil; - } - CFRelease(imageDestination); - animatedImage = [[NSImage alloc] initWithData:imageData]; -#endif - - return animatedImage; -} - -+ (NSArray *)framesFromAnimatedImage:(UIImage *)animatedImage { - if (!animatedImage) { - return nil; - } - - NSMutableArray *frames = [NSMutableArray array]; - NSUInteger frameCount = 0; - -#if SD_UIKIT || SD_WATCH - NSArray *animatedImages = animatedImage.images; - frameCount = animatedImages.count; - if (frameCount == 0) { - return nil; - } - - NSTimeInterval avgDuration = animatedImage.duration / frameCount; - if (avgDuration == 0) { - avgDuration = 0.1; // if it's a animated image but no duration, set it to default 100ms (this do not have that 10ms limit like GIF or WebP to allow custom coder provide the limit) - } - - __block NSUInteger index = 0; - __block NSUInteger repeatCount = 1; - __block UIImage *previousImage = animatedImages.firstObject; - [animatedImages enumerateObjectsUsingBlock:^(UIImage * _Nonnull image, NSUInteger idx, BOOL * _Nonnull stop) { - // ignore first - if (idx == 0) { - return; - } - if ([image isEqual:previousImage]) { - repeatCount++; - } else { - SDWebImageFrame *frame = [SDWebImageFrame frameWithImage:previousImage duration:avgDuration * repeatCount]; - [frames addObject:frame]; - repeatCount = 1; - index++; - } - previousImage = image; - // last one - if (idx == frameCount - 1) { - SDWebImageFrame *frame = [SDWebImageFrame frameWithImage:previousImage duration:avgDuration * repeatCount]; - [frames addObject:frame]; - } - }]; - -#else - - NSBitmapImageRep *bitmapRep; - for (NSImageRep *imageRep in animatedImage.representations) { - if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) { - bitmapRep = (NSBitmapImageRep *)imageRep; - break; - } - } - if (bitmapRep) { - frameCount = [[bitmapRep valueForProperty:NSImageFrameCount] unsignedIntegerValue]; - } - - if (frameCount == 0) { - return nil; - } - - for (size_t i = 0; i < frameCount; i++) { - @autoreleasepool { - // NSBitmapImageRep need to manually change frame. "Good taste" API - [bitmapRep setProperty:NSImageCurrentFrame withValue:@(i)]; - float frameDuration = [[bitmapRep valueForProperty:NSImageCurrentFrameDuration] floatValue]; - NSImage *frameImage = [[NSImage alloc] initWithCGImage:bitmapRep.CGImage size:CGSizeZero]; - SDWebImageFrame *frame = [SDWebImageFrame frameWithImage:frameImage duration:frameDuration]; - [frames addObject:frame]; - } - } -#endif - - return frames; -} - -#if SD_UIKIT || SD_WATCH -// Convert an EXIF image orientation to an iOS one. -+ (UIImageOrientation)imageOrientationFromEXIFOrientation:(NSInteger)exifOrientation { - // CGImagePropertyOrientation is available on iOS 8 above. Currently kept for compatibility - UIImageOrientation imageOrientation = UIImageOrientationUp; - switch (exifOrientation) { - case 1: - imageOrientation = UIImageOrientationUp; - break; - case 3: - imageOrientation = UIImageOrientationDown; - break; - case 8: - imageOrientation = UIImageOrientationLeft; - break; - case 6: - imageOrientation = UIImageOrientationRight; - break; - case 2: - imageOrientation = UIImageOrientationUpMirrored; - break; - case 4: - imageOrientation = UIImageOrientationDownMirrored; - break; - case 5: - imageOrientation = UIImageOrientationLeftMirrored; - break; - case 7: - imageOrientation = UIImageOrientationRightMirrored; - break; - default: - break; - } - return imageOrientation; -} - -// Convert an iOS orientation to an EXIF image orientation. -+ (NSInteger)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation { - // CGImagePropertyOrientation is available on iOS 8 above. Currently kept for compatibility - NSInteger exifOrientation = 1; - switch (imageOrientation) { - case UIImageOrientationUp: - exifOrientation = 1; - break; - case UIImageOrientationDown: - exifOrientation = 3; - break; - case UIImageOrientationLeft: - exifOrientation = 8; - break; - case UIImageOrientationRight: - exifOrientation = 6; - break; - case UIImageOrientationUpMirrored: - exifOrientation = 2; - break; - case UIImageOrientationDownMirrored: - exifOrientation = 4; - break; - case UIImageOrientationLeftMirrored: - exifOrientation = 5; - break; - case UIImageOrientationRightMirrored: - exifOrientation = 7; - break; - default: - break; - } - return exifOrientation; -} -#endif - -#pragma mark - Helper Fuction -#if SD_UIKIT || SD_WATCH -static NSUInteger gcd(NSUInteger a, NSUInteger b) { - NSUInteger c; - while (a != 0) { - c = a; - a = b % a; - b = c; - } - return b; -} - -static NSUInteger gcdArray(size_t const count, NSUInteger const * const values) { - if (count == 0) { - return 0; - } - NSUInteger result = values[0]; - for (size_t i = 1; i < count; ++i) { - result = gcd(values[i], result); - } - return result; -} -#endif - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h deleted file mode 100644 index 5c3d4b37..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCoder.h" - -/** - Global object holding the array of coders, so that we avoid passing them from object to object. - Uses a priority queue behind scenes, which means the latest added coders have the highest priority. - This is done so when encoding/decoding something, we go through the list and ask each coder if they can handle the current data. - That way, users can add their custom coders while preserving our existing prebuilt ones - - Note: the `coders` getter will return the coders in their reversed order - Example: - - by default we internally set coders = `IOCoder`, `WebPCoder`. (`GIFCoder` is not recommended to add only if you want to get GIF support without `FLAnimatedImage`) - - calling `coders` will return `@[WebPCoder, IOCoder]` - - call `[addCoder:[MyCrazyCoder new]]` - - calling `coders` now returns `@[MyCrazyCoder, WebPCoder, IOCoder]` - - Coders - ------ - A coder must conform to the `SDWebImageCoder` protocol or even to `SDWebImageProgressiveCoder` if it supports progressive decoding - Conformance is important because that way, they will implement `canDecodeFromData` or `canEncodeToFormat` - Those methods are called on each coder in the array (using the priority order) until one of them returns YES. - That means that coder can decode that data / encode to that format - */ -@interface SDWebImageCodersManager : NSObject - -/** - Shared reusable instance - */ -+ (nonnull instancetype)sharedInstance; - -/** - All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority - */ -@property (nonatomic, strong, readwrite, nullable) NSArray* coders; - -/** - Add a new coder to the end of coders array. Which has the highest priority. - - @param coder coder - */ -- (void)addCoder:(nonnull id)coder; - -/** - Remove a coder in the coders array. - - @param coder coder - */ -- (void)removeCoder:(nonnull id)coder; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m deleted file mode 100644 index 6134aa88..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m +++ /dev/null @@ -1,133 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCodersManager.h" -#import "SDWebImageImageIOCoder.h" -#import "SDWebImageGIFCoder.h" -#ifdef SD_WEBP -#import "SDWebImageWebPCoder.h" -#endif - -@interface SDWebImageCodersManager () - -@property (strong, nonatomic, nonnull) NSMutableArray* mutableCoders; -@property (strong, nonatomic, nullable) dispatch_queue_t mutableCodersAccessQueue; - -@end - -@implementation SDWebImageCodersManager - -+ (nonnull instancetype)sharedInstance { - static dispatch_once_t once; - static id instance; - dispatch_once(&once, ^{ - instance = [self new]; - }); - return instance; -} - -- (instancetype)init { - if (self = [super init]) { - // initialize with default coders - _mutableCoders = [@[[SDWebImageImageIOCoder sharedCoder]] mutableCopy]; -#ifdef SD_WEBP - [_mutableCoders addObject:[SDWebImageWebPCoder sharedCoder]]; -#endif - _mutableCodersAccessQueue = dispatch_queue_create("com.hackemist.SDWebImageCodersManager", DISPATCH_QUEUE_CONCURRENT); - } - return self; -} - -#pragma mark - Coder IO operations - -- (void)addCoder:(nonnull id)coder { - if ([coder conformsToProtocol:@protocol(SDWebImageCoder)]) { - dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ - [self.mutableCoders addObject:coder]; - }); - } -} - -- (void)removeCoder:(nonnull id)coder { - dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ - [self.mutableCoders removeObject:coder]; - }); -} - -- (NSArray *)coders { - __block NSArray *sortedCoders = nil; - dispatch_sync(self.mutableCodersAccessQueue, ^{ - sortedCoders = (NSArray *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects]; - }); - return sortedCoders; -} - -- (void)setCoders:(NSArray *)coders { - dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ - self.mutableCoders = [coders mutableCopy]; - }); -} - -#pragma mark - SDWebImageCoder -- (BOOL)canDecodeFromData:(NSData *)data { - for (id coder in self.coders) { - if ([coder canDecodeFromData:data]) { - return YES; - } - } - return NO; -} - -- (BOOL)canEncodeToFormat:(SDImageFormat)format { - for (id coder in self.coders) { - if ([coder canEncodeToFormat:format]) { - return YES; - } - } - return NO; -} - -- (UIImage *)decodedImageWithData:(NSData *)data { - if (!data) { - return nil; - } - for (id coder in self.coders) { - if ([coder canDecodeFromData:data]) { - return [coder decodedImageWithData:data]; - } - } - return nil; -} - -- (UIImage *)decompressedImageWithImage:(UIImage *)image - data:(NSData *__autoreleasing _Nullable *)data - options:(nullable NSDictionary*)optionsDict { - if (!image) { - return nil; - } - for (id coder in self.coders) { - if ([coder canDecodeFromData:*data]) { - return [coder decompressedImageWithImage:image data:data options:optionsDict]; - } - } - return nil; -} - -- (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format { - if (!image) { - return nil; - } - for (id coder in self.coders) { - if ([coder canEncodeToFormat:format]) { - return [coder encodedDataWithImage:image format:format]; - } - } - return nil; -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h deleted file mode 100644 index ce068071..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * (c) Jamie Pinkham - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import - -#ifdef __OBJC_GC__ - #error SDWebImage does not support Objective-C Garbage Collection -#endif - -// Apple's defines from TargetConditionals.h are a bit weird. -// Seems like TARGET_OS_MAC is always defined (on all platforms). -// To determine if we are running on OSX, we can only rely on TARGET_OS_IPHONE=0 and all the other platforms -#if !TARGET_OS_IPHONE && !TARGET_OS_IOS && !TARGET_OS_TV && !TARGET_OS_WATCH - #define SD_MAC 1 -#else - #define SD_MAC 0 -#endif - -// iOS and tvOS are very similar, UIKit exists on both platforms -// Note: watchOS also has UIKit, but it's very limited -#if TARGET_OS_IOS || TARGET_OS_TV - #define SD_UIKIT 1 -#else - #define SD_UIKIT 0 -#endif - -#if TARGET_OS_IOS - #define SD_IOS 1 -#else - #define SD_IOS 0 -#endif - -#if TARGET_OS_TV - #define SD_TV 1 -#else - #define SD_TV 0 -#endif - -#if TARGET_OS_WATCH - #define SD_WATCH 1 -#else - #define SD_WATCH 0 -#endif - - -#if SD_MAC - #import - #ifndef UIImage - #define UIImage NSImage - #endif - #ifndef UIImageView - #define UIImageView NSImageView - #endif - #ifndef UIView - #define UIView NSView - #endif -#else - #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 - #error SDWebImage doesn't support Deployment Target version < 5.0 - #endif - - #if SD_UIKIT - #import - #endif - #if SD_WATCH - #import - #endif -#endif - -#ifndef NS_ENUM -#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type -#endif - -#ifndef NS_OPTIONS -#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type -#endif - -FOUNDATION_EXPORT UIImage *SDScaledImageForKey(NSString *key, UIImage *image); - -typedef void(^SDWebImageNoParamsBlock)(void); - -FOUNDATION_EXPORT NSString *const SDWebImageErrorDomain; - -#ifndef dispatch_queue_async_safe -#define dispatch_queue_async_safe(queue, block)\ - if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(queue)) == 0) {\ - block();\ - } else {\ - dispatch_async(queue, block);\ - } -#endif - -#ifndef dispatch_main_async_safe -#define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block) -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m deleted file mode 100644 index bb53495e..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" -#import "UIImage+MultiFormat.h" - -#if !__has_feature(objc_arc) - #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag -#endif - -#if !OS_OBJECT_USE_OBJC - #error SDWebImage need ARC for dispatch object -#endif - -inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { - if (!image) { - return nil; - } - -#if SD_MAC - return image; -#elif SD_UIKIT || SD_WATCH - if ((image.images).count > 0) { - NSMutableArray *scaledImages = [NSMutableArray array]; - - for (UIImage *tempImage in image.images) { - [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; - } - - UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration]; - if (animatedImage) { - animatedImage.sd_imageLoopCount = image.sd_imageLoopCount; - } - return animatedImage; - } else { -#if SD_WATCH - if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { -#elif SD_UIKIT - if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { -#endif - CGFloat scale = 1; - if (key.length >= 8) { - NSRange range = [key rangeOfString:@"@2x."]; - if (range.location != NSNotFound) { - scale = 2.0; - } - - range = [key rangeOfString:@"@3x."]; - if (range.location != NSNotFound) { - scale = 3.0; - } - } - - UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; - image = scaledImage; - } - return image; - } -#endif -} - -NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h deleted file mode 100644 index ac7e5219..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCompat.h" -#import "SDWebImageOperation.h" - -typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { - SDWebImageDownloaderLowPriority = 1 << 0, - SDWebImageDownloaderProgressiveDownload = 1 << 1, - - /** - * By default, request prevent the use of NSURLCache. With this flag, NSURLCache - * is used with default policies. - */ - SDWebImageDownloaderUseNSURLCache = 1 << 2, - - /** - * Call completion block with nil image/imageData if the image was read from NSURLCache - * (to be combined with `SDWebImageDownloaderUseNSURLCache`). - */ - SDWebImageDownloaderIgnoreCachedResponse = 1 << 3, - - /** - * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for - * extra time in background to let the request finish. If the background task expires the operation will be cancelled. - */ - SDWebImageDownloaderContinueInBackground = 1 << 4, - - /** - * Handles cookies stored in NSHTTPCookieStore by setting - * NSMutableURLRequest.HTTPShouldHandleCookies = YES; - */ - SDWebImageDownloaderHandleCookies = 1 << 5, - - /** - * Enable to allow untrusted SSL certificates. - * Useful for testing purposes. Use with caution in production. - */ - SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6, - - /** - * Put the image in the high priority queue. - */ - SDWebImageDownloaderHighPriority = 1 << 7, - - /** - * Scale down the image - */ - SDWebImageDownloaderScaleDownLargeImages = 1 << 8, -}; - -typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) { - /** - * Default value. All download operations will execute in queue style (first-in-first-out). - */ - SDWebImageDownloaderFIFOExecutionOrder, - - /** - * All download operations will execute in stack style (last-in-first-out). - */ - SDWebImageDownloaderLIFOExecutionOrder -}; - -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; - -typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL); - -typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished); - -typedef NSDictionary SDHTTPHeadersDictionary; -typedef NSMutableDictionary SDHTTPHeadersMutableDictionary; - -typedef SDHTTPHeadersDictionary * _Nullable (^SDWebImageDownloaderHeadersFilterBlock)(NSURL * _Nullable url, SDHTTPHeadersDictionary * _Nullable headers); - -/** - * A token associated with each download. Can be used to cancel a download - */ -@interface SDWebImageDownloadToken : NSObject - -@property (nonatomic, strong, nullable) NSURL *url; -@property (nonatomic, strong, nullable) id downloadOperationCancelToken; - -@end - - -/** - * Asynchronous downloader dedicated and optimized for image loading. - */ -@interface SDWebImageDownloader : NSObject - -/** - * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. - * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. - */ -@property (assign, nonatomic) BOOL shouldDecompressImages; - -/** - * The maximum number of concurrent downloads - */ -@property (assign, nonatomic) NSInteger maxConcurrentDownloads; - -/** - * Shows the current amount of downloads that still need to be downloaded - */ -@property (readonly, nonatomic) NSUInteger currentDownloadCount; - -/** - * The timeout value (in seconds) for the download operation. Default: 15.0. - */ -@property (assign, nonatomic) NSTimeInterval downloadTimeout; - -/** - * The configuration in use by the internal NSURLSession. - * Mutating this object directly has no effect. - * - * @see createNewSessionWithConfiguration: - */ -@property (readonly, nonatomic, nonnull) NSURLSessionConfiguration *sessionConfiguration; - - -/** - * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`. - */ -@property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder; - -/** - * Singleton method, returns the shared instance - * - * @return global shared instance of downloader class - */ -+ (nonnull instancetype)sharedDownloader; - -/** - * Set the default URL credential to be set for request operations. - */ -@property (strong, nonatomic, nullable) NSURLCredential *urlCredential; - -/** - * Set username - */ -@property (strong, nonatomic, nullable) NSString *username; - -/** - * Set password - */ -@property (strong, nonatomic, nullable) NSString *password; - -/** - * Set filter to pick headers for downloading image HTTP request. - * - * This block will be invoked for each downloading image request, returned - * NSDictionary will be used as headers in corresponding HTTP request. - */ -@property (nonatomic, copy, nullable) SDWebImageDownloaderHeadersFilterBlock headersFilter; - -/** - * Creates an instance of a downloader with specified session configuration. - * @note `timeoutIntervalForRequest` is going to be overwritten. - * @return new instance of downloader class - */ -- (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)sessionConfiguration NS_DESIGNATED_INITIALIZER; - -/** - * Set a value for a HTTP header to be appended to each download HTTP request. - * - * @param value The value for the header field. Use `nil` value to remove the header. - * @param field The name of the header field to set. - */ -- (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field; - -/** - * Returns the value of the specified HTTP header field. - * - * @return The value associated with the header field field, or `nil` if there is no corresponding header field. - */ -- (nullable NSString *)valueForHTTPHeaderField:(nullable NSString *)field; - -/** - * Sets a subclass of `SDWebImageDownloaderOperation` as the default - * `NSOperation` to be used each time SDWebImage constructs a request - * operation to download an image. - * - * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set - * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`. - */ -- (void)setOperationClass:(nullable Class)operationClass; - -/** - * Creates a SDWebImageDownloader async downloader instance with a given URL - * - * The delegate will be informed when the image is finish downloaded or an error has happen. - * - * @see SDWebImageDownloaderDelegate - * - * @param url The URL to the image to download - * @param options The options to be used for this download - * @param progressBlock A block called repeatedly while the image is downloading - * @note the progress block is executed on a background queue - * @param completedBlock A block called once the download is completed. - * If the download succeeded, the image parameter is set, in case of error, - * error parameter is set with the error. The last parameter is always YES - * if SDWebImageDownloaderProgressiveDownload isn't use. With the - * SDWebImageDownloaderProgressiveDownload option, this block is called - * repeatedly with the partial image object and the finished argument set to NO - * before to be called a last time with the full image and finished argument - * set to YES. In case of error, the finished argument is always YES. - * - * @return A token (SDWebImageDownloadToken) that can be passed to -cancel: to cancel this operation - */ -- (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url - options:(SDWebImageDownloaderOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; - -/** - * Cancels a download that was previously queued using -downloadImageWithURL:options:progress:completed: - * - * @param token The token received from -downloadImageWithURL:options:progress:completed: that should be canceled. - */ -- (void)cancel:(nullable SDWebImageDownloadToken *)token; - -/** - * Sets the download queue suspension state - */ -- (void)setSuspended:(BOOL)suspended; - -/** - * Cancels all download operations in the queue - */ -- (void)cancelAllDownloads; - -/** - * Forces SDWebImageDownloader to create and use a new NSURLSession that is - * initialized with the given configuration. - * @note All existing download operations in the queue will be cancelled. - * @note `timeoutIntervalForRequest` is going to be overwritten. - * - * @param sessionConfiguration The configuration to use for the new NSURLSession - */ -- (void)createNewSessionWithConfiguration:(nonnull NSURLSessionConfiguration *)sessionConfiguration; - -/** - * Invalidates the managed session, optionally canceling pending operations. - * @note If you use custom downloader instead of the shared downloader, you need call this method when you do not use it to avoid memory leak - * @param cancelPendingOperations Whether or not to cancel pending operations. - */ -- (void)invalidateSessionAndCancel:(BOOL)cancelPendingOperations; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m deleted file mode 100644 index 472559ca..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.m +++ /dev/null @@ -1,348 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageDownloader.h" -#import "SDWebImageDownloaderOperation.h" - -@implementation SDWebImageDownloadToken -@end - - -@interface SDWebImageDownloader () - -@property (strong, nonatomic, nonnull) NSOperationQueue *downloadQueue; -@property (weak, nonatomic, nullable) NSOperation *lastAddedOperation; -@property (assign, nonatomic, nullable) Class operationClass; -@property (strong, nonatomic, nonnull) NSMutableDictionary *URLOperations; -@property (strong, nonatomic, nullable) SDHTTPHeadersMutableDictionary *HTTPHeaders; -// This queue is used to serialize the handling of the network responses of all the download operation in a single queue -@property (strong, nonatomic, nullable) dispatch_queue_t barrierQueue; - -// The session in which data tasks will run -@property (strong, nonatomic) NSURLSession *session; - -@end - -@implementation SDWebImageDownloader - -+ (void)initialize { - // Bind SDNetworkActivityIndicator if available (download it here: http://github.com/rs/SDNetworkActivityIndicator ) - // To use it, just add #import "SDNetworkActivityIndicator.h" in addition to the SDWebImage import - if (NSClassFromString(@"SDNetworkActivityIndicator")) { - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" - id activityIndicator = [NSClassFromString(@"SDNetworkActivityIndicator") performSelector:NSSelectorFromString(@"sharedActivityIndicator")]; -#pragma clang diagnostic pop - - // Remove observer in case it was previously added. - [[NSNotificationCenter defaultCenter] removeObserver:activityIndicator name:SDWebImageDownloadStartNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:activityIndicator name:SDWebImageDownloadStopNotification object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:activityIndicator - selector:NSSelectorFromString(@"startActivity") - name:SDWebImageDownloadStartNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:activityIndicator - selector:NSSelectorFromString(@"stopActivity") - name:SDWebImageDownloadStopNotification object:nil]; - } -} - -+ (nonnull instancetype)sharedDownloader { - static dispatch_once_t once; - static id instance; - dispatch_once(&once, ^{ - instance = [self new]; - }); - return instance; -} - -- (nonnull instancetype)init { - return [self initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; -} - -- (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)sessionConfiguration { - if ((self = [super init])) { - _operationClass = [SDWebImageDownloaderOperation class]; - _shouldDecompressImages = YES; - _executionOrder = SDWebImageDownloaderFIFOExecutionOrder; - _downloadQueue = [NSOperationQueue new]; - _downloadQueue.maxConcurrentOperationCount = 6; - _downloadQueue.name = @"com.hackemist.SDWebImageDownloader"; - _URLOperations = [NSMutableDictionary new]; -#ifdef SD_WEBP - _HTTPHeaders = [@{@"Accept": @"image/webp,image/*;q=0.8"} mutableCopy]; -#else - _HTTPHeaders = [@{@"Accept": @"image/*;q=0.8"} mutableCopy]; -#endif - _barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderBarrierQueue", DISPATCH_QUEUE_CONCURRENT); - _downloadTimeout = 15.0; - - [self createNewSessionWithConfiguration:sessionConfiguration]; - } - return self; -} - -- (void)createNewSessionWithConfiguration:(NSURLSessionConfiguration *)sessionConfiguration { - [self cancelAllDownloads]; - - if (self.session) { - [self.session invalidateAndCancel]; - } - - sessionConfiguration.timeoutIntervalForRequest = self.downloadTimeout; - - /** - * Create the session for this task - * We send nil as delegate queue so that the session creates a serial operation queue for performing all delegate - * method calls and completion handler calls. - */ - self.session = [NSURLSession sessionWithConfiguration:sessionConfiguration - delegate:self - delegateQueue:nil]; -} - -- (void)invalidateSessionAndCancel:(BOOL)cancelPendingOperations { - if (cancelPendingOperations) { - [self.session invalidateAndCancel]; - } else { - [self.session finishTasksAndInvalidate]; - } -} - -- (void)dealloc { - [self.session invalidateAndCancel]; - self.session = nil; - - [self.downloadQueue cancelAllOperations]; -} - -- (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field { - if (value) { - self.HTTPHeaders[field] = value; - } else { - [self.HTTPHeaders removeObjectForKey:field]; - } -} - -- (nullable NSString *)valueForHTTPHeaderField:(nullable NSString *)field { - return self.HTTPHeaders[field]; -} - -- (void)setMaxConcurrentDownloads:(NSInteger)maxConcurrentDownloads { - _downloadQueue.maxConcurrentOperationCount = maxConcurrentDownloads; -} - -- (NSUInteger)currentDownloadCount { - return _downloadQueue.operationCount; -} - -- (NSInteger)maxConcurrentDownloads { - return _downloadQueue.maxConcurrentOperationCount; -} - -- (NSURLSessionConfiguration *)sessionConfiguration { - return self.session.configuration; -} - -- (void)setOperationClass:(nullable Class)operationClass { - if (operationClass && [operationClass isSubclassOfClass:[NSOperation class]] && [operationClass conformsToProtocol:@protocol(SDWebImageDownloaderOperationInterface)]) { - _operationClass = operationClass; - } else { - _operationClass = [SDWebImageDownloaderOperation class]; - } -} - -- (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url - options:(SDWebImageDownloaderOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock { - __weak SDWebImageDownloader *wself = self; - - return [self addProgressCallback:progressBlock completedBlock:completedBlock forURL:url createCallback:^SDWebImageDownloaderOperation *{ - __strong __typeof (wself) sself = wself; - NSTimeInterval timeoutInterval = sself.downloadTimeout; - if (timeoutInterval == 0.0) { - timeoutInterval = 15.0; - } - - // In order to prevent from potential duplicate caching (NSURLCache + SDImageCache) we disable the cache for image requests if told otherwise - NSURLRequestCachePolicy cachePolicy = options & SDWebImageDownloaderUseNSURLCache ? NSURLRequestUseProtocolCachePolicy : NSURLRequestReloadIgnoringLocalCacheData; - NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url - cachePolicy:cachePolicy - timeoutInterval:timeoutInterval]; - - request.HTTPShouldHandleCookies = (options & SDWebImageDownloaderHandleCookies); - request.HTTPShouldUsePipelining = YES; - if (sself.headersFilter) { - request.allHTTPHeaderFields = sself.headersFilter(url, [sself.HTTPHeaders copy]); - } - else { - request.allHTTPHeaderFields = sself.HTTPHeaders; - } - SDWebImageDownloaderOperation *operation = [[sself.operationClass alloc] initWithRequest:request inSession:sself.session options:options]; - operation.shouldDecompressImages = sself.shouldDecompressImages; - - if (sself.urlCredential) { - operation.credential = sself.urlCredential; - } else if (sself.username && sself.password) { - operation.credential = [NSURLCredential credentialWithUser:sself.username password:sself.password persistence:NSURLCredentialPersistenceForSession]; - } - - if (options & SDWebImageDownloaderHighPriority) { - operation.queuePriority = NSOperationQueuePriorityHigh; - } else if (options & SDWebImageDownloaderLowPriority) { - operation.queuePriority = NSOperationQueuePriorityLow; - } - - [sself.downloadQueue addOperation:operation]; - if (sself.executionOrder == SDWebImageDownloaderLIFOExecutionOrder) { - // Emulate LIFO execution order by systematically adding new operations as last operation's dependency - [sself.lastAddedOperation addDependency:operation]; - sself.lastAddedOperation = operation; - } - - return operation; - }]; -} - -- (void)cancel:(nullable SDWebImageDownloadToken *)token { - dispatch_barrier_async(self.barrierQueue, ^{ - SDWebImageDownloaderOperation *operation = self.URLOperations[token.url]; - BOOL canceled = [operation cancel:token.downloadOperationCancelToken]; - if (canceled) { - [self.URLOperations removeObjectForKey:token.url]; - } - }); -} - -- (nullable SDWebImageDownloadToken *)addProgressCallback:(SDWebImageDownloaderProgressBlock)progressBlock - completedBlock:(SDWebImageDownloaderCompletedBlock)completedBlock - forURL:(nullable NSURL *)url - createCallback:(SDWebImageDownloaderOperation *(^)(void))createCallback { - // The URL will be used as the key to the callbacks dictionary so it cannot be nil. If it is nil immediately call the completed block with no image or data. - if (url == nil) { - if (completedBlock != nil) { - completedBlock(nil, nil, nil, NO); - } - return nil; - } - - __block SDWebImageDownloadToken *token = nil; - - dispatch_barrier_sync(self.barrierQueue, ^{ - SDWebImageDownloaderOperation *operation = self.URLOperations[url]; - if (!operation) { - operation = createCallback(); - self.URLOperations[url] = operation; - - __weak SDWebImageDownloaderOperation *woperation = operation; - operation.completionBlock = ^{ - dispatch_barrier_sync(self.barrierQueue, ^{ - SDWebImageDownloaderOperation *soperation = woperation; - if (!soperation) return; - if (self.URLOperations[url] == soperation) { - [self.URLOperations removeObjectForKey:url]; - }; - }); - }; - } - id downloadOperationCancelToken = [operation addHandlersForProgress:progressBlock completed:completedBlock]; - - token = [SDWebImageDownloadToken new]; - token.url = url; - token.downloadOperationCancelToken = downloadOperationCancelToken; - }); - - return token; -} - -- (void)setSuspended:(BOOL)suspended { - self.downloadQueue.suspended = suspended; -} - -- (void)cancelAllDownloads { - [self.downloadQueue cancelAllOperations]; -} - -#pragma mark Helper methods - -- (SDWebImageDownloaderOperation *)operationWithTask:(NSURLSessionTask *)task { - SDWebImageDownloaderOperation *returnOperation = nil; - for (SDWebImageDownloaderOperation *operation in self.downloadQueue.operations) { - if (operation.dataTask.taskIdentifier == task.taskIdentifier) { - returnOperation = operation; - break; - } - } - return returnOperation; -} - -#pragma mark NSURLSessionDataDelegate - -- (void)URLSession:(NSURLSession *)session - dataTask:(NSURLSessionDataTask *)dataTask -didReceiveResponse:(NSURLResponse *)response - completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler { - - // Identify the operation that runs this task and pass it the delegate method - SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:dataTask]; - - [dataOperation URLSession:session dataTask:dataTask didReceiveResponse:response completionHandler:completionHandler]; -} - -- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { - - // Identify the operation that runs this task and pass it the delegate method - SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:dataTask]; - - [dataOperation URLSession:session dataTask:dataTask didReceiveData:data]; -} - -- (void)URLSession:(NSURLSession *)session - dataTask:(NSURLSessionDataTask *)dataTask - willCacheResponse:(NSCachedURLResponse *)proposedResponse - completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler { - - // Identify the operation that runs this task and pass it the delegate method - SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:dataTask]; - - [dataOperation URLSession:session dataTask:dataTask willCacheResponse:proposedResponse completionHandler:completionHandler]; -} - -#pragma mark NSURLSessionTaskDelegate - -- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { - - // Identify the operation that runs this task and pass it the delegate method - SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:task]; - - [dataOperation URLSession:session task:task didCompleteWithError:error]; -} - -- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest * _Nullable))completionHandler { - - // Identify the operation that runs this task and pass it the delegate method - SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:task]; - - if ([dataOperation respondsToSelector:@selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)]) { - [dataOperation URLSession:session task:task willPerformHTTPRedirection:response newRequest:request completionHandler:completionHandler]; - } else { - completionHandler(request); - } -} - -- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { - - // Identify the operation that runs this task and pass it the delegate method - SDWebImageDownloaderOperation *dataOperation = [self operationWithTask:task]; - - [dataOperation URLSession:session task:task didReceiveChallenge:challenge completionHandler:completionHandler]; -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h deleted file mode 100644 index 40721b24..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageDownloader.h" -#import "SDWebImageOperation.h" - -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadReceiveResponseNotification; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadFinishNotification; - - - -/** - Describes a downloader operation. If one wants to use a custom downloader op, it needs to inherit from `NSOperation` and conform to this protocol - */ -@protocol SDWebImageDownloaderOperationInterface - -- (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request - inSession:(nullable NSURLSession *)session - options:(SDWebImageDownloaderOptions)options; - -- (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; - -- (BOOL)shouldDecompressImages; -- (void)setShouldDecompressImages:(BOOL)value; - -- (nullable NSURLCredential *)credential; -- (void)setCredential:(nullable NSURLCredential *)value; - -@end - - -@interface SDWebImageDownloaderOperation : NSOperation - -/** - * The request used by the operation's task. - */ -@property (strong, nonatomic, readonly, nullable) NSURLRequest *request; - -/** - * The operation's task - */ -@property (strong, nonatomic, readonly, nullable) NSURLSessionTask *dataTask; - - -@property (assign, nonatomic) BOOL shouldDecompressImages; - -/** - * Was used to determine whether the URL connection should consult the credential storage for authenticating the connection. - * @deprecated Not used for a couple of versions - */ -@property (nonatomic, assign) BOOL shouldUseCredentialStorage __deprecated_msg("Property deprecated. Does nothing. Kept only for backwards compatibility"); - -/** - * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. - * - * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. - */ -@property (nonatomic, strong, nullable) NSURLCredential *credential; - -/** - * The SDWebImageDownloaderOptions for the receiver. - */ -@property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; - -/** - * The expected size of data. - */ -@property (assign, nonatomic) NSInteger expectedSize; - -/** - * The response returned by the operation's connection. - */ -@property (strong, nonatomic, nullable) NSURLResponse *response; - -/** - * Initializes a `SDWebImageDownloaderOperation` object - * - * @see SDWebImageDownloaderOperation - * - * @param request the URL request - * @param session the URL session in which this operation will run - * @param options downloader options - * - * @return the initialized instance - */ -- (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request - inSession:(nullable NSURLSession *)session - options:(SDWebImageDownloaderOptions)options NS_DESIGNATED_INITIALIZER; - -/** - * Adds handlers for progress and completion. Returns a tokent that can be passed to -cancel: to cancel this set of - * callbacks. - * - * @param progressBlock the block executed when a new chunk of data arrives. - * @note the progress block is executed on a background queue - * @param completedBlock the block executed when the download is done. - * @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 - * - * @return the token to use to cancel this set of handlers - */ -- (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; - -/** - * Cancels a set of callbacks. Once all callbacks are canceled, the operation is cancelled. - * - * @param token the token representing a set of callbacks to cancel - * - * @return YES if the operation was stopped because this was the last token to be canceled. NO otherwise. - */ -- (BOOL)cancel:(nullable id)token; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m deleted file mode 100644 index 8fdab376..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.m +++ /dev/null @@ -1,491 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageDownloaderOperation.h" -#import "SDWebImageManager.h" -#import "NSImage+WebCache.h" -#import "SDWebImageCodersManager.h" - -NSString *const SDWebImageDownloadStartNotification = @"SDWebImageDownloadStartNotification"; -NSString *const SDWebImageDownloadReceiveResponseNotification = @"SDWebImageDownloadReceiveResponseNotification"; -NSString *const SDWebImageDownloadStopNotification = @"SDWebImageDownloadStopNotification"; -NSString *const SDWebImageDownloadFinishNotification = @"SDWebImageDownloadFinishNotification"; - -static NSString *const kProgressCallbackKey = @"progress"; -static NSString *const kCompletedCallbackKey = @"completed"; - -typedef NSMutableDictionary SDCallbacksDictionary; - -@interface SDWebImageDownloaderOperation () - -@property (strong, nonatomic, nonnull) NSMutableArray *callbackBlocks; - -@property (assign, nonatomic, getter = isExecuting) BOOL executing; -@property (assign, nonatomic, getter = isFinished) BOOL finished; -@property (strong, nonatomic, nullable) NSMutableData *imageData; -@property (copy, nonatomic, nullable) NSData *cachedData; - -// This is weak because it is injected by whoever manages this session. If this gets nil-ed out, we won't be able to run -// the task associated with this operation -@property (weak, nonatomic, nullable) NSURLSession *unownedSession; -// This is set if we're using not using an injected NSURLSession. We're responsible of invalidating this one -@property (strong, nonatomic, nullable) NSURLSession *ownedSession; - -@property (strong, nonatomic, readwrite, nullable) NSURLSessionTask *dataTask; - -@property (strong, nonatomic, nullable) dispatch_queue_t barrierQueue; - -#if SD_UIKIT -@property (assign, nonatomic) UIBackgroundTaskIdentifier backgroundTaskId; -#endif - -@property (strong, nonatomic, nullable) id progressiveCoder; - -@end - -@implementation SDWebImageDownloaderOperation - -@synthesize executing = _executing; -@synthesize finished = _finished; - -- (nonnull instancetype)init { - return [self initWithRequest:nil inSession:nil options:0]; -} - -- (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request - inSession:(nullable NSURLSession *)session - options:(SDWebImageDownloaderOptions)options { - if ((self = [super init])) { - _request = [request copy]; - _shouldDecompressImages = YES; - _options = options; - _callbackBlocks = [NSMutableArray new]; - _executing = NO; - _finished = NO; - _expectedSize = 0; - _unownedSession = session; - _barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderOperationBarrierQueue", DISPATCH_QUEUE_CONCURRENT); - } - return self; -} - -- (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock { - SDCallbacksDictionary *callbacks = [NSMutableDictionary new]; - if (progressBlock) callbacks[kProgressCallbackKey] = [progressBlock copy]; - if (completedBlock) callbacks[kCompletedCallbackKey] = [completedBlock copy]; - dispatch_barrier_async(self.barrierQueue, ^{ - [self.callbackBlocks addObject:callbacks]; - }); - return callbacks; -} - -- (nullable NSArray *)callbacksForKey:(NSString *)key { - __block NSMutableArray *callbacks = nil; - dispatch_sync(self.barrierQueue, ^{ - // We need to remove [NSNull null] because there might not always be a progress block for each callback - callbacks = [[self.callbackBlocks valueForKey:key] mutableCopy]; - [callbacks removeObjectIdenticalTo:[NSNull null]]; - }); - return [callbacks copy]; // strip mutability here -} - -- (BOOL)cancel:(nullable id)token { - __block BOOL shouldCancel = NO; - dispatch_barrier_sync(self.barrierQueue, ^{ - [self.callbackBlocks removeObjectIdenticalTo:token]; - if (self.callbackBlocks.count == 0) { - shouldCancel = YES; - } - }); - if (shouldCancel) { - [self cancel]; - } - return shouldCancel; -} - -- (void)start { - @synchronized (self) { - if (self.isCancelled) { - self.finished = YES; - [self reset]; - return; - } - -#if SD_UIKIT - Class UIApplicationClass = NSClassFromString(@"UIApplication"); - BOOL hasApplication = UIApplicationClass && [UIApplicationClass respondsToSelector:@selector(sharedApplication)]; - if (hasApplication && [self shouldContinueWhenAppEntersBackground]) { - __weak __typeof__ (self) wself = self; - UIApplication * app = [UIApplicationClass performSelector:@selector(sharedApplication)]; - self.backgroundTaskId = [app beginBackgroundTaskWithExpirationHandler:^{ - __strong __typeof (wself) sself = wself; - - if (sself) { - [sself cancel]; - - [app endBackgroundTask:sself.backgroundTaskId]; - sself.backgroundTaskId = UIBackgroundTaskInvalid; - } - }]; - } -#endif - if (self.options & SDWebImageDownloaderIgnoreCachedResponse) { - // Grab the cached data for later check - NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:self.request]; - if (cachedResponse) { - self.cachedData = cachedResponse.data; - } - } - - NSURLSession *session = self.unownedSession; - if (!self.unownedSession) { - NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; - sessionConfig.timeoutIntervalForRequest = 15; - - /** - * Create the session for this task - * We send nil as delegate queue so that the session creates a serial operation queue for performing all delegate - * method calls and completion handler calls. - */ - self.ownedSession = [NSURLSession sessionWithConfiguration:sessionConfig - delegate:self - delegateQueue:nil]; - session = self.ownedSession; - } - - self.dataTask = [session dataTaskWithRequest:self.request]; - self.executing = YES; - } - - [self.dataTask resume]; - - if (self.dataTask) { - for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { - progressBlock(0, NSURLResponseUnknownLength, self.request.URL); - } - __weak typeof(self) weakSelf = self; - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStartNotification object:weakSelf]; - }); - } else { - [self callCompletionBlocksWithError:[NSError errorWithDomain:NSURLErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Connection can't be initialized"}]]; - } - -#if SD_UIKIT - Class UIApplicationClass = NSClassFromString(@"UIApplication"); - if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { - return; - } - if (self.backgroundTaskId != UIBackgroundTaskInvalid) { - UIApplication * app = [UIApplication performSelector:@selector(sharedApplication)]; - [app endBackgroundTask:self.backgroundTaskId]; - self.backgroundTaskId = UIBackgroundTaskInvalid; - } -#endif -} - -- (void)cancel { - @synchronized (self) { - [self cancelInternal]; - } -} - -- (void)cancelInternal { - if (self.isFinished) return; - [super cancel]; - - if (self.dataTask) { - [self.dataTask cancel]; - __weak typeof(self) weakSelf = self; - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:weakSelf]; - }); - - // As we cancelled the connection, its callback won't be called and thus won't - // maintain the isFinished and isExecuting flags. - if (self.isExecuting) self.executing = NO; - if (!self.isFinished) self.finished = YES; - } - - [self reset]; -} - -- (void)done { - self.finished = YES; - self.executing = NO; - [self reset]; -} - -- (void)reset { - __weak typeof(self) weakSelf = self; - dispatch_barrier_async(self.barrierQueue, ^{ - [weakSelf.callbackBlocks removeAllObjects]; - }); - self.dataTask = nil; - - NSOperationQueue *delegateQueue; - if (self.unownedSession) { - delegateQueue = self.unownedSession.delegateQueue; - } else { - delegateQueue = self.ownedSession.delegateQueue; - } - if (delegateQueue) { - NSAssert(delegateQueue.maxConcurrentOperationCount == 1, @"NSURLSession delegate queue should be a serial queue"); - [delegateQueue addOperationWithBlock:^{ - weakSelf.imageData = nil; - }]; - } - - if (self.ownedSession) { - [self.ownedSession invalidateAndCancel]; - self.ownedSession = nil; - } -} - -- (void)setFinished:(BOOL)finished { - [self willChangeValueForKey:@"isFinished"]; - _finished = finished; - [self didChangeValueForKey:@"isFinished"]; -} - -- (void)setExecuting:(BOOL)executing { - [self willChangeValueForKey:@"isExecuting"]; - _executing = executing; - [self didChangeValueForKey:@"isExecuting"]; -} - -- (BOOL)isConcurrent { - return YES; -} - -#pragma mark NSURLSessionDataDelegate - -- (void)URLSession:(NSURLSession *)session - dataTask:(NSURLSessionDataTask *)dataTask -didReceiveResponse:(NSURLResponse *)response - completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler { - - //'304 Not Modified' is an exceptional one - if (![response respondsToSelector:@selector(statusCode)] || (((NSHTTPURLResponse *)response).statusCode < 400 && ((NSHTTPURLResponse *)response).statusCode != 304)) { - NSInteger expected = (NSInteger)response.expectedContentLength; - expected = expected > 0 ? expected : 0; - self.expectedSize = expected; - for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { - progressBlock(0, expected, self.request.URL); - } - - self.imageData = [[NSMutableData alloc] initWithCapacity:expected]; - self.response = response; - __weak typeof(self) weakSelf = self; - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadReceiveResponseNotification object:weakSelf]; - }); - } else { - NSUInteger code = ((NSHTTPURLResponse *)response).statusCode; - - //This is the case when server returns '304 Not Modified'. It means that remote image is not changed. - //In case of 304 we need just cancel the operation and return cached image from the cache. - if (code == 304) { - [self cancelInternal]; - } else { - [self.dataTask cancel]; - } - __weak typeof(self) weakSelf = self; - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:weakSelf]; - }); - - [self callCompletionBlocksWithError:[NSError errorWithDomain:NSURLErrorDomain code:((NSHTTPURLResponse *)response).statusCode userInfo:nil]]; - - [self done]; - } - - if (completionHandler) { - completionHandler(NSURLSessionResponseAllow); - } -} - -- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { - [self.imageData appendData:data]; - - if ((self.options & SDWebImageDownloaderProgressiveDownload) && self.expectedSize > 0) { - // Get the image data - NSData *imageData = [self.imageData copy]; - // Get the total bytes downloaded - const NSInteger totalSize = imageData.length; - // Get the finish status - BOOL finished = (totalSize >= self.expectedSize); - - if (!self.progressiveCoder) { - // We need to create a new instance for progressive decoding to avoid conflicts - for (idcoder in [SDWebImageCodersManager sharedInstance].coders) { - if ([coder conformsToProtocol:@protocol(SDWebImageProgressiveCoder)] && - [((id)coder) canIncrementallyDecodeFromData:imageData]) { - self.progressiveCoder = [[[coder class] alloc] init]; - break; - } - } - } - - UIImage *image = [self.progressiveCoder incrementallyDecodedImageWithData:imageData finished:finished]; - if (image) { - NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; - image = [self scaledImageForKey:key image:image]; - if (self.shouldDecompressImages) { - image = [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&data options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; - } - - [self callCompletionBlocksWithImage:image imageData:nil error:nil finished:NO]; - } - } - - for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { - progressBlock(self.imageData.length, self.expectedSize, self.request.URL); - } -} - -- (void)URLSession:(NSURLSession *)session - dataTask:(NSURLSessionDataTask *)dataTask - willCacheResponse:(NSCachedURLResponse *)proposedResponse - completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler { - - NSCachedURLResponse *cachedResponse = proposedResponse; - - if (self.request.cachePolicy == NSURLRequestReloadIgnoringLocalCacheData) { - // Prevents caching of responses - cachedResponse = nil; - } - if (completionHandler) { - completionHandler(cachedResponse); - } -} - -#pragma mark NSURLSessionTaskDelegate - -- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { - @synchronized(self) { - self.dataTask = nil; - __weak typeof(self) weakSelf = self; - dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:weakSelf]; - if (!error) { - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadFinishNotification object:weakSelf]; - } - }); - } - - if (error) { - [self callCompletionBlocksWithError:error]; - } else { - if ([self callbacksForKey:kCompletedCallbackKey].count > 0) { - /** - * If you specified to use `NSURLCache`, then the response you get here is what you need. - */ - NSData *imageData = [self.imageData copy]; - if (imageData) { - /** if you specified to only use cached data via `SDWebImageDownloaderIgnoreCachedResponse`, - * then we should check if the cached data is equal to image data - */ - if (self.options & SDWebImageDownloaderIgnoreCachedResponse && [self.cachedData isEqualToData:imageData]) { - // call completion block with nil - [self callCompletionBlocksWithImage:nil imageData:nil error:nil finished:YES]; - } else { - UIImage *image = [[SDWebImageCodersManager sharedInstance] decodedImageWithData:imageData]; - NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; - image = [self scaledImageForKey:key image:image]; - - BOOL shouldDecode = YES; - // Do not force decoding animated GIFs and WebPs - if (image.images) { - shouldDecode = NO; - } else { -#ifdef SD_WEBP - SDImageFormat imageFormat = [NSData sd_imageFormatForImageData:imageData]; - if (imageFormat == SDImageFormatWebP) { - shouldDecode = NO; - } -#endif - } - - if (shouldDecode) { - if (self.shouldDecompressImages) { - BOOL shouldScaleDown = self.options & SDWebImageDownloaderScaleDownLargeImages; - image = [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&imageData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(shouldScaleDown)}]; - } - } - if (CGSizeEqualToSize(image.size, CGSizeZero)) { - [self callCompletionBlocksWithError:[NSError errorWithDomain:SDWebImageErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Downloaded image has 0 pixels"}]]; - } else { - [self callCompletionBlocksWithImage:image imageData:imageData error:nil finished:YES]; - } - } - } else { - [self callCompletionBlocksWithError:[NSError errorWithDomain:SDWebImageErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"Image data is nil"}]]; - } - } - } - [self done]; -} - -- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { - - NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; - __block NSURLCredential *credential = nil; - - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - if (!(self.options & SDWebImageDownloaderAllowInvalidSSLCertificates)) { - disposition = NSURLSessionAuthChallengePerformDefaultHandling; - } else { - credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; - disposition = NSURLSessionAuthChallengeUseCredential; - } - } else { - if (challenge.previousFailureCount == 0) { - if (self.credential) { - credential = self.credential; - disposition = NSURLSessionAuthChallengeUseCredential; - } else { - disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; - } - } else { - disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; - } - } - - if (completionHandler) { - completionHandler(disposition, credential); - } -} - -#pragma mark Helper methods -- (nullable UIImage *)scaledImageForKey:(nullable NSString *)key image:(nullable UIImage *)image { - return SDScaledImageForKey(key, image); -} - -- (BOOL)shouldContinueWhenAppEntersBackground { - return self.options & SDWebImageDownloaderContinueInBackground; -} - -- (void)callCompletionBlocksWithError:(nullable NSError *)error { - [self callCompletionBlocksWithImage:nil imageData:nil error:error finished:YES]; -} - -- (void)callCompletionBlocksWithImage:(nullable UIImage *)image - imageData:(nullable NSData *)imageData - error:(nullable NSError *)error - finished:(BOOL)finished { - NSArray *completionBlocks = [self callbacksForKey:kCompletedCallbackKey]; - dispatch_main_async_safe(^{ - for (SDWebImageDownloaderCompletedBlock completedBlock in completionBlocks) { - completedBlock(image, imageData, error, finished); - } - }); -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h deleted file mode 100644 index d8ba1812..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCompat.h" - -@interface SDWebImageFrame : NSObject - -// This class is used for creating animated images via `animatedImageWithFrames` in `SDWebImageCoderHelper`. Attension if you need animated images loop count, use `sd_imageLoopCount` property in `UIImage+MultiFormat` - -/** - The image of current frame. You should not set an animated image. - */ -@property (nonatomic, strong, readonly, nonnull) UIImage *image; -/** - The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. - */ -@property (nonatomic, readonly, assign) NSTimeInterval duration; - -/** - Create a frame instance with specify image and duration - - @param image current frame's image - @param duration current frame's duration - @return frame instance - */ -+ (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m deleted file mode 100644 index b0aefe54..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageFrame.h" - -@interface SDWebImageFrame () - -@property (nonatomic, strong, readwrite, nonnull) UIImage *image; -@property (nonatomic, readwrite, assign) NSTimeInterval duration; - -@end - -@implementation SDWebImageFrame - -+ (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration { - SDWebImageFrame *frame = [[SDWebImageFrame alloc] init]; - frame.image = image; - frame.duration = duration; - - return frame; -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h deleted file mode 100644 index 30521f9e..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCoder.h" - -/** - Built in coder using ImageIO that supports GIF encoding/decoding - @note `SDWebImageIOCoder` supports GIF but only as static (will use the 1st frame). - @note Use `SDWebImageGIFCoder` for fully animated GIFs - less performant than `FLAnimatedImage` - @note If you decide to make all `UIImageView`(including `FLAnimatedImageView`) instance support GIF. You should add this coder to `SDWebImageCodersManager` and make sure that it has a higher priority than `SDWebImageIOCoder` - @note The recommended approach for animated GIFs is using `FLAnimatedImage`. It's more performant than `UIImageView` for GIF displaying - */ -@interface SDWebImageGIFCoder : NSObject - -+ (nonnull instancetype)sharedCoder; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.m deleted file mode 100644 index 69172104..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.m +++ /dev/null @@ -1,183 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageGIFCoder.h" -#import "NSImage+WebCache.h" -#import -#import "NSData+ImageContentType.h" -#import "UIImage+MultiFormat.h" -#import "SDWebImageCoderHelper.h" - -@implementation SDWebImageGIFCoder - -+ (instancetype)sharedCoder { - static SDWebImageGIFCoder *coder; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - coder = [[SDWebImageGIFCoder alloc] init]; - }); - return coder; -} - -#pragma mark - Decode -- (BOOL)canDecodeFromData:(nullable NSData *)data { - return ([NSData sd_imageFormatForImageData:data] == SDImageFormatGIF); -} - -- (UIImage *)decodedImageWithData:(NSData *)data { - if (!data) { - return nil; - } - -#if SD_MAC - return [[UIImage alloc] initWithData:data]; -#else - - CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); - if (!source) { - return nil; - } - size_t count = CGImageSourceGetCount(source); - - UIImage *animatedImage; - - if (count <= 1) { - animatedImage = [[UIImage alloc] initWithData:data]; - } else { - NSMutableArray *frames = [NSMutableArray array]; - - for (size_t i = 0; i < count; i++) { - CGImageRef imageRef = CGImageSourceCreateImageAtIndex(source, i, NULL); - if (!imageRef) { - continue; - } - - float duration = [self sd_frameDurationAtIndex:i source:source]; -#if SD_WATCH - CGFloat scale = 1; - scale = [WKInterfaceDevice currentDevice].screenScale; -#elif SD_UIKIT - CGFloat scale = 1; - scale = [UIScreen mainScreen].scale; -#endif - UIImage *image = [UIImage imageWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp]; - CGImageRelease(imageRef); - - SDWebImageFrame *frame = [SDWebImageFrame frameWithImage:image duration:duration]; - [frames addObject:frame]; - } - - NSUInteger loopCount = 0; - NSDictionary *imageProperties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(source, nil); - NSDictionary *gifProperties = [imageProperties valueForKey:(__bridge_transfer NSString *)kCGImagePropertyGIFDictionary]; - if (gifProperties) { - NSNumber *gifLoopCount = [gifProperties valueForKey:(__bridge_transfer NSString *)kCGImagePropertyGIFLoopCount]; - if (gifLoopCount != nil) { - loopCount = gifLoopCount.unsignedIntegerValue; - } - } - - animatedImage = [SDWebImageCoderHelper animatedImageWithFrames:frames]; - animatedImage.sd_imageLoopCount = loopCount; - } - - CFRelease(source); - - return animatedImage; -#endif -} - -- (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { - float frameDuration = 0.1f; - CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); - NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; - NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; - - NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; - if (delayTimeUnclampedProp != nil) { - frameDuration = [delayTimeUnclampedProp floatValue]; - } else { - NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; - if (delayTimeProp != nil) { - frameDuration = [delayTimeProp floatValue]; - } - } - - // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. - // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify - // a duration of <= 10 ms. See and - // for more information. - - if (frameDuration < 0.011f) { - frameDuration = 0.100f; - } - - CFRelease(cfFrameProperties); - return frameDuration; -} - -- (UIImage *)decompressedImageWithImage:(UIImage *)image - data:(NSData *__autoreleasing _Nullable *)data - options:(nullable NSDictionary*)optionsDict { - // GIF do not decompress - return image; -} - -#pragma mark - Encode -- (BOOL)canEncodeToFormat:(SDImageFormat)format { - return (format == SDImageFormatGIF); -} - -- (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format { - if (!image) { - return nil; - } - - if (format != SDImageFormatGIF) { - return nil; - } - - NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatGIF]; - NSArray *frames = [SDWebImageCoderHelper framesFromAnimatedImage:image]; - - // Create an image destination. GIF does not support EXIF image orientation - CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, frames.count, NULL); - if (!imageDestination) { - // Handle failure. - return nil; - } - if (frames.count == 0) { - // for static single GIF images - CGImageDestinationAddImage(imageDestination, image.CGImage, nil); - } else { - // for animated GIF images - NSUInteger loopCount = image.sd_imageLoopCount; - NSDictionary *gifProperties = @{(__bridge_transfer NSString *)kCGImagePropertyGIFDictionary: @{(__bridge_transfer NSString *)kCGImagePropertyGIFLoopCount : @(loopCount)}}; - CGImageDestinationSetProperties(imageDestination, (__bridge CFDictionaryRef)gifProperties); - - for (size_t i = 0; i < frames.count; i++) { - SDWebImageFrame *frame = frames[i]; - float frameDuration = frame.duration; - CGImageRef frameImageRef = frame.image.CGImage; - NSDictionary *frameProperties = @{(__bridge_transfer NSString *)kCGImagePropertyGIFDictionary : @{(__bridge_transfer NSString *)kCGImagePropertyGIFUnclampedDelayTime : @(frameDuration)}}; - CGImageDestinationAddImage(imageDestination, frameImageRef, (__bridge CFDictionaryRef)frameProperties); - } - } - // Finalize the destination. - if (CGImageDestinationFinalize(imageDestination) == NO) { - // Handle failure. - imageData = nil; - } - - CFRelease(imageDestination); - - return [imageData copy]; -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h deleted file mode 100644 index 04f68fb9..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageCoder.h" - -/** - Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. - - GIF - Also supports static GIF (meaning will only handle the 1st frame). - For a full GIF support, we recommend `FLAnimatedImage` or our less performant `SDWebImageGIFCoder` - - HEIC - This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices, see: https://devstreaming-cdn.apple.com/videos/wwdc/2017/511tj33587vdhds/511/511_working_with_heif_and_hevc.pdf - Decode(Software): !Simulator && (iOS 11 || tvOS 11 || macOS 10.13) - Decode(Hardware): !Simulator && ((iOS 11 && A9Chip) || (macOS 10.13 && 6thGenerationIntelCPU)) - Encode(Software): macOS 10.13 - Encode(Hardware): !Simulator && ((iOS 11 && A10FusionChip) || (macOS 10.13 && 6thGenerationIntelCPU)) - */ -@interface SDWebImageImageIOCoder : NSObject - -+ (nonnull instancetype)sharedCoder; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.m deleted file mode 100644 index 25c2d194..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.m +++ /dev/null @@ -1,587 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageImageIOCoder.h" -#import "SDWebImageCoderHelper.h" -#import "NSImage+WebCache.h" -#import -#import "NSData+ImageContentType.h" - -#if SD_UIKIT || SD_WATCH -static const size_t kBytesPerPixel = 4; -static const size_t kBitsPerComponent = 8; - -/* - * Defines the maximum size in MB of the decoded image when the flag `SDWebImageScaleDownLargeImages` is set - * Suggested value for iPad1 and iPhone 3GS: 60. - * Suggested value for iPad2 and iPhone 4: 120. - * Suggested value for iPhone 3G and iPod 2 and earlier devices: 30. - */ -static const CGFloat kDestImageSizeMB = 60.0f; - -/* - * Defines the maximum size in MB of a tile used to decode image when the flag `SDWebImageScaleDownLargeImages` is set - * Suggested value for iPad1 and iPhone 3GS: 20. - * Suggested value for iPad2 and iPhone 4: 40. - * Suggested value for iPhone 3G and iPod 2 and earlier devices: 10. - */ -static const CGFloat kSourceImageTileSizeMB = 20.0f; - -static const CGFloat kBytesPerMB = 1024.0f * 1024.0f; -static const CGFloat kPixelsPerMB = kBytesPerMB / kBytesPerPixel; -static const CGFloat kDestTotalPixels = kDestImageSizeMB * kPixelsPerMB; -static const CGFloat kTileTotalPixels = kSourceImageTileSizeMB * kPixelsPerMB; - -static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to overlap the seems where tiles meet. -#endif - -@implementation SDWebImageImageIOCoder { - size_t _width, _height; -#if SD_UIKIT || SD_WATCH - UIImageOrientation _orientation; -#endif - CGImageSourceRef _imageSource; -} - -- (void)dealloc { - if (_imageSource) { - CFRelease(_imageSource); - _imageSource = NULL; - } -} - -+ (instancetype)sharedCoder { - static SDWebImageImageIOCoder *coder; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - coder = [[SDWebImageImageIOCoder alloc] init]; - }); - return coder; -} - -#pragma mark - Decode -- (BOOL)canDecodeFromData:(nullable NSData *)data { - switch ([NSData sd_imageFormatForImageData:data]) { - case SDImageFormatWebP: - // Do not support WebP decoding - return NO; - case SDImageFormatHEIC: - // Check HEIC decoding compatibility - return [[self class] canDecodeFromHEICFormat]; - default: - return YES; - } -} - -- (BOOL)canIncrementallyDecodeFromData:(NSData *)data { - switch ([NSData sd_imageFormatForImageData:data]) { - case SDImageFormatWebP: - // Do not support WebP progressive decoding - return NO; - case SDImageFormatHEIC: - // Check HEIC decoding compatibility - return [[self class] canDecodeFromHEICFormat]; - default: - return YES; - } -} - -- (UIImage *)decodedImageWithData:(NSData *)data { - if (!data) { - return nil; - } - - UIImage *image = [[UIImage alloc] initWithData:data]; - -#if SD_MAC - return image; -#else - if (!image) { - return nil; - } - - SDImageFormat format = [NSData sd_imageFormatForImageData:data]; - if (format == SDImageFormatGIF) { - // static single GIF need to be created animated for `FLAnimatedImage` logic - // GIF does not support EXIF image orientation - image = [UIImage animatedImageWithImages:@[image] duration:image.duration]; - return image; - } - UIImageOrientation orientation = [[self class] sd_imageOrientationFromImageData:data]; - if (orientation != UIImageOrientationUp) { - image = [UIImage imageWithCGImage:image.CGImage - scale:image.scale - orientation:orientation]; - } - - return image; -#endif -} - -- (UIImage *)incrementallyDecodedImageWithData:(NSData *)data finished:(BOOL)finished { - if (!_imageSource) { - _imageSource = CGImageSourceCreateIncremental(NULL); - } - UIImage *image; - - // The following code is from http://www.cocoaintheshell.com/2011/05/progressive-images-download-imageio/ - // Thanks to the author @Nyx0uf - - // Update the data source, we must pass ALL the data, not just the new bytes - CGImageSourceUpdateData(_imageSource, (__bridge CFDataRef)data, finished); - - if (_width + _height == 0) { - CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(_imageSource, 0, NULL); - if (properties) { - NSInteger orientationValue = 1; - CFTypeRef val = CFDictionaryGetValue(properties, kCGImagePropertyPixelHeight); - if (val) CFNumberGetValue(val, kCFNumberLongType, &_height); - val = CFDictionaryGetValue(properties, kCGImagePropertyPixelWidth); - if (val) CFNumberGetValue(val, kCFNumberLongType, &_width); - val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); - if (val) CFNumberGetValue(val, kCFNumberNSIntegerType, &orientationValue); - CFRelease(properties); - - // When we draw to Core Graphics, we lose orientation information, - // which means the image below born of initWithCGIImage will be - // oriented incorrectly sometimes. (Unlike the image born of initWithData - // in didCompleteWithError.) So save it here and pass it on later. -#if SD_UIKIT || SD_WATCH - _orientation = [SDWebImageCoderHelper imageOrientationFromEXIFOrientation:orientationValue]; -#endif - } - } - - if (_width + _height > 0) { - // Create the image - CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(_imageSource, 0, NULL); - -#if SD_UIKIT || SD_WATCH - // Workaround for iOS anamorphic image - if (partialImageRef) { - const size_t partialHeight = CGImageGetHeight(partialImageRef); - CGColorSpaceRef colorSpace = SDCGColorSpaceGetDeviceRGB(); - CGContextRef bmContext = CGBitmapContextCreate(NULL, _width, _height, 8, 0, colorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); - if (bmContext) { - CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = _width, .size.height = partialHeight}, partialImageRef); - CGImageRelease(partialImageRef); - partialImageRef = CGBitmapContextCreateImage(bmContext); - CGContextRelease(bmContext); - } - else { - CGImageRelease(partialImageRef); - partialImageRef = nil; - } - } -#endif - - if (partialImageRef) { -#if SD_UIKIT || SD_WATCH - image = [UIImage imageWithCGImage:partialImageRef scale:1 orientation:_orientation]; -#elif SD_MAC - image = [[UIImage alloc] initWithCGImage:partialImageRef size:NSZeroSize]; -#endif - CGImageRelease(partialImageRef); - } - } - - if (finished) { - if (_imageSource) { - CFRelease(_imageSource); - _imageSource = NULL; - } - } - - return image; -} - -- (UIImage *)decompressedImageWithImage:(UIImage *)image - data:(NSData *__autoreleasing _Nullable *)data - options:(nullable NSDictionary*)optionsDict { -#if SD_MAC - return image; -#endif -#if SD_UIKIT || SD_WATCH - BOOL shouldScaleDown = NO; - if (optionsDict != nil) { - NSNumber *scaleDownLargeImagesOption = nil; - if ([optionsDict[SDWebImageCoderScaleDownLargeImagesKey] isKindOfClass:[NSNumber class]]) { - scaleDownLargeImagesOption = (NSNumber *)optionsDict[SDWebImageCoderScaleDownLargeImagesKey]; - } - if (scaleDownLargeImagesOption != nil) { - shouldScaleDown = [scaleDownLargeImagesOption boolValue]; - } - } - if (!shouldScaleDown) { - return [self sd_decompressedImageWithImage:image]; - } else { - UIImage *scaledDownImage = [self sd_decompressedAndScaledDownImageWithImage:image]; - if (scaledDownImage && !CGSizeEqualToSize(scaledDownImage.size, image.size)) { - // if the image is scaled down, need to modify the data pointer as well - SDImageFormat format = [NSData sd_imageFormatForImageData:*data]; - NSData *imageData = [self encodedDataWithImage:scaledDownImage format:format]; - if (imageData) { - *data = imageData; - } - } - return scaledDownImage; - } -#endif -} - -#if SD_UIKIT || SD_WATCH -- (nullable UIImage *)sd_decompressedImageWithImage:(nullable UIImage *)image { - if (![[self class] shouldDecodeImage:image]) { - return image; - } - - // autorelease the bitmap context and all vars to help system to free memory when there are memory warning. - // on iOS7, do not forget to call [[SDImageCache sharedImageCache] clearMemory]; - @autoreleasepool{ - - CGImageRef imageRef = image.CGImage; - CGColorSpaceRef colorspaceRef = [[self class] colorSpaceForImageRef:imageRef]; - - size_t width = CGImageGetWidth(imageRef); - size_t height = CGImageGetHeight(imageRef); - - // kCGImageAlphaNone is not supported in CGBitmapContextCreate. - // Since the original image here has no alpha info, use kCGImageAlphaNoneSkipLast - // to create bitmap graphics contexts without alpha info. - CGContextRef context = CGBitmapContextCreate(NULL, - width, - height, - kBitsPerComponent, - 0, - colorspaceRef, - kCGBitmapByteOrderDefault|kCGImageAlphaNoneSkipLast); - if (context == NULL) { - return image; - } - - // Draw the image into the context and retrieve the new bitmap image without alpha - CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); - CGImageRef imageRefWithoutAlpha = CGBitmapContextCreateImage(context); - UIImage *imageWithoutAlpha = [UIImage imageWithCGImage:imageRefWithoutAlpha - scale:image.scale - orientation:image.imageOrientation]; - - CGContextRelease(context); - CGImageRelease(imageRefWithoutAlpha); - - return imageWithoutAlpha; - } -} - -- (nullable UIImage *)sd_decompressedAndScaledDownImageWithImage:(nullable UIImage *)image { - if (![[self class] shouldDecodeImage:image]) { - return image; - } - - if (![[self class] shouldScaleDownImage:image]) { - return [self sd_decompressedImageWithImage:image]; - } - - CGContextRef destContext; - - // autorelease the bitmap context and all vars to help system to free memory when there are memory warning. - // on iOS7, do not forget to call [[SDImageCache sharedImageCache] clearMemory]; - @autoreleasepool { - CGImageRef sourceImageRef = image.CGImage; - - CGSize sourceResolution = CGSizeZero; - sourceResolution.width = CGImageGetWidth(sourceImageRef); - sourceResolution.height = CGImageGetHeight(sourceImageRef); - float sourceTotalPixels = sourceResolution.width * sourceResolution.height; - // Determine the scale ratio to apply to the input image - // that results in an output image of the defined size. - // see kDestImageSizeMB, and how it relates to destTotalPixels. - float imageScale = kDestTotalPixels / sourceTotalPixels; - CGSize destResolution = CGSizeZero; - destResolution.width = (int)(sourceResolution.width*imageScale); - destResolution.height = (int)(sourceResolution.height*imageScale); - - // current color space - CGColorSpaceRef colorspaceRef = [[self class] colorSpaceForImageRef:sourceImageRef]; - - // kCGImageAlphaNone is not supported in CGBitmapContextCreate. - // Since the original image here has no alpha info, use kCGImageAlphaNoneSkipLast - // to create bitmap graphics contexts without alpha info. - destContext = CGBitmapContextCreate(NULL, - destResolution.width, - destResolution.height, - kBitsPerComponent, - 0, - colorspaceRef, - kCGBitmapByteOrderDefault|kCGImageAlphaNoneSkipLast); - - if (destContext == NULL) { - return image; - } - CGContextSetInterpolationQuality(destContext, kCGInterpolationHigh); - - // Now define the size of the rectangle to be used for the - // incremental blits from the input image to the output image. - // we use a source tile width equal to the width of the source - // image due to the way that iOS retrieves image data from disk. - // iOS must decode an image from disk in full width 'bands', even - // if current graphics context is clipped to a subrect within that - // band. Therefore we fully utilize all of the pixel data that results - // from a decoding opertion by achnoring our tile size to the full - // width of the input image. - CGRect sourceTile = CGRectZero; - sourceTile.size.width = sourceResolution.width; - // The source tile height is dynamic. Since we specified the size - // of the source tile in MB, see how many rows of pixels high it - // can be given the input image width. - sourceTile.size.height = (int)(kTileTotalPixels / sourceTile.size.width ); - sourceTile.origin.x = 0.0f; - // The output tile is the same proportions as the input tile, but - // scaled to image scale. - CGRect destTile; - destTile.size.width = destResolution.width; - destTile.size.height = sourceTile.size.height * imageScale; - destTile.origin.x = 0.0f; - // The source seem overlap is proportionate to the destination seem overlap. - // this is the amount of pixels to overlap each tile as we assemble the ouput image. - float sourceSeemOverlap = (int)((kDestSeemOverlap/destResolution.height)*sourceResolution.height); - CGImageRef sourceTileImageRef; - // calculate the number of read/write operations required to assemble the - // output image. - int iterations = (int)( sourceResolution.height / sourceTile.size.height ); - // If tile height doesn't divide the image height evenly, add another iteration - // to account for the remaining pixels. - int remainder = (int)sourceResolution.height % (int)sourceTile.size.height; - if(remainder) { - iterations++; - } - // Add seem overlaps to the tiles, but save the original tile height for y coordinate calculations. - float sourceTileHeightMinusOverlap = sourceTile.size.height; - sourceTile.size.height += sourceSeemOverlap; - destTile.size.height += kDestSeemOverlap; - for( int y = 0; y < iterations; ++y ) { - @autoreleasepool { - sourceTile.origin.y = y * sourceTileHeightMinusOverlap + sourceSeemOverlap; - destTile.origin.y = destResolution.height - (( y + 1 ) * sourceTileHeightMinusOverlap * imageScale + kDestSeemOverlap); - sourceTileImageRef = CGImageCreateWithImageInRect( sourceImageRef, sourceTile ); - if( y == iterations - 1 && remainder ) { - float dify = destTile.size.height; - destTile.size.height = CGImageGetHeight( sourceTileImageRef ) * imageScale; - dify -= destTile.size.height; - destTile.origin.y += dify; - } - CGContextDrawImage( destContext, destTile, sourceTileImageRef ); - CGImageRelease( sourceTileImageRef ); - } - } - - CGImageRef destImageRef = CGBitmapContextCreateImage(destContext); - CGContextRelease(destContext); - if (destImageRef == NULL) { - return image; - } - UIImage *destImage = [UIImage imageWithCGImage:destImageRef scale:image.scale orientation:image.imageOrientation]; - CGImageRelease(destImageRef); - if (destImage == nil) { - return image; - } - return destImage; - } -} -#endif - -#pragma mark - Encode -- (BOOL)canEncodeToFormat:(SDImageFormat)format { - switch (format) { - case SDImageFormatWebP: - // Do not support WebP encoding - return NO; - case SDImageFormatHEIC: - // Check HEIC encoding compatibility - return [[self class] canEncodeToHEICFormat]; - default: - return YES; - } -} - -- (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format { - if (!image) { - return nil; - } - - if (format == SDImageFormatUndefined) { - BOOL hasAlpha = SDCGImageRefContainsAlpha(image.CGImage); - if (hasAlpha) { - format = SDImageFormatPNG; - } else { - format = SDImageFormatJPEG; - } - } - - NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:format]; - - // Create an image destination. - CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, 1, NULL); - if (!imageDestination) { - // Handle failure. - return nil; - } - - NSMutableDictionary *properties = [NSMutableDictionary dictionary]; -#if SD_UIKIT || SD_WATCH - NSInteger exifOrientation = [SDWebImageCoderHelper exifOrientationFromImageOrientation:image.imageOrientation]; - [properties setValue:@(exifOrientation) forKey:(__bridge_transfer NSString *)kCGImagePropertyOrientation]; -#endif - - // Add your image to the destination. - CGImageDestinationAddImage(imageDestination, image.CGImage, (__bridge CFDictionaryRef)properties); - - // Finalize the destination. - if (CGImageDestinationFinalize(imageDestination) == NO) { - // Handle failure. - imageData = nil; - } - - CFRelease(imageDestination); - - return [imageData copy]; -} - -#pragma mark - Helper -+ (BOOL)shouldDecodeImage:(nullable UIImage *)image { - // Prevent "CGBitmapContextCreateImage: invalid context 0x0" error - if (image == nil) { - return NO; - } - - // do not decode animated images - if (image.images != nil) { - return NO; - } - - CGImageRef imageRef = image.CGImage; - - BOOL hasAlpha = SDCGImageRefContainsAlpha(imageRef); - // do not decode images with alpha - if (hasAlpha) { - return NO; - } - - return YES; -} - -+ (BOOL)canDecodeFromHEICFormat { - static BOOL canDecode = NO; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ -#if TARGET_OS_SIMULATOR || SD_WATCH - canDecode = NO; -#elif SD_MAC - NSProcessInfo *processInfo = [NSProcessInfo processInfo]; - if ([processInfo respondsToSelector:@selector(operatingSystemVersion)]) { - // macOS 10.13+ - canDecode = processInfo.operatingSystemVersion.minorVersion >= 13; - } else { - canDecode = NO; - } -#elif SD_UIKIT - NSProcessInfo *processInfo = [NSProcessInfo processInfo]; - if ([processInfo respondsToSelector:@selector(operatingSystemVersion)]) { - // iOS 11+ && tvOS 11+ - canDecode = processInfo.operatingSystemVersion.majorVersion >= 11; - } else { - canDecode = NO; - } -#endif - }); - return canDecode; -} - -+ (BOOL)canEncodeToHEICFormat { - static BOOL canEncode = NO; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatHEIC]; - - // Create an image destination. - CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, 1, NULL); - if (!imageDestination) { - // Can't encode to HEIC - canEncode = NO; - } else { - // Can encode to HEIC - CFRelease(imageDestination); - canEncode = YES; - } - }); - return canEncode; -} - -#if SD_UIKIT || SD_WATCH -#pragma mark EXIF orientation tag converter -+ (UIImageOrientation)sd_imageOrientationFromImageData:(nonnull NSData *)imageData { - UIImageOrientation result = UIImageOrientationUp; - CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); - if (imageSource) { - CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); - if (properties) { - CFTypeRef val; - NSInteger exifOrientation; - val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); - if (val) { - CFNumberGetValue(val, kCFNumberNSIntegerType, &exifOrientation); - result = [SDWebImageCoderHelper imageOrientationFromEXIFOrientation:exifOrientation]; - } // else - if it's not set it remains at up - CFRelease((CFTypeRef) properties); - } else { - //NSLog(@"NO PROPERTIES, FAIL"); - } - CFRelease(imageSource); - } - return result; -} -#endif - -#if SD_UIKIT || SD_WATCH -+ (BOOL)shouldScaleDownImage:(nonnull UIImage *)image { - BOOL shouldScaleDown = YES; - - CGImageRef sourceImageRef = image.CGImage; - CGSize sourceResolution = CGSizeZero; - sourceResolution.width = CGImageGetWidth(sourceImageRef); - sourceResolution.height = CGImageGetHeight(sourceImageRef); - float sourceTotalPixels = sourceResolution.width * sourceResolution.height; - float imageScale = kDestTotalPixels / sourceTotalPixels; - if (imageScale < 1) { - shouldScaleDown = YES; - } else { - shouldScaleDown = NO; - } - - return shouldScaleDown; -} - -+ (CGColorSpaceRef)colorSpaceForImageRef:(CGImageRef)imageRef { - // current - CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(CGImageGetColorSpace(imageRef)); - CGColorSpaceRef colorspaceRef = CGImageGetColorSpace(imageRef); - - BOOL unsupportedColorSpace = (imageColorSpaceModel == kCGColorSpaceModelUnknown || - imageColorSpaceModel == kCGColorSpaceModelMonochrome || - imageColorSpaceModel == kCGColorSpaceModelCMYK || - imageColorSpaceModel == kCGColorSpaceModelIndexed); - if (unsupportedColorSpace) { - colorspaceRef = SDCGColorSpaceGetDeviceRGB(); - } - return colorspaceRef; -} -#endif - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageManager.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageManager.h deleted file mode 100644 index ba8b7555..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageManager.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" -#import "SDWebImageOperation.h" -#import "SDWebImageDownloader.h" -#import "SDImageCache.h" - -typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) { - /** - * By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying. - * This flag disable this blacklisting. - */ - SDWebImageRetryFailed = 1 << 0, - - /** - * By default, image downloads are started during UI interactions, this flags disable this feature, - * leading to delayed download on UIScrollView deceleration for instance. - */ - SDWebImageLowPriority = 1 << 1, - - /** - * This flag disables on-disk caching - */ - SDWebImageCacheMemoryOnly = 1 << 2, - - /** - * This flag enables progressive download, the image is displayed progressively during download as a browser would do. - * By default, the image is only displayed once completely downloaded. - */ - SDWebImageProgressiveDownload = 1 << 3, - - /** - * Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed. - * The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation. - * This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics. - * If a cached image is refreshed, the completion block is called once with the cached image and again with the final image. - * - * Use this flag only if you can't make your URLs static with embedded cache busting parameter. - */ - SDWebImageRefreshCached = 1 << 4, - - /** - * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for - * extra time in background to let the request finish. If the background task expires the operation will be cancelled. - */ - SDWebImageContinueInBackground = 1 << 5, - - /** - * Handles cookies stored in NSHTTPCookieStore by setting - * NSMutableURLRequest.HTTPShouldHandleCookies = YES; - */ - SDWebImageHandleCookies = 1 << 6, - - /** - * Enable to allow untrusted SSL certificates. - * Useful for testing purposes. Use with caution in production. - */ - SDWebImageAllowInvalidSSLCertificates = 1 << 7, - - /** - * By default, images are loaded in the order in which they were queued. This flag moves them to - * the front of the queue. - */ - SDWebImageHighPriority = 1 << 8, - - /** - * By default, placeholder images are loaded while the image is loading. This flag will delay the loading - * of the placeholder image until after the image has finished loading. - */ - SDWebImageDelayPlaceholder = 1 << 9, - - /** - * We usually don't call transformDownloadedImage delegate method on animated images, - * as most transformation code would mangle it. - * Use this flag to transform them anyway. - */ - SDWebImageTransformAnimatedImage = 1 << 10, - - /** - * By default, image is added to the imageView after download. But in some cases, we want to - * have the hand before setting the image (apply a filter or add it with cross-fade animation for instance) - * Use this flag if you want to manually set the image in the completion when success - */ - SDWebImageAvoidAutoSetImage = 1 << 11, - - /** - * By default, images are decoded respecting their original size. On iOS, this flag will scale down the - * images to a size compatible with the constrained memory of devices. - * If `SDWebImageProgressiveDownload` flag is set the scale down is deactivated. - */ - SDWebImageScaleDownLargeImages = 1 << 12 -}; - -typedef void(^SDExternalCompletionBlock)(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL); - -typedef void(^SDInternalCompletionBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL); - -typedef NSString * _Nullable (^SDWebImageCacheKeyFilterBlock)(NSURL * _Nullable url); - - -@class SDWebImageManager; - -@protocol SDWebImageManagerDelegate - -@optional - -/** - * Controls which image should be downloaded when the image is not found in the cache. - * - * @param imageManager The current `SDWebImageManager` - * @param imageURL The url of the image to be downloaded - * - * @return Return NO to prevent the downloading of the image on cache misses. If not implemented, YES is implied. - */ -- (BOOL)imageManager:(nonnull SDWebImageManager *)imageManager shouldDownloadImageForURL:(nullable NSURL *)imageURL; - -/** - * Allows to transform the image immediately after it has been downloaded and just before to cache it on disk and memory. - * NOTE: This method is called from a global queue in order to not to block the main thread. - * - * @param imageManager The current `SDWebImageManager` - * @param image The image to transform - * @param imageURL The url of the image to transform - * - * @return The transformed image object. - */ -- (nullable UIImage *)imageManager:(nonnull SDWebImageManager *)imageManager transformDownloadedImage:(nullable UIImage *)image withURL:(nullable NSURL *)imageURL; - -@end - -/** - * The SDWebImageManager is the class behind the UIImageView+WebCache category and likes. - * It ties the asynchronous downloader (SDWebImageDownloader) with the image cache store (SDImageCache). - * You can use this class directly to benefit from web image downloading with caching in another context than - * a UIView. - * - * Here is a simple example of how to use SDWebImageManager: - * - * @code - -SDWebImageManager *manager = [SDWebImageManager sharedManager]; -[manager loadImageWithURL:imageURL - options:0 - progress:nil - completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { - if (image) { - // do something with image - } - }]; - - * @endcode - */ -@interface SDWebImageManager : NSObject - -@property (weak, nonatomic, nullable) id delegate; - -@property (strong, nonatomic, readonly, nullable) SDImageCache *imageCache; -@property (strong, nonatomic, readonly, nullable) SDWebImageDownloader *imageDownloader; - -/** - * The cache filter is a block used each time SDWebImageManager need to convert an URL into a cache key. This can - * be used to remove dynamic part of an image URL. - * - * The following example sets a filter in the application delegate that will remove any query-string from the - * URL before to use it as a cache key: - * - * @code - -[[SDWebImageManager sharedManager] setCacheKeyFilter:^(NSURL *url) { - url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path]; - return [url absoluteString]; -}]; - - * @endcode - */ -@property (nonatomic, copy, nullable) SDWebImageCacheKeyFilterBlock cacheKeyFilter; - -/** - * Returns global SDWebImageManager instance. - * - * @return SDWebImageManager shared instance - */ -+ (nonnull instancetype)sharedManager; - -/** - * Allows to specify instance of cache and image downloader used with image manager. - * @return new instance of `SDWebImageManager` with specified cache and downloader. - */ -- (nonnull instancetype)initWithCache:(nonnull SDImageCache *)cache downloader:(nonnull SDWebImageDownloader *)downloader NS_DESIGNATED_INITIALIZER; - -/** - * Downloads the image at the given URL if not present in cache or return the cached version otherwise. - * - * @param url The URL to the image - * @param options A mask to specify options to use for this request - * @param progressBlock A block called while image is downloading - * @note the progress block is executed on a background queue - * @param completedBlock A block called when operation has been completed. - * - * This parameter is required. - * - * This block has no return value and takes the requested UIImage as first parameter and the NSData representation as second parameter. - * In case of error the image parameter is nil and the third parameter may contain an NSError. - * - * The forth parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache - * or from the memory cache or from the network. - * - * The fith parameter is set to NO when the SDWebImageProgressiveDownload option is used and the image is - * downloading. This block is thus called repeatedly with a partial image. When image is fully downloaded, the - * block is called a last time with the full image and the last parameter set to YES. - * - * The last parameter is the original image URL - * - * @return Returns an NSObject conforming to SDWebImageOperation. Should be an instance of SDWebImageDownloaderOperation - */ -- (nullable id )loadImageWithURL:(nullable NSURL *)url - options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDInternalCompletionBlock)completedBlock; - -/** - * Saves image to cache for given URL - * - * @param image The image to cache - * @param url The URL to the image - * - */ - -- (void)saveImageToCache:(nullable UIImage *)image forURL:(nullable NSURL *)url; - -/** - * Cancel all current operations - */ -- (void)cancelAll; - -/** - * Check one or more operations running - */ -- (BOOL)isRunning; - -/** - * Async check if image has already been cached - * - * @param url image url - * @param completionBlock the block to be executed when the check is finished - * - * @note the completion block is always executed on the main queue - */ -- (void)cachedImageExistsForURL:(nullable NSURL *)url - completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; - -/** - * Async check if image has already been cached on disk only - * - * @param url image url - * @param completionBlock the block to be executed when the check is finished - * - * @note the completion block is always executed on the main queue - */ -- (void)diskImageExistsForURL:(nullable NSURL *)url - completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; - - -/** - *Return the cache key for a given URL - */ -- (nullable NSString *)cacheKeyForURL:(nullable NSURL *)url; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageManager.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageManager.m deleted file mode 100644 index e1e7e575..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageManager.m +++ /dev/null @@ -1,347 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageManager.h" -#import "NSImage+WebCache.h" -#import - -@interface SDWebImageCombinedOperation : NSObject - -@property (assign, nonatomic, getter = isCancelled) BOOL cancelled; -@property (copy, nonatomic, nullable) SDWebImageNoParamsBlock cancelBlock; -@property (strong, nonatomic, nullable) NSOperation *cacheOperation; - -@end - -@interface SDWebImageManager () - -@property (strong, nonatomic, readwrite, nonnull) SDImageCache *imageCache; -@property (strong, nonatomic, readwrite, nonnull) SDWebImageDownloader *imageDownloader; -@property (strong, nonatomic, nonnull) NSMutableSet *failedURLs; -@property (strong, nonatomic, nonnull) NSMutableArray *runningOperations; - -@end - -@implementation SDWebImageManager - -+ (nonnull instancetype)sharedManager { - static dispatch_once_t once; - static id instance; - dispatch_once(&once, ^{ - instance = [self new]; - }); - return instance; -} - -- (nonnull instancetype)init { - SDImageCache *cache = [SDImageCache sharedImageCache]; - SDWebImageDownloader *downloader = [SDWebImageDownloader sharedDownloader]; - return [self initWithCache:cache downloader:downloader]; -} - -- (nonnull instancetype)initWithCache:(nonnull SDImageCache *)cache downloader:(nonnull SDWebImageDownloader *)downloader { - if ((self = [super init])) { - _imageCache = cache; - _imageDownloader = downloader; - _failedURLs = [NSMutableSet new]; - _runningOperations = [NSMutableArray new]; - } - return self; -} - -- (nullable NSString *)cacheKeyForURL:(nullable NSURL *)url { - if (!url) { - return @""; - } - - if (self.cacheKeyFilter) { - return self.cacheKeyFilter(url); - } else { - return url.absoluteString; - } -} - -- (nullable UIImage *)scaledImageForKey:(nullable NSString *)key image:(nullable UIImage *)image { - return SDScaledImageForKey(key, image); -} - -- (void)cachedImageExistsForURL:(nullable NSURL *)url - completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock { - NSString *key = [self cacheKeyForURL:url]; - - BOOL isInMemoryCache = ([self.imageCache imageFromMemoryCacheForKey:key] != nil); - - if (isInMemoryCache) { - // making sure we call the completion block on the main queue - dispatch_async(dispatch_get_main_queue(), ^{ - if (completionBlock) { - completionBlock(YES); - } - }); - return; - } - - [self.imageCache diskImageExistsWithKey:key completion:^(BOOL isInDiskCache) { - // the completion block of checkDiskCacheForImageWithKey:completion: is always called on the main queue, no need to further dispatch - if (completionBlock) { - completionBlock(isInDiskCache); - } - }]; -} - -- (void)diskImageExistsForURL:(nullable NSURL *)url - completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock { - NSString *key = [self cacheKeyForURL:url]; - - [self.imageCache diskImageExistsWithKey:key completion:^(BOOL isInDiskCache) { - // the completion block of checkDiskCacheForImageWithKey:completion: is always called on the main queue, no need to further dispatch - if (completionBlock) { - completionBlock(isInDiskCache); - } - }]; -} - -- (id )loadImageWithURL:(nullable NSURL *)url - options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDInternalCompletionBlock)completedBlock { - // Invoking this method without a completedBlock is pointless - NSAssert(completedBlock != nil, @"If you mean to prefetch the image, use -[SDWebImagePrefetcher prefetchURLs] instead"); - - // Very common mistake is to send the URL using NSString object instead of NSURL. For some strange reason, Xcode won't - // throw any warning for this type mismatch. Here we failsafe this error by allowing URLs to be passed as NSString. - if ([url isKindOfClass:NSString.class]) { - url = [NSURL URLWithString:(NSString *)url]; - } - - // Prevents app crashing on argument type error like sending NSNull instead of NSURL - if (![url isKindOfClass:NSURL.class]) { - url = nil; - } - - __block SDWebImageCombinedOperation *operation = [SDWebImageCombinedOperation new]; - __weak SDWebImageCombinedOperation *weakOperation = operation; - - BOOL isFailedUrl = NO; - if (url) { - @synchronized (self.failedURLs) { - isFailedUrl = [self.failedURLs containsObject:url]; - } - } - - if (url.absoluteString.length == 0 || (!(options & SDWebImageRetryFailed) && isFailedUrl)) { - [self callCompletionBlockForOperation:operation completion:completedBlock error:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist userInfo:nil] url:url]; - return operation; - } - - @synchronized (self.runningOperations) { - [self.runningOperations addObject:operation]; - } - NSString *key = [self cacheKeyForURL:url]; - - operation.cacheOperation = [self.imageCache queryCacheOperationForKey:key done:^(UIImage *cachedImage, NSData *cachedData, SDImageCacheType cacheType) { - if (operation.isCancelled) { - [self safelyRemoveOperationFromRunning:operation]; - return; - } - - if ((!cachedImage || options & SDWebImageRefreshCached) && (![self.delegate respondsToSelector:@selector(imageManager:shouldDownloadImageForURL:)] || [self.delegate imageManager:self shouldDownloadImageForURL:url])) { - if (cachedImage && options & SDWebImageRefreshCached) { - // If image was found in the cache but SDWebImageRefreshCached is provided, notify about the cached image - // AND try to re-download it in order to let a chance to NSURLCache to refresh it from server. - [self callCompletionBlockForOperation:weakOperation completion:completedBlock image:cachedImage data:cachedData error:nil cacheType:cacheType finished:YES url:url]; - } - - // download if no image or requested to refresh anyway, and download allowed by delegate - SDWebImageDownloaderOptions downloaderOptions = 0; - if (options & SDWebImageLowPriority) downloaderOptions |= SDWebImageDownloaderLowPriority; - if (options & SDWebImageProgressiveDownload) downloaderOptions |= SDWebImageDownloaderProgressiveDownload; - if (options & SDWebImageRefreshCached) downloaderOptions |= SDWebImageDownloaderUseNSURLCache; - if (options & SDWebImageContinueInBackground) downloaderOptions |= SDWebImageDownloaderContinueInBackground; - if (options & SDWebImageHandleCookies) downloaderOptions |= SDWebImageDownloaderHandleCookies; - if (options & SDWebImageAllowInvalidSSLCertificates) downloaderOptions |= SDWebImageDownloaderAllowInvalidSSLCertificates; - if (options & SDWebImageHighPriority) downloaderOptions |= SDWebImageDownloaderHighPriority; - if (options & SDWebImageScaleDownLargeImages) downloaderOptions |= SDWebImageDownloaderScaleDownLargeImages; - - if (cachedImage && options & SDWebImageRefreshCached) { - // force progressive off if image already cached but forced refreshing - downloaderOptions &= ~SDWebImageDownloaderProgressiveDownload; - // ignore image read from NSURLCache if image if cached but force refreshing - downloaderOptions |= SDWebImageDownloaderIgnoreCachedResponse; - } - - SDWebImageDownloadToken *subOperationToken = [self.imageDownloader downloadImageWithURL:url options:downloaderOptions progress:progressBlock completed:^(UIImage *downloadedImage, NSData *downloadedData, NSError *error, BOOL finished) { - __strong __typeof(weakOperation) strongOperation = weakOperation; - if (!strongOperation || strongOperation.isCancelled) { - // Do nothing if the operation was cancelled - // See #699 for more details - // if we would call the completedBlock, there could be a race condition between this block and another completedBlock for the same object, so if this one is called second, we will overwrite the new data - } else if (error) { - [self callCompletionBlockForOperation:strongOperation completion:completedBlock error:error url:url]; - - if ( error.code != NSURLErrorNotConnectedToInternet - && error.code != NSURLErrorCancelled - && error.code != NSURLErrorTimedOut - && error.code != NSURLErrorInternationalRoamingOff - && error.code != NSURLErrorDataNotAllowed - && error.code != NSURLErrorCannotFindHost - && error.code != NSURLErrorCannotConnectToHost - && error.code != NSURLErrorNetworkConnectionLost) { - @synchronized (self.failedURLs) { - [self.failedURLs addObject:url]; - } - } - } - else { - if ((options & SDWebImageRetryFailed)) { - @synchronized (self.failedURLs) { - [self.failedURLs removeObject:url]; - } - } - - BOOL cacheOnDisk = !(options & SDWebImageCacheMemoryOnly); - - // We've done the scale process in SDWebImageDownloader with the shared manager, this is used for custom manager and avoid extra scale. - if (self != [SDWebImageManager sharedManager] && self.cacheKeyFilter && downloadedImage) { - downloadedImage = [self scaledImageForKey:key image:downloadedImage]; - } - - if (options & SDWebImageRefreshCached && cachedImage && !downloadedImage) { - // Image refresh hit the NSURLCache cache, do not call the completion block - } else if (downloadedImage && (!downloadedImage.images || (options & SDWebImageTransformAnimatedImage)) && [self.delegate respondsToSelector:@selector(imageManager:transformDownloadedImage:withURL:)]) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ - UIImage *transformedImage = [self.delegate imageManager:self transformDownloadedImage:downloadedImage withURL:url]; - - if (transformedImage && finished) { - BOOL imageWasTransformed = ![transformedImage isEqual:downloadedImage]; - // pass nil if the image was transformed, so we can recalculate the data from the image - [self.imageCache storeImage:transformedImage imageData:(imageWasTransformed ? nil : downloadedData) forKey:key toDisk:cacheOnDisk completion:nil]; - } - - [self callCompletionBlockForOperation:strongOperation completion:completedBlock image:transformedImage data:downloadedData error:nil cacheType:SDImageCacheTypeNone finished:finished url:url]; - }); - } else { - if (downloadedImage && finished) { - [self.imageCache storeImage:downloadedImage imageData:downloadedData forKey:key toDisk:cacheOnDisk completion:nil]; - } - [self callCompletionBlockForOperation:strongOperation completion:completedBlock image:downloadedImage data:downloadedData error:nil cacheType:SDImageCacheTypeNone finished:finished url:url]; - } - } - - if (finished) { - [self safelyRemoveOperationFromRunning:strongOperation]; - } - }]; - @synchronized(operation) { - // Need same lock to ensure cancelBlock called because cancel method can be called in different queue - operation.cancelBlock = ^{ - [self.imageDownloader cancel:subOperationToken]; - __strong __typeof(weakOperation) strongOperation = weakOperation; - [self safelyRemoveOperationFromRunning:strongOperation]; - }; - } - } else if (cachedImage) { - __strong __typeof(weakOperation) strongOperation = weakOperation; - [self callCompletionBlockForOperation:strongOperation completion:completedBlock image:cachedImage data:cachedData error:nil cacheType:cacheType finished:YES url:url]; - [self safelyRemoveOperationFromRunning:operation]; - } else { - // Image not in cache and download disallowed by delegate - __strong __typeof(weakOperation) strongOperation = weakOperation; - [self callCompletionBlockForOperation:strongOperation completion:completedBlock image:nil data:nil error:nil cacheType:SDImageCacheTypeNone finished:YES url:url]; - [self safelyRemoveOperationFromRunning:operation]; - } - }]; - - return operation; -} - -- (void)saveImageToCache:(nullable UIImage *)image forURL:(nullable NSURL *)url { - if (image && url) { - NSString *key = [self cacheKeyForURL:url]; - [self.imageCache storeImage:image forKey:key toDisk:YES completion:nil]; - } -} - -- (void)cancelAll { - @synchronized (self.runningOperations) { - NSArray *copiedOperations = [self.runningOperations copy]; - [copiedOperations makeObjectsPerformSelector:@selector(cancel)]; - [self.runningOperations removeObjectsInArray:copiedOperations]; - } -} - -- (BOOL)isRunning { - BOOL isRunning = NO; - @synchronized (self.runningOperations) { - isRunning = (self.runningOperations.count > 0); - } - return isRunning; -} - -- (void)safelyRemoveOperationFromRunning:(nullable SDWebImageCombinedOperation*)operation { - @synchronized (self.runningOperations) { - if (operation) { - [self.runningOperations removeObject:operation]; - } - } -} - -- (void)callCompletionBlockForOperation:(nullable SDWebImageCombinedOperation*)operation - completion:(nullable SDInternalCompletionBlock)completionBlock - error:(nullable NSError *)error - url:(nullable NSURL *)url { - [self callCompletionBlockForOperation:operation completion:completionBlock image:nil data:nil error:error cacheType:SDImageCacheTypeNone finished:YES url:url]; -} - -- (void)callCompletionBlockForOperation:(nullable SDWebImageCombinedOperation*)operation - completion:(nullable SDInternalCompletionBlock)completionBlock - image:(nullable UIImage *)image - data:(nullable NSData *)data - error:(nullable NSError *)error - cacheType:(SDImageCacheType)cacheType - finished:(BOOL)finished - url:(nullable NSURL *)url { - dispatch_main_async_safe(^{ - if (operation && !operation.isCancelled && completionBlock) { - completionBlock(image, data, error, cacheType, finished, url); - } - }); -} - -@end - - -@implementation SDWebImageCombinedOperation - -- (void)setCancelBlock:(nullable SDWebImageNoParamsBlock)cancelBlock { - // check if the operation is already cancelled, then we just call the cancelBlock - if (self.isCancelled) { - if (cancelBlock) { - cancelBlock(); - } - _cancelBlock = nil; // don't forget to nil the cancelBlock, otherwise we will get crashes - } else { - _cancelBlock = [cancelBlock copy]; - } -} - -- (void)cancel { - @synchronized(self) { - self.cancelled = YES; - if (self.cacheOperation) { - [self.cacheOperation cancel]; - self.cacheOperation = nil; - } - if (self.cancelBlock) { - self.cancelBlock(); - self.cancelBlock = nil; - } - } -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h deleted file mode 100644 index 71094ee3..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import - -@protocol SDWebImageOperation - -- (void)cancel; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h deleted file mode 100644 index 93357f4e..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import -#import "SDWebImageManager.h" - -@class SDWebImagePrefetcher; - -@protocol SDWebImagePrefetcherDelegate - -@optional - -/** - * Called when an image was prefetched. - * - * @param imagePrefetcher The current image prefetcher - * @param imageURL The image url that was prefetched - * @param finishedCount The total number of images that were prefetched (successful or not) - * @param totalCount The total number of images that were to be prefetched - */ -- (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; - -/** - * Called when all images are prefetched. - * @param imagePrefetcher The current image prefetcher - * @param totalCount The total number of images that were prefetched (whether successful or not) - * @param skippedCount The total number of images that were skipped - */ -- (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; - -@end - -typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); -typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); - -/** - * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. - */ -@interface SDWebImagePrefetcher : NSObject - -/** - * The web image manager - */ -@property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager; - -/** - * Maximum number of URLs to prefetch at the same time. Defaults to 3. - */ -@property (nonatomic, assign) NSUInteger maxConcurrentDownloads; - -/** - * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. - */ -@property (nonatomic, assign) SDWebImageOptions options; - -/** - * Queue options for Prefetcher. Defaults to Main Queue. - */ -@property (strong, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; - -@property (weak, nonatomic, nullable) id delegate; - -/** - * Return the global image prefetcher instance. - */ -+ (nonnull instancetype)sharedImagePrefetcher; - -/** - * Allows you to instantiate a prefetcher with any arbitrary image manager. - */ -- (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER; - -/** - * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, - * currently one image is downloaded at a time, - * and skips images for failed downloads and proceed to the next image in the list. - * Any previously-running prefetch operations are canceled. - * - * @param urls list of URLs to prefetch - */ -- (void)prefetchURLs:(nullable NSArray *)urls; - -/** - * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, - * currently one image is downloaded at a time, - * and skips images for failed downloads and proceed to the next image in the list. - * Any previously-running prefetch operations are canceled. - * - * @param urls list of URLs to prefetch - * @param progressBlock block to be called when progress updates; - * first parameter is the number of completed (successful or not) requests, - * second parameter is the total number of images originally requested to be prefetched - * @param completionBlock block to be called when prefetching is completed - * first param is the number of completed (successful or not) requests, - * second parameter is the number of skipped requests - */ -- (void)prefetchURLs:(nullable NSArray *)urls - progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock - completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock; - -/** - * Remove and cancel queued list - */ -- (void)cancelPrefetching; - - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m b/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m deleted file mode 100644 index cabf132d..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m +++ /dev/null @@ -1,143 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImagePrefetcher.h" - -@interface SDWebImagePrefetcher () - -@property (strong, nonatomic, nonnull) SDWebImageManager *manager; -@property (strong, atomic, nullable) NSArray *prefetchURLs; // may be accessed from different queue -@property (assign, nonatomic) NSUInteger requestedCount; -@property (assign, nonatomic) NSUInteger skippedCount; -@property (assign, nonatomic) NSUInteger finishedCount; -@property (assign, nonatomic) NSTimeInterval startedTime; -@property (copy, nonatomic, nullable) SDWebImagePrefetcherCompletionBlock completionBlock; -@property (copy, nonatomic, nullable) SDWebImagePrefetcherProgressBlock progressBlock; - -@end - -@implementation SDWebImagePrefetcher - -+ (nonnull instancetype)sharedImagePrefetcher { - static dispatch_once_t once; - static id instance; - dispatch_once(&once, ^{ - instance = [self new]; - }); - return instance; -} - -- (nonnull instancetype)init { - return [self initWithImageManager:[SDWebImageManager new]]; -} - -- (nonnull instancetype)initWithImageManager:(SDWebImageManager *)manager { - if ((self = [super init])) { - _manager = manager; - _options = SDWebImageLowPriority; - _prefetcherQueue = dispatch_get_main_queue(); - self.maxConcurrentDownloads = 3; - } - return self; -} - -- (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { - self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; -} - -- (NSUInteger)maxConcurrentDownloads { - return self.manager.imageDownloader.maxConcurrentDownloads; -} - -- (void)startPrefetchingAtIndex:(NSUInteger)index { - NSURL *currentURL; - @synchronized(self) { - if (index >= self.prefetchURLs.count) return; - currentURL = self.prefetchURLs[index]; - self.requestedCount++; - } - [self.manager loadImageWithURL:currentURL options:self.options progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { - if (!finished) return; - self.finishedCount++; - - if (self.progressBlock) { - self.progressBlock(self.finishedCount,(self.prefetchURLs).count); - } - if (!image) { - // Add last failed - self.skippedCount++; - } - if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { - [self.delegate imagePrefetcher:self - didPrefetchURL:currentURL - finishedCount:self.finishedCount - totalCount:self.prefetchURLs.count - ]; - } - if (self.prefetchURLs.count > self.requestedCount) { - dispatch_queue_async_safe(self.prefetcherQueue, ^{ - [self startPrefetchingAtIndex:self.requestedCount]; - }); - } else if (self.finishedCount == self.requestedCount) { - [self reportStatus]; - if (self.completionBlock) { - self.completionBlock(self.finishedCount, self.skippedCount); - self.completionBlock = nil; - } - self.progressBlock = nil; - } - }]; -} - -- (void)reportStatus { - NSUInteger total = (self.prefetchURLs).count; - if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { - [self.delegate imagePrefetcher:self - didFinishWithTotalCount:(total - self.skippedCount) - skippedCount:self.skippedCount - ]; - } -} - -- (void)prefetchURLs:(nullable NSArray *)urls { - [self prefetchURLs:urls progress:nil completed:nil]; -} - -- (void)prefetchURLs:(nullable NSArray *)urls - progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock - completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock { - [self cancelPrefetching]; // Prevent duplicate prefetch request - self.startedTime = CFAbsoluteTimeGetCurrent(); - self.prefetchURLs = urls; - self.completionBlock = completionBlock; - self.progressBlock = progressBlock; - - if (urls.count == 0) { - if (completionBlock) { - completionBlock(0,0); - } - } else { - // Starts prefetching from the very first image on the list with the max allowed concurrency - NSUInteger listCount = self.prefetchURLs.count; - for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { - [self startPrefetchingAtIndex:i]; - } - } -} - -- (void)cancelPrefetching { - @synchronized(self) { - self.prefetchURLs = nil; - self.skippedCount = 0; - self.requestedCount = 0; - self.finishedCount = 0; - } - [self.manager cancelAll]; -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h b/iOSProject/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h deleted file mode 100644 index b6c4a2a2..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIButton+WebCache.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" - -#if SD_UIKIT - -#import "SDWebImageManager.h" - -/** - * Integrates SDWebImage async downloading and caching of remote images with UIButtonView. - */ -@interface UIButton (WebCache) - -#pragma mark - Image - -/** - * Get the current image URL. - */ -- (nullable NSURL *)sd_currentImageURL; - -/** - * Get the image URL for a control state. - * - * @param state Which state you want to know the URL for. The values are described in UIControlState. - */ -- (nullable NSURL *)sd_imageURLForState:(UIControlState)state; - -/** - * Set the imageView `image` with an `url`. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `image` with an `url` and a placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param placeholder The image to be set initially, until the image request finishes. - * @see sd_setImageWithURL:placeholderImage:options: - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `image` with an `url`, placeholder and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `image` with an `url`. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - completed:(nullable SDExternalCompletionBlock)completedBlock; - -/** - * Set the imageView `image` with an `url`, placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param placeholder The image to be set initially, until the image request finishes. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder - completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `image` with an `url`, placeholder and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - completed:(nullable SDExternalCompletionBlock)completedBlock; - -#pragma mark - Background image - -/** - * Get the current background image URL. - */ -- (nullable NSURL *)sd_currentBackgroundImageURL; - -/** - * Get the background image URL for a control state. - * - * @param state Which state you want to know the URL for. The values are described in UIControlState. - */ -- (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state; - -/** - * Set the backgroundImageView `image` with an `url`. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - */ -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state NS_REFINED_FOR_SWIFT; - -/** - * Set the backgroundImageView `image` with an `url` and a placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param placeholder The image to be set initially, until the image request finishes. - * @see sd_setImageWithURL:placeholderImage:options: - */ -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; - -/** - * Set the backgroundImageView `image` with an `url`, placeholder and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - */ -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; - -/** - * Set the backgroundImageView `image` with an `url`. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - completed:(nullable SDExternalCompletionBlock)completedBlock; - -/** - * Set the backgroundImageView `image` with an `url`, placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param state The state that uses the specified title. The values are described in UIControlState. - * @param placeholder The image to be set initially, until the image request finishes. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder - completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; - -/** - * Set the backgroundImageView `image` with an `url`, placeholder and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - completed:(nullable SDExternalCompletionBlock)completedBlock; - -#pragma mark - Cancel - -/** - * Cancel the current image download - */ -- (void)sd_cancelImageLoadForState:(UIControlState)state; - -/** - * Cancel the current backgroundImage download - */ -- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state; - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m b/iOSProject/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m deleted file mode 100644 index 11e34b18..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIButton+WebCache.m +++ /dev/null @@ -1,169 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "UIButton+WebCache.h" - -#if SD_UIKIT - -#import "objc/runtime.h" -#import "UIView+WebCacheOperation.h" -#import "UIView+WebCache.h" - -static char imageURLStorageKey; - -typedef NSMutableDictionary SDStateImageURLDictionary; - -static inline NSString * imageURLKeyForState(UIControlState state) { - return [NSString stringWithFormat:@"image_%lu", (unsigned long)state]; -} - -static inline NSString * backgroundImageURLKeyForState(UIControlState state) { - return [NSString stringWithFormat:@"backgroundImage_%lu", (unsigned long)state]; -} - -@implementation UIButton (WebCache) - -#pragma mark - Image - -- (nullable NSURL *)sd_currentImageURL { - NSURL *url = self.imageURLStorage[imageURLKeyForState(self.state)]; - - if (!url) { - url = self.imageURLStorage[imageURLKeyForState(UIControlStateNormal)]; - } - - return url; -} - -- (nullable NSURL *)sd_imageURLForState:(UIControlState)state { - return self.imageURLStorage[imageURLKeyForState(state)]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state { - [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder { - [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { - [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - completed:(nullable SDExternalCompletionBlock)completedBlock { - if (!url) { - [self.imageURLStorage removeObjectForKey:imageURLKeyForState(state)]; - } else { - self.imageURLStorage[imageURLKeyForState(state)] = url; - } - - __weak typeof(self)weakSelf = self; - [self sd_internalSetImageWithURL:url - placeholderImage:placeholder - options:options - operationKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)] - setImageBlock:^(UIImage *image, NSData *imageData) { - [weakSelf setImage:image forState:state]; - } - progress:nil - completed:completedBlock]; -} - -#pragma mark - Background image - -- (nullable NSURL *)sd_currentBackgroundImageURL { - NSURL *url = self.imageURLStorage[backgroundImageURLKeyForState(self.state)]; - - if (!url) { - url = self.imageURLStorage[backgroundImageURLKeyForState(UIControlStateNormal)]; - } - - return url; -} - -- (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state { - return self.imageURLStorage[backgroundImageURLKeyForState(state)]; -} - -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state { - [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil]; -} - -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder { - [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil]; -} - -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { - [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil]; -} - -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock]; -} - -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock]; -} - -- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url - forState:(UIControlState)state - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - completed:(nullable SDExternalCompletionBlock)completedBlock { - if (!url) { - [self.imageURLStorage removeObjectForKey:backgroundImageURLKeyForState(state)]; - } else { - self.imageURLStorage[backgroundImageURLKeyForState(state)] = url; - } - - __weak typeof(self)weakSelf = self; - [self sd_internalSetImageWithURL:url - placeholderImage:placeholder - options:options - operationKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)] - setImageBlock:^(UIImage *image, NSData *imageData) { - [weakSelf setBackgroundImage:image forState:state]; - } - progress:nil - completed:completedBlock]; -} - -- (void)sd_cancelImageLoadForState:(UIControlState)state { - [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]]; -} - -- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state { - [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]]; -} - -- (SDStateImageURLDictionary *)imageURLStorage { - SDStateImageURLDictionary *storage = objc_getAssociatedObject(self, &imageURLStorageKey); - if (!storage) { - storage = [NSMutableDictionary dictionary]; - objc_setAssociatedObject(self, &imageURLStorageKey, storage, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - - return storage; -} - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h b/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h deleted file mode 100644 index 708c37b0..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" - -@interface UIImage (ForceDecode) - -+ (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; - -+ (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m b/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m deleted file mode 100644 index ee55aee7..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "UIImage+ForceDecode.h" -#import "SDWebImageCodersManager.h" - -@implementation UIImage (ForceDecode) - -+ (UIImage *)decodedImageWithImage:(UIImage *)image { - if (!image) { - return nil; - } - NSData *tempData; - return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; -} - -+ (UIImage *)decodedAndScaledDownImageWithImage:(UIImage *)image { - if (!image) { - return nil; - } - NSData *tempData; - return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(YES)}]; -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+GIF.h b/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+GIF.h deleted file mode 100755 index a3a66465..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+GIF.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * (c) Laurin Brandner - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" - -@interface UIImage (GIF) - -/** - * Creates an animated UIImage from an NSData. - * For static GIF, will create an UIImage with `images` array set to nil. For animated GIF, will create an UIImage with valid `images` array. - */ -+ (UIImage *)sd_animatedGIFWithData:(NSData *)data; - -/** - * Checks if an UIImage instance is a GIF. Will use the `images` array. - */ -- (BOOL)isGIF; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+GIF.m b/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+GIF.m deleted file mode 100755 index 6fbca7ae..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+GIF.m +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * (c) Laurin Brandner - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "UIImage+GIF.h" -#import "SDWebImageGIFCoder.h" -#import "NSImage+WebCache.h" - -@implementation UIImage (GIF) - -+ (UIImage *)sd_animatedGIFWithData:(NSData *)data { - if (!data) { - return nil; - } - return [[SDWebImageGIFCoder sharedCoder] decodedImageWithData:data]; -} - -- (BOOL)isGIF { - return (self.images != nil); -} - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h b/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h deleted file mode 100644 index c0792d1b..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" -#import "NSData+ImageContentType.h" - -@interface UIImage (MultiFormat) - -/** - * UIKit: - * For static image format, this value is always 0. - * For animated image format, 0 means infinite looping. - * Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. - * AppKit: - * NSImage currently only support animated via GIF imageRep unlike UIImage. - * The getter of this property will get the loop count from GIF imageRep - * The setter of this property will set the loop count from GIF imageRep - */ -@property (nonatomic, assign) NSUInteger sd_imageLoopCount; - -+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; -- (nullable NSData *)sd_imageData; -- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m b/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m deleted file mode 100644 index 664e0969..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "UIImage+MultiFormat.h" - -#import "objc/runtime.h" -#import "SDWebImageCodersManager.h" - -@implementation UIImage (MultiFormat) - -#if SD_MAC -- (NSUInteger)sd_imageLoopCount { - NSUInteger imageLoopCount = 0; - for (NSImageRep *rep in self.representations) { - if ([rep isKindOfClass:[NSBitmapImageRep class]]) { - NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; - imageLoopCount = [[bitmapRep valueForProperty:NSImageLoopCount] unsignedIntegerValue]; - break; - } - } - return imageLoopCount; -} - -- (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { - for (NSImageRep *rep in self.representations) { - if ([rep isKindOfClass:[NSBitmapImageRep class]]) { - NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; - [bitmapRep setProperty:NSImageLoopCount withValue:@(sd_imageLoopCount)]; - break; - } - } -} - -#else - -- (NSUInteger)sd_imageLoopCount { - NSUInteger imageLoopCount = 0; - NSNumber *value = objc_getAssociatedObject(self, @selector(sd_imageLoopCount)); - if ([value isKindOfClass:[NSNumber class]]) { - imageLoopCount = value.unsignedIntegerValue; - } - return imageLoopCount; -} - -- (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { - NSNumber *value = @(sd_imageLoopCount); - objc_setAssociatedObject(self, @selector(sd_imageLoopCount), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} -#endif - -+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data { - return [[SDWebImageCodersManager sharedInstance] decodedImageWithData:data]; -} - -- (nullable NSData *)sd_imageData { - return [self sd_imageDataAsFormat:SDImageFormatUndefined]; -} - -- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat { - NSData *imageData = nil; - if (self) { - imageData = [[SDWebImageCodersManager sharedInstance] encodedDataWithImage:self format:imageFormat]; - } - return imageData; -} - - -@end diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h b/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h deleted file mode 100644 index c806e5f2..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" - -#if SD_UIKIT - -#import "SDWebImageManager.h" - -/** - * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. - */ -@interface UIImageView (HighlightedWebCache) - -/** - * Set the imageView `highlightedImage` with an `url`. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - */ -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `highlightedImage` with an `url` and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - */ -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url - options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `highlightedImage` with an `url`. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url - completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `highlightedImage` with an `url` and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url - options:(SDWebImageOptions)options - completed:(nullable SDExternalCompletionBlock)completedBlock; - -/** - * Set the imageView `highlightedImage` with an `url` and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param progressBlock A block called while image is downloading - * @note the progress block is executed on a background queue - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url - options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock; - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m b/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m deleted file mode 100644 index fb13bd8b..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "UIImageView+HighlightedWebCache.h" - -#if SD_UIKIT - -#import "UIView+WebCacheOperation.h" -#import "UIView+WebCache.h" - -@implementation UIImageView (HighlightedWebCache) - -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url { - [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; -} - -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options { - [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; -} - -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; -} - -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; -} - -- (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url - options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock { - __weak typeof(self)weakSelf = self; - [self sd_internalSetImageWithURL:url - placeholderImage:nil - options:options - operationKey:@"UIImageViewImageOperationHighlighted" - setImageBlock:^(UIImage *image, NSData *imageData) { - weakSelf.highlightedImage = image; - } - progress:progressBlock - completed:completedBlock]; -} - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h b/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h deleted file mode 100644 index 568ccfd0..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" - -#if SD_UIKIT || SD_MAC - -#import "SDWebImageManager.h" - -/** - * Integrates SDWebImage async downloading and caching of remote images with UIImageView. - * - * Usage with a UITableViewCell sub-class: - * - * @code - -#import - -... - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - static NSString *MyIdentifier = @"MyIdentifier"; - - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; - - if (cell == nil) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] - autorelease]; - } - - // Here we use the provided sd_setImageWithURL: method to load the web image - // Ensure you use a placeholder image otherwise cells will be initialized with no image - [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"] - placeholderImage:[UIImage imageNamed:@"placeholder"]]; - - cell.textLabel.text = @"My Text"; - return cell; -} - - * @endcode - */ -@interface UIImageView (WebCache) - -/** - * Set the imageView `image` with an `url`. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `image` with an `url` and a placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @see sd_setImageWithURL:placeholderImage:options: - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `image` with an `url`, placeholder and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `image` with an `url`. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - completed:(nullable SDExternalCompletionBlock)completedBlock; - -/** - * Set the imageView `image` with an `url`, placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; - -/** - * Set the imageView `image` with an `url`, placeholder and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - completed:(nullable SDExternalCompletionBlock)completedBlock; - -/** - * Set the imageView `image` with an `url`, placeholder and custom options. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param progressBlock A block called while image is downloading - * @note the progress block is executed on a background queue - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock; - -/** - * Set the imageView `image` with an `url` and optionally a placeholder image. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param progressBlock A block called while image is downloading - * @note the progress block is executed on a background queue - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_setImageWithPreviousCachedImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock; - -#if SD_UIKIT - -#pragma mark - Animation of multiple images - -/** - * Download an array of images and starts them in an animation loop - * - * @param arrayOfURLs An array of NSURL - */ -- (void)sd_setAnimationImagesWithURLs:(nonnull NSArray *)arrayOfURLs; - -- (void)sd_cancelCurrentAnimationImagesLoad; - -#endif - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m b/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m deleted file mode 100644 index b25a234f..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIImageView+WebCache.m +++ /dev/null @@ -1,145 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "UIImageView+WebCache.h" - -#if SD_UIKIT || SD_MAC - -#import "objc/runtime.h" -#import "UIView+WebCacheOperation.h" -#import "UIView+WebCache.h" - -@implementation UIImageView (WebCache) - -- (void)sd_setImageWithURL:(nullable NSURL *)url { - [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder { - [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options { - [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock]; -} - -- (void)sd_setImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock { - [self sd_internalSetImageWithURL:url - placeholderImage:placeholder - options:options - operationKey:nil - setImageBlock:nil - progress:progressBlock - completed:completedBlock]; -} - -- (void)sd_setImageWithPreviousCachedImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock { - NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url]; - UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromCacheForKey:key]; - - [self sd_setImageWithURL:url placeholderImage:lastPreviousCachedImage ?: placeholder options:options progress:progressBlock completed:completedBlock]; -} - -#if SD_UIKIT - -#pragma mark - Animation of multiple images - -- (void)sd_setAnimationImagesWithURLs:(nonnull NSArray *)arrayOfURLs { - [self sd_cancelCurrentAnimationImagesLoad]; - __weak __typeof(self)wself = self; - - NSPointerArray *operationsArray = [self sd_animationOperationArray]; - - [arrayOfURLs enumerateObjectsUsingBlock:^(NSURL *logoImageURL, NSUInteger idx, BOOL * _Nonnull stop) { - id operation = [[SDWebImageManager sharedManager] loadImageWithURL:logoImageURL options:0 progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { - if (!wself) return; - dispatch_main_async_safe(^{ - __strong UIImageView *sself = wself; - [sself stopAnimating]; - if (sself && image) { - NSMutableArray *currentImages = [[sself animationImages] mutableCopy]; - if (!currentImages) { - currentImages = [[NSMutableArray alloc] init]; - } - - // We know what index objects should be at when they are returned so - // we will put the object at the index, filling any empty indexes - // with the image that was returned too "early". These images will - // be overwritten. (does not require additional sorting datastructure) - while ([currentImages count] < idx) { - [currentImages addObject:image]; - } - - currentImages[idx] = image; - - sself.animationImages = currentImages; - [sself setNeedsLayout]; - } - [sself startAnimating]; - }); - }]; - @synchronized (self) { - [operationsArray addPointer:(__bridge void *)(operation)]; - } - }]; -} - -static char animationLoadOperationKey; - -// element is weak because operation instance is retained by SDWebImageManager's runningOperations property -// we should use lock to keep thread-safe because these method may not be acessed from main queue -- (NSPointerArray *)sd_animationOperationArray { - @synchronized(self) { - NSPointerArray *operationsArray = objc_getAssociatedObject(self, &animationLoadOperationKey); - if (operationsArray) { - return operationsArray; - } - operationsArray = [NSPointerArray weakObjectsPointerArray]; - objc_setAssociatedObject(self, &animationLoadOperationKey, operationsArray, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - return operationsArray; - } -} - -- (void)sd_cancelCurrentAnimationImagesLoad { - NSPointerArray *operationsArray = [self sd_animationOperationArray]; - if (operationsArray) { - @synchronized (self) { - for (id operation in operationsArray) { - if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]) { - [operation cancel]; - } - } - operationsArray.count = 0; - } - } -} -#endif - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCache.h b/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCache.h deleted file mode 100644 index d9ed3ba3..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCache.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" - -#if SD_UIKIT || SD_MAC - -#import "SDWebImageManager.h" - -/** - A Dispatch group to maintain setImageBlock and completionBlock. This key should be used only internally and may be changed in the future. (dispatch_group_t) - */ -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageInternalSetImageGroupKey; -/** - A SDWebImageManager instance to control the image download and cache process using in UIImageView+WebCache category and likes. If not provided, use the shared manager (SDWebImageManager) - */ -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageExternalCustomManagerKey; - -typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable imageData); - -@interface UIView (WebCache) - -/** - * Get the current image URL. - * - * Note that because of the limitations of categories this property can get out of sync - * if you use setImage: directly. - */ -- (nullable NSURL *)sd_imageURL; - -/** - * Set the imageView `image` with an `url` and optionally a placeholder image. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param operationKey A string to be used as the operation key. If nil, will use the class name - * @param setImageBlock Block used for custom set image code - * @param progressBlock A block called while image is downloading - * @note the progress block is executed on a background queue - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)sd_internalSetImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - operationKey:(nullable NSString *)operationKey - setImageBlock:(nullable SDSetImageBlock)setImageBlock - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock; - -/** - * Set the imageView `image` with an `url` and optionally a placeholder image. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. - * @param operationKey A string to be used as the operation key. If nil, will use the class name - * @param setImageBlock Block used for custom set image code - * @param progressBlock A block called while image is downloading - * @note the progress block is executed on a background queue - * @param completedBlock A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - * @param context A context with extra information to perform specify changes or processes. - */ -- (void)sd_internalSetImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - operationKey:(nullable NSString *)operationKey - setImageBlock:(nullable SDSetImageBlock)setImageBlock - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock - context:(nullable NSDictionary *)context; - -/** - * Cancel the current download - */ -- (void)sd_cancelCurrentImageLoad; - -#if SD_UIKIT - -#pragma mark - Activity indicator - -/** - * Show activity UIActivityIndicatorView - */ -- (void)sd_setShowActivityIndicatorView:(BOOL)show; - -/** - * set desired UIActivityIndicatorViewStyle - * - * @param style The style of the UIActivityIndicatorView - */ -- (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style; - -- (BOOL)sd_showActivityIndicatorView; -- (void)sd_addActivityIndicator; -- (void)sd_removeActivityIndicator; - -#endif - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCache.m b/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCache.m deleted file mode 100644 index de2753d8..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCache.m +++ /dev/null @@ -1,251 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "UIView+WebCache.h" - -#if SD_UIKIT || SD_MAC - -#import "objc/runtime.h" -#import "UIView+WebCacheOperation.h" - -NSString * const SDWebImageInternalSetImageGroupKey = @"internalSetImageGroup"; -NSString * const SDWebImageExternalCustomManagerKey = @"externalCustomManager"; - -static char imageURLKey; - -#if SD_UIKIT -static char TAG_ACTIVITY_INDICATOR; -static char TAG_ACTIVITY_STYLE; -#endif -static char TAG_ACTIVITY_SHOW; - -@implementation UIView (WebCache) - -- (nullable NSURL *)sd_imageURL { - return objc_getAssociatedObject(self, &imageURLKey); -} - -- (void)sd_internalSetImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - operationKey:(nullable NSString *)operationKey - setImageBlock:(nullable SDSetImageBlock)setImageBlock - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock { - return [self sd_internalSetImageWithURL:url placeholderImage:placeholder options:options operationKey:operationKey setImageBlock:setImageBlock progress:progressBlock completed:completedBlock context:nil]; -} - -- (void)sd_internalSetImageWithURL:(nullable NSURL *)url - placeholderImage:(nullable UIImage *)placeholder - options:(SDWebImageOptions)options - operationKey:(nullable NSString *)operationKey - setImageBlock:(nullable SDSetImageBlock)setImageBlock - progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock - completed:(nullable SDExternalCompletionBlock)completedBlock - context:(nullable NSDictionary *)context { - NSString *validOperationKey = operationKey ?: NSStringFromClass([self class]); - [self sd_cancelImageLoadOperationWithKey:validOperationKey]; - objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - - if (!(options & SDWebImageDelayPlaceholder)) { - if ([context valueForKey:SDWebImageInternalSetImageGroupKey]) { - dispatch_group_t group = [context valueForKey:SDWebImageInternalSetImageGroupKey]; - dispatch_group_enter(group); - } - dispatch_main_async_safe(^{ - [self sd_setImage:placeholder imageData:nil basedOnClassOrViaCustomSetImageBlock:setImageBlock]; - }); - } - - if (url) { - // check if activityView is enabled or not - if ([self sd_showActivityIndicatorView]) { - [self sd_addActivityIndicator]; - } - - SDWebImageManager *manager; - if ([context valueForKey:SDWebImageExternalCustomManagerKey]) { - manager = (SDWebImageManager *)[context valueForKey:SDWebImageExternalCustomManagerKey]; - } else { - manager = [SDWebImageManager sharedManager]; - } - - __weak __typeof(self)wself = self; - id operation = [manager loadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { - __strong __typeof (wself) sself = wself; - [sself sd_removeActivityIndicator]; - if (!sself) { return; } - BOOL shouldCallCompletedBlock = finished || (options & SDWebImageAvoidAutoSetImage); - BOOL shouldNotSetImage = ((image && (options & SDWebImageAvoidAutoSetImage)) || - (!image && !(options & SDWebImageDelayPlaceholder))); - SDWebImageNoParamsBlock callCompletedBlockClojure = ^{ - if (!sself) { return; } - if (!shouldNotSetImage) { - [sself sd_setNeedsLayout]; - } - if (completedBlock && shouldCallCompletedBlock) { - completedBlock(image, error, cacheType, url); - } - }; - - // case 1a: we got an image, but the SDWebImageAvoidAutoSetImage flag is set - // OR - // case 1b: we got no image and the SDWebImageDelayPlaceholder is not set - if (shouldNotSetImage) { - dispatch_main_async_safe(callCompletedBlockClojure); - return; - } - - UIImage *targetImage = nil; - NSData *targetData = nil; - if (image) { - // case 2a: we got an image and the SDWebImageAvoidAutoSetImage is not set - targetImage = image; - targetData = data; - } else if (options & SDWebImageDelayPlaceholder) { - // case 2b: we got no image and the SDWebImageDelayPlaceholder flag is set - targetImage = placeholder; - targetData = nil; - } - - if ([context valueForKey:SDWebImageInternalSetImageGroupKey]) { - dispatch_group_t group = [context valueForKey:SDWebImageInternalSetImageGroupKey]; - dispatch_group_enter(group); - dispatch_main_async_safe(^{ - [sself sd_setImage:targetImage imageData:targetData basedOnClassOrViaCustomSetImageBlock:setImageBlock]; - }); - // ensure completion block is called after custom setImage process finish - dispatch_group_notify(group, dispatch_get_main_queue(), ^{ - callCompletedBlockClojure(); - }); - } else { - dispatch_main_async_safe(^{ - [sself sd_setImage:targetImage imageData:targetData basedOnClassOrViaCustomSetImageBlock:setImageBlock]; - callCompletedBlockClojure(); - }); - } - }]; - [self sd_setImageLoadOperation:operation forKey:validOperationKey]; - } else { - dispatch_main_async_safe(^{ - [self sd_removeActivityIndicator]; - if (completedBlock) { - NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; - completedBlock(nil, error, SDImageCacheTypeNone, url); - } - }); - } -} - -- (void)sd_cancelCurrentImageLoad { - [self sd_cancelImageLoadOperationWithKey:NSStringFromClass([self class])]; -} - -- (void)sd_setImage:(UIImage *)image imageData:(NSData *)imageData basedOnClassOrViaCustomSetImageBlock:(SDSetImageBlock)setImageBlock { - if (setImageBlock) { - setImageBlock(image, imageData); - return; - } - -#if SD_UIKIT || SD_MAC - if ([self isKindOfClass:[UIImageView class]]) { - UIImageView *imageView = (UIImageView *)self; - imageView.image = image; - } -#endif - -#if SD_UIKIT - if ([self isKindOfClass:[UIButton class]]) { - UIButton *button = (UIButton *)self; - [button setImage:image forState:UIControlStateNormal]; - } -#endif -} - -- (void)sd_setNeedsLayout { -#if SD_UIKIT - [self setNeedsLayout]; -#elif SD_MAC - [self setNeedsLayout:YES]; -#endif -} - -#pragma mark - Activity indicator - -#pragma mark - -#if SD_UIKIT -- (UIActivityIndicatorView *)activityIndicator { - return (UIActivityIndicatorView *)objc_getAssociatedObject(self, &TAG_ACTIVITY_INDICATOR); -} - -- (void)setActivityIndicator:(UIActivityIndicatorView *)activityIndicator { - objc_setAssociatedObject(self, &TAG_ACTIVITY_INDICATOR, activityIndicator, OBJC_ASSOCIATION_RETAIN); -} -#endif - -- (void)sd_setShowActivityIndicatorView:(BOOL)show { - objc_setAssociatedObject(self, &TAG_ACTIVITY_SHOW, @(show), OBJC_ASSOCIATION_RETAIN); -} - -- (BOOL)sd_showActivityIndicatorView { - return [objc_getAssociatedObject(self, &TAG_ACTIVITY_SHOW) boolValue]; -} - -#if SD_UIKIT -- (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style{ - objc_setAssociatedObject(self, &TAG_ACTIVITY_STYLE, [NSNumber numberWithInt:style], OBJC_ASSOCIATION_RETAIN); -} - -- (int)sd_getIndicatorStyle{ - return [objc_getAssociatedObject(self, &TAG_ACTIVITY_STYLE) intValue]; -} -#endif - -- (void)sd_addActivityIndicator { -#if SD_UIKIT - dispatch_main_async_safe(^{ - if (!self.activityIndicator) { - self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self sd_getIndicatorStyle]]; - self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO; - - [self addSubview:self.activityIndicator]; - - [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeCenterX - multiplier:1.0 - constant:0.0]]; - [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator - attribute:NSLayoutAttributeCenterY - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeCenterY - multiplier:1.0 - constant:0.0]]; - } - [self.activityIndicator startAnimating]; - }); -#endif -} - -- (void)sd_removeActivityIndicator { -#if SD_UIKIT - dispatch_main_async_safe(^{ - if (self.activityIndicator) { - [self.activityIndicator removeFromSuperview]; - self.activityIndicator = nil; - } - }); -#endif -} - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h b/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h deleted file mode 100644 index 5d44691f..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "SDWebImageCompat.h" - -#if SD_UIKIT || SD_MAC - -#import "SDWebImageManager.h" - -// These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external. -// All the stored operations are weak, so it will be dalloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them. -@interface UIView (WebCacheOperation) - -/** - * Set the image load operation (storage in a UIView based weak map table) - * - * @param operation the operation - * @param key key for storing the operation - */ -- (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; - -/** - * Cancel all operations for the current UIView and key - * - * @param key key for identifying the operations - */ -- (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; - -/** - * Just remove the operations corresponding to the current UIView and key without cancelling them - * - * @param key key for identifying the operations - */ -- (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; - -@end - -#endif diff --git a/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m b/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m deleted file mode 100644 index 78d58f41..00000000 --- a/iOSProject/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is part of the SDWebImage package. - * (c) Olivier Poitrey - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#import "UIView+WebCacheOperation.h" - -#if SD_UIKIT || SD_MAC - -#import "objc/runtime.h" - -static char loadOperationKey; - -// key is copy, value is weak because operation instance is retained by SDWebImageManager's runningOperations property -// we should use lock to keep thread-safe because these method may not be acessed from main queue -typedef NSMapTable> SDOperationsDictionary; - -@implementation UIView (WebCacheOperation) - -- (SDOperationsDictionary *)sd_operationDictionary { - @synchronized(self) { - SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); - if (operations) { - return operations; - } - operations = [[NSMapTable alloc] initWithKeyOptions:NSMapTableCopyIn valueOptions:NSMapTableWeakMemory capacity:0]; - objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - return operations; - } -} - -- (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key { - if (key) { - [self sd_cancelImageLoadOperationWithKey:key]; - if (operation) { - SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; - @synchronized (self) { - [operationDictionary setObject:operation forKey:key]; - } - } - } -} - -- (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key { - // Cancel in progress downloader from queue - SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; - id operation; - @synchronized (self) { - operation = [operationDictionary objectForKey:key]; - } - if (operation) { - if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]){ - [operation cancel]; - } - @synchronized (self) { - [operationDictionary removeObjectForKey:key]; - } - } -} - -- (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key { - if (key) { - SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; - @synchronized (self) { - [operationDictionary removeObjectForKey:key]; - } - } -} - -@end - -#endif diff --git a/iOSProject/Pods/TDTouchID/LICENSE b/iOSProject/Pods/TDTouchID/LICENSE deleted file mode 100644 index 8dada3ed..00000000 --- a/iOSProject/Pods/TDTouchID/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/iOSProject/Pods/TDTouchID/README.md b/iOSProject/Pods/TDTouchID/README.md deleted file mode 100644 index b37470b0..00000000 --- a/iOSProject/Pods/TDTouchID/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# TDTouchID - -TDTouchID是一个封装好的指纹验证库,可以用来做iOSAPP的登录/支付等验证。 -![(logo)](IMG_3457.PNG) -#安装方式 -使用Cocoa Pods安装 -``` -pod `TDTouchID` -``` -手动导入 - -下载本项目,导入子层`TDTouchID`文件夹.(里面包含`TDTouchID.h`和`TDTouchID.m`)文件 - -* 导入`TDTouchID.h`即可使用 - - -#如何使用 -``` -/** - 启动TouchID进行验证 - - @param desc Touch显示的描述 - @param block 回调状态的block - */ - --(void)td_showTouchIDWithDescribe:(NSString *)desc BlockState:(StateBlock)block; -``` -详细使用方法参见Demo即可 diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/AppDelegate.h b/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/AppDelegate.h deleted file mode 100644 index d2387579..00000000 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/AppDelegate.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// AppDelegate.h -// TDTouchID -// -// Created by imtudou on 2016/11/20. -// Copyright © 2016年 TuDou. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - - -@end - diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/AppDelegate.m b/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/AppDelegate.m deleted file mode 100644 index 30eebe15..00000000 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/AppDelegate.m +++ /dev/null @@ -1,60 +0,0 @@ -// -// AppDelegate.m -// TDTouchID -// -// Created by imtudou on 2016/11/20. -// Copyright © 2016年 TuDou. All rights reserved. -// - -#import "AppDelegate.h" -#import "TDMainViewController.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; - - TDMainViewController *mainVC = [[TDMainViewController alloc] init]; - UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:mainVC]; - self.window.rootViewController = navVC; - - [self.window makeKeyAndVisible]; - - - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - // 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. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. -} - - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // 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. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // 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. -} - - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // 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. -} - - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDHomeViewController.h b/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDHomeViewController.h deleted file mode 100644 index 8f676c94..00000000 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDHomeViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// TDHomeViewController.h -// TDTouchID -// -// Created by imtudou on 2016/11/19. -// Copyright © 2016年 TuDou. All rights reserved. -// - -#import - -@interface TDHomeViewController : UIViewController - -@end diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDHomeViewController.m b/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDHomeViewController.m deleted file mode 100644 index badb6944..00000000 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDHomeViewController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// TDHomeViewController.m -// TDTouchID -// -// Created by imtudou on 2016/11/19. -// Copyright © 2016年 TuDou. All rights reserved. -// - -#import "TDHomeViewController.h" - -@interface TDHomeViewController () - -@end - -@implementation TDHomeViewController - -- (void)viewDidLoad { - - [super viewDidLoad]; - - self.view.backgroundColor = [UIColor greenColor]; - self.title = @"已经通过TouchID验证"; - -} - - -@end diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDMainViewController.h b/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDMainViewController.h deleted file mode 100644 index 0713573d..00000000 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDMainViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// TDMainViewController.h -// TDTouchID -// -// Created by imtudou on 2016/11/19. -// Copyright © 2016年 TuDou. All rights reserved. -// - -#import - -@interface TDMainViewController : UIViewController - -@end diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDMainViewController.m b/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDMainViewController.m deleted file mode 100644 index 069c3b82..00000000 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDMainViewController.m +++ /dev/null @@ -1,77 +0,0 @@ -// -// TDMainViewController.m -// TDTouchID -// -// Created by imtudou on 2016/11/19. -// Copyright © 2016年 TuDou. All rights reserved. -// - -#import "TDMainViewController.h" -#import "TDTouchID.h" -#import "TDHomeViewController.h" - -@interface TDMainViewController () - -@end - -@implementation TDMainViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.view.backgroundColor = [UIColor whiteColor]; - - self.title = @"验证指纹"; - - //使用TDButton更方便 https://github.com/greezi/TDButton - UIButton *touchIDButton = [[UIButton alloc] init]; - [touchIDButton setBackgroundImage:[UIImage imageNamed:@"touchID"] forState:UIControlStateNormal]; - [touchIDButton addTarget:self action:@selector(touchVerification) forControlEvents:UIControlEventTouchDown]; - touchIDButton.frame = CGRectMake((self.view.frame.size.width / 2) - 30, (self.view.frame.size.height / 2) - 30, 60, 60); - [self.view addSubview:touchIDButton]; - - [self touchVerification]; - -} - - -/** - 验证 TouchID - */ -- (void)touchVerification { - - TDTouchID *touchID = [[TDTouchID alloc] init]; - - [touchID td_showTouchIDWithDescribe:nil BlockState:^(TDTouchIDState state, NSError *error) { - - if (state == TDTouchIDStateNotSupport) { //不支持TouchID - - UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"当前设备不支持TouchID" message:@"请输入密码" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; - alertview.alertViewStyle = UIAlertViewStyleSecureTextInput; - [alertview show]; - - - } else if (state == TDTouchIDStateSuccess) { //TouchID验证成功 - - NSLog(@"jump"); - TDHomeViewController *homeVc = [[TDHomeViewController alloc] init]; - [self.navigationController pushViewController:homeVc animated:YES]; - - } else if (state == TDTouchIDStateInputPassword) { //用户选择手动输入密码 - - UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:nil message:@"请输入密码" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; - alertview.alertViewStyle = UIAlertViewStyleSecureTextInput; - [alertview show]; - - } - - // ps:以上的状态处理并没有写完全! - // 在使用中你需要根据回调的状态进行处理,需要处理什么就处理什么 - - - - }]; - -} - -@end diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDTouchID/TDTouchID.h b/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDTouchID/TDTouchID.h deleted file mode 100644 index 55e75a2e..00000000 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDTouchID/TDTouchID.h +++ /dev/null @@ -1,89 +0,0 @@ -// -// TDTouchID.h -// TDTouchID -// -// Created by imtudou on 2016/11/19. -// Copyright © 2016年 TuDou. All rights reserved. -// - - -#import - -/** - * TouchID 状态 - */ -typedef NS_ENUM(NSUInteger, TDTouchIDState){ - - /** - * 当前设备不支持TouchID - */ - TDTouchIDStateNotSupport = 0, - /** - * TouchID 验证成功 - */ - TDTouchIDStateSuccess = 1, - - /** - * TouchID 验证失败 - */ - TDTouchIDStateFail = 2, - /** - * TouchID 被用户手动取消 - */ - TDTouchIDStateUserCancel = 3, - /** - * 用户不使用TouchID,选择手动输入密码 - */ - TDTouchIDStateInputPassword = 4, - /** - * TouchID 被系统取消 (如遇到来电,锁屏,按了Home键等) - */ - TDTouchIDStateSystemCancel = 5, - /** - * TouchID 无法启动,因为用户没有设置密码 - */ - TDTouchIDStatePasswordNotSet = 6, - /** - * TouchID 无法启动,因为用户没有设置TouchID - */ - TDTouchIDStateTouchIDNotSet = 7, - /** - * TouchID 无效 - */ - TDTouchIDStateTouchIDNotAvailable = 8, - /** - * TouchID 被锁定(连续多次验证TouchID失败,系统需要用户手动输入密码) - */ - TDTouchIDStateTouchIDLockout = 9, - /** - * 当前软件被挂起并取消了授权 (如App进入了后台等) - */ - TDTouchIDStateAppCancel = 10, - /** - * 当前软件被挂起并取消了授权 (LAContext对象无效) - */ - TDTouchIDStateInvalidContext = 11, - /** - * 系统版本不支持TouchID (必须高于iOS 8.0才能使用) - */ - TDTouchIDStateVersionNotSupport = 12 -}; - - - -@interface TDTouchID : LAContext - -typedef void (^StateBlock)(TDTouchIDState state,NSError *error); - - -/** - 启动TouchID进行验证 - - @param desc Touch显示的描述 - @param block 回调状态的block - */ - --(void)td_showTouchIDWithDescribe:(NSString *)desc BlockState:(StateBlock)block; - - -@end diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/main.m b/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/main.m deleted file mode 100644 index c0e00259..00000000 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// TDTouchID -// -// Created by imtudou on 2016/11/20. -// Copyright © 2016年 TuDou. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/iOSProject/Pods/TZImagePickerController/LICENSE b/iOSProject/Pods/TZImagePickerController/LICENSE deleted file mode 100644 index d2a88182..00000000 --- a/iOSProject/Pods/TZImagePickerController/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Zhen Tan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/iOSProject/Pods/TZImagePickerController/README.md b/iOSProject/Pods/TZImagePickerController/README.md deleted file mode 100644 index 422e9d42..00000000 --- a/iOSProject/Pods/TZImagePickerController/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# TZImagePickerController - A clone of UIImagePickerController, support picking multiple photos、original photo、video, also allow preview photo and video, support iOS6+. - 一个支持多选、选原图和视频的图片选择器,同时有预览功能,支持iOS6+。 - - ## 重要提示:1.9.0版本已发布,移除了"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级。 - 其它同样使用了该API的库大家可以检查下,比如著名的[SVProgressHUD](http://www.cocoachina.com/bbs/read.php?tid=1722166) - - 关于升级iOS10和Xcdoe8的提示: - 在Xcode8环境下将项目运行在iOS10的设备/模拟器中,访问相册和相机需要额外配置info.plist文件。分别是Privacy - Photo Library Usage Description和Privacy - Camera Usage Description字段,详见Demo中info.plist中的设置。 - - 项目截图 1.Demo首页 2.照片列表页 3.照片预览页 4.视频预览页 - - - -## 一. Installation 安装 - - * CocoaPods:pod 'TZImagePickerController' - * 手动导入:将TZImagePickerController文件夹拽入项目中,导入头文件:#import "TZImagePickerController.h" - -## 二. Example 例子 - - TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:9 delegate:self]; - - // You can get the photos by block, the same as by delegate. - // 你可以通过block或者代理,来得到用户选择的照片. - [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray *photos, NSArray *assets) { - - }]; - [self presentViewController:imagePickerVc animated:YES completion:nil]; - -## 三. Requirements 要求 - iOS 6 or later. Requires ARC - iOS6及以上系统可使用. ARC环境. - - When system version is iOS6 or iOS7, Using AssetsLibrary. - When system version is iOS8 or later, Using PhotoKit. - 如果运行在iOS6或7系统上,用的是AssetsLibrary库获取照片资源。 - 如果运行在iOS8及以上系统上,用的是PhotoKit库获取照片资源。 - -## 四. More 更多 - - If you find a bug, please create a issue. - Welcome to pull requests. - More infomation please view code. - 如果你发现了bug,请提一个issue。 - 欢迎给我提pull requests。 - 更多信息详见代码,也可查看我的博客: [我的博客](http://www.jianshu.com/p/1975411a31bb "半尺尘 - 简书") - - 关于issue: - 请尽可能详细地描述**系统版本**、**手机型号**、**库的版本**、**崩溃日志**和**复现步骤**,**请先更新到最新版再测试一下**,如果新版还存在再提~如果已有开启的类似issue,请直接在该issue下评论说出你的问题 - -## 五. Other 其它 - - 常见问题 -**Q:pod search TZImagePickerController 搜索出来的不是最新版本** -A:需要在终端执行cd转换文件路径命令退回到Desktop,然后执行pod setup命令更新本地spec缓存(可能需要几分钟),然后再搜索就可以了 - -**Q:拍照后照片保存失败** -A:请参考issue481:https://github.com/banchichen/TZImagePickerController/issues/481 的信息排查,若还有问题请直接在issue内评论 - -**Q:photos数组图片不是原图,如何获取原图?** -A:请参考issue457的解释:https://github.com/banchichen/TZImagePickerController/issues/457 - -**Q:系统语言是中文/英文,界面上却有部分相册名字、返回按钮显示成了英文/中文?** -A:请参考issue443的解释:https://github.com/banchichen/TZImagePickerController/issues/443 - -**Q:预览界面能否支持传入NSURL、UIImage对象?** -A:排期中,优先级高 - -**Q:可否支持横屏?** -A:1.8.4版本已支持 - -**Q:可否加入视频拍摄功能?** -A:排期中,优先级中 - -**Q:可否加入视频多选功能?** -A:1.8.4版本已支持 - -**Q:可否让视频和图片允许一起选?** -A:1.8.4版本已支持 - -**Q:可否增加微信编辑图片的功能?** -A:考虑下,优先级低 - - 最近更新 -1.9.5 优化视频导出API,和其它一些细节 -1.9.4 适配iPhoneX     -1.9.0 移除"prefs:root="的调用,这个API已经被列为私有API,请大家尽快升级 -1.8.8 修复一些细节 -1.8.5 修复一些样式细节 -1.8.4 加入横竖屏适配;支持视频/gif多选;支持视频和照片一起选 -1.8.1 新增2个代理方法,支持由上层来决定相册/照片的显示与否 -1.8.0 修复若干bug, 提升流畅度 -... -1.7.7 支持GIF图片的播放和选择 -1.7.6 支持对共享相册和同步相册的显示 -1.7.5 允许不进入预览页面直接选择照片 -1.7.4 支持单选模式下裁剪照片,支持任意矩形和圆形裁剪框 -1.7.3 优化iCloud照片的显示与选择 -... -1.5.0 可把拍照按钮放在外面;可自定义照片排序方式;Demo页的UI大改版,新增若干开关; -... -1.4.5 性能大幅提升(性能测试截图请去博客查看);可在照片列表页拍照;Demo大幅优化; -... diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/NSBundle+TZImagePicker.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/NSBundle+TZImagePicker.h deleted file mode 100755 index dcc78470..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/NSBundle+TZImagePicker.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// NSBundle+TZImagePicker.h -// TZImagePickerController -// -// Created by 谭真 on 16/08/18. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import - -@interface NSBundle (TZImagePicker) - -+ (NSBundle *)tz_imagePickerBundle; - -+ (NSString *)tz_localizedStringForKey:(NSString *)key value:(NSString *)value; -+ (NSString *)tz_localizedStringForKey:(NSString *)key; - -@end - diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/NSBundle+TZImagePicker.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/NSBundle+TZImagePicker.m deleted file mode 100755 index 04d1e141..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/NSBundle+TZImagePicker.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// NSBundle+TZImagePicker.m -// TZImagePickerController -// -// Created by 谭真 on 16/08/18. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import "NSBundle+TZImagePicker.h" -#import "TZImagePickerController.h" - -@implementation NSBundle (TZImagePicker) - -+ (NSBundle *)tz_imagePickerBundle { - NSBundle *bundle = [NSBundle bundleForClass:[TZImagePickerController class]]; - NSURL *url = [bundle URLForResource:@"TZImagePickerController" withExtension:@"bundle"]; - bundle = [NSBundle bundleWithURL:url]; - return bundle; -} - -+ (NSString *)tz_localizedStringForKey:(NSString *)key { - return [self tz_localizedStringForKey:key value:@""]; -} - -+ (NSString *)tz_localizedStringForKey:(NSString *)key value:(NSString *)value { - static NSBundle *bundle = nil; - if (bundle == nil) { - NSString *language = [NSLocale preferredLanguages].firstObject; - if ([language rangeOfString:@"zh-Hans"].location != NSNotFound) { - language = @"zh-Hans"; - } else { - language = @"en"; - } - bundle = [NSBundle bundleWithPath:[[NSBundle tz_imagePickerBundle] pathForResource:language ofType:@"lproj"]]; - } - NSString *value1 = [bundle localizedStringForKey:key value:value table:nil]; - return value1; -} -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetCell.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetCell.h deleted file mode 100644 index fd0f52dc..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetCell.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// TZAssetCell.h -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import -#import - -typedef enum : NSUInteger { - TZAssetCellTypePhoto = 0, - TZAssetCellTypeLivePhoto, - TZAssetCellTypePhotoGif, - TZAssetCellTypeVideo, - TZAssetCellTypeAudio, -} TZAssetCellType; - -@class TZAssetModel; -@interface TZAssetCell : UICollectionViewCell - -@property (weak, nonatomic) UIButton *selectPhotoButton; -@property (nonatomic, strong) TZAssetModel *model; -@property (nonatomic, copy) void (^didSelectPhotoBlock)(BOOL); -@property (nonatomic, assign) TZAssetCellType type; -@property (nonatomic, assign) BOOL allowPickingGif; -@property (nonatomic, assign) BOOL allowPickingMultipleVideo; -@property (nonatomic, copy) NSString *representedAssetIdentifier; -@property (nonatomic, assign) int32_t imageRequestID; - -@property (nonatomic, copy) NSString *photoSelImageName; -@property (nonatomic, copy) NSString *photoDefImageName; - -@property (nonatomic, assign) BOOL showSelectBtn; -@property (assign, nonatomic) BOOL allowPreview; - -@end - - -@class TZAlbumModel; - -@interface TZAlbumCell : UITableViewCell - -@property (nonatomic, strong) TZAlbumModel *model; -@property (weak, nonatomic) UIButton *selectedCountButton; - -@end - - -@interface TZAssetCameraCell : UICollectionViewCell - -@property (nonatomic, strong) UIImageView *imageView; - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetCell.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetCell.m deleted file mode 100644 index f5264c0b..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetCell.m +++ /dev/null @@ -1,362 +0,0 @@ -// -// TZAssetCell.m -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import "TZAssetCell.h" -#import "TZAssetModel.h" -#import "UIView+Layout.h" -#import "TZImageManager.h" -#import "TZImagePickerController.h" -#import "TZProgressView.h" - -@interface TZAssetCell () -@property (weak, nonatomic) UIImageView *imageView; // The photo / 照片 -@property (weak, nonatomic) UIImageView *selectImageView; -@property (weak, nonatomic) UIView *bottomView; -@property (weak, nonatomic) UILabel *timeLength; - -@property (nonatomic, weak) UIImageView *videoImgView; -@property (nonatomic, strong) TZProgressView *progressView; -@property (nonatomic, assign) int32_t bigImageRequestID; -@end - -@implementation TZAssetCell - -- (void)setModel:(TZAssetModel *)model { - _model = model; - if (iOS8Later) { - self.representedAssetIdentifier = [[TZImageManager manager] getAssetIdentifier:model.asset]; - } - int32_t imageRequestID = [[TZImageManager manager] getPhotoWithAsset:model.asset photoWidth:self.tz_width completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - if (_progressView) { - self.progressView.hidden = YES; - self.imageView.alpha = 1.0; - } - // Set the cell's thumbnail image if it's still showing the same asset. - if (!iOS8Later) { - self.imageView.image = photo; return; - } - if ([self.representedAssetIdentifier isEqualToString:[[TZImageManager manager] getAssetIdentifier:model.asset]]) { - self.imageView.image = photo; - } else { - // NSLog(@"this cell is showing other asset"); - [[PHImageManager defaultManager] cancelImageRequest:self.imageRequestID]; - } - if (!isDegraded) { - self.imageRequestID = 0; - } - } progressHandler:nil networkAccessAllowed:NO]; - if (imageRequestID && self.imageRequestID && imageRequestID != self.imageRequestID) { - [[PHImageManager defaultManager] cancelImageRequest:self.imageRequestID]; - // NSLog(@"cancelImageRequest %d",self.imageRequestID); - } - self.imageRequestID = imageRequestID; - self.selectPhotoButton.selected = model.isSelected; - self.selectImageView.image = self.selectPhotoButton.isSelected ? [UIImage imageNamedFromMyBundle:self.photoSelImageName] : [UIImage imageNamedFromMyBundle:self.photoDefImageName]; - self.type = (NSInteger)model.type; - // 让宽度/高度小于 最小可选照片尺寸 的图片不能选中 - if (![[TZImageManager manager] isPhotoSelectableWithAsset:model.asset]) { - if (_selectImageView.hidden == NO) { - self.selectPhotoButton.hidden = YES; - _selectImageView.hidden = YES; - } - } - // 如果用户选中了该图片,提前获取一下大图 - if (model.isSelected) { - [self fetchBigImage]; - } - [self setNeedsLayout]; -} - -- (void)setShowSelectBtn:(BOOL)showSelectBtn { - _showSelectBtn = showSelectBtn; - if (!self.selectPhotoButton.hidden) { - self.selectPhotoButton.hidden = !showSelectBtn; - } - if (!self.selectImageView.hidden) { - self.selectImageView.hidden = !showSelectBtn; - } -} - -- (void)setType:(TZAssetCellType)type { - _type = type; - if (type == TZAssetCellTypePhoto || type == TZAssetCellTypeLivePhoto || (type == TZAssetCellTypePhotoGif && !self.allowPickingGif) || self.allowPickingMultipleVideo) { - _selectImageView.hidden = NO; - _selectPhotoButton.hidden = NO; - _bottomView.hidden = YES; - } else { // Video of Gif - _selectImageView.hidden = YES; - _selectPhotoButton.hidden = YES; - } - - if (type == TZAssetCellTypeVideo) { - self.bottomView.hidden = NO; - self.timeLength.text = _model.timeLength; - self.videoImgView.hidden = NO; - _timeLength.tz_left = self.videoImgView.tz_right; - _timeLength.textAlignment = NSTextAlignmentRight; - } else if (type == TZAssetCellTypePhotoGif && self.allowPickingGif) { - self.bottomView.hidden = NO; - self.timeLength.text = @"GIF"; - self.videoImgView.hidden = YES; - _timeLength.tz_left = 5; - _timeLength.textAlignment = NSTextAlignmentLeft; - } -} - -- (void)selectPhotoButtonClick:(UIButton *)sender { - if (self.didSelectPhotoBlock) { - self.didSelectPhotoBlock(sender.isSelected); - } - self.selectImageView.image = sender.isSelected ? [UIImage imageNamedFromMyBundle:self.photoSelImageName] : [UIImage imageNamedFromMyBundle:self.photoDefImageName]; - if (sender.isSelected) { - [UIView showOscillatoryAnimationWithLayer:_selectImageView.layer type:TZOscillatoryAnimationToBigger]; - // 用户选中了该图片,提前获取一下大图 - [self fetchBigImage]; - } else { // 取消选中,取消大图的获取 - if (_bigImageRequestID && _progressView) { - [[PHImageManager defaultManager] cancelImageRequest:_bigImageRequestID]; - [self hideProgressView]; - } - } -} - -- (void)hideProgressView { - self.progressView.hidden = YES; - self.imageView.alpha = 1.0; -} - -- (void)fetchBigImage { - _bigImageRequestID = [[TZImageManager manager] getPhotoWithAsset:_model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - if (_progressView) { - [self hideProgressView]; - } - } progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) { - if (_model.isSelected) { - progress = progress > 0.02 ? progress : 0.02;; - self.progressView.progress = progress; - self.progressView.hidden = NO; - self.imageView.alpha = 0.4; - if (progress >= 1) { - [self hideProgressView]; - } - } else { - *stop = YES; - [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; - } - } networkAccessAllowed:YES]; -} - -#pragma mark - Lazy load - -- (UIButton *)selectPhotoButton { - if (_selectImageView == nil) { - UIButton *selectPhotoButton = [[UIButton alloc] init]; - [selectPhotoButton addTarget:self action:@selector(selectPhotoButtonClick:) forControlEvents:UIControlEventTouchUpInside]; - [self.contentView addSubview:selectPhotoButton]; - _selectPhotoButton = selectPhotoButton; - } - return _selectPhotoButton; -} - -- (UIImageView *)imageView { - if (_imageView == nil) { - UIImageView *imageView = [[UIImageView alloc] init]; - imageView.contentMode = UIViewContentModeScaleAspectFill; - imageView.clipsToBounds = YES; - [self.contentView addSubview:imageView]; - _imageView = imageView; - - [self.contentView bringSubviewToFront:_selectImageView]; - [self.contentView bringSubviewToFront:_bottomView]; - } - return _imageView; -} - -- (UIImageView *)selectImageView { - if (_selectImageView == nil) { - UIImageView *selectImageView = [[UIImageView alloc] init]; - [self.contentView addSubview:selectImageView]; - _selectImageView = selectImageView; - } - return _selectImageView; -} - -- (UIView *)bottomView { - if (_bottomView == nil) { - UIView *bottomView = [[UIView alloc] init]; - static NSInteger rgb = 0; - bottomView.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.8]; - [self.contentView addSubview:bottomView]; - _bottomView = bottomView; - } - return _bottomView; -} - -- (UIImageView *)videoImgView { - if (_videoImgView == nil) { - UIImageView *videoImgView = [[UIImageView alloc] init]; - [videoImgView setImage:[UIImage imageNamedFromMyBundle:@"VideoSendIcon"]]; - [self.bottomView addSubview:videoImgView]; - _videoImgView = videoImgView; - } - return _videoImgView; -} - -- (UILabel *)timeLength { - if (_timeLength == nil) { - UILabel *timeLength = [[UILabel alloc] init]; - timeLength.font = [UIFont boldSystemFontOfSize:11]; - timeLength.textColor = [UIColor whiteColor]; - timeLength.textAlignment = NSTextAlignmentRight; - [self.bottomView addSubview:timeLength]; - _timeLength = timeLength; - } - return _timeLength; -} - -- (TZProgressView *)progressView { - if (_progressView == nil) { - _progressView = [[TZProgressView alloc] init]; - _progressView.hidden = YES; - [self addSubview:_progressView]; - } - return _progressView; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - if (self.allowPreview) { - _selectPhotoButton.frame = CGRectMake(self.tz_width - 44, 0, 44, 44); - } else { - _selectPhotoButton.frame = self.bounds; - } - _selectImageView.frame = CGRectMake(self.tz_width - 27, 0, 27, 27); - _imageView.frame = CGRectMake(0, 0, self.tz_width, self.tz_height); - - static CGFloat progressWH = 20; - CGFloat progressXY = (self.tz_width - progressWH) / 2; - _progressView.frame = CGRectMake(progressXY, progressXY, progressWH, progressWH); - - _bottomView.frame = CGRectMake(0, self.tz_height - 17, self.tz_width, 17); - _videoImgView.frame = CGRectMake(8, 0, 17, 17); - _timeLength.frame = CGRectMake(self.videoImgView.tz_right, 0, self.tz_width - self.videoImgView.tz_right - 5, 17); - - self.type = (NSInteger)self.model.type; - self.showSelectBtn = self.showSelectBtn; -} - -@end - -@interface TZAlbumCell () -@property (weak, nonatomic) UIImageView *posterImageView; -@property (weak, nonatomic) UILabel *titleLabel; -@end - -@implementation TZAlbumCell - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - return self; -} - -- (void)setModel:(TZAlbumModel *)model { - _model = model; - - NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:model.name attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor blackColor]}]; - NSAttributedString *countString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@" (%zd)",model.count] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor lightGrayColor]}]; - [nameString appendAttributedString:countString]; - self.titleLabel.attributedText = nameString; - [[TZImageManager manager] getPostImageWithAlbumModel:model completion:^(UIImage *postImage) { - self.posterImageView.image = postImage; - }]; - if (model.selectedCount) { - self.selectedCountButton.hidden = NO; - [self.selectedCountButton setTitle:[NSString stringWithFormat:@"%zd",model.selectedCount] forState:UIControlStateNormal]; - } else { - self.selectedCountButton.hidden = YES; - } -} - -/// For fitting iOS6 -- (void)layoutSubviews { - if (iOS7Later) [super layoutSubviews]; - _selectedCountButton.frame = CGRectMake(self.tz_width - 24 - 30, 23, 24, 24); - NSInteger titleHeight = ceil(self.titleLabel.font.lineHeight); - self.titleLabel.frame = CGRectMake(80, (self.tz_height - titleHeight) / 2, self.tz_width - 80 - 50, titleHeight); - self.posterImageView.frame = CGRectMake(0, 0, 70, 70); -} - -- (void)layoutSublayersOfLayer:(CALayer *)layer { - if (iOS7Later) [super layoutSublayersOfLayer:layer]; -} - -#pragma mark - Lazy load - -- (UIImageView *)posterImageView { - if (_posterImageView == nil) { - UIImageView *posterImageView = [[UIImageView alloc] init]; - posterImageView.contentMode = UIViewContentModeScaleAspectFill; - posterImageView.clipsToBounds = YES; - [self.contentView addSubview:posterImageView]; - _posterImageView = posterImageView; - } - return _posterImageView; -} - -- (UILabel *)titleLabel { - if (_titleLabel == nil) { - UILabel *titleLabel = [[UILabel alloc] init]; - titleLabel.font = [UIFont boldSystemFontOfSize:17]; - titleLabel.textColor = [UIColor blackColor]; - titleLabel.textAlignment = NSTextAlignmentLeft; - [self.contentView addSubview:titleLabel]; - _titleLabel = titleLabel; - } - return _titleLabel; -} - -- (UIButton *)selectedCountButton { - if (_selectedCountButton == nil) { - UIButton *selectedCountButton = [[UIButton alloc] init]; - selectedCountButton.layer.cornerRadius = 12; - selectedCountButton.clipsToBounds = YES; - selectedCountButton.backgroundColor = [UIColor redColor]; - [selectedCountButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - selectedCountButton.titleLabel.font = [UIFont systemFontOfSize:15]; - [self.contentView addSubview:selectedCountButton]; - _selectedCountButton = selectedCountButton; - } - return _selectedCountButton; -} - -@end - - - -@implementation TZAssetCameraCell - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = [UIColor whiteColor]; - _imageView = [[UIImageView alloc] init]; - _imageView.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.500]; - _imageView.contentMode = UIViewContentModeScaleAspectFill; - [self addSubview:_imageView]; - self.clipsToBounds = YES; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - _imageView.frame = self.bounds; -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetModel.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetModel.h deleted file mode 100755 index 76a53e92..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetModel.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// TZAssetModel.h -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import -#import - -typedef enum : NSUInteger { - TZAssetModelMediaTypePhoto = 0, - TZAssetModelMediaTypeLivePhoto, - TZAssetModelMediaTypePhotoGif, - TZAssetModelMediaTypeVideo, - TZAssetModelMediaTypeAudio -} TZAssetModelMediaType; - -@class PHAsset; -@interface TZAssetModel : NSObject - -@property (nonatomic, strong) id asset; ///< PHAsset or ALAsset -@property (nonatomic, assign) BOOL isSelected; ///< The select status of a photo, default is No -@property (nonatomic, assign) TZAssetModelMediaType type; -@property (nonatomic, copy) NSString *timeLength; - -/// Init a photo dataModel With a asset -/// 用一个PHAsset/ALAsset实例,初始化一个照片模型 -+ (instancetype)modelWithAsset:(id)asset type:(TZAssetModelMediaType)type; -+ (instancetype)modelWithAsset:(id)asset type:(TZAssetModelMediaType)type timeLength:(NSString *)timeLength; - -@end - - -@class PHFetchResult; -@interface TZAlbumModel : NSObject - -@property (nonatomic, strong) NSString *name; ///< The album name -@property (nonatomic, assign) NSInteger count; ///< Count of photos the album contain -@property (nonatomic, strong) id result; ///< PHFetchResult or ALAssetsGroup - -@property (nonatomic, strong) NSArray *models; -@property (nonatomic, strong) NSArray *selectedModels; -@property (nonatomic, assign) NSUInteger selectedCount; - -@property (nonatomic, assign) BOOL isCameraRoll; - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetModel.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetModel.m deleted file mode 100644 index 1919156c..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZAssetModel.m +++ /dev/null @@ -1,73 +0,0 @@ -// -// TZAssetModel.m -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import "TZAssetModel.h" -#import "TZImageManager.h" - -@implementation TZAssetModel - -+ (instancetype)modelWithAsset:(id)asset type:(TZAssetModelMediaType)type{ - TZAssetModel *model = [[TZAssetModel alloc] init]; - model.asset = asset; - model.isSelected = NO; - model.type = type; - return model; -} - -+ (instancetype)modelWithAsset:(id)asset type:(TZAssetModelMediaType)type timeLength:(NSString *)timeLength { - TZAssetModel *model = [self modelWithAsset:asset type:type]; - model.timeLength = timeLength; - return model; -} - -@end - - - -@implementation TZAlbumModel - -- (void)setResult:(id)result { - _result = result; - BOOL allowPickingImage = [[[NSUserDefaults standardUserDefaults] objectForKey:@"tz_allowPickingImage"] isEqualToString:@"1"]; - BOOL allowPickingVideo = [[[NSUserDefaults standardUserDefaults] objectForKey:@"tz_allowPickingVideo"] isEqualToString:@"1"]; - [[TZImageManager manager] getAssetsFromFetchResult:result allowPickingVideo:allowPickingVideo allowPickingImage:allowPickingImage completion:^(NSArray *models) { - _models = models; - if (_selectedModels) { - [self checkSelectedModels]; - } - }]; -} - -- (void)setSelectedModels:(NSArray *)selectedModels { - _selectedModels = selectedModels; - if (_models) { - [self checkSelectedModels]; - } -} - -- (void)checkSelectedModels { - self.selectedCount = 0; - NSMutableArray *selectedAssets = [NSMutableArray array]; - for (TZAssetModel *model in _selectedModels) { - [selectedAssets addObject:model.asset]; - } - for (TZAssetModel *model in _models) { - if ([[TZImageManager manager] isAssetsArray:selectedAssets containAsset:model.asset]) { - self.selectedCount ++; - } - } -} - -- (NSString *)name { - if (_name) { - return _name; - } - return @""; -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.h deleted file mode 100644 index 4ebb1925..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// TZGifPhotoPreviewController.h -// TZImagePickerController -// -// Created by ttouch on 2016/12/13. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import - -@class TZAssetModel; -@interface TZGifPhotoPreviewController : UIViewController - -@property (nonatomic, strong) TZAssetModel *model; - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.m deleted file mode 100644 index 2b1b6abf..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.m +++ /dev/null @@ -1,149 +0,0 @@ -// -// TZGifPhotoPreviewController.m -// TZImagePickerController -// -// Created by ttouch on 2016/12/13. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import "TZGifPhotoPreviewController.h" -#import "TZImagePickerController.h" -#import "TZAssetModel.h" -#import "UIView+Layout.h" -#import "TZPhotoPreviewCell.h" -#import "TZImageManager.h" - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -@interface TZGifPhotoPreviewController () { - UIView *_toolBar; - UIButton *_doneButton; - UIProgressView *_progress; - - TZPhotoPreviewView *_previewView; - - UIStatusBarStyle _originStatusBarStyle; -} -@end - -@implementation TZGifPhotoPreviewController - -- (void)viewDidLoad { - [super viewDidLoad]; - self.view.backgroundColor = [UIColor blackColor]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (tzImagePickerVc) { - self.navigationItem.title = [NSString stringWithFormat:@"GIF %@",tzImagePickerVc.previewBtnTitleStr]; - } - [self configPreviewView]; - [self configBottomToolBar]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - _originStatusBarStyle = [UIApplication sharedApplication].statusBarStyle; - [UIApplication sharedApplication].statusBarStyle = iOS7Later ? UIStatusBarStyleLightContent : UIStatusBarStyleBlackOpaque; -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - [UIApplication sharedApplication].statusBarStyle = _originStatusBarStyle; -} - -- (void)configPreviewView { - _previewView = [[TZPhotoPreviewView alloc] initWithFrame:CGRectZero]; - _previewView.model = self.model; - __weak typeof(self) weakSelf = self; - [_previewView setSingleTapGestureBlock:^{ - [weakSelf signleTapAction]; - }]; - [self.view addSubview:_previewView]; -} - -- (void)configBottomToolBar { - _toolBar = [[UIView alloc] initWithFrame:CGRectZero]; - CGFloat rgb = 34 / 255.0; - _toolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.7]; - - _doneButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _doneButton.titleLabel.font = [UIFont systemFontOfSize:16]; - [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (tzImagePickerVc) { - [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal]; - [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal]; - } else { - [_doneButton setTitle:[NSBundle tz_localizedStringForKey:@"Done"] forState:UIControlStateNormal]; - [_doneButton setTitleColor:[UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0] forState:UIControlStateNormal]; - } - [_toolBar addSubview:_doneButton]; - - UILabel *byteLabel = [[UILabel alloc] init]; - byteLabel.textColor = [UIColor whiteColor]; - byteLabel.font = [UIFont systemFontOfSize:13]; - byteLabel.frame = CGRectMake(10, 0, 100, 44); - [[TZImageManager manager] getPhotosBytesWithArray:@[_model] completion:^(NSString *totalBytes) { - byteLabel.text = totalBytes; - }]; - [_toolBar addSubview:byteLabel]; - - [self.view addSubview:_toolBar]; -} - -#pragma mark - Layout - -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - - _previewView.frame = self.view.bounds; - _previewView.scrollView.frame = self.view.bounds; - CGFloat toolBarHeight = [TZCommonTools tz_isIPhoneX] ? 44 + (83 - 49) : 44; - _toolBar.frame = CGRectMake(0, self.view.tz_height - toolBarHeight, self.view.tz_width, toolBarHeight); - _doneButton.frame = CGRectMake(self.view.tz_width - 44 - 12, 0, 44, 44); -} - -#pragma mark - Click Event - -- (void)signleTapAction { - _toolBar.hidden = !_toolBar.isHidden; - [self.navigationController setNavigationBarHidden:_toolBar.isHidden]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (iOS7Later) { - if (_toolBar.isHidden) { - [UIApplication sharedApplication].statusBarHidden = YES; - } else if (tzImagePickerVc.needShowStatusBar) { - [UIApplication sharedApplication].statusBarHidden = NO; - } - } -} - -- (void)doneButtonClick { - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - if (self.navigationController) { - if (imagePickerVc.autoDismiss) { - [self.navigationController dismissViewControllerAnimated:YES completion:^{ - [self callDelegateMethod]; - }]; - } - } else { - [self dismissViewControllerAnimated:YES completion:^{ - [self callDelegateMethod]; - }]; - } -} - -- (void)callDelegateMethod { - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - UIImage *animatedImage = _previewView.imageView.image; - if ([imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingGifImage:sourceAssets:)]) { - [imagePickerVc.pickerDelegate imagePickerController:imagePickerVc didFinishPickingGifImage:animatedImage sourceAssets:_model.asset]; - } - if (imagePickerVc.didFinishPickingGifImageHandle) { - imagePickerVc.didFinishPickingGifImageHandle(animatedImage,_model.asset); - } -} - -#pragma clang diagnostic pop - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageCropManager.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageCropManager.h deleted file mode 100644 index 9dc1cc1f..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageCropManager.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// TZImageCropManager.h -// TZImagePickerController -// -// Created by 谭真 on 2016/12/5. -// Copyright © 2016年 谭真. All rights reserved. -// 图片裁剪管理类 - -#import -#import - -@interface TZImageCropManager : NSObject - -/// 裁剪框背景的处理 -+ (void)overlayClippingWithView:(UIView *)view cropRect:(CGRect)cropRect containerView:(UIView *)containerView needCircleCrop:(BOOL)needCircleCrop; - -/* - 1.7.2 为了解决多位同学对于图片裁剪的需求,我这两天有空便在研究图片裁剪 - 幸好有tuyou的PhotoTweaks库做参考,裁剪的功能实现起来简单许多 - 该方法和其内部引用的方法基本来自于tuyou的PhotoTweaks库,我做了稍许删减和修改 - 感谢tuyou同学在github开源了优秀的裁剪库PhotoTweaks,表示感谢 - PhotoTweaks库的github链接:https://github.com/itouch2/PhotoTweaks - */ -/// 获得裁剪后的图片 -+ (UIImage *)cropImageView:(UIImageView *)imageView toRect:(CGRect)rect zoomScale:(double)zoomScale containerView:(UIView *)containerView; - -/// 获取圆形图片 -+ (UIImage *)circularClipImage:(UIImage *)image; - -@end - - -/// 该分类的代码来自SDWebImage:https://github.com/rs/SDWebImage -/// 为了防止冲突,我将分类名字和方法名字做了修改 -@interface UIImage (TZGif) - -+ (UIImage *)sd_tz_animatedGIFWithData:(NSData *)data; - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageCropManager.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageCropManager.m deleted file mode 100644 index 6485a804..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageCropManager.m +++ /dev/null @@ -1,194 +0,0 @@ -// -// TZImageCropManager.m -// TZImagePickerController -// -// Created by 谭真 on 2016/12/5. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import "TZImageCropManager.h" -#import "UIView+Layout.h" -#import -#import "TZImageManager.h" - -@implementation TZImageCropManager - -/// 裁剪框背景的处理 -+ (void)overlayClippingWithView:(UIView *)view cropRect:(CGRect)cropRect containerView:(UIView *)containerView needCircleCrop:(BOOL)needCircleCrop { - UIBezierPath *path= [UIBezierPath bezierPathWithRect:[UIScreen mainScreen].bounds]; - CAShapeLayer *layer = [CAShapeLayer layer]; - if (needCircleCrop) { // 圆形裁剪框 - [path appendPath:[UIBezierPath bezierPathWithArcCenter:containerView.center radius:cropRect.size.width / 2 startAngle:0 endAngle: 2 * M_PI clockwise:NO]]; - } else { // 矩形裁剪框 - [path appendPath:[UIBezierPath bezierPathWithRect:cropRect]]; - } - layer.path = path.CGPath; - layer.fillRule = kCAFillRuleEvenOdd; - layer.fillColor = [[UIColor blackColor] CGColor]; - layer.opacity = 0.5; - [view.layer addSublayer:layer]; -} - -/// 获得裁剪后的图片 -+ (UIImage *)cropImageView:(UIImageView *)imageView toRect:(CGRect)rect zoomScale:(double)zoomScale containerView:(UIView *)containerView { - CGAffineTransform transform = CGAffineTransformIdentity; - // 平移的处理 - CGRect imageViewRect = [imageView convertRect:imageView.bounds toView:containerView]; - CGPoint point = CGPointMake(imageViewRect.origin.x + imageViewRect.size.width / 2, imageViewRect.origin.y + imageViewRect.size.height / 2); - CGFloat xMargin = containerView.tz_width - CGRectGetMaxX(rect) - rect.origin.x; - CGPoint zeroPoint = CGPointMake((CGRectGetWidth(containerView.frame) - xMargin) / 2, containerView.center.y); - CGPoint translation = CGPointMake(point.x - zeroPoint.x, point.y - zeroPoint.y); - transform = CGAffineTransformTranslate(transform, translation.x, translation.y); - // 缩放的处理 - transform = CGAffineTransformScale(transform, zoomScale, zoomScale); - - CGImageRef imageRef = [self newTransformedImage:transform - sourceImage:imageView.image.CGImage - sourceSize:imageView.image.size - outputWidth:rect.size.width * [UIScreen mainScreen].scale - cropSize:rect.size - imageViewSize:imageView.frame.size]; - UIImage *cropedImage = [UIImage imageWithCGImage:imageRef]; - cropedImage = [[TZImageManager manager] fixOrientation:cropedImage]; - CGImageRelease(imageRef); - return cropedImage; -} - -+ (CGImageRef)newTransformedImage:(CGAffineTransform)transform sourceImage:(CGImageRef)sourceImage sourceSize:(CGSize)sourceSize outputWidth:(CGFloat)outputWidth cropSize:(CGSize)cropSize imageViewSize:(CGSize)imageViewSize { - CGImageRef source = [self newScaledImage:sourceImage toSize:sourceSize]; - - CGFloat aspect = cropSize.height/cropSize.width; - CGSize outputSize = CGSizeMake(outputWidth, outputWidth*aspect); - - CGContextRef context = CGBitmapContextCreate(NULL, outputSize.width, outputSize.height, CGImageGetBitsPerComponent(source), 0, CGImageGetColorSpace(source), CGImageGetBitmapInfo(source)); - CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]); - CGContextFillRect(context, CGRectMake(0, 0, outputSize.width, outputSize.height)); - - CGAffineTransform uiCoords = CGAffineTransformMakeScale(outputSize.width / cropSize.width, outputSize.height / cropSize.height); - uiCoords = CGAffineTransformTranslate(uiCoords, cropSize.width/2.0, cropSize.height / 2.0); - uiCoords = CGAffineTransformScale(uiCoords, 1.0, -1.0); - CGContextConcatCTM(context, uiCoords); - - CGContextConcatCTM(context, transform); - CGContextScaleCTM(context, 1.0, -1.0); - - CGContextDrawImage(context, CGRectMake(-imageViewSize.width/2, -imageViewSize.height/2.0, imageViewSize.width, imageViewSize.height), source); - CGImageRef resultRef = CGBitmapContextCreateImage(context); - CGContextRelease(context); - CGImageRelease(source); - return resultRef; -} - -+ (CGImageRef)newScaledImage:(CGImageRef)source toSize:(CGSize)size { - CGSize srcSize = size; - CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB(); - CGContextRef context = CGBitmapContextCreate(NULL, size.width, size.height, 8, 0, rgbColorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); - CGColorSpaceRelease(rgbColorSpace); - - CGContextSetInterpolationQuality(context, kCGInterpolationNone); - CGContextTranslateCTM(context, size.width/2, size.height/2); - - CGContextDrawImage(context, CGRectMake(-srcSize.width/2, -srcSize.height/2, srcSize.width, srcSize.height), source); - - CGImageRef resultRef = CGBitmapContextCreateImage(context); - CGContextRelease(context); - return resultRef; -} - -/// 获取圆形图片 -+ (UIImage *)circularClipImage:(UIImage *)image { - UIGraphicsBeginImageContextWithOptions(image.size, NO, [UIScreen mainScreen].scale); - - CGContextRef ctx = UIGraphicsGetCurrentContext(); - CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height); - CGContextAddEllipseInRect(ctx, rect); - CGContextClip(ctx); - - [image drawInRect:rect]; - UIImage *circleImage = UIGraphicsGetImageFromCurrentImageContext(); - - UIGraphicsEndImageContext(); - return circleImage; -} - -@end - - -@implementation UIImage (TZGif) - -+ (UIImage *)sd_tz_animatedGIFWithData:(NSData *)data { - if (!data) { - return nil; - } - - CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); - - size_t count = CGImageSourceGetCount(source); - - UIImage *animatedImage; - - if (count <= 1) { - animatedImage = [[UIImage alloc] initWithData:data]; - } - else { - NSMutableArray *images = [NSMutableArray array]; - - NSTimeInterval duration = 0.0f; - - for (size_t i = 0; i < count; i++) { - CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL); - if (!image) { - continue; - } - - duration += [self sd_frameDurationAtIndex:i source:source]; - - [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]]; - - CGImageRelease(image); - } - - if (!duration) { - duration = (1.0f / 10.0f) * count; - } - - animatedImage = [UIImage animatedImageWithImages:images duration:duration]; - } - - CFRelease(source); - - return animatedImage; -} - -+ (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { - float frameDuration = 0.1f; - CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); - NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; - NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; - - NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; - if (delayTimeUnclampedProp) { - frameDuration = [delayTimeUnclampedProp floatValue]; - } - else { - - NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; - if (delayTimeProp) { - frameDuration = [delayTimeProp floatValue]; - } - } - - // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. - // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify - // a duration of <= 10 ms. See and - // for more information. - - if (frameDuration < 0.011f) { - frameDuration = 0.100f; - } - - CFRelease(cfFrameProperties); - return frameDuration; -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageManager.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageManager.h deleted file mode 100755 index 4cd7437b..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageManager.h +++ /dev/null @@ -1,112 +0,0 @@ -// -// TZImageManager.h -// TZImagePickerController -// -// Created by 谭真 on 16/1/4. -// Copyright © 2016年 谭真. All rights reserved. -// 图片资源获取管理类 - -#import -#import -#import -#import -#import "TZAssetModel.h" - -@class TZAlbumModel,TZAssetModel; -@protocol TZImagePickerControllerDelegate; -@interface TZImageManager : NSObject - -@property (nonatomic, strong) PHCachingImageManager *cachingImageManager; - -+ (instancetype)manager NS_SWIFT_NAME(default()); -+ (void)deallocManager; - -@property (assign, nonatomic) id pickerDelegate; - -@property (nonatomic, assign) BOOL shouldFixOrientation; - -/// Default is 600px / 默认600像素宽 -@property (nonatomic, assign) CGFloat photoPreviewMaxWidth; -/// The pixel width of output image, Default is 828px / 导出图片的宽度,默认828像素宽 -@property (nonatomic, assign) CGFloat photoWidth; - -/// Default is 4, Use in photos collectionView in TZPhotoPickerController -/// 默认4列, TZPhotoPickerController中的照片collectionView -@property (nonatomic, assign) NSInteger columnNumber; - -/// Sort photos ascending by modificationDate,Default is YES -/// 对照片排序,按修改时间升序,默认是YES。如果设置为NO,最新的照片会显示在最前面,内部的拍照按钮会排在第一个 -@property (nonatomic, assign) BOOL sortAscendingByModificationDate; - -/// Minimum selectable photo width, Default is 0 -/// 最小可选中的图片宽度,默认是0,小于这个宽度的图片不可选中 -@property (nonatomic, assign) NSInteger minPhotoWidthSelectable; -@property (nonatomic, assign) NSInteger minPhotoHeightSelectable; -@property (nonatomic, assign) BOOL hideWhenCanNotSelect; - -/// Return YES if Authorized 返回YES如果得到了授权 -- (BOOL)authorizationStatusAuthorized; -+ (NSInteger)authorizationStatus; -- (void)requestAuthorizationWithCompletion:(void (^)())completion; - -/// Get Album 获得相册/相册数组 -- (void)getCameraRollAlbum:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(TZAlbumModel *model))completion; -- (void)getAllAlbums:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(NSArray *models))completion; - -/// Get Assets 获得Asset数组 -- (void)getAssetsFromFetchResult:(id)result allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(NSArray *models))completion; -- (void)getAssetFromFetchResult:(id)result atIndex:(NSInteger)index allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(TZAssetModel *model))completion; - -/// Get photo 获得照片 -- (void)getPostImageWithAlbumModel:(TZAlbumModel *)model completion:(void (^)(UIImage *postImage))completion; - -- (int32_t)getPhotoWithAsset:(id)asset completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion; -- (int32_t)getPhotoWithAsset:(id)asset photoWidth:(CGFloat)photoWidth completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion; -- (int32_t)getPhotoWithAsset:(id)asset completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler networkAccessAllowed:(BOOL)networkAccessAllowed; -- (int32_t)getPhotoWithAsset:(id)asset photoWidth:(CGFloat)photoWidth completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler networkAccessAllowed:(BOOL)networkAccessAllowed; - -/// Get full Image 获取原图 -/// 如下两个方法completion一般会调多次,一般会先返回缩略图,再返回原图(详见方法内部使用的系统API的说明),如果info[PHImageResultIsDegradedKey] 为 YES,则表明当前返回的是缩略图,否则是原图。 -- (void)getOriginalPhotoWithAsset:(id)asset completion:(void (^)(UIImage *photo,NSDictionary *info))completion; -- (void)getOriginalPhotoWithAsset:(id)asset newCompletion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion; -// 该方法中,completion只会走一次 -- (void)getOriginalPhotoDataWithAsset:(id)asset completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion; - -/// Save photo 保存照片 -- (void)savePhotoWithImage:(UIImage *)image completion:(void (^)(NSError *error))completion; -- (void)savePhotoWithImage:(UIImage *)image location:(CLLocation *)location completion:(void (^)(NSError *error))completion; - -/// Get video 获得视频 -- (void)getVideoWithAsset:(id)asset completion:(void (^)(AVPlayerItem * playerItem, NSDictionary * info))completion; -- (void)getVideoWithAsset:(id)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler completion:(void (^)(AVPlayerItem *, NSDictionary *))completion; - -/// Export video 导出视频 presetName: 预设名字,默认值是AVAssetExportPreset640x480 -- (void)getVideoOutputPathWithAsset:(id)asset success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure; -- (void)getVideoOutputPathWithAsset:(id)asset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure; -/// Deprecated, Use -getVideoOutputPathWithAsset:failure:success: -- (void)getVideoOutputPathWithAsset:(id)asset completion:(void (^)(NSString *outputPath))completion __attribute__((deprecated("Use -getVideoOutputPathWithAsset:failure:success:"))); - -/// Get photo bytes 获得一组照片的大小 -- (void)getPhotosBytesWithArray:(NSArray *)photos completion:(void (^)(NSString *totalBytes))completion; - -/// Judge is a assets array contain the asset 判断一个assets数组是否包含这个asset -- (BOOL)isAssetsArray:(NSArray *)assets containAsset:(id)asset; - -- (NSString *)getAssetIdentifier:(id)asset; -- (BOOL)isCameraRollAlbum:(id)metadata; - -/// 检查照片大小是否满足最小要求 -- (BOOL)isPhotoSelectableWithAsset:(id)asset; -- (CGSize)photoSizeWithAsset:(id)asset; - -/// 修正图片转向 -- (UIImage *)fixOrientation:(UIImage *)aImage; - -/// 获取asset的资源类型 -- (TZAssetModelMediaType)getAssetType:(id)asset; - -@end - -//@interface TZSortDescriptor : NSSortDescriptor -// -//@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageManager.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageManager.m deleted file mode 100755 index e4d7ab3b..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImageManager.m +++ /dev/null @@ -1,1090 +0,0 @@ -// -// TZImageManager.m -// TZImagePickerController -// -// Created by 谭真 on 16/1/4. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import "TZImageManager.h" -#import -#import "TZAssetModel.h" -#import "TZImagePickerController.h" - -@interface TZImageManager () -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -@property (nonatomic, strong) ALAssetsLibrary *assetLibrary; -@end - -@implementation TZImageManager - -CGSize AssetGridThumbnailSize; -CGFloat TZScreenWidth; -CGFloat TZScreenScale; - -static TZImageManager *manager; -static dispatch_once_t onceToken; - -+ (instancetype)manager { - dispatch_once(&onceToken, ^{ - manager = [[self alloc] init]; - if (iOS8Later) { - // manager.cachingImageManager = [[PHCachingImageManager alloc] init]; - // manager.cachingImageManager.allowsCachingHighQualityImages = YES; - } - - [manager configTZScreenWidth]; - }); - return manager; -} - -+ (void)deallocManager { - onceToken = 0; - manager = nil; -} - -- (void)setPhotoWidth:(CGFloat)photoWidth { - _photoWidth = photoWidth; - TZScreenWidth = photoWidth / 2; -} - -- (void)setColumnNumber:(NSInteger)columnNumber { - [self configTZScreenWidth]; - - _columnNumber = columnNumber; - CGFloat margin = 4; - CGFloat itemWH = (TZScreenWidth - 2 * margin - 4) / columnNumber - margin; - AssetGridThumbnailSize = CGSizeMake(itemWH * TZScreenScale, itemWH * TZScreenScale); -} - -- (void)configTZScreenWidth { - TZScreenWidth = [UIScreen mainScreen].bounds.size.width; - // 测试发现,如果scale在plus真机上取到3.0,内存会增大特别多。故这里写死成2.0 - TZScreenScale = 2.0; - if (TZScreenWidth > 700) { - TZScreenScale = 1.5; - } -} - -- (ALAssetsLibrary *)assetLibrary { - if (_assetLibrary == nil) _assetLibrary = [[ALAssetsLibrary alloc] init]; - return _assetLibrary; -} - -/// Return YES if Authorized 返回YES如果得到了授权 -- (BOOL)authorizationStatusAuthorized { - NSInteger status = [self.class authorizationStatus]; - if (status == 0) { - /** - * 当某些情况下AuthorizationStatus == AuthorizationStatusNotDetermined时,无法弹出系统首次使用的授权alertView,系统应用设置里亦没有相册的设置,此时将无法使用,故作以下操作,弹出系统首次使用的授权alertView - */ - [self requestAuthorizationWithCompletion:nil]; - } - - return status == 3; -} - -+ (NSInteger)authorizationStatus { - if (iOS8Later) { - return [PHPhotoLibrary authorizationStatus]; - } else { - return [ALAssetsLibrary authorizationStatus]; - } - return NO; -} - -- (void)requestAuthorizationWithCompletion:(void (^)())completion { - void (^callCompletionBlock)() = ^(){ - dispatch_async(dispatch_get_main_queue(), ^{ - if (completion) { - completion(); - } - }); - }; - - if (iOS8Later) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { - callCompletionBlock(); - }]; - }); - } else { - [self.assetLibrary enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) { - callCompletionBlock(); - } failureBlock:^(NSError *error) { - callCompletionBlock(); - }]; - } -} - -#pragma mark - Get Album - -/// Get Album 获得相册/相册数组 -- (void)getCameraRollAlbum:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(TZAlbumModel *))completion{ - __block TZAlbumModel *model; - if (iOS8Later) { - PHFetchOptions *option = [[PHFetchOptions alloc] init]; - if (!allowPickingVideo) option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld", PHAssetMediaTypeImage]; - if (!allowPickingImage) option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld", - PHAssetMediaTypeVideo]; - // option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"modificationDate" ascending:self.sortAscendingByModificationDate]]; - if (!self.sortAscendingByModificationDate) { - option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:self.sortAscendingByModificationDate]]; - } - PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil]; - for (PHAssetCollection *collection in smartAlbums) { - // 有可能是PHCollectionList类的的对象,过滤掉 - if (![collection isKindOfClass:[PHAssetCollection class]]) continue; - if ([self isCameraRollAlbum:collection]) { - PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:collection options:option]; - model = [self modelWithResult:fetchResult name:collection.localizedTitle isCameraRoll:YES]; - if (completion) completion(model); - break; - } - } - } else { - [self.assetLibrary enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) { - if ([group numberOfAssets] < 1) return; - if ([self isCameraRollAlbum:group]) { - NSString *name = [group valueForProperty:ALAssetsGroupPropertyName]; - model = [self modelWithResult:group name:name isCameraRoll:YES]; - if (completion) completion(model); - *stop = YES; - } - } failureBlock:nil]; - } -} - -- (void)getAllAlbums:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(NSArray *))completion{ - NSMutableArray *albumArr = [NSMutableArray array]; - if (iOS8Later) { - PHFetchOptions *option = [[PHFetchOptions alloc] init]; - if (!allowPickingVideo) option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld", PHAssetMediaTypeImage]; - if (!allowPickingImage) option.predicate = [NSPredicate predicateWithFormat:@"mediaType == %ld", - PHAssetMediaTypeVideo]; - // option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"modificationDate" ascending:self.sortAscendingByModificationDate]]; - if (!self.sortAscendingByModificationDate) { - option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:self.sortAscendingByModificationDate]]; - } - // 我的照片流 1.6.10重新加入.. - PHFetchResult *myPhotoStreamAlbum = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumMyPhotoStream options:nil]; - PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil]; - PHFetchResult *topLevelUserCollections = [PHCollectionList fetchTopLevelUserCollectionsWithOptions:nil]; - PHFetchResult *syncedAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumSyncedAlbum options:nil]; - PHFetchResult *sharedAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumCloudShared options:nil]; - NSArray *allAlbums = @[myPhotoStreamAlbum,smartAlbums,topLevelUserCollections,syncedAlbums,sharedAlbums]; - for (PHFetchResult *fetchResult in allAlbums) { - for (PHAssetCollection *collection in fetchResult) { - // 有可能是PHCollectionList类的的对象,过滤掉 - if (![collection isKindOfClass:[PHAssetCollection class]]) continue; - PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:collection options:option]; - if (fetchResult.count < 1) continue; - - if ([self.pickerDelegate respondsToSelector:@selector(isAlbumCanSelect:result:)]) { - if (![self.pickerDelegate isAlbumCanSelect:collection.localizedTitle result:fetchResult]) { - continue; - } - } - - if ([collection.localizedTitle tz_containsString:@"Hidden"] || [collection.localizedTitle isEqualToString:@"已隐藏"]) continue; - if ([collection.localizedTitle tz_containsString:@"Deleted"] || [collection.localizedTitle isEqualToString:@"最近删除"]) continue; - if ([self isCameraRollAlbum:collection]) { - [albumArr insertObject:[self modelWithResult:fetchResult name:collection.localizedTitle isCameraRoll:YES] atIndex:0]; - } else { - [albumArr addObject:[self modelWithResult:fetchResult name:collection.localizedTitle isCameraRoll:NO]]; - } - } - } - if (completion && albumArr.count > 0) completion(albumArr); - } else { - [self.assetLibrary enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) { - if (group == nil) { - if (completion && albumArr.count > 0) completion(albumArr); - } - if ([group numberOfAssets] < 1) return; - NSString *name = [group valueForProperty:ALAssetsGroupPropertyName]; - - if ([self.pickerDelegate respondsToSelector:@selector(isAlbumCanSelect:result:)]) { - if (![self.pickerDelegate isAlbumCanSelect:name result:group]) { - return; - } - } - - if ([self isCameraRollAlbum:group]) { - [albumArr insertObject:[self modelWithResult:group name:name isCameraRoll:YES] atIndex:0]; - } else if ([name isEqualToString:@"My Photo Stream"] || [name isEqualToString:@"我的照片流"]) { - if (albumArr.count) { - [albumArr insertObject:[self modelWithResult:group name:name isCameraRoll:NO] atIndex:1]; - } else { - [albumArr addObject:[self modelWithResult:group name:name isCameraRoll:NO]]; - } - } else { - [albumArr addObject:[self modelWithResult:group name:name isCameraRoll:NO]]; - } - } failureBlock:nil]; - } -} - -#pragma mark - Get Assets - -/// Get Assets 获得照片数组 -- (void)getAssetsFromFetchResult:(id)result allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(NSArray *))completion { - NSMutableArray *photoArr = [NSMutableArray array]; - if ([result isKindOfClass:[PHFetchResult class]]) { - PHFetchResult *fetchResult = (PHFetchResult *)result; - [fetchResult enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - TZAssetModel *model = [self assetModelWithAsset:obj allowPickingVideo:allowPickingVideo allowPickingImage:allowPickingImage]; - if (model) { - [photoArr addObject:model]; - } - }]; - if (completion) completion(photoArr); - } else if ([result isKindOfClass:[ALAssetsGroup class]]) { - ALAssetsGroup *group = (ALAssetsGroup *)result; - if (allowPickingImage && allowPickingVideo) { - [group setAssetsFilter:[ALAssetsFilter allAssets]]; - } else if (allowPickingVideo) { - [group setAssetsFilter:[ALAssetsFilter allVideos]]; - } else if (allowPickingImage) { - [group setAssetsFilter:[ALAssetsFilter allPhotos]]; - } - ALAssetsGroupEnumerationResultsBlock resultBlock = ^(ALAsset *result, NSUInteger index, BOOL *stop) { - if (result == nil) { - if (completion) completion(photoArr); - } - TZAssetModel *model = [self assetModelWithAsset:result allowPickingVideo:allowPickingVideo allowPickingImage:allowPickingImage]; - if (model) { - [photoArr addObject:model]; - } - }; - if (self.sortAscendingByModificationDate) { - [group enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) { - if (resultBlock) { resultBlock(result,index,stop); } - }]; - } else { - [group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) { - if (resultBlock) { resultBlock(result,index,stop); } - }]; - } - } -} - -/// Get asset at index 获得下标为index的单个照片 -/// if index beyond bounds, return nil in callback 如果索引越界, 在回调中返回 nil -- (void)getAssetFromFetchResult:(id)result atIndex:(NSInteger)index allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage completion:(void (^)(TZAssetModel *))completion { - if ([result isKindOfClass:[PHFetchResult class]]) { - PHFetchResult *fetchResult = (PHFetchResult *)result; - PHAsset *asset; - @try { - asset = fetchResult[index]; - } - @catch (NSException* e) { - if (completion) completion(nil); - return; - } - TZAssetModel *model = [self assetModelWithAsset:asset allowPickingVideo:allowPickingVideo allowPickingImage:allowPickingImage]; - if (completion) completion(model); - } else if ([result isKindOfClass:[ALAssetsGroup class]]) { - ALAssetsGroup *group = (ALAssetsGroup *)result; - if (allowPickingImage && allowPickingVideo) { - [group setAssetsFilter:[ALAssetsFilter allAssets]]; - } else if (allowPickingVideo) { - [group setAssetsFilter:[ALAssetsFilter allVideos]]; - } else if (allowPickingImage) { - [group setAssetsFilter:[ALAssetsFilter allPhotos]]; - } - NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:index]; - @try { - [group enumerateAssetsAtIndexes:indexSet options:NSEnumerationConcurrent usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) { - if (!result) return; - TZAssetModel *model = [self assetModelWithAsset:result allowPickingVideo:allowPickingVideo allowPickingImage:allowPickingImage]; - if (completion) completion(model); - }]; - } - @catch (NSException* e) { - if (completion) completion(nil); - } - } -} - -- (TZAssetModel *)assetModelWithAsset:(id)asset allowPickingVideo:(BOOL)allowPickingVideo allowPickingImage:(BOOL)allowPickingImage { - BOOL canSelect = YES; - if ([self.pickerDelegate respondsToSelector:@selector(isAssetCanSelect:)]) { - canSelect = [self.pickerDelegate isAssetCanSelect:asset]; - } - if (!canSelect) return nil; - - TZAssetModel *model; - TZAssetModelMediaType type = [self getAssetType:asset]; - if ([asset isKindOfClass:[PHAsset class]]) { - if (!allowPickingVideo && type == TZAssetModelMediaTypeVideo) return nil; - if (!allowPickingImage && type == TZAssetModelMediaTypePhoto) return nil; - if (!allowPickingImage && type == TZAssetModelMediaTypePhotoGif) return nil; - - PHAsset *phAsset = (PHAsset *)asset; - if (self.hideWhenCanNotSelect) { - // 过滤掉尺寸不满足要求的图片 - if (![self isPhotoSelectableWithAsset:phAsset]) { - return nil; - } - } - NSString *timeLength = type == TZAssetModelMediaTypeVideo ? [NSString stringWithFormat:@"%0.0f",phAsset.duration] : @""; - timeLength = [self getNewTimeFromDurationSecond:timeLength.integerValue]; - model = [TZAssetModel modelWithAsset:asset type:type timeLength:timeLength]; - } else { - if (!allowPickingVideo){ - model = [TZAssetModel modelWithAsset:asset type:type]; - return model; - } - /// Allow picking video - if (type == TZAssetModelMediaTypeVideo) { - NSTimeInterval duration = [[asset valueForProperty:ALAssetPropertyDuration] doubleValue]; - NSString *timeLength = [NSString stringWithFormat:@"%0.0f",duration]; - timeLength = [self getNewTimeFromDurationSecond:timeLength.integerValue]; - model = [TZAssetModel modelWithAsset:asset type:type timeLength:timeLength]; - } else { - if (self.hideWhenCanNotSelect) { - // 过滤掉尺寸不满足要求的图片 - if (![self isPhotoSelectableWithAsset:asset]) { - return nil; - } - } - model = [TZAssetModel modelWithAsset:asset type:type]; - } - } - return model; -} - -- (TZAssetModelMediaType)getAssetType:(id)asset { - TZAssetModelMediaType type = TZAssetModelMediaTypePhoto; - if ([asset isKindOfClass:[PHAsset class]]) { - PHAsset *phAsset = (PHAsset *)asset; - if (phAsset.mediaType == PHAssetMediaTypeVideo) type = TZAssetModelMediaTypeVideo; - else if (phAsset.mediaType == PHAssetMediaTypeAudio) type = TZAssetModelMediaTypeAudio; - else if (phAsset.mediaType == PHAssetMediaTypeImage) { - if (iOS9_1Later) { - // if (asset.mediaSubtypes == PHAssetMediaSubtypePhotoLive) type = TZAssetModelMediaTypeLivePhoto; - } - // Gif - if ([[phAsset valueForKey:@"filename"] hasSuffix:@"GIF"]) { - type = TZAssetModelMediaTypePhotoGif; - } - } - } else { - if ([[asset valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypeVideo]) { - type = TZAssetModelMediaTypeVideo; - } - } - return type; -} - -- (NSString *)getNewTimeFromDurationSecond:(NSInteger)duration { - NSString *newTime; - if (duration < 10) { - newTime = [NSString stringWithFormat:@"0:0%zd",duration]; - } else if (duration < 60) { - newTime = [NSString stringWithFormat:@"0:%zd",duration]; - } else { - NSInteger min = duration / 60; - NSInteger sec = duration - (min * 60); - if (sec < 10) { - newTime = [NSString stringWithFormat:@"%zd:0%zd",min,sec]; - } else { - newTime = [NSString stringWithFormat:@"%zd:%zd",min,sec]; - } - } - return newTime; -} - -/// Get photo bytes 获得一组照片的大小 -- (void)getPhotosBytesWithArray:(NSArray *)photos completion:(void (^)(NSString *totalBytes))completion { - if (!photos || !photos.count) { - if (completion) completion(@"0B"); - return; - } - __block NSInteger dataLength = 0; - __block NSInteger assetCount = 0; - for (NSInteger i = 0; i < photos.count; i++) { - TZAssetModel *model = photos[i]; - if ([model.asset isKindOfClass:[PHAsset class]]) { - PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init]; - options.resizeMode = PHImageRequestOptionsResizeModeFast; - [[PHImageManager defaultManager] requestImageDataForAsset:model.asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) { - if (model.type != TZAssetModelMediaTypeVideo) dataLength += imageData.length; - assetCount ++; - if (assetCount >= photos.count) { - NSString *bytes = [self getBytesFromDataLength:dataLength]; - if (completion) completion(bytes); - } - }]; - } else if ([model.asset isKindOfClass:[ALAsset class]]) { - ALAssetRepresentation *representation = [model.asset defaultRepresentation]; - if (model.type != TZAssetModelMediaTypeVideo) dataLength += (NSInteger)representation.size; - if (i >= photos.count - 1) { - NSString *bytes = [self getBytesFromDataLength:dataLength]; - if (completion) completion(bytes); - } - } - } -} - -- (NSString *)getBytesFromDataLength:(NSInteger)dataLength { - NSString *bytes; - if (dataLength >= 0.1 * (1024 * 1024)) { - bytes = [NSString stringWithFormat:@"%0.1fM",dataLength/1024/1024.0]; - } else if (dataLength >= 1024) { - bytes = [NSString stringWithFormat:@"%0.0fK",dataLength/1024.0]; - } else { - bytes = [NSString stringWithFormat:@"%zdB",dataLength]; - } - return bytes; -} - -#pragma mark - Get Photo - -/// Get photo 获得照片本身 -- (int32_t)getPhotoWithAsset:(id)asset completion:(void (^)(UIImage *, NSDictionary *, BOOL isDegraded))completion { - CGFloat fullScreenWidth = TZScreenWidth; - if (fullScreenWidth > _photoPreviewMaxWidth) { - fullScreenWidth = _photoPreviewMaxWidth; - } - return [self getPhotoWithAsset:asset photoWidth:fullScreenWidth completion:completion progressHandler:nil networkAccessAllowed:YES]; -} - -- (int32_t)getPhotoWithAsset:(id)asset photoWidth:(CGFloat)photoWidth completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion { - return [self getPhotoWithAsset:asset photoWidth:photoWidth completion:completion progressHandler:nil networkAccessAllowed:YES]; -} - -- (int32_t)getPhotoWithAsset:(id)asset completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler networkAccessAllowed:(BOOL)networkAccessAllowed { - CGFloat fullScreenWidth = TZScreenWidth; - if (fullScreenWidth > _photoPreviewMaxWidth) { - fullScreenWidth = _photoPreviewMaxWidth; - } - return [self getPhotoWithAsset:asset photoWidth:fullScreenWidth completion:completion progressHandler:progressHandler networkAccessAllowed:networkAccessAllowed]; -} - -- (int32_t)getPhotoWithAsset:(id)asset photoWidth:(CGFloat)photoWidth completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler networkAccessAllowed:(BOOL)networkAccessAllowed { - if ([asset isKindOfClass:[PHAsset class]]) { - CGSize imageSize; - if (photoWidth < TZScreenWidth && photoWidth < _photoPreviewMaxWidth) { - imageSize = AssetGridThumbnailSize; - } else { - PHAsset *phAsset = (PHAsset *)asset; - CGFloat aspectRatio = phAsset.pixelWidth / (CGFloat)phAsset.pixelHeight; - CGFloat pixelWidth = photoWidth * TZScreenScale * 1.5; - // 超宽图片 - if (aspectRatio > 1.8) { - pixelWidth = pixelWidth * aspectRatio; - } - // 超高图片 - if (aspectRatio < 0.2) { - pixelWidth = pixelWidth * 0.5; - } - CGFloat pixelHeight = pixelWidth / aspectRatio; - imageSize = CGSizeMake(pixelWidth, pixelHeight); - } - - __block UIImage *image; - // 修复获取图片时出现的瞬间内存过高问题 - // 下面两行代码,来自hsjcom,他的github是:https://github.com/hsjcom 表示感谢 - PHImageRequestOptions *option = [[PHImageRequestOptions alloc] init]; - option.resizeMode = PHImageRequestOptionsResizeModeFast; - int32_t imageRequestID = [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:imageSize contentMode:PHImageContentModeAspectFill options:option resultHandler:^(UIImage *result, NSDictionary *info) { - if (result) { - image = result; - } - BOOL downloadFinined = (![[info objectForKey:PHImageCancelledKey] boolValue] && ![info objectForKey:PHImageErrorKey]); - if (downloadFinined && result) { - result = [self fixOrientation:result]; - if (completion) completion(result,info,[[info objectForKey:PHImageResultIsDegradedKey] boolValue]); - } - // Download image from iCloud / 从iCloud下载图片 - if ([info objectForKey:PHImageResultIsInCloudKey] && !result && networkAccessAllowed) { - PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init]; - options.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (progressHandler) { - progressHandler(progress, error, stop, info); - } - }); - }; - options.networkAccessAllowed = YES; - options.resizeMode = PHImageRequestOptionsResizeModeFast; - [[PHImageManager defaultManager] requestImageDataForAsset:asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) { - UIImage *resultImage = [UIImage imageWithData:imageData scale:0.1]; - resultImage = [self scaleImage:resultImage toSize:imageSize]; - if (!resultImage) { - resultImage = image; - } - resultImage = [self fixOrientation:resultImage]; - if (completion) completion(resultImage,info,NO); - }]; - } - }]; - return imageRequestID; - } else if ([asset isKindOfClass:[ALAsset class]]) { - ALAsset *alAsset = (ALAsset *)asset; - dispatch_async(dispatch_get_global_queue(0,0), ^{ - CGImageRef thumbnailImageRef = alAsset.thumbnail; - UIImage *thumbnailImage = [UIImage imageWithCGImage:thumbnailImageRef scale:2.0 orientation:UIImageOrientationUp]; - dispatch_async(dispatch_get_main_queue(), ^{ - if (completion) completion(thumbnailImage,nil,YES); - - if (photoWidth == TZScreenWidth || photoWidth == _photoPreviewMaxWidth) { - dispatch_async(dispatch_get_global_queue(0,0), ^{ - ALAssetRepresentation *assetRep = [alAsset defaultRepresentation]; - CGImageRef fullScrennImageRef = [assetRep fullScreenImage]; - UIImage *fullScrennImage = [UIImage imageWithCGImage:fullScrennImageRef scale:2.0 orientation:UIImageOrientationUp]; - - dispatch_async(dispatch_get_main_queue(), ^{ - if (completion) completion(fullScrennImage,nil,NO); - }); - }); - } - }); - }); - } - return 0; -} - -/// Get postImage / 获取封面图 -- (void)getPostImageWithAlbumModel:(TZAlbumModel *)model completion:(void (^)(UIImage *))completion { - if (iOS8Later) { - id asset = [model.result lastObject]; - if (!self.sortAscendingByModificationDate) { - asset = [model.result firstObject]; - } - [[TZImageManager manager] getPhotoWithAsset:asset photoWidth:80 completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - if (completion) completion(photo); - }]; - } else { - ALAssetsGroup *group = model.result; - UIImage *postImage = [UIImage imageWithCGImage:group.posterImage]; - if (completion) completion(postImage); - } -} - -/// Get Original Photo / 获取原图 -- (void)getOriginalPhotoWithAsset:(id)asset completion:(void (^)(UIImage *photo,NSDictionary *info))completion { - [self getOriginalPhotoWithAsset:asset newCompletion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - if (completion) { - completion(photo,info); - } - }]; -} - -- (void)getOriginalPhotoWithAsset:(id)asset newCompletion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion { - if ([asset isKindOfClass:[PHAsset class]]) { - PHImageRequestOptions *option = [[PHImageRequestOptions alloc]init]; - option.networkAccessAllowed = YES; - option.resizeMode = PHImageRequestOptionsResizeModeFast; - [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeAspectFit options:option resultHandler:^(UIImage *result, NSDictionary *info) { - BOOL downloadFinined = (![[info objectForKey:PHImageCancelledKey] boolValue] && ![info objectForKey:PHImageErrorKey]); - if (downloadFinined && result) { - result = [self fixOrientation:result]; - BOOL isDegraded = [[info objectForKey:PHImageResultIsDegradedKey] boolValue]; - if (completion) completion(result,info,isDegraded); - } - }]; - } else if ([asset isKindOfClass:[ALAsset class]]) { - ALAsset *alAsset = (ALAsset *)asset; - ALAssetRepresentation *assetRep = [alAsset defaultRepresentation]; - - dispatch_async(dispatch_get_global_queue(0,0), ^{ - CGImageRef originalImageRef = [assetRep fullResolutionImage]; - UIImage *originalImage = [UIImage imageWithCGImage:originalImageRef scale:1.0 orientation:UIImageOrientationUp]; - - dispatch_async(dispatch_get_main_queue(), ^{ - if (completion) completion(originalImage,nil,NO); - }); - }); - } -} - -- (void)getOriginalPhotoDataWithAsset:(id)asset completion:(void (^)(NSData *data,NSDictionary *info,BOOL isDegraded))completion { - if ([asset isKindOfClass:[PHAsset class]]) { - PHImageRequestOptions *option = [[PHImageRequestOptions alloc] init]; - option.networkAccessAllowed = YES; - option.resizeMode = PHImageRequestOptionsResizeModeFast; - [[PHImageManager defaultManager] requestImageDataForAsset:asset options:option resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) { - BOOL downloadFinined = (![[info objectForKey:PHImageCancelledKey] boolValue] && ![info objectForKey:PHImageErrorKey]); - if (downloadFinined && imageData) { - if (completion) completion(imageData,info,NO); - } - }]; - } else if ([asset isKindOfClass:[ALAsset class]]) { - ALAsset *alAsset = (ALAsset *)asset; - ALAssetRepresentation *assetRep = [alAsset defaultRepresentation]; - Byte *imageBuffer = (Byte *)malloc(assetRep.size); - NSUInteger bufferSize = [assetRep getBytes:imageBuffer fromOffset:0.0 length:assetRep.size error:nil]; - NSData *imageData = [NSData dataWithBytesNoCopy:imageBuffer length:bufferSize freeWhenDone:YES]; - if (completion) completion(imageData,nil,NO); - } -} - -#pragma mark - Save photo - -- (void)savePhotoWithImage:(UIImage *)image completion:(void (^)(NSError *error))completion { - [self savePhotoWithImage:image location:nil completion:completion]; -} - -- (void)savePhotoWithImage:(UIImage *)image location:(CLLocation *)location completion:(void (^)(NSError *error))completion { - if (iOS8Later) { - [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ - if (iOS9Later) { - NSData *data = UIImageJPEGRepresentation(image, 0.9); - PHAssetResourceCreationOptions *options = [[PHAssetResourceCreationOptions alloc] init]; - options.shouldMoveFile = YES; - PHAssetCreationRequest *request = [PHAssetCreationRequest creationRequestForAsset]; - [request addResourceWithType:PHAssetResourceTypePhoto data:data options:options]; - if (location) { - request.location = location; - } - request.creationDate = [NSDate date]; - } else { - PHAssetChangeRequest *request = [PHAssetChangeRequest creationRequestForAssetFromImage:image]; - if (location) { - request.location = location; - } - request.creationDate = [NSDate date]; - } - } completionHandler:^(BOOL success, NSError *error) { - dispatch_sync(dispatch_get_main_queue(), ^{ - if (success && completion) { - completion(nil); - } else if (error) { - NSLog(@"保存照片出错:%@",error.localizedDescription); - if (completion) { - completion(error); - } - } - }); - }]; - } else { - [self.assetLibrary writeImageToSavedPhotosAlbum:image.CGImage orientation:[self orientationFromImage:image] completionBlock:^(NSURL *assetURL, NSError *error) { - if (error) { - NSLog(@"保存图片失败:%@",error.localizedDescription); - if (completion) { - completion(error); - } - } else { - // 多给系统0.5秒的时间,让系统去更新相册数据 - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - if (completion) { - completion(nil); - } - }); - } - }]; - } -} - -#pragma mark - Get Video - -/// Get Video / 获取视频 -- (void)getVideoWithAsset:(id)asset completion:(void (^)(AVPlayerItem *, NSDictionary *))completion { - [self getVideoWithAsset:asset progressHandler:nil completion:completion]; -} - -- (void)getVideoWithAsset:(id)asset progressHandler:(void (^)(double progress, NSError *error, BOOL *stop, NSDictionary *info))progressHandler completion:(void (^)(AVPlayerItem *, NSDictionary *))completion { - if ([asset isKindOfClass:[PHAsset class]]) { - PHVideoRequestOptions *option = [[PHVideoRequestOptions alloc] init]; - option.networkAccessAllowed = YES; - option.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (progressHandler) { - progressHandler(progress, error, stop, info); - } - }); - }; - [[PHImageManager defaultManager] requestPlayerItemForVideo:asset options:option resultHandler:^(AVPlayerItem *playerItem, NSDictionary *info) { - if (completion) completion(playerItem,info); - }]; - } else if ([asset isKindOfClass:[ALAsset class]]) { - ALAsset *alAsset = (ALAsset *)asset; - ALAssetRepresentation *defaultRepresentation = [alAsset defaultRepresentation]; - NSString *uti = [defaultRepresentation UTI]; - NSURL *videoURL = [[asset valueForProperty:ALAssetPropertyURLs] valueForKey:uti]; - AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithURL:videoURL]; - if (completion && playerItem) completion(playerItem,nil); - } -} - -#pragma mark - Export video - -/// Export Video / 导出视频 -- (void)getVideoOutputPathWithAsset:(id)asset success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure { - [self getVideoOutputPathWithAsset:asset presetName:AVAssetExportPreset640x480 success:success failure:failure]; -} - -- (void)getVideoOutputPathWithAsset:(id)asset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure { - if ([asset isKindOfClass:[PHAsset class]]) { - PHVideoRequestOptions* options = [[PHVideoRequestOptions alloc] init]; - options.version = PHVideoRequestOptionsVersionOriginal; - options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic; - options.networkAccessAllowed = YES; - [[PHImageManager defaultManager] requestAVAssetForVideo:asset options:options resultHandler:^(AVAsset* avasset, AVAudioMix* audioMix, NSDictionary* info){ - // NSLog(@"Info:\n%@",info); - AVURLAsset *videoAsset = (AVURLAsset*)avasset; - // NSLog(@"AVAsset URL: %@",myAsset.URL); - [self startExportVideoWithVideoAsset:videoAsset presetName:presetName success:success failure:failure]; - }]; - } else if ([asset isKindOfClass:[ALAsset class]]) { - NSURL *videoURL =[asset valueForProperty:ALAssetPropertyAssetURL]; // ALAssetPropertyURLs - AVURLAsset *videoAsset = [[AVURLAsset alloc] initWithURL:videoURL options:nil]; - [self startExportVideoWithVideoAsset:videoAsset presetName:presetName success:success failure:failure]; - } -} - -/// Deprecated, Use -getVideoOutputPathWithAsset:failure:success: -- (void)getVideoOutputPathWithAsset:(id)asset completion:(void (^)(NSString *outputPath))completion { - [self getVideoOutputPathWithAsset:asset success:completion failure:nil]; -} - -- (void)startExportVideoWithVideoAsset:(AVURLAsset *)videoAsset presetName:(NSString *)presetName success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure { - // Find compatible presets by video asset. - NSArray *presets = [AVAssetExportSession exportPresetsCompatibleWithAsset:videoAsset]; - - // Begin to compress video - // Now we just compress to low resolution if it supports - // If you need to upload to the server, but server does't support to upload by streaming, - // You can compress the resolution to lower. Or you can support more higher resolution. - if ([presets containsObject:presetName]) { - AVAssetExportSession *session = [[AVAssetExportSession alloc] initWithAsset:videoAsset presetName:presetName]; - - NSDateFormatter *formater = [[NSDateFormatter alloc] init]; - [formater setDateFormat:@"yyyy-MM-dd-HH:mm:ss-SSS"]; - NSString *outputPath = [NSHomeDirectory() stringByAppendingFormat:@"/tmp/output-%@.mp4", [formater stringFromDate:[NSDate date]]]; - // NSLog(@"video outputPath = %@",outputPath); - session.outputURL = [NSURL fileURLWithPath:outputPath]; - - // Optimize for network use. - session.shouldOptimizeForNetworkUse = true; - - NSArray *supportedTypeArray = session.supportedFileTypes; - if ([supportedTypeArray containsObject:AVFileTypeMPEG4]) { - session.outputFileType = AVFileTypeMPEG4; - } else if (supportedTypeArray.count == 0) { - if (failure) { - failure(@"该视频类型暂不支持导出", nil); - } - NSLog(@"No supported file types 视频类型暂不支持导出"); - return; - } else { - session.outputFileType = [supportedTypeArray objectAtIndex:0]; - } - - if (![[NSFileManager defaultManager] fileExistsAtPath:[NSHomeDirectory() stringByAppendingFormat:@"/tmp"]]) { - [[NSFileManager defaultManager] createDirectoryAtPath:[NSHomeDirectory() stringByAppendingFormat:@"/tmp"] withIntermediateDirectories:YES attributes:nil error:nil]; - } - - AVMutableVideoComposition *videoComposition = [self fixedCompositionWithAsset:videoAsset]; - if (videoComposition.renderSize.width) { - // 修正视频转向 - session.videoComposition = videoComposition; - } - - // Begin to export video to the output path asynchronously. - [session exportAsynchronouslyWithCompletionHandler:^(void) { - dispatch_async(dispatch_get_main_queue(), ^{ - switch (session.status) { - case AVAssetExportSessionStatusUnknown: { - NSLog(@"AVAssetExportSessionStatusUnknown"); - } break; - case AVAssetExportSessionStatusWaiting: { - NSLog(@"AVAssetExportSessionStatusWaiting"); - } break; - case AVAssetExportSessionStatusExporting: { - NSLog(@"AVAssetExportSessionStatusExporting"); - } break; - case AVAssetExportSessionStatusCompleted: { - NSLog(@"AVAssetExportSessionStatusCompleted"); - if (success) { - success(outputPath); - } - } break; - case AVAssetExportSessionStatusFailed: { - NSLog(@"AVAssetExportSessionStatusFailed"); - if (failure) { - failure(@"视频导出失败", session.error); - } - } break; - case AVAssetExportSessionStatusCancelled: { - NSLog(@"AVAssetExportSessionStatusCancelled"); - if (failure) { - failure(@"导出任务已被取消", nil); - } - } break; - default: break; - } - }); - }]; - } else { - if (failure) { - NSString *errorMessage = [NSString stringWithFormat:@"当前设备不支持该预设:%@", presetName]; - failure(errorMessage, nil); - } - } -} - -/// Judge is a assets array contain the asset 判断一个assets数组是否包含这个asset -- (BOOL)isAssetsArray:(NSArray *)assets containAsset:(id)asset { - if (iOS8Later) { - return [assets containsObject:asset]; - } else { - NSMutableArray *selectedAssetUrls = [NSMutableArray array]; - for (ALAsset *asset_item in assets) { - [selectedAssetUrls addObject:[asset_item valueForProperty:ALAssetPropertyURLs]]; - } - return [selectedAssetUrls containsObject:[asset valueForProperty:ALAssetPropertyURLs]]; - } -} - -- (BOOL)isCameraRollAlbum:(id)metadata { - if ([metadata isKindOfClass:[PHAssetCollection class]]) { - NSString *versionStr = [[UIDevice currentDevice].systemVersion stringByReplacingOccurrencesOfString:@"." withString:@""]; - if (versionStr.length <= 1) { - versionStr = [versionStr stringByAppendingString:@"00"]; - } else if (versionStr.length <= 2) { - versionStr = [versionStr stringByAppendingString:@"0"]; - } - CGFloat version = versionStr.floatValue; - // 目前已知8.0.0 ~ 8.0.2系统,拍照后的图片会保存在最近添加中 - if (version >= 800 && version <= 802) { - return ((PHAssetCollection *)metadata).assetCollectionSubtype == PHAssetCollectionSubtypeSmartAlbumRecentlyAdded; - } else { - return ((PHAssetCollection *)metadata).assetCollectionSubtype == PHAssetCollectionSubtypeSmartAlbumUserLibrary; - } - } - if ([metadata isKindOfClass:[ALAssetsGroup class]]) { - ALAssetsGroup *group = metadata; - return ([[group valueForProperty:ALAssetsGroupPropertyType] intValue] == ALAssetsGroupSavedPhotos); - } - - return NO; -} - -- (NSString *)getAssetIdentifier:(id)asset { - if (iOS8Later) { - PHAsset *phAsset = (PHAsset *)asset; - return phAsset.localIdentifier; - } else { - ALAsset *alAsset = (ALAsset *)asset; - NSURL *assetUrl = [alAsset valueForProperty:ALAssetPropertyAssetURL]; - return assetUrl.absoluteString; - } -} - -/// 检查照片大小是否满足最小要求 -- (BOOL)isPhotoSelectableWithAsset:(id)asset { - CGSize photoSize = [self photoSizeWithAsset:asset]; - if (self.minPhotoWidthSelectable > photoSize.width || self.minPhotoHeightSelectable > photoSize.height) { - return NO; - } - return YES; -} - -- (CGSize)photoSizeWithAsset:(id)asset { - if (iOS8Later) { - PHAsset *phAsset = (PHAsset *)asset; - return CGSizeMake(phAsset.pixelWidth, phAsset.pixelHeight); - } else { - ALAsset *alAsset = (ALAsset *)asset; - return alAsset.defaultRepresentation.dimensions; - } -} - -#pragma mark - Private Method - -- (TZAlbumModel *)modelWithResult:(id)result name:(NSString *)name isCameraRoll:(BOOL)isCameraRoll { - TZAlbumModel *model = [[TZAlbumModel alloc] init]; - model.result = result; - model.name = name; - model.isCameraRoll = isCameraRoll; - if ([result isKindOfClass:[PHFetchResult class]]) { - PHFetchResult *fetchResult = (PHFetchResult *)result; - model.count = fetchResult.count; - } else if ([result isKindOfClass:[ALAssetsGroup class]]) { - ALAssetsGroup *group = (ALAssetsGroup *)result; - model.count = [group numberOfAssets]; - } - return model; -} - -- (UIImage *)scaleImage:(UIImage *)image toSize:(CGSize)size { - if (image.size.width > size.width) { - UIGraphicsBeginImageContext(size); - [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; - UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return newImage; - } else { - return image; - } -} - -- (ALAssetOrientation)orientationFromImage:(UIImage *)image { - NSInteger orientation = image.imageOrientation; - return orientation; -} - -/// 获取优化后的视频转向信息 -- (AVMutableVideoComposition *)fixedCompositionWithAsset:(AVAsset *)videoAsset { - AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoComposition]; - // 视频转向 - int degrees = [self degressFromVideoFileWithAsset:videoAsset]; - if (degrees != 0) { - CGAffineTransform translateToCenter; - CGAffineTransform mixedTransform; - videoComposition.frameDuration = CMTimeMake(1, 30); - - NSArray *tracks = [videoAsset tracksWithMediaType:AVMediaTypeVideo]; - AVAssetTrack *videoTrack = [tracks objectAtIndex:0]; - - AVMutableVideoCompositionInstruction *roateInstruction = [AVMutableVideoCompositionInstruction videoCompositionInstruction]; - roateInstruction.timeRange = CMTimeRangeMake(kCMTimeZero, [videoAsset duration]); - AVMutableVideoCompositionLayerInstruction *roateLayerInstruction = [AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack:videoTrack]; - - if (degrees == 90) { - // 顺时针旋转90° - translateToCenter = CGAffineTransformMakeTranslation(videoTrack.naturalSize.height, 0.0); - mixedTransform = CGAffineTransformRotate(translateToCenter,M_PI_2); - videoComposition.renderSize = CGSizeMake(videoTrack.naturalSize.height,videoTrack.naturalSize.width); - [roateLayerInstruction setTransform:mixedTransform atTime:kCMTimeZero]; - } else if(degrees == 180){ - // 顺时针旋转180° - translateToCenter = CGAffineTransformMakeTranslation(videoTrack.naturalSize.width, videoTrack.naturalSize.height); - mixedTransform = CGAffineTransformRotate(translateToCenter,M_PI); - videoComposition.renderSize = CGSizeMake(videoTrack.naturalSize.width,videoTrack.naturalSize.height); - [roateLayerInstruction setTransform:mixedTransform atTime:kCMTimeZero]; - } else if(degrees == 270){ - // 顺时针旋转270° - translateToCenter = CGAffineTransformMakeTranslation(0.0, videoTrack.naturalSize.width); - mixedTransform = CGAffineTransformRotate(translateToCenter,M_PI_2*3.0); - videoComposition.renderSize = CGSizeMake(videoTrack.naturalSize.height,videoTrack.naturalSize.width); - [roateLayerInstruction setTransform:mixedTransform atTime:kCMTimeZero]; - } - - roateInstruction.layerInstructions = @[roateLayerInstruction]; - // 加入视频方向信息 - videoComposition.instructions = @[roateInstruction]; - } - return videoComposition; -} - -/// 获取视频角度 -- (int)degressFromVideoFileWithAsset:(AVAsset *)asset { - int degress = 0; - NSArray *tracks = [asset tracksWithMediaType:AVMediaTypeVideo]; - if([tracks count] > 0) { - AVAssetTrack *videoTrack = [tracks objectAtIndex:0]; - CGAffineTransform t = videoTrack.preferredTransform; - if(t.a == 0 && t.b == 1.0 && t.c == -1.0 && t.d == 0){ - // Portrait - degress = 90; - } else if(t.a == 0 && t.b == -1.0 && t.c == 1.0 && t.d == 0){ - // PortraitUpsideDown - degress = 270; - } else if(t.a == 1.0 && t.b == 0 && t.c == 0 && t.d == 1.0){ - // LandscapeRight - degress = 0; - } else if(t.a == -1.0 && t.b == 0 && t.c == 0 && t.d == -1.0){ - // LandscapeLeft - degress = 180; - } - } - return degress; -} - -/// 修正图片转向 -- (UIImage *)fixOrientation:(UIImage *)aImage { - if (!self.shouldFixOrientation) return aImage; - - // No-op if the orientation is already correct - if (aImage.imageOrientation == UIImageOrientationUp) - return aImage; - - // We need to calculate the proper transformation to make the image upright. - // We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored. - CGAffineTransform transform = CGAffineTransformIdentity; - - switch (aImage.imageOrientation) { - case UIImageOrientationDown: - case UIImageOrientationDownMirrored: - transform = CGAffineTransformTranslate(transform, aImage.size.width, aImage.size.height); - transform = CGAffineTransformRotate(transform, M_PI); - break; - - case UIImageOrientationLeft: - case UIImageOrientationLeftMirrored: - transform = CGAffineTransformTranslate(transform, aImage.size.width, 0); - transform = CGAffineTransformRotate(transform, M_PI_2); - break; - - case UIImageOrientationRight: - case UIImageOrientationRightMirrored: - transform = CGAffineTransformTranslate(transform, 0, aImage.size.height); - transform = CGAffineTransformRotate(transform, -M_PI_2); - break; - default: - break; - } - - switch (aImage.imageOrientation) { - case UIImageOrientationUpMirrored: - case UIImageOrientationDownMirrored: - transform = CGAffineTransformTranslate(transform, aImage.size.width, 0); - transform = CGAffineTransformScale(transform, -1, 1); - break; - - case UIImageOrientationLeftMirrored: - case UIImageOrientationRightMirrored: - transform = CGAffineTransformTranslate(transform, aImage.size.height, 0); - transform = CGAffineTransformScale(transform, -1, 1); - break; - default: - break; - } - - // Now we draw the underlying CGImage into a new context, applying the transform - // calculated above. - CGContextRef ctx = CGBitmapContextCreate(NULL, aImage.size.width, aImage.size.height, - CGImageGetBitsPerComponent(aImage.CGImage), 0, - CGImageGetColorSpace(aImage.CGImage), - CGImageGetBitmapInfo(aImage.CGImage)); - CGContextConcatCTM(ctx, transform); - switch (aImage.imageOrientation) { - case UIImageOrientationLeft: - case UIImageOrientationLeftMirrored: - case UIImageOrientationRight: - case UIImageOrientationRightMirrored: - // Grr... - CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.height,aImage.size.width), aImage.CGImage); - break; - - default: - CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.width,aImage.size.height), aImage.CGImage); - break; - } - - // And now we just create a new UIImage from the drawing context - CGImageRef cgimg = CGBitmapContextCreateImage(ctx); - UIImage *img = [UIImage imageWithCGImage:cgimg]; - CGContextRelease(ctx); - CGImageRelease(cgimg); - return img; -} - -#pragma clang diagnostic pop - -@end - - -//@implementation TZSortDescriptor -// -//- (id)reversedSortDescriptor { -// return [NSNumber numberWithBool:![TZImageManager manager].sortAscendingByModificationDate]; -//} -// -//@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlay@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlay@2x.png deleted file mode 100644 index 7a51372a..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlay@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlayHL@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlayHL@2x.png deleted file mode 100644 index ffcadc1b..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/MMVideoPreviewPlayHL@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/Root.plist b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/Root.plist deleted file mode 100644 index b1b6fea5..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/Root.plist +++ /dev/null @@ -1,61 +0,0 @@ - - - - - StringsTable - Root - PreferenceSpecifiers - - - Type - PSGroupSpecifier - Title - Group - - - Type - PSTextFieldSpecifier - Title - Name - Key - name_preference - DefaultValue - - IsSecure - - KeyboardType - Alphabet - AutocapitalizationType - None - AutocorrectionType - No - - - Type - PSToggleSwitchSpecifier - Title - Enabled - Key - enabled_preference - DefaultValue - - - - Type - PSSliderSpecifier - Key - slider_preference - DefaultValue - 0.5 - MinimumValue - 0 - MaximumValue - 1 - MinimumValueImage - - MaximumValueImage - - - - - diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/VideoSendIcon@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/VideoSendIcon@2x.png deleted file mode 100644 index 110543a5..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/VideoSendIcon@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/en.lproj/Localizable.strings b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/en.lproj/Localizable.strings deleted file mode 100755 index ef699fa1..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/en.lproj/Localizable.strings and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/navi_back@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/navi_back@2x.png deleted file mode 100644 index 633b9e6d..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/navi_back@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_def_photoPickerVc@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_def_photoPickerVc@2x.png deleted file mode 100644 index 1415caed..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_def_photoPickerVc@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_def_previewVc@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_def_previewVc@2x.png deleted file mode 100644 index 1415caed..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_def_previewVc@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_number_icon@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_number_icon@2x.png deleted file mode 100644 index 789335b4..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_number_icon@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_original_def@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_original_def@2x.png deleted file mode 100644 index c9792ef6..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_original_def@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_original_sel@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_original_sel@2x.png deleted file mode 100644 index 8889b131..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_original_sel@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_sel_photoPickerVc@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_sel_photoPickerVc@2x.png deleted file mode 100644 index 57012cb9..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_sel_photoPickerVc@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_sel_previewVc@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_sel_previewVc@2x.png deleted file mode 100644 index 827c7942..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/photo_sel_previewVc@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/preview_number_icon@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/preview_number_icon@2x.png deleted file mode 100644 index 789335b4..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/preview_number_icon@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/preview_original_def@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/preview_original_def@2x.png deleted file mode 100644 index 9476d15e..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/preview_original_def@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/takePicture@2x.png b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/takePicture@2x.png deleted file mode 100644 index 2697e7f8..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/takePicture@2x.png and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/zh-Hans.lproj/Localizable.strings b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/zh-Hans.lproj/Localizable.strings deleted file mode 100755 index ffe35b9c..00000000 Binary files a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle/zh-Hans.lproj/Localizable.strings and /dev/null differ diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.h deleted file mode 100644 index c4d732a8..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.h +++ /dev/null @@ -1,243 +0,0 @@ -// -// TZImagePickerController.h -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// version 1.9.8 - 2017.12.19 -// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController - -/* - 经过测试,比起xib的方式,把TZAssetCell改用纯代码的方式来写,滑动帧数明显提高了(约提高10帧左右) - - 最初发现这个问题并修复的是@小鱼周凌宇同学,她的博客地址: http://zhoulingyu.com/ - 表示感谢~ - - 原来xib确实会导致性能问题啊...大家也要注意了... - */ - -#import -#import "TZAssetModel.h" -#import "NSBundle+TZImagePicker.h" - -#define iOS7Later ([UIDevice currentDevice].systemVersion.floatValue >= 7.0f) -#define iOS8Later ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f) -#define iOS9Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.0f) -#define iOS9_1Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.1f) - -@protocol TZImagePickerControllerDelegate; -@interface TZImagePickerController : UINavigationController - -/// Use this init method / 用这个初始化方法 -- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount delegate:(id)delegate; -- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id)delegate; -- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id)delegate pushPhotoPickerVc:(BOOL)pushPhotoPickerVc; -/// This init method just for previewing photos / 用这个初始化方法以预览图片 -- (instancetype)initWithSelectedAssets:(NSMutableArray *)selectedAssets selectedPhotos:(NSMutableArray *)selectedPhotos index:(NSInteger)index; -/// This init method for crop photo / 用这个初始化方法以裁剪图片 -- (instancetype)initCropTypeWithAsset:(id)asset photo:(UIImage *)photo completion:(void (^)(UIImage *cropImage,id asset))completion; - -/// Default is 9 / 默认最大可选9张图片 -@property (nonatomic, assign) NSInteger maxImagesCount; - -/// The minimum count photos user must pick, Default is 0 -/// 最小照片必选张数,默认是0 -@property (nonatomic, assign) NSInteger minImagesCount; - -/// Always enale the done button, not require minimum 1 photo be picked -/// 让完成按钮一直可以点击,无须最少选择一张图片 -@property (nonatomic, assign) BOOL alwaysEnableDoneBtn; - -/// Sort photos ascending by modificationDate,Default is YES -/// 对照片排序,按修改时间升序,默认是YES。如果设置为NO,最新的照片会显示在最前面,内部的拍照按钮会排在第一个 -@property (nonatomic, assign) BOOL sortAscendingByModificationDate; - -/// The pixel width of output image, Default is 828px / 导出图片的宽度,默认828像素宽 -@property (nonatomic, assign) CGFloat photoWidth; - -/// Default is 600px / 默认600像素宽 -@property (nonatomic, assign) CGFloat photoPreviewMaxWidth; - -/// Default is 15, While fetching photo, HUD will dismiss automatic if timeout; -/// 超时时间,默认为15秒,当取图片时间超过15秒还没有取成功时,会自动dismiss HUD; -@property (nonatomic, assign) NSInteger timeout; - -/// Default is YES, if set NO, the original photo button will hide. user can't picking original photo. -/// 默认为YES,如果设置为NO,原图按钮将隐藏,用户不能选择发送原图 -@property (nonatomic, assign) BOOL allowPickingOriginalPhoto; - -/// Default is YES, if set NO, user can't picking video. -/// 默认为YES,如果设置为NO,用户将不能选择视频 -@property (nonatomic, assign) BOOL allowPickingVideo; -/// Default is NO / 默认为NO,为YES时可以多选视频/gif图片,和照片共享最大可选张数maxImagesCount的限制 -@property (nonatomic, assign) BOOL allowPickingMultipleVideo; - -/// Default is NO, if set YES, user can picking gif image. -/// 默认为NO,如果设置为YES,用户可以选择gif图片 -@property (nonatomic, assign) BOOL allowPickingGif; - -/// Default is YES, if set NO, user can't picking image. -/// 默认为YES,如果设置为NO,用户将不能选择发送图片 -@property(nonatomic, assign) BOOL allowPickingImage; - -/// Default is YES, if set NO, user can't take picture. -/// 默认为YES,如果设置为NO,拍照按钮将隐藏,用户将不能选择照片 -@property(nonatomic, assign) BOOL allowTakePicture; - -/// Default is YES, if set NO, user can't preview photo. -/// 默认为YES,如果设置为NO,预览按钮将隐藏,用户将不能去预览照片 -@property (nonatomic, assign) BOOL allowPreview; - -/// Default is YES, if set NO, the picker don't dismiss itself. -/// 默认为YES,如果设置为NO, 选择器将不会自己dismiss -@property(nonatomic, assign) BOOL autoDismiss; - -/// The photos user have selected -/// 用户选中过的图片数组 -@property (nonatomic, strong) NSMutableArray *selectedAssets; -@property (nonatomic, strong) NSMutableArray *selectedModels; - -/// Minimum selectable photo width, Default is 0 -/// 最小可选中的图片宽度,默认是0,小于这个宽度的图片不可选中 -@property (nonatomic, assign) NSInteger minPhotoWidthSelectable; -@property (nonatomic, assign) NSInteger minPhotoHeightSelectable; -/// Hide the photo what can not be selected, Default is NO -/// 隐藏不可以选中的图片,默认是NO,不推荐将其设置为YES -@property (nonatomic, assign) BOOL hideWhenCanNotSelect; -/// 顶部statusBar 是否为系统默认的黑色,默认为NO -@property (nonatomic, assign) BOOL isStatusBarDefault; -/// Single selection mode, valid when maxImagesCount = 1 -/// 单选模式,maxImagesCount为1时才生效 -@property (nonatomic, assign) BOOL showSelectBtn; ///< 在单选模式下,照片列表页中,显示选择按钮,默认为NO -@property (nonatomic, assign) BOOL allowCrop; ///< 允许裁剪,默认为YES,showSelectBtn为NO才生效 -@property (nonatomic, assign) CGRect cropRect; ///< 裁剪框的尺寸 -@property (nonatomic, assign) CGRect cropRectPortrait; ///< 裁剪框的尺寸(竖屏) -@property (nonatomic, assign) CGRect cropRectLandscape; ///< 裁剪框的尺寸(横屏) -@property (nonatomic, assign) BOOL needCircleCrop; ///< 需要圆形裁剪框 -@property (nonatomic, assign) NSInteger circleCropRadius; ///< 圆形裁剪框半径大小 -@property (nonatomic, copy) void (^cropViewSettingBlock)(UIView *cropView); ///< 自定义裁剪框的其他属性 - -@property (nonatomic, copy) void (^navLeftBarButtonSettingBlock)(UIButton *leftButton); ///< 自定义返回按钮样式及其属性 - -- (id)showAlertWithTitle:(NSString *)title; -- (void)hideAlertView:(id)alertView; -- (void)showProgressHUD; -- (void)hideProgressHUD; -@property (nonatomic, assign) BOOL isSelectOriginalPhoto; -@property (assign, nonatomic) BOOL needShowStatusBar; - -@property (nonatomic, copy) NSString *takePictureImageName; -@property (nonatomic, copy) NSString *photoSelImageName; -@property (nonatomic, copy) NSString *photoDefImageName; -@property (nonatomic, copy) NSString *photoOriginSelImageName; -@property (nonatomic, copy) NSString *photoOriginDefImageName; -@property (nonatomic, copy) NSString *photoPreviewOriginDefImageName; -@property (nonatomic, copy) NSString *photoNumberIconImageName; - -/// Appearance / 外观颜色 + 按钮文字 -@property (nonatomic, strong) UIColor *oKButtonTitleColorNormal; -@property (nonatomic, strong) UIColor *oKButtonTitleColorDisabled; -@property (nonatomic, strong) UIColor *naviBgColor; -@property (nonatomic, strong) UIColor *naviTitleColor; -@property (nonatomic, strong) UIFont *naviTitleFont; -@property (nonatomic, strong) UIColor *barItemTextColor; -@property (nonatomic, strong) UIFont *barItemTextFont; - -@property (nonatomic, copy) NSString *doneBtnTitleStr; -@property (nonatomic, copy) NSString *cancelBtnTitleStr; -@property (nonatomic, copy) NSString *previewBtnTitleStr; -@property (nonatomic, copy) NSString *fullImageBtnTitleStr; -@property (nonatomic, copy) NSString *settingBtnTitleStr; -@property (nonatomic, copy) NSString *processHintStr; - -/// Public Method -- (void)cancelButtonClick; - -// The picker should dismiss itself; when it dismissed these handle will be called. -// You can also set autoDismiss to NO, then the picker don't dismiss itself. -// If isOriginalPhoto is YES, user picked the original photo. -// You can get original photo with asset, by the method [[TZImageManager manager] getOriginalPhotoWithAsset:completion:]. -// The UIImage Object in photos default width is 828px, you can set it by photoWidth property. -// 这个照片选择器会自己dismiss,当选择器dismiss的时候,会执行下面的handle -// 你也可以设置autoDismiss属性为NO,选择器就不会自己dismis了 -// 如果isSelectOriginalPhoto为YES,表明用户选择了原图 -// 你可以通过一个asset获得原图,通过这个方法:[[TZImageManager manager] getOriginalPhotoWithAsset:completion:] -// photos数组里的UIImage对象,默认是828像素宽,你可以通过设置photoWidth属性的值来改变它 -@property (nonatomic, copy) void (^didFinishPickingPhotosHandle)(NSArray *photos,NSArray *assets,BOOL isSelectOriginalPhoto); -@property (nonatomic, copy) void (^didFinishPickingPhotosWithInfosHandle)(NSArray *photos,NSArray *assets,BOOL isSelectOriginalPhoto,NSArray *infos); -@property (nonatomic, copy) void (^imagePickerControllerDidCancelHandle)(); - -// If user picking a video, this handle will be called. -// If system version > iOS8,asset is kind of PHAsset class, else is ALAsset class. -// 如果用户选择了一个视频,下面的handle会被执行 -// 如果系统版本大于iOS8,asset是PHAsset类的对象,否则是ALAsset类的对象 -@property (nonatomic, copy) void (^didFinishPickingVideoHandle)(UIImage *coverImage,id asset); - -// If user picking a gif image, this callback will be called. -// 如果用户选择了一个gif图片,下面的handle会被执行 -@property (nonatomic, copy) void (^didFinishPickingGifImageHandle)(UIImage *animatedImage,id sourceAssets); - -@property (nonatomic, weak) id pickerDelegate; - -@end - - -@protocol TZImagePickerControllerDelegate -@optional -// The picker should dismiss itself; when it dismissed these handle will be called. -// You can also set autoDismiss to NO, then the picker don't dismiss itself. -// If isOriginalPhoto is YES, user picked the original photo. -// You can get original photo with asset, by the method [[TZImageManager manager] getOriginalPhotoWithAsset:completion:]. -// The UIImage Object in photos default width is 828px, you can set it by photoWidth property. -// 这个照片选择器会自己dismiss,当选择器dismiss的时候,会执行下面的handle -// 你也可以设置autoDismiss属性为NO,选择器就不会自己dismis了 -// 如果isSelectOriginalPhoto为YES,表明用户选择了原图 -// 你可以通过一个asset获得原图,通过这个方法:[[TZImageManager manager] getOriginalPhotoWithAsset:completion:] -// photos数组里的UIImage对象,默认是828像素宽,你可以通过设置photoWidth属性的值来改变它 -- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto; -- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray *)infos; -//- (void)imagePickerControllerDidCancel:(TZImagePickerController *)picker __attribute__((deprecated("Use -tz_imagePickerControllerDidCancel:."))); -- (void)tz_imagePickerControllerDidCancel:(TZImagePickerController *)picker; - -// If user picking a video, this callback will be called. -// If system version > iOS8,asset is kind of PHAsset class, else is ALAsset class. -// 如果用户选择了一个视频,下面的handle会被执行 -// 如果系统版本大于iOS8,asset是PHAsset类的对象,否则是ALAsset类的对象 -- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingVideo:(UIImage *)coverImage sourceAssets:(id)asset; - -// If user picking a gif image, this callback will be called. -// 如果用户选择了一个gif图片,下面的handle会被执行 -- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingGifImage:(UIImage *)animatedImage sourceAssets:(id)asset; - -// Decide album show or not't -// 决定相册显示与否 albumName:相册名字 result:相册原始数据 -- (BOOL)isAlbumCanSelect:(NSString *)albumName result:(id)result; - -// Decide asset show or not't -// 决定照片显示与否 -- (BOOL)isAssetCanSelect:(id)asset; -@end - - -@interface TZAlbumPickerController : UIViewController -@property (nonatomic, assign) NSInteger columnNumber; -- (void)configTableView; -@end - - -@interface UIImage (MyBundle) -+ (UIImage *)imageNamedFromMyBundle:(NSString *)name; -@end - - -@interface NSString (TzExtension) -- (BOOL)tz_containsString:(NSString *)string; -- (CGSize)tz_calculateSizeWithAttributes:(NSDictionary *)attributes maxSize:(CGSize)maxSize; -@end - - -@interface TZCommonTools : NSObject -+ (BOOL)tz_isIPhoneX; -+ (CGFloat)tz_statusBarHeight; -@end - diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.m deleted file mode 100644 index fb631a57..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.m +++ /dev/null @@ -1,757 +0,0 @@ -// -// TZImagePickerController.m -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// version 1.9.8 - 2017.12.19 -// 更多信息,请前往项目的github地址:https://github.com/banchichen/TZImagePickerController - -#import "TZImagePickerController.h" -#import "TZPhotoPickerController.h" -#import "TZPhotoPreviewController.h" -#import "TZAssetModel.h" -#import "TZAssetCell.h" -#import "UIView+Layout.h" -#import "TZImageManager.h" -#import "math.h" -#import "sys/utsname.h" - -@interface TZImagePickerController () { - NSTimer *_timer; - UILabel *_tipLabel; - UIButton *_settingBtn; - BOOL _pushPhotoPickerVc; - BOOL _didPushPhotoPickerVc; - - UIButton *_progressHUD; - UIView *_HUDContainer; - UIActivityIndicatorView *_HUDIndicatorView; - UILabel *_HUDLabel; - - UIStatusBarStyle _originStatusBarStyle; -} -/// Default is 4, Use in photos collectionView in TZPhotoPickerController -/// 默认4列, TZPhotoPickerController中的照片collectionView -@property (nonatomic, assign) NSInteger columnNumber; -@end - -@implementation TZImagePickerController - -- (instancetype)init { - self = [super init]; - if (self) { - self = [self initWithMaxImagesCount:9 delegate:nil]; - } - return self; -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (void)viewDidLoad { - [super viewDidLoad]; - self.needShowStatusBar = ![UIApplication sharedApplication].statusBarHidden; - self.view.backgroundColor = [UIColor whiteColor]; - self.navigationBar.barStyle = UIBarStyleBlack; - self.navigationBar.translucent = YES; - [TZImageManager manager].shouldFixOrientation = NO; - - // Default appearance, you can reset these after this method - // 默认的外观,你可以在这个方法后重置 - self.oKButtonTitleColorNormal = [UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0]; - self.oKButtonTitleColorDisabled = [UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:0.5]; - - if (iOS7Later) { - self.navigationBar.barTintColor = [UIColor colorWithRed:(34/255.0) green:(34/255.0) blue:(34/255.0) alpha:1.0]; - self.navigationBar.tintColor = [UIColor whiteColor]; - self.automaticallyAdjustsScrollViewInsets = NO; - if (self.needShowStatusBar) [UIApplication sharedApplication].statusBarHidden = NO; - } -} - -- (void)setNaviBgColor:(UIColor *)naviBgColor { - _naviBgColor = naviBgColor; - if (iOS7Later) { - self.navigationBar.barTintColor = naviBgColor; - } -} - -- (void)setNaviTitleColor:(UIColor *)naviTitleColor { - _naviTitleColor = naviTitleColor; - [self configNaviTitleAppearance]; -} - -- (void)setNaviTitleFont:(UIFont *)naviTitleFont { - _naviTitleFont = naviTitleFont; - [self configNaviTitleAppearance]; -} - -- (void)configNaviTitleAppearance { - NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary]; - if (self.naviTitleColor) { - textAttrs[NSForegroundColorAttributeName] = self.naviTitleColor; - } - if (self.naviTitleFont) { - textAttrs[NSFontAttributeName] = self.naviTitleFont; - } - self.navigationBar.titleTextAttributes = textAttrs; -} - -- (void)setBarItemTextFont:(UIFont *)barItemTextFont { - _barItemTextFont = barItemTextFont; - [self configBarButtonItemAppearance]; -} - -- (void)setBarItemTextColor:(UIColor *)barItemTextColor { - _barItemTextColor = barItemTextColor; - [self configBarButtonItemAppearance]; -} - -- (void)configBarButtonItemAppearance { - UIBarButtonItem *barItem; - if (iOS9Later) { - barItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; - } else { - barItem = [UIBarButtonItem appearanceWhenContainedIn:[TZImagePickerController class], nil]; - } - NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary]; - textAttrs[NSForegroundColorAttributeName] = self.barItemTextColor; - textAttrs[NSFontAttributeName] = self.barItemTextFont; - [barItem setTitleTextAttributes:textAttrs forState:UIControlStateNormal]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - _originStatusBarStyle = [UIApplication sharedApplication].statusBarStyle; - - if (self.isStatusBarDefault) { - [UIApplication sharedApplication].statusBarStyle = iOS7Later ? UIStatusBarStyleDefault : UIStatusBarStyleBlackOpaque; - } else { - [UIApplication sharedApplication].statusBarStyle = iOS7Later ? UIStatusBarStyleLightContent : UIStatusBarStyleBlackOpaque; - } -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - [UIApplication sharedApplication].statusBarStyle = _originStatusBarStyle; - [self hideProgressHUD]; -} - -- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount delegate:(id)delegate { - return [self initWithMaxImagesCount:maxImagesCount columnNumber:4 delegate:delegate pushPhotoPickerVc:YES]; -} - -- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id)delegate { - return [self initWithMaxImagesCount:maxImagesCount columnNumber:columnNumber delegate:delegate pushPhotoPickerVc:YES]; -} - -- (instancetype)initWithMaxImagesCount:(NSInteger)maxImagesCount columnNumber:(NSInteger)columnNumber delegate:(id)delegate pushPhotoPickerVc:(BOOL)pushPhotoPickerVc { - _pushPhotoPickerVc = pushPhotoPickerVc; - TZAlbumPickerController *albumPickerVc = [[TZAlbumPickerController alloc] init]; - albumPickerVc.columnNumber = columnNumber; - self = [super initWithRootViewController:albumPickerVc]; - if (self) { - self.maxImagesCount = maxImagesCount > 0 ? maxImagesCount : 9; // Default is 9 / 默认最大可选9张图片 - self.pickerDelegate = delegate; - self.selectedModels = [NSMutableArray array]; - - // Allow user picking original photo and video, you also can set No after this method - // 默认准许用户选择原图和视频, 你也可以在这个方法后置为NO - self.allowPickingOriginalPhoto = YES; - self.allowPickingVideo = YES; - self.allowPickingImage = YES; - self.allowTakePicture = YES; - self.sortAscendingByModificationDate = YES; - self.autoDismiss = YES; - self.columnNumber = columnNumber; - [self configDefaultSetting]; - - if (![[TZImageManager manager] authorizationStatusAuthorized]) { - _tipLabel = [[UILabel alloc] init]; - _tipLabel.frame = CGRectMake(8, 120, self.view.tz_width - 16, 60); - _tipLabel.textAlignment = NSTextAlignmentCenter; - _tipLabel.numberOfLines = 0; - _tipLabel.font = [UIFont systemFontOfSize:16]; - _tipLabel.textColor = [UIColor blackColor]; - NSDictionary *infoDict = [NSBundle mainBundle].localizedInfoDictionary; - if (!infoDict) { - infoDict = [NSBundle mainBundle].infoDictionary; - } - NSString *appName = [infoDict valueForKey:@"CFBundleDisplayName"]; - if (!appName) appName = [infoDict valueForKey:@"CFBundleName"]; - NSString *tipText = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Allow %@ to access your album in \"Settings -> Privacy -> Photos\""],appName]; - _tipLabel.text = tipText; - [self.view addSubview:_tipLabel]; - - if (iOS8Later) { - _settingBtn = [UIButton buttonWithType:UIButtonTypeSystem]; - [_settingBtn setTitle:self.settingBtnTitleStr forState:UIControlStateNormal]; - _settingBtn.frame = CGRectMake(0, 180, self.view.tz_width, 44); - _settingBtn.titleLabel.font = [UIFont systemFontOfSize:18]; - [_settingBtn addTarget:self action:@selector(settingBtnClick) forControlEvents:UIControlEventTouchUpInside]; - [self.view addSubview:_settingBtn]; - } - - _timer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(observeAuthrizationStatusChange) userInfo:nil repeats:YES]; - } else { - [self pushPhotoPickerVc]; - } - } - return self; -} - -/// This init method just for previewing photos / 用这个初始化方法以预览图片 -- (instancetype)initWithSelectedAssets:(NSMutableArray *)selectedAssets selectedPhotos:(NSMutableArray *)selectedPhotos index:(NSInteger)index{ - TZPhotoPreviewController *previewVc = [[TZPhotoPreviewController alloc] init]; - self = [super initWithRootViewController:previewVc]; - if (self) { - self.selectedAssets = [NSMutableArray arrayWithArray:selectedAssets]; - self.allowPickingOriginalPhoto = self.allowPickingOriginalPhoto; - [self configDefaultSetting]; - - previewVc.photos = [NSMutableArray arrayWithArray:selectedPhotos]; - previewVc.currentIndex = index; - __weak typeof(self) weakSelf = self; - [previewVc setDoneButtonClickBlockWithPreviewType:^(NSArray *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { - [weakSelf dismissViewControllerAnimated:YES completion:^{ - if (weakSelf.didFinishPickingPhotosHandle) { - weakSelf.didFinishPickingPhotosHandle(photos,assets,isSelectOriginalPhoto); - } - }]; - }]; - } - return self; -} - -/// This init method for crop photo / 用这个初始化方法以裁剪图片 -- (instancetype)initCropTypeWithAsset:(id)asset photo:(UIImage *)photo completion:(void (^)(UIImage *cropImage,id asset))completion { - TZPhotoPreviewController *previewVc = [[TZPhotoPreviewController alloc] init]; - self = [super initWithRootViewController:previewVc]; - if (self) { - self.maxImagesCount = 1; - self.allowCrop = YES; - self.selectedAssets = [NSMutableArray arrayWithArray:@[asset]]; - [self configDefaultSetting]; - - previewVc.photos = [NSMutableArray arrayWithArray:@[photo]]; - previewVc.isCropImage = YES; - previewVc.currentIndex = 0; - __weak typeof(self) weakSelf = self; - [previewVc setDoneButtonClickBlockCropMode:^(UIImage *cropImage, id asset) { - [weakSelf dismissViewControllerAnimated:YES completion:^{ - if (completion) { - completion(cropImage,asset); - } - }]; - }]; - } - return self; -} - -- (void)configDefaultSetting { - self.timeout = 15; - self.photoWidth = 828.0; - self.photoPreviewMaxWidth = 600; - self.naviTitleColor = [UIColor whiteColor]; - self.naviTitleFont = [UIFont systemFontOfSize:17]; - self.barItemTextFont = [UIFont systemFontOfSize:15]; - self.barItemTextColor = [UIColor whiteColor]; - self.allowPreview = YES; - - [self configDefaultImageName]; - [self configDefaultBtnTitle]; - - CGFloat cropViewWH = MIN(self.view.tz_width, self.view.tz_height) / 3 * 2; - self.cropRect = CGRectMake((self.view.tz_width - cropViewWH) / 2, (self.view.tz_height - cropViewWH) / 2, cropViewWH, cropViewWH); -} - -- (void)configDefaultImageName { - self.takePictureImageName = @"takePicture"; - self.photoSelImageName = @"photo_sel_photoPickerVc"; - self.photoDefImageName = @"photo_def_photoPickerVc"; - self.photoNumberIconImageName = @"photo_number_icon"; - self.photoPreviewOriginDefImageName = @"preview_original_def"; - self.photoOriginDefImageName = @"photo_original_def"; - self.photoOriginSelImageName = @"photo_original_sel"; -} - -- (void)configDefaultBtnTitle { - self.doneBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Done"]; - self.cancelBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Cancel"]; - self.previewBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Preview"]; - self.fullImageBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Full image"]; - self.settingBtnTitleStr = [NSBundle tz_localizedStringForKey:@"Setting"]; - self.processHintStr = [NSBundle tz_localizedStringForKey:@"Processing..."]; -} - -- (void)observeAuthrizationStatusChange { - if ([[TZImageManager manager] authorizationStatusAuthorized]) { - [_tipLabel removeFromSuperview]; - [_settingBtn removeFromSuperview]; - [_timer invalidate]; - _timer = nil; - [self pushPhotoPickerVc]; - } -} - -- (void)pushPhotoPickerVc { - _didPushPhotoPickerVc = NO; - // 1.6.8 判断是否需要push到照片选择页,如果_pushPhotoPickerVc为NO,则不push - if (!_didPushPhotoPickerVc && _pushPhotoPickerVc) { - TZPhotoPickerController *photoPickerVc = [[TZPhotoPickerController alloc] init]; - photoPickerVc.isFirstAppear = YES; - photoPickerVc.columnNumber = self.columnNumber; - [[TZImageManager manager] getCameraRollAlbum:self.allowPickingVideo allowPickingImage:self.allowPickingImage completion:^(TZAlbumModel *model) { - photoPickerVc.model = model; - [self pushViewController:photoPickerVc animated:YES]; - _didPushPhotoPickerVc = YES; - }]; - } - - TZAlbumPickerController *albumPickerVc = (TZAlbumPickerController *)self.visibleViewController; - if ([albumPickerVc isKindOfClass:[TZAlbumPickerController class]]) { - [albumPickerVc configTableView]; - } -} - -- (id)showAlertWithTitle:(NSString *)title { - if (iOS8Later) { - UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert]; - [alertController addAction:[UIAlertAction actionWithTitle:[NSBundle tz_localizedStringForKey:@"OK"] style:UIAlertActionStyleDefault handler:nil]]; - [self presentViewController:alertController animated:YES completion:nil]; - return alertController; - } else { - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:nil delegate:nil cancelButtonTitle:[NSBundle tz_localizedStringForKey:@"OK"] otherButtonTitles:nil, nil]; - [alertView show]; - return alertView; - } -} - -- (void)hideAlertView:(id)alertView { - if ([alertView isKindOfClass:[UIAlertController class]]) { - UIAlertController *alertC = alertView; - [alertC dismissViewControllerAnimated:YES completion:nil]; - } else if ([alertView isKindOfClass:[UIAlertView class]]) { - UIAlertView *alertV = alertView; - [alertV dismissWithClickedButtonIndex:0 animated:YES]; - } - alertView = nil; -} - -- (void)showProgressHUD { - if (!_progressHUD) { - _progressHUD = [UIButton buttonWithType:UIButtonTypeCustom]; - [_progressHUD setBackgroundColor:[UIColor clearColor]]; - - _HUDContainer = [[UIView alloc] init]; - _HUDContainer.layer.cornerRadius = 8; - _HUDContainer.clipsToBounds = YES; - _HUDContainer.backgroundColor = [UIColor darkGrayColor]; - _HUDContainer.alpha = 0.7; - - _HUDIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; - - _HUDLabel = [[UILabel alloc] init]; - _HUDLabel.textAlignment = NSTextAlignmentCenter; - _HUDLabel.text = self.processHintStr; - _HUDLabel.font = [UIFont systemFontOfSize:15]; - _HUDLabel.textColor = [UIColor whiteColor]; - - [_HUDContainer addSubview:_HUDLabel]; - [_HUDContainer addSubview:_HUDIndicatorView]; - [_progressHUD addSubview:_HUDContainer]; - } - [_HUDIndicatorView startAnimating]; - [[UIApplication sharedApplication].keyWindow addSubview:_progressHUD]; - - // if over time, dismiss HUD automatic - __weak typeof(self) weakSelf = self; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.timeout * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [weakSelf hideProgressHUD]; - }); -} - -- (void)hideProgressHUD { - if (_progressHUD) { - [_HUDIndicatorView stopAnimating]; - [_progressHUD removeFromSuperview]; - } -} - -- (void)setMaxImagesCount:(NSInteger)maxImagesCount { - _maxImagesCount = maxImagesCount; - if (maxImagesCount > 1) { - _showSelectBtn = YES; - _allowCrop = NO; - } -} - -- (void)setShowSelectBtn:(BOOL)showSelectBtn { - _showSelectBtn = showSelectBtn; - // 多选模式下,不允许让showSelectBtn为NO - if (!showSelectBtn && _maxImagesCount > 1) { - _showSelectBtn = YES; - } -} - -- (void)setAllowCrop:(BOOL)allowCrop { - _allowCrop = _maxImagesCount > 1 ? NO : allowCrop; - if (allowCrop) { // 允许裁剪的时候,不能选原图和GIF - self.allowPickingOriginalPhoto = NO; - self.allowPickingGif = NO; - } -} - -- (void)setCircleCropRadius:(NSInteger)circleCropRadius { - _circleCropRadius = circleCropRadius; - self.cropRect = CGRectMake(self.view.tz_width / 2 - circleCropRadius, self.view.tz_height / 2 - _circleCropRadius, _circleCropRadius * 2, _circleCropRadius * 2); -} - -- (void)setCropRect:(CGRect)cropRect { - _cropRect = cropRect; - _cropRectPortrait = cropRect; - CGFloat widthHeight = cropRect.size.width; - _cropRectLandscape = CGRectMake((self.view.tz_height - widthHeight) / 2, cropRect.origin.x, widthHeight, widthHeight); -} - -- (void)setTimeout:(NSInteger)timeout { - _timeout = timeout; - if (timeout < 5) { - _timeout = 5; - } else if (_timeout > 60) { - _timeout = 60; - } -} - -- (void)setPickerDelegate:(id)pickerDelegate { - _pickerDelegate = pickerDelegate; - [TZImageManager manager].pickerDelegate = pickerDelegate; -} - -- (void)setColumnNumber:(NSInteger)columnNumber { - _columnNumber = columnNumber; - if (columnNumber <= 2) { - _columnNumber = 2; - } else if (columnNumber >= 6) { - _columnNumber = 6; - } - - TZAlbumPickerController *albumPickerVc = [self.childViewControllers firstObject]; - albumPickerVc.columnNumber = _columnNumber; - [TZImageManager manager].columnNumber = _columnNumber; -} - -- (void)setMinPhotoWidthSelectable:(NSInteger)minPhotoWidthSelectable { - _minPhotoWidthSelectable = minPhotoWidthSelectable; - [TZImageManager manager].minPhotoWidthSelectable = minPhotoWidthSelectable; -} - -- (void)setMinPhotoHeightSelectable:(NSInteger)minPhotoHeightSelectable { - _minPhotoHeightSelectable = minPhotoHeightSelectable; - [TZImageManager manager].minPhotoHeightSelectable = minPhotoHeightSelectable; -} - -- (void)setHideWhenCanNotSelect:(BOOL)hideWhenCanNotSelect { - _hideWhenCanNotSelect = hideWhenCanNotSelect; - [TZImageManager manager].hideWhenCanNotSelect = hideWhenCanNotSelect; -} - -- (void)setPhotoPreviewMaxWidth:(CGFloat)photoPreviewMaxWidth { - _photoPreviewMaxWidth = photoPreviewMaxWidth; - if (photoPreviewMaxWidth > 800) { - _photoPreviewMaxWidth = 800; - } else if (photoPreviewMaxWidth < 500) { - _photoPreviewMaxWidth = 500; - } - [TZImageManager manager].photoPreviewMaxWidth = _photoPreviewMaxWidth; -} - -- (void)setPhotoWidth:(CGFloat)photoWidth { - _photoWidth = photoWidth; - [TZImageManager manager].photoWidth = photoWidth; -} - -- (void)setSelectedAssets:(NSMutableArray *)selectedAssets { - _selectedAssets = selectedAssets; - _selectedModels = [NSMutableArray array]; - for (id asset in selectedAssets) { - TZAssetModel *model = [TZAssetModel modelWithAsset:asset type:[[TZImageManager manager] getAssetType:asset]]; - model.isSelected = YES; - [_selectedModels addObject:model]; - } -} - -- (void)setAllowPickingImage:(BOOL)allowPickingImage { - _allowPickingImage = allowPickingImage; - NSString *allowPickingImageStr = _allowPickingImage ? @"1" : @"0"; - [[NSUserDefaults standardUserDefaults] setObject:allowPickingImageStr forKey:@"tz_allowPickingImage"]; - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -- (void)setAllowPickingVideo:(BOOL)allowPickingVideo { - _allowPickingVideo = allowPickingVideo; - NSString *allowPickingVideoStr = _allowPickingVideo ? @"1" : @"0"; - [[NSUserDefaults standardUserDefaults] setObject:allowPickingVideoStr forKey:@"tz_allowPickingVideo"]; - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -- (void)setSortAscendingByModificationDate:(BOOL)sortAscendingByModificationDate { - _sortAscendingByModificationDate = sortAscendingByModificationDate; - [TZImageManager manager].sortAscendingByModificationDate = sortAscendingByModificationDate; -} - -- (void)settingBtnClick { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; -} - -- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { - if (iOS7Later) viewController.automaticallyAdjustsScrollViewInsets = NO; - if (_timer) { [_timer invalidate]; _timer = nil;} - [super pushViewController:viewController animated:animated]; -} - -- (void)dealloc { - // NSLog(@"%@ dealloc",NSStringFromClass(self.class)); -} - -#pragma mark - UIContentContainer - -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - [self willInterfaceOrientionChange]; - if (size.width > size.height) { - _cropRect = _cropRectLandscape; - } else { - _cropRect = _cropRectPortrait; - } -} - -- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { - [self willInterfaceOrientionChange]; - if (toInterfaceOrientation >= 3) { - _cropRect = _cropRectLandscape; - } else { - _cropRect = _cropRectPortrait; - } -} - -- (void)willInterfaceOrientionChange { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.02 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - if (![UIApplication sharedApplication].statusBarHidden) { - if (iOS7Later && self.needShowStatusBar) [UIApplication sharedApplication].statusBarHidden = NO; - } - }); -} - -#pragma mark - Layout - -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - - _HUDContainer.frame = CGRectMake((self.view.tz_width - 120) / 2, (self.view.tz_height - 90) / 2, 120, 90); - _HUDIndicatorView.frame = CGRectMake(45, 15, 30, 30); - _HUDLabel.frame = CGRectMake(0,40, 120, 50); -} - -#pragma mark - Public - -- (void)cancelButtonClick { - if (self.autoDismiss) { - [self dismissViewControllerAnimated:YES completion:^{ - [self callDelegateMethod]; - }]; - } else { - [self callDelegateMethod]; - } -} - -- (void)callDelegateMethod { - if ([self.pickerDelegate respondsToSelector:@selector(tz_imagePickerControllerDidCancel:)]) { - [self.pickerDelegate tz_imagePickerControllerDidCancel:self]; - } - if (self.imagePickerControllerDidCancelHandle) { - self.imagePickerControllerDidCancelHandle(); - } -} - -@end - - -@interface TZAlbumPickerController () { - UITableView *_tableView; -} -@property (nonatomic, strong) NSMutableArray *albumArr; -@property (assign, nonatomic) BOOL isFirstAppear; -@end - -@implementation TZAlbumPickerController - -- (void)viewDidLoad { - [super viewDidLoad]; - self.isFirstAppear = YES; - self.view.backgroundColor = [UIColor whiteColor]; - - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:imagePickerVc.cancelBtnTitleStr style:UIBarButtonItemStylePlain target:imagePickerVc action:@selector(cancelButtonClick)]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - [imagePickerVc hideProgressHUD]; - if (imagePickerVc.allowTakePicture) { - self.navigationItem.title = [NSBundle tz_localizedStringForKey:@"Photos"]; - } else if (imagePickerVc.allowPickingVideo) { - self.navigationItem.title = [NSBundle tz_localizedStringForKey:@"Videos"]; - } - - if (self.isFirstAppear && !imagePickerVc.navLeftBarButtonSettingBlock) { - self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:[NSBundle tz_localizedStringForKey:@"Back"] style:UIBarButtonItemStylePlain target:nil action:nil]; - self.isFirstAppear = NO; - } - - [self configTableView]; -} - -- (void)configTableView { - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - [[TZImageManager manager] getAllAlbums:imagePickerVc.allowPickingVideo allowPickingImage:imagePickerVc.allowPickingImage completion:^(NSArray *models) { - dispatch_async(dispatch_get_main_queue(), ^{ - _albumArr = [NSMutableArray arrayWithArray:models]; - for (TZAlbumModel *albumModel in _albumArr) { - albumModel.selectedModels = imagePickerVc.selectedModels; - } - if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; - _tableView.rowHeight = 70; - _tableView.tableFooterView = [[UIView alloc] init]; - _tableView.dataSource = self; - _tableView.delegate = self; - [_tableView registerClass:[TZAlbumCell class] forCellReuseIdentifier:@"TZAlbumCell"]; - [self.view addSubview:_tableView]; - } else { - [_tableView reloadData]; - } - }); - }]; - }); -} - -- (void)dealloc { - // NSLog(@"%@ dealloc",NSStringFromClass(self.class)); -} - -#pragma mark - Layout - -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - - CGFloat top = 0; - CGFloat tableViewHeight = 0; - CGFloat naviBarHeight = self.navigationController.navigationBar.tz_height; - BOOL isStatusBarHidden = [UIApplication sharedApplication].isStatusBarHidden; - if (self.navigationController.navigationBar.isTranslucent) { - top = naviBarHeight; - if (iOS7Later && !isStatusBarHidden) top += [TZCommonTools tz_statusBarHeight]; - tableViewHeight = self.view.tz_height - top; - } else { - tableViewHeight = self.view.tz_height; - } - _tableView.frame = CGRectMake(0, top, self.view.tz_width, tableViewHeight); -} - -#pragma mark - UITableViewDataSource && Delegate - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return _albumArr.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - TZAlbumCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TZAlbumCell"]; - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - cell.selectedCountButton.backgroundColor = imagePickerVc.oKButtonTitleColorNormal; - cell.model = _albumArr[indexPath.row]; - cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - TZPhotoPickerController *photoPickerVc = [[TZPhotoPickerController alloc] init]; - photoPickerVc.columnNumber = self.columnNumber; - TZAlbumModel *model = _albumArr[indexPath.row]; - photoPickerVc.model = model; - [self.navigationController pushViewController:photoPickerVc animated:YES]; - [tableView deselectRowAtIndexPath:indexPath animated:NO]; -} - -#pragma clang diagnostic pop - -@end - - -@implementation UIImage (MyBundle) - -+ (UIImage *)imageNamedFromMyBundle:(NSString *)name { - NSBundle *imageBundle = [NSBundle tz_imagePickerBundle]; - name = [name stringByAppendingString:@"@2x"]; - NSString *imagePath = [imageBundle pathForResource:name ofType:@"png"]; - UIImage *image = [UIImage imageWithContentsOfFile:imagePath]; - if (!image) { - // 兼容业务方自己设置图片的方式 - name = [name stringByReplacingOccurrencesOfString:@"@2x" withString:@""]; - image = [UIImage imageNamed:name]; - } - return image; -} - -@end - - -@implementation NSString (TzExtension) - -- (BOOL)tz_containsString:(NSString *)string { - if (iOS8Later) { - return [self containsString:string]; - } else { - NSRange range = [self rangeOfString:string]; - return range.location != NSNotFound; - } -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (CGSize)tz_calculateSizeWithAttributes:(NSDictionary *)attributes maxSize:(CGSize)maxSize { - CGSize size; - if (iOS7Later) { - size = [self boundingRectWithSize:maxSize options:NSStringDrawingUsesFontLeading attributes:attributes context:nil].size; - } else { - size = [self sizeWithFont:attributes[NSFontAttributeName] constrainedToSize:maxSize]; - } - return size; -} -#pragma clang diagnostic pop - -@end - - -@implementation TZCommonTools - -+ (BOOL)tz_isIPhoneX { - struct utsname systemInfo; - uname(&systemInfo); - NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding]; - if ([platform isEqualToString:@"i386"] || [platform isEqualToString:@"x86_64"]) { - // 模拟器下采用屏幕的高度来判断 - return (CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(375, 812)) || - CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(812, 375))); - } - // iPhone10,6是美版iPhoneX 感谢hegelsu指出:https://github.com/banchichen/TZImagePickerController/issues/635 - BOOL isIPhoneX = [platform isEqualToString:@"iPhone10,3"] || [platform isEqualToString:@"iPhone10,6"]; - return isIPhoneX; -} - -+ (CGFloat)tz_statusBarHeight { - return [self tz_isIPhoneX] ? 44 : 20; -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZLocationManager.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZLocationManager.h deleted file mode 100644 index 487fbe86..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZLocationManager.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// TZLocationManager.h -// TZImagePickerController -// -// Created by 谭真 on 2017/06/03. -// Copyright © 2017年 谭真. All rights reserved. -// 定位管理类 - - -#import -#import - -@interface TZLocationManager : NSObject - -+ (instancetype)manager; - -/// 开始定位 -- (void)startLocation; -- (void)startLocationWithSuccessBlock:(void (^)(CLLocation *location,CLLocation *oldLocation))successBlock failureBlock:(void (^)(NSError *error))failureBlock; -- (void)startLocationWithGeocoderBlock:(void (^)(NSArray *geocoderArray))geocoderBlock; -- (void)startLocationWithSuccessBlock:(void (^)(CLLocation *location,CLLocation *oldLocation))successBlock failureBlock:(void (^)(NSError *error))failureBlock geocoderBlock:(void (^)(NSArray *geocoderArray))geocoderBlock; - -@end - diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZLocationManager.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZLocationManager.m deleted file mode 100644 index 15465b8a..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZLocationManager.m +++ /dev/null @@ -1,89 +0,0 @@ -// -// TZLocationManager.m -// TZImagePickerController -// -// Created by 谭真 on 2017/06/03. -// Copyright © 2017年 谭真. All rights reserved. -// 定位管理类 - -#import "TZLocationManager.h" -#import "TZImagePickerController.h" - -@interface TZLocationManager () -@property (nonatomic, strong) CLLocationManager *locationManager; -/// 定位成功的回调block -@property (nonatomic, copy) void (^successBlock)(CLLocation *location,CLLocation *oldLocation); -/// 编码成功的回调block -@property (nonatomic, copy) void (^geocodeBlock)(NSArray *geocodeArray); -/// 定位失败的回调block -@property (nonatomic, copy) void (^failureBlock)(NSError *error); -@end - -@implementation TZLocationManager - -+ (instancetype)manager { - static TZLocationManager *manager; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - manager = [[self alloc] init]; - manager.locationManager = [[CLLocationManager alloc] init]; - manager.locationManager.delegate = manager; - if (iOS8Later) { - [manager.locationManager requestWhenInUseAuthorization]; - } - }); - return manager; -} - -- (void)startLocation { - [self startLocationWithSuccessBlock:nil failureBlock:nil geocoderBlock:nil]; -} - -- (void)startLocationWithSuccessBlock:(void (^)(CLLocation *location,CLLocation *oldLocation))successBlock failureBlock:(void (^)(NSError *error))failureBlock { - [self startLocationWithSuccessBlock:successBlock failureBlock:failureBlock geocoderBlock:nil]; -} - -- (void)startLocationWithGeocoderBlock:(void (^)(NSArray *geocoderArray))geocoderBlock { - [self startLocationWithSuccessBlock:nil failureBlock:nil geocoderBlock:geocoderBlock]; -} - -- (void)startLocationWithSuccessBlock:(void (^)(CLLocation *location,CLLocation *oldLocation))successBlock failureBlock:(void (^)(NSError *error))failureBlock geocoderBlock:(void (^)(NSArray *geocoderArray))geocoderBlock { - [self.locationManager startUpdatingLocation]; - _successBlock = successBlock; - _geocodeBlock = geocoderBlock; - _failureBlock = failureBlock; -} - -#pragma mark - CLLocationManagerDelegate - -/// 地理位置发生改变时触发 -- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { - [manager stopUpdatingLocation]; - - if (_successBlock) { - _successBlock(newLocation,oldLocation); - } - - if (_geocodeBlock) { - CLGeocoder *geocoder = [[CLGeocoder alloc] init]; - [geocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *array, NSError *error) { - _geocodeBlock(array); - }]; - } -} - -/// 定位失败回调方法 -- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { - NSLog(@"定位失败, 错误: %@",error); - switch([error code]) { - case kCLErrorDenied: { // 用户禁止了定位权限 - - } break; - default: break; - } - if (_failureBlock) { - _failureBlock(error); - } -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPickerController.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPickerController.h deleted file mode 100644 index 357bb174..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPickerController.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// TZPhotoPickerController.h -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import - -@class TZAlbumModel; -@interface TZPhotoPickerController : UIViewController - -@property (nonatomic, assign) BOOL isFirstAppear; -@property (nonatomic, assign) NSInteger columnNumber; -@property (nonatomic, strong) TZAlbumModel *model; -@end - - -@interface TZCollectionView : UICollectionView - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m deleted file mode 100755 index 3d459db8..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m +++ /dev/null @@ -1,894 +0,0 @@ -// -// TZPhotoPickerController.m -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import "TZPhotoPickerController.h" -#import "TZImagePickerController.h" -#import "TZPhotoPreviewController.h" -#import "TZAssetCell.h" -#import "TZAssetModel.h" -#import "UIView+Layout.h" -#import "TZImageManager.h" -#import "TZVideoPlayerController.h" -#import "TZGifPhotoPreviewController.h" -#import "TZLocationManager.h" - -@interface TZPhotoPickerController () { - NSMutableArray *_models; - - UIView *_bottomToolBar; - UIButton *_previewButton; - UIButton *_doneButton; - UIImageView *_numberImageView; - UILabel *_numberLabel; - UIButton *_originalPhotoButton; - UILabel *_originalPhotoLabel; - UIView *_divideLine; - - BOOL _shouldScrollToBottom; - BOOL _showTakePhotoBtn; - - CGFloat _offsetItemCount; -} -@property CGRect previousPreheatRect; -@property (nonatomic, assign) BOOL isSelectOriginalPhoto; -@property (nonatomic, strong) TZCollectionView *collectionView; -@property (strong, nonatomic) UICollectionViewFlowLayout *layout; -@property (nonatomic, strong) UIImagePickerController *imagePickerVc; -@property (strong, nonatomic) CLLocation *location; -@end - -static CGSize AssetGridThumbnailSize; -static CGFloat itemMargin = 5; - -@implementation TZPhotoPickerController - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (UIImagePickerController *)imagePickerVc { - if (_imagePickerVc == nil) { - _imagePickerVc = [[UIImagePickerController alloc] init]; - _imagePickerVc.delegate = self; - // set appearance / 改变相册选择页的导航栏外观 - if (iOS7Later) { - _imagePickerVc.navigationBar.barTintColor = self.navigationController.navigationBar.barTintColor; - } - _imagePickerVc.navigationBar.tintColor = self.navigationController.navigationBar.tintColor; - UIBarButtonItem *tzBarItem, *BarItem; - if (iOS9Later) { - tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; - BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]]; - } else { - tzBarItem = [UIBarButtonItem appearanceWhenContainedIn:[TZImagePickerController class], nil]; - BarItem = [UIBarButtonItem appearanceWhenContainedIn:[UIImagePickerController class], nil]; - } - NSDictionary *titleTextAttributes = [tzBarItem titleTextAttributesForState:UIControlStateNormal]; - [BarItem setTitleTextAttributes:titleTextAttributes forState:UIControlStateNormal]; - } - return _imagePickerVc; -} -- (void)viewDidLoad { - [super viewDidLoad]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - _isSelectOriginalPhoto = tzImagePickerVc.isSelectOriginalPhoto; - _shouldScrollToBottom = YES; - self.view.backgroundColor = [UIColor whiteColor]; - self.navigationItem.title = _model.name; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:tzImagePickerVc.cancelBtnTitleStr style:UIBarButtonItemStylePlain target:tzImagePickerVc action:@selector(cancelButtonClick)]; - if (tzImagePickerVc.navLeftBarButtonSettingBlock) { - UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom]; - leftButton.frame = CGRectMake(0, 0, 44, 44); - [leftButton addTarget:self action:@selector(navLeftBarButtonClick) forControlEvents:UIControlEventTouchUpInside]; - tzImagePickerVc.navLeftBarButtonSettingBlock(leftButton); - self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftButton]; - } - _showTakePhotoBtn = (_model.isCameraRoll && tzImagePickerVc.allowTakePicture); - // [self resetCachedAssets]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeStatusBarOrientationNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; -} - -- (void)fetchAssetModels { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (_isFirstAppear) { - [tzImagePickerVc showProgressHUD]; - } - dispatch_sync(dispatch_get_global_queue(0, 0), ^{ - if (!tzImagePickerVc.sortAscendingByModificationDate && _isFirstAppear && iOS8Later) { - [[TZImageManager manager] getCameraRollAlbum:tzImagePickerVc.allowPickingVideo allowPickingImage:tzImagePickerVc.allowPickingImage completion:^(TZAlbumModel *model) { - _model = model; - _models = [NSMutableArray arrayWithArray:_model.models]; - [self initSubviews]; - }]; - } else { - if (_showTakePhotoBtn || !iOS8Later || _isFirstAppear) { - [[TZImageManager manager] getAssetsFromFetchResult:_model.result allowPickingVideo:tzImagePickerVc.allowPickingVideo allowPickingImage:tzImagePickerVc.allowPickingImage completion:^(NSArray *models) { - _models = [NSMutableArray arrayWithArray:models]; - [self initSubviews]; - }]; - } else { - _models = [NSMutableArray arrayWithArray:_model.models]; - [self initSubviews]; - } - } - }); -} - -- (void)initSubviews { - dispatch_async(dispatch_get_main_queue(), ^{ - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - [tzImagePickerVc hideProgressHUD]; - - [self checkSelectedModels]; - [self configCollectionView]; - _collectionView.hidden = YES; - [self configBottomToolBar]; - - [self scrollCollectionViewToBottom]; - }); -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - tzImagePickerVc.isSelectOriginalPhoto = _isSelectOriginalPhoto; -} - -- (BOOL)prefersStatusBarHidden { - return NO; -} - -- (void)configCollectionView { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - - _layout = [[UICollectionViewFlowLayout alloc] init]; - _collectionView = [[TZCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:_layout]; - _collectionView.backgroundColor = [UIColor whiteColor]; - _collectionView.dataSource = self; - _collectionView.delegate = self; - _collectionView.alwaysBounceHorizontal = NO; - _collectionView.contentInset = UIEdgeInsetsMake(itemMargin, itemMargin, itemMargin, itemMargin); - - if (_showTakePhotoBtn && tzImagePickerVc.allowTakePicture ) { - _collectionView.contentSize = CGSizeMake(self.view.tz_width, ((_model.count + self.columnNumber) / self.columnNumber) * self.view.tz_width); - } else { - _collectionView.contentSize = CGSizeMake(self.view.tz_width, ((_model.count + self.columnNumber - 1) / self.columnNumber) * self.view.tz_width); - } - [self.view addSubview:_collectionView]; - [_collectionView registerClass:[TZAssetCell class] forCellWithReuseIdentifier:@"TZAssetCell"]; - [_collectionView registerClass:[TZAssetCameraCell class] forCellWithReuseIdentifier:@"TZAssetCameraCell"]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - // Determine the size of the thumbnails to request from the PHCachingImageManager - CGFloat scale = 2.0; - if ([UIScreen mainScreen].bounds.size.width > 600) { - scale = 1.0; - } - CGSize cellSize = ((UICollectionViewFlowLayout *)_collectionView.collectionViewLayout).itemSize; - AssetGridThumbnailSize = CGSizeMake(cellSize.width * scale, cellSize.height * scale); - - if (!_models) { - [self fetchAssetModels]; - } -} - -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - if (iOS8Later) { - // [self updateCachedAssets]; - } -} - -- (void)configBottomToolBar { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (!tzImagePickerVc.showSelectBtn) return; - - _bottomToolBar = [[UIView alloc] initWithFrame:CGRectZero]; - CGFloat rgb = 253 / 255.0; - _bottomToolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:1.0]; - - _previewButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_previewButton addTarget:self action:@selector(previewButtonClick) forControlEvents:UIControlEventTouchUpInside]; - _previewButton.titleLabel.font = [UIFont systemFontOfSize:16]; - [_previewButton setTitle:tzImagePickerVc.previewBtnTitleStr forState:UIControlStateNormal]; - [_previewButton setTitle:tzImagePickerVc.previewBtnTitleStr forState:UIControlStateDisabled]; - [_previewButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; - [_previewButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled]; - _previewButton.enabled = tzImagePickerVc.selectedModels.count; - - if (tzImagePickerVc.allowPickingOriginalPhoto) { - _originalPhotoButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _originalPhotoButton.imageEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0); - [_originalPhotoButton addTarget:self action:@selector(originalPhotoButtonClick) forControlEvents:UIControlEventTouchUpInside]; - _originalPhotoButton.titleLabel.font = [UIFont systemFontOfSize:16]; - [_originalPhotoButton setTitle:tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateNormal]; - [_originalPhotoButton setTitle:tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateSelected]; - [_originalPhotoButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal]; - [_originalPhotoButton setTitleColor:[UIColor blackColor] forState:UIControlStateSelected]; - [_originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:tzImagePickerVc.photoOriginDefImageName] forState:UIControlStateNormal]; - [_originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:tzImagePickerVc.photoOriginSelImageName] forState:UIControlStateSelected]; - _originalPhotoButton.selected = _isSelectOriginalPhoto; - _originalPhotoButton.enabled = tzImagePickerVc.selectedModels.count > 0; - - _originalPhotoLabel = [[UILabel alloc] init]; - _originalPhotoLabel.textAlignment = NSTextAlignmentLeft; - _originalPhotoLabel.font = [UIFont systemFontOfSize:16]; - _originalPhotoLabel.textColor = [UIColor blackColor]; - if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes]; - } - - _doneButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _doneButton.titleLabel.font = [UIFont systemFontOfSize:16]; - [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside]; - [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal]; - [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateDisabled]; - [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal]; - [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorDisabled forState:UIControlStateDisabled]; - _doneButton.enabled = tzImagePickerVc.selectedModels.count || tzImagePickerVc.alwaysEnableDoneBtn; - - _numberImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamedFromMyBundle:tzImagePickerVc.photoNumberIconImageName]]; - _numberImageView.hidden = tzImagePickerVc.selectedModels.count <= 0; - _numberImageView.backgroundColor = [UIColor clearColor]; - - _numberLabel = [[UILabel alloc] init]; - _numberLabel.font = [UIFont systemFontOfSize:15]; - _numberLabel.textColor = [UIColor whiteColor]; - _numberLabel.textAlignment = NSTextAlignmentCenter; - _numberLabel.text = [NSString stringWithFormat:@"%zd",tzImagePickerVc.selectedModels.count]; - _numberLabel.hidden = tzImagePickerVc.selectedModels.count <= 0; - _numberLabel.backgroundColor = [UIColor clearColor]; - - _divideLine = [[UIView alloc] init]; - CGFloat rgb2 = 222 / 255.0; - _divideLine.backgroundColor = [UIColor colorWithRed:rgb2 green:rgb2 blue:rgb2 alpha:1.0]; - - [_bottomToolBar addSubview:_divideLine]; - [_bottomToolBar addSubview:_previewButton]; - [_bottomToolBar addSubview:_doneButton]; - [_bottomToolBar addSubview:_numberImageView]; - [_bottomToolBar addSubview:_numberLabel]; - [_bottomToolBar addSubview:_originalPhotoButton]; - [self.view addSubview:_bottomToolBar]; - [_originalPhotoButton addSubview:_originalPhotoLabel]; -} - -#pragma mark - Layout - -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - - CGFloat top = 0; - CGFloat collectionViewHeight = 0; - CGFloat naviBarHeight = self.navigationController.navigationBar.tz_height; - BOOL isStatusBarHidden = [UIApplication sharedApplication].isStatusBarHidden; - CGFloat toolBarHeight = [TZCommonTools tz_isIPhoneX] ? 50 + (83 - 49) : 50; - if (self.navigationController.navigationBar.isTranslucent) { - top = naviBarHeight; - if (iOS7Later && !isStatusBarHidden) top += [TZCommonTools tz_statusBarHeight]; - collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - toolBarHeight - top : self.view.tz_height - top;; - } else { - collectionViewHeight = tzImagePickerVc.showSelectBtn ? self.view.tz_height - toolBarHeight : self.view.tz_height; - } - _collectionView.frame = CGRectMake(0, top, self.view.tz_width, collectionViewHeight); - CGFloat itemWH = (self.view.tz_width - (self.columnNumber + 1) * itemMargin) / self.columnNumber; - _layout.itemSize = CGSizeMake(itemWH, itemWH); - _layout.minimumInteritemSpacing = itemMargin; - _layout.minimumLineSpacing = itemMargin; - [_collectionView setCollectionViewLayout:_layout]; - if (_offsetItemCount > 0) { - CGFloat offsetY = _offsetItemCount * (_layout.itemSize.height + _layout.minimumLineSpacing); - [_collectionView setContentOffset:CGPointMake(0, offsetY)]; - } - - CGFloat toolBarTop = 0; - if (!self.navigationController.navigationBar.isHidden) { - toolBarTop = self.view.tz_height - toolBarHeight; - } else { - CGFloat navigationHeight = naviBarHeight; - if (iOS7Later) navigationHeight += [TZCommonTools tz_statusBarHeight]; - toolBarTop = self.view.tz_height - toolBarHeight - navigationHeight; - } - _bottomToolBar.frame = CGRectMake(0, toolBarTop, self.view.tz_width, toolBarHeight); - CGFloat previewWidth = [tzImagePickerVc.previewBtnTitleStr tz_calculateSizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} maxSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)].width + 2; - if (!tzImagePickerVc.allowPreview) { - previewWidth = 0.0; - } - _previewButton.frame = CGRectMake(10, 3, previewWidth, 44); - _previewButton.tz_width = !tzImagePickerVc.showSelectBtn ? 0 : previewWidth; - if (tzImagePickerVc.allowPickingOriginalPhoto) { - CGFloat fullImageWidth = [tzImagePickerVc.fullImageBtnTitleStr tz_calculateSizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} maxSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)].width; - _originalPhotoButton.frame = CGRectMake(CGRectGetMaxX(_previewButton.frame), 0, fullImageWidth + 56, 50); - _originalPhotoLabel.frame = CGRectMake(fullImageWidth + 46, 0, 80, 50); - } - _doneButton.frame = CGRectMake(self.view.tz_width - 44 - 12, 3, 44, 44); - _numberImageView.frame = CGRectMake(self.view.tz_width - 56 - 28, 10, 30, 30); - _numberLabel.frame = _numberImageView.frame; - _divideLine.frame = CGRectMake(0, 0, self.view.tz_width, 1); - - [TZImageManager manager].columnNumber = [TZImageManager manager].columnNumber; - [self.collectionView reloadData]; -} - -#pragma mark - Notification - -- (void)didChangeStatusBarOrientationNotification:(NSNotification *)noti { - _offsetItemCount = _collectionView.contentOffset.y / (_layout.itemSize.height + _layout.minimumLineSpacing); -} - -#pragma mark - Click Event -- (void)navLeftBarButtonClick{ - [self.navigationController popViewControllerAnimated:YES]; -} -- (void)previewButtonClick { - TZPhotoPreviewController *photoPreviewVc = [[TZPhotoPreviewController alloc] init]; - [self pushPhotoPrevireViewController:photoPreviewVc]; -} - -- (void)originalPhotoButtonClick { - _originalPhotoButton.selected = !_originalPhotoButton.isSelected; - _isSelectOriginalPhoto = _originalPhotoButton.isSelected; - _originalPhotoLabel.hidden = !_originalPhotoButton.isSelected; - if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes]; -} - -- (void)doneButtonClick { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - // 1.6.8 判断是否满足最小必选张数的限制 - if (tzImagePickerVc.minImagesCount && tzImagePickerVc.selectedModels.count < tzImagePickerVc.minImagesCount) { - NSString *title = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Select a minimum of %zd photos"], tzImagePickerVc.minImagesCount]; - [tzImagePickerVc showAlertWithTitle:title]; - return; - } - - [tzImagePickerVc showProgressHUD]; - NSMutableArray *photos = [NSMutableArray array]; - NSMutableArray *assets = [NSMutableArray array]; - NSMutableArray *infoArr = [NSMutableArray array]; - for (NSInteger i = 0; i < tzImagePickerVc.selectedModels.count; i++) { [photos addObject:@1];[assets addObject:@1];[infoArr addObject:@1]; } - - __block BOOL havenotShowAlert = YES; - [TZImageManager manager].shouldFixOrientation = YES; - __block id alertView; - for (NSInteger i = 0; i < tzImagePickerVc.selectedModels.count; i++) { - TZAssetModel *model = tzImagePickerVc.selectedModels[i]; - [[TZImageManager manager] getPhotoWithAsset:model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - if (isDegraded) return; - if (photo) { - photo = [self scaleImage:photo toSize:CGSizeMake(tzImagePickerVc.photoWidth, (int)(tzImagePickerVc.photoWidth * photo.size.height / photo.size.width))]; - [photos replaceObjectAtIndex:i withObject:photo]; - } - if (info) [infoArr replaceObjectAtIndex:i withObject:info]; - [assets replaceObjectAtIndex:i withObject:model.asset]; - - for (id item in photos) { if ([item isKindOfClass:[NSNumber class]]) return; } - - if (havenotShowAlert) { - [tzImagePickerVc hideAlertView:alertView]; - [self didGetAllPhotos:photos assets:assets infoArr:infoArr]; - } - } progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) { - // 如果图片正在从iCloud同步中,提醒用户 - if (progress < 1 && havenotShowAlert && !alertView) { - [tzImagePickerVc hideProgressHUD]; - alertView = [tzImagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Synchronizing photos from iCloud"]]; - havenotShowAlert = NO; - return; - } - if (progress >= 1) { - havenotShowAlert = YES; - } - } networkAccessAllowed:YES]; - } - if (tzImagePickerVc.selectedModels.count <= 0) { - [self didGetAllPhotos:photos assets:assets infoArr:infoArr]; - } -} - -- (void)didGetAllPhotos:(NSArray *)photos assets:(NSArray *)assets infoArr:(NSArray *)infoArr { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - [tzImagePickerVc hideProgressHUD]; - - if (tzImagePickerVc.autoDismiss) { - [self.navigationController dismissViewControllerAnimated:YES completion:^{ - [self callDelegateMethodWithPhotos:photos assets:assets infoArr:infoArr]; - }]; - } else { - [self callDelegateMethodWithPhotos:photos assets:assets infoArr:infoArr]; - } -} - -- (void)callDelegateMethodWithPhotos:(NSArray *)photos assets:(NSArray *)assets infoArr:(NSArray *)infoArr { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if ([tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:)]) { - [tzImagePickerVc.pickerDelegate imagePickerController:tzImagePickerVc didFinishPickingPhotos:photos sourceAssets:assets isSelectOriginalPhoto:_isSelectOriginalPhoto]; - } - if ([tzImagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingPhotos:sourceAssets:isSelectOriginalPhoto:infos:)]) { - [tzImagePickerVc.pickerDelegate imagePickerController:tzImagePickerVc didFinishPickingPhotos:photos sourceAssets:assets isSelectOriginalPhoto:_isSelectOriginalPhoto infos:infoArr]; - } - if (tzImagePickerVc.didFinishPickingPhotosHandle) { - tzImagePickerVc.didFinishPickingPhotosHandle(photos,assets,_isSelectOriginalPhoto); - } - if (tzImagePickerVc.didFinishPickingPhotosWithInfosHandle) { - tzImagePickerVc.didFinishPickingPhotosWithInfosHandle(photos,assets,_isSelectOriginalPhoto,infoArr); - } -} - -#pragma mark - UICollectionViewDataSource && Delegate - -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - if (_showTakePhotoBtn) { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (tzImagePickerVc.allowPickingImage && tzImagePickerVc.allowTakePicture) { - return _models.count + 1; - } - } - return _models.count; -} - -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - // the cell lead to take a picture / 去拍照的cell - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (((tzImagePickerVc.sortAscendingByModificationDate && indexPath.row >= _models.count) || (!tzImagePickerVc.sortAscendingByModificationDate && indexPath.row == 0)) && _showTakePhotoBtn) { - TZAssetCameraCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZAssetCameraCell" forIndexPath:indexPath]; - cell.imageView.image = [UIImage imageNamedFromMyBundle:tzImagePickerVc.takePictureImageName]; - return cell; - } - // the cell dipaly photo or video / 展示照片或视频的cell - TZAssetCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZAssetCell" forIndexPath:indexPath]; - cell.allowPickingMultipleVideo = tzImagePickerVc.allowPickingMultipleVideo; - cell.photoDefImageName = tzImagePickerVc.photoDefImageName; - cell.photoSelImageName = tzImagePickerVc.photoSelImageName; - TZAssetModel *model; - if (tzImagePickerVc.sortAscendingByModificationDate || !_showTakePhotoBtn) { - model = _models[indexPath.row]; - } else { - model = _models[indexPath.row - 1]; - } - cell.allowPickingGif = tzImagePickerVc.allowPickingGif; - cell.model = model; - cell.showSelectBtn = tzImagePickerVc.showSelectBtn; - cell.allowPreview = tzImagePickerVc.allowPreview; - - __weak typeof(cell) weakCell = cell; - __weak typeof(self) weakSelf = self; - __weak typeof(_numberImageView.layer) weakLayer = _numberImageView.layer; - cell.didSelectPhotoBlock = ^(BOOL isSelected) { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)weakSelf.navigationController; - // 1. cancel select / 取消选择 - if (isSelected) { - weakCell.selectPhotoButton.selected = NO; - model.isSelected = NO; - NSArray *selectedModels = [NSArray arrayWithArray:tzImagePickerVc.selectedModels]; - for (TZAssetModel *model_item in selectedModels) { - if ([[[TZImageManager manager] getAssetIdentifier:model.asset] isEqualToString:[[TZImageManager manager] getAssetIdentifier:model_item.asset]]) { - [tzImagePickerVc.selectedModels removeObject:model_item]; - break; - } - } - [weakSelf refreshBottomToolBarStatus]; - } else { - // 2. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制 - if (tzImagePickerVc.selectedModels.count < tzImagePickerVc.maxImagesCount) { - weakCell.selectPhotoButton.selected = YES; - model.isSelected = YES; - [tzImagePickerVc.selectedModels addObject:model]; - [weakSelf refreshBottomToolBarStatus]; - } else { - NSString *title = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Select a maximum of %zd photos"], tzImagePickerVc.maxImagesCount]; - [tzImagePickerVc showAlertWithTitle:title]; - } - } - [UIView showOscillatoryAnimationWithLayer:weakLayer type:TZOscillatoryAnimationToSmaller]; - }; - return cell; -} - -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - // take a photo / 去拍照 - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (((tzImagePickerVc.sortAscendingByModificationDate && indexPath.row >= _models.count) || (!tzImagePickerVc.sortAscendingByModificationDate && indexPath.row == 0)) && _showTakePhotoBtn) { - [self takePhoto]; return; - } - // preview phote or video / 预览照片或视频 - NSInteger index = indexPath.row; - if (!tzImagePickerVc.sortAscendingByModificationDate && _showTakePhotoBtn) { - index = indexPath.row - 1; - } - TZAssetModel *model = _models[index]; - if (model.type == TZAssetModelMediaTypeVideo && !tzImagePickerVc.allowPickingMultipleVideo) { - if (tzImagePickerVc.selectedModels.count > 0) { - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - [imagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Can not choose both video and photo"]]; - } else { - TZVideoPlayerController *videoPlayerVc = [[TZVideoPlayerController alloc] init]; - videoPlayerVc.model = model; - [self.navigationController pushViewController:videoPlayerVc animated:YES]; - } - } else if (model.type == TZAssetModelMediaTypePhotoGif && tzImagePickerVc.allowPickingGif && !tzImagePickerVc.allowPickingMultipleVideo) { - if (tzImagePickerVc.selectedModels.count > 0) { - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - [imagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Can not choose both photo and GIF"]]; - } else { - TZGifPhotoPreviewController *gifPreviewVc = [[TZGifPhotoPreviewController alloc] init]; - gifPreviewVc.model = model; - [self.navigationController pushViewController:gifPreviewVc animated:YES]; - } - } else { - TZPhotoPreviewController *photoPreviewVc = [[TZPhotoPreviewController alloc] init]; - photoPreviewVc.currentIndex = index; - photoPreviewVc.models = _models; - [self pushPhotoPrevireViewController:photoPreviewVc]; - } -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - if (iOS8Later) { - // [self updateCachedAssets]; - } -} - -#pragma mark - Private Method - -/// 拍照按钮点击事件 -- (void)takePhoto { - AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; - if ((authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied) && iOS7Later) { - // 无权限 做一个友好的提示 - NSString *appName = [[NSBundle mainBundle].infoDictionary valueForKey:@"CFBundleDisplayName"]; - if (!appName) appName = [[NSBundle mainBundle].infoDictionary valueForKey:@"CFBundleName"]; - NSString *message = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Please allow %@ to access your camera in \"Settings -> Privacy -> Camera\""],appName]; - if (iOS8Later) { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSBundle tz_localizedStringForKey:@"Can not use camera"] message:message delegate:self cancelButtonTitle:[NSBundle tz_localizedStringForKey:@"Cancel"] otherButtonTitles:[NSBundle tz_localizedStringForKey:@"Setting"], nil]; - [alert show]; - } else { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSBundle tz_localizedStringForKey:@"Can not use camera"] message:message delegate:self cancelButtonTitle:[NSBundle tz_localizedStringForKey:@"OK"] otherButtonTitles:nil]; - [alert show]; - } - } else if (authStatus == AVAuthorizationStatusNotDetermined) { - // fix issue 466, 防止用户首次拍照拒绝授权时相机页黑屏 - if (iOS7Later) { - [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { - if (granted) { - dispatch_sync(dispatch_get_main_queue(), ^{ - [self pushImagePickerController]; - }); - } - }]; - } else { - [self pushImagePickerController]; - } - } else { - [self pushImagePickerController]; - } -} - -// 调用相机 -- (void)pushImagePickerController { - // 提前定位 - __weak typeof(self) weakSelf = self; - [[TZLocationManager manager] startLocationWithSuccessBlock:^(CLLocation *location, CLLocation *oldLocation) { - weakSelf.location = location; - } failureBlock:^(NSError *error) { - weakSelf.location = nil; - }]; - - UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera; - if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { - self.imagePickerVc.sourceType = sourceType; - if(iOS8Later) { - _imagePickerVc.modalPresentationStyle = UIModalPresentationOverCurrentContext; - } - [self presentViewController:_imagePickerVc animated:YES completion:nil]; - } else { - NSLog(@"模拟器中无法打开照相机,请在真机中使用"); - } -} - -- (void)refreshBottomToolBarStatus { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - - _previewButton.enabled = tzImagePickerVc.selectedModels.count > 0; - _doneButton.enabled = tzImagePickerVc.selectedModels.count > 0 || tzImagePickerVc.alwaysEnableDoneBtn; - - _numberImageView.hidden = tzImagePickerVc.selectedModels.count <= 0; - _numberLabel.hidden = tzImagePickerVc.selectedModels.count <= 0; - _numberLabel.text = [NSString stringWithFormat:@"%zd",tzImagePickerVc.selectedModels.count]; - - _originalPhotoButton.enabled = tzImagePickerVc.selectedModels.count > 0; - _originalPhotoButton.selected = (_isSelectOriginalPhoto && _originalPhotoButton.enabled); - _originalPhotoLabel.hidden = (!_originalPhotoButton.isSelected); - if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes]; -} - -- (void)pushPhotoPrevireViewController:(TZPhotoPreviewController *)photoPreviewVc { - __weak typeof(self) weakSelf = self; - photoPreviewVc.isSelectOriginalPhoto = _isSelectOriginalPhoto; - [photoPreviewVc setBackButtonClickBlock:^(BOOL isSelectOriginalPhoto) { - weakSelf.isSelectOriginalPhoto = isSelectOriginalPhoto; - [weakSelf.collectionView reloadData]; - [weakSelf refreshBottomToolBarStatus]; - }]; - [photoPreviewVc setDoneButtonClickBlock:^(BOOL isSelectOriginalPhoto) { - weakSelf.isSelectOriginalPhoto = isSelectOriginalPhoto; - [weakSelf doneButtonClick]; - }]; - [photoPreviewVc setDoneButtonClickBlockCropMode:^(UIImage *cropedImage, id asset) { - [weakSelf didGetAllPhotos:@[cropedImage] assets:@[asset] infoArr:nil]; - }]; - [self.navigationController pushViewController:photoPreviewVc animated:YES]; -} - -- (void)getSelectedPhotoBytes { - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - [[TZImageManager manager] getPhotosBytesWithArray:imagePickerVc.selectedModels completion:^(NSString *totalBytes) { - _originalPhotoLabel.text = [NSString stringWithFormat:@"(%@)",totalBytes]; - }]; -} - -/// Scale image / 缩放图片 -- (UIImage *)scaleImage:(UIImage *)image toSize:(CGSize)size { - if (image.size.width < size.width) { - return image; - } - UIGraphicsBeginImageContext(size); - [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; - UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return newImage; -} - -- (void)scrollCollectionViewToBottom { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (_shouldScrollToBottom && _models.count > 0) { - NSInteger item = 0; - if (tzImagePickerVc.sortAscendingByModificationDate) { - item = _models.count - 1; - if (_showTakePhotoBtn) { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (tzImagePickerVc.allowPickingImage && tzImagePickerVc.allowTakePicture) { - item += 1; - } - } - } - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [_collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:item inSection:0] atScrollPosition:UICollectionViewScrollPositionBottom animated:NO]; - _shouldScrollToBottom = NO; - _collectionView.hidden = NO; - }); - } else { - _collectionView.hidden = NO; - } -} - -- (void)checkSelectedModels { - for (TZAssetModel *model in _models) { - model.isSelected = NO; - NSMutableArray *selectedAssets = [NSMutableArray array]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - for (TZAssetModel *model in tzImagePickerVc.selectedModels) { - [selectedAssets addObject:model.asset]; - } - if ([[TZImageManager manager] isAssetsArray:selectedAssets containAsset:model.asset]) { - model.isSelected = YES; - } - } -} - -#pragma mark - UIAlertViewDelegate - -- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { - if (buttonIndex == 1) { // 去设置界面,开启相机访问权限 - if (iOS8Later) { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; - } - } -} - -#pragma mark - UIImagePickerControllerDelegate - -- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { - [picker dismissViewControllerAnimated:YES completion:nil]; - NSString *type = [info objectForKey:UIImagePickerControllerMediaType]; - if ([type isEqualToString:@"public.image"]) { - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - [imagePickerVc showProgressHUD]; - UIImage *photo = [info objectForKey:UIImagePickerControllerOriginalImage]; - if (photo) { - [[TZImageManager manager] savePhotoWithImage:photo location:self.location completion:^(NSError *error){ - if (!error) { - [self reloadPhotoArray]; - } - }]; - self.location = nil; - } - } -} - -- (void)reloadPhotoArray { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - [[TZImageManager manager] getCameraRollAlbum:tzImagePickerVc.allowPickingVideo allowPickingImage:tzImagePickerVc.allowPickingImage completion:^(TZAlbumModel *model) { - _model = model; - [[TZImageManager manager] getAssetsFromFetchResult:_model.result allowPickingVideo:tzImagePickerVc.allowPickingVideo allowPickingImage:tzImagePickerVc.allowPickingImage completion:^(NSArray *models) { - [tzImagePickerVc hideProgressHUD]; - - TZAssetModel *assetModel; - if (tzImagePickerVc.sortAscendingByModificationDate) { - assetModel = [models lastObject]; - [_models addObject:assetModel]; - } else { - assetModel = [models firstObject]; - [_models insertObject:assetModel atIndex:0]; - } - - if (tzImagePickerVc.maxImagesCount <= 1) { - if (tzImagePickerVc.allowCrop) { - TZPhotoPreviewController *photoPreviewVc = [[TZPhotoPreviewController alloc] init]; - if (tzImagePickerVc.sortAscendingByModificationDate) { - photoPreviewVc.currentIndex = _models.count - 1; - } else { - photoPreviewVc.currentIndex = 0; - } - photoPreviewVc.models = _models; - [self pushPhotoPrevireViewController:photoPreviewVc]; - } else { - [tzImagePickerVc.selectedModels addObject:assetModel]; - [self doneButtonClick]; - } - return; - } - - if (tzImagePickerVc.selectedModels.count < tzImagePickerVc.maxImagesCount) { - assetModel.isSelected = YES; - [tzImagePickerVc.selectedModels addObject:assetModel]; - [self refreshBottomToolBarStatus]; - } - _collectionView.hidden = YES; - [_collectionView reloadData]; - - _shouldScrollToBottom = YES; - [self scrollCollectionViewToBottom]; - }]; - }]; -} - -- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { - [picker dismissViewControllerAnimated:YES completion:nil]; -} - -- (void)dealloc { - // NSLog(@"%@ dealloc",NSStringFromClass(self.class)); -} - -#pragma mark - Asset Caching - -- (void)resetCachedAssets { - [[TZImageManager manager].cachingImageManager stopCachingImagesForAllAssets]; - self.previousPreheatRect = CGRectZero; -} - -- (void)updateCachedAssets { - BOOL isViewVisible = [self isViewLoaded] && [[self view] window] != nil; - if (!isViewVisible) { return; } - - // The preheat window is twice the height of the visible rect. - CGRect preheatRect = _collectionView.bounds; - preheatRect = CGRectInset(preheatRect, 0.0f, -0.5f * CGRectGetHeight(preheatRect)); - - /* - Check if the collection view is showing an area that is significantly - different to the last preheated area. - */ - CGFloat delta = ABS(CGRectGetMidY(preheatRect) - CGRectGetMidY(self.previousPreheatRect)); - if (delta > CGRectGetHeight(_collectionView.bounds) / 3.0f) { - - // Compute the assets to start caching and to stop caching. - NSMutableArray *addedIndexPaths = [NSMutableArray array]; - NSMutableArray *removedIndexPaths = [NSMutableArray array]; - - [self computeDifferenceBetweenRect:self.previousPreheatRect andRect:preheatRect removedHandler:^(CGRect removedRect) { - NSArray *indexPaths = [self aapl_indexPathsForElementsInRect:removedRect]; - [removedIndexPaths addObjectsFromArray:indexPaths]; - } addedHandler:^(CGRect addedRect) { - NSArray *indexPaths = [self aapl_indexPathsForElementsInRect:addedRect]; - [addedIndexPaths addObjectsFromArray:indexPaths]; - }]; - - NSArray *assetsToStartCaching = [self assetsAtIndexPaths:addedIndexPaths]; - NSArray *assetsToStopCaching = [self assetsAtIndexPaths:removedIndexPaths]; - - // Update the assets the PHCachingImageManager is caching. - [[TZImageManager manager].cachingImageManager startCachingImagesForAssets:assetsToStartCaching - targetSize:AssetGridThumbnailSize - contentMode:PHImageContentModeAspectFill - options:nil]; - [[TZImageManager manager].cachingImageManager stopCachingImagesForAssets:assetsToStopCaching - targetSize:AssetGridThumbnailSize - contentMode:PHImageContentModeAspectFill - options:nil]; - - // Store the preheat rect to compare against in the future. - self.previousPreheatRect = preheatRect; - } -} - -- (void)computeDifferenceBetweenRect:(CGRect)oldRect andRect:(CGRect)newRect removedHandler:(void (^)(CGRect removedRect))removedHandler addedHandler:(void (^)(CGRect addedRect))addedHandler { - if (CGRectIntersectsRect(newRect, oldRect)) { - CGFloat oldMaxY = CGRectGetMaxY(oldRect); - CGFloat oldMinY = CGRectGetMinY(oldRect); - CGFloat newMaxY = CGRectGetMaxY(newRect); - CGFloat newMinY = CGRectGetMinY(newRect); - - if (newMaxY > oldMaxY) { - CGRect rectToAdd = CGRectMake(newRect.origin.x, oldMaxY, newRect.size.width, (newMaxY - oldMaxY)); - addedHandler(rectToAdd); - } - - if (oldMinY > newMinY) { - CGRect rectToAdd = CGRectMake(newRect.origin.x, newMinY, newRect.size.width, (oldMinY - newMinY)); - addedHandler(rectToAdd); - } - - if (newMaxY < oldMaxY) { - CGRect rectToRemove = CGRectMake(newRect.origin.x, newMaxY, newRect.size.width, (oldMaxY - newMaxY)); - removedHandler(rectToRemove); - } - - if (oldMinY < newMinY) { - CGRect rectToRemove = CGRectMake(newRect.origin.x, oldMinY, newRect.size.width, (newMinY - oldMinY)); - removedHandler(rectToRemove); - } - } else { - addedHandler(newRect); - removedHandler(oldRect); - } -} - -- (NSArray *)assetsAtIndexPaths:(NSArray *)indexPaths { - if (indexPaths.count == 0) { return nil; } - - NSMutableArray *assets = [NSMutableArray arrayWithCapacity:indexPaths.count]; - for (NSIndexPath *indexPath in indexPaths) { - if (indexPath.item < _models.count) { - TZAssetModel *model = _models[indexPath.item]; - [assets addObject:model.asset]; - } - } - - return assets; -} - -- (NSArray *)aapl_indexPathsForElementsInRect:(CGRect)rect { - NSArray *allLayoutAttributes = [_collectionView.collectionViewLayout layoutAttributesForElementsInRect:rect]; - if (allLayoutAttributes.count == 0) { return nil; } - NSMutableArray *indexPaths = [NSMutableArray arrayWithCapacity:allLayoutAttributes.count]; - for (UICollectionViewLayoutAttributes *layoutAttributes in allLayoutAttributes) { - NSIndexPath *indexPath = layoutAttributes.indexPath; - [indexPaths addObject:indexPath]; - } - return indexPaths; -} -#pragma clang diagnostic pop - -@end - - - -@implementation TZCollectionView - -- (BOOL)touchesShouldCancelInContentView:(UIView *)view { - if ([view isKindOfClass:[UIControl class]]) { - return YES; - } - return [super touchesShouldCancelInContentView:view]; -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.h deleted file mode 100644 index 556a4425..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// TZPhotoPreviewCell.h -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import - -@class TZAssetModel; -@interface TZAssetPreviewCell : UICollectionViewCell -@property (nonatomic, strong) TZAssetModel *model; -@property (nonatomic, copy) void (^singleTapGestureBlock)(); -- (void)configSubviews; -- (void)photoPreviewCollectionViewDidScroll; -@end - - -@class TZAssetModel,TZProgressView,TZPhotoPreviewView; -@interface TZPhotoPreviewCell : TZAssetPreviewCell - -@property (nonatomic, copy) void (^imageProgressUpdateBlock)(double progress); - -@property (nonatomic, strong) TZPhotoPreviewView *previewView; - -@property (nonatomic, assign) BOOL allowCrop; -@property (nonatomic, assign) CGRect cropRect; - -- (void)recoverSubviews; - -@end - - -@interface TZPhotoPreviewView : UIView -@property (nonatomic, strong) UIImageView *imageView; -@property (nonatomic, strong) UIScrollView *scrollView; -@property (nonatomic, strong) UIView *imageContainerView; -@property (nonatomic, strong) TZProgressView *progressView; - -@property (nonatomic, assign) BOOL allowCrop; -@property (nonatomic, assign) CGRect cropRect; - -@property (nonatomic, strong) TZAssetModel *model; -@property (nonatomic, strong) id asset; -@property (nonatomic, copy) void (^singleTapGestureBlock)(); -@property (nonatomic, copy) void (^imageProgressUpdateBlock)(double progress); - -@property (nonatomic, assign) int32_t imageRequestID; - -- (void)recoverSubviews; -@end - - -@class AVPlayer, AVPlayerLayer; -@interface TZVideoPreviewCell : TZAssetPreviewCell -@property (strong, nonatomic) AVPlayer *player; -@property (strong, nonatomic) AVPlayerLayer *playerLayer; -@property (strong, nonatomic) UIButton *playButton; -@property (strong, nonatomic) UIImage *cover; -- (void)pausePlayerAndShowNaviBar; -@end - - -@interface TZGifPreviewCell : TZAssetPreviewCell -@property (strong, nonatomic) TZPhotoPreviewView *previewView; -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m deleted file mode 100644 index 93013222..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m +++ /dev/null @@ -1,445 +0,0 @@ -// -// TZPhotoPreviewCell.m -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import "TZPhotoPreviewCell.h" -#import "TZAssetModel.h" -#import "UIView+Layout.h" -#import "TZImageManager.h" -#import "TZProgressView.h" -#import "TZImageCropManager.h" -#import -#import "TZImagePickerController.h" - -@implementation TZAssetPreviewCell - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = [UIColor blackColor]; - [self configSubviews]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(photoPreviewCollectionViewDidScroll) name:@"photoPreviewCollectionViewDidScroll" object:nil]; - } - return self; -} - -- (void)configSubviews { - -} - -#pragma mark - Notification - -- (void)photoPreviewCollectionViewDidScroll { - -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -@end - - -@implementation TZPhotoPreviewCell - -- (void)configSubviews { - self.previewView = [[TZPhotoPreviewView alloc] initWithFrame:CGRectZero]; - __weak typeof(self) weakSelf = self; - [self.previewView setSingleTapGestureBlock:^{ - if (weakSelf.singleTapGestureBlock) { - weakSelf.singleTapGestureBlock(); - } - }]; - [self.previewView setImageProgressUpdateBlock:^(double progress) { - if (weakSelf.imageProgressUpdateBlock) { - weakSelf.imageProgressUpdateBlock(progress); - } - }]; - [self addSubview:self.previewView]; -} - -- (void)setModel:(TZAssetModel *)model { - [super setModel:model]; - _previewView.asset = model.asset; -} - -- (void)recoverSubviews { - [_previewView recoverSubviews]; -} - -- (void)setAllowCrop:(BOOL)allowCrop { - _allowCrop = allowCrop; - _previewView.allowCrop = allowCrop; -} - -- (void)setCropRect:(CGRect)cropRect { - _cropRect = cropRect; - _previewView.cropRect = cropRect; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - self.previewView.frame = self.bounds; -} - -@end - - -@interface TZPhotoPreviewView () - -@end - -@implementation TZPhotoPreviewView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - _scrollView = [[UIScrollView alloc] init]; - _scrollView.bouncesZoom = YES; - _scrollView.maximumZoomScale = 2.5; - _scrollView.minimumZoomScale = 1.0; - _scrollView.multipleTouchEnabled = YES; - _scrollView.delegate = self; - _scrollView.scrollsToTop = NO; - _scrollView.showsHorizontalScrollIndicator = NO; - _scrollView.showsVerticalScrollIndicator = YES; - _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - _scrollView.delaysContentTouches = NO; - _scrollView.canCancelContentTouches = YES; - _scrollView.alwaysBounceVertical = NO; - [self addSubview:_scrollView]; - - _imageContainerView = [[UIView alloc] init]; - _imageContainerView.clipsToBounds = YES; - _imageContainerView.contentMode = UIViewContentModeScaleAspectFill; - [_scrollView addSubview:_imageContainerView]; - - _imageView = [[UIImageView alloc] init]; - _imageView.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.500]; - _imageView.contentMode = UIViewContentModeScaleAspectFill; - _imageView.clipsToBounds = YES; - [_imageContainerView addSubview:_imageView]; - - UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTap:)]; - [self addGestureRecognizer:tap1]; - UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)]; - tap2.numberOfTapsRequired = 2; - [tap1 requireGestureRecognizerToFail:tap2]; - [self addGestureRecognizer:tap2]; - - [self configProgressView]; - } - return self; -} - -- (void)configProgressView { - _progressView = [[TZProgressView alloc] init]; - _progressView.hidden = YES; - [self addSubview:_progressView]; -} - -- (void)setModel:(TZAssetModel *)model { - _model = model; - [_scrollView setZoomScale:1.0 animated:NO]; - if (model.type == TZAssetModelMediaTypePhotoGif) { - // 先显示缩略图 - [[TZImageManager manager] getPhotoWithAsset:model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - self.imageView.image = photo; - [self resizeSubviews]; - // 再显示gif动图 - [[TZImageManager manager] getOriginalPhotoDataWithAsset:model.asset completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) { - if (!isDegraded) { - self.imageView.image = [UIImage sd_tz_animatedGIFWithData:data]; - [self resizeSubviews]; - } - }]; - } progressHandler:nil networkAccessAllowed:NO]; - } else { - self.asset = model.asset; - } -} - -- (void)setAsset:(id)asset { - if (_asset && self.imageRequestID) { - [[PHImageManager defaultManager] cancelImageRequest:self.imageRequestID]; - } - - _asset = asset; - self.imageRequestID = [[TZImageManager manager] getPhotoWithAsset:asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - if (![asset isEqual:_asset]) return; - self.imageView.image = photo; - [self resizeSubviews]; - _progressView.hidden = YES; - if (self.imageProgressUpdateBlock) { - self.imageProgressUpdateBlock(1); - } - if (!isDegraded) { - self.imageRequestID = 0; - } - } progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) { - if (![asset isEqual:_asset]) return; - _progressView.hidden = NO; - [self bringSubviewToFront:_progressView]; - progress = progress > 0.02 ? progress : 0.02; - _progressView.progress = progress; - if (self.imageProgressUpdateBlock && progress < 1) { - self.imageProgressUpdateBlock(progress); - } - - if (progress >= 1) { - _progressView.hidden = YES; - self.imageRequestID = 0; - } - } networkAccessAllowed:YES]; -} - -- (void)recoverSubviews { - [_scrollView setZoomScale:1.0 animated:NO]; - [self resizeSubviews]; -} - -- (void)resizeSubviews { - _imageContainerView.tz_origin = CGPointZero; - _imageContainerView.tz_width = self.scrollView.tz_width; - - UIImage *image = _imageView.image; - if (image.size.height / image.size.width > self.tz_height / self.scrollView.tz_width) { - _imageContainerView.tz_height = floor(image.size.height / (image.size.width / self.scrollView.tz_width)); - } else { - CGFloat height = image.size.height / image.size.width * self.scrollView.tz_width; - if (height < 1 || isnan(height)) height = self.tz_height; - height = floor(height); - _imageContainerView.tz_height = height; - _imageContainerView.tz_centerY = self.tz_height / 2; - } - if (_imageContainerView.tz_height > self.tz_height && _imageContainerView.tz_height - self.tz_height <= 1) { - _imageContainerView.tz_height = self.tz_height; - } - CGFloat contentSizeH = MAX(_imageContainerView.tz_height, self.tz_height); - _scrollView.contentSize = CGSizeMake(self.scrollView.tz_width, contentSizeH); - [_scrollView scrollRectToVisible:self.bounds animated:NO]; - _scrollView.alwaysBounceVertical = _imageContainerView.tz_height <= self.tz_height ? NO : YES; - _imageView.frame = _imageContainerView.bounds; - - [self refreshScrollViewContentSize]; -} - -- (void)setAllowCrop:(BOOL)allowCrop { - _allowCrop = allowCrop; - _scrollView.maximumZoomScale = allowCrop ? 4.0 : 2.5; - - if ([self.asset isKindOfClass:[PHAsset class]]) { - PHAsset *phAsset = (PHAsset *)self.asset; - CGFloat aspectRatio = phAsset.pixelWidth / (CGFloat)phAsset.pixelHeight; - // 优化超宽图片的显示 - if (aspectRatio > 1.5) { - self.scrollView.maximumZoomScale *= aspectRatio / 1.5; - } - } -} - -- (void)refreshScrollViewContentSize { - if (_allowCrop) { - // 1.7.2 如果允许裁剪,需要让图片的任意部分都能在裁剪框内,于是对_scrollView做了如下处理: - // 1.让contentSize增大(裁剪框右下角的图片部分) - CGFloat contentWidthAdd = self.scrollView.tz_width - CGRectGetMaxX(_cropRect); - CGFloat contentHeightAdd = (MIN(_imageContainerView.tz_height, self.tz_height) - self.cropRect.size.height) / 2; - CGFloat newSizeW = self.scrollView.contentSize.width + contentWidthAdd; - CGFloat newSizeH = MAX(self.scrollView.contentSize.height, self.tz_height) + contentHeightAdd; - _scrollView.contentSize = CGSizeMake(newSizeW, newSizeH); - _scrollView.alwaysBounceVertical = YES; - // 2.让scrollView新增滑动区域(裁剪框左上角的图片部分) - if (contentHeightAdd > 0 || contentWidthAdd > 0) { - _scrollView.contentInset = UIEdgeInsetsMake(contentHeightAdd, _cropRect.origin.x, 0, 0); - } else { - _scrollView.contentInset = UIEdgeInsetsZero; - } - } -} - -- (void)layoutSubviews { - [super layoutSubviews]; - _scrollView.frame = CGRectMake(10, 0, self.tz_width - 20, self.tz_height); - static CGFloat progressWH = 40; - CGFloat progressX = (self.tz_width - progressWH) / 2; - CGFloat progressY = (self.tz_height - progressWH) / 2; - _progressView.frame = CGRectMake(progressX, progressY, progressWH, progressWH); - - [self recoverSubviews]; -} - -#pragma mark - UITapGestureRecognizer Event - -- (void)doubleTap:(UITapGestureRecognizer *)tap { - if (_scrollView.zoomScale > 1.0) { - _scrollView.contentInset = UIEdgeInsetsZero; - [_scrollView setZoomScale:1.0 animated:YES]; - } else { - CGPoint touchPoint = [tap locationInView:self.imageView]; - CGFloat newZoomScale = _scrollView.maximumZoomScale; - CGFloat xsize = self.frame.size.width / newZoomScale; - CGFloat ysize = self.frame.size.height / newZoomScale; - [_scrollView zoomToRect:CGRectMake(touchPoint.x - xsize/2, touchPoint.y - ysize/2, xsize, ysize) animated:YES]; - } -} - -- (void)singleTap:(UITapGestureRecognizer *)tap { - if (self.singleTapGestureBlock) { - self.singleTapGestureBlock(); - } -} - -#pragma mark - UIScrollViewDelegate - -- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { - return _imageContainerView; -} - -- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view { - scrollView.contentInset = UIEdgeInsetsZero; -} - -- (void)scrollViewDidZoom:(UIScrollView *)scrollView { - [self refreshImageContainerViewCenter]; -} - -- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale { - [self refreshScrollViewContentSize]; -} - -#pragma mark - Private - -- (void)refreshImageContainerViewCenter { - CGFloat offsetX = (_scrollView.tz_width > _scrollView.contentSize.width) ? ((_scrollView.tz_width - _scrollView.contentSize.width) * 0.5) : 0.0; - CGFloat offsetY = (_scrollView.tz_height > _scrollView.contentSize.height) ? ((_scrollView.tz_height - _scrollView.contentSize.height) * 0.5) : 0.0; - self.imageContainerView.center = CGPointMake(_scrollView.contentSize.width * 0.5 + offsetX, _scrollView.contentSize.height * 0.5 + offsetY); -} - -@end - - -@implementation TZVideoPreviewCell - -- (void)configSubviews { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:UIApplicationWillResignActiveNotification object:nil]; -} - -- (void)configPlayButton { - if (_playButton) { - [_playButton removeFromSuperview]; - } - _playButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_playButton setImage:[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal]; - [_playButton setImage:[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlayHL"] forState:UIControlStateHighlighted]; - [_playButton addTarget:self action:@selector(playButtonClick) forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:_playButton]; -} - -- (void)setModel:(TZAssetModel *)model { - [super setModel:model]; - [self configMoviePlayer]; -} - -- (void)configMoviePlayer { - if (_player) { - [_playerLayer removeFromSuperlayer]; - _playerLayer = nil; - [_player pause]; - _player = nil; - } - - [[TZImageManager manager] getPhotoWithAsset:self.model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - _cover = photo; - }]; - [[TZImageManager manager] getVideoWithAsset:self.model.asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) { - dispatch_async(dispatch_get_main_queue(), ^{ - _player = [AVPlayer playerWithPlayerItem:playerItem]; - _playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player]; - _playerLayer.backgroundColor = [UIColor blackColor].CGColor; - _playerLayer.frame = self.bounds; - [self.layer addSublayer:_playerLayer]; - [self configPlayButton]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:_player.currentItem]; - }); - }]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - _playerLayer.frame = self.bounds; - _playButton.frame = CGRectMake(0, 64, self.tz_width, self.tz_height - 64 - 44); -} - -- (void)photoPreviewCollectionViewDidScroll { - [self pausePlayerAndShowNaviBar]; -} - -#pragma mark - Click Event - -- (void)playButtonClick { - CMTime currentTime = _player.currentItem.currentTime; - CMTime durationTime = _player.currentItem.duration; - if (_player.rate == 0.0f) { - if (currentTime.value == durationTime.value) [_player.currentItem seekToTime:CMTimeMake(0, 1)]; - [_player play]; - [_playButton setImage:nil forState:UIControlStateNormal]; - if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = YES; - if (self.singleTapGestureBlock) { - self.singleTapGestureBlock(); - } - } else { - [self pausePlayerAndShowNaviBar]; - } -} - -- (void)pausePlayerAndShowNaviBar { - if (_player.rate != 0.0) { - [_player pause]; - [_playButton setImage:[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal]; - if (self.singleTapGestureBlock) { - self.singleTapGestureBlock(); - } - } -} - -@end - - -@implementation TZGifPreviewCell - -- (void)configSubviews { - [self configPreviewView]; -} - -- (void)configPreviewView { - _previewView = [[TZPhotoPreviewView alloc] initWithFrame:CGRectZero]; - __weak typeof(self) weakSelf = self; - [_previewView setSingleTapGestureBlock:^{ - [weakSelf signleTapAction]; - }]; - [self addSubview:_previewView]; -} - -- (void)setModel:(TZAssetModel *)model { - [super setModel:model]; - _previewView.model = self.model; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - _previewView.frame = self.bounds; -} - -#pragma mark - Click Event - -- (void)signleTapAction { - if (self.singleTapGestureBlock) { - self.singleTapGestureBlock(); - } -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.h deleted file mode 100644 index 2d5d677c..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// TZPhotoPreviewController.h -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import - -@interface TZPhotoPreviewController : UIViewController - -@property (nonatomic, strong) NSMutableArray *models; ///< All photo models / 所有图片模型数组 -@property (nonatomic, strong) NSMutableArray *photos; ///< All photos / 所有图片数组 -@property (nonatomic, assign) NSInteger currentIndex; ///< Index of the photo user click / 用户点击的图片的索引 -@property (nonatomic, assign) BOOL isSelectOriginalPhoto; ///< If YES,return original photo / 是否返回原图 -@property (nonatomic, assign) BOOL isCropImage; - -/// Return the new selected photos / 返回最新的选中图片数组 -@property (nonatomic, copy) void (^backButtonClickBlock)(BOOL isSelectOriginalPhoto); -@property (nonatomic, copy) void (^doneButtonClickBlock)(BOOL isSelectOriginalPhoto); -@property (nonatomic, copy) void (^doneButtonClickBlockCropMode)(UIImage *cropedImage,id asset); -@property (nonatomic, copy) void (^doneButtonClickBlockWithPreviewType)(NSArray *photos,NSArray *assets,BOOL isSelectOriginalPhoto); - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m deleted file mode 100644 index 63e671a2..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m +++ /dev/null @@ -1,512 +0,0 @@ -// -// TZPhotoPreviewController.m -// TZImagePickerController -// -// Created by 谭真 on 15/12/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import "TZPhotoPreviewController.h" -#import "TZPhotoPreviewCell.h" -#import "TZAssetModel.h" -#import "UIView+Layout.h" -#import "TZImagePickerController.h" -#import "TZImageManager.h" -#import "TZImageCropManager.h" - -@interface TZPhotoPreviewController () { - UICollectionView *_collectionView; - UICollectionViewFlowLayout *_layout; - NSArray *_photosTemp; - NSArray *_assetsTemp; - - UIView *_naviBar; - UIButton *_backButton; - UIButton *_selectButton; - - UIView *_toolBar; - UIButton *_doneButton; - UIImageView *_numberImageView; - UILabel *_numberLabel; - UIButton *_originalPhotoButton; - UILabel *_originalPhotoLabel; - - CGFloat _offsetItemCount; -} -@property (nonatomic, assign) BOOL isHideNaviBar; -@property (nonatomic, strong) UIView *cropBgView; -@property (nonatomic, strong) UIView *cropView; - -@property (nonatomic, assign) double progress; -@property (strong, nonatomic) id alertView; -@end - -@implementation TZPhotoPreviewController - -- (void)viewDidLoad { - [super viewDidLoad]; - [TZImageManager manager].shouldFixOrientation = YES; - __weak typeof(self) weakSelf = self; - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)weakSelf.navigationController; - if (!self.models.count) { - self.models = [NSMutableArray arrayWithArray:_tzImagePickerVc.selectedModels]; - _assetsTemp = [NSMutableArray arrayWithArray:_tzImagePickerVc.selectedAssets]; - self.isSelectOriginalPhoto = _tzImagePickerVc.isSelectOriginalPhoto; - } - [self configCollectionView]; - [self configCustomNaviBar]; - [self configBottomToolBar]; - self.view.clipsToBounds = YES; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeStatusBarOrientationNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; -} - -- (void)setPhotos:(NSMutableArray *)photos { - _photos = photos; - _photosTemp = [NSArray arrayWithArray:photos]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self.navigationController setNavigationBarHidden:YES animated:YES]; - if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = YES; - if (_currentIndex) [_collectionView setContentOffset:CGPointMake((self.view.tz_width + 20) * _currentIndex, 0) animated:NO]; - [self refreshNaviBarAndBottomBarState]; -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - [self.navigationController setNavigationBarHidden:NO animated:YES]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (tzImagePickerVc.needShowStatusBar && iOS7Later) { - [UIApplication sharedApplication].statusBarHidden = NO; - } - [TZImageManager manager].shouldFixOrientation = NO; -} - -- (BOOL)prefersStatusBarHidden { - return YES; -} - -- (void)configCustomNaviBar { - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - - _naviBar = [[UIView alloc] initWithFrame:CGRectZero]; - _naviBar.backgroundColor = [UIColor colorWithRed:(34/255.0) green:(34/255.0) blue:(34/255.0) alpha:0.7]; - - _backButton = [[UIButton alloc] initWithFrame:CGRectZero]; - [_backButton setImage:[UIImage imageNamedFromMyBundle:@"navi_back"] forState:UIControlStateNormal]; - [_backButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - [_backButton addTarget:self action:@selector(backButtonClick) forControlEvents:UIControlEventTouchUpInside]; - - _selectButton = [[UIButton alloc] initWithFrame:CGRectZero]; - [_selectButton setImage:[UIImage imageNamedFromMyBundle:tzImagePickerVc.photoDefImageName] forState:UIControlStateNormal]; - [_selectButton setImage:[UIImage imageNamedFromMyBundle:tzImagePickerVc.photoSelImageName] forState:UIControlStateSelected]; - [_selectButton addTarget:self action:@selector(select:) forControlEvents:UIControlEventTouchUpInside]; - _selectButton.hidden = !tzImagePickerVc.showSelectBtn; - - [_naviBar addSubview:_selectButton]; - [_naviBar addSubview:_backButton]; - [self.view addSubview:_naviBar]; -} - -- (void)configBottomToolBar { - _toolBar = [[UIView alloc] initWithFrame:CGRectZero]; - static CGFloat rgb = 34 / 255.0; - _toolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.7]; - - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (_tzImagePickerVc.allowPickingOriginalPhoto) { - _originalPhotoButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _originalPhotoButton.imageEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0); - _originalPhotoButton.backgroundColor = [UIColor clearColor]; - [_originalPhotoButton addTarget:self action:@selector(originalPhotoButtonClick) forControlEvents:UIControlEventTouchUpInside]; - _originalPhotoButton.titleLabel.font = [UIFont systemFontOfSize:13]; - [_originalPhotoButton setTitle:_tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateNormal]; - [_originalPhotoButton setTitle:_tzImagePickerVc.fullImageBtnTitleStr forState:UIControlStateSelected]; - [_originalPhotoButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal]; - [_originalPhotoButton setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; - [_originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:_tzImagePickerVc.photoPreviewOriginDefImageName] forState:UIControlStateNormal]; - [_originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:_tzImagePickerVc.photoOriginSelImageName] forState:UIControlStateSelected]; - - _originalPhotoLabel = [[UILabel alloc] init]; - _originalPhotoLabel.textAlignment = NSTextAlignmentLeft; - _originalPhotoLabel.font = [UIFont systemFontOfSize:13]; - _originalPhotoLabel.textColor = [UIColor whiteColor]; - _originalPhotoLabel.backgroundColor = [UIColor clearColor]; - if (_isSelectOriginalPhoto) [self showPhotoBytes]; - } - - _doneButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _doneButton.titleLabel.font = [UIFont systemFontOfSize:16]; - [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside]; - [_doneButton setTitle:_tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal]; - [_doneButton setTitleColor:_tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal]; - - _numberImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamedFromMyBundle:_tzImagePickerVc.photoNumberIconImageName]]; - _numberImageView.backgroundColor = [UIColor clearColor]; - _numberImageView.hidden = _tzImagePickerVc.selectedModels.count <= 0; - - _numberLabel = [[UILabel alloc] init]; - _numberLabel.font = [UIFont systemFontOfSize:15]; - _numberLabel.textColor = [UIColor whiteColor]; - _numberLabel.textAlignment = NSTextAlignmentCenter; - _numberLabel.text = [NSString stringWithFormat:@"%zd",_tzImagePickerVc.selectedModels.count]; - _numberLabel.hidden = _tzImagePickerVc.selectedModels.count <= 0; - _numberLabel.backgroundColor = [UIColor clearColor]; - - [_originalPhotoButton addSubview:_originalPhotoLabel]; - [_toolBar addSubview:_doneButton]; - [_toolBar addSubview:_originalPhotoButton]; - [_toolBar addSubview:_numberImageView]; - [_toolBar addSubview:_numberLabel]; - [self.view addSubview:_toolBar]; -} - -- (void)configCollectionView { - _layout = [[UICollectionViewFlowLayout alloc] init]; - _layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:_layout]; - _collectionView.backgroundColor = [UIColor blackColor]; - _collectionView.dataSource = self; - _collectionView.delegate = self; - _collectionView.pagingEnabled = YES; - _collectionView.scrollsToTop = NO; - _collectionView.showsHorizontalScrollIndicator = NO; - _collectionView.contentOffset = CGPointMake(0, 0); - _collectionView.contentSize = CGSizeMake(self.models.count * (self.view.tz_width + 20), 0); - [self.view addSubview:_collectionView]; - [_collectionView registerClass:[TZPhotoPreviewCell class] forCellWithReuseIdentifier:@"TZPhotoPreviewCell"]; - [_collectionView registerClass:[TZVideoPreviewCell class] forCellWithReuseIdentifier:@"TZVideoPreviewCell"]; - [_collectionView registerClass:[TZGifPreviewCell class] forCellWithReuseIdentifier:@"TZGifPreviewCell"]; -} - -- (void)configCropView { - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (!_tzImagePickerVc.showSelectBtn && _tzImagePickerVc.allowCrop) { - [_cropView removeFromSuperview]; - [_cropBgView removeFromSuperview]; - - _cropBgView = [UIView new]; - _cropBgView.userInteractionEnabled = NO; - _cropBgView.frame = self.view.bounds; - _cropBgView.backgroundColor = [UIColor clearColor]; - [self.view addSubview:_cropBgView]; - [TZImageCropManager overlayClippingWithView:_cropBgView cropRect:_tzImagePickerVc.cropRect containerView:self.view needCircleCrop:_tzImagePickerVc.needCircleCrop]; - - _cropView = [UIView new]; - _cropView.userInteractionEnabled = NO; - _cropView.frame = _tzImagePickerVc.cropRect; - _cropView.backgroundColor = [UIColor clearColor]; - _cropView.layer.borderColor = [UIColor whiteColor].CGColor; - _cropView.layer.borderWidth = 1.0; - if (_tzImagePickerVc.needCircleCrop) { - _cropView.layer.cornerRadius = _tzImagePickerVc.cropRect.size.width / 2; - _cropView.clipsToBounds = YES; - } - [self.view addSubview:_cropView]; - if (_tzImagePickerVc.cropViewSettingBlock) { - _tzImagePickerVc.cropViewSettingBlock(_cropView); - } - - [self.view bringSubviewToFront:_naviBar]; - [self.view bringSubviewToFront:_toolBar]; - } -} - -#pragma mark - Layout - -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController; - - CGFloat statusBarHeight = [TZCommonTools tz_statusBarHeight]; - CGFloat statusBarHeightInterval = statusBarHeight - 20; - CGFloat naviBarHeight = statusBarHeight + _tzImagePickerVc.navigationBar.tz_height; - _naviBar.frame = CGRectMake(0, 0, self.view.tz_width, naviBarHeight); - _backButton.frame = CGRectMake(10, 10 + statusBarHeightInterval, 44, 44); - _selectButton.frame = CGRectMake(self.view.tz_width - 54, 10 + statusBarHeightInterval, 42, 42); - - _layout.itemSize = CGSizeMake(self.view.tz_width + 20, self.view.tz_height); - _layout.minimumInteritemSpacing = 0; - _layout.minimumLineSpacing = 0; - _collectionView.frame = CGRectMake(-10, 0, self.view.tz_width + 20, self.view.tz_height); - [_collectionView setCollectionViewLayout:_layout]; - if (_offsetItemCount > 0) { - CGFloat offsetX = _offsetItemCount * _layout.itemSize.width; - [_collectionView setContentOffset:CGPointMake(offsetX, 0)]; - } - if (_tzImagePickerVc.allowCrop) { - [_collectionView reloadData]; - } - - CGFloat toolBarHeight = [TZCommonTools tz_isIPhoneX] ? 44 + (83 - 49) : 44; - CGFloat toolBarTop = self.view.tz_height - toolBarHeight; - _toolBar.frame = CGRectMake(0, toolBarTop, self.view.tz_width, toolBarHeight); - if (_tzImagePickerVc.allowPickingOriginalPhoto) { - CGFloat fullImageWidth = [_tzImagePickerVc.fullImageBtnTitleStr tz_calculateSizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} maxSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)].width; - _originalPhotoButton.frame = CGRectMake(0, 0, fullImageWidth + 56, 44); - _originalPhotoLabel.frame = CGRectMake(fullImageWidth + 42, 0, 80, 44); - } - _doneButton.frame = CGRectMake(self.view.tz_width - 44 - 12, 0, 44, 44); - _numberImageView.frame = CGRectMake(self.view.tz_width - 56 - 28, 7, 30, 30); - _numberLabel.frame = _numberImageView.frame; - - [self configCropView]; -} - -#pragma mark - Notification - -- (void)didChangeStatusBarOrientationNotification:(NSNotification *)noti { - _offsetItemCount = _collectionView.contentOffset.x / _layout.itemSize.width; -} - -#pragma mark - Click Event - -- (void)select:(UIButton *)selectButton { - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController; - TZAssetModel *model = _models[_currentIndex]; - if (!selectButton.isSelected) { - // 1. select:check if over the maxImagesCount / 选择照片,检查是否超过了最大个数的限制 - if (_tzImagePickerVc.selectedModels.count >= _tzImagePickerVc.maxImagesCount) { - NSString *title = [NSString stringWithFormat:[NSBundle tz_localizedStringForKey:@"Select a maximum of %zd photos"], _tzImagePickerVc.maxImagesCount]; - [_tzImagePickerVc showAlertWithTitle:title]; - return; - // 2. if not over the maxImagesCount / 如果没有超过最大个数限制 - } else { - [_tzImagePickerVc.selectedModels addObject:model]; - if (self.photos) { - [_tzImagePickerVc.selectedAssets addObject:_assetsTemp[_currentIndex]]; - [self.photos addObject:_photosTemp[_currentIndex]]; - } - if (model.type == TZAssetModelMediaTypeVideo && !_tzImagePickerVc.allowPickingMultipleVideo) { - [_tzImagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Select the video when in multi state, we will handle the video as a photo"]]; - } - } - } else { - NSArray *selectedModels = [NSArray arrayWithArray:_tzImagePickerVc.selectedModels]; - for (TZAssetModel *model_item in selectedModels) { - if ([[[TZImageManager manager] getAssetIdentifier:model.asset] isEqualToString:[[TZImageManager manager] getAssetIdentifier:model_item.asset]]) { - // 1.6.7版本更新:防止有多个一样的model,一次性被移除了 - NSArray *selectedModelsTmp = [NSArray arrayWithArray:_tzImagePickerVc.selectedModels]; - for (NSInteger i = 0; i < selectedModelsTmp.count; i++) { - TZAssetModel *model = selectedModelsTmp[i]; - if ([model isEqual:model_item]) { - [_tzImagePickerVc.selectedModels removeObjectAtIndex:i]; - break; - } - } - // [_tzImagePickerVc.selectedModels removeObject:model_item]; - if (self.photos) { - // 1.6.7版本更新:防止有多个一样的asset,一次性被移除了 - NSArray *selectedAssetsTmp = [NSArray arrayWithArray:_tzImagePickerVc.selectedAssets]; - for (NSInteger i = 0; i < selectedAssetsTmp.count; i++) { - id asset = selectedAssetsTmp[i]; - if ([asset isEqual:_assetsTemp[_currentIndex]]) { - [_tzImagePickerVc.selectedAssets removeObjectAtIndex:i]; - break; - } - } - // [_tzImagePickerVc.selectedAssets removeObject:_assetsTemp[_currentIndex]]; - [self.photos removeObject:_photosTemp[_currentIndex]]; - } - break; - } - } - } - model.isSelected = !selectButton.isSelected; - [self refreshNaviBarAndBottomBarState]; - if (model.isSelected) { - [UIView showOscillatoryAnimationWithLayer:selectButton.imageView.layer type:TZOscillatoryAnimationToBigger]; - } - [UIView showOscillatoryAnimationWithLayer:_numberImageView.layer type:TZOscillatoryAnimationToSmaller]; -} - -- (void)backButtonClick { - if (self.navigationController.childViewControllers.count < 2) { - [self.navigationController dismissViewControllerAnimated:YES completion:nil]; - return; - } - [self.navigationController popViewControllerAnimated:YES]; - if (self.backButtonClickBlock) { - self.backButtonClickBlock(_isSelectOriginalPhoto); - } -} - -- (void)doneButtonClick { - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController; - // 如果图片正在从iCloud同步中,提醒用户 - if (_progress > 0 && _progress < 1 && (_selectButton.isSelected || !_tzImagePickerVc.selectedModels.count )) { - _alertView = [_tzImagePickerVc showAlertWithTitle:[NSBundle tz_localizedStringForKey:@"Synchronizing photos from iCloud"]]; - return; - } - - // 如果没有选中过照片 点击确定时选中当前预览的照片 - if (_tzImagePickerVc.selectedModels.count == 0 && _tzImagePickerVc.minImagesCount <= 0) { - TZAssetModel *model = _models[_currentIndex]; - [_tzImagePickerVc.selectedModels addObject:model]; - } - if (_tzImagePickerVc.allowCrop) { // 裁剪状态 - NSIndexPath *indexPath = [NSIndexPath indexPathForItem:_currentIndex inSection:0]; - TZPhotoPreviewCell *cell = (TZPhotoPreviewCell *)[_collectionView cellForItemAtIndexPath:indexPath]; - UIImage *cropedImage = [TZImageCropManager cropImageView:cell.previewView.imageView toRect:_tzImagePickerVc.cropRect zoomScale:cell.previewView.scrollView.zoomScale containerView:self.view]; - if (_tzImagePickerVc.needCircleCrop) { - cropedImage = [TZImageCropManager circularClipImage:cropedImage]; - } - if (self.doneButtonClickBlockCropMode) { - TZAssetModel *model = _models[_currentIndex]; - self.doneButtonClickBlockCropMode(cropedImage,model.asset); - } - } else if (self.doneButtonClickBlock) { // 非裁剪状态 - self.doneButtonClickBlock(_isSelectOriginalPhoto); - } - if (self.doneButtonClickBlockWithPreviewType) { - self.doneButtonClickBlockWithPreviewType(self.photos,_tzImagePickerVc.selectedAssets,self.isSelectOriginalPhoto); - } -} - -- (void)originalPhotoButtonClick { - _originalPhotoButton.selected = !_originalPhotoButton.isSelected; - _isSelectOriginalPhoto = _originalPhotoButton.isSelected; - _originalPhotoLabel.hidden = !_originalPhotoButton.isSelected; - if (_isSelectOriginalPhoto) { - [self showPhotoBytes]; - if (!_selectButton.isSelected) { - // 如果当前已选择照片张数 < 最大可选张数 && 最大可选张数大于1,就选中该张图 - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (_tzImagePickerVc.selectedModels.count < _tzImagePickerVc.maxImagesCount && _tzImagePickerVc.showSelectBtn) { - [self select:_selectButton]; - } - } - } -} - -- (void)didTapPreviewCell { - self.isHideNaviBar = !self.isHideNaviBar; - _naviBar.hidden = self.isHideNaviBar; - _toolBar.hidden = self.isHideNaviBar; -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - CGFloat offSetWidth = scrollView.contentOffset.x; - offSetWidth = offSetWidth + ((self.view.tz_width + 20) * 0.5); - - NSInteger currentIndex = offSetWidth / (self.view.tz_width + 20); - - if (currentIndex < _models.count && _currentIndex != currentIndex) { - _currentIndex = currentIndex; - [self refreshNaviBarAndBottomBarState]; - } - - [[NSNotificationCenter defaultCenter] postNotificationName:@"photoPreviewCollectionViewDidScroll" object:nil]; -} - -#pragma mark - UICollectionViewDataSource && Delegate - -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - return _models.count; -} - -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController; - TZAssetModel *model = _models[indexPath.row]; - - TZAssetPreviewCell *cell; - __weak typeof(self) weakSelf = self; - if (_tzImagePickerVc.allowPickingMultipleVideo && model.type == TZAssetModelMediaTypeVideo) { - cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZVideoPreviewCell" forIndexPath:indexPath]; - } else if (_tzImagePickerVc.allowPickingMultipleVideo && model.type == TZAssetModelMediaTypePhotoGif && _tzImagePickerVc.allowPickingGif) { - cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZGifPreviewCell" forIndexPath:indexPath]; - } else { - cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TZPhotoPreviewCell" forIndexPath:indexPath]; - TZPhotoPreviewCell *photoPreviewCell = (TZPhotoPreviewCell *)cell; - photoPreviewCell.cropRect = _tzImagePickerVc.cropRect; - photoPreviewCell.allowCrop = _tzImagePickerVc.allowCrop; - __weak typeof(_tzImagePickerVc) weakTzImagePickerVc = _tzImagePickerVc; - __weak typeof(_collectionView) weakCollectionView = _collectionView; - __weak typeof(photoPreviewCell) weakCell = photoPreviewCell; - [photoPreviewCell setImageProgressUpdateBlock:^(double progress) { - weakSelf.progress = progress; - if (progress >= 1) { - if (weakSelf.isSelectOriginalPhoto) [weakSelf showPhotoBytes]; - if (weakSelf.alertView && [weakCollectionView.visibleCells containsObject:weakCell]) { - [weakTzImagePickerVc hideAlertView:weakSelf.alertView]; - weakSelf.alertView = nil; - [weakSelf doneButtonClick]; - } - } - }]; - } - - cell.model = model; - [cell setSingleTapGestureBlock:^{ - [weakSelf didTapPreviewCell]; - }]; - return cell; -} - -- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { - if ([cell isKindOfClass:[TZPhotoPreviewCell class]]) { - [(TZPhotoPreviewCell *)cell recoverSubviews]; - } -} - -- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { - if ([cell isKindOfClass:[TZPhotoPreviewCell class]]) { - [(TZPhotoPreviewCell *)cell recoverSubviews]; - } else if ([cell isKindOfClass:[TZVideoPreviewCell class]]) { - [(TZVideoPreviewCell *)cell pausePlayerAndShowNaviBar]; - } -} - -#pragma mark - Private Method - -- (void)dealloc { - // NSLog(@"%@ dealloc",NSStringFromClass(self.class)); -} - -- (void)refreshNaviBarAndBottomBarState { - TZImagePickerController *_tzImagePickerVc = (TZImagePickerController *)self.navigationController; - TZAssetModel *model = _models[_currentIndex]; - _selectButton.selected = model.isSelected; - _numberLabel.text = [NSString stringWithFormat:@"%zd",_tzImagePickerVc.selectedModels.count]; - _numberImageView.hidden = (_tzImagePickerVc.selectedModels.count <= 0 || _isHideNaviBar || _isCropImage); - _numberLabel.hidden = (_tzImagePickerVc.selectedModels.count <= 0 || _isHideNaviBar || _isCropImage); - - _originalPhotoButton.selected = _isSelectOriginalPhoto; - _originalPhotoLabel.hidden = !_originalPhotoButton.isSelected; - if (_isSelectOriginalPhoto) [self showPhotoBytes]; - - // If is previewing video, hide original photo button - // 如果正在预览的是视频,隐藏原图按钮 - if (!_isHideNaviBar) { - if (model.type == TZAssetModelMediaTypeVideo) { - _originalPhotoButton.hidden = YES; - _originalPhotoLabel.hidden = YES; - } else { - _originalPhotoButton.hidden = NO; - if (_isSelectOriginalPhoto) _originalPhotoLabel.hidden = NO; - } - } - - _doneButton.hidden = NO; - _selectButton.hidden = !_tzImagePickerVc.showSelectBtn; - // 让宽度/高度小于 最小可选照片尺寸 的图片不能选中 - if (![[TZImageManager manager] isPhotoSelectableWithAsset:model.asset]) { - _numberLabel.hidden = YES; - _numberImageView.hidden = YES; - _selectButton.hidden = YES; - _originalPhotoButton.hidden = YES; - _originalPhotoLabel.hidden = YES; - _doneButton.hidden = YES; - } -} - -- (void)showPhotoBytes { - [[TZImageManager manager] getPhotosBytesWithArray:@[_models[_currentIndex]] completion:^(NSString *totalBytes) { - _originalPhotoLabel.text = [NSString stringWithFormat:@"(%@)",totalBytes]; - }]; -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.h deleted file mode 100644 index 65d44594..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// TZProgressView.h -// TZImagePickerController -// -// Created by ttouch on 2016/12/6. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import - -@interface TZProgressView : UIView - -@property (nonatomic, assign) double progress; - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.m deleted file mode 100644 index 31a61823..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZProgressView.m +++ /dev/null @@ -1,55 +0,0 @@ -// -// TZProgressView.m -// TZImagePickerController -// -// Created by ttouch on 2016/12/6. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import "TZProgressView.h" - -@interface TZProgressView () -@property (nonatomic, strong) CAShapeLayer *progressLayer; -@end - -@implementation TZProgressView - -- (instancetype)init { - self = [super init]; - if (self) { - self.backgroundColor = [UIColor clearColor]; - - _progressLayer = [CAShapeLayer layer]; - _progressLayer.fillColor = [[UIColor clearColor] CGColor]; - _progressLayer.strokeColor = [[UIColor whiteColor] CGColor]; - _progressLayer.opacity = 1; - _progressLayer.lineCap = kCALineCapRound; - _progressLayer.lineWidth = 5; - - [_progressLayer setShadowColor:[UIColor blackColor].CGColor]; - [_progressLayer setShadowOffset:CGSizeMake(1, 1)]; - [_progressLayer setShadowOpacity:0.5]; - [_progressLayer setShadowRadius:2]; - } - return self; -} - -- (void)drawRect:(CGRect)rect { - CGPoint center = CGPointMake(rect.size.width / 2, rect.size.height / 2); - CGFloat radius = rect.size.width / 2; - CGFloat startA = - M_PI_2; - CGFloat endA = - M_PI_2 + M_PI * 2 * _progress; - _progressLayer.frame = self.bounds; - UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startA endAngle:endA clockwise:YES]; - _progressLayer.path =[path CGPath]; - - [_progressLayer removeFromSuperlayer]; - [self.layer addSublayer:_progressLayer]; -} - -- (void)setProgress:(double)progress { - _progress = progress; - [self setNeedsDisplay]; -} - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZVideoPlayerController.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZVideoPlayerController.h deleted file mode 100644 index 68868947..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZVideoPlayerController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// TZVideoPlayerController.h -// TZImagePickerController -// -// Created by 谭真 on 16/1/5. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import - -@class TZAssetModel; -@interface TZVideoPlayerController : UIViewController - -@property (nonatomic, strong) TZAssetModel *model; - -@end \ No newline at end of file diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m deleted file mode 100644 index b8ea8979..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m +++ /dev/null @@ -1,195 +0,0 @@ -// -// TZVideoPlayerController.m -// TZImagePickerController -// -// Created by 谭真 on 16/1/5. -// Copyright © 2016年 谭真. All rights reserved. -// - -#import "TZVideoPlayerController.h" -#import -#import "UIView+Layout.h" -#import "TZImageManager.h" -#import "TZAssetModel.h" -#import "TZImagePickerController.h" -#import "TZPhotoPreviewController.h" - -@interface TZVideoPlayerController () { - AVPlayer *_player; - AVPlayerLayer *_playerLayer; - UIButton *_playButton; - UIImage *_cover; - - UIView *_toolBar; - UIButton *_doneButton; - UIProgressView *_progress; - - UIStatusBarStyle _originStatusBarStyle; -} -@end - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -@implementation TZVideoPlayerController - -- (void)viewDidLoad { - [super viewDidLoad]; - self.view.backgroundColor = [UIColor blackColor]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (tzImagePickerVc) { - self.navigationItem.title = tzImagePickerVc.previewBtnTitleStr; - } - [self configMoviePlayer]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:UIApplicationWillResignActiveNotification object:nil]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - _originStatusBarStyle = [UIApplication sharedApplication].statusBarStyle; - [UIApplication sharedApplication].statusBarStyle = iOS7Later ? UIStatusBarStyleLightContent : UIStatusBarStyleBlackOpaque; -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - [UIApplication sharedApplication].statusBarStyle = _originStatusBarStyle; -} - -- (void)configMoviePlayer { - [[TZImageManager manager] getPhotoWithAsset:_model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) { - _cover = photo; - }]; - [[TZImageManager manager] getVideoWithAsset:_model.asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) { - dispatch_async(dispatch_get_main_queue(), ^{ - _player = [AVPlayer playerWithPlayerItem:playerItem]; - _playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player]; - _playerLayer.frame = self.view.bounds; - [self.view.layer addSublayer:_playerLayer]; - [self addProgressObserver]; - [self configPlayButton]; - [self configBottomToolBar]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:_player.currentItem]; - }); - }]; -} - -/// Show progress,do it next time / 给播放器添加进度更新,下次加上 -- (void)addProgressObserver{ - AVPlayerItem *playerItem = _player.currentItem; - UIProgressView *progress = _progress; - [_player addPeriodicTimeObserverForInterval:CMTimeMake(1.0, 1.0) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) { - float current = CMTimeGetSeconds(time); - float total = CMTimeGetSeconds([playerItem duration]); - if (current) { - [progress setProgress:(current/total) animated:YES]; - } - }]; -} - -- (void)configPlayButton { - _playButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_playButton setImage:[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal]; - [_playButton setImage:[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlayHL"] forState:UIControlStateHighlighted]; - [_playButton addTarget:self action:@selector(playButtonClick) forControlEvents:UIControlEventTouchUpInside]; - [self.view addSubview:_playButton]; -} - -- (void)configBottomToolBar { - _toolBar = [[UIView alloc] initWithFrame:CGRectZero]; - CGFloat rgb = 34 / 255.0; - _toolBar.backgroundColor = [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.7]; - - _doneButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _doneButton.titleLabel.font = [UIFont systemFontOfSize:16]; - [_doneButton addTarget:self action:@selector(doneButtonClick) forControlEvents:UIControlEventTouchUpInside]; - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (tzImagePickerVc) { - [_doneButton setTitle:tzImagePickerVc.doneBtnTitleStr forState:UIControlStateNormal]; - [_doneButton setTitleColor:tzImagePickerVc.oKButtonTitleColorNormal forState:UIControlStateNormal]; - } else { - [_doneButton setTitle:[NSBundle tz_localizedStringForKey:@"Done"] forState:UIControlStateNormal]; - [_doneButton setTitleColor:[UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0] forState:UIControlStateNormal]; - } - [_toolBar addSubview:_doneButton]; - [self.view addSubview:_toolBar]; -} - -#pragma mark - Layout - -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - - CGFloat statusBarHeight = [TZCommonTools tz_statusBarHeight]; - CGFloat statusBarAndNaviBarHeight = statusBarHeight + self.navigationController.navigationBar.tz_height; - _playerLayer.frame = self.view.bounds; - CGFloat toolBarHeight = [TZCommonTools tz_isIPhoneX] ? 44 + (83 - 49) : 44; - _toolBar.frame = CGRectMake(0, self.view.tz_height - toolBarHeight, self.view.tz_width, toolBarHeight); - _doneButton.frame = CGRectMake(self.view.tz_width - 44 - 12, 0, 44, 44); - _playButton.frame = CGRectMake(0, statusBarAndNaviBarHeight, self.view.tz_width, self.view.tz_height - statusBarAndNaviBarHeight - toolBarHeight); -} - -#pragma mark - Click Event - -- (void)playButtonClick { - CMTime currentTime = _player.currentItem.currentTime; - CMTime durationTime = _player.currentItem.duration; - if (_player.rate == 0.0f) { - if (currentTime.value == durationTime.value) [_player.currentItem seekToTime:CMTimeMake(0, 1)]; - [_player play]; - [self.navigationController setNavigationBarHidden:YES]; - _toolBar.hidden = YES; - [_playButton setImage:nil forState:UIControlStateNormal]; - if (iOS7Later) [UIApplication sharedApplication].statusBarHidden = YES; - } else { - [self pausePlayerAndShowNaviBar]; - } -} - -- (void)doneButtonClick { - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - if (self.navigationController) { - if (imagePickerVc.autoDismiss) { - [self.navigationController dismissViewControllerAnimated:YES completion:^{ - [self callDelegateMethod]; - }]; - } else { - [self callDelegateMethod]; - } - } else { - [self dismissViewControllerAnimated:YES completion:^{ - [self callDelegateMethod]; - }]; - } -} - -- (void)callDelegateMethod { - TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; - if ([imagePickerVc.pickerDelegate respondsToSelector:@selector(imagePickerController:didFinishPickingVideo:sourceAssets:)]) { - [imagePickerVc.pickerDelegate imagePickerController:imagePickerVc didFinishPickingVideo:_cover sourceAssets:_model.asset]; - } - if (imagePickerVc.didFinishPickingVideoHandle) { - imagePickerVc.didFinishPickingVideoHandle(_cover,_model.asset); - } -} - -#pragma mark - Notification Method - -- (void)pausePlayerAndShowNaviBar { - [_player pause]; - _toolBar.hidden = NO; - [self.navigationController setNavigationBarHidden:NO]; - [_playButton setImage:[UIImage imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal]; - - TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController; - if (tzImagePickerVc.needShowStatusBar && iOS7Later) { - [UIApplication sharedApplication].statusBarHidden = NO; - } -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -#pragma clang diagnostic pop - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/UIView+Layout.h b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/UIView+Layout.h deleted file mode 100755 index 68cdab30..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/UIView+Layout.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// UIView+Layout.h -// -// Created by 谭真 on 15/2/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import - -typedef enum : NSUInteger { - TZOscillatoryAnimationToBigger, - TZOscillatoryAnimationToSmaller, -} TZOscillatoryAnimationType; - -@interface UIView (Layout) - -@property (nonatomic) CGFloat tz_left; ///< Shortcut for frame.origin.x. -@property (nonatomic) CGFloat tz_top; ///< Shortcut for frame.origin.y -@property (nonatomic) CGFloat tz_right; ///< Shortcut for frame.origin.x + frame.size.width -@property (nonatomic) CGFloat tz_bottom; ///< Shortcut for frame.origin.y + frame.size.height -@property (nonatomic) CGFloat tz_width; ///< Shortcut for frame.size.width. -@property (nonatomic) CGFloat tz_height; ///< Shortcut for frame.size.height. -@property (nonatomic) CGFloat tz_centerX; ///< Shortcut for center.x -@property (nonatomic) CGFloat tz_centerY; ///< Shortcut for center.y -@property (nonatomic) CGPoint tz_origin; ///< Shortcut for frame.origin. -@property (nonatomic) CGSize tz_size; ///< Shortcut for frame.size. - -+ (void)showOscillatoryAnimationWithLayer:(CALayer *)layer type:(TZOscillatoryAnimationType)type; - -@end diff --git a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/UIView+Layout.m b/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/UIView+Layout.m deleted file mode 100755 index ee8949c4..00000000 --- a/iOSProject/Pods/TZImagePickerController/TZImagePickerController/TZImagePickerController/UIView+Layout.m +++ /dev/null @@ -1,125 +0,0 @@ -// -// UIView+Layout.m -// -// Created by 谭真 on 15/2/24. -// Copyright © 2015年 谭真. All rights reserved. -// - -#import "UIView+Layout.h" - -@implementation UIView (Layout) - -- (CGFloat)tz_left { - return self.frame.origin.x; -} - -- (void)setTz_left:(CGFloat)x { - CGRect frame = self.frame; - frame.origin.x = x; - self.frame = frame; -} - -- (CGFloat)tz_top { - return self.frame.origin.y; -} - -- (void)setTz_top:(CGFloat)y { - CGRect frame = self.frame; - frame.origin.y = y; - self.frame = frame; -} - -- (CGFloat)tz_right { - return self.frame.origin.x + self.frame.size.width; -} - -- (void)setTz_right:(CGFloat)right { - CGRect frame = self.frame; - frame.origin.x = right - frame.size.width; - self.frame = frame; -} - -- (CGFloat)tz_bottom { - return self.frame.origin.y + self.frame.size.height; -} - -- (void)setTz_bottom:(CGFloat)bottom { - CGRect frame = self.frame; - frame.origin.y = bottom - frame.size.height; - self.frame = frame; -} - -- (CGFloat)tz_width { - return self.frame.size.width; -} - -- (void)setTz_width:(CGFloat)width { - CGRect frame = self.frame; - frame.size.width = width; - self.frame = frame; -} - -- (CGFloat)tz_height { - return self.frame.size.height; -} - -- (void)setTz_height:(CGFloat)height { - CGRect frame = self.frame; - frame.size.height = height; - self.frame = frame; -} - -- (CGFloat)tz_centerX { - return self.center.x; -} - -- (void)setTz_centerX:(CGFloat)centerX { - self.center = CGPointMake(centerX, self.center.y); -} - -- (CGFloat)tz_centerY { - return self.center.y; -} - -- (void)setTz_centerY:(CGFloat)centerY { - self.center = CGPointMake(self.center.x, centerY); -} - -- (CGPoint)tz_origin { - return self.frame.origin; -} - -- (void)setTz_origin:(CGPoint)origin { - CGRect frame = self.frame; - frame.origin = origin; - self.frame = frame; -} - -- (CGSize)tz_size { - return self.frame.size; -} - -- (void)setTz_size:(CGSize)size { - CGRect frame = self.frame; - frame.size = size; - self.frame = frame; -} - -+ (void)showOscillatoryAnimationWithLayer:(CALayer *)layer type:(TZOscillatoryAnimationType)type{ - NSNumber *animationScale1 = type == TZOscillatoryAnimationToBigger ? @(1.15) : @(0.5); - NSNumber *animationScale2 = type == TZOscillatoryAnimationToBigger ? @(0.92) : @(1.15); - - [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{ - [layer setValue:animationScale1 forKeyPath:@"transform.scale"]; - } completion:^(BOOL finished) { - [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{ - [layer setValue:animationScale2 forKeyPath:@"transform.scale"]; - } completion:^(BOOL finished) { - [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{ - [layer setValue:@(1.0) forKeyPath:@"transform.scale"]; - } completion:nil]; - }]; - }]; -} - -@end diff --git a/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m b/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m deleted file mode 100644 index 6a29cf8d..00000000 --- a/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_AFNetworking : NSObject -@end -@implementation PodsDummy_AFNetworking -@end diff --git a/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch b/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch deleted file mode 100644 index e72247a9..00000000 --- a/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch +++ /dev/null @@ -1,23 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - -#ifndef TARGET_OS_IOS - #define TARGET_OS_IOS TARGET_OS_IPHONE -#endif - -#ifndef TARGET_OS_WATCH - #define TARGET_OS_WATCH 0 -#endif - -#ifndef TARGET_OS_TV - #define TARGET_OS_TV 0 -#endif diff --git a/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig b/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig deleted file mode 100644 index 03231200..00000000 --- a/iOSProject/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AFNetworking -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest-dummy.m b/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest-dummy.m deleted file mode 100644 index fe61241c..00000000 --- a/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_ASIHTTPRequest : NSObject -@end -@implementation PodsDummy_ASIHTTPRequest -@end diff --git a/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest-prefix.pch b/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest.xcconfig b/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest.xcconfig deleted file mode 100644 index 24d6aa19..00000000 --- a/iOSProject/Pods/Target Support Files/ASIHTTPRequest/ASIHTTPRequest.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ASIHTTPRequest -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" "$(SDKROOT)/usr/include/libxml2" -LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Reachability" -OTHER_LDFLAGS = -l"xml2.2" -l"z.1" -framework "CFNetwork" -framework "CoreGraphics" -framework "MobileCoreServices" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/ASIHTTPRequest -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController-dummy.m b/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController-dummy.m deleted file mode 100644 index 7012dcac..00000000 --- a/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_CYLTabBarController : NSObject -@end -@implementation PodsDummy_CYLTabBarController -@end diff --git a/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController-prefix.pch b/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController.xcconfig b/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController.xcconfig deleted file mode 100644 index 973fc44b..00000000 --- a/iOSProject/Pods/Target Support Files/CYLTabBarController/CYLTabBarController.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/CYLTabBarController -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/CYLTabBarController" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/CYLTabBarController -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton-dummy.m b/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton-dummy.m deleted file mode 100644 index 9ed0639a..00000000 --- a/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_DWBubbleMenuButton : NSObject -@end -@implementation PodsDummy_DWBubbleMenuButton -@end diff --git a/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton-prefix.pch b/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton.xcconfig b/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton.xcconfig deleted file mode 100644 index 84bd9b81..00000000 --- a/iOSProject/Pods/Target Support Files/DWBubbleMenuButton/DWBubbleMenuButton.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/DWBubbleMenuButton -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/DWBubbleMenuButton -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/FCUUID/FCUUID-dummy.m b/iOSProject/Pods/Target Support Files/FCUUID/FCUUID-dummy.m deleted file mode 100644 index afe20913..00000000 --- a/iOSProject/Pods/Target Support Files/FCUUID/FCUUID-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_FCUUID : NSObject -@end -@implementation PodsDummy_FCUUID -@end diff --git a/iOSProject/Pods/Target Support Files/FCUUID/FCUUID-prefix.pch b/iOSProject/Pods/Target Support Files/FCUUID/FCUUID-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/FCUUID/FCUUID-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/FCUUID/FCUUID.xcconfig b/iOSProject/Pods/Target Support Files/FCUUID/FCUUID.xcconfig deleted file mode 100644 index 1dbe2bcc..00000000 --- a/iOSProject/Pods/Target Support Files/FCUUID/FCUUID.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FCUUID -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FCUUID" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/UICKeyChainStore" -OTHER_LDFLAGS = -framework "Foundation" -framework "Security" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/FCUUID -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture-dummy.m b/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture-dummy.m deleted file mode 100644 index 0f7d9860..00000000 --- a/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_FDFullscreenPopGesture : NSObject -@end -@implementation PodsDummy_FDFullscreenPopGesture -@end diff --git a/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture-prefix.pch b/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture.xcconfig b/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture.xcconfig deleted file mode 100644 index 3221d7d9..00000000 --- a/iOSProject/Pods/Target Support Files/FDFullscreenPopGesture/FDFullscreenPopGesture.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FDFullscreenPopGesture -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/FDFullscreenPopGesture -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/FMDB/FMDB-dummy.m b/iOSProject/Pods/Target Support Files/FMDB/FMDB-dummy.m deleted file mode 100644 index 20ea8f19..00000000 --- a/iOSProject/Pods/Target Support Files/FMDB/FMDB-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_FMDB : NSObject -@end -@implementation PodsDummy_FMDB -@end diff --git a/iOSProject/Pods/Target Support Files/FMDB/FMDB-prefix.pch b/iOSProject/Pods/Target Support Files/FMDB/FMDB-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/FMDB/FMDB-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/FMDB/FMDB.xcconfig b/iOSProject/Pods/Target Support Files/FMDB/FMDB.xcconfig deleted file mode 100644 index ce592166..00000000 --- a/iOSProject/Pods/Target Support Files/FMDB/FMDB.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FMDB -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FMDB" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -l"sqlite3" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/FMDB -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults-dummy.m b/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults-dummy.m deleted file mode 100644 index 3bdeb209..00000000 --- a/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_GVUserDefaults : NSObject -@end -@implementation PodsDummy_GVUserDefaults -@end diff --git a/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults-prefix.pch b/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults.xcconfig b/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults.xcconfig deleted file mode 100644 index f84f0b0e..00000000 --- a/iOSProject/Pods/Target Support Files/GVUserDefaults/GVUserDefaults.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/GVUserDefaults -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/GVUserDefaults" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/GVUserDefaults -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon-dummy.m b/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon-dummy.m deleted file mode 100644 index 166ddd69..00000000 --- a/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_HMEmoticon : NSObject -@end -@implementation PodsDummy_HMEmoticon -@end diff --git a/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon-prefix.pch b/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon.xcconfig b/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon.xcconfig deleted file mode 100644 index 011012ab..00000000 --- a/iOSProject/Pods/Target Support Files/HMEmoticon/HMEmoticon.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/HMEmoticon -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/HMEmoticon" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/HMEmoticon -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner-dummy.m b/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner-dummy.m deleted file mode 100644 index edc4379f..00000000 --- a/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_HMQRCodeScanner : NSObject -@end -@implementation PodsDummy_HMQRCodeScanner -@end diff --git a/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner-prefix.pch b/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner.xcconfig b/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner.xcconfig deleted file mode 100644 index b96a1b16..00000000 --- a/iOSProject/Pods/Target Support Files/HMQRCodeScanner/HMQRCodeScanner.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/HMQRCodeScanner -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "AVFoundation" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/HMQRCodeScanner -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-dummy.m b/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-dummy.m deleted file mode 100644 index 1d8d5d2a..00000000 --- a/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_IQKeyboardManager : NSObject -@end -@implementation PodsDummy_IQKeyboardManager -@end diff --git a/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-prefix.pch b/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager.xcconfig b/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager.xcconfig deleted file mode 100644 index 02873109..00000000 --- a/iOSProject/Pods/Target Support Files/IQKeyboardManager/IQKeyboardManager.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/IQKeyboardManager -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/IQKeyboardManager" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "CoreGraphics" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/IQKeyboardManager -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/KILabel/KILabel-dummy.m b/iOSProject/Pods/Target Support Files/KILabel/KILabel-dummy.m deleted file mode 100644 index 3d646c08..00000000 --- a/iOSProject/Pods/Target Support Files/KILabel/KILabel-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_KILabel : NSObject -@end -@implementation PodsDummy_KILabel -@end diff --git a/iOSProject/Pods/Target Support Files/KILabel/KILabel-prefix.pch b/iOSProject/Pods/Target Support Files/KILabel/KILabel-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/KILabel/KILabel-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/KILabel/KILabel.xcconfig b/iOSProject/Pods/Target Support Files/KILabel/KILabel.xcconfig deleted file mode 100644 index 88ea7c0a..00000000 --- a/iOSProject/Pods/Target Support Files/KILabel/KILabel.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/KILabel -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/KILabel" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/KILabel -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/LxGridView/LxGridView-dummy.m b/iOSProject/Pods/Target Support Files/LxGridView/LxGridView-dummy.m deleted file mode 100644 index a42da6df..00000000 --- a/iOSProject/Pods/Target Support Files/LxGridView/LxGridView-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_LxGridView : NSObject -@end -@implementation PodsDummy_LxGridView -@end diff --git a/iOSProject/Pods/Target Support Files/LxGridView/LxGridView-prefix.pch b/iOSProject/Pods/Target Support Files/LxGridView/LxGridView-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/LxGridView/LxGridView-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/LxGridView/LxGridView.xcconfig b/iOSProject/Pods/Target Support Files/LxGridView/LxGridView.xcconfig deleted file mode 100644 index 31ec8778..00000000 --- a/iOSProject/Pods/Target Support Files/LxGridView/LxGridView.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/LxGridView -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/LxGridView" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "CoreGraphics" -framework "Foundation" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/LxGridView -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite-dummy.m b/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite-dummy.m deleted file mode 100644 index 67a06099..00000000 --- a/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_M13ProgressSuite : NSObject -@end -@implementation PodsDummy_M13ProgressSuite -@end diff --git a/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite-prefix.pch b/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite.xcconfig b/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite.xcconfig deleted file mode 100644 index 5cf9b712..00000000 --- a/iOSProject/Pods/Target Support Files/M13ProgressSuite/M13ProgressSuite.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/M13ProgressSuite -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/M13ProgressSuite" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "Accelerate" -framework "CoreGraphics" -framework "CoreImage" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/M13ProgressSuite -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD-dummy.m b/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD-dummy.m deleted file mode 100644 index 67a74df2..00000000 --- a/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_MBProgressHUD : NSObject -@end -@implementation PodsDummy_MBProgressHUD -@end diff --git a/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch b/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig b/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig deleted file mode 100644 index 9141353b..00000000 --- a/iOSProject/Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/MBProgressHUD -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/MJExtension/MJExtension-dummy.m b/iOSProject/Pods/Target Support Files/MJExtension/MJExtension-dummy.m deleted file mode 100644 index 79c234ee..00000000 --- a/iOSProject/Pods/Target Support Files/MJExtension/MJExtension-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_MJExtension : NSObject -@end -@implementation PodsDummy_MJExtension -@end diff --git a/iOSProject/Pods/Target Support Files/MJExtension/MJExtension-prefix.pch b/iOSProject/Pods/Target Support Files/MJExtension/MJExtension-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/MJExtension/MJExtension-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/MJExtension/MJExtension.xcconfig b/iOSProject/Pods/Target Support Files/MJExtension/MJExtension.xcconfig deleted file mode 100644 index 682e475c..00000000 --- a/iOSProject/Pods/Target Support Files/MJExtension/MJExtension.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MJExtension -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MJExtension" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/MJExtension -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh-dummy.m b/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh-dummy.m deleted file mode 100644 index d43259d2..00000000 --- a/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_MJRefresh : NSObject -@end -@implementation PodsDummy_MJRefresh -@end diff --git a/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh-prefix.pch b/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh.xcconfig b/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh.xcconfig deleted file mode 100644 index 523ee8da..00000000 --- a/iOSProject/Pods/Target Support Files/MJRefresh/MJRefresh.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MJRefresh -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MJRefresh" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/MJRefresh -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager-dummy.m b/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager-dummy.m deleted file mode 100644 index b1846d07..00000000 --- a/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_MOFSPickerManager : NSObject -@end -@implementation PodsDummy_MOFSPickerManager -@end diff --git a/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager-prefix.pch b/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager.xcconfig b/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager.xcconfig deleted file mode 100644 index 8d793ab6..00000000 --- a/iOSProject/Pods/Target Support Files/MOFSPickerManager/MOFSPickerManager.xcconfig +++ /dev/null @@ -1,12 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MOFSPickerManager -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MOFSPickerManager" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" $(SDKROOT)/usr/include/libxml2 -OTHER_LDFLAGS = -l"xml2" -OTHER_LINKER_FLAGS = -ObjC -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/MOFSPickerManager -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES -WEAK_REFERENCES_IN_MANUAL_RETAIN_RELEASE = Yes diff --git a/iOSProject/Pods/Target Support Files/Masonry/Masonry-dummy.m b/iOSProject/Pods/Target Support Files/Masonry/Masonry-dummy.m deleted file mode 100644 index 04001b1a..00000000 --- a/iOSProject/Pods/Target Support Files/Masonry/Masonry-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Masonry : NSObject -@end -@implementation PodsDummy_Masonry -@end diff --git a/iOSProject/Pods/Target Support Files/Masonry/Masonry-prefix.pch b/iOSProject/Pods/Target Support Files/Masonry/Masonry-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/Masonry/Masonry-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/Masonry/Masonry.xcconfig b/iOSProject/Pods/Target Support Files/Masonry/Masonry.xcconfig deleted file mode 100644 index b6072d7e..00000000 --- a/iOSProject/Pods/Target Support Files/Masonry/Masonry.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Masonry -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-acknowledgements.markdown b/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-acknowledgements.markdown deleted file mode 100644 index ecc7f5b0..00000000 --- a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-acknowledgements.markdown +++ /dev/null @@ -1,1269 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## AFNetworking - -Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -## ASIHTTPRequest - -* Copyright (c) 2007-2011, All-Seeing Interactive -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the All-Seeing Interactive nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY All-Seeing Interactive ''AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL All-Seeing Interactive BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -A different license may apply to other software included in this package, -including GHUnit and Andrew Donoho's Reachability class. Please consult their -respective headers for the terms of their individual licenses. - -## BaiduMapKit - -The MIT License (MIT) - -Copyright (c) 2015 BaiduLBS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## CYLTabBarController - -Copyright (c) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTabBarController), L.L.C. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE - - -## DWBubbleMenuButton - -The MIT License (MIT) - -Copyright (c) 2014 Derrick Walker - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -## FCUUID - -The MIT License (MIT) - -Copyright (c) 2016 Fabio Caccamo - fabio.caccamo@gmail.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -## FDFullscreenPopGesture - -The MIT License (MIT) - -Copyright (c) 2015 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## FMDB - -If you are using FMDB in your project, I'd love to hear about it. Let Gus know -by sending an email to gus@flyingmeat.com. - -And if you happen to come across either Gus Mueller or Rob Ryan in a bar, you -might consider purchasing a drink of their choosing if FMDB has been useful to -you. - -Finally, and shortly, this is the MIT License. - -Copyright (c) 2008-2014 Flying Meat Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -## GVUserDefaults - -Copyright (c) 2012 Gangverk ehf. http://gangverk.is - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -## HMEmoticon - -The MIT License (MIT) - -Copyright (c) 2016 黑马程序员 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -## HMQRCodeScanner - -The MIT License (MIT) - -Copyright (c) 2016 Fan Liu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## IQKeyboardManager - -MIT License - -Copyright (c) 2013-2017 Iftekhar Qurashi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -## KILabel - -The MIT License (MIT) - -Copyright (c) 2013 Matthew Styles - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -## LxGridView - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - -## M13ProgressSuite - - Copyright (c) 2013 Brandon McQuilkin - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -## MBProgressHUD - -Copyright © 2009-2016 Matej Bukovinski - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -## MJExtension - -Copyright (c) 2013-2015 MJExtension (https://github.com/CoderMJLee/MJExtension) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -## MJRefresh - -Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -## MOFSPickerManager - -Copyright (c) 2017 luoyuan Corporation, http://www.jianshu.com/u/f4284f2cc646 - -MIT LICENSE - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -## MagicWindowSDK - -The MIT License (MIT) - -Copyright (c) 2016 Magic Window - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -## Masonry - -Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -## Reachability - -Copyright (c) 2011, Tony Million. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -## SDCycleScrollView - -The MIT License (MIT) - -Copyright (c) 2015 GSD_iOS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## SDWebImage - -Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - - -## TDTouchID - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -## TZImagePickerController - -The MIT License (MIT) - -Copyright (c) 2016 Zhen Tan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## Toast - -Copyright (c) 2011-2017 Charles Scalesse. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -## UICKeyChainStore - -The MIT License - -Copyright (c) 2011 kishikawa katsumi - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -## UMengAnalytics - -Copyright 2011 - 2015 UMeng.com. All rights reserved. - - -## UMengUShare - -Copyright 2011 - 2017 UMeng.com. All rights reserved. - - -## WebViewJavascriptBridge - -Copyright (c) 2011-2015 Marcus Westin, Antoine Lagadec - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - - -## WechatOpenSDK - -Copyright 2017 tencent.com. All rights reserved. - - -## YYAsyncLayer - -The MIT License (MIT) - -Copyright (c) 2015 ibireme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## YYCategories - -The MIT License (MIT) - -Copyright (c) 2015 ibireme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## YYImage - -The MIT License (MIT) - -Copyright (c) 2015 ibireme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## YYText - -The MIT License (MIT) - -Copyright (c) 2015 ibireme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -## ZFDownload - -The MIT License (MIT) - -Copyright (c) 2016 紫枫 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -## ZFPlayer - -Copyright (c) 2013-2016 ZFPlayer (https://github.com/renzifeng/ZFPlayer) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -## ZJScrollPageView - -The MIT License (MIT) - -Copyright (c) 2016 ZeroJ - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -## iflyMSC - -The MIT License (MIT) - -Copyright (c) 2016 徐志军 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Generated by CocoaPods - https://cocoapods.org diff --git a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-acknowledgements.plist b/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-acknowledgements.plist deleted file mode 100644 index 483a3cf5..00000000 --- a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-acknowledgements.plist +++ /dev/null @@ -1,1535 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - License - MIT - Title - AFNetworking - Type - PSGroupSpecifier - - - FooterText - * Copyright (c) 2007-2011, All-Seeing Interactive -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the All-Seeing Interactive nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY All-Seeing Interactive ''AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL All-Seeing Interactive BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -A different license may apply to other software included in this package, -including GHUnit and Andrew Donoho's Reachability class. Please consult their -respective headers for the terms of their individual licenses. - License - New BSD License - Title - ASIHTTPRequest - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2015 BaiduLBS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - BaiduMapKit - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTabBarController), L.L.C. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE - - License - MIT - Title - CYLTabBarController - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2014 Derrick Walker - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - License - MIT License - Title - DWBubbleMenuButton - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2016 Fabio Caccamo - fabio.caccamo@gmail.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - License - MIT - Title - FCUUID - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2015 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - FDFullscreenPopGesture - Type - PSGroupSpecifier - - - FooterText - If you are using FMDB in your project, I'd love to hear about it. Let Gus know -by sending an email to gus@flyingmeat.com. - -And if you happen to come across either Gus Mueller or Rob Ryan in a bar, you -might consider purchasing a drink of their choosing if FMDB has been useful to -you. - -Finally, and shortly, this is the MIT License. - -Copyright (c) 2008-2014 Flying Meat Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - License - MIT - Title - FMDB - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2012 Gangverk ehf. http://gangverk.is - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - License - MIT - Title - GVUserDefaults - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2016 黑马程序员 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - License - MIT - Title - HMEmoticon - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2016 Fan Liu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - HMQRCodeScanner - Type - PSGroupSpecifier - - - FooterText - MIT License - -Copyright (c) 2013-2017 Iftekhar Qurashi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - License - MIT - Title - IQKeyboardManager - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2013 Matthew Styles - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - License - MIT - Title - KILabel - Type - PSGroupSpecifier - - - FooterText - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - License - Apache - Title - LxGridView - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2013 Brandon McQuilkin - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - License - MIT - Title - M13ProgressSuite - Type - PSGroupSpecifier - - - FooterText - Copyright © 2009-2016 Matej Bukovinski - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - License - MIT - Title - MBProgressHUD - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2013-2015 MJExtension (https://github.com/CoderMJLee/MJExtension) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - License - MIT - Title - MJExtension - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - License - MIT - Title - MJRefresh - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2017 luoyuan Corporation, http://www.jianshu.com/u/f4284f2cc646 - -MIT LICENSE - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - License - MIT - Title - MOFSPickerManager - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2016 Magic Window - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - License - MIT - Title - MagicWindowSDK - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - License - MIT - Title - Masonry - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2011, Tony Million. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - License - BSD - Title - Reachability - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2015 GSD_iOS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - SDCycleScrollView - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - - License - MIT - Title - SDWebImage - Type - PSGroupSpecifier - - - FooterText - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - License - Apache-2.0 - Title - TDTouchID - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2016 Zhen Tan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - TZImagePickerController - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2011-2017 Charles Scalesse. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - License - MIT - Title - Toast - Type - PSGroupSpecifier - - - FooterText - The MIT License - -Copyright (c) 2011 kishikawa katsumi - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - License - MIT - Title - UICKeyChainStore - Type - PSGroupSpecifier - - - FooterText - Copyright 2011 - 2015 UMeng.com. All rights reserved. - - License - Copyright - Title - UMengAnalytics - Type - PSGroupSpecifier - - - FooterText - Copyright 2011 - 2017 UMeng.com. All rights reserved. - - License - Copyright - Title - UMengUShare - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2011-2015 Marcus Westin, Antoine Lagadec - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - - License - MIT - Title - WebViewJavascriptBridge - Type - PSGroupSpecifier - - - FooterText - Copyright 2017 tencent.com. All rights reserved. - - License - Copyright - Title - WechatOpenSDK - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2015 ibireme <ibireme@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - YYAsyncLayer - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2015 ibireme <ibireme@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - YYCategories - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2015 ibireme <ibireme@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - YYImage - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2015 ibireme <ibireme@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - License - MIT - Title - YYText - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2016 紫枫 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - License - MIT - Title - ZFDownload - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2013-2016 ZFPlayer (https://github.com/renzifeng/ZFPlayer) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - License - MIT - Title - ZFPlayer - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2016 ZeroJ - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - License - MIT - Title - ZJScrollPageView - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - -Copyright (c) 2016 徐志军 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - License - MIT - Title - iflyMSC - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-dummy.m b/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-dummy.m deleted file mode 100644 index 73001bd0..00000000 --- a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_iOSProject : NSObject -@end -@implementation PodsDummy_Pods_iOSProject -@end diff --git a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-frameworks.sh b/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-frameworks.sh deleted file mode 100755 index 0f29f13c..00000000 --- a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-frameworks.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -set -e - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" - - if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - code_sign_cmd="$code_sign_cmd &" - fi - echo "$code_sign_cmd" - eval "$code_sign_cmd" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current file - archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" - stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi -} - -if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - wait -fi diff --git a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-resources.sh b/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-resources.sh deleted file mode 100755 index b27df23d..00000000 --- a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-resources.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - 3) - TARGET_DEVICE_ARGS="--target-device tv" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; -esac - -install_resource() -{ - if [[ "$1" = /* ]] ; then - RESOURCE_PATH="$1" - else - RESOURCE_PATH="${PODS_ROOT}/$1" - fi - if [[ ! -e "$RESOURCE_PATH" ]] ; then - cat << EOM -error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. -EOM - exit 1 - fi - case $RESOURCE_PATH in - *.storyboard) - 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}" - 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} - ;; - *.xib) - 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}" - 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} - ;; - *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" - xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - *) - echo "$RESOURCE_PATH" - echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" - ;; - esac -} -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_resource "BaiduMapKit/BaiduMapKit/BaiduMapAPI_Map.framework/Resources/mapapi.bundle" - install_resource "HMEmoticon/表情键盘/Emoticon/HMEmoticon.bundle" - install_resource "HMQRCodeScanner/HMQRCodeScanner/QRCode/HMScanner.bundle" - install_resource "IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle" - install_resource "MJRefresh/MJRefresh/MJRefresh.bundle" - install_resource "MOFSPickerManager/MOFSPickerManagerDemo/MOFSPickerManager/province_data.xml" - install_resource "MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle" - install_resource "TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle" - install_resource "UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle" - install_resource "UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle" - install_resource "UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle" - install_resource "UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle" - install_resource "ZFPlayer/ZFPlayer/ZFPlayer.bundle" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_resource "BaiduMapKit/BaiduMapKit/BaiduMapAPI_Map.framework/Resources/mapapi.bundle" - install_resource "HMEmoticon/表情键盘/Emoticon/HMEmoticon.bundle" - install_resource "HMQRCodeScanner/HMQRCodeScanner/QRCode/HMScanner.bundle" - install_resource "IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle" - install_resource "MJRefresh/MJRefresh/MJRefresh.bundle" - install_resource "MOFSPickerManager/MOFSPickerManagerDemo/MOFSPickerManager/province_data.xml" - install_resource "MagicWindowSDK/MagicWindowSDK/MagicWindowSDK/MagicWindow.bundle" - install_resource "TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle" - install_resource "UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle" - install_resource "UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle" - install_resource "UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle" - install_resource "UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle" - install_resource "ZFPlayer/ZFPlayer/ZFPlayer.bundle" -fi - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "${PODS_ROOT}*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - 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}" -fi diff --git a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject.debug.xcconfig b/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject.debug.xcconfig deleted file mode 100644 index f3a6214c..00000000 --- a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject.debug.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/BaiduMapKit/BaiduMapKit" "${PODS_ROOT}/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialUI" "${PODS_ROOT}/iflyMSC/RX3_iflyMSC" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2" $(SDKROOT)/usr/include/libxml2 "$(PODS_ROOT)/MagicWindowSDK/MagicWindowSDK" $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/MagicWindowSDK/MagicWindowSDK" "$(PODS_ROOT)/UMengAnalytics/**" "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/ASIHTTPRequest" "$PODS_CONFIGURATION_BUILD_DIR/CYLTabBarController" "$PODS_CONFIGURATION_BUILD_DIR/DWBubbleMenuButton" "$PODS_CONFIGURATION_BUILD_DIR/FCUUID" "$PODS_CONFIGURATION_BUILD_DIR/FDFullscreenPopGesture" "$PODS_CONFIGURATION_BUILD_DIR/FMDB" "$PODS_CONFIGURATION_BUILD_DIR/GVUserDefaults" "$PODS_CONFIGURATION_BUILD_DIR/HMEmoticon" "$PODS_CONFIGURATION_BUILD_DIR/HMQRCodeScanner" "$PODS_CONFIGURATION_BUILD_DIR/IQKeyboardManager" "$PODS_CONFIGURATION_BUILD_DIR/KILabel" "$PODS_CONFIGURATION_BUILD_DIR/LxGridView" "$PODS_CONFIGURATION_BUILD_DIR/M13ProgressSuite" "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" "$PODS_CONFIGURATION_BUILD_DIR/MJExtension" "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh" "$PODS_CONFIGURATION_BUILD_DIR/MOFSPickerManager" "$PODS_CONFIGURATION_BUILD_DIR/Masonry" "$PODS_CONFIGURATION_BUILD_DIR/Reachability" "$PODS_CONFIGURATION_BUILD_DIR/SDCycleScrollView" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/TDTouchID" "$PODS_CONFIGURATION_BUILD_DIR/TZImagePickerController" "$PODS_CONFIGURATION_BUILD_DIR/Toast" "$PODS_CONFIGURATION_BUILD_DIR/UICKeyChainStore" "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge" "$PODS_CONFIGURATION_BUILD_DIR/YYAsyncLayer" "$PODS_CONFIGURATION_BUILD_DIR/YYCategories" "$PODS_CONFIGURATION_BUILD_DIR/YYImage" "$PODS_CONFIGURATION_BUILD_DIR/YYText" "$PODS_CONFIGURATION_BUILD_DIR/ZFDownload" "$PODS_CONFIGURATION_BUILD_DIR/ZFPlayer" "$PODS_CONFIGURATION_BUILD_DIR/ZJScrollPageView" $(inherited) "${PODS_ROOT}/BaiduMapKit/BaiduMapKit/thirdlibs" $(inherited) "${PODS_ROOT}/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDKPlugin" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/Sina" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/WeChat" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK" $(inherited) "${PODS_ROOT}/WechatOpenSDK/OpenSDK1.8.1" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" -isystem "${PODS_ROOT}/Headers/Public/BaiduMapKit" -isystem "${PODS_ROOT}/Headers/Public/CYLTabBarController" -isystem "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" -isystem "${PODS_ROOT}/Headers/Public/FCUUID" -isystem "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/GVUserDefaults" -isystem "${PODS_ROOT}/Headers/Public/HMEmoticon" -isystem "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" -isystem "${PODS_ROOT}/Headers/Public/KILabel" -isystem "${PODS_ROOT}/Headers/Public/LxGridView" -isystem "${PODS_ROOT}/Headers/Public/M13ProgressSuite" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/MJExtension" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" -isystem "${PODS_ROOT}/Headers/Public/MOFSPickerManager" -isystem "${PODS_ROOT}/Headers/Public/MagicWindowSDK" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/Reachability" -isystem "${PODS_ROOT}/Headers/Public/SDCycleScrollView" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/TDTouchID" -isystem "${PODS_ROOT}/Headers/Public/TZImagePickerController" -isystem "${PODS_ROOT}/Headers/Public/Toast" -isystem "${PODS_ROOT}/Headers/Public/UICKeyChainStore" -isystem "${PODS_ROOT}/Headers/Public/UMengAnalytics" -isystem "${PODS_ROOT}/Headers/Public/UMengUShare" -isystem "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK" -isystem "${PODS_ROOT}/Headers/Public/YYAsyncLayer" -isystem "${PODS_ROOT}/Headers/Public/YYCategories" -isystem "${PODS_ROOT}/Headers/Public/YYImage" -isystem "${PODS_ROOT}/Headers/Public/YYText" -isystem "${PODS_ROOT}/Headers/Public/ZFDownload" -isystem "${PODS_ROOT}/Headers/Public/ZFPlayer" -isystem "${PODS_ROOT}/Headers/Public/ZJScrollPageView" -isystem "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"ASIHTTPRequest" -l"CYLTabBarController" -l"DWBubbleMenuButton" -l"FCUUID" -l"FDFullscreenPopGesture" -l"FMDB" -l"GVUserDefaults" -l"HMEmoticon" -l"HMQRCodeScanner" -l"IQKeyboardManager" -l"KILabel" -l"LxGridView" -l"M13ProgressSuite" -l"MBProgressHUD" -l"MJExtension" -l"MJRefresh" -l"MOFSPickerManager" -l"MagicWindowSDK" -l"Masonry" -l"Reachability" -l"SDCycleScrollView" -l"SDWebImage" -l"SocialQQ" -l"SocialSina" -l"SocialWeChat" -l"TDTouchID" -l"TZImagePickerController" -l"Toast" -l"UICKeyChainStore" -l"UMSocialLog" -l"WeChatSDK" -l"WebViewJavascriptBridge" -l"WeiboSDK" -l"YYAsyncLayer" -l"YYCategories" -l"YYImage" -l"YYText" -l"ZFDownload" -l"ZFPlayer" -l"ZJScrollPageView" -l"c++" -l"crypto" -l"sqlite3" -l"sqlite3.0" -l"ssl" -l"xml2" -l"xml2.2" -l"z" -l"z.1" -framework "AVFoundation" -framework "Accelerate" -framework "AdSupport" -framework "AddressBook" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "BaiduMapAPI_Base" -framework "BaiduMapAPI_Cloud" -framework "BaiduMapAPI_Location" -framework "BaiduMapAPI_Map" -framework "BaiduMapAPI_Radar" -framework "BaiduMapAPI_Search" -framework "BaiduMapAPI_Utils" -framework "CFNetwork" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreImage" -framework "CoreLocation" -framework "CoreTelephony" -framework "CoreText" -framework "Foundation" -framework "ImageIO" -framework "LocalAuthentication" -framework "MediaPlayer" -framework "MobileCoreServices" -framework "OpenGLES" -framework "Photos" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "TencentOpenAPI" -framework "UIKit" -framework "UMMobClick" -framework "UMSocialCore" -framework "UMSocialNetwork" -framework "UShareUI" -framework "WebKit" -framework "iflyMSC" -OTHER_LINKER_FLAGS = -ObjC -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods -WEAK_REFERENCES_IN_MANUAL_RETAIN_RELEASE = Yes diff --git a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject.release.xcconfig b/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject.release.xcconfig deleted file mode 100644 index f3a6214c..00000000 --- a/iOSProject/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject.release.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/BaiduMapKit/BaiduMapKit" "${PODS_ROOT}/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialUI" "${PODS_ROOT}/iflyMSC/RX3_iflyMSC" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2" $(SDKROOT)/usr/include/libxml2 "$(PODS_ROOT)/MagicWindowSDK/MagicWindowSDK" $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/MagicWindowSDK/MagicWindowSDK" "$(PODS_ROOT)/UMengAnalytics/**" "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/ASIHTTPRequest" "$PODS_CONFIGURATION_BUILD_DIR/CYLTabBarController" "$PODS_CONFIGURATION_BUILD_DIR/DWBubbleMenuButton" "$PODS_CONFIGURATION_BUILD_DIR/FCUUID" "$PODS_CONFIGURATION_BUILD_DIR/FDFullscreenPopGesture" "$PODS_CONFIGURATION_BUILD_DIR/FMDB" "$PODS_CONFIGURATION_BUILD_DIR/GVUserDefaults" "$PODS_CONFIGURATION_BUILD_DIR/HMEmoticon" "$PODS_CONFIGURATION_BUILD_DIR/HMQRCodeScanner" "$PODS_CONFIGURATION_BUILD_DIR/IQKeyboardManager" "$PODS_CONFIGURATION_BUILD_DIR/KILabel" "$PODS_CONFIGURATION_BUILD_DIR/LxGridView" "$PODS_CONFIGURATION_BUILD_DIR/M13ProgressSuite" "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" "$PODS_CONFIGURATION_BUILD_DIR/MJExtension" "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh" "$PODS_CONFIGURATION_BUILD_DIR/MOFSPickerManager" "$PODS_CONFIGURATION_BUILD_DIR/Masonry" "$PODS_CONFIGURATION_BUILD_DIR/Reachability" "$PODS_CONFIGURATION_BUILD_DIR/SDCycleScrollView" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/TDTouchID" "$PODS_CONFIGURATION_BUILD_DIR/TZImagePickerController" "$PODS_CONFIGURATION_BUILD_DIR/Toast" "$PODS_CONFIGURATION_BUILD_DIR/UICKeyChainStore" "$PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge" "$PODS_CONFIGURATION_BUILD_DIR/YYAsyncLayer" "$PODS_CONFIGURATION_BUILD_DIR/YYCategories" "$PODS_CONFIGURATION_BUILD_DIR/YYImage" "$PODS_CONFIGURATION_BUILD_DIR/YYText" "$PODS_CONFIGURATION_BUILD_DIR/ZFDownload" "$PODS_CONFIGURATION_BUILD_DIR/ZFPlayer" "$PODS_CONFIGURATION_BUILD_DIR/ZJScrollPageView" $(inherited) "${PODS_ROOT}/BaiduMapKit/BaiduMapKit/thirdlibs" $(inherited) "${PODS_ROOT}/MagicWindowSDK/MagicWindowSDK/MagicWindowSDK" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDKPlugin" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/Sina" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/WeChat" $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK" $(inherited) "${PODS_ROOT}/WechatOpenSDK/OpenSDK1.8.1" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" -isystem "${PODS_ROOT}/Headers/Public/BaiduMapKit" -isystem "${PODS_ROOT}/Headers/Public/CYLTabBarController" -isystem "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" -isystem "${PODS_ROOT}/Headers/Public/FCUUID" -isystem "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/GVUserDefaults" -isystem "${PODS_ROOT}/Headers/Public/HMEmoticon" -isystem "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" -isystem "${PODS_ROOT}/Headers/Public/IQKeyboardManager" -isystem "${PODS_ROOT}/Headers/Public/KILabel" -isystem "${PODS_ROOT}/Headers/Public/LxGridView" -isystem "${PODS_ROOT}/Headers/Public/M13ProgressSuite" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/MJExtension" -isystem "${PODS_ROOT}/Headers/Public/MJRefresh" -isystem "${PODS_ROOT}/Headers/Public/MOFSPickerManager" -isystem "${PODS_ROOT}/Headers/Public/MagicWindowSDK" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/Reachability" -isystem "${PODS_ROOT}/Headers/Public/SDCycleScrollView" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/TDTouchID" -isystem "${PODS_ROOT}/Headers/Public/TZImagePickerController" -isystem "${PODS_ROOT}/Headers/Public/Toast" -isystem "${PODS_ROOT}/Headers/Public/UICKeyChainStore" -isystem "${PODS_ROOT}/Headers/Public/UMengAnalytics" -isystem "${PODS_ROOT}/Headers/Public/UMengUShare" -isystem "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK" -isystem "${PODS_ROOT}/Headers/Public/YYAsyncLayer" -isystem "${PODS_ROOT}/Headers/Public/YYCategories" -isystem "${PODS_ROOT}/Headers/Public/YYImage" -isystem "${PODS_ROOT}/Headers/Public/YYText" -isystem "${PODS_ROOT}/Headers/Public/ZFDownload" -isystem "${PODS_ROOT}/Headers/Public/ZFPlayer" -isystem "${PODS_ROOT}/Headers/Public/ZJScrollPageView" -isystem "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"ASIHTTPRequest" -l"CYLTabBarController" -l"DWBubbleMenuButton" -l"FCUUID" -l"FDFullscreenPopGesture" -l"FMDB" -l"GVUserDefaults" -l"HMEmoticon" -l"HMQRCodeScanner" -l"IQKeyboardManager" -l"KILabel" -l"LxGridView" -l"M13ProgressSuite" -l"MBProgressHUD" -l"MJExtension" -l"MJRefresh" -l"MOFSPickerManager" -l"MagicWindowSDK" -l"Masonry" -l"Reachability" -l"SDCycleScrollView" -l"SDWebImage" -l"SocialQQ" -l"SocialSina" -l"SocialWeChat" -l"TDTouchID" -l"TZImagePickerController" -l"Toast" -l"UICKeyChainStore" -l"UMSocialLog" -l"WeChatSDK" -l"WebViewJavascriptBridge" -l"WeiboSDK" -l"YYAsyncLayer" -l"YYCategories" -l"YYImage" -l"YYText" -l"ZFDownload" -l"ZFPlayer" -l"ZJScrollPageView" -l"c++" -l"crypto" -l"sqlite3" -l"sqlite3.0" -l"ssl" -l"xml2" -l"xml2.2" -l"z" -l"z.1" -framework "AVFoundation" -framework "Accelerate" -framework "AdSupport" -framework "AddressBook" -framework "AssetsLibrary" -framework "AudioToolbox" -framework "BaiduMapAPI_Base" -framework "BaiduMapAPI_Cloud" -framework "BaiduMapAPI_Location" -framework "BaiduMapAPI_Map" -framework "BaiduMapAPI_Radar" -framework "BaiduMapAPI_Search" -framework "BaiduMapAPI_Utils" -framework "CFNetwork" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreImage" -framework "CoreLocation" -framework "CoreTelephony" -framework "CoreText" -framework "Foundation" -framework "ImageIO" -framework "LocalAuthentication" -framework "MediaPlayer" -framework "MobileCoreServices" -framework "OpenGLES" -framework "Photos" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "TencentOpenAPI" -framework "UIKit" -framework "UMMobClick" -framework "UMSocialCore" -framework "UMSocialNetwork" -framework "UShareUI" -framework "WebKit" -framework "iflyMSC" -OTHER_LINKER_FLAGS = -ObjC -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods -WEAK_REFERENCES_IN_MANUAL_RETAIN_RELEASE = Yes diff --git a/iOSProject/Pods/Target Support Files/Reachability/Reachability-dummy.m b/iOSProject/Pods/Target Support Files/Reachability/Reachability-dummy.m deleted file mode 100644 index 119024a8..00000000 --- a/iOSProject/Pods/Target Support Files/Reachability/Reachability-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Reachability : NSObject -@end -@implementation PodsDummy_Reachability -@end diff --git a/iOSProject/Pods/Target Support Files/Reachability/Reachability-prefix.pch b/iOSProject/Pods/Target Support Files/Reachability/Reachability-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/Reachability/Reachability-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/Reachability/Reachability.xcconfig b/iOSProject/Pods/Target Support Files/Reachability/Reachability.xcconfig deleted file mode 100644 index 084d5d39..00000000 --- a/iOSProject/Pods/Target Support Files/Reachability/Reachability.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Reachability -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Reachability" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "SystemConfiguration" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/Reachability -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView-dummy.m b/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView-dummy.m deleted file mode 100644 index 3a541b56..00000000 --- a/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_SDCycleScrollView : NSObject -@end -@implementation PodsDummy_SDCycleScrollView -@end diff --git a/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView-prefix.pch b/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView.xcconfig b/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView.xcconfig deleted file mode 100644 index be303067..00000000 --- a/iOSProject/Pods/Target Support Files/SDCycleScrollView/SDCycleScrollView.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDCycleScrollView -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDCycleScrollView" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDCycleScrollView -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m b/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m deleted file mode 100644 index 86d2b5f6..00000000 --- a/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_SDWebImage : NSObject -@end -@implementation PodsDummy_SDWebImage -@end diff --git a/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch b/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig b/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig deleted file mode 100644 index fefeaba8..00000000 --- a/iOSProject/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDWebImage -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "ImageIO" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID-dummy.m b/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID-dummy.m deleted file mode 100644 index ec28eb35..00000000 --- a/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_TDTouchID : NSObject -@end -@implementation PodsDummy_TDTouchID -@end diff --git a/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID-prefix.pch b/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID.xcconfig b/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID.xcconfig deleted file mode 100644 index ec373dbf..00000000 --- a/iOSProject/Pods/Target Support Files/TDTouchID/TDTouchID.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/TDTouchID -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/TDTouchID" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "LocalAuthentication" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/TDTouchID -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController-dummy.m b/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController-dummy.m deleted file mode 100644 index 30889810..00000000 --- a/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_TZImagePickerController : NSObject -@end -@implementation PodsDummy_TZImagePickerController -@end diff --git a/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController-prefix.pch b/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController.xcconfig b/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController.xcconfig deleted file mode 100644 index 1adf0198..00000000 --- a/iOSProject/Pods/Target Support Files/TZImagePickerController/TZImagePickerController.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/TZImagePickerController -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/TZImagePickerController" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "AssetsLibrary" -framework "Photos" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/TZImagePickerController -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/Toast/Toast-dummy.m b/iOSProject/Pods/Target Support Files/Toast/Toast-dummy.m deleted file mode 100644 index 4c1e812d..00000000 --- a/iOSProject/Pods/Target Support Files/Toast/Toast-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Toast : NSObject -@end -@implementation PodsDummy_Toast -@end diff --git a/iOSProject/Pods/Target Support Files/Toast/Toast-prefix.pch b/iOSProject/Pods/Target Support Files/Toast/Toast-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/Toast/Toast-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/Toast/Toast.xcconfig b/iOSProject/Pods/Target Support Files/Toast/Toast.xcconfig deleted file mode 100644 index e6bdf355..00000000 --- a/iOSProject/Pods/Target Support Files/Toast/Toast.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Toast -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Toast" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "QuartzCore" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/Toast -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore-dummy.m b/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore-dummy.m deleted file mode 100644 index 0859e0aa..00000000 --- a/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_UICKeyChainStore : NSObject -@end -@implementation PodsDummy_UICKeyChainStore -@end diff --git a/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore-prefix.pch b/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore.xcconfig b/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore.xcconfig deleted file mode 100644 index 692fa6a0..00000000 --- a/iOSProject/Pods/Target Support Files/UICKeyChainStore/UICKeyChainStore.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/UICKeyChainStore -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/UICKeyChainStore" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "Security" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/UICKeyChainStore -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-dummy.m b/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-dummy.m deleted file mode 100644 index 6c5914c8..00000000 --- a/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_WebViewJavascriptBridge : NSObject -@end -@implementation PodsDummy_WebViewJavascriptBridge -@end diff --git a/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch b/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.xcconfig b/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.xcconfig deleted file mode 100644 index e2d18588..00000000 --- a/iOSProject/Pods/Target Support Files/WebViewJavascriptBridge/WebViewJavascriptBridge.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/WebViewJavascriptBridge -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "UIKit" -framework "WebKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/WebViewJavascriptBridge -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer-dummy.m b/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer-dummy.m deleted file mode 100644 index 9da97462..00000000 --- a/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_YYAsyncLayer : NSObject -@end -@implementation PodsDummy_YYAsyncLayer -@end diff --git a/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer-prefix.pch b/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer.xcconfig b/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer.xcconfig deleted file mode 100644 index d82fec4e..00000000 --- a/iOSProject/Pods/Target Support Files/YYAsyncLayer/YYAsyncLayer.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YYAsyncLayer -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYAsyncLayer" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "QuartzCore" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYAsyncLayer -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/YYCategories/YYCategories-dummy.m b/iOSProject/Pods/Target Support Files/YYCategories/YYCategories-dummy.m deleted file mode 100644 index 9c286033..00000000 --- a/iOSProject/Pods/Target Support Files/YYCategories/YYCategories-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_YYCategories : NSObject -@end -@implementation PodsDummy_YYCategories -@end diff --git a/iOSProject/Pods/Target Support Files/YYCategories/YYCategories-prefix.pch b/iOSProject/Pods/Target Support Files/YYCategories/YYCategories-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/YYCategories/YYCategories-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/YYCategories/YYCategories.xcconfig b/iOSProject/Pods/Target Support Files/YYCategories/YYCategories.xcconfig deleted file mode 100644 index da55c9ff..00000000 --- a/iOSProject/Pods/Target Support Files/YYCategories/YYCategories.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YYCategories -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYCategories" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -l"z" -framework "Accelerate" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreImage" -framework "CoreText" -framework "ImageIO" -framework "QuartzCore" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYCategories -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/YYImage/YYImage-dummy.m b/iOSProject/Pods/Target Support Files/YYImage/YYImage-dummy.m deleted file mode 100644 index 3940c89c..00000000 --- a/iOSProject/Pods/Target Support Files/YYImage/YYImage-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_YYImage : NSObject -@end -@implementation PodsDummy_YYImage -@end diff --git a/iOSProject/Pods/Target Support Files/YYImage/YYImage-prefix.pch b/iOSProject/Pods/Target Support Files/YYImage/YYImage-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/YYImage/YYImage-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/YYImage/YYImage.xcconfig b/iOSProject/Pods/Target Support Files/YYImage/YYImage.xcconfig deleted file mode 100644 index b9348541..00000000 --- a/iOSProject/Pods/Target Support Files/YYImage/YYImage.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YYImage -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -l"z" -framework "Accelerate" -framework "AssetsLibrary" -framework "CoreFoundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYImage -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/YYText/YYText-dummy.m b/iOSProject/Pods/Target Support Files/YYText/YYText-dummy.m deleted file mode 100644 index aa1afccf..00000000 --- a/iOSProject/Pods/Target Support Files/YYText/YYText-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_YYText : NSObject -@end -@implementation PodsDummy_YYText -@end diff --git a/iOSProject/Pods/Target Support Files/YYText/YYText-prefix.pch b/iOSProject/Pods/Target Support Files/YYText/YYText-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/YYText/YYText-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/YYText/YYText.xcconfig b/iOSProject/Pods/Target Support Files/YYText/YYText.xcconfig deleted file mode 100644 index 348c356a..00000000 --- a/iOSProject/Pods/Target Support Files/YYText/YYText.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YYText -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYText" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "Accelerate" -framework "CoreFoundation" -framework "CoreText" -framework "MobileCoreServices" -framework "QuartzCore" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYText -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload-dummy.m b/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload-dummy.m deleted file mode 100644 index 7a51fced..00000000 --- a/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_ZFDownload : NSObject -@end -@implementation PodsDummy_ZFDownload -@end diff --git a/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload-prefix.pch b/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload.xcconfig b/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload.xcconfig deleted file mode 100644 index ec10ba1d..00000000 --- a/iOSProject/Pods/Target Support Files/ZFDownload/ZFDownload.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ZFDownload -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/ZFDownload" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ASIHTTPRequest" "$PODS_CONFIGURATION_BUILD_DIR/Reachability" -OTHER_LDFLAGS = -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/ZFDownload -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer-dummy.m b/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer-dummy.m deleted file mode 100644 index 8414d7fd..00000000 --- a/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_ZFPlayer : NSObject -@end -@implementation PodsDummy_ZFPlayer -@end diff --git a/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer-prefix.pch b/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer.xcconfig b/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer.xcconfig deleted file mode 100644 index 2a0b44e4..00000000 --- a/iOSProject/Pods/Target Support Files/ZFPlayer/ZFPlayer.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ZFPlayer -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/ZFPlayer" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Masonry" -OTHER_LDFLAGS = -framework "MediaPlayer" -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/ZFPlayer -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView-dummy.m b/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView-dummy.m deleted file mode 100644 index 7f9c955b..00000000 --- a/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_ZJScrollPageView : NSObject -@end -@implementation PodsDummy_ZJScrollPageView -@end diff --git a/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView-prefix.pch b/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView-prefix.pch deleted file mode 100644 index beb2a244..00000000 --- a/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView.xcconfig b/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView.xcconfig deleted file mode 100644 index be369f5a..00000000 --- a/iOSProject/Pods/Target Support Files/ZJScrollPageView/ZJScrollPageView.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ZJScrollPageView -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/ZJScrollPageView" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/ASIHTTPRequest" "${PODS_ROOT}/Headers/Public/BaiduMapKit" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/DWBubbleMenuButton" "${PODS_ROOT}/Headers/Public/FCUUID" "${PODS_ROOT}/Headers/Public/FDFullscreenPopGesture" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GVUserDefaults" "${PODS_ROOT}/Headers/Public/HMEmoticon" "${PODS_ROOT}/Headers/Public/HMQRCodeScanner" "${PODS_ROOT}/Headers/Public/IQKeyboardManager" "${PODS_ROOT}/Headers/Public/KILabel" "${PODS_ROOT}/Headers/Public/LxGridView" "${PODS_ROOT}/Headers/Public/M13ProgressSuite" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/MJRefresh" "${PODS_ROOT}/Headers/Public/MOFSPickerManager" "${PODS_ROOT}/Headers/Public/MagicWindowSDK" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/Reachability" "${PODS_ROOT}/Headers/Public/SDCycleScrollView" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/TDTouchID" "${PODS_ROOT}/Headers/Public/TZImagePickerController" "${PODS_ROOT}/Headers/Public/Toast" "${PODS_ROOT}/Headers/Public/UICKeyChainStore" "${PODS_ROOT}/Headers/Public/UMengAnalytics" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WebViewJavascriptBridge" "${PODS_ROOT}/Headers/Public/WechatOpenSDK" "${PODS_ROOT}/Headers/Public/YYAsyncLayer" "${PODS_ROOT}/Headers/Public/YYCategories" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYText" "${PODS_ROOT}/Headers/Public/ZFDownload" "${PODS_ROOT}/Headers/Public/ZFPlayer" "${PODS_ROOT}/Headers/Public/ZJScrollPageView" "${PODS_ROOT}/Headers/Public/iflyMSC" -OTHER_LDFLAGS = -framework "UIKit" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/ZJScrollPageView -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/iOSProject/Pods/Toast/README.md b/iOSProject/Pods/Toast/README.md deleted file mode 100644 index c6b8e38a..00000000 --- a/iOSProject/Pods/Toast/README.md +++ /dev/null @@ -1,130 +0,0 @@ -Toast for iOS -============= - -[![Build Status](https://travis-ci.org/scalessec/Toast.svg?branch=3.0)](https://travis-ci.org/scalessec/Toast) -[![CocoaPods Version](https://img.shields.io/cocoapods/v/Toast.svg)](http://cocoadocs.org/docsets/Toast) -[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) - -Toast is an Objective-C category that adds toast notifications to the `UIView` object class. It is intended to be simple, lightweight, and easy to use. Most - toast notifications can be triggered with a single line of code. - -**Using Swift? A native swift port of this library is now available: [Toast-Swift](https://github.com/scalessec/Toast-Swift "Toast-Swift")** - -Screenshots ---------- -![Toast Screenshots](toast_screenshots.jpg) - - -Basic Examples ---------- -```objc -// basic usage -[self.view makeToast:@"This is a piece of toast."]; - -// toast with a specific duration and position -[self.view makeToast:@"This is a piece of toast with a specific duration and position." - duration:3.0 - position:CSToastPositionTop]; - -// toast with all possible options -[self.view makeToast:@"This is a piece of toast with a title & image" - duration:3.0 - position:[NSValue valueWithCGPoint:CGPointMake(110, 110)] - title:@"Toast Title" - image:[UIImage imageNamed:@"toast.png"] - style:nil - completion:^(BOOL didTap) { - if (didTap) { - NSLog(@"completion from tap"); - } else { - NSLog(@"completion without tap"); - } - }]; - -// display toast with an activity spinner -[self.view makeToastActivity:CSToastPositionCenter]; - -// display any view as toast -[self.view showToast:myView]; -``` - -But wait, there's more! ---------- -```objc -// create a new style -CSToastStyle *style = [[CSToastStyle alloc] initWithDefaultStyle]; - -// this is just one of many style options -style.messageColor = [UIColor orangeColor]; - -// present the toast with the new style -[self.view makeToast:@"This is a piece of toast." - duration:3.0 - position:CSToastPositionBottom - style:style]; - -// or perhaps you want to use this style for all toasts going forward? -// just set the shared style and there's no need to provide the style again -[CSToastManager setSharedStyle:style]; - -// toggle "tap to dismiss" functionality -[CSToastManager setTapToDismissEnabled:YES]; - -// toggle queueing behavior -[CSToastManager setQueueEnabled:YES]; - -// immediately hides all toast views in self.view -[self.view hideAllToasts]; -``` - -See the demo project for more examples. - -Setup Instructions ------------------- - -[CocoaPods](http://cocoapods.org) ------------------- - -Install with CocoaPods by adding the following to your `Podfile`: -```ruby -pod 'Toast', '~> 4.0.0' -``` - -[Carthage](https://github.com/Carthage/Carthage) ------------------- - -Install with Carthage by adding the following to your `Cartfile`: -```ogdl -github "scalessec/Toast" ~> 4.0.0 -``` -Run `carthage update` to build the framework and link against `Toast.framework`. Then, `#import `. - -Manually --------- - -1. Add `UIView+Toast.h` & `UIView+Toast.m` to your project. -2. `#import "UIView+Toast.h"` -3. Grab yourself a cold 🍺. - -MIT License ------------ - Copyright (c) 2011-2017 Charles Scalesse. - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/iOSProject/Pods/Toast/Toast-Framework/Toast.h b/iOSProject/Pods/Toast/Toast-Framework/Toast.h deleted file mode 100644 index ca673d00..00000000 --- a/iOSProject/Pods/Toast/Toast-Framework/Toast.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// Toast.h -// Toast -// -// Created by Charles Scalesse on 11/3/16. -// -// - -#import - -//! Project version number for Toast. -FOUNDATION_EXPORT double ToastVersionNumber; - -//! Project version string for Toast. -FOUNDATION_EXPORT const unsigned char ToastVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import -#import diff --git a/iOSProject/Pods/Toast/Toast/UIView+Toast.h b/iOSProject/Pods/Toast/Toast/UIView+Toast.h deleted file mode 100644 index e2b258b6..00000000 --- a/iOSProject/Pods/Toast/Toast/UIView+Toast.h +++ /dev/null @@ -1,446 +0,0 @@ -// -// UIView+Toast.h -// Toast -// -// Copyright (c) 2011-2017 Charles Scalesse. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#import - -extern const NSString * CSToastPositionTop; -extern const NSString * CSToastPositionCenter; -extern const NSString * CSToastPositionBottom; - -@class CSToastStyle; - -/** - Toast is an Objective-C category that adds toast notifications to the UIView - object class. It is intended to be simple, lightweight, and easy to use. Most - toast notifications can be triggered with a single line of code. - - The `makeToast:` methods create a new view and then display it as toast. - - The `showToast:` methods display any view as toast. - - */ -@interface UIView (Toast) - -/** - Creates and presents a new toast view with a message and displays it with the - default duration and position. Styled using the shared style. - - @param message The message to be displayed - */ -- (void)makeToast:(NSString *)message; - -/** - Creates and presents a new toast view with a message. Duration and position - can be set explicitly. Styled using the shared style. - - @param message The message to be displayed - @param duration The toast duration - @param position The toast's center point. Can be one of the predefined CSToastPosition - constants or a `CGPoint` wrapped in an `NSValue` object. - */ -- (void)makeToast:(NSString *)message - duration:(NSTimeInterval)duration - position:(id)position; - -/** - Creates and presents a new toast view with a message. Duration, position, and - style can be set explicitly. - - @param message The message to be displayed - @param duration The toast duration - @param position The toast's center point. Can be one of the predefined CSToastPosition - constants or a `CGPoint` wrapped in an `NSValue` object. - @param style The style. The shared style will be used when nil - */ -- (void)makeToast:(NSString *)message - duration:(NSTimeInterval)duration - position:(id)position - style:(CSToastStyle *)style; - -/** - Creates and presents a new toast view with a message, title, and image. Duration, - position, and style can be set explicitly. The completion block executes when the - toast view completes. `didTap` will be `YES` if the toast view was dismissed from - a tap. - - @param message The message to be displayed - @param duration The toast duration - @param position The toast's center point. Can be one of the predefined CSToastPosition - constants or a `CGPoint` wrapped in an `NSValue` object. - @param title The title - @param image The image - @param style The style. The shared style will be used when nil - @param completion The completion block, executed after the toast view disappears. - didTap will be `YES` if the toast view was dismissed from a tap. - */ -- (void)makeToast:(NSString *)message - duration:(NSTimeInterval)duration - position:(id)position - title:(NSString *)title - image:(UIImage *)image - style:(CSToastStyle *)style - completion:(void(^)(BOOL didTap))completion; - -/** - Creates a new toast view with any combination of message, title, and image. - The look and feel is configured via the style. Unlike the `makeToast:` methods, - this method does not present the toast view automatically. One of the showToast: - methods must be used to present the resulting view. - - @warning if message, title, and image are all nil, this method will return nil. - - @param message The message to be displayed - @param title The title - @param image The image - @param style The style. The shared style will be used when nil - @return The newly created toast view - */ -- (UIView *)toastViewForMessage:(NSString *)message - title:(NSString *)title - image:(UIImage *)image - style:(CSToastStyle *)style; - -/** - Hides the active toast. If there are multiple toasts active in a view, this method - hides the oldest toast (the first of the toasts to have been presented). - - @see `hideAllToasts` to remove all active toasts from a view. - - @warning This method has no effect on activity toasts. Use `hideToastActivity` to - hide activity toasts. - */ -- (void)hideToast; - -/** - Hides an active toast. - - @param toast The active toast view to dismiss. Any toast that is currently being displayed - on the screen is considered active. - - @warning this does not clear a toast view that is currently waiting in the queue. - */ -- (void)hideToast:(UIView *)toast; - -/** - Hides all active toast views and clears the queue. - */ -- (void)hideAllToasts; - -/** - Hides all active toast views, with options to hide activity and clear the queue. - - @param includeActivity If `true`, toast activity will also be hidden. Default is `false`. - @param clearQueue If `true`, removes all toast views from the queue. Default is `true`. - */ -- (void)hideAllToasts:(BOOL)includeActivity clearQueue:(BOOL)clearQueue; - -/** - Removes all toast views from the queue. This has no effect on toast views that are - active. Use `hideAllToasts` to hide the active toasts views and clear the queue. - */ -- (void)clearToastQueue; - -/** - Creates and displays a new toast activity indicator view at a specified position. - - @warning Only one toast activity indicator view can be presented per superview. Subsequent - calls to `makeToastActivity:` will be ignored until hideToastActivity is called. - - @warning `makeToastActivity:` works independently of the showToast: methods. Toast activity - views can be presented and dismissed while toast views are being displayed. `makeToastActivity:` - has no effect on the queueing behavior of the showToast: methods. - - @param position The toast's center point. Can be one of the predefined CSToastPosition - constants or a `CGPoint` wrapped in an `NSValue` object. - */ -- (void)makeToastActivity:(id)position; - -/** - Dismisses the active toast activity indicator view. - */ -- (void)hideToastActivity; - -/** - Displays any view as toast using the default duration and position. - - @param toast The view to be displayed as toast - */ -- (void)showToast:(UIView *)toast; - -/** - Displays any view as toast at a provided position and duration. The completion block - executes when the toast view completes. `didTap` will be `YES` if the toast view was - dismissed from a tap. - - @param toast The view to be displayed as toast - @param duration The notification duration - @param position The toast's center point. Can be one of the predefined CSToastPosition - constants or a `CGPoint` wrapped in an `NSValue` object. - @param completion The completion block, executed after the toast view disappears. - didTap will be `YES` if the toast view was dismissed from a tap. - */ -- (void)showToast:(UIView *)toast - duration:(NSTimeInterval)duration - position:(id)position - completion:(void(^)(BOOL didTap))completion; - -@end - -/** - `CSToastStyle` instances define the look and feel for toast views created via the - `makeToast:` methods as well for toast views created directly with - `toastViewForMessage:title:image:style:`. - - @warning `CSToastStyle` offers relatively simple styling options for the default - toast view. If you require a toast view with more complex UI, it probably makes more - sense to create your own custom UIView subclass and present it with the `showToast:` - methods. - */ -@interface CSToastStyle : NSObject - -/** - The background color. Default is `[UIColor blackColor]` at 80% opacity. - */ -@property (strong, nonatomic) UIColor *backgroundColor; - -/** - The title color. Default is `[UIColor whiteColor]`. - */ -@property (strong, nonatomic) UIColor *titleColor; - -/** - The message color. Default is `[UIColor whiteColor]`. - */ -@property (strong, nonatomic) UIColor *messageColor; - -/** - A percentage value from 0.0 to 1.0, representing the maximum width of the toast - view relative to it's superview. Default is 0.8 (80% of the superview's width). - */ -@property (assign, nonatomic) CGFloat maxWidthPercentage; - -/** - A percentage value from 0.0 to 1.0, representing the maximum height of the toast - view relative to it's superview. Default is 0.8 (80% of the superview's height). - */ -@property (assign, nonatomic) CGFloat maxHeightPercentage; - -/** - The spacing from the horizontal edge of the toast view to the content. When an image - is present, this is also used as the padding between the image and the text. - Default is 10.0. - */ -@property (assign, nonatomic) CGFloat horizontalPadding; - -/** - The spacing from the vertical edge of the toast view to the content. When a title - is present, this is also used as the padding between the title and the message. - Default is 10.0. - */ -@property (assign, nonatomic) CGFloat verticalPadding; - -/** - The corner radius. Default is 10.0. - */ -@property (assign, nonatomic) CGFloat cornerRadius; - -/** - The title font. Default is `[UIFont boldSystemFontOfSize:16.0]`. - */ -@property (strong, nonatomic) UIFont *titleFont; - -/** - The message font. Default is `[UIFont systemFontOfSize:16.0]`. - */ -@property (strong, nonatomic) UIFont *messageFont; - -/** - The title text alignment. Default is `NSTextAlignmentLeft`. - */ -@property (assign, nonatomic) NSTextAlignment titleAlignment; - -/** - The message text alignment. Default is `NSTextAlignmentLeft`. - */ -@property (assign, nonatomic) NSTextAlignment messageAlignment; - -/** - The maximum number of lines for the title. The default is 0 (no limit). - */ -@property (assign, nonatomic) NSInteger titleNumberOfLines; - -/** - The maximum number of lines for the message. The default is 0 (no limit). - */ -@property (assign, nonatomic) NSInteger messageNumberOfLines; - -/** - Enable or disable a shadow on the toast view. Default is `NO`. - */ -@property (assign, nonatomic) BOOL displayShadow; - -/** - The shadow color. Default is `[UIColor blackColor]`. - */ -@property (strong, nonatomic) UIColor *shadowColor; - -/** - A value from 0.0 to 1.0, representing the opacity of the shadow. - Default is 0.8 (80% opacity). - */ -@property (assign, nonatomic) CGFloat shadowOpacity; - -/** - The shadow radius. Default is 6.0. - */ -@property (assign, nonatomic) CGFloat shadowRadius; - -/** - The shadow offset. The default is `CGSizeMake(4.0, 4.0)`. - */ -@property (assign, nonatomic) CGSize shadowOffset; - -/** - The image size. The default is `CGSizeMake(80.0, 80.0)`. - */ -@property (assign, nonatomic) CGSize imageSize; - -/** - The size of the toast activity view when `makeToastActivity:` is called. - Default is `CGSizeMake(100.0, 100.0)`. - */ -@property (assign, nonatomic) CGSize activitySize; - -/** - The fade in/out animation duration. Default is 0.2. - */ -@property (assign, nonatomic) NSTimeInterval fadeDuration; - -/** - Creates a new instance of `CSToastStyle` with all the default values set. - */ -- (instancetype)initWithDefaultStyle NS_DESIGNATED_INITIALIZER; - -/** - @warning Only the designated initializer should be used to create - an instance of `CSToastStyle`. - */ -- (instancetype)init NS_UNAVAILABLE; - -@end - -/** - `CSToastManager` provides general configuration options for all toast - notifications. Backed by a singleton instance. - */ -@interface CSToastManager : NSObject - -/** - Sets the shared style on the singleton. The shared style is used whenever - a `makeToast:` method (or `toastViewForMessage:title:image:style:`) is called - with with a nil style. By default, this is set to `CSToastStyle`'s default - style. - - @param sharedStyle the shared style - */ -+ (void)setSharedStyle:(CSToastStyle *)sharedStyle; - -/** - Gets the shared style from the singlton. By default, this is - `CSToastStyle`'s default style. - - @return the shared style - */ -+ (CSToastStyle *)sharedStyle; - -/** - Enables or disables tap to dismiss on toast views. Default is `YES`. - - @param tapToDismissEnabled YES or NO - */ -+ (void)setTapToDismissEnabled:(BOOL)tapToDismissEnabled; - -/** - Returns `YES` if tap to dismiss is enabled, otherwise `NO`. - Default is `YES`. - - @return BOOL YES or NO - */ -+ (BOOL)isTapToDismissEnabled; - -/** - Enables or disables queueing behavior for toast views. When `YES`, - toast views will appear one after the other. When `NO`, multiple Toast - views will appear at the same time (potentially overlapping depending - on their positions). This has no effect on the toast activity view, - which operates independently of normal toast views. Default is `NO`. - - @param queueEnabled YES or NO - */ -+ (void)setQueueEnabled:(BOOL)queueEnabled; - -/** - Returns `YES` if the queue is enabled, otherwise `NO`. - Default is `NO`. - - @return BOOL - */ -+ (BOOL)isQueueEnabled; - -/** - Sets the default duration. Used for the `makeToast:` and - `showToast:` methods that don't require an explicit duration. - Default is 3.0. - - @param duration The toast duration - */ -+ (void)setDefaultDuration:(NSTimeInterval)duration; - -/** - Returns the default duration. Default is 3.0. - - @return duration The toast duration -*/ -+ (NSTimeInterval)defaultDuration; - -/** - Sets the default position. Used for the `makeToast:` and - `showToast:` methods that don't require an explicit position. - Default is `CSToastPositionBottom`. - - @param position The default center point. Can be one of the predefined - CSToastPosition constants or a `CGPoint` wrapped in an `NSValue` object. - */ -+ (void)setDefaultPosition:(id)position; - -/** - Returns the default toast position. Default is `CSToastPositionBottom`. - - @return position The default center point. Will be one of the predefined - CSToastPosition constants or a `CGPoint` wrapped in an `NSValue` object. - */ -+ (id)defaultPosition; - -@end diff --git a/iOSProject/Pods/Toast/Toast/UIView+Toast.m b/iOSProject/Pods/Toast/Toast/UIView+Toast.m deleted file mode 100644 index 4e5131a3..00000000 --- a/iOSProject/Pods/Toast/Toast/UIView+Toast.m +++ /dev/null @@ -1,586 +0,0 @@ -// -// UIView+Toast.m -// Toast -// -// Copyright (c) 2011-2017 Charles Scalesse. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -#import "UIView+Toast.h" -#import -#import - -// Positions -NSString * CSToastPositionTop = @"CSToastPositionTop"; -NSString * CSToastPositionCenter = @"CSToastPositionCenter"; -NSString * CSToastPositionBottom = @"CSToastPositionBottom"; - -// Keys for values associated with toast views -static const NSString * CSToastTimerKey = @"CSToastTimerKey"; -static const NSString * CSToastDurationKey = @"CSToastDurationKey"; -static const NSString * CSToastPositionKey = @"CSToastPositionKey"; -static const NSString * CSToastCompletionKey = @"CSToastCompletionKey"; - -// Keys for values associated with self -static const NSString * CSToastActiveKey = @"CSToastActiveKey"; -static const NSString * CSToastActivityViewKey = @"CSToastActivityViewKey"; -static const NSString * CSToastQueueKey = @"CSToastQueueKey"; - -@interface UIView (ToastPrivate) - -/** - These private methods are being prefixed with "cs_" to reduce the likelihood of non-obvious - naming conflicts with other UIView methods. - - @discussion Should the public API also use the cs_ prefix? Technically it should, but it - results in code that is less legible. The current public method names seem unlikely to cause - conflicts so I think we should favor the cleaner API for now. - */ -- (void)cs_showToast:(UIView *)toast duration:(NSTimeInterval)duration position:(id)position; -- (void)cs_hideToast:(UIView *)toast; -- (void)cs_hideToast:(UIView *)toast fromTap:(BOOL)fromTap; -- (void)cs_toastTimerDidFinish:(NSTimer *)timer; -- (void)cs_handleToastTapped:(UITapGestureRecognizer *)recognizer; -- (CGPoint)cs_centerPointForPosition:(id)position withToast:(UIView *)toast; -- (NSMutableArray *)cs_toastQueue; - -@end - -@implementation UIView (Toast) - -#pragma mark - Make Toast Methods - -- (void)makeToast:(NSString *)message { - [self makeToast:message duration:[CSToastManager defaultDuration] position:[CSToastManager defaultPosition] style:nil]; -} - -- (void)makeToast:(NSString *)message duration:(NSTimeInterval)duration position:(id)position { - [self makeToast:message duration:duration position:position style:nil]; -} - -- (void)makeToast:(NSString *)message duration:(NSTimeInterval)duration position:(id)position style:(CSToastStyle *)style { - UIView *toast = [self toastViewForMessage:message title:nil image:nil style:style]; - [self showToast:toast duration:duration position:position completion:nil]; -} - -- (void)makeToast:(NSString *)message duration:(NSTimeInterval)duration position:(id)position title:(NSString *)title image:(UIImage *)image style:(CSToastStyle *)style completion:(void(^)(BOOL didTap))completion { - UIView *toast = [self toastViewForMessage:message title:title image:image style:style]; - [self showToast:toast duration:duration position:position completion:completion]; -} - -#pragma mark - Show Toast Methods - -- (void)showToast:(UIView *)toast { - [self showToast:toast duration:[CSToastManager defaultDuration] position:[CSToastManager defaultPosition] completion:nil]; -} - -- (void)showToast:(UIView *)toast duration:(NSTimeInterval)duration position:(id)position completion:(void(^)(BOOL didTap))completion { - // sanity - if (toast == nil) return; - - // store the completion block on the toast view - objc_setAssociatedObject(toast, &CSToastCompletionKey, completion, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - - if ([CSToastManager isQueueEnabled] && [self.cs_activeToasts count] > 0) { - // we're about to queue this toast view so we need to store the duration and position as well - objc_setAssociatedObject(toast, &CSToastDurationKey, @(duration), OBJC_ASSOCIATION_RETAIN_NONATOMIC); - objc_setAssociatedObject(toast, &CSToastPositionKey, position, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - - // enqueue - [self.cs_toastQueue addObject:toast]; - } else { - // present - [self cs_showToast:toast duration:duration position:position]; - } -} - -#pragma mark - Hide Toast Methods - -- (void)hideToast { - [self hideToast:[[self cs_activeToasts] firstObject]]; -} - -- (void)hideToast:(UIView *)toast { - // sanity - if (!toast || ![[self cs_activeToasts] containsObject:toast]) return; - - [self cs_hideToast:toast]; -} - -- (void)hideAllToasts { - [self hideAllToasts:NO clearQueue:YES]; -} - -- (void)hideAllToasts:(BOOL)includeActivity clearQueue:(BOOL)clearQueue { - if (clearQueue) { - [self clearToastQueue]; - } - - for (UIView *toast in [self cs_activeToasts]) { - [self hideToast:toast]; - } - - if (includeActivity) { - [self hideToastActivity]; - } -} - -- (void)clearToastQueue { - [[self cs_toastQueue] removeAllObjects]; -} - -#pragma mark - Private Show/Hide Methods - -- (void)cs_showToast:(UIView *)toast duration:(NSTimeInterval)duration position:(id)position { - toast.center = [self cs_centerPointForPosition:position withToast:toast]; - toast.alpha = 0.0; - - if ([CSToastManager isTapToDismissEnabled]) { - UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cs_handleToastTapped:)]; - [toast addGestureRecognizer:recognizer]; - toast.userInteractionEnabled = YES; - toast.exclusiveTouch = YES; - } - - [[self cs_activeToasts] addObject:toast]; - - [self addSubview:toast]; - - [UIView animateWithDuration:[[CSToastManager sharedStyle] fadeDuration] - delay:0.0 - options:(UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionAllowUserInteraction) - animations:^{ - toast.alpha = 1.0; - } completion:^(BOOL finished) { - NSTimer *timer = [NSTimer timerWithTimeInterval:duration target:self selector:@selector(cs_toastTimerDidFinish:) userInfo:toast repeats:NO]; - [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; - objc_setAssociatedObject(toast, &CSToastTimerKey, timer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - }]; -} - -- (void)cs_hideToast:(UIView *)toast { - [self cs_hideToast:toast fromTap:NO]; -} - -- (void)cs_hideToast:(UIView *)toast fromTap:(BOOL)fromTap { - NSTimer *timer = (NSTimer *)objc_getAssociatedObject(toast, &CSToastTimerKey); - [timer invalidate]; - - [UIView animateWithDuration:[[CSToastManager sharedStyle] fadeDuration] - delay:0.0 - options:(UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionBeginFromCurrentState) - animations:^{ - toast.alpha = 0.0; - } completion:^(BOOL finished) { - [toast removeFromSuperview]; - - // remove - [[self cs_activeToasts] removeObject:toast]; - - // execute the completion block, if necessary - void (^completion)(BOOL didTap) = objc_getAssociatedObject(toast, &CSToastCompletionKey); - if (completion) { - completion(fromTap); - } - - if ([self.cs_toastQueue count] > 0) { - // dequeue - UIView *nextToast = [[self cs_toastQueue] firstObject]; - [[self cs_toastQueue] removeObjectAtIndex:0]; - - // present the next toast - NSTimeInterval duration = [objc_getAssociatedObject(nextToast, &CSToastDurationKey) doubleValue]; - id position = objc_getAssociatedObject(nextToast, &CSToastPositionKey); - [self cs_showToast:nextToast duration:duration position:position]; - } - }]; -} - -#pragma mark - View Construction - -- (UIView *)toastViewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image style:(CSToastStyle *)style { - // sanity - if (message == nil && title == nil && image == nil) return nil; - - // default to the shared style - if (style == nil) { - style = [CSToastManager sharedStyle]; - } - - // dynamically build a toast view with any combination of message, title, & image - UILabel *messageLabel = nil; - UILabel *titleLabel = nil; - UIImageView *imageView = nil; - - UIView *wrapperView = [[UIView alloc] init]; - wrapperView.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin); - wrapperView.layer.cornerRadius = style.cornerRadius; - - if (style.displayShadow) { - wrapperView.layer.shadowColor = style.shadowColor.CGColor; - wrapperView.layer.shadowOpacity = style.shadowOpacity; - wrapperView.layer.shadowRadius = style.shadowRadius; - wrapperView.layer.shadowOffset = style.shadowOffset; - } - - wrapperView.backgroundColor = style.backgroundColor; - - if(image != nil) { - imageView = [[UIImageView alloc] initWithImage:image]; - imageView.contentMode = UIViewContentModeScaleAspectFit; - imageView.frame = CGRectMake(style.horizontalPadding, style.verticalPadding, style.imageSize.width, style.imageSize.height); - } - - CGRect imageRect = CGRectZero; - - if(imageView != nil) { - imageRect.origin.x = style.horizontalPadding; - imageRect.origin.y = style.verticalPadding; - imageRect.size.width = imageView.bounds.size.width; - imageRect.size.height = imageView.bounds.size.height; - } - - if (title != nil) { - titleLabel = [[UILabel alloc] init]; - titleLabel.numberOfLines = style.titleNumberOfLines; - titleLabel.font = style.titleFont; - titleLabel.textAlignment = style.titleAlignment; - titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; - titleLabel.textColor = style.titleColor; - titleLabel.backgroundColor = [UIColor clearColor]; - titleLabel.alpha = 1.0; - titleLabel.text = title; - - // size the title label according to the length of the text - CGSize maxSizeTitle = CGSizeMake((self.bounds.size.width * style.maxWidthPercentage) - imageRect.size.width, self.bounds.size.height * style.maxHeightPercentage); - CGSize expectedSizeTitle = [titleLabel sizeThatFits:maxSizeTitle]; - // UILabel can return a size larger than the max size when the number of lines is 1 - expectedSizeTitle = CGSizeMake(MIN(maxSizeTitle.width, expectedSizeTitle.width), MIN(maxSizeTitle.height, expectedSizeTitle.height)); - titleLabel.frame = CGRectMake(0.0, 0.0, expectedSizeTitle.width, expectedSizeTitle.height); - } - - if (message != nil) { - messageLabel = [[UILabel alloc] init]; - messageLabel.numberOfLines = style.messageNumberOfLines; - messageLabel.font = style.messageFont; - messageLabel.textAlignment = style.messageAlignment; - messageLabel.lineBreakMode = NSLineBreakByTruncatingTail; - messageLabel.textColor = style.messageColor; - messageLabel.backgroundColor = [UIColor clearColor]; - messageLabel.alpha = 1.0; - messageLabel.text = message; - - CGSize maxSizeMessage = CGSizeMake((self.bounds.size.width * style.maxWidthPercentage) - imageRect.size.width, self.bounds.size.height * style.maxHeightPercentage); - CGSize expectedSizeMessage = [messageLabel sizeThatFits:maxSizeMessage]; - // UILabel can return a size larger than the max size when the number of lines is 1 - expectedSizeMessage = CGSizeMake(MIN(maxSizeMessage.width, expectedSizeMessage.width), MIN(maxSizeMessage.height, expectedSizeMessage.height)); - messageLabel.frame = CGRectMake(0.0, 0.0, expectedSizeMessage.width, expectedSizeMessage.height); - } - - CGRect titleRect = CGRectZero; - - if(titleLabel != nil) { - titleRect.origin.x = imageRect.origin.x + imageRect.size.width + style.horizontalPadding; - titleRect.origin.y = style.verticalPadding; - titleRect.size.width = titleLabel.bounds.size.width; - titleRect.size.height = titleLabel.bounds.size.height; - } - - CGRect messageRect = CGRectZero; - - if(messageLabel != nil) { - messageRect.origin.x = imageRect.origin.x + imageRect.size.width + style.horizontalPadding; - messageRect.origin.y = titleRect.origin.y + titleRect.size.height + style.verticalPadding; - messageRect.size.width = messageLabel.bounds.size.width; - messageRect.size.height = messageLabel.bounds.size.height; - } - - CGFloat longerWidth = MAX(titleRect.size.width, messageRect.size.width); - CGFloat longerX = MAX(titleRect.origin.x, messageRect.origin.x); - - // Wrapper width uses the longerWidth or the image width, whatever is larger. Same logic applies to the wrapper height. - CGFloat wrapperWidth = MAX((imageRect.size.width + (style.horizontalPadding * 2.0)), (longerX + longerWidth + style.horizontalPadding)); - CGFloat wrapperHeight = MAX((messageRect.origin.y + messageRect.size.height + style.verticalPadding), (imageRect.size.height + (style.verticalPadding * 2.0))); - - wrapperView.frame = CGRectMake(0.0, 0.0, wrapperWidth, wrapperHeight); - - if(titleLabel != nil) { - titleLabel.frame = titleRect; - [wrapperView addSubview:titleLabel]; - } - - if(messageLabel != nil) { - messageLabel.frame = messageRect; - [wrapperView addSubview:messageLabel]; - } - - if(imageView != nil) { - [wrapperView addSubview:imageView]; - } - - return wrapperView; -} - -#pragma mark - Storage - -- (NSMutableArray *)cs_activeToasts { - NSMutableArray *cs_activeToasts = objc_getAssociatedObject(self, &CSToastActiveKey); - if (cs_activeToasts == nil) { - cs_activeToasts = [[NSMutableArray alloc] init]; - objc_setAssociatedObject(self, &CSToastActiveKey, cs_activeToasts, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return cs_activeToasts; -} - -- (NSMutableArray *)cs_toastQueue { - NSMutableArray *cs_toastQueue = objc_getAssociatedObject(self, &CSToastQueueKey); - if (cs_toastQueue == nil) { - cs_toastQueue = [[NSMutableArray alloc] init]; - objc_setAssociatedObject(self, &CSToastQueueKey, cs_toastQueue, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return cs_toastQueue; -} - -#pragma mark - Events - -- (void)cs_toastTimerDidFinish:(NSTimer *)timer { - [self cs_hideToast:(UIView *)timer.userInfo]; -} - -- (void)cs_handleToastTapped:(UITapGestureRecognizer *)recognizer { - UIView *toast = recognizer.view; - NSTimer *timer = (NSTimer *)objc_getAssociatedObject(toast, &CSToastTimerKey); - [timer invalidate]; - - [self cs_hideToast:toast fromTap:YES]; -} - -#pragma mark - Activity Methods - -- (void)makeToastActivity:(id)position { - // sanity - UIView *existingActivityView = (UIView *)objc_getAssociatedObject(self, &CSToastActivityViewKey); - if (existingActivityView != nil) return; - - CSToastStyle *style = [CSToastManager sharedStyle]; - - UIView *activityView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, style.activitySize.width, style.activitySize.height)]; - activityView.center = [self cs_centerPointForPosition:position withToast:activityView]; - activityView.backgroundColor = style.backgroundColor; - activityView.alpha = 0.0; - activityView.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin); - activityView.layer.cornerRadius = style.cornerRadius; - - if (style.displayShadow) { - activityView.layer.shadowColor = style.shadowColor.CGColor; - activityView.layer.shadowOpacity = style.shadowOpacity; - activityView.layer.shadowRadius = style.shadowRadius; - activityView.layer.shadowOffset = style.shadowOffset; - } - - UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; - activityIndicatorView.center = CGPointMake(activityView.bounds.size.width / 2, activityView.bounds.size.height / 2); - [activityView addSubview:activityIndicatorView]; - [activityIndicatorView startAnimating]; - - // associate the activity view with self - objc_setAssociatedObject (self, &CSToastActivityViewKey, activityView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - - [self addSubview:activityView]; - - [UIView animateWithDuration:style.fadeDuration - delay:0.0 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - activityView.alpha = 1.0; - } completion:nil]; -} - -- (void)hideToastActivity { - UIView *existingActivityView = (UIView *)objc_getAssociatedObject(self, &CSToastActivityViewKey); - if (existingActivityView != nil) { - [UIView animateWithDuration:[[CSToastManager sharedStyle] fadeDuration] - delay:0.0 - options:(UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionBeginFromCurrentState) - animations:^{ - existingActivityView.alpha = 0.0; - } completion:^(BOOL finished) { - [existingActivityView removeFromSuperview]; - objc_setAssociatedObject (self, &CSToastActivityViewKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - }]; - } -} - -#pragma mark - Helpers - -- (CGPoint)cs_centerPointForPosition:(id)point withToast:(UIView *)toast { - CSToastStyle *style = [CSToastManager sharedStyle]; - - UIEdgeInsets safeInsets = UIEdgeInsetsZero; - if (@available(iOS 11.0, *)) { - safeInsets = self.safeAreaInsets; - } - - CGFloat topPadding = style.verticalPadding + safeInsets.top; - CGFloat bottomPadding = style.verticalPadding + safeInsets.bottom; - - if([point isKindOfClass:[NSString class]]) { - if([point caseInsensitiveCompare:CSToastPositionTop] == NSOrderedSame) { - return CGPointMake(self.bounds.size.width / 2.0, (toast.frame.size.height / 2.0) + topPadding); - } else if([point caseInsensitiveCompare:CSToastPositionCenter] == NSOrderedSame) { - return CGPointMake(self.bounds.size.width / 2.0, self.bounds.size.height / 2.0); - } - } else if ([point isKindOfClass:[NSValue class]]) { - return [point CGPointValue]; - } - - // default to bottom - return CGPointMake(self.bounds.size.width / 2.0, (self.bounds.size.height - (toast.frame.size.height / 2.0)) - bottomPadding); -} - -@end - -@implementation CSToastStyle - -#pragma mark - Constructors - -- (instancetype)initWithDefaultStyle { - self = [super init]; - if (self) { - self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.8]; - self.titleColor = [UIColor whiteColor]; - self.messageColor = [UIColor whiteColor]; - self.maxWidthPercentage = 0.8; - self.maxHeightPercentage = 0.8; - self.horizontalPadding = 10.0; - self.verticalPadding = 10.0; - self.cornerRadius = 10.0; - self.titleFont = [UIFont boldSystemFontOfSize:16.0]; - self.messageFont = [UIFont systemFontOfSize:16.0]; - self.titleAlignment = NSTextAlignmentLeft; - self.messageAlignment = NSTextAlignmentLeft; - self.titleNumberOfLines = 0; - self.messageNumberOfLines = 0; - self.displayShadow = NO; - self.shadowOpacity = 0.8; - self.shadowRadius = 6.0; - self.shadowOffset = CGSizeMake(4.0, 4.0); - self.imageSize = CGSizeMake(80.0, 80.0); - self.activitySize = CGSizeMake(100.0, 100.0); - self.fadeDuration = 0.2; - } - return self; -} - -- (void)setMaxWidthPercentage:(CGFloat)maxWidthPercentage { - _maxWidthPercentage = MAX(MIN(maxWidthPercentage, 1.0), 0.0); -} - -- (void)setMaxHeightPercentage:(CGFloat)maxHeightPercentage { - _maxHeightPercentage = MAX(MIN(maxHeightPercentage, 1.0), 0.0); -} - -- (instancetype)init NS_UNAVAILABLE { - return nil; -} - -@end - -@interface CSToastManager () - -@property (strong, nonatomic) CSToastStyle *sharedStyle; -@property (assign, nonatomic, getter=isTapToDismissEnabled) BOOL tapToDismissEnabled; -@property (assign, nonatomic, getter=isQueueEnabled) BOOL queueEnabled; -@property (assign, nonatomic) NSTimeInterval defaultDuration; -@property (strong, nonatomic) id defaultPosition; - -@end - -@implementation CSToastManager - -#pragma mark - Constructors - -+ (instancetype)sharedManager { - static CSToastManager *_sharedManager = nil; - static dispatch_once_t oncePredicate; - dispatch_once(&oncePredicate, ^{ - _sharedManager = [[self alloc] init]; - }); - - return _sharedManager; -} - -- (instancetype)init { - self = [super init]; - if (self) { - self.sharedStyle = [[CSToastStyle alloc] initWithDefaultStyle]; - self.tapToDismissEnabled = YES; - self.queueEnabled = NO; - self.defaultDuration = 3.0; - self.defaultPosition = CSToastPositionBottom; - } - return self; -} - -#pragma mark - Singleton Methods - -+ (void)setSharedStyle:(CSToastStyle *)sharedStyle { - [[self sharedManager] setSharedStyle:sharedStyle]; -} - -+ (CSToastStyle *)sharedStyle { - return [[self sharedManager] sharedStyle]; -} - -+ (void)setTapToDismissEnabled:(BOOL)tapToDismissEnabled { - [[self sharedManager] setTapToDismissEnabled:tapToDismissEnabled]; -} - -+ (BOOL)isTapToDismissEnabled { - return [[self sharedManager] isTapToDismissEnabled]; -} - -+ (void)setQueueEnabled:(BOOL)queueEnabled { - [[self sharedManager] setQueueEnabled:queueEnabled]; -} - -+ (BOOL)isQueueEnabled { - return [[self sharedManager] isQueueEnabled]; -} - -+ (void)setDefaultDuration:(NSTimeInterval)duration { - [[self sharedManager] setDefaultDuration:duration]; -} - -+ (NSTimeInterval)defaultDuration { - return [[self sharedManager] defaultDuration]; -} - -+ (void)setDefaultPosition:(id)position { - if ([position isKindOfClass:[NSString class]] || [position isKindOfClass:[NSValue class]]) { - [[self sharedManager] setDefaultPosition:position]; - } -} - -+ (id)defaultPosition { - return [[self sharedManager] defaultPosition]; -} - -@end diff --git a/iOSProject/Pods/Toast/license b/iOSProject/Pods/Toast/license deleted file mode 100644 index 824646d8..00000000 --- a/iOSProject/Pods/Toast/license +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2011-2017 Charles Scalesse. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/iOSProject/Pods/UICKeyChainStore/LICENSE b/iOSProject/Pods/UICKeyChainStore/LICENSE deleted file mode 100644 index 98b0edc5..00000000 --- a/iOSProject/Pods/UICKeyChainStore/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License - -Copyright (c) 2011 kishikawa katsumi - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/iOSProject/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.h b/iOSProject/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.h deleted file mode 100644 index b5a62809..00000000 --- a/iOSProject/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.h +++ /dev/null @@ -1,281 +0,0 @@ -// -// UICKeyChainStore.h -// UICKeyChainStore -// -// Created by Kishikawa Katsumi on 11/11/20. -// Copyright (c) 2011 Kishikawa Katsumi. All rights reserved. -// - -#import - -#if !__has_feature(nullability) -#define NS_ASSUME_NONNULL_BEGIN -#define NS_ASSUME_NONNULL_END -#define nullable -#define nonnull -#define null_unspecified -#define null_resettable -#define __nullable -#define __nonnull -#define __null_unspecified -#endif - -#if __has_extension(objc_generics) -#define UIC_KEY_TYPE -#define UIC_CREDENTIAL_TYPE *> -#else -#define UIC_KEY_TYPE -#define UIC_CREDENTIAL_TYPE -#endif - -NS_ASSUME_NONNULL_BEGIN - -extern NSString * const UICKeyChainStoreErrorDomain; - -typedef NS_ENUM(NSInteger, UICKeyChainStoreErrorCode) { - UICKeyChainStoreErrorInvalidArguments = 1, -}; - -typedef NS_ENUM(NSInteger, UICKeyChainStoreItemClass) { - UICKeyChainStoreItemClassGenericPassword = 1, - UICKeyChainStoreItemClassInternetPassword, -}; - -typedef NS_ENUM(NSInteger, UICKeyChainStoreProtocolType) { - UICKeyChainStoreProtocolTypeFTP = 1, - UICKeyChainStoreProtocolTypeFTPAccount, - UICKeyChainStoreProtocolTypeHTTP, - UICKeyChainStoreProtocolTypeIRC, - UICKeyChainStoreProtocolTypeNNTP, - UICKeyChainStoreProtocolTypePOP3, - UICKeyChainStoreProtocolTypeSMTP, - UICKeyChainStoreProtocolTypeSOCKS, - UICKeyChainStoreProtocolTypeIMAP, - UICKeyChainStoreProtocolTypeLDAP, - UICKeyChainStoreProtocolTypeAppleTalk, - UICKeyChainStoreProtocolTypeAFP, - UICKeyChainStoreProtocolTypeTelnet, - UICKeyChainStoreProtocolTypeSSH, - UICKeyChainStoreProtocolTypeFTPS, - UICKeyChainStoreProtocolTypeHTTPS, - UICKeyChainStoreProtocolTypeHTTPProxy, - UICKeyChainStoreProtocolTypeHTTPSProxy, - UICKeyChainStoreProtocolTypeFTPProxy, - UICKeyChainStoreProtocolTypeSMB, - UICKeyChainStoreProtocolTypeRTSP, - UICKeyChainStoreProtocolTypeRTSPProxy, - UICKeyChainStoreProtocolTypeDAAP, - UICKeyChainStoreProtocolTypeEPPC, - UICKeyChainStoreProtocolTypeNNTPS, - UICKeyChainStoreProtocolTypeLDAPS, - UICKeyChainStoreProtocolTypeTelnetS, - UICKeyChainStoreProtocolTypeIRCS, - UICKeyChainStoreProtocolTypePOP3S, -}; - -typedef NS_ENUM(NSInteger, UICKeyChainStoreAuthenticationType) { - UICKeyChainStoreAuthenticationTypeNTLM = 1, - UICKeyChainStoreAuthenticationTypeMSN, - UICKeyChainStoreAuthenticationTypeDPA, - UICKeyChainStoreAuthenticationTypeRPA, - UICKeyChainStoreAuthenticationTypeHTTPBasic, - UICKeyChainStoreAuthenticationTypeHTTPDigest, - UICKeyChainStoreAuthenticationTypeHTMLForm, - UICKeyChainStoreAuthenticationTypeDefault, -}; - -typedef NS_ENUM(NSInteger, UICKeyChainStoreAccessibility) { - UICKeyChainStoreAccessibilityWhenUnlocked = 1, - UICKeyChainStoreAccessibilityAfterFirstUnlock, - UICKeyChainStoreAccessibilityAlways, - UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly - __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0), - UICKeyChainStoreAccessibilityWhenUnlockedThisDeviceOnly, - UICKeyChainStoreAccessibilityAfterFirstUnlockThisDeviceOnly, - UICKeyChainStoreAccessibilityAlwaysThisDeviceOnly, -} -__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_4_0); - -typedef NS_ENUM(NSInteger, UICKeyChainStoreAuthenticationPolicy) { - UICKeyChainStoreAuthenticationPolicyUserPresence = kSecAccessControlUserPresence, -}; - -@interface UICKeyChainStore : NSObject - -@property (nonatomic, readonly) UICKeyChainStoreItemClass itemClass; - -@property (nonatomic, readonly, nullable) NSString *service; -@property (nonatomic, readonly, nullable) NSString *accessGroup; - -@property (nonatomic, readonly, nullable) NSURL *server; -@property (nonatomic, readonly) UICKeyChainStoreProtocolType protocolType; -@property (nonatomic, readonly) UICKeyChainStoreAuthenticationType authenticationType; - -@property (nonatomic) UICKeyChainStoreAccessibility accessibility; -@property (nonatomic, readonly) UICKeyChainStoreAuthenticationPolicy authenticationPolicy -__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); - -@property (nonatomic) BOOL synchronizable; - -@property (nonatomic, nullable) NSString *authenticationPrompt -__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_8_0); - -@property (nonatomic, readonly, nullable) NSArray UIC_KEY_TYPE *allKeys; -@property (nonatomic, readonly, nullable) NSArray *allItems; - -+ (NSString *)defaultService; -+ (void)setDefaultService:(NSString *)defaultService; - -+ (UICKeyChainStore *)keyChainStore; -+ (UICKeyChainStore *)keyChainStoreWithService:(nullable NSString *)service; -+ (UICKeyChainStore *)keyChainStoreWithService:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup; - -+ (UICKeyChainStore *)keyChainStoreWithServer:(NSURL *)server protocolType:(UICKeyChainStoreProtocolType)protocolType; -+ (UICKeyChainStore *)keyChainStoreWithServer:(NSURL *)server protocolType:(UICKeyChainStoreProtocolType)protocolType authenticationType:(UICKeyChainStoreAuthenticationType)authenticationType; - -- (instancetype)init; -- (instancetype)initWithService:(nullable NSString *)service; -- (instancetype)initWithService:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup; - -- (instancetype)initWithServer:(NSURL *)server protocolType:(UICKeyChainStoreProtocolType)protocolType; -- (instancetype)initWithServer:(NSURL *)server protocolType:(UICKeyChainStoreProtocolType)protocolType authenticationType:(UICKeyChainStoreAuthenticationType)authenticationType; - -+ (nullable NSString *)stringForKey:(NSString *)key; -+ (nullable NSString *)stringForKey:(NSString *)key service:(nullable NSString *)service; -+ (nullable NSString *)stringForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup; -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key; -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service; -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup; - -+ (nullable NSData *)dataForKey:(NSString *)key; -+ (nullable NSData *)dataForKey:(NSString *)key service:(nullable NSString *)service; -+ (nullable NSData *)dataForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup; -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key; -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service; -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup; - -- (BOOL)contains:(nullable NSString *)key; - -- (BOOL)setString:(nullable NSString *)string forKey:(nullable NSString *)key; -- (BOOL)setString:(nullable NSString *)string forKey:(nullable NSString *)key label:(nullable NSString *)label comment:(nullable NSString *)comment; -- (nullable NSString *)stringForKey:(NSString *)key; - -- (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key; -- (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key label:(nullable NSString *)label comment:(nullable NSString *)comment; -- (nullable NSData *)dataForKey:(NSString *)key; - -+ (BOOL)removeItemForKey:(NSString *)key; -+ (BOOL)removeItemForKey:(NSString *)key service:(nullable NSString *)service; -+ (BOOL)removeItemForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup; - -+ (BOOL)removeAllItems; -+ (BOOL)removeAllItemsForService:(nullable NSString *)service; -+ (BOOL)removeAllItemsForService:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup; - -- (BOOL)removeItemForKey:(NSString *)key; - -- (BOOL)removeAllItems; - -- (nullable NSString *)objectForKeyedSubscript:(NSString *)key; -- (void)setObject:(nullable NSString *)obj forKeyedSubscript:(NSString *)key; - -+ (nullable NSArray UIC_KEY_TYPE *)allKeysWithItemClass:(UICKeyChainStoreItemClass)itemClass; -- (nullable NSArray UIC_KEY_TYPE *)allKeys; - -+ (nullable NSArray *)allItemsWithItemClass:(UICKeyChainStoreItemClass)itemClass; -- (nullable NSArray *)allItems; - -- (void)setAccessibility:(UICKeyChainStoreAccessibility)accessibility authenticationPolicy:(UICKeyChainStoreAuthenticationPolicy)authenticationPolicy -__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); - -#if TARGET_OS_IOS -- (void)sharedPasswordWithCompletion:(nullable void (^)(NSString * __nullable account, NSString * __nullable password, NSError * __nullable error))completion; -- (void)sharedPasswordForAccount:(NSString *)account completion:(nullable void (^)(NSString * __nullable password, NSError * __nullable error))completion; - -- (void)setSharedPassword:(nullable NSString *)password forAccount:(NSString *)account completion:(nullable void (^)(NSError * __nullable error))completion; -- (void)removeSharedPasswordForAccount:(NSString *)account completion:(nullable void (^)(NSError * __nullable error))completion; - -+ (void)requestSharedWebCredentialWithCompletion:(nullable void (^)(NSArray UIC_CREDENTIAL_TYPE *credentials, NSError * __nullable error))completion; -+ (void)requestSharedWebCredentialForDomain:(nullable NSString *)domain account:(nullable NSString *)account completion:(nullable void (^)(NSArray UIC_CREDENTIAL_TYPE *credentials, NSError * __nullable error))completion; - -+ (NSString *)generatePassword; -#endif - -@end - -@interface UICKeyChainStore (ErrorHandling) - -+ (nullable NSString *)stringForKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (nullable NSString *)stringForKey:(NSString *)key service:(nullable NSString *)service error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (nullable NSString *)stringForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (nullable NSData *)dataForKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (nullable NSData *)dataForKey:(NSString *)key service:(nullable NSString *)service error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (nullable NSData *)dataForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup error:(NSError * __nullable __autoreleasing * __nullable)error; - -- (BOOL)setString:(nullable NSString *)string forKey:(NSString * )key error:(NSError * __nullable __autoreleasing * __nullable)error; -- (BOOL)setString:(nullable NSString *)string forKey:(NSString * )key label:(nullable NSString *)label comment:(nullable NSString *)comment error:(NSError * __nullable __autoreleasing * __nullable)error; - -- (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; -- (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key label:(nullable NSString *)label comment:(nullable NSString *)comment error:(NSError * __nullable __autoreleasing * __nullable)error; - -- (nullable NSString *)stringForKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; -- (nullable NSData *)dataForKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)removeItemForKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (BOOL)removeItemForKey:(NSString *)key service:(nullable NSString *)service error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (BOOL)removeItemForKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)removeAllItemsWithError:(NSError * __nullable __autoreleasing * __nullable)error; -+ (BOOL)removeAllItemsForService:(nullable NSString *)service error:(NSError * __nullable __autoreleasing * __nullable)error; -+ (BOOL)removeAllItemsForService:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup error:(NSError * __nullable __autoreleasing * __nullable)error; - -- (BOOL)removeItemForKey:(NSString *)key error:(NSError * __nullable __autoreleasing * __nullable)error; -- (BOOL)removeAllItemsWithError:(NSError * __nullable __autoreleasing * __nullable)error; - -@end - -@interface UICKeyChainStore (ForwardCompatibility) - -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key genericAttribute:(nullable id)genericAttribute; -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key genericAttribute:(nullable id)genericAttribute error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service genericAttribute:(nullable id)genericAttribute; -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service genericAttribute:(nullable id)genericAttribute error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup genericAttribute:(nullable id)genericAttribute; -+ (BOOL)setString:(nullable NSString *)value forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup genericAttribute:(nullable id)genericAttribute error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key genericAttribute:(nullable id)genericAttribute; -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key genericAttribute:(nullable id)genericAttribute error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service genericAttribute:(nullable id)genericAttribute; -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service genericAttribute:(nullable id)genericAttribute error:(NSError * __nullable __autoreleasing * __nullable)error; - -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup genericAttribute:(nullable id)genericAttribute; -+ (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key service:(nullable NSString *)service accessGroup:(nullable NSString *)accessGroup genericAttribute:(nullable id)genericAttribute error:(NSError * __nullable __autoreleasing * __nullable)error; - -- (BOOL)setString:(nullable NSString *)string forKey:(NSString *)key genericAttribute:(nullable id)genericAttribute; -- (BOOL)setString:(nullable NSString *)string forKey:(NSString *)key genericAttribute:(nullable id)genericAttribute error:(NSError * __nullable __autoreleasing * __nullable)error; - -- (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key genericAttribute:(nullable id)genericAttribute; -- (BOOL)setData:(nullable NSData *)data forKey:(NSString *)key genericAttribute:(nullable id)genericAttribute error:(NSError * __nullable __autoreleasing * __nullable)error; - -@end - -@interface UICKeyChainStore (Deprecation) - -- (void)synchronize __attribute__((deprecated("calling this method is no longer required"))); -- (BOOL)synchronizeWithError:(NSError * __nullable __autoreleasing * __nullable)error __attribute__((deprecated("calling this method is no longer required"))); - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.m b/iOSProject/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.m deleted file mode 100644 index ace499b5..00000000 --- a/iOSProject/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.m +++ /dev/null @@ -1,1392 +0,0 @@ -// -// UICKeyChainStore.m -// UICKeyChainStore -// -// Created by Kishikawa Katsumi on 11/11/20. -// Copyright (c) 2011 Kishikawa Katsumi. All rights reserved. -// - -#import "UICKeyChainStore.h" - -NSString * const UICKeyChainStoreErrorDomain = @"com.kishikawakatsumi.uickeychainstore"; -static NSString *_defaultService; - -@interface UICKeyChainStore () - -@end - -@implementation UICKeyChainStore - -+ (NSString *)defaultService -{ - if (!_defaultService) { - _defaultService = [[NSBundle mainBundle] bundleIdentifier] ?: @""; - } - - return _defaultService; -} - -+ (void)setDefaultService:(NSString *)defaultService -{ - _defaultService = defaultService; -} - -#pragma mark - - -+ (UICKeyChainStore *)keyChainStore -{ - return [[self alloc] initWithService:nil accessGroup:nil]; -} - -+ (UICKeyChainStore *)keyChainStoreWithService:(NSString *)service -{ - return [[self alloc] initWithService:service accessGroup:nil]; -} - -+ (UICKeyChainStore *)keyChainStoreWithService:(NSString *)service accessGroup:(NSString *)accessGroup -{ - return [[self alloc] initWithService:service accessGroup:accessGroup]; -} - -#pragma mark - - -+ (UICKeyChainStore *)keyChainStoreWithServer:(NSURL *)server protocolType:(UICKeyChainStoreProtocolType)protocolType -{ - return [[self alloc] initWithServer:server protocolType:protocolType authenticationType:UICKeyChainStoreAuthenticationTypeDefault]; -} - -+ (UICKeyChainStore *)keyChainStoreWithServer:(NSURL *)server protocolType:(UICKeyChainStoreProtocolType)protocolType authenticationType:(UICKeyChainStoreAuthenticationType)authenticationType -{ - return [[self alloc] initWithServer:server protocolType:protocolType authenticationType:authenticationType]; -} - -#pragma mark - - -- (instancetype)init -{ - return [self initWithService:[self.class defaultService] accessGroup:nil]; -} - -- (instancetype)initWithService:(NSString *)service -{ - return [self initWithService:service accessGroup:nil]; -} - -- (instancetype)initWithService:(NSString *)service accessGroup:(NSString *)accessGroup -{ - self = [super init]; - if (self) { - _itemClass = UICKeyChainStoreItemClassGenericPassword; - - if (!service) { - service = [self.class defaultService]; - } - _service = service.copy; - _accessGroup = accessGroup.copy; - [self commonInit]; - } - - return self; -} - -#pragma mark - - -- (instancetype)initWithServer:(NSURL *)server protocolType:(UICKeyChainStoreProtocolType)protocolType -{ - return [self initWithServer:server protocolType:protocolType authenticationType:UICKeyChainStoreAuthenticationTypeDefault]; -} - -- (instancetype)initWithServer:(NSURL *)server protocolType:(UICKeyChainStoreProtocolType)protocolType authenticationType:(UICKeyChainStoreAuthenticationType)authenticationType -{ - self = [super init]; - if (self) { - _itemClass = UICKeyChainStoreItemClassInternetPassword; - - _server = server.copy; - _protocolType = protocolType; - _authenticationType = authenticationType; - - [self commonInit]; - } - - return self; -} - -#pragma mark - - -- (void)commonInit -{ - _accessibility = UICKeyChainStoreAccessibilityAfterFirstUnlock; -} - -#pragma mark - - -+ (NSString *)stringForKey:(NSString *)key -{ - return [self stringForKey:key service:nil accessGroup:nil error:nil]; -} - -+ (NSString *)stringForKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - return [self stringForKey:key service:nil accessGroup:nil error:error]; -} - -+ (NSString *)stringForKey:(NSString *)key service:(NSString *)service -{ - return [self stringForKey:key service:service accessGroup:nil error:nil]; -} - -+ (NSString *)stringForKey:(NSString *)key service:(NSString *)service error:(NSError *__autoreleasing *)error -{ - return [self stringForKey:key service:service accessGroup:nil error:error]; -} - -+ (NSString *)stringForKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup -{ - return [self stringForKey:key service:service accessGroup:accessGroup error:nil]; -} - -+ (NSString *)stringForKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup error:(NSError *__autoreleasing *)error -{ - if (!key) { - NSError *e = [self argumentError:NSLocalizedString(@"the key must not to be nil", nil)]; - if (error) { - *error = e; - } - return nil; - } - if (!service) { - service = [self defaultService]; - } - - UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:service accessGroup:accessGroup]; - return [keychain stringForKey:key error:error]; -} - -#pragma mark - - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key -{ - return [self setString:value forKey:key service:nil accessGroup:nil genericAttribute:nil error:nil]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - return [self setString:value forKey:key service:nil accessGroup:nil genericAttribute:nil error:error]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key genericAttribute:(id)genericAttribute -{ - return [self setString:value forKey:key service:nil accessGroup:nil genericAttribute:genericAttribute error:nil]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key genericAttribute:(id)genericAttribute error:(NSError * __autoreleasing *)error -{ - return [self setString:value forKey:key service:nil accessGroup:nil genericAttribute:genericAttribute error:error]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key service:(NSString *)service -{ - return [self setString:value forKey:key service:service accessGroup:nil genericAttribute:nil error:nil]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key service:(NSString *)service error:(NSError *__autoreleasing *)error -{ - return [self setString:value forKey:key service:service accessGroup:nil genericAttribute:nil error:error]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key service:(NSString *)service genericAttribute:(id)genericAttribute -{ - return [self setString:value forKey:key service:service accessGroup:nil genericAttribute:genericAttribute error:nil]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key service:(NSString *)service genericAttribute:(id)genericAttribute error:(NSError * __autoreleasing *)error -{ - return [self setString:value forKey:key service:service accessGroup:nil genericAttribute:genericAttribute error:error]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup -{ - return [self setString:value forKey:key service:service accessGroup:accessGroup genericAttribute:nil error:nil]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup error:(NSError *__autoreleasing *)error -{ - return [self setString:value forKey:key service:service accessGroup:accessGroup genericAttribute:nil error:error]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup genericAttribute:(id)genericAttribute -{ - return [self setString:value forKey:key service:service accessGroup:accessGroup genericAttribute:genericAttribute error:nil]; -} - -+ (BOOL)setString:(NSString *)value forKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup genericAttribute:(id)genericAttribute error:(NSError * __autoreleasing *)error -{ - if (!value) { - return [self removeItemForKey:key service:service accessGroup:accessGroup error:error]; - } - NSData *data = [value dataUsingEncoding:NSUTF8StringEncoding]; - if (data) { - return [self setData:data forKey:key service:service accessGroup:accessGroup genericAttribute:genericAttribute error:error]; - } - NSError *e = [self conversionError:NSLocalizedString(@"failed to convert string to data", nil)]; - if (error) { - *error = e; - } - return NO; -} - -#pragma mark - - -+ (NSData *)dataForKey:(NSString *)key -{ - return [self dataForKey:key service:nil accessGroup:nil error:nil]; -} - -+ (NSData *)dataForKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - return [self dataForKey:key service:nil accessGroup:nil error:error]; -} - -+ (NSData *)dataForKey:(NSString *)key service:(NSString *)service -{ - return [self dataForKey:key service:service accessGroup:nil error:nil]; -} - -+ (NSData *)dataForKey:(NSString *)key service:(NSString *)service error:(NSError *__autoreleasing *)error -{ - return [self dataForKey:key service:service accessGroup:nil error:error]; -} - -+ (NSData *)dataForKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup -{ - return [self dataForKey:key service:service accessGroup:accessGroup error:nil]; -} - -+ (NSData *)dataForKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup error:(NSError *__autoreleasing *)error -{ - if (!key) { - NSError *e = [self argumentError:NSLocalizedString(@"the key must not to be nil", nil)]; - if (error) { - *error = e; - } - return nil; - } - if (!service) { - service = [self defaultService]; - } - - UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:service accessGroup:accessGroup]; - return [keychain dataForKey:key error:error]; -} - -#pragma mark - - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key -{ - return [self setData:data forKey:key service:nil accessGroup:nil genericAttribute:nil error:nil]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - return [self setData:data forKey:key service:nil accessGroup:nil genericAttribute:nil error:error]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key genericAttribute:(id)genericAttribute -{ - return [self setData:data forKey:key service:nil accessGroup:nil genericAttribute:genericAttribute error:nil]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key genericAttribute:(id)genericAttribute error:(NSError * __autoreleasing *)error -{ - return [self setData:data forKey:key service:nil accessGroup:nil genericAttribute:genericAttribute error:error]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)service -{ - return [self setData:data forKey:key service:service accessGroup:nil genericAttribute:nil error:nil]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)service error:(NSError *__autoreleasing *)error -{ - return [self setData:data forKey:key service:service accessGroup:nil genericAttribute:nil error:error]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)service genericAttribute:(id)genericAttribute -{ - return [self setData:data forKey:key service:service accessGroup:nil genericAttribute:genericAttribute error:nil]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)service genericAttribute:(id)genericAttribute error:(NSError * __autoreleasing *)error -{ - return [self setData:data forKey:key service:service accessGroup:nil genericAttribute:genericAttribute error:error]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup -{ - return [self setData:data forKey:key service:service accessGroup:accessGroup genericAttribute:nil error:nil]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup error:(NSError *__autoreleasing *)error -{ - return [self setData:data forKey:key service:service accessGroup:accessGroup genericAttribute:nil error:error]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup genericAttribute:(id)genericAttribute -{ - return [self setData:data forKey:key service:service accessGroup:accessGroup genericAttribute:genericAttribute error:nil]; -} - -+ (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup genericAttribute:(id)genericAttribute error:(NSError * __autoreleasing *)error -{ - if (!key) { - NSError *e = [self argumentError:NSLocalizedString(@"the key must not to be nil", nil)]; - if (error) { - *error = e; - } - return NO; - } - if (!service) { - service = [self defaultService]; - } - - UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:service accessGroup:accessGroup]; - return [keychain setData:data forKey:key genericAttribute:genericAttribute]; -} - -#pragma mark - - -- (BOOL)contains:(NSString *)key -{ - NSMutableDictionary *query = [self query]; - query[(__bridge __strong id)kSecAttrAccount] = key; - - OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL); - return status == errSecSuccess; -} - -#pragma mark - - -- (NSString *)stringForKey:(id)key -{ - return [self stringForKey:key error:nil]; -} - -- (NSString *)stringForKey:(id)key error:(NSError *__autoreleasing *)error -{ - NSData *data = [self dataForKey:key error:error]; - if (data) { - NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - if (string) { - return string; - } - NSError *e = [self.class conversionError:NSLocalizedString(@"failed to convert data to string", nil)]; - if (error) { - *error = e; - } - return nil; - } - - return nil; -} - -#pragma mark - - -- (BOOL)setString:(NSString *)string forKey:(NSString *)key -{ - return [self setString:string forKey:key genericAttribute:nil label:nil comment:nil error:nil]; -} - -- (BOOL)setString:(NSString *)string forKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - return [self setString:string forKey:key genericAttribute:nil label:nil comment:nil error:error]; -} - -- (BOOL)setString:(NSString *)string forKey:(NSString *)key genericAttribute:(id)genericAttribute -{ - return [self setString:string forKey:key genericAttribute:genericAttribute label:nil comment:nil error:nil]; -} - -- (BOOL)setString:(NSString *)string forKey:(NSString *)key genericAttribute:(id)genericAttribute error:(NSError * __autoreleasing *)error -{ - return [self setString:string forKey:key genericAttribute:genericAttribute label:nil comment:nil error:error]; -} - -- (BOOL)setString:(NSString *)string forKey:(NSString *)key label:(NSString *)label comment:(NSString *)comment -{ - return [self setString:string forKey:key genericAttribute:nil label:label comment:comment error:nil]; -} - -- (BOOL)setString:(NSString *)string forKey:(NSString *)key label:(NSString *)label comment:(NSString *)comment error:(NSError *__autoreleasing *)error -{ - return [self setString:string forKey:key genericAttribute:nil label:label comment:comment error:error]; -} - -- (BOOL)setString:(NSString *)string forKey:(NSString *)key genericAttribute:(id)genericAttribute label:(NSString *)label comment:(NSString *)comment error:(NSError *__autoreleasing *)error -{ - if (!string) { - return [self removeItemForKey:key error:error]; - } - NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding]; - if (data) { - return [self setData:data forKey:key genericAttribute:genericAttribute label:label comment:comment error:error]; - } - NSError *e = [self.class conversionError:NSLocalizedString(@"failed to convert string to data", nil)]; - if (error) { - *error = e; - } - return NO; -} - -#pragma mark - - -- (NSData *)dataForKey:(NSString *)key -{ - return [self dataForKey:key error:nil]; -} - -- (NSData *)dataForKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - NSMutableDictionary *query = [self query]; - query[(__bridge __strong id)kSecMatchLimit] = (__bridge id)kSecMatchLimitOne; - query[(__bridge __strong id)kSecReturnData] = (__bridge id)kCFBooleanTrue; - - query[(__bridge __strong id)kSecAttrAccount] = key; - - CFTypeRef data = nil; - OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &data); - - if (status == errSecSuccess) { - NSData *ret = [NSData dataWithData:(__bridge NSData *)data]; - if (data) { - CFRelease(data); - return ret; - } else { - NSError *e = [self.class unexpectedError:NSLocalizedString(@"Unexpected error has occurred.", nil)]; - if (error) { - *error = e; - } - return nil; - } - } else if (status == errSecItemNotFound) { - return nil; - } - - NSError *e = [self.class securityError:status]; - if (error) { - *error = e; - } - return nil; -} - -#pragma mark - - -- (BOOL)setData:(NSData *)data forKey:(NSString *)key -{ - return [self setData:data forKey:key genericAttribute:nil label:nil comment:nil error:nil]; -} - -- (BOOL)setData:(NSData *)data forKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - return [self setData:data forKey:key genericAttribute:nil label:nil comment:nil error:error]; -} - -- (BOOL)setData:(NSData *)data forKey:(NSString *)key genericAttribute:(id)genericAttribute -{ - return [self setData:data forKey:key genericAttribute:genericAttribute label:nil comment:nil error:nil]; -} - -- (BOOL)setData:(NSData *)data forKey:(NSString *)key genericAttribute:(id)genericAttribute error:(NSError * __autoreleasing *)error -{ - return [self setData:data forKey:key genericAttribute:genericAttribute label:nil comment:nil error:error]; -} - -- (BOOL)setData:(NSData *)data forKey:(NSString *)key label:(NSString *)label comment:(NSString *)comment -{ - return [self setData:data forKey:key genericAttribute:nil label:label comment:comment error:nil]; -} - -- (BOOL)setData:(NSData *)data forKey:(NSString *)key label:(NSString *)label comment:(NSString *)comment error:(NSError *__autoreleasing *)error -{ - return [self setData:data forKey:key genericAttribute:nil label:label comment:comment error:error]; -} - -- (BOOL)setData:(NSData *)data forKey:(NSString *)key genericAttribute:(id)genericAttribute label:(NSString *)label comment:(NSString *)comment error:(NSError *__autoreleasing *)error -{ - if (!key) { - NSError *e = [self.class argumentError:NSLocalizedString(@"the key must not to be nil", nil)]; - if (error) { - *error = e; - } - return NO; - } - if (!data) { - return [self removeItemForKey:key error:error]; - } - - NSMutableDictionary *query = [self query]; - query[(__bridge __strong id)kSecAttrAccount] = key; -#if TARGET_OS_IOS - if (floor(NSFoundationVersionNumber) > floor(1144.17)) { // iOS 9+ - query[(__bridge __strong id)kSecUseAuthenticationUI] = (__bridge id)kSecUseAuthenticationUIFail; -#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0 - } else if (floor(NSFoundationVersionNumber) > floor(1047.25)) { // iOS 8+ - query[(__bridge __strong id)kSecUseNoAuthenticationUI] = (__bridge id)kCFBooleanTrue; -#endif - } -#elif TARGET_OS_WATCH || TARGET_OS_TV - query[(__bridge __strong id)kSecUseAuthenticationUI] = (__bridge id)kSecUseAuthenticationUIFail; -#endif - - OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL); - if (status == errSecSuccess || status == errSecInteractionNotAllowed) { - query = [self query]; - query[(__bridge __strong id)kSecAttrAccount] = key; - - NSError *unexpectedError = nil; - NSMutableDictionary *attributes = [self attributesWithKey:nil value:data error:&unexpectedError]; - - if (genericAttribute) { - attributes[(__bridge __strong id)kSecAttrGeneric] = genericAttribute; - } - if (label) { - attributes[(__bridge __strong id)kSecAttrLabel] = label; - } - if (comment) { - attributes[(__bridge __strong id)kSecAttrComment] = comment; - } - - if (unexpectedError) { - NSLog(@"error: [%@] %@", @(unexpectedError.code), NSLocalizedString(@"Unexpected error has occurred.", nil)); - if (error) { - *error = unexpectedError; - } - return NO; - } else { - - if (status == errSecInteractionNotAllowed && floor(NSFoundationVersionNumber) <= floor(1140.11)) { // iOS 8.0.x - if ([self removeItemForKey:key error:error]) { - return [self setData:data forKey:key label:label comment:comment error:error]; - } - } else { - status = SecItemUpdate((__bridge CFDictionaryRef)query, (__bridge CFDictionaryRef)attributes); - } - if (status != errSecSuccess) { - NSError *e = [self.class securityError:status]; - if (error) { - *error = e; - } - return NO; - } - } - } else if (status == errSecItemNotFound) { - NSError *unexpectedError = nil; - NSMutableDictionary *attributes = [self attributesWithKey:key value:data error:&unexpectedError]; - - if (genericAttribute) { - attributes[(__bridge __strong id)kSecAttrGeneric] = genericAttribute; - } - if (label) { - attributes[(__bridge __strong id)kSecAttrLabel] = label; - } - if (comment) { - attributes[(__bridge __strong id)kSecAttrComment] = comment; - } - - if (unexpectedError) { - NSLog(@"error: [%@] %@", @(unexpectedError.code), NSLocalizedString(@"Unexpected error has occurred.", nil)); - if (error) { - *error = unexpectedError; - } - return NO; - } else { - status = SecItemAdd((__bridge CFDictionaryRef)attributes, NULL); - if (status != errSecSuccess) { - NSError *e = [self.class securityError:status]; - if (error) { - *error = e; - } - return NO; - } - } - } else { - NSError *e = [self.class securityError:status]; - if (error) { - *error = e; - } - return NO; - } - - return YES; -} - -#pragma mark - - -+ (BOOL)removeItemForKey:(NSString *)key -{ - return [self removeItemForKey:key service:nil accessGroup:nil error:nil]; -} - -+ (BOOL)removeItemForKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - return [self removeItemForKey:key service:nil accessGroup:nil error:error]; -} - -+ (BOOL)removeItemForKey:(NSString *)key service:(NSString *)service -{ - return [self removeItemForKey:key service:service accessGroup:nil error:nil]; -} - -+ (BOOL)removeItemForKey:(NSString *)key service:(NSString *)service error:(NSError *__autoreleasing *)error -{ - return [self removeItemForKey:key service:service accessGroup:nil error:error]; -} - -+ (BOOL)removeItemForKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup -{ - return [self removeItemForKey:key service:service accessGroup:accessGroup error:nil]; -} - -+ (BOOL)removeItemForKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup error:(NSError *__autoreleasing *)error -{ - if (!key) { - NSError *e = [self.class argumentError:NSLocalizedString(@"the key must not to be nil", nil)]; - if (error) { - *error = e; - } - return NO; - } - if (!service) { - service = [self defaultService]; - } - - UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:service accessGroup:accessGroup]; - return [keychain removeItemForKey:key error:error]; -} - -#pragma mark - - -+ (BOOL)removeAllItems -{ - return [self removeAllItemsForService:nil accessGroup:nil error:nil]; -} - -+ (BOOL)removeAllItemsWithError:(NSError *__autoreleasing *)error -{ - return [self removeAllItemsForService:nil accessGroup:nil error:error]; -} - -+ (BOOL)removeAllItemsForService:(NSString *)service -{ - return [self removeAllItemsForService:service accessGroup:nil error:nil]; -} - -+ (BOOL)removeAllItemsForService:(NSString *)service error:(NSError *__autoreleasing *)error -{ - return [self removeAllItemsForService:service accessGroup:nil error:error]; -} - -+ (BOOL)removeAllItemsForService:(NSString *)service accessGroup:(NSString *)accessGroup -{ - return [self removeAllItemsForService:service accessGroup:accessGroup error:nil]; -} - -+ (BOOL)removeAllItemsForService:(NSString *)service accessGroup:(NSString *)accessGroup error:(NSError *__autoreleasing *)error -{ - UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:service accessGroup:accessGroup]; - return [keychain removeAllItemsWithError:error]; -} - -#pragma mark - - -- (BOOL)removeItemForKey:(NSString *)key -{ - return [self removeItemForKey:key error:nil]; -} - -- (BOOL)removeItemForKey:(NSString *)key error:(NSError *__autoreleasing *)error -{ - NSMutableDictionary *query = [self query]; - query[(__bridge __strong id)kSecAttrAccount] = key; - - OSStatus status = SecItemDelete((__bridge CFDictionaryRef)query); - if (status != errSecSuccess && status != errSecItemNotFound) { - NSError *e = [self.class securityError:status]; - if (error) { - *error = e; - } - return NO; - } - - return YES; -} - -#pragma mark - - -- (BOOL)removeAllItems -{ - return [self removeAllItemsWithError:nil]; -} - -- (BOOL)removeAllItemsWithError:(NSError *__autoreleasing *)error -{ - NSMutableDictionary *query = [self query]; -#if !TARGET_OS_IPHONE - query[(__bridge id)kSecMatchLimit] = (__bridge id)kSecMatchLimitAll; -#endif - - OSStatus status = SecItemDelete((__bridge CFDictionaryRef)query); - if (status != errSecSuccess && status != errSecItemNotFound) { - NSError *e = [self.class securityError:status]; - if (error) { - *error = e; - } - return NO; - } - - return YES; -} - -#pragma mark - - -- (NSString *)objectForKeyedSubscript:(NSString *)key -{ - return [self stringForKey:key]; -} - -- (void)setObject:(NSString *)obj forKeyedSubscript:(NSString *)key -{ - if (!obj) { - [self removeItemForKey:key]; - } else { - [self setString:obj forKey:key]; - } -} - -#pragma mark - - -- (NSArray UIC_KEY_TYPE *)allKeys -{ - NSArray *items = [self.class prettify:[self itemClassObject] items:[self items]]; - NSMutableArray *keys = [[NSMutableArray alloc] init]; - for (NSDictionary *item in items) { - NSString *key = item[@"key"]; - if (key) { - [keys addObject:key]; - } - } - return keys.copy; -} - -+ (NSArray UIC_KEY_TYPE *)allKeysWithItemClass:(UICKeyChainStoreItemClass)itemClass -{ - CFTypeRef itemClassObject = kSecClassGenericPassword; - if (itemClass == UICKeyChainStoreItemClassGenericPassword) { - itemClassObject = kSecClassGenericPassword; - } else if (itemClass == UICKeyChainStoreItemClassInternetPassword) { - itemClassObject = kSecClassInternetPassword; - } - - NSMutableDictionary *query = [[NSMutableDictionary alloc] init]; - query[(__bridge __strong id)kSecClass] = (__bridge id)itemClassObject; - query[(__bridge __strong id)kSecMatchLimit] = (__bridge id)kSecMatchLimitAll; - query[(__bridge __strong id)kSecReturnAttributes] = (__bridge id)kCFBooleanTrue; - - CFArrayRef result = nil; - CFDictionaryRef cfquery = (CFDictionaryRef)CFBridgingRetain(query); - OSStatus status = SecItemCopyMatching(cfquery, (CFTypeRef *)&result); - CFRelease(cfquery); - - if (status == errSecSuccess) { - NSArray *items = [self prettify:itemClassObject items:(__bridge NSArray *)result]; - NSMutableArray *keys = [[NSMutableArray alloc] init]; - for (NSDictionary *item in items) { - if (itemClassObject == kSecClassGenericPassword) { - [keys addObject:@{@"service": item[@"service"] ?: @"", @"key": item[@"key"] ?: @""}]; - } else if (itemClassObject == kSecClassInternetPassword) { - [keys addObject:@{@"server": item[@"service"] ?: @"", @"key": item[@"key"] ?: @""}]; - } - } - return keys.copy; - } else if (status == errSecItemNotFound) { - return @[]; - } - - return nil; -} - -+ (NSArray *)allItemsWithItemClass:(UICKeyChainStoreItemClass)itemClass -{ - CFTypeRef itemClassObject = kSecClassGenericPassword; - if (itemClass == UICKeyChainStoreItemClassGenericPassword) { - itemClassObject = kSecClassGenericPassword; - } else if (itemClass == UICKeyChainStoreItemClassInternetPassword) { - itemClassObject = kSecClassInternetPassword; - } - - NSMutableDictionary *query = [[NSMutableDictionary alloc] init]; - query[(__bridge __strong id)kSecClass] = (__bridge id)itemClassObject; - query[(__bridge __strong id)kSecMatchLimit] = (__bridge id)kSecMatchLimitAll; - query[(__bridge __strong id)kSecReturnAttributes] = (__bridge id)kCFBooleanTrue; -#if TARGET_OS_IPHONE - query[(__bridge __strong id)kSecReturnData] = (__bridge id)kCFBooleanTrue; -#endif - - CFArrayRef result = nil; - CFDictionaryRef cfquery = (CFDictionaryRef)CFBridgingRetain(query); - OSStatus status = SecItemCopyMatching(cfquery, (CFTypeRef *)&result); - CFRelease(cfquery); - - if (status == errSecSuccess) { - return [self prettify:itemClassObject items:(__bridge NSArray *)result]; - } else if (status == errSecItemNotFound) { - return @[]; - } - - return nil; -} - -- (NSArray *)allItems -{ - return [self.class prettify:[self itemClassObject] items:[self items]]; -} - -- (NSArray *)items -{ - NSMutableDictionary *query = [self query]; - query[(__bridge __strong id)kSecMatchLimit] = (__bridge id)kSecMatchLimitAll; - query[(__bridge __strong id)kSecReturnAttributes] = (__bridge id)kCFBooleanTrue; -#if TARGET_OS_IPHONE - query[(__bridge __strong id)kSecReturnData] = (__bridge id)kCFBooleanTrue; -#endif - - CFArrayRef result = nil; - OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query,(CFTypeRef *)&result); - - if (status == errSecSuccess) { - return CFBridgingRelease(result); - } else if (status == errSecItemNotFound) { - return @[]; - } - - return nil; -} - -+ (NSArray *)prettify:(CFTypeRef)itemClass items:(NSArray *)items -{ - NSMutableArray *prettified = [[NSMutableArray alloc] init]; - - for (NSDictionary *attributes in items) { - NSMutableDictionary *item = [[NSMutableDictionary alloc] init]; - if (itemClass == kSecClassGenericPassword) { - item[@"class"] = @"GenericPassword"; - id service = attributes[(__bridge id)kSecAttrService]; - if (service) { - item[@"service"] = service; - } - id accessGroup = attributes[(__bridge id)kSecAttrAccessGroup]; - if (accessGroup) { - item[@"accessGroup"] = accessGroup; - } - } else if (itemClass == kSecClassInternetPassword) { - item[@"class"] = @"InternetPassword"; - id server = attributes[(__bridge id)kSecAttrServer]; - if (server) { - item[@"server"] = server; - } - id protocolType = attributes[(__bridge id)kSecAttrProtocol]; - if (protocolType) { - item[@"protocol"] = protocolType; - } - id authenticationType = attributes[(__bridge id)kSecAttrAuthenticationType]; - if (authenticationType) { - item[@"authenticationType"] = authenticationType; - } - } - id key = attributes[(__bridge id)kSecAttrAccount]; - if (key) { - item[@"key"] = key; - } - NSData *data = attributes[(__bridge id)kSecValueData]; - NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - if (string) { - item[@"value"] = string; - } else { - item[@"value"] = data; - } - - id accessible = attributes[(__bridge id)kSecAttrAccessible]; - if (accessible) { - item[@"accessibility"] = accessible; - } - - if (floor(NSFoundationVersionNumber) > floor(993.00)) { // iOS 7+ - id synchronizable = attributes[(__bridge id)kSecAttrSynchronizable]; - if (synchronizable) { - item[@"synchronizable"] = synchronizable; - } - } - - [prettified addObject:item]; - } - - return prettified.copy; -} - -#pragma mark - - -- (void)setSynchronizable:(BOOL)synchronizable -{ - _synchronizable = synchronizable; - if (_authenticationPolicy) { - NSLog(@"%@", @"Cannot specify both an authenticationPolicy and a synchronizable"); - } -} - -- (void)setAccessibility:(UICKeyChainStoreAccessibility)accessibility authenticationPolicy:(UICKeyChainStoreAuthenticationPolicy)authenticationPolicy -{ - _accessibility = accessibility; - _authenticationPolicy = authenticationPolicy; - if (_synchronizable) { - NSLog(@"%@", @"Cannot specify both an authenticationPolicy and a synchronizable"); - } -} - -#pragma mark - - -#if TARGET_OS_IOS -- (void)sharedPasswordWithCompletion:(void (^)(NSString *account, NSString *password, NSError *error))completion -{ - NSString *domain = self.server.host; - if (domain.length > 0) { - [self.class requestSharedWebCredentialForDomain:domain account:nil completion:^(NSArray *credentials, NSError *error) { - NSDictionary *credential = credentials.firstObject; - if (credential) { - NSString *account = credential[@"account"]; - NSString *password = credential[@"password"]; - if (completion) { - completion(account, password, error); - } - } else { - if (completion) { - completion(nil, nil, error); - } - } - }]; - } else { - NSError *error = [self.class argumentError:NSLocalizedString(@"the server property must not to be nil, should use 'keyChainStoreWithServer:protocolType:' initializer to instantiate keychain store", nil)]; - if (completion) { - completion(nil, nil, error); - } - } -} - -- (void)sharedPasswordForAccount:(NSString *)account completion:(void (^)(NSString *password, NSError *error))completion -{ - NSString *domain = self.server.host; - if (domain.length > 0) { - [self.class requestSharedWebCredentialForDomain:domain account:account completion:^(NSArray *credentials, NSError *error) { - NSDictionary *credential = credentials.firstObject; - if (credential) { - NSString *password = credential[@"password"]; - if (completion) { - completion(password, error); - } - } else { - if (completion) { - completion(nil, error); - } - } - }]; - } else { - NSError *error = [self.class argumentError:NSLocalizedString(@"the server property must not to be nil, should use 'keyChainStoreWithServer:protocolType:' initializer to instantiate keychain store", nil)]; - if (completion) { - completion(nil, error); - } - } -} - -- (void)setSharedPassword:(NSString *)password forAccount:(NSString *)account completion:(void (^)(NSError *error))completion -{ - NSString *domain = self.server.host; - if (domain.length > 0) { - SecAddSharedWebCredential((__bridge CFStringRef)domain, (__bridge CFStringRef)account, (__bridge CFStringRef)password, ^(CFErrorRef error) { - if (completion) { - completion((__bridge NSError *)error); - } - }); - } else { - NSError *error = [self.class argumentError:NSLocalizedString(@"the server property must not to be nil, should use 'keyChainStoreWithServer:protocolType:' initializer to instantiate keychain store", nil)]; - if (completion) { - completion(error); - } - } -} - -- (void)removeSharedPasswordForAccount:(NSString *)account completion:(void (^)(NSError *error))completion -{ - [self setSharedPassword:nil forAccount:account completion:completion]; -} - -+ (void)requestSharedWebCredentialWithCompletion:(void (^)(NSArray UIC_CREDENTIAL_TYPE *credentials, NSError *error))completion -{ - [self requestSharedWebCredentialForDomain:nil account:nil completion:completion]; -} - -+ (void)requestSharedWebCredentialForDomain:(NSString *)domain account:(NSString *)account completion:(void (^)(NSArray UIC_CREDENTIAL_TYPE *credentials, NSError *error))completion -{ - SecRequestSharedWebCredential((__bridge CFStringRef)domain, (__bridge CFStringRef)account, ^(CFArrayRef credentials, CFErrorRef error) { - if (error) { - NSError *e = (__bridge NSError *)error; - if (e.code != errSecItemNotFound) { - NSLog(@"error: [%@] %@", @(e.code), e.localizedDescription); - } - } - - NSMutableArray *sharedCredentials = [[NSMutableArray alloc] init]; - for (NSDictionary *credential in (__bridge NSArray *)credentials) { - NSMutableDictionary *sharedCredential = [[NSMutableDictionary alloc] init]; - NSString *server = credential[(__bridge __strong id)kSecAttrServer]; - if (server) { - sharedCredential[@"server"] = server; - } - NSString *account = credential[(__bridge __strong id)kSecAttrAccount]; - if (account) { - sharedCredential[@"account"] = account; - } - NSString *password = credential[(__bridge __strong id)kSecSharedPassword]; - if (password) { - sharedCredential[@"password"] = password; - } - [sharedCredentials addObject:sharedCredential]; - } - - if (completion) { - completion(sharedCredentials.copy, (__bridge NSError *)error); - } - }); -} - -+ (NSString *)generatePassword -{ - return (NSString *)CFBridgingRelease(SecCreateSharedWebCredentialPassword()); -} - -#endif - -#pragma mark - - -- (NSString *)description -{ - NSArray *items = [self allItems]; - if (items.count == 0) { - return @"()"; - } - NSMutableString *description = [[NSMutableString alloc] initWithString:@"(\n"]; - for (NSDictionary *item in items) { - [description appendFormat:@" %@", item]; - } - [description appendString:@")"]; - return description.copy; -} - -- (NSString *)debugDescription -{ - return [NSString stringWithFormat:@"%@", [self items]]; -} - -#pragma mark - - -- (NSMutableDictionary *)query -{ - NSMutableDictionary *query = [[NSMutableDictionary alloc] init]; - - CFTypeRef itemClass = [self itemClassObject]; - query[(__bridge __strong id)kSecClass] =(__bridge id)itemClass; - if (floor(NSFoundationVersionNumber) > floor(993.00)) { // iOS 7+ (NSFoundationVersionNumber_iOS_6_1) - query[(__bridge __strong id)kSecAttrSynchronizable] = (__bridge id)kSecAttrSynchronizableAny; - } - - if (itemClass == kSecClassGenericPassword) { - query[(__bridge __strong id)(kSecAttrService)] = _service; -#if !TARGET_OS_SIMULATOR - if (_accessGroup) { - query[(__bridge __strong id)kSecAttrAccessGroup] = _accessGroup; - } -#endif - } else { - if (_server.host) { - query[(__bridge __strong id)kSecAttrServer] = _server.host; - } - if (_server.port) { - query[(__bridge __strong id)kSecAttrPort] = _server.port; - } - CFTypeRef protocolTypeObject = [self protocolTypeObject]; - if (protocolTypeObject) { - query[(__bridge __strong id)kSecAttrProtocol] = (__bridge id)protocolTypeObject; - } - CFTypeRef authenticationTypeObject = [self authenticationTypeObject]; - if (authenticationTypeObject) { - query[(__bridge __strong id)kSecAttrAuthenticationType] = (__bridge id)authenticationTypeObject; - } - } - -#if TARGET_OS_IOS - if (_authenticationPrompt) { - if (floor(NSFoundationVersionNumber) > floor(1047.25)) { // iOS 8+ (NSFoundationVersionNumber_iOS_7_1) - query[(__bridge __strong id)kSecUseOperationPrompt] = _authenticationPrompt; - } else { - NSLog(@"%@", @"Unavailable 'authenticationPrompt' attribute on iOS versions prior to 8.0."); - } - } -#endif - - return query; -} - -- (NSMutableDictionary *)attributesWithKey:(NSString *)key value:(NSData *)value error:(NSError *__autoreleasing *)error -{ - NSMutableDictionary *attributes; - - if (key) { - attributes = [self query]; - attributes[(__bridge __strong id)kSecAttrAccount] = key; - } else { - attributes = [[NSMutableDictionary alloc] init]; - } - - attributes[(__bridge __strong id)kSecValueData] = value; - -#if TARGET_OS_IOS - double iOS_7_1_or_10_9_2 = 1047.25; // NSFoundationVersionNumber_iOS_7_1 -#else - double iOS_7_1_or_10_9_2 = 1056.13; // NSFoundationVersionNumber10_9_2 -#endif - CFTypeRef accessibilityObject = [self accessibilityObject]; - if (_authenticationPolicy && accessibilityObject) { - if (floor(NSFoundationVersionNumber) > floor(iOS_7_1_or_10_9_2)) { // iOS 8+ or OS X 10.10+ - CFErrorRef securityError = NULL; - SecAccessControlRef accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault, accessibilityObject, (SecAccessControlCreateFlags)_authenticationPolicy, &securityError); - if (securityError) { - NSError *e = (__bridge NSError *)securityError; - NSLog(@"error: [%@] %@", @(e.code), e.localizedDescription); - if (error) { - *error = e; - CFRelease(accessControl); - return nil; - } - } - if (!accessControl) { - NSString *message = NSLocalizedString(@"Unexpected error has occurred.", nil); - NSError *e = [self.class unexpectedError:message]; - if (error) { - *error = e; - } - return nil; - } - attributes[(__bridge __strong id)kSecAttrAccessControl] = (__bridge_transfer id)accessControl; - } else { -#if TARGET_OS_IOS - NSLog(@"%@", @"Unavailable 'Touch ID integration' on iOS versions prior to 8.0."); -#else - NSLog(@"%@", @"Unavailable 'Touch ID integration' on OS X versions prior to 10.10."); -#endif - } - } else { - if (floor(NSFoundationVersionNumber) <= floor(iOS_7_1_or_10_9_2) && _accessibility == UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly) { -#if TARGET_OS_IOS - NSLog(@"%@", @"Unavailable 'UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly' attribute on iOS versions prior to 8.0."); -#else - NSLog(@"%@", @"Unavailable 'UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly' attribute on OS X versions prior to 10.10."); -#endif - } else { - if (accessibilityObject) { - attributes[(__bridge __strong id)kSecAttrAccessible] = (__bridge id)accessibilityObject; - } - } - } - - if (floor(NSFoundationVersionNumber) > floor(993.00)) { // iOS 7+ - attributes[(__bridge __strong id)kSecAttrSynchronizable] = @(_synchronizable); - } - - return attributes; -} - -#pragma mark - - -- (CFTypeRef)itemClassObject -{ - switch (_itemClass) { - case UICKeyChainStoreItemClassGenericPassword: - return kSecClassGenericPassword; - case UICKeyChainStoreItemClassInternetPassword: - return kSecClassInternetPassword; - default: - return nil; - } -} - -- (CFTypeRef)protocolTypeObject -{ - switch (_protocolType) { - case UICKeyChainStoreProtocolTypeFTP: - return kSecAttrProtocolFTP; - case UICKeyChainStoreProtocolTypeFTPAccount: - return kSecAttrProtocolFTPAccount; - case UICKeyChainStoreProtocolTypeHTTP: - return kSecAttrProtocolHTTP; - case UICKeyChainStoreProtocolTypeIRC: - return kSecAttrProtocolIRC; - case UICKeyChainStoreProtocolTypeNNTP: - return kSecAttrProtocolNNTP; - case UICKeyChainStoreProtocolTypePOP3: - return kSecAttrProtocolPOP3; - case UICKeyChainStoreProtocolTypeSMTP: - return kSecAttrProtocolSMTP; - case UICKeyChainStoreProtocolTypeSOCKS: - return kSecAttrProtocolSOCKS; - case UICKeyChainStoreProtocolTypeIMAP: - return kSecAttrProtocolIMAP; - case UICKeyChainStoreProtocolTypeLDAP: - return kSecAttrProtocolLDAP; - case UICKeyChainStoreProtocolTypeAppleTalk: - return kSecAttrProtocolAppleTalk; - case UICKeyChainStoreProtocolTypeAFP: - return kSecAttrProtocolAFP; - case UICKeyChainStoreProtocolTypeTelnet: - return kSecAttrProtocolTelnet; - case UICKeyChainStoreProtocolTypeSSH: - return kSecAttrProtocolSSH; - case UICKeyChainStoreProtocolTypeFTPS: - return kSecAttrProtocolFTPS; - case UICKeyChainStoreProtocolTypeHTTPS: - return kSecAttrProtocolHTTPS; - case UICKeyChainStoreProtocolTypeHTTPProxy: - return kSecAttrProtocolHTTPProxy; - case UICKeyChainStoreProtocolTypeHTTPSProxy: - return kSecAttrProtocolHTTPSProxy; - case UICKeyChainStoreProtocolTypeFTPProxy: - return kSecAttrProtocolFTPProxy; - case UICKeyChainStoreProtocolTypeSMB: - return kSecAttrProtocolSMB; - case UICKeyChainStoreProtocolTypeRTSP: - return kSecAttrProtocolRTSP; - case UICKeyChainStoreProtocolTypeRTSPProxy: - return kSecAttrProtocolRTSPProxy; - case UICKeyChainStoreProtocolTypeDAAP: - return kSecAttrProtocolDAAP; - case UICKeyChainStoreProtocolTypeEPPC: - return kSecAttrProtocolEPPC; - case UICKeyChainStoreProtocolTypeNNTPS: - return kSecAttrProtocolNNTPS; - case UICKeyChainStoreProtocolTypeLDAPS: - return kSecAttrProtocolLDAPS; - case UICKeyChainStoreProtocolTypeTelnetS: - return kSecAttrProtocolTelnetS; - case UICKeyChainStoreProtocolTypeIRCS: - return kSecAttrProtocolIRCS; - case UICKeyChainStoreProtocolTypePOP3S: - return kSecAttrProtocolPOP3S; - default: - return nil; - } -} - -- (CFTypeRef)authenticationTypeObject -{ - switch (_authenticationType) { - case UICKeyChainStoreAuthenticationTypeNTLM: - return kSecAttrAuthenticationTypeNTLM; - case UICKeyChainStoreAuthenticationTypeMSN: - return kSecAttrAuthenticationTypeMSN; - case UICKeyChainStoreAuthenticationTypeDPA: - return kSecAttrAuthenticationTypeDPA; - case UICKeyChainStoreAuthenticationTypeRPA: - return kSecAttrAuthenticationTypeRPA; - case UICKeyChainStoreAuthenticationTypeHTTPBasic: - return kSecAttrAuthenticationTypeHTTPBasic; - case UICKeyChainStoreAuthenticationTypeHTTPDigest: - return kSecAttrAuthenticationTypeHTTPDigest; - case UICKeyChainStoreAuthenticationTypeHTMLForm: - return kSecAttrAuthenticationTypeHTMLForm; - case UICKeyChainStoreAuthenticationTypeDefault: - return kSecAttrAuthenticationTypeDefault; - default: - return nil; - } -} - -- (CFTypeRef)accessibilityObject -{ - switch (_accessibility) { - case UICKeyChainStoreAccessibilityWhenUnlocked: - return kSecAttrAccessibleWhenUnlocked; - case UICKeyChainStoreAccessibilityAfterFirstUnlock: - return kSecAttrAccessibleAfterFirstUnlock; - case UICKeyChainStoreAccessibilityAlways: - return kSecAttrAccessibleAlways; - case UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly: - return kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly; - case UICKeyChainStoreAccessibilityWhenUnlockedThisDeviceOnly: - return kSecAttrAccessibleWhenUnlockedThisDeviceOnly; - case UICKeyChainStoreAccessibilityAfterFirstUnlockThisDeviceOnly: - return kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly; - case UICKeyChainStoreAccessibilityAlwaysThisDeviceOnly: - return kSecAttrAccessibleAlwaysThisDeviceOnly; - default: - return nil; - } -} - -+ (NSError *)argumentError:(NSString *)message -{ - NSError *error = [NSError errorWithDomain:UICKeyChainStoreErrorDomain code:UICKeyChainStoreErrorInvalidArguments userInfo:@{NSLocalizedDescriptionKey: message}]; - NSLog(@"error: [%@] %@", @(error.code), error.localizedDescription); - return error; -} - -+ (NSError *)conversionError:(NSString *)message -{ - NSError *error = [NSError errorWithDomain:UICKeyChainStoreErrorDomain code:-67594 userInfo:@{NSLocalizedDescriptionKey: message}]; - NSLog(@"error: [%@] %@", @(error.code), error.localizedDescription); - return error; -} - -+ (NSError *)securityError:(OSStatus)status -{ - NSString *message = @"Security error has occurred."; -#if TARGET_OS_MAC && !TARGET_OS_IPHONE - CFStringRef description = SecCopyErrorMessageString(status, NULL); - if (description) { - message = (__bridge_transfer NSString *)description; - } -#endif - NSError *error = [NSError errorWithDomain:UICKeyChainStoreErrorDomain code:status userInfo:@{NSLocalizedDescriptionKey: message}]; - NSLog(@"OSStatus error: [%@] %@", @(error.code), error.localizedDescription); - return error; -} - -+ (NSError *)unexpectedError:(NSString *)message -{ - NSError *error = [NSError errorWithDomain:UICKeyChainStoreErrorDomain code:-99999 userInfo:@{NSLocalizedDescriptionKey: message}]; - NSLog(@"error: [%@] %@", @(error.code), error.localizedDescription); - return error; -} - -@end - -@implementation UICKeyChainStore (Deprecation) - -- (void)synchronize -{ - // Deprecated, calling this method is no longer required -} - -- (BOOL)synchronizeWithError:(NSError *__autoreleasing *)error -{ - // Deprecated, calling this method is no longer required - return true; -} - -@end diff --git a/iOSProject/Pods/UICKeyChainStore/README.md b/iOSProject/Pods/UICKeyChainStore/README.md deleted file mode 100644 index 77bca098..00000000 --- a/iOSProject/Pods/UICKeyChainStore/README.md +++ /dev/null @@ -1,559 +0,0 @@ -# UICKeyChainStore -[![CI Status](http://img.shields.io/travis/kishikawakatsumi/UICKeyChainStore.svg?style=flat)](https://travis-ci.org/kishikawakatsumi/UICKeyChainStore) -[![Coverage Status](https://img.shields.io/coveralls/kishikawakatsumi/UICKeyChainStore.svg?style=flat)](https://coveralls.io/r/kishikawakatsumi/UICKeyChainStore?branch=master) -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Version](https://img.shields.io/cocoapods/v/UICKeyChainStore.svg?style=flat)](http://cocoadocs.org/docsets/UICKeyChainStore) -[![License](https://img.shields.io/cocoapods/l/UICKeyChainStore.svg?style=flat)](http://cocoadocs.org/docsets/UICKeyChainStore) -[![Platform](https://img.shields.io/cocoapods/p/UICKeyChainStore.svg?style=flat)](http://cocoadocs.org/docsets/UICKeyChainStore) - -UICKeyChainStore is a simple wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs as easy as NSUserDefaults. - -## Looking for the library written in Swift? - -Try [KeychainAccess](https://github.com/kishikawakatsumi/KeychainAccess). -[KeychainAccess](https://github.com/kishikawakatsumi/KeychainAccess) is next generation of UICKeyChainStore. - -## Transitioning from 1.x to 2.0 - -**`synchronize` method is deprecated. Calling this method is no longer required (Just ignored).** - -## Features - -- Simple interface -- Support access group -- [Support accessibility](#accessibility) -- [Support iCloud sharing](#icloud_sharing) -- **[Support TouchID and Keychain integration (iOS 8+)](#touch_id_integration)** -- **[Support Shared Web Credentials (iOS 8+)](#shared_web_credentials)** -- Works on both iOS & OS X -- Supported watchOS 2 - -## Usage - -### Basics - -#### Saving Application Password - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; -keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef"; -``` - -#### Saving Internet Password - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com/"] - protocolType:UICKeyChainStoreProtocolTypeHTTPS]; -keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef"; -``` - -### Instantiation - -#### Create Keychain for Application Password - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; -``` - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"kishikawakatsumi.git" - accessGroup:@"12ABCD3E4F.shared"]; -``` - -#### Create Keychain for Internet Password - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com/"] - protocolType:UICKeyChainStoreProtocolTypeHTTPS]; -``` - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com/"] - protocolType:UICKeyChainStoreProtocolTypeHTTPS - authenticationType:UICKeyChainStoreAuthenticationTypeHTMLForm]; -``` - -### Adding an item - -#### subscripting - -```objective-c -keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef" -``` - -#### set method - -```objective-c -[keychain setString:@"01234567-89ab-cdef-0123-456789abcdef" forKey:@"kishikawakatsumi"]; -``` - -#### error handling - -```objective-c -if (![keychain setString:@"01234567-89ab-cdef-0123-456789abcdef" forKey:@"kishikawakatsumi"]) { - // error has occurred -} -``` - -```objective-c -NSError *error; -[keychain setString:@"01234567-89ab-cdef-0123-456789abcdef" forKey:@"kishikawakatsumi" error:&error]; -if (error) { - NSLog(@"%@", error.localizedDescription); -} -``` - -### Obtaining an item - -#### subscripting (automatically converts to string) - -```objective-c -NSString *token = keychain[@"kishikawakatsumi"] -``` - -#### get methods - -##### as String - -```objective-c -NSString *token = [keychain stringForKey:@"kishikawakatsumi"]; -``` - -##### as NSData - -```objective-c -NSData *data = [keychain dataForKey:@"kishikawakatsumi"]; -``` - -#### error handling - -**First, get the `failable` (value or error) object** - -```objective-c -NSError *error; -NSString *token = [keychain stringForKey:@"" error:&error]; -if (error) { - NSLog(@"%@", error.localizedDescription); -} -``` - -### Removing an item - -#### subscripting - -```objective-c -keychain[@"kishikawakatsumi"] = nil -``` - -#### remove method - -```objective-c -[keychain removeItemForKey:@"kishikawakatsumi"]; -``` - -#### error handling - -```objective-c -if (![keychain removeItemForKey:@"kishikawakatsumi"]) { - // error has occurred -} -``` - -```objective-c -NSError *error; -[keychain removeItemForKey:@"kishikawakatsumi" error:&error]; -if (error) { - NSLog(@"%@", error.localizedDescription); -} -``` - -### Label and Comment - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com/"] - protocolType:UICKeyChainStoreProtocolTypeHTTPS]; -[keychain setString:@"01234567-89ab-cdef-0123-456789abcdef" - forKey:@"kishikawakatsumi" - label:@"github.com (kishikawakatsumi)" - comment:@"github access token"]; -``` - -### Configuration (Accessibility, Sharing, iCould Sync) - -#### Accessibility - -##### Default accessibility matches background application (=kSecAttrAccessibleAfterFirstUnlock) - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; -``` - -##### For background application - -###### Creating instance - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; -keychain.accessibility = UICKeyChainStoreAccessibilityAfterFirstUnlock; - -keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef" -``` - -##### For foreground application - -###### Creating instance - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; -keychain.accessibility = UICKeyChainStoreAccessibilityWhenUnlocked; - -keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef" -``` - -#### Sharing Keychain items - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"kishikawakatsumi.git" - accessGroup:@"12ABCD3E4F.shared"]; -``` - -#### Synchronizing Keychain items with iCloud - -###### Creating instance - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; -keychain.synchronizable = YES; - -keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef" -``` - -### Touch ID integration - -**Any Operation that require authentication must be run in the background thread.** -**If you run in the main thread, UI thread will lock for the system to try to display the authentication dialog.** - -#### Adding a Touch ID protected item - -If you want to store the Touch ID protected Keychain item, specify `accessibility` and `authenticationPolicy` attributes. - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; - -dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ - [keychain setAccessibility:UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly - authenticationPolicy:UICKeyChainStoreAuthenticationPolicyUserPresence]; - - keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef" -}); -``` - -#### Updating a Touch ID protected item - -The same way as when adding. - -**Do not run in the main thread if there is a possibility that the item you are trying to add already exists, and protected.** -**Because updating protected items requires authentication.** - -Additionally, you want to show custom authentication prompt message when updating, specify an `authenticationPrompt` attribute. -If the item not protected, the `authenticationPrompt` parameter just be ignored. - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; - -dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ - [keychain setAccessibility:UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly - authenticationPolicy:UICKeyChainStoreAuthenticationPolicyUserPresence]; - keychain.authenticationPrompt = @"Authenticate to update your access token"; - - keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef" -}); -``` - -#### Obtaining a Touch ID protected item - -The same way as when you get a normal item. It will be displayed automatically Touch ID or passcode authentication If the item you try to get is protected. -If you want to show custom authentication prompt message, specify an `authenticationPrompt` attribute. -If the item not protected, the `authenticationPrompt` parameter just be ignored. - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; - -dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ - [keychain setAccessibility:UICKeyChainStoreAccessibilityWhenPasscodeSetThisDeviceOnly - authenticationPolicy:UICKeyChainStoreAuthenticationPolicyUserPresence]; - keychain.authenticationPrompt = @"Authenticate to update your access token"; - - NSString *token = keychain[@"kishikawakatsumi"]; -}); -``` - -#### Removing a Touch ID protected item - -The same way as when you remove a normal item. -There is no way to show Touch ID or passcode authentication when removing Keychain items. - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"com.example.github-token"]; - -keychain[@"kishikawakatsumi"] = nil; -``` - -### Shared Web Credentials - -> Shared web credentials is a programming interface that enables native iOS apps to share credentials with their website counterparts. For example, a user may log in to a website in Safari, entering a user name and password, and save those credentials using the iCloud Keychain. Later, the user may run a native app from the same developer, and instead of the app requiring the user to reenter a user name and password, shared web credentials gives it access to the credentials that were entered earlier in Safari. The user can also create new accounts, update passwords, or delete her account from within the app. These changes are then saved and used by Safari. - - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://kishikawakatsumi.com/"] -protocolType:UICKeyChainStoreProtocolTypeHTTPS]; -NSString *username = @"kishikawakatsumi@mac.com"; -NSString *password = keychain[username]; -if (password) { - // If found password in the Keychain, - // then log into the server -} else { - // If not found password in the Keychain, - // try to read from Shared Web Credentials - [keychain sharedPasswordForAccount:username completion:^(NSString *password, NSError *error) { - if (password) { - // If found password in the Shared Web Credentials, - // then log into the server - // and save the password to the Keychain - - keychain[username] = password - } else { - // If not found password either in the Keychain also Shared Web Credentials, - // prompt for username and password - - // Log into server - - // If the login is successful, - // save the credentials to both the Keychain and the Shared Web Credentials. - - keychain[username] = password - [keychain setSharedPassword:password forAccount:username completion:nil]; - } - }]; -} -``` - -#### Request all associated domain's credentials - -```objective-c -[UICKeyChainStore requestSharedWebCredentialWithCompletion:^(NSArray *credentials, NSError *error) { - -}]; -``` - -#### Generate strong random password - -Generate strong random password that is in the same format used by Safari autofill (xxx-xxx-xxx-xxx). - -```objective-c -NSString *password = [UICKeyChainStore generatePassword]; -NSLog(@"%@", password); // => Nhu-GKm-s3n-pMx -``` - -#### How to set up Shared Web Credentials - -> 1. Add a com.apple.developer.associated-domains entitlement to your app. This entitlement must include all the domains with which you want to share credentials. - -> 2. Add an apple-app-site-association file to your website. This file must include application identifiers for all the apps with which the site wants to share credentials, and it must be properly signed. - -> 3. When the app is installed, the system downloads and verifies the site association file for each of its associated domains. If the verification is successful, the app is associated with the domain. - -**More details:** - - -### Debugging - -#### Display all stored items if print keychain object - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com/"] - protocolType:UICKeyChainStoreProtocolTypeHTTPS]; -NSLog(@"%@", keychain); -``` - -``` -=> -( -{ - accessibility = ak; - authenticationType = dflt; - class = InternetPassword; - key = kishikawakatsumi; - protocol = htps; - server = "github.com"; - synchronizable = 0; - value = "01234567-89ab-cdef-0123-456789abcdef"; -} { - accessibility = ck; - authenticationType = dflt; - class = InternetPassword; - key = hirohamada; - protocol = htps; - server = "github.com"; - synchronizable = 1; - value = "11111111-89ab-cdef-1111-456789abcdef"; -} { - accessibility = ak; - authenticationType = dflt; - class = InternetPassword; - key = honeylemon; - protocol = htps; - server = "github.com"; - synchronizable = 0; - value = "22222222-89ab-cdef-2222-456789abcdef"; -}) -``` - -#### Obtaining all stored keys - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com/"] - protocolType:UICKeyChainStoreProtocolTypeHTTPS]; - -NSArray *keys = keychain.allKeys; -for (NSString *key in keys) { - NSLog(@"key: %@", key); -} -``` - -``` -=> -key: kishikawakatsumi -key: hirohamada -key: honeylemon -``` - -#### Obtaining all stored items - -```objective-c -UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithServer:[NSURL URLWithString:@"https://github.com/"] - protocolType:UICKeyChainStoreProtocolTypeHTTPS]; - -NSArray *items = keychain.allItems; -for (NSString *item in items) { - NSLog(@"item: %@", item); -} -``` - -``` -=> - -item: { - accessibility = ak; - authenticationType = dflt; - class = InternetPassword; - key = kishikawakatsumi; - protocol = htps; - server = "github.com"; - synchronizable = 0; - value = "01234567-89ab-cdef-0123-456789abcdef"; -} -item: { - accessibility = ck; - authenticationType = dflt; - class = InternetPassword; - key = hirohamada; - protocol = htps; - server = "github.com"; - synchronizable = 1; - value = "11111111-89ab-cdef-1111-456789abcdef"; -} -item: { - accessibility = ak; - authenticationType = dflt; - class = InternetPassword; - key = honeylemon; - protocol = htps; - server = "github.com"; - synchronizable = 0; - value = "22222222-89ab-cdef-2222-456789abcdef"; -} -``` - -### Convenient class methods - -Add items using default service name (=bundle identifer). - -```objective-c -[UICKeyChainStore setString:@"01234567-89ab-cdef-0123-456789abcdef" forKey:@"kishikawakatsumi"]; -``` - -Or specify the service name. - -```objective-c -[UICKeyChainStore setString:@"01234567-89ab-cdef-0123-456789abcdef" - forKey:@"kishikawakatsumi" - service:@"com.example.github-token"]; -``` - ---- -Remove items. - -```objective-c -[UICKeyChainStore removeItemForKey:@"kishikawakatsumi" service:@"com.example.github-token"]; -``` - -To set nil value also works remove item for the key. - -```objective-c -[UICKeyChainStore setString:nil forKey:@"kishikawakatsumi" service:@"com.example.github-token"]; -``` - -## Requirements - -iOS 4.3 or later -OS X 10.7 or later - -## Installation - -### CocoaPods - -UICKeyChainStore is available through [CocoaPods](http://cocoapods.org). To install -it, simply add the following line to your Podfile: - -`pod 'UICKeyChainStore'` - -##### For watchOS 2 - -```ruby -use_frameworks! - -target 'EampleApp' do - pod 'UICKeyChainStore' -end - -target 'EampleApp WatchKit Extension' do - platform :watchos, '2.0' - pod 'UICKeyChainStore' -end -``` - -### Carthage - -UICKeyChainStore is available through [Carthage](https://github.com/Carthage/Carthage). To install -it, simply add the following line to your Cartfile: - -`github "kishikawakatsumi/UICKeyChainStore"` - -### To manually add to your project - -1. Add `Security.framework` to your target. -2. Copy files in Lib (`UICKeyChainStore.h` and `UICKeyChainStore.m`) to your project. - -## Author - -kishikawa katsumi, kishikawakatsumi@mac.com - -## License - -[Apache]: http://www.apache.org/licenses/LICENSE-2.0 -[MIT]: http://www.opensource.org/licenses/mit-license.php -[GPL]: http://www.gnu.org/licenses/gpl.html -[BSD]: http://opensource.org/licenses/bsd-license.php - -UICKeyChainStore is available under the [MIT license][MIT]. See the LICENSE file for more info. diff --git a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Headers b/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Headers deleted file mode 120000 index a177d2a6..00000000 --- a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/UMMobClick b/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/UMMobClick deleted file mode 120000 index 4f563f01..00000000 --- a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/UMMobClick +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/UMMobClick \ No newline at end of file diff --git a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClick.h b/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClick.h deleted file mode 100644 index c5997c46..00000000 --- a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClick.h +++ /dev/null @@ -1,281 +0,0 @@ -// -// MobClick.h -// Analytics -// -// Copyright (C) 2010-2016 Umeng.com . All rights reserved. - -#import -#import - -#define XcodeAppVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] -typedef void(^CallbackBlock)(); - -/** - REALTIME只在“集成测试”设备的DEBUG模式下有效,其它情况下的REALTIME会改为使用BATCH策略。 - */ -typedef enum { - REALTIME = 0, //实时发送 (只在“集成测试”设备的DEBUG模式下有效) - BATCH = 1, //启动发送 - SEND_INTERVAL = 6, //最小间隔发送 ([90-86400]s, default 90s) - SMART_POLICY = 8, -} ReportPolicy; - -/** - 统计的场景类别,默认为普通统计;若使用游戏统计API,则需选择游戏场景类别,如E_UM_GAME。 - */ -typedef NS_ENUM (NSUInteger, eScenarioType) -{ - E_UM_NORMAL = 0, // default value - E_UM_GAME = 1, // game -}; - -/** @brief 统计SDK的配置实例,具体参照该类成员的参数定义 - * 示例代码: UMConfigInstance.appKey = @"xxxxxxxxxxxxxx..."; - * UMConfigInstance.token = @"yyyyyyyy...."; - * [MobClick startWithConfigure:UMConfigInstance]; - */ -#define UMConfigInstance [UMAnalyticsConfig sharedInstance] -@interface UMAnalyticsConfig : NSObject -/** required: appkey string */ -@property(nonatomic, copy) NSString *appKey; -/** optional: default: nil*/ -@property(nonatomic, copy) NSString *secret; -/** optional: default: "App Store"*/ -@property(nonatomic, copy) NSString *channelId; -/** optional: default: YES */ -@property(nonatomic) BOOL bCrashReportEnabled; -/** optional: default: BATCH */ -@property(nonatomic) ReportPolicy ePolicy; -/** optional: default: E_UM_NORMAL */ -@property(nonatomic) eScenarioType eSType; - -+ (instancetype)sharedInstance; -@end - -@class CLLocation; -@interface MobClick : NSObject - -#pragma mark basics -///--------------------------------------------------------------------------------------- -/// @name 初始化统计 -///--------------------------------------------------------------------------------------- - -/** 初始化友盟统计模块 - @param UMAnalyticsConfig 实例类,具体参照该类成员的参数定义 - @return void - */ -+ (void) startWithConfigure:(UMAnalyticsConfig *)configure; - -///--------------------------------------------------------------------------------------- -/// @name 设置 -///--------------------------------------------------------------------------------------- - -/** 设置app版本号。由于历史原因需要和xcode3工程兼容,友盟提取的是Build号(CFBundleVersion), - 如果需要和App Store上的版本一致,请调用此方法。 - @param appVersion 版本号,例如设置成`XcodeAppVersion`. - @return void. -*/ -+ (void)setAppVersion:(NSString *)appVersion; - -/** 开启CrashReport收集, 默认YES(开启状态). - @param value 设置为NO,可关闭友盟CrashReport收集功能. - @return void. -*/ -+ (void)setCrashReportEnabled:(BOOL)value; - -/** 设置是否打印sdk的log信息, 默认NO(不打印log). - @param value 设置为YES,umeng SDK 会输出log信息可供调试参考. 除非特殊需要,否则发布产品时需改回NO. - @return void. - */ -+ (void)setLogEnabled:(BOOL)value; - -/** 设置是否对日志信息进行加密, 默认NO(不加密). - @param value 设置为YES, umeng SDK 会将日志信息做加密处理 - @return void. - */ -+ (void)setEncryptEnabled:(BOOL)value; - -/** 当reportPolicy == SEND_INTERVAL 时设定log发送间隔 - @param second 单位为秒,最小90秒,最大86400秒(24hour). - @return void. -*/ -+ (void)setLogSendInterval:(double)second; - - - -#pragma mark event logs -///--------------------------------------------------------------------------------------- -/// @name 页面计时 -///--------------------------------------------------------------------------------------- - -/** 手动页面时长统计, 记录某个页面展示的时长. - @param pageName 统计的页面名称. - @param seconds 单位为秒,int型. - @return void. - */ -+ (void)logPageView:(NSString *)pageName seconds:(int)seconds; - -/** 自动页面时长统计, 开始记录某个页面展示时长. - 使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。 - 在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView: - @param pageName 统计的页面名称. - @return void. - */ -+ (void)beginLogPageView:(NSString *)pageName; - -/** 自动页面时长统计, 结束记录某个页面展示时长. - 使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。 - 在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView: - @param pageName 统计的页面名称. - @return void. - */ -+ (void)endLogPageView:(NSString *)pageName; - - -///--------------------------------------------------------------------------------------- -/// @name 事件统计 -///--------------------------------------------------------------------------------------- -/** 结构化事件 - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID。 - - @param keyPath 字符串数组代表的结构化事件路径,其长度最大为8,不能使用unicode 48以内的字符,keyPath[0]必须在网站注册事件ID. - @param value 事件的数值 - @param (optional) label 标签 - @return void. - */ -+ (void)event:(NSArray *)keyPath value:(int)value label:(NSString *)label; - -/** 自定义事件,数量统计. -使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID - - @param eventId 网站上注册的事件Id. - @param label 分类标签。不同的标签会分别进行统计,方便同一事件的不同标签的对比,为nil或空字符串时后台会生成和eventId同名的标签. - @param accumulation 累加值。为减少网络交互,可以自行对某一事件ID的某一分类标签进行累加,再传入次数作为参数。 - @return void. - */ -+ (void)event:(NSString *)eventId; //等同于 event:eventId label:eventId; -/** 自定义事件,数量统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID - */ -+ (void)event:(NSString *)eventId label:(NSString *)label; // label为nil或@""时,等同于 event:eventId label:eventId; - -/** 自定义事件,数量统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID - */ -+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes; - -+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes counter:(int)number; - -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - beginEvent,endEvent要配对使用,也可以自己计时后通过durations参数传递进来 - - @param eventId 网站上注册的事件Id. - @param label 分类标签。不同的标签会分别进行统计,方便同一事件的不同标签的对比,为nil或空字符串时后台会生成和eventId同名的标签. - @param primarykey 这个参数用于和event_id一起标示一个唯一事件,并不会被统计;对于同一个事件在beginEvent和endEvent 中要传递相同的eventId 和 primarykey - @param millisecond 自己计时需要的话需要传毫秒进来 - @return void. - - @warning 每个event的attributes不能超过10个 - eventId、attributes中key和value都不能使用空格和特殊字符,必须是NSString,且长度不能超过255个字符(否则将截取前255个字符) - id, ts, du是保留字段,不能作为eventId及key的名称 -*/ -+ (void)beginEvent:(NSString *)eventId; - -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - */ - -+ (void)endEvent:(NSString *)eventId; -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - */ - -+ (void)beginEvent:(NSString *)eventId label:(NSString *)label; -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - */ - -+ (void)endEvent:(NSString *)eventId label:(NSString *)label; -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - */ - -+ (void)beginEvent:(NSString *)eventId primarykey :(NSString *)keyName attributes:(NSDictionary *)attributes; -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - */ - -+ (void)endEvent:(NSString *)eventId primarykey:(NSString *)keyName; -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - */ - -+ (void)event:(NSString *)eventId durations:(int)millisecond; -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - */ - -+ (void)event:(NSString *)eventId label:(NSString *)label durations:(int)millisecond; -/** 自定义事件,时长统计. - 使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID. - */ -+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes durations:(int)millisecond; - - -#pragma mark - user methods -/** active user sign-in. - 使用sign-In函数后,如果结束该PUID的统计,需要调用sign-Off函数 - @param puid : user's ID - @param provider : 不能以下划线"_"开头,使用大写字母和数字标识; 如果是上市公司,建议使用股票代码。 - @return void. - */ -+ (void)profileSignInWithPUID:(NSString *)puid; -+ (void)profileSignInWithPUID:(NSString *)puid provider:(NSString *)provider; - -/** active user sign-off. - 停止sign-in PUID的统计 - @return void. - */ -+ (void)profileSignOff; - -///--------------------------------------------------------------------------------------- -/// @name 地理位置设置 -/// 需要链接 CoreLocation.framework 并且 #import -///--------------------------------------------------------------------------------------- - -/** 设置经纬度信息 - @param latitude 纬度. - @param longitude 经度. - @return void - */ -+ (void)setLatitude:(double)latitude longitude:(double)longitude; - -/** 设置经纬度信息 - @param location CLLocation 经纬度信息 - @return void - */ -+ (void)setLocation:(CLLocation *)location; - -///--------------------------------------------------------------------------------------- -/// @name Utility函数 -///--------------------------------------------------------------------------------------- - -/** 判断设备是否越狱,依据是否存在apt和Cydia.app - */ -+ (BOOL)isJailbroken; - -/** 判断App是否被破解 - */ -+ (BOOL)isPirated; - -#pragma mark DEPRECATED -/** 友盟模块启动 - [MobClick startWithConfigure:]通常在application:didFinishLaunchingWithOptions:里被调用监听App启动和退出事件, - 如果开发者无法在此处添加友盟的[MobClick startWithConfigure:]方法,App的启动事件可能会无法监听,此时需要手动调用[MobClick startSession:nil]来启动友盟的session。 - 上述情况通常发生在某些第三方框架生成的app里,普通app不用关注该API. - */ -+ (void)startSession:(NSNotification *)notification; - -+ (void)setCrashCBBlock:(CallbackBlock)cbBlock; -@end diff --git a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClickGameAnalytics.h b/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClickGameAnalytics.h deleted file mode 100644 index f8b9fa10..00000000 --- a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClickGameAnalytics.h +++ /dev/null @@ -1,184 +0,0 @@ -// -// MobClickGameAnalytics.h -// Analytics -// -// Copyright (C) 2010-2014 Umeng.com . All rights reserved. - -@interface MobClickGameAnalytics : NSObject - -#pragma mark - account function -/** active user sign-in. - 使用sign-In函数后,如果结束该PUID的统计,需要调用sign-Off函数 - @param puid : user's ID - @param provider : 不能以下划线"_"开头,使用大写字母和数字标识; 如果是上市公司,建议使用股票代码。 - @return void. - */ -+ (void)profileSignInWithPUID:(NSString *)puid; -+ (void)profileSignInWithPUID:(NSString *)puid provider:(NSString *)provider; - -/** active user sign-off. - 停止sign-in PUID的统计 - @return void. - */ -+ (void)profileSignOff; - -#pragma mark GameLevel methods -///--------------------------------------------------------------------------------------- -/// @name set game level -///--------------------------------------------------------------------------------------- - -/** 设置玩家的等级. - */ - -/** 设置玩家等级属性. - @param level 玩家等级 - @return void - */ -+ (void)setUserLevelId:(int)level; - -///--------------------------------------------------------------------------------------- -/// @name 关卡统计 -///--------------------------------------------------------------------------------------- - -/** 记录玩家进入关卡,通过关卡及失败的情况. - */ - - -/** 进入关卡. - @param level 关卡 - @return void - */ -+ (void)startLevel:(NSString *)level; - -/** 通过关卡. - @param level 关卡,如果level == nil 则为当前关卡 - @return void - */ -+ (void)finishLevel:(NSString *)level; - -/** 未通过关卡. - @param level 关卡,如果level == nil 则为当前关卡 - @return void - */ - -+ (void)failLevel:(NSString *)level; - - -#pragma mark - -#pragma mark Pay methods - -///--------------------------------------------------------------------------------------- -/// @name 支付统计 -///--------------------------------------------------------------------------------------- - -/** 记录玩家交易兑换货币的情况 - @param currencyAmount 现金或等价物总额 - @param currencyType 为ISO4217定义的3位字母代码,如CNY,USD等(如使用其它自定义等价物作为现金,可使用ISO4217中未定义的3位字母组合传入货币类型) - @param virtualAmount 虚拟币数量 - @param channel 支付渠道 - @param orderId 交易订单ID - @return void - */ -+ (void)exchange:(NSString *)orderId currencyAmount:(double)currencyAmount currencyType:(NSString *)currencyType virtualCurrencyAmount:(double)virtualAmount paychannel:(int)channel; - -/** 玩家支付货币兑换虚拟币. - @param cash 真实货币数量 - @param source 支付渠道 - @param coin 虚拟币数量 - @return void - */ - -+ (void)pay:(double)cash source:(int)source coin:(double)coin; - -/** 玩家支付货币购买道具. - @param cash 真实货币数量 - @param source 支付渠道 - @param item 道具名称 - @param amount 道具数量 - @param price 道具单价 - @return void - */ -+ (void)pay:(double)cash source:(int)source item:(NSString *)item amount:(int)amount price:(double)price; - - -#pragma mark - -#pragma mark Buy methods - -///--------------------------------------------------------------------------------------- -/// @name 虚拟币购买统计 -///--------------------------------------------------------------------------------------- - -/** 记录玩家使用虚拟币的消费情况 - */ - - -/** 玩家使用虚拟币购买道具 -@param item 道具名称 -@param amount 道具数量 -@param price 道具单价 -@return void - */ -+ (void)buy:(NSString *)item amount:(int)amount price:(double)price; - - -#pragma mark - -#pragma mark Use methods - - -///--------------------------------------------------------------------------------------- -/// @name 道具消耗统计 -///--------------------------------------------------------------------------------------- - -/** 记录玩家道具消费情况 - */ - - -/** 玩家使用虚拟币购买道具 -@param item 道具名称 -@param amount 道具数量 -@param price 道具单价 -@return void - */ - -+ (void)use:(NSString *)item amount:(int)amount price:(double)price; - - -#pragma mark - -#pragma mark Bonus methods - - -///--------------------------------------------------------------------------------------- -/// @name 虚拟币及道具奖励统计 -///--------------------------------------------------------------------------------------- - -/** 记录玩家获赠虚拟币及道具的情况 - */ - - -/** 玩家获虚拟币奖励 -@param coin 虚拟币数量 -@param source 奖励方式 -@return void - */ - -+ (void)bonus:(double)coin source:(int)source; - -/** 玩家获道具奖励 -@param item 道具名称 -@param amount 道具数量 -@param price 道具单价 -@param source 奖励方式 -@return void - */ - -+ (void)bonus:(NSString *)item amount:(int)amount price:(double)price source:(int)source; - -#pragma mark DEPRECATED - -//已经被新的setUserLevelId:方法替代,请使用新的API。 -+ (void)setUserLevel:(NSString *)level; - -//已经被新的active user方法替代,请使用新的API。 -+ (void)setUserID:(NSString *)userId sex:(int)sex age:(int)age platform:(NSString *)platform; - -@end diff --git a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClickSocialAnalytics.h b/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClickSocialAnalytics.h deleted file mode 100644 index 6743c1c9..00000000 --- a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/Headers/MobClickSocialAnalytics.h +++ /dev/null @@ -1,112 +0,0 @@ -// -// MobClickSocialAnalytics.h -// SocialSDK -// -// Created by yeahugo on 13-3-4. -// Copyright (c) 2013年 Umeng. All rights reserved. -// - -#import - -typedef NSString * MobClickSocialTypeString; - -extern MobClickSocialTypeString const MobClickSocialTypeSina; //新浪微博 -extern MobClickSocialTypeString const MobClickSocialTypeTencent; //腾讯微博 -extern MobClickSocialTypeString const MobClickSocialTypeRenren; //人人网 -extern MobClickSocialTypeString const MobClickSocialTypeQzone; //Qzone -extern MobClickSocialTypeString const MobClickSocialTypeRenren; //人人网 -extern MobClickSocialTypeString const MobClickSocialTypeDouban; //douban -extern MobClickSocialTypeString const MobClickSocialTypeWxsesion; //微信好友分享 -extern MobClickSocialTypeString const MobClickSocialTypeWxtimeline; //微信朋友圈 -extern MobClickSocialTypeString const MobClickSocialTypeHuaban; //花瓣 -extern MobClickSocialTypeString const MobClickSocialTypeKaixin; //开心 -extern MobClickSocialTypeString const MobClickSocialTypeFacebook; //facebook -extern MobClickSocialTypeString const MobClickSocialTypeTwitter; //twitter -extern MobClickSocialTypeString const MobClickSocialTypeInstagram; //instagram -extern MobClickSocialTypeString const MobClickSocialTypeFlickr; //flickr -extern MobClickSocialTypeString const MobClickSocialTypeQQ; //qq -extern MobClickSocialTypeString const MobClickSocialTypeWxfavorite; //微信收藏 -extern MobClickSocialTypeString const MobClickSocialTypeLwsession; //来往 -extern MobClickSocialTypeString const MobClickSocialTypeLwtimeline; //来往动态 -extern MobClickSocialTypeString const MobClickSocialTypeYxsession; //易信 -extern MobClickSocialTypeString const MobClickSocialTypeYxtimeline; //易信朋友圈 - - -/** - 微博类,发送微博之后在回调方法初始化此对象 - - */ -@interface MobClickSocialWeibo : NSObject - - -/** - 微博平台类型,使用上面定义的几种常量字符串 - */ -@property (nonatomic, copy) NSString *platformType; - -/** - 微博id - */ -@property (nonatomic, copy) NSString *weiboId; - -/** - 用户在微博平台的id - */ -@property (nonatomic, copy) NSString *userId; - -/** - 微博平台的自定义字段,例如定义{‘gender’:0,’name’:’xxx’} - */ -@property (nonatomic, strong) NSDictionary *param; - - -/** - 初始化方法,在发送微博结束的回调方法使用此初始化方法 - - @param platformType 微博平台类型 - @param weiboId 微博id,可以设置为nil - @param userId 用户id - @param param 微博平台自定义字段,可以设置为nil - - @return 微博对象 - */ --(id)initWithPlatformType:(MobClickSocialTypeString)platformType weiboId:(NSString *)weiboId usid:(NSString *)usid param:(NSDictionary *)param; - -@end - -/** - 发送统计完成的block对象 - */ -typedef void (^MobClickSocialAnalyticsCompletion)(NSDictionary * response, NSError *error); - - -/** -负责统计微博类。 -分享微博完成之后需要先构造`MobClickSocialWeibo`组成微博数组,然后再用类方法发送微博数组 - -``` -+(void)postWeiboCounts:(NSArray *)weibos appKey:(NSString *)appKey topic:(NSString *)topic completion:(MobClickSocialAnalyticsCompletion)completion; -``` - -例如 - - - MobClickSocialWeibo *tencentWeibo = [[MobClickSocialWeibo alloc] initWithPlatformType:UMSocialTypeTencent weiboId:nil userId:@"tencent123" param:@{@"gender":@"1"}]; - [MobClickSocialAnalytics postWeibos:@[tencentWeibo] appKey:@"507fcab25270157b37000010" topic:@"test" completion:^(NSDictionary *result, NSError *error) { - NSLog(@"result is %@", result); - }]; - - */ - -@interface MobClickSocialAnalytics : NSObject -/** - 发送统计微博 - - @param weibos UMSocialWeibo对象组成的数组 - @param appKey 友盟appkey - @param topic 话题,可选,可以设置为nil - @parma completion 发送完成的事件处理block - - */ -+(void)postWeiboCounts:(NSArray *)weibos appKey:(NSString *)appKey topic:(NSString *)topic completion:(MobClickSocialAnalyticsCompletion)completion; -@end diff --git a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/UMMobClick b/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/UMMobClick deleted file mode 100644 index 4fcee6ce..00000000 Binary files a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/A/UMMobClick and /dev/null differ diff --git a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/Current b/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/Current deleted file mode 120000 index 8c7e5a66..00000000 --- a/iOSProject/Pods/UMengAnalytics/umsdk_IOS_analyics_idfa_v4.2.4/UMMobClick.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/QQApiInterface.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/QQApiInterface.h deleted file mode 100644 index 7354c81a..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/QQApiInterface.h +++ /dev/null @@ -1,134 +0,0 @@ -/// -/// \file QQApiInterface.h -/// \brief QQApi接口简化封装 -/// -/// Created by Tencent on 12-5-15. -/// Copyright (c) 2012年 Tencent. All rights reserved. -/// - -#import -#import "QQApiInterfaceObject.h" - -/** - \brief 处理来至QQ的请求及响应的回调协议 - */ -@protocol QQApiInterfaceDelegate - -/** - 处理来至QQ的请求 - */ -- (void)onReq:(QQBaseReq *)req; - -/** - 处理来至QQ的响应 - */ -- (void)onResp:(QQBaseResp *)resp; - -/** - 处理QQ在线状态的回调 - */ -- (void)isOnlineResponse:(NSDictionary *)response; - -@end - -/** - \brief 对QQApi的简单封装类 - */ -@interface QQApiInterface : NSObject - -/** - 处理由手Q唤起的跳转请求 - \param url 待处理的url跳转请求 - \param delegate 第三方应用用于处理来至QQ请求及响应的委托对象 - \return 跳转请求处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败 - */ -+ (BOOL)handleOpenURL:(NSURL *)url delegate:(id)delegate; - -/** - 向手Q发起分享请求 - \param req 分享内容的请求 - \return 请求发送结果码 - */ -+ (QQApiSendResultCode)sendReq:(QQBaseReq *)req; - -/** - 向手Q QZone结合版发起分享请求 - \note H5分享只支持单张网络图片的传递 - \param req 分享内容的请求 - \return 请求发送结果码 - */ -+ (QQApiSendResultCode)SendReqToQZone:(QQBaseReq *)req; - -/** - 向手Q 群部落发起分享请求 - \note H5分享只支持单张网络图片的传递 - \param req 分享内容的请求 - \return 请求发送结果码 - */ -+ (QQApiSendResultCode)SendReqToQQGroupTribe:(QQBaseReq *)req; - -/** - 向手Q发送应答消息 - \param resp 应答消息 - \return 应答发送结果码 - */ -+ (QQApiSendResultCode)sendResp:(QQBaseResp *)resp; - -/** - 检测是否已安装QQ - \return 如果QQ已安装则返回YES,否则返回NO - */ -+ (BOOL)isQQInstalled; - -/** - 检测是否已安装TIM - \return 如果TIM已安装则返回YES,否则返回NO - */ -+ (BOOL)isTIMInstalled; - -/** - 批量检测QQ号码是否在线 - */ -+ (void)getQQUinOnlineStatues:(NSArray *)QQUins delegate:(id)delegate; - -/** - 检测QQ是否支持API调用 - \return 如果当前安装QQ版本支持API调用则返回YES,否则返回NO - */ -+ (BOOL)isQQSupportApi; - -/** - 检测TIM是否支持API调用 - \return 如果当前安装TIM版本支持API调用则返回YES,否则返回NO - */ -+ (BOOL)isTIMSupportApi; - -/** - 启动QQ - \return 成功返回YES,否则返回NO - */ -+ (BOOL)openQQ; - -/** - 启动TIM - \return 成功返回YES,否则返回NO - */ -+ (BOOL)openTIM; - -/** - 获取QQ下载地址 - - 如果App通过QQApiInterface#isQQInstalledQQApiInterface#isQQSupportApi检测发现QQ没安装或当前版本QQ不支持API调用,可引导用户通过打开此链接下载最新版QQ。 - \return iPhoneQQ下载地址 - */ -+ (NSString *)getQQInstallUrl; - -/** - 获取TIM下载地址 - - 如果App通过QQApiInterface#isTIMInstalledQQApiInterface#isTIMSupportApi检测发现TIM没安装或当前版本TIM不支持API调用,可引导用户通过打开此链接下载最新版TIM。 - \return iPhoneTIM下载地址 - */ -+ (NSString *)getTIMInstallUrl; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/QQApiInterfaceObject.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/QQApiInterfaceObject.h deleted file mode 100644 index 39923e67..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/QQApiInterfaceObject.h +++ /dev/null @@ -1,627 +0,0 @@ -/// -/// \file QQApiInterfaceObject.h -/// \brief QQApiInterface所依赖的请求及应答消息对象封装帮助类 -/// -/// Created by Tencent on 12-5-15. -/// Copyright (c) 2012年 Tencent. All rights reserved. -/// - -#ifndef QQApiInterface_QQAPIOBJECT_h -#define QQApiInterface_QQAPIOBJECT_h - -#import - - -typedef enum -{ - EQQAPISENDSUCESS = 0, - EQQAPIQQNOTINSTALLED = 1, - EQQAPIQQNOTSUPPORTAPI = 2, - EQQAPIMESSAGETYPEINVALID = 3, - EQQAPIMESSAGECONTENTNULL = 4, - EQQAPIMESSAGECONTENTINVALID = 5, - EQQAPIAPPNOTREGISTED = 6, - EQQAPIAPPSHAREASYNC = 7, - EQQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW = 8, - EQQAPISENDFAILD = -1, - EQQAPISHAREDESTUNKNOWN = -2, //未指定分享到QQ或TIM - - EQQAPITIMNOTINSTALLED = 11, //TIM未安装 - EQQAPITIMNOTSUPPORTAPI = 12, // TIM api不支持 - //qzone分享不支持text类型分享 - EQQAPIQZONENOTSUPPORTTEXT = 10000, - //qzone分享不支持image类型分享 - EQQAPIQZONENOTSUPPORTIMAGE = 10001, - //当前QQ版本太低,需要更新至新版本才可以支持 - EQQAPIVERSIONNEEDUPDATE = 10002, - ETIMAPIVERSIONNEEDUPDATE = 10004, -} QQApiSendResultCode; - -#pragma mark - QQApiObject(分享对象类型) - -// QQApiObject control flags -enum -{ - kQQAPICtrlFlagQZoneShareOnStart = 0x01, - kQQAPICtrlFlagQZoneShareForbid = 0x02, - kQQAPICtrlFlagQQShare = 0x04, - kQQAPICtrlFlagQQShareFavorites = 0x08, //收藏 - kQQAPICtrlFlagQQShareDataline = 0x10, //数据线 -}; - -// 分享到QQ或TIM -typedef enum ShareDestType { - ShareDestTypeQQ, - ShareDestTypeTIM, -}ShareDestType; - -// QQApiObject -/** \brief 所有在QQ及插件间发送的数据对象的根类。 - */ -__attribute__((visibility("default"))) @interface QQApiObject : NSObject -@property(nonatomic,retain) NSString* title; ///< 标题,最长128个字符 -@property(nonatomic,retain) NSString* description; ///<简要描述,最长512个字符 - -@property (nonatomic, assign) uint64_t cflag; -@property (nonatomic, assign) ShareDestType shareDestType; //分享到QQ或TIM,必须指定 -@end - -// QQApiResultObject -/** \brief 用于请求回应的数据类型。 -

    可能错误码及描述如下:

    - - - - - - - - -
    errorerrorDescription注释
    0nil成功
    -1param error参数错误
    -2group code is invalid该群不在自己的群列表里面
    -3upload photo failed上传图片失败
    -4user give up the current operation用户放弃当前操作
    -5client internal error客户端内部处理错误
    - */ -__attribute__((visibility("default"))) @interface QQApiResultObject : QQApiObject -@property(nonatomic,retain) NSString* error; ///<错误 -@property(nonatomic,retain) NSString* errorDescription; ///<错误描述 -@property(nonatomic,retain) NSString* extendInfo; ///<扩展信息 -@end - -// QQApiTextObject -/** \brief 文本对象 - */ -@interface QQApiTextObject : QQApiObject -@property(nonatomic,retain)NSString* text; ///<文本内容,必填,最长1536个字符 - --(id)initWithText:(NSString*)text; ///<初始化方法 -+(id)objectWithText:(NSString*)text;///<工厂方法,获取一个QQApiTextObject对象. -@end - -// QQApiURLObject -typedef enum QQApiURLTargetType{ - QQApiURLTargetTypeNotSpecified = 0x00, - QQApiURLTargetTypeAudio = 0x01, - QQApiURLTargetTypeVideo = 0x02, - QQApiURLTargetTypeNews = 0x03 -}QQApiURLTargetType; - -/** @brief URL对象类型。 - - 包括URL地址,URL地址所指向的目标类型及预览图像。 - */ -__attribute__((visibility("default"))) @interface QQApiURLObject : QQApiObject -/** - URL地址所指向的目标类型. - @note 参见QQApi.h 中的 QQApiURLTargetType 定义. - */ -@property(nonatomic)QQApiURLTargetType targetContentType; - -@property(nonatomic,retain)NSURL* url; ///QQApiExtendObject对象 - @param data 数据内容 - @param previewImageData 用于预览的图片 - @param title 标题 - @param description 此对象,分享的描述 - @return - 一个自动释放的QQApiExtendObject实例 - */ -+ (id)objectWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description; - -/** - helper方法获取一个autorelease的QQApiExtendObject对象 - @param data 数据内容 - @param previewImageData 用于预览的图片 - @param title 标题 - @param description 此对象,分享的描述 - @param imageDataArray 发送的多张图片队列 - @return - 一个自动释放的QQApiExtendObject实例 - */ -+ (id)objectWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description imageDataArray:(NSArray*)imageDataArray; - -@end - -// QQApiImageObject -/** @brief 图片对象 - 用于分享图片内容的对象,是一个指定为图片类型的QQApiExtendObject - */ -@interface QQApiImageObject : QQApiExtendObject -@end - -// QQApiImageArrayForQZoneObject -/** @brief 图片对象 - 用于分享图片到空间,走写说说路径,是一个指定为图片类型的,当图片数组为空时,默认走文本写说说QQApiObject - */ -@interface QQApiImageArrayForQZoneObject : QQApiObject - -@property(nonatomic,retain) NSArray* imageDataArray;///图片数组 - -/** - 初始化方法 - @param imageDataArray 图片数组 - @param title 写说说的内容,可以为空 - */ -- (id)initWithImageArrayData:(NSArray*)imageDataArray title:(NSString*)title; - -/** - helper方法获取一个autorelease的QQApiExtendObject对象 - @param title 写说说的内容,可以为空 - @param imageDataArray 发送的多张图片队列 - @return - 一个自动释放的QQApiExtendObject实例 - */ -+ (id)objectWithimageDataArray:(NSArray*)imageDataArray title:(NSString*)title; - -@end - -// QQApiVideoForQZoneObject -/** @brief 视频对象 - 用于分享视频到空间,走写说说路径QQApiObject - assetURL可传ALAsset的ALAssetPropertyAssetURL,或者PHAsset的localIdentifier - */ -@interface QQApiVideoForQZoneObject : QQApiObject - -@property(nonatomic, retain) NSString *assetURL; - -- (id)initWithAssetURL:(NSString*)assetURL title:(NSString*)title; - -+ (id)objectWithAssetURL:(NSString*)assetURL title:(NSString*)title; - -@end - -// QQApiWebImageObject -/** @brief 图片对象 - 用于分享网络图片内容的对象,是一个指定网络图片url的: 该类型只在2.9.0的h5分享中才支持, - 原有的手q分享是不支持该类型的。 - */ -@interface QQApiWebImageObject : QQApiObject - -@property(nonatomic, retain) NSURL *previewImageURL; ///<预览图像URL - -/** - 初始化方法 - @param previewImageURL 用于预览的图片 - @param title 标题 - @param description 此对象,分享的描述 - */ -- (id)initWithPreviewImageURL:(NSURL*)previewImageURL title:(NSString*)title description:(NSString*)description; - -/** - helper方法获取一个autorelease的QQApiWebImageObject对象 - @param previewImageURL 用于预览的图片 - @param title 标题 - @param description 此对象,分享的描述 - */ -+ (id)objectWithPreviewImageURL:(NSURL*)previewImageURL title:(NSString*)title description:(NSString*)description; - -@end - -// QQApiGroupTribeImageObject -/** @brief 群部落图片对象 - 用于分享图片内容的对象,是一个指定为图片类型的 可以指定一些其他的附加数据QQApiExtendObject - */ -@interface QQApiGroupTribeImageObject : QQApiImageObject -{ - NSString *_bid; - NSString *_bname; -} -// 群部落id -@property (nonatomic, retain)NSString* bid; - -// 群部落名称 -@property (nonatomic, retain)NSString* bname; - -@end - - -//QQApiFileObject -/** @brief 本地文件对象(暂只支持分享到手机QQ数据线功能) - 用于分享文件内容的对象,是一个指定为文件类型的QQApiExtendObject - */ -@interface QQApiFileObject : QQApiExtendObject -{ - NSString* _fileName; -} -@property(nonatomic, retain)NSString* fileName; -@end - -// QQApiAudioObject -/** @brief 音频URL对象 - 用于分享目标内容为音频的URL的对象 - */ -@interface QQApiAudioObject : QQApiURLObject - -@property (nonatomic, retain) NSURL *flashURL; ///<音频URL地址,最长512个字符 - -/** - 获取一个autorelease的QQApiAudioObject - @param url 音频内容的目标URL - @param title 分享内容的标题 - @param description 分享内容的描述 - @param data 分享内容的预览图像 - @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE - */ -+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data; - -/** - 获取一个autorelease的QQApiAudioObject - @param url 音频内容的目标URL - @param title 分享内容的标题 - @param description 分享内容的描述 - @param previewURL 分享内容的预览图像URL - @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE - */ -+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL; - -@end - -// QQApiVideoObject -/** @brief 视频URL对象 - 用于分享目标内容为视频的URL的对象 - - QQApiVideoObject类型的分享,目前在Android和PC QQ上接收消息时,展现有待完善,待手机QQ版本以后更新支持 - 目前如果要分享视频,推荐使用 QQApiNewsObject 类型 - */ -@interface QQApiVideoObject : QQApiURLObject - -@property (nonatomic, retain) NSURL *flashURL; ///<视频URL地址,最长512个字符 - -/** - 获取一个autorelease的QQApiVideoObject - @param url 视频内容的目标URL - @param title 分享内容的标题 - @param description 分享内容的描述 - @param data 分享内容的预览图像 - @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE - */ -+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data; - -/** - 获取一个autorelease的QQApiVideoObject - @param url 视频内容的目标URL - @param title 分享内容的标题 - @param description 分享内容的描述 - @param previewURL 分享内容的预览图像URL - @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE - */ -+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL; - -@end - -// QQApiNewsObject -/** @brief 新闻URL对象 - 用于分享目标内容为新闻的URL的对象 - */ -@interface QQApiNewsObject : QQApiURLObject -/** - 获取一个autorelease的QQApiNewsObject - @param url 视频内容的目标URL - @param title 分享内容的标题 - @param description 分享内容的描述 - @param data 分享内容的预览图像 - @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE - */ -+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data; - -/** - 获取一个autorelease的QQApiNewsObject - @param url 视频内容的目标URL - @param title 分享内容的标题 - @param description 分享内容的描述 - @param previewURL 分享内容的预览图像URL - @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE - */ -+(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL; - -@end - -// QQApiPayObject -/** \brief 支付对象 - */ -@interface QQApiPayObject : QQApiObject -@property(nonatomic,retain)NSString* OrderNo; ///<支付订单号,必填 -@property(nonatomic,retain)NSString* AppInfo; ///<支付来源信息,必填 - --(id)initWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo; ///<初始化方法 -+(id)objectWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo;///<工厂方法,获取一个QQApiPayObject对象. -@end - -// QQApiCommonContentObject; -/** @brief 通用模板类型对象 - 用于分享一个固定显示模板的图文混排对象 - @note 图片列表和文本列表不能同时为空 - */ -@interface QQApiCommonContentObject : QQApiObject -/** - 预定义的界面布局类型 - */ -@property(nonatomic,assign) unsigned int layoutType; -@property(nonatomic,assign) NSData* previewImageData;///<预览图 -@property(nonatomic,retain) NSArray* textArray;///<文本列表 -@property(nonatomic,retain) NSArray* pictureDataArray;///<图片列表 -+(id)objectWithLayoutType:(int)layoutType textArray:(NSArray*)textArray pictureArray:(NSArray*)pictureArray previewImageData:(NSData*)data; -/** - 将一个NSDictionary对象转化为QQApiCommomContentObject,如果无法转换,则返回空 - */ -+(id)objectWithDictionary:(NSDictionary*)dic; --(NSDictionary*)toDictionary; -@end - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Ad item object definition -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -/** @brief 广告数据对象 - */ -@interface QQApiAdItem : NSObject -@property(nonatomic,retain) NSString* title; ///<名称 -@property(nonatomic,retain) NSString* description;///<描述 -@property(nonatomic,retain) NSData* imageData;///<广告图片 -@property(nonatomic,retain) NSURL* target;///<广告目标链接 -@end - -// QQApiWPAObject -/** \brief 发起WPA对象 - */ -@interface QQApiWPAObject : QQApiObject -@property(nonatomic,retain)NSString* uin; ///<想要对话的QQ号 - --(id)initWithUin:(NSString*)uin; ///<初始化方法 -+(id)objectWithUin:(NSString*)uin;///<工厂方法,获取一个QQApiWPAObject对象. -@end - -// QQApiAddFriendObject -/** \brief 添加好友 - */ -@interface QQApiAddFriendObject : QQApiObject -@property (nonatomic,retain)NSString* openID; -@property (nonatomic,retain)NSString* subID; -@property (nonatomic,retain)NSString* remark; - --(id)initWithOpenID:(NSString*)openID; ///<初始化方法 -+(id)objecWithOpenID:(NSString*)openID; ///<工厂方法,获取一个QQApiAddFriendObject对象. - -@end - -// QQApiGameConsortiumBindingGroupObject -/** \brief 游戏公会绑定群 - */ -@interface QQApiGameConsortiumBindingGroupObject : QQApiObject -@property (nonatomic,retain)NSString* signature; -@property (nonatomic,retain)NSString* unionid; -@property (nonatomic,retain)NSString* zoneID; -@property (nonatomic,retain)NSString* appDisplayName; - --(id)initWithGameConsortium:(NSString*)signature unionid:(NSString*)unionid zoneID:(NSString*)zoneID appDisplayName:(NSString*)appDisplayName; ///<初始化方法 -+(id)objectWithGameConsortium:(NSString*)signature unionid:(NSString*)unionid zoneID:(NSString*)zoneID appDisplayName:(NSString*)appDisplayName; ///<工厂方法,获取一个QQApiAddFriendObject对象. - -@end - -// QQApiGameConsortiumBindingGroupObject -/** \brief 加入群 - */ -@interface QQApiJoinGroupObject : QQApiObject -@property (nonatomic,retain)NSString* groupUin; -@property (nonatomic,retain)NSString* groupKey; - -- (id)initWithGroupInfo:(NSString*)groupUin key:(NSString*)groupKey; ///<初始化方法 -+ (id)objectWithGroupInfo:(NSString*)groupUin key:(NSString*)groupKey; ///<同时提供群号和群KEY 工厂方法,获取一个QQApiAddFriendObject对象. -+ (id)objectWithGroupKey:(NSString*)groupKey; ///<只需要群的KEY 工厂方法,获取一个QQApiAddFriendObject对象. - -@end - -// QQApiGroupChatObject -/** \brief 发起群会话对象 - */ -@interface QQApiGroupChatObject : QQApiObject -@property(nonatomic,retain)NSString* groupID; ///<想要对话的群号 - --(id)initWithGroup:(NSString*)groupID; ///<初始化方法 -+(id)objectWithGroup:(NSString*)groupID;///<工厂方法,获取一个QQApiGroupChatObject对象. -@end - -#pragma mark - QQApi请求消息类型 - -/** - QQApi请求消息类型 - */ -enum QQApiInterfaceReqType -{ - EGETMESSAGEFROMQQREQTYPE = 0, ///< 手Q -> 第三方应用,请求第三方应用向手Q发送消息 - ESENDMESSAGETOQQREQTYPE = 1, ///< 第三方应用 -> 手Q,第三方应用向手Q分享消息 - ESHOWMESSAGEFROMQQREQTYPE = 2 ///< 手Q -> 第三方应用,请求第三方应用展现消息中的数据 -}; - -/** - QQApi应答消息类型 - */ -enum QQApiInterfaceRespType -{ - ESHOWMESSAGEFROMQQRESPTYPE = 0, ///< 第三方应用 -> 手Q,第三方应用应答消息展现结果 - EGETMESSAGEFROMQQRESPTYPE = 1, ///< 第三方应用 -> 手Q,第三方应用回应发往手Q的消息 - ESENDMESSAGETOQQRESPTYPE = 2 ///< 手Q -> 第三方应用,手Q应答处理分享消息的结果 -}; - -/** - QQApi请求消息基类 - */ -@interface QQBaseReq : NSObject - -/** 请求消息类型,参见\ref QQApiInterfaceReqType */ -@property (nonatomic, assign) int type; - -@end - -/** - QQApi应答消息基类 - */ -@interface QQBaseResp : NSObject - -/** 请求处理结果 */ -@property (nonatomic, copy) NSString* result; - -/** 具体错误描述信息 */ -@property (nonatomic, copy) NSString* errorDescription; - -/** 应答消息类型,参见\ref QQApiInterfaceRespType */ -@property (nonatomic, assign) int type; - -/** 扩展信息 */ -@property (nonatomic, assign) NSString* extendInfo; - -@end - -/** - GetMessageFromQQReq请求帮助类 - */ -@interface GetMessageFromQQReq : QQBaseReq - -/** - 创建一个GetMessageFromQQReq请求实例 - */ -+ (GetMessageFromQQReq *)req; - -@end - -/** - GetMessageFromQQResp应答帮助类 - */ -@interface GetMessageFromQQResp : QQBaseResp - -/** - 创建一个GetMessageFromQQResp应答实例 - \param message 具体分享消息实例 - \return 新创建的GetMessageFromQQResp应答实例 - */ -+ (GetMessageFromQQResp *)respWithContent:(QQApiObject *)message; - -/** 具体分享消息 */ -@property (nonatomic, retain) QQApiObject *message; - -@end - -/** - SendMessageToQQReq请求帮助类 - */ -@interface SendMessageToQQReq : QQBaseReq - -/** - 创建一个SendMessageToQQReq请求实例 - \param message 具体分享消息实例 - \return 新创建的SendMessageToQQReq请求实例 - */ -+ (SendMessageToQQReq *)reqWithContent:(QQApiObject *)message; - -/** 具体分享消息 */ -@property (nonatomic, retain) QQApiObject *message; - -@end - -/** - SendMessageToQQResp应答帮助类 - */ -@interface SendMessageToQQResp : QQBaseResp - -/** - 创建一个SendMessageToQQResp应答实例 - \param result 请求处理结果 - \param errDesp 具体错误描述信息 - \param extendInfo 扩展信息 - \return 新创建的SendMessageToQQResp应答实例 - */ -+ (SendMessageToQQResp *)respWithResult:(NSString *)result errorDescription:(NSString *)errDesp extendInfo:(NSString*)extendInfo; - -@end - -/** - ShowMessageFromQQReq请求帮助类 - */ -@interface ShowMessageFromQQReq : QQBaseReq - -/** - 创建一个ShowMessageFromQQReq请求实例 - \param message 具体待展现消息实例 - \return 新创建的ShowMessageFromQQReq请求实例 - */ -+ (ShowMessageFromQQReq *)reqWithContent:(QQApiObject *)message; - -/** 具体待展现消息 */ -@property (nonatomic, retain) QQApiObject *message; - -@end - -/** - ShowMessageFromQQResp应答帮助类 - */ -@interface ShowMessageFromQQResp : QQBaseResp - -/** - 创建一个ShowMessageFromQQResp应答实例 - \param result 展现消息结果 - \param errDesp 具体错误描述信息 - \return 新创建的ShowMessageFromQQResp应答实例 - */ -+ (ShowMessageFromQQResp *)respWithResult:(NSString *)result errorDescription:(NSString *)errDesp; - -@end - -#endif diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentApiInterface.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentApiInterface.h deleted file mode 100644 index 958226c6..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentApiInterface.h +++ /dev/null @@ -1,104 +0,0 @@ -// -// TencentMessage.h -// TencentOpenApi_IOS -// -// Created by qqconnect on 13-5-29. -// Copyright (c) 2013年 Tencent. All rights reserved. -// - -#ifndef QQ_OPEN_SDK_LITE - -#import -#import "TencentMessageObject.h" - -typedef enum -{ - kIphoneQQ, - kIphoneQZONE, - kIphoneTIM, - kThirdApp, -} -TecnentPlatformType; - -typedef enum -{ - kTencentApiSuccess, - kTencentApiPlatformUninstall, - kTencentApiPlatformNotSupport, - kTencentApiParamsError, - kTencentApiFail, -} -TencentApiRetCode; - -@class TencentApiReq; -@class TencentApiResp; - -/** - * \brief TencentApiInterface的回调 - * - * TencentApiInterface的回调接口 - * \note v1.0版本只支持腾讯业务拉起第三方请求内容 - */ -@protocol TencentApiInterfaceDelegate - -@optional -/** - * 请求获得内容 当前版本只支持第三方相应腾讯业务请求 - */ -- (BOOL)onTencentReq:(TencentApiReq *)req; - -/** - * 响应请求答复 当前版本只支持腾讯业务相应第三方的请求答复 - */ -- (BOOL)onTencentResp:(TencentApiResp *)resp; - -@end - -/** - * \brief TencentApiInterface的回调 - * - * TencentApiInterface的调用接口 - * \note v1.0版本只支持第三方答复内容 - */ -@interface TencentApiInterface : NSObject - -/** - * 发送答复返回腾讯业务 - * \param resp 答复内容 - * \return 返回码 - */ -+ (TencentApiRetCode)sendRespMessageToTencentApp:(TencentApiResp *)resp; - -/** - * 是否可以处理拉起协议 - * \param url - * \param delegate 指定的回调 - * \return 是否是腾讯API认识的消息类型 - */ -+ (BOOL)canOpenURL:(NSURL *)url delegate:(id)delegate; - -/** - * 处理应用拉起协议 - * \param url - * \param delegate 指定的回调 - * \return 是否是腾讯API认识的消息类型 - */ -+ (BOOL)handleOpenURL:(NSURL *)url delegate:(id)delegate; - -/** - * 用户设备是否安装腾讯APP - * \param platform 指定的腾讯业务 - * \return YES:安装 NO:未安装 - */ -+ (BOOL)isTencentAppInstall:(TecnentPlatformType)platform; - -/** - * 用户设备是否支持调用SDK - * \param platform 指定的腾讯业务 - * \return YES:支持 NO:不支持 - */ -+ (BOOL)isTencentAppSupportTencentApi:(TecnentPlatformType)platform; - -@end - -#endif diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentMessageObject.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentMessageObject.h deleted file mode 100644 index f89ff900..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentMessageObject.h +++ /dev/null @@ -1,412 +0,0 @@ -// -// TencentMessageObject.h -// TencentOpenApi_IOS -// -// Created by qqconnect on 13-5-27. -// Copyright (c) 2013年 Tencent. All rights reserved. -// - -#ifndef QQ_OPEN_SDK_LITE - -#import -#import -#import "sdkdef.h" - -#define kTextLimit (1024 * 1024) -#define kDataLimit (1024 * 1024 * 10) -#define kPreviewDataLimit (1024 * 1024) - -@class TencentApiReq; -@class TencentApiResp; - -/** - * 必填的NSArray型参数 - */ -typedef NSArray *TCRequiredArray; - -/** - * 必填的NSDictionary型参数 - */ -typedef NSDictionary *TCRequiredDictionary; - -/** - * 必填的TencentApiReq型参数 - */ -typedef TencentApiReq *TCRequiredReq; - -/** - * 可选的UIImage类型参数 - */ -typedef NSData *TCOptionalData; - - -/** - * 可选的NSArray型参数 - */ -typedef NSArray *TCOptionalArray; - -/** - * 可选的TencentApiReq型参数 - */ -typedef TencentApiReq *TCOptionalReq; - -/** - * TencentReqMessageType 请求类型枚举参数 - */ -typedef enum -{ - /** TX APP请求内容填充(需要第三方开发者填充完成内容后需要主动调用sendRespMessageToTencentApp)*/ - ReqFromTencentAppQueryContent, - /** TX APP请求展现内容 (不用调用答复) */ - ReqFromTencentAppShowContent, - /** 第三方 APP 请求内容 */ - ReqFromThirdAppQueryContent, - /** 第三方 APP 请求展现内容(类似分享)*/ - ReqFromThirdAppShowContent, -} -TencentReqMessageType; - -typedef enum -{ - RespFromTencentAppQueryContent, - RespFromTencentAppShowContent, - RespFromThirdAppQueryContent, - RespFromThirdAppShowContent, -} -TencentRespMessageType; - -/** - * TencentObjVersion 腾讯API消息类型枚举 - */ -typedef enum -{ - /** 文本类型 */ - TencentTextObj, - /** 图片类型 */ - TencentImageObj, - /** 音频类型 */ - TencentAudioObj, - /** 视频类型 */ - TencentVideoObj, - /** 图片视频类 */ - TencentImageAndVideoObj, -} -TencentObjVersion; - -/** - * \brief 请求包 - * - * TencentApiReq用来向其他业务发送请求包 - */ -@interface TencentApiReq : NSObject - -/** - * 根据序列号生成一个请求包 - * \param apiSeq 请求序列号 - * \param type 请求类型 - * \return tencentApiReq实例 - */ -+ (TencentApiReq *)reqFromSeq:(NSInteger)apiSeq type:(TencentReqMessageType)type; - -/** 请求类型 */ -@property (readonly, assign, nonatomic)TCRequiredInt nMessageType; - -/** 请求平台 */ -@property (readonly, assign, nonatomic)NSInteger nPlatform; - -/** 请求的SDK版本号 */ -@property (readonly, assign, nonatomic)NSInteger nSdkVersion; - -/** 请求序列号 */ -@property (readonly, assign, nonatomic)TCRequiredInt nSeq; - -/** 第三方的APPID */ -@property (nonatomic, retain)TCRequiredStr sAppID; - -/** 请求内容 TencentBaseMessageObj对象数组 */ -@property (nonatomic, retain)TCOptionalArray arrMessage; - -/** 请求的描述 可以用于告诉对方这个请求的特定场景 */ -@property (nonatomic, retain)TCOptionalStr sDescription; - -@end - -/** - * \brief 答复包 - * - * TencentApiResp用来向其他业务发送答复包 - */ -@interface TencentApiResp : NSObject - -/** - * 根据序列号生成一个答复包 - * \param req 答复对应的请求包(如果req不是TencentApiReq或者他的子类,会抛出异常) - * \return 答复包体 - */ -+ (TencentApiResp *)respFromReq:(TencentApiReq *)req; - -/** 返回码 */ -@property (nonatomic, assign)TCOptionalInt nRetCode; - -/** 返回消息 */ -@property (nonatomic, retain)TCOptionalStr sRetMsg; - -/** 答复对应的请求包 */ -@property (nonatomic, retain)TCOptionalReq objReq; - -@end - -/** - * \brief 消息体 - * - * TencentBaseMessageObj 应用之间传递消息体 - */ -@interface TencentBaseMessageObj : NSObject - -/** 消息类型 */ -@property (nonatomic, assign)NSInteger nVersion; - -/** 消息描述 */ -@property (nonatomic, retain)NSString *sName; - -/** 消息的扩展信息 主要是可以用来进行一些请求消息体的描述 譬如图片要求的width height 文字的关键字什么的, 也可以不用填写*/ -@property (nonatomic, retain)NSDictionary *dictExpandInfo; - -/** - * 消息是否有效 - */ -- (BOOL)isVaild; - -@end - -#pragma mark TencentTextMessage -/** - * \brief 文本的消息体 - * - * TencentTextMessageObjV1 应用之间传递的文本消息体 - */ -@interface TencentTextMessageObjV1 : TencentBaseMessageObj - -/** - * 文本 - * \note 文本长度不能超过4096个字 - */ -@property (nonatomic, retain) NSString *sText; - - -/** - * 初始化文本消息 - * \param text 文本 - * \return 初始化返回的文本消息 - */ -- (id)initWithText:(NSString *)text; - -@end - - -#pragma mark TecentImageMessage - -/** - * TencentApiImageSourceType 图片数据类型(请求方对数据类型可能会有限制) - */ -typedef enum -{ - /** 图片数据是url或二进制数据 */ - AllImage, - /** 图片数据是url */ - UrlImage, - /** 图片数据是二进制数据 */ - DataImage, -}TencentApiImageSourceType; - -/** - * \brief 图片的消息体 - * - * TencentImageMessageObjV1 应用之间传递的图片消息体 - */ -@interface TencentImageMessageObjV1 : TencentBaseMessageObj - -/** - * 图片数据 - * \note 图片不能大于10M - */ -@property (nonatomic, retain) NSData *dataImage; - -/** - * 缩略图的数据 - * \note 图片不能大于1M - */ -@property (nonatomic, retain) NSData *dataThumbImage; - -/** 图片URL */ -@property (nonatomic, retain) NSString *sUrl; - -/** 图片的描述 */ -@property (nonatomic, retain) NSString *sDescription; - -/** 图片的size */ -@property (nonatomic, assign) CGSize szImage; - -/** - * 图片来源 - * \note TencentApiImageSourceType对应的类型 - */ -@property (readonly, assign) NSInteger nType; - -/** - * 初始化图片消息 - * \param dataImage 图片类型 - * \return 初始化返回的图片消息 - */ -- (id)initWithImageData:(NSData *)dataImage; - -/** - * 初始化图片消息 - * \param url 图片url - * \return 初始化返回的图片消息 - */ -- (id)initWithImageUrl:(NSString *)url; - -/** - * 初始化图片消息 - * \param type 图片类型 - * \return 初始化返回的图片消息 - */ -- (id)initWithType:(TencentApiImageSourceType)type; -@end - - -#pragma mark TencentAudioMessage -/** - * \brief 音频的消息体 - * - * TencentAudioMessageObjV1 应用之间传递的音频消息体 - */ -@interface TencentAudioMessageObjV1 : TencentBaseMessageObj - -/** 音频URL */ -@property (nonatomic, retain) NSString *sUrl; - -/** - * 音频的预览图 - * \note图片不能大于1M - */ -@property (nonatomic, retain) NSData *dataImagePreview; - -/** 音频的预览图URL */ -@property (nonatomic, retain) NSString *sImagePreviewUrl; - -/** 音频的描述 */ -@property (nonatomic, retain) NSString *sDescription; - -/** - * 初始化图片消息 - * \param url 音频URL - * \return 初始化返回的音频消息 - */ -- (id)initWithAudioUrl:(NSString *)url; - -@end - - -#pragma mark TencentVideoMessage - -/** - * TencentApiVideoSourceType 视频数据类型(请求方对数据类型可能会有限制) - */ - -typedef enum -{ - /** 视频来源于本地或网络 */ - AllVideo, - /** 视频来源于本地 */ - LocalVideo, - /** 视频来源于网络 */ - NetVideo, -}TencentApiVideoSourceType; - -/** - * \brief 视频的消息体 - * - * TencentVideoMessageV1 应用之间传递的视频消息体 - */ -@interface TencentVideoMessageV1 : TencentBaseMessageObj - -/** - * 视频URL - * \note 不能超过1024 - */ -@property (nonatomic, retain) NSString *sUrl; - -/** - * 视频来源 主要是用来让发起方指定视频的来源 - * \note TencentApiVideoSourceType 对应的类型 只读参数 - */ -@property (readonly, assign, nonatomic) NSInteger nType; - -/** - * 视频的预览图 - * \note 图片不能大于1M - */ -@property (nonatomic, retain) NSData *dataImagePreview; - -/** 视频的预览图URL */ -@property (nonatomic, retain) NSString *sImagePreviewUrl; - -/** 视频的描述 */ -@property (nonatomic, retain) NSString *sDescription; - -/** - * 初始化视频消息 - * \param url 视频URL - * \param type 视频来源类型 - * \return 初始化返回的视频消息 - */ -- (id)initWithVideoUrl:(NSString *)url type:(TencentApiVideoSourceType)type; - - -/** - * 初始化视频消息 - * \param type 视频来源类型 - * \return 初始化返回的视频消息 - */ -- (id)initWithType:(TencentApiVideoSourceType)type; -@end - -#pragma mark TencentImageMessageObj -/** - * \brief 视频图片消息体 - * - * TencentVideoMessageV1 这是一个扩展的类 是一个图片视频类 - * \note 图片视频可以任选一个内容填充 但是注意只能填一个 当有一种类型被填充后 另外一个种类型就无法填充了 - */ -@interface TencentImageAndVideoMessageObjV1 : TencentBaseMessageObj - -/** 图片消息 */ -@property (nonatomic, retain) TencentImageMessageObjV1 *objImageMessage; - -/** 视频消息 */ -@property (nonatomic, retain) TencentVideoMessageV1 *objVideoMessage; - -/** - * 初始化图片消息 - * \param dataImage 图片数据 - * \param url 视频url - * \return 初始化返回的图片视频消息 - */ -- (id)initWithMessage:(NSData *)dataImage videoUrl:(NSString *)url; - -/** - * 设置图片 - * \param dataImage 图片数据 - */ -- (void)setDataImage:(NSData *)dataImage; - -/** - * 设置视频 - * \param videoUrl 视频URL - */ -- (void)setVideoUrl:(NSString *)videoUrl; -@end - -#endif diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentOAuth.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentOAuth.h deleted file mode 100644 index ed60e07d..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentOAuth.h +++ /dev/null @@ -1,676 +0,0 @@ -/// -/// \file TencentOAuth.h -/// \brief QQ互联开放平台授权登录及相关开放接口实现类 -/// -/// Created by Tencent on 12-12-21. -/// Copyright (c) 2012年 Tencent. All rights reserved. -/// - -#import -#import "sdkdef.h" -#import "TencentOAuthObject.h" -#import "TencentApiInterface.h" - -@protocol TencentSessionDelegate; -@protocol TencentLoginDelegate; -@protocol TencentApiInterfaceDelegate; -@protocol TencentWebViewDelegate; - -@class TencentApiReq; -@class TencentApiResp; - -typedef enum -{ - kTencentNotAuthorizeState, - kTencentSSOAuthorizeState, - kTencentWebviewAuthorzieState, -} TencentAuthorizeState; - -typedef enum -{ - kAuthModeClientSideToken, - kAuthModeServerSideCode, -} TencentAuthMode; - -#pragma mark - TencentOAuth(授权登录及相关开放接口调用) - -/** - * \brief TencentOpenAPI授权登录及相关开放接口调用 - * - * TencentOAuth实现授权登录逻辑以及相关开放接口的请求调用 - */ -@interface TencentOAuth : NSObject -{ - NSMutableDictionary* _apiRequests; - NSString* _accessToken; - NSDate* _expirationDate; - id _sessionDelegate; - NSString* _localAppId; - NSString* _openId; - NSString* _redirectURI; - NSArray* _permissions; -} - -/** Access Token凭证,用于后续访问各开放接口 */ -@property(nonatomic, copy) NSString* accessToken; - -/** Access Token的失效期 */ -@property(nonatomic, copy) NSDate* expirationDate; - -/** 已实现的开放接口的回调委托对象 */ -@property(nonatomic, assign) id sessionDelegate; - -/** 第三方应用在开发过程中设置的URLSchema,用于浏览器登录后后跳到第三方应用 */ -@property(nonatomic, copy) NSString* localAppId; - -/** 用户授权登录后对该用户的唯一标识 */ -@property(nonatomic, copy) NSString* openId; - -/** 用户登录成功过后的跳转页面地址 */ -@property(nonatomic, copy) NSString* redirectURI; - -/** 第三方应用在互联开放平台申请的appID */ -@property(nonatomic, retain) NSString* appId; - -/** 主要是互娱的游戏设置uin */ -@property(nonatomic, retain) NSString* uin; - -/** 主要是互娱的游戏设置鉴定票据 */ -@property(nonatomic, retain) NSString* skey; - -/** 登陆透传的数据 */ -@property(nonatomic, copy) NSDictionary* passData; - -/** 授权方式(Client Side Token或者Server Side Code) */ -@property(nonatomic, assign) TencentAuthMode authMode; - -/** union id */ -@property(nonatomic, retain) NSString* unionid; - -/** 第三方在授权登录/分享 时选择 QQ,还是TIM 。在授权前一定要指定其中一个类型*/ -@property(nonatomic, assign) TencentAuthShareType authShareType; - -/** - * 用来获得当前sdk的版本号 - * \return 返回sdk版本号 - **/ - -+ (NSString*)sdkVersion; - -/** - * 用来获得当前sdk的小版本号 - * \return 返回sdk小版本号 - **/ - -+ (NSString*)sdkSubVersion; - -/** - * 用来获得当前sdk的是否精简版 - * \return 返回YES表示精简版 - **/ - -+ (BOOL)isLiteSDK; - -/** - * 主要是用来帮助判断是否有登陆被发起,但是还没有过返回结果 - * \return - * kTencentNotAuthorizeState:无授权 - * kTencentSSOAuthorizeState:有人发起了sso授权但无返回 - * kTencentWebviewAuthorzieState:有人发起了webview授权还未返回 - **/ - -+ (TencentAuthorizeState *)authorizeState; - -/** - * 用来获得当前手机qq的版本号 - * \return 返回手机qq版本号 - **/ -+ (QQVersion)iphoneQQVersion; - - -/** - * 用来获得当前手机TIM的版本号 - * \return 返回手机qq版本号 - **/ -+ (QQVersion)iphoneTIMVersion; - -/** - * 初始化TencentOAuth对象 - * \param appId 第三方应用在互联开放平台申请的唯一标识 - * \param delegate 第三方应用用于接收请求返回结果的委托对象 - * \return 初始化后的授权登录对象 - */ -- (id)initWithAppId:(NSString *)appId - andDelegate:(id)delegate; - - -/** - * 判断用户手机上是否安装手机QQ - * \return YES:安装 NO:没安装 - */ -+ (BOOL)iphoneQQInstalled; - -/** - * 判断用户手机上是否安装手机TIM - * \return YES:安装 NO:没安装 - */ -+ (BOOL)iphoneTIMInstalled; - -/** - * 判断用户手机上的手机QQ是否支持SSO登录 - * \return YES:支持 NO:不支持 - */ -+ (BOOL)iphoneQQSupportSSOLogin; - -/** - * 判断用户手机上的手机TIM是否支持SSO登录 - * \return YES:支持 NO:不支持 - */ -+ (BOOL)iphoneTIMSupportSSOLogin; - -/** - * 判断用户手机上是否安装手机QZone - * \return YES:安装 NO:没安装 - */ -+ (BOOL)iphoneQZoneInstalled; - -/** - * 判断用户手机上的手机QZone是否支持SSO登录 - * \return YES:支持 NO:不支持 - */ -+ (BOOL)iphoneQZoneSupportSSOLogin; - -/** - * 登录授权 - * - * \param permissions 授权信息列 - */ -- (BOOL)authorize:(NSArray *)permissions; - -/** - * 登录授权 - * \param permissions 授权信息列表 - * \param bInSafari 是否使用safari进行登录.IOS SDK 1.3版本开始此参数废除 - */ -- (BOOL)authorize:(NSArray *)permissions - inSafari:(BOOL)bInSafari; - -/** - * 登录授权 - * \param permissions 授权信息列表 - * \param localAppId 应用APPID - * \param bInSafari 是否使用safari进行登录.IOS SDK 1.3版本开始此参数废除 - */ -- (BOOL)authorize:(NSArray *)permissions - localAppId:(NSString *)localAppId - inSafari:(BOOL)bInSafari; - -/** - * 增量授权,因用户没有授予相应接口调用的权限,需要用户确认是否授权 - * \param permissions 需增量授权的信息列表 - * \return 增量授权调用是否成功 - */ -- (BOOL)incrAuthWithPermissions:(NSArray *)permissions; - -/** - * 重新授权,因token废除或失效导致接口调用失败,需用户重新授权 - * \param permissions 授权信息列表,同登录授权 - * \return 授权调用是否成功 - */ -- (BOOL)reauthorizeWithPermissions:(NSArray *)permissions; - -/** - * 获取UnindID,可以根据UnindID的比较来确定OpenID是否属于同一个用户 - * \return NO未登录,信息不足;YES条件满足,发送请求成功,请等待回调 - */ -- (BOOL)RequestUnionId; - -/** - * (静态方法)处理应用拉起协议 - * \param url 处理被其他应用呼起时的逻辑 - * \return 处理结果,YES表示成功,NO表示失败 - */ -+ (BOOL)HandleOpenURL:(NSURL *)url; - -/** - * (静态方法)sdk是否可以处理应用拉起协议 - * \param url 处理被其他应用呼起时的逻辑 - * \return 处理结果,YES表示可以 NO表示不行 - */ -+ (BOOL)CanHandleOpenURL:(NSURL *)url; - -/** - * (静态方法)获取TencentOAuth调用的上一次错误信息 - */ -+ (NSString *)getLastErrorMsg; - -/** - * 以Server Side Code模式授权登录时,通过此接口获取返回的code值; - * 以Client Side Token模式授权登录时,忽略此接口。 - */ -- (NSString *)getServerSideCode; - -/** - * 退出登录(退出登录后,TecentOAuth失效,需要重新初始化) - * \param delegate 第三方应用用于接收请求返回结果的委托对象 - */ -- (void)logout:(id)delegate; - -/** - * 判断登录态是否有效 - * \return 处理结果,YES表示有效,NO表示无效,请用户重新登录授权 - */ -- (BOOL)isSessionValid; - -/** - * 获取用户个人信息 - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)getUserInfo; - -/** - * SDK内置webview实现定向分享时,第三方应用可以根据应用是否在白名单里来开启该配置开关,默认为关闭; - * 在白名单里的应用调用该接口后,即打开sdk内置webview的二级白名单开关(相对与sdk后台的白名单), - * 那么在sdk后台白名单校验请求失败的情况下,会继续先尝试采用内置webview进行分享。 - */ -- (void)openSDKWebViewQQShareEnable; - - -/** - * 获取用户QZone相册列表 - * \attention 需\ref apply_perm - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)getListAlbum; - -/** - * 获取用户QZone相片列表 - * \attention 需\ref apply_perm - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCListPhotoDic - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)getListPhotoWithParams:(NSMutableDictionary *)params; - - -/** - * 分享到QZone - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCAddShareDic - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)addShareWithParams:(NSMutableDictionary *)params; - - -/** - * 上传照片到QZone指定相册 - * \attention 需\ref apply_perm - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCUploadPicDic - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)uploadPicWithParams:(NSMutableDictionary *)params; - -/** - * 在QZone相册中创建一个新的相册 - * \attention 需\ref apply_perm - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCAddAlbumDic - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)addAlbumWithParams:(NSMutableDictionary *)params; - -/** - * 检查是否是QZone某个用户的粉丝 - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCCheckPageFansDic - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)checkPageFansWithParams:(NSMutableDictionary *)params; - -/** - * 在QZone中发表一篇日志 - * \attention 需\ref apply_perm - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCAddOneBlogDic - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)addOneBlogWithParams:(NSMutableDictionary *)params; - -/** - * 在QZone中发表一条说说 - * \attention 需\ref apply_perm - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCAddTopicDic - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)addTopicWithParams:(NSMutableDictionary *)params; - -/** - * 设置QQ头像 使用默认的效果处理设置头像的界面 - * \attention 需\ref apply_perm - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCSetUserHeadpic - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)setUserHeadpic:(NSMutableDictionary *)params; - - -/** - * 设置QQ头像 会返回设置头像由第三方自己处理界面的弹出方式 - * \attention 需\ref apply_perm - * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCSetUserHeadpic - * \param viewController 设置头像的界面 - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)setUserHeadpic:(NSMutableDictionary *)params andViewController:(UIViewController **)viewController; - -/** - * 获取QQ会员信息(仅包括是否为QQ会员,是否为年费QQ会员) - * \attention 需\ref apply_perm - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)getVipInfo; - -/** - * 获取QQ会员详细信息 - * \attention 需\ref apply_perm - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)getVipRichInfo; - -/** - * QZone定向分享,可以@到具体好友,完成后将触发responseDidReceived:forMessage:回调,message:“SendStory” - * \param params 参数字典 - * \param fopenIdArray 第三方应用预传人好友列表,好友以openid标识 - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)sendStory:(NSMutableDictionary *)params friendList:(NSArray *)fopenIdArray; - -/** - * 发送应用邀请,完成后将触发responseDidReceived:forMessage:回调,message:“AppInvitation” - * \param desc 应用的描述文字,不超过35字符,如果为nil或@“”则显示默认描述 - * \param imageUrl 应用的图标,如果为nil或者@“”则显示默认图标 - * \param source 透传参数,由开发者自定义该参数内容 - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)sendAppInvitationWithDescription:(NSString *)desc imageURL:(NSString *)imageUrl source:(NSString *)source; - -/** - * 发起PK或者发送炫耀,完成后将触发responseDidReceived:forMessage:回调,message:“AppChallenge” - * \param receiver 必须指定一位进行PK或者炫耀的好友,填写其OpenID,填写多个OpenID将截取第一个 - * \param type 类型,"pk"或者“brag” - * \param imageUrl 炫耀/挑战场景图的URL - * \param message 炫耀/挑战中的内容描述,不超过50个字符,超过限制则自动截断 - * \param source 透传参数,由开发者自定义该参数内容 - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)sendChallenge:(NSString *)receiver type:(NSString *)type imageURL:(NSString *)imageUrl message:(NSString *)message source:(NSString *)source; - -/** - * 赠送或者请求礼物,完成后将触发responseDidReceived:forMessage:回调,message:“AppGiftRequest” - * \param receiver 赠送或者请求礼物的好友的OpenID,支持填写多个,OpenID之用","分隔,为nil时将由用户通过好友选择器选择好友 - * \param exclude 用户通过好友选择器选择好友场景下,希望排除的好友(不显示在好友选择器) - * \param specified 用户通过好友选择器选择好友场景下,希望出现的指定好友 - * \param only 是否只显示specified指定的好友 - * \param type 类型,"request"或者“freegift” - * \param title 免费礼物或请求名称,不超过6个字符 - * \param message 礼物或请求的默认赠言,控制在35个汉字以内,超过限制自动截断 - * \param imageUrl 请求或礼物配图的URL,如果不传,则默认在弹框中显示应用的icon - * \param source 透传参数,由开发者自定义该参数内容 - * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 - */ -- (BOOL)sendGiftRequest:(NSString *)receiver exclude:(NSString *)exclude specified:(NSString *)specified only:(BOOL)only type:(NSString *)type title:(NSString *)title message:(NSString *)message imageURL:(NSString *)imageUrl source:(NSString *)source; - - -/** - * 退出指定API调用 - * \param userData 用户调用某条API的时候传入的保留参数 - * \return 处理结果,YES表示成功 NO表示失败 - */ -- (BOOL)cancel:(id)userData; - -/** - * CGI类任务创建接口 - * \param apiURL CGI请求的URL地址 - * \param method CGI请求方式:"GET","POST" - * \param params CGI请求参数字典 - * \param callback CGI请求结果的回调接口对象 - * \return CGI请求任务实例,用于取消任务,返回nil代表任务创建失败 - */ -- (TCAPIRequest *)cgiRequestWithURL:(NSURL *)apiURL method:(NSString *)method params:(NSDictionary *)params callback:(id)callback; - -/** - * TencentOpenApi发送任务统一接口 - * \param request 请求发送的任务 - * \param callback 任务发送后的回调地址 - */ -- (BOOL)sendAPIRequest:(TCAPIRequest *)request callback:(id)callback; - -- (NSString *)getUserOpenID; - -@end - -#pragma mark - TencentLoginDelegate(授权登录回调协议) - -/** - * \brief TencentLoginDelegate iOS Open SDK 1.3 API回调协议 - * - * 第三方应用实现登录的回调协议 - */ -@protocol TencentLoginDelegate - -@required - -/** - * 登录成功后的回调 - */ -- (void)tencentDidLogin; - -/** - * 登录失败后的回调 - * \param cancelled 代表用户是否主动退出登录 - */ -- (void)tencentDidNotLogin:(BOOL)cancelled; - -/** - * 登录时网络有问题的回调 - */ -- (void)tencentDidNotNetWork; - -@optional -/** - * 登录时权限信息的获得 - */ -- (NSArray *)getAuthorizedPermissions:(NSArray *)permissions withExtraParams:(NSDictionary *)extraParams; - -/** - * unionID获得 - */ -- (void)didGetUnionID; - -@end - -#pragma mark - TencentSessionDelegate(开放接口回调协议) - -/** - * \brief TencentSessionDelegate iOS Open SDK 1.3 API回调协议 - * - * 第三方应用需要实现每条需要调用的API的回调协议 - */ -@protocol TencentSessionDelegate - -@optional - -/** - * 退出登录的回调 - */ -- (void)tencentDidLogout; - -/** - * 因用户未授予相应权限而需要执行增量授权。在用户调用某个api接口时,如果服务器返回操作未被授权,则触发该回调协议接口,由第三方决定是否跳转到增量授权页面,让用户重新授权。 - * \param tencentOAuth 登录授权对象。 - * \param permissions 需增量授权的权限列表。 - * \return 是否仍然回调返回原始的api请求结果。 - * \note 不实现该协议接口则默认为不开启增量授权流程。若需要增量授权请调用\ref TencentOAuth#incrAuthWithPermissions: \n注意:增量授权时用户可能会修改登录的帐号 - */ -- (BOOL)tencentNeedPerformIncrAuth:(TencentOAuth *)tencentOAuth withPermissions:(NSArray *)permissions; - -/** - * [该逻辑未实现]因token失效而需要执行重新登录授权。在用户调用某个api接口时,如果服务器返回token失效,则触发该回调协议接口,由第三方决定是否跳转到登录授权页面,让用户重新授权。 - * \param tencentOAuth 登录授权对象。 - * \return 是否仍然回调返回原始的api请求结果。 - * \note 不实现该协议接口则默认为不开启重新登录授权流程。若需要重新登录授权请调用\ref TencentOAuth#reauthorizeWithPermissions: \n注意:重新登录授权时用户可能会修改登录的帐号 - */ -- (BOOL)tencentNeedPerformReAuth:(TencentOAuth *)tencentOAuth; - -/** - * 用户通过增量授权流程重新授权登录,token及有效期限等信息已被更新。 - * \param tencentOAuth token及有效期限等信息更新后的授权实例对象 - * \note 第三方应用需更新已保存的token及有效期限等信息。 - */ -- (void)tencentDidUpdate:(TencentOAuth *)tencentOAuth; - -/** - * 用户增量授权过程中因取消或网络问题导致授权失败 - * \param reason 授权失败原因,具体失败原因参见sdkdef.h文件中\ref UpdateFailType - */ -- (void)tencentFailedUpdate:(UpdateFailType)reason; - -/** - * 获取用户个人信息回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/getUserInfoResponse.exp success - * 错误返回示例: \snippet example/getUserInfoResponse.exp fail - */ -- (void)getUserInfoResponse:(APIResponse*) response; - - -/** - * 获取用户QZone相册列表回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/getListAlbumResponse.exp success - * 错误返回示例: \snippet example/getListAlbumResponse.exp fail - */ -- (void)getListAlbumResponse:(APIResponse*) response; - -/** - * 获取用户QZone相片列表 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/getListPhotoResponse.exp success - * 错误返回示例: \snippet example/getListPhotoResponse.exp fail - */ -- (void)getListPhotoResponse:(APIResponse*) response; - -/** - * 检查是否是QZone某个用户的粉丝回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/checkPageFansResponse.exp success - * 错误返回示例: \snippet example/checkPageFansResponse.exp fail - */ -- (void)checkPageFansResponse:(APIResponse*) response; - -/** - * 分享到QZone回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/addShareResponse.exp success - * 错误返回示例: \snippet example/addShareResponse.exp fail - */ -- (void)addShareResponse:(APIResponse*) response; - -/** - * 在QZone相册中创建一个新的相册回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/addAlbumResponse.exp success - * 错误返回示例: \snippet example/addAlbumResponse.exp fail - */ -- (void)addAlbumResponse:(APIResponse*) response; - -/** - * 上传照片到QZone指定相册回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/uploadPicResponse.exp success - * 错误返回示例: \snippet example/uploadPicResponse.exp fail - */ -- (void)uploadPicResponse:(APIResponse*) response; - - -/** - * 在QZone中发表一篇日志回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/addOneBlogResponse.exp success - * 错误返回示例: \snippet example/addOneBlogResponse.exp fail - */ -- (void)addOneBlogResponse:(APIResponse*) response; - -/** - * 在QZone中发表一条说说回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/addTopicResponse.exp success - * 错误返回示例: \snippet example/addTopicResponse.exp fail - */ -- (void)addTopicResponse:(APIResponse*) response; - -/** - * 设置QQ头像回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/setUserHeadpicResponse.exp success - * 错误返回示例: \snippet example/setUserHeadpicResponse.exp fail - */ -- (void)setUserHeadpicResponse:(APIResponse*) response; - -/** - * 获取QQ会员信息回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \remarks 正确返回示例: \snippet example/getVipInfoResponse.exp success - * 错误返回示例: \snippet example/getVipInfoResponse.exp fail - */ -- (void)getVipInfoResponse:(APIResponse*) response; - -/** - * 获取QQ会员详细信息回调 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - */ -- (void)getVipRichInfoResponse:(APIResponse*) response; - -/** - * sendStory分享的回调(已废弃,使用responseDidReceived:forMessage:) - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - */ -- (void)sendStoryResponse:(APIResponse*) response; - - -/** - * 社交API统一回调接口 - * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse - * \param message 响应的消息,目前支持‘SendStory’,‘AppInvitation’,‘AppChallenge’,‘AppGiftRequest’ - */ -- (void)responseDidReceived:(APIResponse*)response forMessage:(NSString *)message; - -/** - * post请求的上传进度 - * \param tencentOAuth 返回回调的tencentOAuth对象 - * \param bytesWritten 本次回调上传的数据字节数 - * \param totalBytesWritten 总共已经上传的字节数 - * \param totalBytesExpectedToWrite 总共需要上传的字节数 - * \param userData 用户自定义数据 - */ -- (void)tencentOAuth:(TencentOAuth *)tencentOAuth didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite userData:(id)userData; - - -/** - * 通知第三方界面需要被关闭 - * \param tencentOAuth 返回回调的tencentOAuth对象 - * \param viewController 需要关闭的viewController - */ -- (void)tencentOAuth:(TencentOAuth *)tencentOAuth doCloseViewController:(UIViewController *)viewController; - -@end - -#pragma mark - TencentWebViewDelegate(H5登录webview旋转方向回调) - -/** - * \brief TencentWebViewDelegate: H5登录webview旋转方向回调协议 - * - * 第三方应用可以根据自己APP的旋转方向限制,通过此协议设置 - */ -@protocol TencentWebViewDelegate -@optional -- (BOOL) tencentWebViewShouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation; -- (NSUInteger) tencentWebViewSupportedInterfaceOrientationsWithWebkit; -- (BOOL) tencentWebViewShouldAutorotateWithWebkit; -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentOAuthObject.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentOAuthObject.h deleted file mode 100644 index 2fc3a65a..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/TencentOAuthObject.h +++ /dev/null @@ -1,452 +0,0 @@ -/// -/// \file TencentOAuthObject.h -/// 对开放接口的调用提供参数字典封装的辅助类 -/// -/// Created by Tencent on 12-12-28. -/// Copyright (c) 2012年 Tencent. All rights reserved. -/// - -#import -#import -#import "sdkdef.h" - - -#pragma mark - -#pragma mark TCAddTopicDic - -/** - * \brief 发表说说的参数字典定义 - * - * 可以直接填写相应参数后将对象当作参数传入API中 - */ -@interface TCAddTopicDic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCAddTopicDic *) dictionary; - -/** - * 发布心情时引用的信息的类型。 - * \note 1表示图片; 2表示网页; 3表示视频 - */ -@property (nonatomic, retain) TCOptionalStr paramRichtype; - -/** - * 发布心情时引用的信息的值。有richtype时必须有richval - * - * \note - * -# 当richtype为图片(即richtype为1,应用场景为发布心情时引用某张图片)时,\n - * richval需要传入该图片的相关参数。引用的图片来源分为两种:一种为网站图片,\n - * 一种为QQ空间相册中的某张图片。 - * - 当引用的图片来自网站,richval包含下列参数的值:\n - * | 参数名称 | 是否必须 | 类型 | 描述 | - * | ------ | ------- | ------ | ----------------- | - * | url | 必须 | string | 网站图片的URL | - * | height | 必须 | string | 图片高度,单位: px | - * | width | 必须 | string | 图片宽度,单位: px | - * \n - * 输入时每个值中间用“&”分隔,如下所示:\n - * “url=http://qq.com/logo.png&width=25&height=21” - * - * - 当引用的图片来自QQ空间相册,richval包含下列参数的值。\n - * 这些值都需要通过调用相册OpenAPI来获得。参数意义如下:\n - * | 参数名称 | 是否必须 | 类型 | 描述 | - * | --------- | ------ | ------ | ---------------------------------- | - * | albumid | 必须 | string | 图片所属空间相册的ID | - * | pictureid | 必须 | string | 图片ID | - * | sloc | 必须 | string | 小图ID | - * | pictype | | string | 图片类型(JPG = 1;GIF = 2;PNG = 3) | - * | picheight | | string | 图片高度,单位: px | - * | picwidth | | string | 图片宽度,单位: px | - * 输入时每个值中间用逗号分隔,如下所示 :\n - * “albumid,pictureid,sloc,pictype,picheight,picwidth” - * -# 当richtype为网页(即richtype为2,应用场景为针对某网页发表评论)时,\n - * richval需要传入该网页的URL,发表为feeds时,后台会自动将该URL转换为短URL。 - * -# 当richtype为视频(即richtype为3,应用场景为针对某视频发表评论)时,\n - * richval需要传入该视频的URL,发表为feeds时,后台会对该URL进行解析,\n - * 在feeds上显示播放器,视频源及缩略图。 - */ -@property (nonatomic, retain) TCOptionalStr paramRichval; - -/** - * 发布的心情的内容。 - */ -@property (nonatomic, retain) TCRequiredStr paramCon; - -/** - * 地址文。例如:广东省深圳市南山区高新科技园腾讯大厦。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。 - */ -@property (nonatomic, retain) TCOptionalStr paramLbs_nm; - -/** - * 经度。-180.0到+180.0,+表示东经。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。 - */ -@property (nonatomic, retain) TCOptionalStr paramLbs_x; - -/** - * 纬度。-90.0到+90.0,+表示北纬。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。 - */ -@property (nonatomic, retain) TCOptionalStr paramLbs_y; - -/** - * 第三方应用的平台类型。 - * \note 1表示QQ空间; 2表示腾讯朋友; 3表示腾讯微博平台; 4表示腾讯Q+平台。 - */ -@property (nonatomic, retain) TCOptionalStr paramThirdSource; -@end - - -#pragma mark - -#pragma mark TCAddOneBlogDic -/** - * \brief 发表日志的参数字典定义 - * - * 可以直接填写相应参数后将对象当作参数传入API中 - */ -@interface TCAddOneBlogDic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCAddOneBlogDic *) dictionary; - -/** - * 日志标题(纯文本,最大长度128个字节,utf-8编码)。 - */ -@property (nonatomic, retain) TCRequiredStr paramTitle; - -/** - * content 文章内容(html数据,最大长度100*1024个字节,utf-8编码) - */ -@property (nonatomic, retain) TCRequiredStr paramContent; -@end - -#pragma mark - -#pragma mark TCAddAlbumDic -/** - * \brief 创建空间相册的参数字典定义 - * - * 可以直接填写相应参数后将对象当作参数传入API中 - */ -@interface TCAddAlbumDic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCAddAlbumDic *) dictionary; - -/** - * albumname 必须 string 相册名 不能超过30个字符。 - */ -@property (nonatomic, retain) TCRequiredStr paramAlbumname; - - -/** - * albumdesc string 相册描述,不能超过200个字符。 - */ -@property (nonatomic, retain) TCOptionalStr paramAlbumdesc; - -/** - * priv string 相册权限 - * - * \note 其取值含义为: 1=公开;3=只主人可见; 4=QQ好友可见; 5=问答加密。\n - * 不传则相册默认为公开权限。\n - * 如果priv取值为5,即相册是问答加密的,则必须包含问题和答案两个参数:\n - * - question: 问题,不能超过30个字符。 - * - answer: 答案,不能超过30个字符。 - */ -@property (nonatomic, retain) TCOptionalStr paramPriv; - -/** - * question 问题,不能超过30个字符。 - * \note 如果priv取值为5,必须包含这个参数: - **/ -@property (nonatomic, retain) TCOptionalStr paramQuestion; - -/** - * answer 答案,不能超过30个字符。 - * \note 如果priv取值为5,必须包含这个参数: - **/ -@property (nonatomic, retain) TCOptionalStr paramAnswer; - -@end - -#pragma mark - -#pragma mark TCUploadPicDic -/** - * \brief 上传一张照片到QQ空间相册的参数字典定义 - * - * 可以直接填写相应参数后将对象当作参数传入API中 - */ -@interface TCUploadPicDic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCUploadPicDic *) dictionary; - -/** - * photodesc string 照片描述,注意照片描述不能超过200个字符。 - */ -@property (nonatomic, retain) TCOptionalStr paramPhotodesc; -/** - * string 照片的命名,必须以.jpg, .gif, .png, .jpeg, .bmp此类后缀结尾。 - */ -@property (nonatomic, retain) TCOptionalStr paramTitle; - -/** - * string 相册id。可不填,不填时则根据“mobile”标识选择默认上传的相册。 - */ -@property (nonatomic, retain) TCOptionalStr paramAlbumid; - -/** - * 标志位 - * - * \note 0表示PC,1表示手机。用于当不传相册id时(即albumid为空时)控制是否传到手机相册。\n - * -# 如果传1,则当albumid为空时,图片会上传到手机相册; - * -# 如果不传或传0,则当albumid为空时,图片会上传到贴图相册; - */ -@property (nonatomic, assign) TCOptionalStr paramMobile; - -/** - * x string 照片拍摄时的地理位置的经度。请使用原始数据(纯经纬度,0-360)。 - */ -@property (nonatomic, retain) TCOptionalStr paramX; - -/** - * y string 照片拍摄时的地理位置的纬度。请使用原始数据(纯经纬度,0-360)。 - */ -@property (nonatomic, retain) TCOptionalStr paramY; - -/** - * picture 必须 string 上传照片的文件名以及图片的内容(在发送请求时,图片内容以二进制数据流的形式发送,见下面的请求示例),注意照片名称不能超过30个字符。 - */ -@property (nonatomic, retain) TCRequiredImage paramPicture; - -/** - * needfeed int 标识上传照片时是否要发feed - * \note(0:不发feed; 1:发feed)。如果不填则默认为发feed。 - */ -@property (nonatomic, assign)TCOptionalStr paramNeedfeed; - -/** - * successnum int 批量上传照片时,已成功上传的张数,指明上传完成情况。 - * \note 单张上传时可以不填,不填则默认为0。 - */ -@property (nonatomic, assign)TCOptionalStr paramSuccessnum; - -/** - * picnum int 批量上传照片的总张数,如果不填则默认为1。 - * \note - * - 如果picnum=1,为单张上传,发送单张上传feed; - * - 如果picnum>1,为批量上传,发送批量上传feed。 - * 批量上传方式:picnum为一次上传照片的张数,successnum初始值为0,每调用一次照片上传接口后递增其值。 - * 信息中心中的feed表现形式:批量上传时最新的7张在feed中展示。其中最新上传的一张图片展示为大图,剩下的 - * 六张按从新到旧的顺序展示为小图,其他图片不在feed中展示。 - */ -@property (nonatomic, assign)TCOptionalStr paramPicnum; - -@end - -#pragma mark - -#pragma mark TCAddShareDic -/** - * \brief 同步分享到QQ空间,腾讯微博的参数字典定义 - * - * 可以直接填写相应参数后将对象当作参数传入API中 - */ -@interface TCAddShareDic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCAddShareDic *) dictionary; - -/** - * title 必须 string feeds的标题 最长36个中文字,超出部分会被截断。 - */ -@property (nonatomic, retain) TCRequiredStr paramTitle; - - -/** - * url 必须 string 分享所在网页资源的链接,点击后跳转至第三方网页,对应上文接口说明中2的超链接。请以http://开头。 - */ -@property (nonatomic, retain) TCRequiredStr paramUrl; - - -/** - * comment string 用户评论内容,也叫发表分享时的分享理由 禁止使用系统生产的语句进行代替。 - * 最长40个中文字,超出部分会被截断。 - */ -@property (nonatomic, retain) TCOptionalStr paramComment; - - -/** - * summary string 所分享的网页资源的摘要内容,或者是网页的概要描述 最长80个中文字,超出部分会被截断。 - */ -@property (nonatomic, retain) TCOptionalStr paramSummary; - -/** - * images string 所分享的网页资源的代表性图片链接",请以http://开头,长度限制255字符。多张图片以竖线(|)分隔,目前只有第一张图片有效,图片规格100*100为佳。 - */ -@property (nonatomic, retain) TCOptionalStr paramImages; - -/** - * type string 分享内容的类型。 - * - * \note 4表示网页;5表示视频(type=5时,必须传入playurl) - */ -@property (nonatomic, retain) TCOptionalStr paramType; - -/** - * playurl string 长度限制为256字节。仅在type=5的时候有效,表示视频的swf播放地址。 - */ -@property (nonatomic, retain) TCOptionalStr paramPlayurl; - -/** - * site 必须 string 分享的来源网站名称,请填写网站申请接入时注册的网站名称 - */ -@property (nonatomic, retain) TCRequiredStr paramSite; - -/** - * fromurl 必须 string 分享的来源网站对应的网站地址url 请以http://开头。 - */ -@property (nonatomic, retain) TCRequiredStr paramFromurl; - -/** - * nswb string 值为1时,表示分享不默认同步到微博,其他值或者不传此参数表示默认同步到微博。 - */ -@property (nonatomic, retain) TCOptionalStr paramNswb; - -@end - -#pragma mark - -#pragma mark TCCheckPageFansDic -/** - * \brief 验证是否认证空间粉丝tttyttyyyu的参数字典定义 - * - * 可以直接填写相应参数后将对象当作参数传入API中 - */ -@interface TCCheckPageFansDic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCCheckPageFansDic *) dictionary; - -/** - * 表示认证空间的QQ号码 - */ -@property (nonatomic, retain) TCRequiredStr paramPage_id; -@end - -#pragma mark - -#pragma mark TCSetUserHeadpic -/** - * \brief 设置用户头像 - * - * 可以直接填写相应参数后将对象当作参数传入API中 - */ -@interface TCSetUserHeadpic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCSetUserHeadpic *) dictionary; - -/** - * 设置用户头像的图片 - */ -@property (nonatomic, retain) TCRequiredImage paramImage; - -/** - * 图片的文件名 - */ -@property (nonatomic, retain) TCOptionalStr paramFileName; -@end - -#pragma mark - -#pragma mark TCListPhotoDic - -/** - * \brief 获取用户QQ空间相册中的照片列表 - * - * 可以直接填写相应参数后将对象当作参数传入API中 - */ -@interface TCListPhotoDic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCListPhotoDic *) dictionary; - -/** - * 表示要获取的照片列表所在的相册ID - */ -@property (nonatomic, retain) TCRequiredStr paramAlbumid; - -@end - -#pragma mark - -#pragma mark TCSendStoryDic -/** - * \brief QQ空间定向分享的参数字典定义 - * - * 该分享支持@到指定好友,最多支持10个好友。 - * 其中第三方应用可预传最多5个指定好友的openid,其余好友由用户自行选择。 - * 该分享形式仅提供跳QZone分享和本地Html5分享两种形式。 - * sendStroy不支持userData参数 - */ -@interface TCSendStoryDic : TCAPIRequest - -/** - * 返回一个对象用来进行API参数的填充 - * - * \note 不用释放,返回的对象是自动释放的 - */ -+ (TCSendStoryDic *) dictionary; - -/** - * 分享的标题 - */ -@property (nonatomic, retain) TCRequiredStr paramTitle; - -/** - * 故事摘要,最多不超过50个汉字,可以为空 - */ -@property (nonatomic, retain) TCOptionalStr paramSummary; - -/** - * 默认展示在输入框里的分享理由,最多120个汉字,可以为空 - */ -@property (nonatomic, retain) TCOptionalStr paramDescription; - -/** - * 图片url - */ -@property (nonatomic, retain) TCOptionalStr paramPics; - -/** - * 如果不填,则默认为"进入应用" - */ -@property (nonatomic, retain) TCRequiredStr paramAct; - -/** - * 点击分享的Url - */ -@property (nonatomic, retain) TCOptionalStr paramShareUrl; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/sdkdef.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/sdkdef.h deleted file mode 100644 index 0eefc788..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Headers/sdkdef.h +++ /dev/null @@ -1,444 +0,0 @@ -/// -/// \file sdkdef.h -/// \brief SDK中相关常量定义 -/// -/// Created by Tencent on 12-12-25. -/// Copyright (c) 2012年 Tencent. All rights reserved. -/// - -#import -#import - -/** - * \brief 设置sdk的log等级 - */ -typedef enum { - TCOLogLevel_Disabled = -1, // 关闭所有log - TCOLogLevel_Error = 0, - TCOLogLevel_Warning, - TCOLogLevel_Info, - TCOLogLevel_Debug, -} TCOLogLevel; - -/** - * \brief 手机qq的当前版本 - */ -typedef enum QQVersion -{ - kQQUninstall, - kQQVersion3_0, - kQQVersion4_0, //支持sso登陆 - kQQVersion4_2_1, //ios7兼容 - kQQVersion4_5, //4.5版本,wpa会话 - kQQVersion4_6, //4.6版本,sso登陆信令通道切换 - kQQVersion4_7, //4.7版本 不确定新支持了什么样的属性 -} QQVersion; - - -/** - * \breif TIM的当前版本 - */ -typedef enum TIMVersion { - kTIMUinstall, - kTIMVersion1_1, -}TIMVersion; - -/** - * \breif 授权/分享 方式 - */ -typedef enum TencentAuthShareType { - AuthShareType_QQ, - AuthShareType_TIM, -}TencentAuthShareType; - -/** - * \brief APIResponse.retCode可能的枚举常量 - */ -typedef enum -{ - URLREQUEST_SUCCEED = 0, /**< 网络请求成功发送至服务器,并且服务器返回数据格式正确 - * \note 这里包括所请求业务操作失败的情况,例如没有授权等原因导致 - */ - - URLREQUEST_FAILED = 1, /**< 网络异常,或服务器返回的数据格式不正确导致无法解析 */ -} REPONSE_RESULT; - -/** - * \brief 增量授权失败原因 - * - * \note 增量授权失败不影响原token的有效性(原token已失效的情况除外) - */ -typedef enum -{ - kUpdateFailUnknown = 1, ///< 未知原因 - kUpdateFailUserCancel, ///< 用户取消 - kUpdateFailNetwork, ///< 网络问题 -} UpdateFailType; - -/** - * \brief 封装服务器返回的结果 - * - * APIResponse用于封装所有请求的返回结果,包括错误码、错误信息、原始返回数据以及返回数据的json格式字典 - */ -@interface APIResponse : NSObject { - int _detailRetCode; - int _retCode; - int _seq; - NSString *_errorMsg; - NSDictionary *_jsonResponse; - NSString *_message; - id _userData; -} - -/** - * 新增的详细错误码\n - * detailRetCode主要用于区分不同的错误情况,参见\ref OpenSDKError - */ -@property (nonatomic, assign) int detailRetCode; - -/** - * 网络请求是否成功送达服务器,以及服务器返回的数据格式是否正确\n - * retCode具体取值可参考\ref REPONSE_RESULT - */ -@property (nonatomic, assign) int retCode; - -/** - * 网络请求对应的递增序列号,方便内部管理 - */ -@property (nonatomic, assign) int seq; - -/** - * 错误提示语 - */ -@property (nonatomic, retain) NSString *errorMsg; - -/** - * 服务器返回数据的json格式字典\n - * 字典内具体参数的命名和含义请参考\ref api_spec - */ -@property (nonatomic, retain) NSDictionary *jsonResponse; - -/** - * 服务器返回的原始数据字符串 - */ -@property (nonatomic, retain) NSString *message; - -/** - * 用户保留数据 - */ -@property (nonatomic, retain) id userData; - -@end - - -/** - * 用户自定义的保留字段 - */ -FOUNDATION_EXTERN NSString * const PARAM_USER_DATA; - -/** - * \name 应用邀请参数字段定义 - */ -///@{ - -/** 应用邀请展示图片url的key */ -FOUNDATION_EXTERN NSString * const PARAM_APP_ICON; - -/** 应用邀请描述文本的key */ -FOUNDATION_EXTERN NSString * const PARAM_APP_DESC; - -/** 应用邀请好友列表的key */ -FOUNDATION_EXTERN NSString * const PARAM_APP_INVITED_OPENIDS; - -///@} - -/** - * \name sendStory新分享参数字段定义 - */ -///@{ - -/** 预填入接受人列表的key */ -FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_RECEIVER; - -/** 分享feeds标题的key */ -FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_TITLE; - -/** 分享feeds评论内容的key */ -FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_COMMENT; - -/** 分享feeds摘要的key */ -FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_SUMMARY; - -/** 分享feeds展示图片url的key */ -FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_IMAGE; - -/** 分享feeds跳转链接url的key */ -FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_URL; - -/** 分享feeds点击操作默认行为的key */ -FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_ACT; - -///@} - -/** - * \name 设置头像参数字段定义 - */ -///@{ - -/** 头像图片数据的key */ -FOUNDATION_EXTERN NSString * const PARAM_SETUSERHEAD_PIC; - -/** 头像图片文件名的key */ -FOUNDATION_EXTERN NSString * const PARAM_SETUSERHEAD_FILENAME; - -///@} - -/** - * \name 服务器返回数据的参数字段定义 - */ -///@{ - -/** 服务器返回码的key */ -FOUNDATION_EXTERN NSString * const PARAM_RETCODE; - -/** 服务器返回错误信息的key */ -FOUNDATION_EXTERN NSString * const PARAM_MESSAGE; - -/** 服务器返回额外数据的key */ -FOUNDATION_EXTERN NSString * const PARAM_DATA; - -///@} - -/** - * \name 错误信息相关常量定义 - */ -///@{ - -/** 详细错误信息字典中额外信息的key */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyExtraInfo; - -/** 详细错误信息字典中返回码的key */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyRetCode; - -/** 详细错误信息字典中错误语句的key */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyMsg; - -/** 不支持的接口 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUnsupportedAPI; - -/** 操作成功 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgSuccess; - -/** 未知错误 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUnknown; - -/** 用户取消 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUserCancel; - -/** 请重新登录 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgReLogin; - -/** 应用没有操作权限 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgOperationDeny; - -/** 网络异常或没有网络 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgNetwork; - -/** URL格式或协议错误 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgURL; - -/** 解析数据出错 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgDataParse; - -/** 传入参数有误 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgParam; - -/** 连接超时 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgTimeout; - -/** 安全问题 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgSecurity; - -/** 文件读写错误 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgIO; - -/** 服务器端错误 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgServer; - -/** 页面错误 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgWebPage; - -/** 设置头像图片过大 */ -FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUserHeadPicLarge; - -///@} - -/** - * \brief SDK新增详细错误常量 - */ -typedef enum -{ - kOpenSDKInvalid = -1, ///< 无效的错误码 - kOpenSDKErrorUnsupportedAPI = -2, ///< 不支持的接口 - - /** - * \name CommonErrorCode - * 公共错误码 - */ - ///@{ - kOpenSDKErrorSuccess = 0, ///< 成功 - kOpenSDKErrorUnknown, ///< 未知错误 - kOpenSDKErrorUserCancel, ///< 用户取消 - kOpenSDKErrorReLogin, ///< token无效或用户未授权相应权限需要重新登录 - kOpenSDKErrorOperationDeny, ///< 第三方应用没有该api操作的权限 - ///@} - - /** - * \name NetworkRelatedErrorCode - * 网络相关错误码 - */ - ///@{ - kOpenSDKErrorNetwork, ///< 网络错误,网络不通或连接不到服务器 - kOpenSDKErrorURL, ///< URL格式或协议错误 - kOpenSDKErrorDataParse, ///< 数据解析错误,服务器返回的数据解析出错 - kOpenSDKErrorParam, ///< 传入参数错误 - kOpenSDKErrorConnTimeout, ///< http连接超时 - kOpenSDKErrorSecurity, ///< 安全问题 - kOpenSDKErrorIO, ///< 下载和文件IO错误 - kOpenSDKErrorServer, ///< 服务器端错误 - ///@} - - /** - * \name WebViewRelatedError - * webview特有错误 - */ - ///@{ - kOpenSDKErrorWebPage, ///< 页面错误 - ///@} - - /** - * \name SetUserHeadRelatedErrorCode - * 设置头像自定义错误码段 - */ - ///@{ - kOpenSDKErrorUserHeadPicLarge = 0x010000, ///< 图片过大 设置头像自定义错误码 - ///@} -} OpenSDKError; - -/** - * \name SDK版本(v1.3)支持的授权列表常量 - */ -///@{ - -/** 发表一条说说到QQ空间(需要申请权限) */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_TOPIC; - -/** 发表一篇日志到QQ空间(需要申请权限) */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_ONE_BLOG; - -/** 创建一个QQ空间相册(需要申请权限) */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_ALBUM; - -/** 上传一张照片到QQ空间相册(需要申请权限) */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_UPLOAD_PIC; - -/** 获取用户QQ空间相册列表(需要申请权限) */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_LIST_ALBUM; - -/** 同步分享到QQ空间、腾讯微博 */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_SHARE; - -/** 验证是否认证空间粉丝 */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_CHECK_PAGE_FANS; - -/** 获取登录用户自己的详细信息 */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_INFO; - -/** 获取其他用户的详细信息 */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_OTHER_INFO; - -/** 获取会员用户基本信息 */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_VIP_INFO; - -/** 获取会员用户详细信息 */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_VIP_RICH_INFO; - -/** 获取用户信息 */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_USER_INFO; - -/** 移动端获取用户信息 */ -FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_SIMPLE_USER_INFO; -///@} - - -/** - * \name CGI接口相关参数类型定义 - */ -///@{ - -/** 必填的字符串类型参数 */ -typedef NSString *TCRequiredStr; - -/** 必填的UIImage类型参数 */ -typedef UIImage *TCRequiredImage; - -/** 必填的整型参数 */ -typedef NSInteger TCRequiredInt; - -/** 必填的数字类型 */ -typedef NSNumber *TCRequiredNumber; - -/** 必填的NSData参数 */ -typedef NSData *TCRequiredData; - -/** 可选的字符串类型参数 */ -typedef NSString *TCOptionalStr; - -/** 可选的UIImage类型参数 */ -typedef UIImage *TCOptionalImage; - -/** 可选的整型参数 */ -typedef NSInteger TCOptionalInt; - -/** 可选的数字类型 */ -typedef NSNumber *TCOptionalNumber; - -/** 可选的不定类型参数 */ -typedef id TCRequiredId; -///@} - - -/** - * \brief CGI请求的参数字典封装辅助基类 - * - * 将相应属性的值以key-value的形式保存到参数字典中 - */ -@interface TCAPIRequest : NSMutableDictionary - -/** CGI请求的URL地址 */ -@property (nonatomic, readonly) NSURL *apiURL; - -/** CGI请求方式:"GET","POST" */ -@property (nonatomic, readonly) NSString *method; - -/** - * API参数中的保留字段,可以塞入任意字典支持的类型,再调用完成后会带回给调用方 - */ -@property (nonatomic, retain) TCRequiredId paramUserData; - -/** - * APIResponse,API的返回结果 - */ -@property (nonatomic, readonly) APIResponse *response; - -/** 取消相应的CGI请求任务 */ -- (void)cancel; - -@end - -@protocol TCAPIRequestDelegate -@optional -- (void)cgiRequest:(TCAPIRequest *)request didResponse:(APIResponse *)response; - -@end - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Resources/ios_open_sdk_3.2.1.473_iphone_release b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/Resources/ios_open_sdk_3.2.1.473_iphone_release deleted file mode 100644 index e69de29b..00000000 diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/TencentOpenAPI b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/TencentOpenAPI deleted file mode 100644 index 74c8d13a..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenAPI.framework/TencentOpenAPI and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/Info.plist b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/Info.plist deleted file mode 100644 index f14efab9..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/Info.plist and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/error.png b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/error.png deleted file mode 100644 index b0ce4613..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/error.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/local.html b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/local.html deleted file mode 100644 index 73f1a732..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/local.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - -社交渠道 - - - - - - -
    - - - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/qqicon.png b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/qqicon.png deleted file mode 100644 index 65c743ce..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/qqicon.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/success.png b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/success.png deleted file mode 100644 index df3899dc..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle/success.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/UMSocialQQHandler.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/UMSocialQQHandler.h deleted file mode 100644 index c0883f75..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/UMSocialQQHandler.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// UMSQQDataTypeTableViewController.h -// SocialSDK -// -// Created by umeng on 16/4/15. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import - -@interface UMSocialQQHandler : UMSocialHandler - -+ (UMSocialQQHandler *)defaultManager; - -/** QQ是否支持网页分享 - * @param support 是否支持 - */ -- (void)setSupportWebView:(BOOL)support __deprecated; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/libSocialQQ.a b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/libSocialQQ.a deleted file mode 100644 index 8f400f22..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/QQ/libSocialQQ.a and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WBHttpRequest+WeiboToken.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WBHttpRequest+WeiboToken.h deleted file mode 100755 index 2457efed..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WBHttpRequest+WeiboToken.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// WBHttpRequest+WeiboToken.h -// WeiboSDK -// -// Created by DannionQiu on 14/11/6. -// Copyright (c) 2014年 SINA iOS Team. All rights reserved. -// - -#import "WBHttpRequest.h" - -@interface WBHttpRequest (WeiboToken) -/*! - @method - - @abstract - 使用RefreshToken去换取新的身份凭证AccessToken. - - @discussion - 在SSO授权登录后,服务器会下发有效期为7天的refreshToken以及有效期为1天的AccessToken。 - 当有效期为1天的AccessToken过期时,可以调用该接口带着refreshToken信息区换取新的AccessToken。 - @param refreshToken refreshToken - - @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 - - @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 - */ -+ (WBHttpRequest *)requestForRenewAccessTokenWithRefreshToken:(NSString*)refreshToken - queue:(NSOperationQueue*)queue - withCompletionHandler:(WBRequestHandler)handler; -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WBHttpRequest.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WBHttpRequest.h deleted file mode 100755 index c3934f53..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WBHttpRequest.h +++ /dev/null @@ -1,181 +0,0 @@ -// -// WBHttpRequest.h -// WeiboSDK -// -// Created by DannionQiu on 14-9-18. -// Copyright (c) 2014年 SINA iOS Team. All rights reserved. -// - -#import -#import - -#pragma mark - WBHttpRequest and WBHttpRequestDelegate -@class WBHttpRequest; - -/** - 接收并处理来自微博sdk对于网络请求接口的调用响应 以及logOutWithToken的请求 - */ -@protocol WBHttpRequestDelegate - -/** - 收到一个来自微博Http请求的响应 - - @param response 具体的响应对象 - */ -@optional -- (void)request:(WBHttpRequest *)request didReceiveResponse:(NSURLResponse *)response; - -/** - 收到一个来自微博Http请求失败的响应 - - @param error 错误信息 - */ -@optional -- (void)request:(WBHttpRequest *)request didFailWithError:(NSError *)error; - -/** - 收到一个来自微博Http请求的网络返回 - - @param result 请求返回结果 - */ -@optional -- (void)request:(WBHttpRequest *)request didFinishLoadingWithResult:(NSString *)result; - -/** - 收到一个来自微博Http请求的网络返回 - - @param data 请求返回结果 - */ -@optional -- (void)request:(WBHttpRequest *)request didFinishLoadingWithDataResult:(NSData *)data; - -/** - 收到快速SSO授权的重定向 - - @param URI - */ -@optional -- (void)request:(WBHttpRequest *)request didReciveRedirectResponseWithURI:(NSURL *)redirectUrl; - -@end - - -/** - 微博封装Http请求的消息结构 - - */ -@interface WBHttpRequest : NSObject -{ - NSURLConnection *connection; - NSMutableData *responseData; -} - -/** - 用户自定义请求地址URL - */ -@property (nonatomic, strong) NSString *url; - -/** - 用户自定义请求方式 - - 支持"GET" "POST" - */ -@property (nonatomic, strong) NSString *httpMethod; - -/** - 用户自定义请求参数字典 - */ -@property (nonatomic, strong) NSDictionary *params; - -/** - WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 - */ -@property (nonatomic, weak) id delegate; - -/** - 用户自定义TAG - - 用于区分回调Request - */ -@property (nonatomic, strong) NSString* tag; - -/** - 统一HTTP请求接口 - 调用此接口后,将发送一个HTTP网络请求 - @param url 请求url地址 - @param httpMethod 支持"GET" "POST" - @param params 向接口传递的参数结构 - @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 - @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回 - */ -+ (WBHttpRequest *)requestWithURL:(NSString *)url - httpMethod:(NSString *)httpMethod - params:(NSDictionary *)params - delegate:(id)delegate - withTag:(NSString *)tag; - -/** - 统一微博Open API HTTP请求接口 - 调用此接口后,将发送一个HTTP网络请求(用于访问微博open api) - @param accessToken 应用获取到的accessToken,用于身份验证 - @param url 请求url地址 - @param httpMethod 支持"GET" "POST" - @param params 向接口传递的参数结构 - @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 - @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回 - */ -+ (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken - url:(NSString *)url - httpMethod:(NSString *)httpMethod - params:(NSDictionary *)params - delegate:(id)delegate - withTag:(NSString *)tag; - - - -/** - 取消网络请求接口 - 调用此接口后,将取消当前网络请求,建议同时[WBHttpRequest setDelegate:nil]; - 注意:该方法只对使用delegate的request方法有效。无法取消任何使用block的request的网络请求接口。 - */ -- (void)disconnect; - -#pragma mark - block extension - -typedef void (^WBRequestHandler)(WBHttpRequest *httpRequest, - id result, - NSError *error); - -/** - 统一微博Open API HTTP请求接口 - 调用此接口后,将发送一个HTTP网络请求(用于访问微博open api) - @param url 请求url地址 - @param httpMethod 支持"GET" "POST" - @param params 向接口传递的参数结构 - @param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。 - @param handler 接口请求返回调用的block方法 - */ -+ (WBHttpRequest *)requestWithURL:(NSString *)url - httpMethod:(NSString *)httpMethod - params:(NSDictionary *)params - queue:(NSOperationQueue*)queue - withCompletionHandler:(WBRequestHandler)handler; - - -/** - 统一HTTP请求接口 - 调用此接口后,将发送一个HTTP网络请求 - @param url 请求url地址 - @param httpMethod 支持"GET" "POST" - @param params 向接口传递的参数结构 - @param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。 - @param handler 接口请求返回调用的block方法 - */ -+ (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken - url:(NSString *)url - httpMethod:(NSString *)httpMethod - params:(NSDictionary *)params - queue:(NSOperationQueue*)queue - withCompletionHandler:(WBRequestHandler)handler; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK+Statistics.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK+Statistics.h deleted file mode 100755 index ac4c5797..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK+Statistics.h +++ /dev/null @@ -1,89 +0,0 @@ -// -// WeiboSDK+Statistics.h -// WeiboSDK -// -// Created by DannionQiu on 15/4/13. -// Copyright (c) 2015年 SINA iOS Team. All rights reserved. -// - -#import "WeiboSDK.h" - -@interface WeiboSDK(Statistics) - -/** 设置是否开启统计模式, 默认为NO. - @param value 为YES, SDK会开启统计功能,记录日志,并在合适的实际传上服务器。 - @return void. - */ -+ (void)setStatisticsEnabled:(BOOL)value; - -#pragma mark - Optional Configs Setting -/** 设置是否打印SDK的log信息, 默认NO(不打印log). - @param value 设置为YES, WeiboSDK 会输出log信息可供调试参考. 除非特殊需要,否则发布产品时需改回NO. - @return void. - */ -+ (void)setStatisticsLogEnabled:(BOOL)value; - -/** 设置版本信息. - @param version 版本号,为nil或@""时, 默认为Build号(CFBundleVersion) - @return void. - */ -+ (void)setVersion:(NSString*)version; - -/** 设置渠道信息. - @param channelID 渠道名称, 为nil或@""时, 默认为@"AppStore"渠道 - @return void. - */ -+ (void)setChannelID:(NSString*)channelID; - -/** 设定日志上传的发送间隔 - @param frequecy 单位为秒,最小30秒,最大8*60*60秒(8小时)。默认为180秒(3分钟) - @return void. - */ -+ (void)setUploadFrequecy:(NSTimeInterval)frequecy; - -#pragma mark - Statistics Api -/** 自动页面时长统计, 开始记录某个页面展示时长. - 使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。 - 在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView: - @param pageName 统计的页面名称. - @return void. - */ -+ (void)beginLogPageView:(NSString *)pageName; - -/** 自动页面时长统计, 结束记录某个页面展示时长. - 使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。 - 在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView: - @param pageName 统计的页面名称. - @return void. - */ -+ (void)endLogPageView:(NSString *)pageName; - - -/** 自动事件时长统计, 开始记录某个事示时长. - 使用方法:调用event:函数来完成自动统计。 - @param eventID 统计的事件标识符. - @warning eventID不能使用空格和特殊字符,且长度不能超过255个字符(否则将截取前255个字符) - */ -+ (void)event:(NSString *)eventID; - -/** 自动事件时长统计, 开始记录某个事示时长. - 使用方法:调用event:函数来完成自动统计。 - @param eventID 统计的事件标识符. - @param pageName 事件发生时所在页面. - @param userInfo 事件相关信息. - @return void. - - @warning 每个event的userInfo不能超过10个 - eventID、pageName、userInfo中key和value都不能使用空格和特殊字符,且长度不能超过255个字符(否则将截取前255个字符) - */ -+ (void)event:(NSString *)eventID onPageView:(NSString*)pageName withUserInfo:(NSDictionary*)userInfo; - -/** 强制日志上传 - 调用后,若距离上次成功上传日志时间不小于30秒,立刻上传日志。 - */ -+ (void)forceUploadRecords; - - - - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/common_button_white@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/common_button_white@2x.png deleted file mode 100755 index fa8a56fc..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/common_button_white@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/common_button_white_highlighted@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/common_button_white_highlighted@2x.png deleted file mode 100755 index afae0926..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/common_button_white_highlighted@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/empty_failed@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/empty_failed@2x.png deleted file mode 100755 index 3f368f65..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/images/empty_failed@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/others/mfp.cer b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/others/mfp.cer deleted file mode 100755 index 56dd026f..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle/others/mfp.cer and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.h deleted file mode 100755 index db0feea4..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.h +++ /dev/null @@ -1,573 +0,0 @@ -// -// WeiboSDKHeaders.h -// WeiboSDKDemo -// -// Created by Wade Cheng on 4/3/13. -// Copyright (c) 2013 SINA iOS Team. All rights reserved. -// - -#import -#import - -#import "WBHttpRequest.h" -#import "WBHttpRequest+WeiboToken.h" - -typedef NS_ENUM(NSInteger, WeiboSDKResponseStatusCode) -{ - WeiboSDKResponseStatusCodeSuccess = 0,//成功 - WeiboSDKResponseStatusCodeUserCancel = -1,//用户取消发送 - WeiboSDKResponseStatusCodeSentFail = -2,//发送失败 - WeiboSDKResponseStatusCodeAuthDeny = -3,//授权失败 - WeiboSDKResponseStatusCodeUserCancelInstall = -4,//用户取消安装微博客户端 - WeiboSDKResponseStatusCodePayFail = -5,//支付失败 - WeiboSDKResponseStatusCodeShareInSDKFailed = -8,//分享失败 详情见response UserInfo - WeiboSDKResponseStatusCodeUnsupport = -99,//不支持的请求 - WeiboSDKResponseStatusCodeUnknown = -100, -}; - -@protocol WeiboSDKDelegate; -@protocol WBHttpRequestDelegate; -@class WBBaseRequest; -@class WBBaseResponse; -@class WBMessageObject; -@class WBImageObject; -@class WBBaseMediaObject; -@class WBHttpRequest; - -/** - 微博SDK接口类 - */ -@interface WeiboSDK : NSObject - -/** - 检查用户是否安装了微博客户端程序 - @return 已安装返回YES,未安装返回NO - */ -+ (BOOL)isWeiboAppInstalled; - -/** - 检查用户是否可以通过微博客户端进行分享 - @return 可以使用返回YES,不可以使用返回NO - */ -+ (BOOL)isCanShareInWeiboAPP; - -/** - 检查用户是否可以使用微博客户端进行SSO授权 - @return 可以使用返回YES,不可以使用返回NO - */ -+ (BOOL)isCanSSOInWeiboApp; - -/** - 打开微博客户端程序 - @return 成功打开返回YES,失败返回NO - */ -+ (BOOL)openWeiboApp; - - -/** - 获取微博客户端程序的itunes安装地址 - @return 微博客户端程序的itunes安装地址 - */ -+ (NSString *)getWeiboAppInstallUrl; - -/** - 获取当前微博SDK的版本号 - @return 当前微博SDK的版本号 - */ -+ (NSString *)getSDKVersion; - - -extern NSString * const WeiboSDKGetAidSucessNotification; -extern NSString * const WeiboSDKGetAidFailNotification; -/** - 获取当前微博SDK的aid - 返回的aid值可能为 nil ,当值为 nil 时会尝试获取 aid 值。 - 当获取成功( aid 值变为有效值)时,SDK会发出名为 WeiboSDKGetAidSucessNotification 的通知,通知中带有 aid 值。 - 当获取失败时,SDK会发出名为 WeiboSDKGetAidFailNotification 的通知,通知中带有 NSError 对象。 - @return aid 用于广告的与设备信息相关的标识符 - */ -+ (NSString *)getWeiboAid; - - -/** - 向微博客户端程序注册第三方应用 - @param appKey 微博开放平台第三方应用appKey - @return 注册成功返回YES,失败返回NO - */ -+ (BOOL)registerApp:(NSString *)appKey; - -/** - 处理微博客户端程序通过URL启动第三方应用时传递的数据 - - 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用 - @param url 启动第三方应用的URL - @param delegate WeiboSDKDelegate对象,用于接收微博触发的消息 - @see WeiboSDKDelegate - */ -+ (BOOL)handleOpenURL:(NSURL *)url delegate:(id)delegate; - -/** - 发送请求给微博客户端程序,并切换到微博 - - 请求发送给微博客户端程序之后,微博客户端程序会进行相关的处理,处理完成之后一定会调用 [WeiboSDKDelegate didReceiveWeiboResponse:] 方法将处理结果返回给第三方应用 - - @param request 具体的发送请求 - - @see [WeiboSDKDelegate didReceiveWeiboResponse:] - @see WBBaseResponse - */ -+ (BOOL)sendRequest:(WBBaseRequest *)request; - -/** - 收到微博客户端程序的请求后,发送对应的应答给微博客户端端程序,并切换到微博 - - 第三方应用收到微博的请求后,异步处理该请求,完成后必须调用该函数将应答返回给微博 - - @param response 具体的应答内容 - @see WBBaseRequest - */ -+ (BOOL)sendResponse:(WBBaseResponse *)response; - -/** - 设置WeiboSDK的调试模式 - - 当开启调试模式时,WeiboSDK会在控制台输出详细的日志信息,开发者可以据此调试自己的程序。默认为 NO - @param enabled 开启或关闭WeiboSDK的调试模式 - */ -+ (void)enableDebugMode:(BOOL)enabled; - -/** - 取消授权,登出接口 - 调用此接口后,token将失效 - @param token 第三方应用之前申请的Token - @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 - @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回 - - */ -+ (void)logOutWithToken:(NSString *)token delegate:(id)delegate withTag:(NSString*)tag; - -/** - 呼起微博客户端或打开微博H5页面,SDK自动检测是否安装微博客户端,当调用SDK相关方法时: - - 有的话呼起微博客户端定位到对应界面; - 没有的话打开 webView 加载相应的微博H5页面; - @param uid 用户id - @param mid 微博id - @param aid 文章id -*/ - -//连接到指定用户的微博个人主页,连接后可进行加关注等互动 -+ (void)linkToUser:(NSString *)uid; - -//连接到指定的单条微博详情页,连接后可对这条微博进行转、评、赞等互动 -+ (void)linkToSingleBlog:(NSString *)uid blogID:(NSString *)mid; - -//连接到指定的微博头条文章页 -+ (void)linkToArticle:(NSString *)aid; - -//分享到微博 -+ (void)shareToWeibo:(NSString *)content; - -//评论指定的微博 -+ (void)commentToWeibo:(NSString *)mid; - -//连接到微博搜索内容流 -+ (void)linkToSearch:(NSString *)keyword; - -//连接到我的微博消息流 -+ (void)linkToTimeLine; - -//连接到我的微博个人主页 -+ (void)linkToProfile; - -@end - -/** - 接收并处理来至微博客户端程序的事件消息 - */ -@protocol WeiboSDKDelegate - -/** - 收到一个来自微博客户端程序的请求 - - 收到微博的请求后,第三方应用应该按照请求类型进行处理,处理完后必须通过 [WeiboSDK sendResponse:] 将结果回传给微博 - @param request 具体的请求对象 - */ -- (void)didReceiveWeiboRequest:(WBBaseRequest *)request; - -/** - 收到一个来自微博客户端程序的响应 - - 收到微博的响应后,第三方应用可以通过响应类型、响应的数据和 WBBaseResponse.userInfo 中的数据完成自己的功能 - @param response 具体的响应对象 - */ -- (void)didReceiveWeiboResponse:(WBBaseResponse *)response; - -@end - - -#pragma mark - DataTransferObject and Base Request/Response - -/** - 微博客户端程序和第三方应用之间传输数据信息的基类 - */ -@interface WBDataTransferObject : NSObject - -/** - 自定义信息字典,用于数据传输过程中存储相关的上下文环境数据 - - 第三方应用给微博客户端程序发送 request 时,可以在 userInfo 中存储请求相关的信息。 - - @warning userInfo中的数据必须是实现了 `NSCoding` 协议的对象,必须保证能序列化和反序列化 - @warning 序列化后的数据不能大于10M - */ -@property (nonatomic, strong) NSDictionary *userInfo; - - -/** - 发送该数据对象的SDK版本号 - - 如果数据对象是自己生成的,则sdkVersion为当前SDK的版本号;如果是接收到的数据对象,则sdkVersion为数据发送方SDK版本号 - */ -@property (strong, nonatomic, readonly) NSString *sdkVersion; - - -/** - 当用户没有安装微博客户端程序时是否提示用户打开微博安装页面 - - 如果设置为YES,当用户未安装微博时会弹出Alert询问用户是否要打开微博App的安装页面。默认为YES - */ -@property (nonatomic, assign) BOOL shouldOpenWeiboAppInstallPageIfNotInstalled; - - -@end - - -/** - 微博SDK所有请求类的基类 - */ -@interface WBBaseRequest : WBDataTransferObject - -/** - 返回一个 WBBaseRequest 对象 - - @return 返回一个*自动释放的*WBBaseRequest对象 - */ -+ (id)request; - -@end - - -/** - 微博SDK所有响应类的基类 - */ -@interface WBBaseResponse : WBDataTransferObject - -/** - 对应的 request 中的自定义信息字典 - - 如果当前 response 是由微博客户端响应给第三方应用的,则 requestUserInfo 中会包含原 request.userInfo 中的所有数据 - - @see WBBaseRequest.userInfo - */ -@property (strong, nonatomic, readonly) NSDictionary *requestUserInfo; - -/** - 响应状态码 - - 第三方应用可以通过statusCode判断请求的处理结果 - */ -@property (nonatomic, assign) WeiboSDKResponseStatusCode statusCode; - -/** - 返回一个 WBBaseResponse 对象 - - @return 返回一个*自动释放的*WBBaseResponse对象 - */ -+ (id)response; - -@end - -#pragma mark - Authorize Request/Response - -/** - 第三方应用向微博客户端请求认证的消息结构 - - 第三方应用向微博客户端申请认证时,需要调用 [WeiboSDK sendRequest:] 函数, 向微博客户端发送一个 WBAuthorizeRequest 的消息结构。 - 微博客户端处理完后会向第三方应用发送一个结构为 WBAuthorizeResponse 的处理结果。 - */ -@interface WBAuthorizeRequest : WBBaseRequest - -/** - 微博开放平台第三方应用授权回调页地址,默认为`http://` - - 参考 http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#.E5.AE.A2.E6.88.B7.E7.AB.AF.E9.BB.98.E8.AE.A4.E5.9B.9E.E8.B0.83.E9.A1.B5 - - @warning 必须保证和在微博开放平台应用管理界面配置的“授权回调页”地址一致,如未进行配置则默认为`http://` - @warning 不能为空,长度小于1K - */ -@property (nonatomic, strong) NSString *redirectURI; - -/** - 微博开放平台第三方应用scope,多个scrope用逗号分隔 - - 参考 http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#scope - - @warning 长度小于1K - */ -@property (nonatomic, strong) NSString *scope; - -/** - 当用户没有安装微博客户端或微博客户端过低无法支持SSO的时候是否弹出SDK自带的Webview进行授权 - - 如果设置为YES,当用户没有安装微博客户端或微博客户端过低无法支持SSO的时候会自动弹出SDK自带的Webview进行授权。 - - 如果设置为NO,会根据 shouldOpenWeiboAppInstallPageIfNotInstalled 属性判断是否弹出安装/更新微博的对话框 - - 默认为YES - */ -@property (nonatomic, assign) BOOL shouldShowWebViewForAuthIfCannotSSO; - -@end - - -/** - 微博客户端处理完第三方应用的认证申请后向第三方应用回送的处理结果 - - WBAuthorizeResponse 结构中仅包含常用的 userID 、accessToken 和 expirationDate 信息,其他的认证信息(比如部分应用可以获取的 refresh_token 信息)会统一存放到 userInfo 中 - */ -@interface WBAuthorizeResponse : WBBaseResponse - -/** - 用户ID - */ -@property (nonatomic, strong) NSString *userID; - -/** - 认证口令 - */ -@property (nonatomic, strong) NSString *accessToken; - -/** - 认证过期时间 - */ -@property (nonatomic, strong) NSDate *expirationDate; - -/** - 当认证口令过期时用于换取认证口令的更新口令 - */ -@property (nonatomic, strong) NSString *refreshToken; - -@end - -#pragma mark - ProvideMessageForWeibo Request/Response - -/** - 微博客户端向第三方程序请求提供内容的消息结构 - */ -@interface WBProvideMessageForWeiboRequest : WBBaseRequest - -@end - -/** - 微博客户端向第三方应用请求提供内容,第三方应用向微博客户端返回的消息结构 - */ -@interface WBProvideMessageForWeiboResponse : WBBaseResponse - -/** - 提供给微博客户端的消息 - */ -@property (nonatomic, strong) WBMessageObject *message; - -/** - 返回一个 WBProvideMessageForWeiboResponse 对象 - @param message 需要回送给微博客户端程序的消息对象 - @return 返回一个*自动释放的*WBProvideMessageForWeiboResponse对象 - */ -+ (id)responseWithMessage:(WBMessageObject *)message; - -@end - -#pragma mark - SendMessageToWeibo Request/Response - -/** - 第三方应用发送消息至微博客户端程序的消息结构体 - */ -@interface WBSendMessageToWeiboRequest : WBBaseRequest - -/** - 发送给微博客户端的消息 - */ -@property (nonatomic, strong) WBMessageObject *message; - -/** - 返回一个 WBSendMessageToWeiboRequest 对象 - 此方法生成对象被[WeiboSDK sendRequest:]会唤起微博客户端的发布器进行分享,如果未安装微博客户端或客户端版本太低 - 会根据 shouldOpenWeiboAppInstallPageIfNotInstalled 属性判断是否弹出安装/更新微博的对话框 - @param message 需要发送给微博客户端的消息对象 - @return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象 - */ -+ (id)requestWithMessage:(WBMessageObject *)message; - -/** - 返回一个 WBSendMessageToWeiboRequest 对象 - - 当用户安装了可以支持微博客户端內分享的微博客户端时,会自动唤起微博并分享 - 当用户没有安装微博客户端或微博客户端过低无法支持通过客户端內分享的时候会自动唤起SDK內微博发布器 - - @param message 需要发送给微博的消息对象 - @param authRequest 授权相关信息,与access_token二者至少有一个不为空,当access_token为空并且需要弹出SDK內发布器时会通过此信息先进行授权后再分享 - @param access_token 第三方应用之前申请的Token,当此值不为空并且无法通过客户端分享的时候,会使用此token进行分享。 - @return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象 - */ -+ (id)requestWithMessage:(WBMessageObject *)message - authInfo:(WBAuthorizeRequest *)authRequest - access_token:(NSString *)access_token; - -@end - -/** - WBSendMessageToWeiboResponse - */ -@interface WBSendMessageToWeiboResponse : WBBaseResponse - -/** - 可能在分享过程中用户进行了授权操作,当此值不为空时,为用户相应授权信息 - */ -@property (nonatomic,strong) WBAuthorizeResponse *authResponse; -@end - - - -#pragma mark - MessageObject / ImageObject - -/** - 微博客户端程序和第三方应用之间传递的消息结构 - - 一个消息结构由三部分组成:文字、图片和多媒体数据。三部分内容中至少有一项不为空,图片和多媒体数据不能共存。 - */ -@interface WBMessageObject : NSObject - -/** - 消息的文本内容 - - @warning 长度小于2000个汉字 - */ -@property (nonatomic, strong) NSString *text; - -/** - 消息的图片内容 - - @see WBImageObject - */ -@property (nonatomic, strong) WBImageObject *imageObject; - -/** - 消息的多媒体内容 - - @see WBBaseMediaObject - */ -@property (nonatomic, strong) WBBaseMediaObject *mediaObject; - -/** - 返回一个 WBMessageObject 对象 - - @return 返回一个*自动释放的*WBMessageObject对象 - */ -+ (id)message; - -@end - -/** - 消息中包含的图片数据对象 - */ -@interface WBImageObject : NSObject - -/** - 图片真实数据内容 - - @warning 大小不能超过10M - */ -@property (nonatomic, strong) NSData *imageData; - -/** - 返回一个 WBImageObject 对象 - - @return 返回一个*自动释放的*WBImageObject对象 - */ -+ (id)object; - -/** - 返回一个 UIImage 对象 - - @return 返回一个*自动释放的*UIImage对象 - */ -- (UIImage *)image; - -@end - -#pragma mark - Message Media Objects - -/** - 消息中包含的多媒体数据对象基类,该类后期会被废弃,在发布器不再显示为linkcard样式,只显示为普通网络连接 - */ -@interface WBBaseMediaObject : NSObject - -/** - 对象唯一ID,用于唯一标识一个多媒体内容 - - 当第三方应用分享多媒体内容到微博时,应该将此参数设置为被分享的内容在自己的系统中的唯一标识 - @warning 不能为空,长度小于255 - */ -@property (nonatomic, strong) NSString *objectID; - -/** - 多媒体内容标题 - @warning 不能为空且长度小于1k - */ -@property (nonatomic, strong) NSString *title; - -/** - 多媒体内容描述 - @warning 长度小于1k - */ -@property (nonatomic, strong) NSString *description; - -/** - 多媒体内容缩略图 - @warning 大小小于32k - */ -@property (nonatomic, strong) NSData *thumbnailData; - -/** - 点击多媒体内容之后呼起第三方应用特定页面的scheme - @warning 长度小于255 - */ -@property (nonatomic, strong) NSString *scheme; - -/** - 返回一个 WBBaseMediaObject 对象 - - @return 返回一个*自动释放的*WBBaseMediaObject对象 - */ -+ (id)object; - -@end - -#pragma mark - Message WebPage Objects - -/** - 消息中包含的网页数据对象 - */ -@interface WBWebpageObject : WBBaseMediaObject - -/** - 网页的url地址 - - @warning 不能为空且长度不能超过255 - */ -@property (nonatomic, strong) NSString *webpageUrl; - -@end - - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/libWeiboSDK.a b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/libWeiboSDK.a deleted file mode 100644 index 5644a787..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/libWeiboSDK.a and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/UMSocialSinaHandler.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/UMSocialSinaHandler.h deleted file mode 100644 index c6237969..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/UMSocialSinaHandler.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// UMSocialSinaHandler.h -// UMSocialSDK -// -// Created by wyq.Cloudayc on 2/21/17. -// Copyright © 2017 UMeng. All rights reserved. -// - -#import -#import - -@interface UMSocialSinaHandler : UMSocialHandler - -+ (UMSocialSinaHandler *)defaultManager; - - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/libSocialSina.a b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/libSocialSina.a deleted file mode 100644 index d7d7234b..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/Sina/libSocialSina.a and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/WeChat/UMSocialWechatHandler.h b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/WeChat/UMSocialWechatHandler.h deleted file mode 100644 index 92aa45b9..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/WeChat/UMSocialWechatHandler.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// UMSWechatDataTypeTableViewController.h -// SocialSDK -// -// Created by umeng on 16/4/14. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import -#import - -@interface UMSocialWechatHandler : UMSocialHandler - -+ (instancetype)defaultManager; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/WeChat/libSocialWeChat.a b/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/WeChat/libSocialWeChat.a deleted file mode 100644 index e4eebc9f..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/SocialLibraries/WeChat/libSocialWeChat.a and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialCore.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialCore.h deleted file mode 100644 index 0e89bc51..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialCore.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// UMSocialCore.h -// UMSocialCore -// -// Created by 张军华 on 16/8/24. -// Copyright © 2016年 张军华. All rights reserved. -// - -#import - -//! Project version number for UMSocialCore. -FOUNDATION_EXPORT double UMSocialCoreVersionNumber; - -//! Project version string for UMSocialCore. -FOUNDATION_EXPORT const unsigned char UMSocialCoreVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - -//base handle -#import - -//UI -//#import -//#import - -//save socialData -#import - -//ImageUtil -#import - -//shareMessageObject -#import -#import - -//core Social -#import -#import -#import -#import - -//img ImageUtils -#import - -//UMSocial log -#import - - -//watermark -#import - - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialCoreImageUtils.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialCoreImageUtils.h deleted file mode 100644 index 3054d081..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialCoreImageUtils.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// UMSocialCoreImageUtils.h -// UMSocialCore -// -// Created by 张军华 on 16/9/18. -// Copyright © 2016年 UMeng. All rights reserved. -// - -#import -#import - - -@interface UMSocialCoreImageUtils : NSObject - -+ (UIImage *)fixOrientation:(UIImage *)sourceImage; - -+ (UIImage *)imageWithColor:(UIColor *)color; - -+ (UIImage *)imageByScalingImage:(UIImage*)image proportionallyToSize:(CGSize)targetSize; - -+ (NSData *)imageDataByCompressImage:(UIImage*)image toLength:(CGFloat)targetLength; - -+ (UIImage *)imageByCompressImage:(UIImage*)image toLength:(CGFloat)targetLength; - -@end \ No newline at end of file diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialDataManager.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialDataManager.h deleted file mode 100644 index 0962c4a7..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialDataManager.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// UMSocialDataManager.h -// UMSocialSDK -// -// Created by umeng on 16/8/9. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import -#import "UMSocialPlatformConfig.h" -extern NSString *const kUMSocialAuthUID; -extern NSString *const kUMSocialAuthAccessToken; -extern NSString *const kUMSocialAuthExpireDate; -extern NSString *const kUMSocialAuthRefreshToken; -extern NSString *const kUMSocialAuthOpenID; - -@interface UMSocialDataManager : NSObject - -+ (UMSocialDataManager *)defaultManager; - -@property (nonatomic, strong, readonly) NSMutableDictionary *allAuthorUserInfo; - -- (void)setAuthorUserInfo:(NSDictionary *)userInfo platform:(UMSocialPlatformType)platformType; - -- (NSDictionary *)getAuthorUserInfoWithPlatform:(UMSocialPlatformType)platformType; - -- (void)deleteAuthorUserInfoWithPlatform:(UMSocialPlatformType)platformType; - -- (BOOL)isAuth:(UMSocialPlatformType)platformType; - -- (void)clearAllAuthorUserInfo; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialGlobal.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialGlobal.h deleted file mode 100644 index e27c7a6f..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialGlobal.h +++ /dev/null @@ -1,103 +0,0 @@ -// -// UMSocialGlobal.h -// UMSocialSDK -// -// Created by 张军华 on 16/8/16. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import - - -/** - * UMSocial的全局配置文件 - */ - - -@class UMSocialWarterMarkConfig; - -/** - * 用来设置UMSocial的全局设置变量 - */ -@interface UMSocialGlobal: NSObject - -+ (UMSocialGlobal *)shareInstance; - -/** - * 是否用cocos2dx,0-没有使用 1-使用cocos2dx 默认为0 - */ -@property(atomic,readwrite, assign)NSInteger use_coco2dx; - -/** - * 统计的主题,默认为:UMSocialDefault - */ -@property(atomic,readwrite,copy)NSString* dc; - -/** - * 是否请求的回流统计请求,默认为不请求 - */ -@property(atomic,readwrite,assign)BOOL isUrlRequest; - -/** - * type字符串 - * @discuss type是新加入的字段,目前默认值为@"native" - */ -@property(atomic,readwrite, copy)NSString* type; - - -/** - * UMSocial的版本号 - * - * @return 返回当前的版本号 - */ -+(NSString*)umSocialSDKVersion; - - -/** - * thumblr平台需要作为标示的字段 tag - * @discuss 默认的tag是UMSocial_ThumblrTag,用户可以自己设置自己的tag - */ -@property(atomic,readwrite,copy)NSString* thumblr_Tag; - - -/** - * 对平台的分享文本的时候,做规定的截断,默认开启 - * @discuss 针对特定平台(比如:微信,qq,sina等)对当前的分享信息中的文本截断到合理的位置从而能成功分享 - */ -@property(atomic,readwrite,assign)BOOL isTruncateShareText; - -/** - * 当前网络请求是否用https - * @discuss 针对ios9系统以后强制使用https的网络请求,针对分享的网络图片都必须是https的网络图片(此为苹果官方要求) - * @discuss 该函数默认开启https请求 - * @discuss 如果开启ios9的请求后,自动会过滤ios的http的请求,并返回错误。 - * - */ -@property(atomic,readwrite,assign)BOOL isUsingHttpsWhenShareContent; - - -/** - * 是否清除缓存在获得用户资料的时候 - * 默认设置为YES,代表请求用户的时候需要请求缓存 - * NO,代表不清楚缓存,用缓存的数据请求用户数据 - */ -@property(atomic,readwrite,assign)BOOL isClearCacheWhenGetUserInfo; - - -/** - * 添加水印功能 - * @note 此功能为6.2版本以后的功能 - * @discuss 此函数默认关闭 NO - 关闭水印 YES - 打开水印 - * @discuss 设置此函数为YES后,必须要设置warterMarkConfig,来配置图片水印和字符串水印,如果不配置,就会用默认的[UMSocialWarterMarkConfig defaultWarterMarkConfig]来显示水印 - */ -@property(atomic,readwrite,assign)BOOL isUsingWaterMark; - -/** - * 添加水印的配置类 - * @note 此功能为6.2版本以后的功能 - * @discuss 设置isUsingWaterMark此函数为YES后,必须要设置warterMarkConfig,来配置图片水印和字符串水印 - */ -@property(nonatomic,readwrite,strong)UMSocialWarterMarkConfig* warterMarkConfig; - -@end - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialHandler.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialHandler.h deleted file mode 100644 index 6ae90f3d..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialHandler.h +++ /dev/null @@ -1,435 +0,0 @@ -// -// UMSShareDataTypeTableViewController.h -// SocialSDK -// -// Created by umeng on 16/4/14. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import -#import "UMSocialPlatformConfig.h" -#import "UMSocialPlatformProvider.h" - - -extern NSString *const UMSocialErrorDomain; -extern NSString *const UMSocialShareDataTypeIllegalMessage; - -@class UMSocialHandlerConfig; - -/** - * 实现所有平台的基类 - * @discuss - * 前提条件:需要在主工程配置 other link flag -ObjC - * 所有实现UMSocialHandler对应平台类型子类,需要重写如下方法: - * 1.+(NSArray*) socialPlatformTypes; 返回对应平台的类型的数组,此处用数组是为了在微信和qq的平台是可以有不同的平台类型(微信,朋友圈等)与统一handler公用 - * 2.重写load函数: - * - * 代码示例: - * +(void)load - * { - * [super load];//必须调用 - * } - * - * 重载后保证调用基类的[UMSocialHandler load] - * 3.重写defaultManager单例类方法,保证运行时能找到defaultManager来获得当前的单例方法,保证其唯一性。 - */ -@interface UMSocialHandler : NSObject - -#pragma mark - 子类需要重载的类 -+(void)load; -+(NSArray*) socialPlatformTypes; -+ (instancetype)defaultManager; - -#pragma mark - - -@property (nonatomic, copy) NSString *appID; - -@property (nonatomic, copy) NSString *appSecret; - -@property (nonatomic, copy) NSString *redirectURL; - -/** - * 当前ViewController(用于一些特定平台弹出相应的页面,默认使用当前ViewController) - * since 6.3把currentViewController修改为弱引用,防止用户传入后强引用用户传入的UIViewController,导致内存不释放, - * 注意:如果传入currentViewController的时候,一定要保证在(执行对应的分享,授权,获得用户信息的接口需要传入此接口的时候)存在,否则导致弱引用为nil,没有弹出界面的效果。 - */ -@property (nonatomic, weak) UIViewController *currentViewController; - -@property (nonatomic, copy) UMSocialRequestCompletionHandler shareCompletionBlock; - -@property (nonatomic, copy) UMSocialRequestCompletionHandler authCompletionBlock; - -@property (nonatomic, copy) UMSocialRequestCompletionHandler userinfoCompletionBlock; - - --(BOOL)searchForURLSchemeWithPrefix:(NSString *)prefix; --(void)setAppId:(NSString *)appID appSecret:(NSString *)secret url:(NSString *)url; --(void)saveuid:(NSString *)uid openid:(NSString *)openid accesstoken:(NSString *)token refreshtoken:(NSString *)retoken expiration:(id )expiration; - -#pragma mark - 6.0.3新加入的平台配置类 -@property(nonatomic,readonly,strong)UMSocialHandlerConfig* handlerConfig; - - -@end - - -/** - * 针对平台限制的类别 - */ -@interface UMSocialHandler (UMSocialLimit) - -/** - * 检查对应平台的数据数据是否超过限制 - * - * @param text 源文本 - * @param textLimit 限制文本的大小 - * - * @return YES 代表没有限制,NO 代表超过限制 - */ --(BOOL) checkText:(NSString*)text withTextLimit:(NSUInteger)textLimit; - - -/** - * 检查对应平台的数据数据是否超过限制 - * - * @param data 源文本 - * @param dataLimit 限制文本的大小 - * - * @return YES 代表没有限制,NO 代表超过限制 - */ --(BOOL) checkData:(NSData*)data withDataLimit:(NSUInteger)dataLimit; - -/** - * 对应平台超过限制,就截断文本 - * - * @param text 源文本 - * @param textLimit 限制文本的大小 - * - * @return 返回的截断的文本 - */ --(NSString*)truncationText:(NSString*)text withTextLimit:(NSUInteger)textLimit; - - -/** - * 压缩对应平台的图片数据到限制发送的大小 - * - * @param imageData 对应的图片数据 - * @param imageLimit 限制图片的大小 - * - * @return 新的压缩的数据 - * @dicuss 当前图片小于对应平台的限制大小就返回本身,反之就压缩到指定大小以下发送 - */ --(NSData*)compressImageData:(NSData*)imageData withImageLimit:(NSUInteger)imageLimit; - -@end - - -#pragma mark - 6.0.3新增的配置类,用于限制分享类型和分享的内容 - -/** - * UMeng 分享类型配置信息的基类 - */ -@interface UMSocialShareObjectConfig : NSObject - -/** - * 标题 - * @note 标题的长度依各个平台的要求而定 - */ -@property (nonatomic, readwrite,assign) NSUInteger titleLimit; - -/** - * 描述 - * @note 描述内容的长度依各个平台的要求而定 - */ -@property (nonatomic, readwrite,assign) NSUInteger descrLimit; - -/** - * 缩略图数据的大小 - */ -@property (nonatomic, readwrite,assign) NSUInteger thumbImageDataLimit; - -/** - * 缩略图URL的大小 - */ -@property (nonatomic, readwrite,assign) NSUInteger thumbImageUrlLimit; - - -/** - * 点击多媒体内容之后呼起第三方应用特定页面的scheme - * @warning 长度小于255 - * //sina平台有此字段限制 - * @discuss 此字段目前不用 - */ -//@property (nonatomic, strong) NSString *schemeLimit; - -/** - * @note 长度不能超过64字节 - * //微信平台有此字段 - * @discuss 此字段目前不用 - */ -//@property (nonatomic, retain) NSString *mediaTagName; - -@end -/** - * 分享文本类型的配置 - * - */ -@interface UMSocialShareTextObjectConfig : UMSocialShareObjectConfig - -/** - * 文本内容的限制 - */ -@property(nonatomic,readwrite,assign)NSUInteger textLimit; - -@end - - -/** - * 分享图片的类型配置 - */ -@interface UMSocialShareImageObjectConfig : UMSocialShareObjectConfig - -/** - * 缩略图数据的大小 - */ -@property (nonatomic, readwrite,assign) NSUInteger shareImageDataLimit; - -/** - * 缩略图数据的URL大小 - */ -@property (nonatomic, readwrite,assign) NSUInteger shareImageURLLimit; - -@end - - -/** - * 分享音乐的类型配置 - */ -@interface UMSocialShareMusicObjectConfig : UMSocialShareObjectConfig - -/** - * 音乐网页的url地址 - */ -@property (nonatomic, readwrite,assign)NSUInteger musicUrlLimit; - -/** - * 音乐lowband网页的url地址 - */ -@property (nonatomic, readwrite,assign)NSUInteger musicLowBandUrlLimit; - -/** - * 音乐数据url地址 - */ -@property (nonatomic, readwrite,assign)NSUInteger musicDataUrlLimit; - -/** - * 音乐lowband数据url地址 - */ -@property (nonatomic, readwrite,assign)NSUInteger musicLowBandDataUrlLimit; - -@end - -/** - * 分享视频的类型配置 - */ -@interface UMSocialShareVideoObjectConfig : UMSocialShareObjectConfig - -/** - * 视频网页的url - */ -@property (nonatomic, readwrite,assign) NSUInteger videoUrlLimit; - -/** - * 视频lowband网页的url - */ -@property (nonatomic, readwrite,assign) NSUInteger videoLowBandUrlLimit; - -/** - * 视频数据流url - */ -@property (nonatomic, readwrite,assign) NSUInteger videoStreamUrlLimit; - -/** - * 视频lowband数据流url - */ -@property (nonatomic, readwrite,assign) NSUInteger videoLowBandStreamUrlLimit; - -@end - -/** - * 分享webURL - */ -@interface UMSocialShareWebpageObjectConfig : UMSocialShareObjectConfig - -/** - * 网页的url地址 - */ -@property (nonatomic, readwrite,assign) NSUInteger webpageUrlLimit; - -@end - -/** - * 分享Email的类型配置 - */ -@interface UMSocialShareEmailObjectConfig : UMSocialShareObjectConfig - -/** - * 接收人 - */ -@property (nonatomic, readwrite,assign) NSUInteger toRecipientLimit; - -/** - * 抄送人 - */ -@property (nonatomic, readwrite,assign) NSUInteger ccRecipientLimit; - -/** - * 密送人 - */ -@property (nonatomic, readwrite,assign) NSUInteger bccRecipientLimit; - -/** - * 文本内容 - */ -@property (nonatomic, readwrite,assign) NSUInteger emailContentLimit; - -/** - * 图片大小 - */ -@property (nonatomic, readwrite,assign) NSUInteger emailImageDataLimit; - -/** - * 图片URL大小 - */ -@property (nonatomic, readwrite,assign) NSUInteger emailImageUrlLimit; - -/** - * 文件(NSData) - */ -@property (nonatomic, readwrite,assign) NSUInteger emailSendDataLimit; - -/** - * 允许的文件格式 - */ -@property (nonatomic, readwrite,strong) NSArray *fileType; - -/** - * 文件名,(例如图片 imageName.png, 文件名后要跟文件后缀名,否则没法识别,导致类似图片不显示的问题) - */ -@property (nonatomic, readwrite,assign) NSUInteger fileNameLimit; - - -@end - -/** - * 分享Email的类型配置 - */ -@interface UMSocialShareSmsObjectConfig : UMSocialShareObjectConfig - -/** - * 接收人 - */ -@property (nonatomic, readwrite,assign) NSUInteger recipientLimit; - -/** - * 文本内容 - */ -@property (nonatomic, readwrite,assign) NSUInteger smsContentLimit; - -/** - * 图片 - */ -@property (nonatomic, readwrite,assign) NSUInteger smsImageDataLimit; -@property (nonatomic, readwrite,assign) NSUInteger smsImageUrlLimit; - -/** - * 文件数据(NSData) - * 必填 - */ -@property (nonatomic, readwrite,assign) NSUInteger smsSendDataLimit; - -/** - * 文件格式 - * 必填,必须指定数据格式,如png图片格式应传入@"png" - */ -@property (nonatomic, readwrite,strong) NSArray *fileType; - -/** - * 文件名,(例如图片 imageName.png, 文件名后要跟文件后缀名,否则没法识别,导致类似图片不显示的问题) - */ -@property (nonatomic, readwrite,assign) NSUInteger fileNameLimit; - -/** - * 文件地址url - */ -@property (nonatomic, readwrite,assign) NSUInteger fileUrlLimit; - -@end - -/** - * 此配置项是特定平台才有的,比如微信, - */ -@interface UMSocialShareEmotionObjectConfig : UMSocialShareObjectConfig - -//表情的字节大小限制 -@property(nonatomic,readwrite,assign)NSUInteger emotionDataLimit; - -@end - - -/** - * 此配置项是特定平台才有的,比如微信, - */ -@interface UMSocialShareFileObjectConfig : UMSocialShareObjectConfig - -@property (nonatomic, readwrite,assign) NSUInteger fileExtensionLimit; - -@property (nonatomic, readwrite,assign) NSUInteger fileDataLimit; - -@end - -/** - * 此配置项是特定平台才有的,比如微信 - */ -@interface UMSocialShareExtendObjectConfig : UMSocialShareObjectConfig - -@property (nonatomic, readwrite,assign) NSUInteger urlLimit; - -@property (nonatomic, readwrite,assign) NSUInteger extInfoLimit; - -@property (nonatomic, readwrite,assign) NSUInteger fileDataLimit; - -@end - - - - -/** - * 每个平台的配置信息 - * 包括如下: - * 1.对分享内容的限制。 - * - */ -@interface UMSocialHandlerConfig : NSObject - -@property(nonatomic,readwrite,strong)UMSocialShareTextObjectConfig* shareTextObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareImageObjectConfig* shareImageObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareMusicObjectConfig* shareMusicObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareVideoObjectConfig* shareVideoObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareWebpageObjectConfig* shareWebpageObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareEmailObjectConfig* shareEmailObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareSmsObjectConfig* shareSmsObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareEmotionObjectConfig* shareEmotionObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareFileObjectConfig* shareFileObjectConfig; -@property(nonatomic,readwrite,strong)UMSocialShareExtendObjectConfig* shareExtendObjectConfig; - -//检查输入的text是否符合对应平台的输入 -+(BOOL) checkText:(NSString*)text withTextLimit:(NSUInteger)textLimit; -+(BOOL) checkData:(NSData*)data withDataLimit:(NSUInteger)dataLimit; -+(NSString*) truncationText:(NSString*)text withTextLimit:(NSUInteger)textLimit; - -//压缩图片 -+ (NSData *)compressImageData:(NSData*)imageData toLength:(CGFloat)imageLimit; -+ (NSData *)compressImage:(UIImage*)image toLength:(CGFloat)imageLimit; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialImageUtil.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialImageUtil.h deleted file mode 100644 index a0d657e6..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialImageUtil.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// UMSocialImageUtil.h -// UMSocialSDK -// -// Created by wangfei on 16/8/12. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import -#import -@interface UMSocialImageUtil : NSObject -+(UIImage*)scaleImage:(UIImage *) image ToSize:(CGSize)size; -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialManager.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialManager.h deleted file mode 100644 index cf4faa16..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialManager.h +++ /dev/null @@ -1,192 +0,0 @@ -// -// UMComPlatformProviderManager.h -// UMSocialSDK -// -// Created by 张军华 on 16/8/5. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import -#import "UMSocialPlatformProvider.h" -#import "UMSocialGlobal.h" -@class UMSocialMessageObject; -@interface UMSocialManager : NSObject - -+(instancetype)defaultManager; - -/** - 友盟appkey - */ -@property(nonatomic,strong)NSString* umSocialAppkey; -@property(nonatomic,strong)NSString* umSocialAppSecret; - -/** - 返回当前有效(安装并是可用的)平台列表 - */ -@property(nonatomic,readonly,strong) NSArray * platformTypeArray; - - -/** - * 打开日志 - * - * @param isOpen YES代表打开,No代表关闭 - */ --(void) openLog:(BOOL)isOpen; - -/** - * 设置平台的appkey - * - * @param platformType 平台类型 @see UMSocialPlatformType - * @param appKey 第三方平台的appKey(QQ平台为appID) - * @param appSecret 第三方平台的appSecret(QQ平台为appKey) - * @param redirectURL redirectURL - */ -- (BOOL)setPlaform:(UMSocialPlatformType)platformType - appKey:(NSString *)appKey - appSecret:(NSString *)appSecret - redirectURL:(NSString *)redirectURL; - - -/** - * 设置分享平台 - * - * @param platformType 平台类型 @see UMSocialPlatformType - * @param messageObject 分享的content @see UMSocialMessageObject - * @param currentViewController 用于弹出类似邮件分享、短信分享等这样的系统页面 - * @param completion 回调 - * @discuss currentViewController 只正对sms,email等平台需要传入viewcontroller的平台,其他不需要的平台可以传入nil - */ -- (void)shareToPlatform:(UMSocialPlatformType)platformType - messageObject:(UMSocialMessageObject *)messageObject - currentViewController:(id)currentViewController - completion:(UMSocialRequestCompletionHandler)completion; - -/** - * 取消授权 - * - * @param platformType 平台类型 @see UMSocialPlatformType - * @param completion 回调 - */ -- (void)cancelAuthWithPlatform:(UMSocialPlatformType)platformType - completion:(UMSocialRequestCompletionHandler)completion; - -/** - * 授权并获取用户信息 - * @param platformType 平台类型 @see UMSocialPlatformType - * @param currentViewController 用于弹出类似邮件分享、短信分享等这样的系统页面 - * @param completion 回调 - */ -- (void)getUserInfoWithPlatform:(UMSocialPlatformType)platformType - currentViewController:(id)currentViewController - completion:(UMSocialRequestCompletionHandler)completion; - -/** - * 获得从sso或者web端回调到本app的回调 - * - * @param url 第三方sdk的打开本app的回调的url - * - * @return 是否处理 YES代表处理成功,NO代表不处理 - */ --(BOOL)handleOpenURL:(NSURL *)url; - -/** - * 获得从sso或者web端回调到本app的回调 - * - * @param url 第三方sdk的打开本app的回调的url - * @param sourceApplication 回调的源程序 - * @param annotation annotation - * - * @return 是否处理 YES代表处理成功,NO代表不处理 - * - * @note 此函数在6.3版本加入 - */ --(BOOL)handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; - -/** - * 获得从sso或者web端回调到本app的回调 - * - * @param url 第三方sdk的打开本app的回调的url - * @param options 回调的参数 - * - * @return 是否处理 YES代表处理成功,NO代表不处理 - * - * @note 此函数在6.3版本加入 - */ --(BOOL)handleOpenURL:(NSURL *)url options:(NSDictionary*)options; - - -/** - * 动态的增加用户自定义的PlatformProvider - * - * @param userDefinePlatformProvider 用户自定义的userDefinePlatformProvider必须实现UMSocialPlatformProvider - * @param platformType 平台类型 @see platformType platformType的有效范围在 (UMSocialPlatformType_UserDefine_Begin,UMSocialPlatformType_UserDefine_End)之间 - * - * @return YES代表返回成功,NO代表失败 - * @disuss 在调用此函数前,必须先设置对应的平台的配置信息 @see - (BOOL)setPlaform:(UMSocialPlatformType)platformType appKey:(NSString *)appKey appSecret:(NSString *)appSecret redirectURL:(NSString *)redirectURL; - */ --(BOOL)addAddUserDefinePlatformProvider:(id)userDefinePlatformProvider - withUserDefinePlatformType:(UMSocialPlatformType)platformType; - - -/** - * 获得对应的平台类型platformType的PlatformProvider - * - * @param platformType 平台类型 @see platformType - * - * @return 返回继承UMSocialPlatformProvider的handle - */ --(id)platformProviderWithPlatformType:(UMSocialPlatformType)platformType; - - - -/** - * 动态的删除不想显示的平台,不管是预定义还是用户自定义的 - * - * @param platformTypeArray 平台类型数组 - */ --(void) removePlatformProviderWithPlatformTypes:(NSArray *)platformTypeArray; - -/** - * 动态的删除PlatformProvider,不管是预定义还是用户自定义的 - * - * @param platformType 平台类型 @see UMSocialPlatformType - */ --(void) removePlatformProviderWithPlatformType:(UMSocialPlatformType)platformType; - - -/** - * 平台是否安装 - * - * @param platformType 平台类型 @see UMSocialPlatformType - * - * @return YES 代表安装,NO 代表未安装 - * @note 调用前请检查是否配置好平台相关白名单: http://dev.umeng.com/social/ios/quick-integration#1_3 - * 在判断QQ空间的App的时候,QQApi判断会出问题 - */ --(BOOL) isInstall:(UMSocialPlatformType)platformType; - -/** - * 当前平台是否支持分享 - * - * @param platformType 平台类型 @see UMSocialPlatformType - * - * @return YES代表支持,NO代表不支持 - */ --(BOOL) isSupport:(UMSocialPlatformType)platformType; - - -#pragma mark - NOT COMMON METHOD -/** - * 授权平台 (此方法仅获取授权token,不包含获取用户信息。推荐使用上面的 getUserInfoWithPlatform... 接口获取授权及用户信息) - * - * @param platformType 平台类型 @see UMSocialPlatformType - * @param currentViewController 用于弹出类似邮件分享、短信分享等这样的系统页面 - * @discuss currentViewController 只对sms,email等平台需要传入viewcontroller的平台,其他不需要的平台可以传入nil - * @param completion 回调 - */ -- (void)authWithPlatform:(UMSocialPlatformType)platformType - currentViewController:(UIViewController *)currentViewController - completion:(UMSocialRequestCompletionHandler)completion; - -@end - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialMessageObject.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialMessageObject.h deleted file mode 100644 index 6c07901e..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialMessageObject.h +++ /dev/null @@ -1,425 +0,0 @@ -// -// UMSocialMessageObject.h -// SocialSDK -// -// Created by umeng on 16/4/22. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import - - -@interface UMSocialMessageObject : NSObject - - -/** - * 文本标题 - * @disucss v6.0.3版本后增加的一个字段, - * @disucss 该字段目前只有Tumblr平台会使用到。 - * @discuss 该字段以后会在需要文本title字段中扩展,具体请参看官方文档。 - */ -@property (nonatomic,copy)NSString* title; - -/** - * text 文本内容 - * @note 非纯文本分享文本 - */ -@property (nonatomic, copy) NSString *text; - -/** - * 分享的所媒体内容对象 - */ -@property (nonatomic, strong) id shareObject; - -/** - * 其他相关参数,见相应平台说明 - */ -@property (nonatomic, strong) NSDictionary *moreInfo; - -+ (UMSocialMessageObject *)messageObject; - -+ (UMSocialMessageObject *)messageObjectWithMediaObject:(id)mediaObject; - - -@end - - -@interface UMShareObject : NSObject - -/** - * 标题 - * @note 标题的长度依各个平台的要求而定 - */ -@property (nonatomic, copy) NSString *title; - -/** - * 描述 - * @note 描述内容的长度依各个平台的要求而定 - */ -@property (nonatomic, copy) NSString *descr; - -/** - * 缩略图 UIImage或者NSData类型或者NSString类型(图片url) - */ -@property (nonatomic, strong) id thumbImage; - -/** - * @param title 标题 - * @param descr 描述 - * @param thumImage 缩略图(UIImage或者NSData类型,或者image_url) - * - */ -+ (id)shareObjectWithTitle:(NSString *)title - descr:(NSString *)descr - thumImage:(id)thumImage; - -+ (void)um_imageDataWithImage:(id)image completion:(void (^)(NSData *image))completion; - -#pragma mark - 6.0.3新版本的函数 -+ (void)um_imageDataWithImage:(id)image withCompletion:(void (^)(NSData *imageData,NSError* error))completion; - -@end - - - -@interface UMShareImageObject : UMShareObject - -/** 图片内容 (可以是UIImage类对象,也可以是NSdata类对象,也可以是图片链接imageUrl NSString类对象) - * @note 图片大小根据各个平台限制而定 - */ -@property (nonatomic, retain) id shareImage; - -/** - * @param title 标题 - * @param descr 描述 - * @param thumImage 缩略图(UIImage或者NSData类型,或者image_url) - * - */ -+ (UMShareImageObject *)shareObjectWithTitle:(NSString *)title - descr:(NSString *)descr - thumImage:(id)thumImage; - -@end - -@interface UMShareMusicObject : UMShareObject - -/** 音乐网页的url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *musicUrl; -/** 音乐lowband网页的url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *musicLowBandUrl; -/** 音乐数据url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *musicDataUrl; - -/**音乐lowband数据url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *musicLowBandDataUrl; - -/** - * @param title 标题 - * @param descr 描述 - * @param thumImage 缩略图(UIImage或者NSData类型,或者image_url) - * - */ -+ (UMShareMusicObject *)shareObjectWithTitle:(NSString *)title - descr:(NSString *)descr - thumImage:(id)thumImage; - -@end - - -@interface UMShareVideoObject : UMShareObject - -/** - 视频网页的url - - @warning 不能为空且长度不能超过255 - */ -@property (nonatomic, strong) NSString *videoUrl; - -/** - 视频lowband网页的url - - @warning 长度不能超过255 - */ -@property (nonatomic, strong) NSString *videoLowBandUrl; - -/** - 视频数据流url - - @warning 长度不能超过255 - */ -@property (nonatomic, strong) NSString *videoStreamUrl; - -/** - 视频lowband数据流url - - @warning 长度不能超过255 - */ -@property (nonatomic, strong) NSString *videoLowBandStreamUrl; - - -/** - * @param title 标题 - * @param descr 描述 - * @param thumImage 缩略图(UIImage或者NSData类型,或者image_url) - * - */ -+ (UMShareVideoObject *)shareObjectWithTitle:(NSString *)title - descr:(NSString *)descr - thumImage:(id)thumImage; - -@end - - -@interface UMShareWebpageObject : UMShareObject - -/** 网页的url地址 - * @note 不能为空且长度不能超过10K - */ -@property (nonatomic, retain) NSString *webpageUrl; - -/** - * @param title 标题 - * @param descr 描述 - * @param thumImage 缩略图(UIImage或者NSData类型,或者image_url) - * - */ -+ (UMShareWebpageObject *)shareObjectWithTitle:(NSString *)title - descr:(NSString *)descr - thumImage:(id)thumImage; - -@end - - -/*! @brief 分享消息中的邮件分享对象 - * - * @see UMSocialMessageObject - */ - -@interface UMShareEmailObject : UMShareObject - -/** - * 主题 - */ -@property (nonatomic, strong) NSString *subject; - -/** - * 接收人 - */ -@property (nonatomic, strong) NSArray *toRecipients; - -/** - * 抄送人 - */ -@property (nonatomic, strong) NSArray *ccRecipients; - -/** - * 密送人 - */ -@property (nonatomic, strong) NSArray *bccRecipients; - -/** - * 文本内容 - */ -@property (nonatomic, copy) NSString *emailContent; - -/** - * 图片,最好是本地图片(UIImage,或者NSdata) - */ -@property (nonatomic, strong) id emailImage; - -/** - * 发送图片的类型 @see MIME - * 默认 "image/ *" - */ -@property (nonatomic, copy) NSString* emailImageType; -/** - * 发送图片的名字 - * 默认 "um_share_image.png" - */ -@property (nonatomic, copy) NSString* emailImageName; - -/** - * 文件(NSData) - */ -@property (nonatomic, strong) NSData *emailSendData; - -/** - * 文件格式 - * @see MIME - * 默认 "text/ *" - */ -@property (nonatomic, copy) NSString *fileType; - -/** - * 文件名,(例如图片 imageName.png, 文件名后要跟文件后缀名,否则没法识别,导致类似图片不显示的问题) - * 默认 "um_share_file.txt" - */ -@property (nonatomic, copy) NSString *fileName; - -@end - - -/*! @brief 分享消息中的短信分享对象 - * - * @see UMSocialMessageObject - * @discuss UMShareSmsObject只能发送的附件是图片!!!! - * 如果发送其他的文件的话,虽然能在短信界面显示发送的文件,但是会发送不成功 - */ -@interface UMShareSmsObject : UMShareObject - -/** - * 接收人 - */ -@property (nonatomic, strong) NSArray *recipients; - -/** - * 主题 - */ -@property (nonatomic, strong) NSString *subject; - -/** - * 文本内容 - */ -@property (nonatomic, copy) NSString *smsContent; - -/** - * 图片 - */ -@property (nonatomic, strong) id smsImage;//UIImage对象必填 -@property (nonatomic, copy) NSString *imageType;//图片格式必填,必须指定数据格式,如png图片格式应传入@"png" -@property (nonatomic, copy) NSString *imageName;//图片 例如 imageName.png, 文件名后要跟文件后缀名,否则没法识别,导致类似图片不显示的问题) - - -#pragma mark - 以下字段为非图片的属性 -/** - * 文件数据(NSData) - * 必填 - */ -@property (nonatomic, strong) NSData *smsSendData; - -/** - * 文件格式 - * 必填,必须指定数据格式,如png图片格式应传入@"txt" - */ -@property (nonatomic, copy) NSString *fileType; - -/** - * 文件名,(例如图片 fileName.txt, 文件名后要跟文件后缀名,否则没法识别,导致类似图片不显示的问题) - */ -@property (nonatomic, copy) NSString *fileName; - -/** - * 文件地址url(http:// or file:// ...../fileName.txt) - */ -@property (nonatomic, copy) NSString *fileUrl; - -@end - - -/** - * 表情的类 - * 表请的缩略图数据请存放在UMShareEmotionObject中 - * 注意:emotionData和emotionURL成员不能同时为空,若同时出现则取emotionURL - */ -@interface UMShareEmotionObject : UMShareObject - -/** - * 表情数据,如GIF等 - * @note 微信的话大小不能超过10M - */ -@property (nonatomic, strong) NSData *emotionData; - -/** - * @param title 标题 - * @param descr 描述 - * @param thumImage 缩略图(UIImage或者NSData类型,或者image_url) - * - */ -+ (UMShareEmotionObject *)shareObjectWithTitle:(NSString *)title - descr:(NSString *)descr - thumImage:(id)thumImage; - -@end - - -#pragma mark - UMSAppExtendObject -/*! @brief 多媒体消息中包含的App扩展数据对象 - * - * 第三方程序向微信终端发送包含UMShareExtendObject的多媒体消息, - * 微信需要处理该消息时,会调用该第三方程序来处理多媒体消息内容。 - * @note url,extInfo和fileData不能同时为空 - * @see UMShareObject - */ -@interface UMShareExtendObject : UMShareObject - -/** 若第三方程序不存在,微信终端会打开该url所指的App下载地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *url; -/** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理 - * @note 长度不能超过2K - */ -@property (nonatomic, retain) NSString *extInfo; -/** App文件数据,该数据发送给微信好友,微信好友需要点击后下载数据,微信终端会回传给第三方程序处理 - * @note 大小不能超过10M - */ -@property (nonatomic, retain) NSData *fileData; - -@end - - -#pragma mark - UMFileObject -/*! @brief 多媒体消息中包含的文件数据对象 - * - * @see UMShareObject - */ -@interface UMShareFileObject : UMShareObject - -/** 文件后缀名 - * @note 长度不超过64字节 - */ -@property (nonatomic, retain) NSString *fileExtension; - -/** 文件真实数据内容 - * @note 大小不能超过10M - */ -@property (nonatomic, retain) NSData *fileData; - - -@end - - -#pragma mark - UMMiniProgramObject - -/*! @brief 多媒体消息中包含 分享微信小程序的数据对象 - * - * @see UMShareObject - */ -@interface UMShareMiniProgramObject : UMShareObject - -/** - 低版本微信网页链接 - */ -@property (nonatomic, strong) NSString *webpageUrl; - -/** - 小程序username - */ -@property (nonatomic, strong) NSString *userName; - -/** - 小程序页面的路径 - */ -@property (nonatomic, strong) NSString *path; - -@end - - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialPlatformConfig.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialPlatformConfig.h deleted file mode 100644 index a0086fe6..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialPlatformConfig.h +++ /dev/null @@ -1,438 +0,0 @@ -// -// UMSocialPlatformConfig.h -// UMSocialSDK -// -// Created by 张军华 on 16/8/5. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import -#import - - -/** - 新浪微博 - */ -extern NSString *const UMSPlatformNameSina; - -/** - 腾讯微博 - */ -extern NSString *const UMSPlatformNameTencentWb; - -/** - 钉钉 - */ -extern NSString *const UMSPlatformNameDingDing; - -/** - 人人网 - */ -extern NSString *const UMSPlatformNameRenren; - -/** - 豆瓣 - */ -extern NSString *const UMSPlatformNameDouban; - -/** - QQ空间 - */ -extern NSString *const UMSPlatformNameQzone; - -/** - 邮箱 - */ -extern NSString *const UMSPlatformNameEmail; - -/** - 短信 - */ -extern NSString *const UMSPlatformNameSms; - -/** - 微信好友 - */ -extern NSString *const UMSPlatformNameWechatSession; - -/** - 微信朋友圈 - */ -extern NSString *const UMSPlatformNameWechatTimeline; - -/** - 微信收藏 - */ -extern NSString *const UMSPlatformNameWechatFavorite; - -/** - 支付宝好友 - */ -extern NSString *const UMSPlatformNameAlipaySession; - -/** - 手机QQ - */ -extern NSString *const UMSPlatformNameQQ; - -/** - Tencent Tim - */ -extern NSString *const UMSPlatformNameTim; - -/** - Facebook - */ -extern NSString *const UMSPlatformNameFacebook; - -/** - Twitter - */ -extern NSString *const UMSPlatformNameTwitter; - - -/** - 易信好友 - */ -extern NSString *const UMSPlatformNameYXSession; - -/** - 易信朋友圈 - */ -extern NSString *const UMSPlatformNameYXTimeline; - -/** - 来往好友 - */ -extern NSString *const UMSPlatformNameLWSession; - -/** - 来往朋友圈 - */ -extern NSString *const UMSPlatformNameLWTimeline; - -/** - 分享到Instragram - */ -extern NSString *const UMSPlatformNameInstagram; - -/** - 分享到Whatsapp - */ -extern NSString *const UMSPlatformNameWhatsapp; - -/** - 分享到Line - */ -extern NSString *const UMSPlatformNameLine; - -/** - 分享到Tumblr - */ -extern NSString *const UMSPlatformNameTumblr; - -/** - 领英 - */ -extern NSString *const UMSPlatformNameLinkedin; - -/** - 分享到Pinterest - */ -extern NSString *const UMSPlatformNamePinterest; - -/** - 分享到KakaoTalk - */ -extern NSString *const UMSPlatformNameKakaoTalk; - -/** - 分享到Flickr - */ -extern NSString *const UMSPlatformNameFlickr; - - -/** - * 有道云笔记 - */ -extern NSString *const UMSPlatformNameYouDaoNote; - -/** - * 印象笔记 - */ -extern NSString *const UMSPlatformNameEverNote; - -/** - * google+ - */ -extern NSString *const UMSPlatformNameGooglePlus; - -/** - * Pocket - */ -extern NSString *const UMSPlatformNamePocket; - -/** - * dropbox - */ -extern NSString *const UMSPlatformNameDropBox; - -/** - * vkontakte - */ -extern NSString *const UMSPlatformNameVKontakte; - -/** - * FaceBookMessenger - */ -extern NSString *const UMSPlatformNameFaceBookMessenger; - - -/** - * 授权,分享,UserProfile等操作的回调 - * - * @param result 表示回调的结果 - * @param error 表示回调的错误码 - */ -typedef void (^UMSocialRequestCompletionHandler)(id result,NSError *error); - -/** - * 授权,分享,UserProfile等操作的回调 - * - * @param shareResponse 表示回调的结果 - * @param error 表示回调的错误码 - */ -typedef void (^UMSocialShareCompletionHandler)(id shareResponse,NSError *error); - -/** - * 授权,分享,UserProfile等操作的回调 - * - * @param authResponse 表示回调的结果 - * @param error 表示回调的错误码 - */ -typedef void (^UMSocialAuthCompletionHandler)(id authResponse,NSError *error); - -/** - * 授权,分享,UserProfile等操作的回调 - * - * @param userInfoResponse 表示回调的结果 - * @param error 表示回调的错误码 - */ -typedef void (^UMSocialGetUserInfoCompletionHandler)(id userInfoResponse,NSError *error); - - -///////////////////////////////////////////////////////////////////////////// -//平台的失败错误码--start -///////////////////////////////////////////////////////////////////////////// -/** - * U-Share返回错误类型 - */ -typedef NS_ENUM(NSInteger, UMSocialPlatformErrorType) { - UMSocialPlatformErrorType_Unknow = 2000, // 未知错误 - UMSocialPlatformErrorType_NotSupport = 2001, // 不支持(url scheme 没配置,或者没有配置-ObjC, 或则SDK版本不支持或则客户端版本不支持) - UMSocialPlatformErrorType_AuthorizeFailed = 2002, // 授权失败 - UMSocialPlatformErrorType_ShareFailed = 2003, // 分享失败 - UMSocialPlatformErrorType_RequestForUserProfileFailed = 2004, // 请求用户信息失败 - UMSocialPlatformErrorType_ShareDataNil = 2005, // 分享内容为空 - UMSocialPlatformErrorType_ShareDataTypeIllegal = 2006, // 分享内容不支持 - UMSocialPlatformErrorType_CheckUrlSchemaFail = 2007, // schemaurl fail - UMSocialPlatformErrorType_NotInstall = 2008, // 应用未安装 - UMSocialPlatformErrorType_Cancel = 2009, // 取消操作 - UMSocialPlatformErrorType_NotNetWork = 2010, // 网络异常 - UMSocialPlatformErrorType_SourceError = 2011, // 第三方错误 - - UMSocialPlatformErrorType_ProtocolNotOverride = 2013, // 对应的 UMSocialPlatformProvider的方法没有实现 - UMSocialPlatformErrorType_NotUsingHttps = 2014, // 没有用https的请求,@see UMSocialGlobal isUsingHttpsWhenShareContent - -}; - -/** The domain name used for the UMSocialPlatformErrorType */ -extern NSString* const UMSocialPlatformErrorDomain; - -///////////////////////////////////////////////////////////////////////////// -//平台的失败错误码--end -///////////////////////////////////////////////////////////////////////////// - - - -///////////////////////////////////////////////////////////////////////////// -//平台的特性--begin -///////////////////////////////////////////////////////////////////////////// - -/** - * 平台的特性枚举变量 - */ -typedef NS_OPTIONS(NSUInteger, UMSocialPlatformFeature) -{ - UMSocialPlatformFeature_None = 0, - - //App - UMSocialPlatformFeature_IsAppInstalled = 1 << 0, - UMSocialPlatformFeature_IsCanOpenApp = 1 << 1, - UMSocialPlatformFeature_IsAppApiSupport = 1 << 2, - - //Authorize - UMSocialPlatformFeature_IsCanAuthorize = 1 << 10, - UMSocialPlatformFeature_IsCanWebViewAuthorize = 1 << 11, - - //SSOShare - UMSocialPlatformFeature_IsCanShare_Text = 1 << 22, - UMSocialPlatformFeature_IsCanShare_Image = 1 << 23, - UMSocialPlatformFeature_IsCanShare_Media = 1 << 24, - UMSocialPlatformFeature_IsCanShare_TextAndImage = 1 << 25, - UMSocialPlatformFeature_IsCanShare_TextAndMedia = 1 << 26, - - //mask - UMSocialPlatformFeature_Mask = 0xFFFFFFFF, -}; - - -///////////////////////////////////////////////////////////////////////////// -//平台的特性--end -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -//平台的类型--start -///////////////////////////////////////////////////////////////////////////// -typedef NS_ENUM(NSInteger,UMSocialPlatformType) -{ - UMSocialPlatformType_UnKnown = -2, - //预定义的平台 - UMSocialPlatformType_Predefine_Begin = -1, - UMSocialPlatformType_Sina = 0, //新浪 - UMSocialPlatformType_WechatSession = 1, //微信聊天 - UMSocialPlatformType_WechatTimeLine = 2,//微信朋友圈 - UMSocialPlatformType_WechatFavorite = 3,//微信收藏 - UMSocialPlatformType_QQ = 4,//QQ聊天页面 - UMSocialPlatformType_Qzone = 5,//qq空间 - UMSocialPlatformType_TencentWb = 6,//腾讯微博 - UMSocialPlatformType_AlipaySession = 7,//支付宝聊天页面 - UMSocialPlatformType_YixinSession = 8,//易信聊天页面 - UMSocialPlatformType_YixinTimeLine = 9,//易信朋友圈 - UMSocialPlatformType_YixinFavorite = 10,//易信收藏 - UMSocialPlatformType_LaiWangSession = 11,//点点虫(原来往)聊天页面 - UMSocialPlatformType_LaiWangTimeLine = 12,//点点虫动态 - UMSocialPlatformType_Sms = 13,//短信 - UMSocialPlatformType_Email = 14,//邮件 - UMSocialPlatformType_Renren = 15,//人人 - UMSocialPlatformType_Facebook = 16,//Facebook - UMSocialPlatformType_Twitter = 17,//Twitter - UMSocialPlatformType_Douban = 18,//豆瓣 - UMSocialPlatformType_KakaoTalk = 19,//KakaoTalk - UMSocialPlatformType_Pinterest = 20,//Pinteres - UMSocialPlatformType_Line = 21,//Line - - UMSocialPlatformType_Linkedin = 22,//领英 - - UMSocialPlatformType_Flickr = 23,//Flickr - - UMSocialPlatformType_Tumblr = 24,//Tumblr - UMSocialPlatformType_Instagram = 25,//Instagram - UMSocialPlatformType_Whatsapp = 26,//Whatsapp - UMSocialPlatformType_DingDing = 27,//钉钉 - - UMSocialPlatformType_YouDaoNote = 28,//有道云笔记 - UMSocialPlatformType_EverNote = 29,//印象笔记 - UMSocialPlatformType_GooglePlus = 30,//Google+ - UMSocialPlatformType_Pocket = 31,//Pocket - UMSocialPlatformType_DropBox = 32,//dropbox - UMSocialPlatformType_VKontakte = 33,//vkontakte - UMSocialPlatformType_FaceBookMessenger = 34,//FaceBookMessenger - UMSocialPlatformType_Tim = 35,// Tencent TIM - - UMSocialPlatformType_Predefine_end = 999, - - //用户自定义的平台 - UMSocialPlatformType_UserDefine_Begin = 1000, - UMSocialPlatformType_UserDefine_End = 2000, -}; - -///////////////////////////////////////////////////////////////////////////// -//平台的类型--end -///////////////////////////////////////////////////////////////////////////// - - - -//通过图片名称读取UMSocialSDKResources.bundle里的平台icon -#define UMSocialPlatformIconWithName(name) [NSString stringWithFormat:@"UMSocialSDKResources.bundle/SnsPlatform/%@",name] - -////通过图片名称读取UMSocialSDKResources.bundle/Buttons/中的图片 -#define UMSocialButtonImageWithName(name) [NSString stringWithFormat:@"UMSocialSDKResources.bundle/Buttons/%@",name] -// - -/** 本地化 */ -#define UMLocalizedString(key,defaultValue) NSLocalizedStringWithDefaultValue(key,@"UMSocialLocalizable", [NSBundle mainBundle], defaultValue, nil) - -/** - * 平台配置类 - */ -@interface UMSocialPlatformConfig : NSObject - - -@property(nonatomic,strong)NSString* appKey; -@property(nonatomic,strong)NSString* appSecret; -@property(nonatomic,strong)NSString* redirectURL; - - -/** - * 根据平台类型获得平台名称 - * - * @param platformType 平台类型 - * @see UMSocialPlatformType - * - * @return 返回对应的平台名称 - */ -+ (NSString *)platformNameWithPlatformType:(UMSocialPlatformType)platformType; - -/** - * 根据平台的类型返回对应平台的对象 - * - * @param platformType 平台类型 - * - * @return 返回对应的平台对象 - */ -+ (id)platformHandlerWithPlatformType:(UMSocialPlatformType)platformType; - - -/** - * 创建错误类型 - * - * @param errorType 平台类型 - * @param userInfo 用户的自定义信息userInfo - * - * @return 返回错误对象 - */ -+ (NSError *)errorWithSocialErrorType:(UMSocialPlatformErrorType)errorType userInfo:(id)userInfo; - -@end - - -/** - * 云端授权/分享编辑页面配置类 - * 云端授权/分享页面目前适用于腾讯微博、豆瓣、人人的授权和分享编辑页面的自定义配置 - */ -@interface UMSocialCloudViewConfig : NSObject - - -/** - 授权页面 - */ -@property (nonatomic, strong) NSString *authViewTitle; -@property (nonatomic, strong) UIColor *authViewTitleColor; -@property( nonatomic, strong) UIColor *authViewNavBarColor; -// button仅需改动title或image即可,touch事件内部触发 -@property (nonatomic, strong) UIButton *authViewCloseButton; - -@property (nonatomic, strong) NSString *editViewTitle; -@property (nonatomic, strong) UIColor *editViewTitleColor; -@property( nonatomic, strong) UIColor *editViewNavBarColor; -// button仅需改动title或image即可,touch事件内部触发 -@property (nonatomic, strong) UIButton *editViewCloseButton; -@property (nonatomic, strong) UIButton *editViewShareButton; - - - -+ (instancetype)sharedInstance; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialPlatformProvider.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialPlatformProvider.h deleted file mode 100644 index 36e7117c..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialPlatformProvider.h +++ /dev/null @@ -1,156 +0,0 @@ -// -// UMSocialPlatformProvider.h -// UMSocialSDK -// -// Created by 张军华 on 16/8/4. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import -#import -#import "UMSocialPlatformConfig.h" - -@class UMSocialMessageObject; - -/** - * 每个平台的必须实现的协议 - */ -@protocol UMSocialPlatformProvider - -@optional -/** - * 当前UMSocialPlatformProvider对应操作的UMSocialPlatformType - * @discuss 当前很多平台对应多个平台类型,出现一对多的关系 - * 例如:QQ提供UMSocialPlatformType_Qzone 和 UMSocialPlatformType_QQ,用户点击分享或者认证的时候,需要区分用户分享或者认证的对应的哪个平台 - */ -@property(nonatomic,assign)UMSocialPlatformType socialPlatformType; - -/** - * 初始化平台 - * - * @param appKey 对应的appkey - * @param appSecret 对应的appSecret - * @param redirectURL 对应的重定向url - * @discuss appSecret和redirectURL如果平台必须要的话就传入,不需要就传入nil - */ --(void)umSocial_setAppKey:(NSString *)appKey - withAppSecret:(NSString *)appSecret - withRedirectURL:(NSString *)redirectURL; - -/** - * 授权 - * - * @param userInfo 用户的授权的自定义数据 - * @param completionHandler 授权后的回调 - * @discuss userInfo在有些平台可以带入,如果没有就传入nil. - */ --(void)umSocial_AuthorizeWithUserInfo:(NSDictionary *)userInfo - withCompletionHandler:(UMSocialRequestCompletionHandler)completionHandler; - -/** - * 授权 - * - * @param userInfo 用户的授权的自定义数据 - * @param completionHandler 授权后的回调 - * @parm viewController 分享需要的viewController - * @discuss userInfo在有些平台可以带入,如果没有就传入nil. - * 这个函数用于sms,email等需要传入viewController的平台 - */ --(void)umSocial_AuthorizeWithUserInfo:(NSDictionary *)userInfo - withViewController:(UIViewController*)viewController - withCompletionHandler:(UMSocialRequestCompletionHandler)completionHandler; - -/** - * 分享 - * - * @param object 分享的对象数据模型 - * @param completionHandler 分享后的回调 - */ --(void)umSocial_ShareWithObject:(UMSocialMessageObject *)object - withCompletionHandler:(UMSocialRequestCompletionHandler)completionHandler; - -/** - * 分享 - * - * @param object 分享的对象数据模型 - * @param completionHandler 分享后的回调 - * @parm viewController 分享需要的viewController - * @dicuss 这个函数用于sms,email等需要传入viewController的平台 - */ --(void)umSocial_ShareWithObject:(UMSocialMessageObject *)object - withViewController:(UIViewController*)viewController - withCompletionHandler:(UMSocialRequestCompletionHandler)completionHandler; - -/** - * 取消授权 - * - * @param completionHandler 授权后的回调 - * @discuss userInfo在有些平台可以带入,如果没有就传入nil. - */ --(void)umSocial_cancelAuthWithCompletionHandler:(UMSocialRequestCompletionHandler)completionHandler; - -/** - * 授权成功后获得用户的信息 - * - * @param completionHandler 请求的回调 - */ --(void)umSocial_RequestForUserProfileWithCompletionHandler:(UMSocialRequestCompletionHandler)completionHandler; - - -/** - * 获取用户信息 - * @param currentViewController 用于弹出类似邮件分享、短信分享等这样的系统页面 - * @param completion 回调 - */ -- (void)umSocial_RequestForUserProfileWithViewController:(id)currentViewController - completion:(UMSocialRequestCompletionHandler)completion; - - -/** - * 清除平台的数据F - */ --(void)umSocial_clearCacheData; - -/** - * 获得从sso或者web端回调到本app的回调 - * - * @param url 第三方sdk的打开本app的回调的url - * - * @return 是否处理 YES代表处理成功,NO代表不处理 - */ --(BOOL)umSocial_handleOpenURL:(NSURL *)url; --(BOOL)umSocial_handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; --(BOOL)umSocial_handleOpenURL:(NSURL *)url options:(NSDictionary*)options; - - -#pragma mark - 平台的特性 -/** - * 平台的特性 - * - * @return 返回平台特性 - * - */ --(UMSocialPlatformFeature)umSocial_SupportedFeatures; - -/** - * 平台的版本 - * - * @return 当前平台sdk的version - */ --(NSString *)umSocial_PlatformSDKVersion; - -/** - * 检查urlschema - * - */ --(BOOL)checkUrlSchema; - - --(BOOL)umSocial_isInstall; - --(BOOL)umSocial_isSupport; - - -@end - - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialResponse.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialResponse.h deleted file mode 100644 index f5f041b7..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialResponse.h +++ /dev/null @@ -1,70 +0,0 @@ -// -// UMSocialResponse.h -// UMSocialSDK -// -// Created by wangfei on 16/8/12. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import -#import "UMSocialPlatformConfig.h" - -@interface UMSocialResponse : NSObject - -@property (nonatomic, copy) NSString *uid; -@property (nonatomic, copy) NSString *openid; -@property (nonatomic, copy) NSString *refreshToken; -@property (nonatomic, copy) NSDate *expiration; -@property (nonatomic, copy) NSString *accessToken; - -@property (nonatomic, copy) NSString *unionId; - - -/** - usid 兼容U-Share 4.x/5.x 版本,与4/5版本数值相同 - 即,对应微信平台:openId,QQ平台openId,其他平台不变 - */ -@property (nonatomic, copy) NSString *usid; - -@property (nonatomic, assign) UMSocialPlatformType platformType; -/** - * 第三方原始数据 - */ -@property (nonatomic, strong) id originalResponse; - -@end - -@interface UMSocialShareResponse : UMSocialResponse - -@property (nonatomic, copy) NSString *message; - -+ (UMSocialShareResponse *)shareResponseWithMessage:(NSString *)message; - -@end - -@interface UMSocialAuthResponse : UMSocialResponse - -@end - -@interface UMSocialUserInfoResponse : UMSocialResponse - -/** - 第三方平台昵称 - */ -@property (nonatomic, copy) NSString *name; - -/** - 第三方平台头像地址 - */ -@property (nonatomic, copy) NSString *iconurl; - -/** - 通用平台性别属性 - QQ、微信、微博返回 "男", "女" - Facebook返回 "male", "female" - */ -@property (nonatomic, copy) NSString *unionGender; - -@property (nonatomic, copy) NSString *gender; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialWarterMarkConfig.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialWarterMarkConfig.h deleted file mode 100644 index 1c6fb89d..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSocialWarterMarkConfig.h +++ /dev/null @@ -1,222 +0,0 @@ -// -// UMSocialWarterMarkConfig.h -// testWatermarkImage -// -// Created by 张军华 on 16/12/23. -// Copyright © 2016年 张军华. All rights reserved. -// - -#import -#import -#import - -@class UMSocialStringWarterMarkConfig; -@class UMSocialImageWarterMarkConfig; - -typedef NS_ENUM(NSInteger, UMSocialWarterMarkPositon) { - UMSocialWarterMarkPositonNone = 0, - - /************************************************************************ - 水印字符串的位置,目前并没有用--start - *************************************************************************/ - UMSocialStringWarterMarkTopLeft = (1 << 0), - UMSocialStringWarterMarkTopRight = (1 << 1), - UMSocialStringWarterMarkBottomLeft = (1 << 2), - UMSocialStringWarterMarkBottomRight = (1 << 3), - /************************************************************************ - 水印字符串的位置,目前并没有用--end - *************************************************************************/ - - //水印图片的位置 - UMSocialImageWarterMarkTopLeft = (1 << 4), - UMSocialImageWarterMarkTopRight = (1 << 5), - UMSocialImageWarterMarkBottomLeft = (1 << 6), - UMSocialImageWarterMarkBottomRight = (1 << 7), - - /************************************************************************ - 水印字符串和水印图片的相对位置,目前并没有用(如果图片和字符串都在同一个位置,就需要设置相对位置)--start - *************************************************************************/ - UMSocialImageWarterMarkForwardStringWarterMark = (1 << 8), //图片在字符串前面 - UMSocialStringWarterMarkForwardImageWarterMark = (1 << 9),//字符串在图片前面 - UMSocialImageWarterMarkAboveStringWarterMark = (1 << 10),//图片在字符串上面 - UMSocialStringWarterMarkAboveImageWarterMark = (1 << 11),//字符串在图片上面 - /************************************************************************ - 水印字符串和水印图片的相对位置,目前并没有用(如果图片和字符串都在同一个位置,就需要设置相对位置)--end - *************************************************************************/ -}; - -typedef NS_OPTIONS(NSInteger, UMSocialStringAndImageWarterMarkPositon) { - UMSocialStringAndImageWarterMarkPositonNone = 0, - - UMSocialOnlyImageWarterMarkTopLeft = UMSocialImageWarterMarkTopLeft,//水印图片左上 - UMSocialOnlyImageWarterMarkTopRight = UMSocialImageWarterMarkTopRight,//水印图片右上 - UMSocialOnlyImageWarterMarkBottomLeft = UMSocialImageWarterMarkBottomLeft,//水印图片左下 - UMSocialOnlyImageWarterMarkBottomRight = UMSocialImageWarterMarkBottomRight,//水印图片右下 - - /************************************************************************ - 以下的枚举变量,目前并没有用--start - *************************************************************************/ - UMSocialStringWarterMarkTopLeftAndImageWarterMarkTopLeft = (UMSocialStringWarterMarkTopLeft | UMSocialImageWarterMarkTopLeft),//水印字符串左上,水印图片左上 - UMSocialStringWarterMarkTopLeftAndImageWarterMarkTopRight = (UMSocialStringWarterMarkTopLeft | UMSocialImageWarterMarkTopRight),//水印字符串左上,水印图片右上 - UMSocialStringWarterMarkTopLeftAndImageWarterMarkBottomLeft = (UMSocialStringWarterMarkTopLeft | UMSocialImageWarterMarkBottomLeft),//水印字符串左上,水印图片左下 - UMSocialStringWarterMarkTopLeftAndImageWarterMarkBottomRight = (UMSocialStringWarterMarkTopLeft | UMSocialImageWarterMarkBottomRight),//水印字符串左上,水印图片右下 - - UMSocialStringWarterMarkTopRightAndImageWarterMarkTopLeft = (UMSocialStringWarterMarkTopRight | UMSocialImageWarterMarkTopLeft),//水印字符串右上,水印图片左上 - UMSocialStringWarterMarkTopRightAndImageWarterMarkTopRight = (UMSocialStringWarterMarkTopRight | UMSocialImageWarterMarkTopRight),//水印字符串右上,水印图片右上 - UMSocialStringWarterMarkTopRightAndImageWarterMarkBottomLeft = (UMSocialStringWarterMarkTopRight | UMSocialImageWarterMarkBottomLeft),//水印字符串右上,水印图片左下 - UMSocialStringWarterMarkTopRightAndImageWarterMarkBottomRight = (UMSocialStringWarterMarkTopRight | UMSocialImageWarterMarkBottomRight),//水印字符串右上,水印图片右下 - - UMSocialStringWarterMarkBottomLeftAndImageWarterMarkTopLeft = (UMSocialStringWarterMarkBottomLeft | UMSocialImageWarterMarkTopLeft),//水印字符串左下,水印图片左上 - UMSocialStringWarterMarkBottomLeftAndImageWarterMarkTopRight = (UMSocialStringWarterMarkBottomLeft | UMSocialImageWarterMarkTopRight),//水印字符串左下,水印图片右上 - UMSocialStringWarterMarkBottomLeftAndImageWarterMarkBottomLeft = (UMSocialStringWarterMarkBottomLeft | UMSocialImageWarterMarkBottomLeft),//水印字符串左下,水印图片左下 - UMSocialStringWarterMarkBottomLeftAndImageWarterMarkBottomRight = (UMSocialStringWarterMarkBottomLeft | UMSocialImageWarterMarkBottomRight),//水印字符串左下,水印图片右下 - - UMSocialStringWarterMarkBottomRightAndImageWarterMarkTopLeft = (UMSocialStringWarterMarkBottomRight | UMSocialImageWarterMarkTopLeft),//水印字符串右下,水印图片左上 - UMSocialStringWarterMarkBottomRightAndImageWarterMarkTopRight = (UMSocialStringWarterMarkBottomRight | UMSocialImageWarterMarkTopRight),//水印字符串右下,水印图片右上 - UMSocialStringWarterMarkBottomRightAndImageWarterMarkBottomLeft = (UMSocialStringWarterMarkBottomRight | UMSocialImageWarterMarkBottomLeft),//水印字符串右下,水印图片左下 - UMSocialStringWarterMarkBottomRightAndImageWarterMarkBottomRight = (UMSocialStringWarterMarkBottomRight | UMSocialImageWarterMarkBottomRight),//水印字符串右下,水印图片右下 - - /************************************************************************ - 以下的枚举变量,目前并没有用---end - *************************************************************************/ -}; - -extern UMSocialWarterMarkPositon getStringWarterMarkPostion(UMSocialStringAndImageWarterMarkPositon stringAndImageWarterMarkPositon); -extern UMSocialWarterMarkPositon getImageWarterMarkPostion(UMSocialStringAndImageWarterMarkPositon stringAndImageWarterMarkPositon); -extern UMSocialWarterMarkPositon getRelatedWarterMarkPostion(UMSocialStringAndImageWarterMarkPositon stringAndImageWarterMarkPositon); - - -/** - * 水印配置类 - * 用户可以设置水印的配置类,目前只是提供图片水印 - * - * method1: - * 用户可以通过默认的配置类来配置水印 - * 代码如下: - UMSocialWarterMarkConfig* warterMarkConfig = [UMSocialWarterMarkConfig defaultWarterMarkConfig]; - * - * method2: - * 用户可以通过创建自己的配置类来配置水印 - * 代码如下: - //创建UMSocialImageWarterMarkConfig - UMSocialImageWarterMarkConfig* imageWarterMarkConfig = [[UMSocialImageWarterMarkConfig alloc] init]; - //配置imageWarterMarkConfig的参数 - //...TODO - //创建UMSocialWarterMarkConfig - UMSocialWarterMarkConfig* warterMarkConfig = [[UMSocialWarterMarkConfig alloc] init]; - //配置warterMarkConfig的参数 - //...TODO - //设置配置类 - [warterMarkConfig setUserDefinedImageWarterMarkConfig:imageWarterMarkConfig]; - * - * - */ -@interface UMSocialWarterMarkConfig : NSObject - -/** - * 默认配置类 - * - * @return 默认配置类 - */ -+(UMSocialWarterMarkConfig*)defaultWarterMarkConfig; - - -@property(nonatomic,readonly,strong)UMSocialStringWarterMarkConfig* stringWarterMarkConfig;//字符串配置类对象 -@property(nonatomic,readonly,strong)UMSocialImageWarterMarkConfig* imageWarterMarkConfig;//图片配置类对象 - -/** - * 字符串和图片的位置 - * 默认是defaultWarterMarkConfig的配置为文字和图片右下角,图片在前文字在后 - */ -@property(nonatomic,readwrite,assign)UMSocialStringAndImageWarterMarkPositon stringAndImageWarterMarkPositon;//字符串和图片的位置 -@property(nonatomic,readwrite,assign)CGFloat spaceBetweenStringWarterMarkAndImageWarterMark;//字符水印和图片水印的间距 - -/** - * 设置用户自定义的配置类 - * - * @param imageWarterMarkConfig 图片配置类对象 - */ --(void)setUserDefinedImageWarterMarkConfig:(UMSocialImageWarterMarkConfig*)imageWarterMarkConfig; - -@end - - -/** - * 字符水印配置类 - * 目前此配置类没有使用 - */ -@interface UMSocialStringWarterMarkConfig : NSObject - -/** - * 默认配置类 - * - * @return 默认配置类 - */ -+(UMSocialStringWarterMarkConfig*)defaultStringWarterMarkConfig; - -//检查参数是否有效 --(BOOL)checkValid; - -@property(nonatomic,readwrite,strong)NSAttributedString* warterMarkAttributedString;//水印字符串 -@property(nonatomic,readwrite,assign)NSUInteger warterMarkStringLimit;//水印字符串的字数限制 -@property(nonatomic,readwrite,strong)UIColor* warterMarkStringColor;//水印字符串的颜色(要想保证色值半透明,可以创建半透明的颜色对象) -@property(nonatomic,readwrite,strong)UIFont* warterMarkStringFont;//水印字符串的字体 - -/** - * 靠近水平边的边距 - * 与UMSocialWarterMarkPositon的停靠位置有关, - 如:为UMSocialStringWarterMarkBottomRight时,paddingToHorizontalParentBorder代表与父窗口的右边间隙. - 如:UMSocialStringWarterMarkTopLeft时,paddingToHorizontalParentBorder代表与父窗口的左边间隙. - */ -@property(nonatomic,readwrite,assign)CGFloat paddingToHorizontalParentBorder;//靠近水平边的边距 - -/** - * 靠近垂直边的边距 - * 与UMSocialWarterMarkPositon的停靠位置有关, - 如:为UMSocialStringWarterMarkBottomRight时,paddingToHorizontalParentBorder代表与父窗口的下边的间隙. - 如:UMSocialStringWarterMarkTopLeft时,paddingToHorizontalParentBorder代表与父窗口的上边间隙. - */ -@property(nonatomic,readwrite,assign)CGFloat paddingToVerticalParentBorder;//靠近垂直边的边距 - -@property(nonatomic,readonly,assign)CGAffineTransform warterMarkStringTransform;//水印字符串的矩阵 - -@end - -/** - * 图片配置类 - */ -@interface UMSocialImageWarterMarkConfig : NSObject - -/** - * 默认配置类 - * - * @return 默认配置类 - */ -+(UMSocialImageWarterMarkConfig*)defaultImageWarterMarkConfig; - -//检查参数是否有效 --(BOOL)checkValid; - -@property(nonatomic,readwrite,strong)UIImage* warterMarkImage;//水印图片 -@property(nonatomic,readwrite,assign)CGFloat warterMarkImageScale;//水印图片相对父图片的缩放因素(0-1之间) -@property(nonatomic,readwrite,assign)CGFloat warterMarkImageAlpha;//水印图片的Alpha混合值 - -/** - * 靠近水平边的边距 - * 与UMSocialWarterMarkPositon的停靠位置有关, - 如:为UMSocialImageWarterMarkBottomRight时,paddingToHorizontalParentBorder代表与父窗口的右边间隙. - 如:UMSocialImageWarterMarkTopLeft时,paddingToHorizontalParentBorder代表与父窗口的左边间隙. - */ -@property(nonatomic,readwrite,assign)CGFloat paddingToHorizontalParentBorder;//靠近水平边的边距 - -/** - * 靠近垂直边的边距 - * 与UMSocialWarterMarkPositon的停靠位置有关, - 如:为UMSocialImageWarterMarkBottomRight时,paddingToHorizontalParentBorder代表与父窗口的下边间隙. - 如:UMSocialImageWarterMarkTopLeft时,paddingToHorizontalParentBorder代表与父窗口的上边间隙. - */ -@property(nonatomic,readwrite,assign)CGFloat paddingToVerticalParentBorder;//靠近垂直边的边距 - -@property(nonatomic,readonly,assign)CGAffineTransform warterMarkImageTransform;//水印图片的矩阵 - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSociallogMacros.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSociallogMacros.h deleted file mode 100644 index 683aac9c..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Headers/UMSociallogMacros.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// UMSociallogMacros.h -// UMSocialCore -// -// Created by 张军华 on 16/9/7. -// Copyright © 2016年 张军华. All rights reserved. -// - -#import - - -/** - * 设置全局的日志等级 - * - * @param levelString 日志分级字符串 @see UMSocialLogClosedString,UMSocialLogErrorString,UMSocialLogWarnString,UMSocialLogInfoString,UMSocialLogDebugString,UMSocialLogVerboseString - * @discuss 普通用户可以设置UMSocialLogClosedString,UMSocialLogErrorString,UMSocialLogWarnString,UMSocialLogInfoString,UMSocialLogDebugString的字符串,如果设置UMSocialLogVerboseString的时候,如果不是本库的开发者,是降低其等级到UMSocialLogDebugString - */ -FOUNDATION_EXPORT void setGlobalLogLevelString(NSString* levelString); -FOUNDATION_EXPORT NSString* getGlobalLogLevelString(); - -FOUNDATION_EXPORT NSString* const UMSocialLogClosedLevelString; -FOUNDATION_EXPORT NSString* const UMSocialLogErrorLevelString; -FOUNDATION_EXPORT NSString* const UMSocialLogWarnLevelString; -FOUNDATION_EXPORT NSString* const UMSocialLogInfoLevelString; -FOUNDATION_EXPORT NSString* const UMSocialLogDebugLevelString; -FOUNDATION_EXPORT NSString* const UMSocialLogVerboseLevelString; - - -/** - * 根据等级打印日志 - * - * @param flagString 控制打印分级的标志字符串 - * @see below UMSocialLogClosedFlagString...and so on - * @param file 打印日志的文件 - * @param function 打印日志的函数 - * @param line 打印的日志的行数 - * @param format 需要打印的日志格式内容 - * @param ... 可变参数 - * @dicuss 本库不需要直接调用,可以用简易函数宏 @see UMSocialLogError,UMSocialLogWarn,UMSocialLogInfo,UMSocialLogDebug - */ -FOUNDATION_EXPORT void UMSocialLog(NSString* flagString,const char* file,const char* function,NSUInteger line,NSString *format, ...) NS_FORMAT_FUNCTION(5,6); - -FOUNDATION_EXPORT NSString* const UMSocialLogErrorFlagString; -FOUNDATION_EXPORT NSString* const UMSocialLogWarnFlagString; -FOUNDATION_EXPORT NSString* const UMSocialLogInfoFlagString; -FOUNDATION_EXPORT NSString* const UMSocialLogDebugFlagString; -FOUNDATION_EXPORT NSString* const UMSocialLogVerboseFlagString; - -//简易函数类似于系统的NSLog函数,线程安全 -#define UMSocialLogError(format, ...) UMSocialLog(UMSocialLogErrorFlagString,__FILE__,__PRETTY_FUNCTION__,__LINE__,format,##__VA_ARGS__) -#define UMSocialLogWarn(format, ...) UMSocialLog(UMSocialLogWarnFlagString,__FILE__,__PRETTY_FUNCTION__,__LINE__,format,##__VA_ARGS__) -#define UMSocialLogInfo(format, ...) UMSocialLog(UMSocialLogInfoFlagString,__FILE__,__PRETTY_FUNCTION__,__LINE__,format,##__VA_ARGS__) -#define UMSocialLogDebug(format, ...) UMSocialLog(UMSocialLogDebugFlagString,__FILE__,__PRETTY_FUNCTION__,__LINE__,format,##__VA_ARGS__) -#define UMSocialLogVerbose(format, ...) UMSocialLog(UMSocialLogVerboseFlagString,__FILE__,__PRETTY_FUNCTION__,__LINE__,format,##__VA_ARGS__) - - -//日志国际化的相关的函数和宏 -FOUNDATION_EXPORT NSString* UMSocialLogWithLocalizedKey(NSString* key); -#define UMSocialLogLocalizedString(key) UMSocialLogWithLocalizedKey(key) - - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Info.plist b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Info.plist deleted file mode 100644 index ae2349e1..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/Info.plist and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/UMSocialCore b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/UMSocialCore deleted file mode 100644 index 6ff477c7..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialCore.framework/UMSocialCore and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialHttpFactory.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialHttpFactory.h deleted file mode 100644 index 7b321e3a..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialHttpFactory.h +++ /dev/null @@ -1,26 +0,0 @@ - - -#import -#import "UMSocialTaskConfig.h" - - -@interface UMSocialHttpFactory : NSObject - -/** - * 创建一个NSMutableURLRequest的对象 - * - * @param method @see UMSocialHttpMethodType - * @param path base path 如: http://www.umeng.com - * @param pathParameters 加入到path后面的键值对 - * @param bodyParameters 加入到body的键值对 - * @param headers 加入的http的header的键值对 - * - * @return @see NSMutableURLRequest - */ -+ (NSMutableURLRequest *)makeRequestWithMethod:(UMSocialHttpMethodType)method - path:(NSString *)path - pathParameters:(NSDictionary *)pathParameters - bodyParameters:(NSDictionary *)bodyParameters - headers:(NSDictionary *)headers; - -@end diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialNetwork.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialNetwork.h deleted file mode 100644 index 70f41194..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialNetwork.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// UMSocialNetwork.h -// UMSocialNetwork -// -// Created by 张军华 on 16/8/29. -// Copyright © 2016年 张军华. All rights reserved. -// - -#import - -//! Project version number for UMSocialNetwork. -FOUNDATION_EXPORT double UMSocialNetworkVersionNumber; - -//! Project version string for UMSocialNetwork. -FOUNDATION_EXPORT const unsigned char UMSocialNetworkVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - -#import -#import - -#import -#import \ No newline at end of file diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTask.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTask.h deleted file mode 100644 index 8abe715d..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTask.h +++ /dev/null @@ -1,65 +0,0 @@ -// -// UMSocialTask.h -// UMSocialSDK -// -// Created by 张军华 on 16/8/11. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import - -#import "UMSocialTaskConfig.h" - -@class UMSocialTaskOperation; -@class UMSocialTask; - -NS_ASSUME_NONNULL_BEGIN -/** - * task的回调代理 - */ -@protocol UMSocialTaskDelegate - --(void)handleTask:(UMSocialTask*)task withError:(NSError*) error; - -@end - -/** - * 所有网络请求的基本任务类 - */ -@interface UMSocialTask : NSObject - -@property(nonatomic,assign)UMSocialHttpMethodType httpMethodType; //http请求类型 -@property(nonatomic,copy)NSString* hostUrlPath;//http请求的host -@property(nonatomic,copy)NSString* relatedUrlPath; //http请求的相对url -@property(nonatomic,strong)NSDictionary* paramDic; //post或者get请求需要的字典 -@property(nonatomic,copy)UMSocialTaskCompletion completion;//回调 - -@property(nonatomic,readonly,assign)NSInteger taskIdentifier; //唯一id -@property(nonatomic,readonly,assign)NSInteger retryCount;//retryCount -@property(nonatomic,readonly,assign)UMSoicalTaskState taskState;//task的状态 - - -#pragma mark - override -/** - * 创建的NSURLRequest - * - * @return @see NSURLRequest - * @discuss 用户可以重载此函数,自己实现makeURLRequest的逻辑, - * 如果不重载此函数会用 - * 默认会用httpMethodType,relatedUrlPath,paramDic来产生对应的NSURLRequest - */ --(NSURLRequest*)makeURLRequest; - -#pragma mark - private -/** - * 在指定的operationTaskQueue的执行对应task的任务 - * - * @param operationTaskQueue @see NSOperationQueue - * @discuss 本函数不需要直接调用,UMSocialNetworkCore会自动调用 - * @see UMSocialTaskManager -(void)addAndExcuteSocialTask:(UMSocialTask*)task - */ --(void)executeTaskWithOperationQueue:(NSOperationQueue*)operationTaskQueue; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTaskConfig.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTaskConfig.h deleted file mode 100644 index 55f32092..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTaskConfig.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// UMSocialTaskConfig.h -// UMSocialSDK -// -// Created by 张军华 on 16/8/12. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import - -//task的网络请求 -typedef NS_ENUM(NSInteger, UMSocialHttpMethodType) -{ - UMSocialHttpMethodTypeGet, - UMSocialHttpMethodTypePut, - UMSocialHttpMethodTypePost, - UMSocialHttpMethodTypeMultipartPost, - UMSocialHttpMethodTypeMultipartPut, - UMSocialHttpMethodTypeDelete -}; - -//task的状态 -typedef NS_ENUM(NSInteger, UMSoicalTaskState) -{ - UMSoicalTaskState_Paused = -1,//目前没用 - UMSoicalTaskState_Ready = 1, - UMSoicalTaskState_Executing = 2, - UMSoicalTaskState_ExecutingDependency = 3, - UMSoicalTaskState_Finished = 4, - UMSoicalTaskState_Canceled = 5,//目前没有用 - UMSoicalTaskState_Error = 6, -}; - - -/** - * task完成的回调 - * - * @param result 返回的数据 - * @param error @see NSError - */ -typedef void (^UMSocialTaskCompletion)(id result,NSError* error); - - -/** - * task error - */ -extern NSString* const UMSoicalTaskErrorDomain; -extern NSString* const UMSoicalTaskErrorUserInfoKey; -typedef NS_ENUM(NSInteger, UMSoicalTaskErrorType) -{ - UMSoicalTaskErrorType_UnKnown, - UMSoicalTaskErrorType_ParameterError,//参数错误 例如没有设置OperationQueue等 - UMSoicalTaskErrorType_CFNetworkErrors, //http的请求的错误 @see CFNetworkErrors,该错误放在UMSoicalTaskErrorUserInfoKey为key的字典中 - UMSoicalTaskErrorType_UMSoicalServerCode,//服务器的错误,根据当前UMSocial服务器的错误码文档来区分 -}; - -extern NSError* errorWithSoicalTaskError(UMSoicalTaskErrorType taskErrorType,id userInfo); - - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTaskManager.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTaskManager.h deleted file mode 100644 index ad0c6a4a..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Headers/UMSocialTaskManager.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// UMSocialTaskManager.h -// UMSocialSDK -// -// Created by 张军华 on 16/8/12. -// Copyright © 2016年 dongjianxiong. All rights reserved. -// - -#import - -@class UMSocialTask; -@class UMSocialTaskOperation; - -NS_ASSUME_NONNULL_BEGIN - -/** - * 所有task的管理类 - */ -@interface UMSocialTaskManager : NSObject - -+(instancetype)shareManager; - -/** - * 创建好task直接执行task - * - * @param task @see UMSocialTask - */ --(void)addAndExcuteSocialTask:(UMSocialTask*)task; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Info.plist b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Info.plist deleted file mode 100644 index a5975b50..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/Info.plist and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/UMSocialNetwork b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/UMSocialNetwork deleted file mode 100644 index c68eb872..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialNetwork.framework/UMSocialNetwork and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle/en.lproj/UMSocialPromptLocalizable.strings b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle/en.lproj/UMSocialPromptLocalizable.strings deleted file mode 100644 index 3a1ae1c0..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle/en.lproj/UMSocialPromptLocalizable.strings +++ /dev/null @@ -1,77 +0,0 @@ -/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */ - - -//core模块的平台相关 -"core_platform_error_1" = "创建相应平台失败:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_platform_error_2" = "创建平台失败:%@ 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; - -"core_platform_warn_1" = "平台检查失败:%@,请检查是否实现 @selector(socialPlatformType),参考UMSocialPlatformConfig.h头文件说明。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_platform_warn_2" = "平台异常:%@ > 未实现相应方法:@selector(umSocial_setAppKey:withAppSecret:withRedirectURL:)"; - -//core模块认证相关 -"core_auth_error_1" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_auth_error_2" = "未实现协议方法@selector(umSocial_AuthorizeWithUserInfo:withViewController:withCompletionHandler:):%@"; -"core_auth_error_3" = "未实现协议方法@selector(umSocial_cancelAuthWithCompletionHandler:):%@"; -"core_auth_error_4" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_auth_error_5" = "未实现协议方法@selector(umSocial_AuthorizeWithUserInfo:withCompletionHandler:):%@"; -"core_auth_error_6" = "平台%@分享时,传入的参数currentViewController应该是nil或者是继承UIViewController的子类"; - -//core模块获得用户资料相关 -"core_getuserinfo_error_1" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_getuserinfo_error_2" = "未实现协议方法@selector(umSocial_RequestForUserProfileWithViewController:completion:):%@"; -"core_getuserinfo_error_3" = "平台%@分享时,传入的参数currentViewController应该是nil或者是继承UIViewController的子类"; - -//core模块分享相关 -"core_share_error_1" = "传入平台('%@')的UMSocialMessageObject类型参数messageObject的数据类型无效,请检查\n1.messageObject是否空。\n2.messageObject.text和messageObject.shareObject是否同时为空"; -"core_share_error_2" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_share_error_3" = "未实现协议方法@selector(umSocial_ShareWithObject:withCompletionHandler:):%@"; -"core_share_error_4" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_share_error_5" = "未实现协议方法@selector(umSocial_ShareWithObject:withViewController:withCompletionHandler:):%@"; -"core_share_error_6" = "平台%@分享时,传入的参数currentViewController应该是nil或者是继承UIViewController的子类"; - - -//wechat -"wechat_auth_error_1" = "请检查是否设置了微信的URLSchema。参考链接检查 https://at.umeng.com/O1Lryy?cid=2723"; - -"wechat_getuserinfo_error_1" = "请检查是否设置了微信的URLSchema。参考链接检查 https://at.umeng.com/O1Lryy?cid=2723"; - - -"wechat_share_error_1" = "请检查是否设置了微信的URLSchema。参考链接检查 https://at.umeng.com/O1Lryy?cid=2723"; -"wechat_share_error_2" = "分享前,请检查微信是否安装。参考链接检查 https://at.umeng.com/1DCO5D?cid=2723"; -"wechat_share_error_3" = "当前的sdk不支持微信的OpenAPI,请更新最新的微信SDK。"; -"wechat_share_error_4" = "微信分享不支持的分享类型,微信的分享类型为:文本,图片,网络链接,音乐链接,视频链接,Gif表情,文件。"; -"wechat_share_error_5" = "下载UMShareImageObject的shareImage失败,请检查图片参数是否正确。(本地图片,请检查是否赋值,网络图片请检查是否为https,防止下载失败)。"; - -"wechat_shareWebPage_warn_1" = "微信分享网页链接的时候,提供的缩略图为错误的下载url或者下载失败,具体的原因如下:%@"; -"wechat_shareWebPage_warn_2" = "微信分享网页链接的时候,提供的缩略图为错误的下载url或者下载失败。"; - -"wechat_shareImage_warn_1" = "微信分享图片的时候,提供的缩略图为为错误的下载url或者下载失败,具体的原因如下:%@"; -"wechat_shareImage_warn_2" = "微信分享图片的时候,提供的缩略图为为错误的下载url或者下载失败。"; - -//qq -"qq_auth_error_1" = "请检查是否设置了QQ的URLSchema。参考链接检查 https://at.umeng.com/aeuC0D?cid=2723"; -"qq_auth_error_2" = "授权失败,点击qq授权没有跳转,请查看是否设置了appid,查看初始化函数:[[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:??? appSecret:nil redirectURL:???];"; - -"qq_getuserinfo_error_1" = "请检查是否设置了QQ的URLSchema。 参考链接检查 https://at.umeng.com/aeuC0D?cid=2723"; -"qq_getuserinfo_info_1" = "提示获得用户信息的时候是否清除缓存,可以设置UMSocialGlobal的isClearCacheWhenGetUserInfo变量来改变,默认是每次都清除用户的授权缓存"; - - -"qq_share_error_1" = "请检查是否设置了QQ的URLSchema。 参考链接检查 https://at.umeng.com/aeuC0D?cid=2723"; -"qq_share_error_2" = "请检查是否安装了QQ。参考链接检查 https://at.umeng.com/1nu05b?cid=2723"; -"qq_share_error_3" = "请检查当前的SDK是否支持API调用,如果不能请升级SDK或者QQ的版本。"; -"qq_share_error_4" = "QQ分享不支持的分享类型,QQ的分享类型为:文本,图片,网络链接,音乐链接,视频链接。"; - -"qq_shareWebPage_warn_1" = "QQ分享网页链接的时候,提供的缩略图为错误的下载url或者下载失败,具体的原因如下:%@"; -"qq_shareWebPage_warn_2" = "QQ分享网页链接的时候,提供的缩略图为错误的下载url或者下载失败"; -//sina -"sina_auth_error_1" = "请检查是否设置了sina的URLSchema。 参考链接检查 https://at.umeng.com/ju49Du?cid=2723"; - -"sina_getuserinfo_error_1" = "请检查是否设置了sina的URLSchema。 参考链接检查 https://at.umeng.com/ju49Du?cid=2723"; - -"sina_share_error_1" = "请检查是否设置了sina的URLSchema。 参考链接检查 https://at.umeng.com/ju49Du?cid=2723"; -"sina_share_error_2" = "新浪分享不支持的分享类型,新浪的分享类型为:文本,图片,图文,网络链接,音乐链接,视频链接。"; -"sina_shareWebPage_error_1"="新浪分享webpage类型(需要强制加入缩略图)错误,具体原因如下:%@"; -"sina_shareText_Info_1" = "新浪文本分享最大的字是140个,如果超过就不能分享成功,sdk默认开启截断功能,如果需要停止截断需要在调用分享前加入代码[UMSocialGlobal shareInstance].isTruncateShareText=NO"; - -//facebook -"facebook_share_error_1" = "facebook分享不支持的分享类型,facebook的分享类型为:文本,图片,网络链接,音乐链接,视频链接。(新版的facebook采用的是对话框的形式分享的,如果设置文本的话需要有publish_actions权限调用OpenAPI)"; diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle/zh-Hans.lproj/UMSocialPromptLocalizable.strings b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle/zh-Hans.lproj/UMSocialPromptLocalizable.strings deleted file mode 100644 index 3a1ae1c0..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle/zh-Hans.lproj/UMSocialPromptLocalizable.strings +++ /dev/null @@ -1,77 +0,0 @@ -/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */ - - -//core模块的平台相关 -"core_platform_error_1" = "创建相应平台失败:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_platform_error_2" = "创建平台失败:%@ 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; - -"core_platform_warn_1" = "平台检查失败:%@,请检查是否实现 @selector(socialPlatformType),参考UMSocialPlatformConfig.h头文件说明。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_platform_warn_2" = "平台异常:%@ > 未实现相应方法:@selector(umSocial_setAppKey:withAppSecret:withRedirectURL:)"; - -//core模块认证相关 -"core_auth_error_1" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_auth_error_2" = "未实现协议方法@selector(umSocial_AuthorizeWithUserInfo:withViewController:withCompletionHandler:):%@"; -"core_auth_error_3" = "未实现协议方法@selector(umSocial_cancelAuthWithCompletionHandler:):%@"; -"core_auth_error_4" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_auth_error_5" = "未实现协议方法@selector(umSocial_AuthorizeWithUserInfo:withCompletionHandler:):%@"; -"core_auth_error_6" = "平台%@分享时,传入的参数currentViewController应该是nil或者是继承UIViewController的子类"; - -//core模块获得用户资料相关 -"core_getuserinfo_error_1" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_getuserinfo_error_2" = "未实现协议方法@selector(umSocial_RequestForUserProfileWithViewController:completion:):%@"; -"core_getuserinfo_error_3" = "平台%@分享时,传入的参数currentViewController应该是nil或者是继承UIViewController的子类"; - -//core模块分享相关 -"core_share_error_1" = "传入平台('%@')的UMSocialMessageObject类型参数messageObject的数据类型无效,请检查\n1.messageObject是否空。\n2.messageObject.text和messageObject.shareObject是否同时为空"; -"core_share_error_2" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_share_error_3" = "未实现协议方法@selector(umSocial_ShareWithObject:withCompletionHandler:):%@"; -"core_share_error_4" = "未发现平台相应类:%@\n请检查:\n1、平台类已实现协议\n2、此平台枚举值在正常枚举区间内,参考UMSocialPlatformConfig.h —> UMSocialPlatformType枚举。 参考链接检查 https://at.umeng.com/mKfWve?cid=2723"; -"core_share_error_5" = "未实现协议方法@selector(umSocial_ShareWithObject:withViewController:withCompletionHandler:):%@"; -"core_share_error_6" = "平台%@分享时,传入的参数currentViewController应该是nil或者是继承UIViewController的子类"; - - -//wechat -"wechat_auth_error_1" = "请检查是否设置了微信的URLSchema。参考链接检查 https://at.umeng.com/O1Lryy?cid=2723"; - -"wechat_getuserinfo_error_1" = "请检查是否设置了微信的URLSchema。参考链接检查 https://at.umeng.com/O1Lryy?cid=2723"; - - -"wechat_share_error_1" = "请检查是否设置了微信的URLSchema。参考链接检查 https://at.umeng.com/O1Lryy?cid=2723"; -"wechat_share_error_2" = "分享前,请检查微信是否安装。参考链接检查 https://at.umeng.com/1DCO5D?cid=2723"; -"wechat_share_error_3" = "当前的sdk不支持微信的OpenAPI,请更新最新的微信SDK。"; -"wechat_share_error_4" = "微信分享不支持的分享类型,微信的分享类型为:文本,图片,网络链接,音乐链接,视频链接,Gif表情,文件。"; -"wechat_share_error_5" = "下载UMShareImageObject的shareImage失败,请检查图片参数是否正确。(本地图片,请检查是否赋值,网络图片请检查是否为https,防止下载失败)。"; - -"wechat_shareWebPage_warn_1" = "微信分享网页链接的时候,提供的缩略图为错误的下载url或者下载失败,具体的原因如下:%@"; -"wechat_shareWebPage_warn_2" = "微信分享网页链接的时候,提供的缩略图为错误的下载url或者下载失败。"; - -"wechat_shareImage_warn_1" = "微信分享图片的时候,提供的缩略图为为错误的下载url或者下载失败,具体的原因如下:%@"; -"wechat_shareImage_warn_2" = "微信分享图片的时候,提供的缩略图为为错误的下载url或者下载失败。"; - -//qq -"qq_auth_error_1" = "请检查是否设置了QQ的URLSchema。参考链接检查 https://at.umeng.com/aeuC0D?cid=2723"; -"qq_auth_error_2" = "授权失败,点击qq授权没有跳转,请查看是否设置了appid,查看初始化函数:[[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:??? appSecret:nil redirectURL:???];"; - -"qq_getuserinfo_error_1" = "请检查是否设置了QQ的URLSchema。 参考链接检查 https://at.umeng.com/aeuC0D?cid=2723"; -"qq_getuserinfo_info_1" = "提示获得用户信息的时候是否清除缓存,可以设置UMSocialGlobal的isClearCacheWhenGetUserInfo变量来改变,默认是每次都清除用户的授权缓存"; - - -"qq_share_error_1" = "请检查是否设置了QQ的URLSchema。 参考链接检查 https://at.umeng.com/aeuC0D?cid=2723"; -"qq_share_error_2" = "请检查是否安装了QQ。参考链接检查 https://at.umeng.com/1nu05b?cid=2723"; -"qq_share_error_3" = "请检查当前的SDK是否支持API调用,如果不能请升级SDK或者QQ的版本。"; -"qq_share_error_4" = "QQ分享不支持的分享类型,QQ的分享类型为:文本,图片,网络链接,音乐链接,视频链接。"; - -"qq_shareWebPage_warn_1" = "QQ分享网页链接的时候,提供的缩略图为错误的下载url或者下载失败,具体的原因如下:%@"; -"qq_shareWebPage_warn_2" = "QQ分享网页链接的时候,提供的缩略图为错误的下载url或者下载失败"; -//sina -"sina_auth_error_1" = "请检查是否设置了sina的URLSchema。 参考链接检查 https://at.umeng.com/ju49Du?cid=2723"; - -"sina_getuserinfo_error_1" = "请检查是否设置了sina的URLSchema。 参考链接检查 https://at.umeng.com/ju49Du?cid=2723"; - -"sina_share_error_1" = "请检查是否设置了sina的URLSchema。 参考链接检查 https://at.umeng.com/ju49Du?cid=2723"; -"sina_share_error_2" = "新浪分享不支持的分享类型,新浪的分享类型为:文本,图片,图文,网络链接,音乐链接,视频链接。"; -"sina_shareWebPage_error_1"="新浪分享webpage类型(需要强制加入缩略图)错误,具体原因如下:%@"; -"sina_shareText_Info_1" = "新浪文本分享最大的字是140个,如果超过就不能分享成功,sdk默认开启截断功能,如果需要停止截断需要在调用分享前加入代码[UMSocialGlobal shareInstance].isTruncateShareText=NO"; - -//facebook -"facebook_share_error_1" = "facebook分享不支持的分享类型,facebook的分享类型为:文本,图片,网络链接,音乐链接,视频链接。(新版的facebook采用的是对话框的形式分享的,如果设置文本的话需要有publish_actions权限调用OpenAPI)"; diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDKPlugin/libUMSocialLog.a b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDKPlugin/libUMSocialLog.a deleted file mode 100644 index 30b61cd4..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialSDKPlugin/libUMSocialLog.a and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_add_friend_off@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_add_friend_off@2x.png deleted file mode 100644 index cc327917..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_add_friend_off@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_delete_image_button_normal@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_delete_image_button_normal@2x.png deleted file mode 100644 index 5355731e..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_delete_image_button_normal@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_nav_button_close@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_nav_button_close@2x.png deleted file mode 100644 index bd61c466..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_nav_button_close@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_nav_button_send@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_nav_button_send@2x.png deleted file mode 100644 index 02c673e5..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_nav_button_send@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_image@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_image@2x.png deleted file mode 100644 index 09ef645a..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_image@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_music@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_music@2x.png deleted file mode 100644 index ad07270e..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_music@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_video@2x.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_video@2x.png deleted file mode 100644 index c4087d6f..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/Buttons/UMS_url_video@2x.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_alipay.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_alipay.png deleted file mode 100644 index 2cfdcfed..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_alipay.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_default.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_default.png deleted file mode 100644 index 13688c81..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_default.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_dingding.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_dingding.png deleted file mode 100644 index af547630..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_dingding.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_douban.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_douban.png deleted file mode 100644 index 3e4a96a8..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_douban.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_dropbox.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_dropbox.png deleted file mode 100644 index 53e11da3..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_dropbox.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_email.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_email.png deleted file mode 100644 index 87c69c45..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_email.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_evernote.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_evernote.png deleted file mode 100644 index f8245272..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_evernote.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_facebook.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_facebook.png deleted file mode 100644 index cc9c1fda..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_facebook.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_facebookmessenger.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_facebookmessenger.png deleted file mode 100644 index 4356d8c9..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_facebookmessenger.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_flickr.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_flickr.png deleted file mode 100644 index 4a4c397c..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_flickr.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_googleplus.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_googleplus.png deleted file mode 100644 index cf960b68..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_googleplus.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_instagram.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_instagram.png deleted file mode 100644 index 347d9abd..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_instagram.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_kakaoTalk.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_kakaoTalk.png deleted file mode 100644 index 40cf5235..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_kakaoTalk.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_line.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_line.png deleted file mode 100644 index 0aa39757..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_line.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_linkedin.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_linkedin.png deleted file mode 100644 index a4b40a81..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_linkedin.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_lw_session.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_lw_session.png deleted file mode 100644 index 04d245e3..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_lw_session.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_lw_timeline.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_lw_timeline.png deleted file mode 100644 index f95a2e79..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_lw_timeline.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_pinterest.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_pinterest.png deleted file mode 100644 index fe207447..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_pinterest.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_pocket.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_pocket.png deleted file mode 100644 index 0dc071d4..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_pocket.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_qq.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_qq.png deleted file mode 100644 index 486d55ce..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_qq.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_qzone.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_qzone.png deleted file mode 100644 index 754597b7..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_qzone.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_renren.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_renren.png deleted file mode 100644 index 41aa69aa..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_renren.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_sina.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_sina.png deleted file mode 100644 index 50359a0b..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_sina.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_sms.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_sms.png deleted file mode 100644 index d406ca8a..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_sms.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tencentWB.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tencentWB.png deleted file mode 100644 index 7453c631..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tencentWB.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tim.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tim.png deleted file mode 100644 index b7934d59..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tim.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tumblr.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tumblr.png deleted file mode 100644 index 0bd123d9..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_tumblr.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_twitter.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_twitter.png deleted file mode 100644 index 81f911bd..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_twitter.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_vkontakte.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_vkontakte.png deleted file mode 100644 index 745504df..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_vkontakte.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat.png deleted file mode 100644 index 927952e8..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat_favorite.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat_favorite.png deleted file mode 100644 index 20a182b7..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat_favorite.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat_timeline.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat_timeline.png deleted file mode 100644 index f9425448..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_wechat_timeline.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_whatsapp.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_whatsapp.png deleted file mode 100644 index 34275ff7..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_whatsapp.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_favorite.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_favorite.png deleted file mode 100644 index 38ff4934..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_favorite.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_session.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_session.png deleted file mode 100644 index db08eda1..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_session.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_timeline.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_timeline.png deleted file mode 100644 index 4bce0e10..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_yixin_timeline.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_youdaonote.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_youdaonote.png deleted file mode 100644 index b9ec762b..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialPlatformTheme/default/umsocial_youdaonote.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialWaterMark/umsocial_defaultwatermark.png b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialWaterMark/umsocial_defaultwatermark.png deleted file mode 100644 index 2f4e439c..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/UMSocialWaterMark/umsocial_defaultwatermark.png and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/en.lproj/UMSocialLocalizable.strings b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/en.lproj/UMSocialLocalizable.strings deleted file mode 100644 index 78df4362..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/en.lproj/UMSocialLocalizable.strings +++ /dev/null @@ -1,186 +0,0 @@ -/* - Localizable.strings - SocialSDK - - Created by yeahugo on 13-6-17. - Copyright (c) 2013年 Umeng. All rights reserved. -*/ -"button_cancel" = "Cancel"; -"button_ok" = "OK"; -"button_start" = "Start"; - -"button_close" = "Close"; -"button_back" = "Back"; -"button_refresh" = "Refresh"; - -"label_request_account" = "Getting account data, please wait……"; - -"oauth_title" = "Authorization"; -"oauth_text" = "Connecting to authorization web, please wait……"; -"oauth_follow" = "Follow official micro-blog"; -"mask_text" = "please wait……"; - -"oauth_error_title" = "authorise failed"; -"oauth_error_message" = "authorise failed, you can try again later"; -"oauth_error_not_approved" = "authorise failed, for your app haven't approved or you haven't add your weibo uid to test accounts"; - -"shareQQ_error" = "Error"; -"shareQQ_notInstall" = "Mobile QQ havn't be installed in your device"; -"shareQQ_openFail" = "Open Mobile QQ fail"; -"shareQQ_ShareFail" = "Share To QQ fail"; -"shareInstagram_openFail" = "Open Instagram fail"; -"shareClient_notInstall" = "Client not installed in your device"; - -"custom_share_title" = "UMeng share"; - -"umsocial_shareUI_Title" = "Choose platform to share"; -"umsocial_shareUI_CancelControlText" = "Cancel"; - -"shareList_title" = "Share To"; -"shareEdit_title" = "Share To "; -"shareEdit_post" = "Post"; -"shareEdit_change_account" = "Change Account"; -"shareEdit_post_finish" = "Post Finished"; -"shareEdit_post_fail" = "Post Failed"; -"shareEdit_posting" = "Posting"; -"shareEdit_delete_picture" = "Delete Picture"; -"shareEdit_delete_video" = "Delete Video"; -"shareEdit_delete_music" = "Delete Music"; -"shareEdit_error_not_empty" = "Post content can not be empty"; -"shareEdit_error_too_long" = "Post content's length too long"; -"shareEdit_error_auth_expired" = "Post failed, for authorization expired"; -"shareEdit_error_auth_again" = "authorize again"; -"shareEdit_error_text_repeated" = "Text repeated"; -"shareEdit_error_user_baned" = "Sorry, you have been banned"; -"shareEdit_error_fail" = "Share fail"; -"shareEdit_error_no_auth" = "Share fail, for no upload picture authority"; -"shareEdit_error_empty_content" = "Share fail, for the content is empty"; -"shareEdit_addFollow" = "Follow weibo"; -"shareEdit_C" = "符"; -"shareEdit_used" = "常"; - -"shareShake_button" = "Share"; - -"share_wechat" = "Share to Wechat"; -"share_wechat_friend" = "Share to Wechat Friend"; -"share_wechat_moments" = "Share to Wechat Moments"; -"share_wechat_no_title" = "No Wechat"; -"share_wechat_no_message" = "Wechat haven't been install in your device"; -"share_facebook_not_login" = "No login Account"; -"share_facebook_not_login_message" = "Your account haven't login"; -"share_facebook_no_osSupport" = "iOS doesn't support"; -"share_facebook_no_osSupport_message" = "The version of your iOS device doesn't support share the that media"; - -"share_alipay" = "Share to AlipayShare"; -"share_alipay_friend" = "Share to AlipayShare friends"; -"share_alipay_moments" = "Share to AlipayShare Timeline"; -"share_alipay_no_title" = "No Alipay"; -"share_alipay_no_message" = "Alipay not installed in device"; -"share_alipay_version_not_supported" = "The version of Alipay not supported."; - -"share_sms_no_osSupport" = "No SMS"; -"share_sms_no_osSupport_message" = "The device doesn't support SMS"; - -"share_email_no_osSupport" = "No email"; -"share_email_no_osSupport_message" = "Your email service have been turned off, please turn it on before you share your email"; - -"login_title" = "Login"; -"login_as_tourists" = "Login as tourists"; -"login_choose" = "choose your available account"; - -"commentList_title" = "Comment List"; -"commentList_mask_text" = "Requesting comments, please wait……"; -"commentList_comment_here" = "Comment here"; - -"commentDetail_title" = "Detail"; - -"commentEdit_no_location" = "No Location"; -"commentEdit_post_fail" = "Post comment fail"; -"commentEdit_post_success" = "Post comment success"; -"commentEdit_noLocation_title" = "Location service have been turned off"; -"commentEdit_noLocation_message" = "Your device's location service have been turned off, please turn on it before you share your location"; -"commentEdit_title" = "New Comment"; -"commentEdit_wait" = "Please wait"; - -"ego_pull_down" = "Pull down, refresh"; -"ego_refresh" = "Loose to refresh"; -"ego_load_more" = "Loose to load more"; -"ego_pull_up" = "Pull up, load more"; -"ego_refreshing" = "Refreshing"; -"ego_loading_more" = "Loading more"; - -"loading" = "Loading"; - -"shareEdit_error_network_fail_message" = "Network Error"; - -"network_fail_title" = "Network Error"; -"network_fail_message" = "The network state of your device is not available."; - -"account_title" = "User Center"; -"account_title_authorize_status" = "authorize status"; -"account_label_login_tourist" = "login as tourist"; -"account_label_login_account" = "login account"; -"account_lable_not_auth" = "not authorized"; -"account_lable_have_auth" = "authorized"; -"account_title_sns_config" = "sns accounts"; - -//分享面板 -"umsocial_sina" = "Sina"; - -"umsocial_wechat" = "Wechat"; -"umsocial_wechat_session" = "Wechat"; -"umsocial_wechat_timeline" = "Moments"; -"umsocial_wechat_favorite" = "Wechat Favorite"; - -"umsocial_qq" = "QQ"; -"umsocial_qzone" = "Qzone"; -"umsocial_tencentWB" = "tencentWB"; - -"umsocial_alipay" = "alipay"; -"umsocial_alipay_session" = "Alipay"; -"umsocial_aliay_circle" = "LifeCircle"; - -"umsocial_lw_session" = "LaiWang"; -"umsocial_lw_timeline" = "LW News"; - -"umsocial_yixin_session" = "YiXin"; -"umsocial_yixin_timeline" = "YX Moments"; - -"umsocial_douban" = "Douban"; - -"umsocial_renren" = "Renren"; - -"umsocial_email" = "Email"; -"umsocial_sms" = "SMS"; - -"umsocial_facebook" = "Facebook"; -"umsocial_twitter" = "Twitter"; -"umsocial_instagram" = "Instagram"; -"umsocial_line" = "Line"; -"umsocial_flickr" = "Flickr"; -"umsocial_kakaoTalk" = "KakaoTalk"; -"umsocial_pinterest" = "Pinterest"; -"umsocial_tumblr" = "Tumblr"; -"umsocial_linkedin" = "Linkedin"; -"umsocial_whatsapp" = "Whatsapp"; - -"umsocial_youdaonote" = "ydnote"; -"umsocial_evernote" = "evernote"; -"umsocial_googleplus" = "Google+"; -"umsocial_pocket" = "Pocket"; -"umsocial_dropbox" = "Dropbox"; -"umsocial_vkontakte" = "VKontakte"; -"umsocial_facebookmessenger" = "Messenger"; - -"umsocial_default" = "template"; - -//云端分享认证的国际化字符串 -"cloudShare_share_success" = "share success"; -"cloudShare_share_failed" = "share failed"; - -"cloudShare_share_close" = "close"; -"cloudShare_share_send" = "send"; -"cloudShare_share" = "share"; - -"cloudShare_oauth_title" = "oauth"; -"cloudShare_oauth_error" = "oauth error"; diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/zh-Hans.lproj/UMSocialLocalizable.strings b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/zh-Hans.lproj/UMSocialLocalizable.strings deleted file mode 100644 index 20493655..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle/zh-Hans.lproj/UMSocialLocalizable.strings +++ /dev/null @@ -1,184 +0,0 @@ -/* - Localizable.strings - SocialSDK - - Created by yeahugo on 13-6-17. - Copyright (c) 2013年 Umeng. All rights reserved. -*/ -"button_cancel" = "取消"; -"button_ok" = "确定"; -"button_start" = "开启"; - -"button_close" = "关闭"; -"button_back" = "返回"; -"button_refresh" = "刷新"; - -"label_request_account" = "正在获取账户信息,请稍等..."; - -"oauth_title" = "授权"; -"oauth_text" = "正在连接授权页面,请稍等..."; -"mask_text" = "正在获取数据,请稍等..."; -"oauth_follow" = "关注官方微博"; - -"oauth_error_title" = "授权失败"; -"oauth_error_message" = "服务器繁忙,授权失败,请稍后再试"; -"oauth_error_not_approved" = "由于没有在开放平台添加此账号作为测试账号或者没有通过审核等原因授权失败"; - -"umsocial_shareUI_Title" = "请选择分享平台"; -"umsocial_shareUI_CancelControlText" = "取消分享"; - -"shareQQ_error" = "抱歉"; -"shareQQ_notInstall" = "没有安装手机QQ客户端"; -"shareQQ_openFail" = "打开手机QQ失败"; -"shareQQ_ShareFail" = "分享到QQ失败"; -"shareClient_notInstall" = "没有安装客户端"; -"shareInstagram_openFail" = "没有安装Instagram客户端"; - -"custom_share_title" = "友盟分享"; - -"shareList_title" = "分享至"; -"shareEdit_title" = "分享至"; -"shareEdit_post" = "发布"; -"shareEdit_change_account" = "切换账号"; -"shareEdit_post_finish" = "发送成功"; -"shareEdit_post_fail" = "发送失败"; -"shareEdit_posting" = "正在发送"; -"shareEdit_delete_picture" = "删除图片"; -"shareEdit_delete_video" = "删除视频"; -"shareEdit_delete_music" = "删除音乐"; -"shareEdit_error_not_empty" = "分享内容不能为空"; -"shareEdit_error_too_long" = "分享内容长度超出限制"; -"shareEdit_error_auth_expired" = "授权过期,分享失败"; -"shareEdit_error_auth_again" = "重新授权"; -"shareEdit_error_text_repeated" = "内容重复,分享失败"; -"shareEdit_error_user_baned" = "对不起,因为违反了用户协议您已被禁言"; -"shareEdit_error_fail" = "分享失败"; -"shareEdit_error_no_auth" = "无上传图片的权限,分享失败"; -"shareEdit_error_empty_content" = "分享内容为空,分享失败"; -"shareEdit_addFollow" = "关注官方微博"; -"shareEdit_C" = "符"; -"shareEdit_used" = "常"; -"shareShake_button" = "分享"; - -"share_wechat" = "分享至微信"; -"share_wechat_friend" = "分享至微信好友"; -"share_wechat_moments" = "分享至微信朋友圈"; -"share_wechat_no_title" = "温馨提示"; -"share_wechat_no_message" = "您的设备没有安装微信"; -"share_facebook_not_login" = "账号未登录"; -"share_facebook_not_login_message" = "账号未登录"; -"share_facebook_no_osSupport" = "系统不支持"; -"share_facebook_no_osSupport_message" = "您的iOS系统版本过低,不支持分享到该平台"; - -"share_alipay" = "分享至支付宝"; -"share_alipay_friend" = "分享至支付宝好友"; -"share_alipay_moments" = "分享至支付宝生活圈"; -"share_alipay_no_title" = "温馨提示"; -"share_alipay_no_message" = "您的设备没有安装支付宝"; -"share_alipay_version_not_supported" = "您的支付宝版本不支持分享"; - -"share_sms_no_osSupport" = "不支持短信"; -"share_sms_no_osSupport_message" = "您的设备不支持短信功能"; - -"share_email_no_osSupport" = "邮件功能未开启"; -"share_email_no_osSupport_message" = "您当前的邮件服务处于未启用状态,请先前往系统设置中配置邮件服务后,再进行分享"; - -"login_title" = "登录"; -"login_as_tourists" = "游客身份"; -"login_choose" = "选择已有账号登录"; - -"commentList_title" = "评论列表"; -"commentList_mask_text" = "正在获取评论数据,请稍等..."; -"commentList_comment_here" = "在这说点什么..."; - -"commentDetail_title" = "评论详情"; - -"commentEdit_no_location" = "取消定位"; -"commentEdit_post_fail" = "评论失败"; -"commentEdit_post_success" = "评论成功"; -"commentEdit_noLocation_title" = "定位服务未开启"; -"commentEdit_noLocation_message" = "您当前的定位服务处于关闭状态,或者没有对此应用开启地理位置服务,请先前往系统设置中开启本应用的定位服务,再进行分享"; -"commentEdit_title" = "新评论"; -"commentEdit_wait" = "评论发送中,请稍等..."; - -"ego_pull_down" = "下拉刷新"; -"ego_pull_up" = "上拉加载更多"; -"ego_refreshing" = "正在刷新"; -"ego_loading_more" = "正在加载更多"; -"ego_refresh" = "松开立即刷新"; -"ego_loadmore" = "松开立即加载更多"; -"shareEdit_error_network_fail_message" = "网络不给力,发送失败了"; - -"loading" = " 加载中 "; - -"network_fail_title" = "温馨提示"; -"network_fail_message" = "当前网络不给力"; - -"account_title" = "个人中心"; -"account_title_authorize_status" = "授权信息"; -"account_label_login_tourist" = "游客登录"; -"account_label_login_account" = "登录账号"; -"account_lable_not_auth" = "尚未授权"; -"account_lable_have_auth" = "已授权"; -"account_title_sns_config" = "分享设置"; - -//分享面板 -"umsocial_sina" = "新浪微博"; - -"umsocial_wechat" = "微信"; -"umsocial_wechat_session" = "微信好友"; -"umsocial_wechat_timeline" = "微信朋友圈"; -"umsocial_wechat_favorite" = "微信收藏"; - -"umsocial_qq" = "QQ"; -"umsocial_qzone" = "QQ空间"; -"umsocial_tencentWB" = "腾讯微博"; - -"umsocial_alipay" = "支付宝"; -"umsocial_alipay_session" = "支付宝好友"; -"umsocial_aliay_circle" = "生活圈"; - -"umsocial_lw_session" = "点点虫"; -"umsocial_lw_timeline" = "点点虫动态"; - -"umsocial_yixin_session" = "易信"; -"umsocial_yixin_timeline" = "易信朋友圈"; - -"umsocial_douban" = "豆瓣"; - -"umsocial_renren" = "人人网"; - -"umsocial_email" = "邮箱"; -"umsocial_sms" = "短信"; - -"umsocial_facebook" = "Facebook"; -"umsocial_twitter" = "Twitter"; -"umsocial_instagram" = "Instagram"; -"umsocial_line" = "Line"; -"umsocial_flickr" = "Flickr"; -"umsocial_kakaoTalk" = "KakaoTalk"; -"umsocial_pinterest" = "Pinterest"; -"umsocial_tumblr" = "Tumblr"; -"umsocial_linkedin" = "Linkedin"; -"umsocial_whatsapp" = "Whatsapp"; - -"umsocial_youdaonote" = "有道云笔记"; -"umsocial_evernote" = "印象笔记"; -"umsocial_googleplus" = "Google+"; -"umsocial_pocket" = "Pocket"; -"umsocial_dropbox" = "Dropbox"; -"umsocial_vkontakte" = "VKontakte"; -"umsocial_facebookmessenger" = "Messenger"; - -"umsocial_default" = "自定义模板"; - -//云端分享认证的国际化字符串 -"cloudShare_share_success" = "分享成功"; -"cloudShare_share_failed" = "分享失败"; - -"cloudShare_share_close" = "关闭"; -"cloudShare_share_send" = "发送"; -"cloudShare_share" = "分享"; - -"cloudShare_oauth_title" = "授权"; -"cloudShare_oauth_error" = "授权错误"; diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialShareUIConfig.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialShareUIConfig.h deleted file mode 100644 index af434b12..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialShareUIConfig.h +++ /dev/null @@ -1,287 +0,0 @@ -// -// UMSocialShareUIConfig.h -// UMSocialSDK -// -// Created by 张军华 on 16/11/7. -// Copyright © 2016年 UMeng. All rights reserved. -// - -#import -#import -#import -#import "UMSocialUIUtility.h" - -@class UMSocialSharePageGroupViewConfig; -@class UMSocialShareContainerConfig; -@class UMSocialShareTitleViewConfig; -@class UMSocialSharePageScrollViewConfig; -@class UMSocialSharePageControlConfig; -@class UMSocialShareCancelControlConfig; -@class UMSocialSharePageControl; -@class UMSocialSharePageScrollView; -@class UMSocialPlatformItemViewConfig; - -typedef void(^UMSocialSharePlatformSelectionBlock)(UMSocialPlatformType platformType,NSDictionary* userInfo); - - -/** - * 分享面板的代码,目前只提供显示,隐藏和指定父窗口 - */ -@protocol UMSocialShareMenuViewDelegate -@optional -/** - * 分享面板显示的回调 - */ -- (void)UMSocialShareMenuViewDidAppear; - -/** - * 分享面板的消失的回调 - */ -- (void)UMSocialShareMenuViewDidDisappear; - -/** - * 返回分享面板的父窗口,用于嵌入在父窗口上显示 - * - * @param defaultSuperView 默认加载的父窗口 - * - * @return 返回实际的父窗口 - * @note 返回的view应该是全屏的view,方便分享面板来布局。 - * @note 如果用户要替换成自己的ParentView,需要保证该view能覆盖到navigationbar和statusbar - * @note 当前分享面板已经是在window上,如果需要切换就重写此协议,如果不需要改变父窗口则不需要重写此协议 - */ -- (UIView*)UMSocialParentView:(UIView*)defaultSuperView; -@end - - -/** - * 点击平台的代理 - */ -@protocol UMSocialHandlePlatformTypeDelegate - -@optional - -/** - * 点击分享面板的回调 - * - * @param platformType 平台类型 @see UMSocialPlatformType - * @param userInfo 点击对应平台类型附带的userinfo,字典类型可为nil - */ -- (void)handlePlatformType:(UMSocialPlatformType)platformType withUserInfo:(NSDictionary*)userInfo; - -@end - - -/** - * 滑动分页scrollview的代理 - */ -@protocol UMSocialHandlePlatformTypeDelegate; - -@protocol UMSocialSharePageScrollViewDelegate - -@optional - -/** - * 滑动分页scrollview的代理 - * - * @param sharePageScrollView UMSocialSharePageScrollView的对象 - * @param numberOfPages 当前的分页总数 - * @param currentPage 当前页的index - */ -- (void)handleSocialSharePageScrollView:(UMSocialSharePageScrollView *)sharePageScrollView - withNumberOfPages:(NSInteger)numberOfPages - withCurrentPage:(NSInteger)currentPage; - - -@end - -/** - * 点击pageControl的事件的代理 - */ -@protocol UMSocialSharePageControlDelegate - -@optional -- (void)handleSocialSharePageControl:(UMSocialSharePageControl*)sharePageControl withNewPage:(NSInteger)newPage; - -@end - -typedef NS_ENUM(NSUInteger, UMSocialSharePageGroupViewPositionType){ - UMSocialSharePageGroupViewPositionType_Bottom,//显示在底部 - UMSocialSharePageGroupViewPositionType_Middle,//显示在中间 -}; - -typedef NS_ENUM(NSUInteger, UMSocialPlatformItemViewBackgroudType){ - UMSocialPlatformItemViewBackgroudType_None,//有图片,没有圆背景, - UMSocialPlatformItemViewBackgroudType_IconAndBGRadius,//有图片,圆背景, - UMSocialPlatformItemViewBackgroudType_IconAndBGRoundAndSuperRadius,//有图片,圆角背景, -}; - -/** - * 分享面板的配置类 - */ -@interface UMSocialShareUIConfig : NSObject - -+(UMSocialShareUIConfig*)shareInstance; - -@property(nonatomic,readwrite,strong)UMSocialSharePageGroupViewConfig* sharePageGroupViewConfig; -@property(nonatomic,readwrite,strong)UMSocialShareContainerConfig* shareContainerConfig; -@property(nonatomic,readwrite,strong)UMSocialShareTitleViewConfig* shareTitleViewConfig; -@property(nonatomic,readwrite,strong)UMSocialSharePageScrollViewConfig* sharePageScrollViewConfig; -@property(nonatomic,readwrite,strong)UMSocialPlatformItemViewConfig* sharePlatformItemViewConfig; -@property(nonatomic,readwrite,strong)UMSocialSharePageControlConfig* sharePageControlConfig; -@property(nonatomic,readwrite,strong)UMSocialShareCancelControlConfig* shareCancelControlConfig; - -@end - - -/** - * ShareMenuSelection的配置类 - */ -@interface UMSocialSharePageGroupViewConfig : NSObject - -@property(nonatomic,readwrite,strong)UIColor* sharePageGroupViewBackgroundColor;//背景颜色 - -@property(nonatomic,readwrite,strong)UIColor* sharePageGroupViewMaskColor;//分享菜单整个背景 -@property(nonatomic,readwrite,assign)CGFloat sharePageGroupViewMaskViewAlpha;//分享菜单整个背景的Alpha - -@property (nonatomic,readwrite,assign)UMSocialSharePageGroupViewPositionType sharePageGroupViewPostionType;//分享面板类的位置@see UMSocialSharePageGroupViewPositionType - -@end - -/** - * ShareContainer的配置类 - */ -@interface UMSocialShareContainerConfig : NSObject - -@property(nonatomic,readwrite,assign)CGFloat shareContainerMarginTop;//相对父view的上边距 -@property(nonatomic,readwrite,assign)CGFloat shareContainerMarginBottom;//相对父view的下边距 -@property(nonatomic,readwrite,assign)CGFloat shareContainerMarginLeft;//相对父view的左边距 -@property(nonatomic,readwrite,assign)CGFloat shareContainerMarginRight;//相对父view的右边距 -@property(nonatomic,readwrite,assign)CGFloat shareContainerMarginLeftForMid;//相对父view的左边距如果sharePageGroupViewPostionType为UMSocialSharePageGroupViewPositionType_Middle的时候 -@property(nonatomic,readwrite,assign)CGFloat shareContainerMarginRightForMid;//相对父view的右边距相对父view的左边距如果sharePageGroupViewPostionType为UMSocialSharePageGroupViewPositionType_Middle的时候 - -@property(nonatomic,readwrite,assign)CGFloat shareContainerCornerRadius;//圆角 -@property(nonatomic,readwrite,strong)UIColor* shareContainerBackgroundColor;//背景色 - -//设置ShareContainer左右渐变显示的参数 -@property(nonatomic,readwrite,assign)BOOL isShareContainerHaveGradient;//是否开启渐变当滑动到边缘的时候 -@property(nonatomic,readwrite,strong)UIColor* shareContainerGradientStartColor;//渐变开始的颜色 -@property(nonatomic,readwrite,strong)UIColor* shareContainerGradientEndColor;//渐变结束的颜色 -@property(nonatomic,readwrite,assign)CGFloat shareContainerGradientLeftWidth;//左边的渐变宽度 -@property(nonatomic,readwrite,assign)CGFloat shareContainerGradientRightWidth;//右边的渐变宽度 - -@end - -/** - * ShareTitleView的配置类 - */ -@interface UMSocialShareTitleViewConfig : NSObject - -@property(nonatomic,readwrite,assign)BOOL isShow;//是否显示 - -@property(nonatomic,readwrite,strong)NSString* shareTitleViewTitleString;//标题的文字 -@property(nonatomic,readwrite,strong)UIFont* shareTitleViewFont;//字体 -@property(nonatomic,readwrite,strong)UIColor* shareTitleViewTitleColor;//文字颜色 -//shareContainerPaddingLeft -@property(nonatomic,readwrite,strong)UIColor* shareTitleViewBackgroundColor;//背景颜色 - -@property(nonatomic,readwrite,assign)CGFloat shareTitleViewPaddingTop;//title的内边距top -@property(nonatomic,readwrite,assign)CGFloat shareTitleViewPaddingBottom;//title的内边距Bottom - - - -@end - -/** - * ShareScrollView的配置类 - */ -@interface UMSocialSharePageScrollViewConfig : NSObject - -@property(nonatomic,readwrite,strong)UIColor* shareScrollViewBackgroundColor;//shareScrollView背景色 - -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageRowSpace;//每页的行间距 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageColumnSpace;//每页的列间距(在设置了shareScrollViewPageMaxItemWidth后,列间距会变化一般设置只是估算每行的容纳的item的个数) -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMarginLeft; //每页的左边距 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMarginRight; //每页的右边距 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMarginTop; //每页的上边距 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMarginBottom; //每页的下边距 - -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPadingLeft; //ScrollView的Left外边距(相对与父窗口) -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPadingRight; //ScrollView的Right外边距(相对与父窗口) -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPadingTop; //ScrollView的Top边距(相对与父窗口) -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPadingBottom; //ScrollView的Bottom边距(相对与父窗口) - -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemWidth; //每页Items的最大宽度 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemHeight; //每页Items的最大高度 - -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemBGWidth; //每页Item内部icon下背景的宽度与shareScrollViewPageMaxItemWidth相同 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemBGHeight; //每页Item内部icon下背景的高度与shareScrollViewPageMaxItemBGWidth相同 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemIconWidth; //每页Item内部icon下宽度 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemIconHeight; //每页Item内部icon下高度 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemSpaceBetweenIconAndName; //每页Item背景和icon的上下间距 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemNameHeight; //每页Item的name的高度 -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxItemNameWidth; //每页Item的name的宽度,和shareScrollViewPageMaxItemBGWidth一样 - -@property(nonatomic,readwrite,strong)UIColor* shareScrollViewPageBGColor; //每页的背景颜色 - -@property(nonatomic,readwrite,assign)UMSocialPlatformItemViewBackgroudType shareScrollViewPageItemStyleType;//@see UMSocialPlatformItemViewBackgroudType - -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxRowCountForPortraitAndBottom; //每页显示最大的行(在底部显示手机处于肖像模式) -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxColumnCountForPortraitAndBottom; //每页显示最大的列(在底部显示手机处于肖像模式) - -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxRowCountForLandscapeAndBottom; //每页显示最大的行(在底部显示手机处于风景模式) -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxColumnCountForLandscapeAndBottom; //每页显示最大的列(在底部显示手机处于风景模式) - -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxRowCountForPortraitAndMid; //每页显示最大的行(在中间显示手机处于肖像模式) -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxColumnCountForPortraitAndMid; //每页显示最大的列(在中间显示手机处于肖像模式) - -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxRowCountForLandscapeAndMid; //每页显示最大的行(在中间显示手机处于风景模式) -@property(nonatomic,readwrite,assign)CGFloat shareScrollViewPageMaxColumnCountForLandscapeAndMid; //每页显示最大的列(在中间显示手机处于风景模式) - - -@end - -/** - * 每个page内Item的配置类 - */ -@interface UMSocialPlatformItemViewConfig : NSObject - -@property(nonatomic,readwrite,strong)UIColor* sharePlatformItemViewBGRadiusColor; //有圆角背景时的颜色 -@property(nonatomic,readwrite,strong)UIColor* sharePlatformItemViewBGRadiusColorPressed;//有圆角背景时的按下颜色 - -@property(nonatomic,readwrite,strong)UIColor* sharePlatformItemViewPlatformNameColor;//平台的颜色 - -@end - -/** - * SharePageControl的配置类 - */ -@interface UMSocialSharePageControlConfig : NSObject - -@property(nonatomic,readwrite,assign)BOOL isShow;//是否显示 - -@property(nonatomic,readwrite,strong)UIColor* sharePageControlPageIndicatorTintColor;//指示器颜色 -@property(nonatomic,readwrite,strong)UIColor* sharePageControlCurrentPageIndicatorTintColor;//当前的页的颜色 -@property(nonatomic,readwrite,assign)BOOL sharePageControlHidesForSinglePage;//为一页是会隐藏 -@property(nonatomic,readwrite,strong)UIColor* sharePageControlBackgroundColor;//背景色 - -@end - -/** - * ShareCancelControl的配置类 - */ -@interface UMSocialShareCancelControlConfig : NSObject - -@property(nonatomic,readwrite,assign)BOOL isShow;//是否显示 - -@property(nonatomic,readwrite,strong)NSString* shareCancelControlText;//相对父view的左边距 -@property(nonatomic,readwrite,strong)UIColor* shareCancelControlTextColor;//文字颜色 -@property(nonatomic,readwrite,strong)UIFont* shareCancelControlTextFont;//文字字体 -@property(nonatomic,readwrite,strong)UIColor* shareCancelControlBackgroundColor;//背景颜色; -@property(nonatomic,readwrite,strong)UIColor* shareCancelControlBackgroundColorPressed;//点击时的按下颜色 - -@end - - - - - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialUIManager.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialUIManager.h deleted file mode 100644 index 287b945a..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialUIManager.h +++ /dev/null @@ -1,72 +0,0 @@ -// -// UMSocialUIManager.h -// UMSocialSDK -// -// Created by umeng on 16/8/10. -// Copyright © 2016年 UMeng+. All rights reserved. -// - -#import -#import "UMSocialShareUIConfig.h" - -@interface UMSocialUIManager : NSObject - -#pragma mark - 6.1新增API - -/** - * 显示分享面板 - * - * @param sharePlatformSelectionBlock 回调block - */ -+ (void)showShareMenuViewInWindowWithPlatformSelectionBlock:(UMSocialSharePlatformSelectionBlock)sharePlatformSelectionBlock; - -/** - * 设置预定义平台 - * - * @param preDefinePlatforms 预定于平台数组@see UMSocialPlatformType. - * 开发者需要自己预定义自己需要的平台。 - * 此函数需要在UMSocialSharePlatformSelectionBlock之前调用, - * 传入的平台必须是合法并且是core模块已经检测到的已经存在的平台,不然会被过滤掉(此条款是上线appStore审核的条件,开发者必须注意) - */ -+(void)setPreDefinePlatforms:(NSArray*)preDefinePlatforms; - - -/** - * 设置用户自定义的平台显示在分享面板的imageIcon和imageName - * 设置了此平台后不会过分享面板过滤掉 - * http://dev.umeng.com/social/ios/进阶文档#5 - * - * @param platformType 用户自定义的平台 范围在(UMSocialPlatformType_UserDefine_Begin,UMSocialPlatformType_UserDefine_End) @see UMSocialPlatformType - * @param platformIcon 平台的icon - * @param platformName 平台的名字 - * @disuss 此函数也可以加入用户需要自定义非平台的功能的性item,比如copy,paste等系统功能 - */ -+(void)addCustomPlatformWithoutFilted:(UMSocialPlatformType)platformType - withPlatformIcon:(UIImage*)platformIcon - withPlatformName:(NSString*)platformName; - -/** - * 删除用户自定义的平台显示在分享面板的imageIcon和imageName - * http://dev.umeng.com/social/ios/进阶文档#5 - * - * @param platformType 范围在(UMSocialPlatformType_UserDefine_Begin,UMSocialPlatformType_UserDefine_End) @see UMSocialPlatformType - */ -+(void)removeCustomPlatformWithoutFilted:(UMSocialPlatformType)platformType; - -/** - * 删除所有的用户自定义的平台 - * http://dev.umeng.com/social/ios/进阶文档#5 - */ -+(void)removeAllCustomPlatformWithoutFilted; - - -/** - * 设置分享面板的代理,从而监控其显示和隐藏的状态 - * - * @param shareMenuViewDelegate shareMenuViewDelegate @see UMSocialShareMenuViewDelegate - * @dicuss 用户根据自己的需求来判断是否需要监控分享面板的显示和隐藏的状态 - */ -+(void)setShareMenuViewDelegate:(id)shareMenuViewDelegate; - -@end - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialUIUtility.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialUIUtility.h deleted file mode 100644 index f5c90bdb..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UMSocialUIUtility.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// UMSocialUIUtility.h -// UMSocialSDK -// -// Created by 张军华 on 16/11/10. -// Copyright © 2016年 UMeng. All rights reserved. -// - -#import -#import -#import - - -/** - * UMSocial的工具类 - */ -@interface UMSocialUIUtility : NSObject - -+ (UIColor *)colorWithHexString:(NSString *)string; - -+(void)configWithPlatformType:(UMSocialPlatformType)platformType withImageName:(NSString**)imageName withPlatformName:(NSString**)platformName; - -+ (UIImage *)imageNamed:(NSString *)name; - -+ (NSString *)localizedString:(NSString *)key defaultString:(NSString *)defaultString; - -@end - -#define UMSocialRGBColor(r, g, b) [UIColor colorWithRed:(r)/255.f green:(g)/255.f blue:(b)/255.f alpha:1.f] - -#define UMSocialColorWithHexString(colorValueString) [UMSocialUIUtility colorWithHexString:colorValueString] diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UShareUI.h b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UShareUI.h deleted file mode 100644 index b387c0e7..00000000 --- a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Headers/UShareUI.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// UShareUI.h -// UShareUI -// -// Created by wyq.Cloudayc on 11/24/16. -// Copyright © 2016 Umeng. All rights reserved. -// - -#import - -//! Project version number for UShareUI. -FOUNDATION_EXPORT double UShareUIVersionNumber; - -//! Project version string for UShareUI. -FOUNDATION_EXPORT const unsigned char UShareUIVersionString[]; - - -#import -#import - diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Info.plist b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Info.plist deleted file mode 100644 index 282aaac6..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/Info.plist and /dev/null differ diff --git a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/UShareUI b/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/UShareUI deleted file mode 100644 index 466f518b..00000000 Binary files a/iOSProject/Pods/UMengUShare/UShareSDK/UMSocialUI/UShareUI.framework/UShareUI and /dev/null differ diff --git a/iOSProject/Pods/WebViewJavascriptBridge/LICENSE b/iOSProject/Pods/WebViewJavascriptBridge/LICENSE deleted file mode 100644 index 56b08241..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2011-2015 Marcus Westin, Antoine Lagadec - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/iOSProject/Pods/WebViewJavascriptBridge/README.md b/iOSProject/Pods/WebViewJavascriptBridge/README.md deleted file mode 100644 index 31ffa5e9..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/README.md +++ /dev/null @@ -1,238 +0,0 @@ -WebViewJavascriptBridge -======================= - -[![Circle CI](https://img.shields.io/circleci/project/github/marcuswestin/WebViewJavascriptBridge.svg)](https://circleci.com/gh/marcuswestin/WebViewJavascriptBridge) - -An iOS/OSX bridge for sending messages between Obj-C and JavaScript in WKWebViews, UIWebViews & WebViews. - -Migration Guide ---------------- - -When upgrading from v5.0.x to 6.0.x you will have to update the `setupWebViewJavascriptBridge` javascript snippet. See https://github.com/marcuswestin/WebViewJavascriptBridge#usage part 4). - -Who uses WebViewJavascriptBridge? ---------------------------------- -WebViewJavascriptBridge is used by a range of companies and projects. This is a small and incomplete sample list: - -- [Facebook Messenger](https://www.facebook.com/mobile/messenger) -- [Facebook Paper](https://facebook.com/paper) -- [Yardsale](http://www.getyardsale.com/) -- [EverTrue](http://www.evertrue.com/) -- [Game Insight](http://www.game-insight.com/) -- [Sush.io](http://www.sush.io) -- [Imbed](http://imbed.github.io/) -- [CareZone](https://carezone.com) -- [Hemlig](http://www.hemlig.co) -- [Altralogica](http://www.altralogica.it) -- [鼎盛中华](https://itunes.apple.com/us/app/ding-sheng-zhong-hua/id537273940?mt=8) -- [FRIL](https://fril.jp) -- [留白·WHITE](http://liubaiapp.com) -- [BrowZine](http://thirdiron.com/browzine/) -- ... & many more! - -Installation (iOS & OSX) ------------------------- - -### Installation with CocoaPods -Add this to your [podfile](https://guides.cocoapods.org/using/getting-started.html) and run `pod install` to install: - -```ruby -pod 'WebViewJavascriptBridge' -``` - -### Manual installation - -Drag the `WebViewJavascriptBridge` folder into your project. - -In the dialog that appears, uncheck "Copy items into destination group's folder" and select "Create groups for any folders". - -Examples --------- - -See the `Example Apps/` folder. Open either the iOS or OSX project and hit run to see it in action. - -To use a WebViewJavascriptBridge in your own project: - -Usage ------ - -1) Import the header file and declare an ivar property: - -```objc -#import "WebViewJavascriptBridge.h" -``` - -... - -```objc -@property WebViewJavascriptBridge* bridge; -``` - -2) Instantiate WebViewJavascriptBridge with a WKWebView, UIWebView (iOS) or WebView (OSX): - -```objc -self.bridge = [WebViewJavascriptBridge bridgeForWebView:webView]; -``` - -3) Register a handler in ObjC, and call a JS handler: - -```objc -[self.bridge registerHandler:@"ObjC Echo" handler:^(id data, WVJBResponseCallback responseCallback) { - NSLog(@"ObjC Echo called with: %@", data); - responseCallback(data); -}]; -[self.bridge callHandler:@"JS Echo" data:nil responseCallback:^(id responseData) { - NSLog(@"ObjC received response: %@", responseData); -}]; -``` - -4) Copy and paste `setupWebViewJavascriptBridge` into your JS: - -```javascript -function setupWebViewJavascriptBridge(callback) { - if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); } - if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); } - window.WVJBCallbacks = [callback]; - var WVJBIframe = document.createElement('iframe'); - WVJBIframe.style.display = 'none'; - WVJBIframe.src = 'https://__bridge_loaded__/'; - document.documentElement.appendChild(WVJBIframe); - setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0) -} -``` - -5) Finally, call `setupWebViewJavascriptBridge` and then use the bridge to register handlers and call ObjC handlers: - -```javascript -setupWebViewJavascriptBridge(function(bridge) { - - /* Initialize your app here */ - - bridge.registerHandler('JS Echo', function(data, responseCallback) { - console.log("JS Echo called with:", data) - responseCallback(data) - }) - bridge.callHandler('ObjC Echo', {'key':'value'}, function responseCallback(responseData) { - console.log("JS received response:", responseData) - }) -}) -``` - -Automatic reference counting (ARC) ----------------------------------- -This library relies on ARC, so if you use ARC in you project, all works fine. -But if your project have no ARC support, be sure to do next steps: - -1) In your Xcode project open project settings -> 'Build Phases' - -2) Expand 'Compile Sources' header and find all *.m files which are belongs to this library. Make attention on the 'Compiler Flags' in front of each source file in this list - -3) For each file add '-fobjc-arc' flag - -Now all WVJB files will be compiled with ARC support. - -Contributors & Forks --------------------- -Contributors: https://github.com/marcuswestin/WebViewJavascriptBridge/graphs/contributors - -Forks: https://github.com/marcuswestin/WebViewJavascriptBridge/network/members - -API Reference -------------- - -### ObjC API - -##### `[WebViewJavascriptBridge bridgeForWebView:(WKWebVIew/UIWebView/WebView*)webview` - -Create a javascript bridge for the given web view. - -Example: - -```objc -[WebViewJavascriptBridge bridgeForWebView:webView]; -``` - -##### `[bridge registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler]` - -Register a handler called `handlerName`. The javascript can then call this handler with `WebViewJavascriptBridge.callHandler("handlerName")`. - -Example: - -```objc -[self.bridge registerHandler:@"getScreenHeight" handler:^(id data, WVJBResponseCallback responseCallback) { - responseCallback([NSNumber numberWithInt:[UIScreen mainScreen].bounds.size.height]); -}]; -[self.bridge registerHandler:@"log" handler:^(id data, WVJBResponseCallback responseCallback) { - NSLog(@"Log: %@", data); -}]; - -``` - -##### `[bridge callHandler:(NSString*)handlerName data:(id)data]` -##### `[bridge callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)callback]` - -Call the javascript handler called `handlerName`. If a `responseCallback` block is given the javascript handler can respond. - -Example: - -```objc -[self.bridge callHandler:@"showAlert" data:@"Hi from ObjC to JS!"]; -[self.bridge callHandler:@"getCurrentPageUrl" data:nil responseCallback:^(id responseData) { - NSLog(@"Current UIWebView page URL is: %@", responseData); -}]; -``` - -#### `[bridge setWebViewDelegate:(id)webViewDelegate]` - -Optionally, set a `WKNavigationDelegate/UIWebViewDelegate` if you need to respond to the [web view's lifecycle events](https://developer.apple.com/reference/uikit/uiwebviewdelegate). - -##### `[bridge disableJavscriptAlertBoxSafetyTimeout]` - -UNSAFE. Speed up bridge message passing by disabling the setTimeout safety check. It is only safe to disable this safety check if you do not call any of the javascript popup box functions (alert, confirm, and prompt). If you call any of these functions from the bridged javascript code, the app will hang. - -Example: - - [self.bridge disableJavscriptAlertBoxSafetyTimeout]; - - - -### Javascript API - -##### `bridge.registerHandler("handlerName", function(responseData) { ... })` - -Register a handler called `handlerName`. The ObjC can then call this handler with `[bridge callHandler:"handlerName" data:@"Foo"]` and `[bridge callHandler:"handlerName" data:@"Foo" responseCallback:^(id responseData) { ... }]` - -Example: - -```javascript -bridge.registerHandler("showAlert", function(data) { alert(data) }) -bridge.registerHandler("getCurrentPageUrl", function(data, responseCallback) { - responseCallback(document.location.toString()) -}) -``` - - -##### `bridge.callHandler("handlerName", data)` -##### `bridge.callHandler("handlerName", data, function responseCallback(responseData) { ... })` - -Call an ObjC handler called `handlerName`. If a `responseCallback` function is given the ObjC handler can respond. - -Example: - -```javascript -bridge.callHandler("Log", "Foo") -bridge.callHandler("getScreenHeight", null, function(response) { - alert('Screen height:' + response) -}) -``` - - -##### `bridge.disableJavscriptAlertBoxSafetyTimeout()` - -Calling `bridge.disableJavscriptAlertBoxSafetyTimeout()` has the same effect as calling `[bridge disableJavscriptAlertBoxSafetyTimeout];` in ObjC. - -Example: - -```javascript -bridge.disableJavscriptAlertBoxSafetyTimeout() -``` diff --git a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.h b/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.h deleted file mode 100644 index 4e3404fc..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// WKWebViewJavascriptBridge.h -// -// Created by @LokiMeyburg on 10/15/14. -// Copyright (c) 2014 @LokiMeyburg. All rights reserved. -// - -#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1) -#define supportsWKWebView -#endif - -#if defined supportsWKWebView - -#import -#import "WebViewJavascriptBridgeBase.h" -#import - -@interface WKWebViewJavascriptBridge : NSObject - -+ (instancetype)bridgeForWebView:(WKWebView*)webView; -+ (void)enableLogging; - -- (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler; -- (void)removeHandler:(NSString*)handlerName; -- (void)callHandler:(NSString*)handlerName; -- (void)callHandler:(NSString*)handlerName data:(id)data; -- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback; -- (void)reset; -- (void)setWebViewDelegate:(id)webViewDelegate; -- (void)disableJavscriptAlertBoxSafetyTimeout; - -@end - -#endif diff --git a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m b/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m deleted file mode 100644 index 73c923db..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m +++ /dev/null @@ -1,198 +0,0 @@ -// -// WKWebViewJavascriptBridge.m -// -// Created by @LokiMeyburg on 10/15/14. -// Copyright (c) 2014 @LokiMeyburg. All rights reserved. -// - - -#import "WKWebViewJavascriptBridge.h" - -#if defined supportsWKWebView - -@implementation WKWebViewJavascriptBridge { - __weak WKWebView* _webView; - __weak id _webViewDelegate; - long _uniqueId; - WebViewJavascriptBridgeBase *_base; -} - -/* API - *****/ - -+ (void)enableLogging { [WebViewJavascriptBridgeBase enableLogging]; } - -+ (instancetype)bridgeForWebView:(WKWebView*)webView { - WKWebViewJavascriptBridge* bridge = [[self alloc] init]; - [bridge _setupInstance:webView]; - [bridge reset]; - return bridge; -} - -- (void)send:(id)data { - [self send:data responseCallback:nil]; -} - -- (void)send:(id)data responseCallback:(WVJBResponseCallback)responseCallback { - [_base sendData:data responseCallback:responseCallback handlerName:nil]; -} - -- (void)callHandler:(NSString *)handlerName { - [self callHandler:handlerName data:nil responseCallback:nil]; -} - -- (void)callHandler:(NSString *)handlerName data:(id)data { - [self callHandler:handlerName data:data responseCallback:nil]; -} - -- (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback { - [_base sendData:data responseCallback:responseCallback handlerName:handlerName]; -} - -- (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler { - _base.messageHandlers[handlerName] = [handler copy]; -} - -- (void)removeHandler:(NSString *)handlerName { - [_base.messageHandlers removeObjectForKey:handlerName]; -} - -- (void)reset { - [_base reset]; -} - -- (void)setWebViewDelegate:(id)webViewDelegate { - _webViewDelegate = webViewDelegate; -} - -- (void)disableJavscriptAlertBoxSafetyTimeout { - [_base disableJavscriptAlertBoxSafetyTimeout]; -} - -/* Internals - ***********/ - -- (void)dealloc { - _base = nil; - _webView = nil; - _webViewDelegate = nil; - _webView.navigationDelegate = nil; -} - - -/* WKWebView Specific Internals - ******************************/ - -- (void) _setupInstance:(WKWebView*)webView { - _webView = webView; - _webView.navigationDelegate = self; - _base = [[WebViewJavascriptBridgeBase alloc] init]; - _base.delegate = self; -} - - -- (void)WKFlushMessageQueue { - [_webView evaluateJavaScript:[_base webViewJavascriptFetchQueyCommand] completionHandler:^(NSString* result, NSError* error) { - if (error != nil) { - NSLog(@"WebViewJavascriptBridge: WARNING: Error when trying to fetch data from WKWebView: %@", error); - } - [_base flushMessageQueue:result]; - }]; -} - -- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { - if (webView != _webView) { return; } - - __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFinishNavigation:)]) { - [strongDelegate webView:webView didFinishNavigation:navigation]; - } -} - - -- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler { - if (webView != _webView) { return; } - - __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationResponse:decisionHandler:)]) { - [strongDelegate webView:webView decidePolicyForNavigationResponse:navigationResponse decisionHandler:decisionHandler]; - } - else { - decisionHandler(WKNavigationResponsePolicyAllow); - } -} - -- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler { - if (webView != _webView) { return; } - - __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didReceiveAuthenticationChallenge:completionHandler:)]) { - [strongDelegate webView:webView didReceiveAuthenticationChallenge:challenge completionHandler:completionHandler]; - } else { - completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); - } -} - -- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { - if (webView != _webView) { return; } - NSURL *url = navigationAction.request.URL; - __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; - - if ([_base isWebViewJavascriptBridgeURL:url]) { - if ([_base isBridgeLoadedURL:url]) { - [_base injectJavascriptFile]; - } else if ([_base isQueueMessageURL:url]) { - [self WKFlushMessageQueue]; - } else { - [_base logUnkownMessage:url]; - } - decisionHandler(WKNavigationActionPolicyCancel); - return; - } - - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)]) { - [_webViewDelegate webView:webView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler]; - } else { - decisionHandler(WKNavigationActionPolicyAllow); - } -} - -- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { - if (webView != _webView) { return; } - - __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didStartProvisionalNavigation:)]) { - [strongDelegate webView:webView didStartProvisionalNavigation:navigation]; - } -} - - -- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { - if (webView != _webView) { return; } - - __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailNavigation:withError:)]) { - [strongDelegate webView:webView didFailNavigation:navigation withError:error]; - } -} - -- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error { - if (webView != _webView) { return; } - - __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailProvisionalNavigation:withError:)]) { - [strongDelegate webView:webView didFailProvisionalNavigation:navigation withError:error]; - } -} - -- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand { - [_webView evaluateJavaScript:javascriptCommand completionHandler:nil]; - return NULL; -} - - - -@end - - -#endif diff --git a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.h b/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.h deleted file mode 100755 index 1b64bb4e..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// WebViewJavascriptBridge.h -// ExampleApp-iOS -// -// Created by Marcus Westin on 6/14/13. -// Copyright (c) 2013 Marcus Westin. All rights reserved. -// - -#import -#import "WebViewJavascriptBridgeBase.h" - -#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1) -#define supportsWKWebView -#endif - -#if defined supportsWKWebView -#import -#endif - -#if defined __MAC_OS_X_VERSION_MAX_ALLOWED - #define WVJB_PLATFORM_OSX - #define WVJB_WEBVIEW_TYPE WebView - #define WVJB_WEBVIEW_DELEGATE_TYPE NSObject - #define WVJB_WEBVIEW_DELEGATE_INTERFACE NSObject -#elif defined __IPHONE_OS_VERSION_MAX_ALLOWED - #import - #define WVJB_PLATFORM_IOS - #define WVJB_WEBVIEW_TYPE UIWebView - #define WVJB_WEBVIEW_DELEGATE_TYPE NSObject - #define WVJB_WEBVIEW_DELEGATE_INTERFACE NSObject -#endif - -@interface WebViewJavascriptBridge : WVJB_WEBVIEW_DELEGATE_INTERFACE - - -+ (instancetype)bridgeForWebView:(id)webView; -+ (instancetype)bridge:(id)webView; - -+ (void)enableLogging; -+ (void)setLogMaxLength:(int)length; - -- (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler; -- (void)removeHandler:(NSString*)handlerName; -- (void)callHandler:(NSString*)handlerName; -- (void)callHandler:(NSString*)handlerName data:(id)data; -- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback; -- (void)setWebViewDelegate:(id)webViewDelegate; -- (void)disableJavscriptAlertBoxSafetyTimeout; - -@end diff --git a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.m b/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.m deleted file mode 100755 index e74a6e24..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.m +++ /dev/null @@ -1,211 +0,0 @@ -// -// WebViewJavascriptBridge.m -// ExampleApp-iOS -// -// Created by Marcus Westin on 6/14/13. -// Copyright (c) 2013 Marcus Westin. All rights reserved. -// - -#import "WebViewJavascriptBridge.h" - -#if defined(supportsWKWebView) -#import "WKWebViewJavascriptBridge.h" -#endif - -#if __has_feature(objc_arc_weak) - #define WVJB_WEAK __weak -#else - #define WVJB_WEAK __unsafe_unretained -#endif - -@implementation WebViewJavascriptBridge { - WVJB_WEAK WVJB_WEBVIEW_TYPE* _webView; - WVJB_WEAK id _webViewDelegate; - long _uniqueId; - WebViewJavascriptBridgeBase *_base; -} - -/* API - *****/ - -+ (void)enableLogging { - [WebViewJavascriptBridgeBase enableLogging]; -} -+ (void)setLogMaxLength:(int)length { - [WebViewJavascriptBridgeBase setLogMaxLength:length]; -} - -+ (instancetype)bridgeForWebView:(id)webView { - return [self bridge:webView]; -} -+ (instancetype)bridge:(id)webView { -#if defined supportsWKWebView - if ([webView isKindOfClass:[WKWebView class]]) { - return (WebViewJavascriptBridge*) [WKWebViewJavascriptBridge bridgeForWebView:webView]; - } -#endif - if ([webView isKindOfClass:[WVJB_WEBVIEW_TYPE class]]) { - WebViewJavascriptBridge* bridge = [[self alloc] init]; - [bridge _platformSpecificSetup:webView]; - return bridge; - } - [NSException raise:@"BadWebViewType" format:@"Unknown web view type."]; - return nil; -} - -- (void)setWebViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE*)webViewDelegate { - _webViewDelegate = webViewDelegate; -} - -- (void)send:(id)data { - [self send:data responseCallback:nil]; -} - -- (void)send:(id)data responseCallback:(WVJBResponseCallback)responseCallback { - [_base sendData:data responseCallback:responseCallback handlerName:nil]; -} - -- (void)callHandler:(NSString *)handlerName { - [self callHandler:handlerName data:nil responseCallback:nil]; -} - -- (void)callHandler:(NSString *)handlerName data:(id)data { - [self callHandler:handlerName data:data responseCallback:nil]; -} - -- (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback { - [_base sendData:data responseCallback:responseCallback handlerName:handlerName]; -} - -- (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler { - _base.messageHandlers[handlerName] = [handler copy]; -} - -- (void)removeHandler:(NSString *)handlerName { - [_base.messageHandlers removeObjectForKey:handlerName]; -} - -- (void)disableJavscriptAlertBoxSafetyTimeout { - [_base disableJavscriptAlertBoxSafetyTimeout]; -} - - -/* Platform agnostic internals - *****************************/ - -- (void)dealloc { - [self _platformSpecificDealloc]; - _base = nil; - _webView = nil; - _webViewDelegate = nil; -} - -- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand { - return [_webView stringByEvaluatingJavaScriptFromString:javascriptCommand]; -} - -#if defined WVJB_PLATFORM_OSX -/* Platform specific internals: OSX - **********************************/ - -- (void) _platformSpecificSetup:(WVJB_WEBVIEW_TYPE*)webView { - _webView = webView; - _webView.policyDelegate = self; - _base = [[WebViewJavascriptBridgeBase alloc] init]; - _base.delegate = self; -} - -- (void) _platformSpecificDealloc { - _webView.policyDelegate = nil; -} - -- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id)listener { - if (webView != _webView) { return; } - - NSURL *url = [request URL]; - if ([_base isWebViewJavascriptBridgeURL:url]) { - if ([_base isBridgeLoadedURL:url]) { - [_base injectJavascriptFile]; - } else if ([_base isQueueMessageURL:url]) { - NSString *messageQueueString = [self _evaluateJavascript:[_base webViewJavascriptFetchQueyCommand]]; - [_base flushMessageQueue:messageQueueString]; - } else { - [_base logUnkownMessage:url]; - } - [listener ignore]; - } else if (_webViewDelegate && [_webViewDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:request:frame:decisionListener:)]) { - [_webViewDelegate webView:webView decidePolicyForNavigationAction:actionInformation request:request frame:frame decisionListener:listener]; - } else { - [listener use]; - } -} - - - -#elif defined WVJB_PLATFORM_IOS -/* Platform specific internals: iOS - **********************************/ - -- (void) _platformSpecificSetup:(WVJB_WEBVIEW_TYPE*)webView { - _webView = webView; - _webView.delegate = self; - _base = [[WebViewJavascriptBridgeBase alloc] init]; - _base.delegate = self; -} - -- (void) _platformSpecificDealloc { - _webView.delegate = nil; -} - -- (void)webViewDidFinishLoad:(UIWebView *)webView { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { - [strongDelegate webViewDidFinishLoad:webView]; - } -} - -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) { - [strongDelegate webView:webView didFailLoadWithError:error]; - } -} - -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { - if (webView != _webView) { return YES; } - - NSURL *url = [request URL]; - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if ([_base isWebViewJavascriptBridgeURL:url]) { - if ([_base isBridgeLoadedURL:url]) { - [_base injectJavascriptFile]; - } else if ([_base isQueueMessageURL:url]) { - NSString *messageQueueString = [self _evaluateJavascript:[_base webViewJavascriptFetchQueyCommand]]; - [_base flushMessageQueue:messageQueueString]; - } else { - [_base logUnkownMessage:url]; - } - return NO; - } else if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) { - return [strongDelegate webView:webView shouldStartLoadWithRequest:request navigationType:navigationType]; - } else { - return YES; - } -} - -- (void)webViewDidStartLoad:(UIWebView *)webView { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewDidStartLoad:)]) { - [strongDelegate webViewDidStartLoad:webView]; - } -} - -#endif - -@end diff --git a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridgeBase.h b/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridgeBase.h deleted file mode 100755 index 54d80acc..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridgeBase.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// WebViewJavascriptBridgeBase.h -// -// Created by @LokiMeyburg on 10/15/14. -// Copyright (c) 2014 @LokiMeyburg. All rights reserved. -// - -#import - -#define kOldProtocolScheme @"wvjbscheme" -#define kNewProtocolScheme @"https" -#define kQueueHasMessage @"__wvjb_queue_message__" -#define kBridgeLoaded @"__bridge_loaded__" - -typedef void (^WVJBResponseCallback)(id responseData); -typedef void (^WVJBHandler)(id data, WVJBResponseCallback responseCallback); -typedef NSDictionary WVJBMessage; - -@protocol WebViewJavascriptBridgeBaseDelegate -- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand; -@end - -@interface WebViewJavascriptBridgeBase : NSObject - - -@property (weak, nonatomic) id delegate; -@property (strong, nonatomic) NSMutableArray* startupMessageQueue; -@property (strong, nonatomic) NSMutableDictionary* responseCallbacks; -@property (strong, nonatomic) NSMutableDictionary* messageHandlers; -@property (strong, nonatomic) WVJBHandler messageHandler; - -+ (void)enableLogging; -+ (void)setLogMaxLength:(int)length; -- (void)reset; -- (void)sendData:(id)data responseCallback:(WVJBResponseCallback)responseCallback handlerName:(NSString*)handlerName; -- (void)flushMessageQueue:(NSString *)messageQueueString; -- (void)injectJavascriptFile; -- (BOOL)isWebViewJavascriptBridgeURL:(NSURL*)url; -- (BOOL)isQueueMessageURL:(NSURL*)urll; -- (BOOL)isBridgeLoadedURL:(NSURL*)urll; -- (void)logUnkownMessage:(NSURL*)url; -- (NSString *)webViewJavascriptCheckCommand; -- (NSString *)webViewJavascriptFetchQueyCommand; -- (void)disableJavscriptAlertBoxSafetyTimeout; - -@end diff --git a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridgeBase.m b/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridgeBase.m deleted file mode 100755 index 3ec26ed4..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridgeBase.m +++ /dev/null @@ -1,221 +0,0 @@ -// -// WebViewJavascriptBridgeBase.m -// -// Created by @LokiMeyburg on 10/15/14. -// Copyright (c) 2014 @LokiMeyburg. All rights reserved. -// - -#import -#import "WebViewJavascriptBridgeBase.h" -#import "WebViewJavascriptBridge_JS.h" - -@implementation WebViewJavascriptBridgeBase { - __weak id _webViewDelegate; - long _uniqueId; -} - -static bool logging = false; -static int logMaxLength = 500; - -+ (void)enableLogging { logging = true; } -+ (void)setLogMaxLength:(int)length { logMaxLength = length;} - -- (id)init { - if (self = [super init]) { - self.messageHandlers = [NSMutableDictionary dictionary]; - self.startupMessageQueue = [NSMutableArray array]; - self.responseCallbacks = [NSMutableDictionary dictionary]; - _uniqueId = 0; - } - return self; -} - -- (void)dealloc { - self.startupMessageQueue = nil; - self.responseCallbacks = nil; - self.messageHandlers = nil; -} - -- (void)reset { - self.startupMessageQueue = [NSMutableArray array]; - self.responseCallbacks = [NSMutableDictionary dictionary]; - _uniqueId = 0; -} - -- (void)sendData:(id)data responseCallback:(WVJBResponseCallback)responseCallback handlerName:(NSString*)handlerName { - NSMutableDictionary* message = [NSMutableDictionary dictionary]; - - if (data) { - message[@"data"] = data; - } - - if (responseCallback) { - NSString* callbackId = [NSString stringWithFormat:@"objc_cb_%ld", ++_uniqueId]; - self.responseCallbacks[callbackId] = [responseCallback copy]; - message[@"callbackId"] = callbackId; - } - - if (handlerName) { - message[@"handlerName"] = handlerName; - } - [self _queueMessage:message]; -} - -- (void)flushMessageQueue:(NSString *)messageQueueString{ - if (messageQueueString == nil || messageQueueString.length == 0) { - NSLog(@"WebViewJavascriptBridge: WARNING: ObjC got nil while fetching the message queue JSON from webview. This can happen if the WebViewJavascriptBridge JS is not currently present in the webview, e.g if the webview just loaded a new page."); - return; - } - - id messages = [self _deserializeMessageJSON:messageQueueString]; - for (WVJBMessage* message in messages) { - if (![message isKindOfClass:[WVJBMessage class]]) { - NSLog(@"WebViewJavascriptBridge: WARNING: Invalid %@ received: %@", [message class], message); - continue; - } - [self _log:@"RCVD" json:message]; - - NSString* responseId = message[@"responseId"]; - if (responseId) { - WVJBResponseCallback responseCallback = _responseCallbacks[responseId]; - responseCallback(message[@"responseData"]); - [self.responseCallbacks removeObjectForKey:responseId]; - } else { - WVJBResponseCallback responseCallback = NULL; - NSString* callbackId = message[@"callbackId"]; - if (callbackId) { - responseCallback = ^(id responseData) { - if (responseData == nil) { - responseData = [NSNull null]; - } - - WVJBMessage* msg = @{ @"responseId":callbackId, @"responseData":responseData }; - [self _queueMessage:msg]; - }; - } else { - responseCallback = ^(id ignoreResponseData) { - // Do nothing - }; - } - - WVJBHandler handler = self.messageHandlers[message[@"handlerName"]]; - - if (!handler) { - NSLog(@"WVJBNoHandlerException, No handler for message from JS: %@", message); - continue; - } - - handler(message[@"data"], responseCallback); - } - } -} - -- (void)injectJavascriptFile { - NSString *js = WebViewJavascriptBridge_js(); - [self _evaluateJavascript:js]; - if (self.startupMessageQueue) { - NSArray* queue = self.startupMessageQueue; - self.startupMessageQueue = nil; - for (id queuedMessage in queue) { - [self _dispatchMessage:queuedMessage]; - } - } -} - -- (BOOL)isWebViewJavascriptBridgeURL:(NSURL*)url { - if (![self isSchemeMatch:url]) { - return NO; - } - return [self isBridgeLoadedURL:url] || [self isQueueMessageURL:url]; -} - -- (BOOL)isSchemeMatch:(NSURL*)url { - NSString* scheme = url.scheme.lowercaseString; - return [scheme isEqualToString:kNewProtocolScheme] || [scheme isEqualToString:kOldProtocolScheme]; -} - -- (BOOL)isQueueMessageURL:(NSURL*)url { - NSString* host = url.host.lowercaseString; - return [self isSchemeMatch:url] && [host isEqualToString:kQueueHasMessage]; -} - -- (BOOL)isBridgeLoadedURL:(NSURL*)url { - NSString* host = url.host.lowercaseString; - return [self isSchemeMatch:url] && [host isEqualToString:kBridgeLoaded]; -} - -- (void)logUnkownMessage:(NSURL*)url { - NSLog(@"WebViewJavascriptBridge: WARNING: Received unknown WebViewJavascriptBridge command %@", [url absoluteString]); -} - -- (NSString *)webViewJavascriptCheckCommand { - return @"typeof WebViewJavascriptBridge == \'object\';"; -} - -- (NSString *)webViewJavascriptFetchQueyCommand { - return @"WebViewJavascriptBridge._fetchQueue();"; -} - -- (void)disableJavscriptAlertBoxSafetyTimeout { - [self sendData:nil responseCallback:nil handlerName:@"_disableJavascriptAlertBoxSafetyTimeout"]; -} - -// Private -// ------------------------------------------- - -- (void) _evaluateJavascript:(NSString *)javascriptCommand { - [self.delegate _evaluateJavascript:javascriptCommand]; -} - -- (void)_queueMessage:(WVJBMessage*)message { - if (self.startupMessageQueue) { - [self.startupMessageQueue addObject:message]; - } else { - [self _dispatchMessage:message]; - } -} - -- (void)_dispatchMessage:(WVJBMessage*)message { - NSString *messageJSON = [self _serializeMessage:message pretty:NO]; - [self _log:@"SEND" json:messageJSON]; - messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"]; - messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]; - messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\'" withString:@"\\\'"]; - messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; - messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\r" withString:@"\\r"]; - messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\f" withString:@"\\f"]; - messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2028" withString:@"\\u2028"]; - messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2029" withString:@"\\u2029"]; - - NSString* javascriptCommand = [NSString stringWithFormat:@"WebViewJavascriptBridge._handleMessageFromObjC('%@');", messageJSON]; - if ([[NSThread currentThread] isMainThread]) { - [self _evaluateJavascript:javascriptCommand]; - - } else { - dispatch_sync(dispatch_get_main_queue(), ^{ - [self _evaluateJavascript:javascriptCommand]; - }); - } -} - -- (NSString *)_serializeMessage:(id)message pretty:(BOOL)pretty{ - return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:message options:(NSJSONWritingOptions)(pretty ? NSJSONWritingPrettyPrinted : 0) error:nil] encoding:NSUTF8StringEncoding]; -} - -- (NSArray*)_deserializeMessageJSON:(NSString *)messageJSON { - return [NSJSONSerialization JSONObjectWithData:[messageJSON dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:nil]; -} - -- (void)_log:(NSString *)action json:(id)json { - if (!logging) { return; } - if (![json isKindOfClass:[NSString class]]) { - json = [self _serializeMessage:json pretty:YES]; - } - if ([json length] > logMaxLength) { - NSLog(@"WVJB %@: %@ [...]", action, [json substringToIndex:logMaxLength]); - } else { - NSLog(@"WVJB %@: %@", action, json); - } -} - -@end diff --git a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h b/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h deleted file mode 100644 index 9c857f16..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge_JS.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -NSString * WebViewJavascriptBridge_js(void); diff --git a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge_JS.m b/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge_JS.m deleted file mode 100644 index 670a552f..00000000 --- a/iOSProject/Pods/WebViewJavascriptBridge/WebViewJavascriptBridge/WebViewJavascriptBridge_JS.m +++ /dev/null @@ -1,139 +0,0 @@ -// This file contains the source for the Javascript side of the -// WebViewJavascriptBridge. It is plaintext, but converted to an NSString -// via some preprocessor tricks. -// -// Previous implementations of WebViewJavascriptBridge loaded the javascript source -// from a resource. This worked fine for app developers, but library developers who -// included the bridge into their library, awkwardly had to ask consumers of their -// library to include the resource, violating their encapsulation. By including the -// Javascript as a string resource, the encapsulation of the library is maintained. - -#import "WebViewJavascriptBridge_JS.h" - -NSString * WebViewJavascriptBridge_js() { - #define __wvjb_js_func__(x) #x - - // BEGIN preprocessorJSCode - static NSString * preprocessorJSCode = @__wvjb_js_func__( -;(function() { - if (window.WebViewJavascriptBridge) { - return; - } - - if (!window.onerror) { - window.onerror = function(msg, url, line) { - console.log("WebViewJavascriptBridge: ERROR:" + msg + "@" + url + ":" + line); - } - } - window.WebViewJavascriptBridge = { - registerHandler: registerHandler, - callHandler: callHandler, - disableJavscriptAlertBoxSafetyTimeout: disableJavscriptAlertBoxSafetyTimeout, - _fetchQueue: _fetchQueue, - _handleMessageFromObjC: _handleMessageFromObjC - }; - - var messagingIframe; - var sendMessageQueue = []; - var messageHandlers = {}; - - var CUSTOM_PROTOCOL_SCHEME = 'https'; - var QUEUE_HAS_MESSAGE = '__wvjb_queue_message__'; - - var responseCallbacks = {}; - var uniqueId = 1; - var dispatchMessagesWithTimeoutSafety = true; - - function registerHandler(handlerName, handler) { - messageHandlers[handlerName] = handler; - } - - function callHandler(handlerName, data, responseCallback) { - if (arguments.length == 2 && typeof data == 'function') { - responseCallback = data; - data = null; - } - _doSend({ handlerName:handlerName, data:data }, responseCallback); - } - function disableJavscriptAlertBoxSafetyTimeout() { - dispatchMessagesWithTimeoutSafety = false; - } - - function _doSend(message, responseCallback) { - if (responseCallback) { - var callbackId = 'cb_'+(uniqueId++)+'_'+new Date().getTime(); - responseCallbacks[callbackId] = responseCallback; - message['callbackId'] = callbackId; - } - sendMessageQueue.push(message); - messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE; - } - - function _fetchQueue() { - var messageQueueString = JSON.stringify(sendMessageQueue); - sendMessageQueue = []; - return messageQueueString; - } - - function _dispatchMessageFromObjC(messageJSON) { - if (dispatchMessagesWithTimeoutSafety) { - setTimeout(_doDispatchMessageFromObjC); - } else { - _doDispatchMessageFromObjC(); - } - - function _doDispatchMessageFromObjC() { - var message = JSON.parse(messageJSON); - var messageHandler; - var responseCallback; - - if (message.responseId) { - responseCallback = responseCallbacks[message.responseId]; - if (!responseCallback) { - return; - } - responseCallback(message.responseData); - delete responseCallbacks[message.responseId]; - } else { - if (message.callbackId) { - var callbackResponseId = message.callbackId; - responseCallback = function(responseData) { - _doSend({ handlerName:message.handlerName, responseId:callbackResponseId, responseData:responseData }); - }; - } - - var handler = messageHandlers[message.handlerName]; - if (!handler) { - console.log("WebViewJavascriptBridge: WARNING: no handler for message from ObjC:", message); - } else { - handler(message.data, responseCallback); - } - } - } - } - - function _handleMessageFromObjC(messageJSON) { - _dispatchMessageFromObjC(messageJSON); - } - - messagingIframe = document.createElement('iframe'); - messagingIframe.style.display = 'none'; - messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE; - document.documentElement.appendChild(messagingIframe); - - registerHandler("_disableJavascriptAlertBoxSafetyTimeout", disableJavscriptAlertBoxSafetyTimeout); - - setTimeout(_callWVJBCallbacks, 0); - function _callWVJBCallbacks() { - var callbacks = window.WVJBCallbacks; - delete window.WVJBCallbacks; - for (var i=0; i -#import "WXApiObject.h" - - -#pragma mark - WXApiDelegate -/*! @brief 接收并处理来自微信终端程序的事件消息 - * - * 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。 - * WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。 - */ -@protocol WXApiDelegate -@optional - -/*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果 - * - * 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。 - * 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。 - * @param req 具体请求内容,是自动释放的 - */ --(void) onReq:(BaseReq*)req; - - - -/*! @brief 发送一个sendReq后,收到微信的回应 - * - * 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。 - * 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。 - * @param resp具体的回应内容,是自动释放的 - */ --(void) onResp:(BaseResp*)resp; - -@end - -#pragma mark - WXApiLogDelegate - -@protocol WXApiLogDelegate - --(void) onLog:(NSString*)log logLevel:(WXLogLevel)level; - -@end - -#pragma mark - WXApi - -/*! @brief 微信Api接口函数类 - * - * 该类封装了微信终端SDK的所有接口 - */ -@interface WXApi : NSObject - -/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 - * - * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现,默认开启MTA数据上报。 - * iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。 - * @attention 请保证在主线程中调用此函数 - * @param appid 微信开发者ID - * @param typeFlag 应用支持打开的文件类型 - * @return 成功返回YES,失败返回NO。 - */ -+(BOOL) registerApp:(NSString *)appid; - -/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 - * - * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。 - * iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。 - * @attention 请保证在主线程中调用此函数 - * @param appid 微信开发者ID - * @param isEnableMTA 是否支持MTA数据上报 - * @return 成功返回YES,失败返回NO。 - */ -+(BOOL) registerApp:(NSString *)appid enableMTA:(BOOL)isEnableMTA; - - -/*! @brief WXApi的成员函数,向微信终端程序注册应用支持打开的文件类型。 - * - * 需要在每次启动第三方应用程序时调用。调用后并第一次成功分享数据到微信后,会在微信的可用应用列表中出现。 - * @see registerApp - * @param typeFlag 应用支持打开的数据类型, enAppSupportContentFlag枚举类型 “|” 操作后结果 - */ -+(void) registerAppSupportContentFlag:(UInt64)typeFlag; - - - -/*! @brief 处理微信通过URL启动App时传递的数据 - * - * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 - * @param url 微信启动第三方应用时传递过来的URL - * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 - * @return 成功返回YES,失败返回NO。 - */ -+(BOOL) handleOpenURL:(NSURL *) url delegate:(id) delegate; - - - -/*! @brief 检查微信是否已被用户安装 - * - * @return 微信已安装返回YES,未安装返回NO。 - */ -+(BOOL) isWXAppInstalled; - - - -/*! @brief 判断当前微信的版本是否支持OpenApi - * - * @return 支持返回YES,不支持返回NO。 - */ -+(BOOL) isWXAppSupportApi; - - - -/*! @brief 获取微信的itunes安装地址 - * - * @return 微信的安装地址字符串。 - */ -+(NSString *) getWXAppInstallUrl; - - - -/*! @brief 获取当前微信SDK的版本号 - * - * @return 返回当前微信SDK的版本号 - */ -+(NSString *) getApiVersion; - - - -/*! @brief 打开微信 - * - * @return 成功返回YES,失败返回NO。 - */ -+(BOOL) openWXApp; - - - -/*! @brief 发送请求到微信,等待微信返回onResp - * - * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型 - * SendAuthReq、SendMessageToWXReq、PayReq等。 - * @param req 具体的发送请求,在调用函数后,请自己释放。 - * @return 成功返回YES,失败返回NO。 - */ -+(BOOL) sendReq:(BaseReq*)req; - -/*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp - * - * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。 - * @param req 具体的发送请求,在调用函数后,请自己释放。 - * @param viewController 当前界面对象。 - * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 - * @return 成功返回YES,失败返回NO。 - */ -+(BOOL) sendAuthReq:(SendAuthReq*)req viewController:(UIViewController*)viewController delegate:(id)delegate; - - -/*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面 - * - * 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有 - * GetMessageFromWXResp、ShowMessageFromWXResp等。 - * @param resp 具体的应答内容,调用函数后,请自己释放 - * @return 成功返回YES,失败返回NO。 - */ -+(BOOL) sendResp:(BaseResp*)resp; - - -/*! @brief WXApi的成员函数,接受微信的log信息。byBlock - 注意1:SDK会强引用这个block,注意不要导致内存泄漏,注意不要导致内存泄漏 - 注意2:调用过一次startLog by block之后,如果再调用一次任意方式的startLoad,会释放上一次logBlock,不再回调上一个logBlock - * - * @param level 打印log的级别 - * @param logBlock 打印log的回调block - */ -+(void) startLogByLevel:(WXLogLevel)level logBlock:(WXLogBolock)logBlock; - -/*! @brief WXApi的成员函数,接受微信的log信息。byDelegate - 注意1:sdk会弱引用这个delegate,这里可加任意对象为代理,不需要与WXApiDelegate同一个对象 - 注意2:调用过一次startLog by delegate之后,再调用一次任意方式的startLoad,不会再回调上一个logDelegate对象 - * @param level 打印log的级别 - * @param logDelegate 打印log的回调代理, - */ -+ (void)startLogByLevel:(WXLogLevel)level logDelegate:(id)logDelegate; - -/*! @brief 停止打印log,会清理block或者delegate为空,释放block - * @param - */ -+ (void)stopLog; -@end diff --git a/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/WXApiObject.h b/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/WXApiObject.h deleted file mode 100644 index 66c8b536..00000000 --- a/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/WXApiObject.h +++ /dev/null @@ -1,916 +0,0 @@ -// -// MMApiObject.h -// Api对象,包含所有接口和对象数据定义 -// -// Created by Wechat on 12-2-28. -// Copyright (c) 2012年 Tencent. All rights reserved. -// - -#import -#import -/*! @brief 错误码 - * - */ -enum WXErrCode { - WXSuccess = 0, /**< 成功 */ - WXErrCodeCommon = -1, /**< 普通错误类型 */ - WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */ - WXErrCodeSentFail = -3, /**< 发送失败 */ - WXErrCodeAuthDeny = -4, /**< 授权失败 */ - WXErrCodeUnsupport = -5, /**< 微信不支持 */ -}; - - - -/*! @brief 请求发送场景 - * - */ -enum WXScene { - WXSceneSession = 0, /**< 聊天界面 */ - WXSceneTimeline = 1, /**< 朋友圈 */ - WXSceneFavorite = 2, /**< 收藏 */ -}; - - - -enum WXAPISupport { - WXAPISupportSession = 0, -}; - - - -/*! @brief 跳转profile类型 - * - */ -enum WXBizProfileType{ - WXBizProfileType_Normal = 0, //**< 普通公众号 */ - WXBizProfileType_Device = 1, //**< 硬件公众号 */ -}; - -/*! @brief 分享小程序类型 - * - */ -typedef NS_ENUM(NSUInteger, WXMiniProgramType){ - WXMiniProgramTypeRelease = 0, //**< 正式版 */ - WXMiniProgramTypeTest = 1, //**< 开发版 */ - WXMiniProgramTypePreview = 2, //**< 体验版 */ -}; - -/*! @brief 跳转mp网页类型 - * - */ -enum WXMPWebviewType { - WXMPWebviewType_Ad = 0, /**< 广告网页 **/ -}; - - - -/*! @brief 应用支持接收微信的文件类型 - * - */ -typedef NS_ENUM(UInt64, enAppSupportContentFlag) -{ - MMAPP_SUPPORT_NOCONTENT = 0x0, - MMAPP_SUPPORT_TEXT = 0x1, - MMAPP_SUPPORT_PICTURE = 0x2, - MMAPP_SUPPORT_LOCATION = 0x4, - MMAPP_SUPPORT_VIDEO = 0x8, - MMAPP_SUPPORT_AUDIO = 0x10, - MMAPP_SUPPORT_WEBPAGE = 0x20, - - // Suport File Type - MMAPP_SUPPORT_DOC = 0x40, // doc - MMAPP_SUPPORT_DOCX = 0x80, // docx - MMAPP_SUPPORT_PPT = 0x100, // ppt - MMAPP_SUPPORT_PPTX = 0x200, // pptx - MMAPP_SUPPORT_XLS = 0x400, // xls - MMAPP_SUPPORT_XLSX = 0x800, // xlsx - MMAPP_SUPPORT_PDF = 0x1000, // pdf -}; - -/*! @brief log的级别 - * - */ -typedef NS_ENUM(NSInteger,WXLogLevel){ - WXLogLevelNormal = 0, // 打印日常的日志 - WXLogLevelDetail = 1, // 打印详细的日志 -}; - - -/*! @brief 打印回调的block - * - */ -typedef void(^WXLogBolock)(NSString * log); - -#pragma mark - BaseReq -/*! @brief 该类为微信终端SDK所有请求类的基类 - * - */ -@interface BaseReq : NSObject - -/** 请求类型 */ -@property (nonatomic, assign) int type; -/** 由用户微信号和AppID组成的唯一标识,发送请求时第三方程序必须填写,用于校验微信用户是否换号登录*/ -@property (nonatomic, retain) NSString* openID; - -@end - - - -#pragma mark - BaseResp -/*! @brief 该类为微信终端SDK所有响应类的基类 - * - */ -@interface BaseResp : NSObject -/** 错误码 */ -@property (nonatomic, assign) int errCode; -/** 错误提示字符串 */ -@property (nonatomic, retain) NSString *errStr; -/** 响应类型 */ -@property (nonatomic, assign) int type; - -@end - - - -#pragma mark - WXMediaMessage -@class WXMediaMessage; - -#ifndef BUILD_WITHOUT_PAY - -/*! @brief 第三方向微信终端发起支付的消息结构体 - * - * 第三方向微信终端发起支付的消息结构体,微信终端处理后会向第三方返回处理结果 - * @see PayResp - */ -@interface PayReq : BaseReq - -/** 商家向财付通申请的商家id */ -@property (nonatomic, retain) NSString *partnerId; -/** 预支付订单 */ -@property (nonatomic, retain) NSString *prepayId; -/** 随机串,防重发 */ -@property (nonatomic, retain) NSString *nonceStr; -/** 时间戳,防重发 */ -@property (nonatomic, assign) UInt32 timeStamp; -/** 商家根据财付通文档填写的数据和签名 */ -@property (nonatomic, retain) NSString *package; -/** 商家根据微信开放平台文档对数据做的签名 */ -@property (nonatomic, retain) NSString *sign; - -@end - -#endif - - -#ifndef BUILD_WITHOUT_PAY - -#pragma mark - PayResp -/*! @brief 微信终端返回给第三方的关于支付结果的结构体 - * - * 微信终端返回给第三方的关于支付结果的结构体 - */ -@interface PayResp : BaseResp - -/** 财付通返回给商家的信息 */ -@property (nonatomic, retain) NSString *returnKey; - -@end - -#endif - - - -#pragma mark - SendAuthReq -/*! @brief 第三方程序向微信终端请求认证的消息结构 - * - * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数, - * 向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。 - * @see SendAuthResp - */ -@interface SendAuthReq : BaseReq -/** 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。 - * @see SendAuthResp - * @note scope字符串长度不能超过1K - */ -@property (nonatomic, retain) NSString* scope; -/** 第三方程序本身用来标识其请求的唯一性,最后跳转回第三方程序时,由微信终端回传。 - * @note state字符串长度不能超过1K - */ -@property (nonatomic, retain) NSString* state; -@end - - - -#pragma mark - SendAuthResp -/*! @brief 微信处理完第三方程序的认证和权限申请后向第三方程序回送的处理结果。 - * - * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。 - * 微信终端处理完后会向第三方程序发送一个SendAuthResp。 - * @see onResp - */ -@interface SendAuthResp : BaseResp -@property (nonatomic, retain) NSString* code; -/** 第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传 - * @note state字符串长度不能超过1K - */ -@property (nonatomic, retain) NSString* state; -@property (nonatomic, retain) NSString* lang; -@property (nonatomic, retain) NSString* country; -@end - - - -#pragma mark - SendMessageToWXReq -/*! @brief 第三方程序发送消息至微信终端程序的消息结构体 - * - * 第三方程序向微信发送信息需要传入SendMessageToWXReq结构体,信息类型包括文本消息和多媒体消息, - * 分别对应于text和message成员。调用该方法后,微信处理完信息会向第三方程序发送一个处理结果。 - * @see SendMessageToWXResp - */ -@interface SendMessageToWXReq : BaseReq -/** 发送消息的文本内容 - * @note 文本长度必须大于0且小于10K - */ -@property (nonatomic, retain) NSString* text; -/** 发送消息的多媒体内容 - * @see WXMediaMessage - */ -@property (nonatomic, retain) WXMediaMessage* message; -/** 发送消息的类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */ -@property (nonatomic, assign) BOOL bText; -/** 发送的目标场景,可以选择发送到会话(WXSceneSession)或者朋友圈(WXSceneTimeline)。 默认发送到会话。 - * @see WXScene - */ -@property (nonatomic, assign) int scene; - -@end - - - -#pragma mark - SendMessageToWXResp -/*! @brief 微信终端向第三方程序返回的SendMessageToWXReq处理结果。 - * - * 第三方程序向微信终端发送SendMessageToWXReq后,微信发送回来的处理结果,该结果用SendMessageToWXResp表示。 - */ -@interface SendMessageToWXResp : BaseResp -@property(nonatomic, retain) NSString* lang; -@property(nonatomic, retain) NSString* country; -@end - - - -#pragma mark - GetMessageFromWXReq -/*! @brief 微信终端向第三方程序请求提供内容的消息结构体。 - * - * 微信终端向第三方程序请求提供内容,微信终端会向第三方程序发送GetMessageFromWXReq消息结构体, - * 需要第三方程序调用sendResp返回一个GetMessageFromWXResp消息结构体。 - */ -@interface GetMessageFromWXReq : BaseReq -@property (nonatomic, retain) NSString* lang; -@property (nonatomic, retain) NSString* country; -@end - - - -#pragma mark - GetMessageFromWXResp -/*! @brief 微信终端向第三方程序请求提供内容,第三方程序向微信终端返回的消息结构体。 - * - * 微信终端向第三方程序请求提供内容,第三方程序调用sendResp向微信终端返回一个GetMessageFromWXResp消息结构体。 - */ -@interface GetMessageFromWXResp : BaseResp -/** 向微信终端提供的文本内容 - @note 文本长度必须大于0且小于10K - */ -@property (nonatomic, retain) NSString* text; -/** 向微信终端提供的多媒体内容。 - * @see WXMediaMessage - */ -@property (nonatomic, retain) WXMediaMessage* message; -/** 向微信终端提供内容的消息类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */ -@property (nonatomic, assign) BOOL bText; -@end - - - -#pragma mark - ShowMessageFromWXReq -/*! @brief 微信通知第三方程序,要求第三方程序显示的消息结构体。 - * - * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。 - * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。 - */ -@interface ShowMessageFromWXReq : BaseReq -/** 微信终端向第三方程序发送的要求第三方程序处理的多媒体内容 - * @see WXMediaMessage - */ -@property (nonatomic, retain) WXMediaMessage* message; -@property (nonatomic, retain) NSString* lang; -@property (nonatomic, retain) NSString* country; -@end - - - -#pragma mark - ShowMessageFromWXResp -/*! @brief 微信通知第三方程序,要求第三方程序显示或处理某些消息,第三方程序处理完后向微信终端发送的处理结果。 - * - * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。 - * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。 - */ -@interface ShowMessageFromWXResp : BaseResp -@end - - - -#pragma mark - LaunchFromWXReq -/*! @brief 微信终端打开第三方程序携带的消息结构体 - * - * 微信向第三方发送的结构体,第三方不需要返回 - */ -@interface LaunchFromWXReq : BaseReq -@property (nonatomic, retain) WXMediaMessage* message; -@property (nonatomic, retain) NSString* lang; -@property (nonatomic, retain) NSString* country; -@end - -#pragma mark - OpenTempSessionReq -/* ! @brief 第三方通知微信,打开临时会话 - * - * 第三方通知微信,打开临时会话 - */ -@interface OpenTempSessionReq : BaseReq -/** 需要打开的用户名 - * @attention 长度不能超过512字节 - */ -@property (nonatomic, retain) NSString* username; -/** 开发者自定义参数,拉起临时会话后会发给开发者后台,可以用于识别场景 - * @attention 长度不能超过32位 - */ -@property (nonatomic, retain) NSString* sessionFrom; -@end - -#pragma mark - OpenTempSessionResp -/*! @brief 微信终端向第三方程序返回的OpenTempSessionReq处理结果。 - * - * 第三方程序向微信终端发送OpenTempSessionReq后,微信发送回来的处理结果,该结果用OpenTempSessionResp表示。 - */ -@interface OpenTempSessionResp : BaseResp - -@end - -#pragma mark - OpenWebviewReq -/* ! @brief 第三方通知微信启动内部浏览器,打开指定网页 - * - * 第三方通知微信启动内部浏览器,打开指定Url对应的网页 - */ -@interface OpenWebviewReq : BaseReq -/** 需要打开的网页对应的Url - * @attention 长度不能超过1024 - */ -@property(nonatomic,retain)NSString* url; - -@end - -#pragma mark - OpenWebviewResp -/*! @brief 微信终端向第三方程序返回的OpenWebviewReq处理结果 - * - * 第三方程序向微信终端发送OpenWebviewReq后,微信发送回来的处理结果,该结果用OpenWebviewResp表示 - */ -@interface OpenWebviewResp : BaseResp - -@end - -#pragma mark - OpenRankListReq -/* ! @brief 第三方通知微信,打开硬件排行榜 - * - * 第三方通知微信,打开硬件排行榜 - */ -@interface OpenRankListReq : BaseReq - -@end - -#pragma mark - OpenRanklistResp -/*! @brief 微信终端向第三方程序返回的OpenRankListReq处理结果。 - * - * 第三方程序向微信终端发送OpenRankListReq后,微信发送回来的处理结果,该结果用OpenRankListResp表示。 - */ -@interface OpenRankListResp : BaseResp - -@end - -#pragma mark - JumpToBizProfileReq -/* ! @brief 第三方通知微信,打开指定微信号profile页面 - * - * 第三方通知微信,打开指定微信号profile页面 - */ -@interface JumpToBizProfileReq : BaseReq -/** 跳转到该公众号的profile - * @attention 长度不能超过512字节 - */ -@property (nonatomic, retain) NSString* username; -/** 如果用户加了该公众号为好友,extMsg会上传到服务器 - * @attention 长度不能超过1024字节 - */ -@property (nonatomic, retain) NSString* extMsg; -/** - * 跳转的公众号类型 - * @see WXBizProfileType - */ -@property (nonatomic, assign) int profileType; -@end - - - -#pragma mark - JumpToBizWebviewReq -/* ! @brief 第三方通知微信,打开指定usrname的profile网页版 - * - */ -@interface JumpToBizWebviewReq : BaseReq -/** 跳转的网页类型,目前只支持广告页 - * @see WXMPWebviewType - */ -@property(nonatomic, assign) int webType; -/** 跳转到该公众号的profile网页版 - * @attention 长度不能超过512字节 - */ -@property(nonatomic, retain) NSString* tousrname; -/** 如果用户加了该公众号为好友,extMsg会上传到服务器 - * @attention 长度不能超过1024字节 - */ -@property(nonatomic, retain) NSString* extMsg; - -@end - -#pragma mark - WXCardItem - -@interface WXCardItem : NSObject -/** 卡id - * @attention 长度不能超过1024字节 - */ -@property (nonatomic,retain) NSString* cardId; -/** ext信息 - * @attention 长度不能超过2024字节 - */ -@property (nonatomic,retain) NSString* extMsg; -/** - * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。 - */ -@property (nonatomic,assign) UInt32 cardState; -/** - * @attention req不需要填,chooseCard返回的。 - */ -@property (nonatomic,retain) NSString* encryptCode; -/** - * @attention req不需要填,chooseCard返回的。 - */ -@property (nonatomic,retain) NSString* appID; -@end; - -#pragma mark - WXInvoiceItem - -@interface WXInvoiceItem : NSObject -/** 卡id - * @attention 长度不能超过1024字节 - */ -@property (nonatomic,retain) NSString* cardId; -/** ext信息 - * @attention 长度不能超过2024字节 - */ -@property (nonatomic,retain) NSString* extMsg; -/** - * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。 - */ -@property (nonatomic,assign) UInt32 cardState; -/** - * @attention req不需要填,chooseCard返回的。 - */ -@property (nonatomic,retain) NSString* encryptCode; -/** - * @attention req不需要填,chooseCard返回的。 - */ -@property (nonatomic,retain) NSString* appID; - -@end - -#pragma mark - AddCardToWXCardPackageReq -/* ! @brief 请求添加卡券至微信卡包 - * - */ - -@interface AddCardToWXCardPackageReq : BaseReq -/** 卡列表 - * @attention 个数不能超过40个 类型WXCardItem - */ -@property (nonatomic,retain) NSArray* cardAry; - -@end - - -#pragma mark - AddCardToWXCardPackageResp -/** ! @brief 微信返回第三方添加卡券结果 - * - */ - -@interface AddCardToWXCardPackageResp : BaseResp -/** 卡列表 - * @attention 个数不能超过40个 类型WXCardItem - */ -@property (nonatomic,retain) NSArray* cardAry; -@end - -#pragma mark - WXChooseCardReq -/* ! @brief 请求从微信选取卡券 - * - */ - -@interface WXChooseCardReq : BaseReq -@property(nonatomic, strong) NSString *appID; -@property(nonatomic, assign) UInt32 shopID; -@property(nonatomic, assign) UInt32 canMultiSelect; -@property(nonatomic, strong) NSString *cardType; -@property(nonatomic, strong) NSString *cardTpID; -@property(nonatomic, strong) NSString *signType; -@property(nonatomic, strong) NSString *cardSign; -@property(nonatomic, assign) UInt32 timeStamp; -@property(nonatomic, strong) NSString *nonceStr; -@end - - -#pragma mark - WXChooseCardResp -/** ! @brief 微信返回第三方请求选择卡券结果 - * - */ - -@interface WXChooseCardResp : BaseResp -@property (nonatomic,retain) NSArray* cardAry; -@end - - -#pragma mark - WXChooseInvoiceReq -/* ! @brief 请求从微信选取发票 - * - */ -@interface WXChooseInvoiceReq : BaseReq -@property (nonatomic, strong) NSString *appID; -@property (nonatomic, assign) UInt32 shopID; -@property (nonatomic, strong) NSString *signType; -@property (nonatomic, strong) NSString *cardSign; -@property (nonatomic, assign) UInt32 timeStamp; -@property (nonatomic, strong) NSString *nonceStr; -@end - -#pragma mark - WXChooseInvoiceResp -/** ! @brief 微信返回第三方请求选择发票结果 - * - */ -@interface WXChooseInvoiceResp : BaseResp -@property (nonatomic, strong) NSArray* cardAry; -@end - -#pragma mark - WXSubscriptionReq -@interface WXSubscribeMsgReq : BaseReq -@property (nonatomic, assign) UInt32 scene; -@property (nonatomic, strong) NSString * templateId; -@property (nonatomic, strong) NSString * reserved; -@end - -#pragma mark - WXSubscriptionReq -@interface WXSubscribeMsgResp : BaseResp - -@property (nonatomic, strong) NSString *templateId; -@property (nonatomic, assign) UInt32 scene; -@property (nonatomic, strong) NSString *action; -@property (nonatomic, strong) NSString * reserved; -@property (nonatomic, strong) NSString * openId; - -@end - -#pragma mark - WXMediaMessage - - -#pragma mark - WXMediaMessage - -/*! @brief 多媒体消息结构体 - * - * 用于微信终端和第三方程序之间传递消息的多媒体消息内容 - */ -@interface WXMediaMessage : NSObject - -+(WXMediaMessage *) message; - -/** 标题 - * @note 长度不能超过512字节 - */ -@property (nonatomic, retain) NSString *title; -/** 描述内容 - * @note 长度不能超过1K - */ -@property (nonatomic, retain) NSString *description; -/** 缩略图数据 - * @note 大小不能超过32K - */ -@property (nonatomic, retain) NSData *thumbData; -/** - * @note 长度不能超过64字节 - */ -@property (nonatomic, retain) NSString *mediaTagName; -/** - * - */ -@property (nonatomic, retain) NSString *messageExt; -@property (nonatomic, retain) NSString *messageAction; -/** - * 多媒体数据对象,可以为WXImageObject,WXMusicObject,WXVideoObject,WXWebpageObject等。 - */ -@property (nonatomic, retain) id mediaObject; - -/*! @brief 设置消息缩略图的方法 - * - * @param image 缩略图 - * @note 大小不能超过32K - */ -- (void) setThumbImage:(UIImage *)image; - -@end - - - -#pragma mark - WXImageObject -/*! @brief 多媒体消息中包含的图片数据对象 - * - * 微信终端和第三方程序之间传递消息中包含的图片数据对象。 - * @note imageData成员不能为空 - * @see WXMediaMessage - */ -@interface WXImageObject : NSObject -/*! @brief 返回一个WXImageObject对象 - * - * @note 返回的WXImageObject对象是自动释放的 - */ -+(WXImageObject *) object; - -/** 图片真实数据内容 - * @note 大小不能超过10M - */ -@property (nonatomic, retain) NSData *imageData; - -@end - - -#pragma mark - WXMusicObject -/*! @brief 多媒体消息中包含的音乐数据对象 - * - * 微信终端和第三方程序之间传递消息中包含的音乐数据对象。 - * @note musicUrl和musicLowBandUrl成员不能同时为空。 - * @see WXMediaMessage - */ -@interface WXMusicObject : NSObject -/*! @brief 返回一个WXMusicObject对象 - * - * @note 返回的WXMusicObject对象是自动释放的 - */ -+(WXMusicObject *) object; - -/** 音乐网页的url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *musicUrl; -/** 音乐lowband网页的url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *musicLowBandUrl; -/** 音乐数据url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *musicDataUrl; - -/**音乐lowband数据url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *musicLowBandDataUrl; - -@end - - - -#pragma mark - WXVideoObject -/*! @brief 多媒体消息中包含的视频数据对象 - * - * 微信终端和第三方程序之间传递消息中包含的视频数据对象。 - * @note videoUrl和videoLowBandUrl不能同时为空。 - * @see WXMediaMessage - */ -@interface WXVideoObject : NSObject -/*! @brief 返回一个WXVideoObject对象 - * - * @note 返回的WXVideoObject对象是自动释放的 - */ -+(WXVideoObject *) object; - -/** 视频网页的url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *videoUrl; -/** 视频lowband网页的url地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *videoLowBandUrl; - -@end - - - -#pragma mark - WXWebpageObject -/*! @brief 多媒体消息中包含的网页数据对象 - * - * 微信终端和第三方程序之间传递消息中包含的网页数据对象。 - * @see WXMediaMessage - */ -@interface WXWebpageObject : NSObject -/*! @brief 返回一个WXWebpageObject对象 - * - * @note 返回的WXWebpageObject对象是自动释放的 - */ -+(WXWebpageObject *) object; - -/** 网页的url地址 - * @note 不能为空且长度不能超过10K - */ -@property (nonatomic, retain) NSString *webpageUrl; - -@end - - - -#pragma mark - WXAppExtendObject -/*! @brief 多媒体消息中包含的App扩展数据对象 - * - * 第三方程序向微信终端发送包含WXAppExtendObject的多媒体消息, - * 微信需要处理该消息时,会调用该第三方程序来处理多媒体消息内容。 - * @note url,extInfo和fileData不能同时为空 - * @see WXMediaMessage - */ -@interface WXAppExtendObject : NSObject -/*! @brief 返回一个WXAppExtendObject对象 - * - * @note 返回的WXAppExtendObject对象是自动释放的 - */ -+(WXAppExtendObject *) object; - -/** 若第三方程序不存在,微信终端会打开该url所指的App下载地址 - * @note 长度不能超过10K - */ -@property (nonatomic, retain) NSString *url; -/** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理 - * @note 长度不能超过2K - */ -@property (nonatomic, retain) NSString *extInfo; -/** App文件数据,该数据发送给微信好友,微信好友需要点击后下载数据,微信终端会回传给第三方程序处理 - * @note 大小不能超过10M - */ -@property (nonatomic, retain) NSData *fileData; - -@end - - - -#pragma mark - WXEmoticonObject -/*! @brief 多媒体消息中包含的表情数据对象 - * - * 微信终端和第三方程序之间传递消息中包含的表情数据对象。 - * @see WXMediaMessage - */ -@interface WXEmoticonObject : NSObject - -/*! @brief 返回一个WXEmoticonObject对象 - * - * @note 返回的WXEmoticonObject对象是自动释放的 - */ -+(WXEmoticonObject *) object; - -/** 表情真实数据内容 - * @note 大小不能超过10M - */ -@property (nonatomic, retain) NSData *emoticonData; - -@end - - - -#pragma mark - WXFileObject -/*! @brief 多媒体消息中包含的文件数据对象 - * - * @see WXMediaMessage - */ -@interface WXFileObject : NSObject - -/*! @brief 返回一个WXFileObject对象 - * - * @note 返回的WXFileObject对象是自动释放的 - */ -+(WXFileObject *) object; - -/** 文件后缀名 - * @note 长度不超过64字节 - */ -@property (nonatomic, retain) NSString *fileExtension; - -/** 文件真实数据内容 - * @note 大小不能超过10M - */ -@property (nonatomic, retain) NSData *fileData; - -@end - - -#pragma mark - WXLocationObject -/*! @brief 多媒体消息中包含的地理位置数据对象 - * - * 微信终端和第三方程序之间传递消息中包含的地理位置数据对象。 - * @see WXMediaMessage - */ -@interface WXLocationObject : NSObject - -/*! @brief 返回一个WXLocationObject对象 - * - * @note 返回的WXLocationObject对象是自动释放的 - */ -+(WXLocationObject *) object; - -/** 地理位置信息 - * @note 经纬度 - */ -@property (nonatomic, assign) double lng; //经度 -@property (nonatomic, assign) double lat; //纬度 - -@end - -@interface WXMiniProgramObject : NSObject - -/*! @brief WXMiniProgramObject对象 - * - * @note 返回的WXMiniProgramObject对象是自动释放的 - */ -+(WXMiniProgramObject *) object; - -@property (nonatomic, strong) NSString *webpageUrl; //低版本网页链接 - -@property (nonatomic, strong) NSString *userName; //小程序username - -@property (nonatomic, strong) NSString *path; //小程序页面的路径 - -@property (nonatomic, strong) NSData *hdImageData; // 小程序新版本的预览图 128k - -@property (nonatomic, assign) BOOL withShareTicket; //是否使用带 shareTicket 的转发 - -@property (nonatomic, assign) WXMiniProgramType miniProgramType; // 分享小程序的版本(正式,开发,体验) - -@end - -#pragma mark - WXLaunchMiniProgramReq - -/*! @brief WXLaunchMiniProgramReq对象, 可实现通过sdk拉起微信小程序 - * - * @note 返回的WXLaunchMiniProgramReq对象是自动释放的 - */ -@interface WXLaunchMiniProgramReq : BaseReq - -+(WXLaunchMiniProgramReq *) object; - -@property (nonatomic, strong) NSString *userName; //拉起的小程序的username -@property (nonatomic, strong) NSString *path; //拉起小程序页面的路径,不填默认拉起小程序首页 -@property (nonatomic, assign) WXMiniProgramType miniProgramType; //拉起小程序的类型 - -@end - -#pragma mark - WXLaunchMiniProgramResp -/*! @brief 微信终端向第三方程序返回的WXLaunchMiniProgramReq处理结果。 - * - * 第三方程序向微信终端发送WXLaunchMiniProgramReq后,微信发送回来的处理结果,该结果用WXLaunchMiniProgramResp表示。 - */ -@interface WXLaunchMiniProgramResp : BaseResp - -@property (nonatomic, retain) NSString *extMsg; - -@end - - -#pragma mark - WXTextObject -/*! @brief 多媒体消息中包含的文本数据对象 - * - * 微信终端和第三方程序之间传递消息中包含的文本数据对象。 - * @see WXMediaMessage - */ -@interface WXTextObject : NSObject - -/*! @brief 返回一个WXTextObject对象 - * - * @note 返回的WXTextObject对象是自动释放的 - */ -+(WXTextObject *) object; - -/** 地理位置信息 - * @note 文本内容 - */ -@property (nonatomic, retain) NSString *contentText; - -@end diff --git a/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/WechatAuthSDK.h b/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/WechatAuthSDK.h deleted file mode 100644 index 076b1d7f..00000000 --- a/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/WechatAuthSDK.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// WechatAuthSDK.h -// WechatAuthSDK -// -// Created by 李凯 on 13-11-29. -// Copyright (c) 2013年 Tencent. All rights reserved. -// - -#import -#import - -enum AuthErrCode { - WechatAuth_Err_Ok = 0, //Auth成功 - WechatAuth_Err_NormalErr = -1, //普通错误 - WechatAuth_Err_NetworkErr = -2, //网络错误 - WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败 - WechatAuth_Err_Cancel = -4, //用户取消授权 - WechatAuth_Err_Timeout = -5, //超时 -}; - -@protocol WechatAuthAPIDelegate -@optional - -- (void)onAuthGotQrcode:(UIImage *)image; //得到二维码 -- (void)onQrcodeScanned; //二维码被扫描 -- (void)onAuthFinish:(int)errCode AuthCode:(NSString *)authCode; //成功登录 - -@end - -@interface WechatAuthSDK : NSObject{ - NSString *_sdkVersion; - __weak id _delegate; -} - -@property(nonatomic, weak) id delegate; -@property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号 - -/*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调 - * - * @param appId 微信开发者ID - * @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同 - * @param timeStamp 时间戳 - * @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔 - * @param signature 签名 - * @param schemeData 会在扫码后拼在scheme后 - * @return 成功返回YES,失败返回NO - 注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。 - */ - -- (BOOL)Auth:(NSString *)appId - nonceStr:(NSString *)nonceStr - timeStamp:(NSString*)timeStamp - scope:(NSString *)scope - signature:(NSString *)signature - schemeData:(NSString *)schemeData; - - -/*! @brief 暂停登录请求 - * - * @return 成功返回YES,失败返回NO。 - */ -- (BOOL)StopAuth; - -@end diff --git a/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/libWeChatSDK.a b/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/libWeChatSDK.a deleted file mode 100644 index 4cd82da8..00000000 Binary files a/iOSProject/Pods/WechatOpenSDK/OpenSDK1.8.1/libWeChatSDK.a and /dev/null differ diff --git a/iOSProject/Pods/YYAsyncLayer/LICENSE b/iOSProject/Pods/YYAsyncLayer/LICENSE deleted file mode 100644 index 46be20bd..00000000 --- a/iOSProject/Pods/YYAsyncLayer/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 ibireme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/iOSProject/Pods/YYAsyncLayer/README.md b/iOSProject/Pods/YYAsyncLayer/README.md deleted file mode 100755 index d8bbfba1..00000000 --- a/iOSProject/Pods/YYAsyncLayer/README.md +++ /dev/null @@ -1,253 +0,0 @@ -YYAsyncLayer -============== - -[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/ibireme/YYAsyncLayer/master/LICENSE)  -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)  -[![CocoaPods](http://img.shields.io/cocoapods/v/YYAsyncLayer.svg?style=flat)](http://cocoapods.org/?q=YYAsyncLayer)  -[![CocoaPods](http://img.shields.io/cocoapods/p/YYAsyncLayer.svg?style=flat)](http://cocoapods.org/?q=YYAsyncLayer)  -[![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  -[![Build Status](https://travis-ci.org/ibireme/YYAsyncLayer.svg?branch=master)](https://travis-ci.org/ibireme/YYAsyncLayer) - -iOS utility classes for asynchronous rendering and display.
    -(It was used by [YYText](https://github.com/ibireme/YYText)) - - -Simple Usage -============== - - @interface YYLabel : UIView - @property NSString *text; - @property UIFont *font; - @end - - @implementation YYLabel - - - (void)setText:(NSString *)text { - _text = text.copy; - [[YYTransaction transactionWithTarget:self selector:@selector(contentsNeedUpdated)] commit]; - } - - - (void)setFont:(UIFont *)font { - _font = font; - [[YYTransaction transactionWithTarget:self selector:@selector(contentsNeedUpdated)] commit]; - } - - - (void)layoutSubviews { - [super layoutSubviews]; - [[YYTransaction transactionWithTarget:self selector:@selector(contentsNeedUpdated)] commit]; - } - - - (void)contentsNeedUpdated { - // do update - [self.layer setNeedsDisplay]; - } - - #pragma mark - YYAsyncLayer - - + (Class)layerClass { - return YYAsyncLayer.class; - } - - - (YYAsyncLayerDisplayTask *)newAsyncDisplayTask { - - // capture current state to display task - NSString *text = _text; - UIFont *font = _font; - - YYAsyncLayerDisplayTask *task = [YYAsyncLayerDisplayTask new]; - task.willDisplay = ^(CALayer *layer) { - //... - }; - - task.display = ^(CGContextRef context, CGSize size, BOOL(^isCancelled)(void)) { - if (isCancelled()) return; - NSArray *lines = CreateCTLines(text, font, size.width); - if (isCancelled()) return; - - for (int i = 0; i < lines.count; i++) { - CTLineRef line = line[i]; - CGContextSetTextPosition(context, 0, i * font.pointSize * 1.5); - CTLineDraw(line, context); - if (isCancelled()) return; - } - }; - - task.didDisplay = ^(CALayer *layer, BOOL finished) { - if (finished) { - // finished - } else { - // cancelled - } - }; - - return task; - } - @end - - -Installation -============== - -### CocoaPods - -1. Add `pod 'YYAsyncLayer'` to your Podfile. -2. Run `pod install` or `pod update`. -3. Import \. - - -### Carthage - -1. Add `github "ibireme/YYAsyncLayer"` to your Cartfile. -2. Run `carthage update --platform ios` and add the framework to your project. -3. Import \. - - -### Manually - -1. Download all the files in the YYAsyncLayer subdirectory. -2. Add the source files to your Xcode project. -3. Import `YYAsyncLayer.h`. - - -Documentation -============== -Full API documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/YYAsyncLayer/).
    -You can also install documentation locally using [appledoc](https://github.com/tomaz/appledoc). - - -Requirements -============== -This library requires `iOS 6.0+` and `Xcode 7.0+`. - - -License -============== -YYAsyncLayer is provided under the MIT license. See LICENSE file for details. - - - - -

    ---- -中文介绍 -============== -iOS 异步绘制与显示的工具类。
    -(该工具是从 [YYText](https://github.com/ibireme/YYText) 提取出来的独立组件) - - -简单用法 -============== - - @interface YYLabel : UIView - @property NSString *text; - @property UIFont *font; - @end - - @implementation YYLabel - - - (void)setText:(NSString *)text { - _text = text.copy; - [[YYTransaction transactionWithTarget:self selector:@selector(contentsNeedUpdated)] commit]; - } - - - (void)setFont:(UIFont *)font { - _font = font; - [[YYTransaction transactionWithTarget:self selector:@selector(contentsNeedUpdated)] commit]; - } - - - (void)layoutSubviews { - [super layoutSubviews]; - [[YYTransaction transactionWithTarget:self selector:@selector(contentsNeedUpdated)] commit]; - } - - - (void)contentsNeedUpdated { - // do update - [self.layer setNeedsDisplay]; - } - - #pragma mark - YYAsyncLayer - - + (Class)layerClass { - return YYAsyncLayer.class; - } - - - (YYAsyncLayerDisplayTask *)newAsyncDisplayTask { - - // capture current state to display task - NSString *text = _text; - UIFont *font = _font; - - YYAsyncLayerDisplayTask *task = [YYAsyncLayerDisplayTask new]; - task.willDisplay = ^(CALayer *layer) { - //... - }; - - task.display = ^(CGContextRef context, CGSize size, BOOL(^isCancelled)(void)) { - if (isCancelled()) return; - NSArray *lines = CreateCTLines(text, font, size.width); - if (isCancelled()) return; - - for (int i = 0; i < lines.count; i++) { - CTLineRef line = line[i]; - CGContextSetTextPosition(context, 0, i * font.pointSize * 1.5); - CTLineDraw(line, context); - if (isCancelled()) return; - } - }; - - task.didDisplay = ^(CALayer *layer, BOOL finished) { - if (finished) { - // finished - } else { - // cancelled - } - }; - - return task; - } - @end - - -安装 -============== - -### CocoaPods - -1. 在 Podfile 中添加 `pod 'YYAsyncLayer'`。 -2. 执行 `pod install` 或 `pod update`。 -3. 导入 \。 - - -### Carthage - -1. 在 Cartfile 中添加 `github "ibireme/YYAsyncLayer"`。 -2. 执行 `carthage update --platform ios` 并将生成的 framework 添加到你的工程。 -3. 导入 \。 - - -### 手动安装 - -1. 下载 YYAsyncLayer 文件夹内的所有内容。 -2. 将 YYAsyncLayer 内的源文件添加(拖放)到你的工程。 -3. 导入 `YYAsyncLayer.h`。 - - -文档 -============== -你可以在 [CocoaDocs](http://cocoadocs.org/docsets/YYAsyncLayer/) 查看在线 API 文档,也可以用 [appledoc](https://github.com/tomaz/appledoc) 本地生成文档。 - - -系统要求 -============== -该项目最低支持 `iOS 6.0` 和 `Xcode 7.0`。 - - -许可证 -============== -YYAsyncLayer 使用 MIT 许可证,详情见 LICENSE 文件。 - -相关文章 -============== -[iOS 保持界面流畅的技巧 -](http://blog.ibireme.com/2015/11/12/smooth_user_interfaces_for_ios/) - diff --git a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYAsyncLayer.h b/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYAsyncLayer.h deleted file mode 100644 index c8c311ff..00000000 --- a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYAsyncLayer.h +++ /dev/null @@ -1,89 +0,0 @@ -// -// YYAsyncLayer.h -// YYKit -// -// Created by ibireme on 15/4/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -#if __has_include() -FOUNDATION_EXPORT double YYAsyncLayerVersionNumber; -FOUNDATION_EXPORT const unsigned char YYAsyncLayerVersionString[]; -#import -#import -#else -#import "YYSentinel.h" -#import "YYTransaction.h" -#endif - -@class YYAsyncLayerDisplayTask; - -NS_ASSUME_NONNULL_BEGIN - -/** - The YYAsyncLayer class is a subclass of CALayer used for render contents asynchronously. - - @discussion When the layer need update it's contents, it will ask the delegate - for a async display task to render the contents in a background queue. - */ -@interface YYAsyncLayer : CALayer -/// Whether the render code is executed in background. Default is YES. -@property BOOL displaysAsynchronously; -@end - - -/** - The YYAsyncLayer's delegate protocol. The delegate of the YYAsyncLayer (typically a UIView) - must implements the method in this protocol. - */ -@protocol YYAsyncLayerDelegate -@required -/// This method is called to return a new display task when the layer's contents need update. -- (YYAsyncLayerDisplayTask *)newAsyncDisplayTask; -@end - - -/** - A display task used by YYAsyncLayer to render the contents in background queue. - */ -@interface YYAsyncLayerDisplayTask : NSObject - -/** - This block will be called before the asynchronous drawing begins. - It will be called on the main thread. - - @param layer The layer. - */ -@property (nullable, nonatomic, copy) void (^willDisplay)(CALayer *layer); - -/** - This block is called to draw the layer's contents. - - @discussion This block may be called on main thread or background thread, - so is should be thread-safe. - - @param context A new bitmap content created by layer. - @param size The content size (typically same as layer's bound size). - @param isCancelled If this block returns `YES`, the method should cancel the - drawing process and return as quickly as possible. - */ -@property (nullable, nonatomic, copy) void (^display)(CGContextRef context, CGSize size, BOOL(^isCancelled)(void)); - -/** - This block will be called after the asynchronous drawing finished. - It will be called on the main thread. - - @param layer The layer. - @param finished If the draw process is cancelled, it's `NO`, otherwise it's `YES`; - */ -@property (nullable, nonatomic, copy) void (^didDisplay)(CALayer *layer, BOOL finished); - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYAsyncLayer.m b/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYAsyncLayer.m deleted file mode 100644 index c477718f..00000000 --- a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYAsyncLayer.m +++ /dev/null @@ -1,187 +0,0 @@ -// -// YYAsyncLayer.m -// YYKit -// -// Created by ibireme on 15/4/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYAsyncLayer.h" -#import "YYSentinel.h" - -#if __has_include("YYDispatchQueuePool.h") -#import "YYDispatchQueuePool.h" -#else -#import -#endif - -/// Global display queue, used for content rendering. -static dispatch_queue_t YYAsyncLayerGetDisplayQueue() { -#ifdef YYDispatchQueuePool_h - return YYDispatchQueueGetForQOS(NSQualityOfServiceUserInitiated); -#else -#define MAX_QUEUE_COUNT 16 - static int queueCount; - static dispatch_queue_t queues[MAX_QUEUE_COUNT]; - static dispatch_once_t onceToken; - static int32_t counter = 0; - dispatch_once(&onceToken, ^{ - queueCount = (int)[NSProcessInfo processInfo].activeProcessorCount; - queueCount = queueCount < 1 ? 1 : queueCount > MAX_QUEUE_COUNT ? MAX_QUEUE_COUNT : queueCount; - if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0) { - for (NSUInteger i = 0; i < queueCount; i++) { - dispatch_queue_attr_t attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INITIATED, 0); - queues[i] = dispatch_queue_create("com.ibireme.yykit.render", attr); - } - } else { - for (NSUInteger i = 0; i < queueCount; i++) { - queues[i] = dispatch_queue_create("com.ibireme.yykit.render", DISPATCH_QUEUE_SERIAL); - dispatch_set_target_queue(queues[i], dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)); - } - } - }); - int32_t cur = OSAtomicIncrement32(&counter); - if (cur < 0) cur = -cur; - return queues[(cur) % queueCount]; -#undef MAX_QUEUE_COUNT -#endif -} - -static dispatch_queue_t YYAsyncLayerGetReleaseQueue() { -#ifdef YYDispatchQueuePool_h - return YYDispatchQueueGetForQOS(NSQualityOfServiceDefault); -#else - return dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0); -#endif -} - - -@implementation YYAsyncLayerDisplayTask -@end - - -@implementation YYAsyncLayer { - YYSentinel *_sentinel; -} - -#pragma mark - Override - -+ (id)defaultValueForKey:(NSString *)key { - if ([key isEqualToString:@"displaysAsynchronously"]) { - return @(YES); - } else { - return [super defaultValueForKey:key]; - } -} - -- (instancetype)init { - self = [super init]; - static CGFloat scale; //global - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - scale = [UIScreen mainScreen].scale; - }); - self.contentsScale = scale; - _sentinel = [YYSentinel new]; - _displaysAsynchronously = YES; - return self; -} - -- (void)dealloc { - [_sentinel increase]; -} - -- (void)setNeedsDisplay { - [self _cancelAsyncDisplay]; - [super setNeedsDisplay]; -} - -- (void)display { - super.contents = super.contents; - [self _displayAsync:_displaysAsynchronously]; -} - -#pragma mark - Private - -- (void)_displayAsync:(BOOL)async { - __strong id delegate = self.delegate; - YYAsyncLayerDisplayTask *task = [delegate newAsyncDisplayTask]; - if (!task.display) { - if (task.willDisplay) task.willDisplay(self); - self.contents = nil; - if (task.didDisplay) task.didDisplay(self, YES); - return; - } - - if (async) { - if (task.willDisplay) task.willDisplay(self); - YYSentinel *sentinel = _sentinel; - int32_t value = sentinel.value; - BOOL (^isCancelled)() = ^BOOL() { - return value != sentinel.value; - }; - CGSize size = self.bounds.size; - BOOL opaque = self.opaque; - CGFloat scale = self.contentsScale; - if (size.width < 1 || size.height < 1) { - CGImageRef image = (__bridge_retained CGImageRef)(self.contents); - self.contents = nil; - if (image) { - dispatch_async(YYAsyncLayerGetReleaseQueue(), ^{ - CFRelease(image); - }); - } - if (task.didDisplay) task.didDisplay(self, YES); - return; - } - - dispatch_async(YYAsyncLayerGetDisplayQueue(), ^{ - if (isCancelled()) return; - UIGraphicsBeginImageContextWithOptions(size, opaque, scale); - CGContextRef context = UIGraphicsGetCurrentContext(); - task.display(context, size, isCancelled); - if (isCancelled()) { - UIGraphicsEndImageContext(); - dispatch_async(dispatch_get_main_queue(), ^{ - if (task.didDisplay) task.didDisplay(self, NO); - }); - return; - } - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - if (isCancelled()) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (task.didDisplay) task.didDisplay(self, NO); - }); - return; - } - dispatch_async(dispatch_get_main_queue(), ^{ - if (isCancelled()) { - if (task.didDisplay) task.didDisplay(self, NO); - } else { - self.contents = (__bridge id)(image.CGImage); - if (task.didDisplay) task.didDisplay(self, YES); - } - }); - }); - } else { - [_sentinel increase]; - if (task.willDisplay) task.willDisplay(self); - UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, self.contentsScale); - CGContextRef context = UIGraphicsGetCurrentContext(); - task.display(context, self.bounds.size, ^{return NO;}); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - self.contents = (__bridge id)(image.CGImage); - if (task.didDisplay) task.didDisplay(self, YES); - } -} - -- (void)_cancelAsyncDisplay { - [_sentinel increase]; -} - -@end diff --git a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYSentinel.h b/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYSentinel.h deleted file mode 100644 index c81e6a7b..00000000 --- a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYSentinel.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// YYSentinel.h -// YYKit -// -// Created by ibireme on 15/4/13. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - YYSentinel is a thread safe incrementing counter. - It may be used in some multi-threaded situation. - */ -@interface YYSentinel : NSObject - -/// Returns the current value of the counter. -@property (readonly) int32_t value; - -/// Increase the value atomically. -/// @return The new value. -- (int32_t)increase; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYSentinel.m b/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYSentinel.m deleted file mode 100644 index fd919f7c..00000000 --- a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYSentinel.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// YYSentinel.m -// YYKit -// -// Created by ibireme on 15/4/13. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYSentinel.h" -#import - -@implementation YYSentinel { - int32_t _value; -} - -- (int32_t)value { - return _value; -} - -- (int32_t)increase { - return OSAtomicIncrement32(&_value); -} - -@end diff --git a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYTransaction.h b/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYTransaction.h deleted file mode 100644 index 351c069d..00000000 --- a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYTransaction.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// YYTransaction.h -// YYKit -// -// Created by ibireme on 15/4/18. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - YYTransaction let you perform a selector once before current runloop sleep. - */ -@interface YYTransaction : NSObject - -/** - Creates and returns a transaction with a specified target and selector. - - @param target A specified target, the target is retained until runloop end. - @param selector A selector for target. - - @return A new transaction, or nil if an error occurs. - */ -+ (YYTransaction *)transactionWithTarget:(id)target selector:(SEL)selector; - -/** - Commit the trancaction to main runloop. - - @discussion It will perform the selector on the target once before main runloop's - current loop sleep. If the same transaction (same target and same selector) has - already commit to runloop in this loop, this method do nothing. - */ -- (void)commit; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYTransaction.m b/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYTransaction.m deleted file mode 100644 index d8d987d4..00000000 --- a/iOSProject/Pods/YYAsyncLayer/YYAsyncLayer/YYTransaction.m +++ /dev/null @@ -1,81 +0,0 @@ -// -// YYTransaction.m -// YYKit -// -// Created by ibireme on 15/4/18. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTransaction.h" - - -@interface YYTransaction() -@property (nonatomic, strong) id target; -@property (nonatomic, assign) SEL selector; -@end - -static NSMutableSet *transactionSet = nil; - -static void YYRunLoopObserverCallBack(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { - if (transactionSet.count == 0) return; - NSSet *currentSet = transactionSet; - transactionSet = [NSMutableSet new]; - [currentSet enumerateObjectsUsingBlock:^(YYTransaction *transaction, BOOL *stop) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" - [transaction.target performSelector:transaction.selector]; -#pragma clang diagnostic pop - }]; -} - -static void YYTransactionSetup() { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - transactionSet = [NSMutableSet new]; - CFRunLoopRef runloop = CFRunLoopGetMain(); - CFRunLoopObserverRef observer; - - observer = CFRunLoopObserverCreate(CFAllocatorGetDefault(), - kCFRunLoopBeforeWaiting | kCFRunLoopExit, - true, // repeat - 0xFFFFFF, // after CATransaction(2000000) - YYRunLoopObserverCallBack, NULL); - CFRunLoopAddObserver(runloop, observer, kCFRunLoopCommonModes); - CFRelease(observer); - }); -} - - -@implementation YYTransaction - -+ (YYTransaction *)transactionWithTarget:(id)target selector:(SEL)selector{ - if (!target || !selector) return nil; - YYTransaction *t = [YYTransaction new]; - t.target = target; - t.selector = selector; - return t; -} - -- (void)commit { - if (!_target || !_selector) return; - YYTransactionSetup(); - [transactionSet addObject:self]; -} - -- (NSUInteger)hash { - long v1 = (long)((void *)_selector); - long v2 = (long)_target; - return v1 ^ v2; -} - -- (BOOL)isEqual:(id)object { - if (self == object) return YES; - if (![object isMemberOfClass:self.class]) return NO; - YYTransaction *other = object; - return other.selector == _selector && other.target == _target; -} - -@end diff --git a/iOSProject/Pods/YYCategories/LICENSE b/iOSProject/Pods/YYCategories/LICENSE deleted file mode 100644 index 46be20bd..00000000 --- a/iOSProject/Pods/YYCategories/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 ibireme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/iOSProject/Pods/YYCategories/README.md b/iOSProject/Pods/YYCategories/README.md deleted file mode 100755 index 58aa73a2..00000000 --- a/iOSProject/Pods/YYCategories/README.md +++ /dev/null @@ -1,145 +0,0 @@ -YYCategories -============== - -[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/ibireme/YYCategories/master/LICENSE)  -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)  -[![CocoaPods](http://img.shields.io/cocoapods/v/YYCategories.svg?style=flat)](http://cocoapods.org/?q=YYCategories)  -[![CocoaPods](http://img.shields.io/cocoapods/p/YYCategories.svg?style=flat)](http://cocoapods.org/?q=YYCategories)  -[![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  -[![Build Status](https://travis-ci.org/ibireme/YYCategories.svg?branch=master)](https://travis-ci.org/ibireme/YYCategories) - -A set of useful categories for Foundation and UIKit.
    -(It's a component of [YYKit](https://github.com/ibireme/YYKit)) - -Documentation -============== - -You can build and install docset use `Docset` scheme in Xcode, `appledoc` need to be pre-installed. -Or your can read the [Documentation](http://github.ibireme.com/doc/YYCategories/index.html) online. - - -Installation -============== - -### CocoaPods - -1. Add `pod 'YYCategories'` to your Podfile. -2. Run `pod install` or `pod update`. -3. Import \. - - -### Carthage - -1. Add `github "ibireme/YYCategories"` to your Cartfile. -2. Run `carthage update --platform ios` and add the framework to your project. -3. Import \. - - -### Manually - -1. Download all the files in the YYCategories subdirectory. -2. Add the source files to your Xcode project. -3. Add `-fno-objc-arc` compiler flag to `NSObject+YYAddForARC.m` and `NSThread+YYAdd.m`. -4. Link with required frameworks: - * UIKit - * CoreGraphics - * QuartzCore - * Accelerate - * ImageIO - * CoreText - * CoreFoundation - * libz -5. Import `YYCategories.h`. - - -Documentation -============== -Full API documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/YYCategories/).
    -You can also install documentation locally using [appledoc](https://github.com/tomaz/appledoc). - - -Requirements -============== -This library requires `iOS 6.0+` and `Xcode 7.0+`. - - -Notice -============== -I want to use the APIs as if it was provided by system, so I don't add prefix in -these categories. This may cause some potential problems(such as conflict with other libraries), so if you just need some pieces of code -in this project, pick them out and don't import the whole library. - - -License -============== -YYCategories is provided under the MIT license. See LICENSE file for details. - - - - -

    ---- -中文介绍 -============== -功能丰富的 Category 类型工具库。
    -(该项目是 [YYKit](https://github.com/ibireme/YYKit) 组件之一) - -文档 -============== - -你可以用 `Docset` scheme 来生成文档 (需要预先安装 appledoc),或者[在线查看](http://github.ibireme.com/doc/YYCategories/index.html)。 - - -安装 -============== - -### CocoaPods - -1. 在 Podfile 中添加 `pod 'YYCategories'`。 -2. 执行 `pod install` 或 `pod update`。 -3. 导入 \。 - - -### Carthage - -1. 在 Cartfile 中添加 `github "ibireme/YYCategories"`。 -2. 执行 `carthage update --platform ios` 并将生成的 framework 添加到你的工程。 -3. 导入 \。 - - -### 手动安装 - -1. 下载 YYCategories 文件夹内的所有内容。 -2. 将 YYCategories 内的源文件添加(拖放)到你的工程。 -3. 为 `NSObject+YYAddForARC.m` 和 `NSThread+YYAdd.m` 添加编译参数 `-fno-objc-arc`。 -4. 链接以下 frameworks: - * UIKit - * CoreGraphics - * QuartzCore - * Accelerate - * ImageIO - * CoreText - * CoreFoundation - * libz -5. 导入 `YYCategories.h`。 - - -文档 -============== -你可以在 [CocoaDocs](http://cocoadocs.org/docsets/YYCategories/) 查看在线 API 文档,也可以用 [appledoc](https://github.com/tomaz/appledoc) 本地生成文档。 - -系统要求 -============== -该项目最低支持 `iOS 6.0` 和 `Xcode 7.0`。 - - -注意 -============== -我希望调用 API 时,有着和调用系统自带 API 一样的体验,所以我并没有为 Category 方法添加前缀。我已经用工具扫描过这个项目中的 API,确保没有对系统 API 产生影响。我知道没有前缀的 Category 可能会带来麻烦(比如可能和其他某些类库产生冲突),所以如果你只需要其中少量代码,那最好将那段代码取出来,而不是导入整个库。 - - -许可证 -============== -YYCategories 使用 MIT 许可证,详情见 LICENSE 文件。 - - diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSArray+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSArray+YYAdd.h deleted file mode 100644 index 44af3059..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSArray+YYAdd.h +++ /dev/null @@ -1,196 +0,0 @@ -// -// NSArray+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provide some some common method for `NSArray`. - */ -@interface NSArray (YYAdd) - -/** - Creates and returns an array from a specified property list data. - - @param plist A property list data whose root object is an array. - @return A new array created from the plist data, or nil if an error occurs. - */ -+ (nullable NSArray *)arrayWithPlistData:(NSData *)plist; - -/** - Creates and returns an array from a specified property list xml string. - - @param plist A property list xml string whose root object is an array. - @return A new array created from the plist string, or nil if an error occurs. - */ -+ (nullable NSArray *)arrayWithPlistString:(NSString *)plist; - -/** - Serialize the array to a binary property list data. - - @return A bplist data, or nil if an error occurs. - */ -- (nullable NSData *)plistData; - -/** - Serialize the array to a xml property list string. - - @return A plist xml string, or nil if an error occurs. - */ -- (nullable NSString *)plistString; - -/** - Returns the object located at a random index. - - @return The object in the array with a random index value. - If the array is empty, returns nil. - */ -- (nullable id)randomObject; - -/** - Returns the object located at index, or return nil when out of bounds. - It's similar to `objectAtIndex:`, but it never throw exception. - - @param index The object located at index. - */ -- (nullable id)objectOrNilAtIndex:(NSUInteger)index; - -/** - Convert object to json string. return nil if an error occurs. - NSString/NSNumber/NSDictionary/NSArray - */ -- (nullable NSString *)jsonStringEncoded; - -/** - Convert object to json string formatted. return nil if an error occurs. - */ -- (nullable NSString *)jsonPrettyStringEncoded; - -@end - - -/** - Provide some some common method for `NSMutableArray`. - */ -@interface NSMutableArray (YYAdd) - -/** - Creates and returns an array from a specified property list data. - - @param plist A property list data whose root object is an array. - @return A new array created from the plist data, or nil if an error occurs. - */ -+ (nullable NSMutableArray *)arrayWithPlistData:(NSData *)plist; - -/** - Creates and returns an array from a specified property list xml string. - - @param plist A property list xml string whose root object is an array. - @return A new array created from the plist string, or nil if an error occurs. - */ -+ (nullable NSMutableArray *)arrayWithPlistString:(NSString *)plist; - -/** - Removes the object with the lowest-valued index in the array. - If the array is empty, this method has no effect. - - @discussion Apple has implemented this method, but did not make it public. - Override for safe. - */ -- (void)removeFirstObject; - -/** - Removes the object with the highest-valued index in the array. - If the array is empty, this method has no effect. - - @discussion Apple's implementation said it raises an NSRangeException if the - array is empty, but in fact nothing will happen. Override for safe. - */ -- (void)removeLastObject; - -/** - Removes and returns the object with the lowest-valued index in the array. - If the array is empty, it just returns nil. - - @return The first object, or nil. - */ -- (nullable id)popFirstObject; - -/** - Removes and returns the object with the highest-valued index in the array. - If the array is empty, it just returns nil. - - @return The first object, or nil. - */ -- (nullable id)popLastObject; - -/** - Inserts a given object at the end of the array. - - @param anObject The object to add to the end of the array's content. - This value must not be nil. Raises an NSInvalidArgumentException if anObject is nil. - */ -- (void)appendObject:(id)anObject; - -/** - Inserts a given object at the beginning of the array. - - @param anObject The object to add to the end of the array's content. - This value must not be nil. Raises an NSInvalidArgumentException if anObject is nil. - */ -- (void)prependObject:(id)anObject; - -/** - Adds the objects contained in another given array to the end of the receiving - array's content. - - @param objects An array of objects to add to the end of the receiving array's - content. If the objects is empty or nil, this method has no effect. - */ -- (void)appendObjects:(NSArray *)objects; - -/** - Adds the objects contained in another given array to the beginnin of the receiving - array's content. - - @param objects An array of objects to add to the beginning of the receiving array's - content. If the objects is empty or nil, this method has no effect. - */ -- (void)prependObjects:(NSArray *)objects; - -/** - Adds the objects contained in another given array at the index of the receiving - array's content. - - @param objects An array of objects to add to the receiving array's - content. If the objects is empty or nil, this method has no effect. - - @param index The index in the array at which to insert objects. This value must - not be greater than the count of elements in the array. Raises an - NSRangeException if index is greater than the number of elements in the array. - */ -- (void)insertObjects:(NSArray *)objects atIndex:(NSUInteger)index; - -/** - Reverse the index of object in this array. - Example: Before @[ @1, @2, @3 ], After @[ @3, @2, @1 ]. - */ -- (void)reverse; - -/** - Sort the object in this array randomly. - */ -- (void)shuffle; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSArray+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSArray+YYAdd.m deleted file mode 100644 index fab17e5d..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSArray+YYAdd.m +++ /dev/null @@ -1,172 +0,0 @@ -// -// NSArray+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSArray+YYAdd.h" -#import "YYCategoriesMacro.h" -#import "NSData+YYAdd.h" - -YYSYNTH_DUMMY_CLASS(NSArray_YYAdd) - - -@implementation NSArray (YYAdd) - -+ (NSArray *)arrayWithPlistData:(NSData *)plist { - if (!plist) return nil; - NSArray *array = [NSPropertyListSerialization propertyListWithData:plist options:NSPropertyListImmutable format:NULL error:NULL]; - if ([array isKindOfClass:[NSArray class]]) return array; - return nil; -} - -+ (NSArray *)arrayWithPlistString:(NSString *)plist { - if (!plist) return nil; - NSData* data = [plist dataUsingEncoding:NSUTF8StringEncoding]; - return [self arrayWithPlistData:data]; -} - -- (NSData *)plistData { - return [NSPropertyListSerialization dataWithPropertyList:self format:NSPropertyListBinaryFormat_v1_0 options:kNilOptions error:NULL]; -} - -- (NSString *)plistString { - NSData *xmlData = [NSPropertyListSerialization dataWithPropertyList:self format:NSPropertyListXMLFormat_v1_0 options:kNilOptions error:NULL]; - if (xmlData) return xmlData.utf8String; - return nil; -} - -- (id)randomObject { - if (self.count) { - return self[arc4random_uniform((u_int32_t)self.count)]; - } - return nil; -} - -- (id)objectOrNilAtIndex:(NSUInteger)index { - return index < self.count ? self[index] : nil; -} - -- (NSString *)jsonStringEncoded { - if ([NSJSONSerialization isValidJSONObject:self]) { - NSError *error; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:0 error:&error]; - NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - return json; - } - return nil; -} - -- (NSString *)jsonPrettyStringEncoded { - if ([NSJSONSerialization isValidJSONObject:self]) { - NSError *error; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:&error]; - NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - return json; - } - return nil; -} - -@end - - - -@implementation NSMutableArray (YYAdd) - -+ (NSMutableArray *)arrayWithPlistData:(NSData *)plist { - if (!plist) return nil; - NSMutableArray *array = [NSPropertyListSerialization propertyListWithData:plist options:NSPropertyListMutableContainersAndLeaves format:NULL error:NULL]; - if ([array isKindOfClass:[NSMutableArray class]]) return array; - return nil; -} - -+ (NSMutableArray *)arrayWithPlistString:(NSString *)plist { - if (!plist) return nil; - NSData* data = [plist dataUsingEncoding:NSUTF8StringEncoding]; - return [self arrayWithPlistData:data]; -} - -- (void)removeFirstObject { - if (self.count) { - [self removeObjectAtIndex:0]; - } -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation" -- (void)removeLastObject { - if (self.count) { - [self removeObjectAtIndex:self.count - 1]; - } -} - -#pragma clang diagnostic pop - - -- (id)popFirstObject { - id obj = nil; - if (self.count) { - obj = self.firstObject; - [self removeFirstObject]; - } - return obj; -} - -- (id)popLastObject { - id obj = nil; - if (self.count) { - obj = self.lastObject; - [self removeLastObject]; - } - return obj; -} - -- (void)appendObject:(id)anObject { - [self addObject:anObject]; -} - -- (void)prependObject:(id)anObject { - [self insertObject:anObject atIndex:0]; -} - -- (void)appendObjects:(NSArray *)objects { - if (!objects) return; - [self addObjectsFromArray:objects]; -} - -- (void)prependObjects:(NSArray *)objects { - if (!objects) return; - NSUInteger i = 0; - for (id obj in objects) { - [self insertObject:obj atIndex:i++]; - } -} - -- (void)insertObjects:(NSArray *)objects atIndex:(NSUInteger)index { - NSUInteger i = index; - for (id obj in objects) { - [self insertObject:obj atIndex:i++]; - } -} - -- (void)reverse { - NSUInteger count = self.count; - int mid = floor(count / 2.0); - for (NSUInteger i = 0; i < mid; i++) { - [self exchangeObjectAtIndex:i withObjectAtIndex:(count - (i + 1))]; - } -} - -- (void)shuffle { - for (NSUInteger i = self.count; i > 1; i--) { - [self exchangeObjectAtIndex:(i - 1) - withObjectAtIndex:arc4random_uniform((u_int32_t)i)]; - } -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSBundle+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSBundle+YYAdd.h deleted file mode 100644 index cec2c409..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSBundle+YYAdd.h +++ /dev/null @@ -1,92 +0,0 @@ -// -// NSBundle+YYAdd.h -// YYCategories -// -// Created by ibireme on 14/10/20. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `NSBundle` to get resource by @2x or @3x... - - Example: ico.png, ico@2x.png, ico@3x.png. Call scaledResource:@"ico" ofType:@"png" - on iPhone6 will return "ico@2x.png"'s path. - */ -@interface NSBundle (YYAdd) - -/** - An array of NSNumber objects, shows the best order for path scale search. - e.g. iPhone3GS:@[@1,@2,@3] iPhone5:@[@2,@3,@1] iPhone6 Plus:@[@3,@2,@1] - */ -+ (NSArray *)preferredScales; - -/** - Returns the full pathname for the resource file identified by the specified - name and extension and residing in a given bundle directory. It first search - the file with current screen's scale (such as @2x), then search from higher - scale to lower scale. - - @param name The name of a resource file contained in the directory - specified by bundlePath. - - @param ext If extension is an empty string or nil, the extension is - assumed not to exist and the file is the first file encountered that exactly matches name. - - @param bundlePath The path of a top-level bundle directory. This must be a - valid path. For example, to specify the bundle directory for a Mac app, you - might specify the path /Applications/MyApp.app. - - @return The full pathname for the resource file or nil if the file could not be - located. This method also returns nil if the bundle specified by the bundlePath - parameter does not exist or is not a readable directory. - */ -+ (nullable NSString *)pathForScaledResource:(NSString *)name - ofType:(nullable nullable NSString *)ext - inDirectory:(NSString *)bundlePath; - -/** - Returns the full pathname for the resource identified by the specified name and - file extension. It first search the file with current screen's scale (such as @2x), - then search from higher scale to lower scale. - - @param name The name of the resource file. If name is an empty string or - nil, returns the first file encountered of the supplied type. - - @param ext If extension is an empty string or nil, the extension is - assumed not to exist and the file is the first file encountered that exactly matches name. - - - @return The full pathname for the resource file or nil if the file could not be located. - */ -- (nullable NSString *)pathForScaledResource:(NSString *)name ofType:(nullable NSString *)ext; - -/** - Returns the full pathname for the resource identified by the specified name and - file extension and located in the specified bundle subdirectory. It first search - the file with current screen's scale (such as @2x), then search from higher - scale to lower scale. - - @param name The name of the resource file. - - @param ext If extension is an empty string or nil, all the files in - subpath and its subdirectories are returned. If an extension is provided the - subdirectories are not searched. - - @param subpath The name of the bundle subdirectory. Can be nil. - - @return The full pathname for the resource file or nil if the file could not be located. - */ -- (nullable NSString *)pathForScaledResource:(NSString *)name - ofType:(nullable NSString *)ext - inDirectory:(nullable NSString *)subpath; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSBundle+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSBundle+YYAdd.m deleted file mode 100644 index 01d665cd..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSBundle+YYAdd.m +++ /dev/null @@ -1,87 +0,0 @@ -// -// NSBundle+YYAdd.m -// YYCategories -// -// Created by ibireme on 14/10/20. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSBundle+YYAdd.h" -#import "NSString+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(NSBundle_YYAdd) - -@implementation NSBundle (YYAdd) - -+ (NSArray *)preferredScales { - static NSArray *scales; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - CGFloat screenScale = [UIScreen mainScreen].scale; - if (screenScale <= 1) { - scales = @[@1,@2,@3]; - } else if (screenScale <= 2) { - scales = @[@2,@3,@1]; - } else { - scales = @[@3,@2,@1]; - } - }); - return scales; -} - -+ (NSString *)pathForScaledResource:(NSString *)name ofType:(NSString *)ext inDirectory:(NSString *)bundlePath { - if (name.length == 0) return nil; - if ([name hasSuffix:@"/"]) return [self pathForResource:name ofType:ext inDirectory:bundlePath]; - - NSString *path = nil; - NSArray *scales = [self preferredScales]; - for (int s = 0; s < scales.count; s++) { - CGFloat scale = ((NSNumber *)scales[s]).floatValue; - NSString *scaledName = ext.length ? [name stringByAppendingNameScale:scale] - : [name stringByAppendingPathScale:scale]; - path = [self pathForResource:scaledName ofType:ext inDirectory:bundlePath]; - if (path) break; - } - - return path; -} - -- (NSString *)pathForScaledResource:(NSString *)name ofType:(NSString *)ext { - if (name.length == 0) return nil; - if ([name hasSuffix:@"/"]) return [self pathForResource:name ofType:ext]; - - NSString *path = nil; - NSArray *scales = [NSBundle preferredScales]; - for (int s = 0; s < scales.count; s++) { - CGFloat scale = ((NSNumber *)scales[s]).floatValue; - NSString *scaledName = ext.length ? [name stringByAppendingNameScale:scale] - : [name stringByAppendingPathScale:scale]; - path = [self pathForResource:scaledName ofType:ext]; - if (path) break; - } - - return path; -} - -- (NSString *)pathForScaledResource:(NSString *)name ofType:(NSString *)ext inDirectory:(NSString *)subpath { - if (name.length == 0) return nil; - if ([name hasSuffix:@"/"]) return [self pathForResource:name ofType:ext]; - - NSString *path = nil; - NSArray *scales = [NSBundle preferredScales]; - for (int s = 0; s < scales.count; s++) { - CGFloat scale = ((NSNumber *)scales[s]).floatValue; - NSString *scaledName = ext.length ? [name stringByAppendingNameScale:scale] - : [name stringByAppendingPathScale:scale]; - path = [self pathForResource:scaledName ofType:ext inDirectory:subpath]; - if (path) break; - } - - return path; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSData+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSData+YYAdd.h deleted file mode 100644 index 95acda2c..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSData+YYAdd.h +++ /dev/null @@ -1,310 +0,0 @@ -// -// NSData+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provide hash, encrypt, encode and some common method for `NSData`. - */ -@interface NSData (YYAdd) - -#pragma mark - Hash -///============================================================================= -/// @name Hash -///============================================================================= - -/** - Returns a lowercase NSString for md2 hash. - */ -- (NSString *)md2String; - -/** - Returns an NSData for md2 hash. - */ -- (NSData *)md2Data; - -/** - Returns a lowercase NSString for md4 hash. - */ -- (NSString *)md4String; - -/** - Returns an NSData for md4 hash. - */ -- (NSData *)md4Data; - -/** - Returns a lowercase NSString for md5 hash. - */ -- (NSString *)md5String; - -/** - Returns an NSData for md5 hash. - */ -- (NSData *)md5Data; - -/** - Returns a lowercase NSString for sha1 hash. - */ -- (NSString *)sha1String; - -/** - Returns an NSData for sha1 hash. - */ -- (NSData *)sha1Data; - -/** - Returns a lowercase NSString for sha224 hash. - */ -- (NSString *)sha224String; - -/** - Returns an NSData for sha224 hash. - */ -- (NSData *)sha224Data; - -/** - Returns a lowercase NSString for sha256 hash. - */ -- (NSString *)sha256String; - -/** - Returns an NSData for sha256 hash. - */ -- (NSData *)sha256Data; - -/** - Returns a lowercase NSString for sha384 hash. - */ -- (NSString *)sha384String; - -/** - Returns an NSData for sha384 hash. - */ -- (NSData *)sha384Data; - -/** - Returns a lowercase NSString for sha512 hash. - */ -- (NSString *)sha512String; - -/** - Returns an NSData for sha512 hash. - */ -- (NSData *)sha512Data; - -/** - Returns a lowercase NSString for hmac using algorithm md5 with key. - @param key The hmac key. - */ -- (NSString *)hmacMD5StringWithKey:(NSString *)key; - -/** - Returns an NSData for hmac using algorithm md5 with key. - @param key The hmac key. - */ -- (NSData *)hmacMD5DataWithKey:(NSData *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha1 with key. - @param key The hmac key. - */ -- (NSString *)hmacSHA1StringWithKey:(NSString *)key; - -/** - Returns an NSData for hmac using algorithm sha1 with key. - @param key The hmac key. - */ -- (NSData *)hmacSHA1DataWithKey:(NSData *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha224 with key. - @param key The hmac key. - */ -- (NSString *)hmacSHA224StringWithKey:(NSString *)key; - -/** - Returns an NSData for hmac using algorithm sha224 with key. - @param key The hmac key. - */ -- (NSData *)hmacSHA224DataWithKey:(NSData *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha256 with key. - @param key The hmac key. - */ -- (NSString *)hmacSHA256StringWithKey:(NSString *)key; - -/** - Returns an NSData for hmac using algorithm sha256 with key. - @param key The hmac key. - */ -- (NSData *)hmacSHA256DataWithKey:(NSData *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha384 with key. - @param key The hmac key. - */ -- (NSString *)hmacSHA384StringWithKey:(NSString *)key; - -/** - Returns an NSData for hmac using algorithm sha384 with key. - @param key The hmac key. - */ -- (NSData *)hmacSHA384DataWithKey:(NSData *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha512 with key. - @param key The hmac key. - */ -- (NSString *)hmacSHA512StringWithKey:(NSString *)key; - -/** - Returns an NSData for hmac using algorithm sha512 with key. - @param key The hmac key. - */ -- (NSData *)hmacSHA512DataWithKey:(NSData *)key; - -/** - Returns a lowercase NSString for crc32 hash. - */ -- (NSString *)crc32String; - -/** - Returns crc32 hash. - */ -- (uint32_t)crc32; - - -#pragma mark - Encrypt and Decrypt -///============================================================================= -/// @name Encrypt and Decrypt -///============================================================================= - -/** - Returns an encrypted NSData using AES. - - @param key A key length of 16, 24 or 32 (128, 192 or 256bits). - - @param iv An initialization vector length of 16(128bits). - Pass nil when you don't want to use iv. - - @return An NSData encrypted, or nil if an error occurs. - */ -- (nullable NSData *)aes256EncryptWithKey:(NSData *)key iv:(nullable NSData *)iv; - -/** - Returns an decrypted NSData using AES. - - @param key A key length of 16, 24 or 32 (128, 192 or 256bits). - - @param iv An initialization vector length of 16(128bits). - Pass nil when you don't want to use iv. - - @return An NSData decrypted, or nil if an error occurs. - */ -- (nullable NSData *)aes256DecryptWithkey:(NSData *)key iv:(nullable NSData *)iv; - - -#pragma mark - Encode and decode -///============================================================================= -/// @name Encode and decode -///============================================================================= - -/** - Returns string decoded in UTF8. - */ -- (nullable NSString *)utf8String; - -/** - Returns a uppercase NSString in HEX. - */ -- (nullable NSString *)hexString; - -/** - Returns an NSData from hex string. - - @param hexString The hex string which is case insensitive. - - @return a new NSData, or nil if an error occurs. - */ -+ (nullable NSData *)dataWithHexString:(NSString *)hexString; - -/** - Returns an NSString for base64 encoded. - */ -- (nullable NSString *)base64EncodedString; - -/** - Returns an NSData from base64 encoded string. - - @warning This method has been implemented in iOS7. - - @param base64EncodedString The encoded string. - */ -+ (nullable NSData *)dataWithBase64EncodedString:(NSString *)base64EncodedString; - -/** - Returns an NSDictionary or NSArray for decoded self. - Returns nil if an error occurs. - */ -- (nullable id)jsonValueDecoded; - - -#pragma mark - Inflate and deflate -///============================================================================= -/// @name Inflate and deflate -///============================================================================= - -/** - Decompress data from gzip data. - @return Inflated data. - */ -- (nullable NSData *)gzipInflate; - -/** - Comperss data to gzip in default compresssion level. - @return Deflated data. - */ -- (nullable NSData *)gzipDeflate; - -/** - Decompress data from zlib-compressed data. - @return Inflated data. - */ -- (nullable NSData *)zlibInflate; - -/** - Comperss data to zlib-compressed in default compresssion level. - @return Deflated data. - */ -- (nullable NSData *)zlibDeflate; - - -#pragma mark - Others -///============================================================================= -/// @name Others -///============================================================================= - -/** - Create data from the file in main bundle (similar to [UIImage imageNamed:]). - - @param name The file name (in main bundle). - - @return A new data create from the file. - */ -+ (nullable NSData *)dataNamed:(NSString *)name; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSData+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSData+YYAdd.m deleted file mode 100644 index 26c7f0ec..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSData+YYAdd.m +++ /dev/null @@ -1,642 +0,0 @@ -// -// NSData+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSData+YYAdd.h" -#import "YYCategoriesMacro.h" -#include -#include - -YYSYNTH_DUMMY_CLASS(NSData_YYAdd) - - -@implementation NSData (YYAdd) - -- (NSString *)md2String { - unsigned char result[CC_MD2_DIGEST_LENGTH]; - CC_MD2(self.bytes, (CC_LONG)self.length, result); - return [NSString stringWithFormat: - @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - result[0], result[1], result[2], result[3], - result[4], result[5], result[6], result[7], - result[8], result[9], result[10], result[11], - result[12], result[13], result[14], result[15] - ]; -} - -- (NSData *)md2Data { - unsigned char result[CC_MD2_DIGEST_LENGTH]; - CC_MD2(self.bytes, (CC_LONG)self.length, result); - return [NSData dataWithBytes:result length:CC_MD2_DIGEST_LENGTH]; -} - -- (NSString *)md4String { - unsigned char result[CC_MD4_DIGEST_LENGTH]; - CC_MD4(self.bytes, (CC_LONG)self.length, result); - return [NSString stringWithFormat: - @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - result[0], result[1], result[2], result[3], - result[4], result[5], result[6], result[7], - result[8], result[9], result[10], result[11], - result[12], result[13], result[14], result[15] - ]; -} - -- (NSData *)md4Data { - unsigned char result[CC_MD4_DIGEST_LENGTH]; - CC_MD4(self.bytes, (CC_LONG)self.length, result); - return [NSData dataWithBytes:result length:CC_MD4_DIGEST_LENGTH]; -} - -- (NSString *)md5String { - unsigned char result[CC_MD5_DIGEST_LENGTH]; - CC_MD5(self.bytes, (CC_LONG)self.length, result); - return [NSString stringWithFormat: - @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - result[0], result[1], result[2], result[3], - result[4], result[5], result[6], result[7], - result[8], result[9], result[10], result[11], - result[12], result[13], result[14], result[15] - ]; -} - -- (NSData *)md5Data { - unsigned char result[CC_MD5_DIGEST_LENGTH]; - CC_MD5(self.bytes, (CC_LONG)self.length, result); - return [NSData dataWithBytes:result length:CC_MD5_DIGEST_LENGTH]; -} - -- (NSString *)sha1String { - unsigned char result[CC_SHA1_DIGEST_LENGTH]; - CC_SHA1(self.bytes, (CC_LONG)self.length, result); - NSMutableString *hash = [NSMutableString - stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2]; - for (int i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) { - [hash appendFormat:@"%02x", result[i]]; - } - return hash; -} - -- (NSData *)sha1Data { - unsigned char result[CC_SHA1_DIGEST_LENGTH]; - CC_SHA1(self.bytes, (CC_LONG)self.length, result); - return [NSData dataWithBytes:result length:CC_SHA1_DIGEST_LENGTH]; -} - -- (NSString *)sha224String { - unsigned char result[CC_SHA224_DIGEST_LENGTH]; - CC_SHA224(self.bytes, (CC_LONG)self.length, result); - NSMutableString *hash = [NSMutableString - stringWithCapacity:CC_SHA224_DIGEST_LENGTH * 2]; - for (int i = 0; i < CC_SHA224_DIGEST_LENGTH; i++) { - [hash appendFormat:@"%02x", result[i]]; - } - return hash; -} - -- (NSData *)sha224Data { - unsigned char result[CC_SHA224_DIGEST_LENGTH]; - CC_SHA224(self.bytes, (CC_LONG)self.length, result); - return [NSData dataWithBytes:result length:CC_SHA224_DIGEST_LENGTH]; -} - -- (NSString *)sha256String { - unsigned char result[CC_SHA256_DIGEST_LENGTH]; - CC_SHA256(self.bytes, (CC_LONG)self.length, result); - NSMutableString *hash = [NSMutableString - stringWithCapacity:CC_SHA256_DIGEST_LENGTH * 2]; - for (int i = 0; i < CC_SHA256_DIGEST_LENGTH; i++) { - [hash appendFormat:@"%02x", result[i]]; - } - return hash; -} - -- (NSData *)sha256Data { - unsigned char result[CC_SHA256_DIGEST_LENGTH]; - CC_SHA256(self.bytes, (CC_LONG)self.length, result); - return [NSData dataWithBytes:result length:CC_SHA256_DIGEST_LENGTH]; -} - -- (NSString *)sha384String { - unsigned char result[CC_SHA384_DIGEST_LENGTH]; - CC_SHA384(self.bytes, (CC_LONG)self.length, result); - NSMutableString *hash = [NSMutableString - stringWithCapacity:CC_SHA384_DIGEST_LENGTH * 2]; - for (int i = 0; i < CC_SHA384_DIGEST_LENGTH; i++) { - [hash appendFormat:@"%02x", result[i]]; - } - return hash; -} - -- (NSData *)sha384Data { - unsigned char result[CC_SHA384_DIGEST_LENGTH]; - CC_SHA384(self.bytes, (CC_LONG)self.length, result); - return [NSData dataWithBytes:result length:CC_SHA384_DIGEST_LENGTH]; -} - -- (NSString *)sha512String { - unsigned char result[CC_SHA512_DIGEST_LENGTH]; - CC_SHA512(self.bytes, (CC_LONG)self.length, result); - NSMutableString *hash = [NSMutableString - stringWithCapacity:CC_SHA512_DIGEST_LENGTH * 2]; - for (int i = 0; i < CC_SHA512_DIGEST_LENGTH; i++) { - [hash appendFormat:@"%02x", result[i]]; - } - return hash; -} - -- (NSData *)sha512Data { - unsigned char result[CC_SHA512_DIGEST_LENGTH]; - CC_SHA512(self.bytes, (CC_LONG)self.length, result); - return [NSData dataWithBytes:result length:CC_SHA512_DIGEST_LENGTH]; -} - -- (NSString *)hmacStringUsingAlg:(CCHmacAlgorithm)alg withKey:(NSString *)key { - size_t size; - switch (alg) { - case kCCHmacAlgMD5: size = CC_MD5_DIGEST_LENGTH; break; - case kCCHmacAlgSHA1: size = CC_SHA1_DIGEST_LENGTH; break; - case kCCHmacAlgSHA224: size = CC_SHA224_DIGEST_LENGTH; break; - case kCCHmacAlgSHA256: size = CC_SHA256_DIGEST_LENGTH; break; - case kCCHmacAlgSHA384: size = CC_SHA384_DIGEST_LENGTH; break; - case kCCHmacAlgSHA512: size = CC_SHA512_DIGEST_LENGTH; break; - default: return nil; - } - unsigned char result[size]; - const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding]; - CCHmac(alg, cKey, strlen(cKey), self.bytes, self.length, result); - NSMutableString *hash = [NSMutableString stringWithCapacity:size * 2]; - for (int i = 0; i < size; i++) { - [hash appendFormat:@"%02x", result[i]]; - } - return hash; -} - -- (NSData *)hmacDataUsingAlg:(CCHmacAlgorithm)alg withKey:(NSData *)key { - size_t size; - switch (alg) { - case kCCHmacAlgMD5: size = CC_MD5_DIGEST_LENGTH; break; - case kCCHmacAlgSHA1: size = CC_SHA1_DIGEST_LENGTH; break; - case kCCHmacAlgSHA224: size = CC_SHA224_DIGEST_LENGTH; break; - case kCCHmacAlgSHA256: size = CC_SHA256_DIGEST_LENGTH; break; - case kCCHmacAlgSHA384: size = CC_SHA384_DIGEST_LENGTH; break; - case kCCHmacAlgSHA512: size = CC_SHA512_DIGEST_LENGTH; break; - default: return nil; - } - unsigned char result[size]; - CCHmac(alg, [key bytes], key.length, self.bytes, self.length, result); - return [NSData dataWithBytes:result length:size]; -} - -- (NSString *)hmacMD5StringWithKey:(NSString *)key { - return [self hmacStringUsingAlg:kCCHmacAlgMD5 withKey:key]; -} - -- (NSData *)hmacMD5DataWithKey:(NSData *)key { - return [self hmacDataUsingAlg:kCCHmacAlgMD5 withKey:key]; -} - -- (NSString *)hmacSHA1StringWithKey:(NSString *)key { - return [self hmacStringUsingAlg:kCCHmacAlgSHA1 withKey:key]; -} - -- (NSData *)hmacSHA1DataWithKey:(NSData *)key { - return [self hmacDataUsingAlg:kCCHmacAlgSHA1 withKey:key]; -} - -- (NSString *)hmacSHA224StringWithKey:(NSString *)key { - return [self hmacStringUsingAlg:kCCHmacAlgSHA224 withKey:key]; -} - -- (NSData *)hmacSHA224DataWithKey:(NSData *)key { - return [self hmacDataUsingAlg:kCCHmacAlgSHA224 withKey:key]; -} - -- (NSString *)hmacSHA256StringWithKey:(NSString *)key { - return [self hmacStringUsingAlg:kCCHmacAlgSHA256 withKey:key]; -} - -- (NSData *)hmacSHA256DataWithKey:(NSData *)key { - return [self hmacDataUsingAlg:kCCHmacAlgSHA256 withKey:key]; -} - -- (NSString *)hmacSHA384StringWithKey:(NSString *)key { - return [self hmacStringUsingAlg:kCCHmacAlgSHA384 withKey:key]; -} - -- (NSData *)hmacSHA384DataWithKey:(NSData *)key { - return [self hmacDataUsingAlg:kCCHmacAlgSHA384 withKey:key]; -} - -- (NSString *)hmacSHA512StringWithKey:(NSString *)key { - return [self hmacStringUsingAlg:kCCHmacAlgSHA512 withKey:key]; -} - -- (NSData *)hmacSHA512DataWithKey:(NSData *)key { - return [self hmacDataUsingAlg:kCCHmacAlgSHA512 withKey:key]; -} - -- (NSString *)crc32String { - uLong result = crc32(0, self.bytes, (uInt)self.length); - return [NSString stringWithFormat:@"%08x", (uint32_t)result]; -} - -- (uint32_t)crc32 { - uLong result = crc32(0, self.bytes, (uInt)self.length); - return (uint32_t)result; -} - -- (NSData *)aes256EncryptWithKey:(NSData *)key iv:(NSData *)iv { - if (key.length != 16 && key.length != 24 && key.length != 32) { - return nil; - } - if (iv.length != 16 && iv.length != 0) { - return nil; - } - - NSData *result = nil; - size_t bufferSize = self.length + kCCBlockSizeAES128; - void *buffer = malloc(bufferSize); - if (!buffer) return nil; - size_t encryptedSize = 0; - CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, - kCCAlgorithmAES128, - kCCOptionPKCS7Padding, - key.bytes, - key.length, - iv.bytes, - self.bytes, - self.length, - buffer, - bufferSize, - &encryptedSize); - if (cryptStatus == kCCSuccess) { - result = [[NSData alloc]initWithBytes:buffer length:encryptedSize]; - free(buffer); - return result; - } else { - free(buffer); - return nil; - } -} - -- (NSData *)aes256DecryptWithkey:(NSData *)key iv:(NSData *)iv { - if (key.length != 16 && key.length != 24 && key.length != 32) { - return nil; - } - if (iv.length != 16 && iv.length != 0) { - return nil; - } - - NSData *result = nil; - size_t bufferSize = self.length + kCCBlockSizeAES128; - void *buffer = malloc(bufferSize); - if (!buffer) return nil; - size_t encryptedSize = 0; - CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt, - kCCAlgorithmAES128, - kCCOptionPKCS7Padding, - key.bytes, - key.length, - iv.bytes, - self.bytes, - self.length, - buffer, - bufferSize, - &encryptedSize); - if (cryptStatus == kCCSuccess) { - result = [[NSData alloc]initWithBytes:buffer length:encryptedSize]; - free(buffer); - return result; - } else { - free(buffer); - return nil; - } -} - -- (NSString *)utf8String { - if (self.length > 0) { - return [[NSString alloc] initWithData:self encoding:NSUTF8StringEncoding]; - } - return @""; -} - -- (NSString *)hexString { - NSUInteger length = self.length; - NSMutableString *result = [NSMutableString stringWithCapacity:length * 2]; - const unsigned char *byte = self.bytes; - for (int i = 0; i < length; i++, byte++) { - [result appendFormat:@"%02X", *byte]; - } - return result; -} - -+ (NSData *)dataWithHexString:(NSString *)hexStr { - hexStr = [hexStr stringByReplacingOccurrencesOfString:@" " withString:@""]; - hexStr = [hexStr lowercaseString]; - NSUInteger len = hexStr.length; - if (!len) return nil; - unichar *buf = malloc(sizeof(unichar) * len); - if (!buf) return nil; - [hexStr getCharacters:buf range:NSMakeRange(0, len)]; - - NSMutableData *result = [NSMutableData data]; - unsigned char bytes; - char str[3] = { '\0', '\0', '\0' }; - int i; - for (i = 0; i < len / 2; i++) { - str[0] = buf[i * 2]; - str[1] = buf[i * 2 + 1]; - bytes = strtol(str, NULL, 16); - [result appendBytes:&bytes length:1]; - } - free(buf); - return result; -} - -static const char base64EncodingTable[64] -= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -static const short base64DecodingTable[256] = { - -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -2, -1, -1, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 62, -2, -2, -2, 63, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, -2, -2, -2, - -2, 0, 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, -2, -2, -2, -2, -2, - -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, - -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2 -}; - -- (NSString *)base64EncodedString { - NSUInteger length = self.length; - if (length == 0) - return @""; - - NSUInteger out_length = ((length + 2) / 3) * 4; - uint8_t *output = malloc(((out_length + 2) / 3) * 4); - if (output == NULL) - return nil; - - const char *input = self.bytes; - NSInteger i, value; - for (i = 0; i < length; i += 3) { - value = 0; - for (NSInteger j = i; j < i + 3; j++) { - value <<= 8; - if (j < length) { - value |= (0xFF & input[j]); - } - } - NSInteger index = (i / 3) * 4; - output[index + 0] = base64EncodingTable[(value >> 18) & 0x3F]; - output[index + 1] = base64EncodingTable[(value >> 12) & 0x3F]; - output[index + 2] = ((i + 1) < length) - ? base64EncodingTable[(value >> 6) & 0x3F] - : '='; - output[index + 3] = ((i + 2) < length) - ? base64EncodingTable[(value >> 0) & 0x3F] - : '='; - } - - NSString *base64 = [[NSString alloc] initWithBytes:output - length:out_length - encoding:NSASCIIStringEncoding]; - free(output); - return base64; -} - -+ (NSData *)dataWithBase64EncodedString:(NSString *)base64EncodedString { - NSInteger length = base64EncodedString.length; - const char *string = [base64EncodedString cStringUsingEncoding:NSASCIIStringEncoding]; - if (string == NULL) - return nil; - - while (length > 0 && string[length - 1] == '=') - length--; - - NSInteger outputLength = length * 3 / 4; - NSMutableData *data = [NSMutableData dataWithLength:outputLength]; - if (data == nil) - return nil; - if (length == 0) - return data; - - uint8_t *output = data.mutableBytes; - NSInteger inputPoint = 0; - NSInteger outputPoint = 0; - while (inputPoint < length) { - char i0 = string[inputPoint++]; - char i1 = string[inputPoint++]; - char i2 = inputPoint < length ? string[inputPoint++] : 'A'; - char i3 = inputPoint < length ? string[inputPoint++] : 'A'; - - output[outputPoint++] = (base64DecodingTable[i0] << 2) - | (base64DecodingTable[i1] >> 4); - if (outputPoint < outputLength) { - output[outputPoint++] = ((base64DecodingTable[i1] & 0xf) << 4) - | (base64DecodingTable[i2] >> 2); - } - if (outputPoint < outputLength) { - output[outputPoint++] = ((base64DecodingTable[i2] & 0x3) << 6) - | base64DecodingTable[i3]; - } - } - - return data; -} - -- (id)jsonValueDecoded { - NSError *error = nil; - id value = [NSJSONSerialization JSONObjectWithData:self options:kNilOptions error:&error]; - if (error) { - NSLog(@"jsonValueDecoded error:%@", error); - } - return value; -} - -- (NSData *)gzipInflate { - if ([self length] == 0) return self; - - unsigned full_length = (unsigned)[self length]; - unsigned half_length = (unsigned)[self length] / 2; - - NSMutableData *decompressed = [NSMutableData - dataWithLength:full_length + half_length]; - BOOL done = NO; - int status; - - z_stream strm; - strm.next_in = (Bytef *)[self bytes]; - strm.avail_in = (unsigned)[self length]; - strm.total_out = 0; - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - - if (inflateInit2(&strm, (15 + 32)) != Z_OK) return nil; - while (!done) { - // Make sure we have enough room and reset the lengths. - if (strm.total_out >= [decompressed length]) - [decompressed increaseLengthBy:half_length]; - strm.next_out = [decompressed mutableBytes] + strm.total_out; - strm.avail_out = (uInt)([decompressed length] - strm.total_out); - - // Inflate another chunk. - status = inflate(&strm, Z_SYNC_FLUSH); - if (status == Z_STREAM_END) done = YES; - else if (status != Z_OK) break; - } - if (inflateEnd(&strm) != Z_OK) return nil; - - // Set real length. - if (done) { - [decompressed setLength:strm.total_out]; - return [NSData dataWithData:decompressed]; - } else return nil; -} - -- (NSData *)gzipDeflate { - if ([self length] == 0) return self; - - z_stream strm; - - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.total_out = 0; - strm.next_in = (Bytef *)[self bytes]; - strm.avail_in = (uInt)[self length]; - - // Compresssion Levels: - // Z_NO_COMPRESSION - // Z_BEST_SPEED - // Z_BEST_COMPRESSION - // Z_DEFAULT_COMPRESSION - - if (deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, (15 + 16), - 8, Z_DEFAULT_STRATEGY) != Z_OK) - return nil; - - // 16K chunks for expansion - NSMutableData *compressed = [NSMutableData dataWithLength:16384]; - - do { - if (strm.total_out >= [compressed length]) - [compressed increaseLengthBy:16384]; - - strm.next_out = [compressed mutableBytes] + strm.total_out; - strm.avail_out = (uInt)([compressed length] - strm.total_out); - - deflate(&strm, Z_FINISH); - } - while (strm.avail_out == 0); - - deflateEnd(&strm); - - [compressed setLength:strm.total_out]; - return [NSData dataWithData:compressed]; -} - -- (NSData *)zlibInflate { - if ([self length] == 0) return self; - - NSUInteger full_length = [self length]; - NSUInteger half_length = [self length] / 2; - - NSMutableData *decompressed = [NSMutableData - dataWithLength:full_length + half_length]; - BOOL done = NO; - int status; - - z_stream strm; - strm.next_in = (Bytef *)[self bytes]; - strm.avail_in = (uInt)full_length; - strm.total_out = 0; - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - - if (inflateInit(&strm) != Z_OK) return nil; - - while (!done) { - // Make sure we have enough room and reset the lengths. - if (strm.total_out >= [decompressed length]) - [decompressed increaseLengthBy:half_length]; - strm.next_out = [decompressed mutableBytes] + strm.total_out; - strm.avail_out = (uInt)([decompressed length] - strm.total_out); - - // Inflate another chunk. - status = inflate(&strm, Z_SYNC_FLUSH); - if (status == Z_STREAM_END) done = YES; - else if (status != Z_OK) break; - } - if (inflateEnd(&strm) != Z_OK) return nil; - - // Set real length. - if (done) { - [decompressed setLength:strm.total_out]; - return [NSData dataWithData:decompressed]; - } else return nil; -} - -- (NSData *)zlibDeflate { - if ([self length] == 0) return self; - - z_stream strm; - - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.total_out = 0; - strm.next_in = (Bytef *)[self bytes]; - strm.avail_in = (uInt)[self length]; - - // Compresssion Levels: - // Z_NO_COMPRESSION - // Z_BEST_SPEED - // Z_BEST_COMPRESSION - // Z_DEFAULT_COMPRESSION - - if (deflateInit(&strm, Z_DEFAULT_COMPRESSION) != Z_OK) return nil; - - // 16K chuncks for expansion - NSMutableData *compressed = [NSMutableData dataWithLength:16384]; - - do { - if (strm.total_out >= [compressed length]) - [compressed increaseLengthBy:16384]; - - strm.next_out = [compressed mutableBytes] + strm.total_out; - strm.avail_out = (uInt)([compressed length] - strm.total_out); - - deflate(&strm, Z_FINISH); - } - while (strm.avail_out == 0); - - deflateEnd(&strm); - - [compressed setLength:strm.total_out]; - return [NSData dataWithData:compressed]; -} - -+ (NSData *)dataNamed:(NSString *)name { - NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@""]; - if (!path) return nil; - NSData *data = [NSData dataWithContentsOfFile:path]; - return data; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDate+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDate+YYAdd.h deleted file mode 100644 index d281902c..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDate+YYAdd.h +++ /dev/null @@ -1,188 +0,0 @@ -// -// NSDate+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `NSDate`. - */ -@interface NSDate (YYAdd) - -#pragma mark - Component Properties -///============================================================================= -/// @name Component Properties -///============================================================================= - -@property (nonatomic, readonly) NSInteger year; ///< Year component -@property (nonatomic, readonly) NSInteger month; ///< Month component (1~12) -@property (nonatomic, readonly) NSInteger day; ///< Day component (1~31) -@property (nonatomic, readonly) NSInteger hour; ///< Hour component (0~23) -@property (nonatomic, readonly) NSInteger minute; ///< Minute component (0~59) -@property (nonatomic, readonly) NSInteger second; ///< Second component (0~59) -@property (nonatomic, readonly) NSInteger nanosecond; ///< Nanosecond component -@property (nonatomic, readonly) NSInteger weekday; ///< Weekday component (1~7, first day is based on user setting) -@property (nonatomic, readonly) NSInteger weekdayOrdinal; ///< WeekdayOrdinal component -@property (nonatomic, readonly) NSInteger weekOfMonth; ///< WeekOfMonth component (1~5) -@property (nonatomic, readonly) NSInteger weekOfYear; ///< WeekOfYear component (1~53) -@property (nonatomic, readonly) NSInteger yearForWeekOfYear; ///< YearForWeekOfYear component -@property (nonatomic, readonly) NSInteger quarter; ///< Quarter component -@property (nonatomic, readonly) BOOL isLeapMonth; ///< Weather the month is leap month -@property (nonatomic, readonly) BOOL isLeapYear; ///< Weather the year is leap year -@property (nonatomic, readonly) BOOL isToday; ///< Weather date is today (based on current locale) -@property (nonatomic, readonly) BOOL isYesterday; ///< Weather date is yesterday (based on current locale) - -#pragma mark - Date modify -///============================================================================= -/// @name Date modify -///============================================================================= - -/** - Returns a date representing the receiver date shifted later by the provided number of years. - - @param years Number of years to add. - @return Date modified by the number of desired years. - */ -- (nullable NSDate *)dateByAddingYears:(NSInteger)years; - -/** - Returns a date representing the receiver date shifted later by the provided number of months. - - @param months Number of months to add. - @return Date modified by the number of desired months. - */ -- (nullable NSDate *)dateByAddingMonths:(NSInteger)months; - -/** - Returns a date representing the receiver date shifted later by the provided number of weeks. - - @param weeks Number of weeks to add. - @return Date modified by the number of desired weeks. - */ -- (nullable NSDate *)dateByAddingWeeks:(NSInteger)weeks; - -/** - Returns a date representing the receiver date shifted later by the provided number of days. - - @param days Number of days to add. - @return Date modified by the number of desired days. - */ -- (nullable NSDate *)dateByAddingDays:(NSInteger)days; - -/** - Returns a date representing the receiver date shifted later by the provided number of hours. - - @param hours Number of hours to add. - @return Date modified by the number of desired hours. - */ -- (nullable NSDate *)dateByAddingHours:(NSInteger)hours; - -/** - Returns a date representing the receiver date shifted later by the provided number of minutes. - - @param minutes Number of minutes to add. - @return Date modified by the number of desired minutes. - */ -- (nullable NSDate *)dateByAddingMinutes:(NSInteger)minutes; - -/** - Returns a date representing the receiver date shifted later by the provided number of seconds. - - @param seconds Number of seconds to add. - @return Date modified by the number of desired seconds. - */ -- (nullable NSDate *)dateByAddingSeconds:(NSInteger)seconds; - - -#pragma mark - Date Format -///============================================================================= -/// @name Date Format -///============================================================================= - -/** - Returns a formatted string representing this date. - see http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns - for format description. - - @param format String representing the desired date format. - e.g. @"yyyy-MM-dd HH:mm:ss" - - @return NSString representing the formatted date string. - */ -- (nullable NSString *)stringWithFormat:(NSString *)format; - -/** - Returns a formatted string representing this date. - see http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns - for format description. - - @param format String representing the desired date format. - e.g. @"yyyy-MM-dd HH:mm:ss" - - @param timeZone Desired time zone. - - @param locale Desired locale. - - @return NSString representing the formatted date string. - */ -- (nullable NSString *)stringWithFormat:(NSString *)format - timeZone:(nullable NSTimeZone *)timeZone - locale:(nullable NSLocale *)locale; - -/** - Returns a string representing this date in ISO8601 format. - e.g. "2010-07-09T16:13:30+12:00" - - @return NSString representing the formatted date string in ISO8601. - */ -- (nullable NSString *)stringWithISOFormat; - -/** - Returns a date parsed from given string interpreted using the format. - - @param dateString The string to parse. - @param format The string's date format. - - @return A date representation of string interpreted using the format. - If can not parse the string, returns nil. - */ -+ (nullable NSDate *)dateWithString:(NSString *)dateString format:(NSString *)format; - -/** - Returns a date parsed from given string interpreted using the format. - - @param dateString The string to parse. - @param format The string's date format. - @param timeZone The time zone, can be nil. - @param locale The locale, can be nil. - - @return A date representation of string interpreted using the format. - If can not parse the string, returns nil. - */ -+ (nullable NSDate *)dateWithString:(NSString *)dateString - format:(NSString *)format - timeZone:(nullable NSTimeZone *)timeZone - locale:(nullable NSLocale *)locale; - -/** - Returns a date parsed from given string interpreted using the ISO8601 format. - - @param dateString The date string in ISO8601 format. e.g. "2010-07-09T16:13:30+12:00" - - @return A date representation of string interpreted using the format. - If can not parse the string, returns nil. - */ -+ (nullable NSDate *)dateWithISOFormatString:(NSString *)dateString; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDate+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDate+YYAdd.m deleted file mode 100644 index 9e27a5d0..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDate+YYAdd.m +++ /dev/null @@ -1,188 +0,0 @@ -// -// NSDate+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSDate+YYAdd.h" -#import "YYCategoriesMacro.h" -#import - -YYSYNTH_DUMMY_CLASS(NSDate_YYAdd) - - -@implementation NSDate (YYAdd) - -- (NSInteger)year { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitYear fromDate:self] year]; -} - -- (NSInteger)month { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitMonth fromDate:self] month]; -} - -- (NSInteger)day { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitDay fromDate:self] day]; -} - -- (NSInteger)hour { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitHour fromDate:self] hour]; -} - -- (NSInteger)minute { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitMinute fromDate:self] minute]; -} - -- (NSInteger)second { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitSecond fromDate:self] second]; -} - -- (NSInteger)nanosecond { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitSecond fromDate:self] nanosecond]; -} - -- (NSInteger)weekday { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitWeekday fromDate:self] weekday]; -} - -- (NSInteger)weekdayOrdinal { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitWeekdayOrdinal fromDate:self] weekdayOrdinal]; -} - -- (NSInteger)weekOfMonth { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitWeekOfMonth fromDate:self] weekOfMonth]; -} - -- (NSInteger)weekOfYear { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitWeekOfYear fromDate:self] weekOfYear]; -} - -- (NSInteger)yearForWeekOfYear { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitYearForWeekOfYear fromDate:self] yearForWeekOfYear]; -} - -- (NSInteger)quarter { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitQuarter fromDate:self] quarter]; -} - -- (BOOL)isLeapMonth { - return [[[NSCalendar currentCalendar] components:NSCalendarUnitQuarter fromDate:self] isLeapMonth]; -} - -- (BOOL)isLeapYear { - NSUInteger year = self.year; - return ((year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0))); -} - -- (BOOL)isToday { - if (fabs(self.timeIntervalSinceNow) >= 60 * 60 * 24) return NO; - return [NSDate new].day == self.day; -} - -- (BOOL)isYesterday { - NSDate *added = [self dateByAddingDays:1]; - return [added isToday]; -} - -- (NSDate *)dateByAddingYears:(NSInteger)years { - NSCalendar *calendar = [NSCalendar currentCalendar]; - NSDateComponents *components = [[NSDateComponents alloc] init]; - [components setYear:years]; - return [calendar dateByAddingComponents:components toDate:self options:0]; -} - -- (NSDate *)dateByAddingMonths:(NSInteger)months { - NSCalendar *calendar = [NSCalendar currentCalendar]; - NSDateComponents *components = [[NSDateComponents alloc] init]; - [components setMonth:months]; - return [calendar dateByAddingComponents:components toDate:self options:0]; -} - -- (NSDate *)dateByAddingWeeks:(NSInteger)weeks { - NSCalendar *calendar = [NSCalendar currentCalendar]; - NSDateComponents *components = [[NSDateComponents alloc] init]; - [components setWeekOfYear:weeks]; - return [calendar dateByAddingComponents:components toDate:self options:0]; -} - -- (NSDate *)dateByAddingDays:(NSInteger)days { - NSTimeInterval aTimeInterval = [self timeIntervalSinceReferenceDate] + 86400 * days; - NSDate *newDate = [NSDate dateWithTimeIntervalSinceReferenceDate:aTimeInterval]; - return newDate; -} - -- (NSDate *)dateByAddingHours:(NSInteger)hours { - NSTimeInterval aTimeInterval = [self timeIntervalSinceReferenceDate] + 3600 * hours; - NSDate *newDate = [NSDate dateWithTimeIntervalSinceReferenceDate:aTimeInterval]; - return newDate; -} - -- (NSDate *)dateByAddingMinutes:(NSInteger)minutes { - NSTimeInterval aTimeInterval = [self timeIntervalSinceReferenceDate] + 60 * minutes; - NSDate *newDate = [NSDate dateWithTimeIntervalSinceReferenceDate:aTimeInterval]; - return newDate; -} - -- (NSDate *)dateByAddingSeconds:(NSInteger)seconds { - NSTimeInterval aTimeInterval = [self timeIntervalSinceReferenceDate] + seconds; - NSDate *newDate = [NSDate dateWithTimeIntervalSinceReferenceDate:aTimeInterval]; - return newDate; -} - -- (NSString *)stringWithFormat:(NSString *)format { - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setDateFormat:format]; - [formatter setLocale:[NSLocale currentLocale]]; - return [formatter stringFromDate:self]; -} - -- (NSString *)stringWithFormat:(NSString *)format timeZone:(NSTimeZone *)timeZone locale:(NSLocale *)locale { - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setDateFormat:format]; - if (timeZone) [formatter setTimeZone:timeZone]; - if (locale) [formatter setLocale:locale]; - return [formatter stringFromDate:self]; -} - -- (NSString *)stringWithISOFormat { - static NSDateFormatter *formatter = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - formatter = [[NSDateFormatter alloc] init]; - formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]; - formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ssZ"; - }); - return [formatter stringFromDate:self]; -} - -+ (NSDate *)dateWithString:(NSString *)dateString format:(NSString *)format { - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setDateFormat:format]; - return [formatter dateFromString:dateString]; -} - -+ (NSDate *)dateWithString:(NSString *)dateString format:(NSString *)format timeZone:(NSTimeZone *)timeZone locale:(NSLocale *)locale { - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setDateFormat:format]; - if (timeZone) [formatter setTimeZone:timeZone]; - if (locale) [formatter setLocale:locale]; - return [formatter dateFromString:dateString]; -} - -+ (NSDate *)dateWithISOFormatString:(NSString *)dateString { - static NSDateFormatter *formatter = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - formatter = [[NSDateFormatter alloc] init]; - formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]; - formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ssZ"; - }); - return [formatter dateFromString:dateString]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDictionary+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDictionary+YYAdd.h deleted file mode 100644 index 99f0cdad..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDictionary+YYAdd.h +++ /dev/null @@ -1,197 +0,0 @@ -// -// NSDictionary+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provide some some common method for `NSDictionary`. - */ -@interface NSDictionary (YYAdd) - -#pragma mark - Dictionary Convertor -///============================================================================= -/// @name Dictionary Convertor -///============================================================================= - -/** - Creates and returns a dictionary from a specified property list data. - - @param plist A property list data whose root object is a dictionary. - @return A new dictionary created from the plist data, or nil if an error occurs. - */ -+ (nullable NSDictionary *)dictionaryWithPlistData:(NSData *)plist; - -/** - Creates and returns a dictionary from a specified property list xml string. - - @param plist A property list xml string whose root object is a dictionary. - @return A new dictionary created from the plist string, or nil if an error occurs. - - @discussion Apple has implemented this method, but did not make it public. - */ -+ (nullable NSDictionary *)dictionaryWithPlistString:(NSString *)plist; - -/** - Serialize the dictionary to a binary property list data. - - @return A bplist data, or nil if an error occurs. - - @discussion Apple has implemented this method, but did not make it public. - */ -- (nullable NSData *)plistData; - -/** - Serialize the dictionary to a xml property list string. - - @return A plist xml string, or nil if an error occurs. - */ -- (nullable NSString *)plistString; - -/** - Returns a new array containing the dictionary's keys sorted. - The keys should be NSString, and they will be sorted ascending. - - @return A new array containing the dictionary's keys, - or an empty array if the dictionary has no entries. - */ -- (NSArray *)allKeysSorted; - -/** - Returns a new array containing the dictionary's values sorted by keys. - - The order of the values in the array is defined by keys. - The keys should be NSString, and they will be sorted ascending. - - @return A new array containing the dictionary's values sorted by keys, - or an empty array if the dictionary has no entries. - */ -- (NSArray *)allValuesSortedByKeys; - -/** - Returns a BOOL value tells if the dictionary has an object for key. - - @param key The key. - */ -- (BOOL)containsObjectForKey:(id)key; - -/** - Returns a new dictionary containing the entries for keys. - If the keys is empty or nil, it just returns an empty dictionary. - - @param keys The keys. - @return The entries for the keys. - */ -- (NSDictionary *)entriesForKeys:(NSArray *)keys; - -/** - Convert dictionary to json string. return nil if an error occurs. - */ -- (nullable NSString *)jsonStringEncoded; - -/** - Convert dictionary to json string formatted. return nil if an error occurs. - */ -- (nullable NSString *)jsonPrettyStringEncoded; - -/** - Try to parse an XML and wrap it into a dictionary. - If you just want to get some value from a small xml, try this. - - example XML: "link" - example Return: @{@"_name":@"config", @"a":{@"_text":@"link",@"href":@"test.com"}} - - @param xmlDataOrString XML in NSData or NSString format. - @return Return a new dictionary, or nil if an error occurs. - */ -+ (nullable NSDictionary *)dictionaryWithXML:(id)xmlDataOrString; - -#pragma mark - Dictionary Value Getter -///============================================================================= -/// @name Dictionary Value Getter -///============================================================================= - -- (BOOL)boolValueForKey:(NSString *)key default:(BOOL)def; - -- (char)charValueForKey:(NSString *)key default:(char)def; -- (unsigned char)unsignedCharValueForKey:(NSString *)key default:(unsigned char)def; - -- (short)shortValueForKey:(NSString *)key default:(short)def; -- (unsigned short)unsignedShortValueForKey:(NSString *)key default:(unsigned short)def; - -- (int)intValueForKey:(NSString *)key default:(int)def; -- (unsigned int)unsignedIntValueForKey:(NSString *)key default:(unsigned int)def; - -- (long)longValueForKey:(NSString *)key default:(long)def; -- (unsigned long)unsignedLongValueForKey:(NSString *)key default:(unsigned long)def; - -- (long long)longLongValueForKey:(NSString *)key default:(long long)def; -- (unsigned long long)unsignedLongLongValueForKey:(NSString *)key default:(unsigned long long)def; - -- (float)floatValueForKey:(NSString *)key default:(float)def; -- (double)doubleValueForKey:(NSString *)key default:(double)def; - -- (NSInteger)integerValueForKey:(NSString *)key default:(NSInteger)def; -- (NSUInteger)unsignedIntegerValueForKey:(NSString *)key default:(NSUInteger)def; - -- (nullable NSNumber *)numberValueForKey:(NSString *)key default:(nullable NSNumber *)def; -- (nullable NSString *)stringValueForKey:(NSString *)key default:(nullable NSString *)def; - -@end - - - -/** - Provide some some common method for `NSMutableDictionary`. - */ -@interface NSMutableDictionary (YYAdd) - -/** - Creates and returns a dictionary from a specified property list data. - - @param plist A property list data whose root object is a dictionary. - @return A new dictionary created from the plist data, or nil if an error occurs. - - @discussion Apple has implemented this method, but did not make it public. - */ -+ (nullable NSMutableDictionary *)dictionaryWithPlistData:(NSData *)plist; - -/** - Creates and returns a dictionary from a specified property list xml string. - - @param plist A property list xml string whose root object is a dictionary. - @return A new dictionary created from the plist string, or nil if an error occurs. - */ -+ (nullable NSMutableDictionary *)dictionaryWithPlistString:(NSString *)plist; - - -/** - Removes and returns the value associated with a given key. - - @param aKey The key for which to return and remove the corresponding value. - @return The value associated with aKey, or nil if no value is associated with aKey. - */ -- (nullable id)popObjectForKey:(id)aKey; - -/** - Returns a new dictionary containing the entries for keys, and remove these - entries from reciever. If the keys is empty or nil, it just returns an - empty dictionary. - - @param keys The keys. - @return The entries for the keys. - */ -- (NSDictionary *)popEntriesForKeys:(NSArray *)keys; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDictionary+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDictionary+YYAdd.m deleted file mode 100644 index 54a48733..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSDictionary+YYAdd.m +++ /dev/null @@ -1,391 +0,0 @@ -// -// NSDictionary+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSDictionary+YYAdd.h" -#import "NSString+YYAdd.h" -#import "NSData+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(NSDictionary_YYAdd) - - -@interface _YYXMLDictionaryParser : NSObject -@end - -@implementation _YYXMLDictionaryParser { - NSMutableDictionary *_root; - NSMutableArray *_stack; - NSMutableString *_text; -} - -- (instancetype)initWithData:(NSData *)data { - self = super.init; - NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; - [parser setDelegate:self]; - [parser parse]; - return self; -} - -- (instancetype)initWithString:(NSString *)xml { - NSData *data = [xml dataUsingEncoding:NSUTF8StringEncoding]; - return [self initWithData:data]; -} - -- (NSDictionary *)result { - return _root; -} - -#pragma mark NSXMLParserDelegate - -#define XMLText @"_text" -#define XMLName @"_name" -#define XMLPref @"_" - -- (void)textEnd { - _text = _text.stringByTrim.mutableCopy; - if (_text.length) { - NSMutableDictionary *top = _stack.lastObject; - id existing = top[XMLText]; - if ([existing isKindOfClass:[NSArray class]]) { - [existing addObject:_text]; - } else if (existing) { - top[XMLText] = [@[existing, _text] mutableCopy]; - } else { - top[XMLText] = _text; - } - } - _text = nil; -} - -- (void)parser:(__unused NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(__unused NSString *)namespaceURI qualifiedName:(__unused NSString *)qName attributes:(NSDictionary *)attributeDict { - [self textEnd]; - - NSMutableDictionary *node = [NSMutableDictionary new]; - if (!_root) node[XMLName] = elementName; - if (attributeDict.count) [node addEntriesFromDictionary:attributeDict]; - - if (_root) { - NSMutableDictionary *top = _stack.lastObject; - id existing = top[elementName]; - if ([existing isKindOfClass:[NSArray class]]) { - [existing addObject:node]; - } else if (existing) { - top[elementName] = [@[existing, node] mutableCopy]; - } else { - top[elementName] = node; - } - [_stack addObject:node]; - } else { - _root = node; - _stack = [NSMutableArray arrayWithObject:node]; - } -} - -- (void)parser:(__unused NSXMLParser *)parser didEndElement:(__unused NSString *)elementName namespaceURI:(__unused NSString *)namespaceURI qualifiedName:(__unused NSString *)qName { - [self textEnd]; - - NSMutableDictionary *top = _stack.lastObject; - [_stack removeLastObject]; - - NSMutableDictionary *left = top.mutableCopy; - [left removeObjectsForKeys:@[XMLText, XMLName]]; - for (NSString *key in left.allKeys) { - [left removeObjectForKey:key]; - if ([key hasPrefix:XMLPref]) { - left[[key substringFromIndex:XMLPref.length]] = top[key]; - } - } - if (left.count) return; - - NSMutableDictionary *children = top.mutableCopy; - [children removeObjectsForKeys:@[XMLText, XMLName]]; - for (NSString *key in children.allKeys) { - if ([key hasPrefix:XMLPref]) { - [children removeObjectForKey:key]; - } - } - if (children.count) return; - - NSMutableDictionary *topNew = _stack.lastObject; - NSString *nodeName = top[XMLName]; - if (!nodeName) { - for (NSString *name in topNew) { - id object = topNew[name]; - if (object == top) { - nodeName = name; break; - } else if ([object isKindOfClass:[NSArray class]] && [object containsObject:top]) { - nodeName = name; break; - } - } - } - if (!nodeName) return; - - id inner = top[XMLText]; - if ([inner isKindOfClass:[NSArray class]]) { - inner = [inner componentsJoinedByString:@"\n"]; - } - if (!inner) return; - - id parent = topNew[nodeName]; - if ([parent isKindOfClass:[NSArray class]]) { - parent[[parent count] - 1] = inner; - } else { - topNew[nodeName] = inner; - } -} - -- (void)parser:(__unused NSXMLParser *)parser foundCharacters:(NSString *)string { - if (_text) [_text appendString:string]; - else _text = [NSMutableString stringWithString:string]; -} - -- (void)parser:(__unused NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { - NSString *string = [[NSString alloc] initWithData:CDATABlock encoding:NSUTF8StringEncoding]; - if (_text) [_text appendString:string]; - else _text = [NSMutableString stringWithString:string]; -} - -#undef XMLText -#undef XMLName -#undef XMLPref -@end - - -@implementation NSDictionary (YYAdd) - -+ (NSDictionary *)dictionaryWithPlistData:(NSData *)plist { - if (!plist) return nil; - NSDictionary *dictionary = [NSPropertyListSerialization propertyListWithData:plist options:NSPropertyListImmutable format:NULL error:NULL]; - if ([dictionary isKindOfClass:[NSDictionary class]]) return dictionary; - return nil; -} - -+ (NSDictionary *)dictionaryWithPlistString:(NSString *)plist { - if (!plist) return nil; - NSData* data = [plist dataUsingEncoding:NSUTF8StringEncoding]; - return [self dictionaryWithPlistData:data]; -} - -- (NSData *)plistData { - return [NSPropertyListSerialization dataWithPropertyList:self format:NSPropertyListBinaryFormat_v1_0 options:kNilOptions error:NULL]; -} - -- (NSString *)plistString { - NSData *xmlData = [NSPropertyListSerialization dataWithPropertyList:self format:NSPropertyListXMLFormat_v1_0 options:kNilOptions error:NULL]; - if (xmlData) return xmlData.utf8String; - return nil; -} - -- (NSArray *)allKeysSorted { - return [[self allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; -} - -- (NSArray *)allValuesSortedByKeys { - NSArray *sortedKeys = [self allKeysSorted]; - NSMutableArray *arr = [[NSMutableArray alloc] init]; - for (id key in sortedKeys) { - [arr addObject:self[key]]; - } - return arr; -} - -- (BOOL)containsObjectForKey:(id)key { - if (!key) return NO; - return self[key] != nil; -} - -- (NSDictionary *)entriesForKeys:(NSArray *)keys { - NSMutableDictionary *dic = [NSMutableDictionary new]; - for (id key in keys) { - id value = self[key]; - if (value) dic[key] = value; - } - return dic; -} - -- (NSString *)jsonStringEncoded { - if ([NSJSONSerialization isValidJSONObject:self]) { - NSError *error; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:0 error:&error]; - NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - return json; - } - return nil; -} - -- (NSString *)jsonPrettyStringEncoded { - if ([NSJSONSerialization isValidJSONObject:self]) { - NSError *error; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:&error]; - NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - return json; - } - return nil; -} - -+ (NSDictionary *)dictionaryWithXML:(id)xml { - _YYXMLDictionaryParser *parser = nil; - if ([xml isKindOfClass:[NSString class]]) { - parser = [[_YYXMLDictionaryParser alloc] initWithString:xml]; - } else if ([xml isKindOfClass:[NSData class]]) { - parser = [[_YYXMLDictionaryParser alloc] initWithData:xml]; - } - return [parser result]; -} - - -/// Get a number value from 'id'. -static NSNumber *NSNumberFromID(id value) { - static NSCharacterSet *dot; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - dot = [NSCharacterSet characterSetWithRange:NSMakeRange('.', 1)]; - }); - if (!value || value == [NSNull null]) return nil; - if ([value isKindOfClass:[NSNumber class]]) return value; - if ([value isKindOfClass:[NSString class]]) { - NSString *lower = ((NSString *)value).lowercaseString; - if ([lower isEqualToString:@"true"] || [lower isEqualToString:@"yes"]) return @(YES); - if ([lower isEqualToString:@"false"] || [lower isEqualToString:@"no"]) return @(NO); - if ([lower isEqualToString:@"nil"] || [lower isEqualToString:@"null"]) return nil; - if ([(NSString *)value rangeOfCharacterFromSet:dot].location != NSNotFound) { - return @(((NSString *)value).doubleValue); - } else { - return @(((NSString *)value).longLongValue); - } - } - return nil; -} - -#define RETURN_VALUE(_type_) \ -if (!key) return def; \ -id value = self[key]; \ -if (!value || value == [NSNull null]) return def; \ -if ([value isKindOfClass:[NSNumber class]]) return ((NSNumber *)value)._type_; \ -if ([value isKindOfClass:[NSString class]]) return NSNumberFromID(value)._type_; \ -return def; - -- (BOOL)boolValueForKey:(NSString *)key default:(BOOL)def { - RETURN_VALUE(boolValue); -} - -- (char)charValueForKey:(NSString *)key default:(char)def { - RETURN_VALUE(charValue); -} - -- (unsigned char)unsignedCharValueForKey:(NSString *)key default:(unsigned char)def { - RETURN_VALUE(unsignedCharValue); -} - -- (short)shortValueForKey:(NSString *)key default:(short)def { - RETURN_VALUE(shortValue); -} - -- (unsigned short)unsignedShortValueForKey:(NSString *)key default:(unsigned short)def { - RETURN_VALUE(unsignedShortValue); -} - -- (int)intValueForKey:(NSString *)key default:(int)def { - RETURN_VALUE(intValue); -} - -- (unsigned int)unsignedIntValueForKey:(NSString *)key default:(unsigned int)def { - RETURN_VALUE(unsignedIntValue); -} - -- (long)longValueForKey:(NSString *)key default:(long)def { - RETURN_VALUE(longValue); -} - -- (unsigned long)unsignedLongValueForKey:(NSString *)key default:(unsigned long)def { - RETURN_VALUE(unsignedLongValue); -} - -- (long long)longLongValueForKey:(NSString *)key default:(long long)def { - RETURN_VALUE(longLongValue); -} - -- (unsigned long long)unsignedLongLongValueForKey:(NSString *)key default:(unsigned long long)def { - RETURN_VALUE(unsignedLongLongValue); -} - -- (float)floatValueForKey:(NSString *)key default:(float)def { - RETURN_VALUE(floatValue); -} - -- (double)doubleValueForKey:(NSString *)key default:(double)def { - RETURN_VALUE(doubleValue); -} - -- (NSInteger)integerValueForKey:(NSString *)key default:(NSInteger)def { - RETURN_VALUE(integerValue); -} - -- (NSUInteger)unsignedIntegerValueForKey:(NSString *)key default:(NSUInteger)def { - RETURN_VALUE(unsignedIntegerValue); -} - -- (NSNumber *)numberValueForKey:(NSString *)key default:(NSNumber *)def { - if (!key) return def; - id value = self[key]; - if (!value || value == [NSNull null]) return def; - if ([value isKindOfClass:[NSNumber class]]) return value; - if ([value isKindOfClass:[NSString class]]) return NSNumberFromID(value); - return def; -} - -- (NSString *)stringValueForKey:(NSString *)key default:(NSString *)def { - if (!key) return def; - id value = self[key]; - if (!value || value == [NSNull null]) return def; - if ([value isKindOfClass:[NSString class]]) return value; - if ([value isKindOfClass:[NSNumber class]]) return ((NSNumber *)value).description; - return def; -} - -@end - - -@implementation NSMutableDictionary (YYAdd) - -+ (NSMutableDictionary *)dictionaryWithPlistData:(NSData *)plist { - if (!plist) return nil; - NSMutableDictionary *dictionary = [NSPropertyListSerialization propertyListWithData:plist options:NSPropertyListMutableContainersAndLeaves format:NULL error:NULL]; - if ([dictionary isKindOfClass:[NSMutableDictionary class]]) return dictionary; - return nil; -} - -+ (NSMutableDictionary *)dictionaryWithPlistString:(NSString *)plist { - if (!plist) return nil; - NSData* data = [plist dataUsingEncoding:NSUTF8StringEncoding]; - return [self dictionaryWithPlistData:data]; -} - -- (id)popObjectForKey:(id)aKey { - if (!aKey) return nil; - id value = self[aKey]; - [self removeObjectForKey:aKey]; - return value; -} - -- (NSDictionary *)popEntriesForKeys:(NSArray *)keys { - NSMutableDictionary *dic = [NSMutableDictionary new]; - for (id key in keys) { - id value = self[key]; - if (value) { - [self removeObjectForKey:key]; - dic[key] = value; - } - } - return dic; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSKeyedUnarchiver+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSKeyedUnarchiver+YYAdd.h deleted file mode 100644 index c8384db8..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSKeyedUnarchiver+YYAdd.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// NSKeyedUnarchiver+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/8/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `NSKeyedUnarchiver`. - */ -@interface NSKeyedUnarchiver (YYAdd) - -/** - Same as unarchiveObjectWithData:, except it returns the exception by reference. - - @param data The data need unarchived. - - @param exception Pointer which will, upon return, if an exception occurred and - said pointer is not NULL, point to said NSException. - */ -+ (nullable id)unarchiveObjectWithData:(NSData *)data - exception:(NSException *_Nullable *_Nullable)exception; - -/** - Same as unarchiveObjectWithFile:, except it returns the exception by reference. - - @param path The path of archived object file. - - @param exception Pointer which will, upon return, if an exception occurred and - said pointer is not NULL, point to said NSException. - */ -+ (nullable id)unarchiveObjectWithFile:(NSString *)path - exception:(NSException *_Nullable *_Nullable)exception; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSKeyedUnarchiver+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSKeyedUnarchiver+YYAdd.m deleted file mode 100644 index 8cba716f..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSKeyedUnarchiver+YYAdd.m +++ /dev/null @@ -1,51 +0,0 @@ -// -// NSKeyedUnarchiver+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/8/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSKeyedUnarchiver+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(NSKeyedUnarchiver_YYAdd) - - -@implementation NSKeyedUnarchiver (YYAdd) - -+ (id)unarchiveObjectWithData:(NSData *)data exception:(__autoreleasing NSException **)exception { - id object = nil; - @try { - object = [NSKeyedUnarchiver unarchiveObjectWithData:data]; - } - @catch (NSException *e) - { - if (exception) *exception = e; - } - @finally - { - } - return object; -} - -+ (id)unarchiveObjectWithFile:(NSString *)path exception:(__autoreleasing NSException **)exception { - id object = nil; - - @try { - object = [NSKeyedUnarchiver unarchiveObjectWithFile:path]; - } - @catch (NSException *e) - { - if (exception) *exception = e; - } - @finally - { - } - return object; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNotificationCenter+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNotificationCenter+YYAdd.h deleted file mode 100644 index 101571e8..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNotificationCenter+YYAdd.h +++ /dev/null @@ -1,97 +0,0 @@ -// -// NSNotificationCenter+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/8/24. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provide some method for `NSNotificationCenter` - to post notification in different thread. - */ -@interface NSNotificationCenter (YYAdd) - -/** - Posts a given notification to the receiver on main thread. - If current thread is main thread, the notification is posted synchronized; - otherwise, is posted asynchronized. - - @param notification The notification to post. - An exception is raised if notification is nil. - */ -- (void)postNotificationOnMainThread:(NSNotification *)notification; - -/** - Posts a given notification to the receiver on main thread. - - @param notification The notification to post. - An exception is raised if notification is nil. - - @param wait A Boolean that specifies whether the current thread blocks - until after the specified notification is posted on the - receiver on the main thread. Specify YES to block this - thread; otherwise, specify NO to have this method return - immediately. - */ -- (void)postNotificationOnMainThread:(NSNotification *)notification - waitUntilDone:(BOOL)wait; - -/** - Creates a notification with a given name and sender and posts it to the - receiver on main thread. If current thread is main thread, the notification - is posted synchronized; otherwise, is posted asynchronized. - - @param name The name of the notification. - - @param object The object posting the notification. - */ -- (void)postNotificationOnMainThreadWithName:(NSString *)name - object:(nullable id)object; - -/** - Creates a notification with a given name and sender and posts it to the - receiver on main thread. If current thread is main thread, the notification - is posted synchronized; otherwise, is posted asynchronized. - - @param name The name of the notification. - - @param object The object posting the notification. - - @param userInfo Information about the the notification. May be nil. - */ -- (void)postNotificationOnMainThreadWithName:(NSString *)name - object:(nullable id)object - userInfo:(nullable NSDictionary *)userInfo; - -/** - Creates a notification with a given name and sender and posts it to the - receiver on main thread. - - @param name The name of the notification. - - @param object The object posting the notification. - - @param userInfo Information about the the notification. May be nil. - - @param wait A Boolean that specifies whether the current thread blocks - until after the specified notification is posted on the - receiver on the main thread. Specify YES to block this - thread; otherwise, specify NO to have this method return - immediately. - */ -- (void)postNotificationOnMainThreadWithName:(NSString *)name - object:(nullable id)object - userInfo:(nullable NSDictionary *)userInfo - waitUntilDone:(BOOL)wait; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNotificationCenter+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNotificationCenter+YYAdd.m deleted file mode 100644 index 5a35edc3..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNotificationCenter+YYAdd.m +++ /dev/null @@ -1,62 +0,0 @@ -// -// NSNotificationCenter+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/8/24. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSNotificationCenter+YYAdd.h" -#include -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(NSNotificationCenter_YYAdd) - - -@implementation NSNotificationCenter (YYAdd) - -- (void)postNotificationOnMainThread:(NSNotification *)notification { - if (pthread_main_np()) return [self postNotification:notification]; - [self postNotificationOnMainThread:notification waitUntilDone:NO]; -} - -- (void)postNotificationOnMainThread:(NSNotification *)notification waitUntilDone:(BOOL)wait { - if (pthread_main_np()) return [self postNotification:notification]; - [[self class] performSelectorOnMainThread:@selector(_yy_postNotification:) withObject:notification waitUntilDone:wait]; -} - -- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object { - if (pthread_main_np()) return [self postNotificationName:name object:object userInfo:nil]; - [self postNotificationOnMainThreadWithName:name object:object userInfo:nil waitUntilDone:NO]; -} - -- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo { - if (pthread_main_np()) return [self postNotificationName:name object:object userInfo:userInfo]; - [self postNotificationOnMainThreadWithName:name object:object userInfo:userInfo waitUntilDone:NO]; -} - -- (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo waitUntilDone:(BOOL)wait { - if (pthread_main_np()) return [self postNotificationName:name object:object userInfo:userInfo]; - NSMutableDictionary *info = [[NSMutableDictionary allocWithZone:nil] initWithCapacity:3]; - if (name) [info setObject:name forKey:@"name"]; - if (object) [info setObject:object forKey:@"object"]; - if (userInfo) [info setObject:userInfo forKey:@"userInfo"]; - [[self class] performSelectorOnMainThread:@selector(_yy_postNotificationName:) withObject:info waitUntilDone:wait]; -} - -+ (void)_yy_postNotification:(NSNotification *)notification { - [[self defaultCenter] postNotification:notification]; -} - -+ (void)_yy_postNotificationName:(NSDictionary *)info { - NSString *name = [info objectForKey:@"name"]; - id object = [info objectForKey:@"object"]; - NSDictionary *userInfo = [info objectForKey:@"userInfo"]; - - [[self defaultCenter] postNotificationName:name object:object userInfo:userInfo]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNumber+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNumber+YYAdd.h deleted file mode 100644 index 3c732865..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNumber+YYAdd.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// NSNumber+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/8/24. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provide a method to parse `NSString` for `NSNumber`. - */ -@interface NSNumber (YYAdd) - -/** - Creates and returns an NSNumber object from a string. - Valid format: @"12", @"12.345", @" -0xFF", @" .23e99 "... - - @param string The string described an number. - - @return an NSNumber when parse succeed, or nil if an error occurs. - */ -+ (nullable NSNumber *)numberWithString:(NSString *)string; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNumber+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNumber+YYAdd.m deleted file mode 100644 index e21fbd11..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSNumber+YYAdd.m +++ /dev/null @@ -1,63 +0,0 @@ -// -// NSNumber+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/8/24. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSNumber+YYAdd.h" -#import "NSString+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(NSNumber_YYAdd) - - -@implementation NSNumber (YYAdd) - -+ (NSNumber *)numberWithString:(NSString *)string { - NSString *str = [[string stringByTrim] lowercaseString]; - if (!str || !str.length) { - return nil; - } - - static NSDictionary *dic; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - dic = @{@"true" : @(YES), - @"yes" : @(YES), - @"false" : @(NO), - @"no" : @(NO), - @"nil" : [NSNull null], - @"null" : [NSNull null], - @"" : [NSNull null]}; - }); - NSNumber *num = dic[str]; - if (num) { - if (num == (id)[NSNull null]) return nil; - return num; - } - - // hex number - int sign = 0; - if ([str hasPrefix:@"0x"]) sign = 1; - else if ([str hasPrefix:@"-0x"]) sign = -1; - if (sign != 0) { - NSScanner *scan = [NSScanner scannerWithString:str]; - unsigned num = -1; - BOOL suc = [scan scanHexInt:&num]; - if (suc) - return [NSNumber numberWithLong:((long)num * sign)]; - else - return nil; - } - // normal number - NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - [formatter setNumberStyle:NSNumberFormatterDecimalStyle]; - return [formatter numberFromString:string]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAdd.h deleted file mode 100644 index 8f5c1696..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAdd.h +++ /dev/null @@ -1,302 +0,0 @@ -// -// NSObject+YYAdd.h -// YYCategories -// -// Created by ibireme on 14/10/8. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Common tasks for NSObject. - */ -@interface NSObject (YYAdd) - - -#pragma mark - Sending messages with variable parameters -///============================================================================= -/// @name Sending messages with variable parameters -///============================================================================= - -/** - Sends a specified message to the receiver and returns the result of the message. - - @param sel A selector identifying the message to send. If the selector is - NULL or unrecognized, an NSInvalidArgumentException is raised. - - @param ... Variable parameter list. Parameters type must correspond to the - selector's method declaration, or unexpected results may occur. - It doesn't support union or struct which is larger than 256 bytes. - - @return An object that is the result of the message. - - @discussion The selector's return value will be wrap as NSNumber or NSValue - if the selector's `return type` is not object. It always returns nil - if the selector's `return type` is void. - - Sample Code: - - // no variable args - [view performSelectorWithArgs:@selector(removeFromSuperView)]; - - // variable arg is not object - [view performSelectorWithArgs:@selector(setCenter:), CGPointMake(0, 0)]; - - // perform and return object - UIImage *image = [UIImage.class performSelectorWithArgs:@selector(imageWithData:scale:), data, 2.0]; - - // perform and return wrapped number - NSNumber *lengthValue = [@"hello" performSelectorWithArgs:@selector(length)]; - NSUInteger length = lengthValue.unsignedIntegerValue; - - // perform and return wrapped struct - NSValue *frameValue = [view performSelectorWithArgs:@selector(frame)]; - CGRect frame = frameValue.CGRectValue; - */ -- (nullable id)performSelectorWithArgs:(SEL)sel, ...; - -/** - Invokes a method of the receiver on the current thread using the default mode after a delay. - - @warning It can't cancelled by previous request. - - @param sel A selector identifying the message to send. If the selector is - NULL or unrecognized, an NSInvalidArgumentException is raised immediately. - - @param delay The minimum time before which the message is sent. Specifying - a delay of 0 does not necessarily cause the selector to be - performed immediately. The selector is still queued on the - thread's run loop and performed as soon as possible. - - @param ... Variable parameter list. Parameters type must correspond to the - selector's method declaration, or unexpected results may occur. - It doesn't support union or struct which is larger than 256 bytes. - - Sample Code: - - // no variable args - [view performSelectorWithArgs:@selector(removeFromSuperView) afterDelay:2.0]; - - // variable arg is not object - [view performSelectorWithArgs:@selector(setCenter:), afterDelay:0, CGPointMake(0, 0)]; - */ -- (void)performSelectorWithArgs:(SEL)sel afterDelay:(NSTimeInterval)delay, ...; - -/** - Invokes a method of the receiver on the main thread using the default mode. - - @param sel A selector identifying the message to send. If the selector is - NULL or unrecognized, an NSInvalidArgumentException is raised. - - @param wait A Boolean that specifies whether the current thread blocks until - after the specified selector is performed on the receiver on the - specified thread. Specify YES to block this thread; otherwise, - specify NO to have this method return immediately. - - @param ... Variable parameter list. Parameters type must correspond to the - selector's method declaration, or unexpected results may occur. - It doesn't support union or struct which is larger than 256 bytes. - - @return While @a wait is YES, it returns object that is the result of - the message. Otherwise return nil; - - @discussion The selector's return value will be wrap as NSNumber or NSValue - if the selector's `return type` is not object. It always returns nil - if the selector's `return type` is void, or @a wait is YES. - - Sample Code: - - // no variable args - [view performSelectorWithArgsOnMainThread:@selector(removeFromSuperView), waitUntilDone:NO]; - - // variable arg is not object - [view performSelectorWithArgsOnMainThread:@selector(setCenter:), waitUntilDone:NO, CGPointMake(0, 0)]; - */ -- (nullable id)performSelectorWithArgsOnMainThread:(SEL)sel waitUntilDone:(BOOL)wait, ...; - -/** - Invokes a method of the receiver on the specified thread using the default mode. - - @param sel A selector identifying the message to send. If the selector is - NULL or unrecognized, an NSInvalidArgumentException is raised. - - @param thread The thread on which to execute aSelector. - - @param wait A Boolean that specifies whether the current thread blocks until - after the specified selector is performed on the receiver on the - specified thread. Specify YES to block this thread; otherwise, - specify NO to have this method return immediately. - - @param ... Variable parameter list. Parameters type must correspond to the - selector's method declaration, or unexpected results may occur. - It doesn't support union or struct which is larger than 256 bytes. - - @return While @a wait is YES, it returns object that is the result of - the message. Otherwise return nil; - - @discussion The selector's return value will be wrap as NSNumber or NSValue - if the selector's `return type` is not object. It always returns nil - if the selector's `return type` is void, or @a wait is YES. - - Sample Code: - - [view performSelectorWithArgs:@selector(removeFromSuperView) onThread:mainThread waitUntilDone:NO]; - - [array performSelectorWithArgs:@selector(sortUsingComparator:) - onThread:backgroundThread - waitUntilDone:NO, ^NSComparisonResult(NSNumber *num1, NSNumber *num2) { - return [num2 compare:num2]; - }]; - */ -- (nullable id)performSelectorWithArgs:(SEL)sel onThread:(NSThread *)thread waitUntilDone:(BOOL)wait, ...; - -/** - Invokes a method of the receiver on a new background thread. - - @param sel A selector identifying the message to send. If the selector is - NULL or unrecognized, an NSInvalidArgumentException is raised. - - @param ... Variable parameter list. Parameters type must correspond to the - selector's method declaration, or unexpected results may occur. - It doesn't support union or struct which is larger than 256 bytes. - - @discussion This method creates a new thread in your application, putting - your application into multithreaded mode if it was not already. - The method represented by sel must set up the thread environment - just as you would for any other new thread in your program. - - Sample Code: - - [array performSelectorWithArgsInBackground:@selector(sortUsingComparator:), - ^NSComparisonResult(NSNumber *num1, NSNumber *num2) { - return [num2 compare:num2]; - }]; - */ -- (void)performSelectorWithArgsInBackground:(SEL)sel, ...; - -/** - Invokes a method of the receiver on the current thread after a delay. - - @warning arc-performSelector-leaks - - @param sel A selector that identifies the method to invoke. The method should - not have a significant return value and should take no argument. - If the selector is NULL or unrecognized, - an NSInvalidArgumentException is raised after the delay. - - @param delay The minimum time before which the message is sent. Specifying a - delay of 0 does not necessarily cause the selector to be performed - immediately. The selector is still queued on the thread's run loop - and performed as soon as possible. - - @discussion This method sets up a timer to perform the aSelector message on - the current thread's run loop. The timer is configured to run in - the default mode (NSDefaultRunLoopMode). When the timer fires, the - thread attempts to dequeue the message from the run loop and - perform the selector. It succeeds if the run loop is running and - in the default mode; otherwise, the timer waits until the run loop - is in the default mode. - */ -- (void)performSelector:(SEL)sel afterDelay:(NSTimeInterval)delay; - - -#pragma mark - Swap method (Swizzling) -///============================================================================= -/// @name Swap method (Swizzling) -///============================================================================= - -/** - Swap two instance method's implementation in one class. Dangerous, be careful. - - @param originalSel Selector 1. - @param newSel Selector 2. - @return YES if swizzling succeed; otherwise, NO. - */ -+ (BOOL)swizzleInstanceMethod:(SEL)originalSel with:(SEL)newSel; - -/** - Swap two class method's implementation in one class. Dangerous, be careful. - - @param originalSel Selector 1. - @param newSel Selector 2. - @return YES if swizzling succeed; otherwise, NO. - */ -+ (BOOL)swizzleClassMethod:(SEL)originalSel with:(SEL)newSel; - - -#pragma mark - Associate value -///============================================================================= -/// @name Associate value -///============================================================================= - -/** - Associate one object to `self`, as if it was a strong property (strong, nonatomic). - - @param value The object to associate. - @param key The pointer to get value from `self`. - */ -- (void)setAssociateValue:(nullable id)value withKey:(void *)key; - -/** - Associate one object to `self`, as if it was a weak property (week, nonatomic). - - @param value The object to associate. - @param key The pointer to get value from `self`. - */ -- (void)setAssociateWeakValue:(nullable id)value withKey:(void *)key; - -/** - Get the associated value from `self`. - - @param key The pointer to get value from `self`. - */ -- (nullable id)getAssociatedValueForKey:(void *)key; - -/** - Remove all associated values. - */ -- (void)removeAssociatedValues; - - -#pragma mark - Others -///============================================================================= -/// @name Others -///============================================================================= - -/** - Returns the class name in NSString. - */ -+ (NSString *)className; - -/** - Returns the class name in NSString. - - @discussion Apple has implemented this method in NSObject(NSLayoutConstraintCallsThis), - but did not make it public. - */ -- (NSString *)className; - -/** - Returns a copy of the instance with `NSKeyedArchiver` and ``NSKeyedUnarchiver``. - Returns nil if an error occurs. - */ -- (nullable id)deepCopy; - -/** - Returns a copy of the instance use archiver and unarchiver. - Returns nil if an error occurs. - - @param archiver NSKeyedArchiver class or any class inherited. - @param unarchiver NSKeyedUnarchiver clsas or any class inherited. - */ -- (nullable id)deepCopyWithArchiver:(Class)archiver unarchiver:(Class)unarchiver; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAdd.m deleted file mode 100644 index 7e31e860..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAdd.m +++ /dev/null @@ -1,396 +0,0 @@ -// -// NSObject+YYAdd.m -// YYCategories -// -// Created by ibireme on 14/10/8. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSObject+YYAdd.h" -#import "YYCategoriesMacro.h" -#import -#import - -YYSYNTH_DUMMY_CLASS(NSObject_YYAdd) - - -@implementation NSObject (YYAdd) - -/* - NSInvocation is much slower than objc_msgSend()... - Do not use it if you have performance issues. - */ - -#define INIT_INV(_last_arg_, _return_) \ -NSMethodSignature * sig = [self methodSignatureForSelector:sel]; \ -if (!sig) { [self doesNotRecognizeSelector:sel]; return _return_; } \ -NSInvocation *inv = [NSInvocation invocationWithMethodSignature:sig]; \ -if (!inv) { [self doesNotRecognizeSelector:sel]; return _return_; } \ -[inv setTarget:self]; \ -[inv setSelector:sel]; \ -va_list args; \ -va_start(args, _last_arg_); \ -[NSObject setInv:inv withSig:sig andArgs:args]; \ -va_end(args); - -- (id)performSelectorWithArgs:(SEL)sel, ...{ - INIT_INV(sel, nil); - [inv invoke]; - return [NSObject getReturnFromInv:inv withSig:sig]; -} - -- (void)performSelectorWithArgs:(SEL)sel afterDelay:(NSTimeInterval)delay, ...{ - INIT_INV(delay, ); - [inv retainArguments]; - [inv performSelector:@selector(invoke) withObject:nil afterDelay:delay]; -} - -- (id)performSelectorWithArgsOnMainThread:(SEL)sel waitUntilDone:(BOOL)wait, ...{ - INIT_INV(wait, nil); - if (!wait) [inv retainArguments]; - [inv performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:wait]; - return wait ? [NSObject getReturnFromInv:inv withSig:sig] : nil; -} - -- (id)performSelectorWithArgs:(SEL)sel onThread:(NSThread *)thr waitUntilDone:(BOOL)wait, ...{ - INIT_INV(wait, nil); - if (!wait) [inv retainArguments]; - [inv performSelector:@selector(invoke) onThread:thr withObject:nil waitUntilDone:wait]; - return wait ? [NSObject getReturnFromInv:inv withSig:sig] : nil; -} - -- (void)performSelectorWithArgsInBackground:(SEL)sel, ...{ - INIT_INV(sel, ); - [inv retainArguments]; - [inv performSelectorInBackground:@selector(invoke) withObject:nil]; -} - -#undef INIT_INV - -+ (id)getReturnFromInv:(NSInvocation *)inv withSig:(NSMethodSignature *)sig { - NSUInteger length = [sig methodReturnLength]; - if (length == 0) return nil; - - char *type = (char *)[sig methodReturnType]; - while (*type == 'r' || // const - *type == 'n' || // in - *type == 'N' || // inout - *type == 'o' || // out - *type == 'O' || // bycopy - *type == 'R' || // byref - *type == 'V') { // oneway - type++; // cutoff useless prefix - } - -#define return_with_number(_type_) \ -do { \ -_type_ ret; \ -[inv getReturnValue:&ret]; \ -return @(ret); \ -} while (0) - - switch (*type) { - case 'v': return nil; // void - case 'B': return_with_number(bool); - case 'c': return_with_number(char); - case 'C': return_with_number(unsigned char); - case 's': return_with_number(short); - case 'S': return_with_number(unsigned short); - case 'i': return_with_number(int); - case 'I': return_with_number(unsigned int); - case 'l': return_with_number(int); - case 'L': return_with_number(unsigned int); - case 'q': return_with_number(long long); - case 'Q': return_with_number(unsigned long long); - case 'f': return_with_number(float); - case 'd': return_with_number(double); - case 'D': { // long double - long double ret; - [inv getReturnValue:&ret]; - return [NSNumber numberWithDouble:ret]; - }; - - case '@': { // id - id ret = nil; - [inv getReturnValue:&ret]; - return ret; - }; - - case '#': { // Class - Class ret = nil; - [inv getReturnValue:&ret]; - return ret; - }; - - default: { // struct / union / SEL / void* / unknown - const char *objCType = [sig methodReturnType]; - char *buf = calloc(1, length); - if (!buf) return nil; - [inv getReturnValue:buf]; - NSValue *value = [NSValue valueWithBytes:buf objCType:objCType]; - free(buf); - return value; - }; - } -#undef return_with_number -} - -+ (void)setInv:(NSInvocation *)inv withSig:(NSMethodSignature *)sig andArgs:(va_list)args { - NSUInteger count = [sig numberOfArguments]; - for (int index = 2; index < count; index++) { - char *type = (char *)[sig getArgumentTypeAtIndex:index]; - while (*type == 'r' || // const - *type == 'n' || // in - *type == 'N' || // inout - *type == 'o' || // out - *type == 'O' || // bycopy - *type == 'R' || // byref - *type == 'V') { // oneway - type++; // cutoff useless prefix - } - - BOOL unsupportedType = NO; - switch (*type) { - case 'v': // 1: void - case 'B': // 1: bool - case 'c': // 1: char / BOOL - case 'C': // 1: unsigned char - case 's': // 2: short - case 'S': // 2: unsigned short - case 'i': // 4: int / NSInteger(32bit) - case 'I': // 4: unsigned int / NSUInteger(32bit) - case 'l': // 4: long(32bit) - case 'L': // 4: unsigned long(32bit) - { // 'char' and 'short' will be promoted to 'int'. - int arg = va_arg(args, int); - [inv setArgument:&arg atIndex:index]; - } break; - - case 'q': // 8: long long / long(64bit) / NSInteger(64bit) - case 'Q': // 8: unsigned long long / unsigned long(64bit) / NSUInteger(64bit) - { - long long arg = va_arg(args, long long); - [inv setArgument:&arg atIndex:index]; - } break; - - case 'f': // 4: float / CGFloat(32bit) - { // 'float' will be promoted to 'double'. - double arg = va_arg(args, double); - float argf = arg; - [inv setArgument:&argf atIndex:index]; - } break; - - case 'd': // 8: double / CGFloat(64bit) - { - double arg = va_arg(args, double); - [inv setArgument:&arg atIndex:index]; - } break; - - case 'D': // 16: long double - { - long double arg = va_arg(args, long double); - [inv setArgument:&arg atIndex:index]; - } break; - - case '*': // char * - case '^': // pointer - { - void *arg = va_arg(args, void *); - [inv setArgument:&arg atIndex:index]; - } break; - - case ':': // SEL - { - SEL arg = va_arg(args, SEL); - [inv setArgument:&arg atIndex:index]; - } break; - - case '#': // Class - { - Class arg = va_arg(args, Class); - [inv setArgument:&arg atIndex:index]; - } break; - - case '@': // id - { - id arg = va_arg(args, id); - [inv setArgument:&arg atIndex:index]; - } break; - - case '{': // struct - { - if (strcmp(type, @encode(CGPoint)) == 0) { - CGPoint arg = va_arg(args, CGPoint); - [inv setArgument:&arg atIndex:index]; - } else if (strcmp(type, @encode(CGSize)) == 0) { - CGSize arg = va_arg(args, CGSize); - [inv setArgument:&arg atIndex:index]; - } else if (strcmp(type, @encode(CGRect)) == 0) { - CGRect arg = va_arg(args, CGRect); - [inv setArgument:&arg atIndex:index]; - } else if (strcmp(type, @encode(CGVector)) == 0) { - CGVector arg = va_arg(args, CGVector); - [inv setArgument:&arg atIndex:index]; - } else if (strcmp(type, @encode(CGAffineTransform)) == 0) { - CGAffineTransform arg = va_arg(args, CGAffineTransform); - [inv setArgument:&arg atIndex:index]; - } else if (strcmp(type, @encode(CATransform3D)) == 0) { - CATransform3D arg = va_arg(args, CATransform3D); - [inv setArgument:&arg atIndex:index]; - } else if (strcmp(type, @encode(NSRange)) == 0) { - NSRange arg = va_arg(args, NSRange); - [inv setArgument:&arg atIndex:index]; - } else if (strcmp(type, @encode(UIOffset)) == 0) { - UIOffset arg = va_arg(args, UIOffset); - [inv setArgument:&arg atIndex:index]; - } else if (strcmp(type, @encode(UIEdgeInsets)) == 0) { - UIEdgeInsets arg = va_arg(args, UIEdgeInsets); - [inv setArgument:&arg atIndex:index]; - } else { - unsupportedType = YES; - } - } break; - - case '(': // union - { - unsupportedType = YES; - } break; - - case '[': // array - { - unsupportedType = YES; - } break; - - default: // what?! - { - unsupportedType = YES; - } break; - } - - if (unsupportedType) { - // Try with some dummy type... - - NSUInteger size = 0; - NSGetSizeAndAlignment(type, &size, NULL); - -#define case_size(_size_) \ -else if (size <= 4 * _size_ ) { \ - struct dummy { char tmp[4 * _size_]; }; \ - struct dummy arg = va_arg(args, struct dummy); \ - [inv setArgument:&arg atIndex:index]; \ -} - if (size == 0) { } - case_size( 1) case_size( 2) case_size( 3) case_size( 4) - case_size( 5) case_size( 6) case_size( 7) case_size( 8) - case_size( 9) case_size(10) case_size(11) case_size(12) - case_size(13) case_size(14) case_size(15) case_size(16) - case_size(17) case_size(18) case_size(19) case_size(20) - case_size(21) case_size(22) case_size(23) case_size(24) - case_size(25) case_size(26) case_size(27) case_size(28) - case_size(29) case_size(30) case_size(31) case_size(32) - case_size(33) case_size(34) case_size(35) case_size(36) - case_size(37) case_size(38) case_size(39) case_size(40) - case_size(41) case_size(42) case_size(43) case_size(44) - case_size(45) case_size(46) case_size(47) case_size(48) - case_size(49) case_size(50) case_size(51) case_size(52) - case_size(53) case_size(54) case_size(55) case_size(56) - case_size(57) case_size(58) case_size(59) case_size(60) - case_size(61) case_size(62) case_size(63) case_size(64) - else { - /* - Larger than 256 byte?! I don't want to deal with this stuff up... - Ignore this argument. - */ - struct dummy {char tmp;}; - for (int i = 0; i < size; i++) va_arg(args, struct dummy); - NSLog(@"YYCategories performSelectorWithArgs unsupported type:%s (%lu bytes)", - [sig getArgumentTypeAtIndex:index],(unsigned long)size); - } -#undef case_size - - } - } -} - -- (void)performSelector:(SEL)selector afterDelay:(NSTimeInterval)delay { - [self performSelector:selector withObject:nil afterDelay:delay]; -} - -+ (BOOL)swizzleInstanceMethod:(SEL)originalSel with:(SEL)newSel { - Method originalMethod = class_getInstanceMethod(self, originalSel); - Method newMethod = class_getInstanceMethod(self, newSel); - if (!originalMethod || !newMethod) return NO; - - class_addMethod(self, - originalSel, - class_getMethodImplementation(self, originalSel), - method_getTypeEncoding(originalMethod)); - class_addMethod(self, - newSel, - class_getMethodImplementation(self, newSel), - method_getTypeEncoding(newMethod)); - - method_exchangeImplementations(class_getInstanceMethod(self, originalSel), - class_getInstanceMethod(self, newSel)); - return YES; -} - -+ (BOOL)swizzleClassMethod:(SEL)originalSel with:(SEL)newSel { - Class class = object_getClass(self); - Method originalMethod = class_getInstanceMethod(class, originalSel); - Method newMethod = class_getInstanceMethod(class, newSel); - if (!originalMethod || !newMethod) return NO; - method_exchangeImplementations(originalMethod, newMethod); - return YES; -} - -- (void)setAssociateValue:(id)value withKey:(void *)key { - objc_setAssociatedObject(self, key, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (void)setAssociateWeakValue:(id)value withKey:(void *)key { - objc_setAssociatedObject(self, key, value, OBJC_ASSOCIATION_ASSIGN); -} - -- (void)removeAssociatedValues { - objc_removeAssociatedObjects(self); -} - -- (id)getAssociatedValueForKey:(void *)key { - return objc_getAssociatedObject(self, key); -} - -+ (NSString *)className { - return NSStringFromClass(self); -} - -- (NSString *)className { - return [NSString stringWithUTF8String:class_getName([self class])]; -} - -- (id)deepCopy { - id obj = nil; - @try { - obj = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:self]]; - } - @catch (NSException *exception) { - NSLog(@"%@", exception); - } - return obj; -} - -- (id)deepCopyWithArchiver:(Class)archiver unarchiver:(Class)unarchiver { - id obj = nil; - @try { - obj = [unarchiver unarchiveObjectWithData:[archiver archivedDataWithRootObject:self]]; - } - @catch (NSException *exception) { - NSLog(@"%@", exception); - } - return obj; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForARC.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForARC.h deleted file mode 100644 index 2052ce39..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForARC.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// NSObject+YYAddForARC.h -// YYCategories -// -// Created by ibireme on 13/12/15. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -/** - Debug method for NSObject when using ARC. - */ -@interface NSObject (YYAddForARC) - -/// Same as `retain` -- (instancetype)arcDebugRetain; - -/// Same as `release` -- (oneway void)arcDebugRelease; - -/// Same as `autorelease` -- (instancetype)arcDebugAutorelease; - -/// Same as `retainCount` -- (NSUInteger)arcDebugRetainCount; - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForARC.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForARC.m deleted file mode 100644 index 0cdf8769..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForARC.m +++ /dev/null @@ -1,40 +0,0 @@ -// -// NSObject+YYAddForARC.m -// YYCategories -// -// Created by ibireme on 13/12/15. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSObject+YYAddForARC.h" - -@interface NSObject_YYAddForARC : NSObject @end -@implementation NSObject_YYAddForARC @end - -#if __has_feature(objc_arc) -#error This file must be compiled without ARC. Specify the -fno-objc-arc flag to this file. -#endif - - -@implementation NSObject (YYAddForARC) - -- (instancetype)arcDebugRetain { - return [self retain]; -} - -- (oneway void)arcDebugRelease { - [self release]; -} - -- (instancetype)arcDebugAutorelease { - return [self autorelease]; -} - -- (NSUInteger)arcDebugRetainCount { - return [self retainCount]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForKVO.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForKVO.h deleted file mode 100644 index b3f1df12..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForKVO.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// NSObject+YYAddForKVO.h -// YYCategories -// -// Created by ibireme on 14/10/15. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Observer with block (KVO). - */ -@interface NSObject (YYAddForKVO) - -/** - Registers a block to receive KVO notifications for the specified key-path - relative to the receiver. - - @discussion The block and block captured objects are retained. Call - `removeObserverBlocksForKeyPath:` or `removeObserverBlocks` to release. - - @param keyPath The key path, relative to the receiver, of the property to - observe. This value must not be nil. - - @param block The block to register for KVO notifications. - */ -- (void)addObserverBlockForKeyPath:(NSString*)keyPath - block:(void (^)(id _Nonnull obj, id _Nonnull oldVal, id _Nonnull newVal))block; - -/** - Stops all blocks (associated by `addObserverBlockForKeyPath:block:`) from - receiving change notifications for the property specified by a given key-path - relative to the receiver, and release these blocks. - - @param keyPath A key-path, relative to the receiver, for which blocks is - registered to receive KVO change notifications. - */ -- (void)removeObserverBlocksForKeyPath:(NSString*)keyPath; - -/** - Stops all blocks (associated by `addObserverBlockForKeyPath:block:`) from - receiving change notifications, and release these blocks. - */ -- (void)removeObserverBlocks; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForKVO.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForKVO.m deleted file mode 100644 index cf8bd733..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSObject+YYAddForKVO.m +++ /dev/null @@ -1,110 +0,0 @@ -// -// NSObject+YYAddForKVO.m -// YYCategories -// -// Created by ibireme on 14/10/15. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSObject+YYAddForKVO.h" -#import "YYCategoriesMacro.h" -#import -#import - -YYSYNTH_DUMMY_CLASS(NSObject_YYAddForKVO) - - - - -static const int block_key; - -@interface _YYNSObjectKVOBlockTarget : NSObject - -@property (nonatomic, copy) void (^block)(__weak id obj, id oldVal, id newVal); - -- (id)initWithBlock:(void (^)(__weak id obj, id oldVal, id newVal))block; - -@end - -@implementation _YYNSObjectKVOBlockTarget - -- (id)initWithBlock:(void (^)(__weak id obj, id oldVal, id newVal))block { - self = [super init]; - if (self) { - self.block = block; - } - return self; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if (!self.block) return; - - BOOL isPrior = [[change objectForKey:NSKeyValueChangeNotificationIsPriorKey] boolValue]; - if (isPrior) return; - - NSKeyValueChange changeKind = [[change objectForKey:NSKeyValueChangeKindKey] integerValue]; - if (changeKind != NSKeyValueChangeSetting) return; - - id oldVal = [change objectForKey:NSKeyValueChangeOldKey]; - if (oldVal == [NSNull null]) oldVal = nil; - - id newVal = [change objectForKey:NSKeyValueChangeNewKey]; - if (newVal == [NSNull null]) newVal = nil; - - self.block(object, oldVal, newVal); -} - -@end - - - -@implementation NSObject (YYAddForKVO) - -- (void)addObserverBlockForKeyPath:(NSString *)keyPath block:(void (^)(__weak id obj, id oldVal, id newVal))block { - if (!keyPath || !block) return; - _YYNSObjectKVOBlockTarget *target = [[_YYNSObjectKVOBlockTarget alloc] initWithBlock:block]; - NSMutableDictionary *dic = [self _yy_allNSObjectObserverBlocks]; - NSMutableArray *arr = dic[keyPath]; - if (!arr) { - arr = [NSMutableArray new]; - dic[keyPath] = arr; - } - [arr addObject:target]; - [self addObserver:target forKeyPath:keyPath options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:NULL]; -} - -- (void)removeObserverBlocksForKeyPath:(NSString *)keyPath { - if (!keyPath) return; - NSMutableDictionary *dic = [self _yy_allNSObjectObserverBlocks]; - NSMutableArray *arr = dic[keyPath]; - [arr enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) { - [self removeObserver:obj forKeyPath:keyPath]; - }]; - - [dic removeObjectForKey:keyPath]; -} - -- (void)removeObserverBlocks { - NSMutableDictionary *dic = [self _yy_allNSObjectObserverBlocks]; - [dic enumerateKeysAndObjectsUsingBlock: ^(NSString *key, NSArray *arr, BOOL *stop) { - [arr enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) { - [self removeObserver:obj forKeyPath:key]; - }]; - }]; - - [dic removeAllObjects]; -} - -- (NSMutableDictionary *)_yy_allNSObjectObserverBlocks { - NSMutableDictionary *targets = objc_getAssociatedObject(self, &block_key); - if (!targets) { - targets = [NSMutableDictionary new]; - objc_setAssociatedObject(self, &block_key, targets, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return targets; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSString+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSString+YYAdd.h deleted file mode 100644 index d06c5e0f..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSString+YYAdd.h +++ /dev/null @@ -1,409 +0,0 @@ -// -// NSString+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provide hash, encrypt, encode and some common method for 'NSString'. - */ -@interface NSString (YYAdd) - -#pragma mark - Hash -///============================================================================= -/// @name Hash -///============================================================================= - -/** - Returns a lowercase NSString for md2 hash. - */ -- (nullable NSString *)md2String; - -/** - Returns a lowercase NSString for md4 hash. - */ -- (nullable NSString *)md4String; - -/** - Returns a lowercase NSString for md5 hash. - */ -- (nullable NSString *)md5String; - -/** - Returns a lowercase NSString for sha1 hash. - */ -- (nullable NSString *)sha1String; - -/** - Returns a lowercase NSString for sha224 hash. - */ -- (nullable NSString *)sha224String; - -/** - Returns a lowercase NSString for sha256 hash. - */ -- (nullable NSString *)sha256String; - -/** - Returns a lowercase NSString for sha384 hash. - */ -- (nullable NSString *)sha384String; - -/** - Returns a lowercase NSString for sha512 hash. - */ -- (nullable NSString *)sha512String; - -/** - Returns a lowercase NSString for hmac using algorithm md5 with key. - @param key The hmac key. - */ -- (nullable NSString *)hmacMD5StringWithKey:(NSString *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha1 with key. - @param key The hmac key. - */ -- (nullable NSString *)hmacSHA1StringWithKey:(NSString *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha224 with key. - @param key The hmac key. - */ -- (nullable NSString *)hmacSHA224StringWithKey:(NSString *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha256 with key. - @param key The hmac key. - */ -- (nullable NSString *)hmacSHA256StringWithKey:(NSString *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha384 with key. - @param key The hmac key. - */ -- (nullable NSString *)hmacSHA384StringWithKey:(NSString *)key; - -/** - Returns a lowercase NSString for hmac using algorithm sha512 with key. - @param key The hmac key. - */ -- (nullable NSString *)hmacSHA512StringWithKey:(NSString *)key; - -/** - Returns a lowercase NSString for crc32 hash. - */ -- (nullable NSString *)crc32String; - - -#pragma mark - Encode and decode -///============================================================================= -/// @name Encode and decode -///============================================================================= - -/** - Returns an NSString for base64 encoded. - */ -- (nullable NSString *)base64EncodedString; - -/** - Returns an NSString from base64 encoded string. - @param base64Encoding The encoded string. - */ -+ (nullable NSString *)stringWithBase64EncodedString:(NSString *)base64EncodedString; - -/** - URL encode a string in utf-8. - @return the encoded string. - */ -- (NSString *)stringByURLEncode; - -/** - URL decode a string in utf-8. - @return the decoded string. - */ -- (NSString *)stringByURLDecode; - -/** - Escape commmon HTML to Entity. - Example: "a - Before After(scale:2) - "icon" "icon@2x" - "icon " "icon @2x" - "icon.top" "icon.top@2x" - "/p/name" "/p/name@2x" - "/path/" "/path/" - - - @param scale Resource scale. - @return String by add scale modifier, or just return if it's not end with file name. - */ -- (NSString *)stringByAppendingNameScale:(CGFloat)scale; - -/** - Add scale modifier to the file path (with path extension), - From @"name.png" to @"name@2x.png". - - e.g. - - - - - - - - - -
    Before After(scale:2)
    "icon.png" "icon@2x.png"
    "icon..png""icon.@2x.png"
    "icon" "icon@2x"
    "icon " "icon @2x"
    "icon." "icon.@2x"
    "/p/name" "/p/name@2x"
    "/path/" "/path/"
    - - @param scale Resource scale. - @return String by add scale modifier, or just return if it's not end with file name. - */ -- (NSString *)stringByAppendingPathScale:(CGFloat)scale; - -/** - Return the path scale. - - e.g. - - - - - - - - -
    Path Scale
    "icon.png" 1
    "icon@2x.png" 2
    "icon@2.5x.png" 2.5
    "icon@2x" 1
    "icon@2x..png" 1
    "icon@2x.png/" 1
    - */ -- (CGFloat)pathScale; - -/** - nil, @"", @" ", @"\n" will Returns NO; otherwise Returns YES. - */ -- (BOOL)isNotBlank; - -/** - Returns YES if the target string is contained within the receiver. - @param string A string to test the the receiver. - - @discussion Apple has implemented this method in iOS8. - */ -- (BOOL)containsString:(NSString *)string; - -/** - Returns YES if the target CharacterSet is contained within the receiver. - @param set A character set to test the the receiver. - */ -- (BOOL)containsCharacterSet:(NSCharacterSet *)set; - -/** - Try to parse this string and returns an `NSNumber`. - @return Returns an `NSNumber` if parse succeed, or nil if an error occurs. - */ -- (NSNumber *)numberValue; - -/** - Returns an NSData using UTF-8 encoding. - */ -- (NSData *)dataValue; - -/** - Returns NSMakeRange(0, self.length). - */ -- (NSRange)rangeOfAll; - -/** - Returns an NSDictionary/NSArray which is decoded from receiver. - Returns nil if an error occurs. - - e.g. NSString: @"{"name":"a","count":2}" => NSDictionary: @[@"name":@"a",@"count":@2] - */ -- (id)jsonValueDecoded; - -/** - Create a string from the file in main bundle (similar to [UIImage imageNamed:]). - - @param name The file name (in main bundle). - - @return A new string create from the file in UTF-8 character encoding. - */ -+ (NSString *)stringNamed:(NSString *)name; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSString+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSString+YYAdd.m deleted file mode 100644 index 1d6588fa..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSString+YYAdd.m +++ /dev/null @@ -1,414 +0,0 @@ -// -// NSString+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSString+YYAdd.h" -#import "NSData+YYAdd.h" -#import "NSNumber+YYAdd.h" -#import "UIDevice+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(NSString_YYAdd) - - -@implementation NSString (YYAdd) - -- (NSString *)md2String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] md2String]; -} - -- (NSString *)md4String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] md4String]; -} - -- (NSString *)md5String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] md5String]; -} - -- (NSString *)sha1String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] sha1String]; -} - -- (NSString *)sha224String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] sha224String]; -} - -- (NSString *)sha256String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] sha256String]; -} - -- (NSString *)sha384String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] sha384String]; -} - -- (NSString *)sha512String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] sha512String]; -} - -- (NSString *)crc32String { - return [[self dataUsingEncoding:NSUTF8StringEncoding] crc32String]; -} - -- (NSString *)hmacMD5StringWithKey:(NSString *)key { - return [[self dataUsingEncoding:NSUTF8StringEncoding] - hmacMD5StringWithKey:key]; -} - -- (NSString *)hmacSHA1StringWithKey:(NSString *)key { - return [[self dataUsingEncoding:NSUTF8StringEncoding] - hmacSHA1StringWithKey:key]; -} - -- (NSString *)hmacSHA224StringWithKey:(NSString *)key { - return [[self dataUsingEncoding:NSUTF8StringEncoding] - hmacSHA224StringWithKey:key]; -} - -- (NSString *)hmacSHA256StringWithKey:(NSString *)key { - return [[self dataUsingEncoding:NSUTF8StringEncoding] - hmacSHA256StringWithKey:key]; -} - -- (NSString *)hmacSHA384StringWithKey:(NSString *)key { - return [[self dataUsingEncoding:NSUTF8StringEncoding] - hmacSHA384StringWithKey:key]; -} - -- (NSString *)hmacSHA512StringWithKey:(NSString *)key { - return [[self dataUsingEncoding:NSUTF8StringEncoding] - hmacSHA512StringWithKey:key]; -} - -- (NSString *)base64EncodedString { - return [[self dataUsingEncoding:NSUTF8StringEncoding] base64EncodedString]; -} - -+ (NSString *)stringWithBase64EncodedString:(NSString *)base64EncodedString { - NSData *data = [NSData dataWithBase64EncodedString:base64EncodedString]; - return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; -} - -- (NSString *)stringByURLEncode { - if ([self respondsToSelector:@selector(stringByAddingPercentEncodingWithAllowedCharacters:)]) { - /** - AFNetworking/AFURLRequestSerialization.m - - Returns a percent-escaped string following RFC 3986 for a query string key or value. - RFC 3986 states that the following characters are "reserved" characters. - - General Delimiters: ":", "#", "[", "]", "@", "?", "/" - - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" - In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow - query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" - should be percent-escaped in the query string. - - parameter string: The string to be percent-escaped. - - returns: The percent-escaped string. - */ - static NSString * const kAFCharactersGeneralDelimitersToEncode = @":#[]@"; // does not include "?" or "/" due to RFC 3986 - Section 3.4 - static NSString * const kAFCharactersSubDelimitersToEncode = @"!$&'()*+,;="; - - NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; - [allowedCharacterSet removeCharactersInString:[kAFCharactersGeneralDelimitersToEncode stringByAppendingString:kAFCharactersSubDelimitersToEncode]]; - static NSUInteger const batchSize = 50; - - NSUInteger index = 0; - NSMutableString *escaped = @"".mutableCopy; - - while (index < self.length) { - NSUInteger length = MIN(self.length - index, batchSize); - NSRange range = NSMakeRange(index, length); - // To avoid breaking up character sequences such as 👴🏻👮🏽 - range = [self rangeOfComposedCharacterSequencesForRange:range]; - NSString *substring = [self substringWithRange:range]; - NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; - [escaped appendString:encoded]; - - index += range.length; - } - return escaped; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - CFStringEncoding cfEncoding = CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding); - NSString *encoded = (__bridge_transfer NSString *) - CFURLCreateStringByAddingPercentEscapes( - kCFAllocatorDefault, - (__bridge CFStringRef)self, - NULL, - CFSTR("!#$&'()*+,/:;=?@[]"), - cfEncoding); - return encoded; -#pragma clang diagnostic pop - } -} - -- (NSString *)stringByURLDecode { - if ([self respondsToSelector:@selector(stringByRemovingPercentEncoding)]) { - return [self stringByRemovingPercentEncoding]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - CFStringEncoding en = CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding); - NSString *decoded = [self stringByReplacingOccurrencesOfString:@"+" - withString:@" "]; - decoded = (__bridge_transfer NSString *) - CFURLCreateStringByReplacingPercentEscapesUsingEncoding( - NULL, - (__bridge CFStringRef)decoded, - CFSTR(""), - en); - return decoded; -#pragma clang diagnostic pop - } -} - -- (NSString *)stringByEscapingHTML { - NSUInteger len = self.length; - if (!len) return self; - - unichar *buf = malloc(sizeof(unichar) * len); - if (!buf) return self; - [self getCharacters:buf range:NSMakeRange(0, len)]; - - NSMutableString *result = [NSMutableString string]; - for (int i = 0; i < len; i++) { - unichar c = buf[i]; - NSString *esc = nil; - switch (c) { - case 34: esc = @"""; break; - case 38: esc = @"&"; break; - case 39: esc = @"'"; break; - case 60: esc = @"<"; break; - case 62: esc = @">"; break; - default: break; - } - if (esc) { - [result appendString:esc]; - } else { - CFStringAppendCharacters((CFMutableStringRef)result, &c, 1); - } - } - free(buf); - return result; -} - -- (CGSize)sizeForFont:(UIFont *)font size:(CGSize)size mode:(NSLineBreakMode)lineBreakMode { - CGSize result; - if (!font) font = [UIFont systemFontOfSize:12]; - if ([self respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) { - NSMutableDictionary *attr = [NSMutableDictionary new]; - attr[NSFontAttributeName] = font; - if (lineBreakMode != NSLineBreakByWordWrapping) { - NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; - paragraphStyle.lineBreakMode = lineBreakMode; - attr[NSParagraphStyleAttributeName] = paragraphStyle; - } - CGRect rect = [self boundingRectWithSize:size - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading - attributes:attr context:nil]; - result = rect.size; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - result = [self sizeWithFont:font constrainedToSize:size lineBreakMode:lineBreakMode]; -#pragma clang diagnostic pop - } - return result; -} - -- (CGFloat)widthForFont:(UIFont *)font { - CGSize size = [self sizeForFont:font size:CGSizeMake(HUGE, HUGE) mode:NSLineBreakByWordWrapping]; - return size.width; -} - -- (CGFloat)heightForFont:(UIFont *)font width:(CGFloat)width { - CGSize size = [self sizeForFont:font size:CGSizeMake(width, HUGE) mode:NSLineBreakByWordWrapping]; - return size.height; -} - -- (BOOL)matchesRegex:(NSString *)regex options:(NSRegularExpressionOptions)options { - NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:regex options:options error:NULL]; - if (!pattern) return NO; - return ([pattern numberOfMatchesInString:self options:0 range:NSMakeRange(0, self.length)] > 0); -} - -- (void)enumerateRegexMatches:(NSString *)regex - options:(NSRegularExpressionOptions)options - usingBlock:(void (^)(NSString *match, NSRange matchRange, BOOL *stop))block { - if (regex.length == 0 || !block) return; - NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:regex options:options error:nil]; - if (!regex) return; - [pattern enumerateMatchesInString:self options:kNilOptions range:NSMakeRange(0, self.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - block([self substringWithRange:result.range], result.range, stop); - }]; -} - -- (NSString *)stringByReplacingRegex:(NSString *)regex - options:(NSRegularExpressionOptions)options - withString:(NSString *)replacement; { - NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:regex options:options error:nil]; - if (!pattern) return self; - return [pattern stringByReplacingMatchesInString:self options:0 range:NSMakeRange(0, [self length]) withTemplate:replacement]; -} - -- (char)charValue { - return self.numberValue.charValue; -} - -- (unsigned char) unsignedCharValue { - return self.numberValue.unsignedCharValue; -} - -- (short) shortValue { - return self.numberValue.shortValue; -} - -- (unsigned short) unsignedShortValue { - return self.numberValue.unsignedShortValue; -} - -- (unsigned int) unsignedIntValue { - return self.numberValue.unsignedIntValue; -} - -- (long) longValue { - return self.numberValue.longValue; -} - -- (unsigned long) unsignedLongValue { - return self.numberValue.unsignedLongValue; -} - -- (unsigned long long) unsignedLongLongValue { - return self.numberValue.unsignedLongLongValue; -} - -- (NSUInteger) unsignedIntegerValue { - return self.numberValue.unsignedIntegerValue; -} - - -+ (NSString *)stringWithUUID { - CFUUIDRef uuid = CFUUIDCreate(NULL); - CFStringRef string = CFUUIDCreateString(NULL, uuid); - CFRelease(uuid); - return (__bridge_transfer NSString *)string; -} - -+ (NSString *)stringWithUTF32Char:(UTF32Char)char32 { - char32 = NSSwapHostIntToLittle(char32); - return [[NSString alloc] initWithBytes:&char32 length:4 encoding:NSUTF32LittleEndianStringEncoding]; -} - -+ (NSString *)stringWithUTF32Chars:(const UTF32Char *)char32 length:(NSUInteger)length { - return [[NSString alloc] initWithBytes:(const void *)char32 - length:length * 4 - encoding:NSUTF32LittleEndianStringEncoding]; -} - -- (void)enumerateUTF32CharInRange:(NSRange)range usingBlock:(void (^)(UTF32Char char32, NSRange range, BOOL *stop))block { - NSString *str = self; - if (range.location != 0 || range.length != self.length) { - str = [self substringWithRange:range]; - } - NSUInteger len = [str lengthOfBytesUsingEncoding:NSUTF32StringEncoding] / 4; - UTF32Char *char32 = (UTF32Char *)[str cStringUsingEncoding:NSUTF32LittleEndianStringEncoding]; - if (len == 0 || char32 == NULL) return; - - NSUInteger location = 0; - BOOL stop = NO; - NSRange subRange; - UTF32Char oneChar; - - for (NSUInteger i = 0; i < len; i++) { - oneChar = char32[i]; - subRange = NSMakeRange(location, oneChar > 0xFFFF ? 2 : 1); - block(oneChar, subRange, &stop); - if (stop) return; - location += subRange.length; - } -} - -- (NSString *)stringByTrim { - NSCharacterSet *set = [NSCharacterSet whitespaceAndNewlineCharacterSet]; - return [self stringByTrimmingCharactersInSet:set]; -} - -- (NSString *)stringByAppendingNameScale:(CGFloat)scale { - if (fabs(scale - 1) <= __FLT_EPSILON__ || self.length == 0 || [self hasSuffix:@"/"]) return self.copy; - return [self stringByAppendingFormat:@"@%@x", @(scale)]; -} - -- (NSString *)stringByAppendingPathScale:(CGFloat)scale { - if (fabs(scale - 1) <= __FLT_EPSILON__ || self.length == 0 || [self hasSuffix:@"/"]) return self.copy; - NSString *ext = self.pathExtension; - NSRange extRange = NSMakeRange(self.length - ext.length, 0); - if (ext.length > 0) extRange.location -= 1; - NSString *scaleStr = [NSString stringWithFormat:@"@%@x", @(scale)]; - return [self stringByReplacingCharactersInRange:extRange withString:scaleStr]; -} - -- (CGFloat)pathScale { - if (self.length == 0 || [self hasSuffix:@"/"]) return 1; - NSString *name = self.stringByDeletingPathExtension; - __block CGFloat scale = 1; - [name enumerateRegexMatches:@"@[0-9]+\\.?[0-9]*x$" options:NSRegularExpressionAnchorsMatchLines usingBlock: ^(NSString *match, NSRange matchRange, BOOL *stop) { - scale = [match substringWithRange:NSMakeRange(1, match.length - 2)].doubleValue; - }]; - return scale; -} - -- (BOOL)isNotBlank { - NSCharacterSet *blank = [NSCharacterSet whitespaceAndNewlineCharacterSet]; - for (NSInteger i = 0; i < self.length; ++i) { - unichar c = [self characterAtIndex:i]; - if (![blank characterIsMember:c]) { - return YES; - } - } - return NO; -} - -- (BOOL)containsString:(NSString *)string { - if (string == nil) return NO; - return [self rangeOfString:string].location != NSNotFound; -} - -- (BOOL)containsCharacterSet:(NSCharacterSet *)set { - if (set == nil) return NO; - return [self rangeOfCharacterFromSet:set].location != NSNotFound; -} - -- (NSNumber *)numberValue { - return [NSNumber numberWithString:self]; -} - -- (NSData *)dataValue { - return [self dataUsingEncoding:NSUTF8StringEncoding]; -} - -- (NSRange)rangeOfAll { - return NSMakeRange(0, self.length); -} - -- (id)jsonValueDecoded { - return [[self dataValue] jsonValueDecoded]; -} - -+ (NSString *)stringNamed:(NSString *)name { - NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@""]; - NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL]; - if (!str) { - path = [[NSBundle mainBundle] pathForResource:name ofType:@"txt"]; - str = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL]; - } - return str; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSThread+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSThread+YYAdd.h deleted file mode 100644 index 01d27612..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSThread+YYAdd.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// NSThread+YYAdd.h -// YYCategories -// -// Created by ibireme on 15/7/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -@interface NSThread (YYAdd) - -/** - Add an autorelease pool to current runloop for current thread. - - @discussion If you create your own thread (NSThread/pthread), and you use - runloop to manage your task, you may use this method to add an autorelease pool - to the runloop. Its behavior is the same as the main thread's autorelease pool. - */ -+ (void)addAutoreleasePoolToCurrentRunloop; - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSThread+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSThread+YYAdd.m deleted file mode 100644 index cda53e0b..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSThread+YYAdd.m +++ /dev/null @@ -1,107 +0,0 @@ -// -// NSThread+YYAdd.h -// YYCategories -// -// Created by ibireme on 15/7/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSThread+YYAdd.h" -#import - -@interface NSThread_YYAdd : NSObject @end -@implementation NSThread_YYAdd @end - -#if __has_feature(objc_arc) -#error This file must be compiled without ARC. Specify the -fno-objc-arc flag to this file. -#endif - -static NSString *const YYNSThreadAutoleasePoolKey = @"YYNSThreadAutoleasePoolKey"; -static NSString *const YYNSThreadAutoleasePoolStackKey = @"YYNSThreadAutoleasePoolStackKey"; - -static const void *PoolStackRetainCallBack(CFAllocatorRef allocator, const void *value) { - return value; -} - -static void PoolStackReleaseCallBack(CFAllocatorRef allocator, const void *value) { - CFRelease((CFTypeRef)value); -} - - -static inline void YYAutoreleasePoolPush() { - NSMutableDictionary *dic = [NSThread currentThread].threadDictionary; - NSMutableArray *poolStack = dic[YYNSThreadAutoleasePoolStackKey]; - - if (!poolStack) { - /* - do not retain pool on push, - but release on pop to avoid memory analyze warning - */ - CFArrayCallBacks callbacks = {0}; - callbacks.retain = PoolStackRetainCallBack; - callbacks.release = PoolStackReleaseCallBack; - poolStack = (id)CFArrayCreateMutable(CFAllocatorGetDefault(), 0, &callbacks); - dic[YYNSThreadAutoleasePoolStackKey] = poolStack; - CFRelease(poolStack); - } - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; //< create - [poolStack addObject:pool]; // push -} - -static inline void YYAutoreleasePoolPop() { - NSMutableDictionary *dic = [NSThread currentThread].threadDictionary; - NSMutableArray *poolStack = dic[YYNSThreadAutoleasePoolStackKey]; - [poolStack removeLastObject]; // pop -} - -static void YYRunLoopAutoreleasePoolObserverCallBack(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { - switch (activity) { - case kCFRunLoopEntry: { - YYAutoreleasePoolPush(); - } break; - case kCFRunLoopBeforeWaiting: { - YYAutoreleasePoolPop(); - YYAutoreleasePoolPush(); - } break; - case kCFRunLoopExit: { - YYAutoreleasePoolPop(); - } break; - default: break; - } -} - -static void YYRunloopAutoreleasePoolSetup() { - CFRunLoopRef runloop = CFRunLoopGetCurrent(); - - CFRunLoopObserverRef pushObserver; - pushObserver = CFRunLoopObserverCreate(CFAllocatorGetDefault(), kCFRunLoopEntry, - true, // repeat - -0x7FFFFFFF, // before other observers - YYRunLoopAutoreleasePoolObserverCallBack, NULL); - CFRunLoopAddObserver(runloop, pushObserver, kCFRunLoopCommonModes); - CFRelease(pushObserver); - - CFRunLoopObserverRef popObserver; - popObserver = CFRunLoopObserverCreate(CFAllocatorGetDefault(), kCFRunLoopBeforeWaiting | kCFRunLoopExit, - true, // repeat - 0x7FFFFFFF, // after other observers - YYRunLoopAutoreleasePoolObserverCallBack, NULL); - CFRunLoopAddObserver(runloop, popObserver, kCFRunLoopCommonModes); - CFRelease(popObserver); -} - -@implementation NSThread (YYAdd) - -+ (void)addAutoreleasePoolToCurrentRunloop { - if ([NSThread isMainThread]) return; // The main thread already has autorelease pool. - NSThread *thread = [self currentThread]; - if (!thread) return; - if (thread.threadDictionary[YYNSThreadAutoleasePoolKey]) return; // already added - YYRunloopAutoreleasePoolSetup(); - thread.threadDictionary[YYNSThreadAutoleasePoolKey] = YYNSThreadAutoleasePoolKey; // mark the state -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSTimer+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSTimer+YYAdd.h deleted file mode 100644 index 60834fcf..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSTimer+YYAdd.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// NSTimer+YYAdd.h -// YYCategories -// -// Created by ibireme on 14/15/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `NSTimer`. - */ -@interface NSTimer (YYAdd) - -/** - Creates and returns a new NSTimer object and schedules it on the current run - loop in the default mode. - - @discussion After seconds seconds have elapsed, the timer fires, - sending the message aSelector to target. - - @param seconds The number of seconds between firings of the timer. If seconds - is less than or equal to 0.0, this method chooses the - nonnegative value of 0.1 milliseconds instead. - - @param block The block to invoke when the timer fires. The timer maintains - a strong reference to the block until it (the timer) is invalidated. - - @param repeats If YES, the timer will repeatedly reschedule itself until - invalidated. If NO, the timer will be invalidated after it fires. - - @return A new NSTimer object, configured according to the specified parameters. - */ -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds block:(void (^)(NSTimer *timer))block repeats:(BOOL)repeats; - -/** - Creates and returns a new NSTimer object initialized with the specified block. - - @discussion You must add the new timer to a run loop, using addTimer:forMode:. - Then, after seconds have elapsed, the timer fires, invoking - block. (If the timer is configured to repeat, there is no need - to subsequently re-add the timer to the run loop.) - - @param seconds The number of seconds between firings of the timer. If seconds - is less than or equal to 0.0, this method chooses the - nonnegative value of 0.1 milliseconds instead. - - @param block The block to invoke when the timer fires. The timer instructs - the block to maintain a strong reference to its arguments. - - @param repeats If YES, the timer will repeatedly reschedule itself until - invalidated. If NO, the timer will be invalidated after it fires. - - @return A new NSTimer object, configured according to the specified parameters. - */ -+ (NSTimer *)timerWithTimeInterval:(NSTimeInterval)seconds block:(void (^)(NSTimer *timer))block repeats:(BOOL)repeats; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSTimer+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSTimer+YYAdd.m deleted file mode 100644 index dcd52e41..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Foundation/NSTimer+YYAdd.m +++ /dev/null @@ -1,35 +0,0 @@ -// -// NSTimer+YYAdd.m -// YYCategories -// -// Created by ibireme on 14/15/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSTimer+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(NSTimer_YYAdd) - - -@implementation NSTimer (YYAdd) - -+ (void)_yy_ExecBlock:(NSTimer *)timer { - if ([timer userInfo]) { - void (^block)(NSTimer *timer) = (void (^)(NSTimer *timer))[timer userInfo]; - block(timer); - } -} - -+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds block:(void (^)(NSTimer *timer))block repeats:(BOOL)repeats { - return [NSTimer scheduledTimerWithTimeInterval:seconds target:self selector:@selector(_yy_ExecBlock:) userInfo:[block copy] repeats:repeats]; -} - -+ (NSTimer *)timerWithTimeInterval:(NSTimeInterval)seconds block:(void (^)(NSTimer *timer))block repeats:(BOOL)repeats { - return [NSTimer timerWithTimeInterval:seconds target:self selector:@selector(_yy_ExecBlock:) userInfo:[block copy] repeats:repeats]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Quartz/CALayer+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/Quartz/CALayer+YYAdd.h deleted file mode 100644 index 5001a750..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Quartz/CALayer+YYAdd.h +++ /dev/null @@ -1,97 +0,0 @@ -// -// CALayer+YYAdd.h -// YYCategories -// -// Created by ibireme on 14/5/10. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `CALayer`. - */ -@interface CALayer (YYAdd) - -/** - Take snapshot without transform, image's size equals to bounds. - */ -- (nullable UIImage *)snapshotImage; - -/** - Take snapshot without transform, PDF's page size equals to bounds. - */ -- (nullable NSData *)snapshotPDF; - -/** - Shortcut to set the layer's shadow - - @param color Shadow Color - @param offset Shadow offset - @param radius Shadow radius - */ -- (void)setLayerShadow:(UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius; - -/** - Remove all sublayers. - */ -- (void)removeAllSublayers; - -@property (nonatomic) CGFloat left; ///< Shortcut for frame.origin.x. -@property (nonatomic) CGFloat top; ///< Shortcut for frame.origin.y -@property (nonatomic) CGFloat right; ///< Shortcut for frame.origin.x + frame.size.width -@property (nonatomic) CGFloat bottom; ///< Shortcut for frame.origin.y + frame.size.height -@property (nonatomic) CGFloat width; ///< Shortcut for frame.size.width. -@property (nonatomic) CGFloat height; ///< Shortcut for frame.size.height. -@property (nonatomic) CGPoint center; ///< Shortcut for center. -@property (nonatomic) CGFloat centerX; ///< Shortcut for center.x -@property (nonatomic) CGFloat centerY; ///< Shortcut for center.y -@property (nonatomic) CGPoint origin; ///< Shortcut for frame.origin. -@property (nonatomic, getter=frameSize, setter=setFrameSize:) CGSize size; ///< Shortcut for frame.size. - - -@property (nonatomic) CGFloat transformRotation; ///< key path "tranform.rotation" -@property (nonatomic) CGFloat transformRotationX; ///< key path "tranform.rotation.x" -@property (nonatomic) CGFloat transformRotationY; ///< key path "tranform.rotation.y" -@property (nonatomic) CGFloat transformRotationZ; ///< key path "tranform.rotation.z" -@property (nonatomic) CGFloat transformScale; ///< key path "tranform.scale" -@property (nonatomic) CGFloat transformScaleX; ///< key path "tranform.scale.x" -@property (nonatomic) CGFloat transformScaleY; ///< key path "tranform.scale.y" -@property (nonatomic) CGFloat transformScaleZ; ///< key path "tranform.scale.z" -@property (nonatomic) CGFloat transformTranslationX; ///< key path "tranform.translation.x" -@property (nonatomic) CGFloat transformTranslationY; ///< key path "tranform.translation.y" -@property (nonatomic) CGFloat transformTranslationZ; ///< key path "tranform.translation.z" - -/** - Shortcut for transform.m34, -1/1000 is a good value. - It should be set before other transform shortcut. - */ -@property (nonatomic) CGFloat transformDepth; - -/** - Wrapper for `contentsGravity` property. - */ -@property (nonatomic) UIViewContentMode contentMode; - -/** - Add a fade animation to layer's contents when the contents is changed. - - @param duration Animation duration - @param curve Animation curve. - */ -- (void)addFadeAnimationWithDuration:(NSTimeInterval)duration curve:(UIViewAnimationCurve)curve; - -/** - Cancel fade animation which is added with "-addFadeAnimationWithDuration:curve:". - */ -- (void)removePreviousFadeAnimation; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Quartz/CALayer+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/Quartz/CALayer+YYAdd.m deleted file mode 100644 index 31efbffb..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Quartz/CALayer+YYAdd.m +++ /dev/null @@ -1,324 +0,0 @@ -// -// CALayer+YYAdd.m -// YYCategories -// -// Created by ibireme on 14/5/10. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "CALayer+YYAdd.h" -#import "YYCategoriesMacro.h" -#import "YYCGUtilities.h" - -YYSYNTH_DUMMY_CLASS(CALayer_YYAdd) - - -@implementation CALayer (YYAdd) - -- (UIImage *)snapshotImage { - UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - [self renderInContext:context]; - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -- (NSData *)snapshotPDF { - CGRect bounds = self.bounds; - NSMutableData* data = [NSMutableData data]; - CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData((__bridge CFMutableDataRef)data); - CGContextRef context = CGPDFContextCreate(consumer, &bounds, NULL); - CGDataConsumerRelease(consumer); - if (!context) return nil; - CGPDFContextBeginPage(context, NULL); - CGContextTranslateCTM(context, 0, bounds.size.height); - CGContextScaleCTM(context, 1.0, -1.0); - [self renderInContext:context]; - CGPDFContextEndPage(context); - CGPDFContextClose(context); - CGContextRelease(context); - return data; -} - -- (void)setLayerShadow:(UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius { - self.shadowColor = color.CGColor; - self.shadowOffset = offset; - self.shadowRadius = radius; - self.shadowOpacity = 1; - self.shouldRasterize = YES; - self.rasterizationScale = [UIScreen mainScreen].scale; -} - -- (void)removeAllSublayers { - while (self.sublayers.count) { - [self.sublayers.lastObject removeFromSuperlayer]; - } -} - -- (CGFloat)left { - return self.frame.origin.x; -} - -- (void)setLeft:(CGFloat)x { - CGRect frame = self.frame; - frame.origin.x = x; - self.frame = frame; -} - -- (CGFloat)top { - return self.frame.origin.y; -} - -- (void)setTop:(CGFloat)y { - CGRect frame = self.frame; - frame.origin.y = y; - self.frame = frame; -} - -- (CGFloat)right { - return self.frame.origin.x + self.frame.size.width; -} - -- (void)setRight:(CGFloat)right { - CGRect frame = self.frame; - frame.origin.x = right - frame.size.width; - self.frame = frame; -} - -- (CGFloat)bottom { - return self.frame.origin.y + self.frame.size.height; -} - -- (void)setBottom:(CGFloat)bottom { - CGRect frame = self.frame; - frame.origin.y = bottom - frame.size.height; - self.frame = frame; -} - -- (CGFloat)width { - return self.frame.size.width; -} - -- (void)setWidth:(CGFloat)width { - CGRect frame = self.frame; - frame.size.width = width; - self.frame = frame; -} - -- (CGFloat)height { - return self.frame.size.height; -} - -- (void)setHeight:(CGFloat)height { - CGRect frame = self.frame; - frame.size.height = height; - self.frame = frame; -} - -- (CGPoint)center { - return CGPointMake(self.frame.origin.x + self.frame.size.width * 0.5, - self.frame.origin.y + self.frame.size.height * 0.5); -} - -- (void)setCenter:(CGPoint)center { - CGRect frame = self.frame; - frame.origin.x = center.x - frame.size.width * 0.5; - frame.origin.y = center.y - frame.size.height * 0.5; - self.frame = frame; -} - -- (CGFloat)centerX { - return self.frame.origin.x + self.frame.size.width * 0.5; -} - -- (void)setCenterX:(CGFloat)centerX { - CGRect frame = self.frame; - frame.origin.x = centerX - frame.size.width * 0.5; - self.frame = frame; -} - -- (CGFloat)centerY { - return self.frame.origin.y + self.frame.size.height * 0.5; -} - -- (void)setCenterY:(CGFloat)centerY { - CGRect frame = self.frame; - frame.origin.y = centerY - frame.size.height * 0.5; - self.frame = frame; -} - -- (CGPoint)origin { - return self.frame.origin; -} - -- (void)setOrigin:(CGPoint)origin { - CGRect frame = self.frame; - frame.origin = origin; - self.frame = frame; -} - -- (CGSize)frameSize { - return self.frame.size; -} - -- (void)setFrameSize:(CGSize)size { - CGRect frame = self.frame; - frame.size = size; - self.frame = frame; -} - -- (CGFloat)transformRotation { - NSNumber *v = [self valueForKeyPath:@"transform.rotation"]; - return v.doubleValue; -} - -- (void)setTransformRotation:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.rotation"]; -} - -- (CGFloat)transformRotationX { - NSNumber *v = [self valueForKeyPath:@"transform.rotation.x"]; - return v.doubleValue; -} - -- (void)setTransformRotationX:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.rotation.x"]; -} - -- (CGFloat)transformRotationY { - NSNumber *v = [self valueForKeyPath:@"transform.rotation.y"]; - return v.doubleValue; -} - -- (void)setTransformRotationY:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.rotation.y"]; -} - -- (CGFloat)transformRotationZ { - NSNumber *v = [self valueForKeyPath:@"transform.rotation.z"]; - return v.doubleValue; -} - -- (void)setTransformRotationZ:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.rotation.z"]; -} - -- (CGFloat)transformScaleX { - NSNumber *v = [self valueForKeyPath:@"transform.scale.x"]; - return v.doubleValue; -} - -- (void)setTransformScaleX:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.scale.x"]; -} - -- (CGFloat)transformScaleY { - NSNumber *v = [self valueForKeyPath:@"transform.scale.y"]; - return v.doubleValue; -} - -- (void)setTransformScaleY:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.scale.y"]; -} - -- (CGFloat)transformScaleZ { - NSNumber *v = [self valueForKeyPath:@"transform.scale.z"]; - return v.doubleValue; -} - -- (void)setTransformScaleZ:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.scale.z"]; -} - -- (CGFloat)transformScale { - NSNumber *v = [self valueForKeyPath:@"transform.scale"]; - return v.doubleValue; -} - -- (void)setTransformScale:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.scale"]; -} - -- (CGFloat)transformTranslationX { - NSNumber *v = [self valueForKeyPath:@"transform.translation.x"]; - return v.doubleValue; -} - -- (void)setTransformTranslationX:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.translation.x"]; -} - -- (CGFloat)transformTranslationY { - NSNumber *v = [self valueForKeyPath:@"transform.translation.y"]; - return v.doubleValue; -} - -- (void)setTransformTranslationY:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.translation.y"]; -} - -- (CGFloat)transformTranslationZ { - NSNumber *v = [self valueForKeyPath:@"transform.translation.z"]; - return v.doubleValue; -} - -- (void)setTransformTranslationZ:(CGFloat)v { - [self setValue:@(v) forKeyPath:@"transform.translation.z"]; -} - -- (CGFloat)transformDepth { - return self.transform.m34; -} - -- (void)setTransformDepth:(CGFloat)v { - CATransform3D d = self.transform; - d.m34 = v; - self.transform = d; -} - -- (UIViewContentMode)contentMode { - return YYCAGravityToUIViewContentMode(self.contentsGravity); -} - -- (void)setContentMode:(UIViewContentMode)contentMode { - self.contentsGravity = YYUIViewContentModeToCAGravity(contentMode); -} - -- (void)addFadeAnimationWithDuration:(NSTimeInterval)duration curve:(UIViewAnimationCurve)curve { - if (duration <= 0) return; - - NSString *mediaFunction; - switch (curve) { - case UIViewAnimationCurveEaseInOut: { - mediaFunction = kCAMediaTimingFunctionEaseInEaseOut; - } break; - case UIViewAnimationCurveEaseIn: { - mediaFunction = kCAMediaTimingFunctionEaseIn; - } break; - case UIViewAnimationCurveEaseOut: { - mediaFunction = kCAMediaTimingFunctionEaseOut; - } break; - case UIViewAnimationCurveLinear: { - mediaFunction = kCAMediaTimingFunctionLinear; - } break; - default: { - mediaFunction = kCAMediaTimingFunctionLinear; - } break; - } - - CATransition *transition = [CATransition animation]; - transition.duration = duration; - transition.timingFunction = [CAMediaTimingFunction functionWithName:mediaFunction]; - transition.type = kCATransitionFade; - [self addAnimation:transition forKey:@"yykit.fade"]; -} - -- (void)removePreviousFadeAnimation { - [self removeAnimationForKey:@"yykit.fade"]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/Quartz/YYCGUtilities.h b/iOSProject/Pods/YYCategories/YYCategories/Quartz/YYCGUtilities.h deleted file mode 100644 index 96cc4516..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Quartz/YYCGUtilities.h +++ /dev/null @@ -1,330 +0,0 @@ -// -// YYCGUtilities.h -// YYCategories -// -// Created by ibireme on 15/2/28. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/// Create an `ARGB` Bitmap context. Returns NULL if an error occurs. -/// -/// @discussion The function is same as UIGraphicsBeginImageContextWithOptions(), -/// but it doesn't push the context to UIGraphic, so you can retain the context for reuse. -CGContextRef _Nullable YYCGContextCreateARGBBitmapContext(CGSize size, BOOL opaque, CGFloat scale); - -/// Create a `DeviceGray` Bitmap context. Returns NULL if an error occurs. -CGContextRef _Nullable YYCGContextCreateGrayBitmapContext(CGSize size, CGFloat scale); - - - -/// Get main screen's scale. -CGFloat YYScreenScale(); - -/// Get main screen's size. Height is always larger than width. -CGSize YYScreenSize(); - - - -/// Convert degrees to radians. -static inline CGFloat DegreesToRadians(CGFloat degrees) { - return degrees * M_PI / 180; -} - -/// Convert radians to degrees. -static inline CGFloat RadiansToDegrees(CGFloat radians) { - return radians * 180 / M_PI; -} - - - -/// Get the transform rotation. -/// @return the rotation in radians [-PI,PI] ([-180°,180°]) -static inline CGFloat CGAffineTransformGetRotation(CGAffineTransform transform) { - return atan2(transform.b, transform.a); -} - -/// Get the transform's scale.x -static inline CGFloat CGAffineTransformGetScaleX(CGAffineTransform transform) { - return sqrt(transform.a * transform.a + transform.c * transform.c); -} - -/// Get the transform's scale.y -static inline CGFloat CGAffineTransformGetScaleY(CGAffineTransform transform) { - return sqrt(transform.b * transform.b + transform.d * transform.d); -} - -/// Get the transform's translate.x -static inline CGFloat CGAffineTransformGetTranslateX(CGAffineTransform transform) { - return transform.tx; -} - -/// Get the transform's translate.y -static inline CGFloat CGAffineTransformGetTranslateY(CGAffineTransform transform) { - return transform.ty; -} - -/** - If you have 3 pair of points transformed by a same CGAffineTransform: - p1 (transform->) q1 - p2 (transform->) q2 - p3 (transform->) q3 - This method returns the original transform matrix from these 3 pair of points. - - @see http://stackoverflow.com/questions/13291796/calculate-values-for-a-cgaffinetransform-from-three-points-in-each-of-two-uiview - */ -CGAffineTransform YYCGAffineTransformGetFromPoints(CGPoint before[3], CGPoint after[3]); - -/// Get the transform which can converts a point from the coordinate system of a given view to another. -CGAffineTransform YYCGAffineTransformGetFromViews(UIView *from, UIView *to); - -/// Create a skew transform. -static inline CGAffineTransform CGAffineTransformMakeSkew(CGFloat x, CGFloat y){ - CGAffineTransform transform = CGAffineTransformIdentity; - transform.c = -x; - transform.b = y; - return transform; -} - -/// Negates/inverts a UIEdgeInsets. -static inline UIEdgeInsets UIEdgeInsetsInvert(UIEdgeInsets insets) { - return UIEdgeInsetsMake(-insets.top, -insets.left, -insets.bottom, -insets.right); -} - -/// Convert CALayer's gravity string to UIViewContentMode. -UIViewContentMode YYCAGravityToUIViewContentMode(NSString *gravity); - -/// Convert UIViewContentMode to CALayer's gravity string. -NSString *YYUIViewContentModeToCAGravity(UIViewContentMode contentMode); - - - -/** - Returns a rectangle to fit the @param rect with specified content mode. - - @param rect The constrant rect - @param size The content size - @param mode The content mode - @return A rectangle for the given content mode. - @discussion UIViewContentModeRedraw is same as UIViewContentModeScaleToFill. - */ -CGRect YYCGRectFitWithContentMode(CGRect rect, CGSize size, UIViewContentMode mode); - -/// Returns the center for the rectangle. -static inline CGPoint CGRectGetCenter(CGRect rect) { - return CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)); -} - -/// Returns the area of the rectangle. -static inline CGFloat CGRectGetArea(CGRect rect) { - if (CGRectIsNull(rect)) return 0; - rect = CGRectStandardize(rect); - return rect.size.width * rect.size.height; -} - -/// Returns the distance between two points. -static inline CGFloat CGPointGetDistanceToPoint(CGPoint p1, CGPoint p2) { - return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y)); -} - -/// Returns the minmium distance between a point to a rectangle. -static inline CGFloat CGPointGetDistanceToRect(CGPoint p, CGRect r) { - r = CGRectStandardize(r); - if (CGRectContainsPoint(r, p)) return 0; - CGFloat distV, distH; - if (CGRectGetMinY(r) <= p.y && p.y <= CGRectGetMaxY(r)) { - distV = 0; - } else { - distV = p.y < CGRectGetMinY(r) ? CGRectGetMinY(r) - p.y : p.y - CGRectGetMaxY(r); - } - if (CGRectGetMinX(r) <= p.x && p.x <= CGRectGetMaxX(r)) { - distH = 0; - } else { - distH = p.x < CGRectGetMinX(r) ? CGRectGetMinX(r) - p.x : p.x - CGRectGetMaxX(r); - } - return MAX(distV, distH); -} - - - -/// Convert point to pixel. -static inline CGFloat CGFloatToPixel(CGFloat value) { - return value * YYScreenScale(); -} - -/// Convert pixel to point. -static inline CGFloat CGFloatFromPixel(CGFloat value) { - return value / YYScreenScale(); -} - - - -/// floor point value for pixel-aligned -static inline CGFloat CGFloatPixelFloor(CGFloat value) { - CGFloat scale = YYScreenScale(); - return floor(value * scale) / scale; -} - -/// round point value for pixel-aligned -static inline CGFloat CGFloatPixelRound(CGFloat value) { - CGFloat scale = YYScreenScale(); - return round(value * scale) / scale; -} - -/// ceil point value for pixel-aligned -static inline CGFloat CGFloatPixelCeil(CGFloat value) { - CGFloat scale = YYScreenScale(); - return ceil(value * scale) / scale; -} - -/// round point value to .5 pixel for path stroke (odd pixel line width pixel-aligned) -static inline CGFloat CGFloatPixelHalf(CGFloat value) { - CGFloat scale = YYScreenScale(); - return (floor(value * scale) + 0.5) / scale; -} - - - -/// floor point value for pixel-aligned -static inline CGPoint CGPointPixelFloor(CGPoint point) { - CGFloat scale = YYScreenScale(); - return CGPointMake(floor(point.x * scale) / scale, - floor(point.y * scale) / scale); -} - -/// round point value for pixel-aligned -static inline CGPoint CGPointPixelRound(CGPoint point) { - CGFloat scale = YYScreenScale(); - return CGPointMake(round(point.x * scale) / scale, - round(point.y * scale) / scale); -} - -/// ceil point value for pixel-aligned -static inline CGPoint CGPointPixelCeil(CGPoint point) { - CGFloat scale = YYScreenScale(); - return CGPointMake(ceil(point.x * scale) / scale, - ceil(point.y * scale) / scale); -} - -/// round point value to .5 pixel for path stroke (odd pixel line width pixel-aligned) -static inline CGPoint CGPointPixelHalf(CGPoint point) { - CGFloat scale = YYScreenScale(); - return CGPointMake((floor(point.x * scale) + 0.5) / scale, - (floor(point.y * scale) + 0.5) / scale); -} - - - -/// floor point value for pixel-aligned -static inline CGSize CGSizePixelFloor(CGSize size) { - CGFloat scale = YYScreenScale(); - return CGSizeMake(floor(size.width * scale) / scale, - floor(size.height * scale) / scale); -} - -/// round point value for pixel-aligned -static inline CGSize CGSizePixelRound(CGSize size) { - CGFloat scale = YYScreenScale(); - return CGSizeMake(round(size.width * scale) / scale, - round(size.height * scale) / scale); -} - -/// ceil point value for pixel-aligned -static inline CGSize CGSizePixelCeil(CGSize size) { - CGFloat scale = YYScreenScale(); - return CGSizeMake(ceil(size.width * scale) / scale, - ceil(size.height * scale) / scale); -} - -/// round point value to .5 pixel for path stroke (odd pixel line width pixel-aligned) -static inline CGSize CGSizePixelHalf(CGSize size) { - CGFloat scale = YYScreenScale(); - return CGSizeMake((floor(size.width * scale) + 0.5) / scale, - (floor(size.height * scale) + 0.5) / scale); -} - - - -/// floor point value for pixel-aligned -static inline CGRect CGRectPixelFloor(CGRect rect) { - CGPoint origin = CGPointPixelCeil(rect.origin); - CGPoint corner = CGPointPixelFloor(CGPointMake(rect.origin.x + rect.size.width, - rect.origin.y + rect.size.height)); - CGRect ret = CGRectMake(origin.x, origin.y, corner.x - origin.x, corner.y - origin.y); - if (ret.size.width < 0) ret.size.width = 0; - if (ret.size.height < 0) ret.size.height = 0; - return ret; -} - -/// round point value for pixel-aligned -static inline CGRect CGRectPixelRound(CGRect rect) { - CGPoint origin = CGPointPixelRound(rect.origin); - CGPoint corner = CGPointPixelRound(CGPointMake(rect.origin.x + rect.size.width, - rect.origin.y + rect.size.height)); - return CGRectMake(origin.x, origin.y, corner.x - origin.x, corner.y - origin.y); -} - -/// ceil point value for pixel-aligned -static inline CGRect CGRectPixelCeil(CGRect rect) { - CGPoint origin = CGPointPixelFloor(rect.origin); - CGPoint corner = CGPointPixelCeil(CGPointMake(rect.origin.x + rect.size.width, - rect.origin.y + rect.size.height)); - return CGRectMake(origin.x, origin.y, corner.x - origin.x, corner.y - origin.y); -} - -/// round point value to .5 pixel for path stroke (odd pixel line width pixel-aligned) -static inline CGRect CGRectPixelHalf(CGRect rect) { - CGPoint origin = CGPointPixelHalf(rect.origin); - CGPoint corner = CGPointPixelHalf(CGPointMake(rect.origin.x + rect.size.width, - rect.origin.y + rect.size.height)); - return CGRectMake(origin.x, origin.y, corner.x - origin.x, corner.y - origin.y); -} - - - -/// floor UIEdgeInset for pixel-aligned -static inline UIEdgeInsets UIEdgeInsetPixelFloor(UIEdgeInsets insets) { - insets.top = CGFloatPixelFloor(insets.top); - insets.left = CGFloatPixelFloor(insets.left); - insets.bottom = CGFloatPixelFloor(insets.bottom); - insets.right = CGFloatPixelFloor(insets.right); - return insets; -} - -/// ceil UIEdgeInset for pixel-aligned -static inline UIEdgeInsets UIEdgeInsetPixelCeil(UIEdgeInsets insets) { - insets.top = CGFloatPixelCeil(insets.top); - insets.left = CGFloatPixelCeil(insets.left); - insets.bottom = CGFloatPixelCeil(insets.bottom); - insets.right = CGFloatPixelCeil(insets.right); - return insets; -} - -// main screen's scale -#ifndef kScreenScale -#define kScreenScale YYScreenScale() -#endif - -// main screen's size (portrait) -#ifndef kScreenSize -#define kScreenSize YYScreenSize() -#endif - -// main screen's width (portrait) -#ifndef kScreenWidth -#define kScreenWidth YYScreenSize().width -#endif - -// main screen's height (portrait) -#ifndef kScreenHeight -#define kScreenHeight YYScreenSize().height -#endif - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/Quartz/YYCGUtilities.m b/iOSProject/Pods/YYCategories/YYCategories/Quartz/YYCGUtilities.m deleted file mode 100644 index 327c5e64..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/Quartz/YYCGUtilities.m +++ /dev/null @@ -1,271 +0,0 @@ -// -// YYCGUtilities.m -// YYCategories -// -// Created by ibireme on 15/2/28. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYCGUtilities.h" -#import -#import "UIView+YYAdd.h" - -CGContextRef YYCGContextCreateARGBBitmapContext(CGSize size, BOOL opaque, CGFloat scale) { - size_t width = ceil(size.width * scale); - size_t height = ceil(size.height * scale); - if (width < 1 || height < 1) return NULL; - - //pre-multiplied ARGB, 8-bits per component - CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); - CGImageAlphaInfo alphaInfo = (opaque ? kCGImageAlphaNoneSkipFirst : kCGImageAlphaPremultipliedFirst); - CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, space, kCGBitmapByteOrderDefault | alphaInfo); - CGColorSpaceRelease(space); - if (context) { - CGContextTranslateCTM(context, 0, height); - CGContextScaleCTM(context, scale, -scale); - } - return context; -} - -CGContextRef YYCGContextCreateGrayBitmapContext(CGSize size, CGFloat scale) { - size_t width = ceil(size.width * scale); - size_t height = ceil(size.height * scale); - if (width < 1 || height < 1) return NULL; - - //DeviceGray, 8-bits per component - CGColorSpaceRef space = CGColorSpaceCreateDeviceGray(); - CGImageAlphaInfo alphaInfo = kCGImageAlphaNone; - CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, space, kCGBitmapByteOrderDefault | alphaInfo); - CGColorSpaceRelease(space); - if (context) { - CGContextTranslateCTM(context, 0, height); - CGContextScaleCTM(context, scale, -scale); - } - return context; -} - -CGFloat YYScreenScale() { - static CGFloat scale; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - scale = [UIScreen mainScreen].scale; - }); - return scale; -} - -CGSize YYScreenSize() { - static CGSize size; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - size = [UIScreen mainScreen].bounds.size; - if (size.height < size.width) { - CGFloat tmp = size.height; - size.height = size.width; - size.width = tmp; - } - }); - return size; -} - -// return 0 when succeed -static int matrix_invert(__CLPK_integer N, double *matrix) { - __CLPK_integer error = 0; - __CLPK_integer pivot_tmp[6 * 6]; - __CLPK_integer *pivot = pivot_tmp; - double workspace_tmp[6 * 6]; - double *workspace = workspace_tmp; - bool need_free = false; - - if (N > 6) { - need_free = true; - pivot = malloc(N * N * sizeof(__CLPK_integer)); - if (!pivot) return -1; - workspace = malloc(N * sizeof(double)); - if (!workspace) { - free(pivot); - return -1; - } - } - - dgetrf_(&N, &N, matrix, &N, pivot, &error); - - if (error == 0) { - dgetri_(&N, matrix, &N, pivot, workspace, &N, &error); - } - - if (need_free) { - free(pivot); - free(workspace); - } - return error; -} - -CGAffineTransform YYCGAffineTransformGetFromPoints(CGPoint before[3], CGPoint after[3]) { - if (before == NULL || after == NULL) return CGAffineTransformIdentity; - - CGPoint p1, p2, p3, q1, q2, q3; - p1 = before[0]; p2 = before[1]; p3 = before[2]; - q1 = after[0]; q2 = after[1]; q3 = after[2]; - - double A[36]; - A[ 0] = p1.x; A[ 1] = p1.y; A[ 2] = 0; A[ 3] = 0; A[ 4] = 1; A[ 5] = 0; - A[ 6] = 0; A[ 7] = 0; A[ 8] = p1.x; A[ 9] = p1.y; A[10] = 0; A[11] = 1; - A[12] = p2.x; A[13] = p2.y; A[14] = 0; A[15] = 0; A[16] = 1; A[17] = 0; - A[18] = 0; A[19] = 0; A[20] = p2.x; A[21] = p2.y; A[22] = 0; A[23] = 1; - A[24] = p3.x; A[25] = p3.y; A[26] = 0; A[27] = 0; A[28] = 1; A[29] = 0; - A[30] = 0; A[31] = 0; A[32] = p3.x; A[33] = p3.y; A[34] = 0; A[35] = 1; - - int error = matrix_invert(6, A); - if (error) return CGAffineTransformIdentity; - - double B[6]; - B[0] = q1.x; B[1] = q1.y; B[2] = q2.x; B[3] = q2.y; B[4] = q3.x; B[5] = q3.y; - - double M[6]; - M[0] = A[ 0] * B[0] + A[ 1] * B[1] + A[ 2] * B[2] + A[ 3] * B[3] + A[ 4] * B[4] + A[ 5] * B[5]; - M[1] = A[ 6] * B[0] + A[ 7] * B[1] + A[ 8] * B[2] + A[ 9] * B[3] + A[10] * B[4] + A[11] * B[5]; - M[2] = A[12] * B[0] + A[13] * B[1] + A[14] * B[2] + A[15] * B[3] + A[16] * B[4] + A[17] * B[5]; - M[3] = A[18] * B[0] + A[19] * B[1] + A[20] * B[2] + A[21] * B[3] + A[22] * B[4] + A[23] * B[5]; - M[4] = A[24] * B[0] + A[25] * B[1] + A[26] * B[2] + A[27] * B[3] + A[28] * B[4] + A[29] * B[5]; - M[5] = A[30] * B[0] + A[31] * B[1] + A[32] * B[2] + A[33] * B[3] + A[34] * B[4] + A[35] * B[5]; - - CGAffineTransform transform = CGAffineTransformMake(M[0], M[2], M[1], M[3], M[4], M[5]); - return transform; -} - -CGAffineTransform YYCGAffineTransformGetFromViews(UIView *from, UIView *to) { - if (!from || !to) return CGAffineTransformIdentity; - - CGPoint before[3], after[3]; - before[0] = CGPointMake(0, 0); - before[1] = CGPointMake(0, 1); - before[2] = CGPointMake(1, 0); - after[0] = [from convertPoint:before[0] toViewOrWindow:to]; - after[1] = [from convertPoint:before[1] toViewOrWindow:to]; - after[2] = [from convertPoint:before[2] toViewOrWindow:to]; - - return YYCGAffineTransformGetFromPoints(before, after); -} - -UIViewContentMode YYCAGravityToUIViewContentMode(NSString *gravity) { - static NSDictionary *dic; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - dic = @{ kCAGravityCenter:@(UIViewContentModeCenter), - kCAGravityTop:@(UIViewContentModeTop), - kCAGravityBottom:@(UIViewContentModeBottom), - kCAGravityLeft:@(UIViewContentModeLeft), - kCAGravityRight:@(UIViewContentModeRight), - kCAGravityTopLeft:@(UIViewContentModeTopLeft), - kCAGravityTopRight:@(UIViewContentModeTopRight), - kCAGravityBottomLeft:@(UIViewContentModeBottomLeft), - kCAGravityBottomRight:@(UIViewContentModeBottomRight), - kCAGravityResize:@(UIViewContentModeScaleToFill), - kCAGravityResizeAspect:@(UIViewContentModeScaleAspectFit), - kCAGravityResizeAspectFill:@(UIViewContentModeScaleAspectFill) }; - }); - if (!gravity) return UIViewContentModeScaleToFill; - return (UIViewContentMode)((NSNumber *)dic[gravity]).integerValue; -} - -NSString *YYUIViewContentModeToCAGravity(UIViewContentMode contentMode) { - switch (contentMode) { - case UIViewContentModeScaleToFill: return kCAGravityResize; - case UIViewContentModeScaleAspectFit: return kCAGravityResizeAspect; - case UIViewContentModeScaleAspectFill: return kCAGravityResizeAspectFill; - case UIViewContentModeRedraw: return kCAGravityResize; - case UIViewContentModeCenter: return kCAGravityCenter; - case UIViewContentModeTop: return kCAGravityTop; - case UIViewContentModeBottom: return kCAGravityBottom; - case UIViewContentModeLeft: return kCAGravityLeft; - case UIViewContentModeRight: return kCAGravityRight; - case UIViewContentModeTopLeft: return kCAGravityTopLeft; - case UIViewContentModeTopRight: return kCAGravityTopRight; - case UIViewContentModeBottomLeft: return kCAGravityBottomLeft; - case UIViewContentModeBottomRight: return kCAGravityBottomRight; - default: return kCAGravityResize; - } -} - -CGRect YYCGRectFitWithContentMode(CGRect rect, CGSize size, UIViewContentMode mode) { - rect = CGRectStandardize(rect); - size.width = size.width < 0 ? -size.width : size.width; - size.height = size.height < 0 ? -size.height : size.height; - CGPoint center = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)); - switch (mode) { - case UIViewContentModeScaleAspectFit: - case UIViewContentModeScaleAspectFill: { - if (rect.size.width < 0.01 || rect.size.height < 0.01 || - size.width < 0.01 || size.height < 0.01) { - rect.origin = center; - rect.size = CGSizeZero; - } else { - CGFloat scale; - if (mode == UIViewContentModeScaleAspectFit) { - if (size.width / size.height < rect.size.width / rect.size.height) { - scale = rect.size.height / size.height; - } else { - scale = rect.size.width / size.width; - } - } else { - if (size.width / size.height < rect.size.width / rect.size.height) { - scale = rect.size.width / size.width; - } else { - scale = rect.size.height / size.height; - } - } - size.width *= scale; - size.height *= scale; - rect.size = size; - rect.origin = CGPointMake(center.x - size.width * 0.5, center.y - size.height * 0.5); - } - } break; - case UIViewContentModeCenter: { - rect.size = size; - rect.origin = CGPointMake(center.x - size.width * 0.5, center.y - size.height * 0.5); - } break; - case UIViewContentModeTop: { - rect.origin.x = center.x - size.width * 0.5; - rect.size = size; - } break; - case UIViewContentModeBottom: { - rect.origin.x = center.x - size.width * 0.5; - rect.origin.y += rect.size.height - size.height; - rect.size = size; - } break; - case UIViewContentModeLeft: { - rect.origin.y = center.y - size.height * 0.5; - rect.size = size; - } break; - case UIViewContentModeRight: { - rect.origin.y = center.y - size.height * 0.5; - rect.origin.x += rect.size.width - size.width; - rect.size = size; - } break; - case UIViewContentModeTopLeft: { - rect.size = size; - } break; - case UIViewContentModeTopRight: { - rect.origin.x += rect.size.width - size.width; - rect.size = size; - } break; - case UIViewContentModeBottomLeft: { - rect.origin.y += rect.size.height - size.height; - rect.size = size; - } break; - case UIViewContentModeBottomRight: { - rect.origin.x += rect.size.width - size.width; - rect.origin.y += rect.size.height - size.height; - rect.size = size; - } break; - case UIViewContentModeScaleToFill: - case UIViewContentModeRedraw: - default: { - rect = rect; - } - } - return rect; -} diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIApplication+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIApplication+YYAdd.h deleted file mode 100644 index 1551eb9d..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIApplication+YYAdd.h +++ /dev/null @@ -1,85 +0,0 @@ -// -// UIApplication+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIApplication`. - */ -@interface UIApplication (YYAdd) - -/// "Documents" folder in this app's sandbox. -@property (nonatomic, readonly) NSURL *documentsURL; -@property (nonatomic, readonly) NSString *documentsPath; - -/// "Caches" folder in this app's sandbox. -@property (nonatomic, readonly) NSURL *cachesURL; -@property (nonatomic, readonly) NSString *cachesPath; - -/// "Library" folder in this app's sandbox. -@property (nonatomic, readonly) NSURL *libraryURL; -@property (nonatomic, readonly) NSString *libraryPath; - -/// Application's Bundle Name (show in SpringBoard). -@property (nullable, nonatomic, readonly) NSString *appBundleName; - -/// Application's Bundle ID. e.g. "com.ibireme.MyApp" -@property (nullable, nonatomic, readonly) NSString *appBundleID; - -/// Application's Version. e.g. "1.2.0" -@property (nullable, nonatomic, readonly) NSString *appVersion; - -/// Application's Build number. e.g. "123" -@property (nullable, nonatomic, readonly) NSString *appBuildVersion; - -/// Whether this app is priated (not install from appstore). -@property (nonatomic, readonly) BOOL isPirated; - -/// Whether this app is being debugged (debugger attached). -@property (nonatomic, readonly) BOOL isBeingDebugged; - -/// Current thread real memory used in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t memoryUsage; - -/// Current thread CPU usage, 1.0 means 100%. (-1 when error occurs) -@property (nonatomic, readonly) float cpuUsage; - - -/** - Increments the number of active network requests. - If this number was zero before incrementing, this will start animating the - status bar network activity indicator. - - This method is thread safe. - */ -- (void)incrementNetworkActivityCount; - -/** - Decrements the number of active network requests. - If this number becomes zero after decrementing, this will stop animating the - status bar network activity indicator. - - This method is thread safe. - */ -- (void)decrementNetworkActivityCount; - - -/// Returns YES in App Extension. -+ (BOOL)isAppExtension; - -/// Same as sharedApplication, but returns nil in App Extension. -+ (nullable UIApplication *)sharedExtensionApplication; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIApplication+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIApplication+YYAdd.m deleted file mode 100644 index 4ea2647b..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIApplication+YYAdd.m +++ /dev/null @@ -1,239 +0,0 @@ -// -// UIApplication+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIApplication+YYAdd.h" -#import "NSArray+YYAdd.h" -#import "NSObject+YYAdd.h" -#import "YYCategoriesMacro.h" -#import "UIDevice+YYAdd.h" -#import -#import -#import - -YYSYNTH_DUMMY_CLASS(UIApplication_YYAdd) - -#define kNetworkIndicatorDelay (1/30.0) -@interface _YYUIApplicationNetworkIndicatorInfo : NSObject -@property (nonatomic, assign) NSInteger count; -@property (nonatomic, strong) NSTimer *timer; -@end - -@implementation _YYUIApplicationNetworkIndicatorInfo -@end - - -@implementation UIApplication (YYAdd) - -- (NSURL *)documentsURL { - return [[[NSFileManager defaultManager] - URLsForDirectory:NSDocumentDirectory - inDomains:NSUserDomainMask] lastObject]; -} - -- (NSString *)documentsPath { - return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; -} - -- (NSURL *)cachesURL { - return [[[NSFileManager defaultManager] - URLsForDirectory:NSCachesDirectory - inDomains:NSUserDomainMask] lastObject]; -} - -- (NSString *)cachesPath { - return [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]; -} - -- (NSURL *)libraryURL { - return [[[NSFileManager defaultManager] - URLsForDirectory:NSLibraryDirectory - inDomains:NSUserDomainMask] lastObject]; -} - -- (NSString *)libraryPath { - return [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) firstObject]; -} - -- (BOOL)isPirated { - if ([[UIDevice currentDevice] isSimulator]) return YES; // Simulator is not from appstore - - if (getgid() <= 10) return YES; // process ID shouldn't be root - - if ([[[NSBundle mainBundle] infoDictionary] objectForKey:@"SignerIdentity"]) { - return YES; - } - - if (![self _yy_fileExistInMainBundle:@"_CodeSignature"]) { - return YES; - } - - if (![self _yy_fileExistInMainBundle:@"SC_Info"]) { - return YES; - } - - //if someone really want to crack your app, this method is useless.. - //you may change this method's name, encrypt the code and do more check.. - return NO; -} - -- (BOOL)_yy_fileExistInMainBundle:(NSString *)name { - NSString *bundlePath = [[NSBundle mainBundle] bundlePath]; - NSString *path = [NSString stringWithFormat:@"%@/%@", bundlePath, name]; - return [[NSFileManager defaultManager] fileExistsAtPath:path]; -} - -- (NSString *)appBundleName { - return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; -} - -- (NSString *)appBundleID { - return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"]; -} - -- (NSString *)appVersion { - return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; -} - -- (NSString *)appBuildVersion { - return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; -} - -- (BOOL)isBeingDebugged { - size_t size = sizeof(struct kinfo_proc); - struct kinfo_proc info; - int ret = 0, name[4]; - memset(&info, 0, sizeof(struct kinfo_proc)); - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID; name[3] = getpid(); - - if (ret == (sysctl(name, 4, &info, &size, NULL, 0))) { - return ret != 0; - } - return (info.kp_proc.p_flag & P_TRACED) ? YES : NO; -} - -- (int64_t)memoryUsage { - struct task_basic_info info; - mach_msg_type_number_t size = sizeof(info); - kern_return_t kern = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &size); - if (kern != KERN_SUCCESS) return -1; - return info.resident_size; -} - -- (float)cpuUsage { - kern_return_t kr; - task_info_data_t tinfo; - mach_msg_type_number_t task_info_count; - - task_info_count = TASK_INFO_MAX; - kr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)tinfo, &task_info_count); - if (kr != KERN_SUCCESS) { - return -1; - } - - thread_array_t thread_list; - mach_msg_type_number_t thread_count; - - thread_info_data_t thinfo; - mach_msg_type_number_t thread_info_count; - - thread_basic_info_t basic_info_th; - - kr = task_threads(mach_task_self(), &thread_list, &thread_count); - if (kr != KERN_SUCCESS) { - return -1; - } - - long tot_sec = 0; - long tot_usec = 0; - float tot_cpu = 0; - int j; - - for (j = 0; j < thread_count; j++) { - thread_info_count = THREAD_INFO_MAX; - kr = thread_info(thread_list[j], THREAD_BASIC_INFO, - (thread_info_t)thinfo, &thread_info_count); - if (kr != KERN_SUCCESS) { - return -1; - } - - basic_info_th = (thread_basic_info_t)thinfo; - - if (!(basic_info_th->flags & TH_FLAGS_IDLE)) { - tot_sec = tot_sec + basic_info_th->user_time.seconds + basic_info_th->system_time.seconds; - tot_usec = tot_usec + basic_info_th->system_time.microseconds + basic_info_th->system_time.microseconds; - tot_cpu = tot_cpu + basic_info_th->cpu_usage / (float)TH_USAGE_SCALE; - } - } - - kr = vm_deallocate(mach_task_self(), (vm_offset_t)thread_list, thread_count * sizeof(thread_t)); - assert(kr == KERN_SUCCESS); - - return tot_cpu; -} - -YYSYNTH_DYNAMIC_PROPERTY_OBJECT(networkActivityInfo, setNetworkActivityInfo, RETAIN_NONATOMIC, _YYUIApplicationNetworkIndicatorInfo *); - -- (void)_delaySetActivity:(NSTimer *)timer { - NSNumber *visiable = timer.userInfo; - if (self.networkActivityIndicatorVisible != visiable.boolValue) { - [self setNetworkActivityIndicatorVisible:visiable.boolValue]; - } - [timer invalidate]; -} - -- (void)_changeNetworkActivityCount:(NSInteger)delta { - @synchronized(self){ - dispatch_async_on_main_queue(^{ - _YYUIApplicationNetworkIndicatorInfo *info = [self networkActivityInfo]; - if (!info) { - info = [_YYUIApplicationNetworkIndicatorInfo new]; - [self setNetworkActivityInfo:info]; - } - NSInteger count = info.count; - count += delta; - info.count = count; - [info.timer invalidate]; - info.timer = [NSTimer timerWithTimeInterval:kNetworkIndicatorDelay target:self selector:@selector(_delaySetActivity:) userInfo:@(info.count > 0) repeats:NO]; - [[NSRunLoop mainRunLoop] addTimer:info.timer forMode:NSRunLoopCommonModes]; - }); - } -} - -- (void)incrementNetworkActivityCount { - [self _changeNetworkActivityCount:1]; -} - -- (void)decrementNetworkActivityCount { - [self _changeNetworkActivityCount:-1]; -} - -+ (BOOL)isAppExtension { - static BOOL isAppExtension = NO; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - Class cls = NSClassFromString(@"UIApplication"); - if(!cls || ![cls respondsToSelector:@selector(sharedApplication)]) isAppExtension = YES; - if ([[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"]) isAppExtension = YES; - }); - return isAppExtension; -} - -+ (UIApplication *)sharedExtensionApplication { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundeclared-selector" - return [self isAppExtension] ? nil : [UIApplication performSelector:@selector(sharedApplication)]; -#pragma clang diagnostic pop -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBarButtonItem+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBarButtonItem+YYAdd.h deleted file mode 100644 index 75d5052c..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBarButtonItem+YYAdd.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// UIBarButtonItem+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/10/15. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIBarButtonItem`. - */ -@interface UIBarButtonItem (YYAdd) - -/** - The block that invoked when the item is selected. The objects captured by block - will retained by the ButtonItem. - - @discussion This param is conflict with `target` and `action` property. - Set this will set `target` and `action` property to some internal objects. - */ -@property (nullable, nonatomic, copy) void (^actionBlock)(id); - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBarButtonItem+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBarButtonItem+YYAdd.m deleted file mode 100644 index 354650bc..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBarButtonItem+YYAdd.m +++ /dev/null @@ -1,62 +0,0 @@ -// -// UIBarButtonItem+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/10/15. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIBarButtonItem+YYAdd.h" -#import "YYCategoriesMacro.h" -#import - -YYSYNTH_DUMMY_CLASS(UIBarButtonItem_YYAdd) - - -static const int block_key; - -@interface _YYUIBarButtonItemBlockTarget : NSObject - -@property (nonatomic, copy) void (^block)(id sender); - -- (id)initWithBlock:(void (^)(id sender))block; -- (void)invoke:(id)sender; - -@end - -@implementation _YYUIBarButtonItemBlockTarget - -- (id)initWithBlock:(void (^)(id sender))block{ - self = [super init]; - if (self) { - _block = [block copy]; - } - return self; -} - -- (void)invoke:(id)sender { - if (self.block) self.block(sender); -} - -@end - - -@implementation UIBarButtonItem (YYAdd) - -- (void)setActionBlock:(void (^)(id sender))block { - _YYUIBarButtonItemBlockTarget *target = [[_YYUIBarButtonItemBlockTarget alloc] initWithBlock:block]; - objc_setAssociatedObject(self, &block_key, target, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - - [self setTarget:target]; - [self setAction:@selector(invoke:)]; -} - -- (void (^)(id)) actionBlock { - _YYUIBarButtonItemBlockTarget *target = objc_getAssociatedObject(self, &block_key); - return target.block; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBezierPath+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBezierPath+YYAdd.h deleted file mode 100644 index a26cbc62..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBezierPath+YYAdd.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// UIBezierPath+YYAdd.h -// YYCategories -// -// Created by ibireme on 14/10/30. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIBezierPath`. - */ -@interface UIBezierPath (YYAdd) - -/** - Creates and returns a new UIBezierPath object initialized with the text glyphs - generated from the specified font. - - @discussion It doesnot support apple emoji. If you want get emoji image, try - [UIImage imageWithEmoji:size:] in `UIImage(YYAdd)`. - - @param text The text to generate glyph path. - @param font The font to generate glyph path. - - @return A new path object with the text and font, or nil if an error occurs. - */ -+ (nullable UIBezierPath *)bezierPathWithText:(NSString *)text font:(UIFont *)font; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBezierPath+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBezierPath+YYAdd.m deleted file mode 100644 index 7e82fdf2..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIBezierPath+YYAdd.m +++ /dev/null @@ -1,64 +0,0 @@ -// -// UIBezierPath+YYAdd.m -// YYCategories -// -// Created by ibireme on 14/10/30. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIBezierPath+YYAdd.h" -#import "UIFont+YYAdd.h" -#import -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(UIBezierPath_YYAdd) - - -@implementation UIBezierPath (YYAdd) - -+ (UIBezierPath *)bezierPathWithText:(NSString *)text font:(UIFont *)font { - CTFontRef ctFont = font.CTFontRef; - if (!ctFont) return nil; - NSDictionary *attrs = @{ (__bridge id)kCTFontAttributeName:(__bridge id)ctFont }; - NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:text attributes:attrs]; - CFRelease(ctFont); - - CTLineRef line = CTLineCreateWithAttributedString((__bridge CFTypeRef)attrString); - if (!line) return nil; - - CGMutablePathRef cgPath = CGPathCreateMutable(); - CFArrayRef runs = CTLineGetGlyphRuns(line); - for (CFIndex iRun = 0, iRunMax = CFArrayGetCount(runs); iRun < iRunMax; iRun++) { - CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex(runs, iRun); - CTFontRef runFont = CFDictionaryGetValue(CTRunGetAttributes(run), kCTFontAttributeName); - - for (CFIndex iGlyph = 0, iGlyphMax = CTRunGetGlyphCount(run); iGlyph < iGlyphMax; iGlyph++) { - CFRange glyphRange = CFRangeMake(iGlyph, 1); - CGGlyph glyph; - CGPoint position; - CTRunGetGlyphs(run, glyphRange, &glyph); - CTRunGetPositions(run, glyphRange, &position); - - CGPathRef glyphPath = CTFontCreatePathForGlyph(runFont, glyph, NULL); - if (glyphPath) { - CGAffineTransform transform = CGAffineTransformMakeTranslation(position.x, position.y); - CGPathAddPath(cgPath, &transform, glyphPath); - CGPathRelease(glyphPath); - } - } - } - UIBezierPath *path = [UIBezierPath bezierPathWithCGPath:cgPath]; - CGRect boundingBox = CGPathGetPathBoundingBox(cgPath); - CFRelease(cgPath); - CFRelease(line); - - [path applyTransform:CGAffineTransformMakeScale(1.0, -1.0)]; - [path applyTransform:CGAffineTransformMakeTranslation(0.0, boundingBox.size.height)]; - - return path; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIColor+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIColor+YYAdd.h deleted file mode 100644 index 5e703f5a..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIColor+YYAdd.h +++ /dev/null @@ -1,358 +0,0 @@ -// -// UIColor+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -extern void YY_RGB2HSL(CGFloat r, CGFloat g, CGFloat b, - CGFloat *h, CGFloat *s, CGFloat *l); - -extern void YY_HSL2RGB(CGFloat h, CGFloat s, CGFloat l, - CGFloat *r, CGFloat *g, CGFloat *b); - -extern void YY_RGB2HSB(CGFloat r, CGFloat g, CGFloat b, - CGFloat *h, CGFloat *s, CGFloat *v); - -extern void YY_HSB2RGB(CGFloat h, CGFloat s, CGFloat v, - CGFloat *r, CGFloat *g, CGFloat *b); - -extern void YY_RGB2CMYK(CGFloat r, CGFloat g, CGFloat b, - CGFloat *c, CGFloat *m, CGFloat *y, CGFloat *k); - -extern void YY_CMYK2RGB(CGFloat c, CGFloat m, CGFloat y, CGFloat k, - CGFloat *r, CGFloat *g, CGFloat *b); - -extern void YY_HSB2HSL(CGFloat h, CGFloat s, CGFloat b, - CGFloat *hh, CGFloat *ss, CGFloat *ll); - -extern void YY_HSL2HSB(CGFloat h, CGFloat s, CGFloat l, - CGFloat *hh, CGFloat *ss, CGFloat *bb); - - -/* - Create UIColor with a hex string. - Example: UIColorHex(0xF0F), UIColorHex(66ccff), UIColorHex(#66CCFF88) - - Valid format: #RGB #RGBA #RRGGBB #RRGGBBAA 0xRGB ... - The `#` or "0x" sign is not required. - */ -#ifndef UIColorHex -#define UIColorHex(_hex_) [UIColor colorWithHexString:((__bridge NSString *)CFSTR(#_hex_))] -#endif - -/** - Provide some method for `UIColor` to convert color between - RGB,HSB,HSL,CMYK and Hex. - - | Color space | Meaning | - |-------------|----------------------------------------| - | RGB * | Red, Green, Blue | - | HSB(HSV) * | Hue, Saturation, Brightness (Value) | - | HSL | Hue, Saturation, Lightness | - | CMYK | Cyan, Magenta, Yellow, Black | - - Apple use RGB & HSB default. - - All the value in this category is float number in the range `0.0` to `1.0`. - Values below `0.0` are interpreted as `0.0`, - and values above `1.0` are interpreted as `1.0`. - - If you want convert color between more color space (CIEXYZ,Lab,YUV...), - see https://github.com/ibireme/yy_color_convertor - */ -@interface UIColor (YYAdd) - - -#pragma mark - Create a UIColor Object -///============================================================================= -/// @name Creating a UIColor Object -///============================================================================= - -/** - Creates and returns a color object using the specified opacity - and HSL color space component values. - - @param hue The hue component of the color object in the HSL color space, - specified as a value from 0.0 to 1.0. - - @param saturation The saturation component of the color object in the HSL color space, - specified as a value from 0.0 to 1.0. - - @param lightness The lightness component of the color object in the HSL color space, - specified as a value from 0.0 to 1.0. - - @param alpha The opacity value of the color object, - specified as a value from 0.0 to 1.0. - - @return The color object. The color information represented by this - object is in the device RGB colorspace. - */ -+ (UIColor *)colorWithHue:(CGFloat)hue - saturation:(CGFloat)saturation - lightness:(CGFloat)lightness - alpha:(CGFloat)alpha; - -/** - Creates and returns a color object using the specified opacity - and CMYK color space component values. - - @param cyan The cyan component of the color object in the CMYK color space, - specified as a value from 0.0 to 1.0. - - @param magenta The magenta component of the color object in the CMYK color space, - specified as a value from 0.0 to 1.0. - - @param yellow The yellow component of the color object in the CMYK color space, - specified as a value from 0.0 to 1.0. - - @param black The black component of the color object in the CMYK color space, - specified as a value from 0.0 to 1.0. - - @param alpha The opacity value of the color object, - specified as a value from 0.0 to 1.0. - - @return The color object. The color information represented by this - object is in the device RGB colorspace. - */ -+ (UIColor *)colorWithCyan:(CGFloat)cyan - magenta:(CGFloat)magenta - yellow:(CGFloat)yellow - black:(CGFloat)black - alpha:(CGFloat)alpha; - -/** - Creates and returns a color object using the hex RGB color values. - - @param rgbValue The rgb value such as 0x66ccff. - - @return The color object. The color information represented by this - object is in the device RGB colorspace. - */ -+ (UIColor *)colorWithRGB:(uint32_t)rgbValue; - -/** - Creates and returns a color object using the hex RGBA color values. - - @param rgbaValue The rgb value such as 0x66ccffff. - - @return The color object. The color information represented by this - object is in the device RGB colorspace. - */ -+ (UIColor *)colorWithRGBA:(uint32_t)rgbaValue; - -/** - Creates and returns a color object using the specified opacity and RGB hex value. - - @param rgbValue The rgb value such as 0x66CCFF. - - @param alpha The opacity value of the color object, - specified as a value from 0.0 to 1.0. - - @return The color object. The color information represented by this - object is in the device RGB colorspace. - */ -+ (UIColor *)colorWithRGB:(uint32_t)rgbValue alpha:(CGFloat)alpha; - -/** - Creates and returns a color object from hex string. - - @discussion: - Valid format: #RGB #RGBA #RRGGBB #RRGGBBAA 0xRGB ... - The `#` or "0x" sign is not required. - The alpha will be set to 1.0 if there is no alpha component. - It will return nil when an error occurs in parsing. - - Example: @"0xF0F", @"66ccff", @"#66CCFF88" - - @param hexStr The hex string value for the new color. - - @return An UIColor object from string, or nil if an error occurs. - */ -+ (nullable UIColor *)colorWithHexString:(NSString *)hexStr; - -/** - Creates and returns a color object by add new color. - - @param add the color added - - @param blendMode add color blend mode - */ -- (UIColor *)colorByAddColor:(UIColor *)add blendMode:(CGBlendMode)blendMode; - -/** - Creates and returns a color object by change components. - - @param hueDelta the hue change delta specified as a value - from -1.0 to 1.0. 0 means no change. - - @param saturationDelta the saturation change delta specified as a value - from -1.0 to 1.0. 0 means no change. - - @param brightnessDelta the brightness change delta specified as a value - from -1.0 to 1.0. 0 means no change. - - @param alphaDelta the alpha change delta specified as a value - from -1.0 to 1.0. 0 means no change. - */ -- (UIColor *)colorByChangeHue:(CGFloat)hueDelta - saturation:(CGFloat)saturationDelta - brightness:(CGFloat)brightnessDelta - alpha:(CGFloat)alphaDelta; - - -#pragma mark - Get color's description -///============================================================================= -/// @name Get color's description -///============================================================================= - -/** - Returns the rgb value in hex. - @return hex value of RGB,such as 0x66ccff. - */ -- (uint32_t)rgbValue; - -/** - Returns the rgba value in hex. - - @return hex value of RGBA,such as 0x66ccffff. - */ -- (uint32_t)rgbaValue; - -/** - Returns the color's RGB value as a hex string (lowercase). - Such as @"0066cc". - - It will return nil when the color space is not RGB - - @return The color's value as a hex string. - */ -- (nullable NSString *)hexString; - -/** - Returns the color's RGBA value as a hex string (lowercase). - Such as @"0066ccff". - - It will return nil when the color space is not RGBA - - @return The color's value as a hex string. - */ -- (nullable NSString *)hexStringWithAlpha; - - -#pragma mark - Retrieving Color Information -///============================================================================= -/// @name Retrieving Color Information -///============================================================================= - -/** - Returns the components that make up the color in the HSL color space. - - @param hue On return, the hue component of the color object, - specified as a value between 0.0 and 1.0. - - @param saturation On return, the saturation component of the color object, - specified as a value between 0.0 and 1.0. - - @param lightness On return, the lightness component of the color object, - specified as a value between 0.0 and 1.0. - - @param alpha On return, the alpha component of the color object, - specified as a value between 0.0 and 1.0. - - @return YES if the color could be converted, NO otherwise. - */ -- (BOOL)getHue:(CGFloat *)hue - saturation:(CGFloat *)saturation - lightness:(CGFloat *)lightness - alpha:(CGFloat *)alpha; - -/** - Returns the components that make up the color in the CMYK color space. - - @param cyan On return, the cyan component of the color object, - specified as a value between 0.0 and 1.0. - - @param magenta On return, the magenta component of the color object, - specified as a value between 0.0 and 1.0. - - @param yellow On return, the yellow component of the color object, - specified as a value between 0.0 and 1.0. - - @param black On return, the black component of the color object, - specified as a value between 0.0 and 1.0. - - @param alpha On return, the alpha component of the color object, - specified as a value between 0.0 and 1.0. - - @return YES if the color could be converted, NO otherwise. - */ -- (BOOL)getCyan:(CGFloat *)cyan - magenta:(CGFloat *)magenta - yellow:(CGFloat *)yellow - black:(CGFloat *)black - alpha:(CGFloat *)alpha; - -/** - The color's red component value in RGB color space. - The value of this property is a float in the range `0.0` to `1.0`. - */ -@property (nonatomic, readonly) CGFloat red; - -/** - The color's green component value in RGB color space. - The value of this property is a float in the range `0.0` to `1.0`. - */ -@property (nonatomic, readonly) CGFloat green; - -/** - The color's blue component value in RGB color space. - The value of this property is a float in the range `0.0` to `1.0`. - */ -@property (nonatomic, readonly) CGFloat blue; - -/** - The color's hue component value in HSB color space. - The value of this property is a float in the range `0.0` to `1.0`. - */ -@property (nonatomic, readonly) CGFloat hue; - -/** - The color's saturation component value in HSB color space. - The value of this property is a float in the range `0.0` to `1.0`. - */ -@property (nonatomic, readonly) CGFloat saturation; - -/** - The color's brightness component value in HSB color space. - The value of this property is a float in the range `0.0` to `1.0`. - */ -@property (nonatomic, readonly) CGFloat brightness; - -/** - The color's alpha component value. - The value of this property is a float in the range `0.0` to `1.0`. - */ -@property (nonatomic, readonly) CGFloat alpha; - -/** - The color's colorspace model. - */ -@property (nonatomic, readonly) CGColorSpaceModel colorSpaceModel; - -/** - Readable colorspace string. - */ -@property (nullable, nonatomic, readonly) NSString *colorSpaceString; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIColor+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIColor+YYAdd.m deleted file mode 100644 index c0714ff6..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIColor+YYAdd.m +++ /dev/null @@ -1,472 +0,0 @@ -// -// UIColor+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIColor+YYAdd.h" -#import "NSString+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(UIColor_YYAdd) - - -#define CLAMP_COLOR_VALUE(v) (v) = (v) < 0 ? 0 : (v) > 1 ? 1 : (v) - -void YY_RGB2HSL(CGFloat r, CGFloat g, CGFloat b, - CGFloat *h, CGFloat *s, CGFloat *l) { - CLAMP_COLOR_VALUE(r); - CLAMP_COLOR_VALUE(g); - CLAMP_COLOR_VALUE(b); - - CGFloat max, min, delta, sum; - max = fmaxf(r, fmaxf(g, b)); - min = fminf(r, fminf(g, b)); - delta = max - min; - sum = max + min; - - *l = sum / 2; // Lightness - if (delta == 0) { // No Saturation, so Hue is undefined (achromatic) - *h = *s = 0; - return; - } - *s = delta / (sum < 1 ? sum : 2 - sum); // Saturation - if (r == max) *h = (g - b) / delta / 6; // color between y & m - else if (g == max) *h = (2 + (b - r) / delta) / 6; // color between c & y - else *h = (4 + (r - g) / delta) / 6; // color between m & y - if (*h < 0) *h += 1; -} - -void YY_HSL2RGB(CGFloat h, CGFloat s, CGFloat l, - CGFloat *r, CGFloat *g, CGFloat *b) { - CLAMP_COLOR_VALUE(h); - CLAMP_COLOR_VALUE(s); - CLAMP_COLOR_VALUE(l); - - if (s == 0) { // No Saturation, Hue is undefined (achromatic) - *r = *g = *b = l; - return; - } - - CGFloat q; - q = (l <= 0.5) ? (l * (1 + s)) : (l + s - (l * s)); - if (q <= 0) { - *r = *g = *b = 0.0; - } else { - *r = *g = *b = 0; - int sextant; - CGFloat m, sv, fract, vsf, mid1, mid2; - m = l + l - q; - sv = (q - m) / q; - if (h == 1) h = 0; - h *= 6.0; - sextant = h; - fract = h - sextant; - vsf = q * sv * fract; - mid1 = m + vsf; - mid2 = q - vsf; - switch (sextant) { - case 0: *r = q; *g = mid1; *b = m; break; - case 1: *r = mid2; *g = q; *b = m; break; - case 2: *r = m; *g = q; *b = mid1; break; - case 3: *r = m; *g = mid2; *b = q; break; - case 4: *r = mid1; *g = m; *b = q; break; - case 5: *r = q; *g = m; *b = mid2; break; - } - } -} - -void YY_RGB2HSB(CGFloat r, CGFloat g, CGFloat b, - CGFloat *h, CGFloat *s, CGFloat *v) { - CLAMP_COLOR_VALUE(r); - CLAMP_COLOR_VALUE(g); - CLAMP_COLOR_VALUE(b); - - CGFloat max, min, delta; - max = fmax(r, fmax(g, b)); - min = fmin(r, fmin(g, b)); - delta = max - min; - - *v = max; // Brightness - if (delta == 0) { // No Saturation, so Hue is undefined (achromatic) - *h = *s = 0; - return; - } - *s = delta / max; // Saturation - - if (r == max) *h = (g - b) / delta / 6; // color between y & m - else if (g == max) *h = (2 + (b - r) / delta) / 6; // color between c & y - else *h = (4 + (r - g) / delta) / 6; // color between m & c - if (*h < 0) *h += 1; -} - -void YY_HSB2RGB(CGFloat h, CGFloat s, CGFloat v, - CGFloat *r, CGFloat *g, CGFloat *b) { - CLAMP_COLOR_VALUE(h); - CLAMP_COLOR_VALUE(s); - CLAMP_COLOR_VALUE(v); - - if (s == 0) { - *r = *g = *b = v; // No Saturation, so Hue is undefined (Achromatic) - } else { - int sextant; - CGFloat f, p, q, t; - if (h == 1) h = 0; - h *= 6; - sextant = floor(h); - f = h - sextant; - p = v * (1 - s); - q = v * (1 - s * f); - t = v * (1 - s * (1 - f)); - switch (sextant) { - case 0: *r = v; *g = t; *b = p; break; - case 1: *r = q; *g = v; *b = p; break; - case 2: *r = p; *g = v; *b = t; break; - case 3: *r = p; *g = q; *b = v; break; - case 4: *r = t; *g = p; *b = v; break; - case 5: *r = v; *g = p; *b = q; break; - } - } -} - -void YY_RGB2CMYK(CGFloat r, CGFloat g, CGFloat b, - CGFloat *c, CGFloat *m, CGFloat *y, CGFloat *k) { - CLAMP_COLOR_VALUE(r); - CLAMP_COLOR_VALUE(g); - CLAMP_COLOR_VALUE(b); - - *c = 1 - r; - *m = 1 - g; - *y = 1 - b; - *k = fmin(*c, fmin(*m, *y)); - - if (*k == 1) { - *c = *m = *y = 0; // Pure black - } else { - *c = (*c - *k) / (1 - *k); - *m = (*m - *k) / (1 - *k); - *y = (*y - *k) / (1 - *k); - } -} - -void YY_CMYK2RGB(CGFloat c, CGFloat m, CGFloat y, CGFloat k, - CGFloat *r, CGFloat *g, CGFloat *b) { - CLAMP_COLOR_VALUE(c); - CLAMP_COLOR_VALUE(m); - CLAMP_COLOR_VALUE(y); - CLAMP_COLOR_VALUE(k); - - *r = (1 - c) * (1 - k); - *g = (1 - m) * (1 - k); - *b = (1 - y) * (1 - k); -} - -void YY_HSB2HSL(CGFloat h, CGFloat s, CGFloat b, - CGFloat *hh, CGFloat *ss, CGFloat *ll) { - CLAMP_COLOR_VALUE(h); - CLAMP_COLOR_VALUE(s); - CLAMP_COLOR_VALUE(b); - - *hh = h; - *ll = (2 - s) * b / 2; - if (*ll <= 0.5) { - *ss = (s) / ((2 - s)); - } else { - *ss = (s * b) / (2 - (2 - s) * b); - } -} - -void YY_HSL2HSB(CGFloat h, CGFloat s, CGFloat l, - CGFloat *hh, CGFloat *ss, CGFloat *bb) { - CLAMP_COLOR_VALUE(h); - CLAMP_COLOR_VALUE(s); - CLAMP_COLOR_VALUE(l); - - *hh = h; - if (l <= 0.5) { - *bb = (s + 1) * l; - *ss = (2 * s) / (s + 1); - } else { - *bb = l + s * (1 - l); - *ss = (2 * s * (1 - l)) / *bb; - } -} - -@implementation UIColor (YYAdd) - -+ (UIColor *)colorWithHue:(CGFloat)hue - saturation:(CGFloat)saturation - lightness:(CGFloat)lightness - alpha:(CGFloat)alpha { - CGFloat r, g, b; - YY_HSL2RGB(hue, saturation, lightness, &r, &g, &b); - return [UIColor colorWithRed:r green:g blue:b alpha:alpha]; -} -+ (UIColor *)colorWithCyan:(CGFloat)cyan - magenta:(CGFloat)magenta - yellow:(CGFloat)yellow - black:(CGFloat)black - alpha:(CGFloat)alpha { - CGFloat r, g, b; - YY_CMYK2RGB(cyan, magenta, yellow, black, &r, &g, &b); - return [UIColor colorWithRed:r green:g blue:b alpha:alpha]; -} - -+ (UIColor *)colorWithRGB:(uint32_t)rgbValue { - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0f - green:((rgbValue & 0xFF00) >> 8) / 255.0f - blue:(rgbValue & 0xFF) / 255.0f - alpha:1]; -} - -+ (UIColor *)colorWithRGBA:(uint32_t)rgbaValue { - return [UIColor colorWithRed:((rgbaValue & 0xFF000000) >> 24) / 255.0f - green:((rgbaValue & 0xFF0000) >> 16) / 255.0f - blue:((rgbaValue & 0xFF00) >> 8) / 255.0f - alpha:(rgbaValue & 0xFF) / 255.0f]; -} - -+ (UIColor *)colorWithRGB:(uint32_t)rgbValue alpha:(CGFloat)alpha { - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0f - green:((rgbValue & 0xFF00) >> 8) / 255.0f - blue:(rgbValue & 0xFF) / 255.0f - alpha:alpha]; -} - -- (uint32_t)rgbValue { - CGFloat r = 0, g = 0, b = 0, a = 0; - [self getRed:&r green:&g blue:&b alpha:&a]; - int8_t red = r * 255; - uint8_t green = g * 255; - uint8_t blue = b * 255; - return (red << 16) + (green << 8) + blue; -} - -- (uint32_t)rgbaValue { - CGFloat r = 0, g = 0, b = 0, a = 0; - [self getRed:&r green:&g blue:&b alpha:&a]; - int8_t red = r * 255; - uint8_t green = g * 255; - uint8_t blue = b * 255; - uint8_t alpha = a * 255; - return (red << 24) + (green << 16) + (blue << 8) + alpha; -} - -static inline NSUInteger hexStrToInt(NSString *str) { - uint32_t result = 0; - sscanf([str UTF8String], "%X", &result); - return result; -} - -static BOOL hexStrToRGBA(NSString *str, - CGFloat *r, CGFloat *g, CGFloat *b, CGFloat *a) { - str = [[str stringByTrim] uppercaseString]; - if ([str hasPrefix:@"#"]) { - str = [str substringFromIndex:1]; - } else if ([str hasPrefix:@"0X"]) { - str = [str substringFromIndex:2]; - } - - NSUInteger length = [str length]; - // RGB RGBA RRGGBB RRGGBBAA - if (length != 3 && length != 4 && length != 6 && length != 8) { - return NO; - } - - //RGB,RGBA,RRGGBB,RRGGBBAA - if (length < 5) { - *r = hexStrToInt([str substringWithRange:NSMakeRange(0, 1)]) / 255.0f; - *g = hexStrToInt([str substringWithRange:NSMakeRange(1, 1)]) / 255.0f; - *b = hexStrToInt([str substringWithRange:NSMakeRange(2, 1)]) / 255.0f; - if (length == 4) *a = hexStrToInt([str substringWithRange:NSMakeRange(3, 1)]) / 255.0f; - else *a = 1; - } else { - *r = hexStrToInt([str substringWithRange:NSMakeRange(0, 2)]) / 255.0f; - *g = hexStrToInt([str substringWithRange:NSMakeRange(2, 2)]) / 255.0f; - *b = hexStrToInt([str substringWithRange:NSMakeRange(4, 2)]) / 255.0f; - if (length == 8) *a = hexStrToInt([str substringWithRange:NSMakeRange(6, 2)]) / 255.0f; - else *a = 1; - } - return YES; -} - -+ (instancetype)colorWithHexString:(NSString *)hexStr { - CGFloat r, g, b, a; - if (hexStrToRGBA(hexStr, &r, &g, &b, &a)) { - return [UIColor colorWithRed:r green:g blue:b alpha:a]; - } - return nil; -} - -- (NSString *)hexString { - return [self hexStringWithAlpha:NO]; -} - -- (NSString *)hexStringWithAlpha { - return [self hexStringWithAlpha:YES]; -} - -- (NSString *)hexStringWithAlpha:(BOOL)withAlpha { - CGColorRef color = self.CGColor; - size_t count = CGColorGetNumberOfComponents(color); - const CGFloat *components = CGColorGetComponents(color); - static NSString *stringFormat = @"%02x%02x%02x"; - NSString *hex = nil; - if (count == 2) { - NSUInteger white = (NSUInteger)(components[0] * 255.0f); - hex = [NSString stringWithFormat:stringFormat, white, white, white]; - } else if (count == 4) { - hex = [NSString stringWithFormat:stringFormat, - (NSUInteger)(components[0] * 255.0f), - (NSUInteger)(components[1] * 255.0f), - (NSUInteger)(components[2] * 255.0f)]; - } - - if (hex && withAlpha) { - hex = [hex stringByAppendingFormat:@"%02lx", - (unsigned long)(self.alpha * 255.0 + 0.5)]; - } - return hex; -} - -- (UIColor *)colorByAddColor:(UIColor *)add blendMode:(CGBlendMode)blendMode { - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big; - uint8_t pixel[4] = { 0 }; - CGContextRef context = CGBitmapContextCreate(&pixel, 1, 1, 8, 4, colorSpace, bitmapInfo); - CGContextSetFillColorWithColor(context, self.CGColor); - CGContextFillRect(context, CGRectMake(0, 0, 1, 1)); - CGContextSetBlendMode(context, blendMode); - CGContextSetFillColorWithColor(context, add.CGColor); - CGContextFillRect(context, CGRectMake(0, 0, 1, 1)); - CGContextRelease(context); - CGColorSpaceRelease(colorSpace); - return [UIColor colorWithRed:pixel[0] / 255.0f green:pixel[1] / 255.0f blue:pixel[2] / 255.0f alpha:pixel[3] / 255.0f]; -} - -- (UIColor *)colorByChangeHue:(CGFloat)h saturation:(CGFloat)s brightness:(CGFloat)b alpha:(CGFloat)a { - CGFloat hh, ss, bb, aa; - if (![self getHue:&hh saturation:&ss brightness:&bb alpha:&aa]) { - return self; - } - hh += h; - ss += s; - bb += b; - aa += a; - hh -= (int)hh; - hh = hh < 0 ? hh + 1 : hh; - ss = ss < 0 ? 0 : ss > 1 ? 1 : ss; - bb = bb < 0 ? 0 : bb > 1 ? 1 : bb; - aa = aa < 0 ? 0 : aa > 1 ? 1 : aa; - return [UIColor colorWithHue:hh saturation:ss brightness:bb alpha:aa]; -} - -- (BOOL)getHue:(CGFloat *)hue - saturation:(CGFloat *)saturation - lightness:(CGFloat *)lightness - alpha:(CGFloat *)alpha { - CGFloat r, g, b, a; - if (![self getRed:&r green:&g blue:&b alpha:&a]) { - return NO; - } - YY_RGB2HSL(r, g, b, hue, saturation, lightness); - *alpha = a; - return YES; -} - -- (BOOL)getCyan:(CGFloat *)cyan - magenta:(CGFloat *)magenta - yellow:(CGFloat *)yellow - black:(CGFloat *)black - alpha:(CGFloat *)alpha { - CGFloat r, g, b, a; - if (![self getRed:&r green:&g blue:&b alpha:&a]) { - return NO; - } - YY_RGB2CMYK(r, g, b, cyan, magenta, yellow, black); - *alpha = a; - return YES; -} - -- (CGFloat)red { - CGFloat r = 0, g, b, a; - [self getRed:&r green:&g blue:&b alpha:&a]; - return r; -} - -- (CGFloat)green { - CGFloat r, g = 0, b, a; - [self getRed:&r green:&g blue:&b alpha:&a]; - return g; -} - -- (CGFloat)blue { - CGFloat r, g, b = 0, a; - [self getRed:&r green:&g blue:&b alpha:&a]; - return b; -} - -- (CGFloat)alpha { - return CGColorGetAlpha(self.CGColor); -} - -- (CGFloat)hue { - CGFloat h = 0, s, b, a; - [self getHue:&h saturation:&s brightness:&b alpha:&a]; - return h; -} - -- (CGFloat)saturation { - CGFloat h, s = 0, b, a; - [self getHue:&h saturation:&s brightness:&b alpha:&a]; - return s; -} - -- (CGFloat)brightness { - CGFloat h, s, b = 0, a; - [self getHue:&h saturation:&s brightness:&b alpha:&a]; - return b; -} - -- (CGColorSpaceModel)colorSpaceModel { - return CGColorSpaceGetModel(CGColorGetColorSpace(self.CGColor)); -} - -- (NSString *)colorSpaceString { - CGColorSpaceModel model = CGColorSpaceGetModel(CGColorGetColorSpace(self.CGColor)); - switch (model) { - case kCGColorSpaceModelUnknown: - return @"kCGColorSpaceModelUnknown"; - - case kCGColorSpaceModelMonochrome: - return @"kCGColorSpaceModelMonochrome"; - - case kCGColorSpaceModelRGB: - return @"kCGColorSpaceModelRGB"; - - case kCGColorSpaceModelCMYK: - return @"kCGColorSpaceModelCMYK"; - - case kCGColorSpaceModelLab: - return @"kCGColorSpaceModelLab"; - - case kCGColorSpaceModelDeviceN: - return @"kCGColorSpaceModelDeviceN"; - - case kCGColorSpaceModelIndexed: - return @"kCGColorSpaceModelIndexed"; - - case kCGColorSpaceModelPattern: - return @"kCGColorSpaceModelPattern"; - - default: - return @"ColorSpaceInvalid"; - } -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIControl+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIControl+YYAdd.h deleted file mode 100644 index c48cba19..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIControl+YYAdd.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// UIControl+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/5. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIControl`. - */ -@interface UIControl (YYAdd) - -/** - Removes all targets and actions for a particular event (or events) - from an internal dispatch table. - */ -- (void)removeAllTargets; - -/** - Adds or replaces a target and action for a particular event (or events) - to an internal dispatch table. - - @param target The target object—that is, the object to which the - action message is sent. If this is nil, the responder - chain is searched for an object willing to respond to the - action message. - - @param action A selector identifying an action message. It cannot be NULL. - - @param controlEvents A bitmask specifying the control events for which the - action message is sent. - */ -- (void)setTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents; - -/** - Adds a block for a particular event (or events) to an internal dispatch table. - It will cause a strong reference to @a block. - - @param block The block which is invoked then the action message is - sent (cannot be nil). The block is retained. - - @param controlEvents A bitmask specifying the control events for which the - action message is sent. - */ -- (void)addBlockForControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender))block; - -/** - Adds or replaces a block for a particular event (or events) to an internal - dispatch table. It will cause a strong reference to @a block. - - @param block The block which is invoked then the action message is - sent (cannot be nil). The block is retained. - - @param controlEvents A bitmask specifying the control events for which the - action message is sent. - */ -- (void)setBlockForControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender))block; - -/** - Removes all blocks for a particular event (or events) from an internal - dispatch table. - - @param controlEvents A bitmask specifying the control events for which the - action message is sent. - */ -- (void)removeAllBlocksForControlEvents:(UIControlEvents)controlEvents; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIControl+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIControl+YYAdd.m deleted file mode 100644 index 4ae42aa0..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIControl+YYAdd.m +++ /dev/null @@ -1,118 +0,0 @@ -// -// UIControl+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/5. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIControl+YYAdd.h" -#import "YYCategoriesMacro.h" -#import - -YYSYNTH_DUMMY_CLASS(UIControl_YYAdd) - - -static const int block_key; - -@interface _YYUIControlBlockTarget : NSObject - -@property (nonatomic, copy) void (^block)(id sender); -@property (nonatomic, assign) UIControlEvents events; - -- (id)initWithBlock:(void (^)(id sender))block events:(UIControlEvents)events; -- (void)invoke:(id)sender; - -@end - -@implementation _YYUIControlBlockTarget - -- (id)initWithBlock:(void (^)(id sender))block events:(UIControlEvents)events { - self = [super init]; - if (self) { - _block = [block copy]; - _events = events; - } - return self; -} - -- (void)invoke:(id)sender { - if (_block) _block(sender); -} - -@end - - - -@implementation UIControl (YYAdd) - -- (void)removeAllTargets { - [[self allTargets] enumerateObjectsUsingBlock: ^(id object, BOOL *stop) { - [self removeTarget:object action:NULL forControlEvents:UIControlEventAllEvents]; - }]; - [[self _yy_allUIControlBlockTargets] removeAllObjects]; -} - -- (void)setTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents { - if (!target || !action || !controlEvents) return; - NSSet *targets = [self allTargets]; - for (id currentTarget in targets) { - NSArray *actions = [self actionsForTarget:currentTarget forControlEvent:controlEvents]; - for (NSString *currentAction in actions) { - [self removeTarget:currentTarget action:NSSelectorFromString(currentAction) - forControlEvents:controlEvents]; - } - } - [self addTarget:target action:action forControlEvents:controlEvents]; -} - -- (void)addBlockForControlEvents:(UIControlEvents)controlEvents - block:(void (^)(id sender))block { - if (!controlEvents) return; - _YYUIControlBlockTarget *target = [[_YYUIControlBlockTarget alloc] - initWithBlock:block events:controlEvents]; - [self addTarget:target action:@selector(invoke:) forControlEvents:controlEvents]; - NSMutableArray *targets = [self _yy_allUIControlBlockTargets]; - [targets addObject:target]; -} - -- (void)setBlockForControlEvents:(UIControlEvents)controlEvents - block:(void (^)(id sender))block { - [self removeAllBlocksForControlEvents:UIControlEventAllEvents]; - [self addBlockForControlEvents:controlEvents block:block]; -} - -- (void)removeAllBlocksForControlEvents:(UIControlEvents)controlEvents { - if (!controlEvents) return; - - NSMutableArray *targets = [self _yy_allUIControlBlockTargets]; - NSMutableArray *removes = [NSMutableArray array]; - for (_YYUIControlBlockTarget *target in targets) { - if (target.events & controlEvents) { - UIControlEvents newEvent = target.events & (~controlEvents); - if (newEvent) { - [self removeTarget:target action:@selector(invoke:) forControlEvents:target.events]; - target.events = newEvent; - [self addTarget:target action:@selector(invoke:) forControlEvents:target.events]; - } else { - [self removeTarget:target action:@selector(invoke:) forControlEvents:target.events]; - [removes addObject:target]; - } - } - } - [targets removeObjectsInArray:removes]; -} - -- (NSMutableArray *)_yy_allUIControlBlockTargets { - NSMutableArray *targets = objc_getAssociatedObject(self, &block_key); - if (!targets) { - targets = [NSMutableArray array]; - objc_setAssociatedObject(self, &block_key, targets, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return targets; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIDevice+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIDevice+YYAdd.h deleted file mode 100644 index a08c5b41..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIDevice+YYAdd.h +++ /dev/null @@ -1,191 +0,0 @@ -// -// UIDevice+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIDevice`. - */ -@interface UIDevice (YYAdd) - - -#pragma mark - Device Information -///============================================================================= -/// @name Device Information -///============================================================================= - -/// Device system version (e.g. 8.1) -+ (double)systemVersion; - -/// Whether the device is iPad/iPad mini. -@property (nonatomic, readonly) BOOL isPad; - -/// Whether the device is a simulator. -@property (nonatomic, readonly) BOOL isSimulator; - -/// Whether the device is jailbroken. -@property (nonatomic, readonly) BOOL isJailbroken; - -/// Wherher the device can make phone calls. -@property (nonatomic, readonly) BOOL canMakePhoneCalls NS_EXTENSION_UNAVAILABLE_IOS(""); - -/// The device's machine model. e.g. "iPhone6,1" "iPad4,6" -/// @see http://theiphonewiki.com/wiki/Models -@property (nullable, nonatomic, readonly) NSString *machineModel; - -/// The device's machine model name. e.g. "iPhone 5s" "iPad mini 2" -/// @see http://theiphonewiki.com/wiki/Models -@property (nullable, nonatomic, readonly) NSString *machineModelName; - -/// The System's startup time. -@property (nonatomic, readonly) NSDate *systemUptime; - - -#pragma mark - Network Information -///============================================================================= -/// @name Network Information -///============================================================================= - -/// WIFI IP address of this device (can be nil). e.g. @"192.168.1.111" -@property (nullable, nonatomic, readonly) NSString *ipAddressWIFI; - -/// Cell IP address of this device (can be nil). e.g. @"10.2.2.222" -@property (nullable, nonatomic, readonly) NSString *ipAddressCell; - - -/** - Network traffic type: - - WWAN: Wireless Wide Area Network. - For example: 3G/4G. - - WIFI: Wi-Fi. - - AWDL: Apple Wireless Direct Link (peer-to-peer connection). - For exmaple: AirDrop, AirPlay, GameKit. - */ -typedef NS_OPTIONS(NSUInteger, YYNetworkTrafficType) { - YYNetworkTrafficTypeWWANSent = 1 << 0, - YYNetworkTrafficTypeWWANReceived = 1 << 1, - YYNetworkTrafficTypeWIFISent = 1 << 2, - YYNetworkTrafficTypeWIFIReceived = 1 << 3, - YYNetworkTrafficTypeAWDLSent = 1 << 4, - YYNetworkTrafficTypeAWDLReceived = 1 << 5, - - YYNetworkTrafficTypeWWAN = YYNetworkTrafficTypeWWANSent | YYNetworkTrafficTypeWWANReceived, - YYNetworkTrafficTypeWIFI = YYNetworkTrafficTypeWIFISent | YYNetworkTrafficTypeWIFIReceived, - YYNetworkTrafficTypeAWDL = YYNetworkTrafficTypeAWDLSent | YYNetworkTrafficTypeAWDLReceived, - - YYNetworkTrafficTypeALL = YYNetworkTrafficTypeWWAN | - YYNetworkTrafficTypeWIFI | - YYNetworkTrafficTypeAWDL, -}; - -/** - Get device network traffic bytes. - - @discussion This is a counter since the device's last boot time. - Usage: - - uint64_t bytes = [[UIDevice currentDevice] getNetworkTrafficBytes:YYNetworkTrafficTypeALL]; - NSTimeInterval time = CACurrentMediaTime(); - - uint64_t bytesPerSecond = (bytes - _lastBytes) / (time - _lastTime); - - _lastBytes = bytes; - _lastTime = time; - - - @param type traffic types - @return bytes counter. - */ -- (uint64_t)getNetworkTrafficBytes:(YYNetworkTrafficType)types; - -#pragma mark - Disk Space -///============================================================================= -/// @name Disk Space -///============================================================================= - -/// Total disk space in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t diskSpace; - -/// Free disk space in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t diskSpaceFree; - -/// Used disk space in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t diskSpaceUsed; - - -#pragma mark - Memory Information -///============================================================================= -/// @name Memory Information -///============================================================================= - -/// Total physical memory in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t memoryTotal; - -/// Used (active + inactive + wired) memory in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t memoryUsed; - -/// Free memory in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t memoryFree; - -/// Acvite memory in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t memoryActive; - -/// Inactive memory in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t memoryInactive; - -/// Wired memory in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t memoryWired; - -/// Purgable memory in byte. (-1 when error occurs) -@property (nonatomic, readonly) int64_t memoryPurgable; - -#pragma mark - CPU Information -///============================================================================= -/// @name CPU Information -///============================================================================= - -/// Avaliable CPU processor count. -@property (nonatomic, readonly) NSUInteger cpuCount; - -/// Current CPU usage, 1.0 means 100%. (-1 when error occurs) -@property (nonatomic, readonly) float cpuUsage; - -/// Current CPU usage per processor (array of NSNumber), 1.0 means 100%. (nil when error occurs) -@property (nullable, nonatomic, readonly) NSArray *cpuUsagePerProcessor; - -@end - -NS_ASSUME_NONNULL_END - -#ifndef kSystemVersion -#define kSystemVersion [UIDevice systemVersion] -#endif - -#ifndef kiOS6Later -#define kiOS6Later (kSystemVersion >= 6) -#endif - -#ifndef kiOS7Later -#define kiOS7Later (kSystemVersion >= 7) -#endif - -#ifndef kiOS8Later -#define kiOS8Later (kSystemVersion >= 8) -#endif - -#ifndef kiOS9Later -#define kiOS9Later (kSystemVersion >= 9) -#endif diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIDevice+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIDevice+YYAdd.m deleted file mode 100644 index cfd48c41..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIDevice+YYAdd.m +++ /dev/null @@ -1,516 +0,0 @@ -// -// UIDevice+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIDevice+YYAdd.h" -#include -#include -#include -#include -#include -#include -#include -#import "YYCategoriesMacro.h" -#import "NSString+YYAdd.h" - -YYSYNTH_DUMMY_CLASS(UIDevice_YYAdd) - - -@implementation UIDevice (YYAdd) - -+ (double)systemVersion { - static double version; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - version = [UIDevice currentDevice].systemVersion.doubleValue; - }); - return version; -} - -- (BOOL)isPad { - static dispatch_once_t one; - static BOOL pad; - dispatch_once(&one, ^{ - pad = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad; - }); - return pad; -} - -- (BOOL)isSimulator { - static dispatch_once_t one; - static BOOL simu; - dispatch_once(&one, ^{ - simu = NSNotFound != [[self model] rangeOfString:@"Simulator"].location; - }); - return simu; -} - -- (BOOL)isJailbroken { - if ([self isSimulator]) return NO; // Dont't check simulator - - // iOS9 URL Scheme query changed ... - // NSURL *cydiaURL = [NSURL URLWithString:@"cydia://package"]; - // if ([[UIApplication sharedApplication] canOpenURL:cydiaURL]) return YES; - - NSArray *paths = @[@"/Applications/Cydia.app", - @"/private/var/lib/apt/", - @"/private/var/lib/cydia", - @"/private/var/stash"]; - for (NSString *path in paths) { - if ([[NSFileManager defaultManager] fileExistsAtPath:path]) return YES; - } - - FILE *bash = fopen("/bin/bash", "r"); - if (bash != NULL) { - fclose(bash); - return YES; - } - - NSString *path = [NSString stringWithFormat:@"/private/%@", [NSString stringWithUUID]]; - if ([@"test" writeToFile : path atomically : YES encoding : NSUTF8StringEncoding error : NULL]) { - [[NSFileManager defaultManager] removeItemAtPath:path error:nil]; - return YES; - } - - return NO; -} - -#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED -- (BOOL)canMakePhoneCalls { - __block BOOL can; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - can = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel://"]]; - }); - return can; -} -#endif - -- (NSString *)ipAddressWithIfaName:(NSString *)name { - if (name.length == 0) return nil; - NSString *address = nil; - struct ifaddrs *addrs = NULL; - if (getifaddrs(&addrs) == 0) { - struct ifaddrs *addr = addrs; - while (addr) { - if ([[NSString stringWithUTF8String:addr->ifa_name] isEqualToString:name]) { - sa_family_t family = addr->ifa_addr->sa_family; - switch (family) { - case AF_INET: { // IPv4 - char str[INET_ADDRSTRLEN] = {0}; - inet_ntop(family, &(((struct sockaddr_in *)addr->ifa_addr)->sin_addr), str, sizeof(str)); - if (strlen(str) > 0) { - address = [NSString stringWithUTF8String:str]; - } - } break; - - case AF_INET6: { // IPv6 - char str[INET6_ADDRSTRLEN] = {0}; - inet_ntop(family, &(((struct sockaddr_in6 *)addr->ifa_addr)->sin6_addr), str, sizeof(str)); - if (strlen(str) > 0) { - address = [NSString stringWithUTF8String:str]; - } - } - - default: break; - } - if (address) break; - } - addr = addr->ifa_next; - } - } - freeifaddrs(addrs); - return address; -} - -- (NSString *)ipAddressWIFI { - return [self ipAddressWithIfaName:@"en0"]; -} - -- (NSString *)ipAddressCell { - return [self ipAddressWithIfaName:@"pdp_ip0"]; -} - - -typedef struct { - uint64_t en_in; - uint64_t en_out; - uint64_t pdp_ip_in; - uint64_t pdp_ip_out; - uint64_t awdl_in; - uint64_t awdl_out; -} yy_net_interface_counter; - - -static uint64_t yy_net_counter_add(uint64_t counter, uint64_t bytes) { - if (bytes < (counter % 0xFFFFFFFF)) { - counter += 0xFFFFFFFF - (counter % 0xFFFFFFFF); - counter += bytes; - } else { - counter = bytes; - } - return counter; -} - -static uint64_t yy_net_counter_get_by_type(yy_net_interface_counter *counter, YYNetworkTrafficType type) { - uint64_t bytes = 0; - if (type & YYNetworkTrafficTypeWWANSent) bytes += counter->pdp_ip_out; - if (type & YYNetworkTrafficTypeWWANReceived) bytes += counter->pdp_ip_in; - if (type & YYNetworkTrafficTypeWIFISent) bytes += counter->en_out; - if (type & YYNetworkTrafficTypeWIFIReceived) bytes += counter->en_in; - if (type & YYNetworkTrafficTypeAWDLSent) bytes += counter->awdl_out; - if (type & YYNetworkTrafficTypeAWDLReceived) bytes += counter->awdl_in; - return bytes; -} - -static yy_net_interface_counter yy_get_net_interface_counter() { - static dispatch_semaphore_t lock; - static NSMutableDictionary *sharedInCounters; - static NSMutableDictionary *sharedOutCounters; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedInCounters = [NSMutableDictionary new]; - sharedOutCounters = [NSMutableDictionary new]; - lock = dispatch_semaphore_create(1); - }); - - yy_net_interface_counter counter = {0}; - struct ifaddrs *addrs; - const struct ifaddrs *cursor; - if (getifaddrs(&addrs) == 0) { - cursor = addrs; - dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); - while (cursor) { - if (cursor->ifa_addr->sa_family == AF_LINK) { - const struct if_data *data = cursor->ifa_data; - NSString *name = cursor->ifa_name ? [NSString stringWithUTF8String:cursor->ifa_name] : nil; - if (name) { - uint64_t counter_in = ((NSNumber *)sharedInCounters[name]).unsignedLongLongValue; - counter_in = yy_net_counter_add(counter_in, data->ifi_ibytes); - sharedInCounters[name] = @(counter_in); - - uint64_t counter_out = ((NSNumber *)sharedOutCounters[name]).unsignedLongLongValue; - counter_out = yy_net_counter_add(counter_out, data->ifi_obytes); - sharedOutCounters[name] = @(counter_out); - - if ([name hasPrefix:@"en"]) { - counter.en_in += counter_in; - counter.en_out += counter_out; - } else if ([name hasPrefix:@"awdl"]) { - counter.awdl_in += counter_in; - counter.awdl_out += counter_out; - } else if ([name hasPrefix:@"pdp_ip"]) { - counter.pdp_ip_in += counter_in; - counter.pdp_ip_out += counter_out; - } - } - } - cursor = cursor->ifa_next; - } - dispatch_semaphore_signal(lock); - freeifaddrs(addrs); - } - - return counter; -} - -- (uint64_t)getNetworkTrafficBytes:(YYNetworkTrafficType)types { - yy_net_interface_counter counter = yy_get_net_interface_counter(); - return yy_net_counter_get_by_type(&counter, types); -} - -- (NSString *)machineModel { - static dispatch_once_t one; - static NSString *model; - dispatch_once(&one, ^{ - size_t size; - sysctlbyname("hw.machine", NULL, &size, NULL, 0); - char *machine = malloc(size); - sysctlbyname("hw.machine", machine, &size, NULL, 0); - model = [NSString stringWithUTF8String:machine]; - free(machine); - }); - return model; -} - -- (NSString *)machineModelName { - static dispatch_once_t one; - static NSString *name; - dispatch_once(&one, ^{ - NSString *model = [self machineModel]; - if (!model) return; - NSDictionary *dic = @{ - @"Watch1,1" : @"Apple Watch 38mm", - @"Watch1,2" : @"Apple Watch 42mm", - @"Watch2,3" : @"Apple Watch Series 2 38mm", - @"Watch2,4" : @"Apple Watch Series 2 42mm", - @"Watch2,6" : @"Apple Watch Series 1 38mm", - @"Watch1,7" : @"Apple Watch Series 1 42mm", - - @"iPod1,1" : @"iPod touch 1", - @"iPod2,1" : @"iPod touch 2", - @"iPod3,1" : @"iPod touch 3", - @"iPod4,1" : @"iPod touch 4", - @"iPod5,1" : @"iPod touch 5", - @"iPod7,1" : @"iPod touch 6", - - @"iPhone1,1" : @"iPhone 1G", - @"iPhone1,2" : @"iPhone 3G", - @"iPhone2,1" : @"iPhone 3GS", - @"iPhone3,1" : @"iPhone 4 (GSM)", - @"iPhone3,2" : @"iPhone 4", - @"iPhone3,3" : @"iPhone 4 (CDMA)", - @"iPhone4,1" : @"iPhone 4S", - @"iPhone5,1" : @"iPhone 5", - @"iPhone5,2" : @"iPhone 5", - @"iPhone5,3" : @"iPhone 5c", - @"iPhone5,4" : @"iPhone 5c", - @"iPhone6,1" : @"iPhone 5s", - @"iPhone6,2" : @"iPhone 5s", - @"iPhone7,1" : @"iPhone 6 Plus", - @"iPhone7,2" : @"iPhone 6", - @"iPhone8,1" : @"iPhone 6s", - @"iPhone8,2" : @"iPhone 6s Plus", - @"iPhone8,4" : @"iPhone SE", - @"iPhone9,1" : @"iPhone 7", - @"iPhone9,2" : @"iPhone 7 Plus", - @"iPhone9,3" : @"iPhone 7", - @"iPhone9,4" : @"iPhone 7 Plus", - - @"iPad1,1" : @"iPad 1", - @"iPad2,1" : @"iPad 2 (WiFi)", - @"iPad2,2" : @"iPad 2 (GSM)", - @"iPad2,3" : @"iPad 2 (CDMA)", - @"iPad2,4" : @"iPad 2", - @"iPad2,5" : @"iPad mini 1", - @"iPad2,6" : @"iPad mini 1", - @"iPad2,7" : @"iPad mini 1", - @"iPad3,1" : @"iPad 3 (WiFi)", - @"iPad3,2" : @"iPad 3 (4G)", - @"iPad3,3" : @"iPad 3 (4G)", - @"iPad3,4" : @"iPad 4", - @"iPad3,5" : @"iPad 4", - @"iPad3,6" : @"iPad 4", - @"iPad4,1" : @"iPad Air", - @"iPad4,2" : @"iPad Air", - @"iPad4,3" : @"iPad Air", - @"iPad4,4" : @"iPad mini 2", - @"iPad4,5" : @"iPad mini 2", - @"iPad4,6" : @"iPad mini 2", - @"iPad4,7" : @"iPad mini 3", - @"iPad4,8" : @"iPad mini 3", - @"iPad4,9" : @"iPad mini 3", - @"iPad5,1" : @"iPad mini 4", - @"iPad5,2" : @"iPad mini 4", - @"iPad5,3" : @"iPad Air 2", - @"iPad5,4" : @"iPad Air 2", - @"iPad6,3" : @"iPad Pro (9.7 inch)", - @"iPad6,4" : @"iPad Pro (9.7 inch)", - @"iPad6,7" : @"iPad Pro (12.9 inch)", - @"iPad6,8" : @"iPad Pro (12.9 inch)", - - @"AppleTV2,1" : @"Apple TV 2", - @"AppleTV3,1" : @"Apple TV 3", - @"AppleTV3,2" : @"Apple TV 3", - @"AppleTV5,3" : @"Apple TV 4", - - @"i386" : @"Simulator x86", - @"x86_64" : @"Simulator x64", - }; - name = dic[model]; - if (!name) name = model; - }); - return name; -} - -- (NSDate *)systemUptime { - NSTimeInterval time = [[NSProcessInfo processInfo] systemUptime]; - return [[NSDate alloc] initWithTimeIntervalSinceNow:(0 - time)]; -} - -- (int64_t)diskSpace { - NSError *error = nil; - NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error]; - if (error) return -1; - int64_t space = [[attrs objectForKey:NSFileSystemSize] longLongValue]; - if (space < 0) space = -1; - return space; -} - -- (int64_t)diskSpaceFree { - NSError *error = nil; - NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error]; - if (error) return -1; - int64_t space = [[attrs objectForKey:NSFileSystemFreeSize] longLongValue]; - if (space < 0) space = -1; - return space; -} - -- (int64_t)diskSpaceUsed { - int64_t total = self.diskSpace; - int64_t free = self.diskSpaceFree; - if (total < 0 || free < 0) return -1; - int64_t used = total - free; - if (used < 0) used = -1; - return used; -} - -- (int64_t)memoryTotal { - int64_t mem = [[NSProcessInfo processInfo] physicalMemory]; - if (mem < -1) mem = -1; - return mem; -} - -- (int64_t)memoryUsed { - mach_port_t host_port = mach_host_self(); - mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); - vm_size_t page_size; - vm_statistics_data_t vm_stat; - kern_return_t kern; - - kern = host_page_size(host_port, &page_size); - if (kern != KERN_SUCCESS) return -1; - kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); - if (kern != KERN_SUCCESS) return -1; - return page_size * (vm_stat.active_count + vm_stat.inactive_count + vm_stat.wire_count); -} - -- (int64_t)memoryFree { - mach_port_t host_port = mach_host_self(); - mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); - vm_size_t page_size; - vm_statistics_data_t vm_stat; - kern_return_t kern; - - kern = host_page_size(host_port, &page_size); - if (kern != KERN_SUCCESS) return -1; - kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); - if (kern != KERN_SUCCESS) return -1; - return vm_stat.free_count * page_size; -} - -- (int64_t)memoryActive { - mach_port_t host_port = mach_host_self(); - mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); - vm_size_t page_size; - vm_statistics_data_t vm_stat; - kern_return_t kern; - - kern = host_page_size(host_port, &page_size); - if (kern != KERN_SUCCESS) return -1; - kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); - if (kern != KERN_SUCCESS) return -1; - return vm_stat.active_count * page_size; -} - -- (int64_t)memoryInactive { - mach_port_t host_port = mach_host_self(); - mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); - vm_size_t page_size; - vm_statistics_data_t vm_stat; - kern_return_t kern; - - kern = host_page_size(host_port, &page_size); - if (kern != KERN_SUCCESS) return -1; - kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); - if (kern != KERN_SUCCESS) return -1; - return vm_stat.inactive_count * page_size; -} - -- (int64_t)memoryWired { - mach_port_t host_port = mach_host_self(); - mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); - vm_size_t page_size; - vm_statistics_data_t vm_stat; - kern_return_t kern; - - kern = host_page_size(host_port, &page_size); - if (kern != KERN_SUCCESS) return -1; - kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); - if (kern != KERN_SUCCESS) return -1; - return vm_stat.wire_count * page_size; -} - -- (int64_t)memoryPurgable { - mach_port_t host_port = mach_host_self(); - mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); - vm_size_t page_size; - vm_statistics_data_t vm_stat; - kern_return_t kern; - - kern = host_page_size(host_port, &page_size); - if (kern != KERN_SUCCESS) return -1; - kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); - if (kern != KERN_SUCCESS) return -1; - return vm_stat.purgeable_count * page_size; -} - -- (NSUInteger)cpuCount { - return [NSProcessInfo processInfo].activeProcessorCount; -} - -- (float)cpuUsage { - float cpu = 0; - NSArray *cpus = [self cpuUsagePerProcessor]; - if (cpus.count == 0) return -1; - for (NSNumber *n in cpus) { - cpu += n.floatValue; - } - return cpu; -} - -- (NSArray *)cpuUsagePerProcessor { - processor_info_array_t _cpuInfo, _prevCPUInfo = nil; - mach_msg_type_number_t _numCPUInfo, _numPrevCPUInfo = 0; - unsigned _numCPUs; - NSLock *_cpuUsageLock; - - int _mib[2U] = { CTL_HW, HW_NCPU }; - size_t _sizeOfNumCPUs = sizeof(_numCPUs); - int _status = sysctl(_mib, 2U, &_numCPUs, &_sizeOfNumCPUs, NULL, 0U); - if (_status) - _numCPUs = 1; - - _cpuUsageLock = [[NSLock alloc] init]; - - natural_t _numCPUsU = 0U; - kern_return_t err = host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &_numCPUsU, &_cpuInfo, &_numCPUInfo); - if (err == KERN_SUCCESS) { - [_cpuUsageLock lock]; - - NSMutableArray *cpus = [NSMutableArray new]; - for (unsigned i = 0U; i < _numCPUs; ++i) { - Float32 _inUse, _total; - if (_prevCPUInfo) { - _inUse = ( - (_cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_USER] - _prevCPUInfo[(CPU_STATE_MAX * i) + CPU_STATE_USER]) - + (_cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_SYSTEM] - _prevCPUInfo[(CPU_STATE_MAX * i) + CPU_STATE_SYSTEM]) - + (_cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_NICE] - _prevCPUInfo[(CPU_STATE_MAX * i) + CPU_STATE_NICE]) - ); - _total = _inUse + (_cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_IDLE] - _prevCPUInfo[(CPU_STATE_MAX * i) + CPU_STATE_IDLE]); - } else { - _inUse = _cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_USER] + _cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_SYSTEM] + _cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_NICE]; - _total = _inUse + _cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_IDLE]; - } - [cpus addObject:@(_inUse / _total)]; - } - - [_cpuUsageLock unlock]; - if (_prevCPUInfo) { - size_t prevCpuInfoSize = sizeof(integer_t) * _numPrevCPUInfo; - vm_deallocate(mach_task_self(), (vm_address_t)_prevCPUInfo, prevCpuInfoSize); - } - return cpus; - } else { - return nil; - } -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIFont+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIFont+YYAdd.h deleted file mode 100644 index 9120ff18..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIFont+YYAdd.h +++ /dev/null @@ -1,153 +0,0 @@ -// -// UIFont+YYAdd.h -// YYCategories -// -// Created by ibireme on 14/5/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIFont`. - */ -@interface UIFont (YYAdd) - -#pragma mark - Font Traits -///============================================================================= -/// @name Font Traits -///============================================================================= - -@property (nonatomic, readonly) BOOL isBold NS_AVAILABLE_IOS(7_0); ///< Whether the font is bold. -@property (nonatomic, readonly) BOOL isItalic NS_AVAILABLE_IOS(7_0); ///< Whether the font is italic. -@property (nonatomic, readonly) BOOL isMonoSpace NS_AVAILABLE_IOS(7_0); ///< Whether the font is mono space. -@property (nonatomic, readonly) BOOL isColorGlyphs NS_AVAILABLE_IOS(7_0); ///< Whether the font is color glyphs (such as Emoji). -@property (nonatomic, readonly) CGFloat fontWeight NS_AVAILABLE_IOS(7_0); ///< Font weight from -1.0 to 1.0. Regular weight is 0.0. - -/** - Create a bold font from receiver. - @return A bold font, or nil if failed. - */ -- (nullable UIFont *)fontWithBold NS_AVAILABLE_IOS(7_0); - -/** - Create a italic font from receiver. - @return A italic font, or nil if failed. - */ -- (nullable UIFont *)fontWithItalic NS_AVAILABLE_IOS(7_0); - -/** - Create a bold and italic font from receiver. - @return A bold and italic font, or nil if failed. - */ -- (nullable UIFont *)fontWithBoldItalic NS_AVAILABLE_IOS(7_0); - -/** - Create a normal (no bold/italic/...) font from receiver. - @return A normal font, or nil if failed. - */ -- (nullable UIFont *)fontWithNormal NS_AVAILABLE_IOS(7_0); - -#pragma mark - Create font -///============================================================================= -/// @name Create font -///============================================================================= - -/** - Creates and returns a font object for the specified CTFontRef. - - @param CTFont CoreText font. - */ -+ (nullable UIFont *)fontWithCTFont:(CTFontRef)CTFont; - -/** - Creates and returns a font object for the specified CGFontRef and size. - - @param CGFont CoreGraphic font. - @param size Font size. - */ -+ (nullable UIFont *)fontWithCGFont:(CGFontRef)CGFont size:(CGFloat)size; - -/** - Creates and returns the CTFontRef object. (need call CFRelease() after used) - */ -- (nullable CTFontRef)CTFontRef CF_RETURNS_RETAINED; - -/** - Creates and returns the CGFontRef object. (need call CFRelease() after used) - */ -- (nullable CGFontRef)CGFontRef CF_RETURNS_RETAINED; - - -#pragma mark - Load and unload font -///============================================================================= -/// @name Load and unload font -///============================================================================= - -/** - Load the font from file path. Support format:TTF,OTF. - If return YES, font can be load use it PostScript Name: [UIFont fontWithName:...] - - @param path font file's full path - */ -+ (BOOL)loadFontFromPath:(NSString *)path; - -/** - Unload font from file path. - - @param path font file's full path - */ -+ (void)unloadFontFromPath:(NSString *)path; - -/** - Load the font from data. Support format:TTF,OTF. - - @param data Font data. - - @return UIFont object if load succeed, otherwise nil. - */ -+ (nullable UIFont *)loadFontFromData:(NSData *)data; - -/** - Unload font which is loaded by loadFontFromData: function. - - @param font the font loaded by loadFontFromData: function - - @return YES if succeed, otherwise NO. - */ -+ (BOOL)unloadFontFromData:(UIFont *)font; - - -#pragma mark - Dump font data -///============================================================================= -/// @name Dump font data -///============================================================================= - -/** - Serialize and return the font data. - - @param font The font. - - @return data in TTF, or nil if an error occurs. - */ -+ (nullable NSData *)dataFromFont:(UIFont *)font; - -/** - Serialize and return the font data. - - @param cgFont The font. - - @return data in TTF, or nil if an error occurs. - */ -+ (nullable NSData *)dataFromCGFont:(CGFontRef)cgFont; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIFont+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIFont+YYAdd.m deleted file mode 100644 index ada90473..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIFont+YYAdd.m +++ /dev/null @@ -1,269 +0,0 @@ -// -// UIFont+YYAdd.m -// YYCategories -// -// Created by ibireme on 14/5/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIFont+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(UIFont_YYAdd) - - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wprotocol" -// Apple has implemented UIFont, but did not make it public. - -@implementation UIFont (YYAdd) - -- (BOOL)isBold { - if (![self respondsToSelector:@selector(fontDescriptor)]) return NO; - return (self.fontDescriptor.symbolicTraits & UIFontDescriptorTraitBold) > 0; -} - -- (BOOL)isItalic { - if (![self respondsToSelector:@selector(fontDescriptor)]) return NO; - return (self.fontDescriptor.symbolicTraits & UIFontDescriptorTraitItalic) > 0; -} - -- (BOOL)isMonoSpace { - if (![self respondsToSelector:@selector(fontDescriptor)]) return NO; - return (self.fontDescriptor.symbolicTraits & UIFontDescriptorTraitMonoSpace) > 0; -} - -- (BOOL)isColorGlyphs { - if (![self respondsToSelector:@selector(fontDescriptor)]) return NO; - return (CTFontGetSymbolicTraits((__bridge CTFontRef)self) & kCTFontTraitColorGlyphs) != 0; -} - -- (CGFloat)fontWeight { - NSDictionary *traits = [self.fontDescriptor objectForKey:UIFontDescriptorTraitsAttribute]; - return [traits[UIFontWeightTrait] floatValue]; -} - -- (UIFont *)fontWithBold { - if (![self respondsToSelector:@selector(fontDescriptor)]) return nil; - return [UIFont fontWithDescriptor:[self.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold] size:self.pointSize]; -} - -- (UIFont *)fontWithItalic { - if (![self respondsToSelector:@selector(fontDescriptor)]) return nil; - return [UIFont fontWithDescriptor:[self.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitItalic] size:self.pointSize]; -} - -- (UIFont *)fontWithBoldItalic { - if (![self respondsToSelector:@selector(fontDescriptor)]) return nil; - return [UIFont fontWithDescriptor:[self.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold | UIFontDescriptorTraitItalic] size:self.pointSize]; -} - -- (UIFont *)fontWithNormal { - if (![self respondsToSelector:@selector(fontDescriptor)]) return nil; - return [UIFont fontWithDescriptor:[self.fontDescriptor fontDescriptorWithSymbolicTraits:0] size:self.pointSize]; -} - -+ (UIFont *)fontWithCTFont:(CTFontRef)CTFont { - if (!CTFont) return nil; - CFStringRef name = CTFontCopyPostScriptName(CTFont); - if (!name) return nil; - CGFloat size = CTFontGetSize(CTFont); - UIFont *font = [self fontWithName:(__bridge NSString *)(name) size:size]; - CFRelease(name); - return font; -} - -+ (UIFont *)fontWithCGFont:(CGFontRef)CGFont size:(CGFloat)size { - if (!CGFont) return nil; - CFStringRef name = CGFontCopyPostScriptName(CGFont); - if (!name) return nil; - UIFont *font = [self fontWithName:(__bridge NSString *)(name) size:size]; - CFRelease(name); - return font; -} - -- (CTFontRef)CTFontRef CF_RETURNS_RETAINED { - CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)self.fontName, self.pointSize, NULL); - return font; -} - -- (CGFontRef)CGFontRef CF_RETURNS_RETAINED { - CGFontRef font = CGFontCreateWithFontName((__bridge CFStringRef)self.fontName); - return font; -} - -+ (BOOL)loadFontFromPath:(NSString *)path { - NSURL *url = [NSURL fileURLWithPath:path]; - CFErrorRef error; - BOOL suc = CTFontManagerRegisterFontsForURL((__bridge CFTypeRef)url, kCTFontManagerScopeNone, &error); - if (!suc) { - NSLog(@"Failed to load font: %@", error); - } - return suc; -} - -+ (void)unloadFontFromPath:(NSString *)path { - NSURL *url = [NSURL fileURLWithPath:path]; - CTFontManagerUnregisterFontsForURL((__bridge CFTypeRef)url, kCTFontManagerScopeNone, NULL); -} - -+ (UIFont *)loadFontFromData:(NSData *)data { - CGDataProviderRef provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data); - if (!provider) return nil; - CGFontRef fontRef = CGFontCreateWithDataProvider(provider); - CGDataProviderRelease(provider); - if (!fontRef) return nil; - - CFErrorRef errorRef; - BOOL suc = CTFontManagerRegisterGraphicsFont(fontRef, &errorRef); - if (!suc) { - CFRelease(fontRef); - NSLog(@"%@", errorRef); - return nil; - } else { - CFStringRef fontName = CGFontCopyPostScriptName(fontRef); - UIFont *font = [UIFont fontWithName:(__bridge NSString *)(fontName) size:[UIFont systemFontSize]]; - if (fontName) CFRelease(fontName); - CGFontRelease(fontRef); - return font; - } -} - -+ (BOOL)unloadFontFromData:(UIFont *)font { - CGFontRef fontRef = CGFontCreateWithFontName((__bridge CFStringRef)font.fontName); - if (!fontRef) return NO; - CFErrorRef errorRef; - BOOL suc = CTFontManagerUnregisterGraphicsFont(fontRef, &errorRef); - CFRelease(fontRef); - if (!suc) NSLog(@"%@", errorRef); - return suc; -} - -+ (NSData *)dataFromFont:(UIFont *)font { - CGFontRef cgFont = font.CGFontRef; - NSData *data = [self dataFromCGFont:cgFont]; - CGFontRelease(cgFont); - return data; -} - -typedef struct FontHeader { - int32_t fVersion; - uint16_t fNumTables; - uint16_t fSearchRange; - uint16_t fEntrySelector; - uint16_t fRangeShift; -} FontHeader; - -typedef struct TableEntry { - uint32_t fTag; - uint32_t fCheckSum; - uint32_t fOffset; - uint32_t fLength; -} TableEntry; - -static uint32_t CalcTableCheckSum(const uint32_t *table, uint32_t numberOfBytesInTable) { - uint32_t sum = 0; - uint32_t nLongs = (numberOfBytesInTable + 3) / 4; - while (nLongs-- > 0) { - sum += CFSwapInt32HostToBig(*table++); - } - return sum; -} - -//Reference: -//https://github.com/google/skia/blob/master/src%2Fports%2FSkFontHost_mac.cpp -+ (NSData *)dataFromCGFont:(CGFontRef)cgFont { - if (!cgFont) return nil; - - CFRetain(cgFont); - - CFArrayRef tags = CGFontCopyTableTags(cgFont); - if (!tags) return nil; - CFIndex tableCount = CFArrayGetCount(tags); - - size_t *tableSizes = malloc(sizeof(size_t) * tableCount); - memset(tableSizes, 0, sizeof(size_t) * tableCount); - - BOOL containsCFFTable = NO; - - size_t totalSize = sizeof(FontHeader) + sizeof(TableEntry) * tableCount; - - for (CFIndex index = 0; index < tableCount; index++) { - size_t tableSize = 0; - uint32_t aTag = (uint32_t)CFArrayGetValueAtIndex(tags, index); - if (aTag == kCTFontTableCFF && !containsCFFTable) { - containsCFFTable = YES; - } - CFDataRef tableDataRef = CGFontCopyTableForTag(cgFont, aTag); - if (tableDataRef) { - tableSize = CFDataGetLength(tableDataRef); - CFRelease(tableDataRef); - } - totalSize += (tableSize + 3) & ~3; - tableSizes[index] = tableSize; - } - - unsigned char *stream = malloc(totalSize); - memset(stream, 0, totalSize); - char *dataStart = (char *)stream; - char *dataPtr = dataStart; - - // compute font header entries - uint16_t entrySelector = 0; - uint16_t searchRange = 1; - while (searchRange < tableCount >> 1) { - entrySelector++; - searchRange <<= 1; - } - searchRange <<= 4; - - uint16_t rangeShift = (tableCount << 4) - searchRange; - - // write font header (also called sfnt header, offset subtable) - FontHeader *offsetTable = (FontHeader *)dataPtr; - - //OpenType Font contains CFF Table use 'OTTO' as version, and with .otf extension - //otherwise 0001 0000 - offsetTable->fVersion = containsCFFTable ? 'OTTO' : CFSwapInt16HostToBig(1); - offsetTable->fNumTables = CFSwapInt16HostToBig((uint16_t)tableCount); - offsetTable->fSearchRange = CFSwapInt16HostToBig((uint16_t)searchRange); - offsetTable->fEntrySelector = CFSwapInt16HostToBig((uint16_t)entrySelector); - offsetTable->fRangeShift = CFSwapInt16HostToBig((uint16_t)rangeShift); - - dataPtr += sizeof(FontHeader); - - // write tables - TableEntry *entry = (TableEntry *)dataPtr; - dataPtr += sizeof(TableEntry) * tableCount; - - for (int index = 0; index < tableCount; ++index) { - uint32_t aTag = (uint32_t)CFArrayGetValueAtIndex(tags, index); - CFDataRef tableDataRef = CGFontCopyTableForTag(cgFont, aTag); - size_t tableSize = CFDataGetLength(tableDataRef); - - memcpy(dataPtr, CFDataGetBytePtr(tableDataRef), tableSize); - - entry->fTag = CFSwapInt32HostToBig((uint32_t)aTag); - entry->fCheckSum = CFSwapInt32HostToBig(CalcTableCheckSum((uint32_t *)dataPtr, (uint32_t)tableSize)); - - uint32_t offset = (uint32_t)dataPtr - (uint32_t)dataStart; - entry->fOffset = CFSwapInt32HostToBig((uint32_t)offset); - entry->fLength = CFSwapInt32HostToBig((uint32_t)tableSize); - dataPtr += (tableSize + 3) & ~3; - ++entry; - CFRelease(tableDataRef); - } - - CFRelease(cgFont); - CFRelease(tags); - free(tableSizes); - NSData *fontData = [NSData dataWithBytesNoCopy:stream length:totalSize freeWhenDone:YES]; - return fontData; -} - -@end - -#pragma clang diagnostic pop diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIGestureRecognizer+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIGestureRecognizer+YYAdd.h deleted file mode 100644 index 987ebe52..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIGestureRecognizer+YYAdd.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// UIGestureRecognizer+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/10/13. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIGestureRecognizer`. - */ -@interface UIGestureRecognizer (YYAdd) - -/** - Initializes an allocated gesture-recognizer object with a action block. - - @param block An action block that to handle the gesture recognized by the - receiver. nil is invalid. It is retained by the gesture. - - @return An initialized instance of a concrete UIGestureRecognizer subclass or - nil if an error occurred in the attempt to initialize the object. - */ -- (instancetype)initWithActionBlock:(void (^)(id sender))block; - -/** - Adds an action block to a gesture-recognizer object. It is retained by the - gesture. - - @param block A block invoked by the action message. nil is not a valid value. - */ -- (void)addActionBlock:(void (^)(id sender))block; - -/** - Remove all action blocks. - */ -- (void)removeAllActionBlocks; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIGestureRecognizer+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIGestureRecognizer+YYAdd.m deleted file mode 100644 index 61a25e81..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIGestureRecognizer+YYAdd.m +++ /dev/null @@ -1,78 +0,0 @@ -// -// UIGestureRecognizer+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/10/13. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIGestureRecognizer+YYAdd.h" -#import "YYCategoriesMacro.h" -#import - -static const int block_key; - -@interface _YYUIGestureRecognizerBlockTarget : NSObject - -@property (nonatomic, copy) void (^block)(id sender); - -- (id)initWithBlock:(void (^)(id sender))block; -- (void)invoke:(id)sender; - -@end - -@implementation _YYUIGestureRecognizerBlockTarget - -- (id)initWithBlock:(void (^)(id sender))block{ - self = [super init]; - if (self) { - _block = [block copy]; - } - return self; -} - -- (void)invoke:(id)sender { - if (_block) _block(sender); -} - -@end - - - - -@implementation UIGestureRecognizer (YYAdd) - -- (instancetype)initWithActionBlock:(void (^)(id sender))block { - self = [self init]; - [self addActionBlock:block]; - return self; -} - -- (void)addActionBlock:(void (^)(id sender))block { - _YYUIGestureRecognizerBlockTarget *target = [[_YYUIGestureRecognizerBlockTarget alloc] initWithBlock:block]; - [self addTarget:target action:@selector(invoke:)]; - NSMutableArray *targets = [self _yy_allUIGestureRecognizerBlockTargets]; - [targets addObject:target]; -} - -- (void)removeAllActionBlocks{ - NSMutableArray *targets = [self _yy_allUIGestureRecognizerBlockTargets]; - [targets enumerateObjectsUsingBlock:^(id target, NSUInteger idx, BOOL *stop) { - [self removeTarget:target action:@selector(invoke:)]; - }]; - [targets removeAllObjects]; -} - -- (NSMutableArray *)_yy_allUIGestureRecognizerBlockTargets { - NSMutableArray *targets = objc_getAssociatedObject(self, &block_key); - if (!targets) { - targets = [NSMutableArray array]; - objc_setAssociatedObject(self, &block_key, targets, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - return targets; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIImage+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIImage+YYAdd.h deleted file mode 100644 index f4b443f2..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIImage+YYAdd.h +++ /dev/null @@ -1,377 +0,0 @@ -// -// UIImage+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provide some commen method for `UIImage`. - Image process is based on CoreGraphic and vImage. - */ -@interface UIImage (YYAdd) - -#pragma mark - Create image -///============================================================================= -/// @name Create image -///============================================================================= - -/** - Create an animated image with GIF data. After created, you can access - the images via property '.images'. If the data is not animated gif, this - function is same as [UIImage imageWithData:data scale:scale]; - - @discussion It has a better display performance, but costs more memory - (width * height * frames Bytes). It only suited to display small - gif such as animated emoji. If you want to display large gif, - see `YYImage`. - - @param data GIF data. - - @param scale The scale factor - - @return A new image created from GIF, or nil when an error occurs. - */ -+ (nullable UIImage *)imageWithSmallGIFData:(NSData *)data scale:(CGFloat)scale; - -/** - Whether the data is animated GIF. - - @param data Image data - - @return Returns YES only if the data is gif and contains more than one frame, - otherwise returns NO. - */ -+ (BOOL)isAnimatedGIFData:(NSData *)data; - -/** - Whether the file in the specified path is GIF. - - @param path An absolute file path. - - @return Returns YES if the file is gif, otherwise returns NO. - */ -+ (BOOL)isAnimatedGIFFile:(NSString *)path; - -/** - Create an image from a PDF file data or path. - - @discussion If the PDF has multiple page, is just return's the first page's - content. Image's scale is equal to current screen's scale, size is same as - PDF's origin size. - - @param dataOrPath PDF data in `NSData`, or PDF file path in `NSString`. - - @return A new image create from PDF, or nil when an error occurs. - */ -+ (nullable UIImage *)imageWithPDF:(id)dataOrPath; - -/** - Create an image from a PDF file data or path. - - @discussion If the PDF has multiple page, is just return's the first page's - content. Image's scale is equal to current screen's scale. - - @param dataOrPath PDF data in `NSData`, or PDF file path in `NSString`. - - @param size The new image's size, PDF's content will be stretched as needed. - - @return A new image create from PDF, or nil when an error occurs. - */ -+ (nullable UIImage *)imageWithPDF:(id)dataOrPath size:(CGSize)size; - -/** - Create a square image from apple emoji. - - @discussion It creates a square image from apple emoji, image's scale is equal - to current screen's scale. The original emoji image in `AppleColorEmoji` font - is in size 160*160 px. - - @param emoji single emoji, such as @"😄". - - @param size image's size. - - @return Image from emoji, or nil when an error occurs. - */ -+ (nullable UIImage *)imageWithEmoji:(NSString *)emoji size:(CGFloat)size; - -/** - Create and return a 1x1 point size image with the given color. - - @param color The color. - */ -+ (nullable UIImage *)imageWithColor:(UIColor *)color; - -/** - Create and return a pure color image with the given color and size. - - @param color The color. - @param size New image's type. - */ -+ (nullable UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size; - -/** - Create and return an image with custom draw code. - - @param size The image size. - @param drawBlock The draw block. - - @return The new image. - */ -+ (nullable UIImage *)imageWithSize:(CGSize)size drawBlock:(void (^)(CGContextRef context))drawBlock; - -#pragma mark - Image Info -///============================================================================= -/// @name Image Info -///============================================================================= - -/** - Whether this image has alpha channel. - */ -- (BOOL)hasAlphaChannel; - - -#pragma mark - Modify Image -///============================================================================= -/// @name Modify Image -///============================================================================= - -/** - Draws the entire image in the specified rectangle, content changed with - the contentMode. - - @discussion This method draws the entire image in the current graphics context, - respecting the image's orientation setting. In the default coordinate system, - images are situated down and to the right of the origin of the specified - rectangle. This method respects any transforms applied to the current graphics - context, however. - - @param rect The rectangle in which to draw the image. - - @param contentMode Draw content mode - - @param clips A Boolean value that determines whether content are confined to the rect. - */ -- (void)drawInRect:(CGRect)rect withContentMode:(UIViewContentMode)contentMode clipsToBounds:(BOOL)clips; - -/** - Returns a new image which is scaled from this image. - The image will be stretched as needed. - - @param size The new size to be scaled, values should be positive. - - @return The new image with the given size. - */ -- (nullable UIImage *)imageByResizeToSize:(CGSize)size; - -/** - Returns a new image which is scaled from this image. - The image content will be changed with thencontentMode. - - @param size The new size to be scaled, values should be positive. - - @param contentMode The content mode for image content. - - @return The new image with the given size. - */ -- (nullable UIImage *)imageByResizeToSize:(CGSize)size contentMode:(UIViewContentMode)contentMode; - -/** - Returns a new image which is cropped from this image. - - @param rect Image's inner rect. - - @return The new image, or nil if an error occurs. - */ -- (nullable UIImage *)imageByCropToRect:(CGRect)rect; - -/** - Returns a new image which is edge inset from this image. - - @param insets Inset (positive) for each of the edges, values can be negative to 'outset'. - - @param color Extend edge's fill color, nil means clear color. - - @return The new image, or nil if an error occurs. - */ -- (nullable UIImage *)imageByInsetEdge:(UIEdgeInsets)insets withColor:(nullable UIColor *)color; - -/** - Rounds a new image with a given corner size. - - @param radius The radius of each corner oval. Values larger than half the - rectangle's width or height are clamped appropriately to half - the width or height. - */ -- (nullable UIImage *)imageByRoundCornerRadius:(CGFloat)radius; - -/** - Rounds a new image with a given corner size. - - @param radius The radius of each corner oval. Values larger than half the - rectangle's width or height are clamped appropriately to - half the width or height. - - @param borderWidth The inset border line width. Values larger than half the rectangle's - width or height are clamped appropriately to half the width - or height. - - @param borderColor The border stroke color. nil means clear color. - */ -- (nullable UIImage *)imageByRoundCornerRadius:(CGFloat)radius - borderWidth:(CGFloat)borderWidth - borderColor:(nullable UIColor *)borderColor; - -/** - Rounds a new image with a given corner size. - - @param radius The radius of each corner oval. Values larger than half the - rectangle's width or height are clamped appropriately to - half the width or height. - - @param corners A bitmask value that identifies the corners that you want - rounded. You can use this parameter to round only a subset - of the corners of the rectangle. - - @param borderWidth The inset border line width. Values larger than half the rectangle's - width or height are clamped appropriately to half the width - or height. - - @param borderColor The border stroke color. nil means clear color. - - @param borderLineJoin The border line join. - */ -- (nullable UIImage *)imageByRoundCornerRadius:(CGFloat)radius - corners:(UIRectCorner)corners - borderWidth:(CGFloat)borderWidth - borderColor:(nullable UIColor *)borderColor - borderLineJoin:(CGLineJoin)borderLineJoin; - -/** - Returns a new rotated image (relative to the center). - - @param radians Rotated radians in counterclockwise.⟲ - - @param fitSize YES: new image's size is extend to fit all content. - NO: image's size will not change, content may be clipped. - */ -- (nullable UIImage *)imageByRotate:(CGFloat)radians fitSize:(BOOL)fitSize; - -/** - Returns a new image rotated counterclockwise by a quarter‑turn (90°). ⤺ - The width and height will be exchanged. - */ -- (nullable UIImage *)imageByRotateLeft90; - -/** - Returns a new image rotated clockwise by a quarter‑turn (90°). ⤼ - The width and height will be exchanged. - */ -- (nullable UIImage *)imageByRotateRight90; - -/** - Returns a new image rotated 180° . ↻ - */ -- (nullable UIImage *)imageByRotate180; - -/** - Returns a vertically flipped image. ⥯ - */ -- (nullable UIImage *)imageByFlipVertical; - -/** - Returns a horizontally flipped image. ⇋ - */ -- (nullable UIImage *)imageByFlipHorizontal; - - -#pragma mark - Image Effect -///============================================================================= -/// @name Image Effect -///============================================================================= - -/** - Tint the image in alpha channel with the given color. - - @param color The color. - */ -- (nullable UIImage *)imageByTintColor:(UIColor *)color; - -/** - Returns a grayscaled image. - */ -- (nullable UIImage *)imageByGrayscale; - -/** - Applies a blur effect to this image. Suitable for blur any content. - */ -- (nullable UIImage *)imageByBlurSoft; - -/** - Applies a blur effect to this image. Suitable for blur any content except pure white. - (same as iOS Control Panel) - */ -- (nullable UIImage *)imageByBlurLight; - -/** - Applies a blur effect to this image. Suitable for displaying black text. - (same as iOS Navigation Bar White) - */ -- (nullable UIImage *)imageByBlurExtraLight; - -/** - Applies a blur effect to this image. Suitable for displaying white text. - (same as iOS Notification Center) - */ -- (nullable UIImage *)imageByBlurDark; - -/** - Applies a blur and tint color to this image. - - @param tintColor The tint color. - */ -- (nullable UIImage *)imageByBlurWithTint:(UIColor *)tintColor; - -/** - Applies a blur, tint color, and saturation adjustment to this image, - optionally within the area specified by @a maskImage. - - @param blurRadius The radius of the blur in points, 0 means no blur effect. - - @param tintColor An optional UIColor object that is uniformly blended with - the result of the blur and saturation operations. The - alpha channel of this color determines how strong the - tint is. nil means no tint. - - @param tintBlendMode The @a tintColor blend mode. Default is kCGBlendModeNormal (0). - - @param saturation A value of 1.0 produces no change in the resulting image. - Values less than 1.0 will desaturation the resulting image - while values greater than 1.0 will have the opposite effect. - 0 means gray scale. - - @param maskImage If specified, @a inputImage is only modified in the area(s) - defined by this mask. This must be an image mask or it - must meet the requirements of the mask parameter of - CGContextClipToMask. - - @return image with effect, or nil if an error occurs (e.g. no - enough memory). - */ -- (nullable UIImage *)imageByBlurRadius:(CGFloat)blurRadius - tintColor:(nullable UIColor *)tintColor - tintMode:(CGBlendMode)tintBlendMode - saturation:(CGFloat)saturation - maskImage:(nullable UIImage *)maskImage; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIImage+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIImage+YYAdd.m deleted file mode 100644 index bf75b5e5..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIImage+YYAdd.m +++ /dev/null @@ -1,752 +0,0 @@ -// -// UIImage+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/4. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIImage+YYAdd.h" -#import "UIDevice+YYAdd.h" -#import "NSString+YYAdd.h" -#import "YYCategoriesMacro.h" -#import "YYCGUtilities.h" -#import -#import -#import -#import -#import "YYCGUtilities.h" - -YYSYNTH_DUMMY_CLASS(UIImage_YYAdd) - -static NSTimeInterval _yy_CGImageSourceGetGIFFrameDelayAtIndex(CGImageSourceRef source, size_t index) { - NSTimeInterval delay = 0; - CFDictionaryRef dic = CGImageSourceCopyPropertiesAtIndex(source, index, NULL); - if (dic) { - CFDictionaryRef dicGIF = CFDictionaryGetValue(dic, kCGImagePropertyGIFDictionary); - if (dicGIF) { - NSNumber *num = CFDictionaryGetValue(dicGIF, kCGImagePropertyGIFUnclampedDelayTime); - if (num.doubleValue <= __FLT_EPSILON__) { - num = CFDictionaryGetValue(dicGIF, kCGImagePropertyGIFDelayTime); - } - delay = num.doubleValue; - } - CFRelease(dic); - } - - // http://nullsleep.tumblr.com/post/16524517190/animated-gif-minimum-frame-delay-browser-compatibility - if (delay < 0.02) delay = 0.1; - return delay; -} - - - -@implementation UIImage (YYAdd) - -+ (UIImage *)imageWithSmallGIFData:(NSData *)data scale:(CGFloat)scale { - CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFTypeRef)(data), NULL); - if (!source) return nil; - - size_t count = CGImageSourceGetCount(source); - if (count <= 1) { - CFRelease(source); - return [self.class imageWithData:data scale:scale]; - } - - NSUInteger frames[count]; - double oneFrameTime = 1 / 50.0; // 50 fps - NSTimeInterval totalTime = 0; - NSUInteger totalFrame = 0; - NSUInteger gcdFrame = 0; - for (size_t i = 0; i < count; i++) { - NSTimeInterval delay = _yy_CGImageSourceGetGIFFrameDelayAtIndex(source, i); - totalTime += delay; - NSInteger frame = lrint(delay / oneFrameTime); - if (frame < 1) frame = 1; - frames[i] = frame; - totalFrame += frames[i]; - if (i == 0) gcdFrame = frames[i]; - else { - NSUInteger frame = frames[i], tmp; - if (frame < gcdFrame) { - tmp = frame; frame = gcdFrame; gcdFrame = tmp; - } - while (true) { - tmp = frame % gcdFrame; - if (tmp == 0) break; - frame = gcdFrame; - gcdFrame = tmp; - } - } - } - NSMutableArray *array = [NSMutableArray new]; - for (size_t i = 0; i < count; i++) { - CGImageRef imageRef = CGImageSourceCreateImageAtIndex(source, i, NULL); - if (!imageRef) { - CFRelease(source); - return nil; - } - size_t width = CGImageGetWidth(imageRef); - size_t height = CGImageGetHeight(imageRef); - if (width == 0 || height == 0) { - CFRelease(source); - CFRelease(imageRef); - return nil; - } - - CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef) & kCGBitmapAlphaInfoMask; - BOOL hasAlpha = NO; - if (alphaInfo == kCGImageAlphaPremultipliedLast || - alphaInfo == kCGImageAlphaPremultipliedFirst || - alphaInfo == kCGImageAlphaLast || - alphaInfo == kCGImageAlphaFirst) { - hasAlpha = YES; - } - // BGRA8888 (premultiplied) or BGRX8888 - // same as UIGraphicsBeginImageContext() and -[UIView drawRect:] - CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host; - bitmapInfo |= hasAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst; - CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); - CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, space, bitmapInfo); - CGColorSpaceRelease(space); - if (!context) { - CFRelease(source); - CFRelease(imageRef); - return nil; - } - CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); // decode - CGImageRef decoded = CGBitmapContextCreateImage(context); - CFRelease(context); - if (!decoded) { - CFRelease(source); - CFRelease(imageRef); - return nil; - } - UIImage *image = [UIImage imageWithCGImage:decoded scale:scale orientation:UIImageOrientationUp]; - CGImageRelease(imageRef); - CGImageRelease(decoded); - if (!image) { - CFRelease(source); - return nil; - } - for (size_t j = 0, max = frames[i] / gcdFrame; j < max; j++) { - [array addObject:image]; - } - } - CFRelease(source); - UIImage *image = [self.class animatedImageWithImages:array duration:totalTime]; - return image; -} - -+ (BOOL)isAnimatedGIFData:(NSData *)data { - if (data.length < 16) return NO; - UInt32 magic = *(UInt32 *)data.bytes; - // http://www.w3.org/Graphics/GIF/spec-gif89a.txt - if ((magic & 0xFFFFFF) != '\0FIG') return NO; - CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFTypeRef)data, NULL); - if (!source) return NO; - size_t count = CGImageSourceGetCount(source); - CFRelease(source); - return count > 1; -} - -+ (BOOL)isAnimatedGIFFile:(NSString *)path { - if (path.length == 0) return NO; - const char *cpath = path.UTF8String; - FILE *fd = fopen(cpath, "rb"); - if (!fd) return NO; - - BOOL isGIF = NO; - UInt32 magic = 0; - if (fread(&magic, sizeof(UInt32), 1, fd) == 1) { - if ((magic & 0xFFFFFF) == '\0FIG') isGIF = YES; - } - fclose(fd); - return isGIF; -} - -+ (UIImage *)imageWithPDF:(id)dataOrPath { - return [self _yy_imageWithPDF:dataOrPath resize:NO size:CGSizeZero]; -} - -+ (UIImage *)imageWithPDF:(id)dataOrPath size:(CGSize)size { - return [self _yy_imageWithPDF:dataOrPath resize:YES size:size]; -} - -+ (UIImage *)imageWithEmoji:(NSString *)emoji size:(CGFloat)size { - if (emoji.length == 0) return nil; - if (size < 1) return nil; - - CGFloat scale = [UIScreen mainScreen].scale; - CTFontRef font = CTFontCreateWithName(CFSTR("AppleColorEmoji"), size * scale, NULL); - if (!font) return nil; - - NSAttributedString *str = [[NSAttributedString alloc] initWithString:emoji attributes:@{ (__bridge id)kCTFontAttributeName:(__bridge id)font, (__bridge id)kCTForegroundColorAttributeName:(__bridge id)[UIColor whiteColor].CGColor }]; - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGContextRef ctx = CGBitmapContextCreate(NULL, size * scale, size * scale, 8, 0, colorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); - CGContextSetInterpolationQuality(ctx, kCGInterpolationHigh); - CTLineRef line = CTLineCreateWithAttributedString((__bridge CFTypeRef)str); - CGRect bounds = CTLineGetBoundsWithOptions(line, kCTLineBoundsUseGlyphPathBounds); - CGContextSetTextPosition(ctx, 0, -bounds.origin.y); - CTLineDraw(line, ctx); - CGImageRef imageRef = CGBitmapContextCreateImage(ctx); - UIImage *image = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp]; - - CFRelease(font); - CGColorSpaceRelease(colorSpace); - CGContextRelease(ctx); - if (line)CFRelease(line); - if (imageRef) CFRelease(imageRef); - - return image; -} - -+ (UIImage *)_yy_imageWithPDF:(id)dataOrPath resize:(BOOL)resize size:(CGSize)size { - CGPDFDocumentRef pdf = NULL; - if ([dataOrPath isKindOfClass:[NSData class]]) { - CGDataProviderRef provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)dataOrPath); - pdf = CGPDFDocumentCreateWithProvider(provider); - CGDataProviderRelease(provider); - } else if ([dataOrPath isKindOfClass:[NSString class]]) { - pdf = CGPDFDocumentCreateWithURL((__bridge CFURLRef)[NSURL fileURLWithPath:dataOrPath]); - } - if (!pdf) return nil; - - CGPDFPageRef page = CGPDFDocumentGetPage(pdf, 1); - if (!page) { - CGPDFDocumentRelease(pdf); - return nil; - } - - CGRect pdfRect = CGPDFPageGetBoxRect(page, kCGPDFCropBox); - CGSize pdfSize = resize ? size : pdfRect.size; - CGFloat scale = [UIScreen mainScreen].scale; - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGContextRef ctx = CGBitmapContextCreate(NULL, pdfSize.width * scale, pdfSize.height * scale, 8, 0, colorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); - if (!ctx) { - CGColorSpaceRelease(colorSpace); - CGPDFDocumentRelease(pdf); - return nil; - } - - CGContextScaleCTM(ctx, scale, scale); - CGContextTranslateCTM(ctx, -pdfRect.origin.x, -pdfRect.origin.y); - CGContextDrawPDFPage(ctx, page); - CGPDFDocumentRelease(pdf); - - CGImageRef image = CGBitmapContextCreateImage(ctx); - UIImage *pdfImage = [[UIImage alloc] initWithCGImage:image scale:scale orientation:UIImageOrientationUp]; - CGImageRelease(image); - CGContextRelease(ctx); - CGColorSpaceRelease(colorSpace); - - return pdfImage; -} - -+ (UIImage *)imageWithColor:(UIColor *)color { - return [self imageWithColor:color size:CGSizeMake(1, 1)]; -} - -+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size { - if (!color || size.width <= 0 || size.height <= 0) return nil; - CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height); - UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSetFillColorWithColor(context, color.CGColor); - CGContextFillRect(context, rect); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -+ (UIImage *)imageWithSize:(CGSize)size drawBlock:(void (^)(CGContextRef context))drawBlock { - if (!drawBlock) return nil; - UIGraphicsBeginImageContextWithOptions(size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - if (!context) return nil; - drawBlock(context); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -- (BOOL)hasAlphaChannel { - if (self.CGImage == NULL) return NO; - CGImageAlphaInfo alpha = CGImageGetAlphaInfo(self.CGImage) & kCGBitmapAlphaInfoMask; - return (alpha == kCGImageAlphaFirst || - alpha == kCGImageAlphaLast || - alpha == kCGImageAlphaPremultipliedFirst || - alpha == kCGImageAlphaPremultipliedLast); -} - -- (void)drawInRect:(CGRect)rect withContentMode:(UIViewContentMode)contentMode clipsToBounds:(BOOL)clips{ - CGRect drawRect = YYCGRectFitWithContentMode(rect, self.size, contentMode); - if (drawRect.size.width == 0 || drawRect.size.height == 0) return; - if (clips) { - CGContextRef context = UIGraphicsGetCurrentContext(); - if (context) { - CGContextSaveGState(context); - CGContextAddRect(context, rect); - CGContextClip(context); - [self drawInRect:drawRect]; - CGContextRestoreGState(context); - } - } else { - [self drawInRect:drawRect]; - } -} - -- (UIImage *)imageByResizeToSize:(CGSize)size { - if (size.width <= 0 || size.height <= 0) return nil; - UIGraphicsBeginImageContextWithOptions(size, NO, self.scale); - [self drawInRect:CGRectMake(0, 0, size.width, size.height)]; - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -- (UIImage *)imageByResizeToSize:(CGSize)size contentMode:(UIViewContentMode)contentMode { - if (size.width <= 0 || size.height <= 0) return nil; - UIGraphicsBeginImageContextWithOptions(size, NO, self.scale); - [self drawInRect:CGRectMake(0, 0, size.width, size.height) withContentMode:contentMode clipsToBounds:NO]; - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -- (UIImage *)imageByCropToRect:(CGRect)rect { - rect.origin.x *= self.scale; - rect.origin.y *= self.scale; - rect.size.width *= self.scale; - rect.size.height *= self.scale; - if (rect.size.width <= 0 || rect.size.height <= 0) return nil; - CGImageRef imageRef = CGImageCreateWithImageInRect(self.CGImage, rect); - UIImage *image = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:self.imageOrientation]; - CGImageRelease(imageRef); - return image; -} - -- (UIImage *)imageByInsetEdge:(UIEdgeInsets)insets withColor:(UIColor *)color { - CGSize size = self.size; - size.width -= insets.left + insets.right; - size.height -= insets.top + insets.bottom; - if (size.width <= 0 || size.height <= 0) return nil; - CGRect rect = CGRectMake(-insets.left, -insets.top, self.size.width, self.size.height); - UIGraphicsBeginImageContextWithOptions(size, NO, self.scale); - CGContextRef context = UIGraphicsGetCurrentContext(); - if (color) { - CGContextSetFillColorWithColor(context, color.CGColor); - CGMutablePathRef path = CGPathCreateMutable(); - CGPathAddRect(path, NULL, CGRectMake(0, 0, size.width, size.height)); - CGPathAddRect(path, NULL, rect); - CGContextAddPath(context, path); - CGContextEOFillPath(context); - CGPathRelease(path); - } - [self drawInRect:rect]; - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -- (UIImage *)imageByRoundCornerRadius:(CGFloat)radius { - return [self imageByRoundCornerRadius:radius borderWidth:0 borderColor:nil]; -} - -- (UIImage *)imageByRoundCornerRadius:(CGFloat)radius - borderWidth:(CGFloat)borderWidth - borderColor:(UIColor *)borderColor { - return [self imageByRoundCornerRadius:radius - corners:UIRectCornerAllCorners - borderWidth:borderWidth - borderColor:borderColor - borderLineJoin:kCGLineJoinMiter]; -} - -- (UIImage *)imageByRoundCornerRadius:(CGFloat)radius - corners:(UIRectCorner)corners - borderWidth:(CGFloat)borderWidth - borderColor:(UIColor *)borderColor - borderLineJoin:(CGLineJoin)borderLineJoin { - - if (corners != UIRectCornerAllCorners) { - UIRectCorner tmp = 0; - if (corners & UIRectCornerTopLeft) tmp |= UIRectCornerBottomLeft; - if (corners & UIRectCornerTopRight) tmp |= UIRectCornerBottomRight; - if (corners & UIRectCornerBottomLeft) tmp |= UIRectCornerTopLeft; - if (corners & UIRectCornerBottomRight) tmp |= UIRectCornerTopRight; - corners = tmp; - } - - UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height); - CGContextScaleCTM(context, 1, -1); - CGContextTranslateCTM(context, 0, -rect.size.height); - - CGFloat minSize = MIN(self.size.width, self.size.height); - if (borderWidth < minSize / 2) { - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(rect, borderWidth, borderWidth) byRoundingCorners:corners cornerRadii:CGSizeMake(radius, borderWidth)]; - [path closePath]; - - CGContextSaveGState(context); - [path addClip]; - CGContextDrawImage(context, rect, self.CGImage); - CGContextRestoreGState(context); - } - - if (borderColor && borderWidth < minSize / 2 && borderWidth > 0) { - CGFloat strokeInset = (floor(borderWidth * self.scale) + 0.5) / self.scale; - CGRect strokeRect = CGRectInset(rect, strokeInset, strokeInset); - CGFloat strokeRadius = radius > self.scale / 2 ? radius - self.scale / 2 : 0; - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:strokeRect byRoundingCorners:corners cornerRadii:CGSizeMake(strokeRadius, borderWidth)]; - [path closePath]; - - path.lineWidth = borderWidth; - path.lineJoinStyle = borderLineJoin; - [borderColor setStroke]; - [path stroke]; - } - - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -- (UIImage *)imageByRotate:(CGFloat)radians fitSize:(BOOL)fitSize { - size_t width = (size_t)CGImageGetWidth(self.CGImage); - size_t height = (size_t)CGImageGetHeight(self.CGImage); - CGRect newRect = CGRectApplyAffineTransform(CGRectMake(0., 0., width, height), - fitSize ? CGAffineTransformMakeRotation(radians) : CGAffineTransformIdentity); - - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGContextRef context = CGBitmapContextCreate(NULL, - (size_t)newRect.size.width, - (size_t)newRect.size.height, - 8, - (size_t)newRect.size.width * 4, - colorSpace, - kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); - CGColorSpaceRelease(colorSpace); - if (!context) return nil; - - CGContextSetShouldAntialias(context, true); - CGContextSetAllowsAntialiasing(context, true); - CGContextSetInterpolationQuality(context, kCGInterpolationHigh); - - CGContextTranslateCTM(context, +(newRect.size.width * 0.5), +(newRect.size.height * 0.5)); - CGContextRotateCTM(context, radians); - - CGContextDrawImage(context, CGRectMake(-(width * 0.5), -(height * 0.5), width, height), self.CGImage); - CGImageRef imgRef = CGBitmapContextCreateImage(context); - UIImage *img = [UIImage imageWithCGImage:imgRef scale:self.scale orientation:self.imageOrientation]; - CGImageRelease(imgRef); - CGContextRelease(context); - return img; -} - -- (UIImage *)_yy_flipHorizontal:(BOOL)horizontal vertical:(BOOL)vertical { - if (!self.CGImage) return nil; - size_t width = (size_t)CGImageGetWidth(self.CGImage); - size_t height = (size_t)CGImageGetHeight(self.CGImage); - size_t bytesPerRow = width * 4; - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, bytesPerRow, colorSpace, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); - CGColorSpaceRelease(colorSpace); - if (!context) return nil; - - CGContextDrawImage(context, CGRectMake(0, 0, width, height), self.CGImage); - UInt8 *data = (UInt8 *)CGBitmapContextGetData(context); - if (!data) { - CGContextRelease(context); - return nil; - } - vImage_Buffer src = { data, height, width, bytesPerRow }; - vImage_Buffer dest = { data, height, width, bytesPerRow }; - if (vertical) { - vImageVerticalReflect_ARGB8888(&src, &dest, kvImageBackgroundColorFill); - } - if (horizontal) { - vImageHorizontalReflect_ARGB8888(&src, &dest, kvImageBackgroundColorFill); - } - CGImageRef imgRef = CGBitmapContextCreateImage(context); - CGContextRelease(context); - UIImage *img = [UIImage imageWithCGImage:imgRef scale:self.scale orientation:self.imageOrientation]; - CGImageRelease(imgRef); - return img; -} - -- (UIImage *)imageByRotateLeft90 { - return [self imageByRotate:DegreesToRadians(90) fitSize:YES]; -} - -- (UIImage *)imageByRotateRight90 { - return [self imageByRotate:DegreesToRadians(-90) fitSize:YES]; -} - -- (UIImage *)imageByRotate180 { - return [self _yy_flipHorizontal:YES vertical:YES]; -} - -- (UIImage *)imageByFlipVertical { - return [self _yy_flipHorizontal:NO vertical:YES]; -} - -- (UIImage *)imageByFlipHorizontal { - return [self _yy_flipHorizontal:YES vertical:NO]; -} - -- (UIImage *)imageByTintColor:(UIColor *)color { - UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale); - CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height); - [color set]; - UIRectFill(rect); - [self drawAtPoint:CGPointMake(0, 0) blendMode:kCGBlendModeDestinationIn alpha:1]; - UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return newImage; -} - -- (UIImage *)imageByGrayscale { - return [self imageByBlurRadius:0 tintColor:nil tintMode:0 saturation:0 maskImage:nil]; -} - -- (UIImage *)imageByBlurSoft { - return [self imageByBlurRadius:60 tintColor:[UIColor colorWithWhite:0.84 alpha:0.36] tintMode:kCGBlendModeNormal saturation:1.8 maskImage:nil]; -} - -- (UIImage *)imageByBlurLight { - return [self imageByBlurRadius:60 tintColor:[UIColor colorWithWhite:1.0 alpha:0.3] tintMode:kCGBlendModeNormal saturation:1.8 maskImage:nil]; -} - -- (UIImage *)imageByBlurExtraLight { - return [self imageByBlurRadius:40 tintColor:[UIColor colorWithWhite:0.97 alpha:0.82] tintMode:kCGBlendModeNormal saturation:1.8 maskImage:nil]; -} - -- (UIImage *)imageByBlurDark { - return [self imageByBlurRadius:40 tintColor:[UIColor colorWithWhite:0.11 alpha:0.73] tintMode:kCGBlendModeNormal saturation:1.8 maskImage:nil]; -} - -- (UIImage *)imageByBlurWithTint:(UIColor *)tintColor { - const CGFloat EffectColorAlpha = 0.6; - UIColor *effectColor = tintColor; - size_t componentCount = CGColorGetNumberOfComponents(tintColor.CGColor); - if (componentCount == 2) { - CGFloat b; - if ([tintColor getWhite:&b alpha:NULL]) { - effectColor = [UIColor colorWithWhite:b alpha:EffectColorAlpha]; - } - } else { - CGFloat r, g, b; - if ([tintColor getRed:&r green:&g blue:&b alpha:NULL]) { - effectColor = [UIColor colorWithRed:r green:g blue:b alpha:EffectColorAlpha]; - } - } - return [self imageByBlurRadius:20 tintColor:effectColor tintMode:kCGBlendModeNormal saturation:-1.0 maskImage:nil]; -} - -- (UIImage *)imageByBlurRadius:(CGFloat)blurRadius - tintColor:(UIColor *)tintColor - tintMode:(CGBlendMode)tintBlendMode - saturation:(CGFloat)saturation - maskImage:(UIImage *)maskImage { - if (self.size.width < 1 || self.size.height < 1) { - NSLog(@"UIImage+YYAdd error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); - return nil; - } - if (!self.CGImage) { - NSLog(@"UIImage+YYAdd error: inputImage must be backed by a CGImage: %@", self); - return nil; - } - if (maskImage && !maskImage.CGImage) { - NSLog(@"UIImage+YYAdd error: effectMaskImage must be backed by a CGImage: %@", maskImage); - return nil; - } - - // iOS7 and above can use new func. - BOOL hasNewFunc = (long)vImageBuffer_InitWithCGImage != 0 && (long)vImageCreateCGImageFromBuffer != 0; - BOOL hasBlur = blurRadius > __FLT_EPSILON__; - BOOL hasSaturation = fabs(saturation - 1.0) > __FLT_EPSILON__; - - CGSize size = self.size; - CGRect rect = { CGPointZero, size }; - CGFloat scale = self.scale; - CGImageRef imageRef = self.CGImage; - BOOL opaque = NO; - - if (!hasBlur && !hasSaturation) { - return [self _yy_mergeImageRef:imageRef tintColor:tintColor tintBlendMode:tintBlendMode maskImage:maskImage opaque:opaque]; - } - - vImage_Buffer effect = { 0 }, scratch = { 0 }; - vImage_Buffer *input = NULL, *output = NULL; - - vImage_CGImageFormat format = { - .bitsPerComponent = 8, - .bitsPerPixel = 32, - .colorSpace = NULL, - .bitmapInfo = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little, //requests a BGRA buffer. - .version = 0, - .decode = NULL, - .renderingIntent = kCGRenderingIntentDefault - }; - - if (hasNewFunc) { - vImage_Error err; - err = vImageBuffer_InitWithCGImage(&effect, &format, NULL, imageRef, kvImagePrintDiagnosticsToConsole); - if (err != kvImageNoError) { - NSLog(@"UIImage+YYAdd error: vImageBuffer_InitWithCGImage returned error code %zi for inputImage: %@", err, self); - return nil; - } - err = vImageBuffer_Init(&scratch, effect.height, effect.width, format.bitsPerPixel, kvImageNoFlags); - if (err != kvImageNoError) { - NSLog(@"UIImage+YYAdd error: vImageBuffer_Init returned error code %zi for inputImage: %@", err, self); - return nil; - } - } else { - UIGraphicsBeginImageContextWithOptions(size, opaque, scale); - CGContextRef effectCtx = UIGraphicsGetCurrentContext(); - CGContextScaleCTM(effectCtx, 1.0, -1.0); - CGContextTranslateCTM(effectCtx, 0, -size.height); - CGContextDrawImage(effectCtx, rect, imageRef); - effect.data = CGBitmapContextGetData(effectCtx); - effect.width = CGBitmapContextGetWidth(effectCtx); - effect.height = CGBitmapContextGetHeight(effectCtx); - effect.rowBytes = CGBitmapContextGetBytesPerRow(effectCtx); - - UIGraphicsBeginImageContextWithOptions(size, opaque, scale); - CGContextRef scratchCtx = UIGraphicsGetCurrentContext(); - scratch.data = CGBitmapContextGetData(scratchCtx); - scratch.width = CGBitmapContextGetWidth(scratchCtx); - scratch.height = CGBitmapContextGetHeight(scratchCtx); - scratch.rowBytes = CGBitmapContextGetBytesPerRow(scratchCtx); - } - - input = &effect; - output = &scratch; - - if (hasBlur) { - // A description of how to compute the box kernel width from the Gaussian - // radius (aka standard deviation) appears in the SVG spec: - // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement - // - // For larger values of 's' (s >= 2.0), an approximation can be used: Three - // successive box-blurs build a piece-wise quadratic convolution kernel, which - // approximates the Gaussian kernel to within roughly 3%. - // - // let d = floor(s * 3*sqrt(2*pi)/4 + 0.5) - // - // ... if d is odd, use three box-blurs of size 'd', centered on the output pixel. - // - CGFloat inputRadius = blurRadius * scale; - if (inputRadius - 2.0 < __FLT_EPSILON__) inputRadius = 2.0; - uint32_t radius = floor((inputRadius * 3.0 * sqrt(2 * M_PI) / 4 + 0.5) / 2); - radius |= 1; // force radius to be odd so that the three box-blur methodology works. - int iterations; - if (blurRadius * scale < 0.5) iterations = 1; - else if (blurRadius * scale < 1.5) iterations = 2; - else iterations = 3; - NSInteger tempSize = vImageBoxConvolve_ARGB8888(input, output, NULL, 0, 0, radius, radius, NULL, kvImageGetTempBufferSize | kvImageEdgeExtend); - void *temp = malloc(tempSize); - for (int i = 0; i < iterations; i++) { - vImageBoxConvolve_ARGB8888(input, output, temp, 0, 0, radius, radius, NULL, kvImageEdgeExtend); - YY_SWAP(input, output); - } - free(temp); - } - - - if (hasSaturation) { - // These values appear in the W3C Filter Effects spec: - // https://dvcs.w3.org/hg/FXTF/raw-file/default/filters/Publish.html#grayscaleEquivalent - CGFloat s = saturation; - CGFloat matrixFloat[] = { - 0.0722 + 0.9278 * s, 0.0722 - 0.0722 * s, 0.0722 - 0.0722 * s, 0, - 0.7152 - 0.7152 * s, 0.7152 + 0.2848 * s, 0.7152 - 0.7152 * s, 0, - 0.2126 - 0.2126 * s, 0.2126 - 0.2126 * s, 0.2126 + 0.7873 * s, 0, - 0, 0, 0, 1, - }; - const int32_t divisor = 256; - NSUInteger matrixSize = sizeof(matrixFloat) / sizeof(matrixFloat[0]); - int16_t matrix[matrixSize]; - for (NSUInteger i = 0; i < matrixSize; ++i) { - matrix[i] = (int16_t)roundf(matrixFloat[i] * divisor); - } - vImageMatrixMultiply_ARGB8888(input, output, matrix, divisor, NULL, NULL, kvImageNoFlags); - YY_SWAP(input, output); - } - - UIImage *outputImage = nil; - if (hasNewFunc) { - CGImageRef effectCGImage = NULL; - effectCGImage = vImageCreateCGImageFromBuffer(input, &format, &_yy_cleanupBuffer, NULL, kvImageNoAllocate, NULL); - if (effectCGImage == NULL) { - effectCGImage = vImageCreateCGImageFromBuffer(input, &format, NULL, NULL, kvImageNoFlags, NULL); - free(input->data); - } - free(output->data); - outputImage = [self _yy_mergeImageRef:effectCGImage tintColor:tintColor tintBlendMode:tintBlendMode maskImage:maskImage opaque:opaque]; - CGImageRelease(effectCGImage); - } else { - CGImageRef effectCGImage; - UIImage *effectImage; - if (input != &effect) effectImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - if (input == &effect) effectImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - effectCGImage = effectImage.CGImage; - outputImage = [self _yy_mergeImageRef:effectCGImage tintColor:tintColor tintBlendMode:tintBlendMode maskImage:maskImage opaque:opaque]; - } - return outputImage; -} - -// Helper function to handle deferred cleanup of a buffer. -static void _yy_cleanupBuffer(void *userData, void *buf_data) { - free(buf_data); -} - -// Helper function to add tint and mask. -- (UIImage *)_yy_mergeImageRef:(CGImageRef)effectCGImage - tintColor:(UIColor *)tintColor - tintBlendMode:(CGBlendMode)tintBlendMode - maskImage:(UIImage *)maskImage - opaque:(BOOL)opaque { - BOOL hasTint = tintColor != nil && CGColorGetAlpha(tintColor.CGColor) > __FLT_EPSILON__; - BOOL hasMask = maskImage != nil; - CGSize size = self.size; - CGRect rect = { CGPointZero, size }; - CGFloat scale = self.scale; - - if (!hasTint && !hasMask) { - return [UIImage imageWithCGImage:effectCGImage]; - } - - UIGraphicsBeginImageContextWithOptions(size, opaque, scale); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextScaleCTM(context, 1.0, -1.0); - CGContextTranslateCTM(context, 0, -size.height); - if (hasMask) { - CGContextDrawImage(context, rect, self.CGImage); - CGContextSaveGState(context); - CGContextClipToMask(context, rect, maskImage.CGImage); - } - CGContextDrawImage(context, rect, effectCGImage); - if (hasTint) { - CGContextSaveGState(context); - CGContextSetBlendMode(context, tintBlendMode); - CGContextSetFillColorWithColor(context, tintColor.CGColor); - CGContextFillRect(context, rect); - CGContextRestoreGState(context); - } - if (hasMask) { - CGContextRestoreGState(context); - } - UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return outputImage; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScreen+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScreen+YYAdd.h deleted file mode 100644 index 43940bf2..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScreen+YYAdd.h +++ /dev/null @@ -1,63 +0,0 @@ -// -// UIScreen+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/5. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIScreen`. - */ -@interface UIScreen (YYAdd) - -/** - Main screen's scale - - @return screen's scale - */ -+ (CGFloat)screenScale; - -/** - Returns the bounds of the screen for the current device orientation. - - @return A rect indicating the bounds of the screen. - @see boundsForOrientation: - */ -- (CGRect)currentBounds NS_EXTENSION_UNAVAILABLE_IOS(""); - -/** - Returns the bounds of the screen for a given device orientation. - `UIScreen`'s `bounds` method always returns the bounds of the - screen of it in the portrait orientation. - - @param orientation The orientation to get the screen's bounds. - @return A rect indicating the bounds of the screen. - @see currentBounds - */ -- (CGRect)boundsForOrientation:(UIInterfaceOrientation)orientation; - -/** - The screen's real size in pixel (width is always smaller than height). - This value may not be very accurate in an unknown device, or simulator. - e.g. (768,1024) - */ -@property (nonatomic, readonly) CGSize sizeInPixel; - -/** - The screen's PPI. - This value may not be very accurate in an unknown device, or simulator. - Default value is 96. - */ -@property (nonatomic, readonly) CGFloat pixelsPerInch; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScreen+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScreen+YYAdd.m deleted file mode 100644 index a0b02551..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScreen+YYAdd.m +++ /dev/null @@ -1,176 +0,0 @@ -// -// UIScreen+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/5. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIScreen+YYAdd.h" -#import "YYCategoriesMacro.h" -#import "UIDevice+YYAdd.h" - -YYSYNTH_DUMMY_CLASS(UIScreen_YYAdd); - - -@implementation UIScreen (YYAdd) - -+ (CGFloat)screenScale { - static CGFloat screenScale = 0.0; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - if ([NSThread isMainThread]) { - screenScale = [[UIScreen mainScreen] scale]; - } else { - dispatch_sync(dispatch_get_main_queue(), ^{ - screenScale = [[UIScreen mainScreen] scale]; - }); - } - }); - return screenScale; -} - -#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED -- (CGRect)currentBounds { - return [self boundsForOrientation:[[UIApplication sharedApplication] statusBarOrientation]]; -} -#endif - -- (CGRect)boundsForOrientation:(UIInterfaceOrientation)orientation { - CGRect bounds = [self bounds]; - - if (UIInterfaceOrientationIsLandscape(orientation)) { - CGFloat buffer = bounds.size.width; - bounds.size.width = bounds.size.height; - bounds.size.height = buffer; - } - return bounds; -} - -- (CGSize)sizeInPixel { - CGSize size = CGSizeZero; - - if ([[UIScreen mainScreen] isEqual:self]) { - NSString *model = [UIDevice currentDevice].machineModel; - - if ([model hasPrefix:@"iPhone"]) { - if ([model isEqualToString:@"iPhone7,1"]) return CGSizeMake(1080, 1920); - if ([model isEqualToString:@"iPhone8,2"]) return CGSizeMake(1080, 1920); - if ([model isEqualToString:@"iPhone9,2"]) return CGSizeMake(1080, 1920); - if ([model isEqualToString:@"iPhone9,4"]) return CGSizeMake(1080, 1920); - } - if ([model hasPrefix:@"iPad"]) { - if ([model hasPrefix:@"iPad6,7"]) size = CGSizeMake(2048, 2732); - if ([model hasPrefix:@"iPad6,8"]) size = CGSizeMake(2048, 2732); - } - } - - if (CGSizeEqualToSize(size, CGSizeZero)) { - if ([self respondsToSelector:@selector(nativeBounds)]) { - size = self.nativeBounds.size; - } else { - size = self.bounds.size; - size.width *= self.scale; - size.height *= self.scale; - } - if (size.height < size.width) { - CGFloat tmp = size.height; - size.height = size.width; - size.width = tmp; - } - } - return size; -} - -- (CGFloat)pixelsPerInch { - if (![[UIScreen mainScreen] isEqual:self]) { - return 326; - } - - static CGFloat ppi = 0; - static dispatch_once_t one; - static NSString *name; - dispatch_once(&one, ^{ - NSDictionary *dic = @{ - @"Watch1,1" : @326, //@"Apple Watch 38mm", - @"Watch1,2" : @326, //@"Apple Watch 43mm", - @"Watch2,3" : @326, //@"Apple Watch Series 2 38mm", - @"Watch2,4" : @326, //@"Apple Watch Series 2 42mm", - @"Watch2,6" : @326, //@"Apple Watch Series 1 38mm", - @"Watch1,7" : @326, //@"Apple Watch Series 1 42mm", - - @"iPod1,1" : @163, //@"iPod touch 1", - @"iPod2,1" : @163, //@"iPod touch 2", - @"iPod3,1" : @163, //@"iPod touch 3", - @"iPod4,1" : @326, //@"iPod touch 4", - @"iPod5,1" : @326, //@"iPod touch 5", - @"iPod7,1" : @326, //@"iPod touch 6", - - @"iPhone1,1" : @163, //@"iPhone 1G", - @"iPhone1,2" : @163, //@"iPhone 3G", - @"iPhone2,1" : @163, //@"iPhone 3GS", - @"iPhone3,1" : @326, //@"iPhone 4 (GSM)", - @"iPhone3,2" : @326, //@"iPhone 4", - @"iPhone3,3" : @326, //@"iPhone 4 (CDMA)", - @"iPhone4,1" : @326, //@"iPhone 4S", - @"iPhone5,1" : @326, //@"iPhone 5", - @"iPhone5,2" : @326, //@"iPhone 5", - @"iPhone5,3" : @326, //@"iPhone 5c", - @"iPhone5,4" : @326, //@"iPhone 5c", - @"iPhone6,1" : @326, //@"iPhone 5s", - @"iPhone6,2" : @326, //@"iPhone 5s", - @"iPhone7,1" : @401, //@"iPhone 6 Plus", - @"iPhone7,2" : @326, //@"iPhone 6", - @"iPhone8,1" : @326, //@"iPhone 6s", - @"iPhone8,2" : @401, //@"iPhone 6s Plus", - @"iPhone8,4" : @326, //@"iPhone SE", - @"iPhone9,1" : @326, //@"iPhone 7", - @"iPhone9,2" : @401, //@"iPhone 7 Plus", - @"iPhone9,3" : @326, //@"iPhone 7", - @"iPhone9,4" : @401, //@"iPhone 7 Plus", - - @"iPad1,1" : @132, //@"iPad 1", - @"iPad2,1" : @132, //@"iPad 2 (WiFi)", - @"iPad2,2" : @132, //@"iPad 2 (GSM)", - @"iPad2,3" : @132, //@"iPad 2 (CDMA)", - @"iPad2,4" : @132, //@"iPad 2", - @"iPad2,5" : @264, //@"iPad mini 1", - @"iPad2,6" : @264, //@"iPad mini 1", - @"iPad2,7" : @264, //@"iPad mini 1", - @"iPad3,1" : @324, //@"iPad 3 (WiFi)", - @"iPad3,2" : @324, //@"iPad 3 (4G)", - @"iPad3,3" : @324, //@"iPad 3 (4G)", - @"iPad3,4" : @324, //@"iPad 4", - @"iPad3,5" : @324, //@"iPad 4", - @"iPad3,6" : @324, //@"iPad 4", - @"iPad4,1" : @324, //@"iPad Air", - @"iPad4,2" : @324, //@"iPad Air", - @"iPad4,3" : @324, //@"iPad Air", - @"iPad4,4" : @264, //@"iPad mini 2", - @"iPad4,5" : @264, //@"iPad mini 2", - @"iPad4,6" : @264, //@"iPad mini 2", - @"iPad4,7" : @264, //@"iPad mini 3", - @"iPad4,8" : @264, //@"iPad mini 3", - @"iPad4,9" : @264, //@"iPad mini 3", - @"iPad5,1" : @264, //@"iPad mini 4", - @"iPad5,2" : @264, //@"iPad mini 4", - @"iPad5,3" : @324, //@"iPad Air 2", - @"iPad5,4" : @324, //@"iPad Air 2", - @"iPad6,3" : @324, //@"iPad Pro (9.7 inch)", - @"iPad6,4" : @324, //@"iPad Pro (9.7 inch)", - @"iPad6,7" : @264, //@"iPad Pro (12.9 inch)", - @"iPad6,8" : @264, //@"iPad Pro (12.9 inch)", - }; - NSString *model = [UIDevice currentDevice].machineModel; - if (model) { - ppi = dic[name].doubleValue; - } - if (ppi == 0) ppi = 326; - }); - return ppi; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScrollView+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScrollView+YYAdd.h deleted file mode 100644 index b62f99d4..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScrollView+YYAdd.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// UIScrollView+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/5. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIScrollView`. - */ -@interface UIScrollView (YYAdd) - -/** - Scroll content to top with animation. - */ -- (void)scrollToTop; - -/** - Scroll content to bottom with animation. - */ -- (void)scrollToBottom; - -/** - Scroll content to left with animation. - */ -- (void)scrollToLeft; - -/** - Scroll content to right with animation. - */ -- (void)scrollToRight; - -/** - Scroll content to top. - - @param animated Use animation. - */ -- (void)scrollToTopAnimated:(BOOL)animated; - -/** - Scroll content to bottom. - - @param animated Use animation. - */ -- (void)scrollToBottomAnimated:(BOOL)animated; - -/** - Scroll content to left. - - @param animated Use animation. - */ -- (void)scrollToLeftAnimated:(BOOL)animated; - -/** - Scroll content to right. - - @param animated Use animation. - */ -- (void)scrollToRightAnimated:(BOOL)animated; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScrollView+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScrollView+YYAdd.m deleted file mode 100644 index 766105ab..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIScrollView+YYAdd.m +++ /dev/null @@ -1,60 +0,0 @@ -// -// UIScrollView+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/5. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIScrollView+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(UIScrollView_YYAdd) - - -@implementation UIScrollView (YYAdd) - -- (void)scrollToTop { - [self scrollToTopAnimated:YES]; -} - -- (void)scrollToBottom { - [self scrollToBottomAnimated:YES]; -} - -- (void)scrollToLeft { - [self scrollToLeftAnimated:YES]; -} - -- (void)scrollToRight { - [self scrollToRightAnimated:YES]; -} - -- (void)scrollToTopAnimated:(BOOL)animated { - CGPoint off = self.contentOffset; - off.y = 0 - self.contentInset.top; - [self setContentOffset:off animated:animated]; -} - -- (void)scrollToBottomAnimated:(BOOL)animated { - CGPoint off = self.contentOffset; - off.y = self.contentSize.height - self.bounds.size.height + self.contentInset.bottom; - [self setContentOffset:off animated:animated]; -} - -- (void)scrollToLeftAnimated:(BOOL)animated { - CGPoint off = self.contentOffset; - off.x = 0 - self.contentInset.left; - [self setContentOffset:off animated:animated]; -} - -- (void)scrollToRightAnimated:(BOOL)animated { - CGPoint off = self.contentOffset; - off.x = self.contentSize.width - self.bounds.size.width + self.contentInset.right; - [self setContentOffset:off animated:animated]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.h deleted file mode 100644 index 5dc38b25..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.h +++ /dev/null @@ -1,188 +0,0 @@ -// -// UITableView+YYAdd.h -// YYCategories -// -// Created by ibireme on 14/5/12. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UITableView`. - */ -@interface UITableView (YYAdd) - -/** - Perform a series of method calls that insert, delete, or select rows and - sections of the receiver. - - @discussion Perform a series of method calls that insert, delete, or select - rows and sections of the table. Call this method if you want - subsequent insertions, deletion, and selection operations (for - example, cellForRowAtIndexPath: and indexPathsForVisibleRows) - to be animated simultaneously. - - @discussion If you do not make the insertion, deletion, and selection calls - inside this block, table attributes such as row count might become - invalid. You should not call reloadData within the block; if you - call this method within the group, you will need to perform any - animations yourself. - - @param block A block combine a series of method calls. - */ -- (void)updateWithBlock:(void (^)(UITableView *tableView))block; - -/** - Scrolls the receiver until a row or section location on the screen. - - @discussion Invoking this method does not cause the delegate to - receive a scrollViewDidScroll: message, as is normal for - programmatically-invoked user interface operations. - - @param row Row index in section. NSNotFound is a valid value for - scrolling to a section with zero rows. - - @param section Section index in table. - - @param scrollPosition A constant that identifies a relative position in the - receiving table view (top, middle, bottom) for row when - scrolling concludes. - - @param animated YES if you want to animate the change in position, - NO if it should be immediate. - */ -- (void)scrollToRow:(NSUInteger)row inSection:(NSUInteger)section atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated; - -/** - Inserts a row in the receiver with an option to animate the insertion. - - @param row Row index in section. - - @param section Section index in table. - - @param animation A constant that either specifies the kind of animation to - perform when inserting the cell or requests no animation. - */ -- (void)insertRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Reloads the specified row using a certain animation effect. - - @param row Row index in section. - - @param section Section index in table. - - @param animation A constant that indicates how the reloading is to be animated, - for example, fade out or slide out from the bottom. The animation - constant affects the direction in which both the old and the - new rows slide. For example, if the animation constant is - UITableViewRowAnimationRight, the old rows slide out to the - right and the new cells slide in from the right. - */ -- (void)reloadRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Deletes the row with an option to animate the deletion. - - @param row Row index in section. - - @param section Section index in table. - - @param animation A constant that indicates how the deletion is to be animated, - for example, fade out or slide out from the bottom. - */ -- (void)deleteRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Inserts the row in the receiver at the locations identified by the indexPath, - with an option to animate the insertion. - - @param indexPath An NSIndexPath object representing a row index and section - index that together identify a row in the table view. - - @param animation A constant that either specifies the kind of animation to - perform when inserting the cell or requests no animation. - */ -- (void)insertRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Reloads the specified row using a certain animation effect. - - @param indexPath An NSIndexPath object representing a row index and section - index that together identify a row in the table view. - - @param animation A constant that indicates how the reloading is to be animated, - for example, fade out or slide out from the bottom. The animation - constant affects the direction in which both the old and the - new rows slide. For example, if the animation constant is - UITableViewRowAnimationRight, the old rows slide out to the - right and the new cells slide in from the right. - */ -- (void)reloadRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Deletes the row specified by an array of index paths, - with an option to animate the deletion. - - @param indexPath An NSIndexPath object representing a row index and section - index that together identify a row in the table view. - - @param animation A constant that indicates how the deletion is to be animated, - for example, fade out or slide out from the bottom. - */ -- (void)deleteRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Inserts a section in the receiver, with an option to animate the insertion. - - @param section An index specifies the section to insert in the receiving - table view. If a section already exists at the specified - index location, it is moved down one index location. - - @param animation A constant that indicates how the insertion is to be animated, - for example, fade in or slide in from the left. - */ -- (void)insertSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Deletes a section in the receiver, with an option to animate the deletion. - - @param section An index that specifies the sections to delete from the - receiving table view. If a section exists after the specified - index location, it is moved up one index location. - - @param animation A constant that either specifies the kind of animation to - perform when deleting the section or requests no animation. - */ -- (void)deleteSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Reloads the specified section using a given animation effect. - - @param section An index identifying the section to reload. - - @param animation A constant that indicates how the reloading is to be animated, - for example, fade out or slide out from the bottom. The - animation constant affects the direction in which both the - old and the new section rows slide. For example, if the - animation constant is UITableViewRowAnimationRight, the old - rows slide out to the right and the new cells slide in from the right. - */ -- (void)reloadSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation; - -/** - Unselect all rows in tableView. - - @param animated YES to animate the transition, NO to make the transition immediate. - */ -- (void)clearSelectedRowsAnimated:(BOOL)animated; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.m deleted file mode 100644 index 9bd400e9..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITableView+YYAdd.m +++ /dev/null @@ -1,80 +0,0 @@ -// -// UITableView+YYAdd.m -// YYCategories -// -// Created by ibireme on 14/5/12. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UITableView+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(UITableView_YYAdd) - - -@implementation UITableView (YYAdd) - -- (void)updateWithBlock:(void (^)(UITableView *tableView))block { - [self beginUpdates]; - block(self); - [self endUpdates]; -} - -- (void)scrollToRow:(NSUInteger)row inSection:(NSUInteger)section atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated { - NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section]; - [self scrollToRowAtIndexPath:indexPath atScrollPosition:scrollPosition animated:animated]; -} - -- (void)insertRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation { - [self insertRowsAtIndexPaths:@[indexPath] withRowAnimation:animation]; -} - -- (void)insertRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { - NSIndexPath *toInsert = [NSIndexPath indexPathForRow:row inSection:section]; - [self insertRowAtIndexPath:toInsert withRowAnimation:animation]; -} - -- (void)reloadRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation { - [self reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:animation]; -} - -- (void)reloadRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { - NSIndexPath *toReload = [NSIndexPath indexPathForRow:row inSection:section]; - [self reloadRowAtIndexPath:toReload withRowAnimation:animation]; -} - -- (void)deleteRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation { - [self deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:animation]; -} - -- (void)deleteRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { - NSIndexPath *toDelete = [NSIndexPath indexPathForRow:row inSection:section]; - [self deleteRowAtIndexPath:toDelete withRowAnimation:animation]; -} - -- (void)insertSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { - NSIndexSet *sections = [NSIndexSet indexSetWithIndex:section]; - [self insertSections:sections withRowAnimation:animation]; -} - -- (void)deleteSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { - NSIndexSet *sections = [NSIndexSet indexSetWithIndex:section]; - [self deleteSections:sections withRowAnimation:animation]; -} - -- (void)reloadSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation { - NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:section]; - [self reloadSections:indexSet withRowAnimation:animation]; -} - -- (void)clearSelectedRowsAnimated:(BOOL)animated { - NSArray *indexs = [self indexPathsForSelectedRows]; - [indexs enumerateObjectsUsingBlock:^(NSIndexPath* path, NSUInteger idx, BOOL *stop) { - [self deselectRowAtIndexPath:path animated:animated]; - }]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITextField+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITextField+YYAdd.h deleted file mode 100644 index adf3f8fb..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITextField+YYAdd.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// UITextField+YYAdd.h -// YYCategories -// -// Created by ibireme on 14/5/12. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UITextField`. - */ -@interface UITextField (YYAdd) - -/** - Set all text selected. - */ -- (void)selectAllText; - -/** - Set text in range selected. - - @param range The range of selected text in a document. - */ -- (void)setSelectedRange:(NSRange)range; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITextField+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITextField+YYAdd.m deleted file mode 100644 index 0288c821..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UITextField+YYAdd.m +++ /dev/null @@ -1,33 +0,0 @@ -// -// UITextField+YYAdd.m -// YYCategories -// -// Created by ibireme on 14/5/12. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UITextField+YYAdd.h" -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(UITextField_YYAdd) - - -@implementation UITextField (YYAdd) - -- (void)selectAllText { - UITextRange *range = [self textRangeFromPosition:self.beginningOfDocument toPosition:self.endOfDocument]; - [self setSelectedTextRange:range]; -} - -- (void)setSelectedRange:(NSRange)range { - UITextPosition *beginning = self.beginningOfDocument; - UITextPosition *startPosition = [self positionFromPosition:beginning offset:range.location]; - UITextPosition *endPosition = [self positionFromPosition:beginning offset:NSMaxRange(range)]; - UITextRange *selectionRange = [self textRangeFromPosition:startPosition toPosition:endPosition]; - [self setSelectedTextRange:selectionRange]; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIView+YYAdd.h b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIView+YYAdd.h deleted file mode 100644 index 844b35b9..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIView+YYAdd.h +++ /dev/null @@ -1,117 +0,0 @@ -// -// UIView+YYAdd.h -// YYCategories -// -// Created by ibireme on 13/4/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIView`. - */ -@interface UIView (YYAdd) - -/** - Create a snapshot image of the complete view hierarchy. - */ -- (nullable UIImage *)snapshotImage; - -/** - Create a snapshot image of the complete view hierarchy. - @discussion It's faster than "snapshotImage", but may cause screen updates. - See -[UIView drawViewHierarchyInRect:afterScreenUpdates:] for more information. - */ -- (nullable UIImage *)snapshotImageAfterScreenUpdates:(BOOL)afterUpdates; - -/** - Create a snapshot PDF of the complete view hierarchy. - */ -- (nullable NSData *)snapshotPDF; - -/** - Shortcut to set the view.layer's shadow - - @param color Shadow Color - @param offset Shadow offset - @param radius Shadow radius - */ -- (void)setLayerShadow:(nullable UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius; - -/** - Remove all subviews. - - @warning Never call this method inside your view's drawRect: method. - */ -- (void)removeAllSubviews; - -/** - Returns the view's view controller (may be nil). - */ -@property (nullable, nonatomic, readonly) UIViewController *viewController; - -/** - Returns the visible alpha on screen, taking into account superview and window. - */ -@property (nonatomic, readonly) CGFloat visibleAlpha; - -/** - Converts a point from the receiver's coordinate system to that of the specified view or window. - - @param point A point specified in the local coordinate system (bounds) of the receiver. - @param view The view or window into whose coordinate system point is to be converted. - If view is nil, this method instead converts to window base coordinates. - @return The point converted to the coordinate system of view. - */ -- (CGPoint)convertPoint:(CGPoint)point toViewOrWindow:(nullable UIView *)view; - -/** - Converts a point from the coordinate system of a given view or window to that of the receiver. - - @param point A point specified in the local coordinate system (bounds) of view. - @param view The view or window with point in its coordinate system. - If view is nil, this method instead converts from window base coordinates. - @return The point converted to the local coordinate system (bounds) of the receiver. - */ -- (CGPoint)convertPoint:(CGPoint)point fromViewOrWindow:(nullable UIView *)view; - -/** - Converts a rectangle from the receiver's coordinate system to that of another view or window. - - @param rect A rectangle specified in the local coordinate system (bounds) of the receiver. - @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. - @return The converted rectangle. - */ -- (CGRect)convertRect:(CGRect)rect toViewOrWindow:(nullable UIView *)view; - -/** - Converts a rectangle from the coordinate system of another view or window to that of the receiver. - - @param rect A rectangle specified in the local coordinate system (bounds) of view. - @param view The view or window with rect in its coordinate system. - If view is nil, this method instead converts from window base coordinates. - @return The converted rectangle. - */ -- (CGRect)convertRect:(CGRect)rect fromViewOrWindow:(nullable UIView *)view; - - -@property (nonatomic) CGFloat left; ///< Shortcut for frame.origin.x. -@property (nonatomic) CGFloat top; ///< Shortcut for frame.origin.y -@property (nonatomic) CGFloat right; ///< Shortcut for frame.origin.x + frame.size.width -@property (nonatomic) CGFloat bottom; ///< Shortcut for frame.origin.y + frame.size.height -@property (nonatomic) CGFloat width; ///< Shortcut for frame.size.width. -@property (nonatomic) CGFloat height; ///< Shortcut for frame.size.height. -@property (nonatomic) CGFloat centerX; ///< Shortcut for center.x -@property (nonatomic) CGFloat centerY; ///< Shortcut for center.y -@property (nonatomic) CGPoint origin; ///< Shortcut for frame.origin. -@property (nonatomic) CGSize size; ///< Shortcut for frame.size. - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIView+YYAdd.m b/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIView+YYAdd.m deleted file mode 100644 index 90c877e8..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/UIKit/UIView+YYAdd.m +++ /dev/null @@ -1,272 +0,0 @@ -// -// UIView+YYAdd.m -// YYCategories -// -// Created by ibireme on 13/4/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIView+YYAdd.h" -#import -#import "YYCategoriesMacro.h" - -YYSYNTH_DUMMY_CLASS(UIView_YYAdd) - - -@implementation UIView (YYAdd) - -- (UIImage *)snapshotImage { - UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0); - [self.layer renderInContext:UIGraphicsGetCurrentContext()]; - UIImage *snap = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return snap; -} - -- (UIImage *)snapshotImageAfterScreenUpdates:(BOOL)afterUpdates { - if (![self respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { - return [self snapshotImage]; - } - UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0); - [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:afterUpdates]; - UIImage *snap = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return snap; -} - -- (NSData *)snapshotPDF { - CGRect bounds = self.bounds; - NSMutableData* data = [NSMutableData data]; - CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData((__bridge CFMutableDataRef)data); - CGContextRef context = CGPDFContextCreate(consumer, &bounds, NULL); - CGDataConsumerRelease(consumer); - if (!context) return nil; - CGPDFContextBeginPage(context, NULL); - CGContextTranslateCTM(context, 0, bounds.size.height); - CGContextScaleCTM(context, 1.0, -1.0); - [self.layer renderInContext:context]; - CGPDFContextEndPage(context); - CGPDFContextClose(context); - CGContextRelease(context); - return data; -} - -- (void)setLayerShadow:(UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius { - self.layer.shadowColor = color.CGColor; - self.layer.shadowOffset = offset; - self.layer.shadowRadius = radius; - self.layer.shadowOpacity = 1; - self.layer.shouldRasterize = YES; - self.layer.rasterizationScale = [UIScreen mainScreen].scale; -} - -- (void)removeAllSubviews { - //[self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; - while (self.subviews.count) { - [self.subviews.lastObject removeFromSuperview]; - } -} - - -- (UIViewController *)viewController { - for (UIView *view = self; view; view = view.superview) { - UIResponder *nextResponder = [view nextResponder]; - if ([nextResponder isKindOfClass:[UIViewController class]]) { - return (UIViewController *)nextResponder; - } - } - return nil; -} - -- (CGFloat)visibleAlpha { - if ([self isKindOfClass:[UIWindow class]]) { - if (self.hidden) return 0; - return self.alpha; - } - if (!self.window) return 0; - CGFloat alpha = 1; - UIView *v = self; - while (v) { - if (v.hidden) { - alpha = 0; - break; - } - alpha *= v.alpha; - v = v.superview; - } - return alpha; -} - -- (CGPoint)convertPoint:(CGPoint)point toViewOrWindow:(UIView *)view { - if (!view) { - if ([self isKindOfClass:[UIWindow class]]) { - return [((UIWindow *)self) convertPoint:point toWindow:nil]; - } else { - return [self convertPoint:point toView:nil]; - } - } - - UIWindow *from = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window; - UIWindow *to = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - if ((!from || !to) || (from == to)) return [self convertPoint:point toView:view]; - point = [self convertPoint:point toView:from]; - point = [to convertPoint:point fromWindow:from]; - point = [view convertPoint:point fromView:to]; - return point; -} - -- (CGPoint)convertPoint:(CGPoint)point fromViewOrWindow:(UIView *)view { - if (!view) { - if ([self isKindOfClass:[UIWindow class]]) { - return [((UIWindow *)self) convertPoint:point fromWindow:nil]; - } else { - return [self convertPoint:point fromView:nil]; - } - } - - UIWindow *from = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - UIWindow *to = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window; - if ((!from || !to) || (from == to)) return [self convertPoint:point fromView:view]; - point = [from convertPoint:point fromView:view]; - point = [to convertPoint:point fromWindow:from]; - point = [self convertPoint:point fromView:to]; - return point; -} - -- (CGRect)convertRect:(CGRect)rect toViewOrWindow:(UIView *)view { - if (!view) { - if ([self isKindOfClass:[UIWindow class]]) { - return [((UIWindow *)self) convertRect:rect toWindow:nil]; - } else { - return [self convertRect:rect toView:nil]; - } - } - - UIWindow *from = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window; - UIWindow *to = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - if (!from || !to) return [self convertRect:rect toView:view]; - if (from == to) return [self convertRect:rect toView:view]; - rect = [self convertRect:rect toView:from]; - rect = [to convertRect:rect fromWindow:from]; - rect = [view convertRect:rect fromView:to]; - return rect; -} - -- (CGRect)convertRect:(CGRect)rect fromViewOrWindow:(UIView *)view { - if (!view) { - if ([self isKindOfClass:[UIWindow class]]) { - return [((UIWindow *)self) convertRect:rect fromWindow:nil]; - } else { - return [self convertRect:rect fromView:nil]; - } - } - - UIWindow *from = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - UIWindow *to = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window; - if ((!from || !to) || (from == to)) return [self convertRect:rect fromView:view]; - rect = [from convertRect:rect fromView:view]; - rect = [to convertRect:rect fromWindow:from]; - rect = [self convertRect:rect fromView:to]; - return rect; -} - -- (CGFloat)left { - return self.frame.origin.x; -} - -- (void)setLeft:(CGFloat)x { - CGRect frame = self.frame; - frame.origin.x = x; - self.frame = frame; -} - -- (CGFloat)top { - return self.frame.origin.y; -} - -- (void)setTop:(CGFloat)y { - CGRect frame = self.frame; - frame.origin.y = y; - self.frame = frame; -} - -- (CGFloat)right { - return self.frame.origin.x + self.frame.size.width; -} - -- (void)setRight:(CGFloat)right { - CGRect frame = self.frame; - frame.origin.x = right - frame.size.width; - self.frame = frame; -} - -- (CGFloat)bottom { - return self.frame.origin.y + self.frame.size.height; -} - -- (void)setBottom:(CGFloat)bottom { - CGRect frame = self.frame; - frame.origin.y = bottom - frame.size.height; - self.frame = frame; -} - -- (CGFloat)width { - return self.frame.size.width; -} - -- (void)setWidth:(CGFloat)width { - CGRect frame = self.frame; - frame.size.width = width; - self.frame = frame; -} - -- (CGFloat)height { - return self.frame.size.height; -} - -- (void)setHeight:(CGFloat)height { - CGRect frame = self.frame; - frame.size.height = height; - self.frame = frame; -} - -- (CGFloat)centerX { - return self.center.x; -} - -- (void)setCenterX:(CGFloat)centerX { - self.center = CGPointMake(centerX, self.center.y); -} - -- (CGFloat)centerY { - return self.center.y; -} - -- (void)setCenterY:(CGFloat)centerY { - self.center = CGPointMake(self.center.x, centerY); -} - -- (CGPoint)origin { - return self.frame.origin; -} - -- (void)setOrigin:(CGPoint)origin { - CGRect frame = self.frame; - frame.origin = origin; - self.frame = frame; -} - -- (CGSize)size { - return self.frame.size; -} - -- (void)setSize:(CGSize)size { - CGRect frame = self.frame; - frame.size = size; - self.frame = frame; -} - -@end diff --git a/iOSProject/Pods/YYCategories/YYCategories/YYCategories.h b/iOSProject/Pods/YYCategories/YYCategories/YYCategories.h deleted file mode 100644 index 25370a79..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/YYCategories.h +++ /dev/null @@ -1,81 +0,0 @@ -// -// YYCategories.h -// YYCategories -// -// Created by ibireme on 13/3/29. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -FOUNDATION_EXPORT double YYCategoriesVersionNumber; -FOUNDATION_EXPORT const unsigned char YYCategoriesVersionString[]; -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#else -#import "YYCategoriesMacro.h" -#import "NSObject+YYAdd.h" -#import "NSObject+YYAddForKVO.h" -#import "NSObject+YYAddForARC.h" -#import "NSData+YYAdd.h" -#import "NSString+YYAdd.h" -#import "NSArray+YYAdd.h" -#import "NSDictionary+YYAdd.h" -#import "NSDate+YYAdd.h" -#import "NSNumber+YYAdd.h" -#import "NSNotificationCenter+YYAdd.h" -#import "NSKeyedUnarchiver+YYAdd.h" -#import "NSTimer+YYAdd.h" -#import "NSBundle+YYAdd.h" -#import "NSThread+YYAdd.h" -#import "UIColor+YYAdd.h" -#import "UIImage+YYAdd.h" -#import "UIControl+YYAdd.h" -#import "UIBarButtonItem+YYAdd.h" -#import "UIGestureRecognizer+YYAdd.h" -#import "UIView+YYAdd.h" -#import "UIScrollView+YYAdd.h" -#import "UITableView+YYAdd.h" -#import "UITextField+YYAdd.h" -#import "UIScreen+YYAdd.h" -#import "UIDevice+YYAdd.h" -#import "UIApplication+YYAdd.h" -#import "UIFont+YYAdd.h" -#import "UIBezierPath+YYAdd.h" -#import "CALayer+YYAdd.h" -#import "YYCGUtilities.h" -#endif - diff --git a/iOSProject/Pods/YYCategories/YYCategories/YYCategoriesMacro.h b/iOSProject/Pods/YYCategories/YYCategories/YYCategoriesMacro.h deleted file mode 100644 index 65d52a98..00000000 --- a/iOSProject/Pods/YYCategories/YYCategories/YYCategoriesMacro.h +++ /dev/null @@ -1,337 +0,0 @@ -// -// YYCategoriesMacro.h -// YYCategories -// -// Created by ibireme on 13/3/29. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import -#import - -#ifndef YYCategoriesMacro_h -#define YYCategoriesMacro_h - -#ifdef __cplusplus -#define YY_EXTERN_C_BEGIN extern "C" { -#define YY_EXTERN_C_END } -#else -#define YY_EXTERN_C_BEGIN -#define YY_EXTERN_C_END -#endif - - - -YY_EXTERN_C_BEGIN - -#ifndef YY_CLAMP // return the clamped value -#define YY_CLAMP(_x_, _low_, _high_) (((_x_) > (_high_)) ? (_high_) : (((_x_) < (_low_)) ? (_low_) : (_x_))) -#endif - -#ifndef YY_SWAP // swap two value -#define YY_SWAP(_a_, _b_) do { __typeof__(_a_) _tmp_ = (_a_); (_a_) = (_b_); (_b_) = _tmp_; } while (0) -#endif - - -#define YYAssertNil(condition, description, ...) NSAssert(!(condition), (description), ##__VA_ARGS__) -#define YYCAssertNil(condition, description, ...) NSCAssert(!(condition), (description), ##__VA_ARGS__) - -#define YYAssertNotNil(condition, description, ...) NSAssert((condition), (description), ##__VA_ARGS__) -#define YYCAssertNotNil(condition, description, ...) NSCAssert((condition), (description), ##__VA_ARGS__) - -#define YYAssertMainThread() NSAssert([NSThread isMainThread], @"This method must be called on the main thread") -#define YYCAssertMainThread() NSCAssert([NSThread isMainThread], @"This method must be called on the main thread") - - -/** - Add this macro before each category implementation, so we don't have to use - -all_load or -force_load to load object files from static libraries that only - contain categories and no classes. - More info: http://developer.apple.com/library/mac/#qa/qa2006/qa1490.html . - ******************************************************************************* - Example: - YYSYNTH_DUMMY_CLASS(NSString_YYAdd) - */ -#ifndef YYSYNTH_DUMMY_CLASS -#define YYSYNTH_DUMMY_CLASS(_name_) \ -@interface YYSYNTH_DUMMY_CLASS_ ## _name_ : NSObject @end \ -@implementation YYSYNTH_DUMMY_CLASS_ ## _name_ @end -#endif - - -/** - Synthsize a dynamic object property in @implementation scope. - It allows us to add custom properties to existing classes in categories. - - @param association ASSIGN / RETAIN / COPY / RETAIN_NONATOMIC / COPY_NONATOMIC - @warning #import - ******************************************************************************* - Example: - @interface NSObject (MyAdd) - @property (nonatomic, retain) UIColor *myColor; - @end - - #import - @implementation NSObject (MyAdd) - YYSYNTH_DYNAMIC_PROPERTY_OBJECT(myColor, setMyColor, RETAIN, UIColor *) - @end - */ -#ifndef YYSYNTH_DYNAMIC_PROPERTY_OBJECT -#define YYSYNTH_DYNAMIC_PROPERTY_OBJECT(_getter_, _setter_, _association_, _type_) \ -- (void)_setter_ : (_type_)object { \ - [self willChangeValueForKey:@#_getter_]; \ - objc_setAssociatedObject(self, _cmd, object, OBJC_ASSOCIATION_ ## _association_); \ - [self didChangeValueForKey:@#_getter_]; \ -} \ -- (_type_)_getter_ { \ - return objc_getAssociatedObject(self, @selector(_setter_:)); \ -} -#endif - - -/** - Synthsize a dynamic c type property in @implementation scope. - It allows us to add custom properties to existing classes in categories. - - @warning #import - ******************************************************************************* - Example: - @interface NSObject (MyAdd) - @property (nonatomic, retain) CGPoint myPoint; - @end - - #import - @implementation NSObject (MyAdd) - YYSYNTH_DYNAMIC_PROPERTY_CTYPE(myPoint, setMyPoint, CGPoint) - @end - */ -#ifndef YYSYNTH_DYNAMIC_PROPERTY_CTYPE -#define YYSYNTH_DYNAMIC_PROPERTY_CTYPE(_getter_, _setter_, _type_) \ -- (void)_setter_ : (_type_)object { \ - [self willChangeValueForKey:@#_getter_]; \ - NSValue *value = [NSValue value:&object withObjCType:@encode(_type_)]; \ - objc_setAssociatedObject(self, _cmd, value, OBJC_ASSOCIATION_RETAIN); \ - [self didChangeValueForKey:@#_getter_]; \ -} \ -- (type)_getter_ { \ - _type_ cValue = { 0 }; \ - NSValue *value = objc_getAssociatedObject(self, @selector(_setter_:)); \ - [value getValue:&cValue]; \ - return cValue; \ -} -#endif - -/** - Synthsize a weak or strong reference. - - Example: - @weakify(self) - [self doSomething^{ - @strongify(self) - if (!self) return; - ... - }]; - - */ -#ifndef weakify - #if DEBUG - #if __has_feature(objc_arc) - #define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object; - #else - #define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object; - #endif - #else - #if __has_feature(objc_arc) - #define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object; - #else - #define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object; - #endif - #endif -#endif - -#ifndef strongify - #if DEBUG - #if __has_feature(objc_arc) - #define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object; - #else - #define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object; - #endif - #else - #if __has_feature(objc_arc) - #define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object; - #else - #define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object; - #endif - #endif -#endif - - -/** - Convert CFRange to NSRange - @param range CFRange @return NSRange - */ -static inline NSRange YYNSRangeFromCFRange(CFRange range) { - return NSMakeRange(range.location, range.length); -} - -/** - Convert NSRange to CFRange - @param range NSRange @return CFRange - */ -static inline CFRange YYCFRangeFromNSRange(NSRange range) { - return CFRangeMake(range.location, range.length); -} - -/** - Same as CFAutorelease(), compatible for iOS6 - @param arg CFObject @return same as input - */ -static inline CFTypeRef YYCFAutorelease(CFTypeRef CF_RELEASES_ARGUMENT arg) { - if (((long)CFAutorelease + 1) != 1) { - return CFAutorelease(arg); - } else { - id __autoreleasing obj = CFBridgingRelease(arg); - return (__bridge CFTypeRef)obj; - } -} - -/** - Profile time cost. - @param ^block code to benchmark - @param ^complete code time cost (millisecond) - - Usage: - YYBenchmark(^{ - // code - }, ^(double ms) { - NSLog("time cost: %.2f ms",ms); - }); - - */ -static inline void YYBenchmark(void (^block)(void), void (^complete)(double ms)) { - // version - /* - extern double CACurrentMediaTime (void); - double begin, end, ms; - begin = CACurrentMediaTime(); - block(); - end = CACurrentMediaTime(); - ms = (end - begin) * 1000.0; - complete(ms); - */ - - // version - struct timeval t0, t1; - gettimeofday(&t0, NULL); - block(); - gettimeofday(&t1, NULL); - double ms = (double)(t1.tv_sec - t0.tv_sec) * 1e3 + (double)(t1.tv_usec - t0.tv_usec) * 1e-3; - complete(ms); -} - -static inline NSDate *_YYCompileTime(const char *data, const char *time) { - NSString *timeStr = [NSString stringWithFormat:@"%s %s",data,time]; - NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setDateFormat:@"MMM dd yyyy HH:mm:ss"]; - [formatter setLocale:locale]; - return [formatter dateFromString:timeStr]; -} - -/** - Get compile timestamp. - @return A new date object set to the compile date and time. - */ -#ifndef YYCompileTime -// use macro to avoid compile warning when use pch file -#define YYCompileTime() _YYCompileTime(__DATE__, __TIME__) -#endif - -/** - Returns a dispatch_time delay from now. - */ -static inline dispatch_time_t dispatch_time_delay(NSTimeInterval second) { - return dispatch_time(DISPATCH_TIME_NOW, (int64_t)(second * NSEC_PER_SEC)); -} - -/** - Returns a dispatch_wall_time delay from now. - */ -static inline dispatch_time_t dispatch_walltime_delay(NSTimeInterval second) { - return dispatch_walltime(DISPATCH_TIME_NOW, (int64_t)(second * NSEC_PER_SEC)); -} - -/** - Returns a dispatch_wall_time from NSDate. - */ -static inline dispatch_time_t dispatch_walltime_date(NSDate *date) { - NSTimeInterval interval; - double second, subsecond; - struct timespec time; - dispatch_time_t milestone; - - interval = [date timeIntervalSince1970]; - subsecond = modf(interval, &second); - time.tv_sec = second; - time.tv_nsec = subsecond * NSEC_PER_SEC; - milestone = dispatch_walltime(&time, 0); - return milestone; -} - -/** - Whether in main queue/thread. - */ -static inline bool dispatch_is_main_queue() { - return pthread_main_np() != 0; -} - -/** - Submits a block for asynchronous execution on a main queue and returns immediately. - */ -static inline void dispatch_async_on_main_queue(void (^block)()) { - if (pthread_main_np()) { - block(); - } else { - dispatch_async(dispatch_get_main_queue(), block); - } -} - -/** - Submits a block for execution on a main queue and waits until the block completes. - */ -static inline void dispatch_sync_on_main_queue(void (^block)()) { - if (pthread_main_np()) { - block(); - } else { - dispatch_sync(dispatch_get_main_queue(), block); - } -} - -/** - Initialize a pthread mutex. - */ -static inline void pthread_mutex_init_recursive(pthread_mutex_t *mutex, bool recursive) { -#define YYMUTEX_ASSERT_ON_ERROR(x_) do { \ -__unused volatile int res = (x_); \ -assert(res == 0); \ -} while (0) - assert(mutex != NULL); - if (!recursive) { - YYMUTEX_ASSERT_ON_ERROR(pthread_mutex_init(mutex, NULL)); - } else { - pthread_mutexattr_t attr; - YYMUTEX_ASSERT_ON_ERROR(pthread_mutexattr_init (&attr)); - YYMUTEX_ASSERT_ON_ERROR(pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE)); - YYMUTEX_ASSERT_ON_ERROR(pthread_mutex_init (mutex, &attr)); - YYMUTEX_ASSERT_ON_ERROR(pthread_mutexattr_destroy (&attr)); - } -#undef YYMUTEX_ASSERT_ON_ERROR -} - - -YY_EXTERN_C_END -#endif diff --git a/iOSProject/Pods/YYImage/LICENSE b/iOSProject/Pods/YYImage/LICENSE deleted file mode 100644 index 46be20bd..00000000 --- a/iOSProject/Pods/YYImage/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 ibireme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/iOSProject/Pods/YYImage/README.md b/iOSProject/Pods/YYImage/README.md deleted file mode 100755 index 7051d7f8..00000000 --- a/iOSProject/Pods/YYImage/README.md +++ /dev/null @@ -1,384 +0,0 @@ -YYImage -============== -[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/ibireme/YYImage/master/LICENSE)  -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)  -[![CocoaPods](http://img.shields.io/cocoapods/v/YYImage.svg?style=flat)](http://cocoapods.org/?q= YYImage)  -[![CocoaPods](http://img.shields.io/cocoapods/p/YYImage.svg?style=flat)](http://cocoapods.org/?q= YYImage)  -[![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  -[![Build Status](https://travis-ci.org/ibireme/YYImage.svg?branch=master)](https://travis-ci.org/ibireme/YYImage) - -Image framework for iOS to display/encode/decode animated WebP, APNG, GIF, and more.
    -(It's a component of [YYKit](https://github.com/ibireme/YYKit)) - -![niconiconi~](https://raw.github.com/ibireme/YYImage/master/Demo/YYImageDemo/niconiconi@2x.gif -) - -Features -============== -- Display/encode/decode animated image with these types:
        WebP, APNG, GIF. -- Display/encode/decode still image with these types:
        WebP, PNG, GIF, JPEG, JP2, TIFF, BMP, ICO, ICNS. -- Baseline/progressive/interlaced image decode with these types:
        PNG, GIF, JPEG, BMP. -- Display frame based image animation and sprite sheet animation. -- Dynamic memory buffer for lower memory usage. -- Fully compatible with UIImage and UIImageView class. -- Extendable protocol for custom image animation. -- Fully documented. - -Usage -============== - -###Display animated image - - // File: ani@3x.gif - UIImage *image = [YYImage imageNamed:@"ani.gif"]; - UIImageView *imageView = [[YYAnimatedImageView alloc] initWithImage:image]; - [self.view addSubView:imageView]; - - -###Display frame animation - - // Files: frame1.png, frame2.png, frame3.png - NSArray *paths = @[@"/ani/frame1.png", @"/ani/frame2.png", @"/ani/frame3.png"]; - NSArray *times = @[@0.1, @0.2, @0.1]; - UIImage *image = [YYFrameImage alloc] initWithImagePaths:paths frameDurations:times repeats:YES]; - UIImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image]; - [self.view addSubView:imageView]; - -###Display sprite sheet animation - - // 8 * 12 sprites in a single sheet image - UIImage *spriteSheet = [UIImage imageNamed:@"sprite-sheet"]; - NSMutableArray *contentRects = [NSMutableArray new]; - NSMutableArray *durations = [NSMutableArray new]; - for (int j = 0; j < 12; j++) { - for (int i = 0; i < 8; i++) { - CGRect rect; - rect.size = CGSizeMake(img.size.width / 8, img.size.height / 12); - rect.origin.x = img.size.width / 8 * i; - rect.origin.y = img.size.height / 12 * j; - [contentRects addObject:[NSValue valueWithCGRect:rect]]; - [durations addObject:@(1 / 60.0)]; - } - } - YYSpriteSheetImage *sprite; - sprite = [[YYSpriteSheetImage alloc] initWithSpriteSheetImage:img - contentRects:contentRects - frameDurations:durations - loopCount:0]; - YYAnimatedImageView *imageView = [YYAnimatedImageView new]; - imageView.size = CGSizeMake(img.size.width / 8, img.size.height / 12); - imageView.image = sprite; - [self.view addSubView:imageView]; - -###Animation control - - YYAnimatedImageView *imageView = ...; - // pause: - [imageView stopAnimating]; - // play: - [imageView startAnimating]; - // set frame index: - imageView.currentAnimatedImageIndex = 12; - // get current status - image.currentIsPlayingAnimation; - -###Image decoder - - // Decode single frame: - NSData *data = [NSData dataWithContentsOfFile:@"/tmp/image.webp"]; - YYImageDecoder *decoder = [YYImageDecoder decoderWithData:data scale:2.0]; - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - - // Progressive: - NSMutableData *data = [NSMutableData new]; - YYImageDecoder *decoder = [[YYImageDecoder alloc] initWithScale:2.0]; - while(newDataArrived) { - [data appendData:newData]; - [decoder updateData:data final:NO]; - if (decoder.frameCount > 0) { - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - // progressive display... - } - } - [decoder updateData:data final:YES]; - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - // final display... - -###Image encoder - - // Encode still image: - YYImageEncoder *jpegEncoder = [[YYImageEncoder alloc] initWithType:YYImageTypeJPEG]; - jpegEncoder.quality = 0.9; - [jpegEncoder addImage:image duration:0]; - NSData jpegData = [jpegEncoder encode]; - - // Encode animated image: - YYImageEncoder *webpEncoder = [[YYImageEncoder alloc] initWithType:YYImageTypeWebP]; - webpEncoder.loopCount = 5; - [webpEncoder addImage:image0 duration:0.1]; - [webpEncoder addImage:image1 duration:0.15]; - [webpEncoder addImage:image2 duration:0.2]; - NSData webpData = [webpEncoder encode]; - -###Image type detection - - // Get image type from image data - YYImageType type = YYImageDetectType(data); - if (type == YYImageTypePNG) ... - - -Installation -============== - -### CocoaPods - -1. Update cocoapods to the latest version. -2. Add `pod 'YYImage'` to your Podfile. -3. Run `pod install` or `pod update`. -4. Import \. -5. Notice: it doesn't include WebP subspec by default, if you want to support WebP format, you may add `pod 'YYImage/WebP'` to your Podfile. - -### Carthage - -1. Add `github "ibireme/YYImage"` to your Cartfile. -2. Run `carthage update --platform ios` and add the framework to your project. -3. Import \. -4. Notice: carthage framework doesn't include WebP component, if you want to support WebP format, use CocoaPods or install manually. - -### Manually - -1. Download all the files in the YYImage subdirectory. -2. Add the source files to your Xcode project. -3. Link with required frameworks: - * UIKit - * CoreFoundation - * QuartzCore - * AssetsLibrary - * ImageIO - * Accelerate - * MobileCoreServices - * libz -4. Import `YYImage.h`. -5. Notice: if you want to support WebP format, you may add `Vendor/WebP.framework`(static library) to your Xcode project. - -FAQ -============== -_Q: Why I can't display WebP image?_ - -A: Make sure you added the `WebP.framework` in your project. You may call `YYImageWebPAvailable()` to check whether the WebP subspec is installed correctly. - -_Q: Why I can't play APNG animation?_ - -A: You should disable the `Compress PNG Files` and `Remove Text Metadata From PNG Files` in your project's build settings. Or you can rename your APNG file's extension name with `apng`. - -Documentation -============== -Full API documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/YYImage/).
    -You can also install documentation locally using [appledoc](https://github.com/tomaz/appledoc). - - - -Requirements -============== -This library requires `iOS 6.0+` and `Xcode 7.0+`. - - -License -============== -YYImage is provided under the MIT license. See LICENSE file for details. - - -

    ---- -中文介绍 -============== -YYImage: 功能强大的 iOS 图像框架。
    -(该项目是 [YYKit](https://github.com/ibireme/YYKit) 组件之一) - -![niconiconi~](https://raw.github.com/ibireme/YYImage/master/Demo/YYImageDemo/niconiconi@2x.gif -) - -特性 -============== -- 支持以下类型动画图像的播放/编码/解码:
    -     WebP, APNG, GIF。 -- 支持以下类型静态图像的显示/编码/解码:
    -     WebP, PNG, GIF, JPEG, JP2, TIFF, BMP, ICO, ICNS。 -- 支持以下类型图片的渐进式/逐行扫描/隔行扫描解码:
    -     PNG, GIF, JPEG, BMP。 -- 支持多张图片构成的帧动画播放,支持单张图片的 sprite sheet 动画。 -- 高效的动态内存缓存管理,以保证高性能低内存的动画播放。 -- 完全兼容 UIImage 和 UIImageView,使用方便。 -- 保留可扩展的接口,以支持自定义动画。 -- 每个类和方法都有完善的文档注释。 - - -用法 -============== - -###显示动画类型的图片 - - // 文件: ani@3x.gif - UIImage *image = [YYImage imageNamed:@"ani.gif"]; - UIImageView *imageView = [[YYAnimatedImageView alloc] initWithImage:image]; - [self.view addSubView:imageView]; - - -###播放帧动画 - - // 文件: frame1.png, frame2.png, frame3.png - NSArray *paths = @[@"/ani/frame1.png", @"/ani/frame2.png", @"/ani/frame3.png"]; - NSArray *times = @[@0.1, @0.2, @0.1]; - UIImage *image = [YYFrameImage alloc] initWithImagePaths:paths frameDurations:times repeats:YES]; - UIImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image]; - [self.view addSubView:imageView]; - -###播放 sprite sheet 动画 - - // 8 * 12 sprites in a single sheet image - UIImage *spriteSheet = [UIImage imageNamed:@"sprite-sheet"]; - NSMutableArray *contentRects = [NSMutableArray new]; - NSMutableArray *durations = [NSMutableArray new]; - for (int j = 0; j < 12; j++) { - for (int i = 0; i < 8; i++) { - CGRect rect; - rect.size = CGSizeMake(img.size.width / 8, img.size.height / 12); - rect.origin.x = img.size.width / 8 * i; - rect.origin.y = img.size.height / 12 * j; - [contentRects addObject:[NSValue valueWithCGRect:rect]]; - [durations addObject:@(1 / 60.0)]; - } - } - YYSpriteSheetImage *sprite; - sprite = [[YYSpriteSheetImage alloc] initWithSpriteSheetImage:img - contentRects:contentRects - frameDurations:durations - loopCount:0]; - YYAnimatedImageView *imageView = [YYAnimatedImageView new]; - imageView.size = CGSizeMake(img.size.width / 8, img.size.height / 12); - imageView.image = sprite; - [self.view addSubView:imageView]; - -###动画播放控制 - - YYAnimatedImageView *imageView = ...; - // 暂停: - [imageView stopAnimating]; - // 播放: - [imageView startAnimating]; - // 设置播放进度: - imageView.currentAnimatedImageIndex = 12; - // 获取播放状态: - image.currentIsPlayingAnimation; - //上面两个属性都支持 KVO。 - -###图片解码 - - // 解码单帧图片: - NSData *data = [NSData dataWithContentsOfFile:@"/tmp/image.webp"]; - YYImageDecoder *decoder = [YYImageDecoder decoderWithData:data scale:2.0]; - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - - // 渐进式图片解码 (可用于图片下载显示): - NSMutableData *data = [NSMutableData new]; - YYImageDecoder *decoder = [[YYImageDecoder alloc] initWithScale:2.0]; - while(newDataArrived) { - [data appendData:newData]; - [decoder updateData:data final:NO]; - if (decoder.frameCount > 0) { - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - // progressive display... - } - } - [decoder updateData:data final:YES]; - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - // final display... - -###图片编码 - - // 编码静态图 (支持各种常见图片格式): - YYImageEncoder *jpegEncoder = [[YYImageEncoder alloc] initWithType:YYImageTypeJPEG]; - jpegEncoder.quality = 0.9; - [jpegEncoder addImage:image duration:0]; - NSData jpegData = [jpegEncoder encode]; - - // 编码动态图 (支持 GIF/APNG/WebP): - YYImageEncoder *webpEncoder = [[YYImageEncoder alloc] initWithType:YYImageTypeWebP]; - webpEncoder.loopCount = 5; - [webpEncoder addImage:image0 duration:0.1]; - [webpEncoder addImage:image1 duration:0.15]; - [webpEncoder addImage:image2 duration:0.2]; - NSData webpData = [webpEncoder encode]; - -###图片类型探测 - - // 获取图片类型 - YYImageType type = YYImageDetectType(data); - if (type == YYImageTypePNG) ... - - -安装 -============== - -### CocoaPods - -1. 将 cocoapods 更新至最新版本. -2. 在 Podfile 中添加 `pod 'YYImage'`。 -3. 执行 `pod install` 或 `pod update`。 -4. 导入 \。 -5. 注意:pod 配置并没有包含 WebP 组件, 如果你需要支持 WebP,可以在 Podfile 中添加 `pod 'YYImage/WebP'`。 - -### Carthage - -1. 在 Cartfile 中添加 `github "ibireme/YYImage"`。 -2. 执行 `carthage update --platform ios` 并将生成的 framework 添加到你的工程。 -3. 导入 \。 -4. 注意:carthage framework 并没有包含 WebP 组件。如果你需要支持 WebP,可以用 CocoaPods 安装,或者手动安装。 - -### 手动安装 - -1. 下载 YYImage 文件夹内的所有内容。 -2. 将 YYImage 内的源文件添加(拖放)到你的工程。 -3. 链接以下 frameworks: - * UIKit - * CoreFoundation - * QuartzCore - * AssetsLibrary - * ImageIO - * Accelerate - * MobileCoreServices - * libz -4. 导入 `YYImage.h`。 -5. 注意:如果你需要支持 WebP,可以将 `Vendor/WebP.framework`(静态库) 加入你的工程。 - -常见问题 -============== -_Q: 为什么我不能显示 WebP 图片?_ - -A: 确保 `WebP.framework` 已经被添加到你的工程内了。你可以调用 `YYImageWebPAvailable()` 来检查一下 WebP 组件是否被正确安装。 - -_Q: 为什么我不能播放 APNG 动画?_ - -A: 你应该禁用 Build Settings 中的 `Compress PNG Files` 和 `Remove Text Metadata From PNG Files`. 或者你也可以把 APNG 文件的扩展名改为`apng`. - -文档 -============== -你可以在 [CocoaDocs](http://cocoadocs.org/docsets/YYImage/) 查看在线 API 文档,也可以用 [appledoc](https://github.com/tomaz/appledoc) 本地生成文档。 - - -系统要求 -============== -该项目最低支持 `iOS 6.0` 和 `Xcode 7.0`。 - - -许可证 -============== -YYImage 使用 MIT 许可证,详情见 LICENSE 文件。 - - -相关链接 -============== -[移动端图片格式调研](http://blog.ibireme.com/2015/11/02/mobile_image_benchmark/)
    - -[iOS 处理图片的一些小 Tip](http://blog.ibireme.com/2015/11/02/ios_image_tips/) - diff --git a/iOSProject/Pods/YYImage/YYImage/YYAnimatedImageView.h b/iOSProject/Pods/YYImage/YYImage/YYAnimatedImageView.h deleted file mode 100644 index e70a6543..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYAnimatedImageView.h +++ /dev/null @@ -1,125 +0,0 @@ -// -// YYAnimatedImageView.h -// YYImage -// -// Created by ibireme on 14/10/19. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - An image view for displaying animated image. - - @discussion It is a fully compatible `UIImageView` subclass. - If the `image` or `highlightedImage` property adopt to the `YYAnimatedImage` protocol, - then it can be used to play the multi-frame animation. The animation can also be - controlled with the UIImageView methods `-startAnimating`, `-stopAnimating` and `-isAnimating`. - - This view request the frame data just in time. When the device has enough free memory, - this view may cache some or all future frames in an inner buffer for lower CPU cost. - Buffer size is dynamically adjusted based on the current state of the device memory. - - Sample Code: - - // ani@3x.gif - YYImage *image = [YYImage imageNamed:@"ani"]; - YYAnimatedImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image]; - [view addSubView:imageView]; - */ -@interface YYAnimatedImageView : UIImageView - -/** - If the image has more than one frame, set this value to `YES` will automatically - play/stop the animation when the view become visible/invisible. - - The default value is `YES`. - */ -@property (nonatomic) BOOL autoPlayAnimatedImage; - -/** - Index of the currently displayed frame (index from 0). - - Set a new value to this property will cause to display the new frame immediately. - If the new value is invalid, this method has no effect. - - You can add an observer to this property to observe the playing status. - */ -@property (nonatomic) NSUInteger currentAnimatedImageIndex; - -/** - Whether the image view is playing animation currently. - - You can add an observer to this property to observe the playing status. - */ -@property (nonatomic, readonly) BOOL currentIsPlayingAnimation; - -/** - The animation timer's runloop mode, default is `NSRunLoopCommonModes`. - - Set this property to `NSDefaultRunLoopMode` will make the animation pause during - UIScrollView scrolling. - */ -@property (nonatomic, copy) NSString *runloopMode; - -/** - The max size (in bytes) for inner frame buffer size, default is 0 (dynamically). - - When the device has enough free memory, this view will request and decode some or - all future frame image into an inner buffer. If this property's value is 0, then - the max buffer size will be dynamically adjusted based on the current state of - the device free memory. Otherwise, the buffer size will be limited by this value. - - When receive memory warning or app enter background, the buffer will be released - immediately, and may grow back at the right time. - */ -@property (nonatomic) NSUInteger maxBufferSize; - -@end - - - -/** - The YYAnimatedImage protocol declares the required methods for animated image - display with YYAnimatedImageView. - - Subclass a UIImage and implement this protocol, so that instances of that class - can be set to YYAnimatedImageView.image or YYAnimatedImageView.highlightedImage - to display animation. - - See `YYImage` and `YYFrameImage` for example. - */ -@protocol YYAnimatedImage -@required -/// Total animated frame count. -/// It the frame count is less than 1, then the methods below will be ignored. -- (NSUInteger)animatedImageFrameCount; - -/// Animation loop count, 0 means infinite looping. -- (NSUInteger)animatedImageLoopCount; - -/// Bytes per frame (in memory). It may used to optimize memory buffer size. -- (NSUInteger)animatedImageBytesPerFrame; - -/// Returns the frame image from a specified index. -/// This method may be called on background thread. -/// @param index Frame index (zero based). -- (nullable UIImage *)animatedImageFrameAtIndex:(NSUInteger)index; - -/// Returns the frames's duration from a specified index. -/// @param index Frame index (zero based). -- (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index; - -@optional -/// A rectangle in image coordinates defining the subrectangle of the image that -/// will be displayed. The rectangle should not outside the image's bounds. -/// It may used to display sprite animation with a single image (sprite sheet). -- (CGRect)animatedImageContentsRectAtIndex:(NSUInteger)index; -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYImage/YYImage/YYAnimatedImageView.m b/iOSProject/Pods/YYImage/YYImage/YYAnimatedImageView.m deleted file mode 100644 index 5f2bcb42..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYAnimatedImageView.m +++ /dev/null @@ -1,672 +0,0 @@ -// -// YYAnimatedImageView.m -// YYImage -// -// Created by ibireme on 14/10/19. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYAnimatedImageView.h" -#import "YYImageCoder.h" -#import -#import - - -#define BUFFER_SIZE (10 * 1024 * 1024) // 10MB (minimum memory buffer size) - -#define LOCK(...) dispatch_semaphore_wait(self->_lock, DISPATCH_TIME_FOREVER); \ -__VA_ARGS__; \ -dispatch_semaphore_signal(self->_lock); - -#define LOCK_VIEW(...) dispatch_semaphore_wait(view->_lock, DISPATCH_TIME_FOREVER); \ -__VA_ARGS__; \ -dispatch_semaphore_signal(view->_lock); - - -static int64_t _YYDeviceMemoryTotal() { - int64_t mem = [[NSProcessInfo processInfo] physicalMemory]; - if (mem < -1) mem = -1; - return mem; -} - -static int64_t _YYDeviceMemoryFree() { - mach_port_t host_port = mach_host_self(); - mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); - vm_size_t page_size; - vm_statistics_data_t vm_stat; - kern_return_t kern; - - kern = host_page_size(host_port, &page_size); - if (kern != KERN_SUCCESS) return -1; - kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); - if (kern != KERN_SUCCESS) return -1; - return vm_stat.free_count * page_size; -} - -/** - A proxy used to hold a weak object. - It can be used to avoid retain cycles, such as the target in NSTimer or CADisplayLink. - */ -@interface _YYImageWeakProxy : NSProxy -@property (nonatomic, weak, readonly) id target; -- (instancetype)initWithTarget:(id)target; -+ (instancetype)proxyWithTarget:(id)target; -@end - -@implementation _YYImageWeakProxy -- (instancetype)initWithTarget:(id)target { - _target = target; - return self; -} -+ (instancetype)proxyWithTarget:(id)target { - return [[_YYImageWeakProxy alloc] initWithTarget:target]; -} -- (id)forwardingTargetForSelector:(SEL)selector { - return _target; -} -- (void)forwardInvocation:(NSInvocation *)invocation { - void *null = NULL; - [invocation setReturnValue:&null]; -} -- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { - return [NSObject instanceMethodSignatureForSelector:@selector(init)]; -} -- (BOOL)respondsToSelector:(SEL)aSelector { - return [_target respondsToSelector:aSelector]; -} -- (BOOL)isEqual:(id)object { - return [_target isEqual:object]; -} -- (NSUInteger)hash { - return [_target hash]; -} -- (Class)superclass { - return [_target superclass]; -} -- (Class)class { - return [_target class]; -} -- (BOOL)isKindOfClass:(Class)aClass { - return [_target isKindOfClass:aClass]; -} -- (BOOL)isMemberOfClass:(Class)aClass { - return [_target isMemberOfClass:aClass]; -} -- (BOOL)conformsToProtocol:(Protocol *)aProtocol { - return [_target conformsToProtocol:aProtocol]; -} -- (BOOL)isProxy { - return YES; -} -- (NSString *)description { - return [_target description]; -} -- (NSString *)debugDescription { - return [_target debugDescription]; -} -@end - - - - -typedef NS_ENUM(NSUInteger, YYAnimatedImageType) { - YYAnimatedImageTypeNone = 0, - YYAnimatedImageTypeImage, - YYAnimatedImageTypeHighlightedImage, - YYAnimatedImageTypeImages, - YYAnimatedImageTypeHighlightedImages, -}; - -@interface YYAnimatedImageView() { - @package - UIImage *_curAnimatedImage; - - dispatch_once_t _onceToken; - dispatch_semaphore_t _lock; ///< lock for _buffer - NSOperationQueue *_requestQueue; ///< image request queue, serial - - CADisplayLink *_link; ///< ticker for change frame - NSTimeInterval _time; ///< time after last frame - - UIImage *_curFrame; ///< current frame to display - NSUInteger _curIndex; ///< current frame index (from 0) - NSUInteger _totalFrameCount; ///< total frame count - - BOOL _loopEnd; ///< whether the loop is end. - NSUInteger _curLoop; ///< current loop count (from 0) - NSUInteger _totalLoop; ///< total loop count, 0 means infinity - - NSMutableDictionary *_buffer; ///< frame buffer - BOOL _bufferMiss; ///< whether miss frame on last opportunity - NSUInteger _maxBufferCount; ///< maximum buffer count - NSInteger _incrBufferCount; ///< current allowed buffer count (will increase by step) - - CGRect _curContentsRect; - BOOL _curImageHasContentsRect; ///< image has implementated "animatedImageContentsRectAtIndex:" -} -@property (nonatomic, readwrite) BOOL currentIsPlayingAnimation; -- (void)calcMaxBufferCount; -@end - -/// An operation for image fetch -@interface _YYAnimatedImageViewFetchOperation : NSOperation -@property (nonatomic, weak) YYAnimatedImageView *view; -@property (nonatomic, assign) NSUInteger nextIndex; -@property (nonatomic, strong) UIImage *curImage; -@end - -@implementation _YYAnimatedImageViewFetchOperation -- (void)main { - __strong YYAnimatedImageView *view = _view; - if (!view) return; - if ([self isCancelled]) return; - view->_incrBufferCount++; - if (view->_incrBufferCount == 0) [view calcMaxBufferCount]; - if (view->_incrBufferCount > (NSInteger)view->_maxBufferCount) { - view->_incrBufferCount = view->_maxBufferCount; - } - NSUInteger idx = _nextIndex; - NSUInteger max = view->_incrBufferCount < 1 ? 1 : view->_incrBufferCount; - NSUInteger total = view->_totalFrameCount; - view = nil; - - for (int i = 0; i < max; i++, idx++) { - @autoreleasepool { - if (idx >= total) idx = 0; - if ([self isCancelled]) break; - __strong YYAnimatedImageView *view = _view; - if (!view) break; - LOCK_VIEW(BOOL miss = (view->_buffer[@(idx)] == nil)); - - if (miss) { - UIImage *img = [_curImage animatedImageFrameAtIndex:idx]; - img = img.yy_imageByDecoded; - if ([self isCancelled]) break; - LOCK_VIEW(view->_buffer[@(idx)] = img ? img : [NSNull null]); - view = nil; - } - } - } -} -@end - -@implementation YYAnimatedImageView - -- (instancetype)init { - self = [super init]; - _runloopMode = NSRunLoopCommonModes; - _autoPlayAnimatedImage = YES; - return self; -} - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - _runloopMode = NSRunLoopCommonModes; - _autoPlayAnimatedImage = YES; - return self; -} - -- (instancetype)initWithImage:(UIImage *)image { - self = [super init]; - _runloopMode = NSRunLoopCommonModes; - _autoPlayAnimatedImage = YES; - self.frame = (CGRect) {CGPointZero, image.size }; - self.image = image; - return self; -} - -- (instancetype)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage { - self = [super init]; - _runloopMode = NSRunLoopCommonModes; - _autoPlayAnimatedImage = YES; - CGSize size = image ? image.size : highlightedImage.size; - self.frame = (CGRect) {CGPointZero, size }; - self.image = image; - self.highlightedImage = highlightedImage; - return self; -} - -// init the animated params. -- (void)resetAnimated { - dispatch_once(&_onceToken, ^{ - _lock = dispatch_semaphore_create(1); - _buffer = [NSMutableDictionary new]; - _requestQueue = [[NSOperationQueue alloc] init]; - _requestQueue.maxConcurrentOperationCount = 1; - _link = [CADisplayLink displayLinkWithTarget:[_YYImageWeakProxy proxyWithTarget:self] selector:@selector(step:)]; - if (_runloopMode) { - [_link addToRunLoop:[NSRunLoop mainRunLoop] forMode:_runloopMode]; - } - _link.paused = YES; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; - }); - - [_requestQueue cancelAllOperations]; - LOCK( - if (_buffer.count) { - NSMutableDictionary *holder = _buffer; - _buffer = [NSMutableDictionary new]; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ - // Capture the dictionary to global queue, - // release these images in background to avoid blocking UI thread. - [holder class]; - }); - } - ); - _link.paused = YES; - _time = 0; - if (_curIndex != 0) { - [self willChangeValueForKey:@"currentAnimatedImageIndex"]; - _curIndex = 0; - [self didChangeValueForKey:@"currentAnimatedImageIndex"]; - } - _curAnimatedImage = nil; - _curFrame = nil; - _curLoop = 0; - _totalLoop = 0; - _totalFrameCount = 1; - _loopEnd = NO; - _bufferMiss = NO; - _incrBufferCount = 0; -} - -- (void)setImage:(UIImage *)image { - if (self.image == image) return; - [self setImage:image withType:YYAnimatedImageTypeImage]; -} - -- (void)setHighlightedImage:(UIImage *)highlightedImage { - if (self.highlightedImage == highlightedImage) return; - [self setImage:highlightedImage withType:YYAnimatedImageTypeHighlightedImage]; -} - -- (void)setAnimationImages:(NSArray *)animationImages { - if (self.animationImages == animationImages) return; - [self setImage:animationImages withType:YYAnimatedImageTypeImages]; -} - -- (void)setHighlightedAnimationImages:(NSArray *)highlightedAnimationImages { - if (self.highlightedAnimationImages == highlightedAnimationImages) return; - [self setImage:highlightedAnimationImages withType:YYAnimatedImageTypeHighlightedImages]; -} - -- (void)setHighlighted:(BOOL)highlighted { - [super setHighlighted:highlighted]; - if (_link) [self resetAnimated]; - [self imageChanged]; -} - -- (id)imageForType:(YYAnimatedImageType)type { - switch (type) { - case YYAnimatedImageTypeNone: return nil; - case YYAnimatedImageTypeImage: return self.image; - case YYAnimatedImageTypeHighlightedImage: return self.highlightedImage; - case YYAnimatedImageTypeImages: return self.animationImages; - case YYAnimatedImageTypeHighlightedImages: return self.highlightedAnimationImages; - } - return nil; -} - -- (YYAnimatedImageType)currentImageType { - YYAnimatedImageType curType = YYAnimatedImageTypeNone; - if (self.highlighted) { - if (self.highlightedAnimationImages.count) curType = YYAnimatedImageTypeHighlightedImages; - else if (self.highlightedImage) curType = YYAnimatedImageTypeHighlightedImage; - } - if (curType == YYAnimatedImageTypeNone) { - if (self.animationImages.count) curType = YYAnimatedImageTypeImages; - else if (self.image) curType = YYAnimatedImageTypeImage; - } - return curType; -} - -- (void)setImage:(id)image withType:(YYAnimatedImageType)type { - [self stopAnimating]; - if (_link) [self resetAnimated]; - _curFrame = nil; - switch (type) { - case YYAnimatedImageTypeNone: break; - case YYAnimatedImageTypeImage: super.image = image; break; - case YYAnimatedImageTypeHighlightedImage: super.highlightedImage = image; break; - case YYAnimatedImageTypeImages: super.animationImages = image; break; - case YYAnimatedImageTypeHighlightedImages: super.highlightedAnimationImages = image; break; - } - [self imageChanged]; -} - -- (void)imageChanged { - YYAnimatedImageType newType = [self currentImageType]; - id newVisibleImage = [self imageForType:newType]; - NSUInteger newImageFrameCount = 0; - BOOL hasContentsRect = NO; - if ([newVisibleImage isKindOfClass:[UIImage class]] && - [newVisibleImage conformsToProtocol:@protocol(YYAnimatedImage)]) { - newImageFrameCount = ((UIImage *) newVisibleImage).animatedImageFrameCount; - if (newImageFrameCount > 1) { - hasContentsRect = [((UIImage *) newVisibleImage) respondsToSelector:@selector(animatedImageContentsRectAtIndex:)]; - } - } - if (!hasContentsRect && _curImageHasContentsRect) { - if (!CGRectEqualToRect(self.layer.contentsRect, CGRectMake(0, 0, 1, 1)) ) { - [CATransaction begin]; - [CATransaction setDisableActions:YES]; - self.layer.contentsRect = CGRectMake(0, 0, 1, 1); - [CATransaction commit]; - } - } - _curImageHasContentsRect = hasContentsRect; - if (hasContentsRect) { - CGRect rect = [((UIImage *) newVisibleImage) animatedImageContentsRectAtIndex:0]; - [self setContentsRect:rect forImage:newVisibleImage]; - } - - if (newImageFrameCount > 1) { - [self resetAnimated]; - _curAnimatedImage = newVisibleImage; - _curFrame = newVisibleImage; - _totalLoop = _curAnimatedImage.animatedImageLoopCount; - _totalFrameCount = _curAnimatedImage.animatedImageFrameCount; - [self calcMaxBufferCount]; - } - [self setNeedsDisplay]; - [self didMoved]; -} - -// dynamically adjust buffer size for current memory. -- (void)calcMaxBufferCount { - int64_t bytes = (int64_t)_curAnimatedImage.animatedImageBytesPerFrame; - if (bytes == 0) bytes = 1024; - - int64_t total = _YYDeviceMemoryTotal(); - int64_t free = _YYDeviceMemoryFree(); - int64_t max = MIN(total * 0.2, free * 0.6); - max = MAX(max, BUFFER_SIZE); - if (_maxBufferSize) max = max > _maxBufferSize ? _maxBufferSize : max; - double maxBufferCount = (double)max / (double)bytes; - if (maxBufferCount < 1) maxBufferCount = 1; - else if (maxBufferCount > 512) maxBufferCount = 512; - _maxBufferCount = maxBufferCount; -} - -- (void)dealloc { - [_requestQueue cancelAllOperations]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; - [_link invalidate]; -} - -- (BOOL)isAnimating { - return self.currentIsPlayingAnimation; -} - -- (void)stopAnimating { - [super stopAnimating]; - [_requestQueue cancelAllOperations]; - _link.paused = YES; - self.currentIsPlayingAnimation = NO; -} - -- (void)startAnimating { - YYAnimatedImageType type = [self currentImageType]; - if (type == YYAnimatedImageTypeImages || type == YYAnimatedImageTypeHighlightedImages) { - NSArray *images = [self imageForType:type]; - if (images.count > 0) { - [super startAnimating]; - self.currentIsPlayingAnimation = YES; - } - } else { - if (_curAnimatedImage && _link.paused) { - _curLoop = 0; - _loopEnd = NO; - _link.paused = NO; - self.currentIsPlayingAnimation = YES; - } - } -} - -- (void)didReceiveMemoryWarning:(NSNotification *)notification { - [_requestQueue cancelAllOperations]; - [_requestQueue addOperationWithBlock: ^{ - _incrBufferCount = -60 - (int)(arc4random() % 120); // about 1~3 seconds to grow back.. - NSNumber *next = @((_curIndex + 1) % _totalFrameCount); - LOCK( - NSArray * keys = _buffer.allKeys; - for (NSNumber * key in keys) { - if (![key isEqualToNumber:next]) { // keep the next frame for smoothly animation - [_buffer removeObjectForKey:key]; - } - } - )//LOCK - }]; -} - -- (void)didEnterBackground:(NSNotification *)notification { - [_requestQueue cancelAllOperations]; - NSNumber *next = @((_curIndex + 1) % _totalFrameCount); - LOCK( - NSArray * keys = _buffer.allKeys; - for (NSNumber * key in keys) { - if (![key isEqualToNumber:next]) { // keep the next frame for smoothly animation - [_buffer removeObjectForKey:key]; - } - } - )//LOCK -} - -- (void)step:(CADisplayLink *)link { - UIImage *image = _curAnimatedImage; - NSMutableDictionary *buffer = _buffer; - UIImage *bufferedImage = nil; - NSUInteger nextIndex = (_curIndex + 1) % _totalFrameCount; - BOOL bufferIsFull = NO; - - if (!image) return; - if (_loopEnd) { // view will keep in last frame - [self stopAnimating]; - return; - } - - NSTimeInterval delay = 0; - if (!_bufferMiss) { - _time += link.duration; - delay = [image animatedImageDurationAtIndex:_curIndex]; - if (_time < delay) return; - _time -= delay; - if (nextIndex == 0) { - _curLoop++; - if (_curLoop >= _totalLoop && _totalLoop != 0) { - _loopEnd = YES; - [self stopAnimating]; - [self.layer setNeedsDisplay]; // let system call `displayLayer:` before runloop sleep - return; // stop at last frame - } - } - delay = [image animatedImageDurationAtIndex:nextIndex]; - if (_time > delay) _time = delay; // do not jump over frame - } - LOCK( - bufferedImage = buffer[@(nextIndex)]; - if (bufferedImage) { - if ((int)_incrBufferCount < _totalFrameCount) { - [buffer removeObjectForKey:@(nextIndex)]; - } - [self willChangeValueForKey:@"currentAnimatedImageIndex"]; - _curIndex = nextIndex; - [self didChangeValueForKey:@"currentAnimatedImageIndex"]; - _curFrame = bufferedImage == (id)[NSNull null] ? nil : bufferedImage; - if (_curImageHasContentsRect) { - _curContentsRect = [image animatedImageContentsRectAtIndex:_curIndex]; - [self setContentsRect:_curContentsRect forImage:_curFrame]; - } - nextIndex = (_curIndex + 1) % _totalFrameCount; - _bufferMiss = NO; - if (buffer.count == _totalFrameCount) { - bufferIsFull = YES; - } - } else { - _bufferMiss = YES; - } - )//LOCK - - if (!_bufferMiss) { - [self.layer setNeedsDisplay]; // let system call `displayLayer:` before runloop sleep - } - - if (!bufferIsFull && _requestQueue.operationCount == 0) { // if some work not finished, wait for next opportunity - _YYAnimatedImageViewFetchOperation *operation = [_YYAnimatedImageViewFetchOperation new]; - operation.view = self; - operation.nextIndex = nextIndex; - operation.curImage = image; - [_requestQueue addOperation:operation]; - } -} - -- (void)displayLayer:(CALayer *)layer { - if (_curFrame) { - layer.contents = (__bridge id)_curFrame.CGImage; - } -} - -- (void)setContentsRect:(CGRect)rect forImage:(UIImage *)image{ - CGRect layerRect = CGRectMake(0, 0, 1, 1); - if (image) { - CGSize imageSize = image.size; - if (imageSize.width > 0.01 && imageSize.height > 0.01) { - layerRect.origin.x = rect.origin.x / imageSize.width; - layerRect.origin.y = rect.origin.y / imageSize.height; - layerRect.size.width = rect.size.width / imageSize.width; - layerRect.size.height = rect.size.height / imageSize.height; - layerRect = CGRectIntersection(layerRect, CGRectMake(0, 0, 1, 1)); - if (CGRectIsNull(layerRect) || CGRectIsEmpty(layerRect)) { - layerRect = CGRectMake(0, 0, 1, 1); - } - } - } - [CATransaction begin]; - [CATransaction setDisableActions:YES]; - self.layer.contentsRect = layerRect; - [CATransaction commit]; -} - -- (void)didMoved { - if (self.autoPlayAnimatedImage) { - if(self.superview && self.window) { - [self startAnimating]; - } else { - [self stopAnimating]; - } - } -} - -- (void)didMoveToWindow { - [super didMoveToWindow]; - [self didMoved]; -} - -- (void)didMoveToSuperview { - [super didMoveToSuperview]; - [self didMoved]; -} - -- (void)setCurrentAnimatedImageIndex:(NSUInteger)currentAnimatedImageIndex { - if (!_curAnimatedImage) return; - if (currentAnimatedImageIndex >= _curAnimatedImage.animatedImageFrameCount) return; - if (_curIndex == currentAnimatedImageIndex) return; - - void (^block)() = ^{ - LOCK( - [_requestQueue cancelAllOperations]; - [_buffer removeAllObjects]; - [self willChangeValueForKey:@"currentAnimatedImageIndex"]; - _curIndex = currentAnimatedImageIndex; - [self didChangeValueForKey:@"currentAnimatedImageIndex"]; - _curFrame = [_curAnimatedImage animatedImageFrameAtIndex:_curIndex]; - if (_curImageHasContentsRect) { - _curContentsRect = [_curAnimatedImage animatedImageContentsRectAtIndex:_curIndex]; - } - _time = 0; - _loopEnd = NO; - _bufferMiss = NO; - [self.layer setNeedsDisplay]; - )//LOCK - }; - - if (pthread_main_np()) { - block(); - } else { - dispatch_async(dispatch_get_main_queue(), block); - } -} - -- (NSUInteger)currentAnimatedImageIndex { - return _curIndex; -} - -- (void)setRunloopMode:(NSString *)runloopMode { - if ([_runloopMode isEqual:runloopMode]) return; - if (_link) { - if (_runloopMode) { - [_link removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:_runloopMode]; - } - if (runloopMode.length) { - [_link addToRunLoop:[NSRunLoop mainRunLoop] forMode:runloopMode]; - } - } - _runloopMode = runloopMode.copy; -} - -#pragma mark - Override NSObject(NSKeyValueObservingCustomization) - -+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key { - if ([key isEqualToString:@"currentAnimatedImageIndex"]) { - return NO; - } - return [super automaticallyNotifiesObserversForKey:key]; -} - -#pragma mark - NSCoding - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - _runloopMode = [aDecoder decodeObjectForKey:@"runloopMode"]; - if (_runloopMode.length == 0) _runloopMode = NSRunLoopCommonModes; - if ([aDecoder containsValueForKey:@"autoPlayAnimatedImage"]) { - _autoPlayAnimatedImage = [aDecoder decodeBoolForKey:@"autoPlayAnimatedImage"]; - } else { - _autoPlayAnimatedImage = YES; - } - - UIImage *image = [aDecoder decodeObjectForKey:@"YYAnimatedImage"]; - UIImage *highlightedImage = [aDecoder decodeObjectForKey:@"YYHighlightedAnimatedImage"]; - if (image) { - self.image = image; - [self setImage:image withType:YYAnimatedImageTypeImage]; - } - if (highlightedImage) { - self.highlightedImage = highlightedImage; - [self setImage:highlightedImage withType:YYAnimatedImageTypeHighlightedImage]; - } - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - [aCoder encodeObject:_runloopMode forKey:@"runloopMode"]; - [aCoder encodeBool:_autoPlayAnimatedImage forKey:@"autoPlayAnimatedImage"]; - - BOOL ani, multi; - ani = [self.image conformsToProtocol:@protocol(YYAnimatedImage)]; - multi = (ani && ((UIImage *)self.image).animatedImageFrameCount > 1); - if (multi) [aCoder encodeObject:self.image forKey:@"YYAnimatedImage"]; - - ani = [self.highlightedImage conformsToProtocol:@protocol(YYAnimatedImage)]; - multi = (ani && ((UIImage *)self.highlightedImage).animatedImageFrameCount > 1); - if (multi) [aCoder encodeObject:self.highlightedImage forKey:@"YYHighlightedAnimatedImage"]; -} - -@end diff --git a/iOSProject/Pods/YYImage/YYImage/YYFrameImage.h b/iOSProject/Pods/YYImage/YYImage/YYFrameImage.h deleted file mode 100644 index 5795cc51..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYFrameImage.h +++ /dev/null @@ -1,109 +0,0 @@ -// -// YYFrameImage.h -// YYImage -// -// Created by ibireme on 14/12/9. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -#import -#elif __has_include() -#import -#else -#import "YYAnimatedImageView.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - -/** - An image to display frame-based animation. - - @discussion It is a fully compatible `UIImage` subclass. - It only support system image format such as png and jpeg. - The animation can be played by YYAnimatedImageView. - - Sample Code: - - NSArray *paths = @[@"/ani/frame1.png", @"/ani/frame2.png", @"/ani/frame3.png"]; - NSArray *times = @[@0.1, @0.2, @0.1]; - YYFrameImage *image = [YYFrameImage alloc] initWithImagePaths:paths frameDurations:times repeats:YES]; - YYAnimatedImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image]; - [view addSubView:imageView]; - */ -@interface YYFrameImage : UIImage - -/** - Create a frame animated image from files. - - @param paths An array of NSString objects, contains the full or - partial path to each image file. - e.g. @[@"/ani/1.png",@"/ani/2.png",@"/ani/3.png"] - - @param oneFrameDuration The duration (in seconds) per frame. - - @param loopCount The animation loop count, 0 means infinite. - - @return An initialized YYFrameImage object, or nil when an error occurs. - */ -- (nullable instancetype)initWithImagePaths:(NSArray *)paths - oneFrameDuration:(NSTimeInterval)oneFrameDuration - loopCount:(NSUInteger)loopCount; - -/** - Create a frame animated image from files. - - @param paths An array of NSString objects, contains the full or - partial path to each image file. - e.g. @[@"/ani/frame1.png",@"/ani/frame2.png",@"/ani/frame3.png"] - - @param frameDurations An array of NSNumber objects, contains the duration (in seconds) per frame. - e.g. @[@0.1, @0.2, @0.3]; - - @param loopCount The animation loop count, 0 means infinite. - - @return An initialized YYFrameImage object, or nil when an error occurs. - */ -- (nullable instancetype)initWithImagePaths:(NSArray *)paths - frameDurations:(NSArray *)frameDurations - loopCount:(NSUInteger)loopCount; - -/** - Create a frame animated image from an array of data. - - @param dataArray An array of NSData objects. - - @param oneFrameDuration The duration (in seconds) per frame. - - @param loopCount The animation loop count, 0 means infinite. - - @return An initialized YYFrameImage object, or nil when an error occurs. - */ -- (nullable instancetype)initWithImageDataArray:(NSArray *)dataArray - oneFrameDuration:(NSTimeInterval)oneFrameDuration - loopCount:(NSUInteger)loopCount; - -/** - Create a frame animated image from an array of data. - - @param dataArray An array of NSData objects. - - @param frameDurations An array of NSNumber objects, contains the duration (in seconds) per frame. - e.g. @[@0.1, @0.2, @0.3]; - - @param loopCount The animation loop count, 0 means infinite. - - @return An initialized YYFrameImage object, or nil when an error occurs. - */ -- (nullable instancetype)initWithImageDataArray:(NSArray *)dataArray - frameDurations:(NSArray *)frameDurations - loopCount:(NSUInteger)loopCount; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYImage/YYImage/YYFrameImage.m b/iOSProject/Pods/YYImage/YYImage/YYFrameImage.m deleted file mode 100644 index 93efe887..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYFrameImage.m +++ /dev/null @@ -1,150 +0,0 @@ -// -// YYFrameImage.m -// YYImage -// -// Created by ibireme on 14/12/9. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYFrameImage.h" -#import "YYImageCoder.h" - - -/** - Return the path scale. - - e.g. - - - - - - - - -
    Path Scale
    "icon.png" 1
    "icon@2x.png" 2
    "icon@2.5x.png" 2.5
    "icon@2x" 1
    "icon@2x..png" 1
    "icon@2x.png/" 1
    - */ -static CGFloat _NSStringPathScale(NSString *string) { - if (string.length == 0 || [string hasSuffix:@"/"]) return 1; - NSString *name = string.stringByDeletingPathExtension; - __block CGFloat scale = 1; - - NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:@"@[0-9]+\\.?[0-9]*x$" options:NSRegularExpressionAnchorsMatchLines error:nil]; - [pattern enumerateMatchesInString:name options:kNilOptions range:NSMakeRange(0, name.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - if (result.range.location >= 3) { - scale = [string substringWithRange:NSMakeRange(result.range.location + 1, result.range.length - 2)].doubleValue; - } - }]; - - return scale; -} - - - -@implementation YYFrameImage { - NSUInteger _loopCount; - NSUInteger _oneFrameBytes; - NSArray *_imagePaths; - NSArray *_imageDatas; - NSArray *_frameDurations; -} - -- (instancetype)initWithImagePaths:(NSArray *)paths oneFrameDuration:(NSTimeInterval)oneFrameDuration loopCount:(NSUInteger)loopCount { - NSMutableArray *durations = [NSMutableArray new]; - for (int i = 0, max = (int)paths.count; i < max; i++) { - [durations addObject:@(oneFrameDuration)]; - } - return [self initWithImagePaths:paths frameDurations:durations loopCount:loopCount]; -} - -- (instancetype)initWithImagePaths:(NSArray *)paths frameDurations:(NSArray *)frameDurations loopCount:(NSUInteger)loopCount { - if (paths.count == 0) return nil; - if (paths.count != frameDurations.count) return nil; - - NSString *firstPath = paths[0]; - NSData *firstData = [NSData dataWithContentsOfFile:firstPath]; - CGFloat scale = _NSStringPathScale(firstPath); - UIImage *firstCG = [[[UIImage alloc] initWithData:firstData] yy_imageByDecoded]; - self = [self initWithCGImage:firstCG.CGImage scale:scale orientation:UIImageOrientationUp]; - if (!self) return nil; - long frameByte = CGImageGetBytesPerRow(firstCG.CGImage) * CGImageGetHeight(firstCG.CGImage); - _oneFrameBytes = (NSUInteger)frameByte; - _imagePaths = paths.copy; - _frameDurations = frameDurations.copy; - _loopCount = loopCount; - - return self; -} - -- (instancetype)initWithImageDataArray:(NSArray *)dataArray oneFrameDuration:(NSTimeInterval)oneFrameDuration loopCount:(NSUInteger)loopCount { - NSMutableArray *durations = [NSMutableArray new]; - for (int i = 0, max = (int)dataArray.count; i < max; i++) { - [durations addObject:@(oneFrameDuration)]; - } - return [self initWithImageDataArray:dataArray frameDurations:durations loopCount:loopCount]; -} - -- (instancetype)initWithImageDataArray:(NSArray *)dataArray frameDurations:(NSArray *)frameDurations loopCount:(NSUInteger)loopCount { - if (dataArray.count == 0) return nil; - if (dataArray.count != frameDurations.count) return nil; - - NSData *firstData = dataArray[0]; - CGFloat scale = [UIScreen mainScreen].scale; - UIImage *firstCG = [[[UIImage alloc] initWithData:firstData] yy_imageByDecoded]; - self = [self initWithCGImage:firstCG.CGImage scale:scale orientation:UIImageOrientationUp]; - if (!self) return nil; - long frameByte = CGImageGetBytesPerRow(firstCG.CGImage) * CGImageGetHeight(firstCG.CGImage); - _oneFrameBytes = (NSUInteger)frameByte; - _imageDatas = dataArray.copy; - _frameDurations = frameDurations.copy; - _loopCount = loopCount; - - return self; -} - -#pragma mark - YYAnimtedImage - -- (NSUInteger)animatedImageFrameCount { - if (_imagePaths) { - return _imagePaths.count; - } else if (_imageDatas) { - return _imageDatas.count; - } else { - return 1; - } -} - -- (NSUInteger)animatedImageLoopCount { - return _loopCount; -} - -- (NSUInteger)animatedImageBytesPerFrame { - return _oneFrameBytes; -} - -- (UIImage *)animatedImageFrameAtIndex:(NSUInteger)index { - if (_imagePaths) { - if (index >= _imagePaths.count) return nil; - NSString *path = _imagePaths[index]; - CGFloat scale = _NSStringPathScale(path); - NSData *data = [NSData dataWithContentsOfFile:path]; - return [[UIImage imageWithData:data scale:scale] yy_imageByDecoded]; - } else if (_imageDatas) { - if (index >= _imageDatas.count) return nil; - NSData *data = _imageDatas[index]; - return [[UIImage imageWithData:data scale:[UIScreen mainScreen].scale] yy_imageByDecoded]; - } else { - return index == 0 ? self : nil; - } -} - -- (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index { - if (index >= _frameDurations.count) return 0; - NSNumber *num = _frameDurations[index]; - return [num doubleValue]; -} - -@end diff --git a/iOSProject/Pods/YYImage/YYImage/YYImage.h b/iOSProject/Pods/YYImage/YYImage/YYImage.h deleted file mode 100644 index 03610260..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYImage.h +++ /dev/null @@ -1,92 +0,0 @@ -// -// YYImage.h -// YYImage -// -// Created by ibireme on 14/10/20. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -FOUNDATION_EXPORT double YYImageVersionNumber; -FOUNDATION_EXPORT const unsigned char YYImageVersionString[]; -#import -#import -#import -#import -#elif __has_include() -#import -#import -#import -#import -#else -#import "YYFrameImage.h" -#import "YYSpriteSheetImage.h" -#import "YYImageCoder.h" -#import "YYAnimatedImageView.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - - -/** - A YYImage object is a high-level way to display animated image data. - - @discussion It is a fully compatible `UIImage` subclass. It extends the UIImage - to support animated WebP, APNG and GIF format image data decoding. It also - support NSCoding protocol to archive and unarchive multi-frame image data. - - If the image is created from multi-frame image data, and you want to play the - animation, try replace UIImageView with `YYAnimatedImageView`. - - Sample Code: - - // animation@3x.webp - YYImage *image = [YYImage imageNamed:@"animation.webp"]; - YYAnimatedImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image]; - [view addSubView:imageView]; - - */ -@interface YYImage : UIImage - -+ (nullable YYImage *)imageNamed:(NSString *)name; // no cache! -+ (nullable YYImage *)imageWithContentsOfFile:(NSString *)path; -+ (nullable YYImage *)imageWithData:(NSData *)data; -+ (nullable YYImage *)imageWithData:(NSData *)data scale:(CGFloat)scale; - -/** - If the image is created from data or file, then the value indicates the data type. - */ -@property (nonatomic, readonly) YYImageType animatedImageType; - -/** - If the image is created from animated image data (multi-frame GIF/APNG/WebP), - this property stores the original image data. - */ -@property (nullable, nonatomic, readonly) NSData *animatedImageData; - -/** - The total memory usage (in bytes) if all frame images was loaded into memory. - The value is 0 if the image is not created from a multi-frame image data. - */ -@property (nonatomic, readonly) NSUInteger animatedImageMemorySize; - -/** - Preload all frame image to memory. - - @discussion Set this property to `YES` will block the calling thread to decode - all animation frame image to memory, set to `NO` will release the preloaded frames. - If the image is shared by lots of image views (such as emoticon), preload all - frames will reduce the CPU cost. - - See `animatedImageMemorySize` for memory cost. - */ -@property (nonatomic) BOOL preloadAllAnimatedImageFrames; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYImage/YYImage/YYImage.m b/iOSProject/Pods/YYImage/YYImage/YYImage.m deleted file mode 100644 index aaea9398..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYImage.m +++ /dev/null @@ -1,254 +0,0 @@ -// -// YYImage.m -// YYImage -// -// Created by ibireme on 14/10/20. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYImage.h" - -/** - An array of NSNumber objects, shows the best order for path scale search. - e.g. iPhone3GS:@[@1,@2,@3] iPhone5:@[@2,@3,@1] iPhone6 Plus:@[@3,@2,@1] - */ -static NSArray *_NSBundlePreferredScales() { - static NSArray *scales; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - CGFloat screenScale = [UIScreen mainScreen].scale; - if (screenScale <= 1) { - scales = @[@1,@2,@3]; - } else if (screenScale <= 2) { - scales = @[@2,@3,@1]; - } else { - scales = @[@3,@2,@1]; - } - }); - return scales; -} - -/** - Add scale modifier to the file name (without path extension), - From @"name" to @"name@2x". - - e.g. - - - - - - - -
    Before After(scale:2)
    "icon" "icon@2x"
    "icon " "icon @2x"
    "icon.top" "icon.top@2x"
    "/p/name" "/p/name@2x"
    "/path/" "/path/"
    - - @param scale Resource scale. - @return String by add scale modifier, or just return if it's not end with file name. - */ -static NSString *_NSStringByAppendingNameScale(NSString *string, CGFloat scale) { - if (!string) return nil; - if (fabs(scale - 1) <= __FLT_EPSILON__ || string.length == 0 || [string hasSuffix:@"/"]) return string.copy; - return [string stringByAppendingFormat:@"@%@x", @(scale)]; -} - -/** - Return the path scale. - - e.g. - - - - - - - - -
    Path Scale
    "icon.png" 1
    "icon@2x.png" 2
    "icon@2.5x.png" 2.5
    "icon@2x" 1
    "icon@2x..png" 1
    "icon@2x.png/" 1
    - */ -static CGFloat _NSStringPathScale(NSString *string) { - if (string.length == 0 || [string hasSuffix:@"/"]) return 1; - NSString *name = string.stringByDeletingPathExtension; - __block CGFloat scale = 1; - - NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:@"@[0-9]+\\.?[0-9]*x$" options:NSRegularExpressionAnchorsMatchLines error:nil]; - [pattern enumerateMatchesInString:name options:kNilOptions range:NSMakeRange(0, name.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - if (result.range.location >= 3) { - scale = [string substringWithRange:NSMakeRange(result.range.location + 1, result.range.length - 2)].doubleValue; - } - }]; - - return scale; -} - - -@implementation YYImage { - YYImageDecoder *_decoder; - NSArray *_preloadedFrames; - dispatch_semaphore_t _preloadedLock; - NSUInteger _bytesPerFrame; -} - -+ (YYImage *)imageNamed:(NSString *)name { - if (name.length == 0) return nil; - if ([name hasSuffix:@"/"]) return nil; - - NSString *res = name.stringByDeletingPathExtension; - NSString *ext = name.pathExtension; - NSString *path = nil; - CGFloat scale = 1; - - // If no extension, guess by system supported (same as UIImage). - NSArray *exts = ext.length > 0 ? @[ext] : @[@"", @"png", @"jpeg", @"jpg", @"gif", @"webp", @"apng"]; - NSArray *scales = _NSBundlePreferredScales(); - for (int s = 0; s < scales.count; s++) { - scale = ((NSNumber *)scales[s]).floatValue; - NSString *scaledName = _NSStringByAppendingNameScale(res, scale); - for (NSString *e in exts) { - path = [[NSBundle mainBundle] pathForResource:scaledName ofType:e]; - if (path) break; - } - if (path) break; - } - if (path.length == 0) return nil; - - NSData *data = [NSData dataWithContentsOfFile:path]; - if (data.length == 0) return nil; - - return [[self alloc] initWithData:data scale:scale]; -} - -+ (YYImage *)imageWithContentsOfFile:(NSString *)path { - return [[self alloc] initWithContentsOfFile:path]; -} - -+ (YYImage *)imageWithData:(NSData *)data { - return [[self alloc] initWithData:data]; -} - -+ (YYImage *)imageWithData:(NSData *)data scale:(CGFloat)scale { - return [[self alloc] initWithData:data scale:scale]; -} - -- (instancetype)initWithContentsOfFile:(NSString *)path { - NSData *data = [NSData dataWithContentsOfFile:path]; - return [self initWithData:data scale:_NSStringPathScale(path)]; -} - -- (instancetype)initWithData:(NSData *)data { - return [self initWithData:data scale:1]; -} - -- (instancetype)initWithData:(NSData *)data scale:(CGFloat)scale { - if (data.length == 0) return nil; - if (scale <= 0) scale = [UIScreen mainScreen].scale; - _preloadedLock = dispatch_semaphore_create(1); - @autoreleasepool { - YYImageDecoder *decoder = [YYImageDecoder decoderWithData:data scale:scale]; - YYImageFrame *frame = [decoder frameAtIndex:0 decodeForDisplay:YES]; - UIImage *image = frame.image; - if (!image) return nil; - self = [self initWithCGImage:image.CGImage scale:decoder.scale orientation:image.imageOrientation]; - if (!self) return nil; - _animatedImageType = decoder.type; - if (decoder.frameCount > 1) { - _decoder = decoder; - _bytesPerFrame = CGImageGetBytesPerRow(image.CGImage) * CGImageGetHeight(image.CGImage); - _animatedImageMemorySize = _bytesPerFrame * decoder.frameCount; - } - self.yy_isDecodedForDisplay = YES; - } - return self; -} - -- (NSData *)animatedImageData { - return _decoder.data; -} - -- (void)setPreloadAllAnimatedImageFrames:(BOOL)preloadAllAnimatedImageFrames { - if (_preloadAllAnimatedImageFrames != preloadAllAnimatedImageFrames) { - if (preloadAllAnimatedImageFrames && _decoder.frameCount > 0) { - NSMutableArray *frames = [NSMutableArray new]; - for (NSUInteger i = 0, max = _decoder.frameCount; i < max; i++) { - UIImage *img = [self animatedImageFrameAtIndex:i]; - if (img) { - [frames addObject:img]; - } else { - [frames addObject:[NSNull null]]; - } - } - dispatch_semaphore_wait(_preloadedLock, DISPATCH_TIME_FOREVER); - _preloadedFrames = frames; - dispatch_semaphore_signal(_preloadedLock); - } else { - dispatch_semaphore_wait(_preloadedLock, DISPATCH_TIME_FOREVER); - _preloadedFrames = nil; - dispatch_semaphore_signal(_preloadedLock); - } - } -} - -#pragma mark - protocol NSCoding - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - NSNumber *scale = [aDecoder decodeObjectForKey:@"YYImageScale"]; - NSData *data = [aDecoder decodeObjectForKey:@"YYImageData"]; - if (data.length) { - self = [self initWithData:data scale:scale.doubleValue]; - } else { - self = [super initWithCoder:aDecoder]; - } - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - if (_decoder.data.length) { - [aCoder encodeObject:@(self.scale) forKey:@"YYImageScale"]; - [aCoder encodeObject:_decoder.data forKey:@"YYImageData"]; - } else { - [super encodeWithCoder:aCoder]; // Apple use UIImagePNGRepresentation() to encode UIImage. - } -} - -#pragma mark - protocol YYAnimatedImage - -- (NSUInteger)animatedImageFrameCount { - return _decoder.frameCount; -} - -- (NSUInteger)animatedImageLoopCount { - return _decoder.loopCount; -} - -- (NSUInteger)animatedImageBytesPerFrame { - return _bytesPerFrame; -} - -- (UIImage *)animatedImageFrameAtIndex:(NSUInteger)index { - if (index >= _decoder.frameCount) return nil; - dispatch_semaphore_wait(_preloadedLock, DISPATCH_TIME_FOREVER); - UIImage *image = _preloadedFrames[index]; - dispatch_semaphore_signal(_preloadedLock); - if (image) return image == (id)[NSNull null] ? nil : image; - return [_decoder frameAtIndex:index decodeForDisplay:YES].image; -} - -- (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index { - NSTimeInterval duration = [_decoder frameDurationAtIndex:index]; - - /* - http://opensource.apple.com/source/WebCore/WebCore-7600.1.25/platform/graphics/cg/ImageSourceCG.cpp - Many annoying ads specify a 0 duration to make an image flash as quickly as - possible. We follow Safari and Firefox's behavior and use a duration of 100 ms - for any frames that specify a duration of <= 10 ms. - See and for more information. - - See also: http://nullsleep.tumblr.com/post/16524517190/animated-gif-minimum-frame-delay-browser. - */ - if (duration < 0.011f) return 0.100f; - return duration; -} - -@end diff --git a/iOSProject/Pods/YYImage/YYImage/YYImageCoder.h b/iOSProject/Pods/YYImage/YYImage/YYImageCoder.h deleted file mode 100644 index 61a931c4..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYImageCoder.h +++ /dev/null @@ -1,505 +0,0 @@ -// -// YYImageCoder.h -// YYImage -// -// Created by ibireme on 15/5/13. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Image file type. - */ -typedef NS_ENUM(NSUInteger, YYImageType) { - YYImageTypeUnknown = 0, ///< unknown - YYImageTypeJPEG, ///< jpeg, jpg - YYImageTypeJPEG2000, ///< jp2 - YYImageTypeTIFF, ///< tiff, tif - YYImageTypeBMP, ///< bmp - YYImageTypeICO, ///< ico - YYImageTypeICNS, ///< icns - YYImageTypeGIF, ///< gif - YYImageTypePNG, ///< png - YYImageTypeWebP, ///< webp - YYImageTypeOther, ///< other image format -}; - - -/** - Dispose method specifies how the area used by the current frame is to be treated - before rendering the next frame on the canvas. - */ -typedef NS_ENUM(NSUInteger, YYImageDisposeMethod) { - - /** - No disposal is done on this frame before rendering the next; the contents - of the canvas are left as is. - */ - YYImageDisposeNone = 0, - - /** - The frame's region of the canvas is to be cleared to fully transparent black - before rendering the next frame. - */ - YYImageDisposeBackground, - - /** - The frame's region of the canvas is to be reverted to the previous contents - before rendering the next frame. - */ - YYImageDisposePrevious, -}; - -/** - Blend operation specifies how transparent pixels of the current frame are - blended with those of the previous canvas. - */ -typedef NS_ENUM(NSUInteger, YYImageBlendOperation) { - - /** - All color components of the frame, including alpha, overwrite the current - contents of the frame's canvas region. - */ - YYImageBlendNone = 0, - - /** - The frame should be composited onto the output buffer based on its alpha. - */ - YYImageBlendOver, -}; - -/** - An image frame object. - */ -@interface YYImageFrame : NSObject -@property (nonatomic) NSUInteger index; ///< Frame index (zero based) -@property (nonatomic) NSUInteger width; ///< Frame width -@property (nonatomic) NSUInteger height; ///< Frame height -@property (nonatomic) NSUInteger offsetX; ///< Frame origin.x in canvas (left-bottom based) -@property (nonatomic) NSUInteger offsetY; ///< Frame origin.y in canvas (left-bottom based) -@property (nonatomic) NSTimeInterval duration; ///< Frame duration in seconds -@property (nonatomic) YYImageDisposeMethod dispose; ///< Frame dispose method. -@property (nonatomic) YYImageBlendOperation blend; ///< Frame blend operation. -@property (nullable, nonatomic, strong) UIImage *image; ///< The image. -+ (instancetype)frameWithImage:(UIImage *)image; -@end - - -#pragma mark - Decoder - -/** - An image decoder to decode image data. - - @discussion This class supports decoding animated WebP, APNG, GIF and system - image format such as PNG, JPG, JP2, BMP, TIFF, PIC, ICNS and ICO. It can be used - to decode complete image data, or to decode incremental image data during image - download. This class is thread-safe. - - Example: - - // Decode single image: - NSData *data = [NSData dataWithContentOfFile:@"/tmp/image.webp"]; - YYImageDecoder *decoder = [YYImageDecoder decoderWithData:data scale:2.0]; - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - - // Decode image during download: - NSMutableData *data = [NSMutableData new]; - YYImageDecoder *decoder = [[YYImageDecoder alloc] initWithScale:2.0]; - while(newDataArrived) { - [data appendData:newData]; - [decoder updateData:data final:NO]; - if (decoder.frameCount > 0) { - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - // progressive display... - } - } - [decoder updateData:data final:YES]; - UIImage image = [decoder frameAtIndex:0 decodeForDisplay:YES].image; - // final display... - - */ -@interface YYImageDecoder : NSObject - -@property (nullable, nonatomic, readonly) NSData *data; ///< Image data. -@property (nonatomic, readonly) YYImageType type; ///< Image data type. -@property (nonatomic, readonly) CGFloat scale; ///< Image scale. -@property (nonatomic, readonly) NSUInteger frameCount; ///< Image frame count. -@property (nonatomic, readonly) NSUInteger loopCount; ///< Image loop count, 0 means infinite. -@property (nonatomic, readonly) NSUInteger width; ///< Image canvas width. -@property (nonatomic, readonly) NSUInteger height; ///< Image canvas height. -@property (nonatomic, readonly, getter=isFinalized) BOOL finalized; - -/** - Creates an image decoder. - - @param scale Image's scale. - @return An image decoder. - */ -- (instancetype)initWithScale:(CGFloat)scale NS_DESIGNATED_INITIALIZER; - -/** - Updates the incremental image with new data. - - @discussion You can use this method to decode progressive/interlaced/baseline - image when you do not have the complete image data. The `data` was retained by - decoder, you should not modify the data in other thread during decoding. - - @param data The data to add to the image decoder. Each time you call this - function, the 'data' parameter must contain all of the image file data - accumulated so far. - - @param final A value that specifies whether the data is the final set. - Pass YES if it is, NO otherwise. When the data is already finalized, you can - not update the data anymore. - - @return Whether succeed. - */ -- (BOOL)updateData:(nullable NSData *)data final:(BOOL)final; - -/** - Convenience method to create a decoder with specified data. - @param data Image data. - @param scale Image's scale. - @return A new decoder, or nil if an error occurs. - */ -+ (nullable instancetype)decoderWithData:(NSData *)data scale:(CGFloat)scale; - -/** - Decodes and returns a frame from a specified index. - @param index Frame image index (zero-based). - @param decodeForDisplay Whether decode the image to memory bitmap for display. - If NO, it will try to returns the original frame data without blend. - @return A new frame with image, or nil if an error occurs. - */ -- (nullable YYImageFrame *)frameAtIndex:(NSUInteger)index decodeForDisplay:(BOOL)decodeForDisplay; - -/** - Returns the frame duration from a specified index. - @param index Frame image (zero-based). - @return Duration in seconds. - */ -- (NSTimeInterval)frameDurationAtIndex:(NSUInteger)index; - -/** - Returns the frame's properties. See "CGImageProperties.h" in ImageIO.framework - for more information. - - @param index Frame image index (zero-based). - @return The ImageIO frame property. - */ -- (nullable NSDictionary *)framePropertiesAtIndex:(NSUInteger)index; - -/** - Returns the image's properties. See "CGImageProperties.h" in ImageIO.framework - for more information. - */ -- (nullable NSDictionary *)imageProperties; - -@end - - - -#pragma mark - Encoder - -/** - An image encoder to encode image to data. - - @discussion It supports encoding single frame image with the type defined in YYImageType. - It also supports encoding multi-frame image with GIF, APNG and WebP. - - Example: - - YYImageEncoder *jpegEncoder = [[YYImageEncoder alloc] initWithType:YYImageTypeJPEG]; - jpegEncoder.quality = 0.9; - [jpegEncoder addImage:image duration:0]; - NSData jpegData = [jpegEncoder encode]; - - YYImageEncoder *gifEncoder = [[YYImageEncoder alloc] initWithType:YYImageTypeGIF]; - gifEncoder.loopCount = 5; - [gifEncoder addImage:image0 duration:0.1]; - [gifEncoder addImage:image1 duration:0.15]; - [gifEncoder addImage:image2 duration:0.2]; - NSData gifData = [gifEncoder encode]; - - @warning It just pack the images together when encoding multi-frame image. If you - want to reduce the image file size, try imagemagick/ffmpeg for GIF and WebP, - and apngasm for APNG. - */ -@interface YYImageEncoder : NSObject - -@property (nonatomic, readonly) YYImageType type; ///< Image type. -@property (nonatomic) NSUInteger loopCount; ///< Loop count, 0 means infinit, only available for GIF/APNG/WebP. -@property (nonatomic) BOOL lossless; ///< Lossless, only available for WebP. -@property (nonatomic) CGFloat quality; ///< Compress quality, 0.0~1.0, only available for JPG/JP2/WebP. - -- (instancetype)init UNAVAILABLE_ATTRIBUTE; -+ (instancetype)new UNAVAILABLE_ATTRIBUTE; - -/** - Create an image encoder with a specified type. - @param type Image type. - @return A new encoder, or nil if an error occurs. - */ -- (nullable instancetype)initWithType:(YYImageType)type NS_DESIGNATED_INITIALIZER; - -/** - Add an image to encoder. - @param image Image. - @param duration Image duration for animation. Pass 0 to ignore this parameter. - */ -- (void)addImage:(UIImage *)image duration:(NSTimeInterval)duration; - -/** - Add an image with image data to encoder. - @param data Image data. - @param duration Image duration for animation. Pass 0 to ignore this parameter. - */ -- (void)addImageWithData:(NSData *)data duration:(NSTimeInterval)duration; - -/** - Add an image from a file path to encoder. - @param image Image file path. - @param duration Image duration for animation. Pass 0 to ignore this parameter. - */ -- (void)addImageWithFile:(NSString *)path duration:(NSTimeInterval)duration; - -/** - Encodes the image and returns the image data. - @return The image data, or nil if an error occurs. - */ -- (nullable NSData *)encode; - -/** - Encodes the image to a file. - @param path The file path (overwrite if exist). - @return Whether succeed. - */ -- (BOOL)encodeToFile:(NSString *)path; - -/** - Convenience method to encode single frame image. - @param image The image. - @param type The destination image type. - @param quality Image quality, 0.0~1.0. - @return The image data, or nil if an error occurs. - */ -+ (nullable NSData *)encodeImage:(UIImage *)image type:(YYImageType)type quality:(CGFloat)quality; - -/** - Convenience method to encode image from a decoder. - @param decoder The image decoder. - @param type The destination image type; - @param quality Image quality, 0.0~1.0. - @return The image data, or nil if an error occurs. - */ -+ (nullable NSData *)encodeImageWithDecoder:(YYImageDecoder *)decoder type:(YYImageType)type quality:(CGFloat)quality; - -@end - - -#pragma mark - UIImage - -@interface UIImage (YYImageCoder) - -/** - Decompress this image to bitmap, so when the image is displayed on screen, - the main thread won't be blocked by additional decode. If the image has already - been decoded or unable to decode, it just returns itself. - - @return an image decoded, or just return itself if no needed. - @see yy_isDecodedForDisplay - */ -- (instancetype)yy_imageByDecoded; - -/** - Wherher the image can be display on screen without additional decoding. - @warning It just a hint for your code, change it has no other effect. - */ -@property (nonatomic) BOOL yy_isDecodedForDisplay; - -/** - Saves this image to iOS Photos Album. - - @discussion This method attempts to save the original data to album if the - image is created from an animated GIF/APNG, otherwise, it will save the image - as JPEG or PNG (based on the alpha information). - - @param completionBlock The block invoked (in main thread) after the save operation completes. - assetURL: An URL that identifies the saved image file. If the image is not saved, assetURL is nil. - error: If the image is not saved, an error object that describes the reason for failure, otherwise nil. - */ -- (void)yy_saveToAlbumWithCompletionBlock:(nullable void(^)(NSURL * _Nullable assetURL, NSError * _Nullable error))completionBlock; - -/** - Return a 'best' data representation for this image. - - @discussion The convertion based on these rule: - 1. If the image is created from an animated GIF/APNG/WebP, it returns the original data. - 2. It returns PNG or JPEG(0.9) representation based on the alpha information. - - @return Image data, or nil if an error occurs. - */ -- (nullable NSData *)yy_imageDataRepresentation; - -@end - - - -#pragma mark - Helper - -/// Detect a data's image type by reading the data's header 16 bytes (very fast). -CG_EXTERN YYImageType YYImageDetectType(CFDataRef data); - -/// Convert YYImageType to UTI (such as kUTTypeJPEG). -CG_EXTERN CFStringRef _Nullable YYImageTypeToUTType(YYImageType type); - -/// Convert UTI (such as kUTTypeJPEG) to YYImageType. -CG_EXTERN YYImageType YYImageTypeFromUTType(CFStringRef uti); - -/// Get image type's file extension (such as @"jpg"). -CG_EXTERN NSString *_Nullable YYImageTypeGetExtension(YYImageType type); - - - -/// Returns the shared DeviceRGB color space. -CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceRGB(); - -/// Returns the shared DeviceGray color space. -CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceGray(); - -/// Returns whether a color space is DeviceRGB. -CG_EXTERN BOOL YYCGColorSpaceIsDeviceRGB(CGColorSpaceRef space); - -/// Returns whether a color space is DeviceGray. -CG_EXTERN BOOL YYCGColorSpaceIsDeviceGray(CGColorSpaceRef space); - - - -/// Convert EXIF orientation value to UIImageOrientation. -CG_EXTERN UIImageOrientation YYUIImageOrientationFromEXIFValue(NSInteger value); - -/// Convert UIImageOrientation to EXIF orientation value. -CG_EXTERN NSInteger YYUIImageOrientationToEXIFValue(UIImageOrientation orientation); - - - -/** - Create a decoded image. - - @discussion If the source image is created from a compressed image data (such as - PNG or JPEG), you can use this method to decode the image. After decoded, you can - access the decoded bytes with CGImageGetDataProvider() and CGDataProviderCopyData() - without additional decode process. If the image has already decoded, this method - just copy the decoded bytes to the new image. - - @param imageRef The source image. - @param decodeForDisplay If YES, this method will decode the image and convert - it to BGRA8888 (premultiplied) or BGRX8888 format for CALayer display. - - @return A decoded image, or NULL if an error occurs. - */ -CG_EXTERN CGImageRef _Nullable YYCGImageCreateDecodedCopy(CGImageRef imageRef, BOOL decodeForDisplay); - -/** - Create an image copy with an orientation. - - @param imageRef Source image - @param orientation Image orientation which will applied to the image. - @param destBitmapInfo Destimation image bitmap, only support 32bit format (such as ARGB8888). - @return A new image, or NULL if an error occurs. - */ -CG_EXTERN CGImageRef _Nullable YYCGImageCreateCopyWithOrientation(CGImageRef imageRef, - UIImageOrientation orientation, - CGBitmapInfo destBitmapInfo); - -/** - Create an image copy with CGAffineTransform. - - @param imageRef Source image. - @param transform Transform applied to image (left-bottom based coordinate system). - @param destSize Destination image size - @param destBitmapInfo Destimation image bitmap, only support 32bit format (such as ARGB8888). - @return A new image, or NULL if an error occurs. - */ -CG_EXTERN CGImageRef _Nullable YYCGImageCreateAffineTransformCopy(CGImageRef imageRef, - CGAffineTransform transform, - CGSize destSize, - CGBitmapInfo destBitmapInfo); - -/** - Encode an image to data with CGImageDestination. - - @param imageRef The image. - @param type The image destination data type. - @param quality The quality (0.0~1.0) - @return A new image data, or nil if an error occurs. - */ -CG_EXTERN CFDataRef _Nullable YYCGImageCreateEncodedData(CGImageRef imageRef, YYImageType type, CGFloat quality); - - -/** - Whether WebP is available in YYImage. - */ -CG_EXTERN BOOL YYImageWebPAvailable(); - -/** - Get a webp image frame count; - - @param webpData WebP data. - @return Image frame count, or 0 if an error occurs. - */ -CG_EXTERN NSUInteger YYImageGetWebPFrameCount(CFDataRef webpData); - -/** - Decode an image from WebP data, returns NULL if an error occurs. - - @param webpData The WebP data. - @param decodeForDisplay If YES, this method will decode the image and convert it - to BGRA8888 (premultiplied) format for CALayer display. - @param useThreads YES to enable multi-thread decode. - (speed up, but cost more CPU) - @param bypassFiltering YES to skip the in-loop filtering. - (speed up, but may lose some smooth) - @param noFancyUpsampling YES to use faster pointwise upsampler. - (speed down, and may lose some details). - @return The decoded image, or NULL if an error occurs. - */ -CG_EXTERN CGImageRef _Nullable YYCGImageCreateWithWebPData(CFDataRef webpData, - BOOL decodeForDisplay, - BOOL useThreads, - BOOL bypassFiltering, - BOOL noFancyUpsampling); - -typedef NS_ENUM(NSUInteger, YYImagePreset) { - YYImagePresetDefault = 0, ///< default preset. - YYImagePresetPicture, ///< digital picture, like portrait, inner shot - YYImagePresetPhoto, ///< outdoor photograph, with natural lighting - YYImagePresetDrawing, ///< hand or line drawing, with high-contrast details - YYImagePresetIcon, ///< small-sized colorful images - YYImagePresetText ///< text-like -}; - -/** - Encode a CGImage to WebP data - - @param imageRef image - @param lossless YES=lossless (similar to PNG), NO=lossy (similar to JPEG) - @param quality 0.0~1.0 (0=smallest file, 1.0=biggest file) - For lossless image, try the value near 1.0; for lossy, try the value near 0.8. - @param compressLevel 0~6 (0=fast, 6=slower-better). Default is 4. - @param preset Preset for different image type, default is YYImagePresetDefault. - @return WebP data, or nil if an error occurs. - */ -CG_EXTERN CFDataRef _Nullable YYCGImageCreateEncodedWebPData(CGImageRef imageRef, - BOOL lossless, - CGFloat quality, - int compressLevel, - YYImagePreset preset); - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYImage/YYImage/YYImageCoder.m b/iOSProject/Pods/YYImage/YYImage/YYImageCoder.m deleted file mode 100644 index 66cf46ef..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYImageCoder.m +++ /dev/null @@ -1,2870 +0,0 @@ -// -// YYImageCoder.m -// YYImage -// -// Created by ibireme on 15/5/13. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYImageCoder.h" -#import "YYImage.h" -#import -#import -#import -#import -#import -#import -#import -#import -#import - - - -#ifndef YYIMAGE_WEBP_ENABLED -#if __has_include() && __has_include() && \ - __has_include() && __has_include() -#define YYIMAGE_WEBP_ENABLED 1 -#import -#import -#import -#import -#elif __has_include("webp/decode.h") && __has_include("webp/encode.h") && \ - __has_include("webp/demux.h") && __has_include("webp/mux.h") -#define YYIMAGE_WEBP_ENABLED 1 -#import "webp/decode.h" -#import "webp/encode.h" -#import "webp/demux.h" -#import "webp/mux.h" -#else -#define YYIMAGE_WEBP_ENABLED 0 -#endif -#endif - - - - - -//////////////////////////////////////////////////////////////////////////////// -#pragma mark - Utility (for little endian platform) - -#define YY_FOUR_CC(c1,c2,c3,c4) ((uint32_t)(((c4) << 24) | ((c3) << 16) | ((c2) << 8) | (c1))) -#define YY_TWO_CC(c1,c2) ((uint16_t)(((c2) << 8) | (c1))) - -static inline uint16_t yy_swap_endian_uint16(uint16_t value) { - return - (uint16_t) ((value & 0x00FF) << 8) | - (uint16_t) ((value & 0xFF00) >> 8) ; -} - -static inline uint32_t yy_swap_endian_uint32(uint32_t value) { - return - (uint32_t)((value & 0x000000FFU) << 24) | - (uint32_t)((value & 0x0000FF00U) << 8) | - (uint32_t)((value & 0x00FF0000U) >> 8) | - (uint32_t)((value & 0xFF000000U) >> 24) ; -} - -//////////////////////////////////////////////////////////////////////////////// -#pragma mark - APNG - -/* - PNG spec: http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html - APNG spec: https://wiki.mozilla.org/APNG_Specification - - =============================================================================== - PNG format: - header (8): 89 50 4e 47 0d 0a 1a 0a - chunk, chunk, chunk, ... - - =============================================================================== - chunk format: - length (4): uint32_t big endian - fourcc (4): chunk type code - data (length): data - crc32 (4): uint32_t big endian crc32(fourcc + data) - - =============================================================================== - PNG chunk define: - - IHDR (Image Header) required, must appear first, 13 bytes - width (4) pixel count, should not be zero - height (4) pixel count, should not be zero - bit depth (1) expected: 1, 2, 4, 8, 16 - color type (1) 1<<0 (palette used), 1<<1 (color used), 1<<2 (alpha channel used) - compression method (1) 0 (deflate/inflate) - filter method (1) 0 (adaptive filtering with five basic filter types) - interlace method (1) 0 (no interlace) or 1 (Adam7 interlace) - - IDAT (Image Data) required, must appear consecutively if there's multiple 'IDAT' chunk - - IEND (End) required, must appear last, 0 bytes - - =============================================================================== - APNG chunk define: - - acTL (Animation Control) required, must appear before 'IDAT', 8 bytes - num frames (4) number of frames - num plays (4) number of times to loop, 0 indicates infinite looping - - fcTL (Frame Control) required, must appear before the 'IDAT' or 'fdAT' chunks of the frame to which it applies, 26 bytes - sequence number (4) sequence number of the animation chunk, starting from 0 - width (4) width of the following frame - height (4) height of the following frame - x offset (4) x position at which to render the following frame - y offset (4) y position at which to render the following frame - delay num (2) frame delay fraction numerator - delay den (2) frame delay fraction denominator - dispose op (1) type of frame area disposal to be done after rendering this frame (0:none, 1:background 2:previous) - blend op (1) type of frame area rendering for this frame (0:source, 1:over) - - fdAT (Frame Data) required - sequence number (4) sequence number of the animation chunk - frame data (x) frame data for this frame (same as 'IDAT') - - =============================================================================== - `dispose_op` specifies how the output buffer should be changed at the end of the delay - (before rendering the next frame). - - * NONE: no disposal is done on this frame before rendering the next; the contents - of the output buffer are left as is. - * BACKGROUND: the frame's region of the output buffer is to be cleared to fully - transparent black before rendering the next frame. - * PREVIOUS: the frame's region of the output buffer is to be reverted to the previous - contents before rendering the next frame. - - `blend_op` specifies whether the frame is to be alpha blended into the current output buffer - content, or whether it should completely replace its region in the output buffer. - - * SOURCE: all color components of the frame, including alpha, overwrite the current contents - of the frame's output buffer region. - * OVER: the frame should be composited onto the output buffer based on its alpha, - using a simple OVER operation as described in the "Alpha Channel Processing" section - of the PNG specification - */ - -typedef enum { - YY_PNG_ALPHA_TYPE_PALEETE = 1 << 0, - YY_PNG_ALPHA_TYPE_COLOR = 1 << 1, - YY_PNG_ALPHA_TYPE_ALPHA = 1 << 2, -} yy_png_alpha_type; - -typedef enum { - YY_PNG_DISPOSE_OP_NONE = 0, - YY_PNG_DISPOSE_OP_BACKGROUND = 1, - YY_PNG_DISPOSE_OP_PREVIOUS = 2, -} yy_png_dispose_op; - -typedef enum { - YY_PNG_BLEND_OP_SOURCE = 0, - YY_PNG_BLEND_OP_OVER = 1, -} yy_png_blend_op; - -typedef struct { - uint32_t width; ///< pixel count, should not be zero - uint32_t height; ///< pixel count, should not be zero - uint8_t bit_depth; ///< expected: 1, 2, 4, 8, 16 - uint8_t color_type; ///< see yy_png_alpha_type - uint8_t compression_method; ///< 0 (deflate/inflate) - uint8_t filter_method; ///< 0 (adaptive filtering with five basic filter types) - uint8_t interlace_method; ///< 0 (no interlace) or 1 (Adam7 interlace) -} yy_png_chunk_IHDR; - -typedef struct { - uint32_t sequence_number; ///< sequence number of the animation chunk, starting from 0 - uint32_t width; ///< width of the following frame - uint32_t height; ///< height of the following frame - uint32_t x_offset; ///< x position at which to render the following frame - uint32_t y_offset; ///< y position at which to render the following frame - uint16_t delay_num; ///< frame delay fraction numerator - uint16_t delay_den; ///< frame delay fraction denominator - uint8_t dispose_op; ///< see yy_png_dispose_op - uint8_t blend_op; ///< see yy_png_blend_op -} yy_png_chunk_fcTL; - -typedef struct { - uint32_t offset; ///< chunk offset in PNG data - uint32_t fourcc; ///< chunk fourcc - uint32_t length; ///< chunk data length - uint32_t crc32; ///< chunk crc32 -} yy_png_chunk_info; - -typedef struct { - uint32_t chunk_index; ///< the first `fdAT`/`IDAT` chunk index - uint32_t chunk_num; ///< the `fdAT`/`IDAT` chunk count - uint32_t chunk_size; ///< the `fdAT`/`IDAT` chunk bytes - yy_png_chunk_fcTL frame_control; -} yy_png_frame_info; - -typedef struct { - yy_png_chunk_IHDR header; ///< png header - yy_png_chunk_info *chunks; ///< chunks - uint32_t chunk_num; ///< count of chunks - - yy_png_frame_info *apng_frames; ///< frame info, NULL if not apng - uint32_t apng_frame_num; ///< 0 if not apng - uint32_t apng_loop_num; ///< 0 indicates infinite looping - - uint32_t *apng_shared_chunk_indexs; ///< shared chunk index - uint32_t apng_shared_chunk_num; ///< shared chunk count - uint32_t apng_shared_chunk_size; ///< shared chunk bytes - uint32_t apng_shared_insert_index; ///< shared chunk insert index - bool apng_first_frame_is_cover; ///< the first frame is same as png (cover) -} yy_png_info; - -static void yy_png_chunk_IHDR_read(yy_png_chunk_IHDR *IHDR, const uint8_t *data) { - IHDR->width = yy_swap_endian_uint32(*((uint32_t *)(data))); - IHDR->height = yy_swap_endian_uint32(*((uint32_t *)(data + 4))); - IHDR->bit_depth = data[8]; - IHDR->color_type = data[9]; - IHDR->compression_method = data[10]; - IHDR->filter_method = data[11]; - IHDR->interlace_method = data[12]; -} - -static void yy_png_chunk_IHDR_write(yy_png_chunk_IHDR *IHDR, uint8_t *data) { - *((uint32_t *)(data)) = yy_swap_endian_uint32(IHDR->width); - *((uint32_t *)(data + 4)) = yy_swap_endian_uint32(IHDR->height); - data[8] = IHDR->bit_depth; - data[9] = IHDR->color_type; - data[10] = IHDR->compression_method; - data[11] = IHDR->filter_method; - data[12] = IHDR->interlace_method; -} - -static void yy_png_chunk_fcTL_read(yy_png_chunk_fcTL *fcTL, const uint8_t *data) { - fcTL->sequence_number = yy_swap_endian_uint32(*((uint32_t *)(data))); - fcTL->width = yy_swap_endian_uint32(*((uint32_t *)(data + 4))); - fcTL->height = yy_swap_endian_uint32(*((uint32_t *)(data + 8))); - fcTL->x_offset = yy_swap_endian_uint32(*((uint32_t *)(data + 12))); - fcTL->y_offset = yy_swap_endian_uint32(*((uint32_t *)(data + 16))); - fcTL->delay_num = yy_swap_endian_uint16(*((uint16_t *)(data + 20))); - fcTL->delay_den = yy_swap_endian_uint16(*((uint16_t *)(data + 22))); - fcTL->dispose_op = data[24]; - fcTL->blend_op = data[25]; -} - -static void yy_png_chunk_fcTL_write(yy_png_chunk_fcTL *fcTL, uint8_t *data) { - *((uint32_t *)(data)) = yy_swap_endian_uint32(fcTL->sequence_number); - *((uint32_t *)(data + 4)) = yy_swap_endian_uint32(fcTL->width); - *((uint32_t *)(data + 8)) = yy_swap_endian_uint32(fcTL->height); - *((uint32_t *)(data + 12)) = yy_swap_endian_uint32(fcTL->x_offset); - *((uint32_t *)(data + 16)) = yy_swap_endian_uint32(fcTL->y_offset); - *((uint16_t *)(data + 20)) = yy_swap_endian_uint16(fcTL->delay_num); - *((uint16_t *)(data + 22)) = yy_swap_endian_uint16(fcTL->delay_den); - data[24] = fcTL->dispose_op; - data[25] = fcTL->blend_op; -} - -// convert double value to fraction -static void yy_png_delay_to_fraction(double duration, uint16_t *num, uint16_t *den) { - if (duration >= 0xFF) { - *num = 0xFF; - *den = 1; - } else if (duration <= 1.0 / (double)0xFF) { - *num = 1; - *den = 0xFF; - } else { - // Use continued fraction to calculate the num and den. - long MAX = 10; - double eps = (0.5 / (double)0xFF); - long p[MAX], q[MAX], a[MAX], i, numl = 0, denl = 0; - // The first two convergents are 0/1 and 1/0 - p[0] = 0; q[0] = 1; - p[1] = 1; q[1] = 0; - // The rest of the convergents (and continued fraction) - for (i = 2; i < MAX; i++) { - a[i] = lrint(floor(duration)); - p[i] = a[i] * p[i - 1] + p[i - 2]; - q[i] = a[i] * q[i - 1] + q[i - 2]; - if (p[i] <= 0xFF && q[i] <= 0xFF) { // uint16_t - numl = p[i]; - denl = q[i]; - } else break; - if (fabs(duration - a[i]) < eps) break; - duration = 1.0 / (duration - a[i]); - } - - if (numl != 0 && denl != 0) { - *num = numl; - *den = denl; - } else { - *num = 1; - *den = 100; - } - } -} - -// convert fraction to double value -static double yy_png_delay_to_seconds(uint16_t num, uint16_t den) { - if (den == 0) { - return num / 100.0; - } else { - return (double)num / (double)den; - } -} - -static bool yy_png_validate_animation_chunk_order(yy_png_chunk_info *chunks, /* input */ - uint32_t chunk_num, /* input */ - uint32_t *first_idat_index, /* output */ - bool *first_frame_is_cover /* output */) { - /* - PNG at least contains 3 chunks: IHDR, IDAT, IEND. - `IHDR` must appear first. - `IDAT` must appear consecutively. - `IEND` must appear end. - - APNG must contains one `acTL` and at least one 'fcTL' and `fdAT`. - `fdAT` must appear consecutively. - `fcTL` must appear before `IDAT` or `fdAT`. - */ - if (chunk_num <= 2) return false; - if (chunks->fourcc != YY_FOUR_CC('I', 'H', 'D', 'R')) return false; - if ((chunks + chunk_num - 1)->fourcc != YY_FOUR_CC('I', 'E', 'N', 'D')) return false; - - uint32_t prev_fourcc = 0; - uint32_t IHDR_num = 0; - uint32_t IDAT_num = 0; - uint32_t acTL_num = 0; - uint32_t fcTL_num = 0; - uint32_t first_IDAT = 0; - bool first_frame_cover = false; - for (uint32_t i = 0; i < chunk_num; i++) { - yy_png_chunk_info *chunk = chunks + i; - switch (chunk->fourcc) { - case YY_FOUR_CC('I', 'H', 'D', 'R'): { // png header - if (i != 0) return false; - if (IHDR_num > 0) return false; - IHDR_num++; - } break; - case YY_FOUR_CC('I', 'D', 'A', 'T'): { // png data - if (prev_fourcc != YY_FOUR_CC('I', 'D', 'A', 'T')) { - if (IDAT_num == 0) - first_IDAT = i; - else - return false; - } - IDAT_num++; - } break; - case YY_FOUR_CC('a', 'c', 'T', 'L'): { // apng control - if (acTL_num > 0) return false; - acTL_num++; - } break; - case YY_FOUR_CC('f', 'c', 'T', 'L'): { // apng frame control - if (i + 1 == chunk_num) return false; - if ((chunk + 1)->fourcc != YY_FOUR_CC('f', 'd', 'A', 'T') && - (chunk + 1)->fourcc != YY_FOUR_CC('I', 'D', 'A', 'T')) { - return false; - } - if (fcTL_num == 0) { - if ((chunk + 1)->fourcc == YY_FOUR_CC('I', 'D', 'A', 'T')) { - first_frame_cover = true; - } - } - fcTL_num++; - } break; - case YY_FOUR_CC('f', 'd', 'A', 'T'): { // apng data - if (prev_fourcc != YY_FOUR_CC('f', 'd', 'A', 'T') && prev_fourcc != YY_FOUR_CC('f', 'c', 'T', 'L')) { - return false; - } - } break; - } - prev_fourcc = chunk->fourcc; - } - if (IHDR_num != 1) return false; - if (IDAT_num == 0) return false; - if (acTL_num != 1) return false; - if (fcTL_num < acTL_num) return false; - *first_idat_index = first_IDAT; - *first_frame_is_cover = first_frame_cover; - return true; -} - -static void yy_png_info_release(yy_png_info *info) { - if (info) { - if (info->chunks) free(info->chunks); - if (info->apng_frames) free(info->apng_frames); - if (info->apng_shared_chunk_indexs) free(info->apng_shared_chunk_indexs); - free(info); - } -} - -/** - Create a png info from a png file. See struct png_info for more information. - - @param data png/apng file data. - @param length the data's length in bytes. - @return A png info object, you may call yy_png_info_release() to release it. - Returns NULL if an error occurs. - */ -static yy_png_info *yy_png_info_create(const uint8_t *data, uint32_t length) { - if (length < 32) return NULL; - if (*((uint32_t *)data) != YY_FOUR_CC(0x89, 0x50, 0x4E, 0x47)) return NULL; - if (*((uint32_t *)(data + 4)) != YY_FOUR_CC(0x0D, 0x0A, 0x1A, 0x0A)) return NULL; - - uint32_t chunk_realloc_num = 16; - yy_png_chunk_info *chunks = malloc(sizeof(yy_png_chunk_info) * chunk_realloc_num); - if (!chunks) return NULL; - - // parse png chunks - uint32_t offset = 8; - uint32_t chunk_num = 0; - uint32_t chunk_capacity = chunk_realloc_num; - uint32_t apng_loop_num = 0; - int32_t apng_sequence_index = -1; - int32_t apng_frame_index = 0; - int32_t apng_frame_number = -1; - bool apng_chunk_error = false; - do { - if (chunk_num >= chunk_capacity) { - yy_png_chunk_info *new_chunks = realloc(chunks, sizeof(yy_png_chunk_info) * (chunk_capacity + chunk_realloc_num)); - if (!new_chunks) { - free(chunks); - return NULL; - } - chunks = new_chunks; - chunk_capacity += chunk_realloc_num; - } - yy_png_chunk_info *chunk = chunks + chunk_num; - const uint8_t *chunk_data = data + offset; - chunk->offset = offset; - chunk->length = yy_swap_endian_uint32(*((uint32_t *)chunk_data)); - if ((uint64_t)chunk->offset + (uint64_t)chunk->length + 12 > length) { - free(chunks); - return NULL; - } - - chunk->fourcc = *((uint32_t *)(chunk_data + 4)); - if ((uint64_t)chunk->offset + 4 + chunk->length + 4 > (uint64_t)length) break; - chunk->crc32 = yy_swap_endian_uint32(*((uint32_t *)(chunk_data + 8 + chunk->length))); - chunk_num++; - offset += 12 + chunk->length; - - switch (chunk->fourcc) { - case YY_FOUR_CC('a', 'c', 'T', 'L') : { - if (chunk->length == 8) { - apng_frame_number = yy_swap_endian_uint32(*((uint32_t *)(chunk_data + 8))); - apng_loop_num = yy_swap_endian_uint32(*((uint32_t *)(chunk_data + 12))); - } else { - apng_chunk_error = true; - } - } break; - case YY_FOUR_CC('f', 'c', 'T', 'L') : - case YY_FOUR_CC('f', 'd', 'A', 'T') : { - if (chunk->fourcc == YY_FOUR_CC('f', 'c', 'T', 'L')) { - if (chunk->length != 26) { - apng_chunk_error = true; - } else { - apng_frame_index++; - } - } - if (chunk->length > 4) { - uint32_t sequence = yy_swap_endian_uint32(*((uint32_t *)(chunk_data + 8))); - if (apng_sequence_index + 1 == sequence) { - apng_sequence_index++; - } else { - apng_chunk_error = true; - } - } else { - apng_chunk_error = true; - } - } break; - case YY_FOUR_CC('I', 'E', 'N', 'D') : { - offset = length; // end, break do-while loop - } break; - } - } while (offset + 12 <= length); - - if (chunk_num < 3 || - chunks->fourcc != YY_FOUR_CC('I', 'H', 'D', 'R') || - chunks->length != 13) { - free(chunks); - return NULL; - } - - // png info - yy_png_info *info = calloc(1, sizeof(yy_png_info)); - if (!info) { - free(chunks); - return NULL; - } - info->chunks = chunks; - info->chunk_num = chunk_num; - yy_png_chunk_IHDR_read(&info->header, data + chunks->offset + 8); - - // apng info - if (!apng_chunk_error && apng_frame_number == apng_frame_index && apng_frame_number >= 1) { - bool first_frame_is_cover = false; - uint32_t first_IDAT_index = 0; - if (!yy_png_validate_animation_chunk_order(info->chunks, info->chunk_num, &first_IDAT_index, &first_frame_is_cover)) { - return info; // ignore apng chunk - } - - info->apng_loop_num = apng_loop_num; - info->apng_frame_num = apng_frame_number; - info->apng_first_frame_is_cover = first_frame_is_cover; - info->apng_shared_insert_index = first_IDAT_index; - info->apng_frames = calloc(apng_frame_number, sizeof(yy_png_frame_info)); - if (!info->apng_frames) { - yy_png_info_release(info); - return NULL; - } - info->apng_shared_chunk_indexs = calloc(info->chunk_num, sizeof(uint32_t)); - if (!info->apng_shared_chunk_indexs) { - yy_png_info_release(info); - return NULL; - } - - int32_t frame_index = -1; - uint32_t *shared_chunk_index = info->apng_shared_chunk_indexs; - for (int32_t i = 0; i < info->chunk_num; i++) { - yy_png_chunk_info *chunk = info->chunks + i; - switch (chunk->fourcc) { - case YY_FOUR_CC('I', 'D', 'A', 'T'): { - if (info->apng_shared_insert_index == 0) { - info->apng_shared_insert_index = i; - } - if (first_frame_is_cover) { - yy_png_frame_info *frame = info->apng_frames + frame_index; - frame->chunk_num++; - frame->chunk_size += chunk->length + 12; - } - } break; - case YY_FOUR_CC('a', 'c', 'T', 'L'): { - } break; - case YY_FOUR_CC('f', 'c', 'T', 'L'): { - frame_index++; - yy_png_frame_info *frame = info->apng_frames + frame_index; - frame->chunk_index = i + 1; - yy_png_chunk_fcTL_read(&frame->frame_control, data + chunk->offset + 8); - } break; - case YY_FOUR_CC('f', 'd', 'A', 'T'): { - yy_png_frame_info *frame = info->apng_frames + frame_index; - frame->chunk_num++; - frame->chunk_size += chunk->length + 12; - } break; - default: { - *shared_chunk_index = i; - shared_chunk_index++; - info->apng_shared_chunk_size += chunk->length + 12; - info->apng_shared_chunk_num++; - } break; - } - } - } - return info; -} - -/** - Copy a png frame data from an apng file. - - @param data apng file data - @param info png info - @param index frame index (zero-based) - @param size output, the size of the frame data - @return A frame data (single-frame png file), call free() to release the data. - Returns NULL if an error occurs. - */ -static uint8_t *yy_png_copy_frame_data_at_index(const uint8_t *data, - const yy_png_info *info, - const uint32_t index, - uint32_t *size) { - if (index >= info->apng_frame_num) return NULL; - - yy_png_frame_info *frame_info = info->apng_frames + index; - uint32_t frame_remux_size = 8 /* PNG Header */ + info->apng_shared_chunk_size + frame_info->chunk_size; - if (!(info->apng_first_frame_is_cover && index == 0)) { - frame_remux_size -= frame_info->chunk_num * 4; // remove fdAT sequence number - } - uint8_t *frame_data = malloc(frame_remux_size); - if (!frame_data) return NULL; - *size = frame_remux_size; - - uint32_t data_offset = 0; - bool inserted = false; - memcpy(frame_data, data, 8); // PNG File Header - data_offset += 8; - for (uint32_t i = 0; i < info->apng_shared_chunk_num; i++) { - uint32_t shared_chunk_index = info->apng_shared_chunk_indexs[i]; - yy_png_chunk_info *shared_chunk_info = info->chunks + shared_chunk_index; - - if (shared_chunk_index >= info->apng_shared_insert_index && !inserted) { // replace IDAT with fdAT - inserted = true; - for (uint32_t c = 0; c < frame_info->chunk_num; c++) { - yy_png_chunk_info *insert_chunk_info = info->chunks + frame_info->chunk_index + c; - if (insert_chunk_info->fourcc == YY_FOUR_CC('f', 'd', 'A', 'T')) { - *((uint32_t *)(frame_data + data_offset)) = yy_swap_endian_uint32(insert_chunk_info->length - 4); - *((uint32_t *)(frame_data + data_offset + 4)) = YY_FOUR_CC('I', 'D', 'A', 'T'); - memcpy(frame_data + data_offset + 8, data + insert_chunk_info->offset + 12, insert_chunk_info->length - 4); - uint32_t crc = (uint32_t)crc32(0, frame_data + data_offset + 4, insert_chunk_info->length); - *((uint32_t *)(frame_data + data_offset + insert_chunk_info->length + 4)) = yy_swap_endian_uint32(crc); - data_offset += insert_chunk_info->length + 8; - } else { // IDAT - memcpy(frame_data + data_offset, data + insert_chunk_info->offset, insert_chunk_info->length + 12); - data_offset += insert_chunk_info->length + 12; - } - } - } - - if (shared_chunk_info->fourcc == YY_FOUR_CC('I', 'H', 'D', 'R')) { - uint8_t tmp[25] = {0}; - memcpy(tmp, data + shared_chunk_info->offset, 25); - yy_png_chunk_IHDR IHDR = info->header; - IHDR.width = frame_info->frame_control.width; - IHDR.height = frame_info->frame_control.height; - yy_png_chunk_IHDR_write(&IHDR, tmp + 8); - *((uint32_t *)(tmp + 21)) = yy_swap_endian_uint32((uint32_t)crc32(0, tmp + 4, 17)); - memcpy(frame_data + data_offset, tmp, 25); - data_offset += 25; - } else { - memcpy(frame_data + data_offset, data + shared_chunk_info->offset, shared_chunk_info->length + 12); - data_offset += shared_chunk_info->length + 12; - } - } - return frame_data; -} - - - -//////////////////////////////////////////////////////////////////////////////// -#pragma mark - Helper - -/// Returns byte-aligned size. -static inline size_t YYImageByteAlign(size_t size, size_t alignment) { - return ((size + (alignment - 1)) / alignment) * alignment; -} - -/// Convert degree to radians -static inline CGFloat YYImageDegreesToRadians(CGFloat degrees) { - return degrees * M_PI / 180; -} - -CGColorSpaceRef YYCGColorSpaceGetDeviceRGB() { - static CGColorSpaceRef space; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - space = CGColorSpaceCreateDeviceRGB(); - }); - return space; -} - -CGColorSpaceRef YYCGColorSpaceGetDeviceGray() { - static CGColorSpaceRef space; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - space = CGColorSpaceCreateDeviceGray(); - }); - return space; -} - -BOOL YYCGColorSpaceIsDeviceRGB(CGColorSpaceRef space) { - return space && CFEqual(space, YYCGColorSpaceGetDeviceRGB()); -} - -BOOL YYCGColorSpaceIsDeviceGray(CGColorSpaceRef space) { - return space && CFEqual(space, YYCGColorSpaceGetDeviceGray()); -} - -/** - A callback used in CGDataProviderCreateWithData() to release data. - - Example: - - void *data = malloc(size); - CGDataProviderRef provider = CGDataProviderCreateWithData(data, data, size, YYCGDataProviderReleaseDataCallback); - */ -static void YYCGDataProviderReleaseDataCallback(void *info, const void *data, size_t size) { - if (info) free(info); -} - -/** - Decode an image to bitmap buffer with the specified format. - - @param srcImage Source image. - @param dest Destination buffer. It should be zero before call this method. - If decode succeed, you should release the dest->data using free(). - @param destFormat Destination bitmap format. - - @return Whether succeed. - - @warning This method support iOS7.0 and later. If call it on iOS6, it just returns NO. - CG_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) - */ -static BOOL YYCGImageDecodeToBitmapBufferWithAnyFormat(CGImageRef srcImage, vImage_Buffer *dest, vImage_CGImageFormat *destFormat) { - if (!srcImage || (((long)vImageConvert_AnyToAny) + 1 == 1) || !destFormat || !dest) return NO; - size_t width = CGImageGetWidth(srcImage); - size_t height = CGImageGetHeight(srcImage); - if (width == 0 || height == 0) return NO; - dest->data = NULL; - - vImage_Error error = kvImageNoError; - CFDataRef srcData = NULL; - vImageConverterRef convertor = NULL; - vImage_CGImageFormat srcFormat = {0}; - srcFormat.bitsPerComponent = (uint32_t)CGImageGetBitsPerComponent(srcImage); - srcFormat.bitsPerPixel = (uint32_t)CGImageGetBitsPerPixel(srcImage); - srcFormat.colorSpace = CGImageGetColorSpace(srcImage); - srcFormat.bitmapInfo = CGImageGetBitmapInfo(srcImage) | CGImageGetAlphaInfo(srcImage); - - convertor = vImageConverter_CreateWithCGImageFormat(&srcFormat, destFormat, NULL, kvImageNoFlags, NULL); - if (!convertor) goto fail; - - CGDataProviderRef srcProvider = CGImageGetDataProvider(srcImage); - srcData = srcProvider ? CGDataProviderCopyData(srcProvider) : NULL; // decode - size_t srcLength = srcData ? CFDataGetLength(srcData) : 0; - const void *srcBytes = srcData ? CFDataGetBytePtr(srcData) : NULL; - if (srcLength == 0 || !srcBytes) goto fail; - - vImage_Buffer src = {0}; - src.data = (void *)srcBytes; - src.width = width; - src.height = height; - src.rowBytes = CGImageGetBytesPerRow(srcImage); - - error = vImageBuffer_Init(dest, height, width, 32, kvImageNoFlags); - if (error != kvImageNoError) goto fail; - - error = vImageConvert_AnyToAny(convertor, &src, dest, NULL, kvImageNoFlags); // convert - if (error != kvImageNoError) goto fail; - - CFRelease(convertor); - CFRelease(srcData); - return YES; - -fail: - if (convertor) CFRelease(convertor); - if (srcData) CFRelease(srcData); - if (dest->data) free(dest->data); - dest->data = NULL; - return NO; -} - -/** - Decode an image to bitmap buffer with the 32bit format (such as ARGB8888). - - @param srcImage Source image. - @param dest Destination buffer. It should be zero before call this method. - If decode succeed, you should release the dest->data using free(). - @param bitmapInfo Destination bitmap format. - - @return Whether succeed. - */ -static BOOL YYCGImageDecodeToBitmapBufferWith32BitFormat(CGImageRef srcImage, vImage_Buffer *dest, CGBitmapInfo bitmapInfo) { - if (!srcImage || !dest) return NO; - size_t width = CGImageGetWidth(srcImage); - size_t height = CGImageGetHeight(srcImage); - if (width == 0 || height == 0) return NO; - - BOOL hasAlpha = NO; - BOOL alphaFirst = NO; - BOOL alphaPremultiplied = NO; - BOOL byteOrderNormal = NO; - - switch (bitmapInfo & kCGBitmapAlphaInfoMask) { - case kCGImageAlphaPremultipliedLast: { - hasAlpha = YES; - alphaPremultiplied = YES; - } break; - case kCGImageAlphaPremultipliedFirst: { - hasAlpha = YES; - alphaPremultiplied = YES; - alphaFirst = YES; - } break; - case kCGImageAlphaLast: { - hasAlpha = YES; - } break; - case kCGImageAlphaFirst: { - hasAlpha = YES; - alphaFirst = YES; - } break; - case kCGImageAlphaNoneSkipLast: { - } break; - case kCGImageAlphaNoneSkipFirst: { - alphaFirst = YES; - } break; - default: { - return NO; - } break; - } - - switch (bitmapInfo & kCGBitmapByteOrderMask) { - case kCGBitmapByteOrderDefault: { - byteOrderNormal = YES; - } break; - case kCGBitmapByteOrder32Little: { - } break; - case kCGBitmapByteOrder32Big: { - byteOrderNormal = YES; - } break; - default: { - return NO; - } break; - } - - /* - Try convert with vImageConvert_AnyToAny() (avaliable since iOS 7.0). - If fail, try decode with CGContextDrawImage(). - CGBitmapContext use a premultiplied alpha format, unpremultiply may lose precision. - */ - vImage_CGImageFormat destFormat = {0}; - destFormat.bitsPerComponent = 8; - destFormat.bitsPerPixel = 32; - destFormat.colorSpace = YYCGColorSpaceGetDeviceRGB(); - destFormat.bitmapInfo = bitmapInfo; - dest->data = NULL; - if (YYCGImageDecodeToBitmapBufferWithAnyFormat(srcImage, dest, &destFormat)) return YES; - - CGBitmapInfo contextBitmapInfo = bitmapInfo & kCGBitmapByteOrderMask; - if (!hasAlpha || alphaPremultiplied) { - contextBitmapInfo |= (bitmapInfo & kCGBitmapAlphaInfoMask); - } else { - contextBitmapInfo |= alphaFirst ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaPremultipliedLast; - } - CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, YYCGColorSpaceGetDeviceRGB(), contextBitmapInfo); - if (!context) goto fail; - - CGContextDrawImage(context, CGRectMake(0, 0, width, height), srcImage); // decode and convert - size_t bytesPerRow = CGBitmapContextGetBytesPerRow(context); - size_t length = height * bytesPerRow; - void *data = CGBitmapContextGetData(context); - if (length == 0 || !data) goto fail; - - dest->data = malloc(length); - dest->width = width; - dest->height = height; - dest->rowBytes = bytesPerRow; - if (!dest->data) goto fail; - - if (hasAlpha && !alphaPremultiplied) { - vImage_Buffer tmpSrc = {0}; - tmpSrc.data = data; - tmpSrc.width = width; - tmpSrc.height = height; - tmpSrc.rowBytes = bytesPerRow; - vImage_Error error; - if (alphaFirst && byteOrderNormal) { - error = vImageUnpremultiplyData_ARGB8888(&tmpSrc, dest, kvImageNoFlags); - } else { - error = vImageUnpremultiplyData_RGBA8888(&tmpSrc, dest, kvImageNoFlags); - } - if (error != kvImageNoError) goto fail; - } else { - memcpy(dest->data, data, length); - } - - CFRelease(context); - return YES; - -fail: - if (context) CFRelease(context); - if (dest->data) free(dest->data); - dest->data = NULL; - return NO; - return NO; -} - -CGImageRef YYCGImageCreateDecodedCopy(CGImageRef imageRef, BOOL decodeForDisplay) { - if (!imageRef) return NULL; - size_t width = CGImageGetWidth(imageRef); - size_t height = CGImageGetHeight(imageRef); - if (width == 0 || height == 0) return NULL; - - if (decodeForDisplay) { //decode with redraw (may lose some precision) - CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef) & kCGBitmapAlphaInfoMask; - BOOL hasAlpha = NO; - if (alphaInfo == kCGImageAlphaPremultipliedLast || - alphaInfo == kCGImageAlphaPremultipliedFirst || - alphaInfo == kCGImageAlphaLast || - alphaInfo == kCGImageAlphaFirst) { - hasAlpha = YES; - } - // BGRA8888 (premultiplied) or BGRX8888 - // same as UIGraphicsBeginImageContext() and -[UIView drawRect:] - CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host; - bitmapInfo |= hasAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst; - CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, YYCGColorSpaceGetDeviceRGB(), bitmapInfo); - if (!context) return NULL; - CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); // decode - CGImageRef newImage = CGBitmapContextCreateImage(context); - CFRelease(context); - return newImage; - - } else { - CGColorSpaceRef space = CGImageGetColorSpace(imageRef); - size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef); - size_t bitsPerPixel = CGImageGetBitsPerPixel(imageRef); - size_t bytesPerRow = CGImageGetBytesPerRow(imageRef); - CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); - if (bytesPerRow == 0 || width == 0 || height == 0) return NULL; - - CGDataProviderRef dataProvider = CGImageGetDataProvider(imageRef); - if (!dataProvider) return NULL; - CFDataRef data = CGDataProviderCopyData(dataProvider); // decode - if (!data) return NULL; - - CGDataProviderRef newProvider = CGDataProviderCreateWithCFData(data); - CFRelease(data); - if (!newProvider) return NULL; - - CGImageRef newImage = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, space, bitmapInfo, newProvider, NULL, false, kCGRenderingIntentDefault); - CFRelease(newProvider); - return newImage; - } -} - -CGImageRef YYCGImageCreateAffineTransformCopy(CGImageRef imageRef, CGAffineTransform transform, CGSize destSize, CGBitmapInfo destBitmapInfo) { - if (!imageRef) return NULL; - size_t srcWidth = CGImageGetWidth(imageRef); - size_t srcHeight = CGImageGetHeight(imageRef); - size_t destWidth = round(destSize.width); - size_t destHeight = round(destSize.height); - if (srcWidth == 0 || srcHeight == 0 || destWidth == 0 || destHeight == 0) return NULL; - - CGDataProviderRef tmpProvider = NULL, destProvider = NULL; - CGImageRef tmpImage = NULL, destImage = NULL; - vImage_Buffer src = {0}, tmp = {0}, dest = {0}; - if(!YYCGImageDecodeToBitmapBufferWith32BitFormat(imageRef, &src, kCGImageAlphaFirst | kCGBitmapByteOrderDefault)) return NULL; - - size_t destBytesPerRow = YYImageByteAlign(destWidth * 4, 32); - tmp.data = malloc(destHeight * destBytesPerRow); - if (!tmp.data) goto fail; - - tmp.width = destWidth; - tmp.height = destHeight; - tmp.rowBytes = destBytesPerRow; - vImage_CGAffineTransform vTransform = *((vImage_CGAffineTransform *)&transform); - uint8_t backColor[4] = {0}; - vImage_Error error = vImageAffineWarpCG_ARGB8888(&src, &tmp, NULL, &vTransform, backColor, kvImageBackgroundColorFill); - if (error != kvImageNoError) goto fail; - free(src.data); - src.data = NULL; - - tmpProvider = CGDataProviderCreateWithData(tmp.data, tmp.data, destHeight * destBytesPerRow, YYCGDataProviderReleaseDataCallback); - if (!tmpProvider) goto fail; - tmp.data = NULL; // hold by provider - tmpImage = CGImageCreate(destWidth, destHeight, 8, 32, destBytesPerRow, YYCGColorSpaceGetDeviceRGB(), kCGImageAlphaFirst | kCGBitmapByteOrderDefault, tmpProvider, NULL, false, kCGRenderingIntentDefault); - if (!tmpImage) goto fail; - CFRelease(tmpProvider); - tmpProvider = NULL; - - if ((destBitmapInfo & kCGBitmapAlphaInfoMask) == kCGImageAlphaFirst && - (destBitmapInfo & kCGBitmapByteOrderMask) != kCGBitmapByteOrder32Little) { - return tmpImage; - } - - if (!YYCGImageDecodeToBitmapBufferWith32BitFormat(tmpImage, &dest, destBitmapInfo)) goto fail; - CFRelease(tmpImage); - tmpImage = NULL; - - destProvider = CGDataProviderCreateWithData(dest.data, dest.data, destHeight * destBytesPerRow, YYCGDataProviderReleaseDataCallback); - if (!destProvider) goto fail; - dest.data = NULL; // hold by provider - destImage = CGImageCreate(destWidth, destHeight, 8, 32, destBytesPerRow, YYCGColorSpaceGetDeviceRGB(), destBitmapInfo, destProvider, NULL, false, kCGRenderingIntentDefault); - if (!destImage) goto fail; - CFRelease(destProvider); - destProvider = NULL; - - return destImage; - -fail: - if (src.data) free(src.data); - if (tmp.data) free(tmp.data); - if (dest.data) free(dest.data); - if (tmpProvider) CFRelease(tmpProvider); - if (tmpImage) CFRelease(tmpImage); - if (destProvider) CFRelease(destProvider); - return NULL; -} - -UIImageOrientation YYUIImageOrientationFromEXIFValue(NSInteger value) { - switch (value) { - case kCGImagePropertyOrientationUp: return UIImageOrientationUp; - case kCGImagePropertyOrientationDown: return UIImageOrientationDown; - case kCGImagePropertyOrientationLeft: return UIImageOrientationLeft; - case kCGImagePropertyOrientationRight: return UIImageOrientationRight; - case kCGImagePropertyOrientationUpMirrored: return UIImageOrientationUpMirrored; - case kCGImagePropertyOrientationDownMirrored: return UIImageOrientationDownMirrored; - case kCGImagePropertyOrientationLeftMirrored: return UIImageOrientationLeftMirrored; - case kCGImagePropertyOrientationRightMirrored: return UIImageOrientationRightMirrored; - default: return UIImageOrientationUp; - } -} - -NSInteger YYUIImageOrientationToEXIFValue(UIImageOrientation orientation) { - switch (orientation) { - case UIImageOrientationUp: return kCGImagePropertyOrientationUp; - case UIImageOrientationDown: return kCGImagePropertyOrientationDown; - case UIImageOrientationLeft: return kCGImagePropertyOrientationLeft; - case UIImageOrientationRight: return kCGImagePropertyOrientationRight; - case UIImageOrientationUpMirrored: return kCGImagePropertyOrientationUpMirrored; - case UIImageOrientationDownMirrored: return kCGImagePropertyOrientationDownMirrored; - case UIImageOrientationLeftMirrored: return kCGImagePropertyOrientationLeftMirrored; - case UIImageOrientationRightMirrored: return kCGImagePropertyOrientationRightMirrored; - default: return kCGImagePropertyOrientationUp; - } -} - -CGImageRef YYCGImageCreateCopyWithOrientation(CGImageRef imageRef, UIImageOrientation orientation, CGBitmapInfo destBitmapInfo) { - if (!imageRef) return NULL; - if (orientation == UIImageOrientationUp) return (CGImageRef)CFRetain(imageRef); - - size_t width = CGImageGetWidth(imageRef); - size_t height = CGImageGetHeight(imageRef); - - CGAffineTransform transform = CGAffineTransformIdentity; - BOOL swapWidthAndHeight = NO; - switch (orientation) { - case UIImageOrientationDown: { - transform = CGAffineTransformMakeRotation(YYImageDegreesToRadians(180)); - transform = CGAffineTransformTranslate(transform, -(CGFloat)width, -(CGFloat)height); - } break; - case UIImageOrientationLeft: { - transform = CGAffineTransformMakeRotation(YYImageDegreesToRadians(90)); - transform = CGAffineTransformTranslate(transform, -(CGFloat)0, -(CGFloat)height); - swapWidthAndHeight = YES; - } break; - case UIImageOrientationRight: { - transform = CGAffineTransformMakeRotation(YYImageDegreesToRadians(-90)); - transform = CGAffineTransformTranslate(transform, -(CGFloat)width, (CGFloat)0); - swapWidthAndHeight = YES; - } break; - case UIImageOrientationUpMirrored: { - transform = CGAffineTransformTranslate(transform, (CGFloat)width, 0); - transform = CGAffineTransformScale(transform, -1, 1); - } break; - case UIImageOrientationDownMirrored: { - transform = CGAffineTransformTranslate(transform, 0, (CGFloat)height); - transform = CGAffineTransformScale(transform, 1, -1); - } break; - case UIImageOrientationLeftMirrored: { - transform = CGAffineTransformMakeRotation(YYImageDegreesToRadians(-90)); - transform = CGAffineTransformScale(transform, 1, -1); - transform = CGAffineTransformTranslate(transform, -(CGFloat)width, -(CGFloat)height); - swapWidthAndHeight = YES; - } break; - case UIImageOrientationRightMirrored: { - transform = CGAffineTransformMakeRotation(YYImageDegreesToRadians(90)); - transform = CGAffineTransformScale(transform, 1, -1); - swapWidthAndHeight = YES; - } break; - default: break; - } - if (CGAffineTransformIsIdentity(transform)) return (CGImageRef)CFRetain(imageRef); - - CGSize destSize = {width, height}; - if (swapWidthAndHeight) { - destSize.width = height; - destSize.height = width; - } - - return YYCGImageCreateAffineTransformCopy(imageRef, transform, destSize, destBitmapInfo); -} - -YYImageType YYImageDetectType(CFDataRef data) { - if (!data) return YYImageTypeUnknown; - uint64_t length = CFDataGetLength(data); - if (length < 16) return YYImageTypeUnknown; - - const char *bytes = (char *)CFDataGetBytePtr(data); - - uint32_t magic4 = *((uint32_t *)bytes); - switch (magic4) { - case YY_FOUR_CC(0x4D, 0x4D, 0x00, 0x2A): { // big endian TIFF - return YYImageTypeTIFF; - } break; - - case YY_FOUR_CC(0x49, 0x49, 0x2A, 0x00): { // little endian TIFF - return YYImageTypeTIFF; - } break; - - case YY_FOUR_CC(0x00, 0x00, 0x01, 0x00): { // ICO - return YYImageTypeICO; - } break; - - case YY_FOUR_CC(0x00, 0x00, 0x02, 0x00): { // CUR - return YYImageTypeICO; - } break; - - case YY_FOUR_CC('i', 'c', 'n', 's'): { // ICNS - return YYImageTypeICNS; - } break; - - case YY_FOUR_CC('G', 'I', 'F', '8'): { // GIF - return YYImageTypeGIF; - } break; - - case YY_FOUR_CC(0x89, 'P', 'N', 'G'): { // PNG - uint32_t tmp = *((uint32_t *)(bytes + 4)); - if (tmp == YY_FOUR_CC('\r', '\n', 0x1A, '\n')) { - return YYImageTypePNG; - } - } break; - - case YY_FOUR_CC('R', 'I', 'F', 'F'): { // WebP - uint32_t tmp = *((uint32_t *)(bytes + 8)); - if (tmp == YY_FOUR_CC('W', 'E', 'B', 'P')) { - return YYImageTypeWebP; - } - } break; - /* - case YY_FOUR_CC('B', 'P', 'G', 0xFB): { // BPG - return YYImageTypeBPG; - } break; - */ - } - - uint16_t magic2 = *((uint16_t *)bytes); - switch (magic2) { - case YY_TWO_CC('B', 'A'): - case YY_TWO_CC('B', 'M'): - case YY_TWO_CC('I', 'C'): - case YY_TWO_CC('P', 'I'): - case YY_TWO_CC('C', 'I'): - case YY_TWO_CC('C', 'P'): { // BMP - return YYImageTypeBMP; - } - case YY_TWO_CC(0xFF, 0x4F): { // JPEG2000 - return YYImageTypeJPEG2000; - } - } - - // JPG FF D8 FF - if (memcmp(bytes,"\377\330\377",3) == 0) return YYImageTypeJPEG; - - // JP2 - if (memcmp(bytes + 4, "\152\120\040\040\015", 5) == 0) return YYImageTypeJPEG2000; - - return YYImageTypeUnknown; -} - -CFStringRef YYImageTypeToUTType(YYImageType type) { - switch (type) { - case YYImageTypeJPEG: return kUTTypeJPEG; - case YYImageTypeJPEG2000: return kUTTypeJPEG2000; - case YYImageTypeTIFF: return kUTTypeTIFF; - case YYImageTypeBMP: return kUTTypeBMP; - case YYImageTypeICO: return kUTTypeICO; - case YYImageTypeICNS: return kUTTypeAppleICNS; - case YYImageTypeGIF: return kUTTypeGIF; - case YYImageTypePNG: return kUTTypePNG; - default: return NULL; - } -} - -YYImageType YYImageTypeFromUTType(CFStringRef uti) { - static NSDictionary *dic; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - dic = @{(id)kUTTypeJPEG : @(YYImageTypeJPEG), - (id)kUTTypeJPEG2000 : @(YYImageTypeJPEG2000), - (id)kUTTypeTIFF : @(YYImageTypeTIFF), - (id)kUTTypeBMP : @(YYImageTypeBMP), - (id)kUTTypeICO : @(YYImageTypeICO), - (id)kUTTypeAppleICNS : @(YYImageTypeICNS), - (id)kUTTypeGIF : @(YYImageTypeGIF), - (id)kUTTypePNG : @(YYImageTypePNG)}; - }); - if (!uti) return YYImageTypeUnknown; - NSNumber *num = dic[(__bridge __strong id)(uti)]; - return num.unsignedIntegerValue; -} - -NSString *YYImageTypeGetExtension(YYImageType type) { - switch (type) { - case YYImageTypeJPEG: return @"jpg"; - case YYImageTypeJPEG2000: return @"jp2"; - case YYImageTypeTIFF: return @"tiff"; - case YYImageTypeBMP: return @"bmp"; - case YYImageTypeICO: return @"ico"; - case YYImageTypeICNS: return @"icns"; - case YYImageTypeGIF: return @"gif"; - case YYImageTypePNG: return @"png"; - case YYImageTypeWebP: return @"webp"; - default: return nil; - } -} - -CFDataRef YYCGImageCreateEncodedData(CGImageRef imageRef, YYImageType type, CGFloat quality) { - if (!imageRef) return nil; - quality = quality < 0 ? 0 : quality > 1 ? 1 : quality; - - if (type == YYImageTypeWebP) { -#if YYIMAGE_WEBP_ENABLED - if (quality == 1) { - return YYCGImageCreateEncodedWebPData(imageRef, YES, quality, 4, YYImagePresetDefault); - } else { - return YYCGImageCreateEncodedWebPData(imageRef, NO, quality, 4, YYImagePresetDefault); - } -#else - return NULL; -#endif - } - - CFStringRef uti = YYImageTypeToUTType(type); - if (!uti) return nil; - - CFMutableDataRef data = CFDataCreateMutable(CFAllocatorGetDefault(), 0); - if (!data) return NULL; - CGImageDestinationRef dest = CGImageDestinationCreateWithData(data, uti, 1, NULL); - if (!dest) { - CFRelease(data); - return NULL; - } - NSDictionary *options = @{(id)kCGImageDestinationLossyCompressionQuality : @(quality) }; - CGImageDestinationAddImage(dest, imageRef, (CFDictionaryRef)options); - if (!CGImageDestinationFinalize(dest)) { - CFRelease(data); - CFRelease(dest); - return nil; - } - CFRelease(dest); - - if (CFDataGetLength(data) == 0) { - CFRelease(data); - return NULL; - } - return data; -} - -#if YYIMAGE_WEBP_ENABLED - -BOOL YYImageWebPAvailable() { - return YES; -} - -CFDataRef YYCGImageCreateEncodedWebPData(CGImageRef imageRef, BOOL lossless, CGFloat quality, int compressLevel, YYImagePreset preset) { - if (!imageRef) return nil; - size_t width = CGImageGetWidth(imageRef); - size_t height = CGImageGetHeight(imageRef); - if (width == 0 || width > WEBP_MAX_DIMENSION) return nil; - if (height == 0 || height > WEBP_MAX_DIMENSION) return nil; - - vImage_Buffer buffer = {0}; - if(!YYCGImageDecodeToBitmapBufferWith32BitFormat(imageRef, &buffer, kCGImageAlphaLast | kCGBitmapByteOrderDefault)) return nil; - - WebPConfig config = {0}; - WebPPicture picture = {0}; - WebPMemoryWriter writer = {0}; - CFDataRef webpData = NULL; - BOOL pictureNeedFree = NO; - - quality = quality < 0 ? 0 : quality > 1 ? 1 : quality; - preset = preset > YYImagePresetText ? YYImagePresetDefault : preset; - compressLevel = compressLevel < 0 ? 0 : compressLevel > 6 ? 6 : compressLevel; - if (!WebPConfigPreset(&config, (WebPPreset)preset, quality)) goto fail; - - config.quality = round(quality * 100.0); - config.lossless = lossless; - config.method = compressLevel; - switch ((WebPPreset)preset) { - case WEBP_PRESET_DEFAULT: { - config.image_hint = WEBP_HINT_DEFAULT; - } break; - case WEBP_PRESET_PICTURE: { - config.image_hint = WEBP_HINT_PICTURE; - } break; - case WEBP_PRESET_PHOTO: { - config.image_hint = WEBP_HINT_PHOTO; - } break; - case WEBP_PRESET_DRAWING: - case WEBP_PRESET_ICON: - case WEBP_PRESET_TEXT: { - config.image_hint = WEBP_HINT_GRAPH; - } break; - } - if (!WebPValidateConfig(&config)) goto fail; - - if (!WebPPictureInit(&picture)) goto fail; - pictureNeedFree = YES; - picture.width = (int)buffer.width; - picture.height = (int)buffer.height; - picture.use_argb = lossless; - if(!WebPPictureImportRGBA(&picture, buffer.data, (int)buffer.rowBytes)) goto fail; - - WebPMemoryWriterInit(&writer); - picture.writer = WebPMemoryWrite; - picture.custom_ptr = &writer; - if(!WebPEncode(&config, &picture)) goto fail; - - webpData = CFDataCreate(CFAllocatorGetDefault(), writer.mem, writer.size); - free(writer.mem); - WebPPictureFree(&picture); - free(buffer.data); - return webpData; - -fail: - if (buffer.data) free(buffer.data); - if (pictureNeedFree) WebPPictureFree(&picture); - return nil; -} - -NSUInteger YYImageGetWebPFrameCount(CFDataRef webpData) { - if (!webpData || CFDataGetLength(webpData) == 0) return 0; - - WebPData data = {CFDataGetBytePtr(webpData), CFDataGetLength(webpData)}; - WebPDemuxer *demuxer = WebPDemux(&data); - if (!demuxer) return 0; - NSUInteger webpFrameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT); - WebPDemuxDelete(demuxer); - return webpFrameCount; -} - -CGImageRef YYCGImageCreateWithWebPData(CFDataRef webpData, - BOOL decodeForDisplay, - BOOL useThreads, - BOOL bypassFiltering, - BOOL noFancyUpsampling) { - /* - Call WebPDecode() on a multi-frame webp data will get an error (VP8_STATUS_UNSUPPORTED_FEATURE). - Use WebPDemuxer to unpack it first. - */ - WebPData data = {0}; - WebPDemuxer *demuxer = NULL; - - int frameCount = 0, canvasWidth = 0, canvasHeight = 0; - WebPIterator iter = {0}; - BOOL iterInited = NO; - const uint8_t *payload = NULL; - size_t payloadSize = 0; - WebPDecoderConfig config = {0}; - - BOOL hasAlpha = NO; - size_t bitsPerComponent = 0, bitsPerPixel = 0, bytesPerRow = 0, destLength = 0; - CGBitmapInfo bitmapInfo = 0; - WEBP_CSP_MODE colorspace = 0; - void *destBytes = NULL; - CGDataProviderRef provider = NULL; - CGImageRef imageRef = NULL; - - if (!webpData || CFDataGetLength(webpData) == 0) return NULL; - data.bytes = CFDataGetBytePtr(webpData); - data.size = CFDataGetLength(webpData); - demuxer = WebPDemux(&data); - if (!demuxer) goto fail; - - frameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT); - if (frameCount == 0) { - goto fail; - - } else if (frameCount == 1) { // single-frame - payload = data.bytes; - payloadSize = data.size; - if (!WebPInitDecoderConfig(&config)) goto fail; - if (WebPGetFeatures(payload , payloadSize, &config.input) != VP8_STATUS_OK) goto fail; - canvasWidth = config.input.width; - canvasHeight = config.input.height; - - } else { // multi-frame - canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH); - canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT); - if (canvasWidth < 1 || canvasHeight < 1) goto fail; - - if (!WebPDemuxGetFrame(demuxer, 1, &iter)) goto fail; - iterInited = YES; - - if (iter.width > canvasWidth || iter.height > canvasHeight) goto fail; - payload = iter.fragment.bytes; - payloadSize = iter.fragment.size; - - if (!WebPInitDecoderConfig(&config)) goto fail; - if (WebPGetFeatures(payload , payloadSize, &config.input) != VP8_STATUS_OK) goto fail; - } - if (payload == NULL || payloadSize == 0) goto fail; - - hasAlpha = config.input.has_alpha; - bitsPerComponent = 8; - bitsPerPixel = 32; - bytesPerRow = YYImageByteAlign(bitsPerPixel / 8 * canvasWidth, 32); - destLength = bytesPerRow * canvasHeight; - if (decodeForDisplay) { - bitmapInfo = kCGBitmapByteOrder32Host; - bitmapInfo |= hasAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst; - colorspace = MODE_bgrA; // small endian - } else { - bitmapInfo = kCGBitmapByteOrderDefault; - bitmapInfo |= hasAlpha ? kCGImageAlphaLast : kCGImageAlphaNoneSkipLast; - colorspace = MODE_RGBA; - } - destBytes = calloc(1, destLength); - if (!destBytes) goto fail; - - config.options.use_threads = useThreads; //speed up 23% - config.options.bypass_filtering = bypassFiltering; //speed up 11%, cause some banding - config.options.no_fancy_upsampling = noFancyUpsampling; //speed down 16%, lose some details - config.output.colorspace = colorspace; - config.output.is_external_memory = 1; - config.output.u.RGBA.rgba = destBytes; - config.output.u.RGBA.stride = (int)bytesPerRow; - config.output.u.RGBA.size = destLength; - - VP8StatusCode result = WebPDecode(payload, payloadSize, &config); - if ((result != VP8_STATUS_OK) && (result != VP8_STATUS_NOT_ENOUGH_DATA)) goto fail; - - if (iter.x_offset != 0 || iter.y_offset != 0) { - void *tmp = calloc(1, destLength); - if (tmp) { - vImage_Buffer src = {destBytes, canvasHeight, canvasWidth, bytesPerRow}; - vImage_Buffer dest = {tmp, canvasHeight, canvasWidth, bytesPerRow}; - vImage_CGAffineTransform transform = {1, 0, 0, 1, iter.x_offset, -iter.y_offset}; - uint8_t backColor[4] = {0}; - vImageAffineWarpCG_ARGB8888(&src, &dest, NULL, &transform, backColor, kvImageBackgroundColorFill); - memcpy(destBytes, tmp, destLength); - free(tmp); - } - } - - provider = CGDataProviderCreateWithData(destBytes, destBytes, destLength, YYCGDataProviderReleaseDataCallback); - if (!provider) goto fail; - destBytes = NULL; // hold by provider - - imageRef = CGImageCreate(canvasWidth, canvasHeight, bitsPerComponent, bitsPerPixel, bytesPerRow, YYCGColorSpaceGetDeviceRGB(), bitmapInfo, provider, NULL, false, kCGRenderingIntentDefault); - - CFRelease(provider); - if (iterInited) WebPDemuxReleaseIterator(&iter); - WebPDemuxDelete(demuxer); - - return imageRef; - -fail: - if (destBytes) free(destBytes); - if (provider) CFRelease(provider); - if (iterInited) WebPDemuxReleaseIterator(&iter); - if (demuxer) WebPDemuxDelete(demuxer); - return NULL; -} - -#else - -BOOL YYImageWebPAvailable() { - return NO; -} - -CFDataRef YYCGImageCreateEncodedWebPData(CGImageRef imageRef, BOOL lossless, CGFloat quality, int compressLevel, YYImagePreset preset) { - NSLog(@"WebP decoder is disabled"); - return NULL; -} - -NSUInteger YYImageGetWebPFrameCount(CFDataRef webpData) { - NSLog(@"WebP decoder is disabled"); - return 0; -} - -CGImageRef YYCGImageCreateWithWebPData(CFDataRef webpData, - BOOL decodeForDisplay, - BOOL useThreads, - BOOL bypassFiltering, - BOOL noFancyUpsampling) { - NSLog(@"WebP decoder is disabled"); - return NULL; -} - -#endif - - -//////////////////////////////////////////////////////////////////////////////// -#pragma mark - Decoder - -@implementation YYImageFrame -+ (instancetype)frameWithImage:(UIImage *)image { - YYImageFrame *frame = [self new]; - frame.image = image; - return frame; -} -- (id)copyWithZone:(NSZone *)zone { - YYImageFrame *frame = [self.class new]; - frame.index = _index; - frame.width = _width; - frame.height = _height; - frame.offsetX = _offsetX; - frame.offsetY = _offsetY; - frame.duration = _duration; - frame.dispose = _dispose; - frame.blend = _blend; - frame.image = _image.copy; - return frame; -} -@end - -// Internal frame object. -@interface _YYImageDecoderFrame : YYImageFrame -@property (nonatomic, assign) BOOL hasAlpha; ///< Whether frame has alpha. -@property (nonatomic, assign) BOOL isFullSize; ///< Whether frame fill the canvas. -@property (nonatomic, assign) NSUInteger blendFromIndex; ///< Blend from frame index to current frame. -@end - -@implementation _YYImageDecoderFrame -- (id)copyWithZone:(NSZone *)zone { - _YYImageDecoderFrame *frame = [super copyWithZone:zone]; - frame.hasAlpha = _hasAlpha; - frame.isFullSize = _isFullSize; - frame.blendFromIndex = _blendFromIndex; - return frame; -} -@end - - -@implementation YYImageDecoder { - pthread_mutex_t _lock; // recursive lock - - BOOL _sourceTypeDetected; - CGImageSourceRef _source; - yy_png_info *_apngSource; -#if YYIMAGE_WEBP_ENABLED - WebPDemuxer *_webpSource; -#endif - - UIImageOrientation _orientation; - dispatch_semaphore_t _framesLock; - NSArray *_frames; ///< Array, without image - BOOL _needBlend; - NSUInteger _blendFrameIndex; - CGContextRef _blendCanvas; -} - -- (void)dealloc { - if (_source) CFRelease(_source); - if (_apngSource) yy_png_info_release(_apngSource); -#if YYIMAGE_WEBP_ENABLED - if (_webpSource) WebPDemuxDelete(_webpSource); -#endif - if (_blendCanvas) CFRelease(_blendCanvas); - pthread_mutex_destroy(&_lock); -} - -+ (instancetype)decoderWithData:(NSData *)data scale:(CGFloat)scale { - if (!data) return nil; - YYImageDecoder *decoder = [[YYImageDecoder alloc] initWithScale:scale]; - [decoder updateData:data final:YES]; - if (decoder.frameCount == 0) return nil; - return decoder; -} - -- (instancetype)init { - return [self initWithScale:[UIScreen mainScreen].scale]; -} - -- (instancetype)initWithScale:(CGFloat)scale { - self = [super init]; - if (scale <= 0) scale = 1; - _scale = scale; - _framesLock = dispatch_semaphore_create(1); - - pthread_mutexattr_t attr; - pthread_mutexattr_init (&attr); - pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init (&_lock, &attr); - pthread_mutexattr_destroy (&attr); - - return self; -} - -- (BOOL)updateData:(NSData *)data final:(BOOL)final { - BOOL result = NO; - pthread_mutex_lock(&_lock); - result = [self _updateData:data final:final]; - pthread_mutex_unlock(&_lock); - return result; -} - -- (YYImageFrame *)frameAtIndex:(NSUInteger)index decodeForDisplay:(BOOL)decodeForDisplay { - YYImageFrame *result = nil; - pthread_mutex_lock(&_lock); - result = [self _frameAtIndex:index decodeForDisplay:decodeForDisplay]; - pthread_mutex_unlock(&_lock); - return result; -} - -- (NSTimeInterval)frameDurationAtIndex:(NSUInteger)index { - NSTimeInterval result = 0; - dispatch_semaphore_wait(_framesLock, DISPATCH_TIME_FOREVER); - if (index < _frames.count) { - result = ((_YYImageDecoderFrame *)_frames[index]).duration; - } - dispatch_semaphore_signal(_framesLock); - return result; -} - -- (NSDictionary *)framePropertiesAtIndex:(NSUInteger)index { - NSDictionary *result = nil; - pthread_mutex_lock(&_lock); - result = [self _framePropertiesAtIndex:index]; - pthread_mutex_unlock(&_lock); - return result; -} - -- (NSDictionary *)imageProperties { - NSDictionary *result = nil; - pthread_mutex_lock(&_lock); - result = [self _imageProperties]; - pthread_mutex_unlock(&_lock); - return result; -} - -#pragma private (wrap) - -- (BOOL)_updateData:(NSData *)data final:(BOOL)final { - if (_finalized) return NO; - if (data.length < _data.length) return NO; - _finalized = final; - _data = data; - - YYImageType type = YYImageDetectType((__bridge CFDataRef)data); - if (_sourceTypeDetected) { - if (_type != type) { - return NO; - } else { - [self _updateSource]; - } - } else { - if (_data.length > 16) { - _type = type; - _sourceTypeDetected = YES; - [self _updateSource]; - } - } - return YES; -} - -- (YYImageFrame *)_frameAtIndex:(NSUInteger)index decodeForDisplay:(BOOL)decodeForDisplay { - if (index >= _frames.count) return 0; - _YYImageDecoderFrame *frame = [(_YYImageDecoderFrame *)_frames[index] copy]; - BOOL decoded = NO; - BOOL extendToCanvas = NO; - if (_type != YYImageTypeICO && decodeForDisplay) { // ICO contains multi-size frame and should not extend to canvas. - extendToCanvas = YES; - } - - if (!_needBlend) { - CGImageRef imageRef = [self _newUnblendedImageAtIndex:index extendToCanvas:extendToCanvas decoded:&decoded]; - if (!imageRef) return nil; - if (decodeForDisplay && !decoded) { - CGImageRef imageRefDecoded = YYCGImageCreateDecodedCopy(imageRef, YES); - if (imageRefDecoded) { - CFRelease(imageRef); - imageRef = imageRefDecoded; - decoded = YES; - } - } - UIImage *image = [UIImage imageWithCGImage:imageRef scale:_scale orientation:_orientation]; - CFRelease(imageRef); - if (!image) return nil; - image.yy_isDecodedForDisplay = decoded; - frame.image = image; - return frame; - } - - // blend - if (![self _createBlendContextIfNeeded]) return nil; - CGImageRef imageRef = NULL; - - if (_blendFrameIndex + 1 == frame.index) { - imageRef = [self _newBlendedImageWithFrame:frame]; - _blendFrameIndex = index; - } else { // should draw canvas from previous frame - _blendFrameIndex = NSNotFound; - CGContextClearRect(_blendCanvas, CGRectMake(0, 0, _width, _height)); - - if (frame.blendFromIndex == frame.index) { - CGImageRef unblendedImage = [self _newUnblendedImageAtIndex:index extendToCanvas:NO decoded:NULL]; - if (unblendedImage) { - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendedImage); - CFRelease(unblendedImage); - } - imageRef = CGBitmapContextCreateImage(_blendCanvas); - if (frame.dispose == YYImageDisposeBackground) { - CGContextClearRect(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height)); - } - _blendFrameIndex = index; - } else { // canvas is not ready - for (uint32_t i = (uint32_t)frame.blendFromIndex; i <= (uint32_t)frame.index; i++) { - if (i == frame.index) { - if (!imageRef) imageRef = [self _newBlendedImageWithFrame:frame]; - } else { - [self _blendImageWithFrame:_frames[i]]; - } - } - _blendFrameIndex = index; - } - } - - if (!imageRef) return nil; - UIImage *image = [UIImage imageWithCGImage:imageRef scale:_scale orientation:_orientation]; - CFRelease(imageRef); - if (!image) return nil; - - image.yy_isDecodedForDisplay = YES; - frame.image = image; - if (extendToCanvas) { - frame.width = _width; - frame.height = _height; - frame.offsetX = 0; - frame.offsetY = 0; - frame.dispose = YYImageDisposeNone; - frame.blend = YYImageBlendNone; - } - return frame; -} - -- (NSDictionary *)_framePropertiesAtIndex:(NSUInteger)index { - if (index >= _frames.count) return nil; - if (!_source) return nil; - CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(_source, index, NULL); - if (!properties) return nil; - return CFBridgingRelease(properties); -} - -- (NSDictionary *)_imageProperties { - if (!_source) return nil; - CFDictionaryRef properties = CGImageSourceCopyProperties(_source, NULL); - if (!properties) return nil; - return CFBridgingRelease(properties); -} - -#pragma private - -- (void)_updateSource { - switch (_type) { - case YYImageTypeWebP: { - [self _updateSourceWebP]; - } break; - - case YYImageTypePNG: { - [self _updateSourceAPNG]; - } break; - - default: { - [self _updateSourceImageIO]; - } break; - } -} - -- (void)_updateSourceWebP { -#if YYIMAGE_WEBP_ENABLED - _width = 0; - _height = 0; - _loopCount = 0; - if (_webpSource) WebPDemuxDelete(_webpSource); - _webpSource = NULL; - dispatch_semaphore_wait(_framesLock, DISPATCH_TIME_FOREVER); - _frames = nil; - dispatch_semaphore_signal(_framesLock); - - /* - https://developers.google.com/speed/webp/docs/api - The documentation said we can use WebPIDecoder to decode webp progressively, - but currently it can only returns an empty image (not same as progressive jpegs), - so we don't use progressive decoding. - - When using WebPDecode() to decode multi-frame webp, we will get the error - "VP8_STATUS_UNSUPPORTED_FEATURE", so we first use WebPDemuxer to unpack it. - */ - - WebPData webPData = {0}; - webPData.bytes = _data.bytes; - webPData.size = _data.length; - WebPDemuxer *demuxer = WebPDemux(&webPData); - if (!demuxer) return; - - uint32_t webpFrameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT); - uint32_t webpLoopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT); - uint32_t canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH); - uint32_t canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT); - if (webpFrameCount == 0 || canvasWidth < 1 || canvasHeight < 1) { - WebPDemuxDelete(demuxer); - return; - } - - NSMutableArray *frames = [NSMutableArray new]; - BOOL needBlend = NO; - uint32_t iterIndex = 0; - uint32_t lastBlendIndex = 0; - WebPIterator iter = {0}; - if (WebPDemuxGetFrame(demuxer, 1, &iter)) { // one-based index... - do { - _YYImageDecoderFrame *frame = [_YYImageDecoderFrame new]; - [frames addObject:frame]; - if (iter.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND) { - frame.dispose = YYImageDisposeBackground; - } - if (iter.blend_method == WEBP_MUX_BLEND) { - frame.blend = YYImageBlendOver; - } - - int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH); - int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT); - frame.index = iterIndex; - frame.duration = iter.duration / 1000.0; - frame.width = iter.width; - frame.height = iter.height; - frame.hasAlpha = iter.has_alpha; - frame.blend = iter.blend_method == WEBP_MUX_BLEND; - frame.offsetX = iter.x_offset; - frame.offsetY = canvasHeight - iter.y_offset - iter.height; - - BOOL sizeEqualsToCanvas = (iter.width == canvasWidth && iter.height == canvasHeight); - BOOL offsetIsZero = (iter.x_offset == 0 && iter.y_offset == 0); - frame.isFullSize = (sizeEqualsToCanvas && offsetIsZero); - - if ((!frame.blend || !frame.hasAlpha) && frame.isFullSize) { - frame.blendFromIndex = lastBlendIndex = iterIndex; - } else { - if (frame.dispose && frame.isFullSize) { - frame.blendFromIndex = lastBlendIndex; - lastBlendIndex = iterIndex + 1; - } else { - frame.blendFromIndex = lastBlendIndex; - } - } - if (frame.index != frame.blendFromIndex) needBlend = YES; - iterIndex++; - } while (WebPDemuxNextFrame(&iter)); - WebPDemuxReleaseIterator(&iter); - } - if (frames.count != webpFrameCount) { - WebPDemuxDelete(demuxer); - return; - } - - _width = canvasWidth; - _height = canvasHeight; - _frameCount = frames.count; - _loopCount = webpLoopCount; - _needBlend = needBlend; - _webpSource = demuxer; - dispatch_semaphore_wait(_framesLock, DISPATCH_TIME_FOREVER); - _frames = frames; - dispatch_semaphore_signal(_framesLock); -#else - static const char *func = __FUNCTION__; - static const int line = __LINE__; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSLog(@"[%s: %d] WebP is not available, check the documentation to see how to install WebP component: https://github.com/ibireme/YYImage#installation", func, line); - }); -#endif -} - -- (void)_updateSourceAPNG { - /* - APNG extends PNG format to support animation, it was supported by ImageIO - since iOS 8. - - We use a custom APNG decoder to make APNG available in old system, so we - ignore the ImageIO's APNG frame info. Typically the custom decoder is a bit - faster than ImageIO. - */ - - yy_png_info_release(_apngSource); - _apngSource = nil; - - [self _updateSourceImageIO]; // decode first frame - if (_frameCount == 0) return; // png decode failed - if (!_finalized) return; // ignore multi-frame before finalized - - yy_png_info *apng = yy_png_info_create(_data.bytes, (uint32_t)_data.length); - if (!apng) return; // apng decode failed - if (apng->apng_frame_num == 0 || - (apng->apng_frame_num == 1 && apng->apng_first_frame_is_cover)) { - yy_png_info_release(apng); - return; // no animation - } - if (_source) { // apng decode succeed, no longer need image souce - CFRelease(_source); - _source = NULL; - } - - uint32_t canvasWidth = apng->header.width; - uint32_t canvasHeight = apng->header.height; - NSMutableArray *frames = [NSMutableArray new]; - BOOL needBlend = NO; - uint32_t lastBlendIndex = 0; - for (uint32_t i = 0; i < apng->apng_frame_num; i++) { - _YYImageDecoderFrame *frame = [_YYImageDecoderFrame new]; - [frames addObject:frame]; - - yy_png_frame_info *fi = apng->apng_frames + i; - frame.index = i; - frame.duration = yy_png_delay_to_seconds(fi->frame_control.delay_num, fi->frame_control.delay_den); - frame.hasAlpha = YES; - frame.width = fi->frame_control.width; - frame.height = fi->frame_control.height; - frame.offsetX = fi->frame_control.x_offset; - frame.offsetY = canvasHeight - fi->frame_control.y_offset - fi->frame_control.height; - - BOOL sizeEqualsToCanvas = (frame.width == canvasWidth && frame.height == canvasHeight); - BOOL offsetIsZero = (fi->frame_control.x_offset == 0 && fi->frame_control.y_offset == 0); - frame.isFullSize = (sizeEqualsToCanvas && offsetIsZero); - - switch (fi->frame_control.dispose_op) { - case YY_PNG_DISPOSE_OP_BACKGROUND: { - frame.dispose = YYImageDisposeBackground; - } break; - case YY_PNG_DISPOSE_OP_PREVIOUS: { - frame.dispose = YYImageDisposePrevious; - } break; - default: { - frame.dispose = YYImageDisposeNone; - } break; - } - switch (fi->frame_control.blend_op) { - case YY_PNG_BLEND_OP_OVER: { - frame.blend = YYImageBlendOver; - } break; - - default: { - frame.blend = YYImageBlendNone; - } break; - } - - if (frame.blend == YYImageBlendNone && frame.isFullSize) { - frame.blendFromIndex = i; - if (frame.dispose != YYImageDisposePrevious) lastBlendIndex = i; - } else { - if (frame.dispose == YYImageDisposeBackground && frame.isFullSize) { - frame.blendFromIndex = lastBlendIndex; - lastBlendIndex = i + 1; - } else { - frame.blendFromIndex = lastBlendIndex; - } - } - if (frame.index != frame.blendFromIndex) needBlend = YES; - } - - _width = canvasWidth; - _height = canvasHeight; - _frameCount = frames.count; - _loopCount = apng->apng_loop_num; - _needBlend = needBlend; - _apngSource = apng; - dispatch_semaphore_wait(_framesLock, DISPATCH_TIME_FOREVER); - _frames = frames; - dispatch_semaphore_signal(_framesLock); -} - -- (void)_updateSourceImageIO { - _width = 0; - _height = 0; - _orientation = UIImageOrientationUp; - _loopCount = 0; - dispatch_semaphore_wait(_framesLock, DISPATCH_TIME_FOREVER); - _frames = nil; - dispatch_semaphore_signal(_framesLock); - - if (!_source) { - if (_finalized) { - _source = CGImageSourceCreateWithData((__bridge CFDataRef)_data, NULL); - } else { - _source = CGImageSourceCreateIncremental(NULL); - if (_source) CGImageSourceUpdateData(_source, (__bridge CFDataRef)_data, false); - } - } else { - CGImageSourceUpdateData(_source, (__bridge CFDataRef)_data, _finalized); - } - if (!_source) return; - - _frameCount = CGImageSourceGetCount(_source); - if (_frameCount == 0) return; - - if (!_finalized) { // ignore multi-frame before finalized - _frameCount = 1; - } else { - if (_type == YYImageTypePNG) { // use custom apng decoder and ignore multi-frame - _frameCount = 1; - } - if (_type == YYImageTypeGIF) { // get gif loop count - CFDictionaryRef properties = CGImageSourceCopyProperties(_source, NULL); - if (properties) { - CFDictionaryRef gif = CFDictionaryGetValue(properties, kCGImagePropertyGIFDictionary); - if (gif) { - CFTypeRef loop = CFDictionaryGetValue(gif, kCGImagePropertyGIFLoopCount); - if (loop) CFNumberGetValue(loop, kCFNumberNSIntegerType, &_loopCount); - } - CFRelease(properties); - } - } - } - - /* - ICO, GIF, APNG may contains multi-frame. - */ - NSMutableArray *frames = [NSMutableArray new]; - for (NSUInteger i = 0; i < _frameCount; i++) { - _YYImageDecoderFrame *frame = [_YYImageDecoderFrame new]; - frame.index = i; - frame.blendFromIndex = i; - frame.hasAlpha = YES; - frame.isFullSize = YES; - [frames addObject:frame]; - - CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(_source, i, NULL); - if (properties) { - NSTimeInterval duration = 0; - NSInteger orientationValue = 0, width = 0, height = 0; - CFTypeRef value = NULL; - - value = CFDictionaryGetValue(properties, kCGImagePropertyPixelWidth); - if (value) CFNumberGetValue(value, kCFNumberNSIntegerType, &width); - value = CFDictionaryGetValue(properties, kCGImagePropertyPixelHeight); - if (value) CFNumberGetValue(value, kCFNumberNSIntegerType, &height); - if (_type == YYImageTypeGIF) { - CFDictionaryRef gif = CFDictionaryGetValue(properties, kCGImagePropertyGIFDictionary); - if (gif) { - // Use the unclamped frame delay if it exists. - value = CFDictionaryGetValue(gif, kCGImagePropertyGIFUnclampedDelayTime); - if (!value) { - // Fall back to the clamped frame delay if the unclamped frame delay does not exist. - value = CFDictionaryGetValue(gif, kCGImagePropertyGIFDelayTime); - } - if (value) CFNumberGetValue(value, kCFNumberDoubleType, &duration); - } - } - - frame.width = width; - frame.height = height; - frame.duration = duration; - - if (i == 0 && _width + _height == 0) { // init first frame - _width = width; - _height = height; - value = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); - if (value) { - CFNumberGetValue(value, kCFNumberNSIntegerType, &orientationValue); - _orientation = YYUIImageOrientationFromEXIFValue(orientationValue); - } - } - CFRelease(properties); - } - } - dispatch_semaphore_wait(_framesLock, DISPATCH_TIME_FOREVER); - _frames = frames; - dispatch_semaphore_signal(_framesLock); -} - -- (CGImageRef)_newUnblendedImageAtIndex:(NSUInteger)index - extendToCanvas:(BOOL)extendToCanvas - decoded:(BOOL *)decoded CF_RETURNS_RETAINED { - - if (!_finalized && index > 0) return NULL; - if (_frames.count <= index) return NULL; - _YYImageDecoderFrame *frame = _frames[index]; - - if (_source) { - CGImageRef imageRef = CGImageSourceCreateImageAtIndex(_source, index, (CFDictionaryRef)@{(id)kCGImageSourceShouldCache:@(YES)}); - if (imageRef && extendToCanvas) { - size_t width = CGImageGetWidth(imageRef); - size_t height = CGImageGetHeight(imageRef); - if (width == _width && height == _height) { - CGImageRef imageRefExtended = YYCGImageCreateDecodedCopy(imageRef, YES); - if (imageRefExtended) { - CFRelease(imageRef); - imageRef = imageRefExtended; - if (decoded) *decoded = YES; - } - } else { - CGContextRef context = CGBitmapContextCreate(NULL, _width, _height, 8, 0, YYCGColorSpaceGetDeviceRGB(), kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst); - if (context) { - CGContextDrawImage(context, CGRectMake(0, _height - height, width, height), imageRef); - CGImageRef imageRefExtended = CGBitmapContextCreateImage(context); - CFRelease(context); - if (imageRefExtended) { - CFRelease(imageRef); - imageRef = imageRefExtended; - if (decoded) *decoded = YES; - } - } - } - } - return imageRef; - } - - if (_apngSource) { - uint32_t size = 0; - uint8_t *bytes = yy_png_copy_frame_data_at_index(_data.bytes, _apngSource, (uint32_t)index, &size); - if (!bytes) return NULL; - CGDataProviderRef provider = CGDataProviderCreateWithData(bytes, bytes, size, YYCGDataProviderReleaseDataCallback); - if (!provider) { - free(bytes); - return NULL; - } - bytes = NULL; // hold by provider - - CGImageSourceRef source = CGImageSourceCreateWithDataProvider(provider, NULL); - if (!source) { - CFRelease(provider); - return NULL; - } - CFRelease(provider); - - if(CGImageSourceGetCount(source) < 1) { - CFRelease(source); - return NULL; - } - - CGImageRef imageRef = CGImageSourceCreateImageAtIndex(source, 0, (CFDictionaryRef)@{(id)kCGImageSourceShouldCache:@(YES)}); - CFRelease(source); - if (!imageRef) return NULL; - if (extendToCanvas) { - CGContextRef context = CGBitmapContextCreate(NULL, _width, _height, 8, 0, YYCGColorSpaceGetDeviceRGB(), kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst); //bgrA - if (context) { - CGContextDrawImage(context, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), imageRef); - CFRelease(imageRef); - imageRef = CGBitmapContextCreateImage(context); - CFRelease(context); - if (decoded) *decoded = YES; - } - } - return imageRef; - } - -#if YYIMAGE_WEBP_ENABLED - if (_webpSource) { - WebPIterator iter; - if (!WebPDemuxGetFrame(_webpSource, (int)(index + 1), &iter)) return NULL; // demux webp frame data - // frame numbers are one-based in webp -----------^ - - int frameWidth = iter.width; - int frameHeight = iter.height; - if (frameWidth < 1 || frameHeight < 1) return NULL; - - int width = extendToCanvas ? (int)_width : frameWidth; - int height = extendToCanvas ? (int)_height : frameHeight; - if (width > _width || height > _height) return NULL; - - const uint8_t *payload = iter.fragment.bytes; - size_t payloadSize = iter.fragment.size; - - WebPDecoderConfig config; - if (!WebPInitDecoderConfig(&config)) { - WebPDemuxReleaseIterator(&iter); - return NULL; - } - if (WebPGetFeatures(payload , payloadSize, &config.input) != VP8_STATUS_OK) { - WebPDemuxReleaseIterator(&iter); - return NULL; - } - - size_t bitsPerComponent = 8; - size_t bitsPerPixel = 32; - size_t bytesPerRow = YYImageByteAlign(bitsPerPixel / 8 * width, 32); - size_t length = bytesPerRow * height; - CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst; //bgrA - - void *pixels = calloc(1, length); - if (!pixels) { - WebPDemuxReleaseIterator(&iter); - return NULL; - } - - config.output.colorspace = MODE_bgrA; - config.output.is_external_memory = 1; - config.output.u.RGBA.rgba = pixels; - config.output.u.RGBA.stride = (int)bytesPerRow; - config.output.u.RGBA.size = length; - VP8StatusCode result = WebPDecode(payload, payloadSize, &config); // decode - if ((result != VP8_STATUS_OK) && (result != VP8_STATUS_NOT_ENOUGH_DATA)) { - WebPDemuxReleaseIterator(&iter); - free(pixels); - return NULL; - } - WebPDemuxReleaseIterator(&iter); - - if (extendToCanvas && (iter.x_offset != 0 || iter.y_offset != 0)) { - void *tmp = calloc(1, length); - if (tmp) { - vImage_Buffer src = {pixels, height, width, bytesPerRow}; - vImage_Buffer dest = {tmp, height, width, bytesPerRow}; - vImage_CGAffineTransform transform = {1, 0, 0, 1, iter.x_offset, -iter.y_offset}; - uint8_t backColor[4] = {0}; - vImage_Error error = vImageAffineWarpCG_ARGB8888(&src, &dest, NULL, &transform, backColor, kvImageBackgroundColorFill); - if (error == kvImageNoError) { - memcpy(pixels, tmp, length); - } - free(tmp); - } - } - - CGDataProviderRef provider = CGDataProviderCreateWithData(pixels, pixels, length, YYCGDataProviderReleaseDataCallback); - if (!provider) { - free(pixels); - return NULL; - } - pixels = NULL; // hold by provider - - CGImageRef image = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, YYCGColorSpaceGetDeviceRGB(), bitmapInfo, provider, NULL, false, kCGRenderingIntentDefault); - CFRelease(provider); - if (decoded) *decoded = YES; - return image; - } -#endif - - return NULL; -} - -- (BOOL)_createBlendContextIfNeeded { - if (!_blendCanvas) { - _blendFrameIndex = NSNotFound; - _blendCanvas = CGBitmapContextCreate(NULL, _width, _height, 8, 0, YYCGColorSpaceGetDeviceRGB(), kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst); - } - BOOL suc = _blendCanvas != NULL; - return suc; -} - -- (void)_blendImageWithFrame:(_YYImageDecoderFrame *)frame { - if (frame.dispose == YYImageDisposePrevious) { - // nothing - } else if (frame.dispose == YYImageDisposeBackground) { - CGContextClearRect(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height)); - } else { // no dispose - if (frame.blend == YYImageBlendOver) { - CGImageRef unblendImage = [self _newUnblendedImageAtIndex:frame.index extendToCanvas:NO decoded:NULL]; - if (unblendImage) { - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendImage); - CFRelease(unblendImage); - } - } else { - CGContextClearRect(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height)); - CGImageRef unblendImage = [self _newUnblendedImageAtIndex:frame.index extendToCanvas:NO decoded:NULL]; - if (unblendImage) { - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendImage); - CFRelease(unblendImage); - } - } - } -} - -- (CGImageRef)_newBlendedImageWithFrame:(_YYImageDecoderFrame *)frame CF_RETURNS_RETAINED{ - CGImageRef imageRef = NULL; - if (frame.dispose == YYImageDisposePrevious) { - if (frame.blend == YYImageBlendOver) { - CGImageRef previousImage = CGBitmapContextCreateImage(_blendCanvas); - CGImageRef unblendImage = [self _newUnblendedImageAtIndex:frame.index extendToCanvas:NO decoded:NULL]; - if (unblendImage) { - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendImage); - CFRelease(unblendImage); - } - imageRef = CGBitmapContextCreateImage(_blendCanvas); - CGContextClearRect(_blendCanvas, CGRectMake(0, 0, _width, _height)); - if (previousImage) { - CGContextDrawImage(_blendCanvas, CGRectMake(0, 0, _width, _height), previousImage); - CFRelease(previousImage); - } - } else { - CGImageRef previousImage = CGBitmapContextCreateImage(_blendCanvas); - CGImageRef unblendImage = [self _newUnblendedImageAtIndex:frame.index extendToCanvas:NO decoded:NULL]; - if (unblendImage) { - CGContextClearRect(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height)); - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendImage); - CFRelease(unblendImage); - } - imageRef = CGBitmapContextCreateImage(_blendCanvas); - CGContextClearRect(_blendCanvas, CGRectMake(0, 0, _width, _height)); - if (previousImage) { - CGContextDrawImage(_blendCanvas, CGRectMake(0, 0, _width, _height), previousImage); - CFRelease(previousImage); - } - } - } else if (frame.dispose == YYImageDisposeBackground) { - if (frame.blend == YYImageBlendOver) { - CGImageRef unblendImage = [self _newUnblendedImageAtIndex:frame.index extendToCanvas:NO decoded:NULL]; - if (unblendImage) { - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendImage); - CFRelease(unblendImage); - } - imageRef = CGBitmapContextCreateImage(_blendCanvas); - CGContextClearRect(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height)); - } else { - CGImageRef unblendImage = [self _newUnblendedImageAtIndex:frame.index extendToCanvas:NO decoded:NULL]; - if (unblendImage) { - CGContextClearRect(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height)); - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendImage); - CFRelease(unblendImage); - } - imageRef = CGBitmapContextCreateImage(_blendCanvas); - CGContextClearRect(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height)); - } - } else { // no dispose - if (frame.blend == YYImageBlendOver) { - CGImageRef unblendImage = [self _newUnblendedImageAtIndex:frame.index extendToCanvas:NO decoded:NULL]; - if (unblendImage) { - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendImage); - CFRelease(unblendImage); - } - imageRef = CGBitmapContextCreateImage(_blendCanvas); - } else { - CGImageRef unblendImage = [self _newUnblendedImageAtIndex:frame.index extendToCanvas:NO decoded:NULL]; - if (unblendImage) { - CGContextClearRect(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height)); - CGContextDrawImage(_blendCanvas, CGRectMake(frame.offsetX, frame.offsetY, frame.width, frame.height), unblendImage); - CFRelease(unblendImage); - } - imageRef = CGBitmapContextCreateImage(_blendCanvas); - } - } - return imageRef; -} - -@end - - -//////////////////////////////////////////////////////////////////////////////// -#pragma mark - Encoder - -@implementation YYImageEncoder { - NSMutableArray *_images; - NSMutableArray *_durations; -} - -- (instancetype)init { - @throw [NSException exceptionWithName:@"YYImageEncoder init error" reason:@"YYImageEncoder must be initialized with a type. Use 'initWithType:' instead." userInfo:nil]; - return [self initWithType:YYImageTypeUnknown]; -} - -- (instancetype)initWithType:(YYImageType)type { - if (type == YYImageTypeUnknown || type >= YYImageTypeOther) { - NSLog(@"[%s: %d] Unsupported image type:%d",__FUNCTION__, __LINE__, (int)type); - return nil; - } - -#if !YYIMAGE_WEBP_ENABLED - if (type == YYImageTypeWebP) { - NSLog(@"[%s: %d] WebP is not available, check the documentation to see how to install WebP component: https://github.com/ibireme/YYImage#installation", __FUNCTION__, __LINE__); - return nil; - } -#endif - - self = [super init]; - if (!self) return nil; - _type = type; - _images = [NSMutableArray new]; - _durations = [NSMutableArray new]; - - switch (type) { - case YYImageTypeJPEG: - case YYImageTypeJPEG2000: { - _quality = 0.9; - } break; - case YYImageTypeTIFF: - case YYImageTypeBMP: - case YYImageTypeGIF: - case YYImageTypeICO: - case YYImageTypeICNS: - case YYImageTypePNG: { - _quality = 1; - _lossless = YES; - } break; - case YYImageTypeWebP: { - _quality = 0.8; - } break; - default: - break; - } - - return self; -} - -- (void)setQuality:(CGFloat)quality { - _quality = quality < 0 ? 0 : quality > 1 ? 1 : quality; -} - -- (void)addImage:(UIImage *)image duration:(NSTimeInterval)duration { - if (!image.CGImage) return; - duration = duration < 0 ? 0 : duration; - [_images addObject:image]; - [_durations addObject:@(duration)]; -} - -- (void)addImageWithData:(NSData *)data duration:(NSTimeInterval)duration { - if (data.length == 0) return; - duration = duration < 0 ? 0 : duration; - [_images addObject:data]; - [_durations addObject:@(duration)]; -} - -- (void)addImageWithFile:(NSString *)path duration:(NSTimeInterval)duration { - if (path.length == 0) return; - duration = duration < 0 ? 0 : duration; - NSURL *url = [NSURL URLWithString:path]; - if (!url) return; - [_images addObject:url]; - [_durations addObject:@(duration)]; -} - -- (BOOL)_imageIOAvaliable { - switch (_type) { - case YYImageTypeJPEG: - case YYImageTypeJPEG2000: - case YYImageTypeTIFF: - case YYImageTypeBMP: - case YYImageTypeICO: - case YYImageTypeICNS: - case YYImageTypeGIF: { - return _images.count > 0; - } break; - case YYImageTypePNG: { - return _images.count == 1; - } break; - case YYImageTypeWebP: { - return NO; - } break; - default: return NO; - } -} - -- (CGImageDestinationRef)_newImageDestination:(id)dest imageCount:(NSUInteger)count CF_RETURNS_RETAINED { - if (!dest) return nil; - CGImageDestinationRef destination = NULL; - if ([dest isKindOfClass:[NSString class]]) { - NSURL *url = [[NSURL alloc] initFileURLWithPath:dest]; - if (url) { - destination = CGImageDestinationCreateWithURL((CFURLRef)url, YYImageTypeToUTType(_type), count, NULL); - } - } else if ([dest isKindOfClass:[NSMutableData class]]) { - destination = CGImageDestinationCreateWithData((CFMutableDataRef)dest, YYImageTypeToUTType(_type), count, NULL); - } - return destination; -} - -- (void)_encodeImageWithDestination:(CGImageDestinationRef)destination imageCount:(NSUInteger)count { - if (_type == YYImageTypeGIF) { - NSDictionary *gifProperty = @{(__bridge id)kCGImagePropertyGIFDictionary: - @{(__bridge id)kCGImagePropertyGIFLoopCount: @(_loopCount)}}; - CGImageDestinationSetProperties(destination, (__bridge CFDictionaryRef)gifProperty); - } - - for (int i = 0; i < count; i++) { - @autoreleasepool { - id imageSrc = _images[i]; - NSDictionary *frameProperty = NULL; - if (_type == YYImageTypeGIF && count > 1) { - frameProperty = @{(NSString *)kCGImagePropertyGIFDictionary : @{(NSString *) kCGImagePropertyGIFDelayTime:_durations[i]}}; - } else { - frameProperty = @{(id)kCGImageDestinationLossyCompressionQuality : @(_quality)}; - } - - if ([imageSrc isKindOfClass:[UIImage class]]) { - UIImage *image = imageSrc; - if (image.imageOrientation != UIImageOrientationUp && image.CGImage) { - CGBitmapInfo info = CGImageGetBitmapInfo(image.CGImage) | CGImageGetAlphaInfo(image.CGImage); - CGImageRef rotated = YYCGImageCreateCopyWithOrientation(image.CGImage, image.imageOrientation, info); - if (rotated) { - image = [UIImage imageWithCGImage:rotated]; - CFRelease(rotated); - } - } - if (image.CGImage) CGImageDestinationAddImage(destination, ((UIImage *)imageSrc).CGImage, (CFDictionaryRef)frameProperty); - } else if ([imageSrc isKindOfClass:[NSURL class]]) { - CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)imageSrc, NULL); - if (source) { - CGImageDestinationAddImageFromSource(destination, source, 0, (CFDictionaryRef)frameProperty); - CFRelease(source); - } - } else if ([imageSrc isKindOfClass:[NSData class]]) { - CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)imageSrc, NULL); - if (source) { - CGImageDestinationAddImageFromSource(destination, source, 0, (CFDictionaryRef)frameProperty); - CFRelease(source); - } - } - } - } -} - -- (CGImageRef)_newCGImageFromIndex:(NSUInteger)index decoded:(BOOL)decoded CF_RETURNS_RETAINED { - UIImage *image = nil; - id imageSrc= _images[index]; - if ([imageSrc isKindOfClass:[UIImage class]]) { - image = imageSrc; - } else if ([imageSrc isKindOfClass:[NSURL class]]) { - image = [UIImage imageWithContentsOfFile:((NSURL *)imageSrc).absoluteString]; - } else if ([imageSrc isKindOfClass:[NSData class]]) { - image = [UIImage imageWithData:imageSrc]; - } - if (!image) return NULL; - CGImageRef imageRef = image.CGImage; - if (!imageRef) return NULL; - if (image.imageOrientation != UIImageOrientationUp) { - return YYCGImageCreateCopyWithOrientation(imageRef, image.imageOrientation, kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst); - } - if (decoded) { - return YYCGImageCreateDecodedCopy(imageRef, YES); - } - return (CGImageRef)CFRetain(imageRef); -} - -- (NSData *)_encodeWithImageIO { - NSMutableData *data = [NSMutableData new]; - NSUInteger count = _type == YYImageTypeGIF ? _images.count : 1; - CGImageDestinationRef destination = [self _newImageDestination:data imageCount:count]; - BOOL suc = NO; - if (destination) { - [self _encodeImageWithDestination:destination imageCount:count]; - suc = CGImageDestinationFinalize(destination); - CFRelease(destination); - } - if (suc && data.length > 0) { - return data; - } else { - return nil; - } -} - -- (BOOL)_encodeWithImageIO:(NSString *)path { - NSUInteger count = _type == YYImageTypeGIF ? _images.count : 1; - CGImageDestinationRef destination = [self _newImageDestination:path imageCount:count]; - BOOL suc = NO; - if (destination) { - [self _encodeImageWithDestination:destination imageCount:count]; - suc = CGImageDestinationFinalize(destination); - CFRelease(destination); - } - return suc; -} - -- (NSData *)_encodeAPNG { - // encode APNG (ImageIO doesn't support APNG encoding, so we use a custom encoder) - NSMutableArray *pngDatas = [NSMutableArray new]; - NSMutableArray *pngSizes = [NSMutableArray new]; - NSUInteger canvasWidth = 0, canvasHeight = 0; - for (int i = 0; i < _images.count; i++) { - CGImageRef decoded = [self _newCGImageFromIndex:i decoded:YES]; - if (!decoded) return nil; - CGSize size = CGSizeMake(CGImageGetWidth(decoded), CGImageGetHeight(decoded)); - [pngSizes addObject:[NSValue valueWithCGSize:size]]; - if (canvasWidth < size.width) canvasWidth = size.width; - if (canvasHeight < size.height) canvasHeight = size.height; - CFDataRef frameData = YYCGImageCreateEncodedData(decoded, YYImageTypePNG, 1); - CFRelease(decoded); - if (!frameData) return nil; - [pngDatas addObject:(__bridge id)(frameData)]; - CFRelease(frameData); - if (size.width < 1 || size.height < 1) return nil; - } - CGSize firstFrameSize = [(NSValue *)[pngSizes firstObject] CGSizeValue]; - if (firstFrameSize.width < canvasWidth || firstFrameSize.height < canvasHeight) { - CGImageRef decoded = [self _newCGImageFromIndex:0 decoded:YES]; - if (!decoded) return nil; - CGContextRef context = CGBitmapContextCreate(NULL, canvasWidth, canvasHeight, 8, - 0, YYCGColorSpaceGetDeviceRGB(), kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst); - if (!context) { - CFRelease(decoded); - return nil; - } - CGContextDrawImage(context, CGRectMake(0, canvasHeight - firstFrameSize.height, firstFrameSize.width, firstFrameSize.height), decoded); - CFRelease(decoded); - CGImageRef extendedImage = CGBitmapContextCreateImage(context); - CFRelease(context); - if (!extendedImage) return nil; - CFDataRef frameData = YYCGImageCreateEncodedData(extendedImage, YYImageTypePNG, 1); - if (!frameData) { - CFRelease(extendedImage); - return nil; - } - pngDatas[0] = (__bridge id)(frameData); - CFRelease(frameData); - } - - NSData *firstFrameData = pngDatas[0]; - yy_png_info *info = yy_png_info_create(firstFrameData.bytes, (uint32_t)firstFrameData.length); - if (!info) return nil; - NSMutableData *result = [NSMutableData new]; - BOOL insertBefore = NO, insertAfter = NO; - uint32_t apngSequenceIndex = 0; - - uint32_t png_header[2]; - png_header[0] = YY_FOUR_CC(0x89, 0x50, 0x4E, 0x47); - png_header[1] = YY_FOUR_CC(0x0D, 0x0A, 0x1A, 0x0A); - - [result appendBytes:png_header length:8]; - - for (int i = 0; i < info->chunk_num; i++) { - yy_png_chunk_info *chunk = info->chunks + i; - - if (!insertBefore && chunk->fourcc == YY_FOUR_CC('I', 'D', 'A', 'T')) { - insertBefore = YES; - // insert acTL (APNG Control) - uint32_t acTL[5] = {0}; - acTL[0] = yy_swap_endian_uint32(8); //length - acTL[1] = YY_FOUR_CC('a', 'c', 'T', 'L'); // fourcc - acTL[2] = yy_swap_endian_uint32((uint32_t)pngDatas.count); // num frames - acTL[3] = yy_swap_endian_uint32((uint32_t)_loopCount); // num plays - acTL[4] = yy_swap_endian_uint32((uint32_t)crc32(0, (const Bytef *)(acTL + 1), 12)); //crc32 - [result appendBytes:acTL length:20]; - - // insert fcTL (first frame control) - yy_png_chunk_fcTL chunk_fcTL = {0}; - chunk_fcTL.sequence_number = apngSequenceIndex; - chunk_fcTL.width = (uint32_t)firstFrameSize.width; - chunk_fcTL.height = (uint32_t)firstFrameSize.height; - yy_png_delay_to_fraction([(NSNumber *)_durations[0] doubleValue], &chunk_fcTL.delay_num, &chunk_fcTL.delay_den); - chunk_fcTL.delay_num = chunk_fcTL.delay_num; - chunk_fcTL.delay_den = chunk_fcTL.delay_den; - chunk_fcTL.dispose_op = YY_PNG_DISPOSE_OP_BACKGROUND; - chunk_fcTL.blend_op = YY_PNG_BLEND_OP_SOURCE; - - uint8_t fcTL[38] = {0}; - *((uint32_t *)fcTL) = yy_swap_endian_uint32(26); //length - *((uint32_t *)(fcTL + 4)) = YY_FOUR_CC('f', 'c', 'T', 'L'); // fourcc - yy_png_chunk_fcTL_write(&chunk_fcTL, fcTL + 8); - *((uint32_t *)(fcTL + 34)) = yy_swap_endian_uint32((uint32_t)crc32(0, (const Bytef *)(fcTL + 4), 30)); - [result appendBytes:fcTL length:38]; - - apngSequenceIndex++; - } - - if (!insertAfter && insertBefore && chunk->fourcc != YY_FOUR_CC('I', 'D', 'A', 'T')) { - insertAfter = YES; - // insert fcTL and fdAT (APNG frame control and data) - - for (int i = 1; i < pngDatas.count; i++) { - NSData *frameData = pngDatas[i]; - yy_png_info *frame = yy_png_info_create(frameData.bytes, (uint32_t)frameData.length); - if (!frame) { - yy_png_info_release(info); - return nil; - } - - // insert fcTL (first frame control) - yy_png_chunk_fcTL chunk_fcTL = {0}; - chunk_fcTL.sequence_number = apngSequenceIndex; - chunk_fcTL.width = frame->header.width; - chunk_fcTL.height = frame->header.height; - yy_png_delay_to_fraction([(NSNumber *)_durations[i] doubleValue], &chunk_fcTL.delay_num, &chunk_fcTL.delay_den); - chunk_fcTL.delay_num = chunk_fcTL.delay_num; - chunk_fcTL.delay_den = chunk_fcTL.delay_den; - chunk_fcTL.dispose_op = YY_PNG_DISPOSE_OP_BACKGROUND; - chunk_fcTL.blend_op = YY_PNG_BLEND_OP_SOURCE; - - uint8_t fcTL[38] = {0}; - *((uint32_t *)fcTL) = yy_swap_endian_uint32(26); //length - *((uint32_t *)(fcTL + 4)) = YY_FOUR_CC('f', 'c', 'T', 'L'); // fourcc - yy_png_chunk_fcTL_write(&chunk_fcTL, fcTL + 8); - *((uint32_t *)(fcTL + 34)) = yy_swap_endian_uint32((uint32_t)crc32(0, (const Bytef *)(fcTL + 4), 30)); - [result appendBytes:fcTL length:38]; - - apngSequenceIndex++; - - // insert fdAT (frame data) - for (int d = 0; d < frame->chunk_num; d++) { - yy_png_chunk_info *dchunk = frame->chunks + d; - if (dchunk->fourcc == YY_FOUR_CC('I', 'D', 'A', 'T')) { - uint32_t length = yy_swap_endian_uint32(dchunk->length + 4); - [result appendBytes:&length length:4]; //length - uint32_t fourcc = YY_FOUR_CC('f', 'd', 'A', 'T'); - [result appendBytes:&fourcc length:4]; //fourcc - uint32_t sq = yy_swap_endian_uint32(apngSequenceIndex); - [result appendBytes:&sq length:4]; //data (sq) - [result appendBytes:(((uint8_t *)frameData.bytes) + dchunk->offset + 8) length:dchunk->length]; //data - uint8_t *bytes = ((uint8_t *)result.bytes) + result.length - dchunk->length - 8; - uint32_t crc = yy_swap_endian_uint32((uint32_t)crc32(0, bytes, dchunk->length + 8)); - [result appendBytes:&crc length:4]; //crc - - apngSequenceIndex++; - } - } - yy_png_info_release(frame); - } - } - - [result appendBytes:((uint8_t *)firstFrameData.bytes) + chunk->offset length:chunk->length + 12]; - } - yy_png_info_release(info); - return result; -} - -- (NSData *)_encodeWebP { -#if YYIMAGE_WEBP_ENABLED - // encode webp - NSMutableArray *webpDatas = [NSMutableArray new]; - for (NSUInteger i = 0; i < _images.count; i++) { - CGImageRef image = [self _newCGImageFromIndex:i decoded:NO]; - if (!image) return nil; - CFDataRef frameData = YYCGImageCreateEncodedWebPData(image, _lossless, _quality, 4, YYImagePresetDefault); - CFRelease(image); - if (!frameData) return nil; - [webpDatas addObject:(__bridge id)frameData]; - CFRelease(frameData); - } - if (webpDatas.count == 1) { - return webpDatas.firstObject; - } else { - // multi-frame webp - WebPMux *mux = WebPMuxNew(); - if (!mux) return nil; - for (NSUInteger i = 0; i < _images.count; i++) { - NSData *data = webpDatas[i]; - NSNumber *duration = _durations[i]; - WebPMuxFrameInfo frame = {0}; - frame.bitstream.bytes = data.bytes; - frame.bitstream.size = data.length; - frame.duration = (int)(duration.floatValue * 1000.0); - frame.id = WEBP_CHUNK_ANMF; - frame.dispose_method = WEBP_MUX_DISPOSE_BACKGROUND; - frame.blend_method = WEBP_MUX_NO_BLEND; - if (WebPMuxPushFrame(mux, &frame, 0) != WEBP_MUX_OK) { - WebPMuxDelete(mux); - return nil; - } - } - - WebPMuxAnimParams params = {(uint32_t)0, (int)_loopCount}; - if (WebPMuxSetAnimationParams(mux, ¶ms) != WEBP_MUX_OK) { - WebPMuxDelete(mux); - return nil; - } - - WebPData output_data; - WebPMuxError error = WebPMuxAssemble(mux, &output_data); - WebPMuxDelete(mux); - if (error != WEBP_MUX_OK) { - return nil; - } - NSData *result = [NSData dataWithBytes:output_data.bytes length:output_data.size]; - WebPDataClear(&output_data); - return result.length ? result : nil; - } -#else - return nil; -#endif -} -- (NSData *)encode { - if (_images.count == 0) return nil; - - if ([self _imageIOAvaliable]) return [self _encodeWithImageIO]; - if (_type == YYImageTypePNG) return [self _encodeAPNG]; - if (_type == YYImageTypeWebP) return [self _encodeWebP]; - return nil; -} - -- (BOOL)encodeToFile:(NSString *)path { - if (_images.count == 0 || path.length == 0) return NO; - - if ([self _imageIOAvaliable]) return [self _encodeWithImageIO:path]; - NSData *data = [self encode]; - if (!data) return NO; - return [data writeToFile:path atomically:YES]; -} - -+ (NSData *)encodeImage:(UIImage *)image type:(YYImageType)type quality:(CGFloat)quality { - YYImageEncoder *encoder = [[YYImageEncoder alloc] initWithType:type]; - encoder.quality = quality; - [encoder addImage:image duration:0]; - return [encoder encode]; -} - -+ (NSData *)encodeImageWithDecoder:(YYImageDecoder *)decoder type:(YYImageType)type quality:(CGFloat)quality { - if (!decoder || decoder.frameCount == 0) return nil; - YYImageEncoder *encoder = [[YYImageEncoder alloc] initWithType:type]; - encoder.quality = quality; - for (int i = 0; i < decoder.frameCount; i++) { - UIImage *frame = [decoder frameAtIndex:i decodeForDisplay:YES].image; - [encoder addImageWithData:UIImagePNGRepresentation(frame) duration:[decoder frameDurationAtIndex:i]]; - } - return encoder.encode; -} - -@end - - -@implementation UIImage (YYImageCoder) - -- (instancetype)yy_imageByDecoded { - if (self.yy_isDecodedForDisplay) return self; - CGImageRef imageRef = self.CGImage; - if (!imageRef) return self; - CGImageRef newImageRef = YYCGImageCreateDecodedCopy(imageRef, YES); - if (!newImageRef) return self; - UIImage *newImage = [[self.class alloc] initWithCGImage:newImageRef scale:self.scale orientation:self.imageOrientation]; - CGImageRelease(newImageRef); - if (!newImage) newImage = self; // decode failed, return self. - newImage.yy_isDecodedForDisplay = YES; - return newImage; -} - -- (BOOL)yy_isDecodedForDisplay { - if (self.images.count > 1 || [self isKindOfClass:[YYSpriteSheetImage class]]) return YES; - NSNumber *num = objc_getAssociatedObject(self, @selector(yy_isDecodedForDisplay)); - return [num boolValue]; -} - -- (void)setYy_isDecodedForDisplay:(BOOL)isDecodedForDisplay { - objc_setAssociatedObject(self, @selector(yy_isDecodedForDisplay), @(isDecodedForDisplay), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (void)yy_saveToAlbumWithCompletionBlock:(void(^)(NSURL *assetURL, NSError *error))completionBlock { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSData *data = [self _yy_dataRepresentationForSystem:YES]; - ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; - [library writeImageDataToSavedPhotosAlbum:data metadata:nil completionBlock:^(NSURL *assetURL, NSError *error){ - if (!completionBlock) return; - if (pthread_main_np()) { - completionBlock(assetURL, error); - } else { - dispatch_async(dispatch_get_main_queue(), ^{ - completionBlock(assetURL, error); - }); - } - }]; - }); -} - -- (NSData *)yy_imageDataRepresentation { - return [self _yy_dataRepresentationForSystem:NO]; -} - -/// @param forSystem YES: used for system album (PNG/JPEG/GIF), NO: used for YYImage (PNG/JPEG/GIF/WebP) -- (NSData *)_yy_dataRepresentationForSystem:(BOOL)forSystem { - NSData *data = nil; - if ([self isKindOfClass:[YYImage class]]) { - YYImage *image = (id)self; - if (image.animatedImageData) { - if (forSystem) { // system only support GIF and PNG - if (image.animatedImageType == YYImageTypeGIF || - image.animatedImageType == YYImageTypePNG) { - data = image.animatedImageData; - } - } else { - data = image.animatedImageData; - } - } - } - if (!data) { - CGImageRef imageRef = self.CGImage ? (CGImageRef)CFRetain(self.CGImage) : nil; - if (imageRef) { - CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); - CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef) & kCGBitmapAlphaInfoMask; - BOOL hasAlpha = NO; - if (alphaInfo == kCGImageAlphaPremultipliedLast || - alphaInfo == kCGImageAlphaPremultipliedFirst || - alphaInfo == kCGImageAlphaLast || - alphaInfo == kCGImageAlphaFirst) { - hasAlpha = YES; - } - if (self.imageOrientation != UIImageOrientationUp) { - CGImageRef rotated = YYCGImageCreateCopyWithOrientation(imageRef, self.imageOrientation, bitmapInfo | alphaInfo); - if (rotated) { - CFRelease(imageRef); - imageRef = rotated; - } - } - @autoreleasepool { - UIImage *newImage = [UIImage imageWithCGImage:imageRef]; - if (newImage) { - if (hasAlpha) { - data = UIImagePNGRepresentation([UIImage imageWithCGImage:imageRef]); - } else { - data = UIImageJPEGRepresentation([UIImage imageWithCGImage:imageRef], 0.9); // same as Apple's example - } - } - } - CFRelease(imageRef); - } - } - if (!data) { - data = UIImagePNGRepresentation(self); - } - return data; -} - -@end diff --git a/iOSProject/Pods/YYImage/YYImage/YYSpriteSheetImage.h b/iOSProject/Pods/YYImage/YYImage/YYSpriteSheetImage.h deleted file mode 100644 index 403bbf57..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYSpriteSheetImage.h +++ /dev/null @@ -1,104 +0,0 @@ -// -// YYSpriteImage.h -// YYImage -// -// Created by ibireme on 15/4/21. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -#import -#elif __has_include() -#import -#else -#import "YYAnimatedImageView.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - -/** - An image to display sprite sheet animation. - - @discussion It is a fully compatible `UIImage` subclass. - The animation can be played by YYAnimatedImageView. - - Sample Code: - - // 8 * 12 sprites in a single sheet image - UIImage *spriteSheet = [UIImage imageNamed:@"sprite-sheet"]; - NSMutableArray *contentRects = [NSMutableArray new]; - NSMutableArray *durations = [NSMutableArray new]; - for (int j = 0; j < 12; j++) { - for (int i = 0; i < 8; i++) { - CGRect rect; - rect.size = CGSizeMake(img.size.width / 8, img.size.height / 12); - rect.origin.x = img.size.width / 8 * i; - rect.origin.y = img.size.height / 12 * j; - [contentRects addObject:[NSValue valueWithCGRect:rect]]; - [durations addObject:@(1 / 60.0)]; - } - } - YYSpriteSheetImage *sprite; - sprite = [[YYSpriteSheetImage alloc] initWithSpriteSheetImage:img - contentRects:contentRects - frameDurations:durations - loopCount:0]; - YYAnimatedImageView *imgView = [YYAnimatedImageView new]; - imgView.size = CGSizeMake(img.size.width / 8, img.size.height / 12); - imgView.image = sprite; - - - - @discussion It can also be used to display single frame in sprite sheet image. - Sample Code: - - YYSpriteSheetImage *sheet = ...; - UIImageView *imageView = ...; - imageView.image = sheet; - imageView.layer.contentsRect = [sheet contentsRectForCALayerAtIndex:6]; - - */ -@interface YYSpriteSheetImage : UIImage - -/** - Creates and returns an image object. - - @param image The sprite sheet image (contains all frames). - - @param contentRects The sprite sheet image frame rects in the image coordinates. - The rectangle should not outside the image's bounds. The objects in this array - should be created with [NSValue valueWithCGRect:]. - - @param frameDurations The sprite sheet image frame's durations in seconds. - The objects in this array should be NSNumber. - - @param loopCount Animation loop count, 0 means infinite looping. - - @return An image object, or nil if an error occurs. - */ -- (nullable instancetype)initWithSpriteSheetImage:(UIImage *)image - contentRects:(NSArray *)contentRects - frameDurations:(NSArray *)frameDurations - loopCount:(NSUInteger)loopCount; - -@property (nonatomic, readonly) NSArray *contentRects; -@property (nonatomic, readonly) NSArray *frameDurations; -@property (nonatomic, readonly) NSUInteger loopCount; - -/** - Get the contents rect for CALayer. - See "contentsRect" property in CALayer for more information. - - @param index Index of frame. - @return Contents Rect. - */ -- (CGRect)contentsRectForCALayerAtIndex:(NSUInteger)index; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYImage/YYImage/YYSpriteSheetImage.m b/iOSProject/Pods/YYImage/YYImage/YYSpriteSheetImage.m deleted file mode 100644 index f5a0d778..00000000 --- a/iOSProject/Pods/YYImage/YYImage/YYSpriteSheetImage.m +++ /dev/null @@ -1,80 +0,0 @@ -// -// YYSpriteImage.m -// YYImage -// -// Created by ibireme on 15/4/21. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYSpriteSheetImage.h" - -@implementation YYSpriteSheetImage - -- (instancetype)initWithSpriteSheetImage:(UIImage *)image - contentRects:(NSArray *)contentRects - frameDurations:(NSArray *)frameDurations - loopCount:(NSUInteger)loopCount { - if (!image.CGImage) return nil; - if (contentRects.count < 1 || frameDurations.count < 1) return nil; - if (contentRects.count != frameDurations.count) return nil; - - self = [super initWithCGImage:image.CGImage scale:image.scale orientation:image.imageOrientation]; - if (!self) return nil; - - _contentRects = contentRects.copy; - _frameDurations = frameDurations.copy; - _loopCount = loopCount; - return self; -} - -- (CGRect)contentsRectForCALayerAtIndex:(NSUInteger)index { - CGRect layerRect = CGRectMake(0, 0, 1, 1); - if (index >= _contentRects.count) return layerRect; - - CGSize imageSize = self.size; - CGRect rect = [self animatedImageContentsRectAtIndex:index]; - if (imageSize.width > 0.01 && imageSize.height > 0.01) { - layerRect.origin.x = rect.origin.x / imageSize.width; - layerRect.origin.y = rect.origin.y / imageSize.height; - layerRect.size.width = rect.size.width / imageSize.width; - layerRect.size.height = rect.size.height / imageSize.height; - layerRect = CGRectIntersection(layerRect, CGRectMake(0, 0, 1, 1)); - if (CGRectIsNull(layerRect) || CGRectIsEmpty(layerRect)) { - layerRect = CGRectMake(0, 0, 1, 1); - } - } - return layerRect; -} - -#pragma mark @protocol YYAnimatedImage - -- (NSUInteger)animatedImageFrameCount { - return _contentRects.count; -} - -- (NSUInteger)animatedImageLoopCount { - return _loopCount; -} - -- (NSUInteger)animatedImageBytesPerFrame { - return 0; -} - -- (UIImage *)animatedImageFrameAtIndex:(NSUInteger)index { - return self; -} - -- (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index { - if (index >= _frameDurations.count) return 0; - return ((NSNumber *)_frameDurations[index]).doubleValue; -} - -- (CGRect)animatedImageContentsRectAtIndex:(NSUInteger)index { - if (index >= _contentRects.count) return CGRectZero; - return ((NSValue *)_contentRects[index]).CGRectValue; -} - -@end diff --git a/iOSProject/Pods/YYText/LICENSE b/iOSProject/Pods/YYText/LICENSE deleted file mode 100644 index 46be20bd..00000000 --- a/iOSProject/Pods/YYText/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 ibireme - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/iOSProject/Pods/YYText/README.md b/iOSProject/Pods/YYText/README.md deleted file mode 100755 index 062aa558..00000000 --- a/iOSProject/Pods/YYText/README.md +++ /dev/null @@ -1,1095 +0,0 @@ -YYText -============== -[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/ibireme/YYText/master/LICENSE)  -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)  -[![CocoaPods](http://img.shields.io/cocoapods/v/YYText.svg?style=flat)](http://cocoapods.org/?q= YYText)  -[![CocoaPods](http://img.shields.io/cocoapods/p/YYText.svg?style=flat)](http://cocoapods.org/?q= YYText)  -[![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  -[![Build Status](https://travis-ci.org/ibireme/YYText.svg?branch=master)](https://travis-ci.org/ibireme/YYText) - -Powerful text framework for iOS to display and edit rich text.
    -(It's a component of [YYKit](https://github.com/ibireme/YYKit)) - - -Features -============== - -- UILabel and UITextView API compatible -- High performance asynchronous text layout and rendering -- Extended CoreText attributes with more text effects -- Text attachments with UIImage, UIView and CALayer -- Custom highlight text range to allow user interact with -- Text parser support (built in markdown/emoticon parser) -- Text container path and exclusion paths support -- Vertical form layout support (for CJK text) -- Image and attributed text copy/paste support -- Attributed text placeholder support -- Custom keyboard view support -- Undo and redo control -- Attributed text archiver and unarchiver support -- Multi-language and VoiceOver support -- Interface Builder support -- Fully documented - - -Architecture -============== -YYText vs TextKit - - - - -Text Attributes -============== - -### YYText supported attributes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DemoAttribute NameClass
    TextAttachmentYYTextAttachment
    TextHighlightYYTextHighlight
    TextBindingYYTextBinding
    TextShadow
    TextInnerShadow
    YYTextShadow
    TextBorderYYTextBorder
    TextBackgroundBorderYYTextBorder
    TextBlockBorderYYTextBorder
    TextGlyphTransform NSValue(CGAffineTransform)
    TextUnderlineYYTextDecoration
    TextStrickthroughYYTextDecoration
    TextBackedStringYYTextBackedString
    - -###CoreText attributes which is supported by YYText - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DemoAttribute NameClass
    Font UIFont(CTFontRef)
    Kern NSNumber
    StrokeWidth NSNumber
    StrokeColor CGColorRef
    Shadow NSShadow
    Ligature NSNumber
    VerticalGlyphForm NSNumber(BOOL)
    WritingDirection NSArray(NSNumber)
    RunDelegate CTRunDelegateRef
    TextAlignment NSParagraphStyle
    (NSTextAlignment)
    LineBreakMode NSParagraphStyle
    (NSLineBreakMode)
    LineSpacing NSParagraphStyle
    (CGFloat)
    ParagraphSpacing
    ParagraphSpacingBefore
    NSParagraphStyle
    (CGFloat)
    FirstLineHeadIndent NSParagraphStyle
    (CGFloat)
    HeadIndent NSParagraphStyle
    (CGFloat)
    TailIndent NSParagraphStyle
    (CGFloat)
    MinimumLineHeight NSParagraphStyle
    (CGFloat)
    MaximumLineHeight NSParagraphStyle
    (CGFloat)
    LineHeightMultiple NSParagraphStyle
    (CGFloat)
    BaseWritingDirection NSParagraphStyle
    (NSWritingDirection)
    DefaultTabInterval
    TabStops
    NSParagraphStyle
    CGFloat/NSArray(NSTextTab)
    - - -Usage -============== - -### Basic - // YYLabel (similar to UILabel) - YYLabel *label = [YYLabel new]; - label.frame = ... - label.font = ... - label.textColor = ... - label.textAlignment = ... - label.lineBreakMode = ... - label.numberOfLines = ... - label.text = ... - - // YYTextView (similar to UITextView) - YYTextView *textView = [YYTextView new]; - textView.frame = ... - textView.font = ... - textView.textColor = ... - textView.dataDetectorTypes = ... - textView.placeHolderText = ... - textView.placeHolderTextColor = ... - textView.delegate = ... - - -### Attributed text - - // 1. Create an attributed string. - NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:@"Some Text, blabla..."]; - - // 2. Set attributes to text, you can use almost all CoreText attributes. - text.yy_font = [UIFont boldSystemFontOfSize:30]; - text.yy_color = [UIColor blueColor]; - [text yy_setColor:[UIColor redColor] range:NSMakeRange(0, 4)]; - text.yy_lineSpacing = 10; - - // 3. Set to YYLabel or YYTextView. - YYLabel *label = [YYLabel new]; - label.frame = ... - label.attributedString = text; - - YYTextView *textView = [YYTextView new]; - textView.frame = ... - textView.attributedString = text; - -### Text highlight - -You can use some convenience methods to set text highlight: - - [text yy_setTextHighlightRange:range - color:[UIColor blueColor] - backgroundColor:[UIColor grayColor] - tapAction:^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect){ - NSLog(@"tap text range:..."); - }]; - -Or set the text highlight with your custom config: - - // 1. Create a 'highlight' attribute for text. - YYTextBorder *border = [YYTextBorder borderWithFillColor:[UIColor grayColor] cornerRadius:3]; - - YYTextHighlight *highlight = [YYTextHighlight new]; - [highlight setColor:[UIColor whiteColor]]; - [highlight setBackgroundBorder:highlightBorder]; - highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { - NSLog(@"tap text range:..."); - // you can also set the action handler to YYLabel or YYTextView. - }; - - // 2. Add 'highlight' attribute to a range of text. - [attributedText yy_setTextHighlight:highlight range:highlightRange]; - - // 3. Set text to label or text view. - YYLabel *label = ... - label.attributedText = attributedText - - YYTextView *textView = ... - textView.attributedText = ... - - // 4. Receive user interactive action. - label.highlightTapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { - NSLog(@"tap text range:..."); - }; - label.highlightLongPressAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { - NSLog(@"long press text range:..."); - }; - - @UITextViewDelegate - - (void)textView:(YYTextView *)textView didTapHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange rect:(CGRect)rect { - NSLog(@"tap text range:..."); - } - - (void)textView:(YYTextView *)textView didLongPressHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange rect:(CGRect)rect { - NSLog(@"long press text range:..."); - } - - -### Text attachments - - NSMutableAttributedString *text = [NSMutableAttributedString new]; - UIFont *font = [UIFont systemFontOfSize:16]; - NSMutableAttributedString *attachment = nil; - - // UIImage attachment - UIImage *image = [UIImage imageNamed:@"dribbble64_imageio"]; - attachment = [NSMutableAttributedString yy_attachmentStringWithContent:image contentMode:UIViewContentModeCenter attachmentSize:image.size alignToFont:font alignment:YYTextVerticalAlignmentCenter]; - [text appendAttributedString: attachment]; - - // UIView attachment - UISwitch *switcher = [UISwitch new]; - [switcher sizeToFit]; - attachment = [NSMutableAttributedString yy_attachmentStringWithContent:switcher contentMode:UIViewContentModeBottom attachmentSize:switcher.size alignToFont:font alignment:YYTextVerticalAlignmentCenter]; - [text appendAttributedString: attachment]; - - // CALayer attachment - CASharpLayer *layer = [CASharpLayer layer]; - layer.path = ... - attachment = [NSMutableAttributedString yy_attachmentStringWithContent:layer contentMode:UIViewContentModeBottom attachmentSize:switcher.size alignToFont:font alignment:YYTextVerticalAlignmentCenter]; - [text appendAttributedString: attachment]; - - -### Text layout calculation - - NSAttributedString *text = ... - CGSize size = CGSizeMake(100, CGFLOAT_MAX); - YYTextLayout *layout = [YYTextLayout layoutWithContainerSize:size text:text]; - - // get text bounding - layout.textBoundingRect; // get bounding rect - layout.textBoundingSize; // get bounding size - - // query text layout - [layout lineIndexForPoint:CGPointMake(10,10)]; - [layout closestLineIndexForPoint:CGPointMake(10,10)]; - [layout closestPositionToPoint:CGPointMake(10,10)]; - [layout textRangeAtPoint:CGPointMake(10,10)]; - [layout rectForRange:[YYTextRange rangeWithRange:NSMakeRange(10,2)]]; - [layout selectionRectsForRange:[YYTextRange rangeWithRange:NSMakeRange(10,2)]]; - - // text layout display - YYLabel *label = [YYLabel new]; - label.size = layout.textBoundingSize; - label.textLayout = layout; - - -### Adjust text line position - - // Convenience methods: - // 1. Create a text line position modifier, implements `YYTextLinePositionModifier` protocol. - // 2. Set it to label or text view. - - YYTextLinePositionSimpleModifier *modifier = [YYTextLinePositionSimpleModifier new]; - modifier.fixedLineHeight = 24; - - YYLabel *label = [YYLabel new]; - label.linePositionModifier = modifier; - - // Fully control - YYTextLinePositionSimpleModifier *modifier = [YYTextLinePositionSimpleModifier new]; - modifier.fixedLineHeight = 24; - - YYTextContainer *container = [YYTextContainer new]; - container.size = CGSizeMake(100, CGFLOAT_MAX); - container.linePositionModifier = modifier; - - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:text]; - YYLabel *label = [YYLabel new]; - label.size = layout.textBoundingSize; - label.textLayout = layout; - - -### Asynchronous layout and rendering - - // If you have performance issues, - // you may enable the asynchronous display mode. - YYLabel *label = ... - label.displaysAsynchronously = YES; - - // If you want to get the highest performance, you should do - // text layout with `YYTextLayout` class in background thread. - YYLabel *label = [YYLabel new]; - label.displaysAsynchronously = YES; - label.ignoreCommonProperties = YES; - - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - // Create attributed string. - NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:@"Some Text"]; - text.yy_font = [UIFont systemFontOfSize:16]; - text.yy_color = [UIColor grayColor]; - [text yy_setColor:[UIColor redColor] range:NSMakeRange(0, 4)]; - - // Create text container - YYTextContainer *container = [YYTextContainer new]; - container.size = CGSizeMake(100, CGFLOAT_MAX); - container.maximumNumberOfRows = 0; - - // Generate a text layout. - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:text]; - - dispatch_async(dispatch_get_main_queue(), ^{ - label.size = layout.textBoundingSize; - label.textLayout = layout; - }); - }); - - -### Text container control - - YYLabel *label = ... - label.textContainerPath = [UIBezierPath bezierPathWith...]; - label.exclusionPaths = @[[UIBezierPath bezierPathWith...];,...]; - label.textContainerInset = UIEdgeInsetsMake(...); - label.verticalForm = YES/NO; - - YYTextView *textView = ... - textView.exclusionPaths = @[[UIBezierPath bezierPathWith...];,...]; - textView.textContainerInset = UIEdgeInsetsMake(...); - textView.verticalForm = YES/NO; - -### Text parser - // 1. Create a text parser - - YYTextSimpleEmoticonParser *parser = [YYTextSimpleEmoticonParser new]; - NSMutableDictionary *mapper = [NSMutableDictionary new]; - mapper[@":smile:"] = [UIImage imageNamed:@"smile.png"]; - mapper[@":cool:"] = [UIImage imageNamed:@"cool.png"]; - mapper[@":cry:"] = [UIImage imageNamed:@"cry.png"]; - mapper[@":wink:"] = [UIImage imageNamed:@"wink.png"]; - parser.emoticonMapper = mapper; - - YYTextSimpleMarkdownParser *parser = [YYTextSimpleMarkdownParser new]; - [parser setColorWithDarkTheme]; - - MyCustomParser *parser = ... // custom parser - - // 2. Attach parser to label or text view - YYLabel *label = ... - label.textParser = parser; - - YYTextView *textView = ... - textView.textParser = parser; - -### Debug - - // Set a shared debug option to show text layout result. - YYTextDebugOption *debugOptions = [YYTextDebugOption new]; - debugOptions.baselineColor = [UIColor redColor]; - debugOptions.CTFrameBorderColor = [UIColor redColor]; - debugOptions.CTLineFillColor = [UIColor colorWithRed:0.000 green:0.463 blue:1.000 alpha:0.180]; - debugOptions.CGGlyphBorderColor = [UIColor colorWithRed:1.000 green:0.524 blue:0.000 alpha:0.200]; - [YYTextDebugOption setSharedDebugOption:debugOptions]; - - -### More examples -See `Demo/YYTextDemo.xcodeproj` for more examples: - - - -

    - - - - -Installation -============== - -### CocoaPods - -1. Add `pod 'YYText'` to your Podfile. -2. Run `pod install` or `pod update`. -3. Import \. - - -### Carthage - -1. Add `github "ibireme/YYText"` to your Cartfile. -2. Run `carthage update --platform ios` and add the framework to your project. -3. Import \. - - -### Manually - -1. Download all the files in the `YYText` subdirectory. -2. Add the source files to your Xcode project. -3. Link with required frameworks: - * UIKit - * CoreFoundation - * CoreText - * QuartzCore - * Accelerate - * MobileCoreServices -4. Import `YYText.h`. - - -### Notice -You may add [YYImage](https://github.com/ibireme/YYImage) or [YYWebImage](https://github.com/ibireme/YYWebImage) to your project if you want to support animated image (GIF/APNG/WebP). - - -Documentation -============== -Full API documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/YYText/).
    -You can also install documentation locally using [appledoc](https://github.com/tomaz/appledoc). - - -Requirements -============== -This library requires `iOS 6.0+` and `Xcode 7.0+`. - - -License -============== -YYText is released under the MIT license. See LICENSE file for details. - - -

    ---- -中文介绍 -============== -功能强大的 iOS 富文本编辑与显示框架。
    -(该项目是 [YYKit](https://github.com/ibireme/YYKit) 组件之一) - - -特性 -============== -- API 兼容 UILabel 和 UITextView -- 支持高性能的异步排版和渲染 -- 扩展了 CoreText 的属性以支持更多文字效果 -- 支持 UIImage、UIView、CALayer 作为图文混排元素 -- 支持添加自定义样式的、可点击的文本高亮范围 -- 支持自定义文本解析 (内置简单的 Markdown/表情解析) -- 支持文本容器路径、内部留空路径的控制 -- 支持文字竖排版,可用于编辑和显示中日韩文本 -- 支持图片和富文本的复制粘贴 -- 文本编辑时,支持富文本占位符 -- 支持自定义键盘视图 -- 撤销和重做次数的控制 -- 富文本的序列化与反序列化支持 -- 支持多语言,支持 VoiceOver -- 支持 Interface Builder -- 全部代码都有文档注释 - - -架构 -============== -YYText 和 TextKit 架构对比 - - - - -文本属性 -============== - -### YYText 原生支持的属性 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DemoAttribute NameClass
    TextAttachmentYYTextAttachment
    TextHighlightYYTextHighlight
    TextBindingYYTextBinding
    TextShadow
    TextInnerShadow
    YYTextShadow
    TextBorderYYTextBorder
    TextBackgroundBorderYYTextBorder
    TextBlockBorderYYTextBorder
    TextGlyphTransform NSValue(CGAffineTransform)
    TextUnderlineYYTextDecoration
    TextStrickthroughYYTextDecoration
    TextBackedStringYYTextBackedString
    - -###YYText 支持的 CoreText 属性 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DemoAttribute NameClass
    Font UIFont(CTFontRef)
    Kern NSNumber
    StrokeWidth NSNumber
    StrokeColor CGColorRef
    Shadow NSShadow
    Ligature NSNumber
    VerticalGlyphForm NSNumber(BOOL)
    WritingDirection NSArray(NSNumber)
    RunDelegate CTRunDelegateRef
    TextAlignment NSParagraphStyle
    (NSTextAlignment)
    LineBreakMode NSParagraphStyle
    (NSLineBreakMode)
    LineSpacing NSParagraphStyle
    (CGFloat)
    ParagraphSpacing
    ParagraphSpacingBefore
    NSParagraphStyle
    (CGFloat)
    FirstLineHeadIndent NSParagraphStyle
    (CGFloat)
    HeadIndent NSParagraphStyle
    (CGFloat)
    TailIndent NSParagraphStyle
    (CGFloat)
    MinimumLineHeight NSParagraphStyle
    (CGFloat)
    MaximumLineHeight NSParagraphStyle
    (CGFloat)
    LineHeightMultiple NSParagraphStyle
    (CGFloat)
    BaseWritingDirection NSParagraphStyle
    (NSWritingDirection)
    DefaultTabInterval
    TabStops
    NSParagraphStyle
    CGFloat/NSArray(NSTextTab)
    - - -用法 -============== - -### 基本用法 - // YYLabel (和 UILabel 用法一致) - YYLabel *label = [YYLabel new]; - label.frame = ... - label.font = ... - label.textColor = ... - label.textAlignment = ... - label.lineBreakMode = ... - label.numberOfLines = ... - label.text = ... - - // YYTextView (和 UITextView 用法一致) - YYTextView *textView = [YYTextView new]; - textView.frame = ... - textView.font = ... - textView.textColor = ... - textView.dataDetectorTypes = ... - textView.placeHolderText = ... - textView.placeHolderTextColor = ... - textView.delegate = ... - - -### 属性文本 - - // 1. 创建一个属性文本 - NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:@"Some Text, blabla..."]; - - // 2. 为文本设置属性 - text.yy_font = [UIFont boldSystemFontOfSize:30]; - text.yy_color = [UIColor blueColor]; - [text yy_setColor:[UIColor redColor] range:NSMakeRange(0, 4)]; - text.yy_lineSpacing = 10; - - // 3. 赋值到 YYLabel 或 YYTextView - YYLabel *label = [YYLabel new]; - label.frame = ... - label.attributedString = text; - - YYTextView *textView = [YYTextView new]; - textView.frame = ... - textView.attributedString = text; - - -### 文本高亮 - -你可以用一些已经封装好的简便方法来设置文本高亮: - - [text yy_setTextHighlightRange:range - color:[UIColor blueColor] - backgroundColor:[UIColor grayColor] - tapAction:^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect){ - NSLog(@"tap text range:..."); - }]; - -或者用更复杂的办法来调节文本高亮的细节: - - // 1. 创建一个"高亮"属性,当用户点击了高亮区域的文本时,"高亮"属性会替换掉原本的属性 - YYTextBorder *border = [YYTextBorder borderWithFillColor:[UIColor grayColor] cornerRadius:3]; - - YYTextHighlight *highlight = [YYTextHighlight new]; - [highlight setColor:[UIColor whiteColor]]; - [highlight setBackgroundBorder:highlightBorder]; - highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { - NSLog(@"tap text range:..."); - // 你也可以把事件回调放到 YYLabel 和 YYTextView 来处理。 - }; - - // 2. 把"高亮"属性设置到某个文本范围 - [attributedText yy_setTextHighlight:highlight range:highlightRange]; - - // 3. 把属性文本设置到 YYLabel 或 YYTextView - YYLabel *label = ... - label.attributedText = attributedText - - YYTextView *textView = ... - textView.attributedText = ... - - // 4. 接受事件回调 - label.highlightTapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { - NSLog(@"tap text range:..."); - }; - label.highlightLongPressAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { - NSLog(@"long press text range:..."); - }; - - @UITextViewDelegate - - (void)textView:(YYTextView *)textView didTapHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange rect:(CGRect)rect { - NSLog(@"tap text range:..."); - } - - (void)textView:(YYTextView *)textView didLongPressHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange rect:(CGRect)rect { - NSLog(@"long press text range:..."); - } - - -### 图文混排 - - NSMutableAttributedString *text = [NSMutableAttributedString new]; - UIFont *font = [UIFont systemFontOfSize:16]; - NSMutableAttributedString *attachment = nil; - - // 嵌入 UIImage - UIImage *image = [UIImage imageNamed:@"dribbble64_imageio"]; - attachment = [NSMutableAttributedString yy_attachmentStringWithContent:image contentMode:UIViewContentModeCenter attachmentSize:image.size alignToFont:font alignment:YYTextVerticalAlignmentCenter]; - [text appendAttributedString: attachment]; - - // 嵌入 UIView - UISwitch *switcher = [UISwitch new]; - [switcher sizeToFit]; - attachment = [NSMutableAttributedString yy_attachmentStringWithContent:switcher contentMode:UIViewContentModeBottom attachmentSize:switcher.size alignToFont:font alignment:YYTextVerticalAlignmentCenter]; - [text appendAttributedString: attachment]; - - // 嵌入 CALayer - CASharpLayer *layer = [CASharpLayer layer]; - layer.path = ... - attachment = [NSMutableAttributedString yy_attachmentStringWithContent:layer contentMode:UIViewContentModeBottom attachmentSize:switcher.size alignToFont:font alignment:YYTextVerticalAlignmentCenter]; - [text appendAttributedString: attachment]; - - -### 文本布局计算 - - NSAttributedString *text = ... - CGSize size = CGSizeMake(100, CGFLOAT_MAX); - YYTextLayout *layout = [YYTextLayout layoutWithContainerSize:size text:text]; - - // 获取文本显示位置和大小 - layout.textBoundingRect; // get bounding rect - layout.textBoundingSize; // get bounding size - - // 查询文本排版结果 - [layout lineIndexForPoint:CGPointMake(10,10)]; - [layout closestLineIndexForPoint:CGPointMake(10,10)]; - [layout closestPositionToPoint:CGPointMake(10,10)]; - [layout textRangeAtPoint:CGPointMake(10,10)]; - [layout rectForRange:[YYTextRange rangeWithRange:NSMakeRange(10,2)]]; - [layout selectionRectsForRange:[YYTextRange rangeWithRange:NSMakeRange(10,2)]]; - - // 显示文本排版结果 - YYLabel *label = [YYLabel new]; - label.size = layout.textBoundingSize; - label.textLayout = layout; - - -### 文本行位置调整 - - // 由于中文、英文、Emoji 等字体高度不一致,或者富文本中出现了不同字号的字体, - // 可能会造成每行文字的高度不一致。这里可以添加一个修改器来实现固定行高,或者自定义文本行位置。 - - // 简单的方法: - // 1. 创建一个文本行位置修改类,实现 `YYTextLinePositionModifier` 协议。 - // 2. 设置到 Label 或 TextView。 - - YYTextLinePositionSimpleModifier *modifier = [YYTextLinePositionSimpleModifier new]; - modifier.fixedLineHeight = 24; - - YYLabel *label = [YYLabel new]; - label.linePositionModifier = modifier; - - // 完全控制: - YYTextLinePositionSimpleModifier *modifier = [YYTextLinePositionSimpleModifier new]; - modifier.fixedLineHeight = 24; - - YYTextContainer *container = [YYTextContainer new]; - container.size = CGSizeMake(100, CGFLOAT_MAX); - container.linePositionModifier = modifier; - - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:text]; - YYLabel *label = [YYLabel new]; - label.size = layout.textBoundingSize; - label.textLayout = layout; - - -### 异步排版和渲染 - - // 如果你在显示字符串时有性能问题,可以这样开启异步模式: - YYLabel *label = ... - label.displaysAsynchronously = YES; - - // 如果需要获得最高的性能,你可以在后台线程用 `YYTextLayout` 进行预排版: - YYLabel *label = [YYLabel new]; - label.displaysAsynchronously = YES; //开启异步绘制 - label.ignoreCommonProperties = YES; //忽略除了 textLayout 之外的其他属性 - - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - // 创建属性字符串 - NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:@"Some Text"]; - text.yy_font = [UIFont systemFontOfSize:16]; - text.yy_color = [UIColor grayColor]; - [text yy_setColor:[UIColor redColor] range:NSMakeRange(0, 4)]; - - // 创建文本容器 - YYTextContainer *container = [YYTextContainer new]; - container.size = CGSizeMake(100, CGFLOAT_MAX); - container.maximumNumberOfRows = 0; - - // 生成排版结果 - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:text]; - - dispatch_async(dispatch_get_main_queue(), ^{ - label.size = layout.textBoundingSize; - label.textLayout = layout; - }); - }); - - -### 文本容器控制 - - YYLabel *label = ... - label.textContainerPath = [UIBezierPath bezierPathWith...]; - label.exclusionPaths = @[[UIBezierPath bezierPathWith...];,...]; - label.textContainerInset = UIEdgeInsetsMake(...); - label.verticalForm = YES/NO; - - YYTextView *textView = ... - textView.exclusionPaths = @[[UIBezierPath bezierPathWith...];,...]; - textView.textContainerInset = UIEdgeInsetsMake(...); - textView.verticalForm = YES/NO; - - -### 文本解析 - // 1. 创建一个解析器 - - // 内置简单的表情解析 - YYTextSimpleEmoticonParser *parser = [YYTextSimpleEmoticonParser new]; - NSMutableDictionary *mapper = [NSMutableDictionary new]; - mapper[@":smile:"] = [UIImage imageNamed:@"smile.png"]; - mapper[@":cool:"] = [UIImage imageNamed:@"cool.png"]; - mapper[@":cry:"] = [UIImage imageNamed:@"cry.png"]; - mapper[@":wink:"] = [UIImage imageNamed:@"wink.png"]; - parser.emoticonMapper = mapper; - - // 内置简单的 markdown 解析 - YYTextSimpleMarkdownParser *parser = [YYTextSimpleMarkdownParser new]; - [parser setColorWithDarkTheme]; - - // 实现 `YYTextParser` 协议的自定义解析器 - MyCustomParser *parser = ... - - // 2. 把解析器添加到 YYLabel 或 YYTextView - YYLabel *label = ... - label.textParser = parser; - - YYTextView *textView = ... - textView.textParser = parser; - -### Debug - - // 设置一个全局的 debug option 来显示排版结果。 - YYTextDebugOption *debugOptions = [YYTextDebugOption new]; - debugOptions.baselineColor = [UIColor redColor]; - debugOptions.CTFrameBorderColor = [UIColor redColor]; - debugOptions.CTLineFillColor = [UIColor colorWithRed:0.000 green:0.463 blue:1.000 alpha:0.180]; - debugOptions.CGGlyphBorderColor = [UIColor colorWithRed:1.000 green:0.524 blue:0.000 alpha:0.200]; - [YYTextDebugOption setSharedDebugOption:debugOptions]; - -### 更多示例 -查看演示工程 `Demo/YYTextDemo.xcodeproj`: - - - -

    - - - - -安装 -============== - -### CocoaPods - -1. 在 Podfile 中添加 `pod 'YYText'`。 -2. 执行 `pod install` 或 `pod update`。 -3. 导入 \。 - - -### Carthage - -1. 在 Cartfile 中添加 `github "ibireme/YYText"`。 -2. 执行 `carthage update --platform ios` 并将生成的 framework 添加到你的工程。 -3. 导入 \。 - - -### 手动安装 - -1. 下载 YYText 文件夹内的所有内容。 -2. 将 YYText 内的源文件添加(拖放)到你的工程。 -3. 链接以下 frameworks: - * UIKit - * CoreFoundation - * CoreText - * QuartzCore - * Accelerate - * MobileCoreServices -4. 导入 `YYText.h`。 - - -### 注意 -你可以添加 [YYImage](https://github.com/ibireme/YYImage) 或 [YYWebImage](https://github.com/ibireme/YYWebImage) 到你的工程,以支持动画格式(GIF/APNG/WebP)的图片。 - - -文档 -============== -你可以在 [CocoaDocs](http://cocoadocs.org/docsets/YYText/) 查看在线 API 文档,也可以用 [appledoc](https://github.com/tomaz/appledoc) 本地生成文档。 - - -系统要求 -============== -该项目最低支持 `iOS 6.0` 和 `Xcode 7.0`。 - - -已知问题 -============== -* YYText 并不能支持所有 CoreText/TextKit 的属性,比如 NSBackgroundColor、NSStrikethrough、NSUnderline、NSAttachment、NSLink 等,但 YYText 中基本都有对应属性作为替代。详情见上方表格。 -* YYTextView 未实现局部刷新,所以在输入和编辑大量的文本(比如超过大概五千个汉字、或大概一万个英文字符)时会出现较明显的卡顿现象。 -* 竖排版时,添加 exclusionPaths 在少数情况下可能会导致文本显示空白。 -* 当添加了非矩形的 textContainerPath,并且有嵌入大于文本排版方向宽度的 RunDelegate 时,RunDelegate 之后的文字会无法显示。这是 CoreText 的 Bug(或者说是 Feature)。 - -许可证 -============== -YYText 使用 MIT 许可证,详情见 LICENSE 文件。 - - diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextContainerView.h b/iOSProject/Pods/YYText/YYText/Component/YYTextContainerView.h deleted file mode 100644 index 66cd909f..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextContainerView.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// YYTextContainerView.h -// YYText -// -// Created by ibireme on 15/4/21. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -#import -#else -#import "YYTextLayout.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - -/** - A simple view to diaplay `YYTextLayout`. - - @discussion This view can become first responder. If this view is first responder, - all the action (such as UIMenu's action) would forward to the `hostView` property. - Typically, you should not use this class directly. - - @warning All the methods in this class should be called on main thread. - */ -@interface YYTextContainerView : UIView - -/// First responder's aciton will forward to this view. -@property (nullable, nonatomic, weak) UIView *hostView; - -/// Debug option for layout debug. Set this property will let the view redraw it's contents. -@property (nullable, nonatomic, copy) YYTextDebugOption *debugOption; - -/// Text vertical alignment. -@property (nonatomic) YYTextVerticalAlignment textVerticalAlignment; - -/// Text layout. Set this property will let the view redraw it's contents. -@property (nullable, nonatomic, strong) YYTextLayout *layout; - -/// The contents fade animation duration when the layout's contents changed. Default is 0 (no animation). -@property (nonatomic) NSTimeInterval contentsFadeDuration; - -/// Convenience method to set `layout` and `contentsFadeDuration`. -/// @param layout Same as `layout` property. -/// @param fadeDuration Same as `contentsFadeDuration` property. -- (void)setLayout:(nullable YYTextLayout *)layout withFadeDuration:(NSTimeInterval)fadeDuration; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextContainerView.m b/iOSProject/Pods/YYText/YYText/Component/YYTextContainerView.m deleted file mode 100644 index e3b7ee82..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextContainerView.m +++ /dev/null @@ -1,144 +0,0 @@ -// -// YYTextContainerView.m -// YYText -// -// Created by ibireme on 15/4/21. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextContainerView.h" - -@implementation YYTextContainerView { - BOOL _attachmentChanged; - NSMutableArray *_attachmentViews; - NSMutableArray *_attachmentLayers; -} - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (!self) return nil; - self.backgroundColor = [UIColor clearColor]; - _attachmentViews = [NSMutableArray array]; - _attachmentLayers = [NSMutableArray array]; - return self; -} - -- (void)setDebugOption:(YYTextDebugOption *)debugOption { - BOOL needDraw = _debugOption.needDrawDebug; - _debugOption = debugOption.copy; - if (_debugOption.needDrawDebug != needDraw) { - [self setNeedsDisplay]; - } -} - -- (void)setTextVerticalAlignment:(YYTextVerticalAlignment)textVerticalAlignment { - if (_textVerticalAlignment == textVerticalAlignment) return; - _textVerticalAlignment = textVerticalAlignment; - [self setNeedsDisplay]; -} - -- (void)setContentsFadeDuration:(NSTimeInterval)contentsFadeDuration { - if (_contentsFadeDuration == contentsFadeDuration) return; - _contentsFadeDuration = contentsFadeDuration; - if (contentsFadeDuration <= 0) { - [self.layer removeAnimationForKey:@"contents"]; - } -} - -- (void)setLayout:(YYTextLayout *)layout { - if (_layout == layout) return; - _layout = layout; - _attachmentChanged = YES; - [self setNeedsDisplay]; -} - -- (void)setLayout:(YYTextLayout *)layout withFadeDuration:(NSTimeInterval)fadeDuration { - self.contentsFadeDuration = fadeDuration; - self.layout = layout; -} - -- (void)drawRect:(CGRect)rect { - // fade content - [self.layer removeAnimationForKey:@"contents"]; - if (_contentsFadeDuration > 0) { - CATransition *transition = [CATransition animation]; - transition.duration = _contentsFadeDuration; - transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; - transition.type = kCATransitionFade; - [self.layer addAnimation:transition forKey:@"contents"]; - } - - // update attachment - if (_attachmentChanged) { - for (UIView *view in _attachmentViews) { - if (view.superview == self) [view removeFromSuperview]; - } - for (CALayer *layer in _attachmentLayers) { - if (layer.superlayer == self.layer) [layer removeFromSuperlayer]; - } - [_attachmentViews removeAllObjects]; - [_attachmentLayers removeAllObjects]; - } - - // draw layout - CGSize boundingSize = _layout.textBoundingSize; - CGPoint point = CGPointZero; - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - if (_layout.container.isVerticalForm) { - point.x = -(self.bounds.size.width - boundingSize.width) * 0.5; - } else { - point.y = (self.bounds.size.height - boundingSize.height) * 0.5; - } - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - if (_layout.container.isVerticalForm) { - point.x = -(self.bounds.size.width - boundingSize.width); - } else { - point.y = (self.bounds.size.height - boundingSize.height); - } - } - [_layout drawInContext:UIGraphicsGetCurrentContext() size:self.bounds.size point:point view:self layer:self.layer debug:_debugOption cancel:nil]; - - // update attachment - if (_attachmentChanged) { - _attachmentChanged = NO; - for (YYTextAttachment *a in _layout.attachments) { - if ([a.content isKindOfClass:[UIView class]]) [_attachmentViews addObject:a.content]; - if ([a.content isKindOfClass:[CALayer class]]) [_attachmentLayers addObject:a.content]; - } - } -} - -- (void)setFrame:(CGRect)frame { - CGSize oldSize = self.bounds.size; - [super setFrame:frame]; - if (!CGSizeEqualToSize(oldSize, self.bounds.size)) { - [self setNeedsLayout]; - } -} - -- (void)setBounds:(CGRect)bounds { - CGSize oldSize = self.bounds.size; - [super setBounds:bounds]; - if (!CGSizeEqualToSize(oldSize, self.bounds.size)) { - [self setNeedsLayout]; - } -} - -#pragma mark - UIResponder forward - -- (BOOL)canBecomeFirstResponder { - return YES; -} - -- (BOOL)canPerformAction:(SEL)action withSender:(id)sender { - return [self.hostView canPerformAction:action withSender:sender]; -} - -- (id)forwardingTargetForSelector:(SEL)aSelector { - return self.hostView; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextDebugOption.h b/iOSProject/Pods/YYText/YYText/Component/YYTextDebugOption.h deleted file mode 100644 index f7063510..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextDebugOption.h +++ /dev/null @@ -1,95 +0,0 @@ -// -// YYTextDebugOption.h -// YYText -// -// Created by ibireme on 15/4/8. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -@class YYTextDebugOption; - -NS_ASSUME_NONNULL_BEGIN - -/** - The YYTextDebugTarget protocol defines the method a debug target should implement. - A debug target can be add to the global container to receive the shared debug - option changed notification. - */ -@protocol YYTextDebugTarget - -@required -/** - When the shared debug option changed, this method would be called on main thread. - It should return as quickly as possible. The option's property should not be changed - in this method. - - @param option The shared debug option. - */ -- (void)setDebugOption:(nullable YYTextDebugOption *)option; -@end - - - -/** - The debug option for YYText. - */ -@interface YYTextDebugOption : NSObject -@property (nullable, nonatomic, strong) UIColor *baselineColor; ///< baseline color -@property (nullable, nonatomic, strong) UIColor *CTFrameBorderColor; ///< CTFrame path border color -@property (nullable, nonatomic, strong) UIColor *CTFrameFillColor; ///< CTFrame path fill color -@property (nullable, nonatomic, strong) UIColor *CTLineBorderColor; ///< CTLine bounds border color -@property (nullable, nonatomic, strong) UIColor *CTLineFillColor; ///< CTLine bounds fill color -@property (nullable, nonatomic, strong) UIColor *CTLineNumberColor; ///< CTLine line number color -@property (nullable, nonatomic, strong) UIColor *CTRunBorderColor; ///< CTRun bounds border color -@property (nullable, nonatomic, strong) UIColor *CTRunFillColor; ///< CTRun bounds fill color -@property (nullable, nonatomic, strong) UIColor *CTRunNumberColor; ///< CTRun number color -@property (nullable, nonatomic, strong) UIColor *CGGlyphBorderColor; ///< CGGlyph bounds border color -@property (nullable, nonatomic, strong) UIColor *CGGlyphFillColor; ///< CGGlyph bounds fill color - -- (BOOL)needDrawDebug; ///< `YES`: at least one debug color is visible. `NO`: all debug color is invisible/nil. -- (void)clear; ///< Set all debug color to nil. - -/** - Add a debug target. - - @discussion When `setSharedDebugOption:` is called, all added debug target will - receive `setDebugOption:` in main thread. It maintains an unsafe_unretained - reference to this target. The target must to removed before dealloc. - - @param target A debug target. - */ -+ (void)addDebugTarget:(id)target; - -/** - Remove a debug target which is added by `addDebugTarget:`. - - @param target A debug target. - */ -+ (void)removeDebugTarget:(id)target; - -/** - Returns the shared debug option. - - @return The shared debug option, default is nil. - */ -+ (nullable YYTextDebugOption *)sharedDebugOption; - -/** - Set a debug option as shared debug option. - This method must be called on main thread. - - @discussion When call this method, the new option will set to all debug target - which is added by `addDebugTarget:`. - - @param option A new debug option (nil is valid). - */ -+ (void)setSharedDebugOption:(nullable YYTextDebugOption *)option; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextDebugOption.m b/iOSProject/Pods/YYText/YYText/Component/YYTextDebugOption.m deleted file mode 100644 index 5eaaa737..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextDebugOption.m +++ /dev/null @@ -1,140 +0,0 @@ -// -// YYTextDebugOption.m -// YYText -// -// Created by ibireme on 15/4/8. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextDebugOption.h" -#import "YYTextWeakProxy.h" -#import -#import - -static pthread_mutex_t _sharedDebugLock; -static CFMutableSetRef _sharedDebugTargets = nil; -static YYTextDebugOption *_sharedDebugOption = nil; - -static const void* _sharedDebugSetRetain(CFAllocatorRef allocator, const void *value) { - return value; -} - -static void _sharedDebugSetRelease(CFAllocatorRef allocator, const void *value) { -} - -void _sharedDebugSetFunction(const void *value, void *context) { - id target = (__bridge id)(value); - [target setDebugOption:_sharedDebugOption]; -} - -static void _initSharedDebug() { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - pthread_mutex_init(&_sharedDebugLock, NULL); - CFSetCallBacks callbacks = kCFTypeSetCallBacks; - callbacks.retain = _sharedDebugSetRetain; - callbacks.release = _sharedDebugSetRelease; - _sharedDebugTargets = CFSetCreateMutable(CFAllocatorGetDefault(), 0, &callbacks); - }); -} - -static void _setSharedDebugOption(YYTextDebugOption *option) { - _initSharedDebug(); - pthread_mutex_lock(&_sharedDebugLock); - _sharedDebugOption = option.copy; - CFSetApplyFunction(_sharedDebugTargets, _sharedDebugSetFunction, NULL); - pthread_mutex_unlock(&_sharedDebugLock); -} - -static YYTextDebugOption *_getSharedDebugOption() { - _initSharedDebug(); - pthread_mutex_lock(&_sharedDebugLock); - YYTextDebugOption *op = _sharedDebugOption; - pthread_mutex_unlock(&_sharedDebugLock); - return op; -} - -static void _addDebugTarget(id target) { - _initSharedDebug(); - pthread_mutex_lock(&_sharedDebugLock); - CFSetAddValue(_sharedDebugTargets, (__bridge const void *)(target)); - pthread_mutex_unlock(&_sharedDebugLock); -} - -static void _removeDebugTarget(id target) { - _initSharedDebug(); - pthread_mutex_lock(&_sharedDebugLock); - CFSetRemoveValue(_sharedDebugTargets, (__bridge const void *)(target)); - pthread_mutex_unlock(&_sharedDebugLock); -} - - -@implementation YYTextDebugOption - -- (id)copyWithZone:(NSZone *)zone { - YYTextDebugOption *op = [self.class new]; - op.baselineColor = self.baselineColor; - op.CTFrameBorderColor = self.CTFrameBorderColor; - op.CTFrameFillColor = self.CTFrameFillColor; - op.CTLineBorderColor = self.CTLineBorderColor; - op.CTLineFillColor = self.CTLineFillColor; - op.CTLineNumberColor = self.CTLineNumberColor; - op.CTRunBorderColor = self.CTRunBorderColor; - op.CTRunFillColor = self.CTRunFillColor; - op.CTRunNumberColor = self.CTRunNumberColor; - op.CGGlyphBorderColor = self.CGGlyphBorderColor; - op.CGGlyphFillColor = self.CGGlyphFillColor; - return op; -} - -- (BOOL)needDrawDebug { - if (self.baselineColor || - self.CTFrameBorderColor || - self.CTFrameFillColor || - self.CTLineBorderColor || - self.CTLineFillColor || - self.CTLineNumberColor || - self.CTRunBorderColor || - self.CTRunFillColor || - self.CTRunNumberColor || - self.CGGlyphBorderColor || - self.CGGlyphFillColor) return YES; - return NO; -} - -- (void)clear { - self.baselineColor = nil; - self.CTFrameBorderColor = nil; - self.CTFrameFillColor = nil; - self.CTLineBorderColor = nil; - self.CTLineFillColor = nil; - self.CTLineNumberColor = nil; - self.CTRunBorderColor = nil; - self.CTRunFillColor = nil; - self.CTRunNumberColor = nil; - self.CGGlyphBorderColor = nil; - self.CGGlyphFillColor = nil; -} - -+ (void)addDebugTarget:(id)target { - if (target) _addDebugTarget(target); -} - -+ (void)removeDebugTarget:(id)target { - if (target) _removeDebugTarget(target); -} - -+ (YYTextDebugOption *)sharedDebugOption { - return _getSharedDebugOption(); -} - -+ (void)setSharedDebugOption:(YYTextDebugOption *)option { - NSAssert([NSThread isMainThread], @"This method must be called on the main thread"); - _setSharedDebugOption(option); -} - -@end - diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextEffectWindow.h b/iOSProject/Pods/YYText/YYText/Component/YYTextEffectWindow.h deleted file mode 100644 index 27cc4c10..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextEffectWindow.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// YYTextEffectWindow.h -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -#import -#import -#else -#import "YYTextMagnifier.h" -#import "YYTextSelectionView.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - -/** - A window to display magnifier and extra contents for text view. - - @discussion Use `sharedWindow` to get the instance, don't create your own instance. - Typically, you should not use this class directly. - */ -@interface YYTextEffectWindow : UIWindow - -/// Returns the shared instance (returns nil in App Extension). -+ (nullable instancetype)sharedWindow; - -/// Show the magnifier in this window with a 'popup' animation. @param mag A magnifier. -- (void)showMagnifier:(YYTextMagnifier *)mag; -/// Update the magnifier content and position. @param mag A magnifier. -- (void)moveMagnifier:(YYTextMagnifier *)mag; -/// Remove the magnifier from this window with a 'shrink' animation. @param mag A magnifier. -- (void)hideMagnifier:(YYTextMagnifier *)mag; - - -/// Show the selection dot in this window if the dot is clipped by the selection view. -/// @param selection A selection view. -- (void)showSelectionDot:(YYTextSelectionView *)selection; -/// Remove the selection dot from this window. -/// @param selection A selection view. -- (void)hideSelectionDot:(YYTextSelectionView *)selection; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextEffectWindow.m b/iOSProject/Pods/YYText/YYText/Component/YYTextEffectWindow.m deleted file mode 100644 index 96cfea00..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextEffectWindow.m +++ /dev/null @@ -1,429 +0,0 @@ -// -// YYTextEffectWindow.m -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextEffectWindow.h" -#import "YYTextKeyboardManager.h" -#import "YYTextUtilities.h" -#import "UIView+YYText.h" - - -@implementation YYTextEffectWindow - -+ (instancetype)sharedWindow { - static YYTextEffectWindow *one = nil; - if (one == nil) { - // iOS 9 compatible - NSString *mode = [NSRunLoop currentRunLoop].currentMode; - if (mode.length == 27 && - [mode hasPrefix:@"UI"] && - [mode hasSuffix:@"InitializationRunLoopMode"]) { - return nil; - } - } - - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - if (!YYTextIsAppExtension()) { - one = [self new]; - one.frame = (CGRect){.size = YYTextScreenSize()}; - one.userInteractionEnabled = NO; - one.windowLevel = UIWindowLevelStatusBar + 1; - one.hidden = NO; - - // for iOS 9: - one.opaque = NO; - one.backgroundColor = [UIColor clearColor]; - one.layer.backgroundColor = [UIColor clearColor].CGColor; - } - }); - return one; -} - -// stop self from becoming the KeyWindow -- (void)becomeKeyWindow { - [[YYTextSharedApplication().delegate window] makeKeyWindow]; -} - -- (UIViewController *)rootViewController { - for (UIWindow *window in [YYTextSharedApplication() windows]) { - if (self == window) continue; - if (window.hidden) continue; - UIViewController *topViewController = window.rootViewController; - if (topViewController) return topViewController; - } - UIViewController *viewController = [super rootViewController]; - if (!viewController) { - viewController = [UIViewController new]; - [super setRootViewController:viewController]; - } - return viewController; -} - -// Bring self to front -- (void)_updateWindowLevel { - UIApplication *app = YYTextSharedApplication(); - if (!app) return; - - UIWindow *top = app.windows.lastObject; - UIWindow *key = app.keyWindow; - if (key && key.windowLevel > top.windowLevel) top = key; - if (top == self) return; - self.windowLevel = top.windowLevel + 1; -} - -- (YYTextDirection)_keyboardDirection { - CGRect keyboardFrame = [YYTextKeyboardManager defaultManager].keyboardFrame; - keyboardFrame = [[YYTextKeyboardManager defaultManager] convertRect:keyboardFrame toView:self]; - if (CGRectIsNull(keyboardFrame) || CGRectIsEmpty(keyboardFrame)) return YYTextDirectionNone; - - if (CGRectGetMinY(keyboardFrame) == 0 && - CGRectGetMinX(keyboardFrame) == 0 && - CGRectGetMaxX(keyboardFrame) == CGRectGetWidth(self.frame)) - return YYTextDirectionTop; - - if (CGRectGetMaxX(keyboardFrame) == CGRectGetWidth(self.frame) && - CGRectGetMinY(keyboardFrame) == 0 && - CGRectGetMaxY(keyboardFrame) == CGRectGetHeight(self.frame)) - return YYTextDirectionRight; - - if (CGRectGetMaxY(keyboardFrame) == CGRectGetHeight(self.frame) && - CGRectGetMinX(keyboardFrame) == 0 && - CGRectGetMaxX(keyboardFrame) == CGRectGetWidth(self.frame)) - return YYTextDirectionBottom; - - if (CGRectGetMinX(keyboardFrame) == 0 && - CGRectGetMinY(keyboardFrame) == 0 && - CGRectGetMaxY(keyboardFrame) == CGRectGetHeight(self.frame)) - return YYTextDirectionLeft; - - return YYTextDirectionNone; -} - -- (CGPoint)_correctedCaptureCenter:(CGPoint)center{ - CGRect keyboardFrame = [YYTextKeyboardManager defaultManager].keyboardFrame; - keyboardFrame = [[YYTextKeyboardManager defaultManager] convertRect:keyboardFrame toView:self]; - if (!CGRectIsNull(keyboardFrame) && !CGRectIsEmpty(keyboardFrame)) { - YYTextDirection direction = [self _keyboardDirection]; - switch (direction) { - case YYTextDirectionTop: { - if (center.y < CGRectGetMaxY(keyboardFrame)) center.y = CGRectGetMaxY(keyboardFrame); - } break; - case YYTextDirectionRight: { - if (center.x > CGRectGetMinX(keyboardFrame)) center.x = CGRectGetMinX(keyboardFrame); - } break; - case YYTextDirectionBottom: { - if (center.y > CGRectGetMinY(keyboardFrame)) center.y = CGRectGetMinY(keyboardFrame); - } break; - case YYTextDirectionLeft: { - if (center.x < CGRectGetMaxX(keyboardFrame)) center.x = CGRectGetMaxX(keyboardFrame); - } break; - default: break; - } - } - return center; -} - -- (CGPoint)_correctedCenter:(CGPoint)center forMagnifier:(YYTextMagnifier *)mag rotation:(CGFloat)rotation { - CGFloat degree = YYTextRadiansToDegrees(rotation); - - degree /= 45.0; - if (degree < 0) degree += (int)(-degree/8.0 + 1) * 8; - if (degree > 8) degree -= (int)(degree/8.0) * 8; - - CGFloat caretExt = 10; - if (degree <= 1 || degree >= 7) { //top - if (mag.type == YYTextMagnifierTypeCaret) { - if (center.y < caretExt) - center.y = caretExt; - } else if (mag.type == YYTextMagnifierTypeRanged) { - if (center.y < mag.bounds.size.height) - center.y = mag.bounds.size.height; - } - } else if (1 < degree && degree < 3) { // right - if (mag.type == YYTextMagnifierTypeCaret) { - if (center.x > self.bounds.size.width - caretExt) - center.x = self.bounds.size.width - caretExt; - } else if (mag.type == YYTextMagnifierTypeRanged) { - if (center.x > self.bounds.size.width - mag.bounds.size.height) - center.x = self.bounds.size.width - mag.bounds.size.height; - } - } else if (3 <= degree && degree <= 5) { // bottom - if (mag.type == YYTextMagnifierTypeCaret) { - if (center.y > self.bounds.size.height - caretExt) - center.y = self.bounds.size.height - caretExt; - } else if (mag.type == YYTextMagnifierTypeRanged) { - if (center.y > mag.bounds.size.height) - center.y = mag.bounds.size.height; - } - } else if (5 < degree && degree < 7) { // left - if (mag.type == YYTextMagnifierTypeCaret) { - if (center.x < caretExt) - center.x = caretExt; - } else if (mag.type == YYTextMagnifierTypeRanged) { - if (center.x < mag.bounds.size.height) - center.x = mag.bounds.size.height; - } - } - - - CGRect keyboardFrame = [YYTextKeyboardManager defaultManager].keyboardFrame; - keyboardFrame = [[YYTextKeyboardManager defaultManager] convertRect:keyboardFrame toView:self]; - if (!CGRectIsNull(keyboardFrame) && !CGRectIsEmpty(keyboardFrame)) { - YYTextDirection direction = [self _keyboardDirection]; - switch (direction) { - case YYTextDirectionTop: { - if (mag.type == YYTextMagnifierTypeCaret) { - if (center.y - mag.bounds.size.height / 2 < CGRectGetMaxY(keyboardFrame)) - center.y = CGRectGetMaxY(keyboardFrame) + mag.bounds.size.height / 2; - } else if (mag.type == YYTextMagnifierTypeRanged) { - if (center.y < CGRectGetMaxY(keyboardFrame)) center.y = CGRectGetMaxY(keyboardFrame); - } - } break; - case YYTextDirectionRight: { - if (mag.type == YYTextMagnifierTypeCaret) { - if (center.x + mag.bounds.size.height / 2 > CGRectGetMinX(keyboardFrame)) - center.x = CGRectGetMinX(keyboardFrame) - mag.bounds.size.width / 2; - } else if (mag.type == YYTextMagnifierTypeRanged) { - if (center.x > CGRectGetMinX(keyboardFrame)) center.x = CGRectGetMinX(keyboardFrame); - } - } break; - case YYTextDirectionBottom: { - if (mag.type == YYTextMagnifierTypeCaret) { - if (center.y + mag.bounds.size.height / 2 > CGRectGetMinY(keyboardFrame)) - center.y = CGRectGetMinY(keyboardFrame) - mag.bounds.size.height / 2; - } else if (mag.type == YYTextMagnifierTypeRanged) { - if (center.y > CGRectGetMinY(keyboardFrame)) center.y = CGRectGetMinY(keyboardFrame); - } - } break; - case YYTextDirectionLeft: { - if (mag.type == YYTextMagnifierTypeCaret) { - if (center.x - mag.bounds.size.height / 2 < CGRectGetMaxX(keyboardFrame)) - center.x = CGRectGetMaxX(keyboardFrame) + mag.bounds.size.width / 2; - } else if (mag.type == YYTextMagnifierTypeRanged) { - if (center.x < CGRectGetMaxX(keyboardFrame)) center.x = CGRectGetMaxX(keyboardFrame); - } - } break; - default: break; - } - } - - return center; -} - -/** - Capture screen snapshot and set it to magnifier. - @return Magnifier rotation radius. - */ -- (CGFloat)_updateMagnifier:(YYTextMagnifier *)mag { - UIApplication *app = YYTextSharedApplication(); - if (!app) return 0; - - UIView *hostView = mag.hostView; - UIWindow *hostWindow = [hostView isKindOfClass:[UIWindow class]] ? (id)hostView : hostView.window; - if (!hostView || !hostWindow) return 0; - CGPoint captureCenter = [self yy_convertPoint:mag.hostCaptureCenter fromViewOrWindow:hostView]; - captureCenter = [self _correctedCaptureCenter:captureCenter]; - CGRect captureRect = {.size = mag.snapshotSize}; - captureRect.origin.x = captureCenter.x - captureRect.size.width / 2; - captureRect.origin.y = captureCenter.y - captureRect.size.height / 2; - - CGAffineTransform trans = YYTextCGAffineTransformGetFromViews(hostView, self); - CGFloat rotation = YYTextCGAffineTransformGetRotation(trans); - - if (mag.captureDisabled) { - if (!mag.snapshot || mag.snapshot.size.width > 1) { - static UIImage *placeholder; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - CGRect rect = mag.bounds; - rect.origin = CGPointZero; - UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - [[UIColor colorWithWhite:1 alpha:0.8] set]; - CGContextFillRect(context, rect); - placeholder = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - }); - mag.captureFadeAnimation = YES; - mag.snapshot = placeholder; - mag.captureFadeAnimation = NO; - } - return rotation; - } - - UIGraphicsBeginImageContextWithOptions(captureRect.size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - if (!context) return rotation; - - CGPoint tp = CGPointMake(captureRect.size.width / 2, captureRect.size.height / 2); - tp = CGPointApplyAffineTransform(tp, CGAffineTransformMakeRotation(rotation)); - CGContextRotateCTM(context, -rotation); - CGContextTranslateCTM(context, tp.x - captureCenter.x, tp.y - captureCenter.y); - - NSMutableArray *windows = app.windows.mutableCopy; - UIWindow *keyWindow = app.keyWindow; - if (![windows containsObject:keyWindow]) [windows addObject:keyWindow]; - [windows sortUsingComparator:^NSComparisonResult(UIWindow *w1, UIWindow *w2) { - if (w1.windowLevel < w2.windowLevel) return NSOrderedAscending; - else if (w1.windowLevel > w2.windowLevel) return NSOrderedDescending; - return NSOrderedSame; - }]; - UIScreen *mainScreen = [UIScreen mainScreen]; - for (UIWindow *window in windows) { - if (window.hidden || window.alpha <= 0.01) continue; - if (window.screen != mainScreen) continue; - if ([window isKindOfClass:self.class]) break; //don't capture window above self - CGContextSaveGState(context); - CGContextConcatCTM(context, YYTextCGAffineTransformGetFromViews(window, self)); - [window.layer renderInContext:context]; //render - //[window drawViewHierarchyInRect:window.bounds afterScreenUpdates:NO]; //slower when capture whole window - CGContextRestoreGState(context); - } - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - if (mag.snapshot.size.width == 1) { - mag.captureFadeAnimation = YES; - } - mag.snapshot = image; - mag.captureFadeAnimation = NO; - return rotation; -} - -- (void)showMagnifier:(YYTextMagnifier *)mag { - if (!mag) return; - if (mag.superview != self) [self addSubview:mag]; - [self _updateWindowLevel]; - CGFloat rotation = [self _updateMagnifier:mag]; - CGPoint center = [self yy_convertPoint:mag.hostPopoverCenter fromViewOrWindow:mag.hostView]; - CGAffineTransform trans = CGAffineTransformMakeRotation(rotation); - trans = CGAffineTransformScale(trans, 0.3, 0.3); - mag.transform = trans; - mag.center = center; - if (mag.type == YYTextMagnifierTypeRanged) { - mag.alpha = 0; - } - NSTimeInterval time = mag.type == YYTextMagnifierTypeCaret ? 0.08 : 0.1; - [UIView animateWithDuration:time delay:0 options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState animations:^{ - if (mag.type == YYTextMagnifierTypeCaret) { - CGPoint newCenter = CGPointMake(0, -mag.fitSize.height / 2); - newCenter = CGPointApplyAffineTransform(newCenter, CGAffineTransformMakeRotation(rotation)); - newCenter.x += center.x; - newCenter.y += center.y; - mag.center = [self _correctedCenter:newCenter forMagnifier:mag rotation:rotation]; - } else { - mag.center = [self _correctedCenter:center forMagnifier:mag rotation:rotation]; - } - mag.transform = CGAffineTransformMakeRotation(rotation); - mag.alpha = 1; - } completion:^(BOOL finished) { - - }]; -} - -- (void)moveMagnifier:(YYTextMagnifier *)mag { - if (!mag) return; - [self _updateWindowLevel]; - CGFloat rotation = [self _updateMagnifier:mag]; - CGPoint center = [self yy_convertPoint:mag.hostPopoverCenter fromViewOrWindow:mag.hostView]; - if (mag.type == YYTextMagnifierTypeCaret) { - CGPoint newCenter = CGPointMake(0, -mag.fitSize.height / 2); - newCenter = CGPointApplyAffineTransform(newCenter, CGAffineTransformMakeRotation(rotation)); - newCenter.x += center.x; - newCenter.y += center.y; - mag.center = [self _correctedCenter:newCenter forMagnifier:mag rotation:rotation]; - } else { - mag.center = [self _correctedCenter:center forMagnifier:mag rotation:rotation]; - } - mag.transform = CGAffineTransformMakeRotation(rotation); -} - -- (void)hideMagnifier:(YYTextMagnifier *)mag { - if (!mag) return; - if (mag.superview != self) return; - CGFloat rotation = [self _updateMagnifier:mag]; - CGPoint center = [self yy_convertPoint:mag.hostPopoverCenter fromViewOrWindow:mag.hostView]; - NSTimeInterval time = mag.type == YYTextMagnifierTypeCaret ? 0.20 : 0.15; - [UIView animateWithDuration:time delay:0 options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState animations:^{ - - CGAffineTransform trans = CGAffineTransformMakeRotation(rotation); - trans = CGAffineTransformScale(trans, 0.01, 0.01); - mag.transform = trans; - - if (mag.type == YYTextMagnifierTypeCaret) { - CGPoint newCenter = CGPointMake(0, -mag.fitSize.height / 2); - newCenter = CGPointApplyAffineTransform(newCenter, CGAffineTransformMakeRotation(rotation)); - newCenter.x += center.x; - newCenter.y += center.y; - mag.center = [self _correctedCenter:newCenter forMagnifier:mag rotation:rotation]; - } else { - mag.center = [self _correctedCenter:center forMagnifier:mag rotation:rotation]; - mag.alpha = 0; - } - - } completion:^(BOOL finished) { - if (finished) { - [mag removeFromSuperview]; - mag.transform = CGAffineTransformIdentity; - mag.alpha = 1; - } - }]; -} - -- (void)_updateSelectionGrabberDot:(YYSelectionGrabberDot *)dot selection:(YYTextSelectionView *)selection{ - dot.mirror.hidden = YES; - if (selection.hostView.clipsToBounds == YES && dot.yy_visibleAlpha > 0.1) { - CGRect dotRect = [dot yy_convertRect:dot.bounds toViewOrWindow:self]; - BOOL dotInKeyboard = NO; - - CGRect keyboardFrame = [YYTextKeyboardManager defaultManager].keyboardFrame; - keyboardFrame = [[YYTextKeyboardManager defaultManager] convertRect:keyboardFrame toView:self]; - if (!CGRectIsNull(keyboardFrame) && !CGRectIsEmpty(keyboardFrame)) { - CGRect inter = CGRectIntersection(dotRect, keyboardFrame); - if (!CGRectIsNull(inter) && (inter.size.width > 1 || inter.size.height > 1)) { - dotInKeyboard = YES; - } - } - if (!dotInKeyboard) { - CGRect hostRect = [selection.hostView convertRect:selection.hostView.bounds toView:self]; - CGRect intersection = CGRectIntersection(dotRect, hostRect); - if (YYTextCGRectGetArea(intersection) < YYTextCGRectGetArea(dotRect)) { - CGFloat dist = YYTextCGPointGetDistanceToRect(YYTextCGRectGetCenter(dotRect), hostRect); - if (dist < CGRectGetWidth(dot.frame) * 0.55) { - dot.mirror.hidden = NO; - } - } - } - } - CGPoint center = [dot yy_convertPoint:CGPointMake(CGRectGetWidth(dot.frame) / 2, CGRectGetHeight(dot.frame) / 2) toViewOrWindow:self]; - if (isnan(center.x) || isnan(center.y) || isinf(center.x) || isinf(center.y)) { - dot.mirror.hidden = YES; - } else { - dot.mirror.center = center; - } -} - -- (void)showSelectionDot:(YYTextSelectionView *)selection { - if (!selection) return; - [self _updateWindowLevel]; - [self insertSubview:selection.startGrabber.dot.mirror atIndex:0]; - [self insertSubview:selection.endGrabber.dot.mirror atIndex:0]; - [self _updateSelectionGrabberDot:selection.startGrabber.dot selection:selection]; - [self _updateSelectionGrabberDot:selection.endGrabber.dot selection:selection]; -} - -- (void)hideSelectionDot:(YYTextSelectionView *)selection { - if (!selection) return; - [selection.startGrabber.dot.mirror removeFromSuperview]; - [selection.endGrabber.dot.mirror removeFromSuperview]; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextInput.h b/iOSProject/Pods/YYText/YYText/Component/YYTextInput.h deleted file mode 100644 index 2e879c09..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextInput.h +++ /dev/null @@ -1,87 +0,0 @@ -// -// YYTextInput.h -// YYText -// -// Created by ibireme on 15/4/17. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Text position affinity. For example, the offset appears after the last - character on a line is backward affinity, before the first character on - the following line is forward affinity. - */ -typedef NS_ENUM(NSInteger, YYTextAffinity) { - YYTextAffinityForward = 0, ///< offset appears before the character - YYTextAffinityBackward = 1, ///< offset appears after the character -}; - - -/** - A YYTextPosition object represents a position in a text container; in other words, - it is an index into the backing string in a text-displaying view. - - YYTextPosition has the same API as Apple's implementation in UITextView/UITextField, - so you can alse use it to interact with UITextView/UITextField. - */ -@interface YYTextPosition : UITextPosition - -@property (nonatomic, readonly) NSInteger offset; -@property (nonatomic, readonly) YYTextAffinity affinity; - -+ (instancetype)positionWithOffset:(NSInteger)offset; -+ (instancetype)positionWithOffset:(NSInteger)offset affinity:(YYTextAffinity) affinity; - -- (NSComparisonResult)compare:(id)otherPosition; - -@end - - -/** - A YYTextRange object represents a range of characters in a text container; in other words, - it identifies a starting index and an ending index in string backing a text-displaying view. - - YYTextRange has the same API as Apple's implementation in UITextView/UITextField, - so you can alse use it to interact with UITextView/UITextField. - */ -@interface YYTextRange : UITextRange - -@property (nonatomic, readonly) YYTextPosition *start; -@property (nonatomic, readonly) YYTextPosition *end; -@property (nonatomic, readonly, getter=isEmpty) BOOL empty; - -+ (instancetype)rangeWithRange:(NSRange)range; -+ (instancetype)rangeWithRange:(NSRange)range affinity:(YYTextAffinity) affinity; -+ (instancetype)rangeWithStart:(YYTextPosition *)start end:(YYTextPosition *)end; -+ (instancetype)defaultRange; ///< <{0,0} Forward> - -- (NSRange)asRange; - -@end - - -/** - A YYTextSelectionRect object encapsulates information about a selected range of - text in a text-displaying view. - - YYTextSelectionRect has the same API as Apple's implementation in UITextView/UITextField, - so you can alse use it to interact with UITextView/UITextField. - */ -@interface YYTextSelectionRect : UITextSelectionRect - -@property (nonatomic, readwrite) CGRect rect; -@property (nonatomic, readwrite) UITextWritingDirection writingDirection; -@property (nonatomic, readwrite) BOOL containsStart; -@property (nonatomic, readwrite) BOOL containsEnd; -@property (nonatomic, readwrite) BOOL isVertical; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextInput.m b/iOSProject/Pods/YYText/YYText/Component/YYTextInput.m deleted file mode 100644 index 0c4cb529..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextInput.m +++ /dev/null @@ -1,152 +0,0 @@ -// -// YYTextInput.m -// YYText -// -// Created by ibireme on 15/4/17. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextInput.h" -#import "YYTextUtilities.h" - - -@implementation YYTextPosition - -+ (instancetype)positionWithOffset:(NSInteger)offset { - return [self positionWithOffset:offset affinity:YYTextAffinityForward]; -} - -+ (instancetype)positionWithOffset:(NSInteger)offset affinity:(YYTextAffinity)affinity { - YYTextPosition *p = [self new]; - p->_offset = offset; - p->_affinity = affinity; - return p; -} - -- (instancetype)copyWithZone:(NSZone *)zone { - return [self.class positionWithOffset:_offset affinity:_affinity]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p> (%@%@)", self.class, self, @(_offset), _affinity == YYTextAffinityForward ? @"F":@"B"]; -} - -- (NSUInteger)hash { - return _offset * 2 + (_affinity == YYTextAffinityForward ? 1 : 0); -} - -- (BOOL)isEqual:(YYTextPosition *)object { - if (!object) return NO; - return _offset == object.offset && _affinity == object.affinity; -} - -- (NSComparisonResult)compare:(YYTextPosition *)otherPosition { - if (!otherPosition) return NSOrderedAscending; - if (_offset < otherPosition.offset) return NSOrderedAscending; - if (_offset > otherPosition.offset) return NSOrderedDescending; - if (_affinity == YYTextAffinityBackward && otherPosition.affinity == YYTextAffinityForward) return NSOrderedAscending; - if (_affinity == YYTextAffinityForward && otherPosition.affinity == YYTextAffinityBackward) return NSOrderedDescending; - return NSOrderedSame; -} - -@end - - - -@implementation YYTextRange { - YYTextPosition *_start; - YYTextPosition *_end; -} - -- (instancetype)init { - self = [super init]; - if (!self) return nil; - _start = [YYTextPosition positionWithOffset:0]; - _end = [YYTextPosition positionWithOffset:0]; - return self; -} - -- (YYTextPosition *)start { - return _start; -} - -- (YYTextPosition *)end { - return _end; -} - -- (BOOL)isEmpty { - return _start.offset == _end.offset; -} - -- (NSRange)asRange { - return NSMakeRange(_start.offset, _end.offset - _start.offset); -} - -+ (instancetype)rangeWithRange:(NSRange)range { - return [self rangeWithRange:range affinity:YYTextAffinityForward]; -} - -+ (instancetype)rangeWithRange:(NSRange)range affinity:(YYTextAffinity)affinity { - YYTextPosition *start = [YYTextPosition positionWithOffset:range.location affinity:affinity]; - YYTextPosition *end = [YYTextPosition positionWithOffset:range.location + range.length affinity:affinity]; - return [self rangeWithStart:start end:end]; -} - -+ (instancetype)rangeWithStart:(YYTextPosition *)start end:(YYTextPosition *)end { - if (!start || !end) return nil; - if ([start compare:end] == NSOrderedDescending) { - YYTEXT_SWAP(start, end); - } - YYTextRange *range = [YYTextRange new]; - range->_start = start; - range->_end = end; - return range; -} - -+ (instancetype)defaultRange { - return [self new]; -} - -- (instancetype)copyWithZone:(NSZone *)zone { - return [self.class rangeWithStart:_start end:_end]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p> (%@, %@)%@", self.class, self, @(_start.offset), @(_end.offset - _start.offset), _end.affinity == YYTextAffinityForward ? @"F":@"B"]; -} - -- (NSUInteger)hash { - return (sizeof(NSUInteger) == 8 ? OSSwapInt64(_start.hash) : OSSwapInt32(_start.hash)) + _end.hash; -} - -- (BOOL)isEqual:(YYTextRange *)object { - if (!object) return NO; - return [_start isEqual:object.start] && [_end isEqual:object.end]; -} - -@end - - - -@implementation YYTextSelectionRect - -@synthesize rect = _rect; -@synthesize writingDirection = _writingDirection; -@synthesize containsStart = _containsStart; -@synthesize containsEnd = _containsEnd; -@synthesize isVertical = _isVertical; - -- (id)copyWithZone:(NSZone *)zone { - YYTextSelectionRect *one = [self.class new]; - one.rect = _rect; - one.writingDirection = _writingDirection; - one.containsStart = _containsStart; - one.containsEnd = _containsEnd; - one.isVertical = _isVertical; - return one; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextKeyboardManager.h b/iOSProject/Pods/YYText/YYText/Component/YYTextKeyboardManager.h deleted file mode 100644 index 5f28a557..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextKeyboardManager.h +++ /dev/null @@ -1,98 +0,0 @@ -// -// YYTextKeyboardManager.h -// YYText -// -// Created by ibireme on 15/6/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - System keyboard transition information. - Use -[YYTextKeyboardManager convertRect:toView:] to convert frame to specified view. - */ -typedef struct { - BOOL fromVisible; ///< Keyboard visible before transition. - BOOL toVisible; ///< Keyboard visible after transition. - CGRect fromFrame; ///< Keyboard frame before transition. - CGRect toFrame; ///< Keyboard frame after transition. - NSTimeInterval animationDuration; ///< Keyboard transition animation duration. - UIViewAnimationCurve animationCurve; ///< Keyboard transition animation curve. - UIViewAnimationOptions animationOption; ///< Keybaord transition animation option. -} YYTextKeyboardTransition; - - -/** - The YYTextKeyboardObserver protocol defines the method you can use - to receive system keyboard change information. - */ -@protocol YYTextKeyboardObserver -@optional -- (void)keyboardChangedWithTransition:(YYTextKeyboardTransition)transition; -@end - - -/** - A YYTextKeyboardManager object lets you get the system keyboard information, - and track the keyboard visible/frame/transition. - - @discussion You should access this class in main thread. - Compatible: iPhone/iPad with iOS6/7/8/9. - */ -@interface YYTextKeyboardManager : NSObject - -- (instancetype)init UNAVAILABLE_ATTRIBUTE; -+ (instancetype)new UNAVAILABLE_ATTRIBUTE; - -/// Get the default manager (returns nil in App Extension). -+ (nullable instancetype)defaultManager; - -/// Get the keyboard window. nil if there's no keyboard window. -@property (nullable, nonatomic, readonly) UIWindow *keyboardWindow; - -/// Get the keyboard view. nil if there's no keyboard view. -@property (nullable, nonatomic, readonly) UIView *keyboardView; - -/// Whether the keyboard is visible. -@property (nonatomic, readonly, getter=isKeyboardVisible) BOOL keyboardVisible; - -/// Get the keyboard frame. CGRectNull if there's no keyboard view. -/// Use convertRect:toView: to convert frame to specified view. -@property (nonatomic, readonly) CGRect keyboardFrame; - - -/** - Add an observer to manager to get keyboard change information. - This method makes a weak reference to the observer. - - @param observer An observer. - This method will do nothing if the observer is nil, or already added. - */ -- (void)addObserver:(id)observer; - -/** - Remove an observer from manager. - - @param observer An observer. - This method will do nothing if the observer is nil, or not in manager. - */ -- (void)removeObserver:(id)observer; - -/** - Convert rect to specified view or window. - - @param rect The frame rect. - @param view A specified view or window (pass nil to convert for main window). - @return The converted rect in specifeid view. - */ -- (CGRect)convertRect:(CGRect)rect toView:(nullable UIView *)view; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextKeyboardManager.m b/iOSProject/Pods/YYText/YYText/Component/YYTextKeyboardManager.m deleted file mode 100644 index 43467bbe..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextKeyboardManager.m +++ /dev/null @@ -1,521 +0,0 @@ -// -// YYTextKeyboardManager.m -// YYText -// -// Created by ibireme on 15/6/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextKeyboardManager.h" -#import "YYTextUtilities.h" -#import - - -static int _YYTextKeyboardViewFrameObserverKey; - -/// Observer for view's frame/bounds/center/transform -@interface _YYTextKeyboardViewFrameObserver : NSObject -@property (nonatomic, copy) void (^notifyBlock)(UIView *keyboard); -- (void)addToKeyboardView:(UIView *)keyboardView; -+ (instancetype)observerForView:(UIView *)keyboardView; -@end - - -@implementation _YYTextKeyboardViewFrameObserver { - __unsafe_unretained UIView *_keyboardView; -} -- (void)addToKeyboardView:(UIView *)keyboardView { - if (_keyboardView == keyboardView) return; - if (_keyboardView) { - [self removeFrameObserver]; - objc_setAssociatedObject(_keyboardView, &_YYTextKeyboardViewFrameObserverKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - } - _keyboardView = keyboardView; - if (keyboardView) { - [self addFrameObserver]; - } - objc_setAssociatedObject(keyboardView, &_YYTextKeyboardViewFrameObserverKey, self, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (void)removeFrameObserver { - [_keyboardView removeObserver:self forKeyPath:@"frame"]; - [_keyboardView removeObserver:self forKeyPath:@"center"]; - [_keyboardView removeObserver:self forKeyPath:@"bounds"]; - [_keyboardView removeObserver:self forKeyPath:@"transform"]; - _keyboardView = nil; -} - -- (void)addFrameObserver { - if (!_keyboardView) return; - [_keyboardView addObserver:self forKeyPath:@"frame" options:kNilOptions context:NULL]; - [_keyboardView addObserver:self forKeyPath:@"center" options:kNilOptions context:NULL]; - [_keyboardView addObserver:self forKeyPath:@"bounds" options:kNilOptions context:NULL]; - [_keyboardView addObserver:self forKeyPath:@"transform" options:kNilOptions context:NULL]; -} - -- (void)dealloc { - [self removeFrameObserver]; -} - -+ (instancetype)observerForView:(UIView *)keyboardView { - if (!keyboardView) return nil; - return objc_getAssociatedObject(keyboardView, &_YYTextKeyboardViewFrameObserverKey); -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - - BOOL isPrior = [[change objectForKey:NSKeyValueChangeNotificationIsPriorKey] boolValue]; - if (isPrior) return; - - NSKeyValueChange changeKind = [[change objectForKey:NSKeyValueChangeKindKey] integerValue]; - if (changeKind != NSKeyValueChangeSetting) return; - - id newVal = [change objectForKey:NSKeyValueChangeNewKey]; - if (newVal == [NSNull null]) newVal = nil; - - if (_notifyBlock) { - _notifyBlock(_keyboardView); - } -} - -@end - - - -@implementation YYTextKeyboardManager { - NSHashTable *_observers; - - CGRect _fromFrame; - BOOL _fromVisible; - UIInterfaceOrientation _fromOrientation; - - CGRect _notificationFromFrame; - CGRect _notificationToFrame; - NSTimeInterval _notificationDuration; - UIViewAnimationCurve _notificationCurve; - BOOL _hasNotification; - - CGRect _observedToFrame; - BOOL _hasObservedChange; - - BOOL _lastIsNotification; -} - -- (instancetype)init { - @throw [NSException exceptionWithName:@"YYTextKeyboardManager init error" reason:@"Use 'defaultManager' to get instance." userInfo:nil]; - return [super init]; -} - -- (instancetype)_init { - self = [super init]; - _observers = [[NSHashTable alloc] initWithOptions:NSPointerFunctionsWeakMemory|NSPointerFunctionsObjectPointerPersonality capacity:0]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(_keyboardFrameWillChangeNotification:) - name:UIKeyboardWillChangeFrameNotification - object:nil]; - // for iPad (iOS 9) - if ([UIDevice currentDevice].systemVersion.floatValue >= 9) { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(_keyboardFrameDidChangeNotification:) - name:UIKeyboardDidChangeFrameNotification - object:nil]; - } - return self; -} - -- (void)_initFrameObserver { - UIView *keyboardView = self.keyboardView; - if (!keyboardView) return; - __weak typeof(self) _self = self; - _YYTextKeyboardViewFrameObserver *observer = [_YYTextKeyboardViewFrameObserver observerForView:keyboardView]; - if (!observer) { - observer = [_YYTextKeyboardViewFrameObserver new]; - observer.notifyBlock = ^(UIView *keyboard) { - [_self _keyboardFrameChanged:keyboard]; - }; - [observer addToKeyboardView:keyboardView]; - } -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -+ (instancetype)defaultManager { - static YYTextKeyboardManager *mgr = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - if (!YYTextIsAppExtension()) { - mgr = [[self alloc] _init]; - } - }); - return mgr; -} - -+ (void)load { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self defaultManager]; - }); -} - -- (void)addObserver:(id)observer { - if (!observer) return; - [_observers addObject:observer]; -} - -- (void)removeObserver:(id)observer { - if (!observer) return; - [_observers removeObject:observer]; -} - -- (UIWindow *)keyboardWindow { - UIApplication *app = YYTextSharedApplication(); - if (!app) return nil; - - UIWindow *window = nil; - for (window in app.windows) { - if ([self _getKeyboardViewFromWindow:window]) return window; - } - window = app.keyWindow; - if ([self _getKeyboardViewFromWindow:window]) return window; - - NSMutableArray *kbWindows = nil; - for (window in app.windows) { - NSString *windowName = NSStringFromClass(window.class); - if ([self _systemVersion] < 9) { - // UITextEffectsWindow - if (windowName.length == 19 && - [windowName hasPrefix:@"UI"] && - [windowName hasSuffix:@"TextEffectsWindow"]) { - if (!kbWindows) kbWindows = [NSMutableArray new]; - [kbWindows addObject:window]; - } - } else { - // UIRemoteKeyboardWindow - if (windowName.length == 22 && - [windowName hasPrefix:@"UI"] && - [windowName hasSuffix:@"RemoteKeyboardWindow"]) { - if (!kbWindows) kbWindows = [NSMutableArray new]; - [kbWindows addObject:window]; - } - } - } - - if (kbWindows.count == 1) { - return kbWindows.firstObject; - } - return nil; -} - -- (UIView *)keyboardView { - UIApplication *app = YYTextSharedApplication(); - if (!app) return nil; - - UIWindow *window = nil; - UIView *view = nil; - for (window in app.windows) { - view = [self _getKeyboardViewFromWindow:window]; - if (view) return view; - } - window = app.keyWindow; - view = [self _getKeyboardViewFromWindow:window]; - if (view) return view; - return nil; -} - -- (BOOL)isKeyboardVisible { - UIWindow *window = self.keyboardWindow; - if (!window) return NO; - UIView *view = self.keyboardView; - if (!view) return NO; - CGRect rect = CGRectIntersection(window.bounds, view.frame); - if (CGRectIsNull(rect)) return NO; - if (CGRectIsInfinite(rect)) return NO; - return rect.size.width > 0 && rect.size.height > 0; -} - -- (CGRect)keyboardFrame { - UIView *keyboard = [self keyboardView]; - if (!keyboard) return CGRectNull; - - CGRect frame = CGRectNull; - UIWindow *window = keyboard.window; - if (window) { - frame = [window convertRect:keyboard.frame toWindow:nil]; - } else { - frame = keyboard.frame; - } - return frame; -} - -#pragma mark - private - -- (double)_systemVersion { - static double v; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - v = [UIDevice currentDevice].systemVersion.doubleValue; - }); - return v; -} - -- (UIView *)_getKeyboardViewFromWindow:(UIWindow *)window { - /* - iOS 6/7: - UITextEffectsWindow - UIPeripheralHostView << keyboard - - iOS 8: - UITextEffectsWindow - UIInputSetContainerView - UIInputSetHostView << keyboard - - iOS 9: - UIRemoteKeyboardWindow - UIInputSetContainerView - UIInputSetHostView << keyboard - */ - if (!window) return nil; - - // Get the window - NSString *windowName = NSStringFromClass(window.class); - if ([self _systemVersion] < 9) { - // UITextEffectsWindow - if (windowName.length != 19) return nil; - if (![windowName hasPrefix:@"UI"]) return nil; - if (![windowName hasSuffix:@"TextEffectsWindow"]) return nil; - } else { - // UIRemoteKeyboardWindow - if (windowName.length != 22) return nil; - if (![windowName hasPrefix:@"UI"]) return nil; - if (![windowName hasSuffix:@"RemoteKeyboardWindow"]) return nil; - } - - // Get the view - if ([self _systemVersion] < 8) { - // UIPeripheralHostView - for (UIView *view in window.subviews) { - NSString *viewName = NSStringFromClass(view.class); - if (viewName.length != 20) continue; - if (![viewName hasPrefix:@"UI"]) continue; - if (![viewName hasSuffix:@"PeripheralHostView"]) continue; - return view; - } - } else { - // UIInputSetContainerView - for (UIView *view in window.subviews) { - NSString *viewName = NSStringFromClass(view.class); - if (viewName.length != 23) continue; - if (![viewName hasPrefix:@"UI"]) continue; - if (![viewName hasSuffix:@"InputSetContainerView"]) continue; - // UIInputSetHostView - for (UIView *subView in view.subviews) { - NSString *subViewName = NSStringFromClass(subView.class); - if (subViewName.length != 18) continue; - if (![subViewName hasPrefix:@"UI"]) continue; - if (![subViewName hasSuffix:@"InputSetHostView"]) continue; - return subView; - } - } - } - - return nil; -} - -- (void)_keyboardFrameWillChangeNotification:(NSNotification *)notif { - if (![notif.name isEqualToString:UIKeyboardWillChangeFrameNotification]) return; - NSDictionary *info = notif.userInfo; - if (!info) return; - - [self _initFrameObserver]; - - NSValue *beforeValue = info[UIKeyboardFrameBeginUserInfoKey]; - NSValue *afterValue = info[UIKeyboardFrameEndUserInfoKey]; - NSNumber *curveNumber = info[UIKeyboardAnimationCurveUserInfoKey]; - NSNumber *durationNumber = info[UIKeyboardAnimationDurationUserInfoKey]; - - CGRect before = beforeValue.CGRectValue; - CGRect after = afterValue.CGRectValue; - UIViewAnimationCurve curve = curveNumber.integerValue; - NSTimeInterval duration = durationNumber.doubleValue; - - // ignore zero end frame - if (after.size.width <= 0 && after.size.height <= 0) return; - - _notificationFromFrame = before; - _notificationToFrame = after; - _notificationCurve = curve; - _notificationDuration = duration; - _hasNotification = YES; - _lastIsNotification = YES; - - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_notifyAllObservers) object:nil]; - if (duration == 0) { - [self performSelector:@selector(_notifyAllObservers) withObject:nil afterDelay:0 inModes:@[NSRunLoopCommonModes]]; - } else { - [self _notifyAllObservers]; - } -} - -- (void)_keyboardFrameDidChangeNotification:(NSNotification *)notif { - if (![notif.name isEqualToString:UIKeyboardDidChangeFrameNotification]) return; - NSDictionary *info = notif.userInfo; - if (!info) return; - - [self _initFrameObserver]; - - NSValue *afterValue = info[UIKeyboardFrameEndUserInfoKey]; - CGRect after = afterValue.CGRectValue; - - // ignore zero end frame - if (after.size.width <= 0 && after.size.height <= 0) return; - - _notificationToFrame = after; - _notificationCurve = UIViewAnimationCurveEaseInOut; - _notificationDuration = 0; - _hasNotification = YES; - _lastIsNotification = YES; - - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_notifyAllObservers) object:nil]; - [self performSelector:@selector(_notifyAllObservers) withObject:nil afterDelay:0 inModes:@[NSRunLoopCommonModes]]; -} - -- (void)_keyboardFrameChanged:(UIView *)keyboard { - if (keyboard != self.keyboardView) return; - - UIWindow *window = keyboard.window; - if (window) { - _observedToFrame = [window convertRect:keyboard.frame toWindow:nil]; - } else { - _observedToFrame = keyboard.frame; - } - _hasObservedChange = YES; - _lastIsNotification = NO; - - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_notifyAllObservers) object:nil]; - [self performSelector:@selector(_notifyAllObservers) withObject:nil afterDelay:0 inModes:@[NSRunLoopCommonModes]]; -} - -- (void)_notifyAllObservers { - UIApplication *app = YYTextSharedApplication(); - if (!app) return; - - UIView *keyboard = self.keyboardView; - UIWindow *window = keyboard.window; - if (!window) { - window = app.keyWindow; - } - if (!window) { - window = app.windows.firstObject; - } - - YYTextKeyboardTransition trans = {0}; - - // from - if (_fromFrame.size.width == 0 && _fromFrame.size.height == 0) { // first notify - _fromFrame.size.width = window.bounds.size.width; - _fromFrame.size.height = trans.toFrame.size.height; - _fromFrame.origin.x = trans.toFrame.origin.x; - _fromFrame.origin.y = window.bounds.size.height; - } - trans.fromFrame = _fromFrame; - trans.fromVisible = _fromVisible; - - // to - if (_lastIsNotification || (_hasObservedChange && CGRectEqualToRect(_observedToFrame, _notificationToFrame))) { - trans.toFrame = _notificationToFrame; - trans.animationDuration = _notificationDuration; - trans.animationCurve = _notificationCurve; - trans.animationOption = _notificationCurve << 16; - - // Fix iPad(iOS7) keyboard frame error after rorate device when the keyboard is not docked to bottom. - if (((int)[self _systemVersion]) == 7) { - UIInterfaceOrientation ori = app.statusBarOrientation; - if (_fromOrientation != UIInterfaceOrientationUnknown && _fromOrientation != ori) { - switch (ori) { - case UIInterfaceOrientationPortrait: { - if (CGRectGetMaxY(trans.toFrame) != window.frame.size.height) { - trans.toFrame.origin.y -= trans.toFrame.size.height; - } - } break; - case UIInterfaceOrientationPortraitUpsideDown: { - if (CGRectGetMinY(trans.toFrame) != 0) { - trans.toFrame.origin.y += trans.toFrame.size.height; - } - } break; - case UIInterfaceOrientationLandscapeLeft: { - if (CGRectGetMaxX(trans.toFrame) != window.frame.size.width) { - trans.toFrame.origin.x -= trans.toFrame.size.width; - } - } break; - case UIInterfaceOrientationLandscapeRight: { - if (CGRectGetMinX(trans.toFrame) != 0) { - trans.toFrame.origin.x += trans.toFrame.size.width; - } - } break; - default: break; - } - } - } - } else { - trans.toFrame = _observedToFrame; - } - - if (window && trans.toFrame.size.width > 0 && trans.toFrame.size.height > 0) { - CGRect rect = CGRectIntersection(window.bounds, trans.toFrame); - if (!CGRectIsNull(rect) && !CGRectIsEmpty(rect)) { - trans.toVisible = YES; - } - } - - if (!CGRectEqualToRect(trans.toFrame, _fromFrame)) { - for (id observer in _observers.copy) { - if ([observer respondsToSelector:@selector(keyboardChangedWithTransition:)]) { - [observer keyboardChangedWithTransition:trans]; - } - } - } - - _hasNotification = NO; - _hasObservedChange = NO; - _fromFrame = trans.toFrame; - _fromVisible = trans.toVisible; - _fromOrientation = app.statusBarOrientation; -} - -- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view { - UIApplication *app = YYTextSharedApplication(); - if (!app) return CGRectZero; - - if (CGRectIsNull(rect)) return rect; - if (CGRectIsInfinite(rect)) return rect; - - UIWindow *mainWindow = app.keyWindow; - if (!mainWindow) mainWindow = app.windows.firstObject; - if (!mainWindow) { // no window ?! - if (view) { - [view convertRect:rect fromView:nil]; - } else { - return rect; - } - } - - rect = [mainWindow convertRect:rect fromWindow:nil]; - if (!view) return [mainWindow convertRect:rect toWindow:nil]; - if (view == mainWindow) return rect; - - UIWindow *toWindow = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - if (!mainWindow || !toWindow) return [mainWindow convertRect:rect toView:view]; - if (mainWindow == toWindow) return [mainWindow convertRect:rect toView:view]; - - // in different window - rect = [mainWindow convertRect:rect toView:mainWindow]; - rect = [toWindow convertRect:rect fromWindow:mainWindow]; - rect = [view convertRect:rect fromView:toWindow]; - return rect; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextLayout.h b/iOSProject/Pods/YYText/YYText/Component/YYTextLayout.h deleted file mode 100644 index 24c0a622..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextLayout.h +++ /dev/null @@ -1,571 +0,0 @@ -// -// YYTextLayout.h -// YYText -// -// Created by ibireme on 15/3/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -#if __has_include() -#import -#import -#import -#else -#import "YYTextDebugOption.h" -#import "YYTextLine.h" -#import "YYTextInput.h" -#endif - -@protocol YYTextLinePositionModifier; - -NS_ASSUME_NONNULL_BEGIN - -/** - The max text container size in layout. - */ -extern const CGSize YYTextContainerMaxSize; - -/** - The YYTextContainer class defines a region in which text is laid out. - YYTextLayout class uses one or more YYTextContainer objects to generate layouts. - - A YYTextContainer defines rectangular regions (`size` and `insets`) or - nonrectangular shapes (`path`), and you can define exclusion paths inside the - text container's bounding rectangle so that text flows around the exclusion - path as it is laid out. - - All methods in this class is thread-safe. - - Example: - - ┌─────────────────────────────┐ <------- container - │ │ - │ asdfasdfasdfasdfasdfa <------------ container insets - │ asdfasdfa asdfasdfa │ - │ asdfas asdasd │ - │ asdfa <----------------------- container exclusion path - │ asdfas adfasd │ - │ asdfasdfa asdfasdfa │ - │ asdfasdfasdfasdfasdfa │ - │ │ - └─────────────────────────────┘ - */ -@interface YYTextContainer : NSObject - -/// Creates a container with the specified size. @param size The size. -+ (instancetype)containerWithSize:(CGSize)size; - -/// Creates a container with the specified size and insets. @param size The size. @param insets The text insets. -+ (instancetype)containerWithSize:(CGSize)size insets:(UIEdgeInsets)insets; - -/// Creates a container with the specified path. @param size The path. -+ (instancetype)containerWithPath:(nullable UIBezierPath *)path; - -/// The constrained size. (if the size is larger than YYTextContainerMaxSize, it will be clipped) -@property CGSize size; - -/// The insets for constrained size. The inset value should not be negative. Default is UIEdgeInsetsZero. -@property UIEdgeInsets insets; - -/// Custom constrained path. Set this property to ignore `size` and `insets`. Default is nil. -@property (nullable, copy) UIBezierPath *path; - -/// An array of `UIBezierPath` for path exclusion. Default is nil. -@property (nullable, copy) NSArray *exclusionPaths; - -/// Path line width. Default is 0; -@property CGFloat pathLineWidth; - -/// YES:(PathFillEvenOdd) Text is filled in the area that would be painted if the path were given to CGContextEOFillPath. -/// NO: (PathFillWindingNumber) Text is fill in the area that would be painted if the path were given to CGContextFillPath. -/// Default is YES; -@property (getter=isPathFillEvenOdd) BOOL pathFillEvenOdd; - -/// Whether the text is vertical form (may used for CJK text layout). Default is NO. -@property (getter=isVerticalForm) BOOL verticalForm; - -/// Maximum number of rows, 0 means no limit. Default is 0. -@property NSUInteger maximumNumberOfRows; - -/// The line truncation type, default is none. -@property YYTextTruncationType truncationType; - -/// The truncation token. If nil, the layout will use "…" instead. Default is nil. -@property (nullable, copy) NSAttributedString *truncationToken; - -/// This modifier is applied to the lines before the layout is completed, -/// give you a chance to modify the line position. Default is nil. -@property (nullable, copy) id linePositionModifier; -@end - - -/** - The YYTextLinePositionModifier protocol declares the required method to modify - the line position in text layout progress. See `YYTextLinePositionSimpleModifier` for example. - */ -@protocol YYTextLinePositionModifier -@required -/** - This method will called before layout is completed. The method should be thread-safe. - @param lines An array of YYTextLine. - @param text The full text. - @param container The layout container. - */ -- (void)modifyLines:(NSArray *)lines fromText:(NSAttributedString *)text inContainer:(YYTextContainer *)container; -@end - - -/** - A simple implementation of `YYTextLinePositionModifier`. It can fix each line's position - to a specified value, lets each line of height be the same. - */ -@interface YYTextLinePositionSimpleModifier : NSObject -@property (assign) CGFloat fixedLineHeight; ///< The fixed line height (distance between two baseline). -@end - - - -/** - YYTextLayout class is a readonly class stores text layout result. - All the property in this class is readonly, and should not be changed. - The methods in this class is thread-safe (except some of the draw methods). - - example: (layout with a circle exclusion path) - - ┌──────────────────────────┐ <------ container - │ [--------Line0--------] │ <- Row0 - │ [--------Line1--------] │ <- Row1 - │ [-Line2-] [-Line3-] │ <- Row2 - │ [-Line4] [Line5-] │ <- Row3 - │ [-Line6-] [-Line7-] │ <- Row4 - │ [--------Line8--------] │ <- Row5 - │ [--------Line9--------] │ <- Row6 - └──────────────────────────┘ - */ -@interface YYTextLayout : NSObject - - -#pragma mark - Generate text layout -///============================================================================= -/// @name Generate text layout -///============================================================================= - -/** - Generate a layout with the given container size and text. - - @param size The text container's size - @param text The text (if nil, returns nil). - @return A new layout, or nil when an error occurs. -*/ -+ (nullable YYTextLayout *)layoutWithContainerSize:(CGSize)size text:(NSAttributedString *)text; - -/** - Generate a layout with the given container and text. - - @param container The text container (if nil, returns nil). - @param text The text (if nil, returns nil). - @return A new layout, or nil when an error occurs. - */ -+ (nullable YYTextLayout *)layoutWithContainer:(YYTextContainer *)container text:(NSAttributedString *)text; - -/** - Generate a layout with the given container and text. - - @param container The text container (if nil, returns nil). - @param text The text (if nil, returns nil). - @param range The text range (if out of range, returns nil). If the - length of the range is 0, it means the length is no limit. - @return A new layout, or nil when an error occurs. - */ -+ (nullable YYTextLayout *)layoutWithContainer:(YYTextContainer *)container text:(NSAttributedString *)text range:(NSRange)range; - -/** - Generate layouts with the given containers and text. - - @param containers An array of YYTextContainer object (if nil, returns nil). - @param text The text (if nil, returns nil). - @return An array of YYTextLayout object (the count is same as containers), - or nil when an error occurs. - */ -+ (nullable NSArray *)layoutWithContainers:(NSArray *)containers - text:(NSAttributedString *)text; - -/** - Generate layouts with the given containers and text. - - @param containers An array of YYTextContainer object (if nil, returns nil). - @param text The text (if nil, returns nil). - @param range The text range (if out of range, returns nil). If the - length of the range is 0, it means the length is no limit. - @return An array of YYTextLayout object (the count is same as containers), - or nil when an error occurs. - */ -+ (nullable NSArray *)layoutWithContainers:(NSArray *)containers - text:(NSAttributedString *)text - range:(NSRange)range; - -- (instancetype)init UNAVAILABLE_ATTRIBUTE; -+ (instancetype)new UNAVAILABLE_ATTRIBUTE; - - -#pragma mark - Text layout attributes -///============================================================================= -/// @name Text layout attributes -///============================================================================= - -///< The text container -@property (nonatomic, strong, readonly) YYTextContainer *container; -///< The full text -@property (nonatomic, strong, readonly) NSAttributedString *text; -///< The text range in full text -@property (nonatomic, readonly) NSRange range; -///< CTFrameSetter -@property (nonatomic, readonly) CTFramesetterRef frameSetter; -///< CTFrame -@property (nonatomic, readonly) CTFrameRef frame; -///< Array of `YYTextLine`, no truncated -@property (nonatomic, strong, readonly) NSArray *lines; -///< YYTextLine with truncated token, or nil -@property (nullable, nonatomic, strong, readonly) YYTextLine *truncatedLine; -///< Array of `YYTextAttachment` -@property (nullable, nonatomic, strong, readonly) NSArray *attachments; -///< Array of NSRange(wrapped by NSValue) in text -@property (nullable, nonatomic, strong, readonly) NSArray *attachmentRanges; -///< Array of CGRect(wrapped by NSValue) in container -@property (nullable, nonatomic, strong, readonly) NSArray *attachmentRects; -///< Set of Attachment (UIImage/UIView/CALayer) -@property (nullable, nonatomic, strong, readonly) NSSet *attachmentContentsSet; -///< Number of rows -@property (nonatomic, readonly) NSUInteger rowCount; -///< Visible text range -@property (nonatomic, readonly) NSRange visibleRange; -///< Bounding rect (glyphs) -@property (nonatomic, readonly) CGRect textBoundingRect; -///< Bounding size (glyphs and insets, ceil to pixel) -@property (nonatomic, readonly) CGSize textBoundingSize; -///< Has highlight attribute -@property (nonatomic, readonly) BOOL containsHighlight; -///< Has block border attribute -@property (nonatomic, readonly) BOOL needDrawBlockBorder; -///< Has background border attribute -@property (nonatomic, readonly) BOOL needDrawBackgroundBorder; -///< Has shadow attribute -@property (nonatomic, readonly) BOOL needDrawShadow; -///< Has underline attribute -@property (nonatomic, readonly) BOOL needDrawUnderline; -///< Has visible text -@property (nonatomic, readonly) BOOL needDrawText; -///< Has attachment attribute -@property (nonatomic, readonly) BOOL needDrawAttachment; -///< Has inner shadow attribute -@property (nonatomic, readonly) BOOL needDrawInnerShadow; -///< Has strickthrough attribute -@property (nonatomic, readonly) BOOL needDrawStrikethrough; -///< Has border attribute -@property (nonatomic, readonly) BOOL needDrawBorder; - - -#pragma mark - Query information from text layout -///============================================================================= -/// @name Query information from text layout -///============================================================================= - -/** - The first line index for row. - - @param row A row index. - @return The line index, or NSNotFound if not found. - */ -- (NSUInteger)lineIndexForRow:(NSUInteger)row; - -/** - The number of lines for row. - - @param row A row index. - @return The number of lines, or NSNotFound when an error occurs. - */ -- (NSUInteger)lineCountForRow:(NSUInteger)row; - -/** - The row index for line. - - @param line A row index. - - @return The row index, or NSNotFound if not found. - */ -- (NSUInteger)rowIndexForLine:(NSUInteger)line; - -/** - The line index for a specified point. - - @discussion It returns NSNotFound if there's no text at the point. - - @param point A point in the container. - @return The line index, or NSNotFound if not found. - */ -- (NSUInteger)lineIndexForPoint:(CGPoint)point; - -/** - The line index closest to a specified point. - - @param point A point in the container. - @return The line index, or NSNotFound if no line exist in layout. - */ -- (NSUInteger)closestLineIndexForPoint:(CGPoint)point; - -/** - The offset in container for a text position in a specified line. - - @discussion The offset is the text position's baseline point.x. - If the container is vertical form, the offset is the baseline point.y; - - @param position The text position in string. - @param lineIndex The line index. - @return The offset in container, or CGFLOAT_MAX if not found. - */ -- (CGFloat)offsetForTextPosition:(NSUInteger)position lineIndex:(NSUInteger)lineIndex; - -/** - The text position for a point in a specified line. - - @discussion This method just call CTLineGetStringIndexForPosition() and does - NOT consider the emoji, line break character, binding text... - - @param point A point in the container. - @param lineIndex The line index. - @return The text position, or NSNotFound if not found. - */ -- (NSUInteger)textPositionForPoint:(CGPoint)point lineIndex:(NSUInteger)lineIndex; - -/** - The closest text position to a specified point. - - @discussion This method takes into account the restrict of emoji, line break - character, binding text and text affinity. - - @param point A point in the container. - @return A text position, or nil if not found. - */ -- (nullable YYTextPosition *)closestPositionToPoint:(CGPoint)point; - -/** - Returns the new position when moving selection grabber in text view. - - @discussion There are two grabber in the text selection period, user can only - move one grabber at the same time. - - @param point A point in the container. - @param oldPosition The old text position for the moving grabber. - @param otherPosition The other position in text selection view. - - @return A text position, or nil if not found. - */ -- (nullable YYTextPosition *)positionForPoint:(CGPoint)point - oldPosition:(YYTextPosition *)oldPosition - otherPosition:(YYTextPosition *)otherPosition; - -/** - Returns the character or range of characters that is at a given point in the container. - If there is no text at the point, returns nil. - - @discussion This method takes into account the restrict of emoji, line break - character, binding text and text affinity. - - @param point A point in the container. - @return An object representing a range that encloses a character (or characters) - at point. Or nil if not found. - */ -- (nullable YYTextRange *)textRangeAtPoint:(CGPoint)point; - -/** - Returns the closest character or range of characters that is at a given point in - the container. - - @discussion This method takes into account the restrict of emoji, line break - character, binding text and text affinity. - - @param point A point in the container. - @return An object representing a range that encloses a character (or characters) - at point. Or nil if not found. - */ -- (nullable YYTextRange *)closestTextRangeAtPoint:(CGPoint)point; - -/** - If the position is inside an emoji, composed character sequences, line break '\\r\\n' - or custom binding range, then returns the range by extend the position. Otherwise, - returns a zero length range from the position. - - @param position A text-position object that identifies a location in layout. - - @return A text-range object that extend the position. Or nil if an error occurs - */ -- (nullable YYTextRange *)textRangeByExtendingPosition:(YYTextPosition *)position; - -/** - Returns a text range at a given offset in a specified direction from another - text position to its farthest extent in a certain direction of layout. - - @param position A text-position object that identifies a location in layout. - @param direction A constant that indicates a direction of layout (right, left, up, down). - @param offset A character offset from position. - - @return A text-range object that represents the distance from position to the - farthest extent in direction. Or nil if an error occurs. - */ -- (nullable YYTextRange *)textRangeByExtendingPosition:(YYTextPosition *)position - inDirection:(UITextLayoutDirection)direction - offset:(NSInteger)offset; - -/** - Returns the line index for a given text position. - - @discussion This method takes into account the text affinity. - - @param position A text-position object that identifies a location in layout. - @return The line index, or NSNotFound if not found. - */ -- (NSUInteger)lineIndexForPosition:(YYTextPosition *)position; - -/** - Returns the baseline position for a given text position. - - @param position An object that identifies a location in the layout. - @return The baseline position for text, or CGPointZero if not found. - */ -- (CGPoint)linePositionForPosition:(YYTextPosition *)position; - -/** - Returns a rectangle used to draw the caret at a given insertion point. - - @param position An object that identifies a location in the layout. - @return A rectangle that defines the area for drawing the caret. The width is - always zero in normal container, the height is always zero in vertical form container. - If not found, it returns CGRectNull. - */ -- (CGRect)caretRectForPosition:(YYTextPosition *)position; - -/** - Returns the first rectangle that encloses a range of text in the layout. - - @param range An object that represents a range of text in layout. - - @return The first rectangle in a range of text. You might use this rectangle to - draw a correction rectangle. The "first" in the name refers the rectangle - enclosing the first line when the range encompasses multiple lines of text. - If not found, it returns CGRectNull. - */ -- (CGRect)firstRectForRange:(YYTextRange *)range; - -/** - Returns the rectangle union that encloses a range of text in the layout. - - @param range An object that represents a range of text in layout. - - @return A rectangle that defines the area than encloses the range. - If not found, it returns CGRectNull. - */ -- (CGRect)rectForRange:(YYTextRange *)range; - -/** - Returns an array of selection rects corresponding to the range of text. - The start and end rect can be used to show grabber. - - @param range An object representing a range in text. - @return An array of `YYTextSelectionRect` objects that encompass the selection. - If not found, the array is empty. - */ -- (NSArray *)selectionRectsForRange:(YYTextRange *)range; - -/** - Returns an array of selection rects corresponding to the range of text. - - @param range An object representing a range in text. - @return An array of `YYTextSelectionRect` objects that encompass the selection. - If not found, the array is empty. - */ -- (NSArray *)selectionRectsWithoutStartAndEndForRange:(YYTextRange *)range; - -/** - Returns the start and end selection rects corresponding to the range of text. - The start and end rect can be used to show grabber. - - @param range An object representing a range in text. - @return An array of `YYTextSelectionRect` objects contains the start and end to - the selection. If not found, the array is empty. - */ -- (NSArray *)selectionRectsWithOnlyStartAndEndForRange:(YYTextRange *)range; - - -#pragma mark - Draw text layout -///============================================================================= -/// @name Draw text layout -///============================================================================= - -/** - Draw the layout and show the attachments. - - @discussion If the `view` parameter is not nil, then the attachment views will - add to this `view`, and if the `layer` parameter is not nil, then the attachment - layers will add to this `layer`. - - @warning This method should be called on main thread if `view` or `layer` parameter - is not nil and there's UIView or CALayer attachments in layout. - Otherwise, it can be called on any thread. - - @param context The draw context. Pass nil to avoid text and image drawing. - @param size The context size. - @param point The point at which to draw the layout. - @param view The attachment views will add to this view. - @param layer The attachment layers will add to this layer. - @param debug The debug option. Pass nil to avoid debug drawing. - @param cancel The cancel checker block. It will be called in drawing progress. - If it returns YES, the further draw progress will be canceled. - Pass nil to ignore this feature. - */ -- (void)drawInContext:(nullable CGContextRef)context - size:(CGSize)size - point:(CGPoint)point - view:(nullable UIView *)view - layer:(nullable CALayer *)layer - debug:(nullable YYTextDebugOption *)debug - cancel:(nullable BOOL (^)(void))cancel; - -/** - Draw the layout text and image (without view or layer attachments). - - @discussion This method is thread safe and can be called on any thread. - - @param context The draw context. Pass nil to avoid text and image drawing. - @param size The context size. - @param debug The debug option. Pass nil to avoid debug drawing. - */ -- (void)drawInContext:(nullable CGContextRef)context - size:(CGSize)size - debug:(nullable YYTextDebugOption *)debug; - -/** - Show view and layer attachments. - - @warning This method must be called on main thread. - - @param view The attachment views will add to this view. - @param layer The attachment layers will add to this layer. - */ -- (void)addAttachmentToView:(nullable UIView *)view layer:(nullable CALayer *)layer; - -/** - Remove attachment views and layers from their super container. - - @warning This method must be called on main thread. - */ -- (void)removeAttachmentFromViewAndLayer; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextLayout.m b/iOSProject/Pods/YYText/YYText/Component/YYTextLayout.m deleted file mode 100644 index 808b55fc..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextLayout.m +++ /dev/null @@ -1,3407 +0,0 @@ -// -// YYTextLayout.m -// YYText -// -// Created by ibireme on 15/3/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextLayout.h" -#import "YYTextUtilities.h" -#import "YYTextAttribute.h" -#import "YYTextArchiver.h" -#import "NSAttributedString+YYText.h" - -const CGSize YYTextContainerMaxSize = (CGSize){0x100000, 0x100000}; - -typedef struct { - CGFloat head; - CGFloat foot; -} YYRowEdge; - -static inline CGSize YYTextClipCGSize(CGSize size) { - if (size.width > YYTextContainerMaxSize.width) size.width = YYTextContainerMaxSize.width; - if (size.height > YYTextContainerMaxSize.height) size.height = YYTextContainerMaxSize.height; - return size; -} - -static inline UIEdgeInsets UIEdgeInsetRotateVertical(UIEdgeInsets insets) { - UIEdgeInsets one; - one.top = insets.left; - one.left = insets.bottom; - one.bottom = insets.right; - one.right = insets.top; - return one; -} - -/** - Sometimes CoreText may convert CGColor to UIColor for `kCTForegroundColorAttributeName` - attribute in iOS7. This should be a bug of CoreText, and may cause crash. Here's a workaround. - */ -static CGColorRef YYTextGetCGColor(CGColorRef color) { - static UIColor *defaultColor; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - defaultColor = [UIColor blackColor]; - }); - if (!color) return defaultColor.CGColor; - if ([((__bridge NSObject *)color) respondsToSelector:@selector(CGColor)]) { - return ((__bridge UIColor *)color).CGColor; - } - return color; -} - -@implementation YYTextLinePositionSimpleModifier -- (void)modifyLines:(NSArray *)lines fromText:(NSAttributedString *)text inContainer:(YYTextContainer *)container { - if (container.verticalForm) { - for (NSUInteger i = 0, max = lines.count; i < max; i++) { - YYTextLine *line = lines[i]; - CGPoint pos = line.position; - pos.x = container.size.width - container.insets.right - line.row * _fixedLineHeight - _fixedLineHeight * 0.9; - line.position = pos; - } - } else { - for (NSUInteger i = 0, max = lines.count; i < max; i++) { - YYTextLine *line = lines[i]; - CGPoint pos = line.position; - pos.y = line.row * _fixedLineHeight + _fixedLineHeight * 0.9 + container.insets.top; - line.position = pos; - } - } -} - -- (id)copyWithZone:(NSZone *)zone { - YYTextLinePositionSimpleModifier *one = [self.class new]; - one.fixedLineHeight = _fixedLineHeight; - return one; -} -@end - - -@implementation YYTextContainer { - @package - BOOL _readonly; ///< used only in YYTextLayout.implementation - dispatch_semaphore_t _lock; - - CGSize _size; - UIEdgeInsets _insets; - UIBezierPath *_path; - NSArray *_exclusionPaths; - BOOL _pathFillEvenOdd; - CGFloat _pathLineWidth; - BOOL _verticalForm; - NSUInteger _maximumNumberOfRows; - YYTextTruncationType _truncationType; - NSAttributedString *_truncationToken; - id _linePositionModifier; -} - -+ (instancetype)containerWithSize:(CGSize)size { - return [self containerWithSize:size insets:UIEdgeInsetsZero]; -} - -+ (instancetype)containerWithSize:(CGSize)size insets:(UIEdgeInsets)insets { - YYTextContainer *one = [self new]; - one.size = YYTextClipCGSize(size); - one.insets = insets; - return one; -} - -+ (instancetype)containerWithPath:(UIBezierPath *)path { - YYTextContainer *one = [self new]; - one.path = path; - return one; -} - -- (instancetype)init { - self = [super init]; - if (!self) return nil; - _lock = dispatch_semaphore_create(1); - _pathFillEvenOdd = YES; - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - YYTextContainer *one = [self.class new]; - dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); - one->_size = _size; - one->_insets = _insets; - one->_path = _path; - one->_exclusionPaths = _exclusionPaths.copy; - one->_pathFillEvenOdd = _pathFillEvenOdd; - one->_pathLineWidth = _pathLineWidth; - one->_verticalForm = _verticalForm; - one->_maximumNumberOfRows = _maximumNumberOfRows; - one->_truncationType = _truncationType; - one->_truncationToken = _truncationToken.copy; - one->_linePositionModifier = [(NSObject *)_linePositionModifier copy]; - dispatch_semaphore_signal(_lock); - return one; -} - -- (id)mutableCopyWithZone:(nullable NSZone *)zone { - return [self copyWithZone:zone]; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:[NSValue valueWithCGSize:_size] forKey:@"size"]; - [aCoder encodeObject:[NSValue valueWithUIEdgeInsets:_insets] forKey:@"insets"]; - [aCoder encodeObject:_path forKey:@"path"]; - [aCoder encodeObject:_exclusionPaths forKey:@"exclusionPaths"]; - [aCoder encodeBool:_pathFillEvenOdd forKey:@"pathFillEvenOdd"]; - [aCoder encodeDouble:_pathLineWidth forKey:@"pathLineWidth"]; - [aCoder encodeBool:_verticalForm forKey:@"verticalForm"]; - [aCoder encodeInteger:_maximumNumberOfRows forKey:@"maximumNumberOfRows"]; - [aCoder encodeInteger:_truncationType forKey:@"truncationType"]; - [aCoder encodeObject:_truncationToken forKey:@"truncationToken"]; - if ([_linePositionModifier respondsToSelector:@selector(encodeWithCoder:)] && - [_linePositionModifier respondsToSelector:@selector(initWithCoder:)]) { - [aCoder encodeObject:_linePositionModifier forKey:@"linePositionModifier"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [self init]; - _size = ((NSValue *)[aDecoder decodeObjectForKey:@"size"]).CGSizeValue; - _insets = ((NSValue *)[aDecoder decodeObjectForKey:@"insets"]).UIEdgeInsetsValue; - _path = [aDecoder decodeObjectForKey:@"path"]; - _exclusionPaths = [aDecoder decodeObjectForKey:@"exclusionPaths"]; - _pathFillEvenOdd = [aDecoder decodeBoolForKey:@"pathFillEvenOdd"]; - _pathLineWidth = [aDecoder decodeDoubleForKey:@"pathLineWidth"]; - _verticalForm = [aDecoder decodeBoolForKey:@"verticalForm"]; - _maximumNumberOfRows = [aDecoder decodeIntegerForKey:@"maximumNumberOfRows"]; - _truncationType = [aDecoder decodeIntegerForKey:@"truncationType"]; - _truncationToken = [aDecoder decodeObjectForKey:@"truncationToken"]; - _linePositionModifier = [aDecoder decodeObjectForKey:@"linePositionModifier"]; - return self; -} - -#define Getter(...) \ -dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); \ -__VA_ARGS__; \ -dispatch_semaphore_signal(_lock); - -#define Setter(...) \ -if (_readonly) { \ -@throw [NSException exceptionWithName:NSInternalInconsistencyException \ -reason:@"Cannot change the property of the 'container' in 'YYTextLayout'." userInfo:nil]; \ -return; \ -} \ -dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); \ -__VA_ARGS__; \ -dispatch_semaphore_signal(_lock); - -- (CGSize)size { - Getter(CGSize size = _size) return size; -} - -- (void)setSize:(CGSize)size { - Setter(if(!_path) _size = YYTextClipCGSize(size)); -} - -- (UIEdgeInsets)insets { - Getter(UIEdgeInsets insets = _insets) return insets; -} - -- (void)setInsets:(UIEdgeInsets)insets { - Setter(if(!_path){ - if (insets.top < 0) insets.top = 0; - if (insets.left < 0) insets.left = 0; - if (insets.bottom < 0) insets.bottom = 0; - if (insets.right < 0) insets.right = 0; - _insets = insets; - }); -} - -- (UIBezierPath *)path { - Getter(UIBezierPath *path = _path) return path; -} - -- (void)setPath:(UIBezierPath *)path { - Setter( - _path = path.copy; - if (_path) { - CGRect bounds = _path.bounds; - CGSize size = bounds.size; - UIEdgeInsets insets = UIEdgeInsetsZero; - if (bounds.origin.x < 0) size.width += bounds.origin.x; - if (bounds.origin.x > 0) insets.left = bounds.origin.x; - if (bounds.origin.y < 0) size.height += bounds.origin.y; - if (bounds.origin.y > 0) insets.top = bounds.origin.y; - _size = size; - _insets = insets; - } - ); -} - -- (NSArray *)exclusionPaths { - Getter(NSArray *paths = _exclusionPaths) return paths; -} - -- (void)setExclusionPaths:(NSArray *)exclusionPaths { - Setter(_exclusionPaths = exclusionPaths.copy); -} - -- (BOOL)isPathFillEvenOdd { - Getter(BOOL is = _pathFillEvenOdd) return is; -} - -- (void)setPathFillEvenOdd:(BOOL)pathFillEvenOdd { - Setter(_pathFillEvenOdd = pathFillEvenOdd); -} - -- (CGFloat)pathLineWidth { - Getter(CGFloat width = _pathLineWidth) return width; -} - -- (void)setPathLineWidth:(CGFloat)pathLineWidth { - Setter(_pathLineWidth = pathLineWidth); -} - -- (BOOL)isVerticalForm { - Getter(BOOL v = _verticalForm) return v; -} - -- (void)setVerticalForm:(BOOL)verticalForm { - Setter(_verticalForm = verticalForm); -} - -- (NSUInteger)maximumNumberOfRows { - Getter(NSUInteger num = _maximumNumberOfRows) return num; -} - -- (void)setMaximumNumberOfRows:(NSUInteger)maximumNumberOfRows { - Setter(_maximumNumberOfRows = maximumNumberOfRows); -} - -- (YYTextTruncationType)truncationType { - Getter(YYTextTruncationType type = _truncationType) return type; -} - -- (void)setTruncationType:(YYTextTruncationType)truncationType { - Setter(_truncationType = truncationType); -} - -- (NSAttributedString *)truncationToken { - Getter(NSAttributedString *token = _truncationToken) return token; -} - -- (void)setTruncationToken:(NSAttributedString *)truncationToken { - Setter(_truncationToken = truncationToken.copy); -} - -- (void)setLinePositionModifier:(id)linePositionModifier { - Setter(_linePositionModifier = [(NSObject *)linePositionModifier copy]); -} - -- (id)linePositionModifier { - Getter(id m = _linePositionModifier) return m; -} - -#undef Getter -#undef Setter -@end - - - - -@interface YYTextLayout () - -@property (nonatomic, readwrite) YYTextContainer *container; -@property (nonatomic, readwrite) NSAttributedString *text; -@property (nonatomic, readwrite) NSRange range; - -@property (nonatomic, readwrite) CTFramesetterRef frameSetter; -@property (nonatomic, readwrite) CTFrameRef frame; -@property (nonatomic, readwrite) NSArray *lines; -@property (nonatomic, readwrite) YYTextLine *truncatedLine; -@property (nonatomic, readwrite) NSArray *attachments; -@property (nonatomic, readwrite) NSArray *attachmentRanges; -@property (nonatomic, readwrite) NSArray *attachmentRects; -@property (nonatomic, readwrite) NSSet *attachmentContentsSet; -@property (nonatomic, readwrite) NSUInteger rowCount; -@property (nonatomic, readwrite) NSRange visibleRange; -@property (nonatomic, readwrite) CGRect textBoundingRect; -@property (nonatomic, readwrite) CGSize textBoundingSize; - -@property (nonatomic, readwrite) BOOL containsHighlight; -@property (nonatomic, readwrite) BOOL needDrawBlockBorder; -@property (nonatomic, readwrite) BOOL needDrawBackgroundBorder; -@property (nonatomic, readwrite) BOOL needDrawShadow; -@property (nonatomic, readwrite) BOOL needDrawUnderline; -@property (nonatomic, readwrite) BOOL needDrawText; -@property (nonatomic, readwrite) BOOL needDrawAttachment; -@property (nonatomic, readwrite) BOOL needDrawInnerShadow; -@property (nonatomic, readwrite) BOOL needDrawStrikethrough; -@property (nonatomic, readwrite) BOOL needDrawBorder; - -@property (nonatomic, assign) NSUInteger *lineRowsIndex; -@property (nonatomic, assign) YYRowEdge *lineRowsEdge; ///< top-left origin - -@end - - - -@implementation YYTextLayout - -#pragma mark - Layout - -- (instancetype)_init { - self = [super init]; - return self; -} - -+ (YYTextLayout *)layoutWithContainerSize:(CGSize)size text:(NSAttributedString *)text { - YYTextContainer *container = [YYTextContainer containerWithSize:size]; - return [self layoutWithContainer:container text:text]; -} - -+ (YYTextLayout *)layoutWithContainer:(YYTextContainer *)container text:(NSAttributedString *)text { - return [self layoutWithContainer:container text:text range:NSMakeRange(0, text.length)]; -} - -+ (YYTextLayout *)layoutWithContainer:(YYTextContainer *)container text:(NSAttributedString *)text range:(NSRange)range { - YYTextLayout *layout = NULL; - CGPathRef cgPath = nil; - CGRect cgPathBox = {0}; - BOOL isVerticalForm = NO; - BOOL rowMaySeparated = NO; - NSMutableDictionary *frameAttrs = nil; - CTFramesetterRef ctSetter = NULL; - CTFrameRef ctFrame = NULL; - CFArrayRef ctLines = nil; - CGPoint *lineOrigins = NULL; - NSUInteger lineCount = 0; - NSMutableArray *lines = nil; - NSMutableArray *attachments = nil; - NSMutableArray *attachmentRanges = nil; - NSMutableArray *attachmentRects = nil; - NSMutableSet *attachmentContentsSet = nil; - BOOL needTruncation = NO; - NSAttributedString *truncationToken = nil; - YYTextLine *truncatedLine = nil; - YYRowEdge *lineRowsEdge = NULL; - NSUInteger *lineRowsIndex = NULL; - NSRange visibleRange; - NSUInteger maximumNumberOfRows = 0; - BOOL constraintSizeIsExtended = NO; - CGRect constraintRectBeforeExtended = {0}; - - text = text.mutableCopy; - container = container.copy; - if (!text || !container) return nil; - if (range.location + range.length > text.length) return nil; - container->_readonly = YES; - maximumNumberOfRows = container.maximumNumberOfRows; - - // CoreText bug when draw joined emoji since iOS 8.3. - // See -[NSMutableAttributedString setClearColorToJoinedEmoji] for more information. - static BOOL needFixJoinedEmojiBug = NO; - // It may use larger constraint size when create CTFrame with - // CTFramesetterCreateFrame in iOS 10. - static BOOL needFixLayoutSizeBug = NO; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - double systemVersionDouble = [UIDevice currentDevice].systemVersion.doubleValue; - if (8.3 <= systemVersionDouble && systemVersionDouble < 9) { - needFixJoinedEmojiBug = YES; - } - if (systemVersionDouble >= 10) { - needFixLayoutSizeBug = YES; - } - }); - if (needFixJoinedEmojiBug) { - [((NSMutableAttributedString *)text) yy_setClearColorToJoinedEmoji]; - } - - layout = [[YYTextLayout alloc] _init]; - layout.text = text; - layout.container = container; - layout.range = range; - isVerticalForm = container.verticalForm; - - // set cgPath and cgPathBox - if (container.path == nil && container.exclusionPaths.count == 0) { - if (container.size.width <= 0 || container.size.height <= 0) goto fail; - CGRect rect = (CGRect) {CGPointZero, container.size }; - if (needFixLayoutSizeBug) { - constraintSizeIsExtended = YES; - constraintRectBeforeExtended = UIEdgeInsetsInsetRect(rect, container.insets); - constraintRectBeforeExtended = CGRectStandardize(constraintRectBeforeExtended); - if (container.isVerticalForm) { - rect.size.width = YYTextContainerMaxSize.width; - } else { - rect.size.height = YYTextContainerMaxSize.height; - } - } - rect = UIEdgeInsetsInsetRect(rect, container.insets); - rect = CGRectStandardize(rect); - cgPathBox = rect; - rect = CGRectApplyAffineTransform(rect, CGAffineTransformMakeScale(1, -1)); - cgPath = CGPathCreateWithRect(rect, NULL); // let CGPathIsRect() returns true - } else if (container.path && CGPathIsRect(container.path.CGPath, &cgPathBox) && container.exclusionPaths.count == 0) { - CGRect rect = CGRectApplyAffineTransform(cgPathBox, CGAffineTransformMakeScale(1, -1)); - cgPath = CGPathCreateWithRect(rect, NULL); // let CGPathIsRect() returns true - } else { - rowMaySeparated = YES; - CGMutablePathRef path = NULL; - if (container.path) { - path = CGPathCreateMutableCopy(container.path.CGPath); - } else { - CGRect rect = (CGRect) {CGPointZero, container.size }; - rect = UIEdgeInsetsInsetRect(rect, container.insets); - CGPathRef rectPath = CGPathCreateWithRect(rect, NULL); - if (rectPath) { - path = CGPathCreateMutableCopy(rectPath); - CGPathRelease(rectPath); - } - } - if (path) { - [layout.container.exclusionPaths enumerateObjectsUsingBlock: ^(UIBezierPath *onePath, NSUInteger idx, BOOL *stop) { - CGPathAddPath(path, NULL, onePath.CGPath); - }]; - - cgPathBox = CGPathGetPathBoundingBox(path); - CGAffineTransform trans = CGAffineTransformMakeScale(1, -1); - CGMutablePathRef transPath = CGPathCreateMutableCopyByTransformingPath(path, &trans); - CGPathRelease(path); - path = transPath; - } - cgPath = path; - } - if (!cgPath) goto fail; - - // frame setter config - frameAttrs = [NSMutableDictionary dictionary]; - if (container.isPathFillEvenOdd == NO) { - frameAttrs[(id)kCTFramePathFillRuleAttributeName] = @(kCTFramePathFillWindingNumber); - } - if (container.pathLineWidth > 0) { - frameAttrs[(id)kCTFramePathWidthAttributeName] = @(container.pathLineWidth); - } - if (container.isVerticalForm == YES) { - frameAttrs[(id)kCTFrameProgressionAttributeName] = @(kCTFrameProgressionRightToLeft); - } - - // create CoreText objects - ctSetter = CTFramesetterCreateWithAttributedString((CFTypeRef)text); - if (!ctSetter) goto fail; - ctFrame = CTFramesetterCreateFrame(ctSetter, YYTextCFRangeFromNSRange(range), cgPath, (CFTypeRef)frameAttrs); - if (!ctFrame) goto fail; - lines = [NSMutableArray new]; - ctLines = CTFrameGetLines(ctFrame); - lineCount = CFArrayGetCount(ctLines); - if (lineCount > 0) { - lineOrigins = malloc(lineCount * sizeof(CGPoint)); - if (lineOrigins == NULL) goto fail; - CTFrameGetLineOrigins(ctFrame, CFRangeMake(0, lineCount), lineOrigins); - } - - CGRect textBoundingRect = CGRectZero; - CGSize textBoundingSize = CGSizeZero; - NSInteger rowIdx = -1; - NSUInteger rowCount = 0; - CGRect lastRect = CGRectMake(0, -FLT_MAX, 0, 0); - CGPoint lastPosition = CGPointMake(0, -FLT_MAX); - if (isVerticalForm) { - lastRect = CGRectMake(FLT_MAX, 0, 0, 0); - lastPosition = CGPointMake(FLT_MAX, 0); - } - - // calculate line frame - NSUInteger lineCurrentIdx = 0; - for (NSUInteger i = 0; i < lineCount; i++) { - CTLineRef ctLine = CFArrayGetValueAtIndex(ctLines, i); - CFArrayRef ctRuns = CTLineGetGlyphRuns(ctLine); - if (!ctRuns || CFArrayGetCount(ctRuns) == 0) continue; - - // CoreText coordinate system - CGPoint ctLineOrigin = lineOrigins[i]; - - // UIKit coordinate system - CGPoint position; - position.x = cgPathBox.origin.x + ctLineOrigin.x; - position.y = cgPathBox.size.height + cgPathBox.origin.y - ctLineOrigin.y; - - YYTextLine *line = [YYTextLine lineWithCTLine:ctLine position:position vertical:isVerticalForm]; - CGRect rect = line.bounds; - - if (constraintSizeIsExtended) { - if (isVerticalForm) { - if (rect.origin.x + rect.size.width > - constraintRectBeforeExtended.origin.x + - constraintRectBeforeExtended.size.width) break; - } else { - if (rect.origin.y + rect.size.height > - constraintRectBeforeExtended.origin.y + - constraintRectBeforeExtended.size.height) break; - } - } - - BOOL newRow = YES; - if (rowMaySeparated && position.x != lastPosition.x) { - if (isVerticalForm) { - if (rect.size.width > lastRect.size.width) { - if (rect.origin.x > lastPosition.x && lastPosition.x > rect.origin.x - rect.size.width) newRow = NO; - } else { - if (lastRect.origin.x > position.x && position.x > lastRect.origin.x - lastRect.size.width) newRow = NO; - } - } else { - if (rect.size.height > lastRect.size.height) { - if (rect.origin.y < lastPosition.y && lastPosition.y < rect.origin.y + rect.size.height) newRow = NO; - } else { - if (lastRect.origin.y < position.y && position.y < lastRect.origin.y + lastRect.size.height) newRow = NO; - } - } - } - - if (newRow) rowIdx++; - lastRect = rect; - lastPosition = position; - - line.index = lineCurrentIdx; - line.row = rowIdx; - [lines addObject:line]; - rowCount = rowIdx + 1; - lineCurrentIdx ++; - - if (i == 0) textBoundingRect = rect; - else { - if (maximumNumberOfRows == 0 || rowIdx < maximumNumberOfRows) { - textBoundingRect = CGRectUnion(textBoundingRect, rect); - } - } - } - - if (rowCount > 0) { - if (maximumNumberOfRows > 0) { - if (rowCount > maximumNumberOfRows) { - needTruncation = YES; - rowCount = maximumNumberOfRows; - do { - YYTextLine *line = lines.lastObject; - if (!line) break; - if (line.row < rowCount) break; - [lines removeLastObject]; - } while (1); - } - } - YYTextLine *lastLine = lines.lastObject; - if (!needTruncation && lastLine.range.location + lastLine.range.length < text.length) { - needTruncation = YES; - } - - // Give user a chance to modify the line's position. - if (container.linePositionModifier) { - [container.linePositionModifier modifyLines:lines fromText:text inContainer:container]; - textBoundingRect = CGRectZero; - for (NSUInteger i = 0, max = lines.count; i < max; i++) { - YYTextLine *line = lines[i]; - if (i == 0) textBoundingRect = line.bounds; - else textBoundingRect = CGRectUnion(textBoundingRect, line.bounds); - } - } - - lineRowsEdge = calloc(rowCount, sizeof(YYRowEdge)); - if (lineRowsEdge == NULL) goto fail; - lineRowsIndex = calloc(rowCount, sizeof(NSUInteger)); - if (lineRowsIndex == NULL) goto fail; - NSInteger lastRowIdx = -1; - CGFloat lastHead = 0; - CGFloat lastFoot = 0; - for (NSUInteger i = 0, max = lines.count; i < max; i++) { - YYTextLine *line = lines[i]; - CGRect rect = line.bounds; - if ((NSInteger)line.row != lastRowIdx) { - if (lastRowIdx >= 0) { - lineRowsEdge[lastRowIdx] = (YYRowEdge) {.head = lastHead, .foot = lastFoot }; - } - lastRowIdx = line.row; - lineRowsIndex[lastRowIdx] = i; - if (isVerticalForm) { - lastHead = rect.origin.x + rect.size.width; - lastFoot = lastHead - rect.size.width; - } else { - lastHead = rect.origin.y; - lastFoot = lastHead + rect.size.height; - } - } else { - if (isVerticalForm) { - lastHead = MAX(lastHead, rect.origin.x + rect.size.width); - lastFoot = MIN(lastFoot, rect.origin.x); - } else { - lastHead = MIN(lastHead, rect.origin.y); - lastFoot = MAX(lastFoot, rect.origin.y + rect.size.height); - } - } - } - lineRowsEdge[lastRowIdx] = (YYRowEdge) {.head = lastHead, .foot = lastFoot }; - - for (NSUInteger i = 1; i < rowCount; i++) { - YYRowEdge v0 = lineRowsEdge[i - 1]; - YYRowEdge v1 = lineRowsEdge[i]; - lineRowsEdge[i - 1].foot = lineRowsEdge[i].head = (v0.foot + v1.head) * 0.5; - } - } - - { // calculate bounding size - CGRect rect = textBoundingRect; - if (container.path) { - if (container.pathLineWidth > 0) { - CGFloat inset = container.pathLineWidth / 2; - rect = CGRectInset(rect, -inset, -inset); - } - } else { - rect = UIEdgeInsetsInsetRect(rect,YYTextUIEdgeInsetsInvert(container.insets)); - } - rect = CGRectStandardize(rect); - CGSize size = rect.size; - if (container.verticalForm) { - size.width += container.size.width - (rect.origin.x + rect.size.width); - } else { - size.width += rect.origin.x; - } - size.height += rect.origin.y; - if (size.width < 0) size.width = 0; - if (size.height < 0) size.height = 0; - size.width = ceil(size.width); - size.height = ceil(size.height); - textBoundingSize = size; - } - - visibleRange = YYTextNSRangeFromCFRange(CTFrameGetVisibleStringRange(ctFrame)); - if (needTruncation) { - YYTextLine *lastLine = lines.lastObject; - NSRange lastRange = lastLine.range; - visibleRange.length = lastRange.location + lastRange.length - visibleRange.location; - - // create truncated line - if (container.truncationType != YYTextTruncationTypeNone) { - CTLineRef truncationTokenLine = NULL; - if (container.truncationToken) { - truncationToken = container.truncationToken; - truncationTokenLine = CTLineCreateWithAttributedString((CFAttributedStringRef)truncationToken); - } else { - CFArrayRef runs = CTLineGetGlyphRuns(lastLine.CTLine); - NSUInteger runCount = CFArrayGetCount(runs); - NSMutableDictionary *attrs = nil; - if (runCount > 0) { - CTRunRef run = CFArrayGetValueAtIndex(runs, runCount - 1); - attrs = (id)CTRunGetAttributes(run); - attrs = attrs ? attrs.mutableCopy : [NSMutableArray new]; - [attrs removeObjectsForKeys:[NSMutableAttributedString yy_allDiscontinuousAttributeKeys]]; - CTFontRef font = (__bridge CFTypeRef)attrs[(id)kCTFontAttributeName]; - CGFloat fontSize = font ? CTFontGetSize(font) : 12.0; - UIFont *uiFont = [UIFont systemFontOfSize:fontSize * 0.9]; - if (uiFont) { - font = CTFontCreateWithName((__bridge CFStringRef)uiFont.fontName, uiFont.pointSize, NULL); - } else { - font = NULL; - } - if (font) { - attrs[(id)kCTFontAttributeName] = (__bridge id)(font); - uiFont = nil; - CFRelease(font); - } - CGColorRef color = (__bridge CGColorRef)(attrs[(id)kCTForegroundColorAttributeName]); - if (color && CFGetTypeID(color) == CGColorGetTypeID() && CGColorGetAlpha(color) == 0) { - // ignore clear color - [attrs removeObjectForKey:(id)kCTForegroundColorAttributeName]; - } - if (!attrs) attrs = [NSMutableDictionary new]; - } - truncationToken = [[NSAttributedString alloc] initWithString:YYTextTruncationToken attributes:attrs]; - truncationTokenLine = CTLineCreateWithAttributedString((CFAttributedStringRef)truncationToken); - } - if (truncationTokenLine) { - CTLineTruncationType type = kCTLineTruncationEnd; - if (container.truncationType == YYTextTruncationTypeStart) { - type = kCTLineTruncationStart; - } else if (container.truncationType == YYTextTruncationTypeMiddle) { - type = kCTLineTruncationMiddle; - } - NSMutableAttributedString *lastLineText = [text attributedSubstringFromRange:lastLine.range].mutableCopy; - [lastLineText appendAttributedString:truncationToken]; - CTLineRef ctLastLineExtend = CTLineCreateWithAttributedString((CFAttributedStringRef)lastLineText); - if (ctLastLineExtend) { - CGFloat truncatedWidth = lastLine.width; - CGRect cgPathRect = CGRectZero; - if (CGPathIsRect(cgPath, &cgPathRect)) { - if (isVerticalForm) { - truncatedWidth = cgPathRect.size.height; - } else { - truncatedWidth = cgPathRect.size.width; - } - } - CTLineRef ctTruncatedLine = CTLineCreateTruncatedLine(ctLastLineExtend, truncatedWidth, type, truncationTokenLine); - CFRelease(ctLastLineExtend); - if (ctTruncatedLine) { - truncatedLine = [YYTextLine lineWithCTLine:ctTruncatedLine position:lastLine.position vertical:isVerticalForm]; - truncatedLine.index = lastLine.index; - truncatedLine.row = lastLine.row; - CFRelease(ctTruncatedLine); - } - } - CFRelease(truncationTokenLine); - } - } - } - - if (isVerticalForm) { - NSCharacterSet *rotateCharset = YYTextVerticalFormRotateCharacterSet(); - NSCharacterSet *rotateMoveCharset = YYTextVerticalFormRotateAndMoveCharacterSet(); - - void (^lineBlock)(YYTextLine *) = ^(YYTextLine *line){ - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - if (!runs) return; - NSUInteger runCount = CFArrayGetCount(runs); - if (runCount == 0) return; - NSMutableArray *lineRunRanges = [NSMutableArray new]; - line.verticalRotateRange = lineRunRanges; - for (NSUInteger r = 0; r < runCount; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - NSMutableArray *runRanges = [NSMutableArray new]; - [lineRunRanges addObject:runRanges]; - NSUInteger glyphCount = CTRunGetGlyphCount(run); - if (glyphCount == 0) continue; - - CFIndex runStrIdx[glyphCount + 1]; - CTRunGetStringIndices(run, CFRangeMake(0, 0), runStrIdx); - CFRange runStrRange = CTRunGetStringRange(run); - runStrIdx[glyphCount] = runStrRange.location + runStrRange.length; - CFDictionaryRef runAttrs = CTRunGetAttributes(run); - CTFontRef font = CFDictionaryGetValue(runAttrs, kCTFontAttributeName); - BOOL isColorGlyph = YYTextCTFontContainsColorBitmapGlyphs(font); - - NSUInteger prevIdx = 0; - YYTextRunGlyphDrawMode prevMode = YYTextRunGlyphDrawModeHorizontal; - NSString *layoutStr = layout.text.string; - for (NSUInteger g = 0; g < glyphCount; g++) { - BOOL glyphRotate = 0, glyphRotateMove = NO; - CFIndex runStrLen = runStrIdx[g + 1] - runStrIdx[g]; - if (isColorGlyph) { - glyphRotate = YES; - } else if (runStrLen == 1) { - unichar c = [layoutStr characterAtIndex:runStrIdx[g]]; - glyphRotate = [rotateCharset characterIsMember:c]; - if (glyphRotate) glyphRotateMove = [rotateMoveCharset characterIsMember:c]; - } else if (runStrLen > 1){ - NSString *glyphStr = [layoutStr substringWithRange:NSMakeRange(runStrIdx[g], runStrLen)]; - BOOL glyphRotate = [glyphStr rangeOfCharacterFromSet:rotateCharset].location != NSNotFound; - if (glyphRotate) glyphRotateMove = [glyphStr rangeOfCharacterFromSet:rotateMoveCharset].location != NSNotFound; - } - - YYTextRunGlyphDrawMode mode = glyphRotateMove ? YYTextRunGlyphDrawModeVerticalRotateMove : (glyphRotate ? YYTextRunGlyphDrawModeVerticalRotate : YYTextRunGlyphDrawModeHorizontal); - if (g == 0) { - prevMode = mode; - } else if (mode != prevMode) { - YYTextRunGlyphRange *aRange = [YYTextRunGlyphRange rangeWithRange:NSMakeRange(prevIdx, g - prevIdx) drawMode:prevMode]; - [runRanges addObject:aRange]; - prevIdx = g; - prevMode = mode; - } - } - if (prevIdx < glyphCount) { - YYTextRunGlyphRange *aRange = [YYTextRunGlyphRange rangeWithRange:NSMakeRange(prevIdx, glyphCount - prevIdx) drawMode:prevMode]; - [runRanges addObject:aRange]; - } - - } - }; - for (YYTextLine *line in lines) { - lineBlock(line); - } - if (truncatedLine) lineBlock(truncatedLine); - } - - if (visibleRange.length > 0) { - layout.needDrawText = YES; - - void (^block)(NSDictionary *attrs, NSRange range, BOOL *stop) = ^(NSDictionary *attrs, NSRange range, BOOL *stop) { - if (attrs[YYTextHighlightAttributeName]) layout.containsHighlight = YES; - if (attrs[YYTextBlockBorderAttributeName]) layout.needDrawBlockBorder = YES; - if (attrs[YYTextBackgroundBorderAttributeName]) layout.needDrawBackgroundBorder = YES; - if (attrs[YYTextShadowAttributeName] || attrs[NSShadowAttributeName]) layout.needDrawShadow = YES; - if (attrs[YYTextUnderlineAttributeName]) layout.needDrawUnderline = YES; - if (attrs[YYTextAttachmentAttributeName]) layout.needDrawAttachment = YES; - if (attrs[YYTextInnerShadowAttributeName]) layout.needDrawInnerShadow = YES; - if (attrs[YYTextStrikethroughAttributeName]) layout.needDrawStrikethrough = YES; - if (attrs[YYTextBorderAttributeName]) layout.needDrawBorder = YES; - }; - - [layout.text enumerateAttributesInRange:visibleRange options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:block]; - if (truncatedLine) { - [truncationToken enumerateAttributesInRange:NSMakeRange(0, truncationToken.length) options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:block]; - } - } - - attachments = [NSMutableArray new]; - attachmentRanges = [NSMutableArray new]; - attachmentRects = [NSMutableArray new]; - attachmentContentsSet = [NSMutableSet new]; - for (NSUInteger i = 0, max = lines.count; i < max; i++) { - YYTextLine *line = lines[i]; - if (truncatedLine && line.index == truncatedLine.index) line = truncatedLine; - if (line.attachments.count > 0) { - [attachments addObjectsFromArray:line.attachments]; - [attachmentRanges addObjectsFromArray:line.attachmentRanges]; - [attachmentRects addObjectsFromArray:line.attachmentRects]; - for (YYTextAttachment *attachment in line.attachments) { - if (attachment.content) { - [attachmentContentsSet addObject:attachment.content]; - } - } - } - } - if (attachments.count == 0) { - attachments = attachmentRanges = attachmentRects = nil; - } - - layout.frameSetter = ctSetter; - layout.frame = ctFrame; - layout.lines = lines; - layout.truncatedLine = truncatedLine; - layout.attachments = attachments; - layout.attachmentRanges = attachmentRanges; - layout.attachmentRects = attachmentRects; - layout.attachmentContentsSet = attachmentContentsSet; - layout.rowCount = rowCount; - layout.visibleRange = visibleRange; - layout.textBoundingRect = textBoundingRect; - layout.textBoundingSize = textBoundingSize; - layout.lineRowsEdge = lineRowsEdge; - layout.lineRowsIndex = lineRowsIndex; - CFRelease(cgPath); - CFRelease(ctSetter); - CFRelease(ctFrame); - if (lineOrigins) free(lineOrigins); - return layout; - -fail: - if (cgPath) CFRelease(cgPath); - if (ctSetter) CFRelease(ctSetter); - if (ctFrame) CFRelease(ctFrame); - if (lineOrigins) free(lineOrigins); - if (lineRowsEdge) free(lineRowsEdge); - if (lineRowsIndex) free(lineRowsIndex); - return nil; -} - -+ (NSArray *)layoutWithContainers:(NSArray *)containers text:(NSAttributedString *)text { - return [self layoutWithContainers:containers text:text range:NSMakeRange(0, text.length)]; -} - -+ (NSArray *)layoutWithContainers:(NSArray *)containers text:(NSAttributedString *)text range:(NSRange)range { - if (!containers || !text) return nil; - if (range.location + range.length > text.length) return nil; - NSMutableArray *layouts = [NSMutableArray array]; - for (NSUInteger i = 0, max = containers.count; i < max; i++) { - YYTextContainer *container = containers[i]; - YYTextLayout *layout = [self layoutWithContainer:container text:text range:range]; - if (!layout) return nil; - NSInteger length = (NSInteger)range.length - (NSInteger)layout.visibleRange.length; - if (length <= 0) { - range.length = 0; - range.location = text.length; - } else { - range.length = length; - range.location += layout.visibleRange.length; - } - } - return layouts; -} - -- (void)setFrameSetter:(CTFramesetterRef)frameSetter { - if (_frameSetter != frameSetter) { - if (frameSetter) CFRetain(frameSetter); - if (_frameSetter) CFRelease(_frameSetter); - _frameSetter = frameSetter; - } -} - -- (void)setFrame:(CTFrameRef)frame { - if (_frame != frame) { - if (frame) CFRetain(frame); - if (_frame) CFRelease(_frame); - _frame = frame; - } -} - -- (void)dealloc { - if (_frameSetter) CFRelease(_frameSetter); - if (_frame) CFRelease(_frame); - if (_lineRowsIndex) free(_lineRowsIndex); - if (_lineRowsEdge) free(_lineRowsEdge); -} - -#pragma mark - Coding - - -- (void)encodeWithCoder:(NSCoder *)aCoder { - NSData *textData = [YYTextArchiver archivedDataWithRootObject:_text]; - [aCoder encodeObject:textData forKey:@"text"]; - [aCoder encodeObject:_container forKey:@"container"]; - [aCoder encodeObject:[NSValue valueWithRange:_range] forKey:@"range"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - NSData *textData = [aDecoder decodeObjectForKey:@"text"]; - NSAttributedString *text = [YYTextUnarchiver unarchiveObjectWithData:textData]; - YYTextContainer *container = [aDecoder decodeObjectForKey:@"container"]; - NSRange range = ((NSValue *)[aDecoder decodeObjectForKey:@"range"]).rangeValue; - self = [self.class layoutWithContainer:container text:text range:range]; - return self; -} - -#pragma mark - Copying - -- (id)copyWithZone:(NSZone *)zone { - return self; // readonly object -} - - -#pragma mark - Query - -/** - Get the row index with 'edge' distance. - - @param edge The distance from edge to the point. - If vertical form, the edge is left edge, otherwise the edge is top edge. - - @return Returns NSNotFound if there's no row at the point. - */ -- (NSUInteger)_rowIndexForEdge:(CGFloat)edge { - if (_rowCount == 0) return NSNotFound; - BOOL isVertical = _container.verticalForm; - NSUInteger lo = 0, hi = _rowCount - 1, mid = 0; - NSUInteger rowIdx = NSNotFound; - while (lo <= hi) { - mid = (lo + hi) / 2; - YYRowEdge oneEdge = _lineRowsEdge[mid]; - if (isVertical ? - (oneEdge.foot <= edge && edge <= oneEdge.head) : - (oneEdge.head <= edge && edge <= oneEdge.foot)) { - rowIdx = mid; - break; - } - if ((isVertical ? (edge > oneEdge.head) : (edge < oneEdge.head))) { - if (mid == 0) break; - hi = mid - 1; - } else { - lo = mid + 1; - } - } - return rowIdx; -} - -/** - Get the closest row index with 'edge' distance. - - @param edge The distance from edge to the point. - If vertical form, the edge is left edge, otherwise the edge is top edge. - - @return Returns NSNotFound if there's no line. - */ -- (NSUInteger)_closestRowIndexForEdge:(CGFloat)edge { - if (_rowCount == 0) return NSNotFound; - NSUInteger rowIdx = [self _rowIndexForEdge:edge]; - if (rowIdx == NSNotFound) { - if (_container.verticalForm) { - if (edge > _lineRowsEdge[0].head) { - rowIdx = 0; - } else if (edge < _lineRowsEdge[_rowCount - 1].foot) { - rowIdx = _rowCount - 1; - } - } else { - if (edge < _lineRowsEdge[0].head) { - rowIdx = 0; - } else if (edge > _lineRowsEdge[_rowCount - 1].foot) { - rowIdx = _rowCount - 1; - } - } - } - return rowIdx; -} - -/** - Get a CTRun from a line position. - - @param line The text line. - @param position The position in the whole text. - - @return Returns NULL if not found (no CTRun at the position). - */ -- (CTRunRef)_runForLine:(YYTextLine *)line position:(YYTextPosition *)position { - if (!line || !position) return NULL; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger i = 0, max = CFArrayGetCount(runs); i < max; i++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, i); - CFRange range = CTRunGetStringRange(run); - if (position.affinity == YYTextAffinityBackward) { - if (range.location < position.offset && position.offset <= range.location + range.length) { - return run; - } - } else { - if (range.location <= position.offset && position.offset < range.location + range.length) { - return run; - } - } - } - return NULL; -} - -/** - Whether the position is inside a composed character sequence. - - @param line The text line. - @param position Text text position in whole text. - @param block The block to be executed before returns YES. - left: left X offset - right: right X offset - prev: left position - next: right position - */ -- (BOOL)_insideComposedCharacterSequences:(YYTextLine *)line position:(NSUInteger)position block:(void (^)(CGFloat left, CGFloat right, NSUInteger prev, NSUInteger next))block { - NSRange range = line.range; - if (range.length == 0) return NO; - __block BOOL inside = NO; - __block NSUInteger _prev, _next; - [_text.string enumerateSubstringsInRange:range options:NSStringEnumerationByComposedCharacterSequences usingBlock: ^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { - NSUInteger prev = substringRange.location; - NSUInteger next = substringRange.location + substringRange.length; - if (prev == position || next == position) { - *stop = YES; - } - if (prev < position && position < next) { - inside = YES; - _prev = prev; - _next = next; - *stop = YES; - } - }]; - if (inside && block) { - CGFloat left = [self offsetForTextPosition:_prev lineIndex:line.index]; - CGFloat right = [self offsetForTextPosition:_next lineIndex:line.index]; - block(left, right, _prev, _next); - } - return inside; -} - -/** - Whether the position is inside an emoji (such as National Flag Emoji). - - @param line The text line. - @param position Text text position in whole text. - @param block Yhe block to be executed before returns YES. - left: emoji's left X offset - right: emoji's right X offset - prev: emoji's left position - next: emoji's right position - */ -- (BOOL)_insideEmoji:(YYTextLine *)line position:(NSUInteger)position block:(void (^)(CGFloat left, CGFloat right, NSUInteger prev, NSUInteger next))block { - if (!line) return NO; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger r = 0, rMax = CFArrayGetCount(runs); r < rMax; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - NSUInteger glyphCount = CTRunGetGlyphCount(run); - if (glyphCount == 0) continue; - CFRange range = CTRunGetStringRange(run); - if (range.length <= 1) continue; - if (position <= range.location || position >= range.location + range.length) continue; - CFDictionaryRef attrs = CTRunGetAttributes(run); - CTFontRef font = CFDictionaryGetValue(attrs, kCTFontAttributeName); - if (!YYTextCTFontContainsColorBitmapGlyphs(font)) continue; - - // Here's Emoji runs (larger than 1 unichar), and position is inside the range. - CFIndex indices[glyphCount]; - CTRunGetStringIndices(run, CFRangeMake(0, glyphCount), indices); - for (NSUInteger g = 0; g < glyphCount; g++) { - CFIndex prev = indices[g]; - CFIndex next = g + 1 < glyphCount ? indices[g + 1] : range.location + range.length; - if (position == prev) break; // Emoji edge - if (prev < position && position < next) { // inside an emoji (such as National Flag Emoji) - CGPoint pos = CGPointZero; - CGSize adv = CGSizeZero; - CTRunGetPositions(run, CFRangeMake(g, 1), &pos); - CTRunGetAdvances(run, CFRangeMake(g, 1), &adv); - if (block) { - block(line.position.x + pos.x, - line.position.x + pos.x + adv.width, - prev, next); - } - return YES; - } - } - } - return NO; -} -/** - Whether the write direction is RTL at the specified point - - @param line The text line - @param point The point in layout. - - @return YES if RTL. - */ -- (BOOL)_isRightToLeftInLine:(YYTextLine *)line atPoint:(CGPoint)point { - if (!line) return NO; - // get write direction - BOOL RTL = NO; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger r = 0, max = CFArrayGetCount(runs); r < max; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CGPoint glyphPosition; - CTRunGetPositions(run, CFRangeMake(0, 1), &glyphPosition); - if (_container.verticalForm) { - CGFloat runX = glyphPosition.x; - runX += line.position.y; - CGFloat runWidth = CTRunGetTypographicBounds(run, CFRangeMake(0, 0), NULL, NULL, NULL); - if (runX <= point.y && point.y <= runX + runWidth) { - if (CTRunGetStatus(run) & kCTRunStatusRightToLeft) RTL = YES; - break; - } - } else { - CGFloat runX = glyphPosition.x; - runX += line.position.x; - CGFloat runWidth = CTRunGetTypographicBounds(run, CFRangeMake(0, 0), NULL, NULL, NULL); - if (runX <= point.x && point.x <= runX + runWidth) { - if (CTRunGetStatus(run) & kCTRunStatusRightToLeft) RTL = YES; - break; - } - } - } - return RTL; -} - -/** - Correct the range's edge. - */ -- (YYTextRange *)_correctedRangeWithEdge:(YYTextRange *)range { - NSRange visibleRange = self.visibleRange; - YYTextPosition *start = range.start; - YYTextPosition *end = range.end; - - if (start.offset == visibleRange.location && start.affinity == YYTextAffinityBackward) { - start = [YYTextPosition positionWithOffset:start.offset affinity:YYTextAffinityForward]; - } - - if (end.offset == visibleRange.location + visibleRange.length && start.affinity == YYTextAffinityForward) { - end = [YYTextPosition positionWithOffset:end.offset affinity:YYTextAffinityBackward]; - } - - if (start != range.start || end != range.end) { - range = [YYTextRange rangeWithStart:start end:end]; - } - return range; -} - -- (NSUInteger)lineIndexForRow:(NSUInteger)row { - if (row >= _rowCount) return NSNotFound; - return _lineRowsIndex[row]; -} - -- (NSUInteger)lineCountForRow:(NSUInteger)row { - if (row >= _rowCount) return NSNotFound; - if (row == _rowCount - 1) { - return _lines.count - _lineRowsIndex[row]; - } else { - return _lineRowsIndex[row + 1] - _lineRowsIndex[row]; - } -} - -- (NSUInteger)rowIndexForLine:(NSUInteger)line { - if (line >= _lines.count) return NSNotFound; - return ((YYTextLine *)_lines[line]).row; -} - -- (NSUInteger)lineIndexForPoint:(CGPoint)point { - if (_lines.count == 0 || _rowCount == 0) return NSNotFound; - NSUInteger rowIdx = [self _rowIndexForEdge:_container.verticalForm ? point.x : point.y]; - if (rowIdx == NSNotFound) return NSNotFound; - - NSUInteger lineIdx0 = _lineRowsIndex[rowIdx]; - NSUInteger lineIdx1 = rowIdx == _rowCount - 1 ? _lines.count - 1 : _lineRowsIndex[rowIdx + 1] - 1; - for (NSUInteger i = lineIdx0; i <= lineIdx1; i++) { - CGRect bounds = ((YYTextLine *)_lines[i]).bounds; - if (CGRectContainsPoint(bounds, point)) return i; - } - - return NSNotFound; -} - -- (NSUInteger)closestLineIndexForPoint:(CGPoint)point { - BOOL isVertical = _container.verticalForm; - if (_lines.count == 0 || _rowCount == 0) return NSNotFound; - NSUInteger rowIdx = [self _closestRowIndexForEdge:isVertical ? point.x : point.y]; - if (rowIdx == NSNotFound) return NSNotFound; - - NSUInteger lineIdx0 = _lineRowsIndex[rowIdx]; - NSUInteger lineIdx1 = rowIdx == _rowCount - 1 ? _lines.count - 1 : _lineRowsIndex[rowIdx + 1] - 1; - if (lineIdx0 == lineIdx1) return lineIdx0; - - CGFloat minDistance = CGFLOAT_MAX; - NSUInteger minIndex = lineIdx0; - for (NSUInteger i = lineIdx0; i <= lineIdx1; i++) { - CGRect bounds = ((YYTextLine *)_lines[i]).bounds; - if (isVertical) { - if (bounds.origin.y <= point.y && point.y <= bounds.origin.y + bounds.size.height) return i; - CGFloat distance; - if (point.y < bounds.origin.y) { - distance = bounds.origin.y - point.y; - } else { - distance = point.y - (bounds.origin.y + bounds.size.height); - } - if (distance < minDistance) { - minDistance = distance; - minIndex = i; - } - } else { - if (bounds.origin.x <= point.x && point.x <= bounds.origin.x + bounds.size.width) return i; - CGFloat distance; - if (point.x < bounds.origin.x) { - distance = bounds.origin.x - point.x; - } else { - distance = point.x - (bounds.origin.x + bounds.size.width); - } - if (distance < minDistance) { - minDistance = distance; - minIndex = i; - } - } - } - return minIndex; -} - -- (CGFloat)offsetForTextPosition:(NSUInteger)position lineIndex:(NSUInteger)lineIndex { - if (lineIndex >= _lines.count) return CGFLOAT_MAX; - YYTextLine *line = _lines[lineIndex]; - CFRange range = CTLineGetStringRange(line.CTLine); - if (position < range.location || position > range.location + range.length) return CGFLOAT_MAX; - - CGFloat offset = CTLineGetOffsetForStringIndex(line.CTLine, position, NULL); - return _container.verticalForm ? (offset + line.position.y) : (offset + line.position.x); -} - -- (NSUInteger)textPositionForPoint:(CGPoint)point lineIndex:(NSUInteger)lineIndex { - if (lineIndex >= _lines.count) return NSNotFound; - YYTextLine *line = _lines[lineIndex]; - if (_container.verticalForm) { - point.x = point.y - line.position.y; - point.y = 0; - } else { - point.x -= line.position.x; - point.y = 0; - } - CFIndex idx = CTLineGetStringIndexForPosition(line.CTLine, point); - if (idx == kCFNotFound) return NSNotFound; - - /* - If the emoji contains one or more variant form (such as ☔️ "\u2614\uFE0F") - and the font size is smaller than 379/15, then each variant form ("\uFE0F") - will rendered as a single blank glyph behind the emoji glyph. Maybe it's a - bug in CoreText? Seems iOS8.3 fixes this problem. - - If the point hit the blank glyph, the CTLineGetStringIndexForPosition() - returns the position before the emoji glyph, but it should returns the - position after the emoji and variant form. - - Here's a workaround. - */ - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger r = 0, max = CFArrayGetCount(runs); r < max; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CFRange range = CTRunGetStringRange(run); - if (range.location <= idx && idx < range.location + range.length) { - NSUInteger glyphCount = CTRunGetGlyphCount(run); - if (glyphCount == 0) break; - CFDictionaryRef attrs = CTRunGetAttributes(run); - CTFontRef font = CFDictionaryGetValue(attrs, kCTFontAttributeName); - if (!YYTextCTFontContainsColorBitmapGlyphs(font)) break; - - CFIndex indices[glyphCount]; - CGPoint positions[glyphCount]; - CTRunGetStringIndices(run, CFRangeMake(0, glyphCount), indices); - CTRunGetPositions(run, CFRangeMake(0, glyphCount), positions); - for (NSUInteger g = 0; g < glyphCount; g++) { - NSUInteger gIdx = indices[g]; - if (gIdx == idx && g + 1 < glyphCount) { - CGFloat right = positions[g + 1].x; - if (point.x < right) break; - NSUInteger next = indices[g + 1]; - do { - if (next == range.location + range.length) break; - unichar c = [_text.string characterAtIndex:next]; - if ((c == 0xFE0E || c == 0xFE0F)) { // unicode variant form for emoji style - next++; - } else break; - } - while (1); - if (next != indices[g + 1]) idx = next; - break; - } - } - break; - } - } - return idx; -} - -- (YYTextPosition *)closestPositionToPoint:(CGPoint)point { - BOOL isVertical = _container.verticalForm; - // When call CTLineGetStringIndexForPosition() on ligature such as 'fi', - // and the point `hit` the glyph's left edge, it may get the ligature inside offset. - // I don't know why, maybe it's a bug of CoreText. Try to avoid it. - if (isVertical) point.y += 0.00001234; - else point.x += 0.00001234; - - NSUInteger lineIndex = [self closestLineIndexForPoint:point]; - if (lineIndex == NSNotFound) return nil; - YYTextLine *line = _lines[lineIndex]; - __block NSUInteger position = [self textPositionForPoint:point lineIndex:lineIndex]; - if (position == NSNotFound) position = line.range.location; - if (position <= _visibleRange.location) { - return [YYTextPosition positionWithOffset:_visibleRange.location affinity:YYTextAffinityForward]; - } else if (position >= _visibleRange.location + _visibleRange.length) { - return [YYTextPosition positionWithOffset:_visibleRange.location + _visibleRange.length affinity:YYTextAffinityBackward]; - } - - YYTextAffinity finalAffinity = YYTextAffinityForward; - BOOL finalAffinityDetected = NO; - - // binding range - NSRange bindingRange; - YYTextBinding *binding = [_text attribute:YYTextBindingAttributeName atIndex:position longestEffectiveRange:&bindingRange inRange:NSMakeRange(0, _text.length)]; - if (binding && bindingRange.length > 0) { - NSUInteger headLineIdx = [self lineIndexForPosition:[YYTextPosition positionWithOffset:bindingRange.location]]; - NSUInteger tailLineIdx = [self lineIndexForPosition:[YYTextPosition positionWithOffset:bindingRange.location + bindingRange.length affinity:YYTextAffinityBackward]]; - if (headLineIdx == lineIndex && lineIndex == tailLineIdx) { // all in same line - CGFloat left = [self offsetForTextPosition:bindingRange.location lineIndex:lineIndex]; - CGFloat right = [self offsetForTextPosition:bindingRange.location + bindingRange.length lineIndex:lineIndex]; - if (left != CGFLOAT_MAX && right != CGFLOAT_MAX) { - if (_container.isVerticalForm) { - if (fabs(point.y - left) < fabs(point.y - right)) { - position = bindingRange.location; - finalAffinity = YYTextAffinityForward; - } else { - position = bindingRange.location + bindingRange.length; - finalAffinity = YYTextAffinityBackward; - } - } else { - if (fabs(point.x - left) < fabs(point.x - right)) { - position = bindingRange.location; - finalAffinity = YYTextAffinityForward; - } else { - position = bindingRange.location + bindingRange.length; - finalAffinity = YYTextAffinityBackward; - } - } - } else if (left != CGFLOAT_MAX) { - position = left; - finalAffinity = YYTextAffinityForward; - } else if (right != CGFLOAT_MAX) { - position = right; - finalAffinity = YYTextAffinityBackward; - } - finalAffinityDetected = YES; - } else if (headLineIdx == lineIndex) { - CGFloat left = [self offsetForTextPosition:bindingRange.location lineIndex:lineIndex]; - if (left != CGFLOAT_MAX) { - position = bindingRange.location; - finalAffinity = YYTextAffinityForward; - finalAffinityDetected = YES; - } - } else if (tailLineIdx == lineIndex) { - CGFloat right = [self offsetForTextPosition:bindingRange.location + bindingRange.length lineIndex:lineIndex]; - if (right != CGFLOAT_MAX) { - position = bindingRange.location + bindingRange.length; - finalAffinity = YYTextAffinityBackward; - finalAffinityDetected = YES; - } - } else { - BOOL onLeft = NO, onRight = NO; - if (headLineIdx != NSNotFound && tailLineIdx != NSNotFound) { - if (abs((int)headLineIdx - (int)lineIndex) < abs((int)tailLineIdx - (int)lineIndex)) onLeft = YES; - else onRight = YES; - } else if (headLineIdx != NSNotFound) { - onLeft = YES; - } else if (tailLineIdx != NSNotFound) { - onRight = YES; - } - - if (onLeft) { - CGFloat left = [self offsetForTextPosition:bindingRange.location lineIndex:headLineIdx]; - if (left != CGFLOAT_MAX) { - lineIndex = headLineIdx; - line = _lines[headLineIdx]; - position = bindingRange.location; - finalAffinity = YYTextAffinityForward; - finalAffinityDetected = YES; - } - } else if (onRight) { - CGFloat right = [self offsetForTextPosition:bindingRange.location + bindingRange.length lineIndex:tailLineIdx]; - if (right != CGFLOAT_MAX) { - lineIndex = tailLineIdx; - line = _lines[tailLineIdx]; - position = bindingRange.location + bindingRange.length; - finalAffinity = YYTextAffinityBackward; - finalAffinityDetected = YES; - } - } - } - } - - // empty line - if (line.range.length == 0) { - BOOL behind = (_lines.count > 1 && lineIndex == _lines.count - 1); //end line - return [YYTextPosition positionWithOffset:line.range.location affinity:behind ? YYTextAffinityBackward:YYTextAffinityForward]; - } - - // detect weather the line is a linebreak token - if (line.range.length <= 2) { - NSString *str = [_text.string substringWithRange:line.range]; - if (YYTextIsLinebreakString(str)) { // an empty line ("\r", "\n", "\r\n") - return [YYTextPosition positionWithOffset:line.range.location]; - } - } - - // above whole text frame - if (lineIndex == 0 && (isVertical ? (point.x > line.right) : (point.y < line.top))) { - position = 0; - finalAffinity = YYTextAffinityForward; - finalAffinityDetected = YES; - } - // below whole text frame - if (lineIndex == _lines.count - 1 && (isVertical ? (point.x < line.left) : (point.y > line.bottom))) { - position = line.range.location + line.range.length; - finalAffinity = YYTextAffinityBackward; - finalAffinityDetected = YES; - } - - // There must be at least one non-linebreak char, - // ignore the linebreak characters at line end if exists. - if (position >= line.range.location + line.range.length - 1) { - if (position > line.range.location) { - unichar c1 = [_text.string characterAtIndex:position - 1]; - if (YYTextIsLinebreakChar(c1)) { - position--; - if (position > line.range.location) { - unichar c0 = [_text.string characterAtIndex:position - 1]; - if (YYTextIsLinebreakChar(c0)) { - position--; - } - } - } - } - } - if (position == line.range.location) { - return [YYTextPosition positionWithOffset:position]; - } - if (position == line.range.location + line.range.length) { - return [YYTextPosition positionWithOffset:position affinity:YYTextAffinityBackward]; - } - - [self _insideComposedCharacterSequences:line position:position block: ^(CGFloat left, CGFloat right, NSUInteger prev, NSUInteger next) { - if (isVertical) { - position = fabs(left - point.y) < fabs(right - point.y) < (right ? prev : next); - } else { - position = fabs(left - point.x) < fabs(right - point.x) < (right ? prev : next); - } - }]; - - [self _insideEmoji:line position:position block: ^(CGFloat left, CGFloat right, NSUInteger prev, NSUInteger next) { - if (isVertical) { - position = fabs(left - point.y) < fabs(right - point.y) < (right ? prev : next); - } else { - position = fabs(left - point.x) < fabs(right - point.x) < (right ? prev : next); - } - }]; - - if (position < _visibleRange.location) position = _visibleRange.location; - else if (position > _visibleRange.location + _visibleRange.length) position = _visibleRange.location + _visibleRange.length; - - if (!finalAffinityDetected) { - CGFloat ofs = [self offsetForTextPosition:position lineIndex:lineIndex]; - if (ofs != CGFLOAT_MAX) { - BOOL RTL = [self _isRightToLeftInLine:line atPoint:point]; - if (position >= line.range.location + line.range.length) { - finalAffinity = RTL ? YYTextAffinityForward : YYTextAffinityBackward; - } else if (position <= line.range.location) { - finalAffinity = RTL ? YYTextAffinityBackward : YYTextAffinityForward; - } else { - finalAffinity = (ofs < (isVertical ? point.y : point.x) && !RTL) ? YYTextAffinityForward : YYTextAffinityBackward; - } - } - } - - return [YYTextPosition positionWithOffset:position affinity:finalAffinity]; -} - -- (YYTextPosition *)positionForPoint:(CGPoint)point - oldPosition:(YYTextPosition *)oldPosition - otherPosition:(YYTextPosition *)otherPosition { - if (!oldPosition || !otherPosition) { - return oldPosition; - } - YYTextPosition *newPos = [self closestPositionToPoint:point]; - if (!newPos) return oldPosition; - if ([newPos compare:otherPosition] == [oldPosition compare:otherPosition] && - newPos.offset != otherPosition.offset) { - return newPos; - } - NSUInteger lineIndex = [self lineIndexForPosition:otherPosition]; - if (lineIndex == NSNotFound) return oldPosition; - YYTextLine *line = _lines[lineIndex]; - YYRowEdge vertical = _lineRowsEdge[line.row]; - if (_container.verticalForm) { - point.x = (vertical.head + vertical.foot) * 0.5; - } else { - point.y = (vertical.head + vertical.foot) * 0.5; - } - newPos = [self closestPositionToPoint:point]; - if ([newPos compare:otherPosition] == [oldPosition compare:otherPosition] && - newPos.offset != otherPosition.offset) { - return newPos; - } - - if (_container.isVerticalForm) { - if ([oldPosition compare:otherPosition] == NSOrderedAscending) { // search backward - YYTextRange *range = [self textRangeByExtendingPosition:otherPosition inDirection:UITextLayoutDirectionUp offset:1]; - if (range) return range.start; - } else { // search forward - YYTextRange *range = [self textRangeByExtendingPosition:otherPosition inDirection:UITextLayoutDirectionDown offset:1]; - if (range) return range.end; - } - } else { - if ([oldPosition compare:otherPosition] == NSOrderedAscending) { // search backward - YYTextRange *range = [self textRangeByExtendingPosition:otherPosition inDirection:UITextLayoutDirectionLeft offset:1]; - if (range) return range.start; - } else { // search forward - YYTextRange *range = [self textRangeByExtendingPosition:otherPosition inDirection:UITextLayoutDirectionRight offset:1]; - if (range) return range.end; - } - } - - return oldPosition; -} - -- (YYTextRange *)textRangeAtPoint:(CGPoint)point { - NSUInteger lineIndex = [self lineIndexForPoint:point]; - if (lineIndex == NSNotFound) return nil; - NSUInteger textPosition = [self textPositionForPoint:point lineIndex:[self lineIndexForPoint:point]]; - if (textPosition == NSNotFound) return nil; - YYTextPosition *pos = [self closestPositionToPoint:point]; - if (!pos) return nil; - - // get write direction - BOOL RTL = [self _isRightToLeftInLine:_lines[lineIndex] atPoint:point]; - CGRect rect = [self caretRectForPosition:pos]; - if (CGRectIsNull(rect)) return nil; - - if (_container.verticalForm) { - YYTextRange *range = [self textRangeByExtendingPosition:pos inDirection:(rect.origin.y >= point.y && !RTL) ? UITextLayoutDirectionUp:UITextLayoutDirectionDown offset:1]; - return range; - } else { - YYTextRange *range = [self textRangeByExtendingPosition:pos inDirection:(rect.origin.x >= point.x && !RTL) ? UITextLayoutDirectionLeft:UITextLayoutDirectionRight offset:1]; - return range; - } -} - -- (YYTextRange *)closestTextRangeAtPoint:(CGPoint)point { - YYTextPosition *pos = [self closestPositionToPoint:point]; - if (!pos) return nil; - NSUInteger lineIndex = [self lineIndexForPosition:pos]; - if (lineIndex == NSNotFound) return nil; - YYTextLine *line = _lines[lineIndex]; - BOOL RTL = [self _isRightToLeftInLine:line atPoint:point]; - CGRect rect = [self caretRectForPosition:pos]; - if (CGRectIsNull(rect)) return nil; - - UITextLayoutDirection direction = UITextLayoutDirectionRight; - if (pos.offset >= line.range.location + line.range.length) { - if (direction != RTL) { - direction = _container.verticalForm ? UITextLayoutDirectionUp : UITextLayoutDirectionLeft; - } else { - direction = _container.verticalForm ? UITextLayoutDirectionDown : UITextLayoutDirectionRight; - } - } else if (pos.offset <= line.range.location) { - if (direction != RTL) { - direction = _container.verticalForm ? UITextLayoutDirectionDown : UITextLayoutDirectionRight; - } else { - direction = _container.verticalForm ? UITextLayoutDirectionUp : UITextLayoutDirectionLeft; - } - } else { - if (_container.verticalForm) { - direction = (rect.origin.y >= point.y && !RTL) ? UITextLayoutDirectionUp:UITextLayoutDirectionDown; - } else { - direction = (rect.origin.x >= point.x && !RTL) ? UITextLayoutDirectionLeft:UITextLayoutDirectionRight; - } - } - - YYTextRange *range = [self textRangeByExtendingPosition:pos inDirection:direction offset:1]; - return range; -} - -- (YYTextRange *)textRangeByExtendingPosition:(YYTextPosition *)position { - NSUInteger visibleStart = _visibleRange.location; - NSUInteger visibleEnd = _visibleRange.location + _visibleRange.length; - - if (!position) return nil; - if (position.offset < visibleStart || position.offset > visibleEnd) return nil; - - // head or tail, returns immediately - if (position.offset == visibleStart) { - return [YYTextRange rangeWithRange:NSMakeRange(position.offset, 0)]; - } else if (position.offset == visibleEnd) { - return [YYTextRange rangeWithRange:NSMakeRange(position.offset, 0) affinity:YYTextAffinityBackward]; - } - - // binding range - NSRange tRange; - YYTextBinding *binding = [_text attribute:YYTextBindingAttributeName atIndex:position.offset longestEffectiveRange:&tRange inRange:_visibleRange]; - if (binding && tRange.length > 0 && tRange.location < position.offset) { - return [YYTextRange rangeWithRange:tRange]; - } - - // inside emoji or composed character sequences - NSUInteger lineIndex = [self lineIndexForPosition:position]; - if (lineIndex != NSNotFound) { - __block NSUInteger _prev, _next; - BOOL emoji = NO, seq = NO; - - YYTextLine *line = _lines[lineIndex]; - emoji = [self _insideEmoji:line position:position.offset block: ^(CGFloat left, CGFloat right, NSUInteger prev, NSUInteger next) { - _prev = prev; - _next = next; - }]; - if (!emoji) { - seq = [self _insideComposedCharacterSequences:line position:position.offset block: ^(CGFloat left, CGFloat right, NSUInteger prev, NSUInteger next) { - _prev = prev; - _next = next; - }]; - } - if (emoji || seq) { - return [YYTextRange rangeWithRange:NSMakeRange(_prev, _next - _prev)]; - } - } - - // inside linebreak '\r\n' - if (position.offset > visibleStart && position.offset < visibleEnd) { - unichar c0 = [_text.string characterAtIndex:position.offset - 1]; - if ((c0 == '\r') && position.offset < visibleEnd) { - unichar c1 = [_text.string characterAtIndex:position.offset]; - if (c1 == '\n') { - return [YYTextRange rangeWithStart:[YYTextPosition positionWithOffset:position.offset - 1] end:[YYTextPosition positionWithOffset:position.offset + 1]]; - } - } - if (YYTextIsLinebreakChar(c0) && position.affinity == YYTextAffinityBackward) { - NSString *str = [_text.string substringToIndex:position.offset]; - NSUInteger len = YYTextLinebreakTailLength(str); - return [YYTextRange rangeWithStart:[YYTextPosition positionWithOffset:position.offset - len] end:[YYTextPosition positionWithOffset:position.offset]]; - } - } - - return [YYTextRange rangeWithRange:NSMakeRange(position.offset, 0) affinity:position.affinity]; -} - -- (YYTextRange *)textRangeByExtendingPosition:(YYTextPosition *)position - inDirection:(UITextLayoutDirection)direction - offset:(NSInteger)offset { - NSInteger visibleStart = _visibleRange.location; - NSInteger visibleEnd = _visibleRange.location + _visibleRange.length; - - if (!position) return nil; - if (position.offset < visibleStart || position.offset > visibleEnd) return nil; - if (offset == 0) return [self textRangeByExtendingPosition:position]; - - BOOL isVerticalForm = _container.verticalForm; - BOOL verticalMove, forwardMove; - - if (isVerticalForm) { - verticalMove = direction == UITextLayoutDirectionLeft || direction == UITextLayoutDirectionRight; - forwardMove = direction == UITextLayoutDirectionLeft || direction == UITextLayoutDirectionDown; - } else { - verticalMove = direction == UITextLayoutDirectionUp || direction == UITextLayoutDirectionDown; - forwardMove = direction == UITextLayoutDirectionDown || direction == UITextLayoutDirectionRight; - } - - if (offset < 0) { - forwardMove = !forwardMove; - offset = -offset; - } - - // head or tail, returns immediately - if (!forwardMove && position.offset == visibleStart) { - return [YYTextRange rangeWithRange:NSMakeRange(_visibleRange.location, 0)]; - } else if (forwardMove && position.offset == visibleEnd) { - return [YYTextRange rangeWithRange:NSMakeRange(position.offset, 0) affinity:YYTextAffinityBackward]; - } - - // extend from position - YYTextRange *fromRange = [self textRangeByExtendingPosition:position]; - if (!fromRange) return nil; - YYTextRange *allForward = [YYTextRange rangeWithStart:fromRange.start end:[YYTextPosition positionWithOffset:visibleEnd]]; - YYTextRange *allBackward = [YYTextRange rangeWithStart:[YYTextPosition positionWithOffset:visibleStart] end:fromRange.end]; - - if (verticalMove) { // up/down in text layout - NSInteger lineIndex = [self lineIndexForPosition:position]; - if (lineIndex == NSNotFound) return nil; - - YYTextLine *line = _lines[lineIndex]; - NSInteger moveToRowIndex = (NSInteger)line.row + (forwardMove ? offset : -offset); - if (moveToRowIndex < 0) return allBackward; - else if (moveToRowIndex >= (NSInteger)_rowCount) return allForward; - - CGFloat ofs = [self offsetForTextPosition:position.offset lineIndex:lineIndex]; - if (ofs == CGFLOAT_MAX) return nil; - - NSUInteger moveToLineFirstIndex = [self lineIndexForRow:moveToRowIndex]; - NSUInteger moveToLineCount = [self lineCountForRow:moveToRowIndex]; - if (moveToLineFirstIndex == NSNotFound || moveToLineCount == NSNotFound || moveToLineCount == 0) return nil; - CGFloat mostLeft = CGFLOAT_MAX, mostRight = -CGFLOAT_MAX; - YYTextLine *mostLeftLine = nil, *mostRightLine = nil; - NSUInteger insideIndex = NSNotFound; - for (NSUInteger i = 0; i < moveToLineCount; i++) { - NSUInteger lineIndex = moveToLineFirstIndex + i; - YYTextLine *line = _lines[lineIndex]; - if (isVerticalForm) { - if (line.top <= ofs && ofs <= line.bottom) { - insideIndex = line.index; - break; - } - if (line.top < mostLeft) { - mostLeft = line.top; - mostLeftLine = line; - } - if (line.bottom > mostRight) { - mostRight = line.bottom; - mostRightLine = line; - } - } else { - if (line.left <= ofs && ofs <= line.right) { - insideIndex = line.index; - break; - } - if (line.left < mostLeft) { - mostLeft = line.left; - mostLeftLine = line; - } - if (line.right > mostRight) { - mostRight = line.right; - mostRightLine = line; - } - } - } - BOOL afinityEdge = NO; - if (insideIndex == NSNotFound) { - if (ofs <= mostLeft) { - insideIndex = mostLeftLine.index; - } else { - insideIndex = mostRightLine.index; - } - afinityEdge = YES; - } - YYTextLine *insideLine = _lines[insideIndex]; - NSUInteger pos; - if (isVerticalForm) { - pos = [self textPositionForPoint:CGPointMake(insideLine.position.x, ofs) lineIndex:insideIndex]; - } else { - pos = [self textPositionForPoint:CGPointMake(ofs, insideLine.position.y) lineIndex:insideIndex]; - } - if (pos == NSNotFound) return nil; - YYTextPosition *extPos; - if (afinityEdge) { - if (pos == insideLine.range.location + insideLine.range.length) { - NSString *subStr = [_text.string substringWithRange:insideLine.range]; - NSUInteger lineBreakLen = YYTextLinebreakTailLength(subStr); - extPos = [YYTextPosition positionWithOffset:pos - lineBreakLen]; - } else { - extPos = [YYTextPosition positionWithOffset:pos]; - } - } else { - extPos = [YYTextPosition positionWithOffset:pos]; - } - YYTextRange *ext = [self textRangeByExtendingPosition:extPos]; - if (!ext) return nil; - if (forwardMove) { - return [YYTextRange rangeWithStart:fromRange.start end:ext.end]; - } else { - return [YYTextRange rangeWithStart:ext.start end:fromRange.end]; - } - - } else { // left/right in text layout - YYTextPosition *toPosition = [YYTextPosition positionWithOffset:position.offset + (forwardMove ? offset : -offset)]; - if (toPosition.offset <= visibleStart) return allBackward; - else if (toPosition.offset >= visibleEnd) return allForward; - - YYTextRange *toRange = [self textRangeByExtendingPosition:toPosition]; - if (!toRange) return nil; - - NSInteger start = MIN(fromRange.start.offset, toRange.start.offset); - NSInteger end = MAX(fromRange.end.offset, toRange.end.offset); - return [YYTextRange rangeWithRange:NSMakeRange(start, end - start)]; - } -} - -- (NSUInteger)lineIndexForPosition:(YYTextPosition *)position { - if (!position) return NSNotFound; - if (_lines.count == 0) return NSNotFound; - NSUInteger location = position.offset; - NSInteger lo = 0, hi = _lines.count - 1, mid = 0; - if (position.affinity == YYTextAffinityBackward) { - while (lo <= hi) { - mid = (lo + hi) / 2; - YYTextLine *line = _lines[mid]; - NSRange range = line.range; - if (range.location < location && location <= range.location + range.length) { - return mid; - } - if (location <= range.location) { - hi = mid - 1; - } else { - lo = mid + 1; - } - } - } else { - while (lo <= hi) { - mid = (lo + hi) / 2; - YYTextLine *line = _lines[mid]; - NSRange range = line.range; - if (range.location <= location && location < range.location + range.length) { - return mid; - } - if (location < range.location) { - hi = mid - 1; - } else { - lo = mid + 1; - } - } - } - return NSNotFound; -} - -- (CGPoint)linePositionForPosition:(YYTextPosition *)position { - NSUInteger lineIndex = [self lineIndexForPosition:position]; - if (lineIndex == NSNotFound) return CGPointZero; - YYTextLine *line = _lines[lineIndex]; - CGFloat offset = [self offsetForTextPosition:position.offset lineIndex:lineIndex]; - if (offset == CGFLOAT_MAX) return CGPointZero; - if (_container.verticalForm) { - return CGPointMake(line.position.x, offset); - } else { - return CGPointMake(offset, line.position.y); - } -} - -- (CGRect)caretRectForPosition:(YYTextPosition *)position { - NSUInteger lineIndex = [self lineIndexForPosition:position]; - if (lineIndex == NSNotFound) return CGRectNull; - YYTextLine *line = _lines[lineIndex]; - CGFloat offset = [self offsetForTextPosition:position.offset lineIndex:lineIndex]; - if (offset == CGFLOAT_MAX) return CGRectNull; - if (_container.verticalForm) { - return CGRectMake(line.bounds.origin.x, offset, line.bounds.size.width, 0); - } else { - return CGRectMake(offset, line.bounds.origin.y, 0, line.bounds.size.height); - } -} - -- (CGRect)firstRectForRange:(YYTextRange *)range { - range = [self _correctedRangeWithEdge:range]; - - NSUInteger startLineIndex = [self lineIndexForPosition:range.start]; - NSUInteger endLineIndex = [self lineIndexForPosition:range.end]; - if (startLineIndex == NSNotFound || endLineIndex == NSNotFound) return CGRectNull; - if (startLineIndex > endLineIndex) return CGRectNull; - YYTextLine *startLine = _lines[startLineIndex]; - YYTextLine *endLine = _lines[endLineIndex]; - NSMutableArray *lines = [NSMutableArray new]; - for (NSUInteger i = startLineIndex; i <= startLineIndex; i++) { - YYTextLine *line = _lines[i]; - if (line.row != startLine.row) break; - [lines addObject:line]; - } - if (_container.verticalForm) { - if (lines.count == 1) { - CGFloat top = [self offsetForTextPosition:range.start.offset lineIndex:startLineIndex]; - CGFloat bottom; - if (startLine == endLine) { - bottom = [self offsetForTextPosition:range.end.offset lineIndex:startLineIndex]; - } else { - bottom = startLine.bottom; - } - if (top == CGFLOAT_MAX || bottom == CGFLOAT_MAX) return CGRectNull; - if (top > bottom) YYTEXT_SWAP(top, bottom); - return CGRectMake(startLine.left, top, startLine.width, bottom - top); - } else { - CGFloat top = [self offsetForTextPosition:range.start.offset lineIndex:startLineIndex]; - CGFloat bottom = startLine.bottom; - if (top == CGFLOAT_MAX || bottom == CGFLOAT_MAX) return CGRectNull; - if (top > bottom) YYTEXT_SWAP(top, bottom); - CGRect rect = CGRectMake(startLine.left, top, startLine.width, bottom - top); - for (NSUInteger i = 1; i < lines.count; i++) { - YYTextLine *line = lines[i]; - rect = CGRectUnion(rect, line.bounds); - } - return rect; - } - } else { - if (lines.count == 1) { - CGFloat left = [self offsetForTextPosition:range.start.offset lineIndex:startLineIndex]; - CGFloat right; - if (startLine == endLine) { - right = [self offsetForTextPosition:range.end.offset lineIndex:startLineIndex]; - } else { - right = startLine.right; - } - if (left == CGFLOAT_MAX || right == CGFLOAT_MAX) return CGRectNull; - if (left > right) YYTEXT_SWAP(left, right); - return CGRectMake(left, startLine.top, right - left, startLine.height); - } else { - CGFloat left = [self offsetForTextPosition:range.start.offset lineIndex:startLineIndex]; - CGFloat right = startLine.right; - if (left == CGFLOAT_MAX || right == CGFLOAT_MAX) return CGRectNull; - if (left > right) YYTEXT_SWAP(left, right); - CGRect rect = CGRectMake(left, startLine.top, right - left, startLine.height); - for (NSUInteger i = 1; i < lines.count; i++) { - YYTextLine *line = lines[i]; - rect = CGRectUnion(rect, line.bounds); - } - return rect; - } - } -} - -- (CGRect)rectForRange:(YYTextRange *)range { - NSArray *rects = [self selectionRectsForRange:range]; - if (rects.count == 0) return CGRectNull; - CGRect rectUnion = ((YYTextSelectionRect *)rects.firstObject).rect; - for (NSUInteger i = 1; i < rects.count; i++) { - YYTextSelectionRect *rect = rects[i]; - rectUnion = CGRectUnion(rectUnion, rect.rect); - } - return rectUnion; -} - -- (NSArray *)selectionRectsForRange:(YYTextRange *)range { - range = [self _correctedRangeWithEdge:range]; - - BOOL isVertical = _container.verticalForm; - NSMutableArray *rects = [NSMutableArray array]; - if (!range) return rects; - - NSUInteger startLineIndex = [self lineIndexForPosition:range.start]; - NSUInteger endLineIndex = [self lineIndexForPosition:range.end]; - if (startLineIndex == NSNotFound || endLineIndex == NSNotFound) return rects; - if (startLineIndex > endLineIndex) YYTEXT_SWAP(startLineIndex, endLineIndex); - YYTextLine *startLine = _lines[startLineIndex]; - YYTextLine *endLine = _lines[endLineIndex]; - CGFloat offsetStart = [self offsetForTextPosition:range.start.offset lineIndex:startLineIndex]; - CGFloat offsetEnd = [self offsetForTextPosition:range.end.offset lineIndex:endLineIndex]; - - YYTextSelectionRect *start = [YYTextSelectionRect new]; - if (isVertical) { - start.rect = CGRectMake(startLine.left, offsetStart, startLine.width, 0); - } else { - start.rect = CGRectMake(offsetStart, startLine.top, 0, startLine.height); - } - start.containsStart = YES; - start.isVertical = isVertical; - [rects addObject:start]; - - YYTextSelectionRect *end = [YYTextSelectionRect new]; - if (isVertical) { - end.rect = CGRectMake(endLine.left, offsetEnd, endLine.width, 0); - } else { - end.rect = CGRectMake(offsetEnd, endLine.top, 0, endLine.height); - } - end.containsEnd = YES; - end.isVertical = isVertical; - [rects addObject:end]; - - if (startLine.row == endLine.row) { // same row - if (offsetStart > offsetEnd) YYTEXT_SWAP(offsetStart, offsetEnd); - YYTextSelectionRect *rect = [YYTextSelectionRect new]; - if (isVertical) { - rect.rect = CGRectMake(startLine.bounds.origin.x, offsetStart, MAX(startLine.width, endLine.width), offsetEnd - offsetStart); - } else { - rect.rect = CGRectMake(offsetStart, startLine.bounds.origin.y, offsetEnd - offsetStart, MAX(startLine.height, endLine.height)); - } - rect.isVertical = isVertical; - [rects addObject:rect]; - - } else { // more than one row - - // start line select rect - YYTextSelectionRect *topRect = [YYTextSelectionRect new]; - topRect.isVertical = isVertical; - CGFloat topOffset = [self offsetForTextPosition:range.start.offset lineIndex:startLineIndex]; - CTRunRef topRun = [self _runForLine:startLine position:range.start]; - if (topRun && (CTRunGetStatus(topRun) & kCTRunStatusRightToLeft)) { - if (isVertical) { - topRect.rect = CGRectMake(startLine.left, _container.path ? startLine.top : _container.insets.top, startLine.width, topOffset - startLine.top); - } else { - topRect.rect = CGRectMake(_container.path ? startLine.left : _container.insets.left, startLine.top, topOffset - startLine.left, startLine.height); - } - topRect.writingDirection = UITextWritingDirectionRightToLeft; - } else { - if (isVertical) { - topRect.rect = CGRectMake(startLine.left, topOffset, startLine.width, (_container.path ? startLine.bottom : _container.size.height - _container.insets.bottom) - topOffset); - } else { - topRect.rect = CGRectMake(topOffset, startLine.top, (_container.path ? startLine.right : _container.size.width - _container.insets.right) - topOffset, startLine.height); - } - } - [rects addObject:topRect]; - - // end line select rect - YYTextSelectionRect *bottomRect = [YYTextSelectionRect new]; - bottomRect.isVertical = isVertical; - CGFloat bottomOffset = [self offsetForTextPosition:range.end.offset lineIndex:endLineIndex]; - CTRunRef bottomRun = [self _runForLine:endLine position:range.end]; - if (bottomRun && (CTRunGetStatus(bottomRun) & kCTRunStatusRightToLeft)) { - if (isVertical) { - bottomRect.rect = CGRectMake(endLine.left, bottomOffset, endLine.width, (_container.path ? endLine.bottom : _container.size.height - _container.insets.bottom) - bottomOffset); - } else { - bottomRect.rect = CGRectMake(bottomOffset, endLine.top, (_container.path ? endLine.right : _container.size.width - _container.insets.right) - bottomOffset, endLine.height); - } - bottomRect.writingDirection = UITextWritingDirectionRightToLeft; - } else { - if (isVertical) { - CGFloat top = _container.path ? endLine.top : _container.insets.top; - bottomRect.rect = CGRectMake(endLine.left, top, endLine.width, bottomOffset - top); - } else { - CGFloat left = _container.path ? endLine.left : _container.insets.left; - bottomRect.rect = CGRectMake(left, endLine.top, bottomOffset - left, endLine.height); - } - } - [rects addObject:bottomRect]; - - if (endLineIndex - startLineIndex >= 2) { - CGRect r = CGRectZero; - BOOL startLineDetected = NO; - for (NSUInteger l = startLineIndex + 1; l < endLineIndex; l++) { - YYTextLine *line = _lines[l]; - if (line.row == startLine.row || line.row == endLine.row) continue; - if (!startLineDetected) { - r = line.bounds; - startLineDetected = YES; - } else { - r = CGRectUnion(r, line.bounds); - } - } - if (startLineDetected) { - if (isVertical) { - if (!_container.path) { - r.origin.y = _container.insets.top; - r.size.height = _container.size.height - _container.insets.bottom - _container.insets.top; - } - r.size.width = CGRectGetMinX(topRect.rect) - CGRectGetMaxX(bottomRect.rect); - r.origin.x = CGRectGetMaxX(bottomRect.rect); - } else { - if (!_container.path) { - r.origin.x = _container.insets.left; - r.size.width = _container.size.width - _container.insets.right - _container.insets.left; - } - r.origin.y = CGRectGetMaxY(topRect.rect); - r.size.height = bottomRect.rect.origin.y - r.origin.y; - } - - YYTextSelectionRect *rect = [YYTextSelectionRect new]; - rect.rect = r; - rect.isVertical = isVertical; - [rects addObject:rect]; - } - } else { - if (isVertical) { - CGRect r0 = bottomRect.rect; - CGRect r1 = topRect.rect; - CGFloat mid = (CGRectGetMaxX(r0) + CGRectGetMinX(r1)) * 0.5; - r0.size.width = mid - r0.origin.x; - CGFloat r1ofs = r1.origin.x - mid; - r1.origin.x -= r1ofs; - r1.size.width += r1ofs; - topRect.rect = r1; - bottomRect.rect = r0; - } else { - CGRect r0 = topRect.rect; - CGRect r1 = bottomRect.rect; - CGFloat mid = (CGRectGetMaxY(r0) + CGRectGetMinY(r1)) * 0.5; - r0.size.height = mid - r0.origin.y; - CGFloat r1ofs = r1.origin.y - mid; - r1.origin.y -= r1ofs; - r1.size.height += r1ofs; - topRect.rect = r0; - bottomRect.rect = r1; - } - } - } - return rects; -} - -- (NSArray *)selectionRectsWithoutStartAndEndForRange:(YYTextRange *)range { - NSMutableArray *rects = [self selectionRectsForRange:range].mutableCopy; - for (NSInteger i = 0, max = rects.count; i < max; i++) { - YYTextSelectionRect *rect = rects[i]; - if (rect.containsStart || rect.containsEnd) { - [rects removeObjectAtIndex:i]; - i--; - max--; - } - } - return rects; -} - -- (NSArray *)selectionRectsWithOnlyStartAndEndForRange:(YYTextRange *)range { - NSMutableArray *rects = [self selectionRectsForRange:range].mutableCopy; - for (NSInteger i = 0, max = rects.count; i < max; i++) { - YYTextSelectionRect *rect = rects[i]; - if (!rect.containsStart && !rect.containsEnd) { - [rects removeObjectAtIndex:i]; - i--; - max--; - } - } - return rects; -} - - -#pragma mark - Draw - - -typedef NS_OPTIONS(NSUInteger, YYTextDecorationType) { - YYTextDecorationTypeUnderline = 1 << 0, - YYTextDecorationTypeStrikethrough = 1 << 1, -}; - -typedef NS_OPTIONS(NSUInteger, YYTextBorderType) { - YYTextBorderTypeBackgound = 1 << 0, - YYTextBorderTypeNormal = 1 << 1, -}; - -static CGRect YYTextMergeRectInSameLine(CGRect rect1, CGRect rect2, BOOL isVertical) { - if (isVertical) { - CGFloat top = MIN(rect1.origin.y, rect2.origin.y); - CGFloat bottom = MAX(rect1.origin.y + rect1.size.height, rect2.origin.y + rect2.size.height); - CGFloat width = MAX(rect1.size.width, rect2.size.width); - return CGRectMake(rect1.origin.x, top, width, bottom - top); - } else { - CGFloat left = MIN(rect1.origin.x, rect2.origin.x); - CGFloat right = MAX(rect1.origin.x + rect1.size.width, rect2.origin.x + rect2.size.width); - CGFloat height = MAX(rect1.size.height, rect2.size.height); - return CGRectMake(left, rect1.origin.y, right - left, height); - } -} - -static void YYTextGetRunsMaxMetric(CFArrayRef runs, CGFloat *xHeight, CGFloat *underlinePosition, CGFloat *lineThickness) { - CGFloat maxXHeight = 0; - CGFloat maxUnderlinePos = 0; - CGFloat maxLineThickness = 0; - for (NSUInteger i = 0, max = CFArrayGetCount(runs); i < max; i++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, i); - CFDictionaryRef attrs = CTRunGetAttributes(run); - if (attrs) { - CTFontRef font = CFDictionaryGetValue(attrs, kCTFontAttributeName); - if (font) { - CGFloat xHeight = CTFontGetXHeight(font); - if (xHeight > maxXHeight) maxXHeight = xHeight; - CGFloat underlinePos = CTFontGetUnderlinePosition(font); - if (underlinePos < maxUnderlinePos) maxUnderlinePos = underlinePos; - CGFloat lineThickness = CTFontGetUnderlineThickness(font); - if (lineThickness > maxLineThickness) maxLineThickness = lineThickness; - } - } - } - if (xHeight) *xHeight = maxXHeight; - if (underlinePosition) *underlinePosition = maxUnderlinePos; - if (lineThickness) *lineThickness = maxLineThickness; -} - -static void YYTextDrawRun(YYTextLine *line, CTRunRef run, CGContextRef context, CGSize size, BOOL isVertical, NSArray *runRanges, CGFloat verticalOffset) { - CGAffineTransform runTextMatrix = CTRunGetTextMatrix(run); - BOOL runTextMatrixIsID = CGAffineTransformIsIdentity(runTextMatrix); - - CFDictionaryRef runAttrs = CTRunGetAttributes(run); - NSValue *glyphTransformValue = CFDictionaryGetValue(runAttrs, (__bridge const void *)(YYTextGlyphTransformAttributeName)); - if (!isVertical && !glyphTransformValue) { // draw run - if (!runTextMatrixIsID) { - CGContextSaveGState(context); - CGAffineTransform trans = CGContextGetTextMatrix(context); - CGContextSetTextMatrix(context, CGAffineTransformConcat(trans, runTextMatrix)); - } - CTRunDraw(run, context, CFRangeMake(0, 0)); - if (!runTextMatrixIsID) { - CGContextRestoreGState(context); - } - } else { // draw glyph - CTFontRef runFont = CFDictionaryGetValue(runAttrs, kCTFontAttributeName); - if (!runFont) return; - NSUInteger glyphCount = CTRunGetGlyphCount(run); - if (glyphCount <= 0) return; - - CGGlyph glyphs[glyphCount]; - CGPoint glyphPositions[glyphCount]; - CTRunGetGlyphs(run, CFRangeMake(0, 0), glyphs); - CTRunGetPositions(run, CFRangeMake(0, 0), glyphPositions); - - CGColorRef fillColor = (CGColorRef)CFDictionaryGetValue(runAttrs, kCTForegroundColorAttributeName); - fillColor = YYTextGetCGColor(fillColor); - NSNumber *strokeWidth = CFDictionaryGetValue(runAttrs, kCTStrokeWidthAttributeName); - - CGContextSaveGState(context); { - CGContextSetFillColorWithColor(context, fillColor); - if (!strokeWidth || strokeWidth.floatValue == 0) { - CGContextSetTextDrawingMode(context, kCGTextFill); - } else { - CGColorRef strokeColor = (CGColorRef)CFDictionaryGetValue(runAttrs, kCTStrokeColorAttributeName); - if (!strokeColor) strokeColor = fillColor; - CGContextSetStrokeColorWithColor(context, strokeColor); - CGContextSetLineWidth(context, CTFontGetSize(runFont) * fabs(strokeWidth.floatValue * 0.01)); - if (strokeWidth.floatValue > 0) { - CGContextSetTextDrawingMode(context, kCGTextStroke); - } else { - CGContextSetTextDrawingMode(context, kCGTextFillStroke); - } - } - - if (isVertical) { - CFIndex runStrIdx[glyphCount + 1]; - CTRunGetStringIndices(run, CFRangeMake(0, 0), runStrIdx); - CFRange runStrRange = CTRunGetStringRange(run); - runStrIdx[glyphCount] = runStrRange.location + runStrRange.length; - CGSize glyphAdvances[glyphCount]; - CTRunGetAdvances(run, CFRangeMake(0, 0), glyphAdvances); - CGFloat ascent = CTFontGetAscent(runFont); - CGFloat descent = CTFontGetDescent(runFont); - CGAffineTransform glyphTransform = glyphTransformValue.CGAffineTransformValue; - CGPoint zeroPoint = CGPointZero; - - for (YYTextRunGlyphRange *oneRange in runRanges) { - NSRange range = oneRange.glyphRangeInRun; - NSUInteger rangeMax = range.location + range.length; - YYTextRunGlyphDrawMode mode = oneRange.drawMode; - - for (NSUInteger g = range.location; g < rangeMax; g++) { - CGContextSaveGState(context); { - CGContextSetTextMatrix(context, CGAffineTransformIdentity); - if (glyphTransformValue) { - CGContextSetTextMatrix(context, glyphTransform); - } - if (mode) { // CJK glyph, need rotated - CGFloat ofs = (ascent - descent) * 0.5; - CGFloat w = glyphAdvances[g].width * 0.5; - CGFloat x = x = line.position.x + verticalOffset + glyphPositions[g].y + (ofs - w); - CGFloat y = -line.position.y + size.height - glyphPositions[g].x - (ofs + w); - if (mode == YYTextRunGlyphDrawModeVerticalRotateMove) { - x += w; - y += w; - } - CGContextSetTextPosition(context, x, y); - } else { - CGContextRotateCTM(context, YYTextDegreesToRadians(-90)); - CGContextSetTextPosition(context, - line.position.y - size.height + glyphPositions[g].x, - line.position.x + verticalOffset + glyphPositions[g].y); - } - - if (YYTextCTFontContainsColorBitmapGlyphs(runFont)) { - CTFontDrawGlyphs(runFont, glyphs + g, &zeroPoint, 1, context); - } else { - CGFontRef cgFont = CTFontCopyGraphicsFont(runFont, NULL); - CGContextSetFont(context, cgFont); - CGContextSetFontSize(context, CTFontGetSize(runFont)); - CGContextShowGlyphsAtPositions(context, glyphs + g, &zeroPoint, 1); - CGFontRelease(cgFont); - } - } CGContextRestoreGState(context); - } - } - } else { // not vertical - if (glyphTransformValue) { - CFIndex runStrIdx[glyphCount + 1]; - CTRunGetStringIndices(run, CFRangeMake(0, 0), runStrIdx); - CFRange runStrRange = CTRunGetStringRange(run); - runStrIdx[glyphCount] = runStrRange.location + runStrRange.length; - CGSize glyphAdvances[glyphCount]; - CTRunGetAdvances(run, CFRangeMake(0, 0), glyphAdvances); - CGAffineTransform glyphTransform = glyphTransformValue.CGAffineTransformValue; - CGPoint zeroPoint = CGPointZero; - - for (NSUInteger g = 0; g < glyphCount; g++) { - CGContextSaveGState(context); { - CGContextSetTextMatrix(context, CGAffineTransformIdentity); - CGContextSetTextMatrix(context, glyphTransform); - CGContextSetTextPosition(context, - line.position.x + glyphPositions[g].x, - size.height - (line.position.y + glyphPositions[g].y)); - - if (YYTextCTFontContainsColorBitmapGlyphs(runFont)) { - CTFontDrawGlyphs(runFont, glyphs + g, &zeroPoint, 1, context); - } else { - CGFontRef cgFont = CTFontCopyGraphicsFont(runFont, NULL); - CGContextSetFont(context, cgFont); - CGContextSetFontSize(context, CTFontGetSize(runFont)); - CGContextShowGlyphsAtPositions(context, glyphs + g, &zeroPoint, 1); - CGFontRelease(cgFont); - } - } CGContextRestoreGState(context); - } - } else { - if (YYTextCTFontContainsColorBitmapGlyphs(runFont)) { - CTFontDrawGlyphs(runFont, glyphs, glyphPositions, glyphCount, context); - } else { - CGFontRef cgFont = CTFontCopyGraphicsFont(runFont, NULL); - CGContextSetFont(context, cgFont); - CGContextSetFontSize(context, CTFontGetSize(runFont)); - CGContextShowGlyphsAtPositions(context, glyphs, glyphPositions, glyphCount); - CGFontRelease(cgFont); - } - } - } - - } CGContextRestoreGState(context); - } -} - -static void YYTextSetLinePatternInContext(YYTextLineStyle style, CGFloat width, CGFloat phase, CGContextRef context){ - CGContextSetLineWidth(context, width); - CGContextSetLineCap(context, kCGLineCapButt); - CGContextSetLineJoin(context, kCGLineJoinMiter); - - CGFloat dash = 12, dot = 5, space = 3; - NSUInteger pattern = style & 0xF00; - if (pattern == YYTextLineStylePatternSolid) { - CGContextSetLineDash(context, phase, NULL, 0); - } else if (pattern == YYTextLineStylePatternDot) { - CGFloat lengths[2] = {width * dot, width * space}; - CGContextSetLineDash(context, phase, lengths, 2); - } else if (pattern == YYTextLineStylePatternDash) { - CGFloat lengths[2] = {width * dash, width * space}; - CGContextSetLineDash(context, phase, lengths, 2); - } else if (pattern == YYTextLineStylePatternDashDot) { - CGFloat lengths[4] = {width * dash, width * space, width * dot, width * space}; - CGContextSetLineDash(context, phase, lengths, 4); - } else if (pattern == YYTextLineStylePatternDashDotDot) { - CGFloat lengths[6] = {width * dash, width * space,width * dot, width * space, width * dot, width * space}; - CGContextSetLineDash(context, phase, lengths, 6); - } else if (pattern == YYTextLineStylePatternCircleDot) { - CGFloat lengths[2] = {width * 0, width * 3}; - CGContextSetLineDash(context, phase, lengths, 2); - CGContextSetLineCap(context, kCGLineCapRound); - CGContextSetLineJoin(context, kCGLineJoinRound); - } -} - - -static void YYTextDrawBorderRects(CGContextRef context, CGSize size, YYTextBorder *border, NSArray *rects, BOOL isVertical) { - if (rects.count == 0) return; - - YYTextShadow *shadow = border.shadow; - if (shadow.color) { - CGContextSaveGState(context); - CGContextSetShadowWithColor(context, shadow.offset, shadow.radius, shadow.color.CGColor); - CGContextBeginTransparencyLayer(context, NULL); - } - - NSMutableArray *paths = [NSMutableArray new]; - for (NSValue *value in rects) { - CGRect rect = value.CGRectValue; - if (isVertical) { - rect = UIEdgeInsetsInsetRect(rect, UIEdgeInsetRotateVertical(border.insets)); - } else { - rect = UIEdgeInsetsInsetRect(rect, border.insets); - } - rect = YYTextCGRectPixelRound(rect); - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:border.cornerRadius]; - [path closePath]; - [paths addObject:path]; - } - - if (border.fillColor) { - CGContextSaveGState(context); - CGContextSetFillColorWithColor(context, border.fillColor.CGColor); - for (UIBezierPath *path in paths) { - CGContextAddPath(context, path.CGPath); - } - CGContextFillPath(context); - CGContextRestoreGState(context); - } - - if (border.strokeColor && border.lineStyle > 0 && border.strokeWidth > 0) { - - //-------------------------- single line ------------------------------// - CGContextSaveGState(context); - for (UIBezierPath *path in paths) { - CGRect bounds = CGRectUnion(path.bounds, (CGRect){CGPointZero, size}); - bounds = CGRectInset(bounds, -2 * border.strokeWidth, -2 * border.strokeWidth); - CGContextAddRect(context, bounds); - CGContextAddPath(context, path.CGPath); - CGContextEOClip(context); - } - [border.strokeColor setStroke]; - YYTextSetLinePatternInContext(border.lineStyle, border.strokeWidth, 0, context); - CGFloat inset = -border.strokeWidth * 0.5; - if ((border.lineStyle & 0xFF) == YYTextLineStyleThick) { - inset *= 2; - CGContextSetLineWidth(context, border.strokeWidth * 2); - } - CGFloat radiusDelta = -inset; - if (border.cornerRadius <= 0) { - radiusDelta = 0; - } - CGContextSetLineJoin(context, border.lineJoin); - for (NSValue *value in rects) { - CGRect rect = value.CGRectValue; - if (isVertical) { - rect = UIEdgeInsetsInsetRect(rect, UIEdgeInsetRotateVertical(border.insets)); - } else { - rect = UIEdgeInsetsInsetRect(rect, border.insets); - } - rect = CGRectInset(rect, inset, inset); - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:border.cornerRadius + radiusDelta]; - [path closePath]; - CGContextAddPath(context, path.CGPath); - } - CGContextStrokePath(context); - CGContextRestoreGState(context); - - //------------------------- second line ------------------------------// - if ((border.lineStyle & 0xFF) == YYTextLineStyleDouble) { - CGContextSaveGState(context); - CGFloat inset = -border.strokeWidth * 2; - for (NSValue *value in rects) { - CGRect rect = value.CGRectValue; - rect = UIEdgeInsetsInsetRect(rect, border.insets); - rect = CGRectInset(rect, inset, inset); - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:border.cornerRadius + 2 * border.strokeWidth]; - [path closePath]; - - CGRect bounds = CGRectUnion(path.bounds, (CGRect){CGPointZero, size}); - bounds = CGRectInset(bounds, -2 * border.strokeWidth, -2 * border.strokeWidth); - CGContextAddRect(context, bounds); - CGContextAddPath(context, path.CGPath); - CGContextEOClip(context); - } - CGContextSetStrokeColorWithColor(context, border.strokeColor.CGColor); - YYTextSetLinePatternInContext(border.lineStyle, border.strokeWidth, 0, context); - CGContextSetLineJoin(context, border.lineJoin); - inset = -border.strokeWidth * 2.5; - radiusDelta = border.strokeWidth * 2; - if (border.cornerRadius <= 0) { - radiusDelta = 0; - } - for (NSValue *value in rects) { - CGRect rect = value.CGRectValue; - rect = UIEdgeInsetsInsetRect(rect, border.insets); - rect = CGRectInset(rect, inset, inset); - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:border.cornerRadius + radiusDelta]; - [path closePath]; - CGContextAddPath(context, path.CGPath); - } - CGContextStrokePath(context); - CGContextRestoreGState(context); - } - } - - if (shadow.color) { - CGContextEndTransparencyLayer(context); - CGContextRestoreGState(context); - } -} - -static void YYTextDrawLineStyle(CGContextRef context, CGFloat length, CGFloat lineWidth, YYTextLineStyle style, CGPoint position, CGColorRef color, BOOL isVertical) { - NSUInteger styleBase = style & 0xFF; - if (styleBase == 0) return; - - CGContextSaveGState(context); { - if (isVertical) { - CGFloat x, y1, y2, w; - y1 = YYTextCGFloatPixelRound(position.y); - y2 = YYTextCGFloatPixelRound(position.y + length); - w = (styleBase == YYTextLineStyleThick ? lineWidth * 2 : lineWidth); - - CGFloat linePixel = YYTextCGFloatToPixel(w); - if (fabs(linePixel - floor(linePixel)) < 0.1) { - int iPixel = linePixel; - if (iPixel == 0 || (iPixel % 2)) { // odd line pixel - x = YYTextCGFloatPixelHalf(position.x); - } else { - x = YYTextCGFloatPixelFloor(position.x); - } - } else { - x = position.x; - } - - CGContextSetStrokeColorWithColor(context, color); - YYTextSetLinePatternInContext(style, lineWidth, position.y, context); - CGContextSetLineWidth(context, w); - if (styleBase == YYTextLineStyleSingle) { - CGContextMoveToPoint(context, x, y1); - CGContextAddLineToPoint(context, x, y2); - CGContextStrokePath(context); - } else if (styleBase == YYTextLineStyleThick) { - CGContextMoveToPoint(context, x, y1); - CGContextAddLineToPoint(context, x, y2); - CGContextStrokePath(context); - } else if (styleBase == YYTextLineStyleDouble) { - CGContextMoveToPoint(context, x - w, y1); - CGContextAddLineToPoint(context, x - w, y2); - CGContextStrokePath(context); - CGContextMoveToPoint(context, x + w, y1); - CGContextAddLineToPoint(context, x + w, y2); - CGContextStrokePath(context); - } - } else { - CGFloat x1, x2, y, w; - x1 = YYTextCGFloatPixelRound(position.x); - x2 = YYTextCGFloatPixelRound(position.x + length); - w = (styleBase == YYTextLineStyleThick ? lineWidth * 2 : lineWidth); - - CGFloat linePixel = YYTextCGFloatToPixel(w); - if (fabs(linePixel - floor(linePixel)) < 0.1) { - int iPixel = linePixel; - if (iPixel == 0 || (iPixel % 2)) { // odd line pixel - y = YYTextCGFloatPixelHalf(position.y); - } else { - y = YYTextCGFloatPixelFloor(position.y); - } - } else { - y = position.y; - } - - CGContextSetStrokeColorWithColor(context, color); - YYTextSetLinePatternInContext(style, lineWidth, position.x, context); - CGContextSetLineWidth(context, w); - if (styleBase == YYTextLineStyleSingle) { - CGContextMoveToPoint(context, x1, y); - CGContextAddLineToPoint(context, x2, y); - CGContextStrokePath(context); - } else if (styleBase == YYTextLineStyleThick) { - CGContextMoveToPoint(context, x1, y); - CGContextAddLineToPoint(context, x2, y); - CGContextStrokePath(context); - } else if (styleBase == YYTextLineStyleDouble) { - CGContextMoveToPoint(context, x1, y - w); - CGContextAddLineToPoint(context, x2, y - w); - CGContextStrokePath(context); - CGContextMoveToPoint(context, x1, y + w); - CGContextAddLineToPoint(context, x2, y + w); - CGContextStrokePath(context); - } - } - } CGContextRestoreGState(context); -} - -static void YYTextDrawText(YYTextLayout *layout, CGContextRef context, CGSize size, CGPoint point, BOOL (^cancel)(void)) { - CGContextSaveGState(context); { - - CGContextTranslateCTM(context, point.x, point.y); - CGContextTranslateCTM(context, 0, size.height); - CGContextScaleCTM(context, 1, -1); - - BOOL isVertical = layout.container.verticalForm; - CGFloat verticalOffset = isVertical ? (size.width - layout.container.size.width) : 0; - - NSArray *lines = layout.lines; - for (NSUInteger l = 0, lMax = lines.count; l < lMax; l++) { - YYTextLine *line = lines[l]; - if (layout.truncatedLine && layout.truncatedLine.index == line.index) line = layout.truncatedLine; - NSArray *lineRunRanges = line.verticalRotateRange; - CGFloat posX = line.position.x + verticalOffset; - CGFloat posY = size.height - line.position.y; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger r = 0, rMax = CFArrayGetCount(runs); r < rMax; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CGContextSetTextMatrix(context, CGAffineTransformIdentity); - CGContextSetTextPosition(context, posX, posY); - YYTextDrawRun(line, run, context, size, isVertical, lineRunRanges[r], verticalOffset); - } - if (cancel && cancel()) break; - } - - // Use this to draw frame for test/debug. - // CGContextTranslateCTM(context, verticalOffset, size.height); - // CTFrameDraw(layout.frame, context); - - } CGContextRestoreGState(context); -} - -static void YYTextDrawBlockBorder(YYTextLayout *layout, CGContextRef context, CGSize size, CGPoint point, BOOL (^cancel)(void)) { - CGContextSaveGState(context); - CGContextTranslateCTM(context, point.x, point.y); - - BOOL isVertical = layout.container.verticalForm; - CGFloat verticalOffset = isVertical ? (size.width - layout.container.size.width) : 0; - - NSArray *lines = layout.lines; - for (NSInteger l = 0, lMax = lines.count; l < lMax; l++) { - if (cancel && cancel()) break; - - YYTextLine *line = lines[l]; - if (layout.truncatedLine && layout.truncatedLine.index == line.index) line = layout.truncatedLine; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSInteger r = 0, rMax = CFArrayGetCount(runs); r < rMax; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CFIndex glyphCount = CTRunGetGlyphCount(run); - if (glyphCount == 0) continue; - NSDictionary *attrs = (id)CTRunGetAttributes(run); - YYTextBorder *border = attrs[YYTextBlockBorderAttributeName]; - if (!border) continue; - - NSUInteger lineStartIndex = line.index; - while (lineStartIndex > 0) { - if (((YYTextLine *)lines[lineStartIndex - 1]).row == line.row) lineStartIndex--; - else break; - } - - CGRect unionRect = CGRectZero; - NSUInteger lineStartRow = ((YYTextLine *)lines[lineStartIndex]).row; - NSUInteger lineContinueIndex = lineStartIndex; - NSUInteger lineContinueRow = lineStartRow; - do { - YYTextLine *one = lines[lineContinueIndex]; - if (lineContinueIndex == lineStartIndex) { - unionRect = one.bounds; - } else { - unionRect = CGRectUnion(unionRect, one.bounds); - } - if (lineContinueIndex + 1 == lMax) break; - YYTextLine *next = lines[lineContinueIndex + 1]; - if (next.row != lineContinueRow) { - YYTextBorder *nextBorder = [layout.text yy_attribute:YYTextBlockBorderAttributeName atIndex:next.range.location]; - if ([nextBorder isEqual:border]) { - lineContinueRow++; - } else { - break; - } - } - lineContinueIndex++; - } while (true); - - if (isVertical) { - UIEdgeInsets insets = layout.container.insets; - unionRect.origin.y = insets.top; - unionRect.size.height = layout.container.size.height -insets.top - insets.bottom; - } else { - UIEdgeInsets insets = layout.container.insets; - unionRect.origin.x = insets.left; - unionRect.size.width = layout.container.size.width -insets.left - insets.right; - } - unionRect.origin.x += verticalOffset; - YYTextDrawBorderRects(context, size, border, @[[NSValue valueWithCGRect:unionRect]], isVertical); - - l = lineContinueIndex; - break; - } - } - - - CGContextRestoreGState(context); -} - -static void YYTextDrawBorder(YYTextLayout *layout, CGContextRef context, CGSize size, CGPoint point, YYTextBorderType type, BOOL (^cancel)(void)) { - CGContextSaveGState(context); - CGContextTranslateCTM(context, point.x, point.y); - - BOOL isVertical = layout.container.verticalForm; - CGFloat verticalOffset = isVertical ? (size.width - layout.container.size.width) : 0; - - NSArray *lines = layout.lines; - NSString *borderKey = (type == YYTextBorderTypeNormal ? YYTextBorderAttributeName : YYTextBackgroundBorderAttributeName); - - BOOL needJumpRun = NO; - NSUInteger jumpRunIndex = 0; - - for (NSInteger l = 0, lMax = lines.count; l < lMax; l++) { - if (cancel && cancel()) break; - - YYTextLine *line = lines[l]; - if (layout.truncatedLine && layout.truncatedLine.index == line.index) line = layout.truncatedLine; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSInteger r = 0, rMax = CFArrayGetCount(runs); r < rMax; r++) { - if (needJumpRun) { - needJumpRun = NO; - r = jumpRunIndex + 1; - if (r >= rMax) break; - } - - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CFIndex glyphCount = CTRunGetGlyphCount(run); - if (glyphCount == 0) continue; - - NSDictionary *attrs = (id)CTRunGetAttributes(run); - YYTextBorder *border = attrs[borderKey]; - if (!border) continue; - - CFRange runRange = CTRunGetStringRange(run); - if (runRange.location == kCFNotFound || runRange.length == 0) continue; - if (runRange.location + runRange.length > layout.text.length) continue; - - NSMutableArray *runRects = [NSMutableArray new]; - NSInteger endLineIndex = l; - NSInteger endRunIndex = r; - BOOL endFound = NO; - for (NSInteger ll = l; ll < lMax; ll++) { - if (endFound) break; - YYTextLine *iLine = lines[ll]; - CFArrayRef iRuns = CTLineGetGlyphRuns(iLine.CTLine); - - CGRect extLineRect = CGRectNull; - for (NSInteger rr = (ll == l) ? r : 0, rrMax = CFArrayGetCount(iRuns); rr < rrMax; rr++) { - CTRunRef iRun = CFArrayGetValueAtIndex(iRuns, rr); - NSDictionary *iAttrs = (id)CTRunGetAttributes(iRun); - YYTextBorder *iBorder = iAttrs[borderKey]; - if (![border isEqual:iBorder]) { - endFound = YES; - break; - } - endLineIndex = ll; - endRunIndex = rr; - - CGPoint iRunPosition = CGPointZero; - CTRunGetPositions(iRun, CFRangeMake(0, 1), &iRunPosition); - CGFloat ascent, descent; - CGFloat iRunWidth = CTRunGetTypographicBounds(iRun, CFRangeMake(0, 0), &ascent, &descent, NULL); - - if (isVertical) { - YYTEXT_SWAP(iRunPosition.x, iRunPosition.y); - iRunPosition.y += iLine.position.y; - CGRect iRect = CGRectMake(verticalOffset + line.position.x - descent, iRunPosition.y, ascent + descent, iRunWidth); - if (CGRectIsNull(extLineRect)) { - extLineRect = iRect; - } else { - extLineRect = CGRectUnion(extLineRect, iRect); - } - } else { - iRunPosition.x += iLine.position.x; - CGRect iRect = CGRectMake(iRunPosition.x, iLine.position.y - ascent, iRunWidth, ascent + descent); - if (CGRectIsNull(extLineRect)) { - extLineRect = iRect; - } else { - extLineRect = CGRectUnion(extLineRect, iRect); - } - } - } - - if (!CGRectIsNull(extLineRect)) { - [runRects addObject:[NSValue valueWithCGRect:extLineRect]]; - } - } - - NSMutableArray *drawRects = [NSMutableArray new]; - CGRect curRect= ((NSValue *)[runRects firstObject]).CGRectValue; - for (NSInteger re = 0, reMax = runRects.count; re < reMax; re++) { - CGRect rect = ((NSValue *)runRects[re]).CGRectValue; - if (isVertical) { - if (fabs(rect.origin.x - curRect.origin.x) < 1) { - curRect = YYTextMergeRectInSameLine(rect, curRect, isVertical); - } else { - [drawRects addObject:[NSValue valueWithCGRect:curRect]]; - curRect = rect; - } - } else { - if (fabs(rect.origin.y - curRect.origin.y) < 1) { - curRect = YYTextMergeRectInSameLine(rect, curRect, isVertical); - } else { - [drawRects addObject:[NSValue valueWithCGRect:curRect]]; - curRect = rect; - } - } - } - if (!CGRectEqualToRect(curRect, CGRectZero)) { - [drawRects addObject:[NSValue valueWithCGRect:curRect]]; - } - - YYTextDrawBorderRects(context, size, border, drawRects, isVertical); - - if (l == endLineIndex) { - r = endRunIndex; - } else { - l = endLineIndex - 1; - needJumpRun = YES; - jumpRunIndex = endRunIndex; - break; - } - - } - } - - CGContextRestoreGState(context); -} - -static void YYTextDrawDecoration(YYTextLayout *layout, CGContextRef context, CGSize size, CGPoint point, YYTextDecorationType type, BOOL (^cancel)(void)) { - NSArray *lines = layout.lines; - - CGContextSaveGState(context); - CGContextTranslateCTM(context, point.x, point.y); - - BOOL isVertical = layout.container.verticalForm; - CGFloat verticalOffset = isVertical ? (size.width - layout.container.size.width) : 0; - CGContextTranslateCTM(context, verticalOffset, 0); - - for (NSUInteger l = 0, lMax = layout.lines.count; l < lMax; l++) { - if (cancel && cancel()) break; - - YYTextLine *line = lines[l]; - if (layout.truncatedLine && layout.truncatedLine.index == line.index) line = layout.truncatedLine; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger r = 0, rMax = CFArrayGetCount(runs); r < rMax; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CFIndex glyphCount = CTRunGetGlyphCount(run); - if (glyphCount == 0) continue; - - NSDictionary *attrs = (id)CTRunGetAttributes(run); - YYTextDecoration *underline = attrs[YYTextUnderlineAttributeName]; - YYTextDecoration *strikethrough = attrs[YYTextStrikethroughAttributeName]; - - BOOL needDrawUnderline = NO, needDrawStrikethrough = NO; - if ((type & YYTextDecorationTypeUnderline) && underline.style > 0) { - needDrawUnderline = YES; - } - if ((type & YYTextDecorationTypeStrikethrough) && strikethrough.style > 0) { - needDrawStrikethrough = YES; - } - if (!needDrawUnderline && !needDrawStrikethrough) continue; - - CFRange runRange = CTRunGetStringRange(run); - if (runRange.location == kCFNotFound || runRange.length == 0) continue; - if (runRange.location + runRange.length > layout.text.length) continue; - NSString *runStr = [layout.text attributedSubstringFromRange:NSMakeRange(runRange.location, runRange.length)].string; - if (YYTextIsLinebreakString(runStr)) continue; // may need more checks... - - CGFloat xHeight, underlinePosition, lineThickness; - YYTextGetRunsMaxMetric(runs, &xHeight, &underlinePosition, &lineThickness); - - CGPoint underlineStart, strikethroughStart; - CGFloat length; - - if (isVertical) { - underlineStart.x = line.position.x + underlinePosition; - strikethroughStart.x = line.position.x + xHeight / 2; - - CGPoint runPosition = CGPointZero; - CTRunGetPositions(run, CFRangeMake(0, 1), &runPosition); - underlineStart.y = strikethroughStart.y = runPosition.x + line.position.y; - length = CTRunGetTypographicBounds(run, CFRangeMake(0, 0), NULL, NULL, NULL); - - } else { - underlineStart.y = line.position.y - underlinePosition; - strikethroughStart.y = line.position.y - xHeight / 2; - - CGPoint runPosition = CGPointZero; - CTRunGetPositions(run, CFRangeMake(0, 1), &runPosition); - underlineStart.x = strikethroughStart.x = runPosition.x + line.position.x; - length = CTRunGetTypographicBounds(run, CFRangeMake(0, 0), NULL, NULL, NULL); - } - - if (needDrawUnderline) { - CGColorRef color = underline.color.CGColor; - if (!color) { - color = (__bridge CGColorRef)(attrs[(id)kCTForegroundColorAttributeName]); - color = YYTextGetCGColor(color); - } - CGFloat thickness = underline.width ? underline.width.floatValue : lineThickness; - YYTextShadow *shadow = underline.shadow; - while (shadow) { - if (!shadow.color) { - shadow = shadow.subShadow; - continue; - } - CGFloat offsetAlterX = size.width + 0xFFFF; - CGContextSaveGState(context); { - CGSize offset = shadow.offset; - offset.width -= offsetAlterX; - CGContextSaveGState(context); { - CGContextSetShadowWithColor(context, offset, shadow.radius, shadow.color.CGColor); - CGContextSetBlendMode(context, shadow.blendMode); - CGContextTranslateCTM(context, offsetAlterX, 0); - YYTextDrawLineStyle(context, length, thickness, underline.style, underlineStart, color, isVertical); - } CGContextRestoreGState(context); - } CGContextRestoreGState(context); - shadow = shadow.subShadow; - } - YYTextDrawLineStyle(context, length, thickness, underline.style, underlineStart, color, isVertical); - } - - if (needDrawStrikethrough) { - CGColorRef color = strikethrough.color.CGColor; - if (!color) { - color = (__bridge CGColorRef)(attrs[(id)kCTForegroundColorAttributeName]); - color = YYTextGetCGColor(color); - } - CGFloat thickness = strikethrough.width ? strikethrough.width.floatValue : lineThickness; - YYTextShadow *shadow = underline.shadow; - while (shadow) { - if (!shadow.color) { - shadow = shadow.subShadow; - continue; - } - CGFloat offsetAlterX = size.width + 0xFFFF; - CGContextSaveGState(context); { - CGSize offset = shadow.offset; - offset.width -= offsetAlterX; - CGContextSaveGState(context); { - CGContextSetShadowWithColor(context, offset, shadow.radius, shadow.color.CGColor); - CGContextSetBlendMode(context, shadow.blendMode); - CGContextTranslateCTM(context, offsetAlterX, 0); - YYTextDrawLineStyle(context, length, thickness, underline.style, underlineStart, color, isVertical); - } CGContextRestoreGState(context); - } CGContextRestoreGState(context); - shadow = shadow.subShadow; - } - YYTextDrawLineStyle(context, length, thickness, strikethrough.style, strikethroughStart, color, isVertical); - } - } - } - CGContextRestoreGState(context); -} - -static void YYTextDrawAttachment(YYTextLayout *layout, CGContextRef context, CGSize size, CGPoint point, UIView *targetView, CALayer *targetLayer, BOOL (^cancel)(void)) { - - BOOL isVertical = layout.container.verticalForm; - CGFloat verticalOffset = isVertical ? (size.width - layout.container.size.width) : 0; - - for (NSUInteger i = 0, max = layout.attachments.count; i < max; i++) { - YYTextAttachment *a = layout.attachments[i]; - if (!a.content) continue; - - UIImage *image = nil; - UIView *view = nil; - CALayer *layer = nil; - if ([a.content isKindOfClass:[UIImage class]]) { - image = a.content; - } else if ([a.content isKindOfClass:[UIView class]]) { - view = a.content; - } else if ([a.content isKindOfClass:[CALayer class]]) { - layer = a.content; - } - if (!image && !view && !layer) continue; - if (image && !context) continue; - if (view && !targetView) continue; - if (layer && !targetLayer) continue; - if (cancel && cancel()) break; - - CGSize asize = image ? image.size : view ? view.frame.size : layer.frame.size; - CGRect rect = ((NSValue *)layout.attachmentRects[i]).CGRectValue; - if (isVertical) { - rect = UIEdgeInsetsInsetRect(rect, UIEdgeInsetRotateVertical(a.contentInsets)); - } else { - rect = UIEdgeInsetsInsetRect(rect, a.contentInsets); - } - rect = YYTextCGRectFitWithContentMode(rect, asize, a.contentMode); - rect = YYTextCGRectPixelRound(rect); - rect = CGRectStandardize(rect); - rect.origin.x += point.x + verticalOffset; - rect.origin.y += point.y; - if (image) { - CGImageRef ref = image.CGImage; - if (ref) { - CGContextSaveGState(context); - CGContextTranslateCTM(context, 0, CGRectGetMaxY(rect) + CGRectGetMinY(rect)); - CGContextScaleCTM(context, 1, -1); - CGContextDrawImage(context, rect, ref); - CGContextRestoreGState(context); - } - } else if (view) { - view.frame = rect; - [targetView addSubview:view]; - } else if (layer) { - layer.frame = rect; - [targetLayer addSublayer:layer]; - } - } -} - -static void YYTextDrawShadow(YYTextLayout *layout, CGContextRef context, CGSize size, CGPoint point, BOOL (^cancel)(void)) { - //move out of context. (0xFFFF is just a random large number) - CGFloat offsetAlterX = size.width + 0xFFFF; - - BOOL isVertical = layout.container.verticalForm; - CGFloat verticalOffset = isVertical ? (size.width - layout.container.size.width) : 0; - - CGContextSaveGState(context); { - CGContextTranslateCTM(context, point.x, point.y); - CGContextTranslateCTM(context, 0, size.height); - CGContextScaleCTM(context, 1, -1); - NSArray *lines = layout.lines; - for (NSUInteger l = 0, lMax = layout.lines.count; l < lMax; l++) { - if (cancel && cancel()) break; - YYTextLine *line = lines[l]; - if (layout.truncatedLine && layout.truncatedLine.index == line.index) line = layout.truncatedLine; - NSArray *lineRunRanges = line.verticalRotateRange; - CGFloat linePosX = line.position.x; - CGFloat linePosY = size.height - line.position.y; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger r = 0, rMax = CFArrayGetCount(runs); r < rMax; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CGContextSetTextMatrix(context, CGAffineTransformIdentity); - CGContextSetTextPosition(context, linePosX, linePosY); - NSDictionary *attrs = (id)CTRunGetAttributes(run); - YYTextShadow *shadow = attrs[YYTextShadowAttributeName]; - YYTextShadow *nsShadow = [YYTextShadow shadowWithNSShadow:attrs[NSShadowAttributeName]]; // NSShadow compatible - if (nsShadow) { - nsShadow.subShadow = shadow; - shadow = nsShadow; - } - while (shadow) { - if (!shadow.color) { - shadow = shadow.subShadow; - continue; - } - CGSize offset = shadow.offset; - offset.width -= offsetAlterX; - CGContextSaveGState(context); { - CGContextSetShadowWithColor(context, offset, shadow.radius, shadow.color.CGColor); - CGContextSetBlendMode(context, shadow.blendMode); - CGContextTranslateCTM(context, offsetAlterX, 0); - YYTextDrawRun(line, run, context, size, isVertical, lineRunRanges[r], verticalOffset); - } CGContextRestoreGState(context); - shadow = shadow.subShadow; - } - } - } - } CGContextRestoreGState(context); -} - -static void YYTextDrawInnerShadow(YYTextLayout *layout, CGContextRef context, CGSize size, CGPoint point, BOOL (^cancel)(void)) { - CGContextSaveGState(context); - CGContextTranslateCTM(context, point.x, point.y); - CGContextTranslateCTM(context, 0, size.height); - CGContextScaleCTM(context, 1, -1); - CGContextSetTextMatrix(context, CGAffineTransformIdentity); - - BOOL isVertical = layout.container.verticalForm; - CGFloat verticalOffset = isVertical ? (size.width - layout.container.size.width) : 0; - - NSArray *lines = layout.lines; - for (NSUInteger l = 0, lMax = lines.count; l < lMax; l++) { - if (cancel && cancel()) break; - - YYTextLine *line = lines[l]; - if (layout.truncatedLine && layout.truncatedLine.index == line.index) line = layout.truncatedLine; - NSArray *lineRunRanges = line.verticalRotateRange; - CGFloat linePosX = line.position.x; - CGFloat linePosY = size.height - line.position.y; - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger r = 0, rMax = CFArrayGetCount(runs); r < rMax; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - if (CTRunGetGlyphCount(run) == 0) continue; - CGContextSetTextMatrix(context, CGAffineTransformIdentity); - CGContextSetTextPosition(context, linePosX, linePosY); - NSDictionary *attrs = (id)CTRunGetAttributes(run); - YYTextShadow *shadow = attrs[YYTextInnerShadowAttributeName]; - while (shadow) { - if (!shadow.color) { - shadow = shadow.subShadow; - continue; - } - CGPoint runPosition = CGPointZero; - CTRunGetPositions(run, CFRangeMake(0, 1), &runPosition); - CGRect runImageBounds = CTRunGetImageBounds(run, context, CFRangeMake(0, 0)); - runImageBounds.origin.x += runPosition.x; - if (runImageBounds.size.width < 0.1 || runImageBounds.size.height < 0.1) continue; - - CFDictionaryRef runAttrs = CTRunGetAttributes(run); - NSValue *glyphTransformValue = CFDictionaryGetValue(runAttrs, (__bridge const void *)(YYTextGlyphTransformAttributeName)); - if (glyphTransformValue) { - runImageBounds = CGRectMake(0, 0, size.width, size.height); - } - - // text inner shadow - CGContextSaveGState(context); { - CGContextSetBlendMode(context, shadow.blendMode); - CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL); - CGContextSetAlpha(context, CGColorGetAlpha(shadow.color.CGColor)); - CGContextClipToRect(context, runImageBounds); - CGContextBeginTransparencyLayer(context, NULL); { - UIColor *opaqueShadowColor = [shadow.color colorWithAlphaComponent:1]; - CGContextSetShadowWithColor(context, shadow.offset, shadow.radius, opaqueShadowColor.CGColor); - CGContextSetFillColorWithColor(context, opaqueShadowColor.CGColor); - CGContextSetBlendMode(context, kCGBlendModeSourceOut); - CGContextBeginTransparencyLayer(context, NULL); { - CGContextFillRect(context, runImageBounds); - CGContextSetBlendMode(context, kCGBlendModeDestinationIn); - CGContextBeginTransparencyLayer(context, NULL); { - YYTextDrawRun(line, run, context, size, isVertical, lineRunRanges[r], verticalOffset); - } CGContextEndTransparencyLayer(context); - } CGContextEndTransparencyLayer(context); - } CGContextEndTransparencyLayer(context); - } CGContextRestoreGState(context); - shadow = shadow.subShadow; - } - } - } - - CGContextRestoreGState(context); -} - -static void YYTextDrawDebug(YYTextLayout *layout, CGContextRef context, CGSize size, CGPoint point, YYTextDebugOption *op) { - UIGraphicsPushContext(context); - CGContextSaveGState(context); - CGContextTranslateCTM(context, point.x, point.y); - CGContextSetLineWidth(context, 1.0 / YYTextScreenScale()); - CGContextSetLineDash(context, 0, NULL, 0); - CGContextSetLineJoin(context, kCGLineJoinMiter); - CGContextSetLineCap(context, kCGLineCapButt); - - BOOL isVertical = layout.container.verticalForm; - CGFloat verticalOffset = isVertical ? (size.width - layout.container.size.width) : 0; - CGContextTranslateCTM(context, verticalOffset, 0); - - if (op.CTFrameBorderColor || op.CTFrameFillColor) { - UIBezierPath *path = layout.container.path; - if (!path) { - CGRect rect = (CGRect){CGPointZero, layout.container.size}; - rect = UIEdgeInsetsInsetRect(rect, layout.container.insets); - if (op.CTFrameBorderColor) rect = YYTextCGRectPixelHalf(rect); - else rect = YYTextCGRectPixelRound(rect); - path = [UIBezierPath bezierPathWithRect:rect]; - } - [path closePath]; - - for (UIBezierPath *ex in layout.container.exclusionPaths) { - [path appendPath:ex]; - } - if (op.CTFrameFillColor) { - [op.CTFrameFillColor setFill]; - if (layout.container.pathLineWidth > 0) { - CGContextSaveGState(context); { - CGContextBeginTransparencyLayer(context, NULL); { - CGContextAddPath(context, path.CGPath); - if (layout.container.pathFillEvenOdd) { - CGContextEOFillPath(context); - } else { - CGContextFillPath(context); - } - CGContextSetBlendMode(context, kCGBlendModeDestinationOut); - [[UIColor blackColor] setFill]; - CGPathRef cgPath = CGPathCreateCopyByStrokingPath(path.CGPath, NULL, layout.container.pathLineWidth, kCGLineCapButt, kCGLineJoinMiter, 0); - if (cgPath) { - CGContextAddPath(context, cgPath); - CGContextFillPath(context); - } - CGPathRelease(cgPath); - } CGContextEndTransparencyLayer(context); - } CGContextRestoreGState(context); - } else { - CGContextAddPath(context, path.CGPath); - if (layout.container.pathFillEvenOdd) { - CGContextEOFillPath(context); - } else { - CGContextFillPath(context); - } - } - } - if (op.CTFrameBorderColor) { - CGContextSaveGState(context); { - if (layout.container.pathLineWidth > 0) { - CGContextSetLineWidth(context, layout.container.pathLineWidth); - } - [op.CTFrameBorderColor setStroke]; - CGContextAddPath(context, path.CGPath); - CGContextStrokePath(context); - } CGContextRestoreGState(context); - } - } - - NSArray *lines = layout.lines; - for (NSUInteger l = 0, lMax = lines.count; l < lMax; l++) { - YYTextLine *line = lines[l]; - if (layout.truncatedLine && layout.truncatedLine.index == line.index) line = layout.truncatedLine; - CGRect lineBounds = line.bounds; - if (op.CTLineFillColor) { - [op.CTLineFillColor setFill]; - CGContextAddRect(context, YYTextCGRectPixelRound(lineBounds)); - CGContextFillPath(context); - } - if (op.CTLineBorderColor) { - [op.CTLineBorderColor setStroke]; - CGContextAddRect(context, YYTextCGRectPixelHalf(lineBounds)); - CGContextStrokePath(context); - } - if (op.baselineColor) { - [op.baselineColor setStroke]; - if (isVertical) { - CGFloat x = YYTextCGFloatPixelHalf(line.position.x); - CGFloat y1 = YYTextCGFloatPixelHalf(line.top); - CGFloat y2 = YYTextCGFloatPixelHalf(line.bottom); - CGContextMoveToPoint(context, x, y1); - CGContextAddLineToPoint(context, x, y2); - CGContextStrokePath(context); - } else { - CGFloat x1 = YYTextCGFloatPixelHalf(lineBounds.origin.x); - CGFloat x2 = YYTextCGFloatPixelHalf(lineBounds.origin.x + lineBounds.size.width); - CGFloat y = YYTextCGFloatPixelHalf(line.position.y); - CGContextMoveToPoint(context, x1, y); - CGContextAddLineToPoint(context, x2, y); - CGContextStrokePath(context); - } - } - if (op.CTLineNumberColor) { - [op.CTLineNumberColor set]; - NSMutableAttributedString *num = [[NSMutableAttributedString alloc] initWithString:@(l).description]; - num.yy_color = op.CTLineNumberColor; - num.yy_font = [UIFont systemFontOfSize:6]; - [num drawAtPoint:CGPointMake(line.position.x, line.position.y - (isVertical ? 1 : 6))]; - } - if (op.CTRunFillColor || op.CTRunBorderColor || op.CTRunNumberColor || op.CGGlyphFillColor || op.CGGlyphBorderColor) { - CFArrayRef runs = CTLineGetGlyphRuns(line.CTLine); - for (NSUInteger r = 0, rMax = CFArrayGetCount(runs); r < rMax; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CFIndex glyphCount = CTRunGetGlyphCount(run); - if (glyphCount == 0) continue; - - CGPoint glyphPositions[glyphCount]; - CTRunGetPositions(run, CFRangeMake(0, glyphCount), glyphPositions); - - CGSize glyphAdvances[glyphCount]; - CTRunGetAdvances(run, CFRangeMake(0, glyphCount), glyphAdvances); - - CGPoint runPosition = glyphPositions[0]; - if (isVertical) { - YYTEXT_SWAP(runPosition.x, runPosition.y); - runPosition.x = line.position.x; - runPosition.y += line.position.y; - } else { - runPosition.x += line.position.x; - runPosition.y = line.position.y - runPosition.y; - } - - CGFloat ascent, descent, leading; - CGFloat width = CTRunGetTypographicBounds(run, CFRangeMake(0, 0), &ascent, &descent, &leading); - CGRect runTypoBounds; - if (isVertical) { - runTypoBounds = CGRectMake(runPosition.x - descent, runPosition.y, ascent + descent, width); - } else { - runTypoBounds = CGRectMake(runPosition.x, line.position.y - ascent, width, ascent + descent); - } - - if (op.CTRunFillColor) { - [op.CTRunFillColor setFill]; - CGContextAddRect(context, YYTextCGRectPixelRound(runTypoBounds)); - CGContextFillPath(context); - } - if (op.CTRunBorderColor) { - [op.CTRunBorderColor setStroke]; - CGContextAddRect(context, YYTextCGRectPixelHalf(runTypoBounds)); - CGContextStrokePath(context); - } - if (op.CTRunNumberColor) { - [op.CTRunNumberColor set]; - NSMutableAttributedString *num = [[NSMutableAttributedString alloc] initWithString:@(r).description]; - num.yy_color = op.CTRunNumberColor; - num.yy_font = [UIFont systemFontOfSize:6]; - [num drawAtPoint:CGPointMake(runTypoBounds.origin.x, runTypoBounds.origin.y - 1)]; - } - if (op.CGGlyphBorderColor || op.CGGlyphFillColor) { - for (NSUInteger g = 0; g < glyphCount; g++) { - CGPoint pos = glyphPositions[g]; - CGSize adv = glyphAdvances[g]; - CGRect rect; - if (isVertical) { - YYTEXT_SWAP(pos.x, pos.y); - pos.x = runPosition.x; - pos.y += line.position.y; - rect = CGRectMake(pos.x - descent, pos.y, runTypoBounds.size.width, adv.width); - } else { - pos.x += line.position.x; - pos.y = runPosition.y; - rect = CGRectMake(pos.x, pos.y - ascent, adv.width, runTypoBounds.size.height); - } - if (op.CGGlyphFillColor) { - [op.CGGlyphFillColor setFill]; - CGContextAddRect(context, YYTextCGRectPixelRound(rect)); - CGContextFillPath(context); - } - if (op.CGGlyphBorderColor) { - [op.CGGlyphBorderColor setStroke]; - CGContextAddRect(context, YYTextCGRectPixelHalf(rect)); - CGContextStrokePath(context); - } - } - } - } - } - } - CGContextRestoreGState(context); - UIGraphicsPopContext(); -} - - -- (void)drawInContext:(CGContextRef)context - size:(CGSize)size - point:(CGPoint)point - view:(UIView *)view - layer:(CALayer *)layer - debug:(YYTextDebugOption *)debug - cancel:(BOOL (^)(void))cancel{ - @autoreleasepool { - if (self.needDrawBlockBorder && context) { - if (cancel && cancel()) return; - YYTextDrawBlockBorder(self, context, size, point, cancel); - } - if (self.needDrawBackgroundBorder && context) { - if (cancel && cancel()) return; - YYTextDrawBorder(self, context, size, point, YYTextBorderTypeBackgound, cancel); - } - if (self.needDrawShadow && context) { - if (cancel && cancel()) return; - YYTextDrawShadow(self, context, size, point, cancel); - } - if (self.needDrawUnderline && context) { - if (cancel && cancel()) return; - YYTextDrawDecoration(self, context, size, point, YYTextDecorationTypeUnderline, cancel); - } - if (self.needDrawText && context) { - if (cancel && cancel()) return; - YYTextDrawText(self, context, size, point, cancel); - } - if (self.needDrawAttachment && (context || view || layer)) { - if (cancel && cancel()) return; - YYTextDrawAttachment(self, context, size, point, view, layer, cancel); - } - if (self.needDrawInnerShadow && context) { - if (cancel && cancel()) return; - YYTextDrawInnerShadow(self, context, size, point, cancel); - } - if (self.needDrawStrikethrough && context) { - if (cancel && cancel()) return; - YYTextDrawDecoration(self, context, size, point, YYTextDecorationTypeStrikethrough, cancel); - } - if (self.needDrawBorder && context) { - if (cancel && cancel()) return; - YYTextDrawBorder(self, context, size, point, YYTextBorderTypeNormal, cancel); - } - if (debug.needDrawDebug && context) { - if (cancel && cancel()) return; - YYTextDrawDebug(self, context, size, point, debug); - } - } -} - -- (void)drawInContext:(CGContextRef)context - size:(CGSize)size - debug:(YYTextDebugOption *)debug { - [self drawInContext:context size:size point:CGPointZero view:nil layer:nil debug:debug cancel:nil]; -} - -- (void)addAttachmentToView:(UIView *)view layer:(CALayer *)layer { - NSAssert([NSThread isMainThread], @"This method must be called on the main thread"); - [self drawInContext:NULL size:CGSizeZero point:CGPointZero view:view layer:layer debug:nil cancel:nil]; -} - -- (void)removeAttachmentFromViewAndLayer { - NSAssert([NSThread isMainThread], @"This method must be called on the main thread"); - for (YYTextAttachment *a in self.attachments) { - if ([a.content isKindOfClass:[UIView class]]) { - UIView *v = a.content; - [v removeFromSuperview]; - } else if ([a.content isKindOfClass:[CALayer class]]) { - CALayer *l = a.content; - [l removeFromSuperlayer]; - } - } -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextLine.h b/iOSProject/Pods/YYText/YYText/Component/YYTextLine.h deleted file mode 100644 index 3151ebca..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextLine.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// YYTextLine.h -// YYText -// -// Created by ibireme on 15/3/10. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -#if __has_include() -#import -#else -#import "YYTextAttribute.h" -#endif - -@class YYTextRunGlyphRange; - -NS_ASSUME_NONNULL_BEGIN - -/** - A text line object wrapped `CTLineRef`, see `YYTextLayout` for more. - */ -@interface YYTextLine : NSObject - -+ (instancetype)lineWithCTLine:(CTLineRef)CTLine position:(CGPoint)position vertical:(BOOL)isVertical; - -@property (nonatomic) NSUInteger index; ///< line index -@property (nonatomic) NSUInteger row; ///< line row -@property (nullable, nonatomic, strong) NSArray *> *verticalRotateRange; ///< Run rotate range - -@property (nonatomic, readonly) CTLineRef CTLine; ///< CoreText line -@property (nonatomic, readonly) NSRange range; ///< string range -@property (nonatomic, readonly) BOOL vertical; ///< vertical form - -@property (nonatomic, readonly) CGRect bounds; ///< bounds (ascent + descent) -@property (nonatomic, readonly) CGSize size; ///< bounds.size -@property (nonatomic, readonly) CGFloat width; ///< bounds.size.width -@property (nonatomic, readonly) CGFloat height; ///< bounds.size.height -@property (nonatomic, readonly) CGFloat top; ///< bounds.origin.y -@property (nonatomic, readonly) CGFloat bottom; ///< bounds.origin.y + bounds.size.height -@property (nonatomic, readonly) CGFloat left; ///< bounds.origin.x -@property (nonatomic, readonly) CGFloat right; ///< bounds.origin.x + bounds.size.width - -@property (nonatomic) CGPoint position; ///< baseline position -@property (nonatomic, readonly) CGFloat ascent; ///< line ascent -@property (nonatomic, readonly) CGFloat descent; ///< line descent -@property (nonatomic, readonly) CGFloat leading; ///< line leading -@property (nonatomic, readonly) CGFloat lineWidth; ///< line width -@property (nonatomic, readonly) CGFloat trailingWhitespaceWidth; - -@property (nullable, nonatomic, readonly) NSArray *attachments; ///< YYTextAttachment -@property (nullable, nonatomic, readonly) NSArray *attachmentRanges; ///< NSRange(NSValue) -@property (nullable, nonatomic, readonly) NSArray *attachmentRects; ///< CGRect(NSValue) - -@end - - -typedef NS_ENUM(NSUInteger, YYTextRunGlyphDrawMode) { - /// No rotate. - YYTextRunGlyphDrawModeHorizontal = 0, - - /// Rotate vertical for single glyph. - YYTextRunGlyphDrawModeVerticalRotate = 1, - - /// Rotate vertical for single glyph, and move the glyph to a better position, - /// such as fullwidth punctuation. - YYTextRunGlyphDrawModeVerticalRotateMove = 2, -}; - -/** - A range in CTRun, used for vertical form. - */ -@interface YYTextRunGlyphRange : NSObject -@property (nonatomic) NSRange glyphRangeInRun; -@property (nonatomic) YYTextRunGlyphDrawMode drawMode; -+ (instancetype)rangeWithRange:(NSRange)range drawMode:(YYTextRunGlyphDrawMode)mode; -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextLine.m b/iOSProject/Pods/YYText/YYText/Component/YYTextLine.m deleted file mode 100644 index 09873835..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextLine.m +++ /dev/null @@ -1,167 +0,0 @@ -// -// YYYTextLine.m -// YYText -// -// Created by ibireme on 15/3/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextLine.h" -#import "YYTextUtilities.h" - - -@implementation YYTextLine { - CGFloat _firstGlyphPos; // first glyph position for baseline, typically 0. -} - -+ (instancetype)lineWithCTLine:(CTLineRef)CTLine position:(CGPoint)position vertical:(BOOL)isVertical { - if (!CTLine) return nil; - YYTextLine *line = [self new]; - line->_position = position; - line->_vertical = isVertical; - [line setCTLine:CTLine]; - return line; -} - -- (void)dealloc { - if (_CTLine) CFRelease(_CTLine); -} - -- (void)setCTLine:(_Nonnull CTLineRef)CTLine { - if (_CTLine != CTLine) { - if (CTLine) CFRetain(CTLine); - if (_CTLine) CFRelease(_CTLine); - _CTLine = CTLine; - if (_CTLine) { - _lineWidth = CTLineGetTypographicBounds(_CTLine, &_ascent, &_descent, &_leading); - CFRange range = CTLineGetStringRange(_CTLine); - _range = NSMakeRange(range.location, range.length); - if (CTLineGetGlyphCount(_CTLine) > 0) { - CFArrayRef runs = CTLineGetGlyphRuns(_CTLine); - CTRunRef run = CFArrayGetValueAtIndex(runs, 0); - CGPoint pos; - CTRunGetPositions(run, CFRangeMake(0, 1), &pos); - _firstGlyphPos = pos.x; - } else { - _firstGlyphPos = 0; - } - _trailingWhitespaceWidth = CTLineGetTrailingWhitespaceWidth(_CTLine); - } else { - _lineWidth = _ascent = _descent = _leading = _firstGlyphPos = _trailingWhitespaceWidth = 0; - _range = NSMakeRange(0, 0); - } - [self reloadBounds]; - } -} - -- (void)setPosition:(CGPoint)position { - _position = position; - [self reloadBounds]; -} - -- (void)reloadBounds { - if (_vertical) { - _bounds = CGRectMake(_position.x - _descent, _position.y, _ascent + _descent, _lineWidth); - _bounds.origin.y += _firstGlyphPos; - } else { - _bounds = CGRectMake(_position.x, _position.y - _ascent, _lineWidth, _ascent + _descent); - _bounds.origin.x += _firstGlyphPos; - } - - _attachments = nil; - _attachmentRanges = nil; - _attachmentRects = nil; - if (!_CTLine) return; - CFArrayRef runs = CTLineGetGlyphRuns(_CTLine); - NSUInteger runCount = CFArrayGetCount(runs); - if (runCount == 0) return; - - NSMutableArray *attachments = [NSMutableArray new]; - NSMutableArray *attachmentRanges = [NSMutableArray new]; - NSMutableArray *attachmentRects = [NSMutableArray new]; - for (NSUInteger r = 0; r < runCount; r++) { - CTRunRef run = CFArrayGetValueAtIndex(runs, r); - CFIndex glyphCount = CTRunGetGlyphCount(run); - if (glyphCount == 0) continue; - NSDictionary *attrs = (id)CTRunGetAttributes(run); - YYTextAttachment *attachment = attrs[YYTextAttachmentAttributeName]; - if (attachment) { - CGPoint runPosition = CGPointZero; - CTRunGetPositions(run, CFRangeMake(0, 1), &runPosition); - - CGFloat ascent, descent, leading, runWidth; - CGRect runTypoBounds; - runWidth = CTRunGetTypographicBounds(run, CFRangeMake(0, 0), &ascent, &descent, &leading); - - if (_vertical) { - YYTEXT_SWAP(runPosition.x, runPosition.y); - runPosition.y = _position.y + runPosition.y; - runTypoBounds = CGRectMake(_position.x + runPosition.x - descent, runPosition.y , ascent + descent, runWidth); - } else { - runPosition.x += _position.x; - runPosition.y = _position.y - runPosition.y; - runTypoBounds = CGRectMake(runPosition.x, runPosition.y - ascent, runWidth, ascent + descent); - } - - NSRange runRange = YYTextNSRangeFromCFRange(CTRunGetStringRange(run)); - [attachments addObject:attachment]; - [attachmentRanges addObject:[NSValue valueWithRange:runRange]]; - [attachmentRects addObject:[NSValue valueWithCGRect:runTypoBounds]]; - } - } - _attachments = attachments.count ? attachments : nil; - _attachmentRanges = attachmentRanges.count ? attachmentRanges : nil; - _attachmentRects = attachmentRects.count ? attachmentRects : nil; -} - -- (CGSize)size { - return _bounds.size; -} - -- (CGFloat)width { - return CGRectGetWidth(_bounds); -} - -- (CGFloat)height { - return CGRectGetHeight(_bounds); -} - -- (CGFloat)top { - return CGRectGetMinY(_bounds); -} - -- (CGFloat)bottom { - return CGRectGetMaxY(_bounds); -} - -- (CGFloat)left { - return CGRectGetMinX(_bounds); -} - -- (CGFloat)right { - return CGRectGetMaxX(_bounds); -} - -- (NSString *)description { - NSMutableString *desc = @"".mutableCopy; - NSRange range = self.range; - [desc appendFormat:@" row:%zd range:%tu,%tu",self, self.row, range.location, range.length]; - [desc appendFormat:@" position:%@",NSStringFromCGPoint(self.position)]; - [desc appendFormat:@" bounds:%@",NSStringFromCGRect(self.bounds)]; - return desc; -} - -@end - - -@implementation YYTextRunGlyphRange -+ (instancetype)rangeWithRange:(NSRange)range drawMode:(YYTextRunGlyphDrawMode)mode { - YYTextRunGlyphRange *one = [self new]; - one.glyphRangeInRun = range; - one.drawMode = mode; - return one; -} -@end diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextMagnifier.h b/iOSProject/Pods/YYText/YYText/Component/YYTextMagnifier.h deleted file mode 100644 index adf131b1..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextMagnifier.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// YYTextMagnifier.h -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -#import -#else -#import "YYTextAttribute.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - -/// Magnifier type -typedef NS_ENUM(NSInteger, YYTextMagnifierType) { - YYTextMagnifierTypeCaret, ///< Circular magnifier - YYTextMagnifierTypeRanged, ///< Round rectangle magnifier -}; - -/** - A magnifier view which can be displayed in `YYTextEffectWindow`. - - @discussion Use `magnifierWithType:` to create instance. - Typically, you should not use this class directly. - */ -@interface YYTextMagnifier : UIView - -/// Create a mangifier with the specified type. @param type The magnifier type. -+ (id)magnifierWithType:(YYTextMagnifierType)type; - -@property (nonatomic, readonly) YYTextMagnifierType type; ///< Type of magnifier -@property (nonatomic, readonly) CGSize fitSize; ///< The 'best' size for magnifier view. -@property (nonatomic, readonly) CGSize snapshotSize; ///< The 'best' snapshot image size for magnifier. -@property (nullable, nonatomic, strong) UIImage *snapshot; ///< The image in magnifier (readwrite). - -@property (nullable, nonatomic, weak) UIView *hostView; ///< The coordinate based view. -@property (nonatomic) CGPoint hostCaptureCenter; ///< The snapshot capture center in `hostView`. -@property (nonatomic) CGPoint hostPopoverCenter; ///< The popover center in `hostView`. -@property (nonatomic) BOOL hostVerticalForm; ///< The host view is vertical form. -@property (nonatomic) BOOL captureDisabled; ///< A hint for `YYTextEffectWindow` to disable capture. -@property (nonatomic) BOOL captureFadeAnimation; ///< Show fade animation when the snapshot image changed. -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextMagnifier.m b/iOSProject/Pods/YYText/YYText/Component/YYTextMagnifier.m deleted file mode 100644 index 3932204f..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextMagnifier.m +++ /dev/null @@ -1,355 +0,0 @@ -// -// YYTextMagnifier.m -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextMagnifier.h" -#import "YYTextUtilities.h" - -#define kCaptureDisableFadeTime 0.1 - - -@interface _YYTextMagnifierCaret : YYTextMagnifier { - UIImageView *_contentView; - UIImageView *_coverView; -} -@end - -@implementation _YYTextMagnifierCaret - -#define kMultiple 1.2 -#define kDiameter 113.0 -#define kPadding 7.0 -#define kSize CGSizeMake(kDiameter + kPadding * 2, kDiameter + kPadding * 2) - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - _contentView = [UIImageView new]; - _contentView.frame = CGRectMake(kPadding, kPadding, kDiameter, kDiameter); - _contentView.layer.cornerRadius = kDiameter / 2; - _contentView.clipsToBounds = YES; - [self addSubview:_contentView]; - - _coverView = [UIImageView new]; - _coverView.frame = (CGRect){.origin = CGPointZero, .size = kSize}; - _coverView.image = [self.class coverImage]; - [self addSubview:_coverView]; - return self; -} - -- (instancetype)init { - self = [self initWithFrame:CGRectZero]; - self.frame = (CGRect){.size = [self sizeThatFits:CGSizeZero]}; - return self; -} - -- (YYTextMagnifierType)type { - return YYTextMagnifierTypeCaret; -} - -- (CGSize)sizeThatFits:(CGSize)size { - return kSize; -} - -- (void)setSnapshot:(UIImage *)snapshot { - if (self.captureFadeAnimation) { - [_contentView.layer removeAnimationForKey:@"contents"]; - CABasicAnimation *animation = [CABasicAnimation animation]; - animation.duration = kCaptureDisableFadeTime; - animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; - [_contentView.layer addAnimation:animation forKey:@"contents"]; - } - _contentView.image = snapshot; -} - -- (UIImage *)snapshot { - return _contentView.image; -} - -- (CGSize)snapshotSize { - CGFloat length = floor(kDiameter / 1.2); - return CGSizeMake(length, length); -} - -- (CGSize)fitSize { - return [self sizeThatFits:CGSizeZero]; -} - -+ (UIImage *)coverImage { - static UIImage *image; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - CGSize size = kSize; - CGRect rect = (CGRect) {.size = size, .origin = CGPointZero}; - rect = CGRectInset(rect, kPadding, kPadding); - - UIGraphicsBeginImageContextWithOptions(size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - - CGPathRef boxPath = CGPathCreateWithRect(CGRectMake(0, 0, size.width, size.height), NULL); - CGPathRef fillPath = CGPathCreateWithEllipseInRect(rect, NULL); - CGPathRef strokePath = CGPathCreateWithEllipseInRect(YYTextCGRectPixelHalf(rect), NULL); - - // inner shadow - CGContextSaveGState(context); { - CGFloat blurRadius = 25; - CGSize offset = CGSizeMake(0, 15); - CGColorRef shadowColor = [UIColor colorWithWhite:0 alpha:0.16].CGColor; - CGColorRef opaqueShadowColor = CGColorCreateCopyWithAlpha(shadowColor, 1.0); - CGContextAddPath(context, fillPath); - CGContextClip(context); - CGContextSetAlpha(context, CGColorGetAlpha(shadowColor)); - CGContextBeginTransparencyLayer(context, NULL); { - CGContextSetShadowWithColor(context, offset, blurRadius, opaqueShadowColor); - CGContextSetBlendMode(context, kCGBlendModeSourceOut); - CGContextSetFillColorWithColor(context, opaqueShadowColor); - CGContextAddPath(context, fillPath); - CGContextFillPath(context); - } CGContextEndTransparencyLayer(context); - CGColorRelease(opaqueShadowColor); - } CGContextRestoreGState(context); - - // outer shadow - CGContextSaveGState(context); { - CGContextAddPath(context, boxPath); - CGContextAddPath(context, fillPath); - CGContextEOClip(context); - CGColorRef shadowColor = [UIColor colorWithWhite:0 alpha:0.32].CGColor; - CGContextSetShadowWithColor(context, CGSizeMake(0, 1.5), 3, shadowColor); - CGContextBeginTransparencyLayer(context, NULL); { - CGContextAddPath(context, fillPath); - [[UIColor colorWithWhite:0.7 alpha:1.000] setFill]; - CGContextFillPath(context); - } CGContextEndTransparencyLayer(context); - } CGContextRestoreGState(context); - - // stroke - CGContextSaveGState(context); { - CGContextAddPath(context, strokePath); - [[UIColor colorWithWhite:0.6 alpha:1] setStroke]; - CGContextSetLineWidth(context, YYTextCGFloatFromPixel(1)); - CGContextStrokePath(context); - } CGContextRestoreGState(context); - - CFRelease(boxPath); - CFRelease(fillPath); - CFRelease(strokePath); - - image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - }); - return image; -} - - -#undef kMultiple -#undef kDiameter -#undef kPadding -#undef kSize - -@end - - - -@interface _YYTextMagnifierRanged : YYTextMagnifier { - UIImageView *_contentView; - UIImageView *_coverView; -} -@end - - -@implementation _YYTextMagnifierRanged -#define kMultiple 1.2 -#define kSize CGSizeMake(141, 60) -#define kPadding YYTextCGFloatPixelHalf(6.0) -#define kRadius 6.0 -#define kHeight 32.0 -#define kArrow 14.0 - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - _contentView = [UIImageView new]; - _contentView.frame = CGRectMake(kPadding, kPadding, kSize.width - 2 * kPadding, kHeight); - _contentView.layer.cornerRadius = kRadius; - _contentView.clipsToBounds = YES; - [self addSubview:_contentView]; - - _coverView = [UIImageView new]; - _coverView.frame = (CGRect){.origin = CGPointZero, .size = kSize}; - _coverView.image = [self.class coverImage]; - [self addSubview:_coverView]; - - self.layer.anchorPoint = CGPointMake(0.5, 1.2); - return self; -} - -- (instancetype)init { - self = [self initWithFrame:CGRectZero]; - self.frame = (CGRect){.size = [self sizeThatFits:CGSizeZero]}; - return self; -} - -- (YYTextMagnifierType)type { - return YYTextMagnifierTypeRanged; -} - -- (CGSize)sizeThatFits:(CGSize)size { - return kSize; -} - -- (void)setSnapshot:(UIImage *)snapshot { - if (self.captureFadeAnimation) { - [_contentView.layer removeAnimationForKey:@"contents"]; - CABasicAnimation *animation = [CABasicAnimation animation]; - animation.duration = kCaptureDisableFadeTime; - animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; - [_contentView.layer addAnimation:animation forKey:@"contents"]; - } - _contentView.image = snapshot; -} - -- (UIImage *)snapshot { - return _contentView.image; -} - -- (CGSize)snapshotSize { - CGSize size; - size.width = floor((kSize.width - 2 * kPadding) / kMultiple); - size.height = floor(kHeight / kMultiple); - return size; -} - -- (CGSize)fitSize { - return [self sizeThatFits:CGSizeZero]; -} - -+ (UIImage *)coverImage { - static UIImage *image; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - CGSize size = kSize; - CGRect rect = (CGRect) {.size = size, .origin = CGPointZero}; - - UIGraphicsBeginImageContextWithOptions(size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - - CGPathRef boxPath = CGPathCreateWithRect(rect, NULL); - - CGMutablePathRef path = CGPathCreateMutable(); - CGPathMoveToPoint(path, NULL, kPadding + kRadius, kPadding); - CGPathAddLineToPoint(path, NULL, size.width - kPadding - kRadius, kPadding); - CGPathAddQuadCurveToPoint(path, NULL, size.width - kPadding, kPadding, size.width - kPadding, kPadding + kRadius); - CGPathAddLineToPoint(path, NULL, size.width - kPadding, kHeight); - CGPathAddCurveToPoint(path, NULL, size.width - kPadding, kPadding + kHeight, size.width - kPadding - kRadius, kPadding + kHeight, size.width - kPadding - kRadius, kPadding + kHeight); - CGPathAddLineToPoint(path, NULL, size.width / 2 + kArrow, kPadding + kHeight); - CGPathAddLineToPoint(path, NULL, size.width / 2, kPadding + kHeight + kArrow); - CGPathAddLineToPoint(path, NULL, size.width / 2 - kArrow, kPadding + kHeight); - CGPathAddLineToPoint(path, NULL, kPadding + kRadius, kPadding + kHeight); - CGPathAddQuadCurveToPoint(path, NULL, kPadding, kPadding + kHeight, kPadding, kHeight); - CGPathAddLineToPoint(path, NULL, kPadding, kPadding + kRadius); - CGPathAddQuadCurveToPoint(path, NULL, kPadding, kPadding, kPadding + kRadius, kPadding); - CGPathCloseSubpath(path); - - CGMutablePathRef arrowPath = CGPathCreateMutable(); - CGPathMoveToPoint(arrowPath, NULL, size.width / 2 - kArrow, YYTextCGFloatPixelFloor(kPadding) + kHeight); - CGPathAddLineToPoint(arrowPath, NULL, size.width / 2 + kArrow, YYTextCGFloatPixelFloor(kPadding) + kHeight); - CGPathAddLineToPoint(arrowPath, NULL, size.width / 2, kPadding + kHeight + kArrow); - CGPathCloseSubpath(arrowPath); - - // inner shadow - CGContextSaveGState(context); { - CGFloat blurRadius = 25; - CGSize offset = CGSizeMake(0, 15); - CGColorRef shadowColor = [UIColor colorWithWhite:0 alpha:0.16].CGColor; - CGColorRef opaqueShadowColor = CGColorCreateCopyWithAlpha(shadowColor, 1.0); - CGContextAddPath(context, path); - CGContextClip(context); - CGContextSetAlpha(context, CGColorGetAlpha(shadowColor)); - CGContextBeginTransparencyLayer(context, NULL); { - CGContextSetShadowWithColor(context, offset, blurRadius, opaqueShadowColor); - CGContextSetBlendMode(context, kCGBlendModeSourceOut); - CGContextSetFillColorWithColor(context, opaqueShadowColor); - CGContextAddPath(context, path); - CGContextFillPath(context); - } CGContextEndTransparencyLayer(context); - CGColorRelease(opaqueShadowColor); - } CGContextRestoreGState(context); - - // outer shadow - CGContextSaveGState(context); { - CGContextAddPath(context, boxPath); - CGContextAddPath(context, path); - CGContextEOClip(context); - CGColorRef shadowColor = [UIColor colorWithWhite:0 alpha:0.32].CGColor; - CGContextSetShadowWithColor(context, CGSizeMake(0, 1.5), 3, shadowColor); - CGContextBeginTransparencyLayer(context, NULL); { - CGContextAddPath(context, path); - [[UIColor colorWithWhite:0.7 alpha:1.000] setFill]; - CGContextFillPath(context); - } CGContextEndTransparencyLayer(context); - } CGContextRestoreGState(context); - - // arrow - CGContextSaveGState(context); { - CGContextAddPath(context, arrowPath); - [[UIColor colorWithWhite:1 alpha:0.95] set]; - CGContextFillPath(context); - } CGContextRestoreGState(context); - - // stroke - CGContextSaveGState(context); { - CGContextAddPath(context, path); - [[UIColor colorWithWhite:0.6 alpha:1] setStroke]; - CGContextSetLineWidth(context, YYTextCGFloatFromPixel(1)); - CGContextStrokePath(context); - } CGContextRestoreGState(context); - - CFRelease(boxPath); - CFRelease(path); - CFRelease(arrowPath); - - image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - }); - return image; -} - -#undef kMultiple -#undef kSize -#undef kPadding -#undef kRadius -#undef kHeight -#undef kArrow - -@end - - -@implementation YYTextMagnifier - -+ (id)magnifierWithType:(YYTextMagnifierType)type { - switch (type) { - case YYTextMagnifierTypeCaret :return [_YYTextMagnifierCaret new]; - case YYTextMagnifierTypeRanged :return [_YYTextMagnifierRanged new]; - } - return nil; -} - -- (id)initWithFrame:(CGRect)frame { - // class cluster - if ([self isMemberOfClass:[YYTextMagnifier class]]) { - @throw [NSException exceptionWithName:NSStringFromClass([self class]) reason:@"Attempting to instantiate an abstract class. Use a concrete subclass instead." userInfo:nil]; - return nil; - } - self = [super initWithFrame:frame]; - return self; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextSelectionView.h b/iOSProject/Pods/YYText/YYText/Component/YYTextSelectionView.h deleted file mode 100644 index be5f38ee..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextSelectionView.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// YYTextSelectionView.h -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -#import -#import -#else -#import "YYTextAttribute.h" -#import "YYTextInput.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - -/** - A single dot view. The frame should be foursquare. - Change the background color for display. - - @discussion Typically, you should not use this class directly. - */ -@interface YYSelectionGrabberDot : UIView -/// Dont't access this property. It was used by `YYTextEffectWindow`. -@property (nonatomic, strong) UIView *mirror; -@end - - -/** - A grabber (stick with a dot). - - @discussion Typically, you should not use this class directly. - */ -@interface YYSelectionGrabber : UIView - -@property (nonatomic, readonly) YYSelectionGrabberDot *dot; ///< the dot view -@property (nonatomic) YYTextDirection dotDirection; ///< don't support composite direction -@property (nullable, nonatomic, strong) UIColor *color; ///< tint color, default is nil - -@end - - -/** - The selection view for text edit and select. - - @discussion Typically, you should not use this class directly. - */ -@interface YYTextSelectionView : UIView - -@property (nullable, nonatomic, weak) UIView *hostView; ///< the holder view -@property (nullable, nonatomic, strong) UIColor *color; ///< the tint color -@property (nonatomic, getter = isCaretBlinks) BOOL caretBlinks; ///< whether the caret is blinks -@property (nonatomic, getter = isCaretVisible) BOOL caretVisible; ///< whether the caret is visible -@property (nonatomic, getter = isVerticalForm) BOOL verticalForm; ///< weather the text view is vertical form - -@property (nonatomic) CGRect caretRect; ///< caret rect (width==0 or height==0) -@property (nullable, nonatomic, copy) NSArray *selectionRects; ///< default is nil - -@property (nonatomic, readonly) UIView *caretView; -@property (nonatomic, readonly) YYSelectionGrabber *startGrabber; -@property (nonatomic, readonly) YYSelectionGrabber *endGrabber; - -- (BOOL)isGrabberContainsPoint:(CGPoint)point; -- (BOOL)isStartGrabberContainsPoint:(CGPoint)point; -- (BOOL)isEndGrabberContainsPoint:(CGPoint)point; -- (BOOL)isCaretContainsPoint:(CGPoint)point; -- (BOOL)isSelectionRectsContainsPoint:(CGPoint)point; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Component/YYTextSelectionView.m b/iOSProject/Pods/YYText/YYText/Component/YYTextSelectionView.m deleted file mode 100644 index 6c3129f4..00000000 --- a/iOSProject/Pods/YYText/YYText/Component/YYTextSelectionView.m +++ /dev/null @@ -1,329 +0,0 @@ -// -// YYTextSelectionView.m -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextSelectionView.h" -#import "YYTextUtilities.h" -#import "YYTextWeakProxy.h" - -#define kMarkAlpha 0.2 -#define kLineWidth 2.0 -#define kBlinkDuration 0.5 -#define kBlinkFadeDuration 0.2 -#define kBlinkFirstDelay 0.1 -#define kTouchTestExtend 14.0 -#define kTouchDotExtend 7.0 - - -@implementation YYSelectionGrabberDot - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (!self) return nil; - self.userInteractionEnabled = NO; - self.mirror = [UIView new]; - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - CGFloat length = MIN(self.bounds.size.width, self.bounds.size.height); - self.layer.cornerRadius = length * 0.5; - self.mirror.bounds = self.bounds; - self.mirror.layer.cornerRadius = self.layer.cornerRadius; -} - -- (void)setBackgroundColor:(UIColor *)backgroundColor { - [super setBackgroundColor:backgroundColor]; - _mirror.backgroundColor = backgroundColor; -} - -@end - - - -@implementation YYSelectionGrabber - -- (instancetype) initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (!self) return nil; - _dot = [[YYSelectionGrabberDot alloc] initWithFrame:CGRectMake(0, 0, 10, 10)]; - return self; -} - -- (void)setDotDirection:(YYTextDirection)dotDirection { - _dotDirection = dotDirection; - [self addSubview:_dot]; - CGRect frame = _dot.frame; - CGFloat ofs = 0.5; - if (dotDirection == YYTextDirectionTop) { - frame.origin.y = -frame.size.height + ofs; - frame.origin.x = (self.bounds.size.width - frame.size.width) / 2; - } else if (dotDirection == YYTextDirectionRight) { - frame.origin.x = self.bounds.size.width - ofs; - frame.origin.y = (self.bounds.size.height - frame.size.height) / 2; - } else if (dotDirection == YYTextDirectionBottom) { - frame.origin.y = self.bounds.size.height - ofs; - frame.origin.x = (self.bounds.size.width - frame.size.width) / 2; - } else if (dotDirection == YYTextDirectionLeft) { - frame.origin.x = -frame.size.width + ofs; - frame.origin.y = (self.bounds.size.height - frame.size.height) / 2; - } else { - [_dot removeFromSuperview]; - } - _dot.frame = frame; -} - -- (void)setColor:(UIColor *)color { - self.backgroundColor = color; - _dot.backgroundColor = color; - _color = color; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - [self setDotDirection:_dotDirection]; -} - -- (CGRect)touchRect { - CGRect rect = CGRectInset(self.frame, -kTouchTestExtend, -kTouchTestExtend); - UIEdgeInsets insets = {0}; - if (_dotDirection == YYTextDirectionTop) { - insets.top = -kTouchDotExtend; - } else if (_dotDirection == YYTextDirectionRight) { - insets.right = -kTouchDotExtend; - } else if (_dotDirection == YYTextDirectionBottom) { - insets.bottom = -kTouchDotExtend; - } else if (_dotDirection == YYTextDirectionLeft) { - insets.left = -kTouchDotExtend; - } - rect = UIEdgeInsetsInsetRect(rect, insets); - return rect; -} - -@end - - - -@interface YYTextSelectionView () -@property (nonatomic, strong) NSTimer *caretTimer; -@property (nonatomic, strong) UIView *caretView; -@property (nonatomic, strong) YYSelectionGrabber *startGrabber; -@property (nonatomic, strong) YYSelectionGrabber *endGrabber; -@property (nonatomic, strong) NSMutableArray *markViews; -@end - -@implementation YYTextSelectionView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (!self) return nil; - - self.userInteractionEnabled = NO; - self.clipsToBounds = NO; - _markViews = [NSMutableArray array]; - _caretView = [UIView new]; - _caretView.hidden = YES; - _startGrabber = [YYSelectionGrabber new]; - _startGrabber.dotDirection = YYTextDirectionTop; - _startGrabber.hidden = YES; - _endGrabber = [YYSelectionGrabber new]; - _endGrabber.dotDirection = YYTextDirectionBottom; - _endGrabber.hidden = YES; - - [self addSubview:_startGrabber]; - [self addSubview:_endGrabber]; - [self addSubview:_caretView]; - - return self; -} - -- (void)dealloc { - [_caretTimer invalidate]; -} - -- (void)setColor:(UIColor *)color { - _color = color; - self.caretView.backgroundColor = color; - self.startGrabber.color = color; - self.endGrabber.color = color; - [self.markViews enumerateObjectsUsingBlock: ^(UIView *v, NSUInteger idx, BOOL *stop) { - v.backgroundColor = color; - }]; -} - -- (void)setCaretBlinks:(BOOL)caretBlinks { - if (_caretBlinks != caretBlinks) { - _caretView.alpha = 1; - [self.class cancelPreviousPerformRequestsWithTarget:self selector:@selector(_startBlinks) object:nil]; - if (caretBlinks) { - [self performSelector:@selector(_startBlinks) withObject:nil afterDelay:kBlinkFirstDelay]; - } else { - [_caretTimer invalidate]; - _caretTimer = nil; - } - _caretBlinks = caretBlinks; - } -} - -- (void)_startBlinks { - [_caretTimer invalidate]; - if (_caretVisible) { - _caretTimer = [NSTimer timerWithTimeInterval:kBlinkDuration target:[YYTextWeakProxy proxyWithTarget:self] selector:@selector(_doBlink) userInfo:nil repeats:YES]; - [[NSRunLoop currentRunLoop] addTimer:_caretTimer forMode:NSDefaultRunLoopMode]; - } else { - _caretView.alpha = 1; - } -} - -- (void)_doBlink { - [UIView animateWithDuration:kBlinkFadeDuration delay:0 options:UIViewAnimationOptionCurveEaseInOut animations: ^{ - if (_caretView.alpha == 1) _caretView.alpha = 0; - else _caretView.alpha = 1; - } completion:NULL]; -} - -- (void)setCaretVisible:(BOOL)caretVisible { - _caretVisible = caretVisible; - self.caretView.hidden = !caretVisible; - _caretView.alpha = 1; - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_startBlinks) object:nil]; - if (_caretBlinks) { - [self performSelector:@selector(_startBlinks) withObject:nil afterDelay:kBlinkFirstDelay]; - } -} - -- (void)setVerticalForm:(BOOL)verticalForm { - if (_verticalForm != verticalForm) { - _verticalForm = verticalForm; - [self setCaretRect:_caretRect]; - self.startGrabber.dotDirection = verticalForm ? YYTextDirectionRight : YYTextDirectionTop; - self.endGrabber.dotDirection = verticalForm ? YYTextDirectionLeft : YYTextDirectionBottom; - } -} - -- (CGRect)_standardCaretRect:(CGRect)caretRect { - caretRect = CGRectStandardize(caretRect); - if (_verticalForm) { - if (caretRect.size.height == 0) { - caretRect.size.height = kLineWidth; - caretRect.origin.y -= kLineWidth * 0.5; - } - if (caretRect.origin.y < 0) { - caretRect.origin.y = 0; - } else if (caretRect.origin.y + caretRect.size.height > self.bounds.size.height) { - caretRect.origin.y = self.bounds.size.height - caretRect.size.height; - } - } else { - if (caretRect.size.width == 0) { - caretRect.size.width = kLineWidth; - caretRect.origin.x -= kLineWidth * 0.5; - } - if (caretRect.origin.x < 0) { - caretRect.origin.x = 0; - } else if (caretRect.origin.x + caretRect.size.width > self.bounds.size.width) { - caretRect.origin.x = self.bounds.size.width - caretRect.size.width; - } - } - caretRect = YYTextCGRectPixelRound(caretRect); - if (isnan(caretRect.origin.x) || isinf(caretRect.origin.x)) caretRect.origin.x = 0; - if (isnan(caretRect.origin.y) || isinf(caretRect.origin.y)) caretRect.origin.y = 0; - if (isnan(caretRect.size.width) || isinf(caretRect.size.width)) caretRect.size.width = 0; - if (isnan(caretRect.size.height) || isinf(caretRect.size.height)) caretRect.size.height = 0; - return caretRect; -} - -- (void)setCaretRect:(CGRect)caretRect { - _caretRect = caretRect; - self.caretView.frame = [self _standardCaretRect:caretRect]; - CGFloat minWidth = MIN(self.caretView.bounds.size.width, self.caretView.bounds.size.height); - self.caretView.layer.cornerRadius = minWidth / 2; -} - -- (void)setSelectionRects:(NSArray *)selectionRects { - _selectionRects = selectionRects.copy; - [self.markViews enumerateObjectsUsingBlock: ^(UIView *v, NSUInteger idx, BOOL *stop) { - [v removeFromSuperview]; - }]; - [self.markViews removeAllObjects]; - self.startGrabber.hidden = YES; - self.endGrabber.hidden = YES; - - [selectionRects enumerateObjectsUsingBlock: ^(YYTextSelectionRect *r, NSUInteger idx, BOOL *stop) { - CGRect rect = r.rect; - rect = CGRectStandardize(rect); - rect = YYTextCGRectPixelRound(rect); - if (r.containsStart || r.containsEnd) { - rect = [self _standardCaretRect:rect]; - if (r.containsStart) { - self.startGrabber.hidden = NO; - self.startGrabber.frame = rect; - } - if (r.containsEnd) { - self.endGrabber.hidden = NO; - self.endGrabber.frame = rect; - } - } else { - if (rect.size.width > 0 && rect.size.height > 0) { - UIView *mark = [[UIView alloc] initWithFrame:rect]; - mark.backgroundColor = _color; - mark.alpha = kMarkAlpha; - [self insertSubview:mark atIndex:0]; - [self.markViews addObject:mark]; - } - } - }]; -} - -- (BOOL)isGrabberContainsPoint:(CGPoint)point { - return [self isStartGrabberContainsPoint:point] || [self isEndGrabberContainsPoint:point]; -} - -- (BOOL)isStartGrabberContainsPoint:(CGPoint)point { - if (_startGrabber.hidden) return NO; - CGRect startRect = [_startGrabber touchRect]; - CGRect endRect = [_endGrabber touchRect]; - if (CGRectIntersectsRect(startRect, endRect)) { - CGFloat distStart = YYTextCGPointGetDistanceToPoint(point, YYTextCGRectGetCenter(startRect)); - CGFloat distEnd = YYTextCGPointGetDistanceToPoint(point, YYTextCGRectGetCenter(endRect)); - if (distEnd <= distStart) return NO; - } - return CGRectContainsPoint(startRect, point); -} - -- (BOOL)isEndGrabberContainsPoint:(CGPoint)point { - if (_endGrabber.hidden) return NO; - CGRect startRect = [_startGrabber touchRect]; - CGRect endRect = [_endGrabber touchRect]; - if (CGRectIntersectsRect(startRect, endRect)) { - CGFloat distStart = YYTextCGPointGetDistanceToPoint(point, YYTextCGRectGetCenter(startRect)); - CGFloat distEnd = YYTextCGPointGetDistanceToPoint(point, YYTextCGRectGetCenter(endRect)); - if (distEnd > distStart) return NO; - } - return CGRectContainsPoint(endRect, point); -} - -- (BOOL)isCaretContainsPoint:(CGPoint)point { - if (_caretVisible) { - CGRect rect = CGRectInset(_caretRect, -kTouchTestExtend, -kTouchTestExtend); - return CGRectContainsPoint(rect, point); - } - return NO; -} - -- (BOOL)isSelectionRectsContainsPoint:(CGPoint)point { - if (_selectionRects.count == 0) return NO; - for (YYTextSelectionRect *rect in _selectionRects) { - if (CGRectContainsPoint(rect.rect, point)) return YES; - } - return NO; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextArchiver.h b/iOSProject/Pods/YYText/YYText/String/YYTextArchiver.h deleted file mode 100644 index cff8935f..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextArchiver.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// YYTextArchiver.h -// YYText -// -// Created by ibireme on 15/3/16. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - A subclass of `NSKeyedArchiver` which implement `NSKeyedArchiverDelegate` protocol. - - The archiver can encode the object which contains - CGColor/CGImage/CTRunDelegateRef/.. (such as NSAttributedString). - */ -@interface YYTextArchiver : NSKeyedArchiver -@end - -/** - A subclass of `NSKeyedUnarchiver` which implement `NSKeyedUnarchiverDelegate` - protocol. The unarchiver can decode the data which is encoded by - `YYTextArchiver` or `NSKeyedArchiver`. - */ -@interface YYTextUnarchiver : NSKeyedUnarchiver -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextArchiver.m b/iOSProject/Pods/YYText/YYText/String/YYTextArchiver.m deleted file mode 100644 index e0f64dc0..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextArchiver.m +++ /dev/null @@ -1,252 +0,0 @@ -// -// YYTextArchiver.m -// YYText -// -// Created by ibireme on 15/3/16. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextArchiver.h" -#import "YYTextRunDelegate.h" -#import "YYTextRubyAnnotation.h" - -/** - When call CTRunDelegateGetTypeID() on some devices (runs iOS6), I got the error: - "dyld: lazy symbol binding failed: Symbol not found: _CTRunDelegateGetTypeID" - - Here's a workaround for this issue. - */ -static CFTypeID CTRunDelegateTypeID() { - static CFTypeID typeID; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - /* - if ((long)CTRunDelegateGetTypeID + 1 > 1) { //avoid compiler optimization - typeID = CTRunDelegateGetTypeID(); - } - */ - YYTextRunDelegate *delegate = [YYTextRunDelegate new]; - CTRunDelegateRef ref = delegate.CTRunDelegate; - typeID = CFGetTypeID(ref); - CFRelease(ref); - }); - return typeID; -} - -static CFTypeID CTRubyAnnotationTypeID() { - static CFTypeID typeID; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - if ((long)CTRubyAnnotationGetTypeID + 1 > 1) { //avoid compiler optimization - typeID = CTRunDelegateGetTypeID(); - } else { - typeID = kCFNotFound; - } - }); - return typeID; -} - -/** - A wrapper for CGColorRef. Used for Archive/Unarchive/Copy. - */ -@interface _YYCGColor : NSObject -@property (nonatomic, assign) CGColorRef CGColor; -+ (instancetype)colorWithCGColor:(CGColorRef)CGColor; -@end - -@implementation _YYCGColor - -+ (instancetype)colorWithCGColor:(CGColorRef)CGColor { - _YYCGColor *color = [self new]; - color.CGColor = CGColor; - return color; -} - -- (void)setCGColor:(CGColorRef)CGColor { - if (_CGColor != CGColor) { - if (CGColor) CGColor = (CGColorRef)CFRetain(CGColor); - if (_CGColor) CFRelease(_CGColor); - _CGColor = CGColor; - } -} - -- (void)dealloc { - if (_CGColor) CFRelease(_CGColor); - _CGColor = NULL; -} - -- (id)copyWithZone:(NSZone *)zone { - _YYCGColor *color = [self.class new]; - color.CGColor = self.CGColor; - return color; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - UIColor *color = [UIColor colorWithCGColor:_CGColor]; - [aCoder encodeObject:color forKey:@"color"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [self init]; - UIColor *color = [aDecoder decodeObjectForKey:@"color"]; - self.CGColor = color.CGColor; - return self; -} - -@end - -/** - A wrapper for CGImageRef. Used for Archive/Unarchive/Copy. - */ -@interface _YYCGImage : NSObject -@property (nonatomic, assign) CGImageRef CGImage; -+ (instancetype)imageWithCGImage:(CGImageRef)CGImage; -@end - -@implementation _YYCGImage - -+ (instancetype)imageWithCGImage:(CGImageRef)CGImage { - _YYCGImage *image = [self new]; - image.CGImage = CGImage; - return image; -} - -- (void)setCGImage:(CGImageRef)CGImage { - if (_CGImage != CGImage) { - if (CGImage) CGImage = (CGImageRef)CFRetain(CGImage); - if (_CGImage) CFRelease(_CGImage); - _CGImage = CGImage; - } -} - -- (void)dealloc { - if (_CGImage) CFRelease(_CGImage); -} - -- (id)copyWithZone:(NSZone *)zone { - _YYCGImage *image = [self.class new]; - image.CGImage = self.CGImage; - return image; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - UIImage *image = [UIImage imageWithCGImage:_CGImage]; - [aCoder encodeObject:image forKey:@"image"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [self init]; - UIImage *image = [aDecoder decodeObjectForKey:@"image"]; - self.CGImage = image.CGImage; - return self; -} - -@end - - -@implementation YYTextArchiver - -+ (NSData *)archivedDataWithRootObject:(id)rootObject { - if (!rootObject) return nil; - NSMutableData *data = [NSMutableData data]; - YYTextArchiver *archiver = [[[self class] alloc] initForWritingWithMutableData:data]; - [archiver encodeRootObject:rootObject]; - [archiver finishEncoding]; - return data; -} - -+ (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path { - NSData *data = [self archivedDataWithRootObject:rootObject]; - if (!data) return NO; - return [data writeToFile:path atomically:YES]; -} - -- (instancetype)init { - self = [super init]; - self.delegate = self; - return self; -} - -- (instancetype)initForWritingWithMutableData:(NSMutableData *)data { - self = [super initForWritingWithMutableData:data]; - self.delegate = self; - return self; -} - -- (id)archiver:(NSKeyedArchiver *)archiver willEncodeObject:(id)object { - CFTypeID typeID = CFGetTypeID((CFTypeRef)object); - if (typeID == CTRunDelegateTypeID()) { - CTRunDelegateRef runDelegate = (__bridge CFTypeRef)(object); - id ref = CTRunDelegateGetRefCon(runDelegate); - if (ref) return ref; - } else if (typeID == CTRubyAnnotationTypeID()) { - CTRubyAnnotationRef ctRuby = (__bridge CFTypeRef)(object); - YYTextRubyAnnotation *ruby = [YYTextRubyAnnotation rubyWithCTRubyRef:ctRuby]; - if (ruby) return ruby; - } else if (typeID == CGColorGetTypeID()) { - return [_YYCGColor colorWithCGColor:(CGColorRef)object]; - } else if (typeID == CGImageGetTypeID()) { - return [_YYCGImage imageWithCGImage:(CGImageRef)object]; - } - return object; -} - -@end - - -@implementation YYTextUnarchiver - -+ (id)unarchiveObjectWithData:(NSData *)data { - if (data.length == 0) return nil; - YYTextUnarchiver *unarchiver = [[self alloc] initForReadingWithData:data]; - return [unarchiver decodeObject]; -} - -+ (id)unarchiveObjectWithFile:(NSString *)path { - NSData *data = [NSData dataWithContentsOfFile:path]; - return [self unarchiveObjectWithData:data]; -} - -- (instancetype)init { - self = [super init]; - self.delegate = self; - return self; -} - -- (instancetype)initForReadingWithData:(NSData *)data { - self = [super initForReadingWithData:data]; - self.delegate = self; - return self; -} - -- (id)unarchiver:(NSKeyedUnarchiver *)unarchiver didDecodeObject:(id) NS_RELEASES_ARGUMENT object NS_RETURNS_RETAINED { - if ([object class] == [YYTextRunDelegate class]) { - YYTextRunDelegate *runDelegate = object; - CTRunDelegateRef ct = runDelegate.CTRunDelegate; - id ctObj = (__bridge id)ct; - if (ct) CFRelease(ct); - return ctObj; - } else if ([object class] == [YYTextRubyAnnotation class]) { - YYTextRubyAnnotation *ruby = object; - if ([UIDevice currentDevice].systemVersion.floatValue >= 8) { - CTRubyAnnotationRef ct = ruby.CTRubyAnnotation; - id ctObj = (__bridge id)(ct); - if (ct) CFRelease(ct); - return ctObj; - } else { - return object; - } - } else if ([object class] == [_YYCGColor class]) { - _YYCGColor *color = object; - return (id)color.CGColor; - } else if ([object class] == [_YYCGImage class]) { - _YYCGImage *image = object; - return (id)image.CGImage; - } - return object; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextAttribute.h b/iOSProject/Pods/YYText/YYText/String/YYTextAttribute.h deleted file mode 100644 index c6bb774e..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextAttribute.h +++ /dev/null @@ -1,347 +0,0 @@ -// -// YYTextAttribute.h -// YYText -// -// Created by ibireme on 14/10/26. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - Enum Define - -/// The attribute type -typedef NS_OPTIONS(NSInteger, YYTextAttributeType) { - YYTextAttributeTypeNone = 0, - YYTextAttributeTypeUIKit = 1 << 0, ///< UIKit attributes, such as UILabel/UITextField/drawInRect. - YYTextAttributeTypeCoreText = 1 << 1, ///< CoreText attributes, used by CoreText. - YYTextAttributeTypeYYText = 1 << 2, ///< YYText attributes, used by YYText. -}; - -/// Get the attribute type from an attribute name. -extern YYTextAttributeType YYTextAttributeGetType(NSString *attributeName); - -/** - Line style in YYText (similar to NSUnderlineStyle). - */ -typedef NS_OPTIONS (NSInteger, YYTextLineStyle) { - // basic style (bitmask:0xFF) - YYTextLineStyleNone = 0x00, ///< ( ) Do not draw a line (Default). - YYTextLineStyleSingle = 0x01, ///< (──────) Draw a single line. - YYTextLineStyleThick = 0x02, ///< (━━━━━━━) Draw a thick line. - YYTextLineStyleDouble = 0x09, ///< (══════) Draw a double line. - - // style pattern (bitmask:0xF00) - YYTextLineStylePatternSolid = 0x000, ///< (────────) Draw a solid line (Default). - YYTextLineStylePatternDot = 0x100, ///< (‑ ‑ ‑ ‑ ‑ ‑) Draw a line of dots. - YYTextLineStylePatternDash = 0x200, ///< (— — — —) Draw a line of dashes. - YYTextLineStylePatternDashDot = 0x300, ///< (— ‑ — ‑ — ‑) Draw a line of alternating dashes and dots. - YYTextLineStylePatternDashDotDot = 0x400, ///< (— ‑ ‑ — ‑ ‑) Draw a line of alternating dashes and two dots. - YYTextLineStylePatternCircleDot = 0x900, ///< (••••••••••••) Draw a line of small circle dots. -}; - -/** - Text vertical alignment. - */ -typedef NS_ENUM(NSInteger, YYTextVerticalAlignment) { - YYTextVerticalAlignmentTop = 0, ///< Top alignment. - YYTextVerticalAlignmentCenter = 1, ///< Center alignment. - YYTextVerticalAlignmentBottom = 2, ///< Bottom alignment. -}; - -/** - The direction define in YYText. - */ -typedef NS_OPTIONS(NSUInteger, YYTextDirection) { - YYTextDirectionNone = 0, - YYTextDirectionTop = 1 << 0, - YYTextDirectionRight = 1 << 1, - YYTextDirectionBottom = 1 << 2, - YYTextDirectionLeft = 1 << 3, -}; - -/** - The trunction type, tells the truncation engine which type of truncation is being requested. - */ -typedef NS_ENUM (NSUInteger, YYTextTruncationType) { - /// No truncate. - YYTextTruncationTypeNone = 0, - - /// Truncate at the beginning of the line, leaving the end portion visible. - YYTextTruncationTypeStart = 1, - - /// Truncate at the end of the line, leaving the start portion visible. - YYTextTruncationTypeEnd = 2, - - /// Truncate in the middle of the line, leaving both the start and the end portions visible. - YYTextTruncationTypeMiddle = 3, -}; - - - -#pragma mark - Attribute Name Defined in YYText - -/// The value of this attribute is a `YYTextBackedString` object. -/// Use this attribute to store the original plain text if it is replaced by something else (such as attachment). -UIKIT_EXTERN NSString *const YYTextBackedStringAttributeName; - -/// The value of this attribute is a `YYTextBinding` object. -/// Use this attribute to bind a range of text together, as if it was a single charactor. -UIKIT_EXTERN NSString *const YYTextBindingAttributeName; - -/// The value of this attribute is a `YYTextShadow` object. -/// Use this attribute to add shadow to a range of text. -/// Shadow will be drawn below text glyphs. Use YYTextShadow.subShadow to add multi-shadow. -UIKIT_EXTERN NSString *const YYTextShadowAttributeName; - -/// The value of this attribute is a `YYTextShadow` object. -/// Use this attribute to add inner shadow to a range of text. -/// Inner shadow will be drawn above text glyphs. Use YYTextShadow.subShadow to add multi-shadow. -UIKIT_EXTERN NSString *const YYTextInnerShadowAttributeName; - -/// The value of this attribute is a `YYTextDecoration` object. -/// Use this attribute to add underline to a range of text. -/// The underline will be drawn below text glyphs. -UIKIT_EXTERN NSString *const YYTextUnderlineAttributeName; - -/// The value of this attribute is a `YYTextDecoration` object. -/// Use this attribute to add strikethrough (delete line) to a range of text. -/// The strikethrough will be drawn above text glyphs. -UIKIT_EXTERN NSString *const YYTextStrikethroughAttributeName; - -/// The value of this attribute is a `YYTextBorder` object. -/// Use this attribute to add cover border or cover color to a range of text. -/// The border will be drawn above the text glyphs. -UIKIT_EXTERN NSString *const YYTextBorderAttributeName; - -/// The value of this attribute is a `YYTextBorder` object. -/// Use this attribute to add background border or background color to a range of text. -/// The border will be drawn below the text glyphs. -UIKIT_EXTERN NSString *const YYTextBackgroundBorderAttributeName; - -/// The value of this attribute is a `YYTextBorder` object. -/// Use this attribute to add a code block border to one or more line of text. -/// The border will be drawn below the text glyphs. -UIKIT_EXTERN NSString *const YYTextBlockBorderAttributeName; - -/// The value of this attribute is a `YYTextAttachment` object. -/// Use this attribute to add attachment to text. -/// It should be used in conjunction with a CTRunDelegate. -UIKIT_EXTERN NSString *const YYTextAttachmentAttributeName; - -/// The value of this attribute is a `YYTextHighlight` object. -/// Use this attribute to add a touchable highlight state to a range of text. -UIKIT_EXTERN NSString *const YYTextHighlightAttributeName; - -/// The value of this attribute is a `NSValue` object stores CGAffineTransform. -/// Use this attribute to add transform to each glyph in a range of text. -UIKIT_EXTERN NSString *const YYTextGlyphTransformAttributeName; - - - -#pragma mark - String Token Define - -UIKIT_EXTERN NSString *const YYTextAttachmentToken; ///< Object replacement character (U+FFFC), used for text attachment. -UIKIT_EXTERN NSString *const YYTextTruncationToken; ///< Horizontal ellipsis (U+2026), used for text truncation "…". - - - -#pragma mark - Attribute Value Define - -/** - The tap/long press action callback defined in YYText. - - @param containerView The text container view (such as YYLabel/YYTextView). - @param text The whole text. - @param range The text range in `text` (if no range, the range.location is NSNotFound). - @param rect The text frame in `containerView` (if no data, the rect is CGRectNull). - */ -typedef void(^YYTextAction)(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect); - - -/** - YYTextBackedString objects are used by the NSAttributedString class cluster - as the values for text backed string attributes (stored in the attributed - string under the key named YYTextBackedStringAttributeName). - - It may used for copy/paste plain text from attributed string. - Example: If :) is replace by a custom emoji (such as😊), the backed string can be set to @":)". - */ -@interface YYTextBackedString : NSObject -+ (instancetype)stringWithString:(nullable NSString *)string; -@property (nullable, nonatomic, copy) NSString *string; ///< backed string -@end - - -/** - YYTextBinding objects are used by the NSAttributedString class cluster - as the values for shadow attributes (stored in the attributed string under - the key named YYTextBindingAttributeName). - - Add this to a range of text will make the specified characters 'binding together'. - YYTextView will treat the range of text as a single character during text - selection and edit. - */ -@interface YYTextBinding : NSObject -+ (instancetype)bindingWithDeleteConfirm:(BOOL)deleteConfirm; -@property (nonatomic) BOOL deleteConfirm; ///< confirm the range when delete in YYTextView -@end - - -/** - YYTextShadow objects are used by the NSAttributedString class cluster - as the values for shadow attributes (stored in the attributed string under - the key named YYTextShadowAttributeName or YYTextInnerShadowAttributeName). - - It's similar to `NSShadow`, but offers more options. - */ -@interface YYTextShadow : NSObject -+ (instancetype)shadowWithColor:(nullable UIColor *)color offset:(CGSize)offset radius:(CGFloat)radius; - -@property (nullable, nonatomic, strong) UIColor *color; ///< shadow color -@property (nonatomic) CGSize offset; ///< shadow offset -@property (nonatomic) CGFloat radius; ///< shadow blur radius -@property (nonatomic) CGBlendMode blendMode; ///< shadow blend mode -@property (nullable, nonatomic, strong) YYTextShadow *subShadow; ///< a sub shadow which will be added above the parent shadow - -+ (instancetype)shadowWithNSShadow:(NSShadow *)nsShadow; ///< convert NSShadow to YYTextShadow -- (NSShadow *)nsShadow; ///< convert YYTextShadow to NSShadow -@end - - -/** - YYTextDecorationLine objects are used by the NSAttributedString class cluster - as the values for decoration line attributes (stored in the attributed string under - the key named YYTextUnderlineAttributeName or YYTextStrikethroughAttributeName). - - When it's used as underline, the line is drawn below text glyphs; - when it's used as strikethrough, the line is drawn above text glyphs. - */ -@interface YYTextDecoration : NSObject -+ (instancetype)decorationWithStyle:(YYTextLineStyle)style; -+ (instancetype)decorationWithStyle:(YYTextLineStyle)style width:(nullable NSNumber *)width color:(nullable UIColor *)color; -@property (nonatomic) YYTextLineStyle style; ///< line style -@property (nullable, nonatomic, strong) NSNumber *width; ///< line width (nil means automatic width) -@property (nullable, nonatomic, strong) UIColor *color; ///< line color (nil means automatic color) -@property (nullable, nonatomic, strong) YYTextShadow *shadow; ///< line shadow -@end - - -/** - YYTextBorder objects are used by the NSAttributedString class cluster - as the values for border attributes (stored in the attributed string under - the key named YYTextBorderAttributeName or YYTextBackgroundBorderAttributeName). - - It can be used to draw a border around a range of text, or draw a background - to a range of text. - - Example: - ╭──────╮ - │ Text │ - ╰──────╯ - */ -@interface YYTextBorder : NSObject -+ (instancetype)borderWithLineStyle:(YYTextLineStyle)lineStyle lineWidth:(CGFloat)width strokeColor:(nullable UIColor *)color; -+ (instancetype)borderWithFillColor:(nullable UIColor *)color cornerRadius:(CGFloat)cornerRadius; -@property (nonatomic) YYTextLineStyle lineStyle; ///< border line style -@property (nonatomic) CGFloat strokeWidth; ///< border line width -@property (nullable, nonatomic, strong) UIColor *strokeColor; ///< border line color -@property (nonatomic) CGLineJoin lineJoin; ///< border line join -@property (nonatomic) UIEdgeInsets insets; ///< border insets for text bounds -@property (nonatomic) CGFloat cornerRadius; ///< border corder radius -@property (nullable, nonatomic, strong) YYTextShadow *shadow; ///< border shadow -@property (nullable, nonatomic, strong) UIColor *fillColor; ///< inner fill color -@end - - -/** - YYTextAttachment objects are used by the NSAttributedString class cluster - as the values for attachment attributes (stored in the attributed string under - the key named YYTextAttachmentAttributeName). - - When display an attributed string which contains `YYTextAttachment` object, - the content will be placed in text metric. If the content is `UIImage`, - then it will be drawn to CGContext; if the content is `UIView` or `CALayer`, - then it will be added to the text container's view or layer. - */ -@interface YYTextAttachment : NSObject -+ (instancetype)attachmentWithContent:(nullable id)content; -@property (nullable, nonatomic, strong) id content; ///< Supported type: UIImage, UIView, CALayer -@property (nonatomic) UIViewContentMode contentMode; ///< Content display mode. -@property (nonatomic) UIEdgeInsets contentInsets; ///< The insets when drawing content. -@property (nullable, nonatomic, strong) NSDictionary *userInfo; ///< The user information dictionary. -@end - - -/** - YYTextHighlight objects are used by the NSAttributedString class cluster - as the values for touchable highlight attributes (stored in the attributed string - under the key named YYTextHighlightAttributeName). - - When display an attributed string in `YYLabel` or `YYTextView`, the range of - highlight text can be toucheds down by users. If a range of text is turned into - highlighted state, the `attributes` in `YYTextHighlight` will be used to modify - (set or remove) the original attributes in the range for display. - */ -@interface YYTextHighlight : NSObject - -/** - Attributes that you can apply to text in an attributed string when highlight. - Key: Same as CoreText/YYText Attribute Name. - Value: Modify attribute value when highlight (NSNull for remove attribute). - */ -@property (nullable, nonatomic, copy) NSDictionary *attributes; - -/** - Creates a highlight object with specified attributes. - - @param attributes The attributes which will replace original attributes when highlight, - If the value is NSNull, it will removed when highlight. - */ -+ (instancetype)highlightWithAttributes:(nullable NSDictionary *)attributes; - -/** - Convenience methods to create a default highlight with the specifeid background color. - - @param color The background border color. - */ -+ (instancetype)highlightWithBackgroundColor:(nullable UIColor *)color; - -// Convenience methods below to set the `attributes`. -- (void)setFont:(nullable UIFont *)font; -- (void)setColor:(nullable UIColor *)color; -- (void)setStrokeWidth:(nullable NSNumber *)width; -- (void)setStrokeColor:(nullable UIColor *)color; -- (void)setShadow:(nullable YYTextShadow *)shadow; -- (void)setInnerShadow:(nullable YYTextShadow *)shadow; -- (void)setUnderline:(nullable YYTextDecoration *)underline; -- (void)setStrikethrough:(nullable YYTextDecoration *)strikethrough; -- (void)setBackgroundBorder:(nullable YYTextBorder *)border; -- (void)setBorder:(nullable YYTextBorder *)border; -- (void)setAttachment:(nullable YYTextAttachment *)attachment; - -/** - The user information dictionary, default is nil. - */ -@property (nullable, nonatomic, copy) NSDictionary *userInfo; - -/** - Tap action when user tap the highlight, default is nil. - If the value is nil, YYTextView or YYLabel will ask it's delegate to handle the tap action. - */ -@property (nullable, nonatomic, copy) YYTextAction tapAction; - -/** - Long press action when user long press the highlight, default is nil. - If the value is nil, YYTextView or YYLabel will ask it's delegate to handle the long press action. - */ -@property (nullable, nonatomic, copy) YYTextAction longPressAction; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextAttribute.m b/iOSProject/Pods/YYText/YYText/String/YYTextAttribute.m deleted file mode 100644 index 09fa05f7..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextAttribute.m +++ /dev/null @@ -1,524 +0,0 @@ -// -// YYTextAttribute.m -// YYText -// -// Created by ibireme on 14/10/26. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextAttribute.h" -#import -#import -#import "NSAttributedString+YYText.h" -#import "YYTextArchiver.h" - - -static double _YYDeviceSystemVersion() { - static double version; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - version = [UIDevice currentDevice].systemVersion.doubleValue; - }); - return version; -} - - -NSString *const YYTextBackedStringAttributeName = @"YYTextBackedString"; -NSString *const YYTextBindingAttributeName = @"YYTextBinding"; -NSString *const YYTextShadowAttributeName = @"YYTextShadow"; -NSString *const YYTextInnerShadowAttributeName = @"YYTextInnerShadow"; -NSString *const YYTextUnderlineAttributeName = @"YYTextUnderline"; -NSString *const YYTextStrikethroughAttributeName = @"YYTextStrikethrough"; -NSString *const YYTextBorderAttributeName = @"YYTextBorder"; -NSString *const YYTextBackgroundBorderAttributeName = @"YYTextBackgroundBorder"; -NSString *const YYTextBlockBorderAttributeName = @"YYTextBlockBorder"; -NSString *const YYTextAttachmentAttributeName = @"YYTextAttachment"; -NSString *const YYTextHighlightAttributeName = @"YYTextHighlight"; -NSString *const YYTextGlyphTransformAttributeName = @"YYTextGlyphTransform"; - -NSString *const YYTextAttachmentToken = @"\uFFFC"; -NSString *const YYTextTruncationToken = @"\u2026"; - - -YYTextAttributeType YYTextAttributeGetType(NSString *name){ - if (name.length == 0) return YYTextAttributeTypeNone; - - static NSMutableDictionary *dic; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - dic = [NSMutableDictionary new]; - NSNumber *All = @(YYTextAttributeTypeUIKit | YYTextAttributeTypeCoreText | YYTextAttributeTypeYYText); - NSNumber *CoreText_YYText = @(YYTextAttributeTypeCoreText | YYTextAttributeTypeYYText); - NSNumber *UIKit_YYText = @(YYTextAttributeTypeUIKit | YYTextAttributeTypeYYText); - NSNumber *UIKit_CoreText = @(YYTextAttributeTypeUIKit | YYTextAttributeTypeCoreText); - NSNumber *UIKit = @(YYTextAttributeTypeUIKit); - NSNumber *CoreText = @(YYTextAttributeTypeCoreText); - NSNumber *YYText = @(YYTextAttributeTypeYYText); - - dic[NSFontAttributeName] = All; - dic[NSKernAttributeName] = All; - dic[NSForegroundColorAttributeName] = UIKit; - dic[(id)kCTForegroundColorAttributeName] = CoreText; - dic[(id)kCTForegroundColorFromContextAttributeName] = CoreText; - dic[NSBackgroundColorAttributeName] = UIKit; - dic[NSStrokeWidthAttributeName] = All; - dic[NSStrokeColorAttributeName] = UIKit; - dic[(id)kCTStrokeColorAttributeName] = CoreText_YYText; - dic[NSShadowAttributeName] = UIKit_YYText; - dic[NSStrikethroughStyleAttributeName] = UIKit; - dic[NSUnderlineStyleAttributeName] = UIKit_CoreText; - dic[(id)kCTUnderlineColorAttributeName] = CoreText; - dic[NSLigatureAttributeName] = All; - dic[(id)kCTSuperscriptAttributeName] = UIKit; //it's a CoreText attrubite, but only supported by UIKit... - dic[NSVerticalGlyphFormAttributeName] = All; - dic[(id)kCTGlyphInfoAttributeName] = CoreText_YYText; - dic[(id)kCTCharacterShapeAttributeName] = CoreText_YYText; - dic[(id)kCTRunDelegateAttributeName] = CoreText_YYText; - dic[(id)kCTBaselineClassAttributeName] = CoreText_YYText; - dic[(id)kCTBaselineInfoAttributeName] = CoreText_YYText; - dic[(id)kCTBaselineReferenceInfoAttributeName] = CoreText_YYText; - dic[(id)kCTWritingDirectionAttributeName] = CoreText_YYText; - dic[NSParagraphStyleAttributeName] = All; - - if (_YYDeviceSystemVersion() >= 7) { - dic[NSStrikethroughColorAttributeName] = UIKit; - dic[NSUnderlineColorAttributeName] = UIKit; - dic[NSTextEffectAttributeName] = UIKit; - dic[NSObliquenessAttributeName] = UIKit; - dic[NSExpansionAttributeName] = UIKit; - dic[(id)kCTLanguageAttributeName] = CoreText_YYText; - dic[NSBaselineOffsetAttributeName] = UIKit; - dic[NSWritingDirectionAttributeName] = All; - dic[NSAttachmentAttributeName] = UIKit; - dic[NSLinkAttributeName] = UIKit; - } - if (_YYDeviceSystemVersion() >= 8) { - dic[(id)kCTRubyAnnotationAttributeName] = CoreText; - } - - dic[YYTextBackedStringAttributeName] = YYText; - dic[YYTextBindingAttributeName] = YYText; - dic[YYTextShadowAttributeName] = YYText; - dic[YYTextInnerShadowAttributeName] = YYText; - dic[YYTextUnderlineAttributeName] = YYText; - dic[YYTextStrikethroughAttributeName] = YYText; - dic[YYTextBorderAttributeName] = YYText; - dic[YYTextBackgroundBorderAttributeName] = YYText; - dic[YYTextBlockBorderAttributeName] = YYText; - dic[YYTextAttachmentAttributeName] = YYText; - dic[YYTextHighlightAttributeName] = YYText; - dic[YYTextGlyphTransformAttributeName] = YYText; - }); - NSNumber *num = dic[name]; - if (num) return num.integerValue; - return YYTextAttributeTypeNone; -} - - -@implementation YYTextBackedString - -+ (instancetype)stringWithString:(NSString *)string { - YYTextBackedString *one = [self new]; - one.string = string; - return one; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:self.string forKey:@"string"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - _string = [aDecoder decodeObjectForKey:@"string"]; - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - typeof(self) one = [self.class new]; - one.string = self.string; - return one; -} - -@end - - -@implementation YYTextBinding - -+ (instancetype)bindingWithDeleteConfirm:(BOOL)deleteConfirm { - YYTextBinding *one = [self new]; - one.deleteConfirm = deleteConfirm; - return one; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:@(self.deleteConfirm) forKey:@"deleteConfirm"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - _deleteConfirm = ((NSNumber *)[aDecoder decodeObjectForKey:@"deleteConfirm"]).boolValue; - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - typeof(self) one = [self.class new]; - one.deleteConfirm = self.deleteConfirm; - return one; -} - -@end - - -@implementation YYTextShadow - -+ (instancetype)shadowWithColor:(UIColor *)color offset:(CGSize)offset radius:(CGFloat)radius { - YYTextShadow *one = [self new]; - one.color = color; - one.offset = offset; - one.radius = radius; - return one; -} - -+ (instancetype)shadowWithNSShadow:(NSShadow *)nsShadow { - if (!nsShadow) return nil; - YYTextShadow *shadow = [self new]; - shadow.offset = nsShadow.shadowOffset; - shadow.radius = nsShadow.shadowBlurRadius; - id color = nsShadow.shadowColor; - if (color) { - if (CGColorGetTypeID() == CFGetTypeID((__bridge CFTypeRef)(color))) { - color = [UIColor colorWithCGColor:(__bridge CGColorRef)(color)]; - } - if ([color isKindOfClass:[UIColor class]]) { - shadow.color = color; - } - } - return shadow; -} - -- (NSShadow *)nsShadow { - NSShadow *shadow = [NSShadow new]; - shadow.shadowOffset = self.offset; - shadow.shadowBlurRadius = self.radius; - shadow.shadowColor = self.color; - return shadow; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:self.color forKey:@"color"]; - [aCoder encodeObject:@(self.radius) forKey:@"radius"]; - [aCoder encodeObject:[NSValue valueWithCGSize:self.offset] forKey:@"offset"]; - [aCoder encodeObject:self.subShadow forKey:@"subShadow"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - _color = [aDecoder decodeObjectForKey:@"color"]; - _radius = ((NSNumber *)[aDecoder decodeObjectForKey:@"radius"]).floatValue; - _offset = ((NSValue *)[aDecoder decodeObjectForKey:@"offset"]).CGSizeValue; - _subShadow = [aDecoder decodeObjectForKey:@"subShadow"]; - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - typeof(self) one = [self.class new]; - one.color = self.color; - one.radius = self.radius; - one.offset = self.offset; - one.subShadow = self.subShadow.copy; - return one; -} - -@end - - -@implementation YYTextDecoration - -- (instancetype)init { - self = [super init]; - _style = YYTextLineStyleSingle; - return self; -} - -+ (instancetype)decorationWithStyle:(YYTextLineStyle)style { - YYTextDecoration *one = [self new]; - one.style = style; - return one; -} -+ (instancetype)decorationWithStyle:(YYTextLineStyle)style width:(NSNumber *)width color:(UIColor *)color { - YYTextDecoration *one = [self new]; - one.style = style; - one.width = width; - one.color = color; - return one; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:@(self.style) forKey:@"style"]; - [aCoder encodeObject:self.width forKey:@"width"]; - [aCoder encodeObject:self.color forKey:@"color"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - self.style = ((NSNumber *)[aDecoder decodeObjectForKey:@"style"]).unsignedIntegerValue; - self.width = [aDecoder decodeObjectForKey:@"width"]; - self.color = [aDecoder decodeObjectForKey:@"color"]; - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - typeof(self) one = [self.class new]; - one.style = self.style; - one.width = self.width; - one.color = self.color; - return one; -} - -@end - - -@implementation YYTextBorder - -+ (instancetype)borderWithLineStyle:(YYTextLineStyle)lineStyle lineWidth:(CGFloat)width strokeColor:(UIColor *)color { - YYTextBorder *one = [self new]; - one.lineStyle = lineStyle; - one.strokeWidth = width; - one.strokeColor = color; - return one; -} - -+ (instancetype)borderWithFillColor:(UIColor *)color cornerRadius:(CGFloat)cornerRadius { - YYTextBorder *one = [self new]; - one.fillColor = color; - one.cornerRadius = cornerRadius; - one.insets = UIEdgeInsetsMake(-2, 0, 0, -2); - return one; -} - -- (instancetype)init { - self = [super init]; - self.lineStyle = YYTextLineStyleSingle; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:@(self.lineStyle) forKey:@"lineStyle"]; - [aCoder encodeObject:@(self.strokeWidth) forKey:@"strokeWidth"]; - [aCoder encodeObject:self.strokeColor forKey:@"strokeColor"]; - [aCoder encodeObject:@(self.lineJoin) forKey:@"lineJoin"]; - [aCoder encodeObject:[NSValue valueWithUIEdgeInsets:self.insets] forKey:@"insets"]; - [aCoder encodeObject:@(self.cornerRadius) forKey:@"cornerRadius"]; - [aCoder encodeObject:self.shadow forKey:@"shadow"]; - [aCoder encodeObject:self.fillColor forKey:@"fillColor"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - _lineStyle = ((NSNumber *)[aDecoder decodeObjectForKey:@"lineStyle"]).unsignedIntegerValue; - _strokeWidth = ((NSNumber *)[aDecoder decodeObjectForKey:@"strokeWidth"]).doubleValue; - _strokeColor = [aDecoder decodeObjectForKey:@"strokeColor"]; - _lineJoin = (CGLineJoin)((NSNumber *)[aDecoder decodeObjectForKey:@"join"]).unsignedIntegerValue; - _insets = ((NSValue *)[aDecoder decodeObjectForKey:@"insets"]).UIEdgeInsetsValue; - _cornerRadius = ((NSNumber *)[aDecoder decodeObjectForKey:@"cornerRadius"]).doubleValue; - _shadow = [aDecoder decodeObjectForKey:@"shadow"]; - _fillColor = [aDecoder decodeObjectForKey:@"fillColor"]; - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - typeof(self) one = [self.class new]; - one.lineStyle = self.lineStyle; - one.strokeWidth = self.strokeWidth; - one.strokeColor = self.strokeColor; - one.lineJoin = self.lineJoin; - one.insets = self.insets; - one.cornerRadius = self.cornerRadius; - one.shadow = self.shadow.copy; - one.fillColor = self.fillColor; - return one; -} - -@end - - -@implementation YYTextAttachment - -+ (instancetype)attachmentWithContent:(id)content { - YYTextAttachment *one = [self new]; - one.content = content; - return one; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:self.content forKey:@"content"]; - [aCoder encodeObject:[NSValue valueWithUIEdgeInsets:self.contentInsets] forKey:@"contentInsets"]; - [aCoder encodeObject:self.userInfo forKey:@"userInfo"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - _content = [aDecoder decodeObjectForKey:@"content"]; - _contentInsets = ((NSValue *)[aDecoder decodeObjectForKey:@"contentInsets"]).UIEdgeInsetsValue; - _userInfo = [aDecoder decodeObjectForKey:@"userInfo"]; - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - typeof(self) one = [self.class new]; - if ([self.content respondsToSelector:@selector(copy)]) { - one.content = [self.content copy]; - } else { - one.content = self.content; - } - one.contentInsets = self.contentInsets; - one.userInfo = self.userInfo.copy; - return one; -} - -@end - - -@implementation YYTextHighlight - -+ (instancetype)highlightWithAttributes:(NSDictionary *)attributes { - YYTextHighlight *one = [self new]; - one.attributes = attributes; - return one; -} - -+ (instancetype)highlightWithBackgroundColor:(UIColor *)color { - YYTextBorder *highlightBorder = [YYTextBorder new]; - highlightBorder.insets = UIEdgeInsetsMake(-2, -1, -2, -1); - highlightBorder.cornerRadius = 3; - highlightBorder.fillColor = color; - - YYTextHighlight *one = [self new]; - [one setBackgroundBorder:highlightBorder]; - return one; -} - -- (void)setAttributes:(NSDictionary *)attributes { - _attributes = attributes.mutableCopy; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - NSData *data = nil; - @try { - data = [YYTextArchiver archivedDataWithRootObject:self.attributes]; - } - @catch (NSException *exception) { - NSLog(@"%@",exception); - } - [aCoder encodeObject:data forKey:@"attributes"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - NSData *data = [aDecoder decodeObjectForKey:@"attributes"]; - @try { - _attributes = [YYTextUnarchiver unarchiveObjectWithData:data]; - } - @catch (NSException *exception) { - NSLog(@"%@",exception); - } - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - typeof(self) one = [self.class new]; - one.attributes = self.attributes.mutableCopy; - return one; -} - -- (void)_makeMutableAttributes { - if (!_attributes) { - _attributes = [NSMutableDictionary new]; - } else if (![_attributes isKindOfClass:[NSMutableDictionary class]]) { - _attributes = _attributes.mutableCopy; - } -} - -- (void)setFont:(UIFont *)font { - [self _makeMutableAttributes]; - if (font == (id)[NSNull null] || font == nil) { - ((NSMutableDictionary *)_attributes)[(id)kCTFontAttributeName] = [NSNull null]; - } else { - CTFontRef ctFont = CTFontCreateWithName((__bridge CFStringRef)font.fontName, font.pointSize, NULL); - if (ctFont) { - ((NSMutableDictionary *)_attributes)[(id)kCTFontAttributeName] = (__bridge id)(ctFont); - CFRelease(ctFont); - } - } -} - -- (void)setColor:(UIColor *)color { - [self _makeMutableAttributes]; - if (color == (id)[NSNull null] || color == nil) { - ((NSMutableDictionary *)_attributes)[(id)kCTForegroundColorAttributeName] = [NSNull null]; - ((NSMutableDictionary *)_attributes)[NSForegroundColorAttributeName] = [NSNull null]; - } else { - ((NSMutableDictionary *)_attributes)[(id)kCTForegroundColorAttributeName] = (__bridge id)(color.CGColor); - ((NSMutableDictionary *)_attributes)[NSForegroundColorAttributeName] = color; - } -} - -- (void)setStrokeWidth:(NSNumber *)width { - [self _makeMutableAttributes]; - if (width == (id)[NSNull null] || width == nil) { - ((NSMutableDictionary *)_attributes)[(id)kCTStrokeWidthAttributeName] = [NSNull null]; - } else { - ((NSMutableDictionary *)_attributes)[(id)kCTStrokeWidthAttributeName] = width; - } -} - -- (void)setStrokeColor:(UIColor *)color { - [self _makeMutableAttributes]; - if (color == (id)[NSNull null] || color == nil) { - ((NSMutableDictionary *)_attributes)[(id)kCTStrokeColorAttributeName] = [NSNull null]; - ((NSMutableDictionary *)_attributes)[NSStrokeColorAttributeName] = [NSNull null]; - } else { - ((NSMutableDictionary *)_attributes)[(id)kCTStrokeColorAttributeName] = (__bridge id)(color.CGColor); - ((NSMutableDictionary *)_attributes)[NSStrokeColorAttributeName] = color; - } -} - -- (void)setTextAttribute:(NSString *)attribute value:(id)value { - [self _makeMutableAttributes]; - if (value == nil) value = [NSNull null]; - ((NSMutableDictionary *)_attributes)[attribute] = value; -} - -- (void)setShadow:(YYTextShadow *)shadow { - [self setTextAttribute:YYTextShadowAttributeName value:shadow]; -} - -- (void)setInnerShadow:(YYTextShadow *)shadow { - [self setTextAttribute:YYTextInnerShadowAttributeName value:shadow]; -} - -- (void)setUnderline:(YYTextDecoration *)underline { - [self setTextAttribute:YYTextUnderlineAttributeName value:underline]; -} - -- (void)setStrikethrough:(YYTextDecoration *)strikethrough { - [self setTextAttribute:YYTextStrikethroughAttributeName value:strikethrough]; -} - -- (void)setBackgroundBorder:(YYTextBorder *)border { - [self setTextAttribute:YYTextBackgroundBorderAttributeName value:border]; -} - -- (void)setBorder:(YYTextBorder *)border { - [self setTextAttribute:YYTextBorderAttributeName value:border]; -} - -- (void)setAttachment:(YYTextAttachment *)attachment { - [self setTextAttribute:YYTextAttachmentAttributeName value:attachment]; -} - -@end - diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextParser.h b/iOSProject/Pods/YYText/YYText/String/YYTextParser.h deleted file mode 100644 index 111064ba..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextParser.h +++ /dev/null @@ -1,91 +0,0 @@ -// -// YYTextParser.h -// YYText -// -// Created by ibireme on 15/3/6. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - The YYTextParser protocol declares the required method for YYTextView and YYLabel - to modify the text during editing. - - You can implement this protocol to add code highlighting or emoticon replacement for - YYTextView and YYLabel. See `YYTextSimpleMarkdownParser` and `YYTextSimpleEmoticonParser` for example. - */ -@protocol YYTextParser -@required -/** - When text is changed in YYTextView or YYLabel, this method will be called. - - @param text The original attributed string. This method may parse the text and - change the text attributes or content. - - @param selectedRange Current selected range in `text`. - This method should correct the range if the text content is changed. If there's - no selected range (such as YYLabel), this value is NULL. - - @return If the 'text' is modified in this method, returns `YES`, otherwise returns `NO`. - */ -- (BOOL)parseText:(nullable NSMutableAttributedString *)text selectedRange:(nullable NSRangePointer)selectedRange; -@end - - - -/** - A simple markdown parser. - - It'a very simple markdown parser, you can use this parser to highlight some - small piece of markdown text. - - This markdown parser use regular expression to parse text, slow and weak. - If you want to write a better parser, try these projests: - https://github.com/NimbusKit/markdown - https://github.com/dreamwieber/AttributedMarkdown - https://github.com/indragiek/CocoaMarkdown - - Or you can use lex/yacc to generate your custom parser. - */ -@interface YYTextSimpleMarkdownParser : NSObject -@property (nonatomic) CGFloat fontSize; ///< default is 14 -@property (nonatomic) CGFloat headerFontSize; ///< default is 20 - -@property (nullable, nonatomic, strong) UIColor *textColor; -@property (nullable, nonatomic, strong) UIColor *controlTextColor; -@property (nullable, nonatomic, strong) UIColor *headerTextColor; -@property (nullable, nonatomic, strong) UIColor *inlineTextColor; -@property (nullable, nonatomic, strong) UIColor *codeTextColor; -@property (nullable, nonatomic, strong) UIColor *linkTextColor; - -- (void)setColorWithBrightTheme; ///< reset the color properties to pre-defined value. -- (void)setColorWithDarkTheme; ///< reset the color properties to pre-defined value. -@end - - - -/** - A simple emoticon parser. - - Use this parser to map some specified piece of string to image emoticon. - Example: "Hello :smile:" -> "Hello 😀" - - It can also be used to extend the "unicode emoticon". - */ -@interface YYTextSimpleEmoticonParser : NSObject - -/** - The custom emoticon mapper. - The key is a specified plain string, such as @":smile:". - The value is a UIImage which will replace the specified plain string in text. - */ -@property (nullable, copy) NSDictionary *emoticonMapper; -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextParser.m b/iOSProject/Pods/YYText/YYText/String/YYTextParser.m deleted file mode 100644 index 9455532b..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextParser.m +++ /dev/null @@ -1,417 +0,0 @@ -// -// YYTextParser.m -// YYText -// -// Created by ibireme on 15/3/6. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextParser.h" -#import "YYTextUtilities.h" -#import "YYTextAttribute.h" -#import "NSAttributedString+YYText.h" -#import "NSParagraphStyle+YYText.h" - - -#pragma mark - Markdown Parser - -@implementation YYTextSimpleMarkdownParser { - UIFont *_font; - NSMutableArray *_headerFonts; ///< h1~h6 - UIFont *_boldFont; - UIFont *_italicFont; - UIFont *_boldItalicFont; - UIFont *_monospaceFont; - YYTextBorder *_border; - - NSRegularExpression *_regexEscape; ///< escape - NSRegularExpression *_regexHeader; ///< #header - NSRegularExpression *_regexH1; ///< header\n==== - NSRegularExpression *_regexH2; ///< header\n---- - NSRegularExpression *_regexBreakline; ///< ****** - NSRegularExpression *_regexEmphasis; ///< *text* _text_ - NSRegularExpression *_regexStrong; ///< **text** - NSRegularExpression *_regexStrongEmphasis; ///< ***text*** ___text___ - NSRegularExpression *_regexUnderline; ///< __text__ - NSRegularExpression *_regexStrikethrough; ///< ~~text~~ - NSRegularExpression *_regexInlineCode; ///< `text` - NSRegularExpression *_regexLink; ///< [name](link) - NSRegularExpression *_regexLinkRefer; ///< [ref]: - NSRegularExpression *_regexList; ///< 1.text 2.text 3.text - NSRegularExpression *_regexBlockQuote; ///< > quote - NSRegularExpression *_regexCodeBlock; ///< \tcode \tcode - NSRegularExpression *_regexNotEmptyLine; -} - -- (void)initRegex { -#define regexp(reg, option) [NSRegularExpression regularExpressionWithPattern : @reg options : option error : NULL] - _regexEscape = regexp("(\\\\\\\\|\\\\\\`|\\\\\\*|\\\\\\_|\\\\\\(|\\\\\\)|\\\\\\[|\\\\\\]|\\\\#|\\\\\\+|\\\\\\-|\\\\\\!)", 0); - _regexHeader = regexp("^((\\#{1,6}[^#].*)|(\\#{6}.+))$", NSRegularExpressionAnchorsMatchLines); - _regexH1 = regexp("^[^=\\n][^\\n]*\\n=+$", NSRegularExpressionAnchorsMatchLines); - _regexH2 = regexp("^[^-\\n][^\\n]*\\n-+$", NSRegularExpressionAnchorsMatchLines); - _regexBreakline = regexp("^[ \\t]*([*-])[ \\t]*((\\1)[ \\t]*){2,}[ \\t]*$", NSRegularExpressionAnchorsMatchLines); - _regexEmphasis = regexp("((?[ \\t>]*", NSRegularExpressionAnchorsMatchLines); - _regexCodeBlock = regexp("(^\\s*$\\n)((( {4}|\\t).*(\\n|\\z))|(^\\s*$\\n))+", NSRegularExpressionAnchorsMatchLines); - _regexNotEmptyLine = regexp("^[ \\t]*[^ \\t]+[ \\t]*$", NSRegularExpressionAnchorsMatchLines); -#undef regexp -} - -- (instancetype)init { - self = [super init]; - _fontSize = 14; - _headerFontSize = 20; - [self _updateFonts]; - [self setColorWithBrightTheme]; - [self initRegex]; - return self; -} - -- (void)setFontSize:(CGFloat)fontSize { - if (fontSize < 1) fontSize = 12; - _fontSize = fontSize; - [self _updateFonts]; -} - -- (void)setHeaderFontSize:(CGFloat)headerFontSize { - if (headerFontSize < 1) headerFontSize = 20; - _headerFontSize = headerFontSize; - [self _updateFonts]; -} - -- (void)_updateFonts { - _font = [UIFont systemFontOfSize:_fontSize]; - _headerFonts = [NSMutableArray new]; - for (int i = 0; i < 6; i++) { - CGFloat size = _headerFontSize - (_headerFontSize - _fontSize) / 5.0 * i; - [_headerFonts addObject:[UIFont systemFontOfSize:size]]; - } - _boldFont = YYTextFontWithBold(_font); - _italicFont = YYTextFontWithItalic(_font); - _boldItalicFont = YYTextFontWithBoldItalic(_font); - _monospaceFont = [UIFont fontWithName:@"Menlo" size:_fontSize]; // Since iOS 7 - if (!_monospaceFont) _monospaceFont = [UIFont fontWithName:@"Courier" size:_fontSize]; // Since iOS 3 -} - -- (void)setColorWithBrightTheme { - _textColor = [UIColor blackColor]; - _controlTextColor = [UIColor colorWithWhite:0.749 alpha:1.000]; - _headerTextColor = [UIColor colorWithRed:1.000 green:0.502 blue:0.000 alpha:1.000]; - _inlineTextColor = [UIColor colorWithWhite:0.150 alpha:1.000]; - _codeTextColor = [UIColor colorWithWhite:0.150 alpha:1.000]; - _linkTextColor = [UIColor colorWithRed:0.000 green:0.478 blue:0.962 alpha:1.000]; - - _border = [YYTextBorder new]; - _border.lineStyle = YYTextLineStyleSingle; - _border.fillColor = [UIColor colorWithWhite:0.184 alpha:0.090]; - _border.strokeColor = [UIColor colorWithWhite:0.546 alpha:0.650]; - _border.insets = UIEdgeInsetsMake(-1, 0, -1, 0); - _border.cornerRadius = 2; - _border.strokeWidth = YYTextCGFloatFromPixel(1); -} - -- (void)setColorWithDarkTheme { - _textColor = [UIColor whiteColor]; - _controlTextColor = [UIColor colorWithWhite:0.604 alpha:1.000]; - _headerTextColor = [UIColor colorWithRed:0.558 green:1.000 blue:0.502 alpha:1.000]; - _inlineTextColor = [UIColor colorWithRed:1.000 green:0.862 blue:0.387 alpha:1.000]; - _codeTextColor = [UIColor colorWithWhite:0.906 alpha:1.000]; - _linkTextColor = [UIColor colorWithRed:0.000 green:0.646 blue:1.000 alpha:1.000]; - - _border = [YYTextBorder new]; - _border.lineStyle = YYTextLineStyleSingle; - _border.fillColor = [UIColor colorWithWhite:0.820 alpha:0.130]; - _border.strokeColor = [UIColor colorWithWhite:1.000 alpha:0.280]; - _border.insets = UIEdgeInsetsMake(-1, 0, -1, 0); - _border.cornerRadius = 2; - _border.strokeWidth = YYTextCGFloatFromPixel(1); -} - -- (NSUInteger)lenghOfBeginWhiteInString:(NSString *)str withRange:(NSRange)range{ - for (NSUInteger i = 0; i < range.length; i++) { - unichar c = [str characterAtIndex:i + range.location]; - if (c != ' ' && c != '\t' && c != '\n') return i; - } - return str.length; -} - -- (NSUInteger)lenghOfEndWhiteInString:(NSString *)str withRange:(NSRange)range{ - for (NSInteger i = range.length - 1; i >= 0; i--) { - unichar c = [str characterAtIndex:i + range.location]; - if (c != ' ' && c != '\t' && c != '\n') return range.length - i; - } - return str.length; -} - -- (NSUInteger)lenghOfBeginChar:(unichar)c inString:(NSString *)str withRange:(NSRange)range{ - for (NSUInteger i = 0; i < range.length; i++) { - if ([str characterAtIndex:i + range.location] != c) return i; - } - return str.length; -} - -- (BOOL)parseText:(NSMutableAttributedString *)text selectedRange:(NSRangePointer)range { - if (text.length == 0) return NO; - [text yy_removeAttributesInRange:NSMakeRange(0, text.length)]; - text.yy_font = _font; - text.yy_color = _textColor; - - NSMutableString *str = text.string.mutableCopy; - [_regexEscape replaceMatchesInString:str options:kNilOptions range:NSMakeRange(0, str.length) withTemplate:@"@@"]; - - [_regexHeader enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - NSUInteger whiteLen = [self lenghOfBeginWhiteInString:str withRange:r]; - NSUInteger sharpLen = [self lenghOfBeginChar:'#' inString:str withRange:NSMakeRange(r.location + whiteLen, r.length - whiteLen)]; - if (sharpLen > 6) sharpLen = 6; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location, whiteLen + sharpLen)]; - [text yy_setColor:_headerTextColor range:NSMakeRange(r.location + whiteLen + sharpLen, r.length - whiteLen - sharpLen)]; - [text yy_setFont:_headerFonts[sharpLen - 1] range:result.range]; - }]; - - [_regexH1 enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - NSRange linebreak = [str rangeOfString:@"\n" options:0 range:result.range locale:nil]; - if (linebreak.location != NSNotFound) { - [text yy_setColor:_headerTextColor range:NSMakeRange(r.location, linebreak.location - r.location)]; - [text yy_setFont:_headerFonts[0] range:NSMakeRange(r.location, linebreak.location - r.location + 1)]; - [text yy_setColor:_controlTextColor range:NSMakeRange(linebreak.location + linebreak.length, r.location + r.length - linebreak.location - linebreak.length)]; - } - }]; - - [_regexH2 enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - NSRange linebreak = [str rangeOfString:@"\n" options:0 range:result.range locale:nil]; - if (linebreak.location != NSNotFound) { - [text yy_setColor:_headerTextColor range:NSMakeRange(r.location, linebreak.location - r.location)]; - [text yy_setFont:_headerFonts[1] range:NSMakeRange(r.location, linebreak.location - r.location + 1)]; - [text yy_setColor:_controlTextColor range:NSMakeRange(linebreak.location + linebreak.length, r.location + r.length - linebreak.location - linebreak.length)]; - } - }]; - - [_regexBreakline enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - [text yy_setColor:_controlTextColor range:result.range]; - }]; - - [_regexEmphasis enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location, 1)]; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location + r.length - 1, 1)]; - [text yy_setFont:_italicFont range:NSMakeRange(r.location + 1, r.length - 2)]; - }]; - - [_regexStrong enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location, 2)]; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location + r.length - 2, 2)]; - [text yy_setFont:_boldFont range:NSMakeRange(r.location + 2, r.length - 4)]; - }]; - - [_regexStrongEmphasis enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location, 3)]; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location + r.length - 3, 3)]; - [text yy_setFont:_boldItalicFont range:NSMakeRange(r.location + 3, r.length - 6)]; - }]; - - [_regexUnderline enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location, 2)]; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location + r.length - 2, 2)]; - [text yy_setTextUnderline:[YYTextDecoration decorationWithStyle:YYTextLineStyleSingle width:@1 color:nil] range:NSMakeRange(r.location + 2, r.length - 4)]; - }]; - - [_regexStrikethrough enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location, 2)]; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location + r.length - 2, 2)]; - [text yy_setTextStrikethrough:[YYTextDecoration decorationWithStyle:YYTextLineStyleSingle width:@1 color:nil] range:NSMakeRange(r.location + 2, r.length - 4)]; - }]; - - [_regexInlineCode enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - NSUInteger len = [self lenghOfBeginChar:'`' inString:str withRange:r]; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location, len)]; - [text yy_setColor:_controlTextColor range:NSMakeRange(r.location + r.length - len, len)]; - [text yy_setColor:_inlineTextColor range:NSMakeRange(r.location + len, r.length - 2 * len)]; - [text yy_setFont:_monospaceFont range:r]; - [text yy_setTextBorder:_border.copy range:r]; - }]; - - [_regexLink enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_linkTextColor range:r]; - }]; - - [_regexLinkRefer enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_controlTextColor range:r]; - }]; - - [_regexList enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_controlTextColor range:r]; - }]; - - [_regexBlockQuote enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - [text yy_setColor:_controlTextColor range:r]; - }]; - - [_regexCodeBlock enumerateMatchesInString:str options:0 range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - NSRange r = result.range; - NSRange firstLineRange = [_regexNotEmptyLine rangeOfFirstMatchInString:str options:kNilOptions range:r]; - NSUInteger lenStart = (firstLineRange.location != NSNotFound) ? firstLineRange.location - r.location : 0; - NSUInteger lenEnd = [self lenghOfEndWhiteInString:str withRange:r]; - if (lenStart + lenEnd < r.length) { - NSRange codeR = NSMakeRange(r.location + lenStart, r.length - lenStart - lenEnd); - [text yy_setColor:_codeTextColor range:codeR]; - [text yy_setFont:_monospaceFont range:codeR]; - YYTextBorder *border = [YYTextBorder new]; - border.lineStyle = YYTextLineStyleSingle; - border.fillColor = [UIColor colorWithWhite:0.184 alpha:0.090]; - border.strokeColor = [UIColor colorWithWhite:0.200 alpha:0.300]; - border.insets = UIEdgeInsetsMake(-1, 0, -1, 0); - border.cornerRadius = 3; - border.strokeWidth = YYTextCGFloatFromPixel(2); - [text yy_setTextBlockBorder:_border.copy range:codeR]; - } - }]; - - return YES; -} - - -@end - - - -#pragma mark - Emoticon Parser - -#define LOCK(...) dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); \ -__VA_ARGS__; \ -dispatch_semaphore_signal(_lock); - -@implementation YYTextSimpleEmoticonParser { - NSRegularExpression *_regex; - NSDictionary *_mapper; - dispatch_semaphore_t _lock; -} - -- (instancetype)init { - self = [super init]; - _lock = dispatch_semaphore_create(1); - return self; -} - -- (NSDictionary *)emoticonMapper { - LOCK(NSDictionary *mapper = _mapper); return mapper; -} - -- (void)setEmoticonMapper:(NSDictionary *)emoticonMapper { - LOCK( - _mapper = emoticonMapper.copy; - if (_mapper.count == 0) { - _regex = nil; - } else { - NSMutableString *pattern = @"(".mutableCopy; - NSArray *allKeys = _mapper.allKeys; - NSCharacterSet *charset = [NSCharacterSet characterSetWithCharactersInString:@"$^?+*.,#|{}[]()\\"]; - for (NSUInteger i = 0, max = allKeys.count; i < max; i++) { - NSMutableString *one = [allKeys[i] mutableCopy]; - - // escape regex characters - for (NSUInteger ci = 0, cmax = one.length; ci < cmax; ci++) { - unichar c = [one characterAtIndex:ci]; - if ([charset characterIsMember:c]) { - [one insertString:@"\\" atIndex:ci]; - ci++; - cmax++; - } - } - - [pattern appendString:one]; - if (i != max - 1) [pattern appendString:@"|"]; - } - [pattern appendString:@")"]; - _regex = [[NSRegularExpression alloc] initWithPattern:pattern options:kNilOptions error:nil]; - } - ); -} - -// correct the selected range during text replacement -- (NSRange)_replaceTextInRange:(NSRange)range withLength:(NSUInteger)length selectedRange:(NSRange)selectedRange { - // no change - if (range.length == length) return selectedRange; - // right - if (range.location >= selectedRange.location + selectedRange.length) return selectedRange; - // left - if (selectedRange.location >= range.location + range.length) { - selectedRange.location = selectedRange.location + length - range.length; - return selectedRange; - } - // same - if (NSEqualRanges(range, selectedRange)) { - selectedRange.length = length; - return selectedRange; - } - // one edge same - if ((range.location == selectedRange.location && range.length < selectedRange.length) || - (range.location + range.length == selectedRange.location + selectedRange.length && range.length < selectedRange.length)) { - selectedRange.length = selectedRange.length + length - range.length; - return selectedRange; - } - selectedRange.location = range.location + length; - selectedRange.length = 0; - return selectedRange; -} - -- (BOOL)parseText:(NSMutableAttributedString *)text selectedRange:(NSRangePointer)range { - if (text.length == 0) return NO; - - NSDictionary *mapper; - NSRegularExpression *regex; - LOCK(mapper = _mapper; regex = _regex;); - if (mapper.count == 0 || regex == nil) return NO; - - NSArray *matches = [regex matchesInString:text.string options:kNilOptions range:NSMakeRange(0, text.length)]; - if (matches.count == 0) return NO; - - NSRange selectedRange = range ? *range : NSMakeRange(0, 0); - NSUInteger cutLength = 0; - for (NSUInteger i = 0, max = matches.count; i < max; i++) { - NSTextCheckingResult *one = matches[i]; - NSRange oneRange = one.range; - if (oneRange.length == 0) continue; - oneRange.location -= cutLength; - NSString *subStr = [text.string substringWithRange:oneRange]; - UIImage *emoticon = mapper[subStr]; - if (!emoticon) continue; - - CGFloat fontSize = 12; // CoreText default value - CTFontRef font = (__bridge CTFontRef)([text yy_attribute:NSFontAttributeName atIndex:oneRange.location]); - if (font) fontSize = CTFontGetSize(font); - NSMutableAttributedString *atr = [NSAttributedString yy_attachmentStringWithEmojiImage:emoticon fontSize:fontSize]; - [atr yy_setTextBackedString:[YYTextBackedString stringWithString:subStr] range:NSMakeRange(0, atr.length)]; - [text replaceCharactersInRange:oneRange withString:atr.string]; - [text yy_removeDiscontinuousAttributesInRange:NSMakeRange(oneRange.location, atr.length)]; - [text addAttributes:atr.yy_attributes range:NSMakeRange(oneRange.location, atr.length)]; - selectedRange = [self _replaceTextInRange:oneRange withLength:atr.length selectedRange:selectedRange]; - cutLength += oneRange.length - 1; - } - if (range) *range = selectedRange; - - return YES; -} -@end diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextRubyAnnotation.h b/iOSProject/Pods/YYText/YYText/String/YYTextRubyAnnotation.h deleted file mode 100644 index 1a138433..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextRubyAnnotation.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// YYTextRubyAnnotation.h -// YYText -// -// Created by ibireme on 15/4/24. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Wrapper for CTRubyAnnotationRef. - - Example: - - YYTextRubyAnnotation *ruby = [YYTextRubyAnnotation new]; - ruby.textBefore = @"zhù yīn"; - CTRubyAnnotationRef ctRuby = ruby.CTRubyAnnotation; - if (ctRuby) { - /// add to attributed string - CFRelease(ctRuby); - } - - */ -@interface YYTextRubyAnnotation : NSObject - -/// Specifies how the ruby text and the base text should be aligned relative to each other. -@property (nonatomic) CTRubyAlignment alignment; - -/// Specifies how the ruby text can overhang adjacent characters. -@property (nonatomic) CTRubyOverhang overhang; - -/// Specifies the size of the annotation text as a percent of the size of the base text. -@property (nonatomic) CGFloat sizeFactor; - - -/// The ruby text is positioned before the base text; -/// i.e. above horizontal text and to the right of vertical text. -@property (nullable, nonatomic, copy) NSString *textBefore; - -/// The ruby text is positioned after the base text; -/// i.e. below horizontal text and to the left of vertical text. -@property (nullable, nonatomic, copy) NSString *textAfter; - -/// The ruby text is positioned to the right of the base text whether it is horizontal or vertical. -/// This is the way that Bopomofo annotations are attached to Chinese text in Taiwan. -@property (nullable, nonatomic, copy) NSString *textInterCharacter; - -/// The ruby text follows the base text with no special styling. -@property (nullable, nonatomic, copy) NSString *textInline; - - -/** - Create a ruby object from CTRuby object. - - @param ctRuby A CTRuby object. - - @return A ruby object, or nil when an error occurs. - */ -+ (instancetype)rubyWithCTRubyRef:(CTRubyAnnotationRef)ctRuby NS_AVAILABLE_IOS(8_0); - -/** - Create a CTRuby object from the instance. - - @return A new CTRuby object, or NULL when an error occurs. - The returned value should be release after used. - */ -- (nullable CTRubyAnnotationRef)CTRubyAnnotation CF_RETURNS_RETAINED NS_AVAILABLE_IOS(8_0); - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextRubyAnnotation.m b/iOSProject/Pods/YYText/YYText/String/YYTextRubyAnnotation.m deleted file mode 100644 index f4d356c3..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextRubyAnnotation.m +++ /dev/null @@ -1,83 +0,0 @@ -// -// YYTextRubyAnnotation.m -// YYText -// -// Created by ibireme on 15/4/24. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextRubyAnnotation.h" - -@implementation YYTextRubyAnnotation - -- (instancetype)init { - self = super.init; - self.alignment = kCTRubyAlignmentAuto; - self.overhang = kCTRubyOverhangAuto; - self.sizeFactor = 0.5; - return self; -} - -+ (instancetype)rubyWithCTRubyRef:(CTRubyAnnotationRef)ctRuby { - if (!ctRuby) return nil; - YYTextRubyAnnotation *one = [self new]; - one.alignment = CTRubyAnnotationGetAlignment(ctRuby); - one.overhang = CTRubyAnnotationGetOverhang(ctRuby); - one.sizeFactor = CTRubyAnnotationGetSizeFactor(ctRuby); - one.textBefore = (__bridge NSString *)(CTRubyAnnotationGetTextForPosition(ctRuby, kCTRubyPositionBefore)); - one.textAfter = (__bridge NSString *)(CTRubyAnnotationGetTextForPosition(ctRuby, kCTRubyPositionAfter)); - one.textInterCharacter = (__bridge NSString *)(CTRubyAnnotationGetTextForPosition(ctRuby, kCTRubyPositionInterCharacter)); - one.textInline = (__bridge NSString *)(CTRubyAnnotationGetTextForPosition(ctRuby, kCTRubyPositionInline)); - return one; -} - -- (CTRubyAnnotationRef)CTRubyAnnotation CF_RETURNS_RETAINED { - if (((long)CTRubyAnnotationCreate + 1) == 1) return NULL; // system not support - - CFStringRef text[kCTRubyPositionCount]; - text[kCTRubyPositionBefore] = (__bridge CFStringRef)(_textBefore); - text[kCTRubyPositionAfter] = (__bridge CFStringRef)(_textAfter); - text[kCTRubyPositionInterCharacter] = (__bridge CFStringRef)(_textInterCharacter); - text[kCTRubyPositionInline] = (__bridge CFStringRef)(_textInline); - CTRubyAnnotationRef ruby = CTRubyAnnotationCreate(_alignment, _overhang, _sizeFactor, text); - return ruby; -} - -- (id)copyWithZone:(NSZone *)zone { - YYTextRubyAnnotation *one = [self.class new]; - one.alignment = _alignment; - one.overhang = _overhang; - one.sizeFactor = _sizeFactor; - one.textBefore = _textBefore; - one.textAfter = _textAfter; - one.textInterCharacter = _textInterCharacter; - one.textInline = _textInline; - return one; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:@(_alignment) forKey:@"alignment"]; - [aCoder encodeObject:@(_overhang) forKey:@"overhang"]; - [aCoder encodeObject:@(_sizeFactor) forKey:@"sizeFactor"]; - [aCoder encodeObject:_textBefore forKey:@"textBefore"]; - [aCoder encodeObject:_textAfter forKey:@"textAfter"]; - [aCoder encodeObject:_textInterCharacter forKey:@"textInterCharacter"]; - [aCoder encodeObject:_textInline forKey:@"textInline"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [self init]; - _alignment = ((NSNumber *)[aDecoder decodeObjectForKey:@"alignment"]).intValue; - _overhang = ((NSNumber *)[aDecoder decodeObjectForKey:@"overhang"]).intValue; - _sizeFactor = ((NSNumber *)[aDecoder decodeObjectForKey:@"sizeFactor"]).intValue; - _textBefore = [aDecoder decodeObjectForKey:@"textBefore"]; - _textAfter = [aDecoder decodeObjectForKey:@"textAfter"]; - _textInterCharacter = [aDecoder decodeObjectForKey:@"textInterCharacter"]; - _textInline = [aDecoder decodeObjectForKey:@"textInline"]; - return self; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextRunDelegate.h b/iOSProject/Pods/YYText/YYText/String/YYTextRunDelegate.h deleted file mode 100644 index ac73b065..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextRunDelegate.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// YYTextRunDelegate.h -// YYText -// -// Created by ibireme on 14/10/14. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Wrapper for CTRunDelegateRef. - - Example: - - YYTextRunDelegate *delegate = [YYTextRunDelegate new]; - delegate.ascent = 20; - delegate.descent = 4; - delegate.width = 20; - CTRunDelegateRef ctRunDelegate = delegate.CTRunDelegate; - if (ctRunDelegate) { - /// add to attributed string - CFRelease(ctRunDelegate); - } - - */ -@interface YYTextRunDelegate : NSObject - -/** - Creates and returns the CTRunDelegate. - - @discussion You need call CFRelease() after used. - The CTRunDelegateRef has a strong reference to this YYTextRunDelegate object. - In CoreText, use CTRunDelegateGetRefCon() to get this YYTextRunDelegate object. - - @return The CTRunDelegate object. - */ -- (nullable CTRunDelegateRef)CTRunDelegate CF_RETURNS_RETAINED; - -/** - Additional information about the the run delegate. - */ -@property (nullable, nonatomic, strong) NSDictionary *userInfo; - -/** - The typographic ascent of glyphs in the run. - */ -@property (nonatomic) CGFloat ascent; - -/** - The typographic descent of glyphs in the run. - */ -@property (nonatomic) CGFloat descent; - -/** - The typographic width of glyphs in the run. - */ -@property (nonatomic) CGFloat width; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/String/YYTextRunDelegate.m b/iOSProject/Pods/YYText/YYText/String/YYTextRunDelegate.m deleted file mode 100644 index 3b858ffc..00000000 --- a/iOSProject/Pods/YYText/YYText/String/YYTextRunDelegate.m +++ /dev/null @@ -1,71 +0,0 @@ -// -// YYTextRunDelegate.m -// YYText -// -// Created by ibireme on 14/10/14. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextRunDelegate.h" - -static void DeallocCallback(void *ref) { - YYTextRunDelegate *self = (__bridge_transfer YYTextRunDelegate *)(ref); - self = nil; // release -} - -static CGFloat GetAscentCallback(void *ref) { - YYTextRunDelegate *self = (__bridge YYTextRunDelegate *)(ref); - return self.ascent; -} - -static CGFloat GetDecentCallback(void *ref) { - YYTextRunDelegate *self = (__bridge YYTextRunDelegate *)(ref); - return self.descent; -} - -static CGFloat GetWidthCallback(void *ref) { - YYTextRunDelegate *self = (__bridge YYTextRunDelegate *)(ref); - return self.width; -} - -@implementation YYTextRunDelegate - -- (CTRunDelegateRef)CTRunDelegate CF_RETURNS_RETAINED { - CTRunDelegateCallbacks callbacks; - callbacks.version = kCTRunDelegateCurrentVersion; - callbacks.dealloc = DeallocCallback; - callbacks.getAscent = GetAscentCallback; - callbacks.getDescent = GetDecentCallback; - callbacks.getWidth = GetWidthCallback; - return CTRunDelegateCreate(&callbacks, (__bridge_retained void *)(self.copy)); -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [aCoder encodeObject:@(_ascent) forKey:@"ascent"]; - [aCoder encodeObject:@(_descent) forKey:@"descent"]; - [aCoder encodeObject:@(_width) forKey:@"width"]; - [aCoder encodeObject:_userInfo forKey:@"userInfo"]; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super init]; - _ascent = ((NSNumber *)[aDecoder decodeObjectForKey:@"ascent"]).floatValue; - _descent = ((NSNumber *)[aDecoder decodeObjectForKey:@"descent"]).floatValue; - _width = ((NSNumber *)[aDecoder decodeObjectForKey:@"width"]).floatValue; - _userInfo = [aDecoder decodeObjectForKey:@"userInfo"]; - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - typeof(self) one = [self.class new]; - one.ascent = self.ascent; - one.descent = self.descent; - one.width = self.width; - one.userInfo = self.userInfo; - return one; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Utility/NSAttributedString+YYText.h b/iOSProject/Pods/YYText/YYText/Utility/NSAttributedString+YYText.h deleted file mode 100644 index 8c794a9c..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/NSAttributedString+YYText.h +++ /dev/null @@ -1,1415 +0,0 @@ -// -// NSAttributedString+YYText.h -// YYText -// -// Created by ibireme on 14/10/7. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -#if __has_include() -#import -#import -#else -#import "YYTextAttribute.h" -#import "YYTextRubyAnnotation.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - -/** - Get pre-defined attributes from attributed string. - All properties defined in UIKit, CoreText and YYText are included. - */ -@interface NSAttributedString (YYText) - -/** - Archive the string to data. - @return Returns nil if an error occurs. - */ -- (nullable NSData *)yy_archiveToData; - -/** - Unarchive string from data. - @param data The archived attributed string data. - @return Returns nil if an error occurs. - */ -+ (nullable instancetype)yy_unarchiveFromData:(NSData *)data; - - - -#pragma mark - Retrieving character attribute information -///============================================================================= -/// @name Retrieving character attribute information -///============================================================================= - -/** - Returns the attributes at first charactor. - */ -@property (nullable, nonatomic, copy, readonly) NSDictionary *yy_attributes; - -/** - Returns the attributes for the character at a given index. - - @discussion Raises an `NSRangeException` if index lies beyond the end of the - receiver's characters. - - @param index The index for which to return attributes. - This value must lie within the bounds of the receiver. - - @return The attributes for the character at index. - */ -- (nullable NSDictionary *)yy_attributesAtIndex:(NSUInteger)index; - -/** - Returns the value for an attribute with a given name of the character at a given index. - - @discussion Raises an `NSRangeException` if index lies beyond the end of the - receiver's characters. - - @param attributeName The name of an attribute. - @param index The index for which to return attributes. - This value must not exceed the bounds of the receiver. - - @return The value for the attribute named `attributeName` of the character at - index `index`, or nil if there is no such attribute. - */ -- (nullable id)yy_attribute:(NSString *)attributeName atIndex:(NSUInteger)index; - - -#pragma mark - Get character attribute as property -///============================================================================= -/// @name Get character attribute as property -///============================================================================= - -/** - The font of the text. (read-only) - - @discussion Default is Helvetica (Neue) 12. - @discussion Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) UIFont *yy_font; -- (nullable UIFont *)yy_fontAtIndex:(NSUInteger)index; - -/** - A kerning adjustment. (read-only) - - @discussion Default is standard kerning. The kerning attribute indicate how many - points the following character should be shifted from its default offset as - defined by the current character's font in points; a positive kern indicates a - shift farther along and a negative kern indicates a shift closer to the current - character. If this attribute is not present, standard kerning will be used. - If this attribute is set to 0.0, no kerning will be done at all. - @discussion Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) NSNumber *yy_kern; -- (nullable NSNumber *)yy_kernAtIndex:(NSUInteger)index; - -/** - The foreground color. (read-only) - - @discussion Default is Black. - @discussion Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) UIColor *yy_color; -- (nullable UIColor *)yy_colorAtIndex:(NSUInteger)index; - -/** - The background color. (read-only) - - @discussion Default is nil (or no background). - @discussion Get this property returns the first character's attribute. - @since UIKit:6.0 - */ -@property (nullable, nonatomic, strong, readonly) UIColor *yy_backgroundColor; -- (nullable UIColor *)yy_backgroundColorAtIndex:(NSUInteger)index; - -/** - The stroke width. (read-only) - - @discussion Default value is 0.0 (no stroke). This attribute, interpreted as - a percentage of font point size, controls the text drawing mode: positive - values effect drawing with stroke only; negative values are for stroke and fill. - A typical value for outlined text is 3.0. - @discussion Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 - */ -@property (nullable, nonatomic, strong, readonly) NSNumber *yy_strokeWidth; -- (nullable NSNumber *)yy_strokeWidthAtIndex:(NSUInteger)index; - -/** - The stroke color. (read-only) - - @discussion Default value is nil (same as foreground color). - @discussion Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 - */ -@property (nullable, nonatomic, strong, readonly) UIColor *yy_strokeColor; -- (nullable UIColor *)yy_strokeColorAtIndex:(NSUInteger)index; - -/** - The text shadow. (read-only) - - @discussion Default value is nil (no shadow). - @discussion Get this property returns the first character's attribute. - @since UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) NSShadow *yy_shadow; -- (nullable NSShadow *)yy_shadowAtIndex:(NSUInteger)index; - -/** - The strikethrough style. (read-only) - - @discussion Default value is NSUnderlineStyleNone (no strikethrough). - @discussion Get this property returns the first character's attribute. - @since UIKit:6.0 - */ -@property (nonatomic, readonly) NSUnderlineStyle yy_strikethroughStyle; -- (NSUnderlineStyle)yy_strikethroughStyleAtIndex:(NSUInteger)index; - -/** - The strikethrough color. (read-only) - - @discussion Default value is nil (same as foreground color). - @discussion Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readonly) UIColor *yy_strikethroughColor; -- (nullable UIColor *)yy_strikethroughColorAtIndex:(NSUInteger)index; - -/** - The underline style. (read-only) - - @discussion Default value is NSUnderlineStyleNone (no underline). - @discussion Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 - */ -@property (nonatomic, readonly) NSUnderlineStyle yy_underlineStyle; -- (NSUnderlineStyle)yy_underlineStyleAtIndex:(NSUInteger)index; - -/** - The underline color. (read-only) - - @discussion Default value is nil (same as foreground color). - @discussion Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readonly) UIColor *yy_underlineColor; -- (nullable UIColor *)yy_underlineColorAtIndex:(NSUInteger)index; - -/** - Ligature formation control. (read-only) - - @discussion Default is int value 1. The ligature attribute determines what kinds - of ligatures should be used when displaying the string. A value of 0 indicates - that only ligatures essential for proper rendering of text should be used, - 1 indicates that standard ligatures should be used, and 2 indicates that all - available ligatures should be used. Which ligatures are standard depends on the - script and possibly the font. - @discussion Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) NSNumber *yy_ligature; -- (nullable NSNumber *)yy_ligatureAtIndex:(NSUInteger)index; - -/** - The text effect. (read-only) - - @discussion Default is nil (no effect). The only currently supported value - is NSTextEffectLetterpressStyle. - @discussion Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readonly) NSString *yy_textEffect; -- (nullable NSString *)yy_textEffectAtIndex:(NSUInteger)index; - -/** - The skew to be applied to glyphs. (read-only) - - @discussion Default is 0 (no skew). - @discussion Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readonly) NSNumber *yy_obliqueness; -- (nullable NSNumber *)yy_obliquenessAtIndex:(NSUInteger)index; - -/** - The log of the expansion factor to be applied to glyphs. (read-only) - - @discussion Default is 0 (no expansion). - @discussion Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readonly) NSNumber *yy_expansion; -- (nullable NSNumber *)yy_expansionAtIndex:(NSUInteger)index; - -/** - The character's offset from the baseline, in points. (read-only) - - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readonly) NSNumber *yy_baselineOffset; -- (nullable NSNumber *)yy_baselineOffsetAtIndex:(NSUInteger)index; - -/** - Glyph orientation control. (read-only) - - @discussion Default is NO. A value of NO indicates that horizontal glyph forms - are to be used, YES indicates that vertical glyph forms are to be used. - @discussion Get this property returns the first character's attribute. - @since CoreText:4.3 YYText:6.0 - */ -@property (nonatomic, readonly) BOOL yy_verticalGlyphForm; -- (BOOL)yy_verticalGlyphFormAtIndex:(NSUInteger)index; - -/** - Specifies text language. (read-only) - - @discussion Value must be a NSString containing a locale identifier. Default is - unset. When this attribute is set to a valid identifier, it will be used to select - localized glyphs (if supported by the font) and locale-specific line breaking rules. - @discussion Get this property returns the first character's attribute. - @since CoreText:7.0 YYText:7.0 - */ -@property (nullable, nonatomic, strong, readonly) NSString *yy_language; -- (nullable NSString *)yy_languageAtIndex:(NSUInteger)index; - -/** - Specifies a bidirectional override or embedding. (read-only) - - @discussion See alse NSWritingDirection and NSWritingDirectionAttributeName. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:7.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) NSArray *yy_writingDirection; -- (nullable NSArray *)yy_writingDirectionAtIndex:(NSUInteger)index; - -/** - An NSParagraphStyle object which is used to specify things like - line alignment, tab rulers, writing direction, etc. (read-only) - - @discussion Default is nil ([NSParagraphStyle defaultParagraphStyle]). - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) NSParagraphStyle *yy_paragraphStyle; -- (nullable NSParagraphStyle *)yy_paragraphStyleAtIndex:(NSUInteger)index; - -#pragma mark - Get paragraph attribute as property -///============================================================================= -/// @name Get paragraph attribute as property -///============================================================================= - -/** - The text alignment (A wrapper for NSParagraphStyle). (read-only) - - @discussion Natural text alignment is realized as left or right alignment - depending on the line sweep direction of the first script contained in the paragraph. - @discussion Default is NSTextAlignmentNatural. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) NSTextAlignment yy_alignment; -- (NSTextAlignment)yy_alignmentAtIndex:(NSUInteger)index; - -/** - The mode that should be used to break lines (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property contains the line break mode to be used laying out the paragraph's text. - @discussion Default is NSLineBreakByWordWrapping. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) NSLineBreakMode yy_lineBreakMode; -- (NSLineBreakMode)yy_lineBreakModeAtIndex:(NSUInteger)index; - -/** - The distance in points between the bottom of one line fragment and the top of the next. - (A wrapper for NSParagraphStyle) (read-only) - - @discussion This value is always nonnegative. This value is included in the line - fragment heights in the layout manager. - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_lineSpacing; -- (CGFloat)yy_lineSpacingAtIndex:(NSUInteger)index; - -/** - The space after the end of the paragraph (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property contains the space (measured in points) added at the - end of the paragraph to separate it from the following paragraph. This value must - be nonnegative. The space between paragraphs is determined by adding the previous - paragraph's paragraphSpacing and the current paragraph's paragraphSpacingBefore. - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_paragraphSpacing; -- (CGFloat)yy_paragraphSpacingAtIndex:(NSUInteger)index; - -/** - The distance between the paragraph's top and the beginning of its text content. - (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property contains the space (measured in points) between the - paragraph's top and the beginning of its text content. - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_paragraphSpacingBefore; -- (CGFloat)yy_paragraphSpacingBeforeAtIndex:(NSUInteger)index; - -/** - The indentation of the first line (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property contains the distance (in points) from the leading margin - of a text container to the beginning of the paragraph's first line. This value - is always nonnegative. - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_firstLineHeadIndent; -- (CGFloat)yy_firstLineHeadIndentAtIndex:(NSUInteger)index; - -/** - The indentation of the receiver's lines other than the first. (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property contains the distance (in points) from the leading margin - of a text container to the beginning of lines other than the first. This value is - always nonnegative. - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_headIndent; -- (CGFloat)yy_headIndentAtIndex:(NSUInteger)index; - -/** - The trailing indentation (A wrapper for NSParagraphStyle). (read-only) - - @discussion If positive, this value is the distance from the leading margin - (for example, the left margin in left-to-right text). If 0 or negative, it's the - distance from the trailing margin. - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_tailIndent; -- (CGFloat)yy_tailIndentAtIndex:(NSUInteger)index; - -/** - The receiver's minimum height (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property contains the minimum height in points that any line in - the receiver will occupy, regardless of the font size or size of any attached graphic. - This value must be nonnegative. - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_minimumLineHeight; -- (CGFloat)yy_minimumLineHeightAtIndex:(NSUInteger)index; - -/** - The receiver's maximum line height (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property contains the maximum height in points that any line in - the receiver will occupy, regardless of the font size or size of any attached graphic. - This value is always nonnegative. Glyphs and graphics exceeding this height will - overlap neighboring lines; however, a maximum height of 0 implies no line height limit. - Although this limit applies to the line itself, line spacing adds extra space between adjacent lines. - @discussion Default is 0 (no limit). - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_maximumLineHeight; -- (CGFloat)yy_maximumLineHeightAtIndex:(NSUInteger)index; - -/** - The line height multiple (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property contains the line break mode to be used laying out the paragraph's text. - @discussion Default is 0 (no multiple). - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) CGFloat yy_lineHeightMultiple; -- (CGFloat)yy_lineHeightMultipleAtIndex:(NSUInteger)index; - -/** - The base writing direction (A wrapper for NSParagraphStyle). (read-only) - - @discussion If you specify NSWritingDirectionNaturalDirection, the receiver resolves - the writing direction to either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft, - depending on the direction for the user's `language` preference setting. - @discussion Default is NSWritingDirectionNatural. - @discussion Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readonly) NSWritingDirection yy_baseWritingDirection; -- (NSWritingDirection)yy_baseWritingDirectionAtIndex:(NSUInteger)index; - -/** - The paragraph's threshold for hyphenation. (A wrapper for NSParagraphStyle). (read-only) - - @discussion Valid values lie between 0.0 and 1.0 inclusive. Hyphenation is attempted - when the ratio of the text width (as broken without hyphenation) to the width of the - line fragment is less than the hyphenation factor. When the paragraph's hyphenation - factor is 0.0, the layout manager's hyphenation factor is used instead. When both - are 0.0, hyphenation is disabled. - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since UIKit:6.0 - */ -@property (nonatomic, readonly) float yy_hyphenationFactor; -- (float)yy_hyphenationFactorAtIndex:(NSUInteger)index; - -/** - The document-wide default tab interval (A wrapper for NSParagraphStyle). (read-only) - - @discussion This property represents the default tab interval in points. Tabs after the - last specified in tabStops are placed at integer multiples of this distance (if positive). - @discussion Default is 0. - @discussion Get this property returns the first character's attribute. - @since CoreText:7.0 UIKit:7.0 YYText:7.0 - */ -@property (nonatomic, readonly) CGFloat yy_defaultTabInterval; -- (CGFloat)yy_defaultTabIntervalAtIndex:(NSUInteger)index; - -/** - An array of NSTextTab objects representing the receiver's tab stops. - (A wrapper for NSParagraphStyle). (read-only) - - @discussion The NSTextTab objects, sorted by location, define the tab stops for - the paragraph style. - @discussion Default is 12 TabStops with 28.0 tab interval. - @discussion Get this property returns the first character's attribute. - @since CoreText:7.0 UIKit:7.0 YYText:7.0 - */ -@property (nullable, nonatomic, copy, readonly) NSArray *yy_tabStops; -- (nullable NSArray *)yy_tabStopsAtIndex:(NSUInteger)index; - -#pragma mark - Get YYText attribute as property -///============================================================================= -/// @name Get YYText attribute as property -///============================================================================= - -/** - The text shadow. (read-only) - - @discussion Default value is nil (no shadow). - @discussion Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) YYTextShadow *yy_textShadow; -- (nullable YYTextShadow *)yy_textShadowAtIndex:(NSUInteger)index; - -/** - The text inner shadow. (read-only) - - @discussion Default value is nil (no shadow). - @discussion Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) YYTextShadow *yy_textInnerShadow; -- (nullable YYTextShadow *)yy_textInnerShadowAtIndex:(NSUInteger)index; - -/** - The text underline. (read-only) - - @discussion Default value is nil (no underline). - @discussion Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) YYTextDecoration *yy_textUnderline; -- (nullable YYTextDecoration *)yy_textUnderlineAtIndex:(NSUInteger)index; - -/** - The text strikethrough. (read-only) - - @discussion Default value is nil (no strikethrough). - @discussion Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) YYTextDecoration *yy_textStrikethrough; -- (nullable YYTextDecoration *)yy_textStrikethroughAtIndex:(NSUInteger)index; - -/** - The text border. (read-only) - - @discussion Default value is nil (no border). - @discussion Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) YYTextBorder *yy_textBorder; -- (nullable YYTextBorder *)yy_textBorderAtIndex:(NSUInteger)index; - -/** - The text background border. (read-only) - - @discussion Default value is nil (no background border). - @discussion Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readonly) YYTextBorder *yy_textBackgroundBorder; -- (nullable YYTextBorder *)yy_textBackgroundBorderAtIndex:(NSUInteger)index; - -/** - The glyph transform. (read-only) - - @discussion Default value is CGAffineTransformIdentity (no transform). - @discussion Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nonatomic, readonly) CGAffineTransform yy_textGlyphTransform; -- (CGAffineTransform)yy_textGlyphTransformAtIndex:(NSUInteger)index; - - -#pragma mark - Query for YYText -///============================================================================= -/// @name Query for YYText -///============================================================================= - -/** - Returns the plain text from a range. - If there's `YYTextBackedStringAttributeName` attribute, the backed string will - replace the attributed string range. - - @param range A range in receiver. - @return The plain text. - */ -- (nullable NSString *)yy_plainTextForRange:(NSRange)range; - - -#pragma mark - Create attachment string for YYText -///============================================================================= -/// @name Create attachment string for YYText -///============================================================================= - -/** - Creates and returns an attachment. - - @param content The attachment (UIImage/UIView/CALayer). - @param contentMode The attachment's content mode. - @param width The attachment's container width in layout. - @param ascent The attachment's container ascent in layout. - @param descent The attachment's container descent in layout. - - @return An attributed string, or nil if an error occurs. - @since YYText:6.0 - */ -+ (NSMutableAttributedString *)yy_attachmentStringWithContent:(nullable id)content - contentMode:(UIViewContentMode)contentMode - width:(CGFloat)width - ascent:(CGFloat)ascent - descent:(CGFloat)descent; - -/** - Creates and returns an attachment. - - - Example: ContentMode:bottom Alignment:Top. - - The text The attachment holder - ↓ ↓ - ─────────┌──────────────────────┐─────── - / \ │ │ / ___| - / _ \ │ │| | - / ___ \ │ │| |___ ←── The text line - /_/ \_\│ ██████████████ │ \____| - ─────────│ ██████████████ │─────── - │ ██████████████ │ - │ ██████████████ ←───────────────── The attachment content - │ ██████████████ │ - └──────────────────────┘ - - @param content The attachment (UIImage/UIView/CALayer). - @param contentMode The attachment's content mode in attachment holder - @param attachmentSize The attachment holder's size in text layout. - @param fontSize The attachment will align to this font. - @param alignment The attachment holder's alignment to text line. - - @return An attributed string, or nil if an error occurs. - @since YYText:6.0 - */ -+ (NSMutableAttributedString *)yy_attachmentStringWithContent:(nullable id)content - contentMode:(UIViewContentMode)contentMode - attachmentSize:(CGSize)attachmentSize - alignToFont:(UIFont *)font - alignment:(YYTextVerticalAlignment)alignment; - -/** - Creates and returns an attahment from a fourquare image as if it was an emoji. - - @param image A fourquare image. - @param fontSize The font size. - - @return An attributed string, or nil if an error occurs. - @since YYText:6.0 - */ -+ (nullable NSMutableAttributedString *)yy_attachmentStringWithEmojiImage:(UIImage *)image - fontSize:(CGFloat)fontSize; - -#pragma mark - Utility -///============================================================================= -/// @name Utility -///============================================================================= - -/** - Returns NSMakeRange(0, self.length). - */ -- (NSRange)yy_rangeOfAll; - -/** - If YES, it share the same attribute in entire text range. - */ -- (BOOL)yy_isSharedAttributesInAllRange; - -/** - If YES, it can be drawn with the [drawWithRect:options:context:] method or displayed with UIKit. - If NO, it should be drawn with CoreText or YYText. - - @discussion If the method returns NO, it means that there's at least one attribute - which is not supported by UIKit (such as CTParagraphStyleRef). If display this string - in UIKit, it may lose some attribute, or even crash the app. - */ -- (BOOL)yy_canDrawWithUIKit; - -@end - - - - -/** - Set pre-defined attributes to attributed string. - All properties defined in UIKit, CoreText and YYText are included. - */ -@interface NSMutableAttributedString (YYText) - -#pragma mark - Set character attribute -///============================================================================= -/// @name Set character attribute -///============================================================================= - -/** - Sets the attributes to the entire text string. - - @discussion The old attributes will be removed. - - @param attributes A dictionary containing the attributes to set, or nil to remove all attributes. - */ -- (void)yy_setAttributes:(nullable NSDictionary *)attributes; -- (void)setYy_attributes:(nullable NSDictionary *)attributes; - -/** - Sets an attribute with the given name and value to the entire text string. - - @param name A string specifying the attribute name. - @param value The attribute value associated with name. Pass `nil` or `NSNull` to - remove the attribute. - */ -- (void)yy_setAttribute:(NSString *)name value:(nullable id)value; - -/** - Sets an attribute with the given name and value to the characters in the specified range. - - @param name A string specifying the attribute name. - @param value The attribute value associated with name. Pass `nil` or `NSNull` to - remove the attribute. - @param range The range of characters to which the specified attribute/value pair applies. - */ -- (void)yy_setAttribute:(NSString *)name value:(nullable id)value range:(NSRange)range; - -/** - Removes all attributes in the specified range. - - @param range The range of characters. - */ -- (void)yy_removeAttributesInRange:(NSRange)range; - - -#pragma mark - Set character attribute as property -///============================================================================= -/// @name Set character attribute as property -///============================================================================= - -/** - The font of the text. - - @discussion Default is Helvetica (Neue) 12. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) UIFont *yy_font; -- (void)yy_setFont:(nullable UIFont *)font range:(NSRange)range; - -/** - A kerning adjustment. - - @discussion Default is standard kerning. The kerning attribute indicate how many - points the following character should be shifted from its default offset as - defined by the current character's font in points; a positive kern indicates a - shift farther along and a negative kern indicates a shift closer to the current - character. If this attribute is not present, standard kerning will be used. - If this attribute is set to 0.0, no kerning will be done at all. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSNumber *yy_kern; -- (void)yy_setKern:(nullable NSNumber *)kern range:(NSRange)range; - -/** - The foreground color. - - @discussion Default is Black. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) UIColor *yy_color; -- (void)yy_setColor:(nullable UIColor *)color range:(NSRange)range; - -/** - The background color. - - @discussion Default is nil (or no background). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) UIColor *yy_backgroundColor; -- (void)yy_setBackgroundColor:(nullable UIColor *)backgroundColor range:(NSRange)range; - -/** - The stroke width. - - @discussion Default value is 0.0 (no stroke). This attribute, interpreted as - a percentage of font point size, controls the text drawing mode: positive - values effect drawing with stroke only; negative values are for stroke and fill. - A typical value for outlined text is 3.0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSNumber *yy_strokeWidth; -- (void)yy_setStrokeWidth:(nullable NSNumber *)strokeWidth range:(NSRange)range; - -/** - The stroke color. - - @discussion Default value is nil (same as foreground color). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) UIColor *yy_strokeColor; -- (void)yy_setStrokeColor:(nullable UIColor *)strokeColor range:(NSRange)range; - -/** - The text shadow. - - @discussion Default value is nil (no shadow). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSShadow *yy_shadow; -- (void)yy_setShadow:(nullable NSShadow *)shadow range:(NSRange)range; - -/** - The strikethrough style. - - @discussion Default value is NSUnderlineStyleNone (no strikethrough). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:6.0 - */ -@property (nonatomic, readwrite) NSUnderlineStyle yy_strikethroughStyle; -- (void)yy_setStrikethroughStyle:(NSUnderlineStyle)strikethroughStyle range:(NSRange)range; - -/** - The strikethrough color. - - @discussion Default value is nil (same as foreground color). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readwrite) UIColor *yy_strikethroughColor; -- (void)yy_setStrikethroughColor:(nullable UIColor *)strikethroughColor range:(NSRange)range NS_AVAILABLE_IOS(7_0); - -/** - The underline style. - - @discussion Default value is NSUnderlineStyleNone (no underline). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 - */ -@property (nonatomic, readwrite) NSUnderlineStyle yy_underlineStyle; -- (void)yy_setUnderlineStyle:(NSUnderlineStyle)underlineStyle range:(NSRange)range; - -/** - The underline color. - - @discussion Default value is nil (same as foreground color). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readwrite) UIColor *yy_underlineColor; -- (void)yy_setUnderlineColor:(nullable UIColor *)underlineColor range:(NSRange)range; - -/** - Ligature formation control. - - @discussion Default is int value 1. The ligature attribute determines what kinds - of ligatures should be used when displaying the string. A value of 0 indicates - that only ligatures essential for proper rendering of text should be used, - 1 indicates that standard ligatures should be used, and 2 indicates that all - available ligatures should be used. Which ligatures are standard depends on the - script and possibly the font. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:3.2 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSNumber *yy_ligature; -- (void)yy_setLigature:(nullable NSNumber *)ligature range:(NSRange)range; - -/** - The text effect. - - @discussion Default is nil (no effect). The only currently supported value - is NSTextEffectLetterpressStyle. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSString *yy_textEffect; -- (void)yy_setTextEffect:(nullable NSString *)textEffect range:(NSRange)range NS_AVAILABLE_IOS(7_0); - -/** - The skew to be applied to glyphs. - - @discussion Default is 0 (no skew). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSNumber *yy_obliqueness; -- (void)yy_setObliqueness:(nullable NSNumber *)obliqueness range:(NSRange)range NS_AVAILABLE_IOS(7_0); - -/** - The log of the expansion factor to be applied to glyphs. - - @discussion Default is 0 (no expansion). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSNumber *yy_expansion; -- (void)yy_setExpansion:(nullable NSNumber *)expansion range:(NSRange)range NS_AVAILABLE_IOS(7_0); - -/** - The character's offset from the baseline, in points. - - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:7.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSNumber *yy_baselineOffset; -- (void)yy_setBaselineOffset:(nullable NSNumber *)baselineOffset range:(NSRange)range NS_AVAILABLE_IOS(7_0); - -/** - Glyph orientation control. - - @discussion Default is NO. A value of NO indicates that horizontal glyph forms - are to be used, YES indicates that vertical glyph forms are to be used. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:4.3 YYText:6.0 - */ -@property (nonatomic, readwrite) BOOL yy_verticalGlyphForm; -- (void)yy_setVerticalGlyphForm:(BOOL)verticalGlyphForm range:(NSRange)range; - -/** - Specifies text language. - - @discussion Value must be a NSString containing a locale identifier. Default is - unset. When this attribute is set to a valid identifier, it will be used to select - localized glyphs (if supported by the font) and locale-specific line breaking rules. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:7.0 YYText:7.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSString *yy_language; -- (void)yy_setLanguage:(nullable NSString *)language range:(NSRange)range NS_AVAILABLE_IOS(7_0); - -/** - Specifies a bidirectional override or embedding. - - @discussion See alse NSWritingDirection and NSWritingDirectionAttributeName. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:7.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSArray *yy_writingDirection; -- (void)yy_setWritingDirection:(nullable NSArray *)writingDirection range:(NSRange)range; - -/** - An NSParagraphStyle object which is used to specify things like - line alignment, tab rulers, writing direction, etc. - - @discussion Default is nil ([NSParagraphStyle defaultParagraphStyle]). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) NSParagraphStyle *yy_paragraphStyle; -- (void)yy_setParagraphStyle:(nullable NSParagraphStyle *)paragraphStyle range:(NSRange)range; - - -#pragma mark - Set paragraph attribute as property -///============================================================================= -/// @name Set paragraph attribute as property -///============================================================================= - -/** - The text alignment (A wrapper for NSParagraphStyle). - - @discussion Natural text alignment is realized as left or right alignment - depending on the line sweep direction of the first script contained in the paragraph. - @discussion Default is NSTextAlignmentNatural. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) NSTextAlignment yy_alignment; -- (void)yy_setAlignment:(NSTextAlignment)alignment range:(NSRange)range; - -/** - The mode that should be used to break lines (A wrapper for NSParagraphStyle). - - @discussion This property contains the line break mode to be used laying out the paragraph's text. - @discussion Default is NSLineBreakByWordWrapping. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) NSLineBreakMode yy_lineBreakMode; -- (void)yy_setLineBreakMode:(NSLineBreakMode)lineBreakMode range:(NSRange)range; - -/** - The distance in points between the bottom of one line fragment and the top of the next. - (A wrapper for NSParagraphStyle) - - @discussion This value is always nonnegative. This value is included in the line - fragment heights in the layout manager. - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_lineSpacing; -- (void)yy_setLineSpacing:(CGFloat)lineSpacing range:(NSRange)range; - -/** - The space after the end of the paragraph (A wrapper for NSParagraphStyle). - - @discussion This property contains the space (measured in points) added at the - end of the paragraph to separate it from the following paragraph. This value must - be nonnegative. The space between paragraphs is determined by adding the previous - paragraph's paragraphSpacing and the current paragraph's paragraphSpacingBefore. - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_paragraphSpacing; -- (void)yy_setParagraphSpacing:(CGFloat)paragraphSpacing range:(NSRange)range; - -/** - The distance between the paragraph's top and the beginning of its text content. - (A wrapper for NSParagraphStyle). - - @discussion This property contains the space (measured in points) between the - paragraph's top and the beginning of its text content. - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_paragraphSpacingBefore; -- (void)yy_setParagraphSpacingBefore:(CGFloat)paragraphSpacingBefore range:(NSRange)range; - -/** - The indentation of the first line (A wrapper for NSParagraphStyle). - - @discussion This property contains the distance (in points) from the leading margin - of a text container to the beginning of the paragraph's first line. This value - is always nonnegative. - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_firstLineHeadIndent; -- (void)yy_setFirstLineHeadIndent:(CGFloat)firstLineHeadIndent range:(NSRange)range; - -/** - The indentation of the receiver's lines other than the first. (A wrapper for NSParagraphStyle). - - @discussion This property contains the distance (in points) from the leading margin - of a text container to the beginning of lines other than the first. This value is - always nonnegative. - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_headIndent; -- (void)yy_setHeadIndent:(CGFloat)headIndent range:(NSRange)range; - -/** - The trailing indentation (A wrapper for NSParagraphStyle). - - @discussion If positive, this value is the distance from the leading margin - (for example, the left margin in left-to-right text). If 0 or negative, it's the - distance from the trailing margin. - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_tailIndent; -- (void)yy_setTailIndent:(CGFloat)tailIndent range:(NSRange)range; - -/** - The receiver's minimum height (A wrapper for NSParagraphStyle). - - @discussion This property contains the minimum height in points that any line in - the receiver will occupy, regardless of the font size or size of any attached graphic. - This value must be nonnegative. - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_minimumLineHeight; -- (void)yy_setMinimumLineHeight:(CGFloat)minimumLineHeight range:(NSRange)range; - -/** - The receiver's maximum line height (A wrapper for NSParagraphStyle). - - @discussion This property contains the maximum height in points that any line in - the receiver will occupy, regardless of the font size or size of any attached graphic. - This value is always nonnegative. Glyphs and graphics exceeding this height will - overlap neighboring lines; however, a maximum height of 0 implies no line height limit. - Although this limit applies to the line itself, line spacing adds extra space between adjacent lines. - @discussion Default is 0 (no limit). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_maximumLineHeight; -- (void)yy_setMaximumLineHeight:(CGFloat)maximumLineHeight range:(NSRange)range; - -/** - The line height multiple (A wrapper for NSParagraphStyle). - - @discussion This property contains the line break mode to be used laying out the paragraph's text. - @discussion Default is 0 (no multiple). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) CGFloat yy_lineHeightMultiple; -- (void)yy_setLineHeightMultiple:(CGFloat)lineHeightMultiple range:(NSRange)range; - -/** - The base writing direction (A wrapper for NSParagraphStyle). - - @discussion If you specify NSWritingDirectionNaturalDirection, the receiver resolves - the writing direction to either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft, - depending on the direction for the user's `language` preference setting. - @discussion Default is NSWritingDirectionNatural. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:6.0 UIKit:6.0 YYText:6.0 - */ -@property (nonatomic, readwrite) NSWritingDirection yy_baseWritingDirection; -- (void)yy_setBaseWritingDirection:(NSWritingDirection)baseWritingDirection range:(NSRange)range; - -/** - The paragraph's threshold for hyphenation. (A wrapper for NSParagraphStyle). - - @discussion Valid values lie between 0.0 and 1.0 inclusive. Hyphenation is attempted - when the ratio of the text width (as broken without hyphenation) to the width of the - line fragment is less than the hyphenation factor. When the paragraph's hyphenation - factor is 0.0, the layout manager's hyphenation factor is used instead. When both - are 0.0, hyphenation is disabled. - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since UIKit:6.0 - */ -@property (nonatomic, readwrite) float yy_hyphenationFactor; -- (void)yy_setHyphenationFactor:(float)hyphenationFactor range:(NSRange)range; - -/** - The document-wide default tab interval (A wrapper for NSParagraphStyle). - - @discussion This property represents the default tab interval in points. Tabs after the - last specified in tabStops are placed at integer multiples of this distance (if positive). - @discussion Default is 0. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:7.0 UIKit:7.0 YYText:7.0 - */ -@property (nonatomic, readwrite) CGFloat yy_defaultTabInterval; -- (void)yy_setDefaultTabInterval:(CGFloat)defaultTabInterval range:(NSRange)range NS_AVAILABLE_IOS(7_0); - -/** - An array of NSTextTab objects representing the receiver's tab stops. - (A wrapper for NSParagraphStyle). - - @discussion The NSTextTab objects, sorted by location, define the tab stops for - the paragraph style. - @discussion Default is 12 TabStops with 28.0 tab interval. - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since CoreText:7.0 UIKit:7.0 YYText:7.0 - */ -@property (nullable, nonatomic, copy, readwrite) NSArray *yy_tabStops; -- (void)yy_setTabStops:(nullable NSArray *)tabStops range:(NSRange)range NS_AVAILABLE_IOS(7_0); - -#pragma mark - Set YYText attribute as property -///============================================================================= -/// @name Set YYText attribute as property -///============================================================================= - -/** - The text shadow. - - @discussion Default value is nil (no shadow). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) YYTextShadow *yy_textShadow; -- (void)yy_setTextShadow:(nullable YYTextShadow *)textShadow range:(NSRange)range; - -/** - The text inner shadow. - - @discussion Default value is nil (no shadow). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) YYTextShadow *yy_textInnerShadow; -- (void)yy_setTextInnerShadow:(nullable YYTextShadow *)textInnerShadow range:(NSRange)range; - -/** - The text underline. - - @discussion Default value is nil (no underline). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) YYTextDecoration *yy_textUnderline; -- (void)yy_setTextUnderline:(nullable YYTextDecoration *)textUnderline range:(NSRange)range; - -/** - The text strikethrough. - - @discussion Default value is nil (no strikethrough). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) YYTextDecoration *yy_textStrikethrough; -- (void)yy_setTextStrikethrough:(nullable YYTextDecoration *)textStrikethrough range:(NSRange)range; - -/** - The text border. - - @discussion Default value is nil (no border). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) YYTextBorder *yy_textBorder; -- (void)yy_setTextBorder:(nullable YYTextBorder *)textBorder range:(NSRange)range; - -/** - The text background border. - - @discussion Default value is nil (no background border). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nullable, nonatomic, strong, readwrite) YYTextBorder *yy_textBackgroundBorder; -- (void)yy_setTextBackgroundBorder:(nullable YYTextBorder *)textBackgroundBorder range:(NSRange)range; - -/** - The glyph transform. - - @discussion Default value is CGAffineTransformIdentity (no transform). - @discussion Set this property applies to the entire text string. - Get this property returns the first character's attribute. - @since YYText:6.0 - */ -@property (nonatomic, readwrite) CGAffineTransform yy_textGlyphTransform; -- (void)yy_setTextGlyphTransform:(CGAffineTransform)textGlyphTransform range:(NSRange)range; - - -#pragma mark - Set discontinuous attribute for range -///============================================================================= -/// @name Set discontinuous attribute for range -///============================================================================= - -- (void)yy_setSuperscript:(nullable NSNumber *)superscript range:(NSRange)range; -- (void)yy_setGlyphInfo:(nullable CTGlyphInfoRef)glyphInfo range:(NSRange)range; -- (void)yy_setCharacterShape:(nullable NSNumber *)characterShape range:(NSRange)range; -- (void)yy_setRunDelegate:(nullable CTRunDelegateRef)runDelegate range:(NSRange)range; -- (void)yy_setBaselineClass:(nullable CFStringRef)baselineClass range:(NSRange)range; -- (void)yy_setBaselineInfo:(nullable CFDictionaryRef)baselineInfo range:(NSRange)range; -- (void)yy_setBaselineReferenceInfo:(nullable CFDictionaryRef)referenceInfo range:(NSRange)range; -- (void)yy_setRubyAnnotation:(nullable CTRubyAnnotationRef)ruby range:(NSRange)range NS_AVAILABLE_IOS(8_0); -- (void)yy_setAttachment:(nullable NSTextAttachment *)attachment range:(NSRange)range NS_AVAILABLE_IOS(7_0); -- (void)yy_setLink:(nullable id)link range:(NSRange)range NS_AVAILABLE_IOS(7_0); -- (void)yy_setTextBackedString:(nullable YYTextBackedString *)textBackedString range:(NSRange)range; -- (void)yy_setTextBinding:(nullable YYTextBinding *)textBinding range:(NSRange)range; -- (void)yy_setTextAttachment:(nullable YYTextAttachment *)textAttachment range:(NSRange)range; -- (void)yy_setTextHighlight:(nullable YYTextHighlight *)textHighlight range:(NSRange)range; -- (void)yy_setTextBlockBorder:(nullable YYTextBorder *)textBlockBorder range:(NSRange)range; -- (void)yy_setTextRubyAnnotation:(nullable YYTextRubyAnnotation *)ruby range:(NSRange)range NS_AVAILABLE_IOS(8_0); - - -#pragma mark - Convenience methods for text highlight -///============================================================================= -/// @name Convenience methods for text highlight -///============================================================================= - -/** - Convenience method to set text highlight - - @param range text range - @param color text color (pass nil to ignore) - @param backgroundColor text background color when highlight - @param userInfo user information dictionary (pass nil to ignore) - @param tapAction tap action when user tap the highlight (pass nil to ignore) - @param longPressAction long press action when user long press the highlight (pass nil to ignore) - */ -- (void)yy_setTextHighlightRange:(NSRange)range - color:(nullable UIColor *)color - backgroundColor:(nullable UIColor *)backgroundColor - userInfo:(nullable NSDictionary *)userInfo - tapAction:(nullable YYTextAction)tapAction - longPressAction:(nullable YYTextAction)longPressAction; - -/** - Convenience method to set text highlight - - @param range text range - @param color text color (pass nil to ignore) - @param backgroundColor text background color when highlight - @param tapAction tap action when user tap the highlight (pass nil to ignore) - */ -- (void)yy_setTextHighlightRange:(NSRange)range - color:(nullable UIColor *)color - backgroundColor:(nullable UIColor *)backgroundColor - tapAction:(nullable YYTextAction)tapAction; - -/** - Convenience method to set text highlight - - @param range text range - @param color text color (pass nil to ignore) - @param backgroundColor text background color when highlight - @param userInfo tap action when user tap the highlight (pass nil to ignore) - */ -- (void)yy_setTextHighlightRange:(NSRange)range - color:(nullable UIColor *)color - backgroundColor:(nullable UIColor *)backgroundColor - userInfo:(nullable NSDictionary *)userInfo; - -#pragma mark - Utilities -///============================================================================= -/// @name Utilities -///============================================================================= - -/** - Inserts into the receiver the characters of a given string at a given location. - The new string inherit the attributes of the first replaced character from location. - - @param string The string to insert into the receiver, must not be nil. - @param location The location at which string is inserted. The location must not - exceed the bounds of the receiver. - @throw Raises an NSRangeException if the location out of bounds. - */ -- (void)yy_insertString:(NSString *)string atIndex:(NSUInteger)location; - -/** - Adds to the end of the receiver the characters of a given string. - The new string inherit the attributes of the receiver's tail. - - @param string The string to append to the receiver, must not be nil. - */ -- (void)yy_appendString:(NSString *)string; - -/** - Set foreground color with [UIColor clearColor] in joined-emoji range. - Emoji drawing will not be affected by the foreground color. - - @discussion In iOS 8.3, Apple releases some new diversified emojis. - There's some single emoji which can be assembled to a new 'joined-emoji'. - The joiner is unicode character 'ZERO WIDTH JOINER' (U+200D). - For example: 👨👩👧👧 -> 👨‍👩‍👧‍👧. - - When there are more than 5 'joined-emoji' in a same CTLine, CoreText may render some - extra glyphs above the emoji. It's a bug in CoreText, try this method to avoid. - This bug is fixed in iOS 9. - */ -- (void)yy_setClearColorToJoinedEmoji; - -/** - Removes all discontinuous attributes in a specified range. - See `allDiscontinuousAttributeKeys`. - - @param range A text range. - */ -- (void)yy_removeDiscontinuousAttributesInRange:(NSRange)range; - -/** - Returns all discontinuous attribute keys, such as RunDelegate/Attachment/Ruby. - - @discussion These attributes can only set to a specified range of text, and - should not extend to other range when editing text. - */ -+ (NSArray *)yy_allDiscontinuousAttributeKeys; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Utility/NSAttributedString+YYText.m b/iOSProject/Pods/YYText/YYText/Utility/NSAttributedString+YYText.m deleted file mode 100644 index 63f95799..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/NSAttributedString+YYText.m +++ /dev/null @@ -1,1404 +0,0 @@ -// -// NSAttributedString+YYText.m -// YYText -// -// Created by ibireme on 14/10/7. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSAttributedString+YYText.h" -#import "NSParagraphStyle+YYText.h" -#import "YYTextArchiver.h" -#import "YYTextRunDelegate.h" -#import "YYTextUtilities.h" -#import - - -// Dummy class for category -@interface NSAttributedString_YYText : NSObject @end -@implementation NSAttributedString_YYText @end - - -static double _YYDeviceSystemVersion() { - static double version; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - version = [UIDevice currentDevice].systemVersion.doubleValue; - }); - return version; -} - -#ifndef kSystemVersion -#define kSystemVersion _YYDeviceSystemVersion() -#endif - -#ifndef kiOS6Later -#define kiOS6Later (kSystemVersion >= 6) -#endif - -#ifndef kiOS7Later -#define kiOS7Later (kSystemVersion >= 7) -#endif - -#ifndef kiOS8Later -#define kiOS8Later (kSystemVersion >= 8) -#endif - -#ifndef kiOS9Later -#define kiOS9Later (kSystemVersion >= 9) -#endif - - - -@implementation NSAttributedString (YYText) - -- (NSData *)yy_archiveToData { - NSData *data = nil; - @try { - data = [YYTextArchiver archivedDataWithRootObject:self]; - } - @catch (NSException *exception) { - NSLog(@"%@",exception); - } - return data; -} - -+ (instancetype)yy_unarchiveFromData:(NSData *)data { - NSAttributedString *one = nil; - @try { - one = [YYTextUnarchiver unarchiveObjectWithData:data]; - } - @catch (NSException *exception) { - NSLog(@"%@",exception); - } - return one; -} - -- (NSDictionary *)yy_attributesAtIndex:(NSUInteger)index { - if (index > self.length || self.length == 0) return nil; - if (self.length > 0 && index == self.length) index--; - return [self attributesAtIndex:index effectiveRange:NULL]; -} - -- (id)yy_attribute:(NSString *)attributeName atIndex:(NSUInteger)index { - if (!attributeName) return nil; - if (index > self.length || self.length == 0) return nil; - if (self.length > 0 && index == self.length) index--; - return [self attribute:attributeName atIndex:index effectiveRange:NULL]; -} - -- (NSDictionary *)yy_attributes { - return [self yy_attributesAtIndex:0]; -} - -- (UIFont *)yy_font { - return [self yy_fontAtIndex:0]; -} - -- (UIFont *)yy_fontAtIndex:(NSUInteger)index { - /* - In iOS7 and later, UIFont is toll-free bridged to CTFontRef, - although Apple does not mention it in documentation. - - In iOS6, UIFont is a wrapper for CTFontRef, so CoreText can alse use UIfont, - but UILabel/UITextView cannot use CTFontRef. - - We use UIFont for both CoreText and UIKit. - */ - UIFont *font = [self yy_attribute:NSFontAttributeName atIndex:index]; - if (kSystemVersion <= 6) { - if (font) { - if (CFGetTypeID((__bridge CFTypeRef)(font)) == CTFontGetTypeID()) { - CTFontRef CTFont = (__bridge CTFontRef)(font); - CFStringRef name = CTFontCopyPostScriptName(CTFont); - CGFloat size = CTFontGetSize(CTFont); - if (!name) { - font = nil; - } else { - font = [UIFont fontWithName:(__bridge NSString *)(name) size:size]; - CFRelease(name); - } - } - } - } - return font; -} - -- (NSNumber *)yy_kern { - return [self yy_kernAtIndex:0]; -} - -- (NSNumber *)yy_kernAtIndex:(NSUInteger)index { - return [self yy_attribute:NSKernAttributeName atIndex:index]; -} - -- (UIColor *)yy_color { - return [self yy_colorAtIndex:0]; -} - -- (UIColor *)yy_colorAtIndex:(NSUInteger)index { - UIColor *color = [self yy_attribute:NSForegroundColorAttributeName atIndex:index]; - if (!color) { - CGColorRef ref = (__bridge CGColorRef)([self yy_attribute:(NSString *)kCTForegroundColorAttributeName atIndex:index]); - color = [UIColor colorWithCGColor:ref]; - } - if (color && ![color isKindOfClass:[UIColor class]]) { - if (CFGetTypeID((__bridge CFTypeRef)(color)) == CGColorGetTypeID()) { - color = [UIColor colorWithCGColor:(__bridge CGColorRef)(color)]; - } else { - color = nil; - } - } - return color; -} - -- (UIColor *)yy_backgroundColor { - return [self yy_backgroundColorAtIndex:0]; -} - -- (UIColor *)yy_backgroundColorAtIndex:(NSUInteger)index { - return [self yy_attribute:NSBackgroundColorAttributeName atIndex:index]; -} - -- (NSNumber *)yy_strokeWidth { - return [self yy_strokeWidthAtIndex:0]; -} - -- (NSNumber *)yy_strokeWidthAtIndex:(NSUInteger)index { - return [self yy_attribute:NSStrokeWidthAttributeName atIndex:index]; -} - -- (UIColor *)yy_strokeColor { - return [self yy_strokeColorAtIndex:0]; -} - -- (UIColor *)yy_strokeColorAtIndex:(NSUInteger)index { - UIColor *color = [self yy_attribute:NSStrokeColorAttributeName atIndex:index]; - if (!color) { - CGColorRef ref = (__bridge CGColorRef)([self yy_attribute:(NSString *)kCTStrokeColorAttributeName atIndex:index]); - color = [UIColor colorWithCGColor:ref]; - } - return color; -} - -- (NSShadow *)yy_shadow { - return [self yy_shadowAtIndex:0]; -} - -- (NSShadow *)yy_shadowAtIndex:(NSUInteger)index { - return [self yy_attribute:NSShadowAttributeName atIndex:index]; -} - -- (NSUnderlineStyle)yy_strikethroughStyle { - return [self yy_strikethroughStyleAtIndex:0]; -} - -- (NSUnderlineStyle)yy_strikethroughStyleAtIndex:(NSUInteger)index { - NSNumber *style = [self yy_attribute:NSStrikethroughStyleAttributeName atIndex:index]; - return style.integerValue; -} - -- (UIColor *)yy_strikethroughColor { - return [self yy_strikethroughColorAtIndex:0]; -} - -- (UIColor *)yy_strikethroughColorAtIndex:(NSUInteger)index { - if (kSystemVersion >= 7) { - return [self yy_attribute:NSStrikethroughColorAttributeName atIndex:index]; - } - return nil; -} - -- (NSUnderlineStyle)yy_underlineStyle { - return [self yy_underlineStyleAtIndex:0]; -} - -- (NSUnderlineStyle)yy_underlineStyleAtIndex:(NSUInteger)index { - NSNumber *style = [self yy_attribute:NSUnderlineStyleAttributeName atIndex:index]; - return style.integerValue; -} - -- (UIColor *)yy_underlineColor { - return [self yy_underlineColorAtIndex:0]; -} - -- (UIColor *)yy_underlineColorAtIndex:(NSUInteger)index { - UIColor *color = nil; - if (kSystemVersion >= 7) { - color = [self yy_attribute:NSUnderlineColorAttributeName atIndex:index]; - } - if (!color) { - CGColorRef ref = (__bridge CGColorRef)([self yy_attribute:(NSString *)kCTUnderlineColorAttributeName atIndex:index]); - color = [UIColor colorWithCGColor:ref]; - } - return color; -} - -- (NSNumber *)yy_ligature { - return [self yy_ligatureAtIndex:0]; -} - -- (NSNumber *)yy_ligatureAtIndex:(NSUInteger)index { - return [self yy_attribute:NSLigatureAttributeName atIndex:index]; -} - -- (NSString *)yy_textEffect { - return [self yy_textEffectAtIndex:0]; -} - -- (NSString *)yy_textEffectAtIndex:(NSUInteger)index { - if (kSystemVersion >= 7) { - return [self yy_attribute:NSTextEffectAttributeName atIndex:index]; - } - return nil; -} - -- (NSNumber *)yy_obliqueness { - return [self yy_obliquenessAtIndex:0]; -} - -- (NSNumber *)yy_obliquenessAtIndex:(NSUInteger)index { - if (kSystemVersion >= 7) { - return [self yy_attribute:NSObliquenessAttributeName atIndex:index]; - } - return nil; -} - -- (NSNumber *)yy_expansion { - return [self yy_expansionAtIndex:0]; -} - -- (NSNumber *)yy_expansionAtIndex:(NSUInteger)index { - if (kSystemVersion >= 7) { - return [self yy_attribute:NSExpansionAttributeName atIndex:index]; - } - return nil; -} - -- (NSNumber *)yy_baselineOffset { - return [self yy_baselineOffsetAtIndex:0]; -} - -- (NSNumber *)yy_baselineOffsetAtIndex:(NSUInteger)index { - if (kSystemVersion >= 7) { - return [self yy_attribute:NSBaselineOffsetAttributeName atIndex:index]; - } - return nil; -} - -- (BOOL)yy_verticalGlyphForm { - return [self yy_verticalGlyphFormAtIndex:0]; -} - -- (BOOL)yy_verticalGlyphFormAtIndex:(NSUInteger)index { - NSNumber *num = [self yy_attribute:NSVerticalGlyphFormAttributeName atIndex:index]; - return num.boolValue; -} - -- (NSString *)yy_language { - return [self yy_languageAtIndex:0]; -} - -- (NSString *)yy_languageAtIndex:(NSUInteger)index { - if (kSystemVersion >= 7) { - return [self yy_attribute:(id)kCTLanguageAttributeName atIndex:index]; - } - return nil; -} - -- (NSArray *)yy_writingDirection { - return [self yy_writingDirectionAtIndex:0]; -} - -- (NSArray *)yy_writingDirectionAtIndex:(NSUInteger)index { - return [self yy_attribute:(id)kCTWritingDirectionAttributeName atIndex:index]; -} - -- (NSParagraphStyle *)yy_paragraphStyle { - return [self yy_paragraphStyleAtIndex:0]; -} - -- (NSParagraphStyle *)yy_paragraphStyleAtIndex:(NSUInteger)index { - /* - NSParagraphStyle is NOT toll-free bridged to CTParagraphStyleRef. - - CoreText can use both NSParagraphStyle and CTParagraphStyleRef, - but UILabel/UITextView can only use NSParagraphStyle. - - We use NSParagraphStyle in both CoreText and UIKit. - */ - NSParagraphStyle *style = [self yy_attribute:NSParagraphStyleAttributeName atIndex:index]; - if (style) { - if (CFGetTypeID((__bridge CFTypeRef)(style)) == CTParagraphStyleGetTypeID()) { \ - style = [NSParagraphStyle yy_styleWithCTStyle:(__bridge CTParagraphStyleRef)(style)]; - } - } - return style; -} - -#define ParagraphAttribute(_attr_) \ -NSParagraphStyle *style = self.yy_paragraphStyle; \ -if (!style) style = [NSParagraphStyle defaultParagraphStyle]; \ -return style. _attr_; - -#define ParagraphAttributeAtIndex(_attr_) \ -NSParagraphStyle *style = [self yy_paragraphStyleAtIndex:index]; \ -if (!style) style = [NSParagraphStyle defaultParagraphStyle]; \ -return style. _attr_; - -- (NSTextAlignment)yy_alignment { - ParagraphAttribute(alignment); -} - -- (NSLineBreakMode)yy_lineBreakMode { - ParagraphAttribute(lineBreakMode); -} - -- (CGFloat)yy_lineSpacing { - ParagraphAttribute(lineSpacing); -} - -- (CGFloat)yy_paragraphSpacing { - ParagraphAttribute(paragraphSpacing); -} - -- (CGFloat)yy_paragraphSpacingBefore { - ParagraphAttribute(paragraphSpacingBefore); -} - -- (CGFloat)yy_firstLineHeadIndent { - ParagraphAttribute(firstLineHeadIndent); -} - -- (CGFloat)yy_headIndent { - ParagraphAttribute(headIndent); -} - -- (CGFloat)yy_tailIndent { - ParagraphAttribute(tailIndent); -} - -- (CGFloat)yy_minimumLineHeight { - ParagraphAttribute(minimumLineHeight); -} - -- (CGFloat)yy_maximumLineHeight { - ParagraphAttribute(maximumLineHeight); -} - -- (CGFloat)yy_lineHeightMultiple { - ParagraphAttribute(lineHeightMultiple); -} - -- (NSWritingDirection)yy_baseWritingDirection { - ParagraphAttribute(baseWritingDirection); -} - -- (float)yy_hyphenationFactor { - ParagraphAttribute(hyphenationFactor); -} - -- (CGFloat)yy_defaultTabInterval { - if (!kiOS7Later) return 0; - ParagraphAttribute(defaultTabInterval); -} - -- (NSArray *)yy_tabStops { - if (!kiOS7Later) return nil; - ParagraphAttribute(tabStops); -} - -- (NSTextAlignment)yy_alignmentAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(alignment); -} - -- (NSLineBreakMode)yy_lineBreakModeAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(lineBreakMode); -} - -- (CGFloat)yy_lineSpacingAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(lineSpacing); -} - -- (CGFloat)yy_paragraphSpacingAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(paragraphSpacing); -} - -- (CGFloat)yy_paragraphSpacingBeforeAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(paragraphSpacingBefore); -} - -- (CGFloat)yy_firstLineHeadIndentAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(firstLineHeadIndent); -} - -- (CGFloat)yy_headIndentAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(headIndent); -} - -- (CGFloat)yy_tailIndentAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(tailIndent); -} - -- (CGFloat)yy_minimumLineHeightAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(minimumLineHeight); -} - -- (CGFloat)yy_maximumLineHeightAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(maximumLineHeight); -} - -- (CGFloat)yy_lineHeightMultipleAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(lineHeightMultiple); -} - -- (NSWritingDirection)yy_baseWritingDirectionAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(baseWritingDirection); -} - -- (float)yy_hyphenationFactorAtIndex:(NSUInteger)index { - ParagraphAttributeAtIndex(hyphenationFactor); -} - -- (CGFloat)yy_defaultTabIntervalAtIndex:(NSUInteger)index { - if (!kiOS7Later) return 0; - ParagraphAttributeAtIndex(defaultTabInterval); -} - -- (NSArray *)yy_tabStopsAtIndex:(NSUInteger)index { - if (!kiOS7Later) return nil; - ParagraphAttributeAtIndex(tabStops); -} - -#undef ParagraphAttribute -#undef ParagraphAttributeAtIndex - -- (YYTextShadow *)yy_textShadow { - return [self yy_textShadowAtIndex:0]; -} - -- (YYTextShadow *)yy_textShadowAtIndex:(NSUInteger)index { - return [self yy_attribute:YYTextShadowAttributeName atIndex:index]; -} - -- (YYTextShadow *)yy_textInnerShadow { - return [self yy_textInnerShadowAtIndex:0]; -} - -- (YYTextShadow *)yy_textInnerShadowAtIndex:(NSUInteger)index { - return [self yy_attribute:YYTextInnerShadowAttributeName atIndex:index]; -} - -- (YYTextDecoration *)yy_textUnderline { - return [self yy_textUnderlineAtIndex:0]; -} - -- (YYTextDecoration *)yy_textUnderlineAtIndex:(NSUInteger)index { - return [self yy_attribute:YYTextUnderlineAttributeName atIndex:index]; -} - -- (YYTextDecoration *)yy_textStrikethrough { - return [self yy_textStrikethroughAtIndex:0]; -} - -- (YYTextDecoration *)yy_textStrikethroughAtIndex:(NSUInteger)index { - return [self yy_attribute:YYTextStrikethroughAttributeName atIndex:index]; -} - -- (YYTextBorder *)yy_textBorder { - return [self yy_textBorderAtIndex:0]; -} - -- (YYTextBorder *)yy_textBorderAtIndex:(NSUInteger)index { - return [self yy_attribute:YYTextBorderAttributeName atIndex:index]; -} - -- (YYTextBorder *)yy_textBackgroundBorder { - return [self yy_textBackgroundBorderAtIndex:0]; -} - -- (YYTextBorder *)yy_textBackgroundBorderAtIndex:(NSUInteger)index { - return [self yy_attribute:YYTextBackedStringAttributeName atIndex:index]; -} - -- (CGAffineTransform)yy_textGlyphTransform { - return [self yy_textGlyphTransformAtIndex:0]; -} - -- (CGAffineTransform)yy_textGlyphTransformAtIndex:(NSUInteger)index { - NSValue *value = [self yy_attribute:YYTextGlyphTransformAttributeName atIndex:index]; - if (!value) return CGAffineTransformIdentity; - return [value CGAffineTransformValue]; -} - -- (NSString *)yy_plainTextForRange:(NSRange)range { - if (range.location == NSNotFound ||range.length == NSNotFound) return nil; - NSMutableString *result = [NSMutableString string]; - if (range.length == 0) return result; - NSString *string = self.string; - [self enumerateAttribute:YYTextBackedStringAttributeName inRange:range options:kNilOptions usingBlock:^(id value, NSRange range, BOOL *stop) { - YYTextBackedString *backed = value; - if (backed && backed.string) { - [result appendString:backed.string]; - } else { - [result appendString:[string substringWithRange:range]]; - } - }]; - return result; -} - -+ (NSMutableAttributedString *)yy_attachmentStringWithContent:(id)content - contentMode:(UIViewContentMode)contentMode - width:(CGFloat)width - ascent:(CGFloat)ascent - descent:(CGFloat)descent { - NSMutableAttributedString *atr = [[NSMutableAttributedString alloc] initWithString:YYTextAttachmentToken]; - - YYTextAttachment *attach = [YYTextAttachment new]; - attach.content = content; - attach.contentMode = contentMode; - [atr yy_setTextAttachment:attach range:NSMakeRange(0, atr.length)]; - - YYTextRunDelegate *delegate = [YYTextRunDelegate new]; - delegate.width = width; - delegate.ascent = ascent; - delegate.descent = descent; - CTRunDelegateRef delegateRef = delegate.CTRunDelegate; - [atr yy_setRunDelegate:delegateRef range:NSMakeRange(0, atr.length)]; - if (delegate) CFRelease(delegateRef); - - return atr; -} - -+ (NSMutableAttributedString *)yy_attachmentStringWithContent:(id)content - contentMode:(UIViewContentMode)contentMode - attachmentSize:(CGSize)attachmentSize - alignToFont:(UIFont *)font - alignment:(YYTextVerticalAlignment)alignment { - NSMutableAttributedString *atr = [[NSMutableAttributedString alloc] initWithString:YYTextAttachmentToken]; - - YYTextAttachment *attach = [YYTextAttachment new]; - attach.content = content; - attach.contentMode = contentMode; - [atr yy_setTextAttachment:attach range:NSMakeRange(0, atr.length)]; - - YYTextRunDelegate *delegate = [YYTextRunDelegate new]; - delegate.width = attachmentSize.width; - switch (alignment) { - case YYTextVerticalAlignmentTop: { - delegate.ascent = font.ascender; - delegate.descent = attachmentSize.height - font.ascender; - if (delegate.descent < 0) { - delegate.descent = 0; - delegate.ascent = attachmentSize.height; - } - } break; - case YYTextVerticalAlignmentCenter: { - CGFloat fontHeight = font.ascender - font.descender; - CGFloat yOffset = font.ascender - fontHeight * 0.5; - delegate.ascent = attachmentSize.height * 0.5 + yOffset; - delegate.descent = attachmentSize.height - delegate.ascent; - if (delegate.descent < 0) { - delegate.descent = 0; - delegate.ascent = attachmentSize.height; - } - } break; - case YYTextVerticalAlignmentBottom: { - delegate.ascent = attachmentSize.height + font.descender; - delegate.descent = -font.descender; - if (delegate.ascent < 0) { - delegate.ascent = 0; - delegate.descent = attachmentSize.height; - } - } break; - default: { - delegate.ascent = attachmentSize.height; - delegate.descent = 0; - } break; - } - - CTRunDelegateRef delegateRef = delegate.CTRunDelegate; - [atr yy_setRunDelegate:delegateRef range:NSMakeRange(0, atr.length)]; - if (delegate) CFRelease(delegateRef); - - return atr; -} - -+ (NSMutableAttributedString *)yy_attachmentStringWithEmojiImage:(UIImage *)image - fontSize:(CGFloat)fontSize { - if (!image || fontSize <= 0) return nil; - - BOOL hasAnim = NO; - if (image.images.count > 1) { - hasAnim = YES; - } else if (NSProtocolFromString(@"YYAnimatedImage") && - [image conformsToProtocol:NSProtocolFromString(@"YYAnimatedImage")]) { - NSNumber *frameCount = [image valueForKey:@"animatedImageFrameCount"]; - if (frameCount.intValue > 1) hasAnim = YES; - } - - CGFloat ascent = YYTextEmojiGetAscentWithFontSize(fontSize); - CGFloat descent = YYTextEmojiGetDescentWithFontSize(fontSize); - CGRect bounding = YYTextEmojiGetGlyphBoundingRectWithFontSize(fontSize); - - YYTextRunDelegate *delegate = [YYTextRunDelegate new]; - delegate.ascent = ascent; - delegate.descent = descent; - delegate.width = bounding.size.width + 2 * bounding.origin.x; - - YYTextAttachment *attachment = [YYTextAttachment new]; - attachment.contentMode = UIViewContentModeScaleAspectFit; - attachment.contentInsets = UIEdgeInsetsMake(ascent - (bounding.size.height + bounding.origin.y), bounding.origin.x, descent + bounding.origin.y, bounding.origin.x); - if (hasAnim) { - Class imageClass = NSClassFromString(@"YYAnimatedImageView"); - if (!imageClass) imageClass = [UIImageView class]; - UIImageView *view = (id)[imageClass new]; - view.frame = bounding; - view.image = image; - view.contentMode = UIViewContentModeScaleAspectFit; - attachment.content = view; - } else { - attachment.content = image; - } - - NSMutableAttributedString *atr = [[NSMutableAttributedString alloc] initWithString:YYTextAttachmentToken]; - [atr yy_setTextAttachment:attachment range:NSMakeRange(0, atr.length)]; - CTRunDelegateRef ctDelegate = delegate.CTRunDelegate; - [atr yy_setRunDelegate:ctDelegate range:NSMakeRange(0, atr.length)]; - if (ctDelegate) CFRelease(ctDelegate); - - return atr; -} - -- (NSRange)yy_rangeOfAll { - return NSMakeRange(0, self.length); -} - -- (BOOL)yy_isSharedAttributesInAllRange { - __block BOOL shared = YES; - __block NSDictionary *firstAttrs = nil; - [self enumerateAttributesInRange:self.yy_rangeOfAll options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:^(NSDictionary *attrs, NSRange range, BOOL *stop) { - if (range.location == 0) { - firstAttrs = attrs; - } else { - if (firstAttrs.count != attrs.count) { - shared = NO; - *stop = YES; - } else if (firstAttrs) { - if (![firstAttrs isEqualToDictionary:attrs]) { - shared = NO; - *stop = YES; - } - } - } - }]; - return shared; -} - -- (BOOL)yy_canDrawWithUIKit { - static NSMutableSet *failSet; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - failSet = [NSMutableSet new]; - [failSet addObject:(id)kCTGlyphInfoAttributeName]; - [failSet addObject:(id)kCTCharacterShapeAttributeName]; - if (kiOS7Later) { - [failSet addObject:(id)kCTLanguageAttributeName]; - } - [failSet addObject:(id)kCTRunDelegateAttributeName]; - [failSet addObject:(id)kCTBaselineClassAttributeName]; - [failSet addObject:(id)kCTBaselineInfoAttributeName]; - [failSet addObject:(id)kCTBaselineReferenceInfoAttributeName]; - if (kiOS8Later) { - [failSet addObject:(id)kCTRubyAnnotationAttributeName]; - } - [failSet addObject:YYTextShadowAttributeName]; - [failSet addObject:YYTextInnerShadowAttributeName]; - [failSet addObject:YYTextUnderlineAttributeName]; - [failSet addObject:YYTextStrikethroughAttributeName]; - [failSet addObject:YYTextBorderAttributeName]; - [failSet addObject:YYTextBackgroundBorderAttributeName]; - [failSet addObject:YYTextBlockBorderAttributeName]; - [failSet addObject:YYTextAttachmentAttributeName]; - [failSet addObject:YYTextHighlightAttributeName]; - [failSet addObject:YYTextGlyphTransformAttributeName]; - }); - -#define Fail { result = NO; *stop = YES; return; } - __block BOOL result = YES; - [self enumerateAttributesInRange:self.yy_rangeOfAll options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:^(NSDictionary *attrs, NSRange range, BOOL *stop) { - if (attrs.count == 0) return; - for (NSString *str in attrs.allKeys) { - if ([failSet containsObject:str]) Fail; - } - if (!kiOS7Later) { - UIFont *font = attrs[NSFontAttributeName]; - if (CFGetTypeID((__bridge CFTypeRef)(font)) == CTFontGetTypeID()) Fail; - } - if (attrs[(id)kCTForegroundColorAttributeName] && !attrs[NSForegroundColorAttributeName]) Fail; - if (attrs[(id)kCTStrokeColorAttributeName] && !attrs[NSStrokeColorAttributeName]) Fail; - if (attrs[(id)kCTUnderlineColorAttributeName]) { - if (!kiOS7Later) Fail; - if (!attrs[NSUnderlineColorAttributeName]) Fail; - } - NSParagraphStyle *style = attrs[NSParagraphStyleAttributeName]; - if (style && CFGetTypeID((__bridge CFTypeRef)(style)) == CTParagraphStyleGetTypeID()) Fail; - }]; - return result; -#undef Fail -} - -@end - -@implementation NSMutableAttributedString (YYText) - -- (void)yy_setAttributes:(NSDictionary *)attributes { - [self setYy_attributes:attributes]; -} - -- (void)setYy_attributes:(NSDictionary *)attributes { - if (attributes == (id)[NSNull null]) attributes = nil; - [self setAttributes:@{} range:NSMakeRange(0, self.length)]; - [attributes enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [self yy_setAttribute:key value:obj]; - }]; -} - -- (void)yy_setAttribute:(NSString *)name value:(id)value { - [self yy_setAttribute:name value:value range:NSMakeRange(0, self.length)]; -} - -- (void)yy_setAttribute:(NSString *)name value:(id)value range:(NSRange)range { - if (!name || [NSNull isEqual:name]) return; - if (value && ![NSNull isEqual:value]) [self addAttribute:name value:value range:range]; - else [self removeAttribute:name range:range]; -} - -- (void)yy_removeAttributesInRange:(NSRange)range { - [self setAttributes:nil range:range]; -} - -#pragma mark - Property Setter - -- (void)setYy_font:(UIFont *)font { - /* - In iOS7 and later, UIFont is toll-free bridged to CTFontRef, - although Apple does not mention it in documentation. - - In iOS6, UIFont is a wrapper for CTFontRef, so CoreText can alse use UIfont, - but UILabel/UITextView cannot use CTFontRef. - - We use UIFont for both CoreText and UIKit. - */ - [self yy_setFont:font range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_kern:(NSNumber *)kern { - [self yy_setKern:kern range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_color:(UIColor *)color { - [self yy_setColor:color range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_backgroundColor:(UIColor *)backgroundColor { - [self yy_setBackgroundColor:backgroundColor range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_strokeWidth:(NSNumber *)strokeWidth { - [self yy_setStrokeWidth:strokeWidth range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_strokeColor:(UIColor *)strokeColor { - [self yy_setStrokeColor:strokeColor range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_shadow:(NSShadow *)shadow { - [self yy_setShadow:shadow range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_strikethroughStyle:(NSUnderlineStyle)strikethroughStyle { - [self yy_setStrikethroughStyle:strikethroughStyle range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_strikethroughColor:(UIColor *)strikethroughColor { - [self yy_setStrikethroughColor:strikethroughColor range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_underlineStyle:(NSUnderlineStyle)underlineStyle { - [self yy_setUnderlineStyle:underlineStyle range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_underlineColor:(UIColor *)underlineColor { - [self yy_setUnderlineColor:underlineColor range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_ligature:(NSNumber *)ligature { - [self yy_setLigature:ligature range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_textEffect:(NSString *)textEffect { - [self yy_setTextEffect:textEffect range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_obliqueness:(NSNumber *)obliqueness { - [self yy_setObliqueness:obliqueness range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_expansion:(NSNumber *)expansion { - [self yy_setExpansion:expansion range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_baselineOffset:(NSNumber *)baselineOffset { - [self yy_setBaselineOffset:baselineOffset range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_verticalGlyphForm:(BOOL)verticalGlyphForm { - [self yy_setVerticalGlyphForm:verticalGlyphForm range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_language:(NSString *)language { - [self yy_setLanguage:language range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_writingDirection:(NSArray *)writingDirection { - [self yy_setWritingDirection:writingDirection range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_paragraphStyle:(NSParagraphStyle *)paragraphStyle { - /* - NSParagraphStyle is NOT toll-free bridged to CTParagraphStyleRef. - - CoreText can use both NSParagraphStyle and CTParagraphStyleRef, - but UILabel/UITextView can only use NSParagraphStyle. - - We use NSParagraphStyle in both CoreText and UIKit. - */ - [self yy_setParagraphStyle:paragraphStyle range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_alignment:(NSTextAlignment)alignment { - [self yy_setAlignment:alignment range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_baseWritingDirection:(NSWritingDirection)baseWritingDirection { - [self yy_setBaseWritingDirection:baseWritingDirection range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_lineSpacing:(CGFloat)lineSpacing { - [self yy_setLineSpacing:lineSpacing range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_paragraphSpacing:(CGFloat)paragraphSpacing { - [self yy_setParagraphSpacing:paragraphSpacing range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_paragraphSpacingBefore:(CGFloat)paragraphSpacingBefore { - [self yy_setParagraphSpacing:paragraphSpacingBefore range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_firstLineHeadIndent:(CGFloat)firstLineHeadIndent { - [self yy_setFirstLineHeadIndent:firstLineHeadIndent range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_headIndent:(CGFloat)headIndent { - [self yy_setHeadIndent:headIndent range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_tailIndent:(CGFloat)tailIndent { - [self yy_setTailIndent:tailIndent range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_lineBreakMode:(NSLineBreakMode)lineBreakMode { - [self yy_setLineBreakMode:lineBreakMode range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_minimumLineHeight:(CGFloat)minimumLineHeight { - [self yy_setMinimumLineHeight:minimumLineHeight range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_maximumLineHeight:(CGFloat)maximumLineHeight { - [self yy_setMaximumLineHeight:maximumLineHeight range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_lineHeightMultiple:(CGFloat)lineHeightMultiple { - [self yy_setLineHeightMultiple:lineHeightMultiple range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_hyphenationFactor:(float)hyphenationFactor { - [self yy_setHyphenationFactor:hyphenationFactor range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_defaultTabInterval:(CGFloat)defaultTabInterval { - [self yy_setDefaultTabInterval:defaultTabInterval range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_tabStops:(NSArray *)tabStops { - [self yy_setTabStops:tabStops range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_textShadow:(YYTextShadow *)textShadow { - [self yy_setTextShadow:textShadow range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_textInnerShadow:(YYTextShadow *)textInnerShadow { - [self yy_setTextInnerShadow:textInnerShadow range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_textUnderline:(YYTextDecoration *)textUnderline { - [self yy_setTextUnderline:textUnderline range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_textStrikethrough:(YYTextDecoration *)textStrikethrough { - [self yy_setTextStrikethrough:textStrikethrough range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_textBorder:(YYTextBorder *)textBorder { - [self yy_setTextBorder:textBorder range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_textBackgroundBorder:(YYTextBorder *)textBackgroundBorder { - [self yy_setTextBackgroundBorder:textBackgroundBorder range:NSMakeRange(0, self.length)]; -} - -- (void)setYy_textGlyphTransform:(CGAffineTransform)textGlyphTransform { - [self yy_setTextGlyphTransform:textGlyphTransform range:NSMakeRange(0, self.length)]; -} - -#pragma mark - Range Setter - -- (void)yy_setFont:(UIFont *)font range:(NSRange)range { - /* - In iOS7 and later, UIFont is toll-free bridged to CTFontRef, - although Apple does not mention it in documentation. - - In iOS6, UIFont is a wrapper for CTFontRef, so CoreText can alse use UIfont, - but UILabel/UITextView cannot use CTFontRef. - - We use UIFont for both CoreText and UIKit. - */ - [self yy_setAttribute:NSFontAttributeName value:font range:range]; -} - -- (void)yy_setKern:(NSNumber *)kern range:(NSRange)range { - [self yy_setAttribute:NSKernAttributeName value:kern range:range]; -} - -- (void)yy_setColor:(UIColor *)color range:(NSRange)range { - [self yy_setAttribute:(id)kCTForegroundColorAttributeName value:(id)color.CGColor range:range]; - [self yy_setAttribute:NSForegroundColorAttributeName value:color range:range]; -} - -- (void)yy_setBackgroundColor:(UIColor *)backgroundColor range:(NSRange)range { - [self yy_setAttribute:NSBackgroundColorAttributeName value:backgroundColor range:range]; -} - -- (void)yy_setStrokeWidth:(NSNumber *)strokeWidth range:(NSRange)range { - [self yy_setAttribute:NSStrokeWidthAttributeName value:strokeWidth range:range]; -} - -- (void)yy_setStrokeColor:(UIColor *)strokeColor range:(NSRange)range { - [self yy_setAttribute:(id)kCTStrokeColorAttributeName value:(id)strokeColor.CGColor range:range]; - [self yy_setAttribute:NSStrokeColorAttributeName value:strokeColor range:range]; -} - -- (void)yy_setShadow:(NSShadow *)shadow range:(NSRange)range { - [self yy_setAttribute:NSShadowAttributeName value:shadow range:range]; -} - -- (void)yy_setStrikethroughStyle:(NSUnderlineStyle)strikethroughStyle range:(NSRange)range { - NSNumber *style = strikethroughStyle == 0 ? nil : @(strikethroughStyle); - [self yy_setAttribute:NSStrikethroughStyleAttributeName value:style range:range]; -} - -- (void)yy_setStrikethroughColor:(UIColor *)strikethroughColor range:(NSRange)range { - if (kSystemVersion >= 7) { - [self yy_setAttribute:NSStrikethroughColorAttributeName value:strikethroughColor range:range]; - } -} - -- (void)yy_setUnderlineStyle:(NSUnderlineStyle)underlineStyle range:(NSRange)range { - NSNumber *style = underlineStyle == 0 ? nil : @(underlineStyle); - [self yy_setAttribute:NSUnderlineStyleAttributeName value:style range:range]; -} - -- (void)yy_setUnderlineColor:(UIColor *)underlineColor range:(NSRange)range { - [self yy_setAttribute:(id)kCTUnderlineColorAttributeName value:(id)underlineColor.CGColor range:range]; - if (kSystemVersion >= 7) { - [self yy_setAttribute:NSUnderlineColorAttributeName value:underlineColor range:range]; - } -} - -- (void)yy_setLigature:(NSNumber *)ligature range:(NSRange)range { - [self yy_setAttribute:NSLigatureAttributeName value:ligature range:range]; -} - -- (void)yy_setTextEffect:(NSString *)textEffect range:(NSRange)range { - if (kSystemVersion >= 7) { - [self yy_setAttribute:NSTextEffectAttributeName value:textEffect range:range]; - } -} - -- (void)yy_setObliqueness:(NSNumber *)obliqueness range:(NSRange)range { - if (kSystemVersion >= 7) { - [self yy_setAttribute:NSObliquenessAttributeName value:obliqueness range:range]; - } -} - -- (void)yy_setExpansion:(NSNumber *)expansion range:(NSRange)range { - if (kSystemVersion >= 7) { - [self yy_setAttribute:NSExpansionAttributeName value:expansion range:range]; - } -} - -- (void)yy_setBaselineOffset:(NSNumber *)baselineOffset range:(NSRange)range { - if (kSystemVersion >= 7) { - [self yy_setAttribute:NSBaselineOffsetAttributeName value:baselineOffset range:range]; - } -} - -- (void)yy_setVerticalGlyphForm:(BOOL)verticalGlyphForm range:(NSRange)range { - NSNumber *v = verticalGlyphForm ? @(YES) : nil; - [self yy_setAttribute:NSVerticalGlyphFormAttributeName value:v range:range]; -} - -- (void)yy_setLanguage:(NSString *)language range:(NSRange)range { - if (kSystemVersion >= 7) { - [self yy_setAttribute:(id)kCTLanguageAttributeName value:language range:range]; - } -} - -- (void)yy_setWritingDirection:(NSArray *)writingDirection range:(NSRange)range { - [self yy_setAttribute:(id)kCTWritingDirectionAttributeName value:writingDirection range:range]; -} - -- (void)yy_setParagraphStyle:(NSParagraphStyle *)paragraphStyle range:(NSRange)range { - /* - NSParagraphStyle is NOT toll-free bridged to CTParagraphStyleRef. - - CoreText can use both NSParagraphStyle and CTParagraphStyleRef, - but UILabel/UITextView can only use NSParagraphStyle. - - We use NSParagraphStyle in both CoreText and UIKit. - */ - [self yy_setAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:range]; -} - -#define ParagraphStyleSet(_attr_) \ -[self enumerateAttribute:NSParagraphStyleAttributeName \ - inRange:range \ - options:kNilOptions \ - usingBlock: ^(NSParagraphStyle *value, NSRange subRange, BOOL *stop) { \ - NSMutableParagraphStyle *style = nil; \ - if (value) { \ - if (CFGetTypeID((__bridge CFTypeRef)(value)) == CTParagraphStyleGetTypeID()) { \ - value = [NSParagraphStyle yy_styleWithCTStyle:(__bridge CTParagraphStyleRef)(value)]; \ - } \ - if (value. _attr_ == _attr_) return; \ - if ([value isKindOfClass:[NSMutableParagraphStyle class]]) { \ - style = (id)value; \ - } else { \ - style = value.mutableCopy; \ - } \ - } else { \ - if ([NSParagraphStyle defaultParagraphStyle]. _attr_ == _attr_) return; \ - style = [NSParagraphStyle defaultParagraphStyle].mutableCopy; \ - } \ - style. _attr_ = _attr_; \ - [self yy_setParagraphStyle:style range:subRange]; \ - }]; - -- (void)yy_setAlignment:(NSTextAlignment)alignment range:(NSRange)range { - ParagraphStyleSet(alignment); -} - -- (void)yy_setBaseWritingDirection:(NSWritingDirection)baseWritingDirection range:(NSRange)range { - ParagraphStyleSet(baseWritingDirection); -} - -- (void)yy_setLineSpacing:(CGFloat)lineSpacing range:(NSRange)range { - ParagraphStyleSet(lineSpacing); -} - -- (void)yy_setParagraphSpacing:(CGFloat)paragraphSpacing range:(NSRange)range { - ParagraphStyleSet(paragraphSpacing); -} - -- (void)yy_setParagraphSpacingBefore:(CGFloat)paragraphSpacingBefore range:(NSRange)range { - ParagraphStyleSet(paragraphSpacingBefore); -} - -- (void)yy_setFirstLineHeadIndent:(CGFloat)firstLineHeadIndent range:(NSRange)range { - ParagraphStyleSet(firstLineHeadIndent); -} - -- (void)yy_setHeadIndent:(CGFloat)headIndent range:(NSRange)range { - ParagraphStyleSet(headIndent); -} - -- (void)yy_setTailIndent:(CGFloat)tailIndent range:(NSRange)range { - ParagraphStyleSet(tailIndent); -} - -- (void)yy_setLineBreakMode:(NSLineBreakMode)lineBreakMode range:(NSRange)range { - ParagraphStyleSet(lineBreakMode); -} - -- (void)yy_setMinimumLineHeight:(CGFloat)minimumLineHeight range:(NSRange)range { - ParagraphStyleSet(minimumLineHeight); -} - -- (void)yy_setMaximumLineHeight:(CGFloat)maximumLineHeight range:(NSRange)range { - ParagraphStyleSet(maximumLineHeight); -} - -- (void)yy_setLineHeightMultiple:(CGFloat)lineHeightMultiple range:(NSRange)range { - ParagraphStyleSet(lineHeightMultiple); -} - -- (void)yy_setHyphenationFactor:(float)hyphenationFactor range:(NSRange)range { - ParagraphStyleSet(hyphenationFactor); -} - -- (void)yy_setDefaultTabInterval:(CGFloat)defaultTabInterval range:(NSRange)range { - if (!kiOS7Later) return; - ParagraphStyleSet(defaultTabInterval); -} - -- (void)yy_setTabStops:(NSArray *)tabStops range:(NSRange)range { - if (!kiOS7Later) return; - ParagraphStyleSet(tabStops); -} - -#undef ParagraphStyleSet - -- (void)yy_setSuperscript:(NSNumber *)superscript range:(NSRange)range { - if ([superscript isEqualToNumber:@(0)]) { - superscript = nil; - } - [self yy_setAttribute:(id)kCTSuperscriptAttributeName value:superscript range:range]; -} - -- (void)yy_setGlyphInfo:(CTGlyphInfoRef)glyphInfo range:(NSRange)range { - [self yy_setAttribute:(id)kCTGlyphInfoAttributeName value:(__bridge id)glyphInfo range:range]; -} - -- (void)yy_setCharacterShape:(NSNumber *)characterShape range:(NSRange)range { - [self yy_setAttribute:(id)kCTCharacterShapeAttributeName value:characterShape range:range]; -} - -- (void)yy_setRunDelegate:(CTRunDelegateRef)runDelegate range:(NSRange)range { - [self yy_setAttribute:(id)kCTRunDelegateAttributeName value:(__bridge id)runDelegate range:range]; -} - -- (void)yy_setBaselineClass:(CFStringRef)baselineClass range:(NSRange)range { - [self yy_setAttribute:(id)kCTBaselineClassAttributeName value:(__bridge id)baselineClass range:range]; -} - -- (void)yy_setBaselineInfo:(CFDictionaryRef)baselineInfo range:(NSRange)range { - [self yy_setAttribute:(id)kCTBaselineInfoAttributeName value:(__bridge id)baselineInfo range:range]; -} - -- (void)yy_setBaselineReferenceInfo:(CFDictionaryRef)referenceInfo range:(NSRange)range { - [self yy_setAttribute:(id)kCTBaselineReferenceInfoAttributeName value:(__bridge id)referenceInfo range:range]; -} - -- (void)yy_setRubyAnnotation:(CTRubyAnnotationRef)ruby range:(NSRange)range { - if (kSystemVersion >= 8) { - [self yy_setAttribute:(id)kCTRubyAnnotationAttributeName value:(__bridge id)ruby range:range]; - } -} - -- (void)yy_setAttachment:(NSTextAttachment *)attachment range:(NSRange)range { - if (kSystemVersion >= 7) { - [self yy_setAttribute:NSAttachmentAttributeName value:attachment range:range]; - } -} - -- (void)yy_setLink:(id)link range:(NSRange)range { - if (kSystemVersion >= 7) { - [self yy_setAttribute:NSLinkAttributeName value:link range:range]; - } -} - -- (void)yy_setTextBackedString:(YYTextBackedString *)textBackedString range:(NSRange)range { - [self yy_setAttribute:YYTextBackedStringAttributeName value:textBackedString range:range]; -} - -- (void)yy_setTextBinding:(YYTextBinding *)textBinding range:(NSRange)range { - [self yy_setAttribute:YYTextBindingAttributeName value:textBinding range:range]; -} - -- (void)yy_setTextShadow:(YYTextShadow *)textShadow range:(NSRange)range { - [self yy_setAttribute:YYTextShadowAttributeName value:textShadow range:range]; -} - -- (void)yy_setTextInnerShadow:(YYTextShadow *)textInnerShadow range:(NSRange)range { - [self yy_setAttribute:YYTextInnerShadowAttributeName value:textInnerShadow range:range]; -} - -- (void)yy_setTextUnderline:(YYTextDecoration *)textUnderline range:(NSRange)range { - [self yy_setAttribute:YYTextUnderlineAttributeName value:textUnderline range:range]; -} - -- (void)yy_setTextStrikethrough:(YYTextDecoration *)textStrikethrough range:(NSRange)range { - [self yy_setAttribute:YYTextStrikethroughAttributeName value:textStrikethrough range:range]; -} - -- (void)yy_setTextBorder:(YYTextBorder *)textBorder range:(NSRange)range { - [self yy_setAttribute:YYTextBorderAttributeName value:textBorder range:range]; -} - -- (void)yy_setTextBackgroundBorder:(YYTextBorder *)textBackgroundBorder range:(NSRange)range { - [self yy_setAttribute:YYTextBackgroundBorderAttributeName value:textBackgroundBorder range:range]; -} - -- (void)yy_setTextAttachment:(YYTextAttachment *)textAttachment range:(NSRange)range { - [self yy_setAttribute:YYTextAttachmentAttributeName value:textAttachment range:range]; -} - -- (void)yy_setTextHighlight:(YYTextHighlight *)textHighlight range:(NSRange)range { - [self yy_setAttribute:YYTextHighlightAttributeName value:textHighlight range:range]; -} - -- (void)yy_setTextBlockBorder:(YYTextBorder *)textBlockBorder range:(NSRange)range { - [self yy_setAttribute:YYTextBlockBorderAttributeName value:textBlockBorder range:range]; -} - -- (void)yy_setTextRubyAnnotation:(YYTextRubyAnnotation *)ruby range:(NSRange)range { - if (kiOS8Later) { - CTRubyAnnotationRef rubyRef = [ruby CTRubyAnnotation]; - [self yy_setRubyAnnotation:rubyRef range:range]; - if (rubyRef) CFRelease(rubyRef); - } -} - -- (void)yy_setTextGlyphTransform:(CGAffineTransform)textGlyphTransform range:(NSRange)range { - NSValue *value = CGAffineTransformIsIdentity(textGlyphTransform) ? nil : [NSValue valueWithCGAffineTransform:textGlyphTransform]; - [self yy_setAttribute:YYTextGlyphTransformAttributeName value:value range:range]; -} - -- (void)yy_setTextHighlightRange:(NSRange)range - color:(UIColor *)color - backgroundColor:(UIColor *)backgroundColor - userInfo:(NSDictionary *)userInfo - tapAction:(YYTextAction)tapAction - longPressAction:(YYTextAction)longPressAction { - YYTextHighlight *highlight = [YYTextHighlight highlightWithBackgroundColor:backgroundColor]; - highlight.userInfo = userInfo; - highlight.tapAction = tapAction; - highlight.longPressAction = longPressAction; - if (color) [self yy_setColor:color range:range]; - [self yy_setTextHighlight:highlight range:range]; -} - -- (void)yy_setTextHighlightRange:(NSRange)range - color:(UIColor *)color - backgroundColor:(UIColor *)backgroundColor - tapAction:(YYTextAction)tapAction { - [self yy_setTextHighlightRange:range - color:color - backgroundColor:backgroundColor - userInfo:nil - tapAction:tapAction - longPressAction:nil]; -} - -- (void)yy_setTextHighlightRange:(NSRange)range - color:(UIColor *)color - backgroundColor:(UIColor *)backgroundColor - userInfo:(NSDictionary *)userInfo { - [self yy_setTextHighlightRange:range - color:color - backgroundColor:backgroundColor - userInfo:userInfo - tapAction:nil - longPressAction:nil]; -} - -- (void)yy_insertString:(NSString *)string atIndex:(NSUInteger)location { - [self replaceCharactersInRange:NSMakeRange(location, 0) withString:string]; - [self yy_removeDiscontinuousAttributesInRange:NSMakeRange(location, string.length)]; -} - -- (void)yy_appendString:(NSString *)string { - NSUInteger length = self.length; - [self replaceCharactersInRange:NSMakeRange(length, 0) withString:string]; - [self yy_removeDiscontinuousAttributesInRange:NSMakeRange(length, string.length)]; -} - -- (void)yy_setClearColorToJoinedEmoji { - NSString *str = self.string; - if (str.length < 8) return; - - // Most string do not contains the joined-emoji, test the joiner first. - BOOL containsJoiner = NO; - { - CFStringRef cfStr = (__bridge CFStringRef)str; - BOOL needFree = NO; - UniChar *chars = NULL; - chars = (void *)CFStringGetCharactersPtr(cfStr); - if (!chars) { - chars = malloc(str.length * sizeof(UniChar)); - if (chars) { - needFree = YES; - CFStringGetCharacters(cfStr, CFRangeMake(0, str.length), chars); - } - } - if (!chars) { // fail to get unichar.. - containsJoiner = YES; - } else { - for (int i = 0, max = (int)str.length; i < max; i++) { - if (chars[i] == 0x200D) { // 'ZERO WIDTH JOINER' (U+200D) - containsJoiner = YES; - break; - } - } - if (needFree) free(chars); - } - } - if (!containsJoiner) return; - - // NSRegularExpression is designed to be immutable and thread safe. - static NSRegularExpression *regex; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - regex = [NSRegularExpression regularExpressionWithPattern:@"((👨‍👩‍👧‍👦|👨‍👩‍👦‍👦|👨‍👩‍👧‍👧|👩‍👩‍👧‍👦|👩‍👩‍👦‍👦|👩‍👩‍👧‍👧|👨‍👨‍👧‍👦|👨‍👨‍👦‍👦|👨‍👨‍👧‍👧)+|(👨‍👩‍👧|👩‍👩‍👦|👩‍👩‍👧|👨‍👨‍👦|👨‍👨‍👧))" options:kNilOptions error:nil]; - }); - - UIColor *clear = [UIColor clearColor]; - [regex enumerateMatchesInString:str options:kNilOptions range:NSMakeRange(0, str.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - [self yy_setColor:clear range:result.range]; - }]; -} - -- (void)yy_removeDiscontinuousAttributesInRange:(NSRange)range { - NSArray *keys = [NSMutableAttributedString yy_allDiscontinuousAttributeKeys]; - for (NSString *key in keys) { - [self removeAttribute:key range:range]; - } -} - -+ (NSArray *)yy_allDiscontinuousAttributeKeys { - static NSMutableArray *keys; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - keys = @[(id)kCTSuperscriptAttributeName, - (id)kCTRunDelegateAttributeName, - YYTextBackedStringAttributeName, - YYTextBindingAttributeName, - YYTextAttachmentAttributeName].mutableCopy; - if (kiOS8Later) { - [keys addObject:(id)kCTRubyAnnotationAttributeName]; - } - if (kiOS7Later) { - [keys addObject:NSAttachmentAttributeName]; - } - }); - return keys; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Utility/NSParagraphStyle+YYText.h b/iOSProject/Pods/YYText/YYText/Utility/NSParagraphStyle+YYText.h deleted file mode 100644 index 49b8acd7..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/NSParagraphStyle+YYText.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// NSParagraphStyle+YYText.h -// YYText -// -// Created by ibireme on 14/10/7. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `NSParagraphStyle` to work with CoreText. - */ -@interface NSParagraphStyle (YYText) - -/** - Creates a new NSParagraphStyle object from the CoreText Style. - - @param CTStyle CoreText Paragraph Style. - - @return a new NSParagraphStyle - */ -+ (nullable NSParagraphStyle *)yy_styleWithCTStyle:(CTParagraphStyleRef)CTStyle; - -/** - Creates and returns a CoreText Paragraph Style. (need call CFRelease() after used) - */ -- (nullable CTParagraphStyleRef)yy_CTStyle CF_RETURNS_RETAINED; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Utility/NSParagraphStyle+YYText.m b/iOSProject/Pods/YYText/YYText/Utility/NSParagraphStyle+YYText.m deleted file mode 100644 index 55e68915..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/NSParagraphStyle+YYText.m +++ /dev/null @@ -1,230 +0,0 @@ -// -// NSParagraphStyle+YYText.m -// YYText -// -// Created by ibireme on 14/10/7. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "NSParagraphStyle+YYText.h" -#import "YYTextAttribute.h" -#import - -// Dummy class for category -@interface NSParagraphStyle_YYText : NSObject @end -@implementation NSParagraphStyle_YYText @end - - -@implementation NSParagraphStyle (YYText) - -+ (NSParagraphStyle *)yy_styleWithCTStyle:(CTParagraphStyleRef)CTStyle { - if (CTStyle == NULL) return nil; - - NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - CGFloat lineSpacing; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &lineSpacing)) { - style.lineSpacing = lineSpacing; - } -#pragma clang diagnostic pop - - CGFloat paragraphSpacing; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierParagraphSpacing, sizeof(CGFloat), ¶graphSpacing)) { - style.paragraphSpacing = paragraphSpacing; - } - - CTTextAlignment alignment; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierAlignment, sizeof(CTTextAlignment), &alignment)) { - style.alignment = NSTextAlignmentFromCTTextAlignment(alignment); - } - - CGFloat firstLineHeadIndent; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierFirstLineHeadIndent, sizeof(CGFloat), &firstLineHeadIndent)) { - style.firstLineHeadIndent = firstLineHeadIndent; - } - - CGFloat headIndent; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierHeadIndent, sizeof(CGFloat), &headIndent)) { - style.headIndent = headIndent; - } - - CGFloat tailIndent; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierTailIndent, sizeof(CGFloat), &tailIndent)) { - style.tailIndent = tailIndent; - } - - CTLineBreakMode lineBreakMode; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierLineBreakMode, sizeof(CTLineBreakMode), &lineBreakMode)) { - style.lineBreakMode = (NSLineBreakMode)lineBreakMode; - } - - CGFloat minimumLineHeight; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierMinimumLineHeight, sizeof(CGFloat), &minimumLineHeight)) { - style.minimumLineHeight = minimumLineHeight; - } - - CGFloat maximumLineHeight; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierMaximumLineHeight, sizeof(CGFloat), &maximumLineHeight)) { - style.maximumLineHeight = maximumLineHeight; - } - - CTWritingDirection baseWritingDirection; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierBaseWritingDirection, sizeof(CTWritingDirection), &baseWritingDirection)) { - style.baseWritingDirection = (NSWritingDirection)baseWritingDirection; - } - - CGFloat lineHeightMultiple; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierLineHeightMultiple, sizeof(CGFloat), &lineHeightMultiple)) { - style.lineHeightMultiple = lineHeightMultiple; - } - - CGFloat paragraphSpacingBefore; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierParagraphSpacingBefore, sizeof(CGFloat), ¶graphSpacingBefore)) { - style.paragraphSpacingBefore = paragraphSpacingBefore; - } - - if ([style respondsToSelector:@selector(tabStops)]) { - CFArrayRef tabStops; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierTabStops, sizeof(CFArrayRef), &tabStops)) { - if ([style respondsToSelector:@selector(setTabStops:)]) { - NSMutableArray *tabs = [NSMutableArray new]; - [((__bridge NSArray *)(tabStops))enumerateObjectsUsingBlock : ^(id obj, NSUInteger idx, BOOL *stop) { - CTTextTabRef ctTab = (__bridge CFTypeRef)obj; - - NSTextTab *tab = [[NSTextTab alloc] initWithTextAlignment:NSTextAlignmentFromCTTextAlignment(CTTextTabGetAlignment(ctTab)) location:CTTextTabGetLocation(ctTab) options:(__bridge id)CTTextTabGetOptions(ctTab)]; - [tabs addObject:tab]; - }]; - if (tabs.count) { - style.tabStops = tabs; - } - } - } - - CGFloat defaultTabInterval; - if (CTParagraphStyleGetValueForSpecifier(CTStyle, kCTParagraphStyleSpecifierDefaultTabInterval, sizeof(CGFloat), &defaultTabInterval)) { - if ([style respondsToSelector:@selector(setDefaultTabInterval:)]) { - style.defaultTabInterval = defaultTabInterval; - } - } - } - - return style; -} - -- (CTParagraphStyleRef)yy_CTStyle CF_RETURNS_RETAINED { - CTParagraphStyleSetting set[kCTParagraphStyleSpecifierCount] = { 0 }; - int count = 0; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - CGFloat lineSpacing = self.lineSpacing; - set[count].spec = kCTParagraphStyleSpecifierLineSpacing; - set[count].valueSize = sizeof(CGFloat); - set[count].value = &lineSpacing; - count++; -#pragma clang diagnostic pop - - CGFloat paragraphSpacing = self.paragraphSpacing; - set[count].spec = kCTParagraphStyleSpecifierParagraphSpacing; - set[count].valueSize = sizeof(CGFloat); - set[count].value = ¶graphSpacing; - count++; - - CTTextAlignment alignment = NSTextAlignmentToCTTextAlignment(self.alignment); - set[count].spec = kCTParagraphStyleSpecifierAlignment; - set[count].valueSize = sizeof(CTTextAlignment); - set[count].value = &alignment; - count++; - - CGFloat firstLineHeadIndent = self.firstLineHeadIndent; - set[count].spec = kCTParagraphStyleSpecifierFirstLineHeadIndent; - set[count].valueSize = sizeof(CGFloat); - set[count].value = &firstLineHeadIndent; - count++; - - CGFloat headIndent = self.headIndent; - set[count].spec = kCTParagraphStyleSpecifierHeadIndent; - set[count].valueSize = sizeof(CGFloat); - set[count].value = &headIndent; - count++; - - CGFloat tailIndent = self.tailIndent; - set[count].spec = kCTParagraphStyleSpecifierTailIndent; - set[count].valueSize = sizeof(CGFloat); - set[count].value = &tailIndent; - count++; - - CTLineBreakMode paraLineBreak = (CTLineBreakMode)self.lineBreakMode; - set[count].spec = kCTParagraphStyleSpecifierLineBreakMode; - set[count].valueSize = sizeof(CTLineBreakMode); - set[count].value = ¶LineBreak; - count++; - - CGFloat minimumLineHeight = self.minimumLineHeight; - set[count].spec = kCTParagraphStyleSpecifierMinimumLineHeight; - set[count].valueSize = sizeof(CGFloat); - set[count].value = &minimumLineHeight; - count++; - - CGFloat maximumLineHeight = self.maximumLineHeight; - set[count].spec = kCTParagraphStyleSpecifierMaximumLineHeight; - set[count].valueSize = sizeof(CGFloat); - set[count].value = &maximumLineHeight; - count++; - - CTWritingDirection paraWritingDirection = (CTWritingDirection)self.baseWritingDirection; - set[count].spec = kCTParagraphStyleSpecifierBaseWritingDirection; - set[count].valueSize = sizeof(CTWritingDirection); - set[count].value = ¶WritingDirection; - count++; - - CGFloat lineHeightMultiple = self.lineHeightMultiple; - set[count].spec = kCTParagraphStyleSpecifierLineHeightMultiple; - set[count].valueSize = sizeof(CGFloat); - set[count].value = &lineHeightMultiple; - count++; - - CGFloat paragraphSpacingBefore = self.paragraphSpacingBefore; - set[count].spec = kCTParagraphStyleSpecifierParagraphSpacingBefore; - set[count].valueSize = sizeof(CGFloat); - set[count].value = ¶graphSpacingBefore; - count++; - - if([self respondsToSelector:@selector(tabStops)]) { - NSMutableArray *tabs = [NSMutableArray array]; - if ([self respondsToSelector:@selector(tabStops)]) { - NSInteger numTabs = self.tabStops.count; - if (numTabs) { - [self.tabStops enumerateObjectsUsingBlock: ^(NSTextTab *tab, NSUInteger idx, BOOL *stop) { - CTTextTabRef ctTab = CTTextTabCreate(NSTextAlignmentToCTTextAlignment(tab.alignment), tab.location, (__bridge CFTypeRef)tab.options); - [tabs addObject:(__bridge id)ctTab]; - CFRelease(ctTab); - }]; - - CFArrayRef tabStops = (__bridge CFArrayRef)(tabs); - set[count].spec = kCTParagraphStyleSpecifierTabStops; - set[count].valueSize = sizeof(CFArrayRef); - set[count].value = &tabStops; - count++; - } - } - - if ([self respondsToSelector:@selector(defaultTabInterval)]) { - CGFloat defaultTabInterval = self.defaultTabInterval; - set[count].spec = kCTParagraphStyleSpecifierDefaultTabInterval; - set[count].valueSize = sizeof(CGFloat); - set[count].value = &defaultTabInterval; - count++; - } - } - - CTParagraphStyleRef style = CTParagraphStyleCreate(set, count); - return style; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Utility/UIPasteboard+YYText.h b/iOSProject/Pods/YYText/YYText/Utility/UIPasteboard+YYText.h deleted file mode 100644 index d516a3d4..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/UIPasteboard+YYText.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// UIPasteboard+YYText.h -// YYText -// -// Created by ibireme on 15/4/2. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Extend UIPasteboard to support image and attributed string. - */ -@interface UIPasteboard (YYText) - -@property (nullable, nonatomic, copy) NSData *yy_PNGData; ///< PNG file data -@property (nullable, nonatomic, copy) NSData *yy_JPEGData; ///< JPEG file data -@property (nullable, nonatomic, copy) NSData *yy_GIFData; ///< GIF file data -@property (nullable, nonatomic, copy) NSData *yy_WEBPData; ///< WebP file data -@property (nullable, nonatomic, copy) NSData *yy_ImageData; ///< image file data - -/// Attributed string, -/// Set this attributed will also set the string property which is copy from the attributed string. -/// If the attributed string contains one or more image, it will also set the `images` property. -@property (nullable, nonatomic, copy) NSAttributedString *yy_AttributedString; - -@end - - -/// The name identifying the attributed string in pasteboard. -UIKIT_EXTERN NSString *const YYTextPasteboardTypeAttributedString; - -/// The UTI Type identifying WebP data in pasteboard. -UIKIT_EXTERN NSString *const YYTextUTTypeWEBP; - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Utility/UIPasteboard+YYText.m b/iOSProject/Pods/YYText/YYText/Utility/UIPasteboard+YYText.m deleted file mode 100644 index 29a86f21..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/UIPasteboard+YYText.m +++ /dev/null @@ -1,146 +0,0 @@ -// -// UIPasteboard+YYText.m -// YYText -// -// Created by ibireme on 15/4/2. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIPasteboard+YYText.h" -#import "NSAttributedString+YYText.h" -#import - - -#if __has_include("YYImage.h") -#import "YYImage.h" -#define YYTextAnimatedImageAvailable 1 -#elif __has_include() -#import -#define YYTextAnimatedImageAvailable 1 -#elif __has_include() -#import -#define YYTextAnimatedImageAvailable 1 -#else -#define YYTextAnimatedImageAvailable 0 -#endif - - -// Dummy class for category -@interface UIPasteboard_YYText : NSObject @end -@implementation UIPasteboard_YYText @end - - -NSString *const YYTextPasteboardTypeAttributedString = @"com.ibireme.NSAttributedString"; -NSString *const YYTextUTTypeWEBP = @"com.google.webp"; - -@implementation UIPasteboard (YYText) - - -- (void)setYy_PNGData:(NSData *)PNGData { - [self setData:PNGData forPasteboardType:(id)kUTTypePNG]; -} - -- (NSData *)yy_PNGData { - return [self dataForPasteboardType:(id)kUTTypePNG]; -} - -- (void)setYy_JPEGData:(NSData *)JPEGData { - [self setData:JPEGData forPasteboardType:(id)kUTTypeJPEG]; -} - -- (NSData *)yy_JPEGData { - return [self dataForPasteboardType:(id)kUTTypeJPEG]; -} - -- (void)setYy_GIFData:(NSData *)GIFData { - [self setData:GIFData forPasteboardType:(id)kUTTypeGIF]; -} - -- (NSData *)yy_GIFData { - return [self dataForPasteboardType:(id)kUTTypeGIF]; -} - -- (void)setYy_WEBPData:(NSData *)WEBPData { - [self setData:WEBPData forPasteboardType:YYTextUTTypeWEBP]; -} - -- (NSData *)yy_WEBPData { - return [self dataForPasteboardType:YYTextUTTypeWEBP]; -} - -- (void)setYy_ImageData:(NSData *)imageData { - [self setData:imageData forPasteboardType:(id)kUTTypeImage]; -} - -- (NSData *)yy_ImageData { - return [self dataForPasteboardType:(id)kUTTypeImage]; -} - -- (void)setYy_AttributedString:(NSAttributedString *)attributedString { - self.string = [attributedString yy_plainTextForRange:NSMakeRange(0, attributedString.length)]; - NSData *data = [attributedString yy_archiveToData]; - if (data) { - NSDictionary *item = @{YYTextPasteboardTypeAttributedString : data}; - [self addItems:@[item]]; - } - [attributedString enumerateAttribute:YYTextAttachmentAttributeName inRange:NSMakeRange(0, attributedString.length) options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:^(YYTextAttachment *attachment, NSRange range, BOOL *stop) { - - // save image - UIImage *simpleImage = nil; - if ([attachment.content isKindOfClass:[UIImage class]]) { - simpleImage = attachment.content; - } else if ([attachment.content isKindOfClass:[UIImageView class]]) { - simpleImage = ((UIImageView *)attachment.content).image; - } - if (simpleImage) { - NSDictionary *item = @{@"com.apple.uikit.image" : simpleImage}; - [self addItems:@[item]]; - } - -#if YYTextAnimatedImageAvailable - // save animated image - if ([attachment.content isKindOfClass:[UIImageView class]]) { - UIImageView *imageView = attachment.content; - Class aniImageClass = NSClassFromString(@"YYImage"); - UIImage *image = imageView.image; - if (aniImageClass && [image isKindOfClass:aniImageClass]) { - NSData *data = [image valueForKey:@"animatedImageData"]; - NSNumber *type = [image valueForKey:@"animatedImageType"]; - if (data) { - switch (type.unsignedIntegerValue) { - case YYImageTypeGIF: { - NSDictionary *item = @{(id)kUTTypeGIF : data}; - [self addItems:@[item]]; - } break; - case YYImageTypePNG: { // APNG - NSDictionary *item = @{(id)kUTTypePNG : data}; - [self addItems:@[item]]; - } break; - case YYImageTypeWebP: { - NSDictionary *item = @{(id)YYTextUTTypeWEBP : data}; - [self addItems:@[item]]; - } break; - default: break; - } - } - } - } -#endif - - }]; -} - -- (NSAttributedString *)yy_AttributedString { - for (NSDictionary *items in self.items) { - NSData *data = items[YYTextPasteboardTypeAttributedString]; - if (data) { - return [NSAttributedString yy_unarchiveFromData:data]; - } - } - return nil; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Utility/UIView+YYText.h b/iOSProject/Pods/YYText/YYText/Utility/UIView+YYText.h deleted file mode 100644 index 9472834a..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/UIView+YYText.h +++ /dev/null @@ -1,72 +0,0 @@ -// -// UIView+YYText.h -// YYText -// -// Created by ibireme on 13/4/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - Provides extensions for `UIView`. - */ -@interface UIView (YYText) - -/** - Returns the view's view controller (may be nil). - */ -@property (nullable, nonatomic, readonly) UIViewController *yy_viewController; - -/** - Returns the visible alpha on screen, taking into account superview and window. - */ -@property (nonatomic, readonly) CGFloat yy_visibleAlpha; - -/** - Converts a point from the receiver's coordinate system to that of the specified view or window. - - @param point A point specified in the local coordinate system (bounds) of the receiver. - @param view The view or window into whose coordinate system point is to be converted. - If view is nil, this method instead converts to window base coordinates. - @return The point converted to the coordinate system of view. - */ -- (CGPoint)yy_convertPoint:(CGPoint)point toViewOrWindow:(UIView *)view; - -/** - Converts a point from the coordinate system of a given view or window to that of the receiver. - - @param point A point specified in the local coordinate system (bounds) of view. - @param view The view or window with point in its coordinate system. - If view is nil, this method instead converts from window base coordinates. - @return The point converted to the local coordinate system (bounds) of the receiver. - */ -- (CGPoint)yy_convertPoint:(CGPoint)point fromViewOrWindow:(UIView *)view; - -/** - Converts a rectangle from the receiver's coordinate system to that of another view or window. - - @param rect A rectangle specified in the local coordinate system (bounds) of the receiver. - @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. - @return The converted rectangle. - */ -- (CGRect)yy_convertRect:(CGRect)rect toViewOrWindow:(UIView *)view; - -/** - Converts a rectangle from the coordinate system of another view or window to that of the receiver. - - @param rect A rectangle specified in the local coordinate system (bounds) of view. - @param view The view or window with rect in its coordinate system. - If view is nil, this method instead converts from window base coordinates. - @return The converted rectangle. - */ -- (CGRect)yy_convertRect:(CGRect)rect fromViewOrWindow:(UIView *)view; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Utility/UIView+YYText.m b/iOSProject/Pods/YYText/YYText/Utility/UIView+YYText.m deleted file mode 100644 index f1c4c537..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/UIView+YYText.m +++ /dev/null @@ -1,123 +0,0 @@ -// -// UIView+YYText.m -// YYText -// -// Created by ibireme on 13/4/3. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "UIView+YYText.h" - -// Dummy class for category -@interface UIView_YYText : NSObject @end -@implementation UIView_YYText @end - - -@implementation UIView (YYText) - -- (UIViewController *)yy_viewController { - for (UIView *view = self; view; view = view.superview) { - UIResponder *nextResponder = [view nextResponder]; - if ([nextResponder isKindOfClass:[UIViewController class]]) { - return (UIViewController *)nextResponder; - } - } - return nil; -} - -- (CGFloat)yy_visibleAlpha { - if ([self isKindOfClass:[UIWindow class]]) { - if (self.hidden) return 0; - return self.alpha; - } - if (!self.window) return 0; - CGFloat alpha = 1; - UIView *v = self; - while (v) { - if (v.hidden) { - alpha = 0; - break; - } - alpha *= v.alpha; - v = v.superview; - } - return alpha; -} - -- (CGPoint)yy_convertPoint:(CGPoint)point toViewOrWindow:(UIView *)view { - if (!view) { - if ([self isKindOfClass:[UIWindow class]]) { - return [((UIWindow *)self) convertPoint:point toWindow:nil]; - } else { - return [self convertPoint:point toView:nil]; - } - } - - UIWindow *from = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window; - UIWindow *to = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - if ((!from || !to) || (from == to)) return [self convertPoint:point toView:view]; - point = [self convertPoint:point toView:from]; - point = [to convertPoint:point fromWindow:from]; - point = [view convertPoint:point fromView:to]; - return point; -} - -- (CGPoint)yy_convertPoint:(CGPoint)point fromViewOrWindow:(UIView *)view { - if (!view) { - if ([self isKindOfClass:[UIWindow class]]) { - return [((UIWindow *)self) convertPoint:point fromWindow:nil]; - } else { - return [self convertPoint:point fromView:nil]; - } - } - - UIWindow *from = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - UIWindow *to = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window; - if ((!from || !to) || (from == to)) return [self convertPoint:point fromView:view]; - point = [from convertPoint:point fromView:view]; - point = [to convertPoint:point fromWindow:from]; - point = [self convertPoint:point fromView:to]; - return point; -} - -- (CGRect)yy_convertRect:(CGRect)rect toViewOrWindow:(UIView *)view { - if (!view) { - if ([self isKindOfClass:[UIWindow class]]) { - return [((UIWindow *)self) convertRect:rect toWindow:nil]; - } else { - return [self convertRect:rect toView:nil]; - } - } - - UIWindow *from = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window; - UIWindow *to = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - if (!from || !to) return [self convertRect:rect toView:view]; - if (from == to) return [self convertRect:rect toView:view]; - rect = [self convertRect:rect toView:from]; - rect = [to convertRect:rect fromWindow:from]; - rect = [view convertRect:rect fromView:to]; - return rect; -} - -- (CGRect)yy_convertRect:(CGRect)rect fromViewOrWindow:(UIView *)view { - if (!view) { - if ([self isKindOfClass:[UIWindow class]]) { - return [((UIWindow *)self) convertRect:rect fromWindow:nil]; - } else { - return [self convertRect:rect fromView:nil]; - } - } - - UIWindow *from = [view isKindOfClass:[UIWindow class]] ? (id)view : view.window; - UIWindow *to = [self isKindOfClass:[UIWindow class]] ? (id)self : self.window; - if ((!from || !to) || (from == to)) return [self convertRect:rect fromView:view]; - rect = [from convertRect:rect fromView:view]; - rect = [to convertRect:rect fromWindow:from]; - rect = [self convertRect:rect fromView:to]; - return rect; -} - -@end \ No newline at end of file diff --git a/iOSProject/Pods/YYText/YYText/Utility/YYTextAsyncLayer.h b/iOSProject/Pods/YYText/YYText/Utility/YYTextAsyncLayer.h deleted file mode 100644 index 9d00826a..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/YYTextAsyncLayer.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// YYTextAsyncLayer.h -// YYText -// -// Created by ibireme on 15/4/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import - -@class YYTextAsyncLayerDisplayTask; - -NS_ASSUME_NONNULL_BEGIN - -/** - The YYTextAsyncLayer class is a subclass of CALayer used for render contents asynchronously. - - @discussion When the layer need update it's contents, it will ask the delegate - for a async display task to render the contents in a background queue. - */ -@interface YYTextAsyncLayer : CALayer -/// Whether the render code is executed in background. Default is YES. -@property BOOL displaysAsynchronously; -@end - - -/** - The YYTextAsyncLayer's delegate protocol. The delegate of the YYTextAsyncLayer (typically a UIView) - must implements the method in this protocol. - */ -@protocol YYTextAsyncLayerDelegate -@required -/// This method is called to return a new display task when the layer's contents need update. -- (YYTextAsyncLayerDisplayTask *)newAsyncDisplayTask; -@end - - -/** - A display task used by YYTextAsyncLayer to render the contents in background queue. - */ -@interface YYTextAsyncLayerDisplayTask : NSObject - -/** - This block will be called before the asynchronous drawing begins. - It will be called on the main thread. - - @param layer The layer. - */ -@property (nullable, nonatomic, copy) void (^willDisplay)(CALayer *layer); - -/** - This block is called to draw the layer's contents. - - @discussion This block may be called on main thread or background thread, - so is should be thread-safe. - - @param context A new bitmap content created by layer. - @param size The content size (typically same as layer's bound size). - @param isCancelled If this block returns `YES`, the method should cancel the - drawing process and return as quickly as possible. - */ -@property (nullable, nonatomic, copy) void (^display)(CGContextRef context, CGSize size, BOOL(^isCancelled)(void)); - -/** - This block will be called after the asynchronous drawing finished. - It will be called on the main thread. - - @param layer The layer. - @param finished If the draw process is cancelled, it's `NO`, otherwise it's `YES`; - */ -@property (nullable, nonatomic, copy) void (^didDisplay)(CALayer *layer, BOOL finished); - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Utility/YYTextAsyncLayer.m b/iOSProject/Pods/YYText/YYText/Utility/YYTextAsyncLayer.m deleted file mode 100644 index e94bc47e..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/YYTextAsyncLayer.m +++ /dev/null @@ -1,234 +0,0 @@ -// -// YYTextAsyncLayer.m -// YYText -// -// Created by ibireme on 15/4/11. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextAsyncLayer.h" -#import - - -/// Global display queue, used for content rendering. -static dispatch_queue_t YYTextAsyncLayerGetDisplayQueue() { -#define MAX_QUEUE_COUNT 16 - static int queueCount; - static dispatch_queue_t queues[MAX_QUEUE_COUNT]; - static dispatch_once_t onceToken; - static int32_t counter = 0; - dispatch_once(&onceToken, ^{ - queueCount = (int)[NSProcessInfo processInfo].activeProcessorCount; - queueCount = queueCount < 1 ? 1 : queueCount > MAX_QUEUE_COUNT ? MAX_QUEUE_COUNT : queueCount; - if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0) { - for (NSUInteger i = 0; i < queueCount; i++) { - dispatch_queue_attr_t attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INITIATED, 0); - queues[i] = dispatch_queue_create("com.ibireme.text.render", attr); - } - } else { - for (NSUInteger i = 0; i < queueCount; i++) { - queues[i] = dispatch_queue_create("com.ibireme.text.render", DISPATCH_QUEUE_SERIAL); - dispatch_set_target_queue(queues[i], dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)); - } - } - }); - uint32_t cur = (uint32_t)OSAtomicIncrement32(&counter); - return queues[(cur) % queueCount]; -#undef MAX_QUEUE_COUNT -} - -static dispatch_queue_t YYTextAsyncLayerGetReleaseQueue() { -#ifdef YYDispatchQueuePool_h - return YYDispatchQueueGetForQOS(NSQualityOfServiceDefault); -#else - return dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0); -#endif -} - - -/// a thread safe incrementing counter. -@interface _YYTextSentinel : NSObject -/// Returns the current value of the counter. -@property (atomic, readonly) int32_t value; -/// Increase the value atomically. @return The new value. -- (int32_t)increase; -@end - -@implementation _YYTextSentinel { - int32_t _value; -} -- (int32_t)value { - return _value; -} -- (int32_t)increase { - return OSAtomicIncrement32(&_value); -} -@end - - -@implementation YYTextAsyncLayerDisplayTask -@end - - -@implementation YYTextAsyncLayer { - _YYTextSentinel *_sentinel; -} - -#pragma mark - Override - -+ (id)defaultValueForKey:(NSString *)key { - if ([key isEqualToString:@"displaysAsynchronously"]) { - return @(YES); - } else { - return [super defaultValueForKey:key]; - } -} - -- (instancetype)init { - self = [super init]; - static CGFloat scale; //global - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - scale = [UIScreen mainScreen].scale; - }); - self.contentsScale = scale; - _sentinel = [_YYTextSentinel new]; - _displaysAsynchronously = YES; - return self; -} - -- (void)dealloc { - [_sentinel increase]; -} - -- (void)setNeedsDisplay { - [self _cancelAsyncDisplay]; - [super setNeedsDisplay]; -} - -- (void)display { - super.contents = super.contents; - [self _displayAsync:_displaysAsynchronously]; -} - -#pragma mark - Private - -- (void)_displayAsync:(BOOL)async { - __strong id delegate = (id)self.delegate; - YYTextAsyncLayerDisplayTask *task = [delegate newAsyncDisplayTask]; - if (!task.display) { - if (task.willDisplay) task.willDisplay(self); - self.contents = nil; - if (task.didDisplay) task.didDisplay(self, YES); - return; - } - - if (async) { - if (task.willDisplay) task.willDisplay(self); - _YYTextSentinel *sentinel = _sentinel; - int32_t value = sentinel.value; - BOOL (^isCancelled)() = ^BOOL() { - return value != sentinel.value; - }; - CGSize size = self.bounds.size; - BOOL opaque = self.opaque; - CGFloat scale = self.contentsScale; - CGColorRef backgroundColor = (opaque && self.backgroundColor) ? CGColorRetain(self.backgroundColor) : NULL; - if (size.width < 1 || size.height < 1) { - CGImageRef image = (__bridge_retained CGImageRef)(self.contents); - self.contents = nil; - if (image) { - dispatch_async(YYTextAsyncLayerGetReleaseQueue(), ^{ - CFRelease(image); - }); - } - if (task.didDisplay) task.didDisplay(self, YES); - CGColorRelease(backgroundColor); - return; - } - - dispatch_async(YYTextAsyncLayerGetDisplayQueue(), ^{ - if (isCancelled()) { - CGColorRelease(backgroundColor); - return; - } - UIGraphicsBeginImageContextWithOptions(size, opaque, scale); - CGContextRef context = UIGraphicsGetCurrentContext(); - if (opaque) { - CGContextSaveGState(context); { - if (!backgroundColor || CGColorGetAlpha(backgroundColor) < 1) { - CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor); - CGContextAddRect(context, CGRectMake(0, 0, size.width * scale, size.height * scale)); - CGContextFillPath(context); - } - if (backgroundColor) { - CGContextSetFillColorWithColor(context, backgroundColor); - CGContextAddRect(context, CGRectMake(0, 0, size.width * scale, size.height * scale)); - CGContextFillPath(context); - } - } CGContextRestoreGState(context); - CGColorRelease(backgroundColor); - } - task.display(context, size, isCancelled); - if (isCancelled()) { - UIGraphicsEndImageContext(); - dispatch_async(dispatch_get_main_queue(), ^{ - if (task.didDisplay) task.didDisplay(self, NO); - }); - return; - } - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - if (isCancelled()) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (task.didDisplay) task.didDisplay(self, NO); - }); - return; - } - dispatch_async(dispatch_get_main_queue(), ^{ - if (isCancelled()) { - if (task.didDisplay) task.didDisplay(self, NO); - } else { - self.contents = (__bridge id)(image.CGImage); - if (task.didDisplay) task.didDisplay(self, YES); - } - }); - }); - } else { - [_sentinel increase]; - if (task.willDisplay) task.willDisplay(self); - UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, self.contentsScale); - CGContextRef context = UIGraphicsGetCurrentContext(); - if (self.opaque) { - CGSize size = self.bounds.size; - size.width *= self.contentsScale; - size.height *= self.contentsScale; - CGContextSaveGState(context); { - if (!self.backgroundColor || CGColorGetAlpha(self.backgroundColor) < 1) { - CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor); - CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height)); - CGContextFillPath(context); - } - if (self.backgroundColor) { - CGContextSetFillColorWithColor(context, self.backgroundColor); - CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height)); - CGContextFillPath(context); - } - } CGContextRestoreGState(context); - } - task.display(context, self.bounds.size, ^{return NO;}); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - self.contents = (__bridge id)(image.CGImage); - if (task.didDisplay) task.didDisplay(self, YES); - } -} - -- (void)_cancelAsyncDisplay { - [_sentinel increase]; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Utility/YYTextTransaction.h b/iOSProject/Pods/YYText/YYText/Utility/YYTextTransaction.h deleted file mode 100644 index 22124f71..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/YYTextTransaction.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// YYTextTransaction.h -// YYText -// -// Created by ibireme on 15/4/18. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - YYTextTransaction let you perform a selector once before current runloop sleep. - */ -@interface YYTextTransaction : NSObject - -/** - Creates and returns a transaction with a specified target and selector. - - @param target A specified target, the target is retained until runloop end. - @param selector A selector for target. - - @return A new transaction, or nil if an error occurs. - */ -+ (YYTextTransaction *)transactionWithTarget:(id)target selector:(SEL)selector; - -/** - Commit the trancaction to main runloop. - - @discussion It will perform the selector on the target once before main runloop's - current loop sleep. If the same transaction (same target and same selector) has - already commit to runloop in this loop, this method do nothing. - */ -- (void)commit; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Utility/YYTextTransaction.m b/iOSProject/Pods/YYText/YYText/Utility/YYTextTransaction.m deleted file mode 100644 index 3ced2492..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/YYTextTransaction.m +++ /dev/null @@ -1,81 +0,0 @@ -// -// YYTextTransaction.m -// YYText -// -// Created by ibireme on 15/4/18. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextTransaction.h" - - -@interface YYTextTransaction() -@property (nonatomic, strong) id target; -@property (nonatomic, assign) SEL selector; -@end - -static NSMutableSet *transactionSet = nil; - -static void YYRunLoopObserverCallBack(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { - if (transactionSet.count == 0) return; - NSSet *currentSet = transactionSet; - transactionSet = [NSMutableSet new]; - [currentSet enumerateObjectsUsingBlock:^(YYTextTransaction *transaction, BOOL *stop) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" - [transaction.target performSelector:transaction.selector]; -#pragma clang diagnostic pop - }]; -} - -static void YYTextTransactionSetup() { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - transactionSet = [NSMutableSet new]; - CFRunLoopRef runloop = CFRunLoopGetMain(); - CFRunLoopObserverRef observer; - - observer = CFRunLoopObserverCreate(CFAllocatorGetDefault(), - kCFRunLoopBeforeWaiting | kCFRunLoopExit, - true, // repeat - 0xFFFFFF, // after CATransaction(2000000) - YYRunLoopObserverCallBack, NULL); - CFRunLoopAddObserver(runloop, observer, kCFRunLoopCommonModes); - CFRelease(observer); - }); -} - - -@implementation YYTextTransaction - -+ (YYTextTransaction *)transactionWithTarget:(id)target selector:(SEL)selector{ - if (!target || !selector) return nil; - YYTextTransaction *t = [YYTextTransaction new]; - t.target = target; - t.selector = selector; - return t; -} - -- (void)commit { - if (!_target || !_selector) return; - YYTextTransactionSetup(); - [transactionSet addObject:self]; -} - -- (NSUInteger)hash { - long v1 = (long)((void *)_selector); - long v2 = (long)_target; - return v1 ^ v2; -} - -- (BOOL)isEqual:(id)object { - if (self == object) return YES; - if (![object isMemberOfClass:self.class]) return NO; - YYTextTransaction *other = object; - return other.selector == _selector && other.target == _target; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/Utility/YYTextUtilities.h b/iOSProject/Pods/YYText/YYText/Utility/YYTextUtilities.h deleted file mode 100644 index 9410c9b2..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/YYTextUtilities.h +++ /dev/null @@ -1,563 +0,0 @@ -// -// YYTextUtilities.h -// YYText -// -// Created by ibireme on 15/4/6. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import -#import -#import - - -#ifndef YYTEXT_CLAMP // return the clamped value -#define YYTEXT_CLAMP(_x_, _low_, _high_) (((_x_) > (_high_)) ? (_high_) : (((_x_) < (_low_)) ? (_low_) : (_x_))) -#endif - -#ifndef YYTEXT_SWAP // swap two value -#define YYTEXT_SWAP(_a_, _b_) do { __typeof__(_a_) _tmp_ = (_a_); (_a_) = (_b_); (_b_) = _tmp_; } while (0) -#endif - -NS_ASSUME_NONNULL_BEGIN - -/** - Whether the character is 'line break char': - U+000D (\\r or CR) - U+2028 (Unicode line separator) - U+000A (\\n or LF) - U+2029 (Unicode paragraph separator) - - @param c A character - @return YES or NO. - */ -static inline BOOL YYTextIsLinebreakChar(unichar c) { - switch (c) { - case 0x000D: - case 0x2028: - case 0x000A: - case 0x2029: - return YES; - default: - return NO; - } -} - -/** - Whether the string is a 'line break': - U+000D (\\r or CR) - U+2028 (Unicode line separator) - U+000A (\\n or LF) - U+2029 (Unicode paragraph separator) - \\r\\n, in that order (also known as CRLF) - - @param str A string - @return YES or NO. - */ -static inline BOOL YYTextIsLinebreakString(NSString * _Nullable str) { - if (str.length > 2 || str.length == 0) return NO; - if (str.length == 1) { - unichar c = [str characterAtIndex:0]; - return YYTextIsLinebreakChar(c); - } else { - return ([str characterAtIndex:0] == '\r') && ([str characterAtIndex:1] == '\n'); - } -} - -/** - If the string has a 'line break' suffix, return the 'line break' length. - - @param str A string. - @return The length of the tail line break: 0, 1 or 2. - */ -static inline NSUInteger YYTextLinebreakTailLength(NSString * _Nullable str) { - if (str.length >= 2) { - unichar c2 = [str characterAtIndex:str.length - 1]; - if (YYTextIsLinebreakChar(c2)) { - unichar c1 = [str characterAtIndex:str.length - 2]; - if (c1 == '\r' && c2 == '\n') return 2; - else return 1; - } else { - return 0; - } - } else if (str.length == 1) { - return YYTextIsLinebreakChar([str characterAtIndex:0]) ? 1 : 0; - } else { - return 0; - } -} - -/** - Convert `UIDataDetectorTypes` to `NSTextCheckingType`. - - @param types The `UIDataDetectorTypes` type. - @return The `NSTextCheckingType` type. - */ -static inline NSTextCheckingType YYTextNSTextCheckingTypeFromUIDataDetectorType(UIDataDetectorTypes types) { - NSTextCheckingType t = 0; - if (types & UIDataDetectorTypePhoneNumber) t |= NSTextCheckingTypePhoneNumber; - if (types & UIDataDetectorTypeLink) t |= NSTextCheckingTypeLink; - if (types & UIDataDetectorTypeAddress) t |= NSTextCheckingTypeAddress; - if (types & UIDataDetectorTypeCalendarEvent) t |= NSTextCheckingTypeDate; - return t; -} - -/** - Whether the font is `AppleColorEmoji` font. - - @param font A font. - @return YES: the font is Emoji, NO: the font is not Emoji. - */ -static inline BOOL YYTextUIFontIsEmoji(UIFont *font) { - return [font.fontName isEqualToString:@"AppleColorEmoji"]; -} - -/** - Whether the font is `AppleColorEmoji` font. - - @param font A font. - @return YES: the font is Emoji, NO: the font is not Emoji. - */ -static inline BOOL YYTextCTFontIsEmoji(CTFontRef font) { - BOOL isEmoji = NO; - CFStringRef name = CTFontCopyPostScriptName(font); - if (name && CFEqual(CFSTR("AppleColorEmoji"), name)) isEmoji = YES; - if (name) CFRelease(name); - return isEmoji; -} - -/** - Whether the font is `AppleColorEmoji` font. - - @param font A font. - @return YES: the font is Emoji, NO: the font is not Emoji. - */ -static inline BOOL YYTextCGFontIsEmoji(CGFontRef font) { - BOOL isEmoji = NO; - CFStringRef name = CGFontCopyPostScriptName(font); - if (name && CFEqual(CFSTR("AppleColorEmoji"), name)) isEmoji = YES; - if (name) CFRelease(name); - return isEmoji; -} - -/** - Whether the font contains color bitmap glyphs. - - @discussion Only `AppleColorEmoji` contains color bitmap glyphs in iOS system fonts. - @param font A font. - @return YES: the font contains color bitmap glyphs, NO: the font has no color bitmap glyph. - */ -static inline BOOL YYTextCTFontContainsColorBitmapGlyphs(CTFontRef font) { - return (CTFontGetSymbolicTraits(font) & kCTFontTraitColorGlyphs) != 0; -} - -/** - Whether the glyph is bitmap. - - @param font The glyph's font. - @param glyph The glyph which is created from the specified font. - @return YES: the glyph is bitmap, NO: the glyph is vector. - */ -static inline BOOL YYTextCGGlyphIsBitmap(CTFontRef font, CGGlyph glyph) { - if (!font && !glyph) return NO; - if (!YYTextCTFontContainsColorBitmapGlyphs(font)) return NO; - CGPathRef path = CTFontCreatePathForGlyph(font, glyph, NULL); - if (path) { - CFRelease(path); - return NO; - } - return YES; -} - -/** - Get the `AppleColorEmoji` font's ascent with a specified font size. - It may used to create custom emoji. - - @param fontSize The specified font size. - @return The font ascent. - */ -static inline CGFloat YYTextEmojiGetAscentWithFontSize(CGFloat fontSize) { - if (fontSize < 16) { - return 1.25 * fontSize; - } else if (16 <= fontSize && fontSize <= 24) { - return 0.5 * fontSize + 12; - } else { - return fontSize; - } -} - -/** - Get the `AppleColorEmoji` font's descent with a specified font size. - It may used to create custom emoji. - - @param fontSize The specified font size. - @return The font descent. - */ -static inline CGFloat YYTextEmojiGetDescentWithFontSize(CGFloat fontSize) { - if (fontSize < 16) { - return 0.390625 * fontSize; - } else if (16 <= fontSize && fontSize <= 24) { - return 0.15625 * fontSize + 3.75; - } else { - return 0.3125 * fontSize; - } - return 0; -} - -/** - Get the `AppleColorEmoji` font's glyph bounding rect with a specified font size. - It may used to create custom emoji. - - @param fontSize The specified font size. - @return The font glyph bounding rect. - */ -static inline CGRect YYTextEmojiGetGlyphBoundingRectWithFontSize(CGFloat fontSize) { - CGRect rect; - rect.origin.x = 0.75; - rect.size.width = rect.size.height = YYTextEmojiGetAscentWithFontSize(fontSize); - if (fontSize < 16) { - rect.origin.y = -0.2525 * fontSize; - } else if (16 <= fontSize && fontSize <= 24) { - rect.origin.y = 0.1225 * fontSize -6; - } else { - rect.origin.y = -0.1275 * fontSize; - } - return rect; -} - - -/** - Get the character set which should rotate in vertical form. - @return The shared character set. - */ -NSCharacterSet *YYTextVerticalFormRotateCharacterSet(); - -/** - Get the character set which should rotate and move in vertical form. - @return The shared character set. - */ -NSCharacterSet *YYTextVerticalFormRotateAndMoveCharacterSet(); - - - -/// Convert degrees to radians. -static inline CGFloat YYTextDegreesToRadians(CGFloat degrees) { - return degrees * M_PI / 180; -} - -/// Convert radians to degrees. -static inline CGFloat YYTextRadiansToDegrees(CGFloat radians) { - return radians * 180 / M_PI; -} - - - -/// Get the transform rotation. -/// @return the rotation in radians [-PI,PI] ([-180°,180°]) -static inline CGFloat YYTextCGAffineTransformGetRotation(CGAffineTransform transform) { - return atan2(transform.b, transform.a); -} - -/// Get the transform's scale.x -static inline CGFloat YYTextCGAffineTransformGetScaleX(CGAffineTransform transform) { - return sqrt(transform.a * transform.a + transform.c * transform.c); -} - -/// Get the transform's scale.y -static inline CGFloat YYTextCGAffineTransformGetScaleY(CGAffineTransform transform) { - return sqrt(transform.b * transform.b + transform.d * transform.d); -} - -/// Get the transform's translate.x -static inline CGFloat YYTextCGAffineTransformGetTranslateX(CGAffineTransform transform) { - return transform.tx; -} - -/// Get the transform's translate.y -static inline CGFloat YYTextCGAffineTransformGetTranslateY(CGAffineTransform transform) { - return transform.ty; -} - -/** - If you have 3 pair of points transformed by a same CGAffineTransform: - p1 (transform->) q1 - p2 (transform->) q2 - p3 (transform->) q3 - This method returns the original transform matrix from these 3 pair of points. - - @see http://stackoverflow.com/questions/13291796/calculate-values-for-a-cgaffinetransform-from-three-points-in-each-of-two-uiview - */ -CGAffineTransform YYTextCGAffineTransformGetFromPoints(CGPoint before[3], CGPoint after[3]); - -/// Get the transform which can converts a point from the coordinate system of a given view to another. -CGAffineTransform YYTextCGAffineTransformGetFromViews(UIView *from, UIView *to); - -/// Create a skew transform. -static inline CGAffineTransform YYTextCGAffineTransformMakeSkew(CGFloat x, CGFloat y){ - CGAffineTransform transform = CGAffineTransformIdentity; - transform.c = -x; - transform.b = y; - return transform; -} - -/// Negates/inverts a UIEdgeInsets. -static inline UIEdgeInsets YYTextUIEdgeInsetsInvert(UIEdgeInsets insets) { - return UIEdgeInsetsMake(-insets.top, -insets.left, -insets.bottom, -insets.right); -} - -/// Convert CALayer's gravity string to UIViewContentMode. -UIViewContentMode YYTextCAGravityToUIViewContentMode(NSString *gravity); - -/// Convert UIViewContentMode to CALayer's gravity string. -NSString *YYTextUIViewContentModeToCAGravity(UIViewContentMode contentMode); - - - -/** - Returns a rectangle to fit the @param rect with specified content mode. - - @param rect The constrant rect - @param size The content size - @param mode The content mode - @return A rectangle for the given content mode. - @discussion UIViewContentModeRedraw is same as UIViewContentModeScaleToFill. - */ -CGRect YYTextCGRectFitWithContentMode(CGRect rect, CGSize size, UIViewContentMode mode); - -/// Returns the center for the rectangle. -static inline CGPoint YYTextCGRectGetCenter(CGRect rect) { - return CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)); -} - -/// Returns the area of the rectangle. -static inline CGFloat YYTextCGRectGetArea(CGRect rect) { - if (CGRectIsNull(rect)) return 0; - rect = CGRectStandardize(rect); - return rect.size.width * rect.size.height; -} - -/// Returns the distance between two points. -static inline CGFloat YYTextCGPointGetDistanceToPoint(CGPoint p1, CGPoint p2) { - return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y)); -} - -/// Returns the minmium distance between a point to a rectangle. -static inline CGFloat YYTextCGPointGetDistanceToRect(CGPoint p, CGRect r) { - r = CGRectStandardize(r); - if (CGRectContainsPoint(r, p)) return 0; - CGFloat distV, distH; - if (CGRectGetMinY(r) <= p.y && p.y <= CGRectGetMaxY(r)) { - distV = 0; - } else { - distV = p.y < CGRectGetMinY(r) ? CGRectGetMinY(r) - p.y : p.y - CGRectGetMaxY(r); - } - if (CGRectGetMinX(r) <= p.x && p.x <= CGRectGetMaxX(r)) { - distH = 0; - } else { - distH = p.x < CGRectGetMinX(r) ? CGRectGetMinX(r) - p.x : p.x - CGRectGetMaxX(r); - } - return MAX(distV, distH); -} - - -/// Get main screen's scale. -CGFloat YYTextScreenScale(); - -/// Get main screen's size. Height is always larger than width. -CGSize YYTextScreenSize(); - -/// Convert point to pixel. -static inline CGFloat YYTextCGFloatToPixel(CGFloat value) { - return value * YYTextScreenScale(); -} - -/// Convert pixel to point. -static inline CGFloat YYTextCGFloatFromPixel(CGFloat value) { - return value / YYTextScreenScale(); -} - -/// floor point value for pixel-aligned -static inline CGFloat YYTextCGFloatPixelFloor(CGFloat value) { - CGFloat scale = YYTextScreenScale(); - return floor(value * scale) / scale; -} - -/// round point value for pixel-aligned -static inline CGFloat YYTextCGFloatPixelRound(CGFloat value) { - CGFloat scale = YYTextScreenScale(); - return round(value * scale) / scale; -} - -/// ceil point value for pixel-aligned -static inline CGFloat YYTextCGFloatPixelCeil(CGFloat value) { - CGFloat scale = YYTextScreenScale(); - return ceil(value * scale) / scale; -} - -/// round point value to .5 pixel for path stroke (odd pixel line width pixel-aligned) -static inline CGFloat YYTextCGFloatPixelHalf(CGFloat value) { - CGFloat scale = YYTextScreenScale(); - return (floor(value * scale) + 0.5) / scale; -} - -/// floor point value for pixel-aligned -static inline CGPoint YYTextCGPointPixelFloor(CGPoint point) { - CGFloat scale = YYTextScreenScale(); - return CGPointMake(floor(point.x * scale) / scale, - floor(point.y * scale) / scale); -} - -/// round point value for pixel-aligned -static inline CGPoint YYTextCGPointPixelRound(CGPoint point) { - CGFloat scale = YYTextScreenScale(); - return CGPointMake(round(point.x * scale) / scale, - round(point.y * scale) / scale); -} - -/// ceil point value for pixel-aligned -static inline CGPoint YYTextCGPointPixelCeil(CGPoint point) { - CGFloat scale = YYTextScreenScale(); - return CGPointMake(ceil(point.x * scale) / scale, - ceil(point.y * scale) / scale); -} - -/// round point value to .5 pixel for path stroke (odd pixel line width pixel-aligned) -static inline CGPoint YYTextCGPointPixelHalf(CGPoint point) { - CGFloat scale = YYTextScreenScale(); - return CGPointMake((floor(point.x * scale) + 0.5) / scale, - (floor(point.y * scale) + 0.5) / scale); -} - - - -/// floor point value for pixel-aligned -static inline CGSize YYTextCGSizePixelFloor(CGSize size) { - CGFloat scale = YYTextScreenScale(); - return CGSizeMake(floor(size.width * scale) / scale, - floor(size.height * scale) / scale); -} - -/// round point value for pixel-aligned -static inline CGSize YYTextCGSizePixelRound(CGSize size) { - CGFloat scale = YYTextScreenScale(); - return CGSizeMake(round(size.width * scale) / scale, - round(size.height * scale) / scale); -} - -/// ceil point value for pixel-aligned -static inline CGSize YYTextCGSizePixelCeil(CGSize size) { - CGFloat scale = YYTextScreenScale(); - return CGSizeMake(ceil(size.width * scale) / scale, - ceil(size.height * scale) / scale); -} - -/// round point value to .5 pixel for path stroke (odd pixel line width pixel-aligned) -static inline CGSize YYTextCGSizePixelHalf(CGSize size) { - CGFloat scale = YYTextScreenScale(); - return CGSizeMake((floor(size.width * scale) + 0.5) / scale, - (floor(size.height * scale) + 0.5) / scale); -} - - - -/// floor point value for pixel-aligned -static inline CGRect YYTextCGRectPixelFloor(CGRect rect) { - CGPoint origin = YYTextCGPointPixelCeil(rect.origin); - CGPoint corner = YYTextCGPointPixelFloor(CGPointMake(rect.origin.x + rect.size.width, - rect.origin.y + rect.size.height)); - CGRect ret = CGRectMake(origin.x, origin.y, corner.x - origin.x, corner.y - origin.y); - if (ret.size.width < 0) ret.size.width = 0; - if (ret.size.height < 0) ret.size.height = 0; - return ret; -} - -/// round point value for pixel-aligned -static inline CGRect YYTextCGRectPixelRound(CGRect rect) { - CGPoint origin = YYTextCGPointPixelRound(rect.origin); - CGPoint corner = YYTextCGPointPixelRound(CGPointMake(rect.origin.x + rect.size.width, - rect.origin.y + rect.size.height)); - return CGRectMake(origin.x, origin.y, corner.x - origin.x, corner.y - origin.y); -} - -/// ceil point value for pixel-aligned -static inline CGRect YYTextCGRectPixelCeil(CGRect rect) { - CGPoint origin = YYTextCGPointPixelFloor(rect.origin); - CGPoint corner = YYTextCGPointPixelCeil(CGPointMake(rect.origin.x + rect.size.width, - rect.origin.y + rect.size.height)); - return CGRectMake(origin.x, origin.y, corner.x - origin.x, corner.y - origin.y); -} - -/// round point value to .5 pixel for path stroke (odd pixel line width pixel-aligned) -static inline CGRect YYTextCGRectPixelHalf(CGRect rect) { - CGPoint origin = YYTextCGPointPixelHalf(rect.origin); - CGPoint corner = YYTextCGPointPixelHalf(CGPointMake(rect.origin.x + rect.size.width, - rect.origin.y + rect.size.height)); - return CGRectMake(origin.x, origin.y, corner.x - origin.x, corner.y - origin.y); -} - - - -/// floor UIEdgeInset for pixel-aligned -static inline UIEdgeInsets YYTextUIEdgeInsetPixelFloor(UIEdgeInsets insets) { - insets.top = YYTextCGFloatPixelFloor(insets.top); - insets.left = YYTextCGFloatPixelFloor(insets.left); - insets.bottom = YYTextCGFloatPixelFloor(insets.bottom); - insets.right = YYTextCGFloatPixelFloor(insets.right); - return insets; -} - -/// ceil UIEdgeInset for pixel-aligned -static inline UIEdgeInsets YYTextUIEdgeInsetPixelCeil(UIEdgeInsets insets) { - insets.top = YYTextCGFloatPixelCeil(insets.top); - insets.left = YYTextCGFloatPixelCeil(insets.left); - insets.bottom = YYTextCGFloatPixelCeil(insets.bottom); - insets.right = YYTextCGFloatPixelCeil(insets.right); - return insets; -} - - - -static inline UIFont * _Nullable YYTextFontWithBold(UIFont *font) { - if (![font respondsToSelector:@selector(fontDescriptor)]) return font; - return [UIFont fontWithDescriptor:[font.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold] size:font.pointSize]; -} - -static inline UIFont * _Nullable YYTextFontWithItalic(UIFont *font) { - if (![font respondsToSelector:@selector(fontDescriptor)]) return font; - return [UIFont fontWithDescriptor:[font.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitItalic] size:font.pointSize]; -} - -static inline UIFont * _Nullable YYTextFontWithBoldItalic(UIFont *font) { - if (![font respondsToSelector:@selector(fontDescriptor)]) return font; - return [UIFont fontWithDescriptor:[font.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold | UIFontDescriptorTraitItalic] size:font.pointSize]; -} - - - -/** - Convert CFRange to NSRange - @param range CFRange @return NSRange - */ -static inline NSRange YYTextNSRangeFromCFRange(CFRange range) { - return NSMakeRange(range.location, range.length); -} - -/** - Convert NSRange to CFRange - @param range NSRange @return CFRange - */ -static inline CFRange YYTextCFRangeFromNSRange(NSRange range) { - return CFRangeMake(range.location, range.length); -} - - -/// Returns YES in App Extension. -BOOL YYTextIsAppExtension(); - -/// Returns nil in App Extension. -UIApplication * _Nullable YYTextSharedApplication(); - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Utility/YYTextUtilities.m b/iOSProject/Pods/YYText/YYText/Utility/YYTextUtilities.m deleted file mode 100644 index 11eaefed..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/YYTextUtilities.m +++ /dev/null @@ -1,309 +0,0 @@ -// -// YYTextUtilities.m -// YYText -// -// Created by ibireme on 15/4/6. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextUtilities.h" -#import -#import "UIView+YYText.h" - -NSCharacterSet *YYTextVerticalFormRotateCharacterSet() { - static NSMutableCharacterSet *set; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - set = [NSMutableCharacterSet new]; - [set addCharactersInRange:NSMakeRange(0x1100, 256)]; // Hangul Jamo - [set addCharactersInRange:NSMakeRange(0x2460, 160)]; // Enclosed Alphanumerics - [set addCharactersInRange:NSMakeRange(0x2600, 256)]; // Miscellaneous Symbols - [set addCharactersInRange:NSMakeRange(0x2700, 192)]; // Dingbats - [set addCharactersInRange:NSMakeRange(0x2E80, 128)]; // CJK Radicals Supplement - [set addCharactersInRange:NSMakeRange(0x2F00, 224)]; // Kangxi Radicals - [set addCharactersInRange:NSMakeRange(0x2FF0, 16)]; // Ideographic Description Characters - [set addCharactersInRange:NSMakeRange(0x3000, 64)]; // CJK Symbols and Punctuation - [set removeCharactersInRange:NSMakeRange(0x3008, 10)]; - [set removeCharactersInRange:NSMakeRange(0x3014, 12)]; - [set addCharactersInRange:NSMakeRange(0x3040, 96)]; // Hiragana - [set addCharactersInRange:NSMakeRange(0x30A0, 96)]; // Katakana - [set addCharactersInRange:NSMakeRange(0x3100, 48)]; // Bopomofo - [set addCharactersInRange:NSMakeRange(0x3130, 96)]; // Hangul Compatibility Jamo - [set addCharactersInRange:NSMakeRange(0x3190, 16)]; // Kanbun - [set addCharactersInRange:NSMakeRange(0x31A0, 32)]; // Bopomofo Extended - [set addCharactersInRange:NSMakeRange(0x31C0, 48)]; // CJK Strokes - [set addCharactersInRange:NSMakeRange(0x31F0, 16)]; // Katakana Phonetic Extensions - [set addCharactersInRange:NSMakeRange(0x3200, 256)]; // Enclosed CJK Letters and Months - [set addCharactersInRange:NSMakeRange(0x3300, 256)]; // CJK Compatibility - [set addCharactersInRange:NSMakeRange(0x3400, 2582)]; // CJK Unified Ideographs Extension A - [set addCharactersInRange:NSMakeRange(0x4E00, 20941)]; // CJK Unified Ideographs - [set addCharactersInRange:NSMakeRange(0xAC00, 11172)]; // Hangul Syllables - [set addCharactersInRange:NSMakeRange(0xD7B0, 80)]; // Hangul Jamo Extended-B - [set addCharactersInString:@""]; // U+F8FF (Private Use Area) - [set addCharactersInRange:NSMakeRange(0xF900, 512)]; // CJK Compatibility Ideographs - [set addCharactersInRange:NSMakeRange(0xFE10, 16)]; // Vertical Forms - [set addCharactersInRange:NSMakeRange(0xFF00, 240)]; // Halfwidth and Fullwidth Forms - [set addCharactersInRange:NSMakeRange(0x1F200, 256)]; // Enclosed Ideographic Supplement - [set addCharactersInRange:NSMakeRange(0x1F300, 768)]; // Enclosed Ideographic Supplement - [set addCharactersInRange:NSMakeRange(0x1F600, 80)]; // Emoticons (Emoji) - [set addCharactersInRange:NSMakeRange(0x1F680, 128)]; // Transport and Map Symbols - - // See http://unicode-table.com/ for more information. - }); - return set; -} - -NSCharacterSet *YYTextVerticalFormRotateAndMoveCharacterSet() { - static NSMutableCharacterSet *set; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - set = [NSMutableCharacterSet new]; - [set addCharactersInString:@",。、."]; - }); - return set; -} - -// return 0 when succeed -static int matrix_invert(__CLPK_integer N, double *matrix) { - __CLPK_integer error = 0; - __CLPK_integer pivot_tmp[6 * 6]; - __CLPK_integer *pivot = pivot_tmp; - double workspace_tmp[6 * 6]; - double *workspace = workspace_tmp; - bool need_free = false; - - if (N > 6) { - need_free = true; - pivot = malloc(N * N * sizeof(__CLPK_integer)); - if (!pivot) return -1; - workspace = malloc(N * sizeof(double)); - if (!workspace) { - free(pivot); - return -1; - } - } - - dgetrf_(&N, &N, matrix, &N, pivot, &error); - - if (error == 0) { - dgetri_(&N, matrix, &N, pivot, workspace, &N, &error); - } - - if (need_free) { - free(pivot); - free(workspace); - } - return error; -} - -CGAffineTransform YYTextCGAffineTransformGetFromPoints(CGPoint before[3], CGPoint after[3]) { - if (before == NULL || after == NULL) return CGAffineTransformIdentity; - - CGPoint p1, p2, p3, q1, q2, q3; - p1 = before[0]; p2 = before[1]; p3 = before[2]; - q1 = after[0]; q2 = after[1]; q3 = after[2]; - - double A[36]; - A[ 0] = p1.x; A[ 1] = p1.y; A[ 2] = 0; A[ 3] = 0; A[ 4] = 1; A[ 5] = 0; - A[ 6] = 0; A[ 7] = 0; A[ 8] = p1.x; A[ 9] = p1.y; A[10] = 0; A[11] = 1; - A[12] = p2.x; A[13] = p2.y; A[14] = 0; A[15] = 0; A[16] = 1; A[17] = 0; - A[18] = 0; A[19] = 0; A[20] = p2.x; A[21] = p2.y; A[22] = 0; A[23] = 1; - A[24] = p3.x; A[25] = p3.y; A[26] = 0; A[27] = 0; A[28] = 1; A[29] = 0; - A[30] = 0; A[31] = 0; A[32] = p3.x; A[33] = p3.y; A[34] = 0; A[35] = 1; - - int error = matrix_invert(6, A); - if (error) return CGAffineTransformIdentity; - - double B[6]; - B[0] = q1.x; B[1] = q1.y; B[2] = q2.x; B[3] = q2.y; B[4] = q3.x; B[5] = q3.y; - - double M[6]; - M[0] = A[ 0] * B[0] + A[ 1] * B[1] + A[ 2] * B[2] + A[ 3] * B[3] + A[ 4] * B[4] + A[ 5] * B[5]; - M[1] = A[ 6] * B[0] + A[ 7] * B[1] + A[ 8] * B[2] + A[ 9] * B[3] + A[10] * B[4] + A[11] * B[5]; - M[2] = A[12] * B[0] + A[13] * B[1] + A[14] * B[2] + A[15] * B[3] + A[16] * B[4] + A[17] * B[5]; - M[3] = A[18] * B[0] + A[19] * B[1] + A[20] * B[2] + A[21] * B[3] + A[22] * B[4] + A[23] * B[5]; - M[4] = A[24] * B[0] + A[25] * B[1] + A[26] * B[2] + A[27] * B[3] + A[28] * B[4] + A[29] * B[5]; - M[5] = A[30] * B[0] + A[31] * B[1] + A[32] * B[2] + A[33] * B[3] + A[34] * B[4] + A[35] * B[5]; - - CGAffineTransform transform = CGAffineTransformMake(M[0], M[2], M[1], M[3], M[4], M[5]); - return transform; -} - -CGAffineTransform YYTextCGAffineTransformGetFromViews(UIView *from, UIView *to) { - if (!from || !to) return CGAffineTransformIdentity; - - CGPoint before[3], after[3]; - before[0] = CGPointMake(0, 0); - before[1] = CGPointMake(0, 1); - before[2] = CGPointMake(1, 0); - after[0] = [from yy_convertPoint:before[0] toViewOrWindow:to]; - after[1] = [from yy_convertPoint:before[1] toViewOrWindow:to]; - after[2] = [from yy_convertPoint:before[2] toViewOrWindow:to]; - - return YYTextCGAffineTransformGetFromPoints(before, after); -} - -UIViewContentMode YYTextCAGravityToUIViewContentMode(NSString *gravity) { - static NSDictionary *dic; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - dic = @{ kCAGravityCenter:@(UIViewContentModeCenter), - kCAGravityTop:@(UIViewContentModeTop), - kCAGravityBottom:@(UIViewContentModeBottom), - kCAGravityLeft:@(UIViewContentModeLeft), - kCAGravityRight:@(UIViewContentModeRight), - kCAGravityTopLeft:@(UIViewContentModeTopLeft), - kCAGravityTopRight:@(UIViewContentModeTopRight), - kCAGravityBottomLeft:@(UIViewContentModeBottomLeft), - kCAGravityBottomRight:@(UIViewContentModeBottomRight), - kCAGravityResize:@(UIViewContentModeScaleToFill), - kCAGravityResizeAspect:@(UIViewContentModeScaleAspectFit), - kCAGravityResizeAspectFill:@(UIViewContentModeScaleAspectFill) }; - }); - if (!gravity) return UIViewContentModeScaleToFill; - return (UIViewContentMode)((NSNumber *)dic[gravity]).integerValue; -} - -NSString *YYTextUIViewContentModeToCAGravity(UIViewContentMode contentMode) { - switch (contentMode) { - case UIViewContentModeScaleToFill: return kCAGravityResize; - case UIViewContentModeScaleAspectFit: return kCAGravityResizeAspect; - case UIViewContentModeScaleAspectFill: return kCAGravityResizeAspectFill; - case UIViewContentModeRedraw: return kCAGravityResize; - case UIViewContentModeCenter: return kCAGravityCenter; - case UIViewContentModeTop: return kCAGravityTop; - case UIViewContentModeBottom: return kCAGravityBottom; - case UIViewContentModeLeft: return kCAGravityLeft; - case UIViewContentModeRight: return kCAGravityRight; - case UIViewContentModeTopLeft: return kCAGravityTopLeft; - case UIViewContentModeTopRight: return kCAGravityTopRight; - case UIViewContentModeBottomLeft: return kCAGravityBottomLeft; - case UIViewContentModeBottomRight: return kCAGravityBottomRight; - default: return kCAGravityResize; - } -} - -CGRect YYTextCGRectFitWithContentMode(CGRect rect, CGSize size, UIViewContentMode mode) { - rect = CGRectStandardize(rect); - size.width = size.width < 0 ? -size.width : size.width; - size.height = size.height < 0 ? -size.height : size.height; - CGPoint center = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)); - switch (mode) { - case UIViewContentModeScaleAspectFit: - case UIViewContentModeScaleAspectFill: { - if (rect.size.width < 0.01 || rect.size.height < 0.01 || - size.width < 0.01 || size.height < 0.01) { - rect.origin = center; - rect.size = CGSizeZero; - } else { - CGFloat scale; - if (mode == UIViewContentModeScaleAspectFit) { - if (size.width / size.height < rect.size.width / rect.size.height) { - scale = rect.size.height / size.height; - } else { - scale = rect.size.width / size.width; - } - } else { - if (size.width / size.height < rect.size.width / rect.size.height) { - scale = rect.size.width / size.width; - } else { - scale = rect.size.height / size.height; - } - } - size.width *= scale; - size.height *= scale; - rect.size = size; - rect.origin = CGPointMake(center.x - size.width * 0.5, center.y - size.height * 0.5); - } - } break; - case UIViewContentModeCenter: { - rect.size = size; - rect.origin = CGPointMake(center.x - size.width * 0.5, center.y - size.height * 0.5); - } break; - case UIViewContentModeTop: { - rect.origin.x = center.x - size.width * 0.5; - rect.size = size; - } break; - case UIViewContentModeBottom: { - rect.origin.x = center.x - size.width * 0.5; - rect.origin.y += rect.size.height - size.height; - rect.size = size; - } break; - case UIViewContentModeLeft: { - rect.origin.y = center.y - size.height * 0.5; - rect.size = size; - } break; - case UIViewContentModeRight: { - rect.origin.y = center.y - size.height * 0.5; - rect.origin.x += rect.size.width - size.width; - rect.size = size; - } break; - case UIViewContentModeTopLeft: { - rect.size = size; - } break; - case UIViewContentModeTopRight: { - rect.origin.x += rect.size.width - size.width; - rect.size = size; - } break; - case UIViewContentModeBottomLeft: { - rect.origin.y += rect.size.height - size.height; - rect.size = size; - } break; - case UIViewContentModeBottomRight: { - rect.origin.x += rect.size.width - size.width; - rect.origin.y += rect.size.height - size.height; - rect.size = size; - } break; - case UIViewContentModeScaleToFill: - case UIViewContentModeRedraw: - default: { - rect = rect; - } - } - return rect; -} - -CGFloat YYTextScreenScale() { - static CGFloat scale; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - scale = [UIScreen mainScreen].scale; - }); - return scale; -} - -CGSize YYTextScreenSize() { - static CGSize size; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - size = [UIScreen mainScreen].bounds.size; - if (size.height < size.width) { - CGFloat tmp = size.height; - size.height = size.width; - size.width = tmp; - } - }); - return size; -} - - -BOOL YYTextIsAppExtension() { - static BOOL isAppExtension = NO; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - Class cls = NSClassFromString(@"UIApplication"); - if(!cls || ![cls respondsToSelector:@selector(sharedApplication)]) isAppExtension = YES; - if ([[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"]) isAppExtension = YES; - }); - return isAppExtension; -} - -UIApplication *YYTextSharedApplication() { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundeclared-selector" - return YYTextIsAppExtension() ? nil : [UIApplication performSelector:@selector(sharedApplication)]; -#pragma clang diagnostic pop -} diff --git a/iOSProject/Pods/YYText/YYText/Utility/YYTextWeakProxy.h b/iOSProject/Pods/YYText/YYText/Utility/YYTextWeakProxy.h deleted file mode 100644 index 08343022..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/YYTextWeakProxy.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// YYTextWeakProxy.h -// YYText -// -// Created by ibireme on 14/10/18. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - A proxy used to hold a weak object. - It can be used to avoid retain cycles, such as the target in NSTimer or CADisplayLink. - - sample code: - - @implementation MyView { - NSTimer *_timer; - } - - - (void)initTimer { - YYTextWeakProxy *proxy = [YYTextWeakProxy proxyWithTarget:self]; - _timer = [NSTimer timerWithTimeInterval:0.1 target:proxy selector:@selector(tick:) userInfo:nil repeats:YES]; - } - - - (void)tick:(NSTimer *)timer {...} - @end - */ -@interface YYTextWeakProxy : NSProxy - -/** - The proxy target. - */ -@property (nullable, nonatomic, weak, readonly) id target; - -/** - Creates a new weak proxy for target. - - @param target Target object. - - @return A new proxy object. - */ -- (instancetype)initWithTarget:(id)target; - -/** - Creates a new weak proxy for target. - - @param target Target object. - - @return A new proxy object. - */ -+ (instancetype)proxyWithTarget:(id)target; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/Utility/YYTextWeakProxy.m b/iOSProject/Pods/YYText/YYText/Utility/YYTextWeakProxy.m deleted file mode 100644 index 63ec1418..00000000 --- a/iOSProject/Pods/YYText/YYText/Utility/YYTextWeakProxy.m +++ /dev/null @@ -1,83 +0,0 @@ -// -// YYTextWeakProxy.m -// YYText -// -// Created by ibireme on 14/10/18. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextWeakProxy.h" - - -@implementation YYTextWeakProxy - -- (instancetype)initWithTarget:(id)target { - _target = target; - return self; -} - -+ (instancetype)proxyWithTarget:(id)target { - return [[YYTextWeakProxy alloc] initWithTarget:target]; -} - -- (id)forwardingTargetForSelector:(SEL)selector { - return _target; -} - -- (void)forwardInvocation:(NSInvocation *)invocation { - void *null = NULL; - [invocation setReturnValue:&null]; -} - -- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { - return [NSObject instanceMethodSignatureForSelector:@selector(init)]; -} - -- (BOOL)respondsToSelector:(SEL)aSelector { - return [_target respondsToSelector:aSelector]; -} - -- (BOOL)isEqual:(id)object { - return [_target isEqual:object]; -} - -- (NSUInteger)hash { - return [_target hash]; -} - -- (Class)superclass { - return [_target superclass]; -} - -- (Class)class { - return [_target class]; -} - -- (BOOL)isKindOfClass:(Class)aClass { - return [_target isKindOfClass:aClass]; -} - -- (BOOL)isMemberOfClass:(Class)aClass { - return [_target isMemberOfClass:aClass]; -} - -- (BOOL)conformsToProtocol:(Protocol *)aProtocol { - return [_target conformsToProtocol:aProtocol]; -} - -- (BOOL)isProxy { - return YES; -} - -- (NSString *)description { - return [_target description]; -} - -- (NSString *)debugDescription { - return [_target debugDescription]; -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/YYLabel.h b/iOSProject/Pods/YYText/YYText/YYLabel.h deleted file mode 100644 index a3687f12..00000000 --- a/iOSProject/Pods/YYText/YYText/YYLabel.h +++ /dev/null @@ -1,380 +0,0 @@ -// -// YYLabel.h -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -#import -#import -#import -#else -#import "YYTextParser.h" -#import "YYTextLayout.h" -#import "YYTextAttribute.h" -#endif - -NS_ASSUME_NONNULL_BEGIN - -#if !TARGET_INTERFACE_BUILDER - -/** - The YYLabel class implements a read-only text view. - - @discussion The API and behavior is similar to UILabel, but provides more features: - - * It supports asynchronous layout and rendering (to avoid blocking UI thread). - * It extends the CoreText attributes to support more text effects. - * It allows to add UIImage, UIView and CALayer as text attachments. - * It allows to add 'highlight' link to some range of text to allow user interact with. - * It allows to add container path and exclusion paths to control text container's shape. - * It supports vertical form layout to display CJK text. - - See NSAttributedString+YYText.h for more convenience methods to set the attributes. - See YYTextAttribute.h and YYTextLayout.h for more information. - */ -@interface YYLabel : UIView - -#pragma mark - Accessing the Text Attributes -///============================================================================= -/// @name Accessing the Text Attributes -///============================================================================= - -/** - The text displayed by the label. Default is nil. - Set a new value to this property also replaces the text in `attributedText`. - Get the value returns the plain text in `attributedText`. - */ -@property (nullable, nonatomic, copy) NSString *text; - -/** - The font of the text. Default is 17-point system font. - Set a new value to this property also causes the new font to be applied to the entire `attributedText`. - Get the value returns the font at the head of `attributedText`. - */ -@property (null_resettable, nonatomic, strong) UIFont *font; - -/** - The color of the text. Default is black. - Set a new value to this property also causes the new color to be applied to the entire `attributedText`. - Get the value returns the color at the head of `attributedText`. - */ -@property (null_resettable, nonatomic, strong) UIColor *textColor; - -/** - The shadow color of the text. Default is nil. - Set a new value to this property also causes the shadow color to be applied to the entire `attributedText`. - Get the value returns the shadow color at the head of `attributedText`. - */ -@property (nullable, nonatomic, strong) UIColor *shadowColor; - -/** - The shadow offset of the text. Default is CGSizeZero. - Set a new value to this property also causes the shadow offset to be applied to the entire `attributedText`. - Get the value returns the shadow offset at the head of `attributedText`. - */ -@property (nonatomic) CGSize shadowOffset; - -/** - The shadow blur of the text. Default is 0. - Set a new value to this property also causes the shadow blur to be applied to the entire `attributedText`. - Get the value returns the shadow blur at the head of `attributedText`. - */ -@property (nonatomic) CGFloat shadowBlurRadius; - -/** - The technique to use for aligning the text. Default is NSTextAlignmentNatural. - Set a new value to this property also causes the new alignment to be applied to the entire `attributedText`. - Get the value returns the alignment at the head of `attributedText`. - */ -@property (nonatomic) NSTextAlignment textAlignment; - -/** - The text vertical aligmnent in container. Default is YYTextVerticalAlignmentCenter. - */ -@property (nonatomic) YYTextVerticalAlignment textVerticalAlignment; - -/** - The styled text displayed by the label. - Set a new value to this property also replaces the value of the `text`, `font`, `textColor`, - `textAlignment` and other properties in label. - - @discussion It only support the attributes declared in CoreText and YYTextAttribute. - See `NSAttributedString+YYText` for more convenience methods to set the attributes. - */ -@property (nullable, nonatomic, copy) NSAttributedString *attributedText; - -/** - The technique to use for wrapping and truncating the label's text. - Default is NSLineBreakByTruncatingTail. - */ -@property (nonatomic) NSLineBreakMode lineBreakMode; - -/** - The truncation token string used when text is truncated. Default is nil. - When the value is nil, the label use "…" as default truncation token. - */ -@property (nullable, nonatomic, copy) NSAttributedString *truncationToken; - -/** - The maximum number of lines to use for rendering text. Default value is 1. - 0 means no limit. - */ -@property (nonatomic) NSUInteger numberOfLines; - -/** - When `text` or `attributedText` is changed, the parser will be called to modify the text. - It can be used to add code highlighting or emoticon replacement to text view. - The default value is nil. - - See `YYTextParser` protocol for more information. - */ -@property (nullable, nonatomic, strong) id textParser; - -/** - The current text layout in text view. It can be used to query the text layout information. - Set a new value to this property also replaces most properties in this label, such as `text`, - `color`, `attributedText`, `lineBreakMode`, `textContainerPath`, `exclusionPaths` and so on. - */ -@property (nullable, nonatomic, strong) YYTextLayout *textLayout; - - -#pragma mark - Configuring the Text Container -///============================================================================= -/// @name Configuring the Text Container -///============================================================================= - -/** - A UIBezierPath object that specifies the shape of the text frame. Default value is nil. - */ -@property (nullable, nonatomic, copy) UIBezierPath *textContainerPath; - -/** - An array of UIBezierPath objects representing the exclusion paths inside the - receiver's bounding rectangle. Default value is nil. - */ -@property (nullable, nonatomic, copy) NSArray *exclusionPaths; - -/** - The inset of the text container's layout area within the text view's content area. - Default value is UIEdgeInsetsZero. - */ -@property (nonatomic) UIEdgeInsets textContainerInset; - -/** - Whether the receiver's layout orientation is vertical form. Default is NO. - It may used to display CJK text. - */ -@property (nonatomic, getter=isVerticalForm) BOOL verticalForm; - -/** - The text line position modifier used to modify the lines' position in layout. - Default value is nil. - See `YYTextLinePositionModifier` protocol for more information. - */ -@property (nullable, nonatomic, copy) id linePositionModifier; - -/** - The debug option to display CoreText layout result. - The default value is [YYTextDebugOption sharedDebugOption]. - */ -@property (nullable, nonatomic, copy) YYTextDebugOption *debugOption; - - -#pragma mark - Getting the Layout Constraints -///============================================================================= -/// @name Getting the Layout Constraints -///============================================================================= - -/** - The preferred maximum width (in points) for a multiline label. - - @discussion This property affects the size of the label when layout constraints - are applied to it. During layout, if the text extends beyond the width - specified by this property, the additional text is flowed to one or more new - lines, thereby increasing the height of the label. If the text is vertical - form, this value will match to text height. - */ -@property (nonatomic) CGFloat preferredMaxLayoutWidth; - - -#pragma mark - Interacting with Text Data -///============================================================================= -/// @name Interacting with Text Data -///============================================================================= - -/** - When user tap the label, this action will be called (similar to tap gesture). - The default value is nil. - */ -@property (nullable, nonatomic, copy) YYTextAction textTapAction; - -/** - When user long press the label, this action will be called (similar to long press gesture). - The default value is nil. - */ -@property (nullable, nonatomic, copy) YYTextAction textLongPressAction; - -/** - When user tap the highlight range of text, this action will be called. - The default value is nil. - */ -@property (nullable, nonatomic, copy) YYTextAction highlightTapAction; - -/** - When user long press the highlight range of text, this action will be called. - The default value is nil. - */ -@property (nullable, nonatomic, copy) YYTextAction highlightLongPressAction; - - -#pragma mark - Configuring the Display Mode -///============================================================================= -/// @name Configuring the Display Mode -///============================================================================= - -/** - A Boolean value indicating whether the layout and rendering codes are running - asynchronously on background threads. - - The default value is `NO`. - */ -@property (nonatomic) BOOL displaysAsynchronously; - -/** - If the value is YES, and the layer is rendered asynchronously, then it will - set label.layer.contents to nil before display. - - The default value is `YES`. - - @discussion When the asynchronously display is enabled, the layer's content will - be updated after the background render process finished. If the render process - can not finished in a vsync time (1/60 second), the old content will be still kept - for display. You may manually clear the content by set the layer.contents to nil - after you update the label's properties, or you can just set this property to YES. - */ -@property (nonatomic) BOOL clearContentsBeforeAsynchronouslyDisplay; - -/** - If the value is YES, and the layer is rendered asynchronously, then it will add - a fade animation on layer when the contents of layer changed. - - The default value is `YES`. - */ -@property (nonatomic) BOOL fadeOnAsynchronouslyDisplay; - -/** - If the value is YES, then it will add a fade animation on layer when some range - of text become highlighted. - - The default value is `YES`. - */ -@property (nonatomic) BOOL fadeOnHighlight; - -/** - Ignore common properties (such as text, font, textColor, attributedText...) and - only use "textLayout" to display content. - - The default value is `NO`. - - @discussion If you control the label content only through "textLayout", then - you may set this value to YES for higher performance. - */ -@property (nonatomic) BOOL ignoreCommonProperties; - -/* - Tips: - - 1. If you only need a UILabel alternative to display rich text and receive link touch event, - you do not need to adjust the display mode properties. - - 2. If you have performance issues, you may enable the asynchronous display mode - by setting the `displaysAsynchronously` to YES. - - 3. If you want to get the highest performance, you should do text layout with - `YYTextLayout` class in background thread. Here's an example: - - YYLabel *label = [YYLabel new]; - label.displaysAsynchronously = YES; - label.ignoreCommonProperties = YES; - - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - - // Create attributed string. - NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:@"Some Text"]; - text.yy_font = [UIFont systemFontOfSize:16]; - text.yy_color = [UIColor grayColor]; - [text yy_setColor:[UIColor redColor] range:NSMakeRange(0, 4)]; - - // Create text container - YYTextContainer *container = [YYTextContainer new]; - container.size = CGSizeMake(100, CGFLOAT_MAX); - container.maximumNumberOfRows = 0; - - // Generate a text layout. - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:text]; - - dispatch_async(dispatch_get_main_queue(), ^{ - label.size = layout.textBoundingSize; - label.textLayout = layout; - }); - }); - - */ - -@end - - -#else // TARGET_INTERFACE_BUILDER -IB_DESIGNABLE -@interface YYLabel : UIView -@property (nullable, nonatomic, copy) IBInspectable NSString *text; -@property (null_resettable, nonatomic, strong) IBInspectable UIColor *textColor; -@property (nullable, nonatomic, strong) IBInspectable NSString *fontName_; -@property (nonatomic) IBInspectable CGFloat fontSize_; -@property (nonatomic) IBInspectable BOOL fontIsBold_; -@property (nonatomic) IBInspectable NSUInteger numberOfLines; -@property (nonatomic) IBInspectable NSInteger lineBreakMode; -@property (nonatomic) IBInspectable CGFloat preferredMaxLayoutWidth; -@property (nonatomic, getter=isVerticalForm) IBInspectable BOOL verticalForm; -@property (nonatomic) IBInspectable NSInteger textAlignment; -@property (nonatomic) IBInspectable NSInteger textVerticalAlignment; -@property (nullable, nonatomic, strong) IBInspectable UIColor *shadowColor; -@property (nonatomic) IBInspectable CGPoint shadowOffset; -@property (nonatomic) IBInspectable CGFloat shadowBlurRadius; -@property (nullable, nonatomic, copy) IBInspectable NSAttributedString *attributedText; -@property (nonatomic) IBInspectable CGFloat insetTop_; -@property (nonatomic) IBInspectable CGFloat insetBottom_; -@property (nonatomic) IBInspectable CGFloat insetLeft_; -@property (nonatomic) IBInspectable CGFloat insetRight_; -@property (nonatomic) IBInspectable BOOL debugEnabled_; - -@property (null_resettable, nonatomic, strong) UIFont *font; -@property (nullable, nonatomic, copy) NSAttributedString *truncationToken; -@property (nullable, nonatomic, strong) id textParser; -@property (nullable, nonatomic, strong) YYTextLayout *textLayout; -@property (nullable, nonatomic, copy) UIBezierPath *textContainerPath; -@property (nullable, nonatomic, copy) NSArray *exclusionPaths; -@property (nonatomic) UIEdgeInsets textContainerInset; -@property (nullable, nonatomic, copy) id linePositionModifier; -@property (nonnull, nonatomic, copy) YYTextDebugOption *debugOption; -@property (nullable, nonatomic, copy) YYTextAction textTapAction; -@property (nullable, nonatomic, copy) YYTextAction textLongPressAction; -@property (nullable, nonatomic, copy) YYTextAction highlightTapAction; -@property (nullable, nonatomic, copy) YYTextAction highlightLongPressAction; -@property (nonatomic) BOOL displaysAsynchronously; -@property (nonatomic) BOOL clearContentsBeforeAsynchronouslyDisplay; -@property (nonatomic) BOOL fadeOnAsynchronouslyDisplay; -@property (nonatomic) BOOL fadeOnHighlight; -@property (nonatomic) BOOL ignoreCommonProperties; -@end -#endif // !TARGET_INTERFACE_BUILDER - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/YYLabel.m b/iOSProject/Pods/YYText/YYText/YYLabel.m deleted file mode 100644 index f5656e9a..00000000 --- a/iOSProject/Pods/YYText/YYText/YYLabel.m +++ /dev/null @@ -1,1306 +0,0 @@ -// -// YYLabel.m -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYLabel.h" -#import "YYTextAsyncLayer.h" -#import "YYTextWeakProxy.h" -#import "YYTextUtilities.h" -#import "NSAttributedString+YYText.h" -#import - - -static dispatch_queue_t YYLabelGetReleaseQueue() { - return dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0); -} - - -#define kLongPressMinimumDuration 0.5 // Time in seconds the fingers must be held down for long press gesture. -#define kLongPressAllowableMovement 9.0 // Maximum movement in points allowed before the long press fails. -#define kHighlightFadeDuration 0.15 // Time in seconds for highlight fadeout animation. -#define kAsyncFadeDuration 0.08 // Time in seconds for async display fadeout animation. - - -@interface YYLabel() { - NSMutableAttributedString *_innerText; ///< nonnull - YYTextLayout *_innerLayout; - YYTextContainer *_innerContainer; ///< nonnull - - NSMutableArray *_attachmentViews; - NSMutableArray *_attachmentLayers; - - NSRange _highlightRange; ///< current highlight range - YYTextHighlight *_highlight; ///< highlight attribute in `_highlightRange` - YYTextLayout *_highlightLayout; ///< when _state.showingHighlight=YES, this layout should be displayed - - YYTextLayout *_shrinkInnerLayout; - YYTextLayout *_shrinkHighlightLayout; - - NSTimer *_longPressTimer; - CGPoint _touchBeganPoint; - - struct { - unsigned int layoutNeedUpdate : 1; - unsigned int showingHighlight : 1; - - unsigned int trackingTouch : 1; - unsigned int swallowTouch : 1; - unsigned int touchMoved : 1; - - unsigned int hasTapAction : 1; - unsigned int hasLongPressAction : 1; - - unsigned int contentsNeedFade : 1; - } _state; -} -@end - - -@implementation YYLabel - -#pragma mark - Private - -- (void)_updateIfNeeded { - if (_state.layoutNeedUpdate) { - _state.layoutNeedUpdate = NO; - [self _updateLayout]; - [self.layer setNeedsDisplay]; - } -} - -- (void)_updateLayout { - _innerLayout = [YYTextLayout layoutWithContainer:_innerContainer text:_innerText]; - _shrinkInnerLayout = [YYLabel _shrinkLayoutWithLayout:_innerLayout]; -} - -- (void)_setLayoutNeedUpdate { - _state.layoutNeedUpdate = YES; - [self _clearInnerLayout]; - [self _setLayoutNeedRedraw]; -} - -- (void)_setLayoutNeedRedraw { - [self.layer setNeedsDisplay]; -} - -- (void)_clearInnerLayout { - if (!_innerLayout) return; - YYTextLayout *layout = _innerLayout; - _innerLayout = nil; - _shrinkInnerLayout = nil; - dispatch_async(YYLabelGetReleaseQueue(), ^{ - NSAttributedString *text = [layout text]; // capture to block and release in background - if (layout.attachments.count) { - dispatch_async(dispatch_get_main_queue(), ^{ - [text length]; // capture to block and release in main thread (maybe there's UIView/CALayer attachments). - }); - } - }); -} - -- (YYTextLayout *)_innerLayout { - return _shrinkInnerLayout ? _shrinkInnerLayout : _innerLayout; -} - -- (YYTextLayout *)_highlightLayout { - return _shrinkHighlightLayout ? _shrinkHighlightLayout : _highlightLayout; -} - -+ (YYTextLayout *)_shrinkLayoutWithLayout:(YYTextLayout *)layout { - if (layout.text.length && layout.lines.count == 0) { - YYTextContainer *container = layout.container.copy; - container.maximumNumberOfRows = 1; - CGSize containerSize = container.size; - if (!container.verticalForm) { - containerSize.height = YYTextContainerMaxSize.height; - } else { - containerSize.width = YYTextContainerMaxSize.width; - } - container.size = containerSize; - return [YYTextLayout layoutWithContainer:container text:layout.text]; - } else { - return nil; - } -} - -- (void)_startLongPressTimer { - [_longPressTimer invalidate]; - _longPressTimer = [NSTimer timerWithTimeInterval:kLongPressMinimumDuration - target:[YYTextWeakProxy proxyWithTarget:self] - selector:@selector(_trackDidLongPress) - userInfo:nil - repeats:NO]; - [[NSRunLoop currentRunLoop] addTimer:_longPressTimer forMode:NSRunLoopCommonModes]; -} - -- (void)_endLongPressTimer { - [_longPressTimer invalidate]; - _longPressTimer = nil; -} - -- (void)_trackDidLongPress { - [self _endLongPressTimer]; - if (_state.hasLongPressAction && _textLongPressAction) { - NSRange range = NSMakeRange(NSNotFound, 0); - CGRect rect = CGRectNull; - CGPoint point = [self _convertPointToLayout:_touchBeganPoint]; - YYTextRange *textRange = [self._innerLayout textRangeAtPoint:point]; - CGRect textRect = [self._innerLayout rectForRange:textRange]; - textRect = [self _convertRectFromLayout:textRect]; - if (textRange) { - range = textRange.asRange; - rect = textRect; - } - _textLongPressAction(self, _innerText, range, rect); - } - if (_highlight) { - YYTextAction longPressAction = _highlight.longPressAction ? _highlight.longPressAction : _highlightLongPressAction; - if (longPressAction) { - YYTextPosition *start = [YYTextPosition positionWithOffset:_highlightRange.location]; - YYTextPosition *end = [YYTextPosition positionWithOffset:_highlightRange.location + _highlightRange.length affinity:YYTextAffinityBackward]; - YYTextRange *range = [YYTextRange rangeWithStart:start end:end]; - CGRect rect = [self._innerLayout rectForRange:range]; - rect = [self _convertRectFromLayout:rect]; - longPressAction(self, _innerText, _highlightRange, rect); - [self _removeHighlightAnimated:YES]; - _state.trackingTouch = NO; - } - } -} - -- (YYTextHighlight *)_getHighlightAtPoint:(CGPoint)point range:(NSRangePointer)range { - if (!self._innerLayout.containsHighlight) return nil; - point = [self _convertPointToLayout:point]; - YYTextRange *textRange = [self._innerLayout textRangeAtPoint:point]; - if (!textRange) return nil; - - NSUInteger startIndex = textRange.start.offset; - if (startIndex == _innerText.length) { - if (startIndex > 0) { - startIndex--; - } - } - NSRange highlightRange = {0}; - YYTextHighlight *highlight = [_innerText attribute:YYTextHighlightAttributeName - atIndex:startIndex - longestEffectiveRange:&highlightRange - inRange:NSMakeRange(0, _innerText.length)]; - - if (!highlight) return nil; - if (range) *range = highlightRange; - return highlight; -} - -- (void)_showHighlightAnimated:(BOOL)animated { - if (!_highlight) return; - if (!_highlightLayout) { - NSMutableAttributedString *hiText = _innerText.mutableCopy; - NSDictionary *newAttrs = _highlight.attributes; - [newAttrs enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) { - [hiText yy_setAttribute:key value:value range:_highlightRange]; - }]; - _highlightLayout = [YYTextLayout layoutWithContainer:_innerContainer text:hiText]; - _shrinkHighlightLayout = [YYLabel _shrinkLayoutWithLayout:_highlightLayout]; - if (!_highlightLayout) _highlight = nil; - } - - if (_highlightLayout && !_state.showingHighlight) { - _state.showingHighlight = YES; - _state.contentsNeedFade = animated; - [self _setLayoutNeedRedraw]; - } -} - -- (void)_hideHighlightAnimated:(BOOL)animated { - if (_state.showingHighlight) { - _state.showingHighlight = NO; - _state.contentsNeedFade = animated; - [self _setLayoutNeedRedraw]; - } -} - -- (void)_removeHighlightAnimated:(BOOL)animated { - [self _hideHighlightAnimated:animated]; - _highlight = nil; - _highlightLayout = nil; - _shrinkHighlightLayout = nil; -} - -- (void)_endTouch { - [self _endLongPressTimer]; - [self _removeHighlightAnimated:YES]; - _state.trackingTouch = NO; -} - -- (CGPoint)_convertPointToLayout:(CGPoint)point { - CGSize boundingSize = self._innerLayout.textBoundingSize; - if (self._innerLayout.container.isVerticalForm) { - CGFloat w = self._innerLayout.textBoundingSize.width; - if (w < self.bounds.size.width) w = self.bounds.size.width; - point.x += self._innerLayout.container.size.width - w; - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - point.x += (self.bounds.size.width - boundingSize.width) * 0.5; - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - point.x += (self.bounds.size.width - boundingSize.width); - } - return point; - } else { - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - point.y -= (self.bounds.size.height - boundingSize.height) * 0.5; - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - point.y -= (self.bounds.size.height - boundingSize.height); - } - return point; - } -} - -- (CGPoint)_convertPointFromLayout:(CGPoint)point { - CGSize boundingSize = self._innerLayout.textBoundingSize; - if (self._innerLayout.container.isVerticalForm) { - CGFloat w = self._innerLayout.textBoundingSize.width; - if (w < self.bounds.size.width) w = self.bounds.size.width; - point.x -= self._innerLayout.container.size.width - w; - if (boundingSize.width < self.bounds.size.width) { - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - point.x -= (self.bounds.size.width - boundingSize.width) * 0.5; - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - point.x -= (self.bounds.size.width - boundingSize.width); - } - } - return point; - } else { - if (boundingSize.height < self.bounds.size.height) { - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - point.y += (self.bounds.size.height - boundingSize.height) * 0.5; - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - point.y += (self.bounds.size.height - boundingSize.height); - } - } - return point; - } -} - -- (CGRect)_convertRectToLayout:(CGRect)rect { - rect.origin = [self _convertPointToLayout:rect.origin]; - return rect; -} - -- (CGRect)_convertRectFromLayout:(CGRect)rect { - rect.origin = [self _convertPointFromLayout:rect.origin]; - return rect; -} - -- (UIFont *)_defaultFont { - return [UIFont systemFontOfSize:17]; -} - -- (NSShadow *)_shadowFromProperties { - if (!_shadowColor || _shadowBlurRadius < 0) return nil; - NSShadow *shadow = [NSShadow new]; - shadow.shadowColor = _shadowColor; -#if !TARGET_INTERFACE_BUILDER - shadow.shadowOffset = _shadowOffset; -#else - shadow.shadowOffset = CGSizeMake(_shadowOffset.x, _shadowOffset.y); -#endif - shadow.shadowBlurRadius = _shadowBlurRadius; - return shadow; -} - -- (void)_updateOuterLineBreakMode { - if (_innerContainer.truncationType) { - switch (_innerContainer.truncationType) { - case YYTextTruncationTypeStart: { - _lineBreakMode = NSLineBreakByTruncatingHead; - } break; - case YYTextTruncationTypeEnd: { - _lineBreakMode = NSLineBreakByTruncatingTail; - } break; - case YYTextTruncationTypeMiddle: { - _lineBreakMode = NSLineBreakByTruncatingMiddle; - } break; - default:break; - } - } else { - _lineBreakMode = _innerText.yy_lineBreakMode; - } -} - -- (void)_updateOuterTextProperties { - _text = [_innerText yy_plainTextForRange:NSMakeRange(0, _innerText.length)]; - _font = _innerText.yy_font; - if (!_font) _font = [self _defaultFont]; - _textColor = _innerText.yy_color; - if (!_textColor) _textColor = [UIColor blackColor]; - _textAlignment = _innerText.yy_alignment; - _lineBreakMode = _innerText.yy_lineBreakMode; - NSShadow *shadow = _innerText.yy_shadow; - _shadowColor = shadow.shadowColor; -#if !TARGET_INTERFACE_BUILDER - _shadowOffset = shadow.shadowOffset; -#else - _shadowOffset = CGPointMake(shadow.shadowOffset.width, shadow.shadowOffset.height); -#endif - - _shadowBlurRadius = shadow.shadowBlurRadius; - _attributedText = _innerText; - [self _updateOuterLineBreakMode]; -} - -- (void)_updateOuterContainerProperties { - _truncationToken = _innerContainer.truncationToken; - _numberOfLines = _innerContainer.maximumNumberOfRows; - _textContainerPath = _innerContainer.path; - _exclusionPaths = _innerContainer.exclusionPaths; - _textContainerInset = _innerContainer.insets; - _verticalForm = _innerContainer.verticalForm; - _linePositionModifier = _innerContainer.linePositionModifier; - [self _updateOuterLineBreakMode]; -} - -- (void)_clearContents { - CGImageRef image = (__bridge_retained CGImageRef)(self.layer.contents); - self.layer.contents = nil; - if (image) { - dispatch_async(YYLabelGetReleaseQueue(), ^{ - CFRelease(image); - }); - } -} - -- (void)_initLabel { - ((YYTextAsyncLayer *)self.layer).displaysAsynchronously = NO; - self.layer.contentsScale = [UIScreen mainScreen].scale; - self.contentMode = UIViewContentModeRedraw; - - _attachmentViews = [NSMutableArray new]; - _attachmentLayers = [NSMutableArray new]; - - _debugOption = [YYTextDebugOption sharedDebugOption]; - [YYTextDebugOption addDebugTarget:self]; - - _font = [self _defaultFont]; - _textColor = [UIColor blackColor]; - _textVerticalAlignment = YYTextVerticalAlignmentCenter; - _numberOfLines = 1; - _textAlignment = NSTextAlignmentNatural; - _lineBreakMode = NSLineBreakByTruncatingTail; - _innerText = [NSMutableAttributedString new]; - _innerContainer = [YYTextContainer new]; - _innerContainer.truncationType = YYTextTruncationTypeEnd; - _innerContainer.maximumNumberOfRows = _numberOfLines; - _clearContentsBeforeAsynchronouslyDisplay = YES; - _fadeOnAsynchronouslyDisplay = YES; - _fadeOnHighlight = YES; - - self.isAccessibilityElement = YES; -} - -#pragma mark - Override - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:CGRectZero]; - if (!self) return nil; - self.backgroundColor = [UIColor clearColor]; - self.opaque = NO; - [self _initLabel]; - self.frame = frame; - return self; -} - -- (void)dealloc { - [YYTextDebugOption removeDebugTarget:self]; - [_longPressTimer invalidate]; -} - -+ (Class)layerClass { - return [YYTextAsyncLayer class]; -} - -- (void)setFrame:(CGRect)frame { - CGSize oldSize = self.bounds.size; - [super setFrame:frame]; - CGSize newSize = self.bounds.size; - if (!CGSizeEqualToSize(oldSize, newSize)) { - _innerContainer.size = self.bounds.size; - if (!_ignoreCommonProperties) { - _state.layoutNeedUpdate = YES; - } - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedRedraw]; - } -} - -- (void)setBounds:(CGRect)bounds { - CGSize oldSize = self.bounds.size; - [super setBounds:bounds]; - CGSize newSize = self.bounds.size; - if (!CGSizeEqualToSize(oldSize, newSize)) { - _innerContainer.size = self.bounds.size; - if (!_ignoreCommonProperties) { - _state.layoutNeedUpdate = YES; - } - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedRedraw]; - } -} - -- (CGSize)sizeThatFits:(CGSize)size { - if (_ignoreCommonProperties) { - return _innerLayout.textBoundingSize; - } - - if (!_verticalForm && size.width <= 0) size.width = YYTextContainerMaxSize.width; - if (_verticalForm && size.height <= 0) size.height = YYTextContainerMaxSize.height; - - if ((!_verticalForm && size.width == self.bounds.size.width) || - (_verticalForm && size.height == self.bounds.size.height)) { - [self _updateIfNeeded]; - YYTextLayout *layout = self._innerLayout; - BOOL contains = NO; - if (layout.container.maximumNumberOfRows == 0) { - if (layout.truncatedLine == nil) { - contains = YES; - } - } else { - if (layout.rowCount <= layout.container.maximumNumberOfRows) { - contains = YES; - } - } - if (contains) { - return layout.textBoundingSize; - } - } - - if (!_verticalForm) { - size.height = YYTextContainerMaxSize.height; - } else { - size.width = YYTextContainerMaxSize.width; - } - - YYTextContainer *container = [_innerContainer copy]; - container.size = size; - - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:_innerText]; - return layout.textBoundingSize; -} - -- (NSString *)accessibilityLabel { - return [_innerLayout.text yy_plainTextForRange:_innerLayout.text.yy_rangeOfAll]; -} - -#pragma mark - NSCoding - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - [aCoder encodeObject:_attributedText forKey:@"attributedText"]; - [aCoder encodeObject:_innerContainer forKey:@"innerContainer"]; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - [self _initLabel]; - YYTextContainer *innerContainer = [aDecoder decodeObjectForKey:@"innerContainer"]; - if (innerContainer) { - _innerContainer = innerContainer; - } else { - _innerContainer.size = self.bounds.size; - } - [self _updateOuterContainerProperties]; - self.attributedText = [aDecoder decodeObjectForKey:@"attributedText"]; - [self _setLayoutNeedUpdate]; - return self; -} - -#pragma mark - Touches - -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - [self _updateIfNeeded]; - UITouch *touch = touches.anyObject; - CGPoint point = [touch locationInView:self]; - - _highlight = [self _getHighlightAtPoint:point range:&_highlightRange]; - _highlightLayout = nil; - _shrinkHighlightLayout = nil; - _state.hasTapAction = _textTapAction != nil; - _state.hasLongPressAction = _textLongPressAction != nil; - - if (_highlight || _textTapAction || _textLongPressAction) { - _touchBeganPoint = point; - _state.trackingTouch = YES; - _state.swallowTouch = YES; - _state.touchMoved = NO; - [self _startLongPressTimer]; - if (_highlight) [self _showHighlightAnimated:NO]; - } else { - _state.trackingTouch = NO; - _state.swallowTouch = NO; - _state.touchMoved = NO; - } - if (!_state.swallowTouch) { - [super touchesBegan:touches withEvent:event]; - } -} - -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - [self _updateIfNeeded]; - - UITouch *touch = touches.anyObject; - CGPoint point = [touch locationInView:self]; - - if (_state.trackingTouch) { - if (!_state.touchMoved) { - CGFloat moveH = point.x - _touchBeganPoint.x; - CGFloat moveV = point.y - _touchBeganPoint.y; - if (fabs(moveH) > fabs(moveV)) { - if (fabs(moveH) > kLongPressAllowableMovement) _state.touchMoved = YES; - } else { - if (fabs(moveV) > kLongPressAllowableMovement) _state.touchMoved = YES; - } - if (_state.touchMoved) { - [self _endLongPressTimer]; - } - } - if (_state.touchMoved && _highlight) { - YYTextHighlight *highlight = [self _getHighlightAtPoint:point range:NULL]; - if (highlight == _highlight) { - [self _showHighlightAnimated:_fadeOnHighlight]; - } else { - [self _hideHighlightAnimated:_fadeOnHighlight]; - } - } - } - - if (!_state.swallowTouch) { - [super touchesMoved:touches withEvent:event]; - } -} - -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - UITouch *touch = touches.anyObject; - CGPoint point = [touch locationInView:self]; - - if (_state.trackingTouch) { - [self _endLongPressTimer]; - if (!_state.touchMoved && _textTapAction) { - NSRange range = NSMakeRange(NSNotFound, 0); - CGRect rect = CGRectNull; - CGPoint point = [self _convertPointToLayout:_touchBeganPoint]; - YYTextRange *textRange = [self._innerLayout textRangeAtPoint:point]; - CGRect textRect = [self._innerLayout rectForRange:textRange]; - textRect = [self _convertRectFromLayout:textRect]; - if (textRange) { - range = textRange.asRange; - rect = textRect; - } - _textTapAction(self, _innerText, range, rect); - } - - if (_highlight) { - if (!_state.touchMoved || [self _getHighlightAtPoint:point range:NULL] == _highlight) { - YYTextAction tapAction = _highlight.tapAction ? _highlight.tapAction : _highlightTapAction; - if (tapAction) { - YYTextPosition *start = [YYTextPosition positionWithOffset:_highlightRange.location]; - YYTextPosition *end = [YYTextPosition positionWithOffset:_highlightRange.location + _highlightRange.length affinity:YYTextAffinityBackward]; - YYTextRange *range = [YYTextRange rangeWithStart:start end:end]; - CGRect rect = [self._innerLayout rectForRange:range]; - rect = [self _convertRectFromLayout:rect]; - tapAction(self, _innerText, _highlightRange, rect); - } - } - [self _removeHighlightAnimated:_fadeOnHighlight]; - } - } - - if (!_state.swallowTouch) { - [super touchesEnded:touches withEvent:event]; - } -} - -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { - [self _endTouch]; - if (!_state.swallowTouch) [super touchesCancelled:touches withEvent:event]; -} - -#pragma mark - Properties - -- (void)setText:(NSString *)text { - if (_text == text || [_text isEqualToString:text]) return; - _text = text.copy; - BOOL needAddAttributes = _innerText.length == 0 && text.length > 0; - [_innerText replaceCharactersInRange:NSMakeRange(0, _innerText.length) withString:text ? text : @""]; - [_innerText yy_removeDiscontinuousAttributesInRange:NSMakeRange(0, _innerText.length)]; - if (needAddAttributes) { - _innerText.yy_font = _font; - _innerText.yy_color = _textColor; - _innerText.yy_shadow = [self _shadowFromProperties]; - _innerText.yy_alignment = _textAlignment; - switch (_lineBreakMode) { - case NSLineBreakByWordWrapping: - case NSLineBreakByCharWrapping: - case NSLineBreakByClipping: { - _innerText.yy_lineBreakMode = _lineBreakMode; - } break; - case NSLineBreakByTruncatingHead: - case NSLineBreakByTruncatingTail: - case NSLineBreakByTruncatingMiddle: { - _innerText.yy_lineBreakMode = NSLineBreakByWordWrapping; - } break; - default: break; - } - } - if ([_textParser parseText:_innerText selectedRange:NULL]) { - [self _updateOuterTextProperties]; - } - if (!_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setFont:(UIFont *)font { - if (!font) { - font = [self _defaultFont]; - } - if (_font == font || [_font isEqual:font]) return; - _font = font; - _innerText.yy_font = _font; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setTextColor:(UIColor *)textColor { - if (!textColor) { - textColor = [UIColor blackColor]; - } - if (_textColor == textColor || [_textColor isEqual:textColor]) return; - _textColor = textColor; - _innerText.yy_color = textColor; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - } -} - -- (void)setShadowColor:(UIColor *)shadowColor { - if (_shadowColor == shadowColor || [_shadowColor isEqual:shadowColor]) return; - _shadowColor = shadowColor; - _innerText.yy_shadow = [self _shadowFromProperties]; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - } -} - -#if !TARGET_INTERFACE_BUILDER -- (void)setShadowOffset:(CGSize)shadowOffset { - if (CGSizeEqualToSize(_shadowOffset, shadowOffset)) return; - _shadowOffset = shadowOffset; - _innerText.yy_shadow = [self _shadowFromProperties]; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - } -} -#else -- (void)setShadowOffset:(CGPoint)shadowOffset { - if (CGPointEqualToPoint(_shadowOffset, shadowOffset)) return; - _shadowOffset = shadowOffset; - _innerText.yy_shadow = [self _shadowFromProperties]; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - } -} -#endif - -- (void)setShadowBlurRadius:(CGFloat)shadowBlurRadius { - if (_shadowBlurRadius == shadowBlurRadius) return; - _shadowBlurRadius = shadowBlurRadius; - _innerText.yy_shadow = [self _shadowFromProperties]; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - } -} - -- (void)setTextAlignment:(NSTextAlignment)textAlignment { - if (_textAlignment == textAlignment) return; - _textAlignment = textAlignment; - _innerText.yy_alignment = textAlignment; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setLineBreakMode:(NSLineBreakMode)lineBreakMode { - if (_lineBreakMode == lineBreakMode) return; - _lineBreakMode = lineBreakMode; - _innerText.yy_lineBreakMode = lineBreakMode; - // allow multi-line break - switch (lineBreakMode) { - case NSLineBreakByWordWrapping: - case NSLineBreakByCharWrapping: - case NSLineBreakByClipping: { - _innerContainer.truncationType = YYTextTruncationTypeNone; - _innerText.yy_lineBreakMode = lineBreakMode; - } break; - case NSLineBreakByTruncatingHead:{ - _innerContainer.truncationType = YYTextTruncationTypeStart; - _innerText.yy_lineBreakMode = NSLineBreakByWordWrapping; - } break; - case NSLineBreakByTruncatingTail:{ - _innerContainer.truncationType = YYTextTruncationTypeEnd; - _innerText.yy_lineBreakMode = NSLineBreakByWordWrapping; - } break; - case NSLineBreakByTruncatingMiddle: { - _innerContainer.truncationType = YYTextTruncationTypeMiddle; - _innerText.yy_lineBreakMode = NSLineBreakByWordWrapping; - } break; - default: break; - } - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setTextVerticalAlignment:(YYTextVerticalAlignment)textVerticalAlignment { - if (_textVerticalAlignment == textVerticalAlignment) return; - _textVerticalAlignment = textVerticalAlignment; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setTruncationToken:(NSAttributedString *)truncationToken { - if (_truncationToken == truncationToken || [_truncationToken isEqual:truncationToken]) return; - _truncationToken = truncationToken.copy; - _innerContainer.truncationToken = truncationToken; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setNumberOfLines:(NSUInteger)numberOfLines { - if (_numberOfLines == numberOfLines) return; - _numberOfLines = numberOfLines; - _innerContainer.maximumNumberOfRows = numberOfLines; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setAttributedText:(NSAttributedString *)attributedText { - if (attributedText.length > 0) { - _innerText = attributedText.mutableCopy; - switch (_lineBreakMode) { - case NSLineBreakByWordWrapping: - case NSLineBreakByCharWrapping: - case NSLineBreakByClipping: { - _innerText.yy_lineBreakMode = _lineBreakMode; - } break; - case NSLineBreakByTruncatingHead: - case NSLineBreakByTruncatingTail: - case NSLineBreakByTruncatingMiddle: { - _innerText.yy_lineBreakMode = NSLineBreakByWordWrapping; - } break; - default: break; - } - } else { - _innerText = [NSMutableAttributedString new]; - } - [_textParser parseText:_innerText selectedRange:NULL]; - if (!_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _updateOuterTextProperties]; - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setTextContainerPath:(UIBezierPath *)textContainerPath { - if (_textContainerPath == textContainerPath || [_textContainerPath isEqual:textContainerPath]) return; - _textContainerPath = textContainerPath.copy; - _innerContainer.path = textContainerPath; - if (!_textContainerPath) { - _innerContainer.size = self.bounds.size; - _innerContainer.insets = _textContainerInset; - } - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setExclusionPaths:(NSArray *)exclusionPaths { - if (_exclusionPaths == exclusionPaths || [_exclusionPaths isEqual:exclusionPaths]) return; - _exclusionPaths = exclusionPaths.copy; - _innerContainer.exclusionPaths = exclusionPaths; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setTextContainerInset:(UIEdgeInsets)textContainerInset { - if (UIEdgeInsetsEqualToEdgeInsets(_textContainerInset, textContainerInset)) return; - _textContainerInset = textContainerInset; - _innerContainer.insets = textContainerInset; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setVerticalForm:(BOOL)verticalForm { - if (_verticalForm == verticalForm) return; - _verticalForm = verticalForm; - _innerContainer.verticalForm = verticalForm; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setLinePositionModifier:(id)linePositionModifier { - if (_linePositionModifier == linePositionModifier) return; - _linePositionModifier = linePositionModifier; - _innerContainer.linePositionModifier = linePositionModifier; - if (_innerText.length && !_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } -} - -- (void)setTextParser:(id)textParser { - if (_textParser == textParser || [_textParser isEqual:textParser]) return; - _textParser = textParser; - if ([_textParser parseText:_innerText selectedRange:NULL]) { - [self _updateOuterTextProperties]; - if (!_ignoreCommonProperties) { - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - [self _setLayoutNeedUpdate]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; - } - } -} - -- (void)setTextLayout:(YYTextLayout *)textLayout { - _innerLayout = textLayout; - _shrinkInnerLayout = nil; - - if (_ignoreCommonProperties) { - _innerText = (NSMutableAttributedString *)textLayout.text; - _innerContainer = textLayout.container.copy; - } else { - _innerText = textLayout.text.mutableCopy; - if (!_innerText) { - _innerText = [NSMutableAttributedString new]; - } - [self _updateOuterTextProperties]; - - _innerContainer = textLayout.container.copy; - if (!_innerContainer) { - _innerContainer = [YYTextContainer new]; - _innerContainer.size = self.bounds.size; - _innerContainer.insets = self.textContainerInset; - } - [self _updateOuterContainerProperties]; - } - - if (_displaysAsynchronously && _clearContentsBeforeAsynchronouslyDisplay) { - [self _clearContents]; - } - _state.layoutNeedUpdate = NO; - [self _setLayoutNeedRedraw]; - [self _endTouch]; - [self invalidateIntrinsicContentSize]; -} - -- (YYTextLayout *)textLayout { - [self _updateIfNeeded]; - return _innerLayout; -} - -- (void)setDisplaysAsynchronously:(BOOL)displaysAsynchronously { - _displaysAsynchronously = displaysAsynchronously; - ((YYTextAsyncLayer *)self.layer).displaysAsynchronously = displaysAsynchronously; -} - -#pragma mark - AutoLayout - -- (void)setPreferredMaxLayoutWidth:(CGFloat)preferredMaxLayoutWidth { - if (_preferredMaxLayoutWidth == preferredMaxLayoutWidth) return; - _preferredMaxLayoutWidth = preferredMaxLayoutWidth; - [self invalidateIntrinsicContentSize]; -} - -- (CGSize)intrinsicContentSize { - if (_preferredMaxLayoutWidth == 0) { - YYTextContainer *container = [_innerContainer copy]; - container.size = YYTextContainerMaxSize; - - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:_innerText]; - return layout.textBoundingSize; - } - - CGSize containerSize = _innerContainer.size; - if (!_verticalForm) { - containerSize.height = YYTextContainerMaxSize.height; - containerSize.width = _preferredMaxLayoutWidth; - if (containerSize.width == 0) containerSize.width = self.bounds.size.width; - } else { - containerSize.width = YYTextContainerMaxSize.width; - containerSize.height = _preferredMaxLayoutWidth; - if (containerSize.height == 0) containerSize.height = self.bounds.size.height; - } - - YYTextContainer *container = [_innerContainer copy]; - container.size = containerSize; - - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:_innerText]; - return layout.textBoundingSize; -} - -#pragma mark - YYTextDebugTarget - -- (void)setDebugOption:(YYTextDebugOption *)debugOption { - BOOL needDraw = _debugOption.needDrawDebug; - _debugOption = debugOption.copy; - if (_debugOption.needDrawDebug != needDraw) { - [self _setLayoutNeedRedraw]; - } -} - -#pragma mark - YYTextAsyncLayerDelegate - -- (YYTextAsyncLayerDisplayTask *)newAsyncDisplayTask { - - // capture current context - BOOL contentsNeedFade = _state.contentsNeedFade; - NSAttributedString *text = _innerText; - YYTextContainer *container = _innerContainer; - YYTextVerticalAlignment verticalAlignment = _textVerticalAlignment; - YYTextDebugOption *debug = _debugOption; - NSMutableArray *attachmentViews = _attachmentViews; - NSMutableArray *attachmentLayers = _attachmentLayers; - BOOL layoutNeedUpdate = _state.layoutNeedUpdate; - BOOL fadeForAsync = _displaysAsynchronously && _fadeOnAsynchronouslyDisplay; - __block YYTextLayout *layout = (_state.showingHighlight && _highlightLayout) ? self._highlightLayout : self._innerLayout; - __block YYTextLayout *shrinkLayout = nil; - __block BOOL layoutUpdated = NO; - if (layoutNeedUpdate) { - text = text.copy; - container = container.copy; - } - - // create display task - YYTextAsyncLayerDisplayTask *task = [YYTextAsyncLayerDisplayTask new]; - - task.willDisplay = ^(CALayer *layer) { - [layer removeAnimationForKey:@"contents"]; - - // If the attachment is not in new layout, or we don't know the new layout currently, - // the attachment should be removed. - for (UIView *view in attachmentViews) { - if (layoutNeedUpdate || ![layout.attachmentContentsSet containsObject:view]) { - if (view.superview == self) { - [view removeFromSuperview]; - } - } - } - for (CALayer *layer in attachmentLayers) { - if (layoutNeedUpdate || ![layout.attachmentContentsSet containsObject:layer]) { - if (layer.superlayer == self.layer) { - [layer removeFromSuperlayer]; - } - } - } - [attachmentViews removeAllObjects]; - [attachmentLayers removeAllObjects]; - }; - - task.display = ^(CGContextRef context, CGSize size, BOOL (^isCancelled)(void)) { - if (isCancelled()) return; - if (text.length == 0) return; - - YYTextLayout *drawLayout = layout; - if (layoutNeedUpdate) { - layout = [YYTextLayout layoutWithContainer:container text:text]; - shrinkLayout = [YYLabel _shrinkLayoutWithLayout:layout]; - if (isCancelled()) return; - layoutUpdated = YES; - drawLayout = shrinkLayout ? shrinkLayout : layout; - } - - CGSize boundingSize = drawLayout.textBoundingSize; - CGPoint point = CGPointZero; - if (verticalAlignment == YYTextVerticalAlignmentCenter) { - if (drawLayout.container.isVerticalForm) { - point.x = -(size.width - boundingSize.width) * 0.5; - } else { - point.y = (size.height - boundingSize.height) * 0.5; - } - } else if (verticalAlignment == YYTextVerticalAlignmentBottom) { - if (drawLayout.container.isVerticalForm) { - point.x = -(size.width - boundingSize.width); - } else { - point.y = (size.height - boundingSize.height); - } - } - point = YYTextCGPointPixelRound(point); - [drawLayout drawInContext:context size:size point:point view:nil layer:nil debug:debug cancel:isCancelled]; - }; - - task.didDisplay = ^(CALayer *layer, BOOL finished) { - YYTextLayout *drawLayout = layout; - if (layoutUpdated && shrinkLayout) { - drawLayout = shrinkLayout; - } - if (!finished) { - // If the display task is cancelled, we should clear the attachments. - for (YYTextAttachment *a in drawLayout.attachments) { - if ([a.content isKindOfClass:[UIView class]]) { - if (((UIView *)a.content).superview == layer.delegate) { - [((UIView *)a.content) removeFromSuperview]; - } - } else if ([a.content isKindOfClass:[CALayer class]]) { - if (((CALayer *)a.content).superlayer == layer) { - [((CALayer *)a.content) removeFromSuperlayer]; - } - } - } - return; - } - [layer removeAnimationForKey:@"contents"]; - - __strong YYLabel *view = (YYLabel *)layer.delegate; - if (!view) return; - if (view->_state.layoutNeedUpdate && layoutUpdated) { - view->_innerLayout = layout; - view->_shrinkInnerLayout = shrinkLayout; - view->_state.layoutNeedUpdate = NO; - } - - CGSize size = layer.bounds.size; - CGSize boundingSize = drawLayout.textBoundingSize; - CGPoint point = CGPointZero; - if (verticalAlignment == YYTextVerticalAlignmentCenter) { - if (drawLayout.container.isVerticalForm) { - point.x = -(size.width - boundingSize.width) * 0.5; - } else { - point.y = (size.height - boundingSize.height) * 0.5; - } - } else if (verticalAlignment == YYTextVerticalAlignmentBottom) { - if (drawLayout.container.isVerticalForm) { - point.x = -(size.width - boundingSize.width); - } else { - point.y = (size.height - boundingSize.height); - } - } - point = YYTextCGPointPixelRound(point); - [drawLayout drawInContext:nil size:size point:point view:view layer:layer debug:nil cancel:NULL]; - for (YYTextAttachment *a in drawLayout.attachments) { - if ([a.content isKindOfClass:[UIView class]]) [attachmentViews addObject:a.content]; - else if ([a.content isKindOfClass:[CALayer class]]) [attachmentLayers addObject:a.content]; - } - - if (contentsNeedFade) { - CATransition *transition = [CATransition animation]; - transition.duration = kHighlightFadeDuration; - transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; - transition.type = kCATransitionFade; - [layer addAnimation:transition forKey:@"contents"]; - } else if (fadeForAsync) { - CATransition *transition = [CATransition animation]; - transition.duration = kAsyncFadeDuration; - transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; - transition.type = kCATransitionFade; - [layer addAnimation:transition forKey:@"contents"]; - } - }; - - return task; -} - -@end - - - -@interface YYLabel(IBInspectableProperties) -@end - -@implementation YYLabel (IBInspectableProperties) - -- (BOOL)fontIsBold_:(UIFont *)font { - if (![font respondsToSelector:@selector(fontDescriptor)]) return NO; - return (font.fontDescriptor.symbolicTraits & UIFontDescriptorTraitBold) > 0; -} - -- (UIFont *)boldFont_:(UIFont *)font { - if (![font respondsToSelector:@selector(fontDescriptor)]) return font; - return [UIFont fontWithDescriptor:[font.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold] size:font.pointSize]; -} - -- (UIFont *)normalFont_:(UIFont *)font { - if (![font respondsToSelector:@selector(fontDescriptor)]) return font; - return [UIFont fontWithDescriptor:[font.fontDescriptor fontDescriptorWithSymbolicTraits:0] size:font.pointSize]; -} - -- (void)setFontName_:(NSString *)fontName { - if (!fontName) return; - UIFont *font = self.font; - if ((fontName.length == 0 || [fontName.lowercaseString isEqualToString:@"system"]) && ![self fontIsBold_:font]) { - font = [UIFont systemFontOfSize:font.pointSize]; - } else if ([fontName.lowercaseString isEqualToString:@"system bold"]) { - font = [UIFont boldSystemFontOfSize:font.pointSize]; - } else { - if ([self fontIsBold_:font] && ([fontName.lowercaseString rangeOfString:@"bold"].location == NSNotFound)) { - font = [UIFont fontWithName:fontName size:font.pointSize]; - font = [self boldFont_:font]; - } else { - font = [UIFont fontWithName:fontName size:font.pointSize]; - } - } - if (font) self.font = font; -} - -- (void)setFontSize_:(CGFloat)fontSize { - if (fontSize <= 0) return; - UIFont *font = self.font; - font = [font fontWithSize:fontSize]; - if (font) self.font = font; -} - -- (void)setFontIsBold_:(BOOL)fontBold { - UIFont *font = self.font; - if ([self fontIsBold_:font] == fontBold) return; - if (fontBold) { - font = [self boldFont_:font]; - } else { - font = [self normalFont_:font]; - } - if (font) self.font = font; -} - -- (void)setInsetTop_:(CGFloat)textInsetTop { - UIEdgeInsets insets = self.textContainerInset; - insets.top = textInsetTop; - self.textContainerInset = insets; -} - -- (void)setInsetBottom_:(CGFloat)textInsetBottom { - UIEdgeInsets insets = self.textContainerInset; - insets.bottom = textInsetBottom; - self.textContainerInset = insets; -} - -- (void)setInsetLeft_:(CGFloat)textInsetLeft { - UIEdgeInsets insets = self.textContainerInset; - insets.left = textInsetLeft; - self.textContainerInset = insets; - -} - -- (void)setInsetRight_:(CGFloat)textInsetRight { - UIEdgeInsets insets = self.textContainerInset; - insets.right = textInsetRight; - self.textContainerInset = insets; -} - -- (void)setDebugEnabled_:(BOOL)enabled { - if (!enabled) { - self.debugOption = nil; - } else { - YYTextDebugOption *debugOption = [YYTextDebugOption new]; - debugOption.baselineColor = [UIColor redColor]; - debugOption.CTFrameBorderColor = [UIColor redColor]; - debugOption.CTLineFillColor = [UIColor colorWithRed:0.000 green:0.463 blue:1.000 alpha:0.180]; - debugOption.CGGlyphBorderColor = [UIColor colorWithRed:1.000 green:0.524 blue:0.000 alpha:0.200]; - self.debugOption = debugOption; - } -} - -@end diff --git a/iOSProject/Pods/YYText/YYText/YYText.h b/iOSProject/Pods/YYText/YYText/YYText.h deleted file mode 100644 index 0900d8b9..00000000 --- a/iOSProject/Pods/YYText/YYText/YYText.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// YYText.h -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -FOUNDATION_EXPORT double YYTextVersionNumber; -FOUNDATION_EXPORT const unsigned char YYTextVersionString[]; -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#else -#import "YYLabel.h" -#import "YYTextView.h" -#import "YYTextAttribute.h" -#import "YYTextArchiver.h" -#import "YYTextParser.h" -#import "YYTextRunDelegate.h" -#import "YYTextRubyAnnotation.h" -#import "YYTextLayout.h" -#import "YYTextLine.h" -#import "YYTextInput.h" -#import "YYTextDebugOption.h" -#import "YYTextKeyboardManager.h" -#import "YYTextUtilities.h" -#import "NSAttributedString+YYText.h" -#import "NSParagraphStyle+YYText.h" -#import "UIPasteboard+YYText.h" -#endif diff --git a/iOSProject/Pods/YYText/YYText/YYTextView.h b/iOSProject/Pods/YYText/YYText/YYTextView.h deleted file mode 100644 index db5a275a..00000000 --- a/iOSProject/Pods/YYText/YYText/YYTextView.h +++ /dev/null @@ -1,410 +0,0 @@ -// -// YYTextView.h -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import - -#if __has_include() -#import -#import -#import -#else -#import "YYTextParser.h" -#import "YYTextLayout.h" -#import "YYTextAttribute.h" -#endif - -@class YYTextView; - -NS_ASSUME_NONNULL_BEGIN - -/** - The YYTextViewDelegate protocol defines a set of optional methods you can use - to receive editing-related messages for YYTextView objects. - - @discussion The API and behavior is similar to UITextViewDelegate, - see UITextViewDelegate's documentation for more information. - */ -@protocol YYTextViewDelegate -@optional -- (BOOL)textViewShouldBeginEditing:(YYTextView *)textView; -- (BOOL)textViewShouldEndEditing:(YYTextView *)textView; -- (void)textViewDidBeginEditing:(YYTextView *)textView; -- (void)textViewDidEndEditing:(YYTextView *)textView; -- (BOOL)textView:(YYTextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; -- (void)textViewDidChange:(YYTextView *)textView; -- (void)textViewDidChangeSelection:(YYTextView *)textView; - -- (BOOL)textView:(YYTextView *)textView shouldTapHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange; -- (void)textView:(YYTextView *)textView didTapHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange rect:(CGRect)rect; -- (BOOL)textView:(YYTextView *)textView shouldLongPressHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange; -- (void)textView:(YYTextView *)textView didLongPressHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange rect:(CGRect)rect; -@end - - -#if !TARGET_INTERFACE_BUILDER - -/** - The YYTextView class implements the behavior for a scrollable, multiline text region. - - @discussion The API and behavior is similar to UITextView, but provides more features: - - * It extends the CoreText attributes to support more text effects. - * It allows to add UIImage, UIView and CALayer as text attachments. - * It allows to add 'highlight' link to some range of text to allow user interact with. - * It allows to add exclusion paths to control text container's shape. - * It supports vertical form layout to display and edit CJK text. - * It allows user to copy/paste image and attributed text from/to text view. - * It allows to set an attributed text as placeholder. - - See NSAttributedString+YYText.h for more convenience methods to set the attributes. - See YYTextAttribute.h and YYTextLayout.h for more information. - */ -@interface YYTextView : UIScrollView - - -#pragma mark - Accessing the Delegate -///============================================================================= -/// @name Accessing the Delegate -///============================================================================= - -@property (nullable, nonatomic, weak) id delegate; - - -#pragma mark - Configuring the Text Attributes -///============================================================================= -/// @name Configuring the Text Attributes -///============================================================================= - -/** - The text displayed by the text view. - Set a new value to this property also replaces the text in `attributedText`. - Get the value returns the plain text in `attributedText`. - */ -@property (null_resettable, nonatomic, copy) NSString *text; - -/** - The font of the text. Default is 12-point system font. - Set a new value to this property also causes the new font to be applied to the entire `attributedText`. - Get the value returns the font at the head of `attributedText`. - */ -@property (nullable, nonatomic, strong) UIFont *font; - -/** - The color of the text. Default is black. - Set a new value to this property also causes the new color to be applied to the entire `attributedText`. - Get the value returns the color at the head of `attributedText`. - */ -@property (nullable, nonatomic, strong) UIColor *textColor; - -/** - The technique to use for aligning the text. Default is NSTextAlignmentNatural. - Set a new value to this property also causes the new alignment to be applied to the entire `attributedText`. - Get the value returns the alignment at the head of `attributedText`. - */ -@property (nonatomic) NSTextAlignment textAlignment; - -/** - The text vertical aligmnent in container. Default is YYTextVerticalAlignmentTop. - */ -@property (nonatomic) YYTextVerticalAlignment textVerticalAlignment; - -/** - The types of data converted to clickable URLs in the text view. Default is UIDataDetectorTypeNone. - The tap or long press action should be handled by delegate. - */ -@property (nonatomic) UIDataDetectorTypes dataDetectorTypes; - -/** - The attributes to apply to links at normal state. Default is light blue color. - When a range of text is detected by the `dataDetectorTypes`, this value would be - used to modify the original attributes in the range. - */ -@property (nullable, nonatomic, copy) NSDictionary *linkTextAttributes; - -/** - The attributes to apply to links at highlight state. Default is a gray border. - When a range of text is detected by the `dataDetectorTypes` and the range was touched by user, - this value would be used to modify the original attributes in the range. - */ -@property (nullable, nonatomic, copy) NSDictionary *highlightTextAttributes; - -/** - The attributes to apply to new text being entered by the user. - When the text view's selection changes, this value is reset automatically. - */ -@property (nullable, nonatomic, copy) NSDictionary *typingAttributes; - -/** - The styled text displayed by the text view. - Set a new value to this property also replaces the value of the `text`, `font`, `textColor`, - `textAlignment` and other properties in text view. - - @discussion It only support the attributes declared in CoreText and YYTextAttribute. - See `NSAttributedString+YYText` for more convenience methods to set the attributes. - */ -@property (nullable, nonatomic, copy) NSAttributedString *attributedText; - -/** - When `text` or `attributedText` is changed, the parser will be called to modify the text. - It can be used to add code highlighting or emoticon replacement to text view. - The default value is nil. - - See `YYTextParser` protocol for more information. - */ -@property (nullable, nonatomic, strong) id textParser; - -/** - The current text layout in text view (readonly). - It can be used to query the text layout information. - */ -@property (nullable, nonatomic, strong, readonly) YYTextLayout *textLayout; - - -#pragma mark - Configuring the Placeholder -///============================================================================= -/// @name Configuring the Placeholder -///============================================================================= - -/** - The placeholder text displayed by the text view (when the text view is empty). - Set a new value to this property also replaces the text in `placeholderAttributedText`. - Get the value returns the plain text in `placeholderAttributedText`. - */ -@property (nullable, nonatomic, copy) NSString *placeholderText; - -/** - The font of the placeholder text. Default is same as `font` property. - Set a new value to this property also causes the new font to be applied to the entire `placeholderAttributedText`. - Get the value returns the font at the head of `placeholderAttributedText`. - */ -@property (nullable, nonatomic, strong) UIFont *placeholderFont; - -/** - The color of the placeholder text. Default is gray. - Set a new value to this property also causes the new color to be applied to the entire `placeholderAttributedText`. - Get the value returns the color at the head of `placeholderAttributedText`. - */ -@property (nullable, nonatomic, strong) UIColor *placeholderTextColor; - -/** - The styled placeholder text displayed by the text view (when the text view is empty). - Set a new value to this property also replaces the value of the `placeholderText`, - `placeholderFont`, `placeholderTextColor`. - - @discussion It only support the attributes declared in CoreText and YYTextAttribute. - See `NSAttributedString+YYText` for more convenience methods to set the attributes. - */ -@property (nullable, nonatomic, copy) NSAttributedString *placeholderAttributedText; - - -#pragma mark - Configuring the Text Container -///============================================================================= -/// @name Configuring the Text Container -///============================================================================= - -/** - The inset of the text container's layout area within the text view's content area. - */ -@property (nonatomic) UIEdgeInsets textContainerInset; - -/** - An array of UIBezierPath objects representing the exclusion paths inside the - receiver's bounding rectangle. Default value is nil. - */ -@property (nullable, nonatomic, copy) NSArray *exclusionPaths; - -/** - Whether the receiver's layout orientation is vertical form. Default is NO. - It may used to edit/display CJK text. - */ -@property (nonatomic, getter=isVerticalForm) BOOL verticalForm; - -/** - The text line position modifier used to modify the lines' position in layout. - See `YYTextLinePositionModifier` protocol for more information. - */ -@property (nullable, nonatomic, copy) id linePositionModifier; - -/** - The debug option to display CoreText layout result. - The default value is [YYTextDebugOption sharedDebugOption]. - */ -@property (nullable, nonatomic, copy) YYTextDebugOption *debugOption; - - -#pragma mark - Working with the Selection and Menu -///============================================================================= -/// @name Working with the Selection and Menu -///============================================================================= - -/** - Scrolls the receiver until the text in the specified range is visible. - */ -- (void)scrollRangeToVisible:(NSRange)range; - -/** - The current selection range of the receiver. - */ -@property (nonatomic) NSRange selectedRange; - -/** - A Boolean value indicating whether inserting text replaces the previous contents. - The default value is NO. - */ -@property (nonatomic) BOOL clearsOnInsertion; - -/** - A Boolean value indicating whether the receiver is selectable. Default is YES. - When the value of this property is NO, user cannot select content or edit text. - */ -@property (nonatomic, getter=isSelectable) BOOL selectable; - -/** - A Boolean value indicating whether the receiver is highlightable. Default is YES. - When the value of this property is NO, user cannot interact with the highlight range of text. - */ -@property (nonatomic, getter=isHighlightable) BOOL highlightable; - -/** - A Boolean value indicating whether the receiver is editable. Default is YES. - When the value of this property is NO, user cannot edit text. - */ -@property (nonatomic, getter=isEditable) BOOL editable; - -/** - A Boolean value indicating whether the receiver can paste image from pasteboard. Default is NO. - When the value of this property is YES, user can paste image from pasteboard via "paste" menu. - */ -@property (nonatomic) BOOL allowsPasteImage; - -/** - A Boolean value indicating whether the receiver can paste attributed text from pasteboard. Default is NO. - When the value of this property is YES, user can paste attributed text from pasteboard via "paste" menu. - */ -@property (nonatomic) BOOL allowsPasteAttributedString; - -/** - A Boolean value indicating whether the receiver can copy attributed text to pasteboard. Default is YES. - When the value of this property is YES, user can copy attributed text (with attachment image) - from text view to pasteboard via "copy" menu. - */ -@property (nonatomic) BOOL allowsCopyAttributedString; - - -#pragma mark - Manage the undo and redo -///============================================================================= -/// @name Manage the undo and redo -///============================================================================= - -/** - A Boolean value indicating whether the receiver can undo and redo typing with - shake gesture. The default value is YES. - */ -@property (nonatomic) BOOL allowsUndoAndRedo; - -/** - The maximum undo/redo level. The default value is 20. - */ -@property (nonatomic) NSUInteger maximumUndoLevel; - - -#pragma mark - Replacing the System Input Views -///============================================================================= -/// @name Replacing the System Input Views -///============================================================================= - -/** - The custom input view to display when the text view becomes the first responder. - It can be used to replace system keyboard. - - @discussion If set the value while first responder, it will not take effect until - 'reloadInputViews' is called. - */ -@property (nullable, nonatomic, readwrite, strong) __kindof UIView *inputView; - -/** - The custom accessory view to display when the text view becomes the first responder. - It can be used to add a toolbar at the top of keyboard. - - @discussion If set the value while first responder, it will not take effect until - 'reloadInputViews' is called. - */ -@property (nullable, nonatomic, readwrite, strong) __kindof UIView *inputAccessoryView; - -/** - If you use an custom accessory view without "inputAccessoryView" property, - you may set the accessory view's height. It may used by auto scroll calculation. - */ -@property (nonatomic) CGFloat extraAccessoryViewHeight; - -@end - - -#else // TARGET_INTERFACE_BUILDER -IB_DESIGNABLE -@interface YYTextView : UIScrollView -@property (null_resettable, nonatomic, copy) IBInspectable NSString *text; -@property (nullable, nonatomic, strong) IBInspectable UIColor *textColor; -@property (nullable, nonatomic, strong) IBInspectable NSString *fontName_; -@property (nonatomic) IBInspectable CGFloat fontSize_; -@property (nonatomic) IBInspectable BOOL fontIsBold_; -@property (nonatomic) IBInspectable NSTextAlignment textAlignment; -@property (nonatomic) IBInspectable YYTextVerticalAlignment textVerticalAlignment; -@property (nullable, nonatomic, copy) IBInspectable NSString *placeholderText; -@property (nullable, nonatomic, strong) IBInspectable UIColor *placeholderTextColor; -@property (nullable, nonatomic, strong) IBInspectable NSString *placeholderFontName_; -@property (nonatomic) IBInspectable CGFloat placeholderFontSize_; -@property (nonatomic) IBInspectable BOOL placeholderFontIsBold_; -@property (nonatomic, getter=isVerticalForm) IBInspectable BOOL verticalForm; -@property (nonatomic) IBInspectable BOOL clearsOnInsertion; -@property (nonatomic, getter=isSelectable) IBInspectable BOOL selectable; -@property (nonatomic, getter=isHighlightable) IBInspectable BOOL highlightable; -@property (nonatomic, getter=isEditable) IBInspectable BOOL editable; -@property (nonatomic) IBInspectable BOOL allowsPasteImage; -@property (nonatomic) IBInspectable BOOL allowsPasteAttributedString; -@property (nonatomic) IBInspectable BOOL allowsCopyAttributedString; -@property (nonatomic) IBInspectable BOOL allowsUndoAndRedo; -@property (nonatomic) IBInspectable NSUInteger maximumUndoLevel; -@property (nonatomic) IBInspectable CGFloat insetTop_; -@property (nonatomic) IBInspectable CGFloat insetBottom_; -@property (nonatomic) IBInspectable CGFloat insetLeft_; -@property (nonatomic) IBInspectable CGFloat insetRight_; -@property (nonatomic) IBInspectable BOOL debugEnabled_; -@property (nullable, nonatomic, weak) id delegate; -@property (nullable, nonatomic, strong) UIFont *font; -@property (nonatomic) UIDataDetectorTypes dataDetectorTypes; -@property (nullable, nonatomic, copy) NSDictionary *linkTextAttributes; -@property (nullable, nonatomic, copy) NSDictionary *highlightTextAttributes; -@property (nullable, nonatomic, copy) NSDictionary *typingAttributes; -@property (nullable, nonatomic, copy) NSAttributedString *attributedText; -@property (nullable, nonatomic, strong) id textParser; -@property (nullable, nonatomic, strong, readonly) YYTextLayout *textLayout; -@property (nullable, nonatomic, strong) UIFont *placeholderFont; -@property (nullable, nonatomic, copy) NSAttributedString *placeholderAttributedText; -@property (nonatomic) UIEdgeInsets textContainerInset; -@property (nullable, nonatomic, copy) NSArray *exclusionPaths; -@property (nullable, nonatomic, copy) id linePositionModifier; -@property (nullable, nonatomic, copy) YYTextDebugOption *debugOption; -- (void)scrollRangeToVisible:(NSRange)range; -@property (nonatomic) NSRange selectedRange; -@property (nullable, nonatomic, readwrite, strong) __kindof UIView *inputView; -@property (nullable, nonatomic, readwrite, strong) __kindof UIView *inputAccessoryView; -@property (nonatomic) CGFloat extraAccessoryViewHeight; -@end -#endif // !TARGET_INTERFACE_BUILDER - - -// Notifications, see UITextView's documentation for more information. -UIKIT_EXTERN NSString *const YYTextViewTextDidBeginEditingNotification; -UIKIT_EXTERN NSString *const YYTextViewTextDidChangeNotification; -UIKIT_EXTERN NSString *const YYTextViewTextDidEndEditingNotification; - -NS_ASSUME_NONNULL_END diff --git a/iOSProject/Pods/YYText/YYText/YYTextView.m b/iOSProject/Pods/YYText/YYText/YYTextView.m deleted file mode 100644 index 01b1629a..00000000 --- a/iOSProject/Pods/YYText/YYText/YYTextView.m +++ /dev/null @@ -1,3830 +0,0 @@ -// -// YYTextView.m -// YYText -// -// Created by ibireme on 15/2/25. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. -// - -#import "YYTextView.h" -#import "YYTextInput.h" -#import "YYTextContainerView.h" -#import "YYTextSelectionView.h" -#import "YYTextMagnifier.h" -#import "YYTextEffectWindow.h" -#import "YYTextKeyboardManager.h" -#import "YYTextUtilities.h" -#import "YYTextTransaction.h" -#import "YYTextWeakProxy.h" -#import "NSAttributedString+YYText.h" -#import "UIPasteboard+YYText.h" -#import "UIView+YYText.h" - - -static double _YYDeviceSystemVersion() { - static double version; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - version = [UIDevice currentDevice].systemVersion.doubleValue; - }); - return version; -} - -#ifndef kSystemVersion -#define kSystemVersion _YYDeviceSystemVersion() -#endif - -#ifndef kiOS6Later -#define kiOS6Later (kSystemVersion >= 6) -#endif - -#ifndef kiOS7Later -#define kiOS7Later (kSystemVersion >= 7) -#endif - -#ifndef kiOS8Later -#define kiOS8Later (kSystemVersion >= 8) -#endif - -#ifndef kiOS9Later -#define kiOS9Later (kSystemVersion >= 9) -#endif - - - -#define kDefaultUndoLevelMax 20 // Default maximum undo level - -#define kAutoScrollMinimumDuration 0.1 // Time in seconds to tick auto-scroll. -#define kLongPressMinimumDuration 0.5 // Time in seconds the fingers must be held down for long press gesture. -#define kLongPressAllowableMovement 10.0 // Maximum movement in points allowed before the long press fails. - -#define kMagnifierRangedTrackFix -6.0 // Magnifier ranged offset fix. -#define kMagnifierRangedPopoverOffset 4.0 // Magnifier ranged popover offset. -#define kMagnifierRangedCaptureOffset -6.0 // Magnifier ranged capture center offset. - -#define kHighlightFadeDuration 0.15 // Time in seconds for highlight fadeout animation. - -#define kDefaultInset UIEdgeInsetsMake(6, 4, 6, 4) -#define kDefaultVerticalInset UIEdgeInsetsMake(4, 6, 4, 6) - - -NSString *const YYTextViewTextDidBeginEditingNotification = @"YYTextViewTextDidBeginEditing"; -NSString *const YYTextViewTextDidChangeNotification = @"YYTextViewTextDidChange"; -NSString *const YYTextViewTextDidEndEditingNotification = @"YYTextViewTextDidEndEditing"; - - -typedef NS_ENUM (NSUInteger, YYTextGrabberDirection) { - kStart = 1, - kEnd = 2, -}; - -typedef NS_ENUM(NSUInteger, YYTextMoveDirection) { - kLeft = 1, - kTop = 2, - kRight = 3, - kBottom = 4, -}; - - -/// An object that captures the state of the text view. Used for undo and redo. -@interface _YYTextViewUndoObject : NSObject -@property (nonatomic, strong) NSAttributedString *text; -@property (nonatomic, assign) NSRange selectedRange; -@end -@implementation _YYTextViewUndoObject -+ (instancetype)objectWithText:(NSAttributedString *)text range:(NSRange)range { - _YYTextViewUndoObject *obj = [self new]; - obj.text = text ? text : [NSAttributedString new]; - obj.selectedRange = range; - return obj; -} -@end - - -@interface YYTextView () { - - YYTextRange *_selectedTextRange; /// nonnull - YYTextRange *_markedTextRange; - - __weak id _outerDelegate; - - UIImageView *_placeHolderView; - - NSMutableAttributedString *_innerText; ///< nonnull, inner attributed text - NSMutableAttributedString *_delectedText; ///< detected text for display - YYTextContainer *_innerContainer; ///< nonnull, inner text container - YYTextLayout *_innerLayout; ///< inner text layout, the text in this layout is longer than `_innerText` by appending '\n' - - YYTextContainerView *_containerView; ///< nonnull - YYTextSelectionView *_selectionView; ///< nonnull - YYTextMagnifier *_magnifierCaret; ///< nonnull - YYTextMagnifier *_magnifierRanged; ///< nonnull - - NSMutableAttributedString *_typingAttributesHolder; ///< nonnull, typing attributes - NSDataDetector *_dataDetector; - CGFloat _magnifierRangedOffset; - - NSRange _highlightRange; ///< current highlight range - YYTextHighlight *_highlight; ///< highlight attribute in `_highlightRange` - YYTextLayout *_highlightLayout; ///< when _state.showingHighlight=YES, this layout should be displayed - YYTextRange *_trackingRange; ///< the range in _innerLayout, may out of _innerText. - - BOOL _insetModifiedByKeyboard; ///< text is covered by keyboard, and the contentInset is modified - UIEdgeInsets _originalContentInset; ///< the original contentInset before modified - UIEdgeInsets _originalScrollIndicatorInsets; ///< the original scrollIndicatorInsets before modified - - NSTimer *_longPressTimer; - NSTimer *_autoScrollTimer; - CGFloat _autoScrollOffset; ///< current auto scroll offset which shoud add to scroll view - NSInteger _autoScrollAcceleration; ///< an acceleration coefficient for auto scroll - NSTimer *_selectionDotFixTimer; ///< fix the selection dot in window if the view is moved by parents - CGPoint _previousOriginInWindow; - - CGPoint _touchBeganPoint; - CGPoint _trackingPoint; - NSTimeInterval _touchBeganTime; - NSTimeInterval _trackingTime; - - NSMutableArray *_undoStack; - NSMutableArray *_redoStack; - NSRange _lastTypeRange; - - struct { - unsigned int trackingGrabber : 2; ///< YYTextGrabberDirection, current tracking grabber - unsigned int trackingCaret : 1; ///< track the caret - unsigned int trackingPreSelect : 1; ///< track pre-select - unsigned int trackingTouch : 1; ///< is in touch phase - unsigned int swallowTouch : 1; ///< don't forward event to next responder - unsigned int touchMoved : 3; ///< YYTextMoveDirection, move direction after touch began - unsigned int selectedWithoutEdit : 1; ///< show selected range but not first responder - unsigned int deleteConfirm : 1; ///< delete a binding text range - unsigned int ignoreFirstResponder : 1; ///< ignore become first responder temporary - unsigned int ignoreTouchBegan : 1; ///< ignore begin tracking touch temporary - - unsigned int showingMagnifierCaret : 1; - unsigned int showingMagnifierRanged : 1; - unsigned int showingMenu : 1; - unsigned int showingHighlight : 1; - - unsigned int typingAttributesOnce : 1; ///< apply the typing attributes once - unsigned int clearsOnInsertionOnce : 1; ///< select all once when become first responder - unsigned int autoScrollTicked : 1; ///< auto scroll did tick scroll at this timer period - unsigned int firstShowDot : 1; ///< the selection grabber dot has displayed at least once - unsigned int needUpdate : 1; ///< the layout or selection view is 'dirty' and need update - unsigned int placeholderNeedUpdate : 1; ///< the placeholder need update it's contents - - unsigned int insideUndoBlock : 1; - unsigned int firstResponderBeforeUndoAlert : 1; - } _state; -} - -@end - - -@implementation YYTextView - -#pragma mark - @protocol UITextInputTraits -@synthesize autocapitalizationType = _autocapitalizationType; -@synthesize autocorrectionType = _autocorrectionType; -@synthesize spellCheckingType = _spellCheckingType; -@synthesize keyboardType = _keyboardType; -@synthesize keyboardAppearance = _keyboardAppearance; -@synthesize returnKeyType = _returnKeyType; -@synthesize enablesReturnKeyAutomatically = _enablesReturnKeyAutomatically; -@synthesize secureTextEntry = _secureTextEntry; - -#pragma mark - @protocol UITextInput -@synthesize selectedTextRange = _selectedTextRange; //copy nonnull (YYTextRange*) -@synthesize markedTextRange = _markedTextRange; //readonly (YYTextRange*) -@synthesize markedTextStyle = _markedTextStyle; //copy -@synthesize inputDelegate = _inputDelegate; //assign -@synthesize tokenizer = _tokenizer; //readonly - -#pragma mark - @protocol UITextInput optional -@synthesize selectionAffinity = _selectionAffinity; - - -#pragma mark - Private - -/// Update layout and selection before runloop sleep/end. -- (void)_commitUpdate { -#if !TARGET_INTERFACE_BUILDER - _state.needUpdate = YES; - [[YYTextTransaction transactionWithTarget:self selector:@selector(_updateIfNeeded)] commit]; -#else - [self _update]; -#endif -} - -/// Update layout and selection view if needed. -- (void)_updateIfNeeded { - if (_state.needUpdate) { - [self _update]; - } -} - -/// Update layout and selection view immediately. -- (void)_update { - _state.needUpdate = NO; - [self _updateLayout]; - [self _updateSelectionView]; -} - -/// Update layout immediately. -- (void)_updateLayout { - NSMutableAttributedString *text = _innerText.mutableCopy; - _placeHolderView.hidden = text.length > 0; - if ([self _detectText:text]) { - _delectedText = text; - } else { - _delectedText = nil; - } - [text replaceCharactersInRange:NSMakeRange(text.length, 0) withString:@"\r"]; // add for nextline caret - [text yy_removeDiscontinuousAttributesInRange:NSMakeRange(_innerText.length, 1)]; - [text removeAttribute:YYTextBorderAttributeName range:NSMakeRange(_innerText.length, 1)]; - [text removeAttribute:YYTextBackgroundBorderAttributeName range:NSMakeRange(_innerText.length, 1)]; - if (_innerText.length == 0) { - [text yy_setAttributes:_typingAttributesHolder.yy_attributes]; // add for empty text caret - } - if (_selectedTextRange.end.offset == _innerText.length) { - [_typingAttributesHolder.yy_attributes enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) { - [text yy_setAttribute:key value:value range:NSMakeRange(_innerText.length, 1)]; - }]; - } - [self willChangeValueForKey:@"textLayout"]; - _innerLayout = [YYTextLayout layoutWithContainer:_innerContainer text:text]; - [self didChangeValueForKey:@"textLayout"]; - CGSize size = [_innerLayout textBoundingSize]; - CGSize visibleSize = [self _getVisibleSize]; - if (_innerContainer.isVerticalForm) { - size.height = visibleSize.height; - if (size.width < visibleSize.width) size.width = visibleSize.width; - } else { - size.width = visibleSize.width; - } - - [_containerView setLayout:_innerLayout withFadeDuration:0]; - _containerView.frame = (CGRect){.size = size}; - _state.showingHighlight = NO; - self.contentSize = size; -} - -/// Update selection view immediately. -/// This method should be called after "layout update" finished. -- (void)_updateSelectionView { - _selectionView.frame = _containerView.frame; - _selectionView.caretBlinks = NO; - _selectionView.caretVisible = NO; - _selectionView.selectionRects = nil; - [[YYTextEffectWindow sharedWindow] hideSelectionDot:_selectionView]; - if (!_innerLayout) return; - - NSMutableArray *allRects = [NSMutableArray new]; - BOOL containsDot = NO; - - YYTextRange *selectedRange = _selectedTextRange; - if (_state.trackingTouch && _trackingRange) { - selectedRange = _trackingRange; - } - - if (_markedTextRange) { - NSArray *rects = [_innerLayout selectionRectsWithoutStartAndEndForRange:_markedTextRange]; - if (rects) [allRects addObjectsFromArray:rects]; - if (selectedRange.asRange.length > 0) { - rects = [_innerLayout selectionRectsWithOnlyStartAndEndForRange:selectedRange]; - if (rects) [allRects addObjectsFromArray:rects]; - containsDot = rects.count > 0; - } else { - CGRect rect = [_innerLayout caretRectForPosition:selectedRange.end]; - _selectionView.caretRect = [self _convertRectFromLayout:rect]; - _selectionView.caretVisible = YES; - _selectionView.caretBlinks = YES; - } - } else { - if (selectedRange.asRange.length == 0) { // only caret - if (self.isFirstResponder || _state.trackingPreSelect) { - CGRect rect = [_innerLayout caretRectForPosition:selectedRange.end]; - _selectionView.caretRect = [self _convertRectFromLayout:rect]; - _selectionView.caretVisible = YES; - if (!_state.trackingCaret && !_state.trackingPreSelect) { - _selectionView.caretBlinks = YES; - } - } - } else { // range selected - if ((self.isFirstResponder && !_state.deleteConfirm) || - (!self.isFirstResponder && _state.selectedWithoutEdit)) { - NSArray *rects = [_innerLayout selectionRectsForRange:selectedRange]; - if (rects) [allRects addObjectsFromArray:rects]; - containsDot = rects.count > 0; - } else if ((!self.isFirstResponder && _state.trackingPreSelect) || - (self.isFirstResponder && _state.deleteConfirm)){ - NSArray *rects = [_innerLayout selectionRectsWithoutStartAndEndForRange:selectedRange]; - if (rects) [allRects addObjectsFromArray:rects]; - } - } - } - [allRects enumerateObjectsUsingBlock:^(YYTextSelectionRect *rect, NSUInteger idx, BOOL *stop) { - rect.rect = [self _convertRectFromLayout:rect.rect]; - }]; - _selectionView.selectionRects = allRects; - if (!_state.firstShowDot && containsDot) { - _state.firstShowDot = YES; - /* - The dot position may be wrong at the first time displayed. - I can't find the reason. Here's a workaround. - */ - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.02 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [[YYTextEffectWindow sharedWindow] showSelectionDot:_selectionView]; - }); - } - [[YYTextEffectWindow sharedWindow] showSelectionDot:_selectionView]; - - if (containsDot) { - [self _startSelectionDotFixTimer]; - } else { - [self _endSelectionDotFixTimer]; - } -} - -/// Update inner contains's size. -- (void)_updateInnerContainerSize { - CGSize size = [self _getVisibleSize]; - if (_innerContainer.isVerticalForm) size.width = CGFLOAT_MAX; - else size.height = CGFLOAT_MAX; - _innerContainer.size = size; -} - -/// Update placeholder before runloop sleep/end. -- (void)_commitPlaceholderUpdate { -#if !TARGET_INTERFACE_BUILDER - _state.placeholderNeedUpdate = YES; - [[YYTextTransaction transactionWithTarget:self selector:@selector(_updatePlaceholderIfNeeded)] commit]; -#else - [self _updatePlaceholder]; -#endif -} - -/// Update placeholder if needed. -- (void)_updatePlaceholderIfNeeded { - if (_state.placeholderNeedUpdate) { - _state.placeholderNeedUpdate = NO; - [self _updatePlaceholder]; - } -} - -/// Update placeholder immediately. -- (void)_updatePlaceholder { - CGRect frame = CGRectZero; - _placeHolderView.image = nil; - _placeHolderView.frame = frame; - if (_placeholderAttributedText.length > 0) { - YYTextContainer *container = _innerContainer.copy; - container.size = self.bounds.size; - container.truncationType = YYTextTruncationTypeEnd; - container.truncationToken = nil; - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:_placeholderAttributedText]; - CGSize size = [layout textBoundingSize]; - BOOL needDraw = size.width > 1 && size.height > 1; - if (needDraw) { - UIGraphicsBeginImageContextWithOptions(size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - [layout drawInContext:context size:size debug:self.debugOption]; - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - _placeHolderView.image = image; - frame.size = image.size; - if (container.isVerticalForm) { - frame.origin.x = self.bounds.size.width - image.size.width; - } else { - frame.origin = CGPointZero; - } - _placeHolderView.frame = frame; - } - } -} - -/// Update the `_selectedTextRange` to a single position by `_trackingPoint`. -- (void)_updateTextRangeByTrackingCaret { - if (!_state.trackingTouch) return; - - CGPoint trackingPoint = [self _convertPointToLayout:_trackingPoint]; - YYTextPosition *newPos = [_innerLayout closestPositionToPoint:trackingPoint]; - if (newPos) { - newPos = [self _correctedTextPosition:newPos]; - if (_markedTextRange) { - if ([newPos compare:_markedTextRange.start] == NSOrderedAscending) { - newPos = _markedTextRange.start; - } else if ([newPos compare:_markedTextRange.end] == NSOrderedDescending) { - newPos = _markedTextRange.end; - } - } - YYTextRange *newRange = [YYTextRange rangeWithRange:NSMakeRange(newPos.offset, 0) affinity:newPos.affinity]; - _trackingRange = newRange; - } -} - -/// Update the `_selectedTextRange` to a new range by `_trackingPoint` and `_state.trackingGrabber`. -- (void)_updateTextRangeByTrackingGrabber { - if (!_state.trackingTouch || !_state.trackingGrabber) return; - - BOOL isStart = _state.trackingGrabber == kStart; - CGPoint magPoint = _trackingPoint; - magPoint.y += kMagnifierRangedTrackFix; - magPoint = [self _convertPointToLayout:magPoint]; - YYTextPosition *position = [_innerLayout positionForPoint:magPoint - oldPosition:(isStart ? _selectedTextRange.start : _selectedTextRange.end) - otherPosition:(isStart ? _selectedTextRange.end : _selectedTextRange.start)]; - if (position) { - position = [self _correctedTextPosition:position]; - if ((NSUInteger)position.offset > _innerText.length) { - position = [YYTextPosition positionWithOffset:_innerText.length]; - } - YYTextRange *newRange = [YYTextRange rangeWithStart:(isStart ? position : _selectedTextRange.start) - end:(isStart ? _selectedTextRange.end : position)]; - _trackingRange = newRange; - } -} - -/// Update the `_selectedTextRange` to a new range/position by `_trackingPoint`. -- (void)_updateTextRangeByTrackingPreSelect { - if (!_state.trackingTouch) return; - YYTextRange *newRange = [self _getClosestTokenRangeAtPoint:_trackingPoint]; - _trackingRange = newRange; -} - -/// Show or update `_magnifierCaret` based on `_trackingPoint`, and hide `_magnifierRange`. -- (void)_showMagnifierCaret { - if (YYTextIsAppExtension()) return; - - if (_state.showingMagnifierRanged) { - _state.showingMagnifierRanged = NO; - [[YYTextEffectWindow sharedWindow] hideMagnifier:_magnifierRanged]; - } - - _magnifierCaret.hostPopoverCenter = _trackingPoint; - _magnifierCaret.hostCaptureCenter = _trackingPoint; - if (!_state.showingMagnifierCaret) { - _state.showingMagnifierCaret = YES; - [[YYTextEffectWindow sharedWindow] showMagnifier:_magnifierCaret]; - } else { - [[YYTextEffectWindow sharedWindow] moveMagnifier:_magnifierCaret]; - } -} - -/// Show or update `_magnifierRanged` based on `_trackingPoint`, and hide `_magnifierCaret`. -- (void)_showMagnifierRanged { - if (YYTextIsAppExtension()) return; - - if (_verticalForm) { // hack for vertical form... - [self _showMagnifierCaret]; - return; - } - - if (_state.showingMagnifierCaret) { - _state.showingMagnifierCaret = NO; - [[YYTextEffectWindow sharedWindow] hideMagnifier:_magnifierCaret]; - } - - CGPoint magPoint = _trackingPoint; - if (_verticalForm) { - magPoint.x += kMagnifierRangedTrackFix; - } else { - magPoint.y += kMagnifierRangedTrackFix; - } - - YYTextRange *selectedRange = _selectedTextRange; - if (_state.trackingTouch && _trackingRange) { - selectedRange = _trackingRange; - } - - YYTextPosition *position; - if (_markedTextRange) { - position = selectedRange.end; - } else { - position = [_innerLayout positionForPoint:[self _convertPointToLayout:magPoint] - oldPosition:(_state.trackingGrabber == kStart ? selectedRange.start : selectedRange.end) - otherPosition:(_state.trackingGrabber == kStart ? selectedRange.end : selectedRange.start)]; - } - - NSUInteger lineIndex = [_innerLayout lineIndexForPosition:position]; - if (lineIndex < _innerLayout.lines.count) { - YYTextLine *line = _innerLayout.lines[lineIndex]; - CGRect lineRect = [self _convertRectFromLayout:line.bounds]; - if (_verticalForm) { - magPoint.x = YYTEXT_CLAMP(magPoint.x, CGRectGetMinX(lineRect), CGRectGetMaxX(lineRect)); - } else { - magPoint.y = YYTEXT_CLAMP(magPoint.y, CGRectGetMinY(lineRect), CGRectGetMaxY(lineRect)); - } - CGPoint linePoint = [_innerLayout linePositionForPosition:position]; - linePoint = [self _convertPointFromLayout:linePoint]; - - CGPoint popoverPoint = linePoint; - if (_verticalForm) { - popoverPoint.x = linePoint.x + _magnifierRangedOffset; - } else { - popoverPoint.y = linePoint.y + _magnifierRangedOffset; - } - - CGPoint capturePoint; - if (_verticalForm) { - capturePoint.x = linePoint.x + kMagnifierRangedCaptureOffset; - capturePoint.y = linePoint.y; - } else { - capturePoint.x = linePoint.x; - capturePoint.y = linePoint.y + kMagnifierRangedCaptureOffset; - } - - _magnifierRanged.hostPopoverCenter = popoverPoint; - _magnifierRanged.hostCaptureCenter = capturePoint; - if (!_state.showingMagnifierRanged) { - _state.showingMagnifierRanged = YES; - [[YYTextEffectWindow sharedWindow] showMagnifier:_magnifierRanged]; - } else { - [[YYTextEffectWindow sharedWindow] moveMagnifier:_magnifierRanged]; - } - } -} - -/// Update the showing magnifier. -- (void)_updateMagnifier { - if (YYTextIsAppExtension()) return; - - if (_state.showingMagnifierCaret) { - [[YYTextEffectWindow sharedWindow] moveMagnifier:_magnifierCaret]; - } - if (_state.showingMagnifierRanged) { - [[YYTextEffectWindow sharedWindow] moveMagnifier:_magnifierRanged]; - } -} - -/// Hide the `_magnifierCaret` and `_magnifierRanged`. -- (void)_hideMagnifier { - if (YYTextIsAppExtension()) return; - - if (_state.showingMagnifierCaret || _state.showingMagnifierRanged) { - // disable touch began temporary to ignore caret animation overlap - _state.ignoreTouchBegan = YES; - __weak typeof(self) _self = self; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - __strong typeof(_self) self = _self; - if (self) self->_state.ignoreTouchBegan = NO; - }); - } - - if (_state.showingMagnifierCaret) { - _state.showingMagnifierCaret = NO; - [[YYTextEffectWindow sharedWindow] hideMagnifier:_magnifierCaret]; - } - if (_state.showingMagnifierRanged) { - _state.showingMagnifierRanged = NO; - [[YYTextEffectWindow sharedWindow] hideMagnifier:_magnifierRanged]; - } -} - -/// Show and update the UIMenuController. -- (void)_showMenu { - CGRect rect; - if (_selectionView.caretVisible) { - rect = _selectionView.caretView.frame; - } else if (_selectionView.selectionRects.count > 0) { - YYTextSelectionRect *sRect = _selectionView.selectionRects.firstObject; - rect = sRect.rect; - for (NSUInteger i = 1; i < _selectionView.selectionRects.count; i++) { - sRect = _selectionView.selectionRects[i]; - rect = CGRectUnion(rect, sRect.rect); - } - - CGRect inter = CGRectIntersection(rect, self.bounds); - if (!CGRectIsNull(inter) && inter.size.height > 1) { - rect = inter; //clip to bounds - } else { - if (CGRectGetMinY(rect) < CGRectGetMinY(self.bounds)) { - rect.size.height = 1; - rect.origin.y = CGRectGetMinY(self.bounds); - } else { - rect.size.height = 1; - rect.origin.y = CGRectGetMaxY(self.bounds); - } - } - - YYTextKeyboardManager *mgr = [YYTextKeyboardManager defaultManager]; - if (mgr.keyboardVisible) { - CGRect kbRect = [mgr convertRect:mgr.keyboardFrame toView:self]; - CGRect kbInter = CGRectIntersection(rect, kbRect); - if (!CGRectIsNull(kbInter) && kbInter.size.height > 1 && kbInter.size.width > 1) { - // self is covered by keyboard - if (CGRectGetMinY(kbInter) > CGRectGetMinY(rect)) { // keyboard at bottom - rect.size.height -= kbInter.size.height; - } else if (CGRectGetMaxY(kbInter) < CGRectGetMaxY(rect)) { // keyboard at top - rect.origin.y += kbInter.size.height; - rect.size.height -= kbInter.size.height; - } - } - } - } else { - rect = _selectionView.bounds; - } - - if (!self.isFirstResponder) { - if (!_containerView.isFirstResponder) { - [_containerView becomeFirstResponder]; - } - } - - if (self.isFirstResponder || _containerView.isFirstResponder) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - UIMenuController *menu = [UIMenuController sharedMenuController]; - [menu setTargetRect:CGRectStandardize(rect) inView:_selectionView]; - [menu update]; - if (!_state.showingMenu || !menu.menuVisible) { - _state.showingMenu = YES; - [menu setMenuVisible:YES animated:YES]; - } - }); - } -} - -/// Hide the UIMenuController. -- (void)_hideMenu { - if (_state.showingMenu) { - _state.showingMenu = NO; - UIMenuController *menu = [UIMenuController sharedMenuController]; - [menu setMenuVisible:NO animated:YES]; - } - if (_containerView.isFirstResponder) { - _state.ignoreFirstResponder = YES; - [_containerView resignFirstResponder]; // it will call [self becomeFirstResponder], ignore it temporary. - _state.ignoreFirstResponder = NO; - } -} - -/// Show highlight layout based on `_highlight` and `_highlightRange` -/// If the `_highlightLayout` is nil, try to create. -- (void)_showHighlightAnimated:(BOOL)animated { - NSTimeInterval fadeDuration = animated ? kHighlightFadeDuration : 0; - if (!_highlight) return; - if (!_highlightLayout) { - NSMutableAttributedString *hiText = (_delectedText ? _delectedText : _innerText).mutableCopy; - NSDictionary *newAttrs = _highlight.attributes; - [newAttrs enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) { - [hiText yy_setAttribute:key value:value range:_highlightRange]; - }]; - _highlightLayout = [YYTextLayout layoutWithContainer:_innerContainer text:hiText]; - if (!_highlightLayout) _highlight = nil; - } - - if (_highlightLayout && !_state.showingHighlight) { - _state.showingHighlight = YES; - [_containerView setLayout:_highlightLayout withFadeDuration:fadeDuration]; - } -} - -/// Show `_innerLayout` instead of `_highlightLayout`. -/// It does not destory the `_highlightLayout`. -- (void)_hideHighlightAnimated:(BOOL)animated { - NSTimeInterval fadeDuration = animated ? kHighlightFadeDuration : 0; - if (_state.showingHighlight) { - _state.showingHighlight = NO; - [_containerView setLayout:_innerLayout withFadeDuration:fadeDuration]; - } -} - -/// Show `_innerLayout` and destory the `_highlight` and `_highlightLayout`. -- (void)_removeHighlightAnimated:(BOOL)animated { - [self _hideHighlightAnimated:animated]; - _highlight = nil; - _highlightLayout = nil; -} - -/// Scroll current selected range to visible. -- (void)_scrollSelectedRangeToVisible { - [self _scrollRangeToVisible:_selectedTextRange]; -} - -/// Scroll range to visible, take account into keyboard and insets. -- (void)_scrollRangeToVisible:(YYTextRange *)range { - if (!range) return; - CGRect rect = [_innerLayout rectForRange:range]; - if (CGRectIsNull(rect)) return; - rect = [self _convertRectFromLayout:rect]; - rect = [_containerView convertRect:rect toView:self]; - - if (rect.size.width < 1) rect.size.width = 1; - if (rect.size.height < 1) rect.size.height = 1; - CGFloat extend = 3; - - BOOL insetModified = NO; - YYTextKeyboardManager *mgr = [YYTextKeyboardManager defaultManager]; - - if (mgr.keyboardVisible && self.window && self.superview && self.isFirstResponder && !_verticalForm) { - CGRect bounds = self.bounds; - bounds.origin = CGPointZero; - CGRect kbRect = [mgr convertRect:mgr.keyboardFrame toView:self]; - kbRect.origin.y -= _extraAccessoryViewHeight; - kbRect.size.height += _extraAccessoryViewHeight; - - kbRect.origin.x -= self.contentOffset.x; - kbRect.origin.y -= self.contentOffset.y; - CGRect inter = CGRectIntersection(bounds, kbRect); - if (!CGRectIsNull(inter) && inter.size.height > 1 && inter.size.width > extend) { // self is covered by keyboard - if (CGRectGetMinY(inter) > CGRectGetMinY(bounds)) { // keyboard below self.top - - UIEdgeInsets originalContentInset = self.contentInset; - UIEdgeInsets originalScrollIndicatorInsets = self.scrollIndicatorInsets; - if (_insetModifiedByKeyboard) { - originalContentInset = _originalContentInset; - originalScrollIndicatorInsets = _originalScrollIndicatorInsets; - } - - if (originalContentInset.bottom < inter.size.height + extend) { - insetModified = YES; - if (!_insetModifiedByKeyboard) { - _insetModifiedByKeyboard = YES; - _originalContentInset = self.contentInset; - _originalScrollIndicatorInsets = self.scrollIndicatorInsets; - } - UIEdgeInsets newInset = originalContentInset; - UIEdgeInsets newIndicatorInsets = originalScrollIndicatorInsets; - newInset.bottom = inter.size.height + extend; - newIndicatorInsets.bottom = newInset.bottom; - UIViewAnimationOptions curve; - if (kiOS7Later) { - curve = 7 << 16; - } else { - curve = UIViewAnimationOptionCurveEaseInOut; - } - [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction | curve animations:^{ - [super setContentInset:newInset]; - [super setScrollIndicatorInsets:newIndicatorInsets]; - [self scrollRectToVisible:CGRectInset(rect, -extend, -extend) animated:NO]; - } completion:NULL]; - } - } - } - } - if (!insetModified) { - [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut animations:^{ - [self _restoreInsetsAnimated:NO]; - [self scrollRectToVisible:CGRectInset(rect, -extend, -extend) animated:NO]; - } completion:NULL]; - } -} - -/// Restore contents insets if modified by keyboard. -- (void)_restoreInsetsAnimated:(BOOL)animated { - if (_insetModifiedByKeyboard) { - _insetModifiedByKeyboard = NO; - if (animated) { - [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut animations:^{ - [super setContentInset:_originalContentInset]; - [super setScrollIndicatorInsets:_originalScrollIndicatorInsets]; - } completion:NULL]; - } else { - [super setContentInset:_originalContentInset]; - [super setScrollIndicatorInsets:_originalScrollIndicatorInsets]; - } - } -} - -/// Keyboard frame changed, scroll the caret to visible range, or modify the content insets. -- (void)_keyboardChanged { - if (!self.isFirstResponder) return; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - if ([YYTextKeyboardManager defaultManager].keyboardVisible) { - [self _scrollRangeToVisible:_selectedTextRange]; - } else { - [self _restoreInsetsAnimated:YES]; - } - [self _updateMagnifier]; - if (_state.showingMenu) { - [self _showMenu]; - } - }); -} - -/// Start long press timer, used for 'highlight' range text action. -- (void)_startLongPressTimer { - [_longPressTimer invalidate]; - _longPressTimer = [NSTimer timerWithTimeInterval:kLongPressMinimumDuration - target:[YYTextWeakProxy proxyWithTarget:self] - selector:@selector(_trackDidLongPress) - userInfo:nil - repeats:NO]; - [[NSRunLoop currentRunLoop] addTimer:_longPressTimer forMode:NSRunLoopCommonModes]; -} - -/// Invalidate the long press timer. -- (void)_endLongPressTimer { - [_longPressTimer invalidate]; - _longPressTimer = nil; -} - -/// Long press detected. -- (void)_trackDidLongPress { - [self _endLongPressTimer]; - - BOOL dealLongPressAction = NO; - if (_state.showingHighlight) { - [self _hideMenu]; - - if (_highlight.longPressAction) { - dealLongPressAction = YES; - CGRect rect = [_innerLayout rectForRange:[YYTextRange rangeWithRange:_highlightRange]]; - rect = [self _convertRectFromLayout:rect]; - _highlight.longPressAction(self, _innerText, _highlightRange, rect); - [self _endTouchTracking]; - } else { - BOOL shouldHighlight = YES; - if ([self.delegate respondsToSelector:@selector(textView:shouldLongPressHighlight:inRange:)]) { - shouldHighlight = [self.delegate textView:self shouldLongPressHighlight:_highlight inRange:_highlightRange]; - } - if (shouldHighlight && [self.delegate respondsToSelector:@selector(textView:didLongPressHighlight:inRange:rect:)]) { - dealLongPressAction = YES; - CGRect rect = [_innerLayout rectForRange:[YYTextRange rangeWithRange:_highlightRange]]; - rect = [self _convertRectFromLayout:rect]; - [self.delegate textView:self didLongPressHighlight:_highlight inRange:_highlightRange rect:rect]; - [self _endTouchTracking]; - } - } - } - - if (!dealLongPressAction){ - [self _removeHighlightAnimated:NO]; - if (_state.trackingTouch) { - if (_state.trackingGrabber) { - self.panGestureRecognizer.enabled = NO; - [self _hideMenu]; - [self _showMagnifierRanged]; - } else if (self.isFirstResponder){ - self.panGestureRecognizer.enabled = NO; - _selectionView.caretBlinks = NO; - _state.trackingCaret = YES; - CGPoint trackingPoint = [self _convertPointToLayout:_trackingPoint]; - YYTextPosition *newPos = [_innerLayout closestPositionToPoint:trackingPoint]; - newPos = [self _correctedTextPosition:newPos]; - if (newPos) { - if (_markedTextRange) { - if ([newPos compare:_markedTextRange.start] != NSOrderedDescending) { - newPos = _markedTextRange.start; - } else if ([newPos compare:_markedTextRange.end] != NSOrderedAscending) { - newPos = _markedTextRange.end; - } - } - _trackingRange = [YYTextRange rangeWithRange:NSMakeRange(newPos.offset, 0) affinity:newPos.affinity]; - [self _updateSelectionView]; - } - [self _hideMenu]; - - if (_markedTextRange) { - [self _showMagnifierRanged]; - } else { - [self _showMagnifierCaret]; - } - } else if (self.selectable) { - self.panGestureRecognizer.enabled = NO; - _state.trackingPreSelect = YES; - _state.selectedWithoutEdit = NO; - [self _updateTextRangeByTrackingPreSelect]; - [self _updateSelectionView]; - [self _showMagnifierCaret]; - } - } - } -} - -/// Start auto scroll timer, used for auto scroll tick. -- (void)_startAutoScrollTimer { - if (!_autoScrollTimer) { - [_autoScrollTimer invalidate]; - _autoScrollTimer = [NSTimer timerWithTimeInterval:kAutoScrollMinimumDuration - target:[YYTextWeakProxy proxyWithTarget:self] - selector:@selector(_trackDidTickAutoScroll) - userInfo:nil - repeats:YES]; - [[NSRunLoop currentRunLoop] addTimer:_autoScrollTimer forMode:NSRunLoopCommonModes]; - } -} - -/// Invalidate the auto scroll, and restore the text view state. -- (void)_endAutoScrollTimer { - if (_state.autoScrollTicked) [self flashScrollIndicators]; - [_autoScrollTimer invalidate]; - _autoScrollTimer = nil; - _autoScrollOffset = 0; - _autoScrollAcceleration = 0; - _state.autoScrollTicked = NO; - - if (_magnifierCaret.captureDisabled) { - _magnifierCaret.captureDisabled = NO; - if (_state.showingMagnifierCaret) { - [self _showMagnifierCaret]; - } - } - if (_magnifierRanged.captureDisabled) { - _magnifierRanged.captureDisabled = NO; - if (_state.showingMagnifierRanged) { - [self _showMagnifierRanged]; - } - } -} - -/// Auto scroll ticked by timer. -- (void)_trackDidTickAutoScroll { - if (_autoScrollOffset != 0) { - _magnifierCaret.captureDisabled = YES; - _magnifierRanged.captureDisabled = YES; - - CGPoint offset = self.contentOffset; - if (_verticalForm) { - offset.x += _autoScrollOffset; - - if (_autoScrollAcceleration > 0) { - offset.x += ((_autoScrollOffset > 0 ? 1 : -1) * _autoScrollAcceleration * _autoScrollAcceleration * 0.5); - } - _autoScrollAcceleration++; - offset.x = round(offset.x); - if (_autoScrollOffset < 0) { - if (offset.x < -self.contentInset.left) offset.x = -self.contentInset.left; - } else { - CGFloat maxOffsetX = self.contentSize.width - self.bounds.size.width + self.contentInset.right; - if (offset.x > maxOffsetX) offset.x = maxOffsetX; - } - if (offset.x < -self.contentInset.left) offset.x = -self.contentInset.left; - } else { - offset.y += _autoScrollOffset; - if (_autoScrollAcceleration > 0) { - offset.y += ((_autoScrollOffset > 0 ? 1 : -1) * _autoScrollAcceleration * _autoScrollAcceleration * 0.5); - } - _autoScrollAcceleration++; - offset.y = round(offset.y); - if (_autoScrollOffset < 0) { - if (offset.y < -self.contentInset.top) offset.y = -self.contentInset.top; - } else { - CGFloat maxOffsetY = self.contentSize.height - self.bounds.size.height + self.contentInset.bottom; - if (offset.y > maxOffsetY) offset.y = maxOffsetY; - } - if (offset.y < -self.contentInset.top) offset.y = -self.contentInset.top; - } - - BOOL shouldScroll; - if (_verticalForm) { - shouldScroll = fabs(offset.x -self.contentOffset.x) > 0.5; - } else { - shouldScroll = fabs(offset.y -self.contentOffset.y) > 0.5; - } - - if (shouldScroll) { - _state.autoScrollTicked = YES; - _trackingPoint.x += offset.x - self.contentOffset.x; - _trackingPoint.y += offset.y - self.contentOffset.y; - [UIView animateWithDuration:kAutoScrollMinimumDuration delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionCurveLinear animations:^{ - [self setContentOffset:offset]; - } completion:^(BOOL finished) { - if (_state.trackingTouch) { - if (_state.trackingGrabber) { - [self _showMagnifierRanged]; - [self _updateTextRangeByTrackingGrabber]; - } else if (_state.trackingPreSelect) { - [self _showMagnifierCaret]; - [self _updateTextRangeByTrackingPreSelect]; - } else if (_state.trackingCaret) { - if (_markedTextRange) { - [self _showMagnifierRanged]; - } else { - [self _showMagnifierCaret]; - } - [self _updateTextRangeByTrackingCaret]; - } - [self _updateSelectionView]; - } - }]; - } else { - [self _endAutoScrollTimer]; - } - } else { - [self _endAutoScrollTimer]; - } -} - -/// End current touch tracking (if is tracking now), and update the state. -- (void)_endTouchTracking { - if (!_state.trackingTouch) return; - - _state.trackingTouch = NO; - _state.trackingGrabber = NO; - _state.trackingCaret = NO; - _state.trackingPreSelect = NO; - _state.touchMoved = NO; - _state.deleteConfirm = NO; - _state.clearsOnInsertionOnce = NO; - _trackingRange = nil; - _selectionView.caretBlinks = YES; - - [self _removeHighlightAnimated:YES]; - [self _hideMagnifier]; - [self _endLongPressTimer]; - [self _endAutoScrollTimer]; - [self _updateSelectionView]; - - self.panGestureRecognizer.enabled = self.scrollEnabled; -} - -/// Start a timer to fix the selection dot. -- (void)_startSelectionDotFixTimer { - [_selectionDotFixTimer invalidate]; - _longPressTimer = [NSTimer timerWithTimeInterval:1/15.0 - target:[YYTextWeakProxy proxyWithTarget:self] - selector:@selector(_fixSelectionDot) - userInfo:nil - repeats:NO]; - [[NSRunLoop currentRunLoop] addTimer:_longPressTimer forMode:NSRunLoopCommonModes]; -} - -/// End the timer. -- (void)_endSelectionDotFixTimer { - [_selectionDotFixTimer invalidate]; - _selectionDotFixTimer = nil; -} - -/// If it shows selection grabber and this view was moved by super view, -/// update the selection dot in window. -- (void)_fixSelectionDot { - if (YYTextIsAppExtension()) return; - CGPoint origin = [self yy_convertPoint:CGPointZero toViewOrWindow:[YYTextEffectWindow sharedWindow]]; - if (!CGPointEqualToPoint(origin, _previousOriginInWindow)) { - _previousOriginInWindow = origin; - [[YYTextEffectWindow sharedWindow] hideSelectionDot:_selectionView]; - [[YYTextEffectWindow sharedWindow] showSelectionDot:_selectionView]; - } -} - -/// Try to get the character range/position with word granularity from the tokenizer. -- (YYTextRange *)_getClosestTokenRangeAtPosition:(YYTextPosition *)position { - position = [self _correctedTextPosition:position]; - if (!position) return nil; - YYTextRange *range = nil; - if (_tokenizer) { - range = (id)[_tokenizer rangeEnclosingPosition:position withGranularity:UITextGranularityWord inDirection:UITextStorageDirectionForward]; - if (range.asRange.length == 0) { - range = (id)[_tokenizer rangeEnclosingPosition:position withGranularity:UITextGranularityWord inDirection:UITextStorageDirectionBackward]; - } - } - - if (!range || range.asRange.length == 0) { - range = [_innerLayout textRangeByExtendingPosition:position inDirection:UITextLayoutDirectionRight offset:1]; - range = [self _correctedTextRange:range]; - if (range.asRange.length == 0) { - range = [_innerLayout textRangeByExtendingPosition:position inDirection:UITextLayoutDirectionLeft offset:1]; - range = [self _correctedTextRange:range]; - } - } else { - YYTextRange *extStart = [_innerLayout textRangeByExtendingPosition:range.start]; - YYTextRange *extEnd = [_innerLayout textRangeByExtendingPosition:range.end]; - if (extStart && extEnd) { - NSArray *arr = [@[extStart.start, extStart.end, extEnd.start, extEnd.end] sortedArrayUsingSelector:@selector(compare:)]; - range = [YYTextRange rangeWithStart:arr.firstObject end:arr.lastObject]; - } - } - - range = [self _correctedTextRange:range]; - if (range.asRange.length == 0) { - range = [YYTextRange rangeWithRange:NSMakeRange(0, _innerText.length)]; - } - - return [self _correctedTextRange:range]; -} - -/// Try to get the character range/position with word granularity from the tokenizer. -- (YYTextRange *)_getClosestTokenRangeAtPoint:(CGPoint)point { - point = [self _convertPointToLayout:point]; - YYTextRange *touchRange = [_innerLayout closestTextRangeAtPoint:point]; - touchRange = [self _correctedTextRange:touchRange]; - - if (_tokenizer && touchRange) { - YYTextRange *encEnd = (id)[_tokenizer rangeEnclosingPosition:touchRange.end withGranularity:UITextGranularityWord inDirection:UITextStorageDirectionBackward]; - YYTextRange *encStart = (id)[_tokenizer rangeEnclosingPosition:touchRange.start withGranularity:UITextGranularityWord inDirection:UITextStorageDirectionForward]; - if (encEnd && encStart) { - NSArray *arr = [@[encEnd.start, encEnd.end, encStart.start, encStart.end] sortedArrayUsingSelector:@selector(compare:)]; - touchRange = [YYTextRange rangeWithStart:arr.firstObject end:arr.lastObject]; - } - } - - if (touchRange) { - YYTextRange *extStart = [_innerLayout textRangeByExtendingPosition:touchRange.start]; - YYTextRange *extEnd = [_innerLayout textRangeByExtendingPosition:touchRange.end]; - if (extStart && extEnd) { - NSArray *arr = [@[extStart.start, extStart.end, extEnd.start, extEnd.end] sortedArrayUsingSelector:@selector(compare:)]; - touchRange = [YYTextRange rangeWithStart:arr.firstObject end:arr.lastObject]; - } - } - - if (!touchRange) touchRange = [YYTextRange defaultRange]; - - if (_innerText.length && touchRange.asRange.length == 0) { - touchRange = [YYTextRange rangeWithRange:NSMakeRange(0, _innerText.length)]; - } - - return touchRange; -} - -/// Try to get the highlight property. If exist, the range will be returnd by the range pointer. -/// If the delegate ignore the highlight, returns nil. -- (YYTextHighlight *)_getHighlightAtPoint:(CGPoint)point range:(NSRangePointer)range { - if (!_highlightable || !_innerLayout.containsHighlight) return nil; - point = [self _convertPointToLayout:point]; - YYTextRange *textRange = [_innerLayout textRangeAtPoint:point]; - textRange = [self _correctedTextRange:textRange]; - if (!textRange) return nil; - NSUInteger startIndex = textRange.start.offset; - if (startIndex == _innerText.length) { - if (startIndex == 0) return nil; - else startIndex--; - } - NSRange highlightRange = {0}; - NSAttributedString *text = _delectedText ? _delectedText : _innerText; - YYTextHighlight *highlight = [text attribute:YYTextHighlightAttributeName - atIndex:startIndex - longestEffectiveRange:&highlightRange - inRange:NSMakeRange(0, _innerText.length)]; - - if (!highlight) return nil; - - BOOL shouldTap = YES, shouldLongPress = YES; - if (!highlight.tapAction && !highlight.longPressAction) { - if ([self.delegate respondsToSelector:@selector(textView:shouldTapHighlight:inRange:)]) { - shouldTap = [self.delegate textView:self shouldTapHighlight:highlight inRange:highlightRange]; - } - if ([self.delegate respondsToSelector:@selector(textView:shouldLongPressHighlight:inRange:)]) { - shouldLongPress = [self.delegate textView:self shouldLongPressHighlight:highlight inRange:highlightRange]; - } - } - if (!shouldTap && !shouldLongPress) return nil; - if (range) *range = highlightRange; - return highlight; -} - -/// Return the ranged magnifier popover offset from the baseline, base on `_trackingPoint`. -- (CGFloat)_getMagnifierRangedOffset { - CGPoint magPoint = _trackingPoint; - magPoint = [self _convertPointToLayout:magPoint]; - if (_verticalForm) { - magPoint.x += kMagnifierRangedTrackFix; - } else { - magPoint.y += kMagnifierRangedTrackFix; - } - YYTextPosition *position = [_innerLayout closestPositionToPoint:magPoint]; - NSUInteger lineIndex = [_innerLayout lineIndexForPosition:position]; - if (lineIndex < _innerLayout.lines.count) { - YYTextLine *line = _innerLayout.lines[lineIndex]; - if (_verticalForm) { - magPoint.x = YYTEXT_CLAMP(magPoint.x, line.left, line.right); - return magPoint.x - line.position.x + kMagnifierRangedPopoverOffset; - } else { - magPoint.y = YYTEXT_CLAMP(magPoint.y, line.top, line.bottom); - return magPoint.y - line.position.y + kMagnifierRangedPopoverOffset; - } - } else { - return 0; - } -} - -/// Return a YYTextMoveDirection from `_touchBeganPoint` to `_trackingPoint`. -- (unsigned int)_getMoveDirection { - CGFloat moveH = _trackingPoint.x - _touchBeganPoint.x; - CGFloat moveV = _trackingPoint.y - _touchBeganPoint.y; - if (fabs(moveH) > fabs(moveV)) { - if (fabs(moveH) > kLongPressAllowableMovement) { - return moveH > 0 ? kRight : kLeft; - } - } else { - if (fabs(moveV) > kLongPressAllowableMovement) { - return moveV > 0 ? kBottom : kTop; - } - } - return 0; -} - -/// Get the auto scroll offset in one tick time. -- (CGFloat)_getAutoscrollOffset { - if (!_state.trackingTouch) return 0; - - CGRect bounds = self.bounds; - bounds.origin = CGPointZero; - YYTextKeyboardManager *mgr = [YYTextKeyboardManager defaultManager]; - if (mgr.keyboardVisible && self.window && self.superview && self.isFirstResponder && !_verticalForm) { - CGRect kbRect = [mgr convertRect:mgr.keyboardFrame toView:self]; - kbRect.origin.y -= _extraAccessoryViewHeight; - kbRect.size.height += _extraAccessoryViewHeight; - - kbRect.origin.x -= self.contentOffset.x; - kbRect.origin.y -= self.contentOffset.y; - CGRect inter = CGRectIntersection(bounds, kbRect); - if (!CGRectIsNull(inter) && inter.size.height > 1 && inter.size.width > 1) { - if (CGRectGetMinY(inter) > CGRectGetMinY(bounds)) { - bounds.size.height -= inter.size.height; - } - } - } - - CGPoint point = _trackingPoint; - point.x -= self.contentOffset.x; - point.y -= self.contentOffset.y; - - CGFloat maxOfs = 32; // a good value ~ - CGFloat ofs = 0; - if (_verticalForm) { - if (point.x < self.contentInset.left) { - ofs = (point.x - self.contentInset.left - 5) * 0.5; - if (ofs < -maxOfs) ofs = -maxOfs; - } else if (point.x > bounds.size.width) { - ofs = ((point.x - bounds.size.width) + 5) * 0.5; - if (ofs > maxOfs) ofs = maxOfs; - } - } else { - if (point.y < self.contentInset.top) { - ofs = (point.y - self.contentInset.top - 5) * 0.5; - if (ofs < -maxOfs) ofs = -maxOfs; - } else if (point.y > bounds.size.height) { - ofs = ((point.y - bounds.size.height) + 5) * 0.5; - if (ofs > maxOfs) ofs = maxOfs; - } - } - return ofs; -} - -/// Visible size based on bounds and insets -- (CGSize)_getVisibleSize { - CGSize visibleSize = self.bounds.size; - visibleSize.width -= self.contentInset.left - self.contentInset.right; - visibleSize.height -= self.contentInset.top - self.contentInset.bottom; - if (visibleSize.width < 0) visibleSize.width = 0; - if (visibleSize.height < 0) visibleSize.height = 0; - return visibleSize; -} - -/// Returns whether the text view can paste data from pastboard. -- (BOOL)_isPasteboardContainsValidValue { - UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; - if (pasteboard.string.length > 0) { - return YES; - } - if (pasteboard.yy_AttributedString.length > 0) { - if (_allowsPasteAttributedString) { - return YES; - } - } - if (pasteboard.image || pasteboard.yy_ImageData.length > 0) { - if (_allowsPasteImage) { - return YES; - } - } - return NO; -} - -/// Save current selected attributed text to pasteboard. -- (void)_copySelectedTextToPasteboard { - if (_allowsCopyAttributedString) { - NSAttributedString *text = [_innerText attributedSubstringFromRange:_selectedTextRange.asRange]; - if (text.length) { - [UIPasteboard generalPasteboard].yy_AttributedString = text; - } - } else { - NSString *string = [_innerText yy_plainTextForRange:_selectedTextRange.asRange]; - if (string.length) { - [UIPasteboard generalPasteboard].string = string; - } - } -} - -/// Update the text view state when pasteboard changed. -- (void)_pasteboardChanged { - if (_state.showingMenu) { - UIMenuController *menu = [UIMenuController sharedMenuController]; - [menu update]; - } -} - -/// Whether the position is valid (not out of bounds). -- (BOOL)_isTextPositionValid:(YYTextPosition *)position { - if (!position) return NO; - if (position.offset < 0) return NO; - if (position.offset > _innerText.length) return NO; - if (position.offset == 0 && position.affinity == YYTextAffinityBackward) return NO; - if (position.offset == _innerText.length && position.affinity == YYTextAffinityBackward) return NO; - return YES; -} - -/// Whether the range is valid (not out of bounds). -- (BOOL)_isTextRangeValid:(YYTextRange *)range { - if (![self _isTextPositionValid:range.start]) return NO; - if (![self _isTextPositionValid:range.end]) return NO; - return YES; -} - -/// Correct the position if it out of bounds. -- (YYTextPosition *)_correctedTextPosition:(YYTextPosition *)position { - if (!position) return nil; - if ([self _isTextPositionValid:position]) return position; - if (position.offset < 0) { - return [YYTextPosition positionWithOffset:0]; - } - if (position.offset > _innerText.length) { - return [YYTextPosition positionWithOffset:_innerText.length]; - } - if (position.offset == 0 && position.affinity == YYTextAffinityBackward) { - return [YYTextPosition positionWithOffset:position.offset]; - } - if (position.offset == _innerText.length && position.affinity == YYTextAffinityBackward) { - return [YYTextPosition positionWithOffset:position.offset]; - } - return position; -} - -/// Correct the range if it out of bounds. -- (YYTextRange *)_correctedTextRange:(YYTextRange *)range { - if (!range) return nil; - if ([self _isTextRangeValid:range]) return range; - YYTextPosition *start = [self _correctedTextPosition:range.start]; - YYTextPosition *end = [self _correctedTextPosition:range.end]; - return [YYTextRange rangeWithStart:start end:end]; -} - -/// Convert the point from this view to text layout. -- (CGPoint)_convertPointToLayout:(CGPoint)point { - CGSize boundingSize = _innerLayout.textBoundingSize; - if (_innerLayout.container.isVerticalForm) { - CGFloat w = _innerLayout.textBoundingSize.width; - if (w < self.bounds.size.width) w = self.bounds.size.width; - point.x += _innerLayout.container.size.width - w; - if (boundingSize.width < self.bounds.size.width) { - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - point.x += (self.bounds.size.width - boundingSize.width) * 0.5; - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - point.x += (self.bounds.size.width - boundingSize.width); - } - } - return point; - } else { - if (boundingSize.height < self.bounds.size.height) { - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - point.y -= (self.bounds.size.height - boundingSize.height) * 0.5; - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - point.y -= (self.bounds.size.height - boundingSize.height); - } - } - return point; - } -} - -/// Convert the point from text layout to this view. -- (CGPoint)_convertPointFromLayout:(CGPoint)point { - CGSize boundingSize = _innerLayout.textBoundingSize; - if (_innerLayout.container.isVerticalForm) { - CGFloat w = _innerLayout.textBoundingSize.width; - if (w < self.bounds.size.width) w = self.bounds.size.width; - point.x -= _innerLayout.container.size.width - w; - if (boundingSize.width < self.bounds.size.width) { - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - point.x -= (self.bounds.size.width - boundingSize.width) * 0.5; - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - point.x -= (self.bounds.size.width - boundingSize.width); - } - } - return point; - } else { - if (boundingSize.height < self.bounds.size.height) { - if (_textVerticalAlignment == YYTextVerticalAlignmentCenter) { - point.y += (self.bounds.size.height - boundingSize.height) * 0.5; - } else if (_textVerticalAlignment == YYTextVerticalAlignmentBottom) { - point.y += (self.bounds.size.height - boundingSize.height); - } - } - return point; - } -} - -/// Convert the rect from this view to text layout. -- (CGRect)_convertRectToLayout:(CGRect)rect { - rect.origin = [self _convertPointToLayout:rect.origin]; - return rect; -} - -/// Convert the rect from text layout to this view. -- (CGRect)_convertRectFromLayout:(CGRect)rect { - rect.origin = [self _convertPointFromLayout:rect.origin]; - return rect; -} - -/// Replace the range with the text, and change the `_selectTextRange`. -/// The caller should make sure the `range` and `text` are valid before call this method. -- (void)_replaceRange:(YYTextRange *)range withText:(NSString *)text notifyToDelegate:(BOOL)notify{ - if (NSEqualRanges(range.asRange, _selectedTextRange.asRange)) { - if (notify) [_inputDelegate selectionWillChange:self]; - NSRange newRange = NSMakeRange(0, 0); - newRange.location = _selectedTextRange.start.offset + text.length; - _selectedTextRange = [YYTextRange rangeWithRange:newRange]; - if (notify) [_inputDelegate selectionDidChange:self]; - } else { - if (range.asRange.length != text.length) { - if (notify) [_inputDelegate selectionWillChange:self]; - NSRange unionRange = NSIntersectionRange(_selectedTextRange.asRange, range.asRange); - if (unionRange.length == 0) { - // no intersection - if (range.end.offset <= _selectedTextRange.start.offset) { - NSInteger ofs = (NSInteger)text.length - (NSInteger)range.asRange.length; - NSRange newRange = _selectedTextRange.asRange; - newRange.location += ofs; - _selectedTextRange = [YYTextRange rangeWithRange:newRange]; - } - } else if (unionRange.length == _selectedTextRange.asRange.length) { - // target range contains selected range - _selectedTextRange = [YYTextRange rangeWithRange:NSMakeRange(range.start.offset + text.length, 0)]; - } else if (range.start.offset >= _selectedTextRange.start.offset && - range.end.offset <= _selectedTextRange.end.offset) { - // target range inside selected range - NSInteger ofs = (NSInteger)text.length - (NSInteger)range.asRange.length; - NSRange newRange = _selectedTextRange.asRange; - newRange.length += ofs; - _selectedTextRange = [YYTextRange rangeWithRange:newRange]; - } else { - // interleaving - if (range.start.offset < _selectedTextRange.start.offset) { - NSRange newRange = _selectedTextRange.asRange; - newRange.location = range.start.offset + text.length; - newRange.length -= unionRange.length; - _selectedTextRange = [YYTextRange rangeWithRange:newRange]; - } else { - NSRange newRange = _selectedTextRange.asRange; - newRange.length -= unionRange.length; - _selectedTextRange = [YYTextRange rangeWithRange:newRange]; - } - } - _selectedTextRange = [self _correctedTextRange:_selectedTextRange]; - if (notify) [_inputDelegate selectionDidChange:self]; - } - } - if (notify) [_inputDelegate textWillChange:self]; - NSRange newRange = NSMakeRange(range.asRange.location, text.length); - [_innerText replaceCharactersInRange:range.asRange withString:text]; - [_innerText yy_removeDiscontinuousAttributesInRange:newRange]; - if (notify) [_inputDelegate textDidChange:self]; -} - -/// Save current typing attributes to the attributes holder. -- (void)_updateAttributesHolder { - if (_innerText.length > 0) { - NSUInteger index = _selectedTextRange.end.offset == 0 ? 0 : _selectedTextRange.end.offset - 1; - NSDictionary *attributes = [_innerText yy_attributesAtIndex:index]; - if (!attributes) attributes = @{}; - _typingAttributesHolder.yy_attributes = attributes; - [_typingAttributesHolder yy_removeDiscontinuousAttributesInRange:NSMakeRange(0, _typingAttributesHolder.length)]; - [_typingAttributesHolder removeAttribute:YYTextBorderAttributeName range:NSMakeRange(0, _typingAttributesHolder.length)]; - [_typingAttributesHolder removeAttribute:YYTextBackgroundBorderAttributeName range:NSMakeRange(0, _typingAttributesHolder.length)]; - } -} - -/// Update outer properties from current inner data. -- (void)_updateOuterProperties { - [self _updateAttributesHolder]; - NSParagraphStyle *style = _innerText.yy_paragraphStyle; - if (!style) style = _typingAttributesHolder.yy_paragraphStyle; - if (!style) style = [NSParagraphStyle defaultParagraphStyle]; - - UIFont *font = _innerText.yy_font; - if (!font) font = _typingAttributesHolder.yy_font; - if (!font) font = [self _defaultFont]; - - UIColor *color = _innerText.yy_color; - if (!color) color = _typingAttributesHolder.yy_color; - if (!color) color = [UIColor blackColor]; - - [self _setText:[_innerText yy_plainTextForRange:NSMakeRange(0, _innerText.length)]]; - [self _setFont:font]; - [self _setTextColor:color]; - [self _setTextAlignment:style.alignment]; - [self _setSelectedRange:_selectedTextRange.asRange]; - [self _setTypingAttributes:_typingAttributesHolder.yy_attributes]; - [self _setAttributedText:_innerText]; -} - -/// Parse text with `textParser` and update the _selectedTextRange. -/// @return Whether changed (text or selection) -- (BOOL)_parseText { - if (self.textParser) { - YYTextRange *oldTextRange = _selectedTextRange; - NSRange newRange = _selectedTextRange.asRange; - - [_inputDelegate textWillChange:self]; - BOOL textChanged = [self.textParser parseText:_innerText selectedRange:&newRange]; - [_inputDelegate textDidChange:self]; - - YYTextRange *newTextRange = [YYTextRange rangeWithRange:newRange]; - newTextRange = [self _correctedTextRange:newTextRange]; - - if (![oldTextRange isEqual:newTextRange]) { - [_inputDelegate selectionWillChange:self]; - _selectedTextRange = newTextRange; - [_inputDelegate selectionDidChange:self]; - } - return textChanged; - } - return NO; -} - -/// Returns whether the text should be detected by the data detector. -- (BOOL)_shouldDetectText { - if (!_dataDetector) return NO; - if (!_highlightable) return NO; - if (_linkTextAttributes.count == 0 && _highlightTextAttributes.count == 0) return NO; - if (self.isFirstResponder || _containerView.isFirstResponder) return NO; - return YES; -} - -/// Detect the data in text and add highlight to the data range. -/// @return Whether detected. -- (BOOL)_detectText:(NSMutableAttributedString *)text { - if (![self _shouldDetectText]) return NO; - if (text.length == 0) return NO; - __block BOOL detected = NO; - [_dataDetector enumerateMatchesInString:text.string options:kNilOptions range:NSMakeRange(0, text.length) usingBlock: ^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - switch (result.resultType) { - case NSTextCheckingTypeDate: - case NSTextCheckingTypeAddress: - case NSTextCheckingTypeLink: - case NSTextCheckingTypePhoneNumber: { - detected = YES; - if (_highlightTextAttributes.count) { - YYTextHighlight *highlight = [YYTextHighlight highlightWithAttributes:_highlightTextAttributes]; - [text yy_setTextHighlight:highlight range:result.range]; - } - if (_linkTextAttributes.count) { - [_linkTextAttributes enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [text yy_setAttribute:key value:obj range:result.range]; - }]; - } - } break; - default: - break; - } - }]; - return detected; -} - -/// Returns the `root` view controller (returns nil if not found). -- (UIViewController *)_getRootViewController { - UIViewController *ctrl = nil; - UIApplication *app = YYTextSharedApplication(); - if (!ctrl) ctrl = app.keyWindow.rootViewController; - if (!ctrl) ctrl = [app.windows.firstObject rootViewController]; - if (!ctrl) ctrl = self.yy_viewController; - if (!ctrl) return nil; - - while (!ctrl.view.window && ctrl.presentedViewController) { - ctrl = ctrl.presentedViewController; - } - if (!ctrl.view.window) return nil; - return ctrl; -} - -/// Clear the undo and redo stack, and capture current state to undo stack. -- (void)_resetUndoAndRedoStack { - [_undoStack removeAllObjects]; - [_redoStack removeAllObjects]; - _YYTextViewUndoObject *object = [_YYTextViewUndoObject objectWithText:_innerText.copy range:_selectedTextRange.asRange]; - _lastTypeRange = _selectedTextRange.asRange; - [_undoStack addObject:object]; -} - -/// Clear the redo stack. -- (void)_resetRedoStack { - [_redoStack removeAllObjects]; -} - -/// Capture current state to undo stack. -- (void)_saveToUndoStack { - if (!_allowsUndoAndRedo) return; - _YYTextViewUndoObject *lastObject = _undoStack.lastObject; - if ([lastObject.text isEqualToAttributedString:self.attributedText]) return; - - _YYTextViewUndoObject *object = [_YYTextViewUndoObject objectWithText:_innerText.copy range:_selectedTextRange.asRange]; - _lastTypeRange = _selectedTextRange.asRange; - [_undoStack addObject:object]; - while (_undoStack.count > _maximumUndoLevel) { - [_undoStack removeObjectAtIndex:0]; - } -} - -/// Capture current state to redo stack. -- (void)_saveToRedoStack { - if (!_allowsUndoAndRedo) return; - _YYTextViewUndoObject *lastObject = _redoStack.lastObject; - if ([lastObject.text isEqualToAttributedString:self.attributedText]) return; - - _YYTextViewUndoObject *object = [_YYTextViewUndoObject objectWithText:_innerText.copy range:_selectedTextRange.asRange]; - [_redoStack addObject:object]; - while (_redoStack.count > _maximumUndoLevel) { - [_redoStack removeObjectAtIndex:0]; - } -} - -- (BOOL)_canUndo { - if (_undoStack.count == 0) return NO; - _YYTextViewUndoObject *object = _undoStack.lastObject; - if ([object.text isEqualToAttributedString:_innerText]) return NO; - return YES; -} - -- (BOOL)_canRedo { - if (_redoStack.count == 0) return NO; - _YYTextViewUndoObject *object = _undoStack.lastObject; - if ([object.text isEqualToAttributedString:_innerText]) return NO; - return YES; -} - -- (void)_undo { - if (![self _canUndo]) return; - [self _saveToRedoStack]; - _YYTextViewUndoObject *object = _undoStack.lastObject; - [_undoStack removeLastObject]; - - _state.insideUndoBlock = YES; - self.attributedText = object.text; - self.selectedRange = object.selectedRange; - _state.insideUndoBlock = NO; -} - -- (void)_redo { - if (![self _canRedo]) return; - [self _saveToUndoStack]; - _YYTextViewUndoObject *object = _redoStack.lastObject; - [_redoStack removeLastObject]; - - _state.insideUndoBlock = YES; - self.attributedText = object.text; - self.selectedRange = object.selectedRange; - _state.insideUndoBlock = NO; -} - -- (void)_restoreFirstResponderAfterUndoAlert { - if (_state.firstResponderBeforeUndoAlert) { - [self performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0]; - } -} - -/// Show undo alert if it can undo or redo. -#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED -- (void)_showUndoRedoAlert NS_EXTENSION_UNAVAILABLE_IOS(""){ - _state.firstResponderBeforeUndoAlert = self.isFirstResponder; - __weak typeof(self) _self = self; - NSArray *strings = [self _localizedUndoStrings]; - BOOL canUndo = [self _canUndo]; - BOOL canRedo = [self _canRedo]; - - UIViewController *ctrl = [self _getRootViewController]; - - if (canUndo && canRedo) { - if (kiOS8Later) { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:strings[4] message:@"" preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:strings[3] style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { - [_self _undo]; - [_self _restoreFirstResponderAfterUndoAlert]; - }]]; - [alert addAction:[UIAlertAction actionWithTitle:strings[2] style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { - [_self _redo]; - [_self _restoreFirstResponderAfterUndoAlert]; - }]]; - [alert addAction:[UIAlertAction actionWithTitle:strings[0] style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { - [_self _restoreFirstResponderAfterUndoAlert]; - }]]; - [ctrl presentViewController:alert animated:YES completion:nil]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:strings[4] message:@"" delegate:self cancelButtonTitle:strings[0] otherButtonTitles:strings[3], strings[2], nil]; - [alert show]; -#pragma clang diagnostic pop - } - } else if (canUndo) { - if (kiOS8Later) { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:strings[4] message:@"" preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:strings[3] style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { - [_self _undo]; - [_self _restoreFirstResponderAfterUndoAlert]; - }]]; - [alert addAction:[UIAlertAction actionWithTitle:strings[0] style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { - [_self _restoreFirstResponderAfterUndoAlert]; - }]]; - [ctrl presentViewController:alert animated:YES completion:nil]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:strings[4] message:@"" delegate:self cancelButtonTitle:strings[0] otherButtonTitles:strings[3], nil]; - [alert show]; -#pragma clang diagnostic pop - } - } else if (canRedo) { - if (kiOS8Later) { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:strings[2] message:@"" preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:strings[1] style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { - [_self _redo]; - [_self _restoreFirstResponderAfterUndoAlert]; - }]]; - [alert addAction:[UIAlertAction actionWithTitle:strings[0] style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { - [_self _restoreFirstResponderAfterUndoAlert]; - }]]; - [ctrl presentViewController:alert animated:YES completion:nil]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:strings[2] message:@"" delegate:self cancelButtonTitle:strings[0] otherButtonTitles:strings[1], nil]; - [alert show]; -#pragma clang diagnostic pop - } - } -} -#endif - -/// Get the localized undo alert strings based on app's main bundle. -- (NSArray *)_localizedUndoStrings { - static NSArray *strings = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - NSDictionary *dic = @{ - @"ar" : @[ @"إلغاء", @"إعادة", @"إعادة الكتابة", @"تراجع", @"تراجع عن الكتابة" ], - @"ca" : @[ @"Cancel·lar", @"Refer", @"Refer l’escriptura", @"Desfer", @"Desfer l’escriptura" ], - @"cs" : @[ @"Zrušit", @"Opakovat akci", @"Opakovat akci Psát", @"Odvolat akci", @"Odvolat akci Psát" ], - @"da" : @[ @"Annuller", @"Gentag", @"Gentag Indtastning", @"Fortryd", @"Fortryd Indtastning" ], - @"de" : @[ @"Abbrechen", @"Wiederholen", @"Eingabe wiederholen", @"Widerrufen", @"Eingabe widerrufen" ], - @"el" : @[ @"Ακύρωση", @"Επανάληψη", @"Επανάληψη πληκτρολόγησης", @"Αναίρεση", @"Αναίρεση πληκτρολόγησης" ], - @"en" : @[ @"Cancel", @"Redo", @"Redo Typing", @"Undo", @"Undo Typing" ], - @"es" : @[ @"Cancelar", @"Rehacer", @"Rehacer escritura", @"Deshacer", @"Deshacer escritura" ], - @"es_MX" : @[ @"Cancelar", @"Rehacer", @"Rehacer escritura", @"Deshacer", @"Deshacer escritura" ], - @"fi" : @[ @"Kumoa", @"Tee sittenkin", @"Kirjoita sittenkin", @"Peru", @"Peru kirjoitus" ], - @"fr" : @[ @"Annuler", @"Rétablir", @"Rétablir la saisie", @"Annuler", @"Annuler la saisie" ], - @"he" : @[ @"ביטול", @"חזור על הפעולה האחרונה", @"חזור על הקלדה", @"בטל", @"בטל הקלדה" ], - @"hr" : @[ @"Odustani", @"Ponovi", @"Ponovno upiši", @"Poništi", @"Poništi upisivanje" ], - @"hu" : @[ @"Mégsem", @"Ismétlés", @"Gépelés ismétlése", @"Visszavonás", @"Gépelés visszavonása" ], - @"id" : @[ @"Batalkan", @"Ulang", @"Ulang Pengetikan", @"Kembalikan", @"Batalkan Pengetikan" ], - @"it" : @[ @"Annulla", @"Ripristina originale", @"Ripristina Inserimento", @"Annulla", @"Annulla Inserimento" ], - @"ja" : @[ @"キャンセル", @"やり直す", @"やり直す - 入力", @"取り消す", @"取り消す - 入力" ], - @"ko" : @[ @"취소", @"실행 복귀", @"입력 복귀", @"실행 취소", @"입력 실행 취소" ], - @"ms" : @[ @"Batal", @"Buat semula", @"Ulang Penaipan", @"Buat asal", @"Buat asal Penaipan" ], - @"nb" : @[ @"Avbryt", @"Utfør likevel", @"Utfør skriving likevel", @"Angre", @"Angre skriving" ], - @"nl" : @[ @"Annuleer", @"Opnieuw", @"Opnieuw typen", @"Herstel", @"Herstel typen" ], - @"pl" : @[ @"Anuluj", @"Przywróć", @"Przywróć Wpisz", @"Cofnij", @"Cofnij Wpisz" ], - @"pt" : @[ @"Cancelar", @"Refazer", @"Refazer Digitação", @"Desfazer", @"Desfazer Digitação" ], - @"pt_PT" : @[ @"Cancelar", @"Refazer", @"Refazer digitar", @"Desfazer", @"Desfazer digitar" ], - @"ro" : @[ @"Renunță", @"Refă", @"Refă tastare", @"Anulează", @"Anulează tastare" ], - @"ru" : @[ @"Отменить", @"Повторить", @"Повторить набор на клавиатуре", @"Отменить", @"Отменить набор на клавиатуре" ], - @"sk" : @[ @"Zrušiť", @"Obnoviť", @"Obnoviť písanie", @"Odvolať", @"Odvolať písanie" ], - @"sv" : @[ @"Avbryt", @"Gör om", @"Gör om skriven text", @"Ångra", @"Ångra skriven text" ], - @"th" : @[ @"ยกเลิก", @"ทำกลับมาใหม่", @"ป้อนกลับมาใหม่", @"เลิกทำ", @"เลิกป้อน" ], - @"tr" : @[ @"Vazgeç", @"Yinele", @"Yazmayı Yinele", @"Geri Al", @"Yazmayı Geri Al" ], - @"uk" : @[ @"Скасувати", @"Повторити", @"Повторити введення", @"Відмінити", @"Відмінити введення" ], - @"vi" : @[ @"Hủy", @"Làm lại", @"Làm lại thao tác Nhập", @"Hoàn tác", @"Hoàn tác thao tác Nhập" ], - @"zh" : @[ @"取消", @"重做", @"重做键入", @"撤销", @"撤销键入" ], - @"zh_CN" : @[ @"取消", @"重做", @"重做键入", @"撤销", @"撤销键入" ], - @"zh_HK" : @[ @"取消", @"重做", @"重做輸入", @"還原", @"還原輸入" ], - @"zh_TW" : @[ @"取消", @"重做", @"重做輸入", @"還原", @"還原輸入" ] - }; - NSString *preferred = [[NSBundle mainBundle] preferredLocalizations].firstObject; - if (preferred.length == 0) preferred = @"English"; - NSString *canonical = [NSLocale canonicalLocaleIdentifierFromString:preferred]; - if (canonical.length == 0) canonical = @"en"; - strings = dic[canonical]; - if (!strings && ([canonical rangeOfString:@"_"].location != NSNotFound)) { - NSString *prefix = [canonical componentsSeparatedByString:@"_"].firstObject; - if (prefix.length) strings = dic[prefix]; - } - if (!strings) strings = dic[@"en"]; - }); - return strings; -} - -/// Returns the default font for text view (same as CoreText). -- (UIFont *)_defaultFont { - return [UIFont systemFontOfSize:12]; -} - -/// Returns the default tint color for text view (used for caret and select range background). -- (UIColor *)_defaultTintColor { - return [UIColor colorWithRed:69/255.0 green:111/255.0 blue:238/255.0 alpha:1]; -} - -/// Returns the default placeholder color for text view (same as UITextField). -- (UIColor *)_defaultPlaceholderColor { - return [UIColor colorWithRed:0 green:0 blue:25/255.0 alpha:44/255.0]; -} - -#pragma mark - Private Setter - -- (void)_setText:(NSString *)text { - if (_text == text || [_text isEqualToString:text]) return; - [self willChangeValueForKey:@"text"]; - _text = text.copy; - if (!_text) _text = @""; - [self didChangeValueForKey:@"text"]; - self.accessibilityLabel = _text; -} - -- (void)_setFont:(UIFont *)font { - if (_font == font || [_font isEqual:font]) return; - [self willChangeValueForKey:@"font"]; - _font = font; - [self didChangeValueForKey:@"font"]; -} - -- (void)_setTextColor:(UIColor *)textColor { - if (_textColor == textColor) return; - if (_textColor && textColor) { - if (CFGetTypeID(_textColor.CGColor) == CFGetTypeID(textColor.CGColor) && - CFGetTypeID(_textColor.CGColor) == CGColorGetTypeID()) { - if ([_textColor isEqual:textColor]) { - return; - } - } - } - [self willChangeValueForKey:@"textColor"]; - _textColor = textColor; - [self didChangeValueForKey:@"textColor"]; -} - -- (void)_setTextAlignment:(NSTextAlignment)textAlignment { - if (_textAlignment == textAlignment) return; - [self willChangeValueForKey:@"textAlignment"]; - _textAlignment = textAlignment; - [self didChangeValueForKey:@"textAlignment"]; -} - -- (void)_setDataDetectorTypes:(UIDataDetectorTypes)dataDetectorTypes { - if (_dataDetectorTypes == dataDetectorTypes) return; - [self willChangeValueForKey:@"dataDetectorTypes"]; - _dataDetectorTypes = dataDetectorTypes; - [self didChangeValueForKey:@"dataDetectorTypes"]; -} - -- (void)_setLinkTextAttributes:(NSDictionary *)linkTextAttributes { - if (_linkTextAttributes == linkTextAttributes || [_linkTextAttributes isEqual:linkTextAttributes]) return; - [self willChangeValueForKey:@"linkTextAttributes"]; - _linkTextAttributes = linkTextAttributes.copy; - [self didChangeValueForKey:@"linkTextAttributes"]; -} - -- (void)_setHighlightTextAttributes:(NSDictionary *)highlightTextAttributes { - if (_highlightTextAttributes == highlightTextAttributes || [_highlightTextAttributes isEqual:highlightTextAttributes]) return; - [self willChangeValueForKey:@"highlightTextAttributes"]; - _highlightTextAttributes = highlightTextAttributes.copy; - [self didChangeValueForKey:@"highlightTextAttributes"]; -} -- (void)_setTextParser:(id)textParser { - if (_textParser == textParser || [_textParser isEqual:textParser]) return; - [self willChangeValueForKey:@"textParser"]; - _textParser = textParser; - [self didChangeValueForKey:@"textParser"]; -} - -- (void)_setAttributedText:(NSAttributedString *)attributedText { - if (_attributedText == attributedText || [_attributedText isEqual:attributedText]) return; - [self willChangeValueForKey:@"attributedText"]; - _attributedText = attributedText.copy; - if (!_attributedText) _attributedText = [NSAttributedString new]; - [self didChangeValueForKey:@"attributedText"]; -} - -- (void)_setTextContainerInset:(UIEdgeInsets)textContainerInset { - if (UIEdgeInsetsEqualToEdgeInsets(_textContainerInset, textContainerInset)) return; - [self willChangeValueForKey:@"textContainerInset"]; - _textContainerInset = textContainerInset; - [self didChangeValueForKey:@"textContainerInset"]; -} - -- (void)_setExclusionPaths:(NSArray *)exclusionPaths { - if (_exclusionPaths == exclusionPaths || [_exclusionPaths isEqual:exclusionPaths]) return; - [self willChangeValueForKey:@"exclusionPaths"]; - _exclusionPaths = exclusionPaths.copy; - [self didChangeValueForKey:@"exclusionPaths"]; -} - -- (void)_setVerticalForm:(BOOL)verticalForm { - if (_verticalForm == verticalForm) return; - [self willChangeValueForKey:@"verticalForm"]; - _verticalForm = verticalForm; - [self didChangeValueForKey:@"verticalForm"]; -} - -- (void)_setLinePositionModifier:(id)linePositionModifier { - if (_linePositionModifier == linePositionModifier) return; - [self willChangeValueForKey:@"linePositionModifier"]; - _linePositionModifier = [(NSObject *)linePositionModifier copy]; - [self didChangeValueForKey:@"linePositionModifier"]; -} - -- (void)_setSelectedRange:(NSRange)selectedRange { - if (NSEqualRanges(_selectedRange, selectedRange)) return; - [self willChangeValueForKey:@"selectedRange"]; - _selectedRange = selectedRange; - [self didChangeValueForKey:@"selectedRange"]; - if ([self.delegate respondsToSelector:@selector(textViewDidChangeSelection:)]) { - [self.delegate textViewDidChangeSelection:self]; - } -} - -- (void)_setTypingAttributes:(NSDictionary *)typingAttributes { - if (_typingAttributes == typingAttributes || [_typingAttributes isEqual:typingAttributes]) return; - [self willChangeValueForKey:@"typingAttributes"]; - _typingAttributes = typingAttributes.copy; - [self didChangeValueForKey:@"typingAttributes"]; -} - -#pragma mark - Private Init - -- (void)_initTextView { - self.delaysContentTouches = NO; - self.canCancelContentTouches = YES; - self.multipleTouchEnabled = NO; - self.clipsToBounds = YES; - [super setDelegate:self]; - - _text = @""; - _attributedText = [NSAttributedString new]; - - // UITextInputTraits - _autocapitalizationType = UITextAutocapitalizationTypeSentences; - _autocorrectionType = UITextAutocorrectionTypeDefault; - _spellCheckingType = UITextSpellCheckingTypeDefault; - _keyboardType = UIKeyboardTypeDefault; - _keyboardAppearance = UIKeyboardAppearanceDefault; - _returnKeyType = UIReturnKeyDefault; - _enablesReturnKeyAutomatically = NO; - _secureTextEntry = NO; - - // UITextInput - _selectedTextRange = [YYTextRange defaultRange]; - _markedTextRange = nil; - _markedTextStyle = nil; - _tokenizer = [[UITextInputStringTokenizer alloc] initWithTextInput:self]; - - _editable = YES; - _selectable = YES; - _highlightable = YES; - _allowsCopyAttributedString = YES; - _textAlignment = NSTextAlignmentNatural; - - _innerText = [NSMutableAttributedString new]; - _innerContainer = [YYTextContainer new]; - _innerContainer.insets = kDefaultInset; - _textContainerInset = kDefaultInset; - _typingAttributesHolder = [[NSMutableAttributedString alloc] initWithString:@" "]; - _linkTextAttributes = @{NSForegroundColorAttributeName : [self _defaultTintColor], - (id)kCTForegroundColorAttributeName : (id)[self _defaultTintColor].CGColor}; - - YYTextHighlight *highlight = [YYTextHighlight new]; - YYTextBorder * border = [YYTextBorder new]; - border.insets = UIEdgeInsetsMake(-2, -2, -2, -2); - border.fillColor = [UIColor colorWithWhite:0.1 alpha:0.2]; - border.cornerRadius = 3; - [highlight setBorder:border]; - _highlightTextAttributes = highlight.attributes.copy; - - _placeHolderView = [UIImageView new]; - _placeHolderView.userInteractionEnabled = NO; - _placeHolderView.hidden = YES; - - _containerView = [YYTextContainerView new]; - _containerView.hostView = self; - - _selectionView = [YYTextSelectionView new]; - _selectionView.userInteractionEnabled = NO; - _selectionView.hostView = self; - _selectionView.color = [self _defaultTintColor]; - - _magnifierCaret = [YYTextMagnifier magnifierWithType:YYTextMagnifierTypeCaret]; - _magnifierCaret.hostView = _containerView; - _magnifierRanged = [YYTextMagnifier magnifierWithType:YYTextMagnifierTypeRanged]; - _magnifierRanged.hostView = _containerView; - - [self addSubview:_placeHolderView]; - [self addSubview:_containerView]; - [self addSubview:_selectionView]; - - _undoStack = [NSMutableArray new]; - _redoStack = [NSMutableArray new]; - _allowsUndoAndRedo = YES; - _maximumUndoLevel = kDefaultUndoLevelMax; - - self.debugOption = [YYTextDebugOption sharedDebugOption]; - [YYTextDebugOption addDebugTarget:self]; - - [self _updateInnerContainerSize]; - [self _update]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_pasteboardChanged) name:UIPasteboardChangedNotification object:nil]; - [[YYTextKeyboardManager defaultManager] addObserver:self]; - - self.isAccessibilityElement = YES; -} - -#pragma mark - Public - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (!self) return nil; - [self _initTextView]; - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIPasteboardChangedNotification object:nil]; - [[YYTextKeyboardManager defaultManager] removeObserver:self]; - - [[YYTextEffectWindow sharedWindow] hideSelectionDot:_selectionView]; - [[YYTextEffectWindow sharedWindow] hideMagnifier:_magnifierCaret]; - [[YYTextEffectWindow sharedWindow] hideMagnifier:_magnifierRanged]; - - [YYTextDebugOption removeDebugTarget:self]; - - [_longPressTimer invalidate]; - [_autoScrollTimer invalidate]; - [_selectionDotFixTimer invalidate]; -} - -- (void)scrollRangeToVisible:(NSRange)range { - YYTextRange *textRange = [YYTextRange rangeWithRange:range]; - textRange = [self _correctedTextRange:textRange]; - [self _scrollRangeToVisible:textRange]; -} - -#pragma mark - Property - -- (void)setText:(NSString *)text { - if (_text == text || [_text isEqualToString:text]) return; - [self _setText:text]; - - _state.selectedWithoutEdit = NO; - _state.deleteConfirm = NO; - [self _endTouchTracking]; - [self _hideMenu]; - [self _resetUndoAndRedoStack]; - [self replaceRange:[YYTextRange rangeWithRange:NSMakeRange(0, _innerText.length)] withText:text]; -} - -- (void)setFont:(UIFont *)font { - if (_font == font || [_font isEqual:font]) return; - [self _setFont:font]; - - _state.typingAttributesOnce = NO; - _typingAttributesHolder.yy_font = font; - _innerText.yy_font = font; - [self _resetUndoAndRedoStack]; - [self _commitUpdate]; -} - -- (void)setTextColor:(UIColor *)textColor { - if (_textColor == textColor || [_textColor isEqual:textColor]) return; - [self _setTextColor:textColor]; - - _state.typingAttributesOnce = NO; - _typingAttributesHolder.yy_color = textColor; - _innerText.yy_color = textColor; - [self _resetUndoAndRedoStack]; - [self _commitUpdate]; -} - -- (void)setTextAlignment:(NSTextAlignment)textAlignment { - if (_textAlignment == textAlignment) return; - [self _setTextAlignment:textAlignment]; - - _typingAttributesHolder.yy_alignment = textAlignment; - _innerText.yy_alignment = textAlignment; - [self _resetUndoAndRedoStack]; - [self _commitUpdate]; -} - -- (void)setDataDetectorTypes:(UIDataDetectorTypes)dataDetectorTypes { - if (_dataDetectorTypes == dataDetectorTypes) return; - [self _setDataDetectorTypes:dataDetectorTypes]; - NSTextCheckingType type = YYTextNSTextCheckingTypeFromUIDataDetectorType(dataDetectorTypes); - _dataDetector = type ? [NSDataDetector dataDetectorWithTypes:type error:NULL] : nil; - [self _resetUndoAndRedoStack]; - [self _commitUpdate]; -} - -- (void)setLinkTextAttributes:(NSDictionary *)linkTextAttributes { - if (_linkTextAttributes == linkTextAttributes || [_linkTextAttributes isEqual:linkTextAttributes]) return; - [self _setLinkTextAttributes:linkTextAttributes]; - if (_dataDetector) { - [self _commitUpdate]; - } -} - -- (void)setHighlightTextAttributes:(NSDictionary *)highlightTextAttributes { - if (_highlightTextAttributes == highlightTextAttributes || [_highlightTextAttributes isEqual:highlightTextAttributes]) return; - [self _setHighlightTextAttributes:highlightTextAttributes]; - if (_dataDetector) { - [self _commitUpdate]; - } -} - -- (void)setTextParser:(id)textParser { - if (_textParser == textParser || [_textParser isEqual:textParser]) return; - [self _setTextParser:textParser]; - if (textParser && _text.length) { - [self replaceRange:[YYTextRange rangeWithRange:NSMakeRange(0, _text.length)] withText:_text]; - } - [self _resetUndoAndRedoStack]; - [self _commitUpdate]; -} - -- (void)setTypingAttributes:(NSDictionary *)typingAttributes { - [self _setTypingAttributes:typingAttributes]; - _state.typingAttributesOnce = YES; - [typingAttributes enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [_typingAttributesHolder yy_setAttribute:key value:obj]; - }]; - [self _commitUpdate]; -} - -- (void)setAttributedText:(NSAttributedString *)attributedText { - if (_attributedText == attributedText) return; - [self _setAttributedText:attributedText]; - _state.typingAttributesOnce = NO; - - NSMutableAttributedString *text = attributedText.mutableCopy; - if (text.length == 0) { - [self replaceRange:[YYTextRange rangeWithRange:NSMakeRange(0, _innerText.length)] withText:@""]; - return; - } - if ([self.delegate respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementText:)]) { - BOOL should = [self.delegate textView:self shouldChangeTextInRange:NSMakeRange(0, _innerText.length) replacementText:text.string]; - if (!should) return; - } - - _state.selectedWithoutEdit = NO; - _state.deleteConfirm = NO; - [self _endTouchTracking]; - [self _hideMenu]; - - [_inputDelegate selectionWillChange:self]; - [_inputDelegate textWillChange:self]; - _innerText = text; - [self _parseText]; - _selectedTextRange = [YYTextRange rangeWithRange:NSMakeRange(0, _innerText.length)]; - [_inputDelegate textDidChange:self]; - [_inputDelegate selectionDidChange:self]; - - [self _setAttributedText:text]; - if (_innerText.length > 0) { - _typingAttributesHolder.yy_attributes = [_innerText yy_attributesAtIndex:_innerText.length - 1]; - } - - [self _updateOuterProperties]; - [self _updateLayout]; - [self _updateSelectionView]; - - if (self.isFirstResponder) { - [self _scrollRangeToVisible:_selectedTextRange]; - } - - if ([self.delegate respondsToSelector:@selector(textViewDidChange:)]) { - [self.delegate textViewDidChange:self]; - } - [[NSNotificationCenter defaultCenter] postNotificationName:YYTextViewTextDidChangeNotification object:self]; - - if (!_state.insideUndoBlock) { - [self _resetUndoAndRedoStack]; - } -} - -- (void)setTextVerticalAlignment:(YYTextVerticalAlignment)textVerticalAlignment { - if (_textVerticalAlignment == textVerticalAlignment) return; - [self willChangeValueForKey:@"textVerticalAlignment"]; - _textVerticalAlignment = textVerticalAlignment; - [self didChangeValueForKey:@"textVerticalAlignment"]; - _containerView.textVerticalAlignment = textVerticalAlignment; - [self _commitUpdate]; -} - -- (void)setTextContainerInset:(UIEdgeInsets)textContainerInset { - if (UIEdgeInsetsEqualToEdgeInsets(_textContainerInset, textContainerInset)) return; - [self _setTextContainerInset:textContainerInset]; - _innerContainer.insets = textContainerInset; - [self _commitUpdate]; -} - -- (void)setExclusionPaths:(NSArray *)exclusionPaths { - if (_exclusionPaths == exclusionPaths || [_exclusionPaths isEqual:exclusionPaths]) return; - [self _setExclusionPaths:exclusionPaths]; - _innerContainer.exclusionPaths = exclusionPaths; - if (_innerContainer.isVerticalForm) { - CGAffineTransform trans = CGAffineTransformMakeTranslation(_innerContainer.size.width - self.bounds.size.width, 0); - [_innerContainer.exclusionPaths enumerateObjectsUsingBlock:^(UIBezierPath *path, NSUInteger idx, BOOL *stop) { - [path applyTransform:trans]; - }]; - } - [self _commitUpdate]; -} - -- (void)setVerticalForm:(BOOL)verticalForm { - if (_verticalForm == verticalForm) return; - [self _setVerticalForm:verticalForm]; - _innerContainer.verticalForm = verticalForm; - _selectionView.verticalForm = verticalForm; - - [self _updateInnerContainerSize]; - - if (verticalForm) { - if (UIEdgeInsetsEqualToEdgeInsets(_innerContainer.insets, kDefaultInset)) { - _innerContainer.insets = kDefaultVerticalInset; - [self _setTextContainerInset:kDefaultVerticalInset]; - } - } else { - if (UIEdgeInsetsEqualToEdgeInsets(_innerContainer.insets, kDefaultVerticalInset)) { - _innerContainer.insets = kDefaultInset; - [self _setTextContainerInset:kDefaultInset]; - } - } - - _innerContainer.exclusionPaths = _exclusionPaths; - if (verticalForm) { - CGAffineTransform trans = CGAffineTransformMakeTranslation(_innerContainer.size.width - self.bounds.size.width, 0); - [_innerContainer.exclusionPaths enumerateObjectsUsingBlock:^(UIBezierPath *path, NSUInteger idx, BOOL *stop) { - [path applyTransform:trans]; - }]; - } - - [self _keyboardChanged]; - [self _commitUpdate]; -} - -- (void)setLinePositionModifier:(id)linePositionModifier { - if (_linePositionModifier == linePositionModifier) return; - [self _setLinePositionModifier:linePositionModifier]; - _innerContainer.linePositionModifier = linePositionModifier; - [self _commitUpdate]; -} - -- (void)setSelectedRange:(NSRange)selectedRange { - if (NSEqualRanges(_selectedRange, selectedRange)) return; - if (_markedTextRange) return; - _state.typingAttributesOnce = NO; - - YYTextRange *range = [YYTextRange rangeWithRange:selectedRange]; - range = [self _correctedTextRange:range]; - [self _endTouchTracking]; - _selectedTextRange = range; - [self _updateSelectionView]; - - [self _setSelectedRange:range.asRange]; - - if (!_state.insideUndoBlock) { - [self _resetUndoAndRedoStack]; - } -} - -- (void)setHighlightable:(BOOL)highlightable { - if (_highlightable == highlightable) return; - [self willChangeValueForKey:@"highlightable"]; - _highlightable = highlightable; - [self didChangeValueForKey:@"highlightable"]; - [self _commitUpdate]; -} - -- (void)setEditable:(BOOL)editable { - if (_editable == editable) return; - [self willChangeValueForKey:@"editable"]; - _editable = editable; - [self didChangeValueForKey:@"editable"]; - if (!editable) { - [self resignFirstResponder]; - } -} - -- (void)setSelectable:(BOOL)selectable { - if (_selectable == selectable) return; - [self willChangeValueForKey:@"selectable"]; - _selectable = selectable; - [self didChangeValueForKey:@"selectable"]; - if (!selectable) { - if (self.isFirstResponder) { - [self resignFirstResponder]; - } else { - _state.selectedWithoutEdit = NO; - [self _endTouchTracking]; - [self _hideMenu]; - [self _updateSelectionView]; - } - } -} - -- (void)setClearsOnInsertion:(BOOL)clearsOnInsertion { - if (_clearsOnInsertion == clearsOnInsertion) return; - _clearsOnInsertion = clearsOnInsertion; - if (clearsOnInsertion) { - if (self.isFirstResponder) { - self.selectedRange = NSMakeRange(0, _attributedText.length); - } else { - _state.clearsOnInsertionOnce = YES; - } - } -} - -- (void)setDebugOption:(YYTextDebugOption *)debugOption { - _containerView.debugOption = debugOption; -} - -- (YYTextDebugOption *)debugOption { - return _containerView.debugOption; -} - -- (YYTextLayout *)textLayout { - [self _updateIfNeeded]; - return _innerLayout; -} - -- (void)setPlaceholderText:(NSString *)placeholderText { - if (_placeholderAttributedText.length > 0) { - if (placeholderText.length > 0) { - [((NSMutableAttributedString *)_placeholderAttributedText) replaceCharactersInRange:NSMakeRange(0, _placeholderAttributedText.length) withString:placeholderText]; - } else { - [((NSMutableAttributedString *)_placeholderAttributedText) replaceCharactersInRange:NSMakeRange(0, _placeholderAttributedText.length) withString:@""]; - } - ((NSMutableAttributedString *)_placeholderAttributedText).yy_font = _placeholderFont; - ((NSMutableAttributedString *)_placeholderAttributedText).yy_color = _placeholderTextColor; - } else { - if (placeholderText.length > 0) { - NSMutableAttributedString *atr = [[NSMutableAttributedString alloc] initWithString:placeholderText]; - if (!_placeholderFont) _placeholderFont = _font; - if (!_placeholderFont) _placeholderFont = [self _defaultFont]; - if (!_placeholderTextColor) _placeholderTextColor = [self _defaultPlaceholderColor]; - atr.yy_font = _placeholderFont; - atr.yy_color = _placeholderTextColor; - _placeholderAttributedText = atr; - } - } - _placeholderText = [_placeholderAttributedText yy_plainTextForRange:NSMakeRange(0, _placeholderAttributedText.length)]; - [self _commitPlaceholderUpdate]; -} - -- (void)setPlaceholderFont:(UIFont *)placeholderFont { - _placeholderFont = placeholderFont; - ((NSMutableAttributedString *)_placeholderAttributedText).yy_font = _placeholderFont; - [self _commitPlaceholderUpdate]; -} - -- (void)setPlaceholderTextColor:(UIColor *)placeholderTextColor { - _placeholderTextColor = placeholderTextColor; - ((NSMutableAttributedString *)_placeholderAttributedText).yy_color = _placeholderTextColor; - [self _commitPlaceholderUpdate]; -} - -- (void)setPlaceholderAttributedText:(NSAttributedString *)placeholderAttributedText { - _placeholderAttributedText = placeholderAttributedText.mutableCopy; - _placeholderText = [_placeholderAttributedText yy_plainTextForRange:NSMakeRange(0, _placeholderAttributedText.length)]; - _placeholderFont = _placeholderAttributedText.yy_font; - _placeholderTextColor = _placeholderAttributedText.yy_color; - [self _commitPlaceholderUpdate]; -} - -#pragma mark - Override For Protect - -- (void)setMultipleTouchEnabled:(BOOL)multipleTouchEnabled { - [super setMultipleTouchEnabled:NO]; // must not enabled -} - -- (void)setContentInset:(UIEdgeInsets)contentInset { - UIEdgeInsets oldInsets = self.contentInset; - if (_insetModifiedByKeyboard) { - _originalContentInset = contentInset; - } else { - [super setContentInset:contentInset]; - BOOL changed = !UIEdgeInsetsEqualToEdgeInsets(oldInsets, contentInset); - if (changed) { - [self _updateInnerContainerSize]; - [self _commitUpdate]; - [self _commitPlaceholderUpdate]; - } - } -} - -- (void)setScrollIndicatorInsets:(UIEdgeInsets)scrollIndicatorInsets { - if (_insetModifiedByKeyboard) { - _originalScrollIndicatorInsets = scrollIndicatorInsets; - } else { - [super setScrollIndicatorInsets:scrollIndicatorInsets]; - } -} - -- (void)setFrame:(CGRect)frame { - CGSize oldSize = self.bounds.size; - [super setFrame:frame]; - CGSize newSize = self.bounds.size; - BOOL changed = _innerContainer.isVerticalForm ? (oldSize.height != newSize.height) : (oldSize.width != newSize.width); - if (changed) { - [self _updateInnerContainerSize]; - [self _commitUpdate]; - } - if (!CGSizeEqualToSize(oldSize, newSize)) { - [self _commitPlaceholderUpdate]; - } -} - -- (void)setBounds:(CGRect)bounds { - CGSize oldSize = self.bounds.size; - [super setBounds:bounds]; - CGSize newSize = self.bounds.size; - BOOL changed = _innerContainer.isVerticalForm ? (oldSize.height != newSize.height) : (oldSize.width != newSize.width); - if (changed) { - [self _updateInnerContainerSize]; - [self _commitUpdate]; - } - if (!CGSizeEqualToSize(oldSize, newSize)) { - [self _commitPlaceholderUpdate]; - } -} - -- (void)tintColorDidChange { - if ([self respondsToSelector:@selector(tintColor)]) { - UIColor *color = self.tintColor; - NSMutableDictionary *attrs = _highlightTextAttributes.mutableCopy; - NSMutableDictionary *linkAttrs = _linkTextAttributes.mutableCopy; - if (!linkAttrs) linkAttrs = @{}.mutableCopy; - if (!color) { - [attrs removeObjectForKey:NSForegroundColorAttributeName]; - [attrs removeObjectForKey:(id)kCTForegroundColorAttributeName]; - [linkAttrs setObject:[self _defaultTintColor] forKey:NSForegroundColorAttributeName]; - [linkAttrs setObject:(id)[self _defaultTintColor].CGColor forKey:(id)kCTForegroundColorAttributeName]; - } else { - [attrs setObject:color forKey:NSForegroundColorAttributeName]; - [attrs setObject:(id)color.CGColor forKey:(id)kCTForegroundColorAttributeName]; - [linkAttrs setObject:color forKey:NSForegroundColorAttributeName]; - [linkAttrs setObject:(id)color.CGColor forKey:(id)kCTForegroundColorAttributeName]; - } - self.highlightTextAttributes = attrs; - _selectionView.color = color ? color : [self _defaultTintColor]; - _linkTextAttributes = linkAttrs; - [self _commitUpdate]; - } -} - -- (CGSize)sizeThatFits:(CGSize)size { - if (!_verticalForm && size.width <= 0) size.width = YYTextContainerMaxSize.width; - if (_verticalForm && size.height <= 0) size.height = YYTextContainerMaxSize.height; - - if ((!_verticalForm && size.width == self.bounds.size.width) || - (_verticalForm && size.height == self.bounds.size.height)) { - [self _updateIfNeeded]; - if (!_verticalForm) { - if (_containerView.bounds.size.height <= size.height) { - return _containerView.bounds.size; - } - } else { - if (_containerView.bounds.size.width <= size.width) { - return _containerView.bounds.size; - } - } - } - - if (!_verticalForm) { - size.height = YYTextContainerMaxSize.height; - } else { - size.width = YYTextContainerMaxSize.width; - } - - YYTextContainer *container = [_innerContainer copy]; - container.size = size; - - YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:_innerText]; - return layout.textBoundingSize; -} - -#pragma mark - Override UIResponder - -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - [self _updateIfNeeded]; - UITouch *touch = touches.anyObject; - CGPoint point = [touch locationInView:_containerView]; - - _touchBeganTime = _trackingTime = touch.timestamp; - _touchBeganPoint = _trackingPoint = point; - _trackingRange = _selectedTextRange; - - _state.trackingGrabber = NO; - _state.trackingCaret = NO; - _state.trackingPreSelect = NO; - _state.trackingTouch = YES; - _state.swallowTouch = YES; - _state.touchMoved = NO; - - if (!self.isFirstResponder && !_state.selectedWithoutEdit && self.highlightable) { - _highlight = [self _getHighlightAtPoint:point range:&_highlightRange]; - _highlightLayout = nil; - } - - if ((!self.selectable && !_highlight) || _state.ignoreTouchBegan) { - _state.swallowTouch = NO; - _state.trackingTouch = NO; - } - - if (_state.trackingTouch) { - [self _startLongPressTimer]; - if (_highlight) { - [self _showHighlightAnimated:NO]; - } else { - if ([_selectionView isGrabberContainsPoint:point]) { // track grabber - self.panGestureRecognizer.enabled = NO; // disable scroll view - [self _hideMenu]; - _state.trackingGrabber = [_selectionView isStartGrabberContainsPoint:point] ? kStart : kEnd; - _magnifierRangedOffset = [self _getMagnifierRangedOffset]; - } else { - if (_selectedTextRange.asRange.length == 0 && self.isFirstResponder) { - if ([_selectionView isCaretContainsPoint:point]) { // track caret - _state.trackingCaret = YES; - self.panGestureRecognizer.enabled = NO; // disable scroll view - } - } - } - } - [self _updateSelectionView]; - } - - if (!_state.swallowTouch) [super touchesBegan:touches withEvent:event]; -} - -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - [self _updateIfNeeded]; - UITouch *touch = touches.anyObject; - CGPoint point = [touch locationInView:_containerView]; - - _trackingTime = touch.timestamp; - _trackingPoint = point; - - if (!_state.touchMoved) { - _state.touchMoved = [self _getMoveDirection]; - if (_state.touchMoved) [self _endLongPressTimer]; - } - _state.clearsOnInsertionOnce = NO; - - if (_state.trackingTouch) { - BOOL showMagnifierCaret = NO; - BOOL showMagnifierRanged = NO; - - if (_highlight) { - - YYTextHighlight *highlight = [self _getHighlightAtPoint:_trackingPoint range:NULL]; - if (highlight == _highlight) { - [self _showHighlightAnimated:YES]; - } else { - [self _hideHighlightAnimated:YES]; - } - - } else { - _trackingRange = _selectedTextRange; - if (_state.trackingGrabber) { - self.panGestureRecognizer.enabled = NO; - [self _hideMenu]; - [self _updateTextRangeByTrackingGrabber]; - showMagnifierRanged = YES; - } else if (_state.trackingPreSelect) { - [self _updateTextRangeByTrackingPreSelect]; - showMagnifierCaret = YES; - } else if (_state.trackingCaret || _markedTextRange || self.isFirstResponder) { - if (_state.trackingCaret || _state.touchMoved) { - _state.trackingCaret = YES; - [self _hideMenu]; - if (_verticalForm) { - if (_state.touchMoved == kTop || _state.touchMoved == kBottom) { - self.panGestureRecognizer.enabled = NO; - } - } else { - if (_state.touchMoved == kLeft || _state.touchMoved == kRight) { - self.panGestureRecognizer.enabled = NO; - } - } - [self _updateTextRangeByTrackingCaret]; - if (_markedTextRange) { - showMagnifierRanged = YES; - } else { - showMagnifierCaret = YES; - } - } - } - } - [self _updateSelectionView]; - if (showMagnifierCaret) [self _showMagnifierCaret]; - if (showMagnifierRanged) [self _showMagnifierRanged]; - } - - CGFloat autoScrollOffset = [self _getAutoscrollOffset]; - if (_autoScrollOffset != autoScrollOffset) { - if (fabs(autoScrollOffset) < fabs(_autoScrollOffset)) { - _autoScrollAcceleration *= 0.5; - } - _autoScrollOffset = autoScrollOffset; - if (_autoScrollOffset != 0 && _state.touchMoved) { - [self _startAutoScrollTimer]; - } - } - - if (!_state.swallowTouch) [super touchesMoved:touches withEvent:event]; -} - -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - [self _updateIfNeeded]; - - UITouch *touch = touches.anyObject; - CGPoint point = [touch locationInView:_containerView]; - - _trackingTime = touch.timestamp; - _trackingPoint = point; - - if (!_state.touchMoved) { - _state.touchMoved = [self _getMoveDirection]; - } - if (_state.trackingTouch) { - [self _hideMagnifier]; - - if (_highlight) { - if (_state.showingHighlight) { - if (_highlight.tapAction) { - CGRect rect = [_innerLayout rectForRange:[YYTextRange rangeWithRange:_highlightRange]]; - rect = [self _convertRectFromLayout:rect]; - _highlight.tapAction(self, _innerText, _highlightRange, rect); - } else { - BOOL shouldTap = YES; - if ([self.delegate respondsToSelector:@selector(textView:shouldTapHighlight:inRange:)]) { - shouldTap = [self.delegate textView:self shouldTapHighlight:_highlight inRange:_highlightRange]; - } - if (shouldTap && [self.delegate respondsToSelector:@selector(textView:didTapHighlight:inRange:rect:)]) { - CGRect rect = [_innerLayout rectForRange:[YYTextRange rangeWithRange:_highlightRange]]; - rect = [self _convertRectFromLayout:rect]; - [self.delegate textView:self didTapHighlight:_highlight inRange:_highlightRange rect:rect]; - } - } - [self _removeHighlightAnimated:YES]; - } - } else { - if (_state.trackingCaret) { - if (_state.touchMoved) { - [self _updateTextRangeByTrackingCaret]; - [self _showMenu]; - } else { - if (_state.showingMenu) [self _hideMenu]; - else [self _showMenu]; - } - } else if (_state.trackingGrabber) { - [self _updateTextRangeByTrackingGrabber]; - [self _showMenu]; - } else if (_state.trackingPreSelect) { - [self _updateTextRangeByTrackingPreSelect]; - if (_trackingRange.asRange.length > 0) { - _state.selectedWithoutEdit = YES; - [self _showMenu]; - } else { - [self performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0]; - } - } else if (_state.deleteConfirm || _markedTextRange) { - [self _updateTextRangeByTrackingCaret]; - [self _hideMenu]; - } else { - if (!_state.touchMoved) { - if (_state.selectedWithoutEdit) { - _state.selectedWithoutEdit = NO; - [self _hideMenu]; - } else { - if (self.isFirstResponder) { - YYTextRange *_oldRange = _trackingRange; - [self _updateTextRangeByTrackingCaret]; - if ([_oldRange isEqual:_trackingRange]) { - if (_state.showingMenu) [self _hideMenu]; - else [self _showMenu]; - } else { - [self _hideMenu]; - } - } else { - [self _hideMenu]; - if (_state.clearsOnInsertionOnce) { - _state.clearsOnInsertionOnce = NO; - _selectedTextRange = [YYTextRange rangeWithRange:NSMakeRange(0, _innerText.length)]; - [self _setSelectedRange:_selectedTextRange.asRange]; - } else { - [self _updateTextRangeByTrackingCaret]; - } - [self performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0]; - } - } - } - } - } - - if (_trackingRange && (![_trackingRange isEqual:_selectedTextRange] || _state.trackingPreSelect)) { - if (![_trackingRange isEqual:_selectedTextRange]) { - [_inputDelegate selectionWillChange:self]; - _selectedTextRange = _trackingRange; - [_inputDelegate selectionDidChange:self]; - [self _updateAttributesHolder]; - [self _updateOuterProperties]; - } - if (!_state.trackingGrabber && !_state.trackingPreSelect) { - [self _scrollRangeToVisible:_selectedTextRange]; - } - } - - [self _endTouchTracking]; - } - - if (!_state.swallowTouch) [super touchesEnded:touches withEvent:event]; -} - -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { - [self _endTouchTracking]; - [self _hideMenu]; - - if (!_state.swallowTouch) [super touchesCancelled:touches withEvent:event]; -} - -- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { - if (motion == UIEventSubtypeMotionShake && _allowsUndoAndRedo) { - if (!YYTextIsAppExtension()) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundeclared-selector" - [self performSelector:@selector(_showUndoRedoAlert)]; -#pragma clang diagnostic pop - } - } else { - [super motionEnded:motion withEvent:event]; - } -} - -- (BOOL)canBecomeFirstResponder { - if (!self.isSelectable) return NO; - if (!self.isEditable) return NO; - if (_state.ignoreFirstResponder) return NO; - if ([self.delegate respondsToSelector:@selector(textViewShouldBeginEditing:)]) { - if (![self.delegate textViewShouldBeginEditing:self]) return NO; - } - return YES; -} - -- (BOOL)becomeFirstResponder { - BOOL isFirstResponder = self.isFirstResponder; - if (isFirstResponder) return YES; - BOOL shouldDetectData = [self _shouldDetectText]; - BOOL become = [super becomeFirstResponder]; - if (!isFirstResponder && become) { - [self _endTouchTracking]; - [self _hideMenu]; - - _state.selectedWithoutEdit = NO; - if (shouldDetectData != [self _shouldDetectText]) { - [self _update]; - } - [self _updateIfNeeded]; - [self _updateSelectionView]; - [self performSelector:@selector(_scrollSelectedRangeToVisible) withObject:nil afterDelay:0]; - if ([self.delegate respondsToSelector:@selector(textViewDidBeginEditing:)]) { - [self.delegate textViewDidBeginEditing:self]; - } - [[NSNotificationCenter defaultCenter] postNotificationName:YYTextViewTextDidBeginEditingNotification object:self]; - } - return become; -} - -- (BOOL)canResignFirstResponder { - if (!self.isFirstResponder) return YES; - if ([self.delegate respondsToSelector:@selector(textViewShouldEndEditing:)]) { - if (![self.delegate textViewShouldEndEditing:self]) return NO; - } - return YES; -} - -- (BOOL)resignFirstResponder { - BOOL isFirstResponder = self.isFirstResponder; - if (!isFirstResponder) return YES; - BOOL resign = [super resignFirstResponder]; - if (resign) { - if (_markedTextRange) { - _markedTextRange = nil; - [self _parseText]; - [self _setText:[_innerText yy_plainTextForRange:NSMakeRange(0, _innerText.length)]]; - } - _state.selectedWithoutEdit = NO; - if ([self _shouldDetectText]) { - [self _update]; - } - [self _endTouchTracking]; - [self _hideMenu]; - [self _updateIfNeeded]; - [self _updateSelectionView]; - [self _restoreInsetsAnimated:YES]; - if ([self.delegate respondsToSelector:@selector(textViewDidEndEditing:)]) { - [self.delegate textViewDidEndEditing:self]; - } - [[NSNotificationCenter defaultCenter] postNotificationName:YYTextViewTextDidEndEditingNotification object:self]; - } - return resign; -} - -- (BOOL)canPerformAction:(SEL)action withSender:(id)sender { - /* - ------------------------------------------------------ - Default menu actions list: - cut: Cut - copy: Copy - select: Select - selectAll: Select All - paste: Paste - delete: Delete - _promptForReplace: Replace... - _transliterateChinese: 简⇄繁 - _showTextStyleOptions: 𝐁𝐼𝐔 - _define: Define - _addShortcut: Add... - _accessibilitySpeak: Speak - _accessibilitySpeakLanguageSelection: Speak... - _accessibilityPauseSpeaking: Pause Speak - makeTextWritingDirectionRightToLeft: ⇋ - makeTextWritingDirectionLeftToRight: ⇌ - - ------------------------------------------------------ - Default attribute modifier list: - toggleBoldface: - toggleItalics: - toggleUnderline: - increaseSize: - decreaseSize: - */ - - if (_selectedTextRange.asRange.length == 0) { - if (action == @selector(select:) || - action == @selector(selectAll:)) { - return _innerText.length > 0; - } - if (action == @selector(paste:)) { - return [self _isPasteboardContainsValidValue]; - } - } else { - if (action == @selector(cut:)) { - return self.isFirstResponder && self.editable; - } - if (action == @selector(copy:)) { - return YES; - } - if (action == @selector(selectAll:)) { - return _selectedTextRange.asRange.length < _innerText.length; - } - if (action == @selector(paste:)) { - return self.isFirstResponder && self.editable && [self _isPasteboardContainsValidValue]; - } - NSString *selString = NSStringFromSelector(action); - if ([selString hasSuffix:@"define:"] && [selString hasPrefix:@"_"]) { - return [self _getRootViewController] != nil; - } - } - return NO; -} - -- (void)reloadInputViews { - [super reloadInputViews]; - if (_markedTextRange) { - [self unmarkText]; - } -} - -#pragma mark - Override NSObject(UIResponderStandardEditActions) - -- (void)cut:(id)sender { - [self _endTouchTracking]; - if (_selectedTextRange.asRange.length == 0) return; - - [self _copySelectedTextToPasteboard]; - [self _saveToUndoStack]; - [self _resetRedoStack]; - [self replaceRange:_selectedTextRange withText:@""]; -} - -- (void)copy:(id)sender { - [self _endTouchTracking]; - [self _copySelectedTextToPasteboard]; -} - -- (void)paste:(id)sender { - [self _endTouchTracking]; - UIPasteboard *p = [UIPasteboard generalPasteboard]; - NSAttributedString *atr = nil; - - if (_allowsPasteAttributedString) { - atr = p.yy_AttributedString; - if (atr.length == 0) atr = nil; - } - if (!atr && _allowsPasteImage) { - UIImage *img = nil; - - Class cls = NSClassFromString(@"YYImage"); - if (cls) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundeclared-selector" - if (p.yy_GIFData) { - img = [(id)cls performSelector:@selector(imageWithData:scale:) withObject:p.yy_GIFData withObject:nil]; - } - if (!img && p.yy_PNGData) { - img = [(id)cls performSelector:@selector(imageWithData:scale:) withObject:p.yy_PNGData withObject:nil]; - } - if (!img && p.yy_WEBPData) { - img = [(id)cls performSelector:@selector(imageWithData:scale:) withObject:p.yy_WEBPData withObject:nil]; - } -#pragma clang diagnostic pop - } - - if (!img) { - img = p.image; - } - if (!img && p.yy_ImageData) { - img = [UIImage imageWithData:p.yy_ImageData scale:YYTextScreenScale()]; - } - if (img && img.size.width > 1 && img.size.height > 1) { - id content = img; - - if (cls) { - if ([img conformsToProtocol:NSProtocolFromString(@"YYAnimatedImage")]) { - NSNumber *frameCount = [img valueForKey:@"animatedImageFrameCount"]; - if (frameCount.integerValue > 1) { - Class viewCls = NSClassFromString(@"YYAnimatedImageView"); - UIImageView *imgView = [(id)viewCls new]; - imgView.image = img; - imgView.frame = CGRectMake(0, 0, img.size.width, img.size.height); - if (imgView) { - content = imgView; - } - } - } - } - - if ([content isKindOfClass:[UIImage class]] && img.images.count > 1) { - UIImageView *imgView = [UIImageView new]; - imgView.image = img; - imgView.frame = CGRectMake(0, 0, img.size.width, img.size.height); - if (imgView) { - content = imgView; - } - } - - NSMutableAttributedString *attText = [NSAttributedString yy_attachmentStringWithContent:content contentMode:UIViewContentModeScaleToFill width:img.size.width ascent:img.size.height descent:0]; - NSDictionary *attrs = _typingAttributesHolder.yy_attributes; - if (attrs) [attText addAttributes:attrs range:NSMakeRange(0, attText.length)]; - atr = attText; - } - } - - if (atr) { - NSUInteger endPosition = _selectedTextRange.start.offset + atr.length; - NSMutableAttributedString *text = _innerText.mutableCopy; - [text replaceCharactersInRange:_selectedTextRange.asRange withAttributedString:atr]; - self.attributedText = text; - YYTextPosition *pos = [self _correctedTextPosition:[YYTextPosition positionWithOffset:endPosition]]; - YYTextRange *range = [_innerLayout textRangeByExtendingPosition:pos]; - range = [self _correctedTextRange:range]; - if (range) { - self.selectedRange = NSMakeRange(range.end.offset, 0); - } - } else { - NSString *string = p.string; - if (string.length > 0) { - [self _saveToUndoStack]; - [self _resetRedoStack]; - [self replaceRange:_selectedTextRange withText:string]; - } - } -} - -- (void)select:(id)sender { - [self _endTouchTracking]; - - if (_selectedTextRange.asRange.length > 0 || _innerText.length == 0) return; - YYTextRange *newRange = [self _getClosestTokenRangeAtPosition:_selectedTextRange.start]; - if (newRange.asRange.length > 0) { - [_inputDelegate selectionWillChange:self]; - _selectedTextRange = newRange; - [_inputDelegate selectionDidChange:self]; - } - - [self _updateIfNeeded]; - [self _updateOuterProperties]; - [self _updateSelectionView]; - [self _hideMenu]; - [self _showMenu]; -} - -- (void)selectAll:(id)sender { - _trackingRange = nil; - [_inputDelegate selectionWillChange:self]; - _selectedTextRange = [YYTextRange rangeWithRange:NSMakeRange(0, _innerText.length)]; - [_inputDelegate selectionDidChange:self]; - - [self _updateIfNeeded]; - [self _updateOuterProperties]; - [self _updateSelectionView]; - [self _hideMenu]; - [self _showMenu]; -} - -- (void)_define:(id)sender { - [self _hideMenu]; - - NSString *string = [_innerText yy_plainTextForRange:_selectedTextRange.asRange]; - if (string.length == 0) return; - BOOL resign = [self resignFirstResponder]; - if (!resign) return; - - UIReferenceLibraryViewController* ref = [[UIReferenceLibraryViewController alloc] initWithTerm:string]; - ref.view.backgroundColor = [UIColor whiteColor]; - [[self _getRootViewController] presentViewController:ref animated:YES completion:^{}]; -} - - -#pragma mark - Overrice NSObject(NSKeyValueObservingCustomization) - -+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key { - static NSSet *keys = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - keys = [NSSet setWithArray:@[ - @"text", - @"font", - @"textColor", - @"textAlignment", - @"dataDetectorTypes", - @"linkTextAttributes", - @"highlightTextAttributes", - @"textParser", - @"attributedText", - @"textVerticalAlignment", - @"textContainerInset", - @"exclusionPaths", - @"verticalForm", - @"linePositionModifier", - @"selectedRange", - @"typingAttributes" - ]]; - }); - if ([keys containsObject:key]) { - return NO; - } - return [super automaticallyNotifiesObserversForKey:key]; -} - -#pragma mark - @protocol NSCoding - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - [self _initTextView]; - self.attributedText = [aDecoder decodeObjectForKey:@"attributedText"]; - self.selectedRange = ((NSValue *)[aDecoder decodeObjectForKey:@"selectedRange"]).rangeValue; - self.textVerticalAlignment = [aDecoder decodeIntegerForKey:@"textVerticalAlignment"]; - self.dataDetectorTypes = [aDecoder decodeIntegerForKey:@"dataDetectorTypes"]; - self.textContainerInset = ((NSValue *)[aDecoder decodeObjectForKey:@"textContainerInset"]).UIEdgeInsetsValue; - self.exclusionPaths = [aDecoder decodeObjectForKey:@"exclusionPaths"]; - self.verticalForm = [aDecoder decodeBoolForKey:@"verticalForm"]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - [aCoder encodeObject:self.attributedText forKey:@"attributedText"]; - [aCoder encodeObject:[NSValue valueWithRange:self.selectedRange] forKey:@"selectedRange"]; - [aCoder encodeInteger:self.textVerticalAlignment forKey:@"textVerticalAlignment"]; - [aCoder encodeInteger:self.dataDetectorTypes forKey:@"dataDetectorTypes"]; - [aCoder encodeUIEdgeInsets:self.textContainerInset forKey:@"textContainerInset"]; - [aCoder encodeObject:self.exclusionPaths forKey:@"exclusionPaths"]; - [aCoder encodeBool:self.verticalForm forKey:@"verticalForm"]; -} - -#pragma mark - @protocol UIScrollViewDelegate - -- (id)delegate { - return _outerDelegate; -} - -- (void)setDelegate:(id)delegate { - _outerDelegate = delegate; -} - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - [[YYTextEffectWindow sharedWindow] hideSelectionDot:_selectionView]; - - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewDidScroll:scrollView]; - } -} - -- (void)scrollViewDidZoom:(UIScrollView *)scrollView { - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewDidZoom:scrollView]; - } -} - -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewWillBeginDragging:scrollView]; - } -} - -- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; - } -} - -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { - if (!decelerate) { - [[YYTextEffectWindow sharedWindow] showSelectionDot:_selectionView]; - } - - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewDidEndDragging:scrollView willDecelerate:decelerate]; - } -} - -- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView { - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewWillBeginDecelerating:scrollView]; - } -} - -- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { - [[YYTextEffectWindow sharedWindow] showSelectionDot:_selectionView]; - - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewDidEndDecelerating:scrollView]; - } -} - -- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewDidEndScrollingAnimation:scrollView]; - } -} - -- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { - if ([_outerDelegate respondsToSelector:_cmd]) { - return [_outerDelegate viewForZoomingInScrollView:scrollView]; - } else { - return nil; - } -} - -- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view{ - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewWillBeginZooming:scrollView withView:view]; - } -} - -- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale { - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewDidEndZooming:scrollView withView:view atScale:scale]; - } -} - -- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView { - if ([_outerDelegate respondsToSelector:_cmd]) { - return [_outerDelegate scrollViewShouldScrollToTop:scrollView]; - } - return YES; -} - -- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView { - if ([_outerDelegate respondsToSelector:_cmd]) { - [_outerDelegate scrollViewDidScrollToTop:scrollView]; - } -} - -#pragma mark - @protocol YYTextKeyboardObserver - -- (void)keyboardChangedWithTransition:(YYTextKeyboardTransition)transition { - [self _keyboardChanged]; -} - -#pragma mark - @protocol UIALertViewDelegate - -- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { - NSString *title = [alertView buttonTitleAtIndex:buttonIndex]; - if (title.length == 0) return; - NSArray *strings = [self _localizedUndoStrings]; - if ([title isEqualToString:strings[1]] || [title isEqualToString:strings[2]]) { - [self _redo]; - } else if ([title isEqualToString:strings[3]] || [title isEqualToString:strings[4]]) { - [self _undo]; - } - [self _restoreFirstResponderAfterUndoAlert]; -} - -#pragma mark - @protocol UIKeyInput - -- (BOOL)hasText { - return _innerText.length > 0; -} - -- (void)insertText:(NSString *)text { - if (text.length == 0) return; - if (!NSEqualRanges(_lastTypeRange, _selectedTextRange.asRange)) { - [self _saveToUndoStack]; - [self _resetRedoStack]; - } - [self replaceRange:_selectedTextRange withText:text]; -} - -- (void)deleteBackward { - [self _updateIfNeeded]; - NSRange range = _selectedTextRange.asRange; - if (range.location == 0 && range.length == 0) return; - _state.typingAttributesOnce = NO; - - // test if there's 'TextBinding' before the caret - if (!_state.deleteConfirm && range.length == 0 && range.location > 0) { - NSRange effectiveRange; - YYTextBinding *binding = [_innerText attribute:YYTextBindingAttributeName atIndex:range.location - 1 longestEffectiveRange:&effectiveRange inRange:NSMakeRange(0, _innerText.length)]; - if (binding && binding.deleteConfirm) { - _state.deleteConfirm = YES; - [_inputDelegate selectionWillChange:self]; - _selectedTextRange = [YYTextRange rangeWithRange:effectiveRange]; - _selectedTextRange = [self _correctedTextRange:_selectedTextRange]; - [_inputDelegate selectionDidChange:self]; - - [self _updateOuterProperties]; - [self _updateSelectionView]; - return; - } - } - - _state.deleteConfirm = NO; - if (range.length == 0) { - YYTextRange *extendRange = [_innerLayout textRangeByExtendingPosition:_selectedTextRange.end inDirection:UITextLayoutDirectionLeft offset:1]; - if ([self _isTextRangeValid:extendRange]) { - range = extendRange.asRange; - } - } - if (!NSEqualRanges(_lastTypeRange, _selectedTextRange.asRange)) { - [self _saveToUndoStack]; - [self _resetRedoStack]; - } - [self replaceRange:[YYTextRange rangeWithRange:range] withText:@""]; -} - -#pragma mark - @protocol UITextInput - -- (void)setInputDelegate:(id)inputDelegate { - _inputDelegate = inputDelegate; -} - -- (void)setSelectedTextRange:(YYTextRange *)selectedTextRange { - if (!selectedTextRange) return; - selectedTextRange = [self _correctedTextRange:selectedTextRange]; - if ([selectedTextRange isEqual:_selectedTextRange]) return; - [self _updateIfNeeded]; - [self _endTouchTracking]; - [self _hideMenu]; - _state.deleteConfirm = NO; - _state.typingAttributesOnce = NO; - - [_inputDelegate selectionWillChange:self]; - _selectedTextRange = selectedTextRange; - _lastTypeRange = _selectedTextRange.asRange; - [_inputDelegate selectionDidChange:self]; - - [self _updateOuterProperties]; - [self _updateSelectionView]; - - if (self.isFirstResponder) { - [self _scrollRangeToVisible:_selectedTextRange]; - } -} - -- (void)setMarkedTextStyle:(NSDictionary *)markedTextStyle { - _markedTextStyle = markedTextStyle.copy; -} - -/* - Replace current markedText with the new markedText - @param markedText New marked text. - @param selectedRange The range from the '_markedTextRange' - */ -- (void)setMarkedText:(NSString *)markedText selectedRange:(NSRange)selectedRange { - [self _updateIfNeeded]; - [self _endTouchTracking]; - [self _hideMenu]; - - if ([self.delegate respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementText:)]) { - NSRange range = _markedTextRange ? _markedTextRange.asRange : NSMakeRange(_selectedTextRange.end.offset, 0); - BOOL should = [self.delegate textView:self shouldChangeTextInRange:range replacementText:markedText]; - if (!should) return; - } - - - if (!NSEqualRanges(_lastTypeRange, _selectedTextRange.asRange)) { - [self _saveToUndoStack]; - [self _resetRedoStack]; - } - - BOOL needApplyHolderAttribute = NO; - if (_innerText.length > 0 && _markedTextRange) { - [self _updateAttributesHolder]; - } else { - needApplyHolderAttribute = YES; - } - - if (_selectedTextRange.asRange.length > 0) { - [self replaceRange:_selectedTextRange withText:@""]; - } - - [_inputDelegate textWillChange:self]; - [_inputDelegate selectionWillChange:self]; - - if (!markedText) markedText = @""; - if (_markedTextRange == nil) { - _markedTextRange = [YYTextRange rangeWithRange:NSMakeRange(_selectedTextRange.end.offset, markedText.length)]; - [_innerText replaceCharactersInRange:NSMakeRange(_selectedTextRange.end.offset, 0) withString:markedText]; - _selectedTextRange = [YYTextRange rangeWithRange:NSMakeRange(_selectedTextRange.start.offset + selectedRange.location, selectedRange.length)]; - } else { - _markedTextRange = [self _correctedTextRange:_markedTextRange]; - [_innerText replaceCharactersInRange:_markedTextRange.asRange withString:markedText]; - _markedTextRange = [YYTextRange rangeWithRange:NSMakeRange(_markedTextRange.start.offset, markedText.length)]; - _selectedTextRange = [YYTextRange rangeWithRange:NSMakeRange(_markedTextRange.start.offset + selectedRange.location, selectedRange.length)]; - } - - _selectedTextRange = [self _correctedTextRange:_selectedTextRange]; - _markedTextRange = [self _correctedTextRange:_markedTextRange]; - if (_markedTextRange.asRange.length == 0) { - _markedTextRange = nil; - } else { - if (needApplyHolderAttribute) { - [_innerText setAttributes:_typingAttributesHolder.yy_attributes range:_markedTextRange.asRange]; - } - [_innerText yy_removeDiscontinuousAttributesInRange:_markedTextRange.asRange]; - } - - [_inputDelegate selectionDidChange:self]; - [_inputDelegate textDidChange:self]; - - [self _updateOuterProperties]; - [self _updateLayout]; - [self _updateSelectionView]; - [self _scrollRangeToVisible:_selectedTextRange]; - - if ([self.delegate respondsToSelector:@selector(textViewDidChange:)]) { - [self.delegate textViewDidChange:self]; - } - [[NSNotificationCenter defaultCenter] postNotificationName:YYTextViewTextDidChangeNotification object:self]; - - _lastTypeRange = _selectedTextRange.asRange; -} - -- (void)unmarkText { - _markedTextRange = nil; - [self _endTouchTracking]; - [self _hideMenu]; - if ([self _parseText]) _state.needUpdate = YES; - - [self _updateIfNeeded]; - [self _updateOuterProperties]; - [self _updateSelectionView]; - [self _scrollRangeToVisible:_selectedTextRange]; -} - -- (void)replaceRange:(YYTextRange *)range withText:(NSString *)text { - if (!range) return; - if (!text) text = @""; - if (range.asRange.length == 0 && text.length == 0) return; - range = [self _correctedTextRange:range]; - - if ([self.delegate respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementText:)]) { - BOOL should = [self.delegate textView:self shouldChangeTextInRange:range.asRange replacementText:text]; - if (!should) return; - } - - BOOL useInnerAttributes = NO; - if (_innerText.length > 0) { - if (range.start.offset == 0 && range.end.offset == _innerText.length) { - if (text.length == 0) { - NSMutableDictionary *attrs = [_innerText yy_attributesAtIndex:0].mutableCopy; - [attrs removeObjectsForKeys:[NSMutableAttributedString yy_allDiscontinuousAttributeKeys]]; - _typingAttributesHolder.yy_attributes = attrs; - } - } - } else { // no text - useInnerAttributes = YES; - } - BOOL applyTypingAttributes = NO; - if (_state.typingAttributesOnce) { - _state.typingAttributesOnce = NO; - if (!useInnerAttributes) { - if (range.asRange.length == 0 && text.length > 0) { - applyTypingAttributes = YES; - } - } - } - - _state.selectedWithoutEdit = NO; - _state.deleteConfirm = NO; - [self _endTouchTracking]; - [self _hideMenu]; - - [self _replaceRange:range withText:text notifyToDelegate:YES]; - if (useInnerAttributes) { - [_innerText yy_setAttributes:_typingAttributesHolder.yy_attributes]; - } else if (applyTypingAttributes) { - NSRange newRange = NSMakeRange(range.asRange.location, text.length); - [_typingAttributesHolder.yy_attributes enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [_innerText yy_setAttribute:key value:obj range:newRange]; - }]; - } - [self _parseText]; - [self _updateOuterProperties]; - [self _update]; - - if (self.isFirstResponder) { - [self _scrollRangeToVisible:_selectedTextRange]; - } - - if ([self.delegate respondsToSelector:@selector(textViewDidChange:)]) { - [self.delegate textViewDidChange:self]; - } - [[NSNotificationCenter defaultCenter] postNotificationName:YYTextViewTextDidChangeNotification object:self]; - - _lastTypeRange = _selectedTextRange.asRange; -} - -- (void)setBaseWritingDirection:(UITextWritingDirection)writingDirection forRange:(YYTextRange *)range { - if (!range) return; - range = [self _correctedTextRange:range]; - [_innerText yy_setBaseWritingDirection:(NSWritingDirection)writingDirection range:range.asRange]; - [self _commitUpdate]; -} - -- (NSString *)textInRange:(YYTextRange *)range { - range = [self _correctedTextRange:range]; - if (!range) return @""; - return [_innerText.string substringWithRange:range.asRange]; -} - -- (UITextWritingDirection)baseWritingDirectionForPosition:(YYTextPosition *)position inDirection:(UITextStorageDirection)direction { - [self _updateIfNeeded]; - position = [self _correctedTextPosition:position]; - if (!position) return UITextWritingDirectionNatural; - if (_innerText.length == 0) return UITextWritingDirectionNatural; - NSUInteger idx = position.offset; - if (idx == _innerText.length) idx--; - - NSDictionary *attrs = [_innerText yy_attributesAtIndex:idx]; - CTParagraphStyleRef paraStyle = (__bridge CFTypeRef)(attrs[NSParagraphStyleAttributeName]); - if (paraStyle) { - CTWritingDirection baseWritingDirection; - if (CTParagraphStyleGetValueForSpecifier(paraStyle, kCTParagraphStyleSpecifierBaseWritingDirection, sizeof(CTWritingDirection), &baseWritingDirection)) { - return (UITextWritingDirection)baseWritingDirection; - } - } - - return UITextWritingDirectionNatural; -} - -- (YYTextPosition *)beginningOfDocument { - return [YYTextPosition positionWithOffset:0]; -} - -- (YYTextPosition *)endOfDocument { - return [YYTextPosition positionWithOffset:_innerText.length]; -} - -- (YYTextPosition *)positionFromPosition:(YYTextPosition *)position offset:(NSInteger)offset { - if (offset == 0) return position; - - NSUInteger location = position.offset; - NSInteger newLocation = (NSInteger)location + offset; - if (newLocation < 0 || newLocation > _innerText.length) return nil; - - if (newLocation != 0 && newLocation != _innerText.length) { - // fix emoji - [self _updateIfNeeded]; - YYTextRange *extendRange = [_innerLayout textRangeByExtendingPosition:[YYTextPosition positionWithOffset:newLocation]]; - if (extendRange.asRange.length > 0) { - if (offset < 0) { - newLocation = extendRange.start.offset; - } else { - newLocation = extendRange.end.offset; - } - } - } - - YYTextPosition *p = [YYTextPosition positionWithOffset:newLocation]; - return [self _correctedTextPosition:p]; -} - -- (YYTextPosition *)positionFromPosition:(YYTextPosition *)position inDirection:(UITextLayoutDirection)direction offset:(NSInteger)offset { - [self _updateIfNeeded]; - YYTextRange *range = [_innerLayout textRangeByExtendingPosition:position inDirection:direction offset:offset]; - - BOOL forward; - if (_innerContainer.isVerticalForm) { - forward = direction == UITextLayoutDirectionLeft || direction == UITextLayoutDirectionDown; - } else { - forward = direction == UITextLayoutDirectionDown || direction == UITextLayoutDirectionRight; - } - if (!forward && offset < 0) { - forward = -forward; - } - - YYTextPosition *newPosition = forward ? range.end : range.start; - if (newPosition.offset > _innerText.length) { - newPosition = [YYTextPosition positionWithOffset:_innerText.length affinity:YYTextAffinityBackward]; - } - - return [self _correctedTextPosition:newPosition]; -} - -- (YYTextRange *)textRangeFromPosition:(YYTextPosition *)fromPosition toPosition:(YYTextPosition *)toPosition { - return [YYTextRange rangeWithStart:fromPosition end:toPosition]; -} - -- (NSComparisonResult)comparePosition:(YYTextPosition *)position toPosition:(YYTextPosition *)other { - return [position compare:other]; -} - -- (NSInteger)offsetFromPosition:(YYTextPosition *)from toPosition:(YYTextPosition *)toPosition { - return toPosition.offset - from.offset; -} - -- (YYTextPosition *)positionWithinRange:(YYTextRange *)range farthestInDirection:(UITextLayoutDirection)direction { - NSRange nsRange = range.asRange; - if (direction == UITextLayoutDirectionLeft | direction == UITextLayoutDirectionUp) { - return [YYTextPosition positionWithOffset:nsRange.location]; - } else { - return [YYTextPosition positionWithOffset:nsRange.location + nsRange.length affinity:YYTextAffinityBackward]; - } -} - -- (YYTextRange *)characterRangeByExtendingPosition:(YYTextPosition *)position inDirection:(UITextLayoutDirection)direction { - [self _updateIfNeeded]; - YYTextRange *range = [_innerLayout textRangeByExtendingPosition:position inDirection:direction offset:1]; - return [self _correctedTextRange:range]; -} - -- (YYTextPosition *)closestPositionToPoint:(CGPoint)point { - [self _updateIfNeeded]; - point = [self _convertPointToLayout:point]; - YYTextPosition *position = [_innerLayout closestPositionToPoint:point]; - return [self _correctedTextPosition:position]; -} - -- (YYTextPosition *)closestPositionToPoint:(CGPoint)point withinRange:(YYTextRange *)range { - YYTextPosition *pos = (id)[self closestPositionToPoint:point]; - if (!pos) return nil; - - range = [self _correctedTextRange:range]; - if ([pos compare:range.start] == NSOrderedAscending) { - pos = range.start; - } else if ([pos compare:range.end] == NSOrderedDescending) { - pos = range.end; - } - return pos; -} - -- (YYTextRange *)characterRangeAtPoint:(CGPoint)point { - [self _updateIfNeeded]; - point = [self _convertPointToLayout:point]; - YYTextRange *r = [_innerLayout closestTextRangeAtPoint:point]; - return [self _correctedTextRange:r]; -} - -- (CGRect)firstRectForRange:(YYTextRange *)range { - [self _updateIfNeeded]; - CGRect rect = [_innerLayout firstRectForRange:range]; - if (CGRectIsNull(rect)) rect = CGRectZero; - return [self _convertRectFromLayout:rect]; -} - -- (CGRect)caretRectForPosition:(YYTextPosition *)position { - [self _updateIfNeeded]; - CGRect caretRect = [_innerLayout caretRectForPosition:position]; - if (!CGRectIsNull(caretRect)) { - caretRect = [self _convertRectFromLayout:caretRect]; - caretRect = CGRectStandardize(caretRect); - if (_verticalForm) { - if (caretRect.size.height == 0) { - caretRect.size.height = 2; - caretRect.origin.y -= 2 * 0.5; - } - if (caretRect.origin.y < 0) { - caretRect.origin.y = 0; - } else if (caretRect.origin.y + caretRect.size.height > self.bounds.size.height) { - caretRect.origin.y = self.bounds.size.height - caretRect.size.height; - } - } else { - if (caretRect.size.width == 0) { - caretRect.size.width = 2; - caretRect.origin.x -= 2 * 0.5; - } - if (caretRect.origin.x < 0) { - caretRect.origin.x = 0; - } else if (caretRect.origin.x + caretRect.size.width > self.bounds.size.width) { - caretRect.origin.x = self.bounds.size.width - caretRect.size.width; - } - } - return YYTextCGRectPixelRound(caretRect); - } - return CGRectZero; -} - -- (NSArray *)selectionRectsForRange:(YYTextRange *)range { - [self _updateIfNeeded]; - NSArray *rects = [_innerLayout selectionRectsForRange:range]; - [rects enumerateObjectsUsingBlock:^(YYTextSelectionRect *rect, NSUInteger idx, BOOL *stop) { - rect.rect = [self _convertRectFromLayout:rect.rect]; - }]; - return rects; -} - -#pragma mark - @protocol UITextInput optional - -- (UITextStorageDirection)selectionAffinity { - if (_selectedTextRange.end.affinity == YYTextAffinityForward) { - return UITextStorageDirectionForward; - } else { - return UITextStorageDirectionBackward; - } -} - -- (void)setSelectionAffinity:(UITextStorageDirection)selectionAffinity { - _selectedTextRange = [YYTextRange rangeWithRange:_selectedTextRange.asRange affinity:selectionAffinity == UITextStorageDirectionForward ? YYTextAffinityForward : YYTextAffinityBackward]; - [self _updateSelectionView]; -} - -- (NSDictionary *)textStylingAtPosition:(YYTextPosition *)position inDirection:(UITextStorageDirection)direction { - if (!position) return nil; - if (_innerText.length == 0) return _typingAttributesHolder.yy_attributes; - NSDictionary *attrs = nil; - if (0 <= position.offset && position.offset <= _innerText.length) { - NSUInteger ofs = position.offset; - if (position.offset == _innerText.length || - direction == UITextStorageDirectionBackward) { - ofs--; - } - attrs = [_innerText attributesAtIndex:ofs effectiveRange:NULL]; - } - return attrs; -} - -- (YYTextPosition *)positionWithinRange:(YYTextRange *)range atCharacterOffset:(NSInteger)offset { - if (!range) return nil; - if (offset < range.start.offset || offset > range.end.offset) return nil; - if (offset == range.start.offset) return range.start; - else if (offset == range.end.offset) return range.end; - else return [YYTextPosition positionWithOffset:offset]; -} - -- (NSInteger)characterOffsetOfPosition:(YYTextPosition *)position withinRange:(YYTextRange *)range { - return position ? position.offset : NSNotFound; -} - -@end - - - -@interface YYTextView(IBInspectableProperties) -@end - -@implementation YYTextView(IBInspectableProperties) - -- (BOOL)fontIsBold_:(UIFont *)font { - if (![font respondsToSelector:@selector(fontDescriptor)]) return NO; - return (font.fontDescriptor.symbolicTraits & UIFontDescriptorTraitBold) > 0; -} - -- (UIFont *)boldFont_:(UIFont *)font { - if (![font respondsToSelector:@selector(fontDescriptor)]) return font; - return [UIFont fontWithDescriptor:[font.fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold] size:font.pointSize]; -} - -- (UIFont *)normalFont_:(UIFont *)font { - if (![font respondsToSelector:@selector(fontDescriptor)]) return font; - return [UIFont fontWithDescriptor:[font.fontDescriptor fontDescriptorWithSymbolicTraits:0] size:font.pointSize]; -} - -- (void)setFontName_:(NSString *)fontName { - if (!fontName) return; - UIFont *font = self.font; - if (!font) font = [self _defaultFont]; - if ((fontName.length == 0 || [fontName.lowercaseString isEqualToString:@"system"]) && ![self fontIsBold_:font]) { - font = [UIFont systemFontOfSize:font.pointSize]; - } else if ([fontName.lowercaseString isEqualToString:@"system bold"]) { - font = [UIFont boldSystemFontOfSize:font.pointSize]; - } else { - if ([self fontIsBold_:font] && ([fontName.lowercaseString rangeOfString:@"bold"].location == NSNotFound)) { - font = [UIFont fontWithName:fontName size:font.pointSize]; - font = [self boldFont_:font]; - } else { - font = [UIFont fontWithName:fontName size:font.pointSize]; - } - } - if (font) self.font = font; -} - -- (void)setFontSize_:(CGFloat)fontSize { - if (fontSize <= 0) return; - UIFont *font = self.font; - if (!font) font = [self _defaultFont]; - if (!font) font = [self _defaultFont]; - font = [font fontWithSize:fontSize]; - if (font) self.font = font; -} - -- (void)setFontIsBold_:(BOOL)fontBold { - UIFont *font = self.font; - if (!font) font = [self _defaultFont]; - if ([self fontIsBold_:font] == fontBold) return; - if (fontBold) { - font = [self boldFont_:font]; - } else { - font = [self normalFont_:font]; - } - if (font) self.font = font; -} - -- (void)setPlaceholderFontName_:(NSString *)fontName { - if (!fontName) return; - UIFont *font = self.placeholderFont; - if (!font) font = [self _defaultFont]; - if ((fontName.length == 0 || [fontName.lowercaseString isEqualToString:@"system"]) && ![self fontIsBold_:font]) { - font = [UIFont systemFontOfSize:font.pointSize]; - } else if ([fontName.lowercaseString isEqualToString:@"system bold"]) { - font = [UIFont boldSystemFontOfSize:font.pointSize]; - } else { - if ([self fontIsBold_:font] && ([fontName.lowercaseString rangeOfString:@"bold"].location == NSNotFound)) { - font = [UIFont fontWithName:fontName size:font.pointSize]; - font = [self boldFont_:font]; - } else { - font = [UIFont fontWithName:fontName size:font.pointSize]; - } - } - if (font) self.placeholderFont = font; -} - -- (void)setPlaceholderFontSize_:(CGFloat)fontSize { - if (fontSize <= 0) return; - UIFont *font = self.placeholderFont; - if (!font) font = [self _defaultFont]; - font = [font fontWithSize:fontSize]; - if (font) self.placeholderFont = font; -} - -- (void)setPlaceholderFontIsBold_:(BOOL)fontBold { - UIFont *font = self.placeholderFont; - if (!font) font = [self _defaultFont]; - if ([self fontIsBold_:font] == fontBold) return; - if (fontBold) { - font = [self boldFont_:font]; - } else { - font = [self normalFont_:font]; - } - if (font) self.placeholderFont = font; -} - -- (void)setInsetTop_:(CGFloat)textInsetTop { - UIEdgeInsets insets = self.textContainerInset; - insets.top = textInsetTop; - self.textContainerInset = insets; -} - -- (void)setInsetBottom_:(CGFloat)textInsetBottom { - UIEdgeInsets insets = self.textContainerInset; - insets.bottom = textInsetBottom; - self.textContainerInset = insets; -} - -- (void)setInsetLeft_:(CGFloat)textInsetLeft { - UIEdgeInsets insets = self.textContainerInset; - insets.left = textInsetLeft; - self.textContainerInset = insets; - -} - -- (void)setInsetRight_:(CGFloat)textInsetRight { - UIEdgeInsets insets = self.textContainerInset; - insets.right = textInsetRight; - self.textContainerInset = insets; -} - -- (void)setDebugEnabled_:(BOOL)enabled { - if (!enabled) { - self.debugOption = nil; - } else { - YYTextDebugOption *debugOption = [YYTextDebugOption new]; - debugOption.baselineColor = [UIColor redColor]; - debugOption.CTFrameBorderColor = [UIColor redColor]; - debugOption.CTLineFillColor = [UIColor colorWithRed:0.000 green:0.463 blue:1.000 alpha:0.180]; - debugOption.CGGlyphBorderColor = [UIColor colorWithRed:1.000 green:0.524 blue:0.000 alpha:0.200]; - self.debugOption = debugOption; - } -} - -@end diff --git a/iOSProject/Pods/ZFDownload/LICENSE b/iOSProject/Pods/ZFDownload/LICENSE deleted file mode 100644 index 970c1fc6..00000000 --- a/iOSProject/Pods/ZFDownload/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 紫枫 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/iOSProject/Pods/ZFDownload/README.md b/iOSProject/Pods/ZFDownload/README.md deleted file mode 100644 index 53ace8ec..00000000 --- a/iOSProject/Pods/ZFDownload/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# ZFDownload - -

    - - - - - -

    - -## 特性 -* 支持断点下载 -* 异常退出,再次打开保留下载进度 -* 实时下载进度 -* 实时下载速度 - -## 要求 -* iOS 7+ -* Xcode 6+ - ---- -#### ZFDownload的具体实现,可以看ZFPlayer,已获取1000多颗star:[ZFPlayer](https://github.com/renzifeng/ZFPlayer) ---- - -## 效果图 - -![图片效果演示](https://github.com/renzifeng/ZFDownload/raw/master/ZFDownload.gif) - -## 安装 -### Cocoapods - -```ruby -pod 'ZFDownload' -``` - -## 使用 -```objc -// 设置代理 -self.downloadManage.downloadDelegate = self; -// 指定下载URL,文件名称... -[[ZFDownloadManager sharedDownloadManager] downFileUrl:urlStr filename:name fileimage:nil]; -// 设置最多同时下载个数(默认是3) -[ZFDownloadManager sharedDownloadManager].maxCount = 2; - -``` -在cell上获取实时下载进度,遵守 ZFDownloadDelegate代理,然后实现 - -```objc - -#pragma mark - ZFDownloadDelegate - -// 开始下载 -- (void)startDownload:(ZFHttpRequest *)request; - -// 下载中 -- (void)updateCellProgress:(ZFHttpRequest *)request; - -// 下载完成 -- (void)finishedDownload:(ZFHttpRequest *)request; - - -``` - -# 联系我 -- 微博: [@任子丰](https://weibo.com/zifeng1300) -- 邮箱: zifeng1300@gmail.com -- QQ群:213376937 - -# License - -ZFDownload is available under the MIT license. See the LICENSE file for more info. \ No newline at end of file diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFCommonHelper.h b/iOSProject/Pods/ZFDownload/ZFDownload/ZFCommonHelper.h deleted file mode 100755 index 3c64d239..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFCommonHelper.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// ZFCommonHelper.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import - -// 下载文件的总文件夹 -#define BASE @"ZFDownLoad" -// 完整文件路径 -#define TARGET @"CacheList" -// 临时文件夹名称 -#define TEMP @"Temp" -// 缓存主目录 -#define CACHES_DIRECTORY [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] -// 临时文件夹的路径 -#define TEMP_FOLDER [NSString stringWithFormat:@"%@/%@/%@",CACHES_DIRECTORY,BASE,TEMP] -// 临时文件的路径 -#define TEMP_PATH(name) [NSString stringWithFormat:@"%@/%@",[ZFCommonHelper createFolder:TEMP_FOLDER],name] -// 下载文件夹路径 -#define FILE_FOLDER [NSString stringWithFormat:@"%@/%@/%@",CACHES_DIRECTORY,BASE,TARGET] -// 下载文件的路径 -#define FILE_PATH(name) [NSString stringWithFormat:@"%@/%@",[ZFCommonHelper createFolder:FILE_FOLDER],name] -// 文件信息的Plist路径 -#define PLIST_PATH [NSString stringWithFormat:@"%@/%@/FinishedPlist.plist",CACHES_DIRECTORY,BASE] - -@interface ZFCommonHelper : NSObject - -/** 将文件大小转化成M单位或者B单位 */ -+ (NSString *)getFileSizeString:(NSString *)size; -/** 经文件大小转化成不带单位的数字 */ -+ (float)getFileSizeNumber:(NSString *)size; -/** 字符串格式化成日期 */ -+ (NSDate *)makeDate:(NSString *)birthday; -/** 日期格式化成字符串 */ -+ (NSString *)dateToString:(NSDate*)date; -/** 检查文件名是否存在 */ -+ (BOOL)isExistFile:(NSString *)fileName; -+ (NSString *)createFolder:(NSString *)path; - -@end diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFCommonHelper.m b/iOSProject/Pods/ZFDownload/ZFDownload/ZFCommonHelper.m deleted file mode 100755 index 4ef153f9..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFCommonHelper.m +++ /dev/null @@ -1,106 +0,0 @@ -// -// ZFCommonHelper.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFCommonHelper.h" -#import "ZFFileModel.h" - -@implementation ZFCommonHelper - -+ (NSString *)getFileSizeString:(NSString *)size -{ - if([size floatValue]>=1024*1024)//大于1M,则转化成M单位的字符串 - { - return [NSString stringWithFormat:@"%1.2fM",[size floatValue]/1024/1024]; - } - else if([size floatValue]>=1024&&[size floatValue]<1024*1024) //不到1M,但是超过了1KB,则转化成KB单位 - { - return [NSString stringWithFormat:@"%1.2fK",[size floatValue]/1024]; - } - else//剩下的都是小于1K的,则转化成B单位 - { - return [NSString stringWithFormat:@"%1.2fB",[size floatValue]]; - } -} - -+ (float)getFileSizeNumber:(NSString *)size -{ - NSInteger indexM=[size rangeOfString:@"M"].location; - NSInteger indexK=[size rangeOfString:@"K"].location; - NSInteger indexB=[size rangeOfString:@"B"].location; - if(indexM<1000)//是M单位的字符串 - { - return [[size substringToIndex:indexM] floatValue]*1024*1024; - } - else if(indexK<1000)//是K单位的字符串 - { - return [[size substringToIndex:indexK] floatValue]*1024; - } - else if(indexB<1000)//是B单位的字符串 - { - return [[size substringToIndex:indexB] floatValue]; - } - else//没有任何单位的数字字符串 - { - return [size floatValue]; - } -} - -+ (BOOL)isExistFile:(NSString *)fileName -{ - NSFileManager *fileManager = [NSFileManager defaultManager]; - return [fileManager fileExistsAtPath:fileName]; -} - -+ (NSDate *)makeDate:(NSString *)birthday -{ - NSDateFormatter *df = [[NSDateFormatter alloc] init]; - [df setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; - NSDate *date = [df dateFromString:birthday]; - return date; -} - -+ (NSString *)dateToString:(NSDate*)date -{ - NSDateFormatter *df = [[NSDateFormatter alloc] init]; - [df setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; - NSString *datestr = [df stringFromDate:date]; - return datestr; -} - -+ (NSString *)createFolder:(NSString *)path -{ - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSError *error; - if(![fileManager fileExistsAtPath:path]) - { - [fileManager createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]; - if(!error) - { - NSLog(@"%@",[error description]); - - } - } - return path; -} - -@end diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadDelegate.h b/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadDelegate.h deleted file mode 100755 index 2fbe247b..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadDelegate.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// ZFDownloadDelegate.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import "ZFHttpRequest.h" - -@protocol ZFDownloadDelegate - -@optional -- (void)startDownload:(ZFHttpRequest *)request; -- (void)updateCellProgress:(ZFHttpRequest *)request; -- (void)finishedDownload:(ZFHttpRequest *)request; -- (void)allowNextRequest;//处理一个窗口内连续下载多个文件且重复下载的情况 - -@end diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadManager.h b/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadManager.h deleted file mode 100755 index cf097cfd..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadManager.h +++ /dev/null @@ -1,101 +0,0 @@ -// -// ZFDownloadManager.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - - -#import -#import "ZFCommonHelper.h" -#import "ZFDownloadDelegate.h" -#import "ZFFileModel.h" -#import "ZFHttpRequest.h" - -#define kMaxRequestCount @"kMaxRequestCount" - -@interface ZFDownloadManager : NSObject - -/** 获得下载事件的vc,用在比如多选图片后批量下载的情况,这时需配合 allowNextRequest 协议方法使用 */ -@property (nonatomic, weak ) id VCdelegate; -/** 下载列表delegate */ -@property (nonatomic, weak ) id downloadDelegate; -/** 设置最大的并发下载个数 */ -@property (nonatomic, assign) NSInteger maxCount; -/** 已下载完成的文件列表(文件对象) */ -@property (atomic, strong, readonly) NSMutableArray *finishedlist; -/** 正在下载的文件列表(ASIHttpRequest对象) */ -@property (atomic, strong, readonly) NSMutableArray *downinglist; -/** 未下载完成的临时文件数组(文件对象) */ -@property (atomic, strong, readonly) NSMutableArray *filelist; -/** 下载文件的模型 */ -@property (nonatomic, strong, readonly) ZFFileModel *fileInfo; - -/** 单例 */ -+ (ZFDownloadManager *)sharedDownloadManager; -/** - * 清除所有正在下载的请求 - */ -- (void)clearAllRquests; -/** - * 清除所有下载完的文件 - */ -- (void)clearAllFinished; -/** - * 恢复下载 - */ -- (void)resumeRequest:(ZFHttpRequest *)request; -/** - * 删除这个下载请求 - */ -- (void)deleteRequest:(ZFHttpRequest *)request; -/** - * 停止这个下载请求 - */ -- (void)stopRequest:(ZFHttpRequest *)request; -/** - * 保存下载完成的文件信息到plist - */ -- (void)saveFinishedFile; -/** - * 删除某一个下载完成的文件 - */ -- (void)deleteFinishFile:(ZFFileModel *)selectFile; -/** - * 下载视频时候调用 - */ -- (void)downFileUrl:(NSString*)url - filename:(NSString*)name - fileimage:(UIImage *)image; -/** - * 开始任务 - */ -- (void)startLoad; -/** - * 全部开始(等于最大下载个数,超过的还是等待下载状态) - */ -- (void)startAllDownloads; -/** - * 全部暂停 - */ -- (void)pauseAllDownloads; - -@end - - diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadManager.m b/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadManager.m deleted file mode 100755 index b54bc22f..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFDownloadManager.m +++ /dev/null @@ -1,706 +0,0 @@ - -// ZFDownloadManager.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFDownloadManager.h" - -static ZFDownloadManager *sharedDownloadManager = nil; - -@interface ZFDownloadManager () - -/** 本地临时文件夹文件的个数 */ -@property (nonatomic,assign ) NSInteger count; -/** 已下载完成的文件列表(文件对象)*/ -@property (atomic,strong ) NSMutableArray *finishedlist; -/** 正在下载的文件列表(ASIHttpRequest对象)*/ -@property (atomic,strong ) NSMutableArray *downinglist; -/** 未下载完成的临时文件数组(文件对象)*/ -@property (atomic,strong ) NSMutableArray *filelist; -/** 下载文件的模型 */ -@property (nonatomic,strong ) ZFFileModel *fileInfo; - -@end - -@implementation ZFDownloadManager - -#pragma mark - init methods - -+ (ZFDownloadManager *)sharedDownloadManager -{ - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedDownloadManager = [[self alloc] init]; - }); - return sharedDownloadManager; -} - -- (instancetype)init -{ - self = [super init]; - if (self) { - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - NSString * max = [userDefaults valueForKey:kMaxRequestCount]; - if (max == nil) { - [userDefaults setObject:@"3" forKey:kMaxRequestCount]; - max = @"3"; - } - [userDefaults synchronize]; - _maxCount = [max integerValue]; - _filelist = [[NSMutableArray alloc]init]; - _downinglist = [[NSMutableArray alloc] init]; - _finishedlist = [[NSMutableArray alloc] init]; - _count = 0; - [self loadFinishedfiles]; - [self loadTempfiles]; - } - return self; -} - -- (void)cleanLastInfo -{ - for (ZFHttpRequest *request in _downinglist) { - if([request isExecuting]) - [request cancel]; - } - [self saveFinishedFile]; - [_downinglist removeAllObjects]; - [_finishedlist removeAllObjects]; - [_filelist removeAllObjects]; -} - -#pragma mark - 创建一个下载任务 - -- (void)downFileUrl:(NSString *)url - filename:(NSString *)name - fileimage:(UIImage *)image -{ - // 因为是重新下载,则说明肯定该文件已经被下载完,或者有临时文件正在留着,所以检查一下这两个地方,存在则删除掉 - - _fileInfo = [[ZFFileModel alloc] init]; - if (!name) { name = [url lastPathComponent]; } - _fileInfo.fileName = name; - _fileInfo.fileURL = url; - - NSDate *myDate = [NSDate date]; - _fileInfo.time = [ZFCommonHelper dateToString:myDate]; - _fileInfo.fileType = [name pathExtension]; - - _fileInfo.fileimage = image; - _fileInfo.downloadState = ZFDownloading; - _fileInfo.error = NO; - _fileInfo.tempPath = TEMP_PATH(name); - if ([ZFCommonHelper isExistFile:FILE_PATH(name)]) { // 已经下载过一次 - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"该文件已下载,是否重新下载?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; - dispatch_async(dispatch_get_main_queue(), ^{ - [alert show]; - }); - return; - } - // 存在于临时文件夹里 - NSString *tempfilePath = [TEMP_PATH(name) stringByAppendingString:@".plist"]; - if ([ZFCommonHelper isExistFile:tempfilePath]) { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"该文件已经在下载列表中了,是否重新下载?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; - dispatch_async(dispatch_get_main_queue(), ^{ - [alert show]; - }); - return; - } - - // 若不存在文件和临时文件,则是新的下载 - [self.filelist addObject:_fileInfo]; - // 开始下载 - [self startLoad]; - - if (self.VCdelegate && [self.VCdelegate respondsToSelector:@selector(allowNextRequest)]) { - [self.VCdelegate allowNextRequest]; - } else { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"该文件成功添加到下载队列" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; - dispatch_async(dispatch_get_main_queue(), ^{ - [alert show]; - }); - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)( 0.8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [alert dismissWithClickedButtonIndex:0 animated:YES]; - }); - } - return; - -} - -#pragma mark - 下载开始 - -- (void)beginRequest:(ZFFileModel *)fileInfo isBeginDown:(BOOL)isBeginDown -{ - for(ZFHttpRequest *tempRequest in self.downinglist) - { - /** - * 注意这里判读是否是同一下载的方法,asihttprequest有三种url: url,originalurl,redirectURL - * 经过实践,应该使用originalurl,就是最先获得到的原下载地址 - **/ - if([[[tempRequest.url absoluteString] lastPathComponent] isEqualToString:[fileInfo.fileURL lastPathComponent]]) - { - if ([tempRequest isExecuting] && isBeginDown) { - return; - } else if ([tempRequest isExecuting] && !isBeginDown) { - [tempRequest setUserInfo:[NSDictionary dictionaryWithObject:fileInfo forKey:@"File"]]; - [tempRequest cancel]; - [self.downloadDelegate updateCellProgress:tempRequest]; - return; - } - } - } - - [self saveDownloadFile:fileInfo]; - - // 按照获取的文件名获取临时文件的大小,即已下载的大小 - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSData *fileData = [fileManager contentsAtPath:fileInfo.tempPath]; - NSInteger receivedDataLength = [fileData length]; - fileInfo.fileReceivedSize = [NSString stringWithFormat:@"%zd", receivedDataLength]; - - // NSLog(@"start down:已经下载:%@",fileInfo.fileReceivedSize); - ZFHttpRequest *midRequest = [[ZFHttpRequest alloc] initWithURL:[NSURL URLWithString:fileInfo.fileURL]]; - midRequest.downloadDestinationPath = FILE_PATH(fileInfo.fileName); - midRequest.temporaryFileDownloadPath = fileInfo.tempPath; - midRequest.delegate = self; - [midRequest setUserInfo:[NSDictionary dictionaryWithObject:fileInfo forKey:@"File"]];//设置上下文的文件基本信息 - if (isBeginDown) { [midRequest startAsynchronous]; } - - // 如果文件重复下载或暂停、继续,则把队列中的请求删除,重新添加 - BOOL exit = NO; - for (ZFHttpRequest *tempRequest in self.downinglist) { - if([[[tempRequest.url absoluteString] lastPathComponent] isEqualToString:[fileInfo.fileURL lastPathComponent]]) { - [self.downinglist replaceObjectAtIndex:[_downinglist indexOfObject:tempRequest] withObject:midRequest]; - exit = YES; - break; - } - } - - if (!exit) { [self.downinglist addObject:midRequest]; } - [self.downloadDelegate updateCellProgress:midRequest]; -} - -#pragma mark - 存储下载信息到一个plist文件 - -- (void)saveDownloadFile:(ZFFileModel*)fileinfo -{ - NSData *imagedata = UIImagePNGRepresentation(fileinfo.fileimage); - NSDictionary *filedic = [NSDictionary dictionaryWithObjectsAndKeys:fileinfo.fileName,@"filename", - fileinfo.fileURL,@"fileurl", - fileinfo.time,@"time", - fileinfo.fileSize,@"filesize", - fileinfo.fileReceivedSize,@"filerecievesize", - imagedata,@"fileimage",nil]; - - NSString *plistPath = [fileinfo.tempPath stringByAppendingPathExtension:@"plist"]; - if (![filedic writeToFile:plistPath atomically:YES]) { - NSLog(@"write plist fail"); - } -} - -#pragma mark - 自动处理下载状态的算法 - -/*下载状态的逻辑是这样的:三种状态,下载中,等待下载,停止下载 - - 当超过最大下载数时,继续添加的下载会进入等待状态,当同时下载数少于最大限制时会自动开始下载等待状态的任务。 - 可以主动切换下载状态 - 所有任务以添加时间排序。 - */ - -- (void)startLoad -{ - NSInteger num = 0; - NSInteger max = _maxCount; - for (ZFFileModel *file in _filelist) { - if (!file.error) { - if (file.downloadState == ZFDownloading) { - if (num >= max) { - file.downloadState = ZFWillDownload; - } else { - num++; - } - } - } - } - if (num < max) { - for (ZFFileModel *file in _filelist) { - if (!file.error) { - if (file.downloadState == ZFWillDownload) { - num++; - if (num>max) { - break; - } - file.downloadState = ZFDownloading; - } - } - } - - } - for (ZFFileModel *file in _filelist) { - if (!file.error) { - if (file.downloadState == ZFDownloading) { - [self beginRequest:file isBeginDown:YES]; - } else { - [self beginRequest:file isBeginDown:NO]; - } - } - } - self.count = [_filelist count]; -} - - -#pragma mark - 恢复下载 - -- (void)resumeRequest:(ZFHttpRequest *)request -{ - NSInteger max = _maxCount; - ZFFileModel *fileInfo = [request.userInfo objectForKey:@"File"]; - NSInteger downingcount = 0; - NSInteger indexmax = -1; - for (ZFFileModel *file in _filelist) { - if (file.downloadState == ZFDownloading) { - downingcount++; - if (downingcount==max) { - indexmax = [_filelist indexOfObject:file]; - } - } - } - // 此时下载中数目是否是最大,并获得最大时的位置Index - if (downingcount == max) { - ZFFileModel *file = [_filelist objectAtIndex:indexmax]; - if (file.downloadState == ZFDownloading) { - file.downloadState = ZFWillDownload; - } - } - // 中止一个进程使其进入等待 - for (ZFFileModel *file in _filelist) { - if ([file.fileName isEqualToString:fileInfo.fileName]) { - file.downloadState = ZFDownloading; - file.error = NO; - } - } - // 重新开始此下载 - [self startLoad]; -} - -#pragma mark - 暂停下载 - -- (void)stopRequest:(ZFHttpRequest *)request -{ - NSInteger max = self.maxCount; - if([request isExecuting]) { - [request cancel]; - } - ZFFileModel *fileInfo = [request.userInfo objectForKey:@"File"]; - for (ZFFileModel *file in _filelist) { - if ([file.fileName isEqualToString:fileInfo.fileName]) { - file.downloadState = ZFStopDownload; - break; - } - } - NSInteger downingcount = 0; - - for (ZFFileModel *file in _filelist) { - if (file.downloadState == ZFDownloading) { - downingcount++; - } - } - if (downingcount < max) { - for (ZFFileModel *file in _filelist) { - if (file.downloadState == ZFWillDownload){ - file.downloadState = ZFDownloading; - break; - } - } - } - - [self startLoad]; -} - -#pragma mark - 删除下载 - -- (void)deleteRequest:(ZFHttpRequest *)request -{ - BOOL isexecuting = NO; - if([request isExecuting]) { - [request cancel]; - isexecuting = YES; - } - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSError *error; - ZFFileModel *fileInfo = (ZFFileModel*)[request.userInfo objectForKey:@"File"]; - NSString *path = fileInfo.tempPath; - - NSString *configPath = [NSString stringWithFormat:@"%@.plist",path]; - [fileManager removeItemAtPath:path error:&error]; - [fileManager removeItemAtPath:configPath error:&error]; - - if(!error){ NSLog(@"%@",[error description]);} - - NSInteger delindex = -1; - for (ZFFileModel *file in _filelist) { - if ([file.fileName isEqualToString:fileInfo.fileName]) { - delindex = [_filelist indexOfObject:file]; - break; - } - } - if (delindex != NSNotFound) - [_filelist removeObjectAtIndex:delindex]; - - [_downinglist removeObject:request]; - - if (isexecuting) { - [self startLoad]; - } - self.count = [_filelist count]; -} - -#pragma mark - 可能的UI操作接口 - -- (void)clearAllFinished -{ - [_finishedlist removeAllObjects]; -} - -- (void)clearAllRquests -{ - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSError *error; - for (ZFHttpRequest *request in _downinglist) { - if([request isExecuting]) - [request cancel]; - ZFFileModel *fileInfo = (ZFFileModel*)[request.userInfo objectForKey:@"File"]; - NSString *path = fileInfo.tempPath;; - NSString *configPath = [NSString stringWithFormat:@"%@.plist",path]; - [fileManager removeItemAtPath:path error:&error]; - [fileManager removeItemAtPath:configPath error:&error]; - if(!error) - { - NSLog(@"%@",[error description]); - } - - } - [_downinglist removeAllObjects]; - [_filelist removeAllObjects]; -} - -- (void)startAllDownloads -{ - for (ZFHttpRequest *request in _downinglist) { - if([request isExecuting]) { - [request cancel]; - } - ZFFileModel *fileInfo = [request.userInfo objectForKey:@"File"]; - fileInfo.downloadState = ZFDownloading; - } - [self startLoad]; -} - -- (void)pauseAllDownloads -{ - for (ZFHttpRequest *request in _downinglist) { - if([request isExecuting]) { - [request cancel]; - } - ZFFileModel *fileInfo = [request.userInfo objectForKey:@"File"]; - fileInfo.downloadState = ZFStopDownload; - } - [self startLoad]; -} - -#pragma mark - 从这里获取上次未完成下载的信息 -/* - 将本地的未下载完成的临时文件加载到正在下载列表里,但是不接着开始下载 - - */ -- (void)loadTempfiles -{ - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSError *error; - NSArray *filelist = [fileManager contentsOfDirectoryAtPath:TEMP_FOLDER error:&error]; - if(!error) - { - NSLog(@"%@",[error description]); - } - NSMutableArray *filearr = [[NSMutableArray alloc]init]; - for(NSString *file in filelist) { - NSString *filetype = [file pathExtension]; - if([filetype isEqualToString:@"plist"]) - [filearr addObject:[self getTempfile:TEMP_PATH(file)]]; - } - - NSArray* arr = [self sortbyTime:(NSArray *)filearr]; - [_filelist addObjectsFromArray:arr]; - - [self startLoad]; -} - -- (ZFFileModel *)getTempfile:(NSString *)path -{ - NSDictionary *dic = [NSDictionary dictionaryWithContentsOfFile:path]; - ZFFileModel *file = [[ZFFileModel alloc]init]; - file.fileName = [dic objectForKey:@"filename"]; - file.fileType = [file.fileName pathExtension ]; - file.fileURL = [dic objectForKey:@"fileurl"]; - file.fileSize = [dic objectForKey:@"filesize"]; - file.fileReceivedSize = [dic objectForKey:@"filerecievesize"]; - - file.tempPath = TEMP_PATH(file.fileName); - file.time = [dic objectForKey:@"time"]; - file.fileimage = [UIImage imageWithData:[dic objectForKey:@"fileimage"]]; - file.downloadState = ZFStopDownload; - file.error = NO; - - NSData *fileData = [[NSFileManager defaultManager ] contentsAtPath:file.tempPath]; - NSInteger receivedDataLength = [fileData length]; - file.fileReceivedSize = [NSString stringWithFormat:@"%zd",receivedDataLength]; - return file; -} - -- (NSArray *)sortbyTime:(NSArray *)array -{ - NSArray *sorteArray1 = [array sortedArrayUsingComparator:^(id obj1, id obj2){ - ZFFileModel *file1 = (ZFFileModel *)obj1; - ZFFileModel *file2 = (ZFFileModel *)obj2; - NSDate *date1 = [ZFCommonHelper makeDate:file1.time]; - NSDate *date2 = [ZFCommonHelper makeDate:file2.time]; - if ([[date1 earlierDate:date2]isEqualToDate:date2]) { - return (NSComparisonResult)NSOrderedDescending; - } - - if ([[date1 earlierDate:date2]isEqualToDate:date1]) { - return (NSComparisonResult)NSOrderedAscending; - } - - return (NSComparisonResult)NSOrderedSame; - }]; - return sorteArray1; -} - -#pragma mark - 已完成的下载任务在这里处理 -/* - 将本地已经下载完成的文件加载到已下载列表里 - */ -- (void)loadFinishedfiles -{ - if ([[NSFileManager defaultManager] fileExistsAtPath:PLIST_PATH]) { - NSMutableArray *finishArr = [[NSMutableArray alloc] initWithContentsOfFile:PLIST_PATH]; - for (NSDictionary *dic in finishArr) { - ZFFileModel *file = [[ZFFileModel alloc]init]; - file.fileName = [dic objectForKey:@"filename"]; - file.fileType = [file.fileName pathExtension]; - file.fileSize = [dic objectForKey:@"filesize"]; - file.time = [dic objectForKey:@"time"]; - file.fileimage = [UIImage imageWithData:[dic objectForKey:@"fileimage"]]; - [_finishedlist addObject:file]; - } - } - -} - -- (void)saveFinishedFile -{ - if (_finishedlist == nil) { return; } - NSMutableArray *finishedinfo = [[NSMutableArray alloc] init]; - - for (ZFFileModel *fileinfo in _finishedlist) { - NSData *imagedata = UIImagePNGRepresentation(fileinfo.fileimage); - NSDictionary *filedic = [NSDictionary dictionaryWithObjectsAndKeys: fileinfo.fileName,@"filename", - fileinfo.time,@"time", - fileinfo.fileSize,@"filesize", - imagedata,@"fileimage", nil]; - [finishedinfo addObject:filedic]; - } - - if (![finishedinfo writeToFile:PLIST_PATH atomically:YES]) { - NSLog(@"write plist fail"); - } -} - -- (void)deleteFinishFile:(ZFFileModel *)selectFile -{ - [_finishedlist removeObject:selectFile]; - NSFileManager *fm = [NSFileManager defaultManager]; - NSString *path = FILE_PATH(selectFile.fileName); - if ([fm fileExistsAtPath:path]) { - [fm removeItemAtPath:path error:nil]; - } - [self saveFinishedFile]; -} - -#pragma mark -- ASIHttpRequest回调委托 -- - -// 出错了,如果是等待超时,则继续下载 -- (void)requestFailed:(ZFHttpRequest *)request -{ - NSError *error=[request error]; - NSLog(@"ASIHttpRequest出错了!%@",error); - if (error.code==4) { return; } - if ([request isExecuting]) { [request cancel]; } - ZFFileModel *fileInfo = [request.userInfo objectForKey:@"File"]; - fileInfo.downloadState = ZFStopDownload; - fileInfo.error = YES; - for (ZFFileModel *file in _filelist) { - if ([file.fileName isEqualToString:fileInfo.fileName]) { - file.downloadState = ZFStopDownload; - file.error = YES; - } - } - [self.downloadDelegate updateCellProgress:request]; -} - -- (void)requestStarted:(ZFHttpRequest *)request -{ - NSLog(@"开始了!"); -} - -- (void)request:(ZFHttpRequest *)request didReceiveResponseHeaders:(NSDictionary *)responseHeaders -{ - NSLog(@"收到回复了!"); - - ZFFileModel *fileInfo = [request.userInfo objectForKey:@"File"]; - fileInfo.isFirstReceived = YES; - - NSString *len = [responseHeaders objectForKey:@"Content-Length"]; - // 这个信息头,首次收到的为总大小,那么后来续传时收到的大小为肯定小于或等于首次的值,则忽略 - if ([fileInfo.fileSize longLongValue] > [len longLongValue]){ return; } - - fileInfo.fileSize = [NSString stringWithFormat:@"%lld", [len longLongValue]]; - [self saveDownloadFile:fileInfo]; -} - -- (void)request:(ZFHttpRequest *)request didReceiveBytes:(long long)bytes -{ - ZFFileModel *fileInfo = [request.userInfo objectForKey:@"File"]; - NSLog(@"%@,%lld",fileInfo.fileReceivedSize,bytes); - if (fileInfo.isFirstReceived) { - fileInfo.isFirstReceived = NO; - fileInfo.fileReceivedSize = [NSString stringWithFormat:@"%lld",bytes]; - } else if(!fileInfo.isFirstReceived) { - fileInfo.fileReceivedSize = [NSString stringWithFormat:@"%lld",[fileInfo.fileReceivedSize longLongValue]+bytes]; - } - - if([self.downloadDelegate respondsToSelector:@selector(updateCellProgress:)]) { - [self.downloadDelegate updateCellProgress:request]; - } - -} - -// 将正在下载的文件请求ASIHttpRequest从队列里移除,并将其配置文件删除掉,然后向已下载列表里添加该文件对象 -- (void)requestFinished:(ZFHttpRequest *)request -{ - ZFFileModel *fileInfo = (ZFFileModel *)[request.userInfo objectForKey:@"File"]; - [_finishedlist addObject:fileInfo]; - NSString *configPath = [fileInfo.tempPath stringByAppendingString:@".plist"]; - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSError *error; - if([fileManager fileExistsAtPath:configPath]) //如果存在临时文件的配置文件 - { - [fileManager removeItemAtPath:configPath error:&error]; - if(!error) { NSLog(@"%@",[error description]); } - } - - [_filelist removeObject:fileInfo]; - [_downinglist removeObject:request]; - [self saveFinishedFile]; - [self startLoad]; - - if([self.downloadDelegate respondsToSelector:@selector(finishedDownload:)]) { - [self.downloadDelegate finishedDownload:request]; - } -} - -#pragma mark - UIAlertViewDelegate - -- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex -{ - // 确定按钮 - if( buttonIndex == 1 ) { - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSError *error; - NSInteger delindex = -1; - NSString *path = FILE_PATH(_fileInfo.fileName); - if([ZFCommonHelper isExistFile:path]) { //已经下载过一次该文件 - for (ZFFileModel *info in _finishedlist) { - if ([info.fileName isEqualToString:_fileInfo.fileName]) { - // 删除文件 - [self deleteFinishFile:info]; - } - } - } else { // 如果正在下载中,择重新下载 - for(ZFHttpRequest *request in self.downinglist) { - ZFFileModel *ZFFileModel = [request.userInfo objectForKey:@"File"]; - if([ZFFileModel.fileName isEqualToString:_fileInfo.fileName]) - { - if ([request isExecuting]) { - [request cancel]; - } - delindex = [_downinglist indexOfObject:request]; - break; - } - } - [_downinglist removeObjectAtIndex:delindex]; - - for (ZFFileModel *file in _filelist) { - if ([file.fileName isEqualToString:_fileInfo.fileName]) { - delindex = [_filelist indexOfObject:file]; - break; - } - } - [_filelist removeObjectAtIndex:delindex]; - // 存在于临时文件夹里 - NSString * tempfilePath = [_fileInfo.tempPath stringByAppendingString:@".plist"]; - if([ZFCommonHelper isExistFile:tempfilePath]) - { - if (![fileManager removeItemAtPath:tempfilePath error:&error]) { - NSLog(@"删除临时文件出错:%@",[error localizedDescription]); - } - - } - if([ZFCommonHelper isExistFile:_fileInfo.tempPath]) - { - if (![fileManager removeItemAtPath:_fileInfo.tempPath error:&error]) { - NSLog(@"删除临时文件出错:%@",[error localizedDescription]); - } - } - - } - - self.fileInfo.fileReceivedSize = [ZFCommonHelper getFileSizeString:@"0"]; - [_filelist addObject:_fileInfo]; - [self startLoad]; - } - if (self.VCdelegate!=nil && [self.VCdelegate respondsToSelector:@selector(allowNextRequest)]) { - [self.VCdelegate allowNextRequest]; - } -} - -#pragma mark - setter - -- (void)setMaxCount:(NSInteger)maxCount -{ - _maxCount = maxCount; - [[NSUserDefaults standardUserDefaults] setValue:@(maxCount) forKey:kMaxRequestCount]; - [[NSUserDefaults standardUserDefaults] synchronize]; - [[ZFDownloadManager sharedDownloadManager] startLoad]; -} - -@end diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFFileModel.h b/iOSProject/Pods/ZFDownload/ZFDownload/ZFFileModel.h deleted file mode 100755 index 7c62ed58..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFFileModel.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// ZFFileModel.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import - -typedef NS_ENUM(NSInteger,ZFDownLoadState) { - ZFDownloading, //下载中 - ZFWillDownload, //等待下载 - ZFStopDownload //停止下载 -}; - -@interface ZFFileModel : NSObject - -/** 文件名 */ -@property (nonatomic,strong) NSString *fileName; -/** 文件的总长度 */ -@property (nonatomic,strong) NSString *fileSize; -/** 文件的类型(文件后缀,比如:mp4)*/ -@property (nonatomic,strong) NSString *fileType; -/** 是否是第一次接受数据,如果是则不累加第一次返回的数据长度,之后变累加 */ -@property (nonatomic,assign) BOOL isFirstReceived; -/** 文件已下载的长度 */ -@property (nonatomic,strong) NSString *fileReceivedSize; -/** 接受的数据 */ -@property (nonatomic,strong) NSMutableData *fileReceivedData; -/** 下载文件的URL */ -@property (nonatomic,strong) NSString *fileURL; -/** 下载时间 */ -@property (nonatomic,strong) NSString *time; -/** 临时文件路径 */ -@property (nonatomic,strong) NSString *tempPath; -/*下载状态的逻辑是这样的:三种状态,下载中,等待下载,停止下载 - *当超过最大下载数时,继续添加的下载会进入等待状态,当同时下载数少于最大限制时会自动开始下载等待状态的任务。 - *可以主动切换下载状态 - *所有任务以添加时间排序。 -*/ -@property (nonatomic, assign) ZFDownLoadState downloadState; -/** 是否下载出错 */ -@property (nonatomic, assign) BOOL error; -/** md5 */ -@property (nonatomic,strong ) NSString *MD5; -/** 文件的附属图片 */ -@property (nonatomic,strong ) UIImage *fileimage; - -@end diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFFileModel.m b/iOSProject/Pods/ZFDownload/ZFDownload/ZFFileModel.m deleted file mode 100755 index 426bae9f..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFFileModel.m +++ /dev/null @@ -1,28 +0,0 @@ -// -// ZFFileModel.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFFileModel.h" - -@implementation ZFFileModel - -@end diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFHttpRequest.h b/iOSProject/Pods/ZFDownload/ZFDownload/ZFHttpRequest.h deleted file mode 100755 index 257be075..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFHttpRequest.h +++ /dev/null @@ -1,56 +0,0 @@ -// -// ZFHttpRequest.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import - -@class ZFHttpRequest; - -@protocol ZFHttpRequestDelegate - -- (void)requestFailed:(ZFHttpRequest *)request; -- (void)requestStarted:(ZFHttpRequest *)request; -- (void)request:(ZFHttpRequest *)request didReceiveResponseHeaders:(NSDictionary *)responseHeaders; -- (void)request:(ZFHttpRequest *)request didReceiveBytes:(long long)bytes; -- (void)requestFinished:(ZFHttpRequest *)request; -@optional -- (void)request:(ZFHttpRequest *)request willRedirectToURL:(NSURL *)newURL; - -@end - -@interface ZFHttpRequest : NSObject -@property (weak, nonatomic ) id delegate; -@property (strong, nonatomic) NSURL *url; -@property (strong, nonatomic) NSURL *originalURL; -@property (strong, nonatomic) NSDictionary *userInfo; -@property (assign, nonatomic) NSInteger tag; -@property (strong, nonatomic) NSString *downloadDestinationPath; -@property (strong, nonatomic) NSString *temporaryFileDownloadPath; -@property (strong,readonly,nonatomic) NSError *error; - -- (instancetype)initWithURL:(NSURL*)url; -- (void)startAsynchronous; -- (BOOL)isFinished; -- (BOOL)isExecuting; -- (void)cancel; -@end diff --git a/iOSProject/Pods/ZFDownload/ZFDownload/ZFHttpRequest.m b/iOSProject/Pods/ZFDownload/ZFDownload/ZFHttpRequest.m deleted file mode 100755 index 63135ae6..00000000 --- a/iOSProject/Pods/ZFDownload/ZFDownload/ZFHttpRequest.m +++ /dev/null @@ -1,152 +0,0 @@ -// -// ZFHttpRequest.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFHttpRequest.h" - -@interface ZFHttpRequest() -{ - ASIHTTPRequest *_realRequest; -} -@end - -@implementation ZFHttpRequest - -- (instancetype)initWithURL:(NSURL*)url -{ - self = [super init]; - if (self) { - _url = url; - _realRequest = [[ASIHTTPRequest alloc]initWithURL:url]; - _realRequest.delegate = self; - [_realRequest setDownloadProgressDelegate:self]; - [_realRequest setNumberOfTimesToRetryOnTimeout:2]; - [_realRequest setAllowResumeForFileDownloads:YES];//支持断点续传 - [_realRequest setTimeOutSeconds:30.0f]; - - } - return self; -} -- (void)setUserInfo:(NSDictionary *)userInfo -{ - _userInfo = userInfo; -} - -- (void)setTag:(NSInteger)tag -{ - _tag = tag; - _realRequest.tag = tag; -} - -- (NSURL*)originalURL -{ - return _realRequest.originalURL; -} - -- (NSError*)error -{ - return _realRequest.error; -} - -- (BOOL)isFinished -{ - return [_realRequest isFinished]; -} - -- (BOOL)isExecuting -{ - return [_realRequest isExecuting]; -} - -- (void)cancel -{ - [_realRequest clearDelegatesAndCancel]; -} - -- (void)setDownloadDestinationPath:(NSString *)downloadDestinationPath -{ - _downloadDestinationPath = downloadDestinationPath; - [_realRequest setDownloadDestinationPath:_downloadDestinationPath]; -} - -- (void)setTemporaryFileDownloadPath:(NSString *)temporaryFileDownloadPath -{ - _temporaryFileDownloadPath = temporaryFileDownloadPath; - [_realRequest setTemporaryFileDownloadPath:_temporaryFileDownloadPath]; -} - -- (void)startAsynchronous -{ - [_realRequest startAsynchronous]; -} - -#pragma mark - ASIHttpDelegate - -- (void)requestStarted:(ASIHTTPRequest *)request -{ - if (self.delegate&&[self.delegate respondsToSelector:@selector(requestStarted:)]) { - [self.delegate requestStarted:self]; - } -} - -- (void)request:(ASIHTTPRequest *)request didReceiveResponseHeaders:(NSDictionary *)responseHeader -{ - if (self.delegate&&[self.delegate respondsToSelector:@selector(request:didReceiveResponseHeaders:)]) { - [self.delegate request:self didReceiveResponseHeaders:responseHeader]; - } -} - -- (void)request:(ZFHttpRequest *)request didReceiveBytes:(long long)bytes -{ - if (self.delegate&&[self.delegate respondsToSelector:@selector(request:didReceiveBytes:)]) { - [self.delegate request:self didReceiveBytes:bytes]; - } -} -- (void)request:(ASIHTTPRequest *)request willRedirectToURL:(NSURL *)newURL -{ - if (self.delegate&&[self.delegate respondsToSelector:@selector(request:willRedirectToURL:)]) { - [self.delegate request:self willRedirectToURL:newURL]; - } -} -- (void)requestFinished:(ASIHTTPRequest *)request -{ - if (self.delegate&&[self.delegate respondsToSelector:@selector(requestFinished:)]) { - [self.delegate requestFinished:self]; - } -} - -- (void)requestFailed:(ASIHTTPRequest *)request -{ - if (self.delegate&&[self.delegate respondsToSelector:@selector(requestFailed:)]) { - [self.delegate requestFailed:self]; - } -} - -// 全部暂停的时候 request并不retain它们的代理,所以已经释放了代理 而之后request完成了,这将会引起崩溃。大多数情况下,如果你的代理即将被释放,你一定也希望取消所有request,因为你已经不再关心它们的返回情况了,所以得在ZFHttpRequest这个类的dealloc里面加上一个[request clearDelegatesAndCancel]; -// 代理类的dealloc函数 -- (void)dealloc -{ - //NSLog(@"%@ 释放了",_realRequest); - [_realRequest clearDelegatesAndCancel]; -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/LICENSE b/iOSProject/Pods/ZFPlayer/LICENSE deleted file mode 100644 index 1973cdc7..00000000 --- a/iOSProject/Pods/ZFPlayer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2016 ZFPlayer (https://github.com/renzifeng/ZFPlayer) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/iOSProject/Pods/ZFPlayer/README.md b/iOSProject/Pods/ZFPlayer/README.md deleted file mode 100644 index 7a9f9932..00000000 --- a/iOSProject/Pods/ZFPlayer/README.md +++ /dev/null @@ -1,313 +0,0 @@ -

    -ZFPlayer -

    - -

    - - - - - -

    - -A simple video player for iOS, based on AVPlayer. Support the vertical, horizontal screen(lock screen direction). Support adjust volume, brigtness and video progress. - - -[中文说明](https://github.com/renzifeng/ZFPlayer/blob/master/README.zh.md)  [ZFPlayer剖析](http://www.jianshu.com/p/5566077bb25f)  [哪些app使用ZFPlayer](http://www.jianshu.com/p/5fa55a05f87b) - -## Features -- [x] Support for horizontal and vertical play mode, in horizontal mode can also lock the screen direction -- [x] Support play with online URL and local file -- [x] Support in TableviewCell playing video -- [x] Adjust brightness by slide vertical at left side of screen -- [x] Adjust volume by slide vertical at right side of screen -- [x] Slide horizontal to fast forward and rewind -- [x] Full screen mode to drag the slider control progress, display video preview -- [x] Download -- [x] Toggle video resolution - -## Requirements - -- iOS 7+ -- Xcode 8+ - - -## Statistics - -What App using ZFPlayer, and on AppStore, please tell me, help me to statistics. - -## Component - -- Breakpoint Download: [ZFDownload](https://github.com/renzifeng/ZFDownload) -- ZFNavigationController: [ZFNavigationController](https://github.com/renzifeng/ZFNavigationController) -- Layout: Masonry - -## Installation - -### CocoaPods - -```ruby -pod 'ZFPlayer' -``` - -Then, run the following command: - -```bash -$ pod install -``` - -## Usage (Support IB and code) -##### Set status bar color -Please add the "View controller-based status bar appearance" field in info.plist and change it to NO - -##### IB usage -Drag IB to UIView,the View class `ZFPlayerView` instead -```objc -// view -ZFPlayerControlView *controlView = [[ZFPlayerControlView alloc] init]; -// model -ZFPlayerModel *playerModel = [[ZFPlayerModel alloc] init]; -playerModel.fatherView = ... -playerModel.videoURL = ... -playerModel.title = ... -[self.playerView playerControlView:controlView playerModel:playerModel]; -// delegate -self.playerView.delegate = self; -// auto play the video -[self.playerView autoPlayTheVideo]; -``` - -`ZFPlayerDelegate` - -``` -/** backBtn event */ -- (void)zf_playerBackAction; -/** downloadBtn event */ -- (void)zf_playerDownload:(NSString *)url; -``` - -##### Code implementation (Masonry) usage - -```objc -self.playerView = [[ZFPlayerView alloc] init]; -[self.view addSubview:self.playerView]; -[self.playerView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.view).offset(20); - make.left.right.equalTo(self.view); - // Here a 16:9 aspect ratio, can customize the video aspect ratio - make.height.equalTo(self.playerView.mas_width).multipliedBy(9.0f/16.0f); -}]; -// control view(you can custom) -ZFPlayerControlView *controlView = [[ZFPlayerControlView alloc] init]; -// model -ZFPlayerModel *playerModel = [[ZFPlayerModel alloc]init]; -playerModel.fatherView = ... -playerModel.videoURL = ... -playerModel.title = ... -[self.playerView playerControlView:controlView playerModel:playerModel]; - -// delegate -self.playerView.delegate = self; -// auto play the video -[self.playerView autoPlayTheVideo]; -``` - -##### Set the fill mode for the video - -```objc - // Set the fill mode of the video, the default settings (ZFPlayerLayerGravityResizeAspect: wait for a proportional fill, until a dimension reaches the area boundary). - self.playerView.playerLayerGravity = ZFPlayerLayerGravityResizeAspect; -``` -##### Is there a breakpoint download function -```objc - // Default is to close the breakpoint download function, such as the need for this feature set here - self.playerView.hasDownload = YES; -``` - -##### Play video from XX seconds - - ```objc - // Play video from XX seconds - playerModel.seekTime = 15; - ``` - -##### Automatically play the video,not automatically play by default -```objc -// Automatically play the video -[self.playerView autoPlayTheVideo]; -``` - -##### Set the video placeholderImage - -```objc -// The video placeholder image -// If network image and local image set at the same time, ignore the local image, display the network images -ZFPlayerModel *playerModel = [[ZFPlayerModel alloc]init]; -// local image -playerModel.placeholderImage = [UIImage imageNamed: @"..."]; -// network image -playerModel.placeholderImageURLString = @"https://xxx.jpg/"; -self.playerView.playerModel = playerModel; -``` - -##### Custom control layer -`self.playerView.controlView = your customView;` - -custom view you need to implement the following method in `.m`, you can reference`ZFPlayerControlView.m` - -``` -/** - * Set playaer model - */ -- (void)zf_playerModel:(ZFPlayerModel *)playerModel; - -/** - * Show controlView - */ -- (void)zf_playerShowControlView; - -/** - * Hide controlView - */ -- (void)zf_playerHideControlView; - -/** - * Reset controlView - */ -- (void)zf_playerResetControlView; - -/** - * Reset controlView for resolution - */ -- (void)zf_playerResetControlViewForResolution; - -/** - * Cancel auto fadeout controlView - */ -- (void)zf_playerCancelAutoFadeOutControlView; - -/** - * Begin to play - */ -- (void)zf_playerItemPlaying; - -/** - * Play end - */ -- (void)zf_playerPlayEnd; - -/** - * Has download function - */ -- (void)zf_playerHasDownloadFunction:(BOOL)sender; - -/** - * Resolution function - */ -- (void)zf_playerResolutionArray:(NSArray *)resolutionArray; - -/** - * PlayBtn state (play or pause) - */ -- (void)zf_playerPlayBtnState:(BOOL)state; - -/** - * LockBtn state - */ -- (void)zf_playerLockBtnState:(BOOL)state; - -/** - * DownloadBtn state - */ -- (void)zf_playerDownloadBtnState:(BOOL)state; - -/** - * Player activity - */ -- (void)zf_playerActivity:(BOOL)animated; - -/** - * Set preview View - */ -- (void)zf_playerDraggedTime:(NSInteger)draggedTime sliderImage:(UIImage *)image; - -/** - * Dragged to control video progress - - * @param draggedTime Dragged time for video - * @param totalTime Total time for video - * @param forawrd Whether fast forward - * @param preview Is there a preview - */ -- (void)zf_playerDraggedTime:(NSInteger)draggedTime totalTime:(NSInteger)totalTime isForward:(BOOL)forawrd hasPreview:(BOOL)preview; - -/** - * Dragged end - */ -- (void)zf_playerDraggedEnd; - -/** - * Normal play - - * @param currentTime Current time for video - * @param totalTime Total Time for video - * @param value Slider value(0.0~1.0) - */ -- (void)zf_playerCurrentTime:(NSInteger)currentTime totalTime:(NSInteger)totalTime sliderValue:(CGFloat)value; - -/** - * Progress display buffer - */ -- (void)zf_playerSetProgress:(CGFloat)progress; - -/** - * Video load failure - */ -- (void)zf_playerItemStatusFailed:(NSError *)error; - -/** - * Bottom shrink play - */ -- (void)zf_playerBottomShrinkPlay; - -/** - * play on cell - */ -- (void)zf_playerCellPlay; -``` - -### Picture demonstration - -![Picture effect](https://github.com/renzifeng/ZFPlayer/raw/master/screen.gif) - -![Sound adjustment demonstration](https://github.com/renzifeng/ZFPlayer/raw/master/volume.png) - -![Brightness adjustment demonstration](https://github.com/renzifeng/ZFPlayer/raw/master/brightness.png) - -![Fast adjustment demonstration](https://github.com/renzifeng/ZFPlayer/raw/master/fast.png) - -![Progress adjustment demonstration](https://github.com/renzifeng/ZFPlayer/raw/master/progress.png) - - -### Reference link: - -- [https://segmentfault.com/a/1190000004054258](https://segmentfault.com/a/1190000004054258) -- [http://sky-weihao.github.io/2015/10/06/Video-streaming-and-caching-in-iOS/](http://sky-weihao.github.io/2015/10/06/Video-streaming-and-caching-in-iOS/) -- [https://developer.apple.com/library/prerelease/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/02_Playback.html#//apple_ref/doc/uid/TP40010188-CH3-SW8](https://developer.apple.com/library/prerelease/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/02_Playback.html#//apple_ref/doc/uid/TP40010188-CH3-SW8) - ---- -### Swift Player: -See the [BMPlayer](https://github.com/BrikerMan/BMPlayer) please, thanks the BMPlayer author's open source. - ---- - -# Contact me -- Weibo: [@任子丰](https://weibo.com/zifeng1300) -- Email: zifeng1300@gmail.com -- QQ:459643690 -- QQ Group: 213376937(full) 213375947(add this) - -# License - -ZFPlayer is available under the MIT license. See the LICENSE file for more info. - diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValuePopUpView.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValuePopUpView.h deleted file mode 100644 index 5bff29cf..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValuePopUpView.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// ASValuePopUpView.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -@protocol ASValuePopUpViewDelegate -- (CGFloat)currentValueOffset; //expects value in the range 0.0 - 1.0 -- (void)colorDidUpdate:(UIColor *)opaqueColor; -@end - -@interface ASValuePopUpView : UIView - -@property (weak, nonatomic) id delegate; -@property (nonatomic) CGFloat cornerRadius; -@property (nonatomic) CGFloat arrowLength; -@property (nonatomic) CGFloat widthPaddingFactor; -@property (nonatomic) CGFloat heightPaddingFactor; - -- (UIColor *)color; -- (void)setColor:(UIColor *)color; -- (UIColor *)opaqueColor; - -- (void)setText:(NSString *)text; -- (void)setImage:(UIImage *)image; - -- (void)setAnimatedColors:(NSArray *)animatedColors withKeyTimes:(NSArray *)keyTimes; - -- (void)setAnimationOffset:(CGFloat)animOffset returnColor:(void (^)(UIColor *opaqueReturnColor))block; - -- (void)setFrame:(CGRect)frame arrowOffset:(CGFloat)arrowOffset; - -- (void)animateBlock:(void (^)(CFTimeInterval duration))block; - -- (void)showAnimated:(BOOL)animated; -- (void)hideAnimated:(BOOL)animated completionBlock:(void (^)())block; - -@end \ No newline at end of file diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValuePopUpView.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValuePopUpView.m deleted file mode 100644 index 12c905b6..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValuePopUpView.m +++ /dev/null @@ -1,328 +0,0 @@ -// -// ASValuePopUpView.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ASValuePopUpView.h" - -@implementation CALayer (ASAnimationAdditions) - -- (void)animateKey:(NSString *)animationName fromValue:(id)fromValue toValue:(id)toValue - customize:(void (^)(CABasicAnimation *animation))block -{ - [self setValue:toValue forKey:animationName]; - CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:animationName]; - anim.fromValue = fromValue ?: [self.presentationLayer valueForKey:animationName]; - anim.toValue = toValue; - if (block) block(anim); - [self addAnimation:anim forKey:animationName]; -} -@end - -NSString *const SliderFillColorAnim = @"fillColor"; - -@implementation ASValuePopUpView -{ - BOOL _shouldAnimate; - CFTimeInterval _animDuration; - - CAShapeLayer *_pathLayer; - - UIImageView *_imageView; - UILabel *_timeLabel; - CGFloat _arrowCenterOffset; - - CAShapeLayer *_colorAnimLayer; -} - -+ (Class)layerClass { - return [CAShapeLayer class]; -} - -// if ivar _shouldAnimate) is YES then return an animation -// otherwise return NSNull (no animation) -- (id )actionForLayer:(CALayer *)layer forKey:(NSString *)key -{ - if (_shouldAnimate) { - CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:key]; - anim.beginTime = CACurrentMediaTime(); - anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - anim.fromValue = [layer.presentationLayer valueForKey:key]; - anim.duration = _animDuration; - return anim; - } else return (id )[NSNull null]; -} - -#pragma mark - public - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - _shouldAnimate = NO; - self.layer.anchorPoint = CGPointMake(0.5, 1); - - self.userInteractionEnabled = NO; - _pathLayer = (CAShapeLayer *)self.layer; // ivar can now be accessed without casting to CAShapeLayer every time - - _cornerRadius = 4.0; - _arrowLength = 13.0; - _widthPaddingFactor = 1.15; - _heightPaddingFactor = 1.1; - - _colorAnimLayer = [CAShapeLayer layer]; - [self.layer addSublayer:_colorAnimLayer]; - - _timeLabel = [[UILabel alloc] init]; - _timeLabel.text = @"10:00"; - _timeLabel.font = [UIFont systemFontOfSize:10.0]; - _timeLabel.textAlignment = NSTextAlignmentCenter; - _timeLabel.textColor = [UIColor whiteColor]; - [self addSubview:_timeLabel]; - - _imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; - [self addSubview:_imageView]; - - } - return self; -} - -- (void)setCornerRadius:(CGFloat)radius -{ - if (_cornerRadius == radius) return; - _cornerRadius = radius; - _pathLayer.path = [self pathForRect:self.bounds withArrowOffset:_arrowCenterOffset].CGPath; - -} - -- (UIColor *)color -{ - return [UIColor colorWithCGColor:[_pathLayer.presentationLayer fillColor]]; -} - -- (void)setColor:(UIColor *)color -{ - _pathLayer.fillColor = color.CGColor; - [_colorAnimLayer removeAnimationForKey:SliderFillColorAnim]; // single color, no animation required -} - -- (UIColor *)opaqueColor -{ - return opaqueUIColorFromCGColor([_colorAnimLayer.presentationLayer fillColor] ?: _pathLayer.fillColor); -} - -- (void)setText:(NSString *)string -{ - _timeLabel.text = string; -} - -- (void)setImage:(UIImage *)image -{ - _imageView.image = image; -} - -// set up an animation, but prevent it from running automatically -// the animation progress will be adjusted manually -- (void)setAnimatedColors:(NSArray *)animatedColors withKeyTimes:(NSArray *)keyTimes -{ - NSMutableArray *cgColors = [NSMutableArray array]; - for (UIColor *col in animatedColors) { - [cgColors addObject:(id)col.CGColor]; - } - - CAKeyframeAnimation *colorAnim = [CAKeyframeAnimation animationWithKeyPath:SliderFillColorAnim]; - colorAnim.keyTimes = keyTimes; - colorAnim.values = cgColors; - colorAnim.fillMode = kCAFillModeBoth; - colorAnim.duration = 1.0; - colorAnim.delegate = self; - - // As the interpolated color values from the presentationLayer are needed immediately - // the animation must be allowed to start to initialize _colorAnimLayer's presentationLayer - // hence the speed is set to min value - then set to zero in 'animationDidStart:' delegate method - _colorAnimLayer.speed = FLT_MIN; - _colorAnimLayer.timeOffset = 0.0; - - [_colorAnimLayer addAnimation:colorAnim forKey:SliderFillColorAnim]; -} - -- (void)setAnimationOffset:(CGFloat)animOffset returnColor:(void (^)(UIColor *opaqueReturnColor))block -{ - if ([_colorAnimLayer animationForKey:SliderFillColorAnim]) { - _colorAnimLayer.timeOffset = animOffset; - _pathLayer.fillColor = [_colorAnimLayer.presentationLayer fillColor]; - block([self opaqueColor]); - } -} - -- (void)setFrame:(CGRect)frame arrowOffset:(CGFloat)arrowOffset -{ - // only redraw path if either the arrowOffset or popUpView size has changed - if (arrowOffset != _arrowCenterOffset || !CGSizeEqualToSize(frame.size, self.frame.size)) { - _pathLayer.path = [self pathForRect:frame withArrowOffset:arrowOffset].CGPath; - } - _arrowCenterOffset = arrowOffset; - - CGFloat anchorX = 0.5+(arrowOffset/CGRectGetWidth(frame)); - self.layer.anchorPoint = CGPointMake(anchorX, 1); - self.layer.position = CGPointMake(CGRectGetMinX(frame) + CGRectGetWidth(frame)*anchorX, 0); - self.layer.bounds = (CGRect){CGPointZero, frame.size}; - -} - -// _shouldAnimate = YES; causes 'actionForLayer:' to return an animation for layer property changes -// call the supplied block, then set _shouldAnimate back to NO -- (void)animateBlock:(void (^)(CFTimeInterval duration))block -{ - _shouldAnimate = YES; - _animDuration = 0.5; - - CAAnimation *anim = [self.layer animationForKey:@"position"]; - if ((anim)) { // if previous animation hasn't finished reduce the time of new animation - CFTimeInterval elapsedTime = MIN(CACurrentMediaTime() - anim.beginTime, anim.duration); - _animDuration = _animDuration * elapsedTime / anim.duration; - } - - block(_animDuration); - _shouldAnimate = NO; -} - -- (void)showAnimated:(BOOL)animated -{ - if (!animated) { - self.layer.opacity = 1.0; - return; - } - - [CATransaction begin]; { - // start the transform animation from scale 0.5, or its current value if it's already running - NSValue *fromValue = [self.layer animationForKey:@"transform"] ? [self.layer.presentationLayer valueForKey:@"transform"] : [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5, 0.5, 1)]; - - [self.layer animateKey:@"transform" fromValue:fromValue toValue:[NSValue valueWithCATransform3D:CATransform3DIdentity] - customize:^(CABasicAnimation *animation) { - animation.duration = 0.4; - animation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.8 :2.5 :0.35 :0.5]; - }]; - - [self.layer animateKey:@"opacity" fromValue:nil toValue:@1.0 customize:^(CABasicAnimation *animation) { - animation.duration = 0.1; - }]; - } [CATransaction commit]; -} - -- (void)hideAnimated:(BOOL)animated completionBlock:(void (^)())block -{ - [CATransaction begin]; { - [CATransaction setCompletionBlock:^{ - block(); - self.layer.transform = CATransform3DIdentity; - }]; - if (animated) { - [self.layer animateKey:@"transform" fromValue:nil - toValue:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5, 0.5, 1)] - customize:^(CABasicAnimation *animation) { - animation.duration = 0.55; - animation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.1 :-2 :0.3 :3]; - }]; - - [self.layer animateKey:@"opacity" fromValue:nil toValue:@0.0 customize:^(CABasicAnimation *animation) { - animation.duration = 0.75; - }]; - } else { // not animated - just set opacity to 0.0 - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - self.layer.opacity = 0.0; - }); - } - } [CATransaction commit]; -} - -#pragma mark - CAAnimation delegate - -// set the speed to zero to freeze the animation and set the offset to the correct value -// the animation can now be updated manually by explicity setting its 'timeOffset' -- (void)animationDidStart:(CAAnimation *)animation -{ - _colorAnimLayer.speed = 0.0; - _colorAnimLayer.timeOffset = [self.delegate currentValueOffset]; - - _pathLayer.fillColor = [_colorAnimLayer.presentationLayer fillColor]; - [self.delegate colorDidUpdate:[self opaqueColor]]; -} - -#pragma mark - private - -- (UIBezierPath *)pathForRect:(CGRect)rect withArrowOffset:(CGFloat)arrowOffset; -{ - if (CGRectEqualToRect(rect, CGRectZero)) return nil; - - rect = (CGRect){CGPointZero, rect.size}; // ensure origin is CGPointZero - - // Create rounded rect - CGRect roundedRect = rect; - roundedRect.size.height -= _arrowLength; - UIBezierPath *popUpPath = [UIBezierPath bezierPathWithRoundedRect:roundedRect cornerRadius:_cornerRadius]; - - // Create arrow path - CGFloat maxX = CGRectGetMaxX(roundedRect); // prevent arrow from extending beyond this point - CGFloat arrowTipX = CGRectGetMidX(rect) + arrowOffset; - CGPoint tip = CGPointMake(arrowTipX, CGRectGetMaxY(rect)); - - CGFloat arrowLength = CGRectGetHeight(roundedRect)/2.0; - CGFloat x = arrowLength * tan(45.0 * M_PI/180); // x = half the length of the base of the arrow - - UIBezierPath *arrowPath = [UIBezierPath bezierPath]; - [arrowPath moveToPoint:tip]; - [arrowPath addLineToPoint:CGPointMake(MAX(arrowTipX - x, 0), CGRectGetMaxY(roundedRect) - arrowLength)]; - [arrowPath addLineToPoint:CGPointMake(MIN(arrowTipX + x, maxX), CGRectGetMaxY(roundedRect) - arrowLength)]; - [arrowPath closePath]; - - [popUpPath appendPath:arrowPath]; - - return popUpPath; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - - CGRect textRect = CGRectMake(self.bounds.origin.x, - 0, - self.bounds.size.width, 13); - _timeLabel.frame = textRect; - CGRect imageReact = CGRectMake(self.bounds.origin.x+5, textRect.size.height+textRect.origin.y, self.bounds.size.width-10, 56); - _imageView.frame = imageReact; -} - -static UIColor* opaqueUIColorFromCGColor(CGColorRef col) -{ - if (col == NULL) return nil; - - const CGFloat *components = CGColorGetComponents(col); - UIColor *color; - if (CGColorGetNumberOfComponents(col) == 2) { - color = [UIColor colorWithWhite:components[0] alpha:1.0]; - } else { - color = [UIColor colorWithRed:components[0] green:components[1] blue:components[2] alpha:1.0]; - } - return color; -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValueTrackingSlider.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValueTrackingSlider.h deleted file mode 100644 index ec76c79c..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValueTrackingSlider.h +++ /dev/null @@ -1,81 +0,0 @@ -// -// ASValueTrackingSlider.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import "ASValuePopUpView.h" - -@protocol ASValueTrackingSliderDelegate; - -@interface ASValueTrackingSlider : UISlider - -// present the popUpView manually, without touch event. -- (void)showPopUpViewAnimated:(BOOL)animated; -// the popUpView will not hide again until you call 'hidePopUpViewAnimated:' -- (void)hidePopUpViewAnimated:(BOOL)animated; - -// setting the value of 'popUpViewColor' overrides 'popUpViewAnimatedColors' and vice versa -// the return value of 'popUpViewColor' is the currently displayed value -// this will vary if 'popUpViewAnimatedColors' is set (see below) -@property (strong, nonatomic) UIColor *popUpViewColor; - -// pass an array of 2 or more UIColors to animate the color change as the slider moves -@property (strong, nonatomic) NSArray *popUpViewAnimatedColors; - -// the above @property distributes the colors evenly across the slider -// to specify the exact position of colors on the slider scale, pass an NSArray of NSNumbers -- (void)setPopUpViewAnimatedColors:(NSArray *)popUpViewAnimatedColors withPositions:(NSArray *)positions; - -@property (strong, nonatomic, readonly) ASValuePopUpView *popUpView; -// cornerRadius of the popUpView, default is 4.0 -@property (nonatomic) CGFloat popUpViewCornerRadius; - -// arrow height of the popUpView, default is 13.0 -@property (nonatomic) CGFloat popUpViewArrowLength; -// width padding factor of the popUpView, default is 1.15 -@property (nonatomic) CGFloat popUpViewWidthPaddingFactor; -// height padding factor of the popUpView, default is 1.1 -@property (nonatomic) CGFloat popUpViewHeightPaddingFactor; - -// changes the left handside of the UISlider track to match current popUpView color -// the track color alpha is always set to 1.0, even if popUpView color is less than 1.0 -@property (nonatomic) BOOL autoAdjustTrackColor; // (default is YES) - -// delegate is only needed when used with a TableView or CollectionView - see below -@property (weak, nonatomic) id delegate; -/** 设置时间 */ -- (void)setText:(NSString *)text; -/** 设置预览图 */ -- (void)setImage:(UIImage *)image; - -@end - -// when embedding an ASValueTrackingSlider inside a TableView or CollectionView -// you need to ensure that the cell it resides in is brought to the front of the view hierarchy -// to prevent the popUpView from being obscured -@protocol ASValueTrackingSliderDelegate -- (void)sliderWillDisplayPopUpView:(ASValueTrackingSlider *)slider; - -@optional -- (void)sliderWillHidePopUpView:(ASValueTrackingSlider *)slider; -- (void)sliderDidHidePopUpView:(ASValueTrackingSlider *)slider; -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValueTrackingSlider.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValueTrackingSlider.m deleted file mode 100644 index 39115588..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ASValueTrackingSlider.m +++ /dev/null @@ -1,387 +0,0 @@ -// -// ASValueTrackingSlider.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ASValueTrackingSlider.h" - -@interface ASValueTrackingSlider() -@property (strong, nonatomic) ASValuePopUpView *popUpView; -@property (nonatomic) BOOL popUpViewAlwaysOn; // default is NO -@end - -@implementation ASValueTrackingSlider -{ - NSNumberFormatter *_numberFormatter; - UIColor *_popUpViewColor; - NSArray *_keyTimes; - CGFloat _valueRange; -} - -#pragma mark - initialization - -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - [self setup]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)coder -{ - self = [super initWithCoder:coder]; - if (self) { - [self setup]; - } - return self; -} - -#pragma mark - public - -- (void)setAutoAdjustTrackColor:(BOOL)autoAdjust -{ - if (_autoAdjustTrackColor == autoAdjust) return; - - _autoAdjustTrackColor = autoAdjust; - - // setMinimumTrackTintColor has been overridden to also set autoAdjustTrackColor to NO - // therefore super's implementation must be called to set minimumTrackTintColor - if (autoAdjust == NO) { - super.minimumTrackTintColor = nil; // sets track to default blue color - } else { - super.minimumTrackTintColor = [self.popUpView opaqueColor]; - } -} - -- (void)setText:(NSString *)text -{ - [self.popUpView setText:text]; -} -- (void)setImage:(UIImage *)image -{ - [self.popUpView setImage:image]; -} - -// return the currently displayed color if possible, otherwise return _popUpViewColor -// if animated colors are set, the color will change each time the slider value changes -- (UIColor *)popUpViewColor -{ - return self.popUpView.color ?: _popUpViewColor; -} - -- (void)setPopUpViewColor:(UIColor *)color -{ - _popUpViewColor = color; - _popUpViewAnimatedColors = nil; // animated colors should be discarded - [self.popUpView setColor:color]; - - if (_autoAdjustTrackColor) { - super.minimumTrackTintColor = [self.popUpView opaqueColor]; - } -} - -- (void)setPopUpViewAnimatedColors:(NSArray *)colors -{ - [self setPopUpViewAnimatedColors:colors withPositions:nil]; -} - -// if 2 or more colors are present, set animated colors -// if only 1 color is present then call 'setPopUpViewColor:' -// if arg is nil then restore previous _popUpViewColor -- (void)setPopUpViewAnimatedColors:(NSArray *)colors withPositions:(NSArray *)positions -{ - if (positions) { - NSAssert([colors count] == [positions count], @"popUpViewAnimatedColors and locations should contain the same number of items"); - } - - _popUpViewAnimatedColors = colors; - _keyTimes = [self keyTimesFromSliderPositions:positions]; - - if ([colors count] >= 2) { - [self.popUpView setAnimatedColors:colors withKeyTimes:_keyTimes]; - } else { - [self setPopUpViewColor:[colors lastObject] ?: _popUpViewColor]; - } -} - -- (void)setPopUpViewCornerRadius:(CGFloat)radius -{ - self.popUpView.cornerRadius = radius; -} - -- (CGFloat)popUpViewCornerRadius -{ - return self.popUpView.cornerRadius; -} - -- (void)setPopUpViewArrowLength:(CGFloat)length -{ - self.popUpView.arrowLength = length; -} - -- (CGFloat)popUpViewArrowLength -{ - return self.popUpView.arrowLength; -} - -- (void)setPopUpViewWidthPaddingFactor:(CGFloat)factor -{ - self.popUpView.widthPaddingFactor = factor; -} - -- (CGFloat)popUpViewWidthPaddingFactor -{ - return self.popUpView.widthPaddingFactor; -} - -- (void)setPopUpViewHeightPaddingFactor:(CGFloat)factor -{ - self.popUpView.heightPaddingFactor = factor; -} - -- (CGFloat)popUpViewHeightPaddingFactor -{ - return self.popUpView.heightPaddingFactor; -} - -// when either the min/max value or number formatter changes, recalculate the popUpView width -- (void)setMaximumValue:(float)maximumValue -{ - [super setMaximumValue:maximumValue]; - _valueRange = self.maximumValue - self.minimumValue; -} - -- (void)setMinimumValue:(float)minimumValue -{ - [super setMinimumValue:minimumValue]; - _valueRange = self.maximumValue - self.minimumValue; -} - -- (void)showPopUpViewAnimated:(BOOL)animated -{ - self.popUpViewAlwaysOn = YES; - [self _showPopUpViewAnimated:animated]; -} - -- (void)hidePopUpViewAnimated:(BOOL)animated -{ - self.popUpViewAlwaysOn = NO; - [self _hidePopUpViewAnimated:animated]; -} - -#pragma mark - ASValuePopUpViewDelegate - -- (void)colorDidUpdate:(UIColor *)opaqueColor -{ - super.minimumTrackTintColor = opaqueColor; -} - -// returns the current offset of UISlider value in the range 0.0 – 1.0 -- (CGFloat)currentValueOffset -{ - return (self.value - self.minimumValue) / _valueRange; -} - -#pragma mark - private - -- (void)setup -{ - _autoAdjustTrackColor = YES; - _valueRange = self.maximumValue - self.minimumValue; - _popUpViewAlwaysOn = NO; - - NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - [formatter setNumberStyle:NSNumberFormatterDecimalStyle]; - [formatter setRoundingMode:NSNumberFormatterRoundHalfUp]; - [formatter setMaximumFractionDigits:2]; - [formatter setMinimumFractionDigits:2]; - _numberFormatter = formatter; - - self.popUpView = [[ASValuePopUpView alloc] initWithFrame:CGRectZero]; - self.popUpViewColor = [UIColor colorWithHue:0.6 saturation:0.6 brightness:0.5 alpha:0.8]; - - self.popUpView.alpha = 0.0; - self.popUpView.delegate = self; - [self addSubview:self.popUpView]; - -} - -// ensure animation restarts if app is closed then becomes active again -- (void)didBecomeActiveNotification:(NSNotification *)note -{ - if (self.popUpViewAnimatedColors) { - [self.popUpView setAnimatedColors:_popUpViewAnimatedColors withKeyTimes:_keyTimes]; - } -} - -- (void)updatePopUpView -{ - CGSize popUpViewSize = CGSizeMake(100, 56 + self.popUpViewArrowLength + 18); - - // calculate the popUpView frame - CGRect thumbRect = [self thumbRect]; - CGFloat thumbW = thumbRect.size.width; - CGFloat thumbH = thumbRect.size.height; - - CGRect popUpRect = CGRectInset(thumbRect, (thumbW - popUpViewSize.width)/2, (thumbH - popUpViewSize.height)/2); - popUpRect.origin.y = thumbRect.origin.y - popUpViewSize.height; - - // determine if popUpRect extends beyond the frame of the progress view - // if so adjust frame and set the center offset of the PopUpView's arrow - CGFloat minOffsetX = CGRectGetMinX(popUpRect); - CGFloat maxOffsetX = CGRectGetMaxX(popUpRect) - CGRectGetWidth(self.bounds); - - CGFloat offset = minOffsetX < 0.0 ? minOffsetX : (maxOffsetX > 0.0 ? maxOffsetX : 0.0); - popUpRect.origin.x -= offset; - - [self.popUpView setFrame:popUpRect arrowOffset:offset]; - -} - -// takes an array of NSNumbers in the range self.minimumValue - self.maximumValue -// returns an array of NSNumbers in the range 0.0 - 1.0 -- (NSArray *)keyTimesFromSliderPositions:(NSArray *)positions -{ - if (!positions) return nil; - - NSMutableArray *keyTimes = [NSMutableArray array]; - for (NSNumber *num in [positions sortedArrayUsingSelector:@selector(compare:)]) { - [keyTimes addObject:@((num.floatValue - self.minimumValue) / _valueRange)]; - } - return keyTimes; -} - -- (CGRect)thumbRect -{ - return [self thumbRectForBounds:self.bounds - trackRect:[self trackRectForBounds:self.bounds] - value:self.value]; -} - -- (void)_showPopUpViewAnimated:(BOOL)animated -{ - if (self.delegate) [self.delegate sliderWillDisplayPopUpView:self]; - [self.popUpView showAnimated:animated]; -} - -- (void)_hidePopUpViewAnimated:(BOOL)animated -{ - if ([self.delegate respondsToSelector:@selector(sliderWillHidePopUpView:)]) { - [self.delegate sliderWillHidePopUpView:self]; - } - [self.popUpView hideAnimated:animated completionBlock:^{ - if ([self.delegate respondsToSelector:@selector(sliderDidHidePopUpView:)]) { - [self.delegate sliderDidHidePopUpView:self]; - } - }]; -} - -#pragma mark - subclassed - --(void)layoutSubviews -{ - [super layoutSubviews]; - [self updatePopUpView]; -} - -- (void)didMoveToWindow -{ - if (!self.window) { // removed from window - cancel notifications - [[NSNotificationCenter defaultCenter] removeObserver:self]; - } - else { // added to window - register notifications - - if (self.popUpViewAnimatedColors) { // restart color animation if needed - [self.popUpView setAnimatedColors:_popUpViewAnimatedColors withKeyTimes:_keyTimes]; - } - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(didBecomeActiveNotification:) - name:UIApplicationDidBecomeActiveNotification - object:nil]; - } -} - -- (void)setValue:(float)value -{ - [super setValue:value]; - [self.popUpView setAnimationOffset:[self currentValueOffset] returnColor:^(UIColor *opaqueReturnColor) { - super.minimumTrackTintColor = opaqueReturnColor; - }]; -} - -- (void)setValue:(float)value animated:(BOOL)animated -{ - if (animated) { - [self.popUpView animateBlock:^(CFTimeInterval duration) { - [UIView animateWithDuration:duration animations:^{ - [super setValue:value animated:animated]; - [self.popUpView setAnimationOffset:[self currentValueOffset] returnColor:^(UIColor *opaqueReturnColor) { - super.minimumTrackTintColor = opaqueReturnColor; - }]; - [self layoutIfNeeded]; - }]; - }]; - } else { - [super setValue:value animated:animated]; - } -} - -- (void)setMinimumTrackTintColor:(UIColor *)color -{ - self.autoAdjustTrackColor = NO; // if a custom value is set then prevent auto coloring - [super setMinimumTrackTintColor:color]; -} - -- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event -{ - BOOL begin = [super beginTrackingWithTouch:touch withEvent:event]; - if (begin && !self.popUpViewAlwaysOn) [self _showPopUpViewAnimated:NO]; - return begin; -} - -- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event -{ - BOOL continueTrack = [super continueTrackingWithTouch:touch withEvent:event]; - if (continueTrack) { - [self.popUpView setAnimationOffset:[self currentValueOffset] returnColor:^(UIColor *opaqueReturnColor) { - super.minimumTrackTintColor = opaqueReturnColor; - }]; - } - return continueTrack; -} - -- (void)cancelTrackingWithEvent:(UIEvent *)event -{ - [super cancelTrackingWithEvent:event]; - if (self.popUpViewAlwaysOn == NO) [self _hidePopUpViewAnimated:NO]; -} - -- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event -{ - [super endTrackingWithTouch:touch withEvent:event]; - if (self.popUpViewAlwaysOn == NO) [self _hidePopUpViewAnimated:NO]; -} - - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIAlertController+ZFPlayerRotation.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIAlertController+ZFPlayerRotation.h deleted file mode 100644 index db3b889d..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIAlertController+ZFPlayerRotation.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// UIAlertController+ZFPlayerRotation.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -@interface UIAlertController (ZFPlayerRotation) - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIAlertController+ZFPlayerRotation.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIAlertController+ZFPlayerRotation.m deleted file mode 100644 index f374e1c2..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIAlertController+ZFPlayerRotation.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// UIAlertController+ZFPlayerRotation.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIAlertController+ZFPlayerRotation.h" - -@implementation UIAlertController (ZFPlayerRotation) - -#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 -- (NSUInteger)supportedInterfaceOrientations; { - return UIInterfaceOrientationMaskAll; -} -#else -- (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskAll; -} -#endif - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIImageView+ZFCache.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIImageView+ZFCache.h deleted file mode 100644 index 3f0505ea..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIImageView+ZFCache.h +++ /dev/null @@ -1,127 +0,0 @@ -// -// UIImageView+ZFCache.h -// Player -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -typedef void (^ZFDownLoadDataCallBack)(NSData *data, NSError *error); -typedef void (^ZFDownloadProgressBlock)(unsigned long long total, unsigned long long current); - -@interface ZFImageDownloader : NSObject - -@property (nonatomic, strong) NSURLSession *session; -@property (nonatomic, strong) NSURLSessionDownloadTask *task; - -@property (nonatomic, assign) unsigned long long totalLength; -@property (nonatomic, assign) unsigned long long currentLength; - -@property (nonatomic, copy) ZFDownloadProgressBlock progressBlock; -@property (nonatomic, copy) ZFDownLoadDataCallBack callbackOnFinished; - -- (void)startDownloadImageWithUrl:(NSString *)url - progress:(ZFDownloadProgressBlock)progress - finished:(ZFDownLoadDataCallBack)finished; - -@end - -typedef void (^ZFImageBlock)(UIImage *image); - -@interface UIImageView (ZFCache) - -/** - * Get/Set the callback block when download the image finished. - * - * @param image The image object from network or from disk. - */ -@property (nonatomic, copy) ZFImageBlock completion; - -/** - * Image downloader - */ -@property (nonatomic, strong) ZFImageDownloader *imageDownloader; - -/** - * Specify the URL to download images fails, the number of retries, the default is 2 - */ -@property (nonatomic, assign) NSUInteger attemptToReloadTimesForFailedURL; - -/** - * Will automatically download to cutting for UIImageView size of image.The default value is NO. - * If set to YES, then the download after a successful store only after cutting the image - */ -@property (nonatomic, assign) BOOL shouldAutoClipImageToViewSize; - -/** - * Set the imageView `image` with an `url` and a placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholderImageName The image name to be set initially, until the image request finishes. - */ -- (void)setImageWithURLString:(NSString *)url placeholderImageName:(NSString *)placeholderImageName; - -/** - * Set the imageView `image` with an `url` and a placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - */ -- (void)setImageWithURLString:(NSString *)url placeholder:(UIImage *)placeholderImage; - -/** - * Set the imageView `image` with an `url`, placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholder The image to be set initially, until the image request finishes. - * @param completion A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)setImageWithURLString:(NSString *)url - placeholder:(UIImage *)placeholderImage - completion:(void (^)(UIImage *image))completion; - -/** - * Set the imageView `image` with an `url`, placeholder. - * - * The download is asynchronous and cached. - * - * @param url The url for the image. - * @param placeholderImageName The image name to be set initially, until the image request finishes. - * @param completion A block called when operation has been completed. This block has no return value - * and takes the requested UIImage as first parameter. In case of error the image parameter - * is nil and the second parameter may contain an NSError. The third parameter is a Boolean - * indicating if the image was retrieved from the local cache or from the network. - * The fourth parameter is the original image url. - */ -- (void)setImageWithURLString:(NSString *)url - placeholderImageName:(NSString *)placeholderImageName - completion:(void (^)(UIImage *image))completion; -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIImageView+ZFCache.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIImageView+ZFCache.m deleted file mode 100644 index 51ce2c6d..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIImageView+ZFCache.m +++ /dev/null @@ -1,424 +0,0 @@ -// -// UIImageView+ZFCache.m -// Player -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIImageView+ZFCache.h" -#import -#import - -@implementation ZFImageDownloader - -- (void)startDownloadImageWithUrl:(NSString *)url - progress:(ZFDownloadProgressBlock)progress - finished:(ZFDownLoadDataCallBack)finished { - self.progressBlock = progress; - self.callbackOnFinished = finished; - - if ([NSURL URLWithString:url] == nil) { - if (finished) { finished(nil, nil); } - return; - } - - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] - cachePolicy:NSURLRequestReturnCacheDataElseLoad - timeoutInterval:60]; - [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; - NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration]; - NSOperationQueue *queue = [[NSOperationQueue alloc]init]; - self.session = [NSURLSession sessionWithConfiguration:config - delegate:self - delegateQueue:queue]; - NSURLSessionDownloadTask *task = [self.session downloadTaskWithRequest:request]; - [task resume]; - self.task = task; -} - -- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location { - NSData *data = [NSData dataWithContentsOfURL:location]; - - if (self.progressBlock) { - self.progressBlock(self.totalLength, self.currentLength); - } - - if (self.callbackOnFinished) { - self.callbackOnFinished(data, nil); - - // 防止重复调用 - self.callbackOnFinished = nil; - } -} - -- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite { - self.currentLength = totalBytesWritten; - self.totalLength = totalBytesExpectedToWrite; - - if (self.progressBlock) { - self.progressBlock(self.totalLength, self.currentLength); - } -} - -- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { - if ([error code] != NSURLErrorCancelled) { - if (self.callbackOnFinished) { - self.callbackOnFinished(nil, error); - } - self.callbackOnFinished = nil; - } -} - -@end - -@interface NSString (md5) - -+ (NSString *)cachedFileNameForKey:(NSString *)key; -+ (NSString *)zf_cachePath; -+ (NSString *)zf_keyForRequest:(NSURLRequest *)request; - -@end - -@implementation NSString (md5) - -+ (NSString *)zf_keyForRequest:(NSURLRequest *)request{ - return request.URL.absoluteString; -} - -+ (NSString *)zf_cachePath { - NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]; - NSString *directoryPath = [NSString stringWithFormat:@"%@/%@/%@",cachePath,@"default",@"com.hackemist.SDWebImageCache.default"]; - return directoryPath; -} - -+ (NSString *)cachedFileNameForKey:(NSString *)key { - const char *str = [key UTF8String]; - if (str == NULL) { - str = ""; - } - unsigned char r[CC_MD5_DIGEST_LENGTH]; - CC_MD5(str, (CC_LONG)strlen(str), r); - NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%@", - r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], - r[11], r[12], r[13], r[14], r[15], [[key pathExtension] isEqualToString:@""] ? @"" : [NSString stringWithFormat:@".%@", [key pathExtension]]]; - - return filename; -} - -@end - -@interface UIApplication (ZFCacheImage) - -@property (nonatomic, strong, readonly) NSMutableDictionary *zf_cacheFaileTimes; - -- (UIImage *)zf_cacheImageForRequest:(NSURLRequest *)request; -- (void)zf_cacheImage:(UIImage *)image forRequest:(NSURLRequest *)request; -- (void)zf_cacheFailRequest:(NSURLRequest *)request; -- (NSUInteger)zf_failTimesForRequest:(NSURLRequest *)request; - -@end - -@implementation UIApplication (ZFCacheImage) - -- (NSMutableDictionary *)zf_cacheFaileTimes { - NSMutableDictionary *dict = objc_getAssociatedObject(self, _cmd); - if (!dict) { - dict = [[NSMutableDictionary alloc] init]; - } - return dict; -} - -- (void)setZf_cacheFaileTimes:(NSMutableDictionary *)zf_cacheFaileTimes -{ - objc_setAssociatedObject(self, @selector(zf_cacheFaileTimes), zf_cacheFaileTimes, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (void)zf_clearCache -{ - [self.zf_cacheFaileTimes removeAllObjects]; - self.zf_cacheFaileTimes = nil; -} - -- (void)zf_clearDiskCaches { - NSString *directoryPath = [NSString zf_cachePath]; - - if ([[NSFileManager defaultManager] fileExistsAtPath:directoryPath isDirectory:nil]) { - dispatch_queue_t ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL); - dispatch_async(ioQueue, ^{ - NSError *error = nil; - [[NSFileManager defaultManager] removeItemAtPath:directoryPath error:&error]; - [[NSFileManager defaultManager] createDirectoryAtPath:directoryPath - withIntermediateDirectories:YES - attributes:nil - error:nil]; - }); - } - - [self zf_clearCache]; -} - -- (UIImage *)zf_cacheImageForRequest:(NSURLRequest *)request { - if (request) { - NSString *directoryPath = [NSString zf_cachePath]; - NSString *path = [NSString stringWithFormat:@"%@/%@", directoryPath, [NSString cachedFileNameForKey:[NSString zf_keyForRequest:request]]]; - return [UIImage imageWithContentsOfFile:path]; - } - return nil; -} - -- (NSUInteger)zf_failTimesForRequest:(NSURLRequest *)request { - NSNumber *faileTimes = [self.zf_cacheFaileTimes objectForKey:[NSString cachedFileNameForKey:[NSString zf_keyForRequest:request]]]; - if (faileTimes && [faileTimes respondsToSelector:@selector(integerValue)]) { - return faileTimes.integerValue; - } - return 0; -} - -- (void)zf_cacheFailRequest:(NSURLRequest *)request { - NSNumber *faileTimes = [self.zf_cacheFaileTimes objectForKey:[NSString cachedFileNameForKey:[NSString zf_keyForRequest:request]]]; - NSUInteger times = 0; - if (faileTimes && [faileTimes respondsToSelector:@selector(integerValue)]) { - times = [faileTimes integerValue]; - } - - times++; - - [self.zf_cacheFaileTimes setObject:@(times) forKey:[NSString cachedFileNameForKey:[NSString zf_keyForRequest:request]]]; -} - -- (void)zf_cacheImage:(UIImage *)image forRequest:(NSURLRequest *)request { - if (!image || !request) { return; } - - NSString *directoryPath = [NSString zf_cachePath]; - - if (![[NSFileManager defaultManager] fileExistsAtPath:directoryPath isDirectory:nil]) { - NSError *error = nil; - [[NSFileManager defaultManager] createDirectoryAtPath:directoryPath - withIntermediateDirectories:YES - attributes:nil - error:&error]; - if (error) { return; } - } - - NSString *path = [NSString stringWithFormat:@"%@/%@", directoryPath, [NSString cachedFileNameForKey:[NSString zf_keyForRequest:request]]]; - NSData *data = UIImagePNGRepresentation(image); - if (data) { - [[NSFileManager defaultManager] createFileAtPath:path contents:data attributes:nil]; - } -} - -@end - - -@implementation UIImageView (ZFCache) - -#pragma mark - getter - -- (ZFImageBlock)completion -{ - return objc_getAssociatedObject(self, _cmd); -} - -- (ZFImageDownloader *)imageDownloader -{ - return objc_getAssociatedObject(self, _cmd); -} - -- (NSUInteger)attemptToReloadTimesForFailedURL -{ - NSUInteger count = [objc_getAssociatedObject(self, _cmd) integerValue]; - if (count == 0) { count = 2; } - return count; -} - -- (BOOL)shouldAutoClipImageToViewSize -{ - return [objc_getAssociatedObject(self, _cmd) boolValue]; -} - -#pragma mark - setter - -- (void)setCompletion:(ZFImageBlock)completion -{ - objc_setAssociatedObject(self, @selector(completion), completion, OBJC_ASSOCIATION_COPY_NONATOMIC); -} - -- (void)setImageDownloader:(ZFImageDownloader *)imageDownloader -{ - objc_setAssociatedObject(self, @selector(imageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (void)setAttemptToReloadTimesForFailedURL:(NSUInteger)attemptToReloadTimesForFailedURL -{ - objc_setAssociatedObject(self, @selector(attemptToReloadTimesForFailedURL), @(attemptToReloadTimesForFailedURL), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (void)setShouldAutoClipImageToViewSize:(BOOL)shouldAutoClipImageToViewSize -{ - objc_setAssociatedObject(self, @selector(shouldAutoClipImageToViewSize), @(shouldAutoClipImageToViewSize), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -#pragma mark - public method - -- (void)setImageWithURLString:(NSString *)url - placeholderImageName:(NSString *)placeholderImageName { - return [self setImageWithURLString:url placeholderImageName:placeholderImageName completion:nil]; -} - -- (void)setImageWithURLString:(NSString *)url placeholder:(UIImage *)placeholderImage { - return [self setImageWithURLString:url placeholder:placeholderImage completion:nil]; -} - -- (void)setImageWithURLString:(NSString *)url - placeholderImageName:(NSString *)placeholderImage - completion:(void (^)(UIImage *image))completion { - NSString *path = [[NSBundle mainBundle] pathForResource:placeholderImage ofType:nil]; - UIImage *image = [UIImage imageWithContentsOfFile:path]; - if (image == nil) { image = [UIImage imageNamed:placeholderImage]; } - - [self setImageWithURLString:url placeholder:image completion:completion]; -} - -- (void)setImageWithURLString:(NSString *)url - placeholder:(UIImage *)placeholderImageName - completion:(void (^)(UIImage *image))completion { - [self.layer removeAllAnimations]; - self.completion = completion; - - if (url == nil || [url isKindOfClass:[NSNull class]] || (![url hasPrefix:@"http://"] && ![url hasPrefix:@"https://"])) { - [self setImage:placeholderImageName isFromCache:YES]; - - if (completion) { - self.completion(self.image); - } - return; - } - - NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; - [self downloadWithReqeust:request holder:placeholderImageName]; -} - -#pragma mark - private method - -- (void)downloadWithReqeust:(NSURLRequest *)theRequest holder:(UIImage *)holder { - UIImage *cachedImage = [[UIApplication sharedApplication] zf_cacheImageForRequest:theRequest]; - - if (cachedImage) { - [self setImage:cachedImage isFromCache:YES]; - if (self.completion) { - self.completion(cachedImage); - } - return; - } - - [self setImage:holder isFromCache:YES]; - - if ([[UIApplication sharedApplication] zf_failTimesForRequest:theRequest] >= self.attemptToReloadTimesForFailedURL) { - return; - } - - [self cancelRequest]; - self.imageDownloader = nil; - - __weak __typeof(self) weakSelf = self; - - self.imageDownloader = [[ZFImageDownloader alloc] init]; - [self.imageDownloader startDownloadImageWithUrl:theRequest.URL.absoluteString progress:nil finished:^(NSData *data, NSError *error) { - // success - if (data != nil && error == nil) { - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - UIImage *image = [UIImage imageWithData:data]; - UIImage *finalImage = image; - - if (image) { - if (weakSelf.shouldAutoClipImageToViewSize) { - // cutting - if (fabs(weakSelf.frame.size.width - image.size.width) != 0 - && fabs(weakSelf.frame.size.height - image.size.height) != 0) { - finalImage = [self clipImage:image toSize:weakSelf.frame.size isScaleToMax:YES]; - } - } - - [[UIApplication sharedApplication] zf_cacheImage:finalImage forRequest:theRequest]; - } else { - [[UIApplication sharedApplication] zf_cacheFailRequest:theRequest]; - } - - dispatch_async(dispatch_get_main_queue(), ^{ - if (finalImage) { - [weakSelf setImage:finalImage isFromCache:NO]; - - if (weakSelf.completion) { - weakSelf.completion(weakSelf.image); - } - } else {// error data - if (weakSelf.completion) { - weakSelf.completion(weakSelf.image); - } - } - }); - }); - } else { // error - [[UIApplication sharedApplication] zf_cacheFailRequest:theRequest]; - - if (weakSelf.completion) { - weakSelf.completion(weakSelf.image); - } - } - }]; -} - -- (void)setImage:(UIImage *)image isFromCache:(BOOL)isFromCache { - self.image = image; - if (!isFromCache) { - CATransition *animation = [CATransition animation]; - [animation setDuration:0.6f]; - [animation setType:kCATransitionFade]; - animation.removedOnCompletion = YES; - [self.layer addAnimation:animation forKey:@"transition"]; - } -} - -- (void)cancelRequest { - [self.imageDownloader.task cancel]; -} - -- (UIImage *)clipImage:(UIImage *)image toSize:(CGSize)size isScaleToMax:(BOOL)isScaleToMax { - CGFloat scale = [UIScreen mainScreen].scale; - - UIGraphicsBeginImageContextWithOptions(size, NO, scale); - - CGSize aspectFitSize = CGSizeZero; - if (image.size.width != 0 && image.size.height != 0) { - CGFloat rateWidth = size.width / image.size.width; - CGFloat rateHeight = size.height / image.size.height; - - CGFloat rate = isScaleToMax ? MAX(rateHeight, rateWidth) : MIN(rateHeight, rateWidth); - aspectFitSize = CGSizeMake(image.size.width * rate, image.size.height * rate); - } - - [image drawInRect:CGRectMake(0, 0, aspectFitSize.width, aspectFitSize.height)]; - UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - return finalImage; -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UINavigationController+ZFPlayerRotation.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UINavigationController+ZFPlayerRotation.h deleted file mode 100644 index 0224ae0e..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UINavigationController+ZFPlayerRotation.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// UINavigationController+ZFPlayerRotation.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -@interface UINavigationController (ZFPlayerRotation) - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UINavigationController+ZFPlayerRotation.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UINavigationController+ZFPlayerRotation.m deleted file mode 100644 index 09c22a88..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UINavigationController+ZFPlayerRotation.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// UINavigationController+ZFPlayerRotation.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UINavigationController+ZFPlayerRotation.h" -#import - -@implementation UINavigationController (ZFPlayerRotation) - -/** - * 如果window的根视图是UINavigationController,则会先调用这个Category,然后调用UIViewController+ZFPlayerRotation - * 只需要在支持除竖屏以外方向的页面重新下边三个方法 - */ - -// 是否支持自动转屏 -- (BOOL)shouldAutorotate { - return [self.topViewController shouldAutorotate]; -} - -// 支持哪些屏幕方向 -- (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return [self.topViewController supportedInterfaceOrientations]; -} - -// 默认的屏幕方向(当前ViewController必须是通过模态出来的UIViewController(模态带导航的无效)方式展现出来的,才会调用这个方法) -- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { - return [self.topViewController preferredInterfaceOrientationForPresentation]; -} - -- (UIViewController *)childViewControllerForStatusBarStyle { - return self.topViewController; -} - -- (UIViewController *)childViewControllerForStatusBarHidden { - return self.topViewController; -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UITabBarController+ZFPlayerRotation.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UITabBarController+ZFPlayerRotation.h deleted file mode 100644 index 22b99600..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UITabBarController+ZFPlayerRotation.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// UITabBarController+ZFPlayerRotation.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -@interface UITabBarController (ZFPlayerRotation) - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UITabBarController+ZFPlayerRotation.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UITabBarController+ZFPlayerRotation.m deleted file mode 100644 index b0543511..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UITabBarController+ZFPlayerRotation.m +++ /dev/null @@ -1,91 +0,0 @@ -// -// UITabBarController+ZFPlayerRotation.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UITabBarController+ZFPlayerRotation.h" -#import - -@implementation UITabBarController (ZFPlayerRotation) - -+ (void)load { - SEL selectors[] = { - @selector(selectedIndex) - }; - - for (NSUInteger index = 0; index < sizeof(selectors) / sizeof(SEL); ++index) { - SEL originalSelector = selectors[index]; - SEL swizzledSelector = NSSelectorFromString([@"zf_" stringByAppendingString:NSStringFromSelector(originalSelector)]); - Method originalMethod = class_getInstanceMethod(self, originalSelector); - Method swizzledMethod = class_getInstanceMethod(self, swizzledSelector); - if (class_addMethod(self, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { - class_replaceMethod(self, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); - } else { - method_exchangeImplementations(originalMethod, swizzledMethod); - } - } -} - -- (NSInteger)zf_selectedIndex { - NSInteger index = [self zf_selectedIndex]; - if (index > self.viewControllers.count) { return 0; } - return index; -} - -/** - * 如果window的根视图是UITabBarController,则会先调用这个Category,然后调用UIViewController+ZFPlayerRotation - * 只需要在支持除竖屏以外方向的页面重新下边三个方法 - */ - -// 是否支持自动转屏 -- (BOOL)shouldAutorotate { - UIViewController *vc = self.viewControllers[self.selectedIndex]; - if ([vc isKindOfClass:[UINavigationController class]]) { - UINavigationController *nav = (UINavigationController *)vc; - return [nav.topViewController shouldAutorotate]; - } else { - return [vc shouldAutorotate]; - } -} - -// 支持哪些屏幕方向 -- (UIInterfaceOrientationMask)supportedInterfaceOrientations { - UIViewController *vc = self.viewControllers[self.selectedIndex]; - if ([vc isKindOfClass:[UINavigationController class]]) { - UINavigationController *nav = (UINavigationController *)vc; - return [nav.topViewController supportedInterfaceOrientations]; - } else { - return [vc supportedInterfaceOrientations]; - } -} - -// 默认的屏幕方向(当前ViewController必须是通过模态出来的UIViewController(模态带导航的无效)方式展现出来的,才会调用这个方法) -- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { - UIViewController *vc = self.viewControllers[self.selectedIndex]; - if ([vc isKindOfClass:[UINavigationController class]]) { - UINavigationController *nav = (UINavigationController *)vc; - return [nav.topViewController preferredInterfaceOrientationForPresentation]; - } else { - return [vc preferredInterfaceOrientationForPresentation]; - } -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIView+CustomControlView.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIView+CustomControlView.h deleted file mode 100644 index 4d3211ec..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIView+CustomControlView.h +++ /dev/null @@ -1,153 +0,0 @@ -// -// UIView+CustomControlView.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import "ZFPlayer.h" - -@interface UIView (CustomControlView) -@property (nonatomic, weak) id delegate; - -/** - * 设置播放模型 - */ -- (void)zf_playerModel:(ZFPlayerModel *)playerModel; - -- (void)zf_playerShowOrHideControlView; -/** - * 显示控制层 - */ -- (void)zf_playerShowControlView; - -/** - * 隐藏控制层*/ -- (void)zf_playerHideControlView; - -/** - * 重置ControlView - */ -- (void)zf_playerResetControlView; - -/** - * 切换分辨率时重置ControlView - */ -- (void)zf_playerResetControlViewForResolution; - -/** - * 取消自动隐藏控制层view - */ -- (void)zf_playerCancelAutoFadeOutControlView; - -/** - * 开始播放(用来隐藏placeholderImageView) - */ -- (void)zf_playerItemPlaying; - -/** - * 播放完了 - */ -- (void)zf_playerPlayEnd; - -/** - * 是否有下载功能 - */ -- (void)zf_playerHasDownloadFunction:(BOOL)sender; - -/** - * 是否有切换分辨率功能 - * @param resolutionArray 分辨率名称的数组 - */ -- (void)zf_playerResolutionArray:(NSArray *)resolutionArray; - -/** - * 播放按钮状态 (播放、暂停状态) - */ -- (void)zf_playerPlayBtnState:(BOOL)state; - -/** - * 锁定屏幕方向按钮状态 - */ -- (void)zf_playerLockBtnState:(BOOL)state; - -/** - * 下载按钮状态 - */ -- (void)zf_playerDownloadBtnState:(BOOL)state; - -/** - * 加载的菊花 - */ -- (void)zf_playerActivity:(BOOL)animated; - -/** - * 设置预览图 - - * @param draggedTime 拖拽的时长 - * @param image 预览图 - */ -- (void)zf_playerDraggedTime:(NSInteger)draggedTime sliderImage:(UIImage *)image; - -/** - * 拖拽快进 快退 - - * @param draggedTime 拖拽的时长 - * @param totalTime 视频总时长 - * @param forawrd 是否是快进 - * @param preview 是否有预览图 - */ -- (void)zf_playerDraggedTime:(NSInteger)draggedTime totalTime:(NSInteger)totalTime isForward:(BOOL)forawrd hasPreview:(BOOL)preview; - -/** - * 滑动调整进度结束结束 - */ -- (void)zf_playerDraggedEnd; - -/** - * 正常播放 - - * @param currentTime 当前播放时长 - * @param totalTime 视频总时长 - * @param value slider的value(0.0~1.0) - */ -- (void)zf_playerCurrentTime:(NSInteger)currentTime totalTime:(NSInteger)totalTime sliderValue:(CGFloat)value; - -/** - * progress显示缓冲进度 - */ -- (void)zf_playerSetProgress:(CGFloat)progress; - -/** - * 视频加载失败 - */ -- (void)zf_playerItemStatusFailed:(NSError *)error; - -/** - * 小屏播放 - */ -- (void)zf_playerBottomShrinkPlay; - -/** - * 在cell播放 - */ -- (void)zf_playerCellPlay; - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIView+CustomControlView.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIView+CustomControlView.m deleted file mode 100644 index a5433f67..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIView+CustomControlView.m +++ /dev/null @@ -1,159 +0,0 @@ -// -// UIView+CustomControlView.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIView+CustomControlView.h" -#import - -@implementation UIView (CustomControlView) - -- (void)setDelegate:(id)delegate { - objc_setAssociatedObject(self, @selector(delegate), delegate, OBJC_ASSOCIATION_ASSIGN); -} - -- (id)delegate { - return objc_getAssociatedObject(self, _cmd); -} - -/** - * 设置播放模型 - */ -- (void)zf_playerModel:(ZFPlayerModel *)playerModel {} - -- (void)zf_playerShowOrHideControlView {} -/** - * 显示top、bottom、lockBtn - */ -- (void)zf_playerShowControlView {} -/** - * 隐藏top、bottom、lockBtn*/ -- (void)zf_playerHideControlView {} - -/** - * 重置ControlView - */ -- (void)zf_playerResetControlView {} - -/** - * 切换分辨率时候调用此方法 - */ -- (void)zf_playerResetControlViewForResolution {} - -/** - * 取消自动隐藏控制层view - */ -- (void)zf_playerCancelAutoFadeOutControlView {} - -/** - * 开始播放(隐藏placeholderImageView) - */ -- (void)zf_playerItemPlaying {} - -/** - * 播放完了 - */ -- (void)zf_playerPlayEnd {} - -/** - * 是否有下载功能 - */ -- (void)zf_playerHasDownloadFunction:(BOOL)sender {} - -/** - * 下载按钮状态 - */ -- (void)zf_playerDownloadBtnState:(BOOL)state {} - -/** - * 是否有切换分辨率功能 - * @param resolutionArray 分辨率名称的数组 - */ -- (void)zf_playerResolutionArray:(NSArray *)resolutionArray {} - -/** - * 播放按钮状态 (播放、暂停状态) - */ -- (void)zf_playerPlayBtnState:(BOOL)state {} - -/** - * 锁定屏幕方向按钮状态 - */ -- (void)zf_playerLockBtnState:(BOOL)state {} - -/** - * 加载的菊花 - */ -- (void)zf_playerActivity:(BOOL)animated {} - -/** - * 设置预览图 - - * @param draggedTime 拖拽的时长 - * @param image 预览图 - */ -- (void)zf_playerDraggedTime:(NSInteger)draggedTime sliderImage:(UIImage *)image {} - -/** - * 拖拽快进 快退 - - * @param draggedTime 拖拽的时长 - * @param totalTime 视频总时长 - * @param forawrd 是否是快进 - * @param preview 是否有预览图 - */ -- (void)zf_playerDraggedTime:(NSInteger)draggedTime totalTime:(NSInteger)totalTime isForward:(BOOL)forawrd hasPreview:(BOOL)preview {} - -/** - * 滑动调整进度结束结束 - */ -- (void)zf_playerDraggedEnd {} - -/** - * 正常播放 - - * @param currentTime 当前播放时长 - * @param totalTime 视频总时长 - * @param value slider的value(0.0~1.0) - */ -- (void)zf_playerCurrentTime:(NSInteger)currentTime totalTime:(NSInteger)totalTime sliderValue:(CGFloat)value {} - -/** - * progress显示缓冲进度 - */ -- (void)zf_playerSetProgress:(CGFloat)progress {} - -/** - * 视频加载失败 - */ -- (void)zf_playerItemStatusFailed:(NSError *)error {} - -/** - * 小屏播放 - */ -- (void)zf_playerBottomShrinkPlay {} - -/** - * 在cell播放 - */ -- (void)zf_playerCellPlay {} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIViewController+ZFPlayerRotation.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIViewController+ZFPlayerRotation.h deleted file mode 100644 index 8b76fab2..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIViewController+ZFPlayerRotation.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// UIViewController+ZFPlayerRotation.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -@interface UIViewController (ZFPlayerRotation) - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIViewController+ZFPlayerRotation.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIViewController+ZFPlayerRotation.m deleted file mode 100644 index 30f98c98..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIViewController+ZFPlayerRotation.m +++ /dev/null @@ -1,55 +0,0 @@ -// -// UIViewController+ZFPlayerRotation.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIViewController+ZFPlayerRotation.h" - -@implementation UIViewController (ZFPlayerRotation) - -/** - * 默认所有都不支持转屏,如需个别页面支持除竖屏外的其他方向,请在viewController重新下边这三个方法 - */ - -// 是否支持自动转屏 -- (BOOL)shouldAutorotate { - return NO; -} - -// 支持哪些屏幕方向 -- (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskPortrait; -} - -// 默认的屏幕方向(当前ViewController必须是通过模态出来的UIViewController(模态带导航的无效)方式展现出来的,才会调用这个方法) -- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { - return UIInterfaceOrientationPortrait; -} - -- (UIStatusBarStyle)preferredStatusBarStyle { - return UIStatusBarStyleDefault; // your own style -} - -- (BOOL)prefersStatusBarHidden { - return NO; // your own visibility code -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIWindow+CurrentViewController.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIWindow+CurrentViewController.h deleted file mode 100755 index c42b040f..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIWindow+CurrentViewController.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// UIWindow+CurrentViewController.h -// Player -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -@interface UIWindow (CurrentViewController) - -/*! - @method currentViewController - - @return Returns the topViewController in stack of topMostController. - */ -+ (UIViewController*)zf_currentViewController; -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIWindow+CurrentViewController.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIWindow+CurrentViewController.m deleted file mode 100755 index 3f81add8..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/Category/UIWindow+CurrentViewController.m +++ /dev/null @@ -1,47 +0,0 @@ -// -// UIWindow+CurrentViewController.m -// Player -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "UIWindow+CurrentViewController.h" - -@implementation UIWindow (CurrentViewController) - -+ (UIViewController*)zf_currentViewController; { - UIWindow *window = [[UIApplication sharedApplication].delegate window]; - UIViewController *topViewController = [window rootViewController]; - while (true) { - if (topViewController.presentedViewController) { - topViewController = topViewController.presentedViewController; - } else if ([topViewController isKindOfClass:[UINavigationController class]] && [(UINavigationController*)topViewController topViewController]) { - topViewController = [(UINavigationController *)topViewController topViewController]; - } else if ([topViewController isKindOfClass:[UITabBarController class]]) { - UITabBarController *tab = (UITabBarController *)topViewController; - topViewController = tab.selectedViewController; - } else { - break; - } - } - return topViewController; -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/MMMaterialDesignSpinner.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/MMMaterialDesignSpinner.h deleted file mode 100755 index 6b92c16f..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/MMMaterialDesignSpinner.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// MMMaterialDesignSpinner.h -// Pods -// -// Created by Michael Maxwell on 12/28/14. -// -// - -#import - -//! Project version number for MMMaterialDesignSpinner. -FOUNDATION_EXPORT double MMMaterialDesignSpinnerVersionNumber; - -//! Project version string for MMMaterialDesignSpinner. -FOUNDATION_EXPORT const unsigned char MMMaterialDesignSpinnerVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - -/** - * A control similar to iOS' UIActivityIndicatorView modeled after Google's Material Design Activity spinner. - */ -@interface MMMaterialDesignSpinner : UIView - -/** Sets the line width of the spinner's circle. */ -@property (nonatomic) CGFloat lineWidth; - -/** Sets whether the view is hidden when not animating. */ -@property (nonatomic) BOOL hidesWhenStopped; - -/** Specifies the timing function to use for the control's animation. Defaults to kCAMediaTimingFunctionEaseInEaseOut */ -@property (nonatomic, strong) CAMediaTimingFunction *timingFunction; - -/** Property indicating whether the view is currently animating. */ -@property (nonatomic, readonly) BOOL isAnimating; - -/** Property indicating the duration of the animation, default is 1.5s. Should be set prior to -[startAnimating] */ -@property (nonatomic, readwrite) NSTimeInterval duration; - -/** - * Convenience function for starting & stopping animation with a boolean variable instead of explicit - * method calls. - * - * @param animate true to start animating, false to stop animating. - @note This method simply calls the startAnimating or stopAnimating methods based on the value of the animate parameter. - */ -- (void)setAnimating:(BOOL)animate; - -/** - * Starts animation of the spinner. - */ -- (void)startAnimating; - -/** - * Stops animation of the spinnner. - */ -- (void)stopAnimating; - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/MMMaterialDesignSpinner.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/MMMaterialDesignSpinner.m deleted file mode 100755 index a7262b08..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/MMMaterialDesignSpinner.m +++ /dev/null @@ -1,201 +0,0 @@ -// -// MMMaterialDesignSpinner.m -// Pods -// -// Created by Michael Maxwell on 12/28/14. -// -// - -#import "MMMaterialDesignSpinner.h" - -static NSString *kMMRingStrokeAnimationKey = @"mmmaterialdesignspinner.stroke"; -static NSString *kMMRingRotationAnimationKey = @"mmmaterialdesignspinner.rotation"; - -@interface MMMaterialDesignSpinner () -@property (nonatomic, readonly) CAShapeLayer *progressLayer; -@property (nonatomic, readwrite) BOOL isAnimating; -@end - -@implementation MMMaterialDesignSpinner - -@synthesize progressLayer=_progressLayer; - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self initialize]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - if (self = [super initWithCoder:aDecoder]) { - [self initialize]; - } - return self; -} - -- (void)awakeFromNib -{ - [super awakeFromNib]; - [self initialize]; -} - -- (void)initialize { - self.duration = 1.5f; - _timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - - [self.layer addSublayer:self.progressLayer]; - - // See comment in resetAnimations on why this notification is used. - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resetAnimations) name:UIApplicationDidBecomeActiveNotification object:nil]; -} - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - - self.progressLayer.frame = CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); - [self updatePath]; -} - -- (void)tintColorDidChange { - [super tintColorDidChange]; - - self.progressLayer.strokeColor = self.tintColor.CGColor; -} - -- (void)resetAnimations { - // If the app goes to the background, returning it to the foreground causes the animation to stop (even though it's not explicitly stopped by our code). Resetting the animation seems to kick it back into gear. - if (self.isAnimating) { - [self stopAnimating]; - [self startAnimating]; - } -} - -- (void)setAnimating:(BOOL)animate { - (animate ? [self startAnimating] : [self stopAnimating]); -} - - - -- (void)startAnimating { - if (self.isAnimating) - return; - - CABasicAnimation *animation = [CABasicAnimation animation]; - animation.keyPath = @"transform.rotation"; - animation.duration = self.duration / 0.375f; - animation.fromValue = @(0.f); - animation.toValue = @(2 * M_PI); - animation.repeatCount = INFINITY; - animation.removedOnCompletion = NO; - [self.progressLayer addAnimation:animation forKey:kMMRingRotationAnimationKey]; - - CABasicAnimation *headAnimation = [CABasicAnimation animation]; - headAnimation.keyPath = @"strokeStart"; - headAnimation.duration = self.duration / 1.5f; - headAnimation.fromValue = @(0.f); - headAnimation.toValue = @(0.25f); - headAnimation.timingFunction = self.timingFunction; - - CABasicAnimation *tailAnimation = [CABasicAnimation animation]; - tailAnimation.keyPath = @"strokeEnd"; - tailAnimation.duration = self.duration / 1.5f; - tailAnimation.fromValue = @(0.f); - tailAnimation.toValue = @(1.f); - tailAnimation.timingFunction = self.timingFunction; - - - CABasicAnimation *endHeadAnimation = [CABasicAnimation animation]; - endHeadAnimation.keyPath = @"strokeStart"; - endHeadAnimation.beginTime = self.duration / 1.5f; - endHeadAnimation.duration = self.duration / 3.0f; - endHeadAnimation.fromValue = @(0.25f); - endHeadAnimation.toValue = @(1.f); - endHeadAnimation.timingFunction = self.timingFunction; - - CABasicAnimation *endTailAnimation = [CABasicAnimation animation]; - endTailAnimation.keyPath = @"strokeEnd"; - endTailAnimation.beginTime = self.duration / 1.5f; - endTailAnimation.duration = self.duration / 3.0f; - endTailAnimation.fromValue = @(1.f); - endTailAnimation.toValue = @(1.f); - endTailAnimation.timingFunction = self.timingFunction; - - CAAnimationGroup *animations = [CAAnimationGroup animation]; - [animations setDuration:self.duration]; - [animations setAnimations:@[headAnimation, tailAnimation, endHeadAnimation, endTailAnimation]]; - animations.repeatCount = INFINITY; - animations.removedOnCompletion = NO; - [self.progressLayer addAnimation:animations forKey:kMMRingStrokeAnimationKey]; - - - self.isAnimating = true; - - if (self.hidesWhenStopped) { - self.hidden = NO; - } -} - -- (void)stopAnimating { - if (!self.isAnimating) - return; - - [self.progressLayer removeAnimationForKey:kMMRingRotationAnimationKey]; - [self.progressLayer removeAnimationForKey:kMMRingStrokeAnimationKey]; - self.isAnimating = false; - - if (self.hidesWhenStopped) { - self.hidden = YES; - } -} - -#pragma mark - Private - -- (void)updatePath { - CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); - CGFloat radius = MIN(CGRectGetWidth(self.bounds) / 2, CGRectGetHeight(self.bounds) / 2) - self.progressLayer.lineWidth / 2; - CGFloat startAngle = (CGFloat)(0); - CGFloat endAngle = (CGFloat)(2*M_PI); - UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES]; - self.progressLayer.path = path.CGPath; - - self.progressLayer.strokeStart = 0.f; - self.progressLayer.strokeEnd = 0.f; -} - -#pragma mark - Properties - -- (CAShapeLayer *)progressLayer { - if (!_progressLayer) { - _progressLayer = [CAShapeLayer layer]; - _progressLayer.strokeColor = self.tintColor.CGColor; - _progressLayer.fillColor = nil; - _progressLayer.lineWidth = 1.5f; - } - return _progressLayer; -} - -- (BOOL)isAnimating { - return _isAnimating; -} - -- (CGFloat)lineWidth { - return self.progressLayer.lineWidth; -} - -- (void)setLineWidth:(CGFloat)lineWidth { - self.progressLayer.lineWidth = lineWidth; - [self updatePath]; -} - -- (void)setHidesWhenStopped:(BOOL)hidesWhenStopped { - _hidesWhenStopped = hidesWhenStopped; - self.hidden = !self.isAnimating && hidesWhenStopped; -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFBrightnessView.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFBrightnessView.h deleted file mode 100755 index 66d0df65..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFBrightnessView.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// ZFBrightnessView.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -@interface ZFBrightnessView : UIView - -/** 调用单例记录播放状态是否锁定屏幕方向*/ -@property (nonatomic, assign) BOOL isLockScreen; -/** 是否允许横屏,来控制只有竖屏的状态*/ -@property (nonatomic, assign) BOOL isAllowLandscape; -@property (nonatomic, assign) BOOL isStatusBarHidden; -/** 是否是横屏状态 */ -@property (nonatomic, assign) BOOL isLandscape; -+ (instancetype)sharedBrightnessView; - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFBrightnessView.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFBrightnessView.m deleted file mode 100755 index 17c8bdb5..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFBrightnessView.m +++ /dev/null @@ -1,197 +0,0 @@ -// -// ZFBrightnessView.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFBrightnessView.h" -#import "ZFPlayer.h" - -@interface ZFBrightnessView () - -@property (nonatomic, strong) UIImageView *backImage; -@property (nonatomic, strong) UILabel *title; -@property (nonatomic, strong) UIView *longView; -@property (nonatomic, strong) NSMutableArray *tipArray; -@property (nonatomic, assign) BOOL orientationDidChange; - -@end - -@implementation ZFBrightnessView - -+ (instancetype)sharedBrightnessView { - static ZFBrightnessView *instance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [[ZFBrightnessView alloc] init]; - [[UIApplication sharedApplication].keyWindow addSubview:instance]; - }); - return instance; -} - -- (instancetype)init { - if (self = [super init]) { - self.frame = CGRectMake(ScreenWidth * 0.5, ScreenHeight * 0.5, 155, 155); - - self.layer.cornerRadius = 10; - self.layer.masksToBounds = YES; - - // 使用UIToolbar实现毛玻璃效果,简单粗暴,支持iOS7+ - UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:self.bounds]; - toolbar.alpha = 0.97; - [self addSubview:toolbar]; - - self.backImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 79, 76)]; - self.backImage.image = ZFPlayerImage(@"ZFPlayer_brightness"); - [self addSubview:self.backImage]; - - self.title = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, self.bounds.size.width, 30)]; - self.title.font = [UIFont boldSystemFontOfSize:16]; - self.title.textColor = [UIColor colorWithRed:0.25f green:0.22f blue:0.21f alpha:1.00f]; - self.title.textAlignment = NSTextAlignmentCenter; - self.title.text = @"亮度"; - [self addSubview:self.title]; - - self.longView = [[UIView alloc]initWithFrame:CGRectMake(13, 132, self.bounds.size.width - 26, 7)]; - self.longView.backgroundColor = [UIColor colorWithRed:0.25f green:0.22f blue:0.21f alpha:1.00f]; - [self addSubview:self.longView]; - - [self createTips]; - [self addNotification]; - [self addObserver]; - - self.alpha = 0.0; - } - return self; -} - -// 创建 Tips -- (void)createTips { - - self.tipArray = [NSMutableArray arrayWithCapacity:16]; - - CGFloat tipW = (self.longView.bounds.size.width - 17) / 16; - CGFloat tipH = 5; - CGFloat tipY = 1; - - for (int i = 0; i < 16; i++) { - CGFloat tipX = i * (tipW + 1) + 1; - UIImageView *image = [[UIImageView alloc] init]; - image.backgroundColor = [UIColor whiteColor]; - image.frame = CGRectMake(tipX, tipY, tipW, tipH); - [self.longView addSubview:image]; - [self.tipArray addObject:image]; - } - [self updateLongView:[UIScreen mainScreen].brightness]; -} - -#pragma makr - 通知 KVO - -- (void)addNotification { - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(updateLayer:) - name:UIDeviceOrientationDidChangeNotification - object:nil]; -} - -- (void)addObserver { - - [[UIScreen mainScreen] addObserver:self - forKeyPath:@"brightness" - options:NSKeyValueObservingOptionNew context:NULL]; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(NSDictionary *)change - context:(void *)context { - - CGFloat sound = [change[@"new"] floatValue]; - [self appearSoundView]; - [self updateLongView:sound]; -} - -- (void)updateLayer:(NSNotification *)notify { - self.orientationDidChange = YES; - [self setNeedsLayout]; - [self layoutIfNeeded]; -} - -#pragma mark - Methond - -- (void)appearSoundView { - if (self.alpha == 0.0) { - self.orientationDidChange = NO; - self.alpha = 1.0; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self disAppearSoundView]; - }); - } -} - -- (void)disAppearSoundView { - - if (self.alpha == 1.0) { - [UIView animateWithDuration:0.8 animations:^{ - self.alpha = 0.0; - }]; - } -} - -#pragma mark - Update View - -- (void)updateLongView:(CGFloat)sound { - CGFloat stage = 1 / 15.0; - NSInteger level = sound / stage; - - for (int i = 0; i < self.tipArray.count; i++) { - UIImageView *img = self.tipArray[i]; - - if (i <= level) { - img.hidden = NO; - } else { - img.hidden = YES; - } - } -} - -- (void)layoutSubviews { - [super layoutSubviews]; - self.backImage.center = CGPointMake(155 * 0.5, 155 * 0.5); - self.center = CGPointMake(ScreenWidth * 0.5, ScreenHeight * 0.5); -} - -- (void)dealloc { - [[UIScreen mainScreen] removeObserver:self forKeyPath:@"brightness"]; - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)setIsStatusBarHidden:(BOOL)isStatusBarHidden { - _isStatusBarHidden = isStatusBarHidden; - [[UIWindow zf_currentViewController] setNeedsStatusBarAppearanceUpdate]; -} - -- (void)setIsLandscape:(BOOL)isLandscape { - _isLandscape = isLandscape; - [[UIWindow zf_currentViewController] setNeedsStatusBarAppearanceUpdate]; -} - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_back_full@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_back_full@2x.png deleted file mode 100644 index b6ae8afd..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_back_full@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_back_full@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_back_full@3x.png deleted file mode 100644 index e0a0d1a8..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_back_full@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_bottom_shadow.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_bottom_shadow.png deleted file mode 100644 index e67cb360..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_bottom_shadow.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_brightness@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_brightness@2x.png deleted file mode 100644 index 9782a11a..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_brightness@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close.png deleted file mode 100644 index 26a893a2..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close@2x.png deleted file mode 100644 index 80ab29f1..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close@3x.png deleted file mode 100644 index 95c6484f..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_close@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_download@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_download@2x.png deleted file mode 100644 index 50889fdc..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_download@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_download@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_download@3x.png deleted file mode 100644 index 2b4c9f1f..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_download@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_backward@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_backward@2x.png deleted file mode 100644 index a2f7d330..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_backward@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_backward@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_backward@3x.png deleted file mode 100644 index 1f4e89ba..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_backward@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_forward@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_forward@2x.png deleted file mode 100644 index d6d5dd51..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_forward@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_forward@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_forward@3x.png deleted file mode 100644 index 0f313be3..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fast_forward@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen.png deleted file mode 100644 index ced952bb..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen@2x.png deleted file mode 100644 index 769afae7..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen@3x.png deleted file mode 100644 index c68b2cea..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_fullscreen@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_loading_bgView.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_loading_bgView.png deleted file mode 100644 index dee2706a..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_loading_bgView.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_lock-nor@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_lock-nor@2x.png deleted file mode 100644 index 91304b97..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_lock-nor@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_lock-nor@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_lock-nor@3x.png deleted file mode 100644 index 0d516986..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_lock-nor@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_not_download@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_not_download@2x.png deleted file mode 100644 index 5527b2f9..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_not_download@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_not_download@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_not_download@3x.png deleted file mode 100644 index 39fc62f9..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_not_download@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause.png deleted file mode 100644 index 89932e0c..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause@2x.png deleted file mode 100644 index b82c0985..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause@3x.png deleted file mode 100644 index 3e47c077..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_pause@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play@2x.png deleted file mode 100644 index 3ca0ae47..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play@3x.png deleted file mode 100644 index ee7df9ee..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play_btn@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play_btn@2x.png deleted file mode 100644 index 76472b4c..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_play_btn@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video.png deleted file mode 100644 index 5f8b764f..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video@2x.png deleted file mode 100644 index a9c83025..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video@3x.png deleted file mode 100644 index d5726e83..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_repeat_video@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen.png deleted file mode 100644 index 74815d96..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen@2x.png deleted file mode 100644 index 45274a4d..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen@3x.png deleted file mode 100644 index e83f58ca..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_shrinkscreen@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider.png deleted file mode 100644 index f3aa3ab1..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider@2x.png deleted file mode 100644 index 7c126639..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider@3x.png deleted file mode 100644 index 62020521..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_slider@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_top_shadow.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_top_shadow.png deleted file mode 100644 index 1a3cfd21..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_top_shadow.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_unlock-nor@2x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_unlock-nor@2x.png deleted file mode 100644 index d6a2c98d..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_unlock-nor@2x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_unlock-nor@3x.png b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_unlock-nor@3x.png deleted file mode 100644 index 1d1f46c7..00000000 Binary files a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.bundle/ZFPlayer_unlock-nor@3x.png and /dev/null differ diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.h deleted file mode 100644 index b936408c..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayer.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// ZFPlayer.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#define iPhone4s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO) -// 监听TableView的contentOffset -#define kZFPlayerViewContentOffset @"contentOffset" -// player的单例 -#define ZFPlayerShared [ZFBrightnessView sharedBrightnessView] -// 屏幕的宽 -#define ScreenWidth [[UIScreen mainScreen] bounds].size.width -// 屏幕的高 -#define ScreenHeight [[UIScreen mainScreen] bounds].size.height -// 颜色值RGB -#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a] -// 图片路径 -#define ZFPlayerSrcName(file) [@"ZFPlayer.bundle" stringByAppendingPathComponent:file] - -#define ZFPlayerFrameworkSrcName(file) [@"Frameworks/ZFPlayer.framework/ZFPlayer.bundle" stringByAppendingPathComponent:file] - -#define ZFPlayerImage(file) [UIImage imageNamed:ZFPlayerSrcName(file)] ? :[UIImage imageNamed:ZFPlayerFrameworkSrcName(file)] - -#define ZFPlayerOrientationIsLandscape UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) - -#define ZFPlayerOrientationIsPortrait UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation) - - -#import "ZFPlayerView.h" -#import "ZFPlayerModel.h" -#import "ZFPlayerControlView.h" -#import "ZFBrightnessView.h" -#import "UITabBarController+ZFPlayerRotation.h" -#import "UIViewController+ZFPlayerRotation.h" -#import "UINavigationController+ZFPlayerRotation.h" -#import "UIImageView+ZFCache.h" -#import "UIWindow+CurrentViewController.h" -#import "ZFPlayerControlViewDelegate.h" -#import diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlView.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlView.h deleted file mode 100755 index bf937f1f..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlView.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// ZFPlayerControlView.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import "ASValueTrackingSlider.h" -#import "ZFPlayer.h" - -@interface ZFPlayerControlView : UIView - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlView.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlView.m deleted file mode 100755 index 7f5e556a..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlView.m +++ /dev/null @@ -1,1162 +0,0 @@ -// -// ZFPlayerControlView.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFPlayerControlView.h" -#import -#import -#import "UIView+CustomControlView.h" -#import "MMMaterialDesignSpinner.h" - -#pragma clang diagnostic push -#pragma clang diagnostic ignored"-Wdeprecated-declarations" - -static const CGFloat ZFPlayerAnimationTimeInterval = 7.0f; -static const CGFloat ZFPlayerControlBarAutoFadeOutTimeInterval = 0.35f; - -@interface ZFPlayerControlView () - -/** 标题 */ -@property (nonatomic, strong) UILabel *titleLabel; -/** 开始播放按钮 */ -@property (nonatomic, strong) UIButton *startBtn; -/** 当前播放时长label */ -@property (nonatomic, strong) UILabel *currentTimeLabel; -/** 视频总时长label */ -@property (nonatomic, strong) UILabel *totalTimeLabel; -/** 缓冲进度条 */ -@property (nonatomic, strong) UIProgressView *progressView; -/** 滑杆 */ -@property (nonatomic, strong) ASValueTrackingSlider *videoSlider; -/** 全屏按钮 */ -@property (nonatomic, strong) UIButton *fullScreenBtn; -/** 锁定屏幕方向按钮 */ -@property (nonatomic, strong) UIButton *lockBtn; -/** 系统菊花 */ -@property (nonatomic, strong) MMMaterialDesignSpinner *activity; -/** 返回按钮*/ -@property (nonatomic, strong) UIButton *backBtn; -/** 关闭按钮*/ -@property (nonatomic, strong) UIButton *closeBtn; -/** 重播按钮 */ -@property (nonatomic, strong) UIButton *repeatBtn; -/** bottomView*/ -@property (nonatomic, strong) UIImageView *bottomImageView; -/** topView */ -@property (nonatomic, strong) UIImageView *topImageView; -/** 缓存按钮 */ -@property (nonatomic, strong) UIButton *downLoadBtn; -/** 切换分辨率按钮 */ -@property (nonatomic, strong) UIButton *resolutionBtn; -/** 分辨率的View */ -@property (nonatomic, strong) UIView *resolutionView; -/** 播放按钮 */ -@property (nonatomic, strong) UIButton *playeBtn; -/** 加载失败按钮 */ -@property (nonatomic, strong) UIButton *failBtn; -/** 快进快退View*/ -@property (nonatomic, strong) UIView *fastView; -/** 快进快退进度progress*/ -@property (nonatomic, strong) UIProgressView *fastProgressView; -/** 快进快退时间*/ -@property (nonatomic, strong) UILabel *fastTimeLabel; -/** 快进快退ImageView*/ -@property (nonatomic, strong) UIImageView *fastImageView; -/** 当前选中的分辨率btn按钮 */ -@property (nonatomic, weak ) UIButton *resoultionCurrentBtn; -/** 占位图 */ -@property (nonatomic, strong) UIImageView *placeholderImageView; -/** 控制层消失时候在底部显示的播放进度progress */ -@property (nonatomic, strong) UIProgressView *bottomProgressView; -/** 分辨率的名称 */ -@property (nonatomic, strong) NSArray *resolutionArray; - -/** 显示控制层 */ -@property (nonatomic, assign, getter=isShowing) BOOL showing; -/** 小屏播放 */ -@property (nonatomic, assign, getter=isShrink ) BOOL shrink; -/** 在cell上播放 */ -@property (nonatomic, assign, getter=isCellVideo)BOOL cellVideo; -/** 是否拖拽slider控制播放进度 */ -@property (nonatomic, assign, getter=isDragged) BOOL dragged; -/** 是否播放结束 */ -@property (nonatomic, assign, getter=isPlayEnd) BOOL playeEnd; -/** 是否全屏播放 */ -@property (nonatomic, assign,getter=isFullScreen)BOOL fullScreen; - -@end - -@implementation ZFPlayerControlView - -- (instancetype)init { - self = [super init]; - if (self) { - - [self addSubview:self.placeholderImageView]; - [self addSubview:self.topImageView]; - [self addSubview:self.bottomImageView]; - [self.bottomImageView addSubview:self.startBtn]; - [self.bottomImageView addSubview:self.currentTimeLabel]; - [self.bottomImageView addSubview:self.progressView]; - [self.bottomImageView addSubview:self.videoSlider]; - [self.bottomImageView addSubview:self.fullScreenBtn]; - [self.bottomImageView addSubview:self.totalTimeLabel]; - - [self.topImageView addSubview:self.downLoadBtn]; - [self addSubview:self.lockBtn]; - [self.topImageView addSubview:self.backBtn]; - [self addSubview:self.activity]; - [self addSubview:self.repeatBtn]; - [self addSubview:self.playeBtn]; - [self addSubview:self.failBtn]; - - [self addSubview:self.fastView]; - [self.fastView addSubview:self.fastImageView]; - [self.fastView addSubview:self.fastTimeLabel]; - [self.fastView addSubview:self.fastProgressView]; - - [self.topImageView addSubview:self.resolutionBtn]; - [self.topImageView addSubview:self.titleLabel]; - [self addSubview:self.closeBtn]; - [self addSubview:self.bottomProgressView]; - - // 添加子控件的约束 - [self makeSubViewsConstraints]; - - self.downLoadBtn.hidden = YES; - self.resolutionBtn.hidden = YES; - // 初始化时重置controlView - [self zf_playerResetControlView]; - // app退到后台 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground) name:UIApplicationWillResignActiveNotification object:nil]; - // app进入前台 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterPlayground) name:UIApplicationDidBecomeActiveNotification object:nil]; - - [self listeningRotating]; - } - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; -} - -- (void)makeSubViewsConstraints { - [self.placeholderImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(UIEdgeInsetsZero); - }]; - - [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.equalTo(self.mas_trailing).offset(7); - make.top.equalTo(self.mas_top).offset(-7); - make.width.height.mas_equalTo(20); - }]; - - [self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self); - make.top.equalTo(self.mas_top).offset(0); - make.height.mas_equalTo(50); - }]; - - [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.topImageView.mas_leading).offset(10); - make.top.equalTo(self.topImageView.mas_top).offset(3); - make.width.height.mas_equalTo(40); - }]; - - [self.downLoadBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(40); - make.height.mas_equalTo(49); - make.trailing.equalTo(self.topImageView.mas_trailing).offset(-10); - make.centerY.equalTo(self.backBtn.mas_centerY); - }]; - - [self.resolutionBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(40); - make.height.mas_equalTo(25); - make.trailing.equalTo(self.downLoadBtn.mas_leading).offset(-10); - make.centerY.equalTo(self.backBtn.mas_centerY); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.backBtn.mas_trailing).offset(5); - make.centerY.equalTo(self.backBtn.mas_centerY); - make.trailing.equalTo(self.resolutionBtn.mas_leading).offset(-10); - }]; - - [self.bottomImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.bottom.mas_equalTo(0); - make.height.mas_equalTo(50); - }]; - - [self.startBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.bottomImageView.mas_leading).offset(5); - make.bottom.equalTo(self.bottomImageView.mas_bottom).offset(-5); - make.width.height.mas_equalTo(30); - }]; - - [self.currentTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.startBtn.mas_trailing).offset(-3); - make.centerY.equalTo(self.startBtn.mas_centerY); - make.width.mas_equalTo(43); - }]; - - [self.fullScreenBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(30); - make.trailing.equalTo(self.bottomImageView.mas_trailing).offset(-5); - make.centerY.equalTo(self.startBtn.mas_centerY); - }]; - - [self.totalTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.equalTo(self.fullScreenBtn.mas_leading).offset(3); - make.centerY.equalTo(self.startBtn.mas_centerY); - make.width.mas_equalTo(43); - }]; - - [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.currentTimeLabel.mas_trailing).offset(4); - make.trailing.equalTo(self.totalTimeLabel.mas_leading).offset(-4); - make.centerY.equalTo(self.startBtn.mas_centerY); - }]; - - [self.videoSlider mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.currentTimeLabel.mas_trailing).offset(4); - make.trailing.equalTo(self.totalTimeLabel.mas_leading).offset(-4); - make.centerY.equalTo(self.currentTimeLabel.mas_centerY).offset(-1); - make.height.mas_equalTo(30); - }]; - - [self.lockBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.equalTo(self.mas_leading).offset(15); - make.centerY.equalTo(self.mas_centerY); - make.width.height.mas_equalTo(32); - }]; - - [self.repeatBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self); - }]; - - [self.playeBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(50); - make.center.equalTo(self); - }]; - - [self.activity mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self); - make.width.with.height.mas_equalTo(45); - }]; - - [self.failBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self); - make.width.mas_equalTo(130); - make.height.mas_equalTo(33); - }]; - - [self.fastView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(125); - make.height.mas_equalTo(80); - make.center.equalTo(self); - }]; - - [self.fastImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_offset(32); - make.height.mas_offset(32); - make.top.mas_equalTo(5); - make.centerX.mas_equalTo(self.fastView.mas_centerX); - }]; - - [self.fastTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.with.trailing.mas_equalTo(0); - make.top.mas_equalTo(self.fastImageView.mas_bottom).offset(2); - }]; - - [self.fastProgressView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(12); - make.trailing.mas_equalTo(-12); - make.top.mas_equalTo(self.fastTimeLabel.mas_bottom).offset(10); - }]; - - [self.bottomProgressView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_offset(0); - make.bottom.mas_offset(0); - }]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - - UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation; - if (currentOrientation == UIDeviceOrientationPortrait) { - [self setOrientationPortraitConstraint]; - } else { - [self setOrientationLandscapeConstraint]; - } -} - -#pragma mark - Action - -/** - * 点击切换分别率按钮 - */ -- (void)changeResolution:(UIButton *)sender { - sender.selected = YES; - if (sender.isSelected) { - sender.backgroundColor = RGBA(86, 143, 232, 1); - } else { - sender.backgroundColor = [UIColor clearColor]; - } - self.resoultionCurrentBtn.selected = NO; - self.resoultionCurrentBtn.backgroundColor = [UIColor clearColor]; - self.resoultionCurrentBtn = sender; - // 隐藏分辨率View - self.resolutionView.hidden = YES; - // 分辨率Btn改为normal状态 - self.resolutionBtn.selected = NO; - // topImageView上的按钮的文字 - [self.resolutionBtn setTitle:sender.titleLabel.text forState:UIControlStateNormal]; - if ([self.delegate respondsToSelector:@selector(zf_controlView:resolutionAction:)]) { - [self.delegate zf_controlView:self resolutionAction:sender]; - } -} - -/** - * UISlider TapAction - */ -- (void)tapSliderAction:(UITapGestureRecognizer *)tap { - if ([tap.view isKindOfClass:[UISlider class]]) { - UISlider *slider = (UISlider *)tap.view; - CGPoint point = [tap locationInView:slider]; - CGFloat length = slider.frame.size.width; - // 视频跳转的value - CGFloat tapValue = point.x / length; - if ([self.delegate respondsToSelector:@selector(zf_controlView:progressSliderTap:)]) { - [self.delegate zf_controlView:self progressSliderTap:tapValue]; - } - } -} -// 不做处理,只是为了滑动slider其他地方不响应其他手势 -- (void)panRecognizer:(UIPanGestureRecognizer *)sender {} - -- (void)backBtnClick:(UIButton *)sender { - // 状态条的方向旋转的方向,来判断当前屏幕的方向 - UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; - // 在cell上并且是竖屏时候响应关闭事件 - if (self.isCellVideo && orientation == UIInterfaceOrientationPortrait) { - if ([self.delegate respondsToSelector:@selector(zf_controlView:closeAction:)]) { - [self.delegate zf_controlView:self closeAction:sender]; - } - } else { - if ([self.delegate respondsToSelector:@selector(zf_controlView:backAction:)]) { - [self.delegate zf_controlView:self backAction:sender]; - } - } -} - -- (void)lockScrrenBtnClick:(UIButton *)sender { - sender.selected = !sender.selected; - self.showing = NO; - [self zf_playerShowControlView]; - if ([self.delegate respondsToSelector:@selector(zf_controlView:lockScreenAction:)]) { - [self.delegate zf_controlView:self lockScreenAction:sender]; - } -} - -- (void)playBtnClick:(UIButton *)sender { - sender.selected = !sender.selected; - if ([self.delegate respondsToSelector:@selector(zf_controlView:playAction:)]) { - [self.delegate zf_controlView:self playAction:sender]; - } -} - -- (void)closeBtnClick:(UIButton *)sender { - if ([self.delegate respondsToSelector:@selector(zf_controlView:closeAction:)]) { - [self.delegate zf_controlView:self closeAction:sender]; - } -} - -- (void)fullScreenBtnClick:(UIButton *)sender { - sender.selected = !sender.selected; - if ([self.delegate respondsToSelector:@selector(zf_controlView:fullScreenAction:)]) { - [self.delegate zf_controlView:self fullScreenAction:sender]; - } -} - -- (void)repeatBtnClick:(UIButton *)sender { - // 重置控制层View - [self zf_playerResetControlView]; - [self zf_playerShowControlView]; - if ([self.delegate respondsToSelector:@selector(zf_controlView:repeatPlayAction:)]) { - [self.delegate zf_controlView:self repeatPlayAction:sender]; - } -} - -- (void)downloadBtnClick:(UIButton *)sender { - if ([self.delegate respondsToSelector:@selector(zf_controlView:downloadVideoAction:)]) { - [self.delegate zf_controlView:self downloadVideoAction:sender]; - } -} - -- (void)resolutionBtnClick:(UIButton *)sender { - sender.selected = !sender.selected; - // 显示隐藏分辨率View - self.resolutionView.hidden = !sender.isSelected; -} - -- (void)centerPlayBtnClick:(UIButton *)sender { - if ([self.delegate respondsToSelector:@selector(zf_controlView:cneterPlayAction:)]) { - [self.delegate zf_controlView:self cneterPlayAction:sender]; - } -} - -- (void)failBtnClick:(UIButton *)sender { - self.failBtn.hidden = YES; - if ([self.delegate respondsToSelector:@selector(zf_controlView:failAction:)]) { - [self.delegate zf_controlView:self failAction:sender]; - } -} - -- (void)progressSliderTouchBegan:(ASValueTrackingSlider *)sender { - [self zf_playerCancelAutoFadeOutControlView]; - self.videoSlider.popUpView.hidden = YES; - if ([self.delegate respondsToSelector:@selector(zf_controlView:progressSliderTouchBegan:)]) { - [self.delegate zf_controlView:self progressSliderTouchBegan:sender]; - } -} - -- (void)progressSliderValueChanged:(ASValueTrackingSlider *)sender { - if ([self.delegate respondsToSelector:@selector(zf_controlView:progressSliderValueChanged:)]) { - [self.delegate zf_controlView:self progressSliderValueChanged:sender]; - } -} - -- (void)progressSliderTouchEnded:(ASValueTrackingSlider *)sender { - self.showing = YES; - if ([self.delegate respondsToSelector:@selector(zf_controlView:progressSliderTouchEnded:)]) { - [self.delegate zf_controlView:self progressSliderTouchEnded:sender]; - } -} - -/** - * 应用退到后台 - */ -- (void)appDidEnterBackground { - [self zf_playerCancelAutoFadeOutControlView]; -} - -/** - * 应用进入前台 - */ -- (void)appDidEnterPlayground { - if (!self.isShrink) { [self zf_playerShowControlView]; } -} - -- (void)playerPlayDidEnd { - self.backgroundColor = RGBA(0, 0, 0, .6); - self.repeatBtn.hidden = NO; - // 初始化显示controlView为YES - self.showing = NO; - // 延迟隐藏controlView - [self zf_playerShowControlView]; -} - -/** - * 屏幕方向发生变化会调用这里 - */ -- (void)onDeviceOrientationChange { - if (ZFPlayerShared.isLockScreen) { return; } - self.lockBtn.hidden = !self.isFullScreen; - self.fullScreenBtn.selected = self.isFullScreen; - UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; - if (orientation == UIDeviceOrientationFaceUp || orientation == UIDeviceOrientationFaceDown || orientation == UIDeviceOrientationUnknown || orientation == UIDeviceOrientationPortraitUpsideDown) { return; } - if (!self.isShrink && !self.isPlayEnd && !self.showing) { - // 显示、隐藏控制层 - [self zf_playerShowOrHideControlView]; - } -} - -- (void)setOrientationLandscapeConstraint { - if (self.isCellVideo) { - self.shrink = NO; - } - self.fullScreen = YES; - self.lockBtn.hidden = !self.isFullScreen; - self.fullScreenBtn.selected = self.isFullScreen; - [self.backBtn setImage:ZFPlayerImage(@"ZFPlayer_back_full") forState:UIControlStateNormal]; - [self.backBtn mas_remakeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.topImageView.mas_top).offset(23); - make.leading.equalTo(self.topImageView.mas_leading).offset(10); - make.width.height.mas_equalTo(40); - }]; -} -/** - * 设置竖屏的约束 - */ -- (void)setOrientationPortraitConstraint { - self.fullScreen = NO; - self.lockBtn.hidden = !self.isFullScreen; - self.fullScreenBtn.selected = self.isFullScreen; - [self.backBtn mas_remakeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.topImageView.mas_top).offset(3); - make.leading.equalTo(self.topImageView.mas_leading).offset(10); - make.width.height.mas_equalTo(40); - }]; - - if (self.isCellVideo) { - [self.backBtn setImage:ZFPlayerImage(@"ZFPlayer_close") forState:UIControlStateNormal]; - } -} - -#pragma mark - Private Method - -- (void)showControlView { - self.showing = YES; - if (self.lockBtn.isSelected) { - self.topImageView.alpha = 0; - self.bottomImageView.alpha = 0; - } else { - self.topImageView.alpha = 1; - self.bottomImageView.alpha = 1; - } - self.backgroundColor = RGBA(0, 0, 0, 0.3); - self.lockBtn.alpha = 1; - if (self.isCellVideo) { - self.shrink = NO; - } - self.bottomProgressView.alpha = 0; - ZFPlayerShared.isStatusBarHidden = NO; -} - -- (void)hideControlView { - self.showing = NO; - self.backgroundColor = RGBA(0, 0, 0, 0); - self.topImageView.alpha = self.playeEnd; - self.bottomImageView.alpha = 0; - self.lockBtn.alpha = 0; - self.bottomProgressView.alpha = 1; - // 隐藏resolutionView - self.resolutionBtn.selected = YES; - [self resolutionBtnClick:self.resolutionBtn]; - if (self.isFullScreen && !self.playeEnd && !self.isShrink) { - ZFPlayerShared.isStatusBarHidden = YES; - } -} - -/** - * 监听设备旋转通知 - */ -- (void)listeningRotating { - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onDeviceOrientationChange) - name:UIDeviceOrientationDidChangeNotification - object:nil]; -} - - -- (void)autoFadeOutControlView { - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(zf_playerHideControlView) object:nil]; - [self performSelector:@selector(zf_playerHideControlView) withObject:nil afterDelay:ZFPlayerAnimationTimeInterval]; -} - -/** - slider滑块的bounds - */ -- (CGRect)thumbRect { - return [self.videoSlider thumbRectForBounds:self.videoSlider.bounds - trackRect:[self.videoSlider trackRectForBounds:self.videoSlider.bounds] - value:self.videoSlider.value]; -} - -#pragma mark - setter - -- (void)setShrink:(BOOL)shrink { - _shrink = shrink; - self.closeBtn.hidden = !shrink; - self.bottomProgressView.hidden = shrink; -} - -- (void)setFullScreen:(BOOL)fullScreen { - _fullScreen = fullScreen; - ZFPlayerShared.isLandscape = fullScreen; -} - -#pragma mark - getter - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.textColor = [UIColor whiteColor]; - _titleLabel.font = [UIFont systemFontOfSize:15.0]; - } - return _titleLabel; -} - -- (UIButton *)backBtn { - if (!_backBtn) { - _backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_backBtn setImage:ZFPlayerImage(@"ZFPlayer_back_full") forState:UIControlStateNormal]; - [_backBtn addTarget:self action:@selector(backBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _backBtn; -} - -- (UIImageView *)topImageView { - if (!_topImageView) { - _topImageView = [[UIImageView alloc] init]; - _topImageView.userInteractionEnabled = YES; - _topImageView.alpha = 0; - _topImageView.image = ZFPlayerImage(@"ZFPlayer_top_shadow"); - } - return _topImageView; -} - -- (UIImageView *)bottomImageView { - if (!_bottomImageView) { - _bottomImageView = [[UIImageView alloc] init]; - _bottomImageView.userInteractionEnabled = YES; - _bottomImageView.alpha = 0; - _bottomImageView.image = ZFPlayerImage(@"ZFPlayer_bottom_shadow"); - } - return _bottomImageView; -} - -- (UIButton *)lockBtn { - if (!_lockBtn) { - _lockBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_lockBtn setImage:ZFPlayerImage(@"ZFPlayer_unlock-nor") forState:UIControlStateNormal]; - [_lockBtn setImage:ZFPlayerImage(@"ZFPlayer_lock-nor") forState:UIControlStateSelected]; - [_lockBtn addTarget:self action:@selector(lockScrrenBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - - } - return _lockBtn; -} - -- (UIButton *)startBtn { - if (!_startBtn) { - _startBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_startBtn setImage:ZFPlayerImage(@"ZFPlayer_play") forState:UIControlStateNormal]; - [_startBtn setImage:ZFPlayerImage(@"ZFPlayer_pause") forState:UIControlStateSelected]; - [_startBtn addTarget:self action:@selector(playBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _startBtn; -} - -- (UIButton *)closeBtn { - if (!_closeBtn) { - _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_closeBtn setImage:ZFPlayerImage(@"ZFPlayer_close") forState:UIControlStateNormal]; - [_closeBtn addTarget:self action:@selector(closeBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - _closeBtn.hidden = YES; - } - return _closeBtn; -} - -- (UILabel *)currentTimeLabel { - if (!_currentTimeLabel) { - _currentTimeLabel = [[UILabel alloc] init]; - _currentTimeLabel.textColor = [UIColor whiteColor]; - _currentTimeLabel.font = [UIFont systemFontOfSize:12.0f]; - _currentTimeLabel.textAlignment = NSTextAlignmentCenter; - } - return _currentTimeLabel; -} - -- (UIProgressView *)progressView { - if (!_progressView) { - _progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault]; - _progressView.progressTintColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5]; - _progressView.trackTintColor = [UIColor clearColor]; - } - return _progressView; -} - -- (ASValueTrackingSlider *)videoSlider { - if (!_videoSlider) { - _videoSlider = [[ASValueTrackingSlider alloc] init]; - _videoSlider.popUpViewCornerRadius = 0.0; - _videoSlider.popUpViewColor = RGBA(19, 19, 9, 1); - _videoSlider.popUpViewArrowLength = 8; - - [_videoSlider setThumbImage:ZFPlayerImage(@"ZFPlayer_slider") forState:UIControlStateNormal]; - _videoSlider.maximumValue = 1; - _videoSlider.minimumTrackTintColor = [UIColor whiteColor]; - _videoSlider.maximumTrackTintColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.5]; - - // slider开始滑动事件 - [_videoSlider addTarget:self action:@selector(progressSliderTouchBegan:) forControlEvents:UIControlEventTouchDown]; - // slider滑动中事件 - [_videoSlider addTarget:self action:@selector(progressSliderValueChanged:) forControlEvents:UIControlEventValueChanged]; - // slider结束滑动事件 - [_videoSlider addTarget:self action:@selector(progressSliderTouchEnded:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchCancel | UIControlEventTouchUpOutside]; - - UITapGestureRecognizer *sliderTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapSliderAction:)]; - [_videoSlider addGestureRecognizer:sliderTap]; - - UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panRecognizer:)]; - panRecognizer.delegate = self; - [panRecognizer setMaximumNumberOfTouches:1]; - [panRecognizer setDelaysTouchesBegan:YES]; - [panRecognizer setDelaysTouchesEnded:YES]; - [panRecognizer setCancelsTouchesInView:YES]; - [_videoSlider addGestureRecognizer:panRecognizer]; - } - return _videoSlider; -} - -- (UILabel *)totalTimeLabel { - if (!_totalTimeLabel) { - _totalTimeLabel = [[UILabel alloc] init]; - _totalTimeLabel.textColor = [UIColor whiteColor]; - _totalTimeLabel.font = [UIFont systemFontOfSize:12.0f]; - _totalTimeLabel.textAlignment = NSTextAlignmentCenter; - } - return _totalTimeLabel; -} - -- (UIButton *)fullScreenBtn { - if (!_fullScreenBtn) { - _fullScreenBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_fullScreenBtn setImage:ZFPlayerImage(@"ZFPlayer_fullscreen") forState:UIControlStateNormal]; - [_fullScreenBtn setImage:ZFPlayerImage(@"ZFPlayer_shrinkscreen") forState:UIControlStateSelected]; - [_fullScreenBtn addTarget:self action:@selector(fullScreenBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _fullScreenBtn; -} - -- (MMMaterialDesignSpinner *)activity { - if (!_activity) { - _activity = [[MMMaterialDesignSpinner alloc] init]; - _activity.lineWidth = 1; - _activity.duration = 1; - _activity.tintColor = [[UIColor whiteColor] colorWithAlphaComponent:0.9]; - } - return _activity; -} - -- (UIButton *)repeatBtn { - if (!_repeatBtn) { - _repeatBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_repeatBtn setImage:ZFPlayerImage(@"ZFPlayer_repeat_video") forState:UIControlStateNormal]; - [_repeatBtn addTarget:self action:@selector(repeatBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _repeatBtn; -} - -- (UIButton *)downLoadBtn { - if (!_downLoadBtn) { - _downLoadBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_downLoadBtn setImage:ZFPlayerImage(@"ZFPlayer_download") forState:UIControlStateNormal]; - [_downLoadBtn setImage:ZFPlayerImage(@"ZFPlayer_not_download") forState:UIControlStateDisabled]; - [_downLoadBtn addTarget:self action:@selector(downloadBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _downLoadBtn; -} - -- (UIButton *)resolutionBtn { - if (!_resolutionBtn) { - _resolutionBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - _resolutionBtn.titleLabel.font = [UIFont systemFontOfSize:12]; - _resolutionBtn.backgroundColor = RGBA(0, 0, 0, 0.7); - [_resolutionBtn addTarget:self action:@selector(resolutionBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _resolutionBtn; -} - -- (UIButton *)playeBtn { - if (!_playeBtn) { - _playeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [_playeBtn setImage:ZFPlayerImage(@"ZFPlayer_play_btn") forState:UIControlStateNormal]; - [_playeBtn addTarget:self action:@selector(centerPlayBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _playeBtn; -} - -- (UIButton *)failBtn { - if (!_failBtn) { - _failBtn = [UIButton buttonWithType:UIButtonTypeSystem]; - [_failBtn setTitle:@"加载失败,点击重试" forState:UIControlStateNormal]; - [_failBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _failBtn.titleLabel.font = [UIFont systemFontOfSize:14.0]; - _failBtn.backgroundColor = RGBA(0, 0, 0, 0.7); - [_failBtn addTarget:self action:@selector(failBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - } - return _failBtn; -} - -- (UIView *)fastView { - if (!_fastView) { - _fastView = [[UIView alloc] init]; - _fastView.backgroundColor = RGBA(0, 0, 0, 0.8); - _fastView.layer.cornerRadius = 4; - _fastView.layer.masksToBounds = YES; - } - return _fastView; -} - -- (UIImageView *)fastImageView { - if (!_fastImageView) { - _fastImageView = [[UIImageView alloc] init]; - } - return _fastImageView; -} - -- (UILabel *)fastTimeLabel { - if (!_fastTimeLabel) { - _fastTimeLabel = [[UILabel alloc] init]; - _fastTimeLabel.textColor = [UIColor whiteColor]; - _fastTimeLabel.textAlignment = NSTextAlignmentCenter; - _fastTimeLabel.font = [UIFont systemFontOfSize:14.0]; - } - return _fastTimeLabel; -} - -- (UIProgressView *)fastProgressView { - if (!_fastProgressView) { - _fastProgressView = [[UIProgressView alloc] init]; - _fastProgressView.progressTintColor = [UIColor whiteColor]; - _fastProgressView.trackTintColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.4]; - } - return _fastProgressView; -} - -- (UIImageView *)placeholderImageView { - if (!_placeholderImageView) { - _placeholderImageView = [[UIImageView alloc] init]; - _placeholderImageView.userInteractionEnabled = YES; - } - return _placeholderImageView; -} - -- (UIProgressView *)bottomProgressView { - if (!_bottomProgressView) { - _bottomProgressView = [[UIProgressView alloc] init]; - _bottomProgressView.progressTintColor = [UIColor whiteColor]; - _bottomProgressView.trackTintColor = [UIColor clearColor]; - } - return _bottomProgressView; -} - -#pragma mark - UIGestureRecognizerDelegate - -- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { - CGRect rect = [self thumbRect]; - CGPoint point = [touch locationInView:self.videoSlider]; - if ([touch.view isKindOfClass:[UISlider class]]) { // 如果在滑块上点击就不响应pan手势 - if (point.x <= rect.origin.x + rect.size.width && point.x >= rect.origin.x) { return NO; } - } - return YES; -} - -#pragma mark - Public method - -/** 重置ControlView */ -- (void)zf_playerResetControlView { - [self.activity stopAnimating]; - self.videoSlider.value = 0; - self.bottomProgressView.progress = 0; - self.progressView.progress = 0; - self.currentTimeLabel.text = @"00:00"; - self.totalTimeLabel.text = @"00:00"; - self.fastView.hidden = YES; - self.repeatBtn.hidden = YES; - self.playeBtn.hidden = YES; - self.resolutionView.hidden = YES; - self.failBtn.hidden = YES; - self.backgroundColor = [UIColor clearColor]; - self.downLoadBtn.enabled = YES; - self.shrink = NO; - self.showing = NO; - self.playeEnd = NO; - self.lockBtn.hidden = !self.isFullScreen; - self.failBtn.hidden = YES; - self.placeholderImageView.alpha = 1; - [self hideControlView]; -} - -- (void)zf_playerResetControlViewForResolution { - self.fastView.hidden = YES; - self.repeatBtn.hidden = YES; - self.resolutionView.hidden = YES; - self.playeBtn.hidden = YES; - self.downLoadBtn.enabled = YES; - self.failBtn.hidden = YES; - self.backgroundColor = [UIColor clearColor]; - self.shrink = NO; - self.showing = NO; - self.playeEnd = NO; -} - -/** - * 取消延时隐藏controlView的方法 - */ -- (void)zf_playerCancelAutoFadeOutControlView { - [NSObject cancelPreviousPerformRequestsWithTarget:self]; -} - -/** 设置播放模型 */ -- (void)zf_playerModel:(ZFPlayerModel *)playerModel { - - if (playerModel.title) { self.titleLabel.text = playerModel.title; } - // 设置网络占位图片 - if (playerModel.placeholderImageURLString) { - [self.placeholderImageView setImageWithURLString:playerModel.placeholderImageURLString placeholder:ZFPlayerImage(@"ZFPlayer_loading_bgView")]; - } else { - self.placeholderImageView.image = playerModel.placeholderImage; - } - if (playerModel.resolutionDic) { - [self zf_playerResolutionArray:[playerModel.resolutionDic allKeys]]; - } -} - -/** 正在播放(隐藏placeholderImageView) */ -- (void)zf_playerItemPlaying { - [UIView animateWithDuration:1.0 animations:^{ - self.placeholderImageView.alpha = 0; - }]; -} - -- (void)zf_playerShowOrHideControlView { - if (self.isShowing) { - [self zf_playerHideControlView]; - } else { - [self zf_playerShowControlView]; - } -} -/** - * 显示控制层 - */ -- (void)zf_playerShowControlView { - if ([self.delegate respondsToSelector:@selector(zf_controlViewWillShow:isFullscreen:)]) { - [self.delegate zf_controlViewWillShow:self isFullscreen:self.isFullScreen]; - } - [self zf_playerCancelAutoFadeOutControlView]; - [UIView animateWithDuration:ZFPlayerControlBarAutoFadeOutTimeInterval animations:^{ - [self showControlView]; - } completion:^(BOOL finished) { - self.showing = YES; - [self autoFadeOutControlView]; - }]; -} - -/** - * 隐藏控制层 - */ -- (void)zf_playerHideControlView { - if ([self.delegate respondsToSelector:@selector(zf_controlViewWillHidden:isFullscreen:)]) { - [self.delegate zf_controlViewWillHidden:self isFullscreen:self.isFullScreen]; - } - [self zf_playerCancelAutoFadeOutControlView]; - [UIView animateWithDuration:ZFPlayerControlBarAutoFadeOutTimeInterval animations:^{ - [self hideControlView]; - } completion:^(BOOL finished) { - self.showing = NO; - }]; -} - -/** 小屏播放 */ -- (void)zf_playerBottomShrinkPlay { - self.shrink = YES; - [self hideControlView]; -} - -/** 在cell播放 */ -- (void)zf_playerCellPlay { - self.cellVideo = YES; - self.shrink = NO; - [self.backBtn setImage:ZFPlayerImage(@"ZFPlayer_close") forState:UIControlStateNormal]; -} - -- (void)zf_playerCurrentTime:(NSInteger)currentTime totalTime:(NSInteger)totalTime sliderValue:(CGFloat)value { - // 当前时长进度progress - NSInteger proMin = currentTime / 60;//当前秒 - NSInteger proSec = currentTime % 60;//当前分钟 - // duration 总时长 - NSInteger durMin = totalTime / 60;//总秒 - NSInteger durSec = totalTime % 60;//总分钟 - if (!self.isDragged) { - // 更新slider - self.videoSlider.value = value; - self.bottomProgressView.progress = value; - // 更新当前播放时间 - self.currentTimeLabel.text = [NSString stringWithFormat:@"%02zd:%02zd", proMin, proSec]; - } - // 更新总时间 - self.totalTimeLabel.text = [NSString stringWithFormat:@"%02zd:%02zd", durMin, durSec]; -} - -- (void)zf_playerDraggedTime:(NSInteger)draggedTime totalTime:(NSInteger)totalTime isForward:(BOOL)forawrd hasPreview:(BOOL)preview { - // 快进快退时候停止菊花 - [self.activity stopAnimating]; - // 拖拽的时长 - NSInteger proMin = draggedTime / 60;//当前秒 - NSInteger proSec = draggedTime % 60;//当前分钟 - - //duration 总时长 - NSInteger durMin = totalTime / 60;//总秒 - NSInteger durSec = totalTime % 60;//总分钟 - - NSString *currentTimeStr = [NSString stringWithFormat:@"%02zd:%02zd", proMin, proSec]; - NSString *totalTimeStr = [NSString stringWithFormat:@"%02zd:%02zd", durMin, durSec]; - CGFloat draggedValue = (CGFloat)draggedTime/(CGFloat)totalTime; - NSString *timeStr = [NSString stringWithFormat:@"%@ / %@", currentTimeStr, totalTimeStr]; - - // 显示、隐藏预览窗 - self.videoSlider.popUpView.hidden = !preview; - // 更新slider的值 - self.videoSlider.value = draggedValue; - // 更新bottomProgressView的值 - self.bottomProgressView.progress = draggedValue; - // 更新当前时间 - self.currentTimeLabel.text = currentTimeStr; - // 正在拖动控制播放进度 - self.dragged = YES; - - if (forawrd) { - self.fastImageView.image = ZFPlayerImage(@"ZFPlayer_fast_forward"); - } else { - self.fastImageView.image = ZFPlayerImage(@"ZFPlayer_fast_backward"); - } - self.fastView.hidden = preview; - self.fastTimeLabel.text = timeStr; - self.fastProgressView.progress = draggedValue; - -} - -- (void)zf_playerDraggedEnd { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - self.fastView.hidden = YES; - }); - self.dragged = NO; - // 结束滑动时候把开始播放按钮改为播放状态 - self.startBtn.selected = YES; - // 滑动结束延时隐藏controlView - [self autoFadeOutControlView]; -} - -- (void)zf_playerDraggedTime:(NSInteger)draggedTime sliderImage:(UIImage *)image; { - // 拖拽的时长 - NSInteger proMin = draggedTime / 60;//当前秒 - NSInteger proSec = draggedTime % 60;//当前分钟 - NSString *currentTimeStr = [NSString stringWithFormat:@"%02zd:%02zd", proMin, proSec]; - [self.videoSlider setImage:image]; - [self.videoSlider setText:currentTimeStr]; - self.fastView.hidden = YES; -} - -/** progress显示缓冲进度 */ -- (void)zf_playerSetProgress:(CGFloat)progress { - [self.progressView setProgress:progress animated:NO]; -} - -/** 视频加载失败 */ -- (void)zf_playerItemStatusFailed:(NSError *)error { - self.failBtn.hidden = NO; -} - -/** 加载的菊花 */ -- (void)zf_playerActivity:(BOOL)animated { - if (animated) { - [self.activity startAnimating]; - self.fastView.hidden = YES; - } else { - [self.activity stopAnimating]; - } -} - -/** 播放完了 */ -- (void)zf_playerPlayEnd { - self.repeatBtn.hidden = NO; - self.playeEnd = YES; - self.showing = NO; - // 隐藏controlView - [self hideControlView]; - self.backgroundColor = RGBA(0, 0, 0, .3); - ZFPlayerShared.isStatusBarHidden = NO; - self.bottomProgressView.alpha = 0; -} - -/** - 是否有下载功能 - */ -- (void)zf_playerHasDownloadFunction:(BOOL)sender { - self.downLoadBtn.hidden = !sender; -} - -/** - 是否有切换分辨率功能 - */ -- (void)zf_playerResolutionArray:(NSArray *)resolutionArray { - self.resolutionBtn.hidden = NO; - - _resolutionArray = resolutionArray; - [_resolutionBtn setTitle:resolutionArray.firstObject forState:UIControlStateNormal]; - // 添加分辨率按钮和分辨率下拉列表 - self.resolutionView = [[UIView alloc] init]; - self.resolutionView.hidden = YES; - self.resolutionView.backgroundColor = RGBA(0, 0, 0, 0.7); - [self addSubview:self.resolutionView]; - - [self.resolutionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(40); - make.height.mas_equalTo(25*resolutionArray.count); - make.leading.equalTo(self.resolutionBtn.mas_leading).offset(0); - make.top.equalTo(self.resolutionBtn.mas_bottom).offset(0); - }]; - - // 分辨率View上边的Btn - for (NSInteger i = 0 ; i < resolutionArray.count; i++) { - UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; - btn.layer.borderColor = [UIColor whiteColor].CGColor; - btn.layer.borderWidth = 0.5; - btn.tag = 200+i; - btn.frame = CGRectMake(0, 25*i, 40, 25); - btn.titleLabel.font = [UIFont systemFontOfSize:12]; - [btn setTitle:resolutionArray[i] forState:UIControlStateNormal]; - if (i == 0) { - self.resoultionCurrentBtn = btn; - btn.selected = YES; - btn.backgroundColor = RGBA(86, 143, 232, 1); - } - [self.resolutionView addSubview:btn]; - [btn addTarget:self action:@selector(changeResolution:) forControlEvents:UIControlEventTouchUpInside]; - } -} - -/** 播放按钮状态 */ -- (void)zf_playerPlayBtnState:(BOOL)state { - self.startBtn.selected = state; -} - -/** 锁定屏幕方向按钮状态 */ -- (void)zf_playerLockBtnState:(BOOL)state { - self.lockBtn.selected = state; -} - -/** 下载按钮状态 */ -- (void)zf_playerDownloadBtnState:(BOOL)state { - self.downLoadBtn.enabled = state; -} - -#pragma clang diagnostic pop - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlViewDelegate.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlViewDelegate.h deleted file mode 100644 index 08658c6a..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerControlViewDelegate.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// ZFPlayerControlViewDelegate.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#ifndef ZFPlayerControlViewDelegate_h -#define ZFPlayerControlViewDelegate_h - - -#endif /* ZFPlayerControlViewDelegate_h */ - -@protocol ZFPlayerControlViewDelagate - -@optional -/** 返回按钮事件 */ -- (void)zf_controlView:(UIView *)controlView backAction:(UIButton *)sender; -/** cell播放中小屏状态 关闭按钮事件 */ -- (void)zf_controlView:(UIView *)controlView closeAction:(UIButton *)sender; -/** 播放按钮事件 */ -- (void)zf_controlView:(UIView *)controlView playAction:(UIButton *)sender; -/** 全屏按钮事件 */ -- (void)zf_controlView:(UIView *)controlView fullScreenAction:(UIButton *)sender; -/** 锁定屏幕方向按钮时间 */ -- (void)zf_controlView:(UIView *)controlView lockScreenAction:(UIButton *)sender; -/** 重播按钮事件 */ -- (void)zf_controlView:(UIView *)controlView repeatPlayAction:(UIButton *)sender; -/** 中间播放按钮事件 */ -- (void)zf_controlView:(UIView *)controlView cneterPlayAction:(UIButton *)sender; -/** 加载失败按钮事件 */ -- (void)zf_controlView:(UIView *)controlView failAction:(UIButton *)sender; -/** 下载按钮事件 */ -- (void)zf_controlView:(UIView *)controlView downloadVideoAction:(UIButton *)sender; -/** 切换分辨率按钮事件 */ -- (void)zf_controlView:(UIView *)controlView resolutionAction:(UIButton *)sender; -/** slider的点击事件(点击slider控制进度) */ -- (void)zf_controlView:(UIView *)controlView progressSliderTap:(CGFloat)value; -/** 开始触摸slider */ -- (void)zf_controlView:(UIView *)controlView progressSliderTouchBegan:(UISlider *)slider; -/** slider触摸中 */ -- (void)zf_controlView:(UIView *)controlView progressSliderValueChanged:(UISlider *)slider; -/** slider触摸结束 */ -- (void)zf_controlView:(UIView *)controlView progressSliderTouchEnded:(UISlider *)slider; -/** 控制层即将显示 */ -- (void)zf_controlViewWillShow:(UIView *)controlView isFullscreen:(BOOL)fullscreen; -/** 控制层即将隐藏 */ -- (void)zf_controlViewWillHidden:(UIView *)controlView isFullscreen:(BOOL)fullscreen; - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerModel.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerModel.h deleted file mode 100644 index c0f729f0..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerModel.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// ZFPlayerModel.h -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import - -@interface ZFPlayerModel : NSObject - -/** 视频标题 */ -@property (nonatomic, copy ) NSString *title; -/** 视频URL */ -@property (nonatomic, strong) NSURL *videoURL; -/** 视频封面本地图片 */ -@property (nonatomic, strong) UIImage *placeholderImage; -/** 播放器View的父视图(非cell播放使用这个)*/ -@property (nonatomic, weak ) UIView *fatherView; - -/** - * 视频封面网络图片url - * 如果和本地图片同时设置,则忽略本地图片,显示网络图片 - */ -@property (nonatomic, copy ) NSString *placeholderImageURLString; -/** - * 视频分辨率字典, 分辨率标题与该分辨率对应的视频URL. - * 例如: @{@"高清" : @"https://xx/xx-hd.mp4", @"标清" : @"https://xx/xx-sd.mp4"} - */ -@property (nonatomic, strong) NSDictionary *resolutionDic; -/** 从xx秒开始播放视频(默认0) */ -@property (nonatomic, assign) NSInteger seekTime; -// cell播放视频,以下属性必须设置值 -@property (nonatomic, strong) UIScrollView *scrollView; -/** cell所在的indexPath */ -@property (nonatomic, strong) NSIndexPath *indexPath; -/** - * cell上播放必须指定 - * 播放器View的父视图tag(根据tag值在cell里查找playerView加到哪里) - */ -@property (nonatomic, assign) NSInteger fatherViewTag; - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerModel.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerModel.m deleted file mode 100644 index 3d87c5a4..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerModel.m +++ /dev/null @@ -1,34 +0,0 @@ -// -// ZFPlayerModel.m -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFPlayerModel.h" -#import "ZFPlayer.h" - -@implementation ZFPlayerModel - -- (UIImage *)placeholderImage { - if (!_placeholderImage) { - _placeholderImage = ZFPlayerImage(@"ZFPlayer_loading_bgView"); - } - return _placeholderImage; -} -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerView.h b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerView.h deleted file mode 100644 index 5aa06c91..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerView.h +++ /dev/null @@ -1,125 +0,0 @@ -// -// ZFPlayerView.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import "ZFPlayer.h" -#import "ZFPlayerControlView.h" -#import "ZFPlayerModel.h" -#import "ZFPlayerControlViewDelegate.h" - -@protocol ZFPlayerDelegate -@optional -/** 返回按钮事件 */ -- (void)zf_playerBackAction; -/** 下载视频 */ -- (void)zf_playerDownload:(NSString *)url; -/** 控制层即将显示 */ -- (void)zf_playerControlViewWillShow:(UIView *)controlView isFullscreen:(BOOL)fullscreen; -/** 控制层即将隐藏 */ -- (void)zf_playerControlViewWillHidden:(UIView *)controlView isFullscreen:(BOOL)fullscreen; - -@end - -// playerLayer的填充模式(默认:等比例填充,直到一个维度到达区域边界) -typedef NS_ENUM(NSInteger, ZFPlayerLayerGravity) { - ZFPlayerLayerGravityResize, // 非均匀模式。两个维度完全填充至整个视图区域 - ZFPlayerLayerGravityResizeAspect, // 等比例填充,直到一个维度到达区域边界 - ZFPlayerLayerGravityResizeAspectFill // 等比例填充,直到填充满整个视图区域,其中一个维度的部分区域会被裁剪 -}; - -// 播放器的几种状态 -typedef NS_ENUM(NSInteger, ZFPlayerState) { - ZFPlayerStateFailed, // 播放失败 - ZFPlayerStateBuffering, // 缓冲中 - ZFPlayerStatePlaying, // 播放中 - ZFPlayerStateStopped, // 停止播放 - ZFPlayerStatePause // 暂停播放 -}; - -@interface ZFPlayerView : UIView - -/** 设置playerLayer的填充模式 */ -@property (nonatomic, assign) ZFPlayerLayerGravity playerLayerGravity; -/** 是否有下载功能(默认是关闭) */ -@property (nonatomic, assign) BOOL hasDownload; -/** 是否开启预览图 */ -@property (nonatomic, assign) BOOL hasPreviewView; -/** 设置代理 */ -@property (nonatomic, weak) id delegate; -/** 是否被用户暂停 */ -@property (nonatomic, assign, readonly) BOOL isPauseByUser; -/** 播发器的几种状态 */ -@property (nonatomic, assign, readonly) ZFPlayerState state; -/** 静音(默认为NO)*/ -@property (nonatomic, assign) BOOL mute; -/** 当cell划出屏幕的时候停止播放(默认为NO) */ -@property (nonatomic, assign) BOOL stopPlayWhileCellNotVisable; -/** 当cell播放视频由全屏变为小屏时候,是否回到中间位置(默认YES) */ -@property (nonatomic, assign) BOOL cellPlayerOnCenter; -/** player在栈上,即此时push或者模态了新控制器 */ -@property (nonatomic, assign) BOOL playerPushedOrPresented; - -/** - * 单例,用于列表cell上多个视频 - * - * @return ZFPlayer - */ -+ (instancetype)sharedPlayerView; - -/** - * 指定播放的控制层和模型 - * 控制层传nil,默认使用ZFPlayerControlView(如自定义可传自定义的控制层) - */ -- (void)playerControlView:(UIView *)controlView playerModel:(ZFPlayerModel *)playerModel; - -/** - * 使用自带的控制层时候可使用此API - */ -- (void)playerModel:(ZFPlayerModel *)playerModel; - -/** - * 自动播放,默认不自动播放 - */ -- (void)autoPlayTheVideo; - -/** - * 重置player - */ -- (void)resetPlayer; - -/** - * 在当前页面,设置新的视频时候调用此方法 - */ -- (void)resetToPlayNewVideo:(ZFPlayerModel *)playerModel; - -/** - * 播放 - */ -- (void)play; - -/** - * 暂停 - */ -- (void)pause; - -@end diff --git a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerView.m b/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerView.m deleted file mode 100644 index 30e005c6..00000000 --- a/iOSProject/Pods/ZFPlayer/ZFPlayer/ZFPlayerView.m +++ /dev/null @@ -1,1627 +0,0 @@ -// -// ZFPlayerView.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFPlayerView.h" -#import -#import -#import "UIView+CustomControlView.h" -#import "ZFPlayer.h" - -#define CellPlayerFatherViewTag 200 - -//忽略编译器的警告 -#pragma clang diagnostic push -#pragma clang diagnostic ignored"-Wdeprecated-declarations" - -// 枚举值,包含水平移动方向和垂直移动方向 -typedef NS_ENUM(NSInteger, PanDirection){ - PanDirectionHorizontalMoved, // 横向移动 - PanDirectionVerticalMoved // 纵向移动 -}; - -@interface ZFPlayerView () - -/** 播放属性 */ -@property (nonatomic, strong) AVPlayer *player; -@property (nonatomic, strong) AVPlayerItem *playerItem; -@property (nonatomic, strong) AVURLAsset *urlAsset; -@property (nonatomic, strong) AVAssetImageGenerator *imageGenerator; -/** playerLayer */ -@property (nonatomic, strong) AVPlayerLayer *playerLayer; -@property (nonatomic, strong) id timeObserve; -/** 滑杆 */ -@property (nonatomic, strong) UISlider *volumeViewSlider; -/** 用来保存快进的总时长 */ -@property (nonatomic, assign) CGFloat sumTime; -/** 定义一个实例变量,保存枚举值 */ -@property (nonatomic, assign) PanDirection panDirection; -/** 播发器的几种状态 */ -@property (nonatomic, assign) ZFPlayerState state; -/** 是否为全屏 */ -@property (nonatomic, assign) BOOL isFullScreen; -/** 是否锁定屏幕方向 */ -@property (nonatomic, assign) BOOL isLocked; -/** 是否在调节音量*/ -@property (nonatomic, assign) BOOL isVolume; -/** 是否被用户暂停 */ -@property (nonatomic, assign) BOOL isPauseByUser; -/** 是否播放本地文件 */ -@property (nonatomic, assign) BOOL isLocalVideo; -/** slider上次的值 */ -@property (nonatomic, assign) CGFloat sliderLastValue; -/** 是否再次设置URL播放视频 */ -@property (nonatomic, assign) BOOL repeatToPlay; -/** 播放完了*/ -@property (nonatomic, assign) BOOL playDidEnd; -/** 进入后台*/ -@property (nonatomic, assign) BOOL didEnterBackground; -/** 是否自动播放 */ -@property (nonatomic, assign) BOOL isAutoPlay; -/** 单击 */ -@property (nonatomic, strong) UITapGestureRecognizer *singleTap; -/** 双击 */ -@property (nonatomic, strong) UITapGestureRecognizer *doubleTap; -/** 视频URL的数组 */ -@property (nonatomic, strong) NSArray *videoURLArray; -/** slider预览图 */ -@property (nonatomic, strong) UIImage *thumbImg; -/** 亮度view */ -@property (nonatomic, strong) ZFBrightnessView *brightnessView; -/** 视频填充模式 */ -@property (nonatomic, copy) NSString *videoGravity; - -#pragma mark - UITableViewCell PlayerView - -/** palyer加到tableView */ -@property (nonatomic, strong) UIScrollView *scrollView; -/** player所在cell的indexPath */ -@property (nonatomic, strong) NSIndexPath *indexPath; -/** ViewController中页面是否消失 */ -@property (nonatomic, assign) BOOL viewDisappear; -/** 是否在cell上播放video */ -@property (nonatomic, assign) BOOL isCellVideo; -/** 是否缩小视频在底部 */ -@property (nonatomic, assign) BOOL isBottomVideo; -/** 是否切换分辨率*/ -@property (nonatomic, assign) BOOL isChangeResolution; -/** 是否正在拖拽 */ -@property (nonatomic, assign) BOOL isDragged; -/** 小窗口距屏幕右边和下边的距离 */ -@property (nonatomic, assign) CGPoint shrinkRightBottomPoint; - -@property (nonatomic, strong) UIPanGestureRecognizer *shrinkPanGesture; - -@property (nonatomic, strong) UIView *controlView; -@property (nonatomic, strong) ZFPlayerModel *playerModel; -@property (nonatomic, assign) NSInteger seekTime; -@property (nonatomic, strong) NSURL *videoURL; -@property (nonatomic, strong) NSDictionary *resolutionDic; -@end - -@implementation ZFPlayerView - -#pragma mark - life Cycle - -/** - * 代码初始化调用此方法 - */ -- (instancetype)init { - self = [super init]; - if (self) { [self initializeThePlayer]; } - return self; -} - -/** - * storyboard、xib加载playerView会调用此方法 - */ -- (void)awakeFromNib { - [super awakeFromNib]; - [self initializeThePlayer]; -} - -/** - * 初始化player - */ -- (void)initializeThePlayer { - self.cellPlayerOnCenter = YES; -} - -- (void)dealloc { - self.playerItem = nil; - self.scrollView = nil; - ZFPlayerShared.isLockScreen = NO; - [self.controlView zf_playerCancelAutoFadeOutControlView]; - // 移除通知 - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; - // 移除time观察者 - if (self.timeObserve) { - [self.player removeTimeObserver:self.timeObserve]; - self.timeObserve = nil; - } -} - -/** - * 在当前页面,设置新的Player的URL调用此方法 - */ -- (void)resetToPlayNewURL { - self.repeatToPlay = YES; - [self resetPlayer]; -} - -#pragma mark - 观察者、通知 - -/** - * 添加观察者、通知 - */ -- (void)addNotifications { - // app退到后台 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground) name:UIApplicationWillResignActiveNotification object:nil]; - // app进入前台 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterPlayground) name:UIApplicationDidBecomeActiveNotification object:nil]; - - // 监听耳机插入和拔掉通知 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(audioRouteChangeListenerCallback:) name:AVAudioSessionRouteChangeNotification object:nil]; - - // 监测设备方向 - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onDeviceOrientationChange) - name:UIDeviceOrientationDidChangeNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(onStatusBarOrientationChange) - name:UIApplicationDidChangeStatusBarOrientationNotification - object:nil]; -} - -#pragma mark - layoutSubviews - -- (void)layoutSubviews { - [super layoutSubviews]; - self.playerLayer.frame = self.bounds; -} - -#pragma mark - Public Method - -/** - * 单例,用于列表cell上多个视频 - * - * @return ZFPlayer - */ -+ (instancetype)sharedPlayerView { - static ZFPlayerView *playerView = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - playerView = [[ZFPlayerView alloc] init]; - }); - return playerView; -} - -- (void)playerControlView:(UIView *)controlView playerModel:(ZFPlayerModel *)playerModel { - if (!controlView) { - // 指定默认控制层 - ZFPlayerControlView *defaultControlView = [[ZFPlayerControlView alloc] init]; - self.controlView = defaultControlView; - } else { - self.controlView = controlView; - } - self.playerModel = playerModel; -} - -/** - * 使用自带的控制层时候可使用此API - */ -- (void)playerModel:(ZFPlayerModel *)playerModel { - [self playerControlView:nil playerModel:playerModel]; -} - -/** - * 自动播放,默认不自动播放 - */ -- (void)autoPlayTheVideo { - // 设置Player相关参数 - [self configZFPlayer]; -} - -/** - * player添加到fatherView上 - */ -- (void)addPlayerToFatherView:(UIView *)view { - // 这里应该添加判断,因为view有可能为空,当view为空时[view addSubview:self]会crash - if (view) { - [self removeFromSuperview]; - [view addSubview:self]; - [self mas_remakeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_offset(UIEdgeInsetsZero); - }]; - } -} - -/** - * 重置player - */ -- (void)resetPlayer { - // 改为为播放完 - self.playDidEnd = NO; - self.playerItem = nil; - self.didEnterBackground = NO; - // 视频跳转秒数置0 - self.seekTime = 0; - self.isAutoPlay = NO; - if (self.timeObserve) { - [self.player removeTimeObserver:self.timeObserve]; - self.timeObserve = nil; - } - // 移除通知 - [[NSNotificationCenter defaultCenter] removeObserver:self]; - // 暂停 - [self pause]; - // 移除原来的layer - [self.playerLayer removeFromSuperlayer]; - // 替换PlayerItem为nil - [self.player replaceCurrentItemWithPlayerItem:nil]; - // 把player置为nil - self.imageGenerator = nil; - self.player = nil; - if (self.isChangeResolution) { // 切换分辨率 - [self.controlView zf_playerResetControlViewForResolution]; - self.isChangeResolution = NO; - }else { // 重置控制层View - [self.controlView zf_playerResetControlView]; - } - self.controlView = nil; - // 非重播时,移除当前playerView - if (!self.repeatToPlay) { [self removeFromSuperview]; } - // 底部播放video改为NO - self.isBottomVideo = NO; - // cell上播放视频 && 不是重播时 - if (self.isCellVideo && !self.repeatToPlay) { - // vicontroller中页面消失 - self.viewDisappear = YES; - self.isCellVideo = NO; - self.scrollView = nil; - self.indexPath = nil; - } -} - -/** - * 在当前页面,设置新的视频时候调用此方法 - */ -- (void)resetToPlayNewVideo:(ZFPlayerModel *)playerModel { - self.repeatToPlay = YES; - [self resetPlayer]; - self.playerModel = playerModel; - [self configZFPlayer]; -} - -/** - * 播放 - */ -- (void)play { - [self.controlView zf_playerPlayBtnState:YES]; - if (self.state == ZFPlayerStatePause) { self.state = ZFPlayerStatePlaying; } - self.isPauseByUser = NO; - [_player play]; -} - -/** - * 暂停 - */ -- (void)pause { - [self.controlView zf_playerPlayBtnState:NO]; - if (self.state == ZFPlayerStatePlaying) { self.state = ZFPlayerStatePause;} - self.isPauseByUser = YES; - [_player pause]; -} - -#pragma mark - Private Method - -/** - * 用于cell上播放player - * - * @param tableView tableView - * @param indexPath indexPath - */ -- (void)cellVideoWithScrollView:(UIScrollView *)scrollView - AtIndexPath:(NSIndexPath *)indexPath { - // 如果页面没有消失,并且playerItem有值,需要重置player(其实就是点击播放其他视频时候) - if (!self.viewDisappear && self.playerItem) { [self resetPlayer]; } - // 在cell上播放视频 - self.isCellVideo = YES; - // viewDisappear改为NO - self.viewDisappear = NO; - // 设置tableview - self.scrollView = scrollView; - // 设置indexPath - self.indexPath = indexPath; - // 在cell播放 - [self.controlView zf_playerCellPlay]; - - self.shrinkPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(shrikPanAction:)]; - self.shrinkPanGesture.delegate = self; - [self addGestureRecognizer:self.shrinkPanGesture]; -} - -/** - * 设置Player相关参数 - */ -- (void)configZFPlayer { - self.urlAsset = [AVURLAsset assetWithURL:self.videoURL]; - // 初始化playerItem - self.playerItem = [AVPlayerItem playerItemWithAsset:self.urlAsset]; - // 每次都重新创建Player,替换replaceCurrentItemWithPlayerItem:,该方法阻塞线程 - self.player = [AVPlayer playerWithPlayerItem:self.playerItem]; - - // 初始化playerLayer - self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player]; - - self.backgroundColor = [UIColor blackColor]; - // 此处为默认视频填充模式 - self.playerLayer.videoGravity = self.videoGravity; - - // 自动播放 - self.isAutoPlay = YES; - - // 添加播放进度计时器 - [self createTimer]; - - // 获取系统音量 - [self configureVolume]; - - // 本地文件不设置ZFPlayerStateBuffering状态 - if ([self.videoURL.scheme isEqualToString:@"file"]) { - self.state = ZFPlayerStatePlaying; - self.isLocalVideo = YES; - [self.controlView zf_playerDownloadBtnState:NO]; - } else { - self.state = ZFPlayerStateBuffering; - self.isLocalVideo = NO; - [self.controlView zf_playerDownloadBtnState:YES]; - } - // 开始播放 - [self play]; - self.isPauseByUser = NO; -} - -/** - * 创建手势 - */ -- (void)createGesture { - // 单击 - self.singleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(singleTapAction:)]; - self.singleTap.delegate = self; - self.singleTap.numberOfTouchesRequired = 1; //手指数 - self.singleTap.numberOfTapsRequired = 1; - [self addGestureRecognizer:self.singleTap]; - - // 双击(播放/暂停) - self.doubleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(doubleTapAction:)]; - self.doubleTap.delegate = self; - self.doubleTap.numberOfTouchesRequired = 1; //手指数 - self.doubleTap.numberOfTapsRequired = 2; - [self addGestureRecognizer:self.doubleTap]; - - // 解决点击当前view时候响应其他控件事件 - [self.singleTap setDelaysTouchesBegan:YES]; - [self.doubleTap setDelaysTouchesBegan:YES]; - // 双击失败响应单击事件 - [self.singleTap requireGestureRecognizerToFail:self.doubleTap]; -} - -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - if (self.isAutoPlay) { - UITouch *touch = [touches anyObject]; - if(touch.tapCount == 1) { - [self performSelector:@selector(singleTapAction:) withObject:@(NO) ]; - } else if (touch.tapCount == 2) { - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(singleTapAction:) object:nil]; - [self doubleTapAction:touch.gestureRecognizers.lastObject]; - } - } -} - -- (void)createTimer { - __weak typeof(self) weakSelf = self; - self.timeObserve = [self.player addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(1, 1) queue:nil usingBlock:^(CMTime time){ - AVPlayerItem *currentItem = weakSelf.playerItem; - NSArray *loadedRanges = currentItem.seekableTimeRanges; - if (loadedRanges.count > 0 && currentItem.duration.timescale != 0) { - NSInteger currentTime = (NSInteger)CMTimeGetSeconds([currentItem currentTime]); - CGFloat totalTime = (CGFloat)currentItem.duration.value / currentItem.duration.timescale; - CGFloat value = CMTimeGetSeconds([currentItem currentTime]) / totalTime; - [weakSelf.controlView zf_playerCurrentTime:currentTime totalTime:totalTime sliderValue:value]; - } - }]; -} - -/** - * 获取系统音量 - */ -- (void)configureVolume { - MPVolumeView *volumeView = [[MPVolumeView alloc] init]; - _volumeViewSlider = nil; - for (UIView *view in [volumeView subviews]){ - if ([view.class.description isEqualToString:@"MPVolumeSlider"]){ - _volumeViewSlider = (UISlider *)view; - break; - } - } - - // 使用这个category的应用不会随着手机静音键打开而静音,可在手机静音下播放声音 - NSError *setCategoryError = nil; - BOOL success = [[AVAudioSession sharedInstance] - setCategory: AVAudioSessionCategoryPlayback - error: &setCategoryError]; - - if (!success) { /* handle the error in setCategoryError */ } - -} - -/** - * 耳机插入、拔出事件 - */ -- (void)audioRouteChangeListenerCallback:(NSNotification*)notification { - NSDictionary *interuptionDict = notification.userInfo; - - NSInteger routeChangeReason = [[interuptionDict valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue]; - - switch (routeChangeReason) { - - case AVAudioSessionRouteChangeReasonNewDeviceAvailable: - // 耳机插入 - break; - - case AVAudioSessionRouteChangeReasonOldDeviceUnavailable: - { - // 耳机拔掉 - // 拔掉耳机继续播放 - [self play]; - } - break; - - case AVAudioSessionRouteChangeReasonCategoryChange: - // called at start - also when other audio wants to play - NSLog(@"AVAudioSessionRouteChangeReasonCategoryChange"); - break; - } -} - -#pragma mark - KVO - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if (object == self.player.currentItem) { - if ([keyPath isEqualToString:@"status"]) { - - if (self.player.currentItem.status == AVPlayerItemStatusReadyToPlay) { - [self setNeedsLayout]; - [self layoutIfNeeded]; - // 添加playerLayer到self.layer - [self.layer insertSublayer:self.playerLayer atIndex:0]; - self.state = ZFPlayerStatePlaying; - // 加载完成后,再添加平移手势 - // 添加平移手势,用来控制音量、亮度、快进快退 - UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panDirection:)]; - panRecognizer.delegate = self; - [panRecognizer setMaximumNumberOfTouches:1]; - [panRecognizer setDelaysTouchesBegan:YES]; - [panRecognizer setDelaysTouchesEnded:YES]; - [panRecognizer setCancelsTouchesInView:YES]; - [self addGestureRecognizer:panRecognizer]; - - // 跳到xx秒播放视频 - if (self.seekTime) { - [self seekToTime:self.seekTime completionHandler:nil]; - } - self.player.muted = self.mute; - } else if (self.player.currentItem.status == AVPlayerItemStatusFailed) { - self.state = ZFPlayerStateFailed; - } - } else if ([keyPath isEqualToString:@"loadedTimeRanges"]) { - - // 计算缓冲进度 - NSTimeInterval timeInterval = [self availableDuration]; - CMTime duration = self.playerItem.duration; - CGFloat totalDuration = CMTimeGetSeconds(duration); - [self.controlView zf_playerSetProgress:timeInterval / totalDuration]; - - } else if ([keyPath isEqualToString:@"playbackBufferEmpty"]) { - - // 当缓冲是空的时候 - if (self.playerItem.playbackBufferEmpty) { - self.state = ZFPlayerStateBuffering; - [self bufferingSomeSecond]; - } - - } else if ([keyPath isEqualToString:@"playbackLikelyToKeepUp"]) { - - // 当缓冲好的时候 - if (self.playerItem.playbackLikelyToKeepUp && self.state == ZFPlayerStateBuffering){ - self.state = ZFPlayerStatePlaying; - } - } - } else if (object == self.scrollView) { - if ([keyPath isEqualToString:kZFPlayerViewContentOffset]) { - if (self.isFullScreen) { return; } - // 当tableview滚动时处理playerView的位置 - [self handleScrollOffsetWithDict:change]; - } - } -} - -#pragma mark - tableViewContentOffset - -/** - * KVO TableViewContentOffset - * - * @param dict void - */ -- (void)handleScrollOffsetWithDict:(NSDictionary*)dict { - if ([self.scrollView isKindOfClass:[UITableView class]]) { - UITableView *tableView = (UITableView *)self.scrollView; - UITableViewCell *cell = [tableView cellForRowAtIndexPath:self.indexPath]; - NSArray *visableCells = tableView.visibleCells; - if ([visableCells containsObject:cell]) { - // 在显示中 - [self updatePlayerViewToCell]; - } else { - if (self.stopPlayWhileCellNotVisable) { - [self resetPlayer]; - } else { - // 在底部 - [self updatePlayerViewToBottom]; - } - } - } else if ([self.scrollView isKindOfClass:[UICollectionView class]]) { - UICollectionView *collectionView = (UICollectionView *)self.scrollView; - UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:self.indexPath]; - if ( [collectionView.visibleCells containsObject:cell]) { - // 在显示中 - [self updatePlayerViewToCell]; - } else { - if (self.stopPlayWhileCellNotVisable) { - [self resetPlayer]; - } else { - // 在底部 - [self updatePlayerViewToBottom]; - } - } - } -} - -/** - * 缩小到底部,显示小视频 - */ -- (void)updatePlayerViewToBottom { - if (self.isBottomVideo) { return; } - self.isBottomVideo = YES; - if (self.playDidEnd) { // 如果播放完了,滑动到小屏bottom位置时,直接resetPlayer - self.repeatToPlay = NO; - self.playDidEnd = NO; - [self resetPlayer]; - return; - } - [[UIApplication sharedApplication].keyWindow addSubview:self]; - - if (CGPointEqualToPoint(self.shrinkRightBottomPoint, CGPointZero)) { // 没有初始值 - self.shrinkRightBottomPoint = CGPointMake(10, self.scrollView.contentInset.bottom+10); - } else { - [self setShrinkRightBottomPoint:self.shrinkRightBottomPoint]; - } - // 小屏播放 - [self.controlView zf_playerBottomShrinkPlay]; -} - -/** - * 回到cell显示 - */ -- (void)updatePlayerViewToCell { - if (!self.isBottomVideo) { return; } - self.isBottomVideo = NO; - [self setOrientationPortraitConstraint]; - [self.controlView zf_playerCellPlay]; -} - -/** - * 设置横屏的约束 - */ -- (void)setOrientationLandscapeConstraint:(UIInterfaceOrientation)orientation { - [self toOrientation:orientation]; - self.isFullScreen = YES; -} - -/** - * 设置竖屏的约束 - */ -- (void)setOrientationPortraitConstraint { - if (self.isCellVideo) { - if ([self.scrollView isKindOfClass:[UITableView class]]) { - UITableView *tableView = (UITableView *)self.scrollView; - UITableViewCell *cell = [tableView cellForRowAtIndexPath:self.indexPath]; - self.isBottomVideo = NO; - if (![tableView.visibleCells containsObject:cell]) { - [self updatePlayerViewToBottom]; - } else { - UIView *fatherView = [cell.contentView viewWithTag:self.playerModel.fatherViewTag]; - [self addPlayerToFatherView:fatherView]; - } - } else if ([self.scrollView isKindOfClass:[UICollectionView class]]) { - UICollectionView *collectionView = (UICollectionView *)self.scrollView; - UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:self.indexPath]; - self.isBottomVideo = NO; - if (![collectionView.visibleCells containsObject:cell]) { - [self updatePlayerViewToBottom]; - } else { - UIView *fatherView = [cell viewWithTag:self.playerModel.fatherViewTag]; - [self addPlayerToFatherView:fatherView]; - } - } - } else { - [self addPlayerToFatherView:self.playerModel.fatherView]; - } - - [self toOrientation:UIInterfaceOrientationPortrait]; - self.isFullScreen = NO; -} - -- (void)toOrientation:(UIInterfaceOrientation)orientation { - // 获取到当前状态条的方向 - UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation; - // 判断如果当前方向和要旋转的方向一致,那么不做任何操作 - if (currentOrientation == orientation) { return; } - - // 根据要旋转的方向,使用Masonry重新修改限制 - if (orientation != UIInterfaceOrientationPortrait) {// - // 这个地方加判断是为了从全屏的一侧,直接到全屏的另一侧不用修改限制,否则会出错; - if (currentOrientation == UIInterfaceOrientationPortrait) { - [self removeFromSuperview]; - ZFBrightnessView *brightnessView = [ZFBrightnessView sharedBrightnessView]; - [[UIApplication sharedApplication].keyWindow insertSubview:self belowSubview:brightnessView]; - [self mas_remakeConstraints:^(MASConstraintMaker *make) { - make.width.equalTo(@(ScreenHeight)); - make.height.equalTo(@(ScreenWidth)); - make.center.equalTo([UIApplication sharedApplication].keyWindow); - }]; - } - } - // iOS6.0之后,设置状态条的方法能使用的前提是shouldAutorotate为NO,也就是说这个视图控制器内,旋转要关掉; - // 也就是说在实现这个方法的时候-(BOOL)shouldAutorotate返回值要为NO - [[UIApplication sharedApplication] setStatusBarOrientation:orientation animated:NO]; - // 获取旋转状态条需要的时间: - [UIView beginAnimations:nil context:nil]; - [UIView setAnimationDuration:0.3]; - // 更改了状态条的方向,但是设备方向UIInterfaceOrientation还是正方向的,这就要设置给你播放视频的视图的方向设置旋转 - // 给你的播放视频的view视图设置旋转 - self.transform = CGAffineTransformIdentity; - self.transform = [self getTransformRotationAngle]; - // 开始旋转 - [UIView commitAnimations]; -} - -/** - * 获取变换的旋转角度 - * - * @return 角度 - */ -- (CGAffineTransform)getTransformRotationAngle { - // 状态条的方向已经设置过,所以这个就是你想要旋转的方向 - UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; - // 根据要进行旋转的方向来计算旋转的角度 - if (orientation == UIInterfaceOrientationPortrait) { - return CGAffineTransformIdentity; - } else if (orientation == UIInterfaceOrientationLandscapeLeft){ - return CGAffineTransformMakeRotation(-M_PI_2); - } else if(orientation == UIInterfaceOrientationLandscapeRight){ - return CGAffineTransformMakeRotation(M_PI_2); - } - return CGAffineTransformIdentity; -} - -#pragma mark 屏幕转屏相关 - -/** - * 屏幕转屏 - * - * @param orientation 屏幕方向 - */ -- (void)interfaceOrientation:(UIInterfaceOrientation)orientation { - if (orientation == UIInterfaceOrientationLandscapeRight || orientation == UIInterfaceOrientationLandscapeLeft) { - // 设置横屏 - [self setOrientationLandscapeConstraint:orientation]; - } else if (orientation == UIInterfaceOrientationPortrait) { - // 设置竖屏 - [self setOrientationPortraitConstraint]; - } -} - -/** - * 屏幕方向发生变化会调用这里 - */ -- (void)onDeviceOrientationChange { - if (!self.player) { return; } - if (ZFPlayerShared.isLockScreen) { return; } - if (self.didEnterBackground) { return; }; - if (self.playerPushedOrPresented) { return; } - UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; - UIInterfaceOrientation interfaceOrientation = (UIInterfaceOrientation)orientation; - if (orientation == UIDeviceOrientationFaceUp || orientation == UIDeviceOrientationFaceDown || orientation == UIDeviceOrientationUnknown ) { return; } - - switch (interfaceOrientation) { - case UIInterfaceOrientationPortraitUpsideDown:{ - } - break; - case UIInterfaceOrientationPortrait:{ - if (self.isFullScreen) { - [self toOrientation:UIInterfaceOrientationPortrait]; - - } - } - break; - case UIInterfaceOrientationLandscapeLeft:{ - if (self.isFullScreen == NO) { - [self toOrientation:UIInterfaceOrientationLandscapeLeft]; - self.isFullScreen = YES; - } else { - [self toOrientation:UIInterfaceOrientationLandscapeLeft]; - } - - } - break; - case UIInterfaceOrientationLandscapeRight:{ - if (self.isFullScreen == NO) { - [self toOrientation:UIInterfaceOrientationLandscapeRight]; - self.isFullScreen = YES; - } else { - [self toOrientation:UIInterfaceOrientationLandscapeRight]; - } - } - break; - default: - break; - } -} - -// 状态条变化通知(在前台播放才去处理) -- (void)onStatusBarOrientationChange { - if (!self.didEnterBackground) { - // 获取到当前状态条的方向 - UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation; - if (currentOrientation == UIInterfaceOrientationPortrait) { - [self setOrientationPortraitConstraint]; - if (self.cellPlayerOnCenter) { - if ([self.scrollView isKindOfClass:[UITableView class]]) { - UITableView *tableView = (UITableView *)self.scrollView; - [tableView scrollToRowAtIndexPath:self.indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO]; - - } else if ([self.scrollView isKindOfClass:[UICollectionView class]]) { - UICollectionView *collectionView = (UICollectionView *)self.scrollView; - [collectionView scrollToItemAtIndexPath:self.indexPath atScrollPosition:UICollectionViewScrollPositionTop animated:NO]; - } - } - [self.brightnessView removeFromSuperview]; - [[UIApplication sharedApplication].keyWindow addSubview:self.brightnessView]; - [self.brightnessView mas_remakeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(155); - make.leading.mas_equalTo((ScreenWidth-155)/2); - make.top.mas_equalTo((ScreenHeight-155)/2); - }]; - } else { - if (currentOrientation == UIInterfaceOrientationLandscapeRight) { - [self toOrientation:UIInterfaceOrientationLandscapeRight]; - } else if (currentOrientation == UIDeviceOrientationLandscapeLeft){ - [self toOrientation:UIInterfaceOrientationLandscapeLeft]; - } - [self.brightnessView removeFromSuperview]; - [self addSubview:self.brightnessView]; - [self.brightnessView mas_remakeConstraints:^(MASConstraintMaker *make) { - make.center.mas_equalTo(self); - make.width.height.mas_equalTo(155); - }]; - - } - } -} - -/** - * 锁定屏幕方向按钮 - * - * @param sender UIButton - */ -- (void)lockScreenAction:(UIButton *)sender { - sender.selected = !sender.selected; - self.isLocked = sender.selected; - // 调用AppDelegate单例记录播放状态是否锁屏,在TabBarController设置哪些页面支持旋转 - ZFPlayerShared.isLockScreen = sender.selected; -} - -/** - * 解锁屏幕方向锁定 - */ -- (void)unLockTheScreen { - // 调用AppDelegate单例记录播放状态是否锁屏 - ZFPlayerShared.isLockScreen = NO; - [self.controlView zf_playerLockBtnState:NO]; - self.isLocked = NO; - [self interfaceOrientation:UIInterfaceOrientationPortrait]; -} - -#pragma mark - 缓冲较差时候 - -/** - * 缓冲较差时候回调这里 - */ -- (void)bufferingSomeSecond { - self.state = ZFPlayerStateBuffering; - // playbackBufferEmpty会反复进入,因此在bufferingOneSecond延时播放执行完之前再调用bufferingSomeSecond都忽略 - __block BOOL isBuffering = NO; - if (isBuffering) return; - isBuffering = YES; - - // 需要先暂停一小会之后再播放,否则网络状况不好的时候时间在走,声音播放不出来 - [self.player pause]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - - // 如果此时用户已经暂停了,则不再需要开启播放了 - if (self.isPauseByUser) { - isBuffering = NO; - return; - } - - [self play]; - // 如果执行了play还是没有播放则说明还没有缓存好,则再次缓存一段时间 - isBuffering = NO; - if (!self.playerItem.isPlaybackLikelyToKeepUp) { [self bufferingSomeSecond]; } - - }); -} - -#pragma mark - 计算缓冲进度 - -/** - * 计算缓冲进度 - * - * @return 缓冲进度 - */ -- (NSTimeInterval)availableDuration { - NSArray *loadedTimeRanges = [[_player currentItem] loadedTimeRanges]; - CMTimeRange timeRange = [loadedTimeRanges.firstObject CMTimeRangeValue];// 获取缓冲区域 - float startSeconds = CMTimeGetSeconds(timeRange.start); - float durationSeconds = CMTimeGetSeconds(timeRange.duration); - NSTimeInterval result = startSeconds + durationSeconds;// 计算缓冲总进度 - return result; -} - -#pragma mark - Action - -/** - * 轻拍方法 - * - * @param gesture UITapGestureRecognizer - */ -- (void)singleTapAction:(UIGestureRecognizer *)gesture { - if ([gesture isKindOfClass:[NSNumber class]] && ![(id)gesture boolValue]) { - [self _fullScreenAction]; - return; - } - if (gesture.state == UIGestureRecognizerStateRecognized) { - if (self.isBottomVideo && !self.isFullScreen) { [self _fullScreenAction]; } - else { - if (self.playDidEnd) { return; } - else { - [self.controlView zf_playerShowOrHideControlView]; - } - } - } -} - -/** - * 双击播放/暂停 - * - * @param gesture UITapGestureRecognizer - */ -- (void)doubleTapAction:(UIGestureRecognizer *)gesture { - if (self.playDidEnd) { return; } - // 显示控制层 - [self.controlView zf_playerShowControlView]; - if (self.isPauseByUser) { [self play]; } - else { [self pause]; } - if (!self.isAutoPlay) { - self.isAutoPlay = YES; - [self configZFPlayer]; - } -} - -- (void)shrikPanAction:(UIPanGestureRecognizer *)gesture { - CGPoint point = [gesture locationInView:[UIApplication sharedApplication].keyWindow]; - ZFPlayerView *view = (ZFPlayerView *)gesture.view; - const CGFloat width = view.frame.size.width; - const CGFloat height = view.frame.size.height; - const CGFloat distance = 10; // 离四周的最小边距 - - if (gesture.state == UIGestureRecognizerStateEnded) { - // x轴的的移动 - if (point.x < width/2) { - point.x = width/2 + distance; - } else if (point.x > ScreenWidth - width/2) { - point.x = ScreenWidth - width/2 - distance; - } - // y轴的移动 - if (point.y < height/2) { - point.y = height/2 + distance; - } else if (point.y > ScreenHeight - height/2) { - point.y = ScreenHeight - height/2 - distance; - } - - [UIView animateWithDuration:0.5 animations:^{ - view.center = point; - self.shrinkRightBottomPoint = CGPointMake(ScreenWidth - view.frame.origin.x - width, ScreenHeight - view.frame.origin.y - height); - }]; - - } else { - view.center = point; - self.shrinkRightBottomPoint = CGPointMake(ScreenWidth - view.frame.origin.x- view.frame.size.width, ScreenHeight - view.frame.origin.y-view.frame.size.height); - } -} - -/** 全屏 */ -- (void)_fullScreenAction { - if (ZFPlayerShared.isLockScreen) { - [self unLockTheScreen]; - return; - } - if (self.isFullScreen) { - [self interfaceOrientation:UIInterfaceOrientationPortrait]; - self.isFullScreen = NO; - return; - } else { - UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; - if (orientation == UIDeviceOrientationLandscapeRight) { - [self interfaceOrientation:UIInterfaceOrientationLandscapeLeft]; - } else { - [self interfaceOrientation:UIInterfaceOrientationLandscapeRight]; - } - self.isFullScreen = YES; - } -} - -#pragma mark - NSNotification Action - -/** - * 播放完了 - * - * @param notification 通知 - */ -- (void)moviePlayDidEnd:(NSNotification *)notification { - self.state = ZFPlayerStateStopped; - if (self.isBottomVideo && !self.isFullScreen) { // 播放完了,如果是在小屏模式 && 在bottom位置,直接关闭播放器 - self.repeatToPlay = NO; - self.playDidEnd = NO; - [self resetPlayer]; - } else { - if (!self.isDragged) { // 如果不是拖拽中,直接结束播放 - self.playDidEnd = YES; - [self.controlView zf_playerPlayEnd]; - } - } -} - -/** - * 应用退到后台 - */ -- (void)appDidEnterBackground { - self.didEnterBackground = YES; - // 退到后台锁定屏幕方向 - ZFPlayerShared.isLockScreen = YES; - [_player pause]; - self.state = ZFPlayerStatePause; -} - -/** - * 应用进入前台 - */ -- (void)appDidEnterPlayground { - self.didEnterBackground = NO; - // 根据是否锁定屏幕方向 来恢复单例里锁定屏幕的方向 - ZFPlayerShared.isLockScreen = self.isLocked; - if (!self.isPauseByUser) { - self.state = ZFPlayerStatePlaying; - self.isPauseByUser = NO; - [self play]; - } -} - -/** - * 从xx秒开始播放视频跳转 - * - * @param dragedSeconds 视频跳转的秒数 - */ -- (void)seekToTime:(NSInteger)dragedSeconds completionHandler:(void (^)(BOOL finished))completionHandler { - if (self.player.currentItem.status == AVPlayerItemStatusReadyToPlay) { - // seekTime:completionHandler:不能精确定位 - // 如果需要精确定位,可以使用seekToTime:toleranceBefore:toleranceAfter:completionHandler: - // 转换成CMTime才能给player来控制播放进度 - [self.controlView zf_playerActivity:YES]; - [self.player pause]; - CMTime dragedCMTime = CMTimeMake(dragedSeconds, 1); //kCMTimeZero - __weak typeof(self) weakSelf = self; - [self.player seekToTime:dragedCMTime toleranceBefore:CMTimeMake(1,1) toleranceAfter:CMTimeMake(1,1) completionHandler:^(BOOL finished) { - [weakSelf.controlView zf_playerActivity:NO]; - // 视频跳转回调 - if (completionHandler) { completionHandler(finished); } - [weakSelf.player play]; - weakSelf.seekTime = 0; - weakSelf.isDragged = NO; - // 结束滑动 - [weakSelf.controlView zf_playerDraggedEnd]; - if (!weakSelf.playerItem.isPlaybackLikelyToKeepUp && !weakSelf.isLocalVideo) { weakSelf.state = ZFPlayerStateBuffering; } - - }]; - } -} - -#pragma mark - UIPanGestureRecognizer手势方法 - -/** - * pan手势事件 - * - * @param pan UIPanGestureRecognizer - */ -- (void)panDirection:(UIPanGestureRecognizer *)pan { - //根据在view上Pan的位置,确定是调音量还是亮度 - CGPoint locationPoint = [pan locationInView:self]; - - // 我们要响应水平移动和垂直移动 - // 根据上次和本次移动的位置,算出一个速率的point - CGPoint veloctyPoint = [pan velocityInView:self]; - - // 判断是垂直移动还是水平移动 - switch (pan.state) { - case UIGestureRecognizerStateBegan:{ // 开始移动 - // 使用绝对值来判断移动的方向 - CGFloat x = fabs(veloctyPoint.x); - CGFloat y = fabs(veloctyPoint.y); - if (x > y) { // 水平移动 - // 取消隐藏 - self.panDirection = PanDirectionHorizontalMoved; - // 给sumTime初值 - CMTime time = self.player.currentTime; - self.sumTime = time.value/time.timescale; - } - else if (x < y){ // 垂直移动 - self.panDirection = PanDirectionVerticalMoved; - // 开始滑动的时候,状态改为正在控制音量 - if (locationPoint.x > self.bounds.size.width / 2) { - self.isVolume = YES; - }else { // 状态改为显示亮度调节 - self.isVolume = NO; - } - } - break; - } - case UIGestureRecognizerStateChanged:{ // 正在移动 - switch (self.panDirection) { - case PanDirectionHorizontalMoved:{ - [self horizontalMoved:veloctyPoint.x]; // 水平移动的方法只要x方向的值 - break; - } - case PanDirectionVerticalMoved:{ - [self verticalMoved:veloctyPoint.y]; // 垂直移动方法只要y方向的值 - break; - } - default: - break; - } - break; - } - case UIGestureRecognizerStateEnded:{ // 移动停止 - // 移动结束也需要判断垂直或者平移 - // 比如水平移动结束时,要快进到指定位置,如果这里没有判断,当我们调节音量完之后,会出现屏幕跳动的bug - switch (self.panDirection) { - case PanDirectionHorizontalMoved:{ - self.isPauseByUser = NO; - [self seekToTime:self.sumTime completionHandler:nil]; - // 把sumTime滞空,不然会越加越多 - self.sumTime = 0; - break; - } - case PanDirectionVerticalMoved:{ - // 垂直移动结束后,把状态改为不再控制音量 - self.isVolume = NO; - break; - } - default: - break; - } - break; - } - default: - break; - } -} - -/** - * pan垂直移动的方法 - * - * @param value void - */ -- (void)verticalMoved:(CGFloat)value { - self.isVolume ? (self.volumeViewSlider.value -= value / 10000) : ([UIScreen mainScreen].brightness -= value / 10000); -} - -/** - * pan水平移动的方法 - * - * @param value void - */ -- (void)horizontalMoved:(CGFloat)value { - // 每次滑动需要叠加时间 - self.sumTime += value / 200; - - // 需要限定sumTime的范围 - CMTime totalTime = self.playerItem.duration; - CGFloat totalMovieDuration = (CGFloat)totalTime.value/totalTime.timescale; - if (self.sumTime > totalMovieDuration) { self.sumTime = totalMovieDuration;} - if (self.sumTime < 0) { self.sumTime = 0; } - - BOOL style = false; - if (value > 0) { style = YES; } - if (value < 0) { style = NO; } - if (value == 0) { return; } - - self.isDragged = YES; - [self.controlView zf_playerDraggedTime:self.sumTime totalTime:totalMovieDuration isForward:style hasPreview:NO]; -} - -/** - * 根据时长求出字符串 - * - * @param time 时长 - * - * @return 时长字符串 - */ -- (NSString *)durationStringWithTime:(int)time { - // 获取分钟 - NSString *min = [NSString stringWithFormat:@"%02d",time / 60]; - // 获取秒数 - NSString *sec = [NSString stringWithFormat:@"%02d",time % 60]; - return [NSString stringWithFormat:@"%@:%@", min, sec]; -} - -#pragma mark - UIGestureRecognizerDelegate - -- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { - - if (gestureRecognizer == self.shrinkPanGesture && self.isCellVideo) { - if (!self.isBottomVideo || self.isFullScreen) { - return NO; - } - } - if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && gestureRecognizer != self.shrinkPanGesture) { - if ((self.isCellVideo && !self.isFullScreen) || self.playDidEnd || self.isLocked){ - return NO; - } - } - if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) { - if (self.isBottomVideo && !self.isFullScreen) { - return NO; - } - } - if ([touch.view isKindOfClass:[UISlider class]]) { - return NO; - } - - return YES; -} - -#pragma mark - Setter - -/** - * videoURL的setter方法 - * - * @param videoURL videoURL - */ -- (void)setVideoURL:(NSURL *)videoURL { - _videoURL = videoURL; - - // 每次加载视频URL都设置重播为NO - self.repeatToPlay = NO; - self.playDidEnd = NO; - - // 添加通知 - [self addNotifications]; - - self.isPauseByUser = YES; - - // 添加手势 - [self createGesture]; - -} - -/** - * 设置播放的状态 - * - * @param state ZFPlayerState - */ -- (void)setState:(ZFPlayerState)state { - _state = state; - // 控制菊花显示、隐藏 - [self.controlView zf_playerActivity:state == ZFPlayerStateBuffering]; - if (state == ZFPlayerStatePlaying || state == ZFPlayerStateBuffering) { - // 隐藏占位图 - [self.controlView zf_playerItemPlaying]; - } else if (state == ZFPlayerStateFailed) { - NSError *error = [self.playerItem error]; - [self.controlView zf_playerItemStatusFailed:error]; - } -} - -/** - * 根据playerItem,来添加移除观察者 - * - * @param playerItem playerItem - */ -- (void)setPlayerItem:(AVPlayerItem *)playerItem { - if (_playerItem == playerItem) {return;} - - if (_playerItem) { - [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:_playerItem]; - [_playerItem removeObserver:self forKeyPath:@"status"]; - [_playerItem removeObserver:self forKeyPath:@"loadedTimeRanges"]; - [_playerItem removeObserver:self forKeyPath:@"playbackBufferEmpty"]; - [_playerItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"]; - } - _playerItem = playerItem; - if (playerItem) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayDidEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:playerItem]; - [playerItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:nil]; - [playerItem addObserver:self forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew context:nil]; - // 缓冲区空了,需要等待数据 - [playerItem addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:nil]; - // 缓冲区有足够数据可以播放了 - [playerItem addObserver:self forKeyPath:@"playbackLikelyToKeepUp" options:NSKeyValueObservingOptionNew context:nil]; - } -} - -/** - * 根据tableview的值来添加、移除观察者 - * - * @param tableView tableView - */ -- (void)setScrollView:(UIScrollView *)scrollView { - if (_scrollView == scrollView) { return; } - if (_scrollView) { - [_scrollView removeObserver:self forKeyPath:kZFPlayerViewContentOffset]; - } - _scrollView = scrollView; - if (scrollView) { [scrollView addObserver:self forKeyPath:kZFPlayerViewContentOffset options:NSKeyValueObservingOptionNew context:nil]; } -} - -/** - * 设置playerLayer的填充模式 - * - * @param playerLayerGravity playerLayerGravity - */ -- (void)setPlayerLayerGravity:(ZFPlayerLayerGravity)playerLayerGravity { - _playerLayerGravity = playerLayerGravity; - switch (playerLayerGravity) { - case ZFPlayerLayerGravityResize: - self.playerLayer.videoGravity = AVLayerVideoGravityResize; - self.videoGravity = AVLayerVideoGravityResize; - break; - case ZFPlayerLayerGravityResizeAspect: - self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspect; - self.videoGravity = AVLayerVideoGravityResizeAspect; - break; - case ZFPlayerLayerGravityResizeAspectFill: - self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; - self.videoGravity = AVLayerVideoGravityResizeAspectFill; - break; - default: - break; - } -} - -/** - * 是否有下载功能 - */ -- (void)setHasDownload:(BOOL)hasDownload { - _hasDownload = hasDownload; - [self.controlView zf_playerHasDownloadFunction:hasDownload]; -} - -- (void)setResolutionDic:(NSDictionary *)resolutionDic { - _resolutionDic = resolutionDic; - self.videoURLArray = [resolutionDic allValues]; -} - -- (void)setControlView:(UIView *)controlView { - if (_controlView) { return; } - _controlView = controlView; - controlView.delegate = self; - [self addSubview:controlView]; - [controlView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(UIEdgeInsetsZero); - }]; -} - -- (void)setPlayerModel:(ZFPlayerModel *)playerModel { - _playerModel = playerModel; - - if (playerModel.seekTime) { self.seekTime = playerModel.seekTime; } - [self.controlView zf_playerModel:playerModel]; - // 分辨率 - if (playerModel.resolutionDic) { - self.resolutionDic = playerModel.resolutionDic; - } - - if (playerModel.scrollView && playerModel.indexPath && playerModel.videoURL) { - NSCAssert(playerModel.fatherViewTag, @"请指定playerViews所在的faterViewTag"); - [self cellVideoWithScrollView:playerModel.scrollView AtIndexPath:playerModel.indexPath]; - if ([self.scrollView isKindOfClass:[UITableView class]]) { - UITableView *tableView = (UITableView *)playerModel.scrollView; - UITableViewCell *cell = [tableView cellForRowAtIndexPath:playerModel.indexPath]; - UIView *fatherView = [cell.contentView viewWithTag:playerModel.fatherViewTag]; - [self addPlayerToFatherView:fatherView]; - } else if ([self.scrollView isKindOfClass:[UICollectionView class]]) { - UICollectionView *collectionView = (UICollectionView *)playerModel.scrollView; - UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:playerModel.indexPath]; - UIView *fatherView = [cell.contentView viewWithTag:playerModel.fatherViewTag]; - [self addPlayerToFatherView:fatherView]; - } - } else { - NSCAssert(playerModel.fatherView, @"请指定playerView的faterView"); - [self addPlayerToFatherView:playerModel.fatherView]; - } - self.videoURL = playerModel.videoURL; -} - -- (void)setShrinkRightBottomPoint:(CGPoint)shrinkRightBottomPoint { - _shrinkRightBottomPoint = shrinkRightBottomPoint; - CGFloat width = ScreenWidth*0.5-20; - CGFloat height = (self.bounds.size.height / self.bounds.size.width); - [self mas_remakeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(width); - make.height.equalTo(self.mas_width).multipliedBy(height); - make.trailing.mas_equalTo(-shrinkRightBottomPoint.x); - make.bottom.mas_equalTo(-shrinkRightBottomPoint.y); - }]; -} - -- (void)setPlayerPushedOrPresented:(BOOL)playerPushedOrPresented { - _playerPushedOrPresented = playerPushedOrPresented; - if (playerPushedOrPresented) { - [self pause]; - } else { - [self play]; - } -} -#pragma mark - Getter - -- (AVAssetImageGenerator *)imageGenerator { - if (!_imageGenerator) { - _imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:self.urlAsset]; - } - return _imageGenerator; -} - -- (ZFBrightnessView *)brightnessView { - if (!_brightnessView) { - _brightnessView = [ZFBrightnessView sharedBrightnessView]; - } - return _brightnessView; -} - -- (NSString *)videoGravity { - if (!_videoGravity) { - _videoGravity = AVLayerVideoGravityResizeAspect; - } - return _videoGravity; -} - -#pragma mark - ZFPlayerControlViewDelegate - -- (void)zf_controlView:(UIView *)controlView playAction:(UIButton *)sender { - self.isPauseByUser = !self.isPauseByUser; - if (self.isPauseByUser) { - [self pause]; - if (self.state == ZFPlayerStatePlaying) { self.state = ZFPlayerStatePause;} - } else { - [self play]; - if (self.state == ZFPlayerStatePause) { self.state = ZFPlayerStatePlaying; } - } - - if (!self.isAutoPlay) { - self.isAutoPlay = YES; - [self configZFPlayer]; - } -} - -- (void)zf_controlView:(UIView *)controlView backAction:(UIButton *)sender { - if (ZFPlayerShared.isLockScreen) { - [self unLockTheScreen]; - } else { - if (!self.isFullScreen) { - // player加到控制器上,只有一个player时候 - [self pause]; - if ([self.delegate respondsToSelector:@selector(zf_playerBackAction)]) { [self.delegate zf_playerBackAction]; } - } else { - [self interfaceOrientation:UIInterfaceOrientationPortrait]; - } - } -} - -- (void)zf_controlView:(UIView *)controlView closeAction:(UIButton *)sender { - [self resetPlayer]; - [self removeFromSuperview]; -} - -- (void)zf_controlView:(UIView *)controlView fullScreenAction:(UIButton *)sender { - [self _fullScreenAction]; -} - -- (void)zf_controlView:(UIView *)controlView lockScreenAction:(UIButton *)sender { - self.isLocked = sender.selected; - // 调用AppDelegate单例记录播放状态是否锁屏 - ZFPlayerShared.isLockScreen = sender.selected; -} - -- (void)zf_controlView:(UIView *)controlView cneterPlayAction:(UIButton *)sender { - [self configZFPlayer]; -} - -- (void)zf_controlView:(UIView *)controlView repeatPlayAction:(UIButton *)sender { - // 没有播放完 - self.playDidEnd = NO; - // 重播改为NO - self.repeatToPlay = NO; - [self seekToTime:0 completionHandler:nil]; - - if ([self.videoURL.scheme isEqualToString:@"file"]) { - self.state = ZFPlayerStatePlaying; - } else { - self.state = ZFPlayerStateBuffering; - } -} - -/** 加载失败按钮事件 */ -- (void)zf_controlView:(UIView *)controlView failAction:(UIButton *)sender { - [self configZFPlayer]; -} - -- (void)zf_controlView:(UIView *)controlView resolutionAction:(UIButton *)sender { - // 记录切换分辨率的时刻 - NSInteger currentTime = (NSInteger)CMTimeGetSeconds([self.player currentTime]); - NSString *videoStr = self.videoURLArray[sender.tag - 200]; - NSURL *videoURL = [NSURL URLWithString:videoStr]; - if ([videoURL isEqual:self.videoURL]) { return; } - self.isChangeResolution = YES; - // reset player - [self resetToPlayNewURL]; - self.videoURL = videoURL; - // 从xx秒播放 - self.seekTime = currentTime; - // 切换完分辨率自动播放 - [self autoPlayTheVideo]; -} - -- (void)zf_controlView:(UIView *)controlView downloadVideoAction:(UIButton *)sender { - NSString *urlStr = self.videoURL.absoluteString; - if ([self.delegate respondsToSelector:@selector(zf_playerDownload:)]) { - [self.delegate zf_playerDownload:urlStr]; - } -} - -- (void)zf_controlView:(UIView *)controlView progressSliderTap:(CGFloat)value { - // 视频总时间长度 - CGFloat total = (CGFloat)self.playerItem.duration.value / self.playerItem.duration.timescale; - //计算出拖动的当前秒数 - NSInteger dragedSeconds = floorf(total * value); - - [self.controlView zf_playerPlayBtnState:YES]; - [self seekToTime:dragedSeconds completionHandler:^(BOOL finished) {}]; - -} - -- (void)zf_controlView:(UIView *)controlView progressSliderValueChanged:(UISlider *)slider { - // 拖动改变视频播放进度 - if (self.player.currentItem.status == AVPlayerItemStatusReadyToPlay) { - self.isDragged = YES; - BOOL style = false; - CGFloat value = slider.value - self.sliderLastValue; - if (value > 0) { style = YES; } - if (value < 0) { style = NO; } - if (value == 0) { return; } - - self.sliderLastValue = slider.value; - - CGFloat totalTime = (CGFloat)_playerItem.duration.value / _playerItem.duration.timescale; - - //计算出拖动的当前秒数 - CGFloat dragedSeconds = floorf(totalTime * slider.value); - - //转换成CMTime才能给player来控制播放进度 - CMTime dragedCMTime = CMTimeMake(dragedSeconds, 1); - - [controlView zf_playerDraggedTime:dragedSeconds totalTime:totalTime isForward:style hasPreview:self.isFullScreen ? self.hasPreviewView : NO]; - - if (totalTime > 0) { // 当总时长 > 0时候才能拖动slider - if (self.isFullScreen && self.hasPreviewView) { - - [self.imageGenerator cancelAllCGImageGeneration]; - self.imageGenerator.appliesPreferredTrackTransform = YES; - self.imageGenerator.maximumSize = CGSizeMake(100, 56); - AVAssetImageGeneratorCompletionHandler handler = ^(CMTime requestedTime, CGImageRef im, CMTime actualTime, AVAssetImageGeneratorResult result, NSError *error){ - NSLog(@"%zd",result); - if (result != AVAssetImageGeneratorSucceeded) { - dispatch_async(dispatch_get_main_queue(), ^{ - [controlView zf_playerDraggedTime:dragedSeconds sliderImage:self.thumbImg ? : ZFPlayerImage(@"ZFPlayer_loading_bgView")]; - }); - } else { - self.thumbImg = [UIImage imageWithCGImage:im]; - dispatch_async(dispatch_get_main_queue(), ^{ - [controlView zf_playerDraggedTime:dragedSeconds sliderImage:self.thumbImg ? : ZFPlayerImage(@"ZFPlayer_loading_bgView")]; - }); - } - }; - [self.imageGenerator generateCGImagesAsynchronouslyForTimes:[NSArray arrayWithObject:[NSValue valueWithCMTime:dragedCMTime]] completionHandler:handler]; - } - } else { - // 此时设置slider值为0 - slider.value = 0; - } - - }else { // player状态加载失败 - // 此时设置slider值为0 - slider.value = 0; - } - -} - -- (void)zf_controlView:(UIView *)controlView progressSliderTouchEnded:(UISlider *)slider { - if (self.player.currentItem.status == AVPlayerItemStatusReadyToPlay) { - self.isPauseByUser = NO; - self.isDragged = NO; - // 视频总时间长度 - CGFloat total = (CGFloat)_playerItem.duration.value / _playerItem.duration.timescale; - //计算出拖动的当前秒数 - NSInteger dragedSeconds = floorf(total * slider.value); - [self seekToTime:dragedSeconds completionHandler:nil]; - } -} - -- (void)zf_controlViewWillShow:(UIView *)controlView isFullscreen:(BOOL)fullscreen { - if ([self.delegate respondsToSelector:@selector(zf_playerControlViewWillShow:isFullscreen:)]) { - [self.delegate zf_playerControlViewWillShow:controlView isFullscreen:fullscreen]; - } -} - -- (void)zf_controlViewWillHidden:(UIView *)controlView isFullscreen:(BOOL)fullscreen { - if ([self.delegate respondsToSelector:@selector(zf_playerControlViewWillHidden:isFullscreen:)]) { - [self.delegate zf_playerControlViewWillHidden:controlView isFullscreen:fullscreen]; - } -} - -#pragma clang diagnostic pop - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/LICENSE b/iOSProject/Pods/ZJScrollPageView/LICENSE deleted file mode 100755 index 5042b2fe..00000000 --- a/iOSProject/Pods/ZJScrollPageView/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 ZeroJ - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/iOSProject/Pods/ZJScrollPageView/README.md b/iOSProject/Pods/ZJScrollPageView/README.md deleted file mode 100755 index 5b245306..00000000 --- a/iOSProject/Pods/ZJScrollPageView/README.md +++ /dev/null @@ -1,254 +0,0 @@ -# ZJScrollPageView -####OC版的简单方便的集成网易新闻, 腾讯视频, 头条 等首页的滑块视图联动的效果, segmentVIew, scrollViewController - -###swift版本的请点[这里](https://github.com/jasnig/ScrollPageView) - -####注意,如果您需要查看详细的注释, 可以下载swift版本里面, 这里很多地方就没有把注释移过来了 ----- -##使用示例效果 -![滚动示例1.gif](http://upload-images.jianshu.io/upload_images/1271831-ecb291a43d1e5209.gif?imageMogr2/auto-orient/strip)![滚动示例2.gif](http://upload-images.jianshu.io/upload_images/1271831-bd679dbe86ab7404.gif?imageMogr2/auto-orient/strip)![滚动示例3.gif](http://upload-images.jianshu.io/upload_images/1271831-e094a23212160015.gif?imageMogr2/auto-orient/strip) - -![滚动示例4.gif](http://upload-images.jianshu.io/upload_images/1271831-829166f3911adff6.gif?imageMogr2/auto-orient/strip)![滚动示例5.gif](http://upload-images.jianshu.io/upload_images/1271831-3f2b8dc30bf013b1.gif?imageMogr2/auto-orient/strip)![滚动示例6.gif](http://upload-images.jianshu.io/upload_images/1271831-6d37b6b5699e63a6.gif?imageMogr2/auto-orient/strip) - -![滚动示例7.gif](http://upload-images.jianshu.io/upload_images/1271831-d4c09a66bd840fe4.gif?imageMogr2/auto-orient/strip) -![滚动示例8.gif](http://upload-images.jianshu.io/upload_images/1271831-c6b1d54295f4bcb1.gif?imageMogr2/auto-orient/strip) - -![tupian1](http://upload-images.jianshu.io/upload_images/1271831-7cd2608c83794f15.gif?imageMogr2/auto-orient/strip) -![tupian2.gif](http://upload-images.jianshu.io/upload_images/1271831-6910abfdf29dc67f.gif?imageMogr2/auto-orient/strip) -![tupian3.gif](http://upload-images.jianshu.io/upload_images/1271831-b62f7976f4051931.gif?imageMogr2/auto-orient/strip) -![tupian4.gif](http://upload-images.jianshu.io/upload_images/1271831-bb2c00f01725c010.gif?imageMogr2/auto-orient/strip) - ----- -### 可以简单快速灵活的实现上图中的效果 - ------ - - -### 书写思路移步 -###[简书1](http://www.jianshu.com/p/b84f4dd96d0c) - -## Requirements - -* iOS 7.0+ - - -## Installation - -* ###直接将下载文件的ZJScrollPageView文件夹下的文件拖进您的项目中然后#import "ZJScrollPageView.h"就可以使用了 - -* 使用cocoaPods, 在你项目的Podfile文件里面添加 `pod ZJScrollPageView` - -##usage - -####特别说明 -因为大家可能会复用同一个controller来显示内容 -* 在对应的controller的viewWillAppear()等生命周期里面可以根据不同的title来显示不同的内容或者刷新视图 -* 但是注意ZJScrollPageView不会保证viewWillAppear等生命周期方法一定会调用 -* 所以建议在子控制器中使用ZJScrollPageViewChildVcDelegate中的方法来加载不同的数据 - - ----- -###更新说明 -* 2016/05/26 新增了一个通知ScrollPageViewDidShowThePageNotification, 你可以监听这个通知来获取到正在显示的页数, 使用的示例可以参照 ZJSegmentStyle.h里面的说明 -* 2016/05/27 增加了一个style属性 segmentViewBounces, 来设置segmentView是否有弹性 -* 2016/05/27 增加了一个style属性 scrollContentView, 来设置contentView是否能滑动 -* 2016/06/12 增加了一个分类, 提供了 scrollPageParentViewController属性, 方便在每个界面获取到父控制器 -* 2016/06/29 更改了初始化方法, 改为了使用代理来传递相关的自控制器 方便动态更新 -* 2016/06/30 新增加了子控制器遵守的协议ZJScrollPageViewChildVcDelegate, 用于页面出现的时候加载数据 -* 2016/08/21 增加了可以显示图片, 和设置图片的不同位置的功能 ----- - - - - -####可以设置的style效果 -``` -/** 是否显示遮盖 默认为NO */ -@property (assign, nonatomic, getter=isShowCover) BOOL showCover; -/** 是否显示滚动条 默认为NO*/ -@property (assign, nonatomic, getter=isShowLine) BOOL showLine; -/** 是否缩放标题 默认为NO*/ -@property (assign, nonatomic, getter=isScaleTitle) BOOL scaleTitle; -/** 是否滚动标题 默认为YES 设置为NO的时候所有的标题将不会滚动, 并且宽度会平分 和系统的segment效果相似 */ -@property (assign, nonatomic, getter=isScrollTitle) BOOL scrollTitle; -/** segmentView是否有弹性 默认为NO*/ -@property (assign, nonatomic, getter=isSegmentViewBounces) BOOL segmentViewBounces; -/** 是否颜色渐变 默认为NO*/ -@property (assign, nonatomic, getter=isGradualChangeTitleColor) BOOL gradualChangeTitleColor; -/** 是否显示附加的按钮 默认为NO*/ -@property (assign, nonatomic, getter=isShowExtraButton) BOOL showExtraButton; -/** 内容view是否能滑动 默认为YES*/ -@property (assign, nonatomic, getter=isScrollContentView) BOOL scrollContentView; -/** 设置附加按钮的背景图片 默认为nil*/ -@property (strong, nonatomic) NSString *extraBtnBackgroundImageName; -/** 滚动条的高度 默认为2 */ -@property (assign, nonatomic) CGFloat scrollLineHeight; -/** 滚动条的颜色 */ -@property (strong, nonatomic) UIColor *scrollLineColor; -/** 遮盖的颜色 */ -@property (strong, nonatomic) UIColor *coverBackgroundColor; -/** 遮盖的圆角 默认为14*/ -@property (assign, nonatomic) CGFloat coverCornerRadius; -/** 遮盖的高度 默认为28*/ -@property (assign, nonatomic) CGFloat coverHeight; -/** 标题之间的间隙 默认为15.0 */ -@property (assign, nonatomic) CGFloat titleMargin; -/** 标题的字体 默认为14 */ -@property (strong, nonatomic) UIFont *titleFont; -/** 标题缩放倍数, 默认1.3 */ -@property (assign, nonatomic) CGFloat titleBigScale; -/** 标题一般状态的颜色 */ -@property (strong, nonatomic) UIColor *normalTitleColor; -/** 标题选中状态的颜色 */ -@property (strong, nonatomic) UIColor *selectedTitleColor; -/** segmentVIew的高度, 这个属性只在使用ZJScrollPageVIew的时候设置生效 */ -@property (assign, nonatomic) CGFloat segmentHeight; -``` - -####一. 使用ScrollPageView , 提供了各种效果的组合,但是不能修改segmentView和ContentView的相对位置,两者是结合在一起的 - - - (void)viewDidLoad { - [super viewDidLoad]; - self.title = @"效果示例"; - - //必要的设置, 如果没有设置可能导致内容显示不正常 - self.automaticallyAdjustsScrollViewInsets = NO; - - ZJSegmentStyle *style = [[ZJSegmentStyle alloc] init]; - //显示遮盖 - style.showCover = YES; - style.segmentViewBounces = NO; - // 颜色渐变 - style.gradualChangeTitleColor = YES; - // 显示附加的按钮 - style.showExtraButton = YES; - // 设置附加按钮的背景图片 - style.extraBtnBackgroundImageName = @"extraBtnBackgroundImage"; - - self.titles = @[@"新闻头条", - @"国际要闻", - @"体育", - @"中国足球", - @"汽车", - @"囧途旅游", - @"幽默搞笑", - @"视频", - @"无厘头", - @"美女图片", - @"今日房价", - @"头像", - ]; - // 初始化 - CGRect scrollPageViewFrame = CGRectMake(0, 64.0, self.view.bounds.size.width, self.view.bounds.size.height - 64.0); - ZJScrollPageView *scrollPageView = [[ZJScrollPageView alloc] initWithFrame:scrollPageViewFrame segmentStyle:style titles:_titles parentViewController:self delegate:self]; - self.scrollPageView = scrollPageView; - // 额外的按钮响应的block - __weak typeof(self) weakSelf = self; - - - self.scrollPageView.extraBtnOnClick = ^(UIButton *extraBtn){ - weakSelf.title = @"点击了extraBtn"; - NSLog(@"点击了extraBtn"); - - }; - [self.view addSubview:self.scrollPageView]; -} - - -代理方法 - - - (NSInteger)numberOfChildViewControllers { - return self.titles.count;// 传入页面的总数, 推荐使用titles.count - } - - - (UIViewController *)childViewController:(UIViewController *)reuseViewController forIndex:(NSInteger)index { - - UIViewController *childVc = reuseViewController; - // 这里一定要判断传过来的是否是nil, 如果为nil直接使用并返回 - // 如果不为nil 就创建 - if (childVc == nil) { - childVc = [UIViewController new]; - - if (index%2 == 0) { - childVc.view.backgroundColor = [UIColor redColor]; - } else { - childVc.view.backgroundColor = [UIColor cyanColor]; - - } - - } - return childVc; - } -####二 使用 ZJScrollSegmentView 和 ZJContentView, 提供相同的效果组合, 但是同时可以分离开segmentView和contentView,可以单独设置他们的frame, 使用更灵活 - - - - (void)viewDidLoad { - [super viewDidLoad]; - self.title = @"效果示例"; - - //必要的设置, 如果没有设置可能导致内容显示不正常 - self.automaticallyAdjustsScrollViewInsets = NO; - self.childVcs = [self setupChildVc]; - // 初始化 - [self setupSegmentView]; - [self setupContentView]; - - } - - -###setupSegmentView - // 注意: 一定要避免循环引用!! - __weak typeof(self) weakSelf = self; - ZJScrollSegmentView *segment = [[ZJScrollSegmentView alloc] initWithFrame:CGRectMake(0, 64.0, 160.0, 28.0) segmentStyle:style titles:titles titleDidClick:^(UILabel *label, NSInteger index) { - - [weakSelf.contentView setContentOffSet:CGPointMake(weakSelf.contentView.bounds.size.width * index, 0.0) animated:YES]; - - }]; - // 自定义标题的样式 - segment.layer.cornerRadius = 14.0; - segment.backgroundColor = [UIColor redColor]; - // 当然推荐直接设置背景图片的方式 - // segment.backgroundImage = [UIImage imageNamed:@"extraBtnBackgroundImage"]; - - self.segmentView = segment; - self.navigationItem.titleView = self.segmentView; - - -###setupContentView - - ZJContentView *content = [[ZJContentView alloc] initWithFrame:CGRectMake(0.0, 64.0, self.view.bounds.size.width, self.view.bounds.size.height - 64.0) segmentView:self.segmentView parentViewController:self delegate:self]; - self.contentView = content; - [self.view addSubview:self.contentView]; - 代理方法 - - - (NSInteger)numberOfChildViewControllers { - return self.titles.count; - } - - - (UIViewController *)childViewController:(UIViewController *)reuseViewController forIndex:(NSInteger)index { - UIViewController *childVc = reuseViewController; - if (childVc == nil) { - childVc = self.childVcs[index]; - - if (index%2 == 0) { - childVc.view.backgroundColor = [UIColor redColor]; - } else { - childVc.view.backgroundColor = [UIColor cyanColor]; - - } - - } - return childVc; - } - - - -###如果有建议, 请随意issue或者P-R - - -####如果对你有帮助,请随手给个star -####如果你在使用中遇到问题: 可以联系我QQ: 854136959 - -## License - -ScrollPageView is released under the MIT license. See LICENSE for details. \ No newline at end of file diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIView+ZJFrame.h b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIView+ZJFrame.h deleted file mode 100755 index 72f58fbd..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIView+ZJFrame.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// UIView+Frame.h -// BuDeJie -// -// Created by yz on 15/10/29. -// Copyright © 2015年 yz. All rights reserved. -// - -#import - -@interface UIView (ZJFrame) - -@property (nonatomic, assign) CGFloat zj_centerX; -@property (nonatomic, assign) CGFloat zj_centerY; - -@property (nonatomic, assign) CGFloat zj_x; -@property (nonatomic, assign) CGFloat zj_y; -@property (nonatomic, assign) CGFloat zj_width; -@property (nonatomic, assign) CGFloat zj_height; - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIView+ZJFrame.m b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIView+ZJFrame.m deleted file mode 100755 index 69e1d6f9..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIView+ZJFrame.m +++ /dev/null @@ -1,82 +0,0 @@ -// -// UIView+Frame.m -// BuDeJie -// -// Created by yz on 15/10/29. -// Copyright © 2015年 yz. All rights reserved. -// - -#import "UIView+ZJFrame.h" - -@implementation UIView (ZJFrame) - -- (CGFloat)zj_height -{ - return self.frame.size.height; -} - -- (CGFloat)zj_width -{ - return self.frame.size.width; -} - -- (void)setZj_height:(CGFloat)zj_height { - CGRect frame = self.frame; - frame.size.height = zj_height; - self.frame = frame; -} -- (void)setZj_width:(CGFloat)zj_width { - CGRect frame = self.frame; - frame.size.width = zj_width; - self.frame = frame; -} - -- (CGFloat)zj_x -{ - return self.frame.origin.x; -} - -- (void)setZj_x:(CGFloat)zj_x { - CGRect frame = self.frame; - frame.origin.x = zj_x; - self.frame = frame; -} - - -- (CGFloat)zj_y -{ - return self.frame.origin.y; -} - - -- (void)setZj_y:(CGFloat)zj_y { - CGRect frame = self.frame; - frame.origin.y = zj_y; - self.frame = frame; -} - - -- (void)setZj_centerX:(CGFloat)zj_centerX { - CGPoint center = self.center; - center.x = zj_centerX; - self.center = center; -} - -- (CGFloat)zj_centerX -{ - return self.center.x; -} - - -- (void)setZj_centerY:(CGFloat)zj_centerY { - CGPoint center = self.center; - center.y = zj_centerY; - self.center = center; -} - -- (CGFloat)zj_centerY -{ - return self.center.y; -} - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIViewController+ZJScrollPageController.h b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIViewController+ZJScrollPageController.h deleted file mode 100755 index 30ce315a..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIViewController+ZJScrollPageController.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// UIViewController+UIViewController_ZJScrollPageController.h -// ZJScrollPageView -// -// Created by jasnig on 16/6/7. -// Copyright © 2016年 ZeroJ. All rights reserved. -// -#import - - -@interface UIViewController (ZJScrollPageController) -/** - * 所有子控制的父控制器, 方便在每个子控制页面直接获取到父控制器进行其他操作 - */ -@property (nonatomic, weak, readonly) UIViewController *zj_scrollViewController; - - - - - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIViewController+ZJScrollPageController.m b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIViewController+ZJScrollPageController.m deleted file mode 100755 index be694a8b..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/UIViewController+ZJScrollPageController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// UIViewController+UIViewController_ZJScrollPageController.m -// ZJScrollPageView -// -// Created by jasnig on 16/6/7. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import "UIViewController+ZJScrollPageController.h" -#import "ZJScrollPageViewDelegate.h" - -@implementation UIViewController (ZJScrollPageController) - -//@dynamic zj_scrollViewController; - -- (UIViewController *)zj_scrollViewController { - UIViewController *controller = self; - while (controller) { - if ([controller conformsToProtocol:@protocol(ZJScrollPageViewDelegate)]) { - break; - } - controller = controller.parentViewController; - } - return controller; -} - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJContentView.h b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJContentView.h deleted file mode 100755 index cf810d7b..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJContentView.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// ZJContentView.h -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import -#import "ZJScrollPageViewDelegate.h" -@class ZJScrollSegmentView; -@class ZJContentView; - -@interface ZJContentView : UIView - -/** 必须设置代理和实现相关的方法*/ -@property(weak, nonatomic)id delegate; -@property (strong, nonatomic, readonly) UIScrollView *scrollView; - -/**初始化方法 - * - */ -- (instancetype)initWithFrame:(CGRect)frame segmentView:(ZJScrollSegmentView *)segmentView parentViewController:(UIViewController *)parentViewController delegate:(id) delegate; - -/** 给外界可以设置ContentOffSet的方法 */ -- (void)setContentOffSet:(CGPoint)offset animated:(BOOL)animated; -/** 给外界 重新加载内容的方法 */ -- (void)reload; -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJContentView.m b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJContentView.m deleted file mode 100755 index ead5c442..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJContentView.m +++ /dev/null @@ -1,455 +0,0 @@ -// -// ZJContentView.m -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import "ZJContentView.h" -#import "ZJScrollSegmentView.h" -#import "UIViewController+ZJScrollPageController.h" - -typedef NS_ENUM(NSInteger, ZJScrollPageControllerScrollDirection) { - ZJScrollPageControllerScrollDirectionNone, - ZJScrollPageControllerScrollDirectionLeft, - ZJScrollPageControllerScrollDirectionRight -}; - -@interface ZJContentView () { - CGFloat _oldOffSetX; - BOOL _isLoadFirstView; -// BOOL _isAnimating; -} -/** 避免循环引用*/ -@property (weak, nonatomic) ZJScrollSegmentView *segmentView; - - -// 父类 用于处理添加子控制器 使用weak避免循环引用 -@property (weak, nonatomic) UIViewController *parentViewController; -// 当这个属性设置为YES的时候 就不用处理 scrollView滚动的计算 -@property (assign, nonatomic) BOOL forbidTouchToAdjustPosition; -@property (assign, nonatomic) NSInteger itemsCount; -// 所有的子控制器 -@property (strong, nonatomic) NSMutableDictionary *> *childVcsDic; -// 当前控制器 -@property (strong, nonatomic) UIViewController *currentChildVc; - -/// 如果类似cell缓存一样, 虽然创建的控制器少了, 但是每个页面每次都要重新加载数据, 否则显示的内容就会出错, 貌似还不如每个页面创建一个控制器好 -//@property (strong, nonatomic) NSCache *cacheChildVcs; - -@property (strong, nonatomic) UIScrollView *scrollView; -@property (strong, nonatomic) UIView *currentView; -@property (strong, nonatomic) UIView *oldView; -@property (assign, nonatomic) NSInteger currentIndex; -@property (assign, nonatomic) NSInteger oldIndex; -@property (assign, nonatomic) ZJScrollPageControllerScrollDirection scrollDirection; - -@end - -@implementation ZJContentView -#define cellID @"cellID" - -static NSString *const kContentOffsetOffKey = @"contentOffset"; -#pragma mark - life cycle - -- (instancetype)initWithFrame:(CGRect)frame segmentView:(ZJScrollSegmentView *)segmentView parentViewController:(UIViewController *)parentViewController delegate:(id) delegate { - - if (self = [super initWithFrame:frame]) { - self.segmentView = segmentView; - self.delegate = delegate; - self.parentViewController = parentViewController; - - [self commonInit]; - [self addNotification]; - } - return self; -} - -- (void)commonInit { - - _oldIndex = -1; - _currentIndex = -1; - _oldOffSetX = 0.0f; - _forbidTouchToAdjustPosition = NO; - _isLoadFirstView = YES; - if ([_delegate respondsToSelector:@selector(numberOfChildViewControllers)]) { - self.itemsCount = [_delegate numberOfChildViewControllers]; - } - [self addSubview:self.scrollView]; - - [self setCurrentIndex:0 andScrollDirection:ZJScrollPageControllerScrollDirectionNone]; - - if (self.parentViewController.parentViewController && [self.parentViewController.parentViewController isKindOfClass:[UINavigationController class]]) { - UINavigationController *navi = (UINavigationController *)self.parentViewController.parentViewController; - - if (navi.interactivePopGestureRecognizer) { - navi.interactivePopGestureRecognizer.delegate = self; - [self.scrollView.panGestureRecognizer requireGestureRecognizerToFail:navi.interactivePopGestureRecognizer]; - } - } -} - -- (void)addNotification { - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveMemoryWarningHander:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; -} - -- (void)receiveMemoryWarningHander:(NSNotificationCenter *)noti { - - __weak typeof(self) weakSelf = self; - [_childVcsDic enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, UIViewController * _Nonnull childVc, BOOL * _Nonnull stop) { - __strong typeof(self) strongSelf = weakSelf; - - if (childVc != strongSelf.currentChildVc) { - [_childVcsDic removeObjectForKey:key]; - [ZJContentView removeChildVc:childVc]; - } - - }]; - -} - -- (void)dealloc { - self.parentViewController = nil; - [[NSNotificationCenter defaultCenter] removeObserver:self]; -#if DEBUG - NSLog(@"ZJContentView---销毁"); -#endif -} - -#pragma mark - public helper - -/** 给外界可以设置ContentOffSet的方法 */ -- (void)setContentOffSet:(CGPoint)offset animated:(BOOL)animated { - self.forbidTouchToAdjustPosition = YES; - - NSInteger currentIndex = offset.x/self.scrollView.bounds.size.width; - _oldIndex = _currentIndex; - [self setCurrentIndex:currentIndex andScrollDirection:ZJScrollPageControllerScrollDirectionNone]; - - if (animated) { - CGFloat delta = offset.x - self.scrollView.contentOffset.x; - NSInteger page = fabs(delta)/self.scrollView.bounds.size.width; - if (page>=2) {// 需要滚动两页以上的时候, 跳过中间页的动画 - - __weak typeof(self) weakself = self; - dispatch_async(dispatch_get_main_queue(), ^{ - __strong typeof(weakself) strongSelf = weakself; - if (strongSelf) { - [strongSelf.scrollView setContentOffset:offset animated:NO]; - [self didAppearWithIndex:currentIndex]; - [self didDisappearWithIndex:_oldIndex]; - } - }); - } - else { - [self.scrollView setContentOffset:offset animated:animated]; - [self didAppearWithIndex:currentIndex]; - [self didDisappearWithIndex:_oldIndex]; - - } - } - else { - [self.scrollView setContentOffset:offset animated:animated]; - [self didAppearWithIndex:currentIndex]; - [self didDisappearWithIndex:_oldIndex]; - - - } - -} - -/** 给外界刷新视图的方法 */ -- (void)reload { - - [self.childVcsDic enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, UIViewController * _Nonnull childVc, BOOL * _Nonnull stop) { - [ZJContentView removeChildVc:childVc]; - childVc = nil; - - }]; - self.childVcsDic = nil; - [self.scrollView removeFromSuperview]; - self.scrollView = nil; - [self commonInit]; -} - -+ (void)removeChildVc:(UIViewController *)childVc { - [childVc willMoveToParentViewController:nil]; - [childVc.view removeFromSuperview]; - [childVc removeFromParentViewController]; -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - if (self.forbidTouchToAdjustPosition) {// first or last - return; - } - - if (scrollView.contentOffset.x <= 0) { - [self contentViewDidMoveFromIndex:0 toIndex:0 progress:1.0]; - return; - - } - if (scrollView.contentOffset.x >= scrollView.contentSize.width - scrollView.bounds.size.width) { - [self contentViewDidMoveFromIndex:_itemsCount-1 toIndex:_itemsCount-1 progress:1.0]; - return; - - } - - CGFloat tempProgress = scrollView.contentOffset.x / self.bounds.size.width; - NSInteger tempIndex = (NSInteger)tempProgress; - CGFloat progress = tempProgress - floor(tempProgress); - CGFloat deltaX = scrollView.contentOffset.x - _oldOffSetX; - - if (deltaX > 0 && (deltaX != scrollView.bounds.size.width)) {// 向右 - _oldIndex = tempIndex; - NSInteger tempCurrentIndex = tempIndex + 1; - - [self setCurrentIndex:tempCurrentIndex andScrollDirection:ZJScrollPageControllerScrollDirectionRight]; - - } - else if (deltaX < 0) { - progress = 1.0 - progress; - - _oldIndex = tempIndex + 1; - - [self setCurrentIndex:tempIndex andScrollDirection:ZJScrollPageControllerScrollDirectionLeft]; - - } - else { - return; - } - - NSLog(@"%f------%ld----%ld------", progress, _oldIndex, _currentIndex); - - [self contentViewDidMoveFromIndex:_oldIndex toIndex:_currentIndex progress:progress]; - -} - -/** 滚动减速完成时再更新title的位置 */ -- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { - NSInteger currentIndex = (scrollView.contentOffset.x / self.bounds.size.width); - if (_scrollDirection == ZJScrollPageControllerScrollDirectionNone && !_forbidTouchToAdjustPosition) { // 开启bounds 在第一页和最后一页快速松开手又接触滑动的时候 会不合理的被调用这个代理方法 ---- 其实这个时候并没有在松开手的情况下减速完成 - return; - } - [self contentViewDidMoveFromIndex:currentIndex toIndex:currentIndex progress:1.0]; - // 调整title - [self adjustSegmentTitleOffsetToCurrentIndex:currentIndex]; - - if (scrollView.contentOffset.x == _oldOffSetX) {// 滚动未完成 - - [self didAppearWithIndex:currentIndex]; - [self didDisappearWithIndex:_currentIndex]; - } - else { - [self didAppearWithIndex:_currentIndex]; - [self didDisappearWithIndex:_oldIndex]; - } - // 重置_currentIndex 不触发set方法 - _currentIndex = currentIndex; - _scrollDirection = ZJScrollPageControllerScrollDirectionNone; - -} - - -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { - _oldOffSetX = scrollView.contentOffset.x; - self.forbidTouchToAdjustPosition = NO; - _scrollDirection = ZJScrollPageControllerScrollDirectionNone; - -} - - -#pragma mark - private helper -- (void)contentViewDidMoveFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex progress:(CGFloat)progress { - if(self.segmentView) { - [self.segmentView adjustUIWithProgress:progress oldIndex:fromIndex currentIndex:toIndex]; - } -} - -- (void)adjustSegmentTitleOffsetToCurrentIndex:(NSInteger)index { - if(self.segmentView) { - [self.segmentView adjustTitleOffSetToCurrentIndex:index]; - } - -} - -- (void)willAppearWithIndex:(NSInteger)index { - UIViewController *controller = [self.childVcsDic valueForKey:[NSString stringWithFormat:@"%ld", index]]; - if (controller) { - if ([controller respondsToSelector:@selector(zj_viewWillAppearForIndex:)]) { - [controller zj_viewWillAppearForIndex:index]; - } - - if (_delegate && [_delegate respondsToSelector:@selector(scrollPageController:childViewControllWillAppear:forIndex:)]) { - [_delegate scrollPageController:self.parentViewController childViewControllWillAppear:controller forIndex:index]; - } - } - - -} - -- (void)didAppearWithIndex:(NSInteger)index { - UIViewController *controller = [self.childVcsDic valueForKey:[NSString stringWithFormat:@"%ld", index]]; - if (controller) { - if ([controller respondsToSelector:@selector(zj_viewDidAppearForIndex:)]) { - [controller zj_viewDidAppearForIndex:index]; - } - - if (_delegate && [_delegate respondsToSelector:@selector(scrollPageController:childViewControllDidAppear:forIndex:)]) { - [_delegate scrollPageController:self.parentViewController childViewControllDidAppear:controller forIndex:index]; - } - } - - - -} - -- (void)willDisappearWithIndex:(NSInteger)index { - UIViewController *controller = [self.childVcsDic valueForKey:[NSString stringWithFormat:@"%ld", index]]; - if (controller) { - if ([controller respondsToSelector:@selector(zj_viewWillDisappearForIndex:)]) { - [controller zj_viewWillDisappearForIndex:index]; - } - if (_delegate && [_delegate respondsToSelector:@selector(scrollPageController:childViewControllWillDisappear:forIndex:)]) { - [_delegate scrollPageController:self.parentViewController childViewControllWillDisappear:controller forIndex:index]; - } - } - -} -- (void)didDisappearWithIndex:(NSInteger)index { - UIViewController *controller = [self.childVcsDic valueForKey:[NSString stringWithFormat:@"%ld", index]]; - if (controller) { - if ([controller respondsToSelector:@selector(zj_viewDidDisappearForIndex:)]) { - [controller zj_viewDidDisappearForIndex:index]; - } - if (_delegate && [_delegate respondsToSelector:@selector(scrollPageController:childViewControllDidDisappear:forIndex:)]) { - [_delegate scrollPageController:self.parentViewController childViewControllDidDisappear:controller forIndex:index]; - } - } -} - - -- (void)setCurrentIndex:(NSInteger)currentIndex andScrollDirection:(ZJScrollPageControllerScrollDirection)scrollDirection { - if (currentIndex != _currentIndex) { - -// NSLog(@"current -- %ld _current ---- %ld _oldIndex --- %ld", currentIndex, _currentIndex, _oldIndex); - [self setupSubviewsWithCurrentIndex:currentIndex oldIndex:_oldIndex]; - - if (scrollDirection != ZJScrollPageControllerScrollDirectionNone) { - // 打开右边, 但是未松手又返回了打开左边 - // 打开左边, 但是未松手又返回了打开右边 - [self didDisappearWithIndex:_currentIndex]; - - } - [self willAppearWithIndex:currentIndex]; - [self willDisappearWithIndex:_oldIndex]; - if (_isLoadFirstView) { // 加载第一个controller的时候 同时出发didAppear - [self didAppearWithIndex:currentIndex]; - _isLoadFirstView = NO; - } - - _scrollDirection = scrollDirection; - _currentIndex = currentIndex; - -// NSLog(@"%@",self.scrollView.subviews); - } - -} - -- (void)setupSubviewsWithCurrentIndex:(NSInteger)currentIndex oldIndex:(NSInteger)oldIndex { - UIViewController *currentController = [self.childVcsDic valueForKey:[NSString stringWithFormat:@"%ld", (long)currentIndex]]; - - if (_delegate && [_delegate respondsToSelector:@selector(childViewController:forIndex:)]) { - if (currentController == nil) { - currentController = [_delegate childViewController:nil forIndex:currentIndex]; - [self.childVcsDic setValue:currentController forKey:[NSString stringWithFormat:@"%ld", (long)currentIndex]]; - } else { - [_delegate childViewController:currentController forIndex:currentIndex]; - } - } else { - NSAssert(NO, @"必须设置代理和实现代理方法"); - } - - if ([currentController isKindOfClass:[UINavigationController class]]) { - NSAssert(NO, @"不要添加UINavigationController包装后的子控制器"); - - } - - CGFloat width = self.bounds.size.width; - CGFloat height = self.bounds.size.height; - - // 添加currentController - if (currentController.zj_scrollViewController != self.parentViewController) { - [self.parentViewController addChildViewController:currentController]; - } - [self.currentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; - self.currentView.frame = CGRectMake(currentIndex*width, 0, width, height); - [self.currentView addSubview:currentController.view]; - [_currentChildVc didMoveToParentViewController:self.parentViewController]; - - UIViewController *oldController = [self.childVcsDic valueForKey:[NSString stringWithFormat:@"%ld", (long)_oldIndex]]; - // 添加oldController - if (oldController) { - - [self.oldView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; - self.oldView.frame = CGRectMake(oldIndex*width, 0, width, height); - [self.oldView addSubview:oldController.view]; - [oldController didMoveToParentViewController:self.parentViewController]; - } - - [self setNeedsLayout]; -} - - - -#pragma mark - UIGestureRecognizerDelegate -- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { - if (self.parentViewController.parentViewController && [self.parentViewController.parentViewController isKindOfClass:[UINavigationController class]]) { - UINavigationController *navi = (UINavigationController *)self.parentViewController.parentViewController; - - if (navi.visibleViewController == self.parentViewController) {// 当显示的是ScrollPageView的时候 只在第一个tag处执行pop手势 - - return self.scrollView.contentOffset.x == 0; - } else { - return [super gestureRecognizerShouldBegin:gestureRecognizer]; - } - } - return [super gestureRecognizerShouldBegin:gestureRecognizer]; -} - - -#pragma mark - getter --- setter -- (UIScrollView *)scrollView { - if (!_scrollView) { - UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.bounds]; - - self.currentView = [[UIView alloc] init]; - self.oldView = [[UIView alloc] init]; - scrollView.delegate = self; - [scrollView addSubview:self.currentView]; - [scrollView addSubview:self.oldView]; - - scrollView.pagingEnabled = YES; - scrollView.showsVerticalScrollIndicator = NO; - scrollView.showsHorizontalScrollIndicator = NO; - scrollView.bounces = self.segmentView.segmentStyle.isContentViewBounces; - scrollView.scrollEnabled = self.segmentView.segmentStyle.isScrollContentView; - scrollView.contentSize = CGSizeMake(self.itemsCount*self.bounds.size.width, self.bounds.size.height); - - _scrollView = scrollView; - } - return _scrollView; -} - -- (NSMutableDictionary *> *)childVcsDic { - if (!_childVcsDic) { - NSMutableDictionary *dic = [NSMutableDictionary dictionary]; - _childVcsDic = dic; - } - return _childVcsDic; -} - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView.h b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView.h deleted file mode 100755 index b4d4c5a3..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// ZJScrollPageView.h -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import -#import "UIView+ZJFrame.h" -#import "UIViewController+ZJScrollPageController.h" -#import "ZJContentView.h" -#import "ZJTitleView.h" -#import "ZJScrollSegmentView.h" -#import "ZJSegmentStyle.h" -#import "ZJScrollPageViewDelegate.h" - - - -@interface ZJScrollPageView : UIView -typedef void(^ExtraBtnOnClick)(UIButton *extraBtn); - -@property (copy, nonatomic) ExtraBtnOnClick extraBtnOnClick; -@property (weak, nonatomic, readonly) ZJContentView *contentView; -@property (weak, nonatomic, readonly) ZJScrollSegmentView *segmentView; - -/** 必须设置代理并且实现相应的方法*/ -@property(weak, nonatomic)id delegate; - - -- (instancetype)initWithFrame:(CGRect)frame segmentStyle:(ZJSegmentStyle *)segmentStyle titles:(NSArray *)titles parentViewController:(UIViewController *)parentViewController delegate:(id) delegate ; - -/** 给外界设置选中的下标的方法 */ -- (void)setSelectedIndex:(NSInteger)selectedIndex animated:(BOOL)animated; - -/** 给外界重新设置的标题的方法(同时会重新加载页面的内容) */ -- (void)reloadWithNewTitles:(NSArray *)newTitles; -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView.m b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView.m deleted file mode 100755 index a98e2290..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView.m +++ /dev/null @@ -1,113 +0,0 @@ -// -// ZJScrollPageView.m -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import "ZJScrollPageView.h" - -@interface ZJScrollPageView () -@property (strong, nonatomic) ZJSegmentStyle *segmentStyle; -@property (weak, nonatomic) ZJScrollSegmentView *segmentView; -@property (weak, nonatomic) ZJContentView *contentView; - -@property (weak, nonatomic) UIViewController *parentViewController; -@property (strong, nonatomic) NSArray *childVcs; -@property (strong, nonatomic) NSArray *titlesArray; - -@end -@implementation ZJScrollPageView - -#pragma mark - life cycle - -- (instancetype)initWithFrame:(CGRect)frame segmentStyle:(ZJSegmentStyle *)segmentStyle titles:(NSArray *)titles parentViewController:(UIViewController *)parentViewController delegate:(id) delegate { - if (self = [super initWithFrame:frame]) { - self.segmentStyle = segmentStyle; - self.delegate = delegate; - self.parentViewController = parentViewController; - self.titlesArray = titles.copy; - [self commonInit]; - } - return self; -} - - -- (void)commonInit { - - // 触发懒加载 - self.segmentView.backgroundColor = [UIColor whiteColor]; - self.contentView.backgroundColor = [UIColor whiteColor]; -} - -- (void)dealloc { - NSLog(@"ZJScrollPageView--销毁"); -} - -#pragma mark - public helper - -/** 给外界设置选中的下标的方法 */ -- (void)setSelectedIndex:(NSInteger)selectedIndex animated:(BOOL)animated { - [self.segmentView setSelectedIndex:selectedIndex animated:animated]; -} - -/** 给外界重新设置视图内容的标题的方法 */ -- (void)reloadWithNewTitles:(NSArray *)newTitles { - - self.titlesArray = nil; - self.titlesArray = newTitles.copy; - - [self.segmentView reloadTitlesWithNewTitles:self.titlesArray]; - [self.contentView reload]; -} - - -#pragma mark - getter ---- setter - -- (ZJContentView *)contentView { - if (!_contentView) { - ZJContentView *content = [[ZJContentView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segmentView.frame), self.bounds.size.width, self.bounds.size.height - CGRectGetMaxY(self.segmentView.frame)) segmentView:self.segmentView parentViewController:self.parentViewController delegate:self.delegate]; - [self addSubview:content]; - _contentView = content; - } - - return _contentView; -} - - -- (ZJScrollSegmentView *)segmentView { - if (!_segmentView) { - __weak typeof(self) weakSelf = self; - ZJScrollSegmentView *segment = [[ZJScrollSegmentView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.segmentStyle.segmentHeight) segmentStyle:self.segmentStyle delegate:self.delegate titles:self.titlesArray titleDidClick:^(ZJTitleView *titleView, NSInteger index) { - - [weakSelf.contentView setContentOffSet:CGPointMake(weakSelf.contentView.bounds.size.width * index, 0.0) animated:weakSelf.segmentStyle.isAnimatedContentViewWhenTitleClicked]; - - }]; - [self addSubview:segment]; - _segmentView = segment; - } - return _segmentView; -} - - -- (NSArray *)childVcs { - if (!_childVcs) { - _childVcs = [NSArray array]; - } - return _childVcs; -} - -- (NSArray *)titlesArray { - if (!_titlesArray) { - _titlesArray = [NSArray array]; - } - return _titlesArray; -} - -- (void)setExtraBtnOnClick:(ExtraBtnOnClick)extraBtnOnClick { - _extraBtnOnClick = extraBtnOnClick; - self.segmentView.extraBtnOnClick = extraBtnOnClick; -} - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageViewDelegate.h b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageViewDelegate.h deleted file mode 100644 index 2481fd32..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollPageViewDelegate.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// ZJScrollPageViewDelegate.h -// ZJScrollPageView -// -// Created by ZeroJ on 16/6/30. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import -@class ZJContentView; -@class ZJTitleView; - -@protocol ZJScrollPageViewChildVcDelegate - -@optional -/** - * - * 注意ZJScrollPageView不会保证viewWillAppear等生命周期方法一定会调用 - * 所以建议使用ZJScrollPageViewChildVcDelegate中的方法来替代对应的生命周期方法完成数据的加载 - */ -- (void)zj_viewWillAppearForIndex:(NSInteger)index; -- (void)zj_viewDidAppearForIndex:(NSInteger)index; -- (void)zj_viewWillDisappearForIndex:(NSInteger)index; -- (void)zj_viewDidDisappearForIndex:(NSInteger)index; - -@end - - -@protocol ZJScrollPageViewDelegate -/** 将要显示的子页面的总数 */ -- (NSInteger)numberOfChildViewControllers; - -/** 获取到将要显示的页面的控制器 - * -reuseViewController : 这个是返回给你的controller, 你应该首先判断这个是否为nil, 如果为nil 创建对应的控制器并返回, 如果不为nil直接使用并返回 - * -index : 对应的下标 - */ -- (UIViewController *)childViewController:(UIViewController *)reuseViewController forIndex:(NSInteger)index; - -@optional -- (void)setUpTitleView:(ZJTitleView *)titleView forIndex:(NSInteger)index; - -/** - * 页面将要出现 - * - * @param scrollPageController - * @param childViewController - * @param index - */ -- (void)scrollPageController:(UIViewController *)scrollPageController childViewControllWillAppear:(UIViewController *)childViewController forIndex:(NSInteger)index; -/** - * 页面已经出现 - * - * @param scrollPageController - * @param childViewController - * @param index - */ -- (void)scrollPageController:(UIViewController *)scrollPageController childViewControllDidAppear:(UIViewController *)childViewController forIndex:(NSInteger)index; - -- (void)scrollPageController:(UIViewController *)scrollPageController childViewControllWillDisappear:(UIViewController *)childViewController forIndex:(NSInteger)index; -- (void)scrollPageController:(UIViewController *)scrollPageController childViewControllDidDisappear:(UIViewController *)childViewController forIndex:(NSInteger)index; - - -@end - diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollSegmentView.h b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollSegmentView.h deleted file mode 100755 index 8f2c237f..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollSegmentView.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// ZJScrollSegmentView.h -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import -#import "ZJSegmentStyle.h" -#import "ZJScrollPageViewDelegate.h" -@class ZJSegmentStyle; -@class ZJTitleView; - -typedef void(^TitleBtnOnClickBlock)(ZJTitleView *titleView, NSInteger index); -typedef void(^ExtraBtnOnClick)(UIButton *extraBtn); - -@interface ZJScrollSegmentView : UIView - -// 所有的标题 -@property (strong, nonatomic) NSArray *titles; -// 所有标题的设置 -@property (strong, nonatomic) ZJSegmentStyle *segmentStyle; -@property (copy, nonatomic) ExtraBtnOnClick extraBtnOnClick; -@property (weak, nonatomic) id delegate; -@property (strong, nonatomic) UIImage *backgroundImage; - -- (instancetype)initWithFrame:(CGRect )frame segmentStyle:(ZJSegmentStyle *)segmentStyle delegate:(id)delegate titles:(NSArray *)titles titleDidClick:(TitleBtnOnClickBlock)titleDidClick; - - -/** 点击按钮的时候调整UI*/ -- (void)adjustUIWhenBtnOnClickWithAnimate:(BOOL)animated; -/** 切换下标的时候根据progress同步设置UI*/ -- (void)adjustUIWithProgress:(CGFloat)progress oldIndex:(NSInteger)oldIndex currentIndex:(NSInteger)currentIndex; -/** 让选中的标题居中*/ -- (void)adjustTitleOffSetToCurrentIndex:(NSInteger)currentIndex; -/** 设置选中的下标*/ -- (void)setSelectedIndex:(NSInteger)index animated:(BOOL)animated; -/** 重新刷新标题的内容*/ -- (void)reloadTitlesWithNewTitles:(NSArray *)titles; - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollSegmentView.m b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollSegmentView.m deleted file mode 100755 index dc39d666..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJScrollSegmentView.m +++ /dev/null @@ -1,734 +0,0 @@ -// -// ZJScrollSegmentView.m -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import "ZJScrollSegmentView.h" -#import "ZJTitleView.h" -#import "UIView+ZJFrame.h" - -@interface ZJScrollSegmentView () { - CGFloat _currentWidth; - NSUInteger _currentIndex; - NSUInteger _oldIndex; -// BOOL _isScroll; -} -// 滚动条 -@property (strong, nonatomic) UIView *scrollLine; -// 遮盖 -@property (strong, nonatomic) UIView *coverLayer; -// 滚动scrollView -@property (strong, nonatomic) UIScrollView *scrollView; -// 背景ImageView -@property (strong, nonatomic) UIImageView *backgroundImageView; -// 附加的按钮 -@property (strong, nonatomic) UIButton *extraBtn; - - -// 用于懒加载计算文字的rgb差值, 用于颜色渐变的时候设置 -@property (strong, nonatomic) NSArray *deltaRGB; -@property (strong, nonatomic) NSArray *selectedColorRgb; -@property (strong, nonatomic) NSArray *normalColorRgb; -/** 缓存所有标题label */ -@property (nonatomic, strong) NSMutableArray *titleViews; -// 缓存计算出来的每个标题的宽度 -@property (nonatomic, strong) NSMutableArray *titleWidths; -// 响应标题点击 -@property (copy, nonatomic) TitleBtnOnClickBlock titleBtnOnClick; - -@end - -@implementation ZJScrollSegmentView - -static CGFloat const xGap = 5.0; -static CGFloat const wGap = 2*xGap; -static CGFloat const contentSizeXOff = 20.0; - -#pragma mark - life cycle -- (instancetype)initWithFrame:(CGRect )frame segmentStyle:(ZJSegmentStyle *)segmentStyle delegate:(id)delegate titles:(NSArray *)titles titleDidClick:(TitleBtnOnClickBlock)titleDidClick { - if (self = [super initWithFrame:frame]) { - self.segmentStyle = segmentStyle; - self.titles = titles; - self.titleBtnOnClick = titleDidClick; - self.delegate = delegate; - _currentIndex = 0; - _oldIndex = 0; - _currentWidth = frame.size.width; - - if (!self.segmentStyle.isScrollTitle) { // 不能滚动的时候就不要把缩放和遮盖或者滚动条同时使用, 否则显示效果不好 - - self.segmentStyle.scaleTitle = !(self.segmentStyle.isShowCover || self.segmentStyle.isShowLine); - } - - if (self.segmentStyle.isShowImage) {//不要有以下的显示效果 - self.segmentStyle.scaleTitle = NO; - self.segmentStyle.showCover = NO; - self.segmentStyle.gradualChangeTitleColor = NO; - } - - // 设置了frame之后可以直接设置其他的控件的frame了, 不需要在layoutsubView()里面设置 - [self setupSubviews]; - [self setupUI]; - - } - - return self; -} -- (void)setupSubviews { - - [self addSubview:self.scrollView]; - [self addScrollLineOrCoverOrExtraBtn]; - [self setupTitles]; -} - -- (void)addScrollLineOrCoverOrExtraBtn { - if (self.segmentStyle.isShowLine) { - [self.scrollView addSubview:self.scrollLine]; - } - - if (self.segmentStyle.isShowCover) { - [self.scrollView insertSubview:self.coverLayer atIndex:0]; - - } - - if (self.segmentStyle.isShowExtraButton) { - [self addSubview:self.extraBtn]; - } -} - -- (void)dealloc -{ -#if DEBUG - NSLog(@"ZJScrollSegmentView ---- 销毁"); - -#endif -} - -#pragma mark - button action - -- (void)titleLabelOnClick:(UITapGestureRecognizer *)tapGes { - - ZJTitleView *currentLabel = (ZJTitleView *)tapGes.view; - - if (!currentLabel) { - return; - } - - _currentIndex = currentLabel.tag; - - [self adjustUIWhenBtnOnClickWithAnimate:true]; -} - -- (void)extraBtnOnClick:(UIButton *)extraBtn { - - if (self.extraBtnOnClick) { - self.extraBtnOnClick(extraBtn); - } -} - - -#pragma mark - private helper - -- (void)setupTitles { - - if (self.titles.count == 0) return; - - NSInteger index = 0; - for (NSString *title in self.titles) { - - ZJTitleView *titleView = [[ZJTitleView alloc] initWithFrame:CGRectZero]; - titleView.tag = index; - - titleView.font = self.segmentStyle.titleFont; - titleView.text = title; - titleView.textColor = self.segmentStyle.normalTitleColor; - titleView.imagePosition = self.segmentStyle.imagePosition; - - - if (self.delegate && [self.delegate respondsToSelector:@selector(setUpTitleView:forIndex:)]) { - [self.delegate setUpTitleView:titleView forIndex:index]; - } - - UITapGestureRecognizer *tapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(titleLabelOnClick:)]; - [titleView addGestureRecognizer:tapGes]; - - CGFloat titleViewWidth = [titleView titleViewWidth]; - [self.titleWidths addObject:@(titleViewWidth)]; - - [self.titleViews addObject:titleView]; - [self.scrollView addSubview:titleView]; - - index++; - - } - -} - -- (void)setupUI { - if (self.titles.count == 0) return; - - [self setupScrollViewAndExtraBtn]; - [self setUpTitleViewsPosition]; - [self setupScrollLineAndCover]; - - if (self.segmentStyle.isScrollTitle) { // 设置滚动区域 - ZJTitleView *lastTitleView = (ZJTitleView *)self.titleViews.lastObject; - - if (lastTitleView) { - self.scrollView.contentSize = CGSizeMake(CGRectGetMaxX(lastTitleView.frame) + contentSizeXOff, 0.0); - } - } - -} - -- (void)setupScrollViewAndExtraBtn { - CGFloat extraBtnW = 44.0; - CGFloat extraBtnY = 5.0; - - // UILabel *lastLabel = _titleLabels.lastObject; - // CGFloat maxX = CGRectGetMaxX(lastLabel.frame) + 8; - CGFloat scrollW = self.extraBtn ? _currentWidth - extraBtnW : _currentWidth; - // if (maxX < _currentWidth) { - // scrollW = maxX; - // } - self.scrollView.frame = CGRectMake(0.0, 0.0, scrollW, self.zj_height); - - if (self.extraBtn) { - self.extraBtn.frame = CGRectMake(scrollW , extraBtnY, extraBtnW, self.zj_height - 2*extraBtnY); - } -} - -- (void)setUpTitleViewsPosition { - CGFloat titleX = 0.0; - CGFloat titleY = 0.0; - CGFloat titleW = 0.0; - CGFloat titleH = self.zj_height - self.segmentStyle.scrollLineHeight; - - if (!self.segmentStyle.isScrollTitle) {// 标题不能滚动, 平分宽度 - titleW = _currentWidth / self.titles.count; - - NSInteger index = 0; - for (ZJTitleView *titleView in self.titleViews) { - - titleX = index * titleW; - - titleView.frame = CGRectMake(titleX, titleY, titleW, titleH); - if (self.segmentStyle.isShowImage) { - [titleView adjustSubviewFrame]; - } - index++; - } - - } else { - NSInteger index = 0; - float lastLableMaxX = self.segmentStyle.titleMargin; - float addedMargin = 0.0f; - if (self.segmentStyle.isAutoAdjustTitlesWidth) { - - float allTitlesWidth = self.segmentStyle.titleMargin; - for (int i = 0; i= self.titles.count || - currentIndex < 0 || - currentIndex >= self.titles.count - ) { - return; - } - _oldIndex = currentIndex; - - ZJTitleView *oldTitleView = (ZJTitleView *)self.titleViews[oldIndex]; - ZJTitleView *currentTitleView = (ZJTitleView *)self.titleViews[currentIndex]; - - - CGFloat xDistance = currentTitleView.zj_x - oldTitleView.zj_x; - CGFloat wDistance = currentTitleView.zj_width - oldTitleView.zj_width; - - if (self.scrollLine) { - - if (self.segmentStyle.isScrollTitle) { - self.scrollLine.zj_x = oldTitleView.zj_x + xDistance * progress; - self.scrollLine.zj_width = oldTitleView.zj_width + wDistance * progress; - } else { - if (self.segmentStyle.isAdjustCoverOrLineWidth) { - CGFloat oldScrollLineW = [self.titleWidths[oldIndex] floatValue] + wGap; - CGFloat currentScrollLineW = [self.titleWidths[currentIndex] floatValue] + wGap; - wDistance = currentScrollLineW - oldScrollLineW; - - CGFloat oldScrollLineX = oldTitleView.zj_x + (oldTitleView.zj_width - oldScrollLineW) * 0.5; - CGFloat currentScrollLineX = currentTitleView.zj_x + (currentTitleView.zj_width - currentScrollLineW) * 0.5; - xDistance = currentScrollLineX - oldScrollLineX; - self.scrollLine.zj_x = oldScrollLineX + xDistance * progress; - self.scrollLine.zj_width = oldScrollLineW + wDistance * progress; - } else { - self.scrollLine.zj_x = oldTitleView.zj_x + xDistance * progress; - self.scrollLine.zj_width = oldTitleView.zj_width + wDistance * progress; - } - } - - } - - if (self.coverLayer) { - if (self.segmentStyle.isScrollTitle) { - self.coverLayer.zj_x = oldTitleView.zj_x + xDistance * progress - xGap; - self.coverLayer.zj_width = oldTitleView.zj_width + wDistance * progress + wGap; - } else { - if (self.segmentStyle.isAdjustCoverOrLineWidth) { - CGFloat oldCoverW = [self.titleWidths[oldIndex] floatValue] + wGap; - CGFloat currentCoverW = [self.titleWidths[currentIndex] floatValue] + wGap; - wDistance = currentCoverW - oldCoverW; - CGFloat oldCoverX = oldTitleView.zj_x + (oldTitleView.zj_width - oldCoverW) * 0.5; - CGFloat currentCoverX = currentTitleView.zj_x + (currentTitleView.zj_width - currentCoverW) * 0.5; - xDistance = currentCoverX - oldCoverX; - self.coverLayer.zj_x = oldCoverX + xDistance * progress; - self.coverLayer.zj_width = oldCoverW + wDistance * progress; - } else { - self.coverLayer.zj_x = oldTitleView.zj_x + xDistance * progress; - self.coverLayer.zj_width = oldTitleView.zj_width + wDistance * progress; - } - } - } - - // 渐变 - if (self.segmentStyle.isGradualChangeTitleColor) { - - oldTitleView.textColor = [UIColor colorWithRed:[self.selectedColorRgb[0] floatValue] + [self.deltaRGB[0] floatValue] * progress green:[self.selectedColorRgb[1] floatValue] + [self.deltaRGB[1] floatValue] * progress blue:[self.selectedColorRgb[2] floatValue] + [self.deltaRGB[2] floatValue] * progress alpha:1.0]; - currentTitleView.textColor = [UIColor colorWithRed:[self.normalColorRgb[0] floatValue] - [self.deltaRGB[0] floatValue] * progress green:[self.normalColorRgb[1] floatValue] - [self.deltaRGB[1] floatValue] * progress blue:[self.normalColorRgb[2] floatValue] - [self.deltaRGB[2] floatValue] * progress alpha:1.0]; - - } - - if (!self.segmentStyle.isScaleTitle) { - return; - } - - CGFloat deltaScale = self.segmentStyle.titleBigScale - 1.0; - oldTitleView.currentTransformSx = self.segmentStyle.titleBigScale - deltaScale * progress; - currentTitleView.currentTransformSx = 1.0 + deltaScale * progress; - - -} - -- (void)adjustTitleOffSetToCurrentIndex:(NSInteger)currentIndex { - // 重置附近其他item的缩放和颜色 - - for (NSInteger index = currentIndex - 3; index < currentIndex + 3; index++) { - if (index >= 0 && index <= _titles.count - 1) { - ZJTitleView *nextTitleView = _titleViews[index]; - if (index != currentIndex) { - nextTitleView.textColor = self.segmentStyle.normalTitleColor; - nextTitleView.currentTransformSx = 1.0; - nextTitleView.selected = NO; - } - else { - nextTitleView.textColor = self.segmentStyle.selectedTitleColor; - if (self.segmentStyle.isScaleTitle) { - nextTitleView.currentTransformSx = self.segmentStyle.titleBigScale; - } - nextTitleView.selected = YES; - } - - } - } - - - if (self.scrollView.contentSize.width != self.scrollView.bounds.size.width + contentSizeXOff) {// 需要滚动 - ZJTitleView *currentTitleView = (ZJTitleView *)_titleViews[currentIndex]; - self.userInteractionEnabled = NO; - - CGFloat offSetx = currentTitleView.center.x - _currentWidth * 0.5; - if (offSetx < 0) { - offSetx = 0; - self.userInteractionEnabled = YES; - - } - CGFloat extraBtnW = self.extraBtn ? self.extraBtn.zj_width : 0.0; - CGFloat maxOffSetX = self.scrollView.contentSize.width - (_currentWidth - extraBtnW); - - if (maxOffSetX < 0) { - maxOffSetX = 0; - } - - if (offSetx > maxOffSetX) { - offSetx = maxOffSetX; - self.userInteractionEnabled = YES; - } - - if (!self.segmentStyle.isGradualChangeTitleColor) { - int index = 0; - for (ZJTitleView *titleView in _titleViews) { - if (index != currentIndex) { - titleView.textColor = self.segmentStyle.normalTitleColor; - titleView.currentTransformSx = 1.0; - titleView.selected = NO; - } - else { - titleView.textColor = self.segmentStyle.selectedTitleColor; - if (self.segmentStyle.isScaleTitle) { - titleView.currentTransformSx = self.segmentStyle.titleBigScale; - } - titleView.selected = YES; - - } - - index++; - } - } - [self.scrollView setContentOffset:CGPointMake(offSetx, 0.0) animated:YES]; - } - - -} - -- (void)setSelectedIndex:(NSInteger)index animated:(BOOL)animated { - NSAssert(index >= 0 && index < self.titles.count, @"设置的下标不合法!!"); - - if (index < 0 || index >= self.titles.count) { - return; - } - - _currentIndex = index; - [self adjustUIWhenBtnOnClickWithAnimate:animated]; -} - -- (void)reloadTitlesWithNewTitles:(NSArray *)titles { - [self.scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; - - self.titleWidths = nil; - self.titleViews = nil; - self.titles = nil; - self.titles = [titles copy]; - if (self.titles.count == 0) return; - for (UIView *subview in self.subviews) { - [subview removeFromSuperview]; - } - [self setupSubviews]; - [self setupUI]; - [self setSelectedIndex:0 animated:YES]; - -} - -- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { - self.userInteractionEnabled = YES; -} - -#pragma mark - getter --- setter - -- (UIView *)scrollLine { - - if (!self.segmentStyle.isShowLine) { - return nil; - } - - if (!_scrollLine) { - UIView *lineView = [[UIView alloc] init]; - lineView.backgroundColor = self.segmentStyle.scrollLineColor; - - _scrollLine = lineView; - - } - - return _scrollLine; -} - -- (UIView *)coverLayer { - if (!self.segmentStyle.isShowCover) { - return nil; - } - - if (_coverLayer == nil) { - UIView *coverView = [[UIView alloc] init]; - coverView.backgroundColor = self.segmentStyle.coverBackgroundColor; - coverView.layer.cornerRadius = self.segmentStyle.coverCornerRadius; - coverView.layer.masksToBounds = YES; - - _coverLayer = coverView; - - } - - return _coverLayer; -} - -- (UIButton *)extraBtn { - - if (!self.segmentStyle.showExtraButton) { - return nil; - } - if (!_extraBtn) { - UIButton *btn = [UIButton new]; - [btn addTarget:self action:@selector(extraBtnOnClick:) forControlEvents:UIControlEventTouchUpInside]; - NSString *imageName = self.segmentStyle.extraBtnBackgroundImageName ? self.segmentStyle.extraBtnBackgroundImageName : @""; - [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal]; - btn.backgroundColor = [UIColor whiteColor]; - // 设置边缘的阴影效果 - btn.layer.shadowColor = [UIColor whiteColor].CGColor; - btn.layer.shadowOffset = CGSizeMake(-5, 0); - btn.layer.shadowOpacity = 1; - - _extraBtn = btn; - } - return _extraBtn; -} - -- (UIScrollView *)scrollView { - - if (!_scrollView) { - UIScrollView *scrollView = [[UIScrollView alloc] init]; - scrollView.showsHorizontalScrollIndicator = NO; - scrollView.scrollsToTop = NO; - scrollView.bounces = self.segmentStyle.isSegmentViewBounces; - scrollView.pagingEnabled = NO; - scrollView.delegate = self; - _scrollView = scrollView; - } - return _scrollView; -} - -- (UIImageView *)backgroundImageView { - - if (!_backgroundImageView) { - UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.bounds]; - - [self insertSubview:imageView atIndex:0]; - - _backgroundImageView = imageView; - } - return _backgroundImageView; -} - -- (void)setBackgroundImage:(UIImage *)backgroundImage { - _backgroundImage = backgroundImage; - if (backgroundImage) { - self.backgroundImageView.image = backgroundImage; - } -} - -- (NSMutableArray *)titleViews -{ - if (_titleViews == nil) { - _titleViews = [NSMutableArray array]; - } - return _titleViews; -} - -- (NSMutableArray *)titleWidths -{ - if (_titleWidths == nil) { - _titleWidths = [NSMutableArray array]; - } - return _titleWidths; -} - -- (NSArray *)deltaRGB { - if (_deltaRGB == nil) { - NSArray *normalColorRgb = self.normalColorRgb; - NSArray *selectedColorRgb = self.selectedColorRgb; - - NSArray *delta; - if (normalColorRgb && selectedColorRgb) { - CGFloat deltaR = [normalColorRgb[0] floatValue] - [selectedColorRgb[0] floatValue]; - CGFloat deltaG = [normalColorRgb[1] floatValue] - [selectedColorRgb[1] floatValue]; - CGFloat deltaB = [normalColorRgb[2] floatValue] - [selectedColorRgb[2] floatValue]; - delta = [NSArray arrayWithObjects:@(deltaR), @(deltaG), @(deltaB), nil]; - _deltaRGB = delta; - - } - } - return _deltaRGB; -} - -- (NSArray *)normalColorRgb { - if (!_normalColorRgb) { - NSArray *normalColorRgb = [self getColorRgb:self.segmentStyle.normalTitleColor]; - NSAssert(normalColorRgb, @"设置普通状态的文字颜色时 请使用RGB空间的颜色值"); - _normalColorRgb = normalColorRgb; - - } - return _normalColorRgb; -} - -- (NSArray *)selectedColorRgb { - if (!_selectedColorRgb) { - NSArray *selectedColorRgb = [self getColorRgb:self.segmentStyle.selectedTitleColor]; - NSAssert(selectedColorRgb, @"设置选中状态的文字颜色时 请使用RGB空间的颜色值"); - _selectedColorRgb = selectedColorRgb; - - } - return _selectedColorRgb; -} - -- (NSArray *)getColorRgb:(UIColor *)color { - CGFloat numOfcomponents = CGColorGetNumberOfComponents(color.CGColor); - NSArray *rgbComponents; - if (numOfcomponents == 4) { - const CGFloat *components = CGColorGetComponents(color.CGColor); - rgbComponents = [NSArray arrayWithObjects:@(components[0]), @(components[1]), @(components[2]), nil]; - } - return rgbComponents; - -} - - -@end - - diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJSegmentStyle.h b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJSegmentStyle.h deleted file mode 100755 index 63048364..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJSegmentStyle.h +++ /dev/null @@ -1,95 +0,0 @@ -// -// ZJSegmentStyle.h -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import -typedef NS_ENUM(NSInteger, TitleImagePosition) { - TitleImagePositionLeft, - TitleImagePositionRight, - TitleImagePositionTop, - TitleImagePositionCenter -}; - -typedef NS_OPTIONS(NSInteger, SegmentViewComponent) { - SegmentViewComponentShowCover = 1 << 0, - SegmentViewComponentShowLine = 1 << 1, - SegmentViewComponentShowImage = 1 << 2, - SegmentViewComponentShowExtraButton = 1 << 3, - SegmentViewComponentScaleTitle = 1 << 4, - SegmentViewComponentScrollTitle = 1 << 5, - SegmentViewComponentBounces = 1 << 6, - SegmentViewComponentGraduallyChangeTitleColor = 1 << 7, - SegmentViewComponentAdjustCoverOrLineWidth = 1 << 8, - SegmentViewComponentAutoAdjustTitlesWidth = 1 << 9, - -}; - -@interface ZJSegmentStyle : NSObject - -/** 是否显示遮盖 默认为NO */ -@property (assign, nonatomic, getter=isShowCover) BOOL showCover; -/** 是否显示滚动条 默认为NO*/ -@property (assign, nonatomic, getter=isShowLine) BOOL showLine; -/**是否显示图片 默认为NO*/ -@property (assign, nonatomic, getter=isShowImage) BOOL showImage; -/** 是否显示附加的按钮 默认为NO*/ -@property (assign, nonatomic, getter=isShowExtraButton) BOOL showExtraButton; -/** 是否缩放标题 不能滚动的时候就不要把缩放和遮盖或者滚动条同时使用, 否则显示效果不好 默认为NO*/ -@property (assign, nonatomic, getter=isScaleTitle) BOOL scaleTitle; -/** 是否滚动标题 默认为YES 设置为NO的时候所有的标题将不会滚动, 并且宽度会平分 和系统的segment效果相似 */ -@property (assign, nonatomic, getter=isScrollTitle) BOOL scrollTitle; -/** segmentView是否有弹性 默认为YES*/ -@property (assign, nonatomic, getter=isSegmentViewBounces) BOOL segmentViewBounces; -/** contentView是否有弹性 默认为YES*/ -@property (assign, nonatomic, getter=isContentViewBounces) BOOL contentViewBounces; - -/** 是否颜色渐变 默认为NO*/ -@property (assign, nonatomic, getter=isGradualChangeTitleColor) BOOL gradualChangeTitleColor; - -/** 内容view是否能滑动 默认为YES*/ -@property (assign, nonatomic, getter=isScrollContentView) BOOL scrollContentView; -/** 点击标题切换的时候,内容view是否会有动画 即使是设置为YES当跳过两页以上的时候都没有动画 默认为YES*/ -@property (assign, nonatomic, getter=isAnimatedContentViewWhenTitleClicked) BOOL animatedContentViewWhenTitleClicked; - -/** 当设置scrollTitle=NO的时候标题会平分宽度, 如果你希望在滚动的过程中cover或者scrollLine的宽度随着变化设置这个属性为YES 默认为NO*/ -@property (assign, nonatomic, getter=isAdjustCoverOrLineWidth) BOOL adjustCoverOrLineWidth; -/** 是否自动调整标题的宽度, 当设置为YES的时候 如果所有的标题的宽度之和小于segmentView的宽度的时候, 会自动调整title的位置, 达到类似"平分"的效果 默认为NO*/ -@property (assign, nonatomic, getter=isAutoAdjustTitlesWidth) BOOL autoAdjustTitlesWidth; - - - -/** 设置附加按钮的背景图片 默认为nil*/ -@property (strong, nonatomic) NSString *extraBtnBackgroundImageName; -/** 滚动条的高度 默认为2 */ -@property (assign, nonatomic) CGFloat scrollLineHeight; -/** 滚动条的颜色 */ -@property (strong, nonatomic) UIColor *scrollLineColor; -/** 遮盖的颜色 */ -@property (strong, nonatomic) UIColor *coverBackgroundColor; -/** 遮盖的圆角 默认为14*/ -@property (assign, nonatomic) CGFloat coverCornerRadius; -/** 遮盖的高度 默认为28*/ -@property (assign, nonatomic) CGFloat coverHeight; -/** 标题之间的间隙 默认为15.0 */ -@property (assign, nonatomic) CGFloat titleMargin; -/** 标题的字体 默认为14 */ -@property (strong, nonatomic) UIFont *titleFont; -/** 标题缩放倍数, 默认1.3 */ -@property (assign, nonatomic) CGFloat titleBigScale; -/** 标题一般状态的颜色 */ -@property (strong, nonatomic) UIColor *normalTitleColor; -/** 标题选中状态的颜色 */ -@property (strong, nonatomic) UIColor *selectedTitleColor; -/** segmentVIew的高度, 这个属性只在使用ZJScrollPageVIew的时候设置生效 */ -@property (assign, nonatomic) CGFloat segmentHeight; -/** 标题中图片的位置 */ -@property (assign, nonatomic) TitleImagePosition imagePosition; - -/**未使用*/ -//@property (assign, nonatomic) SegmentViewComponent segmentViewComponent; - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJSegmentStyle.m b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJSegmentStyle.m deleted file mode 100755 index 31baa13f..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJSegmentStyle.m +++ /dev/null @@ -1,82 +0,0 @@ -// -// ZJSegmentStyle.m -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import "ZJSegmentStyle.h" - -@implementation ZJSegmentStyle - -- (instancetype)init { - if(self = [super init]) { - _showCover = NO; - _showLine = NO; - _scaleTitle = NO; - _scrollTitle = YES; - _segmentViewBounces = YES; - _contentViewBounces = YES; - _gradualChangeTitleColor = NO; - _showExtraButton = NO; - _scrollContentView = YES; - _adjustCoverOrLineWidth = NO; - _showImage = NO; - _autoAdjustTitlesWidth = NO; - _animatedContentViewWhenTitleClicked = YES; - _extraBtnBackgroundImageName = nil; - _scrollLineHeight = 2.0; - _scrollLineColor = [UIColor brownColor]; - _coverBackgroundColor = [UIColor lightGrayColor]; - _coverCornerRadius = 14.0; - _coverHeight = 28.0; - _titleMargin = 15.0; - _titleFont = [UIFont systemFontOfSize:14.0]; - _titleBigScale = 1.3; - _normalTitleColor = [UIColor colorWithRed:51.0/255.0 green:53.0/255.0 blue:75/255.0 alpha:1.0]; - _selectedTitleColor = [UIColor colorWithRed:255.0/255.0 green:0.0/255.0 blue:121/255.0 alpha:1.0]; - - _segmentHeight = 44.0; - - } - return self; -} - - -- (void)setSegmentViewComponent:(SegmentViewComponent)segmentViewComponent { - - if (segmentViewComponent & SegmentViewComponentShowCover) { - _showCover = YES; - } - else if (segmentViewComponent & SegmentViewComponentShowLine) { - _showLine = YES; - } - else if (segmentViewComponent & SegmentViewComponentShowImage) { - _showImage = YES; - } - else if (segmentViewComponent & SegmentViewComponentShowExtraButton) { - _showExtraButton = YES; - } - else if (segmentViewComponent & SegmentViewComponentScaleTitle) { - _scaleTitle = YES; - } - else if (segmentViewComponent & SegmentViewComponentScrollTitle) { - _scrollTitle = YES; - } - else if (segmentViewComponent & SegmentViewComponentBounces) { - _segmentViewBounces = YES; - } - else if (segmentViewComponent & SegmentViewComponentGraduallyChangeTitleColor) { - _gradualChangeTitleColor = YES; - } - else if (segmentViewComponent & SegmentViewComponentAdjustCoverOrLineWidth) { - _adjustCoverOrLineWidth = YES; - } - else { - _autoAdjustTitlesWidth = YES; - } - -} - -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJTitleView.h b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJTitleView.h deleted file mode 100755 index b2f893dc..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJTitleView.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// ZJCustomLabel.h -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import -#import "ZJSegmentStyle.h" -@interface ZJTitleView : UIView -@property (assign, nonatomic) CGFloat currentTransformSx; - -@property (assign, nonatomic) TitleImagePosition imagePosition; - -@property (strong, nonatomic) NSString *text; -@property (strong, nonatomic) UIColor *textColor; -@property (strong, nonatomic) UIFont *font; -@property (assign, nonatomic, getter=isSelected) BOOL selected; -/** 代理方法中推荐只设置下面的属性, 当然上面的属性设置也会有效, 不过建议上面的设置在style里面设置 */ -@property (strong, nonatomic) UIImage *normalImage; -@property (strong, nonatomic) UIImage *selectedImage; - -- (CGFloat)titleViewWidth; -- (void)adjustSubviewFrame; -@end diff --git a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJTitleView.m b/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJTitleView.m deleted file mode 100755 index 6f431241..00000000 --- a/iOSProject/Pods/ZJScrollPageView/ZJScrollPageView/ZJScrollPageView/ZJTitleView.m +++ /dev/null @@ -1,215 +0,0 @@ -// -// ZJCustomLabel.m -// ZJScrollPageView -// -// Created by jasnig on 16/5/6. -// Copyright © 2016年 ZeroJ. All rights reserved. -// - -#import "ZJTitleView.h" - -@interface ZJTitleView() { - CGSize _titleSize; - CGFloat _imageHeight; - CGFloat _imageWidth; - BOOL _isShowImage; -} -@property (strong, nonatomic) UIImageView *imageView; -@property (strong, nonatomic) UILabel *label; -@property (strong, nonatomic) UIView *contentView; -/** 后续添加 */ -// TODO: - 添加badge -@property (nonatomic) UIView *badgeView; - -@end - -@implementation ZJTitleView -- (instancetype)init { - self = [self initWithFrame:CGRectZero]; - return self; -} - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - self.currentTransformSx = 1.0; - self.userInteractionEnabled = YES; - self.backgroundColor = [UIColor clearColor]; - _isShowImage = NO; - [self addSubview:self.label]; - - } - - return self; -} - -- (void)setCurrentTransformSx:(CGFloat)currentTransformSx { - _currentTransformSx = currentTransformSx; - self.transform = CGAffineTransformMakeScale(currentTransformSx, currentTransformSx); -} - - -- (void)layoutSubviews { - [super layoutSubviews]; - - if (!_isShowImage) { - self.label.frame = self.bounds; - } -} - -- (void)adjustSubviewFrame { - _isShowImage = YES; - - CGRect contentViewFrame = self.bounds; - contentViewFrame.size.width = [self titleViewWidth]; - contentViewFrame.origin.x = (self.frame.size.width - contentViewFrame.size.width)/2; - self.contentView.frame = contentViewFrame; - self.label.frame = self.contentView.bounds; - - [self addSubview:self.contentView]; - [self.label removeFromSuperview]; - [self.contentView addSubview:self.label]; - [self.contentView addSubview:self.imageView]; - - switch (self.imagePosition) { - case TitleImagePositionTop: { - CGRect contentViewFrame = self.contentView.frame; - contentViewFrame.size.height = _imageHeight + _titleSize.height; - contentViewFrame.origin.y = (self.frame.size.height - contentViewFrame.size.height)*0.5; - self.contentView.frame = contentViewFrame; - - self.imageView.frame = CGRectMake(0, 0, _imageWidth, _imageHeight); - CGPoint center = self.imageView.center; - center.x = self.label.center.x; - self.imageView.center = center; - - CGFloat labelHeight = self.contentView.frame.size.height - _imageHeight; - CGRect labelFrame = self.label.frame; - labelFrame.origin.y = _imageHeight; - labelFrame.size.height = labelHeight; - self.label.frame = labelFrame; - break; - } - case TitleImagePositionLeft: { - - CGRect labelFrame = self.label.frame; - labelFrame.origin.x = _imageWidth; - labelFrame.size.width = self.contentView.frame.size.width - _imageWidth; - self.label.frame = labelFrame; - - CGRect imageFrame = CGRectZero; - imageFrame.size.height = _imageHeight; - imageFrame.size.width = _imageWidth; - imageFrame.origin.y = (self.contentView.frame.size.height - imageFrame.size.height)/2; - self.imageView.frame = imageFrame; - - break; - } - case TitleImagePositionRight: { - CGRect labelFrame = self.label.frame; - labelFrame.size.width = self.contentView.frame.size.width - _imageWidth; - self.label.frame = labelFrame; - - CGRect imageFrame = CGRectZero; - imageFrame.origin.x = CGRectGetMaxX(self.label.frame); - imageFrame.size.height = _imageHeight; - imageFrame.size.width = _imageWidth; - imageFrame.origin.y = (self.contentView.frame.size.height - imageFrame.size.height)/2; - self.imageView.frame = imageFrame; - break; - } - case TitleImagePositionCenter: - - self.imageView.frame = self.contentView.bounds; - [self.label removeFromSuperview]; - break; - default: - break; - } - -} - - - -- (CGFloat)titleViewWidth { - CGFloat width = 0.0f; - switch (self.imagePosition) { - case TitleImagePositionLeft: - width = _imageWidth + _titleSize.width; - break; - case TitleImagePositionRight: - width = _imageWidth + _titleSize.width; - break; - case TitleImagePositionCenter: - width = _imageWidth; - break; - default: - width = _titleSize.width; - break; - } - - return width; -} - - -- (void)setNormalImage:(UIImage *)normalImage { - _normalImage = normalImage; - _imageWidth = normalImage.size.width; - _imageHeight = normalImage.size.height; - self.imageView.image = normalImage; -} - -- (void)setSelectedImage:(UIImage *)selectedImage { - _selectedImage = selectedImage; - self.imageView.highlightedImage = selectedImage; -} - -- (void)setFont:(UIFont *)font { - _font = font; - self.label.font = font; -} - -- (void)setText:(NSString *)text { - _text = text; - self.label.text = text; - CGRect bounds = [text boundingRectWithSize:CGSizeMake(MAXFLOAT, 0.0) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: self.label.font} context:nil]; - _titleSize = bounds.size; - -} - -- (void)setTextColor:(UIColor *)textColor { - _textColor = textColor; - self.label.textColor = textColor; - -} - -- (void)setSelected:(BOOL)selected { - _selected = selected; - self.imageView.highlighted = selected; -} - -- (UIImageView *)imageView { - if (_imageView == nil) { - _imageView = [[UIImageView alloc] init]; - _imageView.contentMode = UIViewContentModeCenter; - } - return _imageView; -} - -- (UILabel *)label { - if (_label == nil) { - _label = [[UILabel alloc] init]; - _label.textAlignment = NSTextAlignmentCenter; - } - return _label; -} - -- (UIView *)contentView { - if (!_contentView) { - _contentView = [UIView new]; - } - return _contentView; -} - - - -@end diff --git a/iOSProject/Pods/iflyMSC/LICENSE b/iOSProject/Pods/iflyMSC/LICENSE deleted file mode 100755 index 2073aac5..00000000 --- a/iOSProject/Pods/iflyMSC/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 徐志军 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/iOSProject/Pods/iflyMSC/README.md b/iOSProject/Pods/iflyMSC/README.md deleted file mode 100644 index 5cd8344e..00000000 --- a/iOSProject/Pods/iflyMSC/README.md +++ /dev/null @@ -1 +0,0 @@ -# iflyMSC diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyContact.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyContact.h deleted file mode 100755 index 22d4878c..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyContact.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// IFlyContact.h -// msc -// -// Created by ypzhao on 13-3-1. -// Copyright (c) 2013年 IFLYTEK. All rights reserved. -// - -#import - -/*! - * 此接口为获取通信录中的联系人 - * 获取联系人是为了在进行语音识别时(sms)能更好的识别出您说的人名,联系人上传是属于个性化的 - * 一部分. - */ -@interface IFlyContact : NSObject - -/*! - * 获取联系人 - * 调用此方法需要添加 AddressBook.framework 到工程中,调用此方法后可以直接将通信录中的联系 - * 人转化为语音云识别的数据结构。您可以将获取的数据通过IFlyDataUploader类,上传到语音云,我们 - * 只获取通信录中的人名 - * - * @return 返回联系人信息 - */ -- (NSString *) contact; -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyDataUploader.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyDataUploader.h deleted file mode 100755 index 1ffb6c88..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyDataUploader.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// IFlyDataUploader.h -// MSC -// -// Created by ypzhao on 13-4-8. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import - - -@class IFlySpeechError; - -/*! - * 数据上传类 - */ -@interface IFlyDataUploader : NSObject - -/*! - * 数据名称 - */ -@property(nonatomic,copy) NSString *dataName; -/*! - * 数据 - */ -@property(nonatomic,copy) NSString *data; - -/*! - * 上传完成回调 - * - * @param result 结果 - * @param error 错误码 - */ -typedef void(^IFlyUploadDataCompletionHandler)(NSString* result,IFlySpeechError * error); - -/*! - * 上传数据 - * 此函数用于上传数据,下载的过程是**异步**的。 - * - * @param completionHandler -[in] 上传完成回调 - * @param name -[in] 上传的内容名称,名称最好和你要上传的数据内容相关,不可以为nil - * @param data -[in] 上传的数据,以utf8编码,不可以为nil - */ -- (void) uploadDataWithCompletionHandler:(IFlyUploadDataCompletionHandler)completionHandler name:(NSString *)name data:(NSString *)data; - -/*! - * 设置上传数据参数 - * - * @param parameter 参数值 - * @param key 参数名 - */ --(void) setParameter:(NSString*) parameter forKey:(NSString*) key; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyDebugLog.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyDebugLog.h deleted file mode 100755 index 9cf29877..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyDebugLog.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// IFlyDebugLog.h -// MSC - -// description: 程序中的log处理类 - -// Created by ypzhao on 12-11-22. -// Copyright (c) 2012年 iflytek. All rights reserved. -// - -#import - -/*! - * 调试信息 - */ -@interface IFlyDebugLog : NSObject - -/*! - * 打印调试信息 - * - * @param format -[in] 要打印的内容格式 - * @param ... -[in] 要打印的内容 - */ -+ (void) showLog:(NSString *)format, ...; - -/*! - * 将log写入文件中 - */ -+ (void) writeLog; - -/*! - * 设置是否显示log - * - * @param showLog YES:显示;NO:不显示 - */ -+ (void) setShowLog:(BOOL) showLog; -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyISVDelegate.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyISVDelegate.h deleted file mode 100755 index a3c4e8ce..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyISVDelegate.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// IFlyISVDelegate.h -// msc_UI -// -// Created by admin on 14-9-15. -// Copyright (c) 2014年 iflytek. All rights reserved. -// - - -#import - -@class IFlySpeechError; - -/** - * 声纹回调协议 - */ -@protocol IFlyISVDelegate - -/** - * 声纹结果回调 - * - * @param dic 结果 - */ --(void) onResult:(NSDictionary *)dic; - -/** - * 错误码回调 - * - * @param errorCode 错误码 - */ --(void) onError:(IFlySpeechError *) errorCode; - -@optional - -/** - * 等待结果 - */ --(void) onRecognition; - -/** - * 音量改变回调 - * - * @param volume 音量值 - */ --(void) onVolumeChanged: (int)volume; - -@end - diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyISVRecognizer.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyISVRecognizer.h deleted file mode 100755 index 1e76d127..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyISVRecognizer.h +++ /dev/null @@ -1,134 +0,0 @@ -// -// IFlyISVRecognizer.h -// ISV -// -// Created by wangdan on 14-9-6. -// Copyright (c) 2014年 IFlyTEK. All rights reserved. -// - - -#import -#import "IFlyISVDelegate.h" - -/** - * 声纹接口类 - */ -@interface IFlyISVRecognizer : NSObject -{ - -} -@property (assign) id delegate; - - - -/* - * FlyISVRecognizer is a kind of Singleton calss - * the function can be used as below: - IFLyISVRecognizer *recognizer=[IFlyISVRecognizer creteRecognizer: self]; - */ - -+(IFlyISVRecognizer *) sharedInstance; - - -/* - * genrerate a serial number password - * princeple: - 1.number serial has no 1 in itself; - 2.the nuber serial has no same number("98765432"is right while "99876543" is wrong) - * @length: the serial number's length,length of "98765432" is 8, - generally length is 8 and other value is forbidden - */ - --(NSString*) generatePassword:(int)length; - - - -/* - * Used to get password from server - * @pwdt: - when pwdt is 1,the function will return chinese text; - while pwdt is 2, the funciton will return number serial - */ - --(NSArray*) getPasswordList:(int)pwdt; - - -/* - * Used to judge if the engine is running in listenning - * return value: - YES: the engine is listenning; - No : the engine is not listenning - */ --(BOOL) isListening; - - - -/* - * Used to query or delete the voiceprint model in server - * @cmd: - "del": delete model - "que": query model - * @authid: user id ,can be @"tianxia" or other; - * @pwdt: voiceprint type - 1: fixed txt voiceprint code ,like @"我的地盘我做主" - 2: free voiceprint code , user can speek anything,but 5 times - trainning the speech shall be same - 3: number serial voiceprint code ,like @"98765432" and so on - * @ptxt: voiceprint txt,only fixed voiceprint and number serial have this, - in free voiceprint model this param shall be set nil - * @vid: another voiceprint type model,user can use this to query or delete - model in server can be @"jakillasdfasdjjjlajlsdfhdfdsadff",totally 32 bits; - * NOTES: - when vid is not nil,then the server will judge the vid first - while the vid is nil, server can still query or delete the voiceprint model - by other params - */ --(BOOL) sendRequest:(NSString*)cmd authid:(NSString *)auth_id pwdt:(int)pwdt ptxt:(NSString *)ptxt vid:(NSString *)vid err:(int *)err; - - -/* - * set the voiceprint params - * @"sst" : @"train" or @"verify" - * @"auth_id" : @"tianxia" or ther - * @"sub" : @"ivp" - * @"ptxt" : - * @"rgn" : @"5" - * @"pwdt" : @"1",or @"2", or @"3" - * @"auf" : @"audio/L16;rate=16000" or @"audio/L16;rate=8000" - * @"vad_enable : @"1" or @"0" - * @"vad_timeout" : @"3000" - * @"vad_speech_tail": @"100" - */ --(BOOL) setParameter:(NSString *)value forKey:(NSString *)key; - - - -/* - * get the voiceprint params - * used the same as function of setParameter - */ --(NSString*) getParameter:(NSString *)key; - - -/* - * start recording - */ --(void) startListening; - - -/* - * stop recording - */ --(void) stopListening; - - -/* - * cancel recording,like function stopListening - */ --(void) cancel; /* cancel recognization */ - - - - -@end - diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyMSC.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyMSC.h deleted file mode 100755 index 3f5e35ed..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyMSC.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// IFlyMSC.h -// msc -// -// Created by 张剑 on 15/1/14. -// Copyright (c) 2015年 iflytek. All rights reserved. -// - -#ifndef MSC_IFlyMSC_h -#define MSC_IFlyMSC_h - -#import "IFlyContact.h" -#import "IFlyDataUploader.h" -#import "IFlyDebugLog.h" -#import "IFlyISVDelegate.h" -#import "IFlyISVRecognizer.h" -#import "IFlyRecognizerView.h" -#import "IFlyRecognizerViewDelegate.h" -#import "IFlyResourceUtil.h" -#import "IFlySetting.h" -#import "IFlySpeechConstant.h" -#import "IFlySpeechError.h" -#import "IFlySpeechEvaluator.h" -#import "IFlySpeechEvaluatorDelegate.h" -#import "IFlySpeechEvent.h" -#import "IFlySpeechRecognizer.h" -#import "IFlySpeechRecognizerDelegate.h" -#import "IFlySpeechSynthesizer.h" -#import "IFlySpeechSynthesizerDelegate.h" -#import "IFlySpeechUnderstander.h" -#import "IFlySpeechUtility.h" -#import "IFlyTextUnderstander.h" -#import "IFlyUserWords.h" -#import "IFlyPcmRecorder.h" - - -#endif diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyPcmRecorder.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyPcmRecorder.h deleted file mode 100755 index bf8816f2..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyPcmRecorder.h +++ /dev/null @@ -1,104 +0,0 @@ -// -// IFlyPcmRecorder.h -// MSC - -// description: - -// Created by ypzhao on 12-11-15. -// Copyright (c) 2012年 iflytek. All rights reserved. -// - -#import - -#import -#import -#import -#import -#import - - -@class IFlyPcmRecorder; - -/** - * 录音协议 - */ -@protocol IFlyPcmRecorderDelegate - -/** - * 回调音频数据 - * - * @param buffer 音频数据 - * @param size 表示音频的长度 - */ -- (void) onIFlyRecorderBuffer: (const void *)buffer bufferSize:(int)size; - -/** - * 回调音频的错误码 - * - * @param recoder 录音器 - * @param error 错误码 - */ -- (void) onIFlyRecorderError:(IFlyPcmRecorder*)recoder theError:(int) error; - -@optional - -/** - * 回调录音音量 - * - * @param power 音量值 - */ -- (void) onIFlyRecorderVolumeChanged:(int) power; - -@end - - -/** - * 录音封装 - */ -@interface IFlyPcmRecorder : NSObject - -/** - * 录音委托对象 - */ -@property (assign) id delegate; - -/** - * 单例模式 - * - * @return 返回录音对象单例 - */ -+ (id) sharedInstance; - -/** - * 开始录音 - * - * @return 开启录音成功返回YES,否则返回NO - */ -- (BOOL) start; - -/** - * 停止录音 - */ -- (void) stop; - -/** - * 设置音频采样率 - * - * @param rate -[in] 采样率,8k/16k - */ -- (void) setSample:(NSString *) rate; - -/* - * 设置录音时间间隔参数 - */ -- (void) setPowerCycle:(float) cycle; - -/** - * 保存录音 - * - * @param savePath 音频保存路径 - */ --(void) setSaveAudioPath:(NSString *)savePath; - -@end - diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyRecognizerView.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyRecognizerView.h deleted file mode 100755 index 3b67472f..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyRecognizerView.h +++ /dev/null @@ -1,137 +0,0 @@ -// -// IFlyRecognizerView.h -// MSC -// -// Created by admin on 13-4-16. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import - - -@protocol IFlyRecognizerViewDelegate ; - -/*! - * 语音识别控件 - * 录音时触摸控件结束录音,开始识别(相当于旧版的停止);触摸其他位置,取消录音,结束会话(取消) - * 出错时触摸控件,重新开启会话(相当于旧版的再说一次);触摸其他位置,取消录音,结束会话(取消) - * - */ -@interface IFlyRecognizerView : UIView - -/*! - * 设置委托对象 - */ -@property(nonatomic,assign)id delegate; - -/*! - * 初始化控件 - * - * @param origin 控件左上角的坐标 - * - * @return IFlyRecognizerView 对象 - */ -- (id)initWithOrigin:(CGPoint)origin; - -/*! - * 初始化控件 - * - * @param center 控件中心的坐标 - * - * @return IFlyRecognizerView 对象 - */ -- (id) initWithCenter:(CGPoint)center; - -/*! - * 设置横竖屏自适应 - * - * @param autoRotate 默认值YES,横竖屏自适应 - */ -- (void) setAutoRotate:(BOOL)autoRotate; - -/* - * | ------------- |----------------------------------------------------------- - * | 参数 | 描述 - * | ------------- |----------------------------------------------------------- - * | domain |应用的领域: 取值为:iat、search、video、poi、music、asr; - * | | iat:普通文本听写; - * | | search:热词搜索; - * | | video:视频音乐搜索; - * | | asr:关键词识别; - * | ------------- |----------------------------------------------------------- - * | vad_bos |前端点检测: 静音超时时间,即用户多长时间不说话则当做超时处理; 单位:ms; - * | | engine指定iat识别默认值为5000; - * | | 其他情况默认值为 4000,范围 0-10000。 - * | ------------- |----------------------------------------------------------- - * | vad_eos |后断点检测: 后端点静音检测时间,即用户停止说话多长时间内即认为不再输入, - * | | 自动停止录音;单位:ms; - * | | sms 识别默认值为 1800; - * | | 其他默认值为 700,范围 0-10000。 - * | ------------- |----------------------------------------------------------- - * | sample_rate |采样率:目前支持的采样率设置有 16000 和 8000。 - * | ------------- |----------------------------------------------------------- - * | asr_ptt |标点符号设置: 默认为 1,当设置为 0 时,将返回无标点符号文本。 - * | ------------- |----------------------------------------------------------- - * | result_type |返回结果的数据格式: 可设置为json,xml,plain,默认为json。 - * | ------------- |----------------------------------------------------------- - * | grammarID |识别的语法id: 只针对 domain 设置为”asr”的应用。 - * | ------------- |----------------------------------------------------------- - * | asr_audio_path|音频文件名: 设置此参数后,将会自动保存识别的录音文件。 - * | | 路径为Documents/(指定值)。 - * | | 不设置或者设置为nil,则不保存音频。 - * | ------------- |----------------------------------------------------------- - * | params |扩展参数: 对于一些特殊的参数可在此设置,一般用于设置语义。 - * | ------------- |----------------------------------------------------------- - * - */ - -/*! - * 设置识别引擎的参数 - * 识别的引擎参数(key)取值如下: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    *参数描述
    domain应用的领域: 取值为:iat、search、video、poi、music、asr;
    iat:普通文本听写;
    search:热词搜索;
    video:视频音乐搜索;
    video:视频音乐搜索;
    asr:关键词识别;
    vad_bos前端点检测: 静音超时时间,即用户多长时间不说话则当做超时处理; 单位:ms;
    engine指定iat识别默认值为5000;
    其他情况默认值为 4000,范围 0-10000。
    vad_eos后断点检测: 后端点静音检测时间,即用户停止说话多长时间内即认为不再输入,
    自动停止录音;单位:ms;
    sms 识别默认值为 1800;
    其他默认值为 700,范围 0-10000。
    sample_rate采样率:目前支持的采样率设置有 16000 和 8000。
    asr_ptt标点符号设置: 默认为 1,当设置为 0 时,将返回无标点符号文本。
    result_type返回结果的数据格式: 可设置为json,xml,plain,默认为json。
    grammarID识别的语法id: 只针对 domain 设置为”asr”的应用。
    asr_audio_path音频文件名: 设置此参数后,将会自动保存识别的录音文件。
    路径为Documents/(指定值)。
    不设置或者设置为nil,则不保存音频。
    params扩展参数: 对于一些特殊的参数可在此设置,一般用于设置语义。
    - * @param value 参数对应的取值 - * @param key 识别引擎参数 - * - * @return 成功返回YES;失败返回NO - */ --(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; - -/*! - * 获取识别引擎参数 - * - * @param key 参数key - * - * @return 参数值 - */ --(NSString*) parameterForKey:(NSString *)key; - -/*! - * 开始识别 - * - * @return 成功返回YES;失败返回NO - */ -- (BOOL)start; - -/*! - * 取消本次识别 - */ -- (void)cancel; - - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyRecognizerViewDelegate.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyRecognizerViewDelegate.h deleted file mode 100755 index 07c20359..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyRecognizerViewDelegate.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// IFlyRecognizerDelegate.h -// MSC -// -// Created by admin on 13-4-16. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import - -@class IFlyRecognizerView; -@class IFlySpeechError; - -/*! - * 识别回调委托 - */ -@protocol IFlyRecognizerViewDelegate - -/*! - * 回调返回识别结果 - * - * @param resultArray 识别结果,NSArray的第一个元素为NSDictionary,NSDictionary的key为识别结果,sc为识别结果的置信度 - * @param isLast -[out] 是否最后一个结果 - */ -- (void)onResult:(NSArray *)resultArray isLast:(BOOL) isLast; - -/*! - * 识别结束回调 - * - * @param error 识别结束错误码 - */ -- (void)onError: (IFlySpeechError *) error; - -@optional - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyResourceUtil.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyResourceUtil.h deleted file mode 100755 index 4f11d14a..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyResourceUtil.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// IFlyResourceUtil.h -// MSCDemo -// -// Created by admin on 14-6-20. -// Copyright (c) 2014年 iflytek. All rights reserved. -// - -#import - -/*! - * 资源工具类 - */ -@interface IFlyResourceUtil : NSObject - -/*! - * 获取通过MSPSetParam,启动引擎的标识 - * - * @return 通过MSPSetParam,启动引擎的标识 - */ -+(NSString*) ENGINE_START; - -/*! - * 获取通过MSPSetParam,销毁引擎的标识 - * - * @return 通过MSPSetParam,销毁引擎的标识 - */ -+(NSString*) ENGINE_DESTROY; - -/*! - * 获取识别引擎的资源目录标识 - * - * @return 识别引擎的资源目录标识 - */ -+(NSString*) ASR_RES_PATH; - -/*! - * 得到语法构建目录 - * - * @return 语法构建目录 - */ -+(NSString*) GRM_BUILD_PATH; - -/*! - * 获取合成引擎的资源目录标识,同时需要先传入voice_name方可生效 - * - * @return 合成引擎的资源目录标识,同时需要先传入voice_name方可生效 - */ -+(NSString*) TTS_RES_PATH; - -/*! - * 获取唤醒资源的资源目录标识 - * - * @return 唤醒资源的资源目录标识 - */ -+(NSString*) IVW_RES_PATH; - -/*! - * 语法类型 - * - * @return 语法类型 - */ -+(NSString*) GRAMMARTYPE; - -/*! - * 资源存放路径 - * - * @param path 设置的路径 - * - * @return 资源目录 - */ -+(NSString*) generateResourcePath:(NSString *)path; - - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySetting.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySetting.h deleted file mode 100755 index c19f245b..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySetting.h +++ /dev/null @@ -1,93 +0,0 @@ -// -// IFlySetting.h -// MSC -// -// Created by iflytek on 13-4-12. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import - -/*! - * 日志打印等级 - */ -typedef NS_OPTIONS(NSInteger, LOG_LEVEL){ - /*! - * 全部打印 - */ - LVL_ALL = -1, - /*! - * 高,异常分析需要的级别 - */ - LVL_DETAIL = 31, - /*! - * 中,打印基本日志信息 - */ - LVL_NORMAL = 15, - /*! - * 低,只打印主要日志信息 - */ - LVL_LOW = 7, - /*! - * 不打印 - */ - LVL_NONE = 0 -}; - -/*! - * 此接口为iflyMSC sdk 配置接口。 - * 可以获取版本号,设置日志打印等级等 - */ -@interface IFlySetting : NSObject - -/*! - * 获取版本号 - * - * @return 版本号 - */ -+ (NSString *) getVersion; - -/*! - * 获取日志等级 - * - * @return 返回日志等级 - */ -+ (LOG_LEVEL) logLvl; - -/*! - * 是否打印控制台log - * 在软件发布时,建议关闭此log。 - * - * @param showLog -[in] YES,打印log;NO,不打印 - */ -+ (void) showLogcat:(BOOL) showLog; - -/*! - * 设置日志msc.log生成路径以及日志等级 - * - * - * - * - * - * - * - * - * - * - * - * - *
    *日志打印等级描述
    LVL_ALL全部打印
    LVL_DETAIL高,异常分析需要的级别
    LVL_NORMAL中,打印基本日志信息
    LVL_LOW低,只打印主要日志信息
    LVL_NONE不打印
    - * - * @param level -[in] 日志打印等级 - */ -+ (void) setLogFile:(LOG_LEVEL) level; - -/*! - * 设置日志文件的路径 - * 日志文件默认存放在Documents目录。 - * - * @param path -[in] 日志文件的全路径 - */ -+ (void) setLogFilePath:(NSString*) path; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechConstant.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechConstant.h deleted file mode 100755 index 79dcd204..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechConstant.h +++ /dev/null @@ -1,796 +0,0 @@ -// -// IFlySpeechConstant.h -// MSCDemo -// -// Created by iflytek on 5/9/14. -// Copyright (c) 2014 iflytek. All rights reserved. -// - -#import - -/*! - * 公共常量类 - * 主要定义参数的key value值 - */ -@interface IFlySpeechConstant : NSObject - - -#pragma mark - 通用参数key - -/*! - * 语音应用ID - * 通过开发者网站申请 - * - * @return 语音应用IDkey - */ -+(NSString*)APPID; - - -/*! - * 语言区域。 - * - * @return 语言区域key。 - */ -+(NSString*)ACCENT; - -/*! - * 语言区域。 - * - * @return 普通话value。 - */ -+(NSString*)ACCENT_MANDARIN; - -/*! - * 语言区域。 - * - * @return 河南话value。 - */ -+(NSString*)ACCENT_HENANESE; - -/*! - * 语言区域。 - * - * @return 粤语value。 - */ -+(NSString*)ACCENT_CANTONESE; - -/*! - * 语言 - * 支持:zh_cn,zh_tw,en_us
    - * - * @return 语言key - */ -+(NSString*)LANGUAGE; - -/*! - * 语言 - * - * @return 中文value - */ -+(NSString*)LANGUAGE_CHINESE; - - -/*! - * 语言 - * - * @return 中文台湾value - */ -+(NSString*)LANGUAGE_CHINESE_TW; - -/*! - * 语言 - * - * @return 英文value - */ -+(NSString*)LANGUAGE_ENGLISH; - -/*! - * 返回结果的数据格式, - * 可设置为json,xml,plain,默认为json。 - * - * @return 返回结果的数据格式key - */ -+(NSString*)RESULT_TYPE; - -/*! - * 应用领域。 - * - * @return 应用领域key - */ -+(NSString*)IFLY_DOMAIN; - -/*! - * 个性化数据上传类型 - * - * @return 个性化数据上传类型key - */ -+(NSString*)DATA_TYPE; - -/*! - * 语音输入超时时间 - * 单位:ms,默认30000 - * - * @return 语音输入超时时间key - */ -+(NSString*)SPEECH_TIMEOUT; - -/*! - * 网络连接超时时间 - * 单位:ms,默认20000 - * - * @return 网络连接超时时间key - */ -+(NSString*)NET_TIMEOUT; - -/*! - * 业务类型。 - * - * @return 业务类型key。 - */ -+(NSString*)SUBJECT; - -/*! - * 扩展参数。 - * - * @return 扩展参数key。 - */ -+(NSString*)PARAMS; - -/** - * 加密参数 - * - * 支持类型:ssl 加密 tcp 非加密 默认:tcp - * 建议对安全性要求较高时使用ssl。 - * - * @return 加密参数key - */ -+(NSString*)PROT_TYPE; - -/** - * ssl证书内容 - * - * @return ssl证书内容key - */ -+(NSString*)SSL_CERT; - -/*! - * 录音音量返回时间间隔。 - * - * @return 间隔key。 - */ -+(NSString*)POWER_CYCLE; - -/*! - * 合成、识别、唤醒、评测、声纹等业务采样率。 - * - * @return 合成及识别采样率key。 - */ -+(NSString*)SAMPLE_RATE; - -/*! - * 合成、识别、唤醒、评测、声纹等业务采样率。 - * - * @return 合成及识别采样率8K Value。 - */ -+(NSString*)SAMPLE_RATE_8K; - -/*! - * 合成、识别、唤醒、评测、声纹等业务采样率。 - * - * @return 合成及识别采样率16K Value。 - */ -+(NSString*)SAMPLE_RATE_16K; - -/*! - * 引擎类型。 - * 可选:local,cloud,auto - * 默认:auto - * - * @return 引擎类型key。 - */ -+(NSString*)ENGINE_TYPE; - -/*! - * 本地识别引擎。 - * - * @return 本地识别引擎value。 - */ -+(NSString*)TYPE_LOCAL; - -/*! - * 云端识别引擎。 - * - * @return 云端识别引擎value。 - */ -+(NSString*)TYPE_CLOUD; - -/*! - * 混合识别引擎。 - * - * @return 混合识别引擎value。 - */ -+(NSString*)TYPE_MIX; - -/*! - * 引擎根据当前配置进行选择。 - * - * @return 引擎根据当前配置进行选择value。 - */ -+(NSString*)TYPE_AUTO; - -/*! - * 输入文本编码格式。 - * - * @return 编码格式key。 - */ -+(NSString*)TEXT_ENCODING; - -/*! - * 结果编码格式。 - * - * @return 结果编码格式key。 - */ -+(NSString*)RESULT_ENCODING; - -#pragma mark - 合成相关设置key -/*! - * 语速 - * 范围 (0~100) 默认值:50 - * - * @return 语速key - */ -+(NSString*)SPEED; - -/*! - * 音调 - * 范围(0~100)默认值:50 - * - * @return 音调key - */ -+(NSString*)PITCH; - -/*! - * 合成录音保存路径 - * - * @return 合成录音保存路径key - */ -+(NSString*)TTS_AUDIO_PATH; - -/** - * 启用VAD功能 - * - * @return 启用VAD功能key - */ -+(NSString*)VAD_ENABLE; - -/*! - * VAD前端点超时 - * 范围:0-10000(单位ms) - * - * @return VAD前端点超时key - */ -+(NSString*)VAD_BOS; - -/*! - * VAD后端点超时 。 - * 可选范围:0-10000(单位ms) - * - * @return VAD后端点超时key - */ -+(NSString*)VAD_EOS; - - -/* - * 云端支持如下发音人: - * 对于网络TTS的发音人角色,不同引擎类型支持的发音人不同,使用中请注意选择。 - * - * |--------|----------------| - * | 发音人 | 参数 | - * |--------|----------------| - * | 小燕 | xiaoyan | - * |--------|----------------| - * | 小宇 | xiaoyu | - * |--------|----------------| - * | 凯瑟琳 | catherine | - * |--------|----------------| - * | 亨利 | henry | - * |--------|----------------| - * | 玛丽 | vimary | - * |--------|----------------| - * | 小研 | vixy | - * |--------|----------------| - * | 小琪 | vixq | - * |--------|----------------| - * | 小峰 | vixf | - * |--------|----------------| - * | 小梅 | vixl | - * |--------|----------------| - * | 小莉 | vixq | - * |--------|----------------| - * | 小蓉 | vixr | - * |--------|----------------| - * | 小芸 | vixyun | - * |--------|----------------| - * | 小坤 | vixk | - * |--------|----------------| - * | 小强 | vixqa | - * |--------|----------------| - * | 小莹 | vixyin | - * |--------|----------------| - * | 小新 | vixx | - * |--------|----------------| - * | 楠楠 | vinn | - * |--------|----------------| - * | 老孙 | vils | - * |--------|----------------| - */ - -/*! - * 发音人 - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    *云端发音人名称参数
    小燕xiaoyan
    小宇xiaoyu
    凯瑟琳catherine
    亨利henry
    玛丽vimary
    小研vixy
    小琪vixq
    小峰vixf
    小梅vixl
    小莉vixq
    小蓉(四川话)vixr
    小芸vixyun
    小坤vixk
    小强vixqa
    小莹vixying
    小新vixx
    楠楠vinn
    老孙vils
    - * - * @return 发音人key - */ -+(NSString*)VOICE_NAME; - -/*! - * 音量 - * 范围(0~100) 默认值:50 - * - * @return 音量key - */ -+(NSString*)VOLUME ; - -/*! - * 合成音频播放缓冲时间 - * 即缓冲多少秒音频后开始播放,如tts_buffer_time=1000; - * 默认缓冲1000ms毫秒后播放。 - * - * @return 合成音频播放缓冲时间缓冲时间key - */ -+(NSString*)TTS_BUFFER_TIME ; - -/** 合成数据即时返回 - */ - -/** - * 合成数据是否即时返回 - * 是否需要数据回调,为1时,当合成一段音频会通过onEvent回调返回,直接合成结束; - * 设置为1为即时返回;0为非即时返回;默认值为0; - * - * @return 成数据即时返回key - */ -+(NSString*)TTS_DATA_NOTIFY; - -/** - * 预合成文本 - * - * @return 约合成文本参数key - */ -+(NSString*)NEXT_TEXT; - -/** - * 是否需要打开MPPlayingInfocenter - * - * @return 是否需要打开MPPlayingInfocenter 参数key - */ -+(NSString*)MPPLAYINGINFOCENTER; - -#pragma mark - 识别、听写、语义相关设置key - -/*! - * 录音源 - * 录音时的录音方式,默认为麦克风,设置为1; - * 如果需要外部送入音频,设置为-1,通过WriteAudio接口送入音频。 - * - * @return 录音源key - */ -+(NSString*)AUDIO_SOURCE; - -/*! - * 识别录音保存路径 - * - * @return 识别录音保存路径key - */ -+(NSString*) ASR_AUDIO_PATH; - -/*! - * 设置是否开启语义 - * - * @return 设置是否开启语义key - */ -+(NSString*)ASR_SCH; - -/*! - * 设置是否有标点符号 - * - * @return 设置是否有标点符号key - */ -+(NSString*)ASR_PTT; - -/*! - * ASR_PTT 参数值:设置带标点符号 - * - * @return 设置是有标点符号Value - */ -+(NSString*)ASR_PTT_HAVEDOT; - -/*! - * ASR_PTT 参数值:设置不带标点符号 - * - * @return 设置是无标点符号Value - */ -+(NSString*)ASR_PTT_NODOT; - -/*! - * 本地语法名称。 - * 本地语法名称,对应云端的有CLOUD_GRAMMAR - * - * @return 本地语法名称key。 - */ -+(NSString*)LOCAL_GRAMMAR; - -/*! - * 云端语法ID。 - * 云端编译语法返回的表示,早期版本使用GRAMMAR_ID,仍然兼容,但建议使用新的。 - * - * @return 云端语法ID key。 - */ -+(NSString*)CLOUD_GRAMMAR; - -/*! - * 语法类型 - * - * @return 语法类型key - */ -+(NSString*)GRAMMAR_TYPE; - -/*! - * 语法内容。 - * - * @return 语法内容key。 - */ -+(NSString*)GRAMMAR_CONTENT; - -/*! - * 字典内容。 - * - * @return 字典内容key。 - */ -+(NSString*)LEXICON_CONTENT; - -/*! - * 字典名字。 - * - * @return 字典名字key。 - */ -+(NSString*)LEXICON_NAME; - -/*! - * 语法名称列表。 - * - * @return 语法名称列表key。 - */ -+(NSString*)GRAMMAR_LIST; - -/*! - * 开放语义协议版本号。 - * 如需使用请在http://osp.voicecloud.cn/上进行业务配置 - * - * @return 开放语义协议版本号key。 - */ -+(NSString*)NLP_VERSION; - -#pragma mark - 唤醒相关设置key -/*! - * 唤醒门限值。 - * - * @return 唤醒门限值key。 - */ -+(NSString*)IVW_THRESHOLD; - -/*! - * 唤醒服务类型。 - * - * @return 唤醒服务类型key。 - */ -+(NSString*)IVW_SST; - -/*! - * 唤醒+识别。 - * - * @return 唤醒+识别key。 - */ -+(NSString*)IVW_ONESHOT; - -/*! - * 唤醒工作方式 - * 1:表示唤醒成功后继续录音,0:表示唤醒成功后停止录音。 - * - * @return 唤醒工作方式key - */ -+(NSString*)KEEP_ALIVE; - -#pragma mark - 评测相关设置key -/*! - * 评测类型
    - * 可选值:read_syllable(英文评测不支持):单字;read_word:词语;read_sentence:句子;read_chapter(待开放):篇章。 - * - * @return 评测类型 key - */ -+(NSString*)ISE_CATEGORY; - -/*! - * 评测结果等级
    - * 可选值:complete:完整 ;plain:简单 - * - * @return 评测结果等级 key - */ -+(NSString*)ISE_RESULT_LEVEL; - -/*! - * 评测结果格式 - * 可选值:xml;plain - * - * @return 评测结果格式 key - */ -+(NSString*)ISE_RESULT_TYPE; - -/*! - * 评测录音保存路径 - * - * @return 评测录音保存路径key - */ -+(NSString*) ISE_AUDIO_PATH; - - -#pragma mark - 语音+业务key -/** - * 本地所有资源 - * - * @return 本地所有资源key - */ -+ (NSString *)PLUS_LOCAL_ALL; - -/** - * 本地合成资源 - * - * @return 本地合成资源key - */ -+ (NSString *)PLUS_LOCAL_TTS; - -/** - * 本地识别资源 - * - * @return 本地识别资源key - */ -+ (NSString *)PLUS_LOCAL_ASR; - -/** - * 本地唤醒资源 - * - * @return 本地唤醒资源key - */ -+ (NSString *)PLUS_LOCAL_IVW; - -#pragma mark - 身份验证业务key - -/** - * auth_id - * 用于用户注册和登录、查询、删除等业务时标识用户身份 - * - * @return 用户标识 - */ -+ (NSString*)MFV_AUTH_ID; - -/** - * 请求业务类型,可选值:mfv(默认,融合验证),ivp(声纹),ifr(人脸) - * - * @return 请求业务类型key - */ -+ (NSString*)MFV_SUB; - -/** - * 会话类型,不同sub有不同的sst取值。 - * ifr:enroll,verify,identify,reenroll,query,delete - * ivp:enroll(train),verify,reenroll,query,delete,download - * - * @return 会话类型key - */ -+ (NSString*)MFV_SST; - -/** - * 融合验证模式,仅在融合验证场景下使用。可选值:sin(单一生物特征数据验证),mix(混合生物特征数据验证),agi(灵活生物特征数据验证) - * - * @return 融合验证模式key - */ -+ (NSString*)MFV_VCM; - -/** - * 特征场景,用来说明本次验证将涉及的业务。可选值:ivp,ifr,ivp|ifr - * - * @return 特征场景 key - */ -+ (NSString*)MFV_SCENES; - -/** - * 确认周期(affirmance cycle,单位:s),用户设置的确认超时时间(生命周期),仅在灵活融合验证场景下使用 - * - * @return 确认周期key - */ -+ (NSString*)MFV_AFC; - -/** - * 数据保存路径 - * - * @return 数据保存路径key - */ -+ (NSString*)MFV_DATA_PATH; - -/** - * 训练次数:取值2~9.无默认值,必须明确指定。 - * - * @return 训练次数key - */ -+ (NSString*)MFV_RGN; - -/** - * 声纹确认门限值,验证得分>=tsd验证通过,否则验证失败(该参数目前不支持,作为保留参数。)却只范围:0~100. - * - * @return 声纹确认门限值key - */ -+ (NSString*)MFV_TSD; - -/** - * 密码文本。从服务端下载,比如数字密码所需要的数字串。 - * - * @return 密码文本key - */ -+ (NSString*)MFV_PTXT; - -/** - * 密码类型。取值:1(文本密码),2(自由说),3(数字密码). - * - * @return 密码类型key - */ -+ (NSString*)MFV_PWDT; - -/** - * 取消注册。取值:0(不取消,即不生效),1(取消本次注册). - * - * @return 取消注册key - */ -+ (NSString*)MFV_FIN; - -/** - * 等待超时时间:描述客户端等待结果的超时时间 - * - * @return 等待超时时间:key - */ -+ (NSString*)MFV_WTT; - -/** - * 数据格式 - * 声纹为音频采样率支持:16000和8000;人脸为图片格式,支持jpg和gif - * - * @return 数据格式key - */ -+ (NSString*)MFV_DATA_FORMAT; - -/** - * 数据压缩编码 - * 声纹为;人脸支持raw,不对图片压缩 - * - * @return 数据压缩编码key - */ -+ (NSString*)MFV_DATA_ENCODING; - -#pragma mark - 人脸业务key - -//1. sub 取值: wfr 用途: 用于区分业务类型,web访问方式中,nginx配置不用使用,但是在结构化日志和染色日志记录中使用。 -//2. sst 取值: reg、verify、detect、align 用途: 指定本路会话是属于何种性质 -// + 人脸图像注册(reg):上传图像,验证图像的有效性,然后存储起来,作为数据源。 -// + 人脸图像验证(verify):通过与指定源图像比较,验证人脸相似性。 -// + 人脸图像检测(detect):能够检测出不同姿态方位的人脸在图中的位置。 -// + 人脸图像聚焦(align):在给定人脸框下自动标定出两眼、鼻尖、嘴角的坐标。 -//3. aue 取值: raw 用途: 图像压缩格式,现在引擎不支持图像压缩,aue只能取值raw -//4. pset 取值: 整数 用途: 人脸识别验证阈值,取值可以是负数也可以是整数。 -//5. skip 取值: true/false 用途: 后台图片处理是否进行过滤。true表示不过滤,false表示过滤 -//6. gid 取值: *********** 用途: 图像模型id,如:4a6c124ed6b78436ee5aac4563f13eb5 -//7. appid 取值:用户申请的appid 用途: 验证用户 - - -/** sub 默认值:wfr - * 用于区分业务类型,web访问方式中,nginx配置不用使用,但是在结构化日志和染色日志记录中使用。 - */ -+ (NSString*) FACE_SUB; - -/** WFR - * sub参数的默认值 - */ -+ (NSString*) FACE_WFR; - -/** sst - * 指定本路会话是属于何种性质 - */ -+ (NSString*) FACE_SST; - -/** REG - * 人脸图像注册(reg):上传图像,验证图像的有效性,然后存储起来,作为数据源。 - */ -+ (NSString*) FACE_REG; -/** VERIFY - * 人脸图像验证(verify):通过与指定源图像比较,验证人脸相似性。 - */ -+ (NSString*) FACE_VERIFY; -/** DETECT - * 人脸图像检测(detect):能够检测出不同姿态方位的人脸在图中的位置。 - */ -+ (NSString*) FACE_DETECT; -/** ALIGN - * 人脸图像聚焦(align):在给定人脸框下自动标定出两眼、鼻尖、嘴角的坐标。 - */ -+ (NSString*) FACE_ALIGN; - -/** ATTR - * 面部属性识别(attr):对面部属性进行识别:例如秃顶、刘海、大嘴、模糊、眼镜等。 - */ -+ (NSString*) FACE_ATTR; - - -/** AUE - * 图像压缩格式,现在引擎不支持图像压缩,aue只能取值raw - */ -+ (NSString*) FACE_AUE; - -/** RAW - * AUE参数的值 - */ -+ (NSString*) FACE_RAW; - -/** PSET - * 人脸识别验证阈值,取值可以是负数也可以是整数。 - */ -+ (NSString*) FACE_PSET; - -/** SKIP - * 后台图片处理是否进行过滤。true表示不过滤,false表示过滤,传入字符串@“true”或@“false” - */ -+ (NSString*) FACE_SKIP; - -/** GID - * 图像模型id,如:4a6c124ed6b78436ee5aac4563f13eb5 - */ -+ (NSString*) FACE_GID; - -/** DVC - * 用户设备编号,用于验证用户 - */ -+ (NSString*) FACE_DVC; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechError.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechError.h deleted file mode 100755 index 01e7a3f1..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechError.h +++ /dev/null @@ -1,54 +0,0 @@ -// -// IFlySpeechError.h -// MSC -// -// Created by iflytek on 13-3-19. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import - -/*! - * 错误描述类 - */ -@interface IFlySpeechError : NSObject - -/*! - * 错误码 - */ -@property(nonatomic,assign) int errorCode; - -/*! - * 错误码类 - */ -@property(nonatomic,assign) int errorType; - -/*! - * 错误描述 - */ -@property(nonatomic,retain) NSString* errorDesc; - -/*! - * 初始化 - * - * @param errorCode -[in] 错误码 - * - * @return IFlySpeechError对象 - */ -+ (id) initWithError:(int) errorCode; - -/*! - * 获取错误码 - * - * @return 错误码 - */ --(int) errorCode; - -/*! - * 获取错误描述 - * - * @return 错误描述 - */ -- (NSString *) errorDesc; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvaluator.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvaluator.h deleted file mode 100755 index 7d44fb4a..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvaluator.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// IFlySpeechEvaluator.h -// msc -// -// Created by jianzhang on 14-1-13 -// Copyright (c) 2013年 iflytek. All rights reserved. -// - - -#import -#import "IFlySpeechEvaluatorDelegate.h" - -/*! - * 语音评测类 - */ -@interface IFlySpeechEvaluator : NSObject - -/*! - * 设置委托对象 - */ -@property (assign) id delegate; - -/*! - * 返回评测对象的单例 - * - * @return 别对象的单例 - */ -+ (id)sharedInstance; - -/*! - * 销毁评测对象。 - * - * @return 成功返回YES,失败返回NO。 - */ -- (BOOL)destroy; - -/*! - * 设置评测引擎的参数 - * - * @param value 评测引擎参数值 - * @param key 评测引擎参数 - * - * @return 设置的参数和取值正确返回YES,失败返回NO - */ -- (BOOL)setParameter:(NSString *)value forKey:(NSString *)key; - - -/*! - * 获得评测引擎的参数 - * - * @param key 评测引擎参数 - * - * @return key对应的参数值 - */ -- (NSString*)parameterForKey:(NSString *)key; - -/*! - * 开始评测 - * 同时只能进行一路会话,这次会话没有结束不能进行下一路会话,否则会报错 - * - * @param data 评测的试题 - * @param params 评测的参数 - */ -- (void)startListening:(NSData *)data params:(NSString *)params; - -/*! - * 停止录音 - * 调用此函数会停止录音,并开始进行语音识别 - */ -- (void)stopListening; - -/*! - * 取消本次会话 - */ -- (void)cancel; - -@end - diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvaluatorDelegate.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvaluatorDelegate.h deleted file mode 100755 index cc18a087..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvaluatorDelegate.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// IFlySpeechEvaluatorDelegate.h -// msc -// -// Created by admin on 13-6-19. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - - -#import - -@class IFlySpeechError; - -/*! - * 评测协议 - */ -@protocol IFlySpeechEvaluatorDelegate - -/*! - * 音量和数据回调 - * - * @param volume 音量 - * @param buffer 音频数据 - */ -- (void)onVolumeChanged:(int)volume buffer:(NSData *)buffer; - -/*! - * 开始录音回调 - * 当调用了`startListening`函数之后,如果没有发生错误则会回调此函数。如果发生错误则回调onError:函数 - */ -- (void)onBeginOfSpeech; - -/*! - * 停止录音回调 - * 当调用了`stopListening`函数或者引擎内部自动检测到断点,如果没有发生错误则回调此函数。 - * 如果发生错误则回调onError:函数 - */ -- (void)onEndOfSpeech; - -/*! - * 正在取消 - */ -- (void)onCancel; - -/*! - * 评测错误回调 - * 在进行语音评测过程中的任何时刻都有可能回调此函数,你可以根据errorCode进行相应的处理. - * 当errorCode没有错误时,表示此次会话正常结束,否则,表示此次会话有错误发生。特别的当调用 - * `cancel`函数时,引擎不会自动结束,需要等到回调此函数,才表示此次会话结束。在没有回调此函 - * 数之前如果重新调用了`startListenging`函数则会报错误。 - * - * @param errorCode 错误描述类 - */ -- (void)onError:(IFlySpeechError *)errorCode; - -/*! - * 评测结果回调 - * 在评测过程中可能会多次回调此函数,你最好不要在此回调函数中进行界面的更改等操作,只需要将回调的结果保存起来。 - * - * @param results -[out] 评测结果。 - * @param isLast -[out] 是否最后一条结果 - */ -- (void)onResults:(NSData *)results isLast:(BOOL)isLast; - -@end - diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvent.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvent.h deleted file mode 100755 index d056a021..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechEvent.h +++ /dev/null @@ -1,171 +0,0 @@ -// -// IFlySpeechEvent.h -// MSCDemo -// -// Created by admin on 14-8-12. -// Copyright (c) 2014年 iflytek. All rights reserved. -// - -#import - -/*! - * 事件类型 - */ -typedef NS_ENUM(NSUInteger,IFlySpeechEventType){ - /*! - * 网络状态消息 - * 在消息到达时,可通过onEvent的第2个参数arg1,获取当前网络连接状态值 - */ - IFlySpeechEventTypeNetPref = 10001, - /** - * 转写音频文件消息 - * 在录音模式下,成功创建音频文件时返回。可通过onEvent - * 第4个参数data 指定Key为[IFlySpeechConstant IST_AUDIO_PATH],获取音频文件绝对路径. - * 或通过[IFlySpeechTranscripter getParameter:[IFlySpeechConstant IST_AUDIO_PATH]], - * 获取音频文件绝对路径. - */ - IFlySpeechEventTypeISTAudioFile = 10004, - /** - * 转写已上传字节消息 - * 在消息到达时,通过onEvent - * 的第二个参数arg1,获取已确认上传到服务器的字节数. - * 若当前音频源为非写音频模式,还可通过onEvent - * 的第三个参数arg2,获取当前所有音频的字节大小.录音模式时,由于所有音频字节大小会变。 - * 当停止音频输入后(等待录音时间超时 - * [IFlySpeechConstant SPEECH_TIMEOUT] - * ,或调用[IFlySpeechTranscripter stopTranscripting]), - * 且服务器收到所有音频时,第四个参数data,将包含完成标记的布尔值(true),可通过data调用 - * 指定KEY为KCIFlySpeechEventKeyISTUploadComplete获取。 - * 此消息可能多次返回. - */ - IFlySpeechEventTypeISTUploadBytes = 10006, - - /** - * 转写缓存剩余 - * 此消息仅在音频源为-1时需要关注 - * 在调用[IFlySpeechTranscripter writeAudio]写音频时,应该关注此事件。 - * 此事件在调用写音频接口、及音频最后被写入底库库时分别回调一次。当事件回调时,通过onEvent - * 的第二个参数arg1,获取当前剩余的缓存大小,当缓存小于要写入的音频时,应该先暂停写音频数据,直到下次缓存大小大于要写入的音频时. - * 最大缓存为128KByte。 - */ - IFlySpeechEventTypeISTCacheLeft = 10007, - - /** - * 转写结果等待时间消息 - * 在消息到达时,通过 onEvent - * 的第二个参数arg1,获取当前结果需要的时间. - * 此消息可能多次返回,返回时间不定,且不一定会返回. - */ - IFlySpeechEventTypeISTResultTime= 10008, - - /** - * 转写转写音频同步ID消息 - * 在消息到达时,通过 onEvent - * 的第二个参数arg1,获取当前写音频同步ID. - * 此消息可能多次返回. - */ - IFlySpeechEventTypeISTSyncID= 10009, - - /** - * 会话开始消息 - * 在会话开始成功后返回 - */ - IFlySpeechEventTypeSessionBegin = 10010, - - /** - * 会话结束消息 - * 在会话结束前返回 - */ - IFlySpeechEventTypeSessionEnd = 10011, - - /** - * 音量消息,在得到音量时抛出,暂时只有身份验证的声纹业务用到 - */ - IFlySpeechEventTypeVolume = 10012, - - /** - * VAD后端点消息,在检测到VAD后端点时抛出,暂时只有身份验证的声纹业务用到 - */ - IFlySpeechEventTypeVadEOS = 10013, - - /*! - * 服务端会话id - * 在消息到达时,可通过onEvent的第4个参数data(字典类型), - * 指定key KCIFlySpeechEventKeySessionID,获取服务端会话id. - */ - IFlySpeechEventTypeSessionID = 20001, - - /*! - * TTS合成数据消息 - * -(void)onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData - * 其中eventData中包含数据 - * - */ - IFlySpeechEventTypeTTSBuffer = 21001, - - /*! - * 通知cancel方法被调用的回调 - * - */ - IFlySpeechEventTypeTTSCancel = 21002, - - /*! - * IVW onshot 听写 or 识别结果 - * 在消息到达时,第2个参数arg1包含是否为最后一个结果:1为是,0为否; - * 第4个参数data中包含数据,通过指定KEY为KCIFlySpeechEventKeyIVWResult获取. - */ - IFlySpeechEventTypeIVWResult = 22001, - - /*! - * 开始处理录音数据 - * - */ - IFlySpeechEventTypeSpeechStart= 22002, - - /*! - * 录音停止 - * - */ - IFlySpeechEventTypeRecordStop= 22003, - - /*! - * 服务端音频url - * 在消息到达时, - * 第4个参数data,包含数据,通过 - * 指定KEY为KCIFlySpeechEventKeyAudioUrl获取. - */ - IFlySpeechEventTypeAudioUrl = 23001, - - /*! - * 变声数据结果返回 - * - * 设置voice_change参数获取结果. - */ - IFlySpeechEventTypeVoiceChangeResult = 24001 - -}; - -#pragma mark - keys for event data - -/** - * 转写是否已上传完标记key - */ -extern NSString* const KCIFlySpeechEventKeyISTUploadComplete; - -/** - * 服务端会话key - */ -extern NSString* const KCIFlySpeechEventKeySessionID; -/** - * TTS取音频数据key - */ -extern NSString* const KCIFlySpeechEventKeyTTSBuffer; -/** - * IVW oneshot 听写 or 识别结果 key - */ -extern NSString* const KCIFlySpeechEventKeyIVWResult; -/** - * 服务端音频url key - */ -extern NSString* const KCIFlySpeechEventKeyAudioUrl; - diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechRecognizer.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechRecognizer.h deleted file mode 100755 index e1316a62..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechRecognizer.h +++ /dev/null @@ -1,174 +0,0 @@ -// -// IFlySpeechRecognizer.h -// MSC -// -// Created by iflytek on 13-3-19. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import - -#import "IFlySpeechRecognizerDelegate.h" - -#define IFLY_AUDIO_SOURCE_MIC @"1" -#define IFLY_AUDIO_SOURCE_STREAM @"-1" - -/*! - * 语音识别类 - * 此类现在设计为单例,你在使用中只需要创建此对象,不能调用release/dealloc函数去释放此对象。所有关于语音识别的操作都在此类中。 - */ -@interface IFlySpeechRecognizer : NSObject - -/** 设置委托对象 */ -@property(nonatomic,assign) id delegate ; - -/*! - * 返回识别对象的单例 - * - * @return 识别对象的单例 - */ -+ (id) sharedInstance; - -/*! - * 销毁识别对象。 - * - * @return 成功返回YES,失败返回NO - */ -- (BOOL) destroy; - -/* - * | ------------- |----------------------------------------------------------- - * | 参数 | 描述 - * | ------------- |----------------------------------------------------------- - * | domain |应用的领域: 取值为:iat、search、video、poi、music、asr; - * | | iat:普通文本听写; - * | | search:热词搜索; - * | | video:视频音乐搜索; - * | | asr:关键词识别; - * | ------------- |----------------------------------------------------------- - * | vad_bos |前端点检测: 静音超时时间,即用户多长时间不说话则当做超时处理; 单位:ms; - * | | engine指定iat识别默认值为5000; - * | | 其他情况默认值为 4000,范围 0-10000。 - * | ------------- |----------------------------------------------------------- - * | vad_eos |后断点检测: 后端点静音检测时间,即用户停止说话多长时间内即认为不再输入, - * | | 自动停止录音;单位:ms; - * | | sms 识别默认值为 1800; - * | | 其他默认值为 700,范围 0-10000。 - * | ------------- |----------------------------------------------------------- - * | sample_rate |采样率:目前支持的采样率设置有 16000 和 8000。 - * | ------------- |----------------------------------------------------------- - * | asr_ptt |标点符号设置: 默认为 1,当设置为 0 时,将返回无标点符号文本。 - * | ------------- |----------------------------------------------------------- - * | result_type |返回结果的数据格式: 可设置为json,xml,plain,默认为json。 - * | ------------- |----------------------------------------------------------- - * | grammarID |识别的语法id: 只针对 domain 设置为”asr”的应用。 - * | ------------- |----------------------------------------------------------- - * | asr_audio_path|音频文件名: 设置此参数后,将会自动保存识别的录音文件。 - * | | 路径为Documents/(指定值)。 - * | | 不设置或者设置为nil,则不保存音频。 - * | ------------- |----------------------------------------------------------- - * | params |扩展参数: 对于一些特殊的参数可在此设置,一般用于设置语义。 - * | ------------- |----------------------------------------------------------- - * - */ - -/*! - * 设置识别引擎的参数 - * 识别的引擎参数(key)取值如下: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    *参数描述
    domain应用的领域: 取值为:iat、search、video、poi、music、asr;
    iat:普通文本听写;
    search:热词搜索;
    video:视频音乐搜索;
    video:视频音乐搜索;
    asr:关键词识别;
    vad_bos前端点检测: 静音超时时间,即用户多长时间不说话则当做超时处理; 单位:ms;
    engine指定iat识别默认值为5000;
    其他情况默认值为 4000,范围 0-10000。
    vad_eos后断点检测: 后端点静音检测时间,即用户停止说话多长时间内即认为不再输入,
    自动停止录音;单位:ms;
    sms 识别默认值为 1800;
    其他默认值为 700,范围 0-10000。
    sample_rate采样率:目前支持的采样率设置有 16000 和 8000。
    asr_ptt标点符号设置: 默认为 1,当设置为 0 时,将返回无标点符号文本。
    result_type返回结果的数据格式: 可设置为json,xml,plain,默认为json。
    grammarID识别的语法id: 只针对 domain 设置为”asr”的应用。
    asr_audio_path音频文件名: 设置此参数后,将会自动保存识别的录音文件。
    路径为Documents/(指定值)。
    不设置或者设置为nil,则不保存音频。
    params扩展参数: 对于一些特殊的参数可在此设置,一般用于设置语义。
    - * @param value 参数对应的取值 - * @param key 识别引擎参数 - * - * @return 成功返回YES;失败返回NO - */ --(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; - -/*! - * 获取识别引擎参数 - * - * @param key 参数key - * - * @return 参数值 - */ --(NSString*) parameterForKey:(NSString *)key; - -/*! - * 开始识别 - * 同时只能进行一路会话,这次会话没有结束不能进行下一路会话,否则会报错。若有需要多次回话, - * 请在onError回调返回后请求下一路回话。 - * - * @return 成功返回YES;失败返回NO - */ -- (BOOL) startListening; - -/*! - * 停止录音 - * 调用此函数会停止录音,并开始进行语音识别 - */ -- (void) stopListening; - -/*! - * 取消本次会话 - */ -- (void) cancel; - -/*! - * 上传语法 - * - * @param completionHandler 上传语法完成回调 - * @param grammarType 语法类型 - * @param grammarContent 语法内容 - * - * @return 错误码 - */ -- (int) buildGrammarCompletionHandler:(IFlyOnBuildFinishCompletionHandler)completionHandler - grammarType:(NSString *)grammarType - grammarContent:(NSString *)grammarContent; - -/** 是否正在识别 - */ -@property (nonatomic, readonly) BOOL isListening; - -@end - -/*! - * 音频流识别 - * 音频流识别可以将文件分段写入 - */ -@interface IFlySpeechRecognizer(IFlyStreamRecognizer) - -/*! -* 写入音频流 -* 此方法的使用示例如下: -*
    [_iFlySpeechRecognizer setParameter:@"audio_source" value:@"-1"];
    -* [_iFlySpeechRecognizer startListening];
    -* [_iFlySpeechRecognizer writeAudio:audioData1];
    -* [_iFlySpeechRecognizer writeAudio:audioData2];
    -* ...
    -* [_iFlySpeechRecognizer stopListening];
    -* 
    -* -* @param audioData 音频数据 -* -* @return 写入成功返回YES,写入失败返回NO -*/ -- (BOOL) writeAudio:(NSData *) audioData; - -@end - diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechRecognizerDelegate.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechRecognizerDelegate.h deleted file mode 100755 index 0417564b..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechRecognizerDelegate.h +++ /dev/null @@ -1,112 +0,0 @@ -// -// IFlySpeechRecognizerDelegate.h -// MSC -// -// Created by ypzhao on 13-3-27. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import - -@class IFlySpeechError; - -/*! - * 构建语法结束回调 - * - * @param grammarId 语法id - * @param error 错误描述 - */ -typedef void(^IFlyOnBuildFinishCompletionHandler)(NSString* grammarId,IFlySpeechError * error); - - -/*! - * 语音识别协议 - * 在使用语音识别时,需要实现这个协议中的方法. - */ -@protocol IFlySpeechRecognizerDelegate - -@required - -/*! - * 识别结果回调 - * 在进行语音识别过程中的任何时刻都有可能回调此函数,你可以根据errorCode进行相应的处理, - * 当errorCode没有错误时,表示此次会话正常结束;否则,表示此次会话有错误发生。特别的当调用 - * `cancel`函数时,引擎不会自动结束,需要等到回调此函数,才表示此次会话结束。在没有回调此函数 - * 之前如果重新调用了`startListenging`函数则会报错误。 - * - * @param errorCode 错误描述 - */ -- (void) onError:(IFlySpeechError *) errorCode; - -/*! - * 识别结果回调 - * 在识别过程中可能会多次回调此函数,你最好不要在此回调函数中进行界面的更改等操作,只需要将回调的结果保存起来。 - * 使用results的示例如下: - *
    
    - *  - (void) onResults:(NSArray *) results{
    - *     NSMutableString *result = [[NSMutableString alloc] init];
    - *     NSDictionary *dic = [results objectAtIndex:0];
    - *     for (NSString *key in dic){
    - *        [result appendFormat:@"%@",key];//合并结果
    - *     }
    - *   }
    - *  
    - * - * @param results -[out] 识别结果,NSArray的第一个元素为NSDictionary,NSDictionary的key为识别结果,sc为识别结果的置信度。 - * @param isLast -[out] 是否最后一个结果 - */ -- (void) onResults:(NSArray *) results isLast:(BOOL)isLast; - -@optional - -/*! - * 音量变化回调 - * 在录音过程中,回调音频的音量。 - * - * @param volume -[out] 音量,范围从0-100 - */ -- (void) onVolumeChanged: (int)volume; - -/*! - * 开始录音回调 - * 当调用了`startListening`函数之后,如果没有发生错误则会回调此函数。 - * 如果发生错误则回调onError:函数 - */ -- (void) onBeginOfSpeech; - -/*! - * 停止录音回调 - * 当调用了`stopListening`函数或者引擎内部自动检测到断点,如果没有发生错误则回调此函数。 - * 如果发生错误则回调onError:函数 - */ -- (void) onEndOfSpeech; - -/*! - * 取消识别回调 - * 当调用了`cancel`函数之后,会回调此函数,在调用了cancel函数和回调onError之前会有一个 - * 短暂时间,您可以在此函数中实现对这段时间的界面显示。 - */ -- (void) onCancel; - -#ifdef _EDUCATION_ -/** - * 返回音频Key - * - * @param key 音频Key - */ -- (void) getAudioKey:(NSString *)key; - -#endif - -/** - * 扩展事件回调 - * 根据事件类型返回额外的数据 - * - * @param eventType 事件类型,具体参见IFlySpeechEventType的IFlySpeechEventTypeVoiceChangeResult枚举。 - * @param arg0 arg0 - * @param arg1 arg1 - * @param eventData 事件数据 - */ -- (void) onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechSynthesizer.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechSynthesizer.h deleted file mode 100755 index 22770c69..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechSynthesizer.h +++ /dev/null @@ -1,127 +0,0 @@ -// -// IFlySpeechSynthesizer.h -// MSC -// -// Created by ypzhao on 13-3-21. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import -#import "IFlySpeechSynthesizerDelegate.h" - -/*! - * 语音合成 - */ -@interface IFlySpeechSynthesizer : NSObject - -/*! - * 设置识别的委托对象 - */ -@property(nonatomic,assign) id delegate; - -/*! - * 返回合成对象的单例 - * - * @return 合成对象 - */ -+ (id) sharedInstance; - -/*! - * 销毁合成对象。 - * - * @return 成功返回YES,失败返回NO. - */ -+ (BOOL) destroy; - -/* - * | ------------- |----------------------------------------------------------- - * | 参数 | 描述 - * | ------------- |----------------------------------------------------------- - * | speed |合成语速,取值范围 0~100 - * | ------------- |----------------------------------------------------------- - * | volume |合成的音量,取值范围 0~100 - * | ------------- |----------------------------------------------------------- - * | voice_name |默认为”xiaoyan”;可以设置的参数列表可参考个性化发音人列表 - * | ------------- |----------------------------------------------------------- - * | sample_rate |采样率:目前支持的采样率设置有 16000 和 8000。 - * | ------------- |----------------------------------------------------------- - * | tts_audio_path|音频文件名 设置此参数后,将会自动保存合成的音频文件。 - * | |路径为Documents/(指定值)。不设置或者设置为nil,则不保存音频。 - * | ------------- |----------------------------------------------------------- - * | params |扩展参数: 对于一些特殊的参数可在此设置。 - * | ------------- |----------------------------------------------------------- - * - */ - -/*! - * 设置合成参数 - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    参数描述
    speed合成语速,取值范围 0~100
    volume合成的音量,取值范围 0~100
    voice_name默认为”xiaoyan”;可以设置的参数列表可参考个性化发音人列表
    sample_rate采样率:目前支持的采样率设置有 16000 和 8000。
    tts_audio_path音频文件名 设置此参数后,将会自动保存合成的音频文件。
    路径为Documents/(指定值)。不设置或者设置为nil,则不保存音频。
    params扩展参数: 对于一些特殊的参数可在此设置。
    - * - * @param value 参数取值 - * @param key 合成参数 - * - * @return 设置成功返回YES,失败返回NO - */ --(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; - -/*! - * 获取合成参数 - * - * @param key 参数key - * - * @return 参数值 - */ --(NSString*) parameterForKey:(NSString *)key; - -/*! - * 开始合成(播放) - * 调用此函数进行合成,如果发生错误会回调错误`onCompleted` - * - * @param text 合成的文本,最大的字节数为1k - */ -- (void) startSpeaking:(NSString *)text; - -/*! - * 开始合成(不播放) - * 调用此函数进行合成,如果发生错误会回调错误`onCompleted` - * - * @param text 合成的文本,最大的字节数为1k - * @param uri 合成后,保存再本地的音频路径 - */ --(void)synthesize:(NSString *)text toUri:(NSString*)uri; - -/*! - * 暂停播放 - * 暂停播放之后,合成不会暂停,仍会继续,如果发生错误则会回调错误`onCompleted` - */ -- (void) pauseSpeaking; - -/*! - * 恢复播放 - */ -- (void) resumeSpeaking; - -/*! - * 停止播放并停止合成 - */ -- (void) stopSpeaking; - -/*! - * 是否正在播放 - */ -@property (nonatomic, readonly) BOOL isSpeaking; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechSynthesizerDelegate.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechSynthesizerDelegate.h deleted file mode 100755 index 8fee57ad..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechSynthesizerDelegate.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// IFlySpeechSynthesizerDelegate.h -// MSC -// -// Created by ypzhao on 13-3-20. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import -#import "IFlySpeechEvent.h" - -@class IFlySpeechError; - -/** - * 语音合成回调 - */ -@protocol IFlySpeechSynthesizerDelegate - -@required - -/** - * 结束回调 - * 当整个合成结束之后会回调此函数 - * - * @param error 错误码 - */ -- (void) onCompleted:(IFlySpeechError*) error; - -@optional - -/** - * 开始合成回调 - */ -- (void) onSpeakBegin; - -/** - * 缓冲进度回调 - * - * @param progress 缓冲进度,0-100 - * @param msg 附件信息,此版本为nil - */ -- (void) onBufferProgress:(int) progress message:(NSString *)msg; - -/** - * 播放进度回调 - * - * @param progress 播放进度,0-100 - */ -- (void) onSpeakProgress:(int) progress; - -/** - * 暂停播放回调 - */ -- (void) onSpeakPaused; - -/** - * 恢复播放回调 - */ -- (void) onSpeakResumed; - -/** - * 正在取消回调 - * 当调用`cancel`之后会回调此函数 - */ -- (void) onSpeakCancel; - -/** - * 扩展事件回调 - * 根据事件类型返回额外的数据 - * - * @param eventType 事件类型,具体参见IFlySpeechEventType枚举。目前只支持EVENT_TTS_BUFFER也就是实时返回合成音频。 - * @param arg0 arg0 - * @param arg1 arg1 - * @param eventData 事件数据 - */ -- (void) onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechUnderstander.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechUnderstander.h deleted file mode 100755 index 2a55152e..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechUnderstander.h +++ /dev/null @@ -1,134 +0,0 @@ -// -// IFlySpeechUnderstander.h -// MSC -// -// Created by iflytek on 2014-03-12. -// Copyright (c) 2014年 iflytek. All rights reserved. -// - -#import - -@class IFlySpeechError; -@protocol IFlySpeechRecognizerDelegate; - -/*! - * 语义理解接口 - */ -@interface IFlySpeechUnderstander : NSObject - -/*! - * 是否正在语义理解 - */ -@property (readonly) BOOL isUnderstanding; - -/*! - * 设置委托对象 - */ -@property(nonatomic,retain) id delegate ; - -/*! - * 创建语义理解对象的单例 - * - * @return 语义理解对象 - */ -+(IFlySpeechUnderstander*) sharedInstance; - -/*! - * 开始义理解 - * 同时只能进行一路会话,这次会话没有结束不能进行下一路会话,否则会报错。若有需要多次回话,请在onError回调返回后请求下一路回话。 - * - * @return 成功返回YES,失败返回NO - */ -- (BOOL) startListening; - -/*! - * 停止录音 - * 调用此函数会停止录音,并开始进行语义理解 - */ -- (void) stopListening; - -/*! - * 取消本次会话 - */ -- (void) cancel; - -/* - * | ------------- |----------------------------------------------------------- - * | 参数 | 描述 - * | ------------- |----------------------------------------------------------- - * | domain |应用的领域: 取值为:iat、search、video、poi、music、asr; - * | | iat:普通文本听写; - * | | search:热词搜索; - * | | video:视频音乐搜索; - * | | asr:关键词识别; - * | ------------- |----------------------------------------------------------- - * | vad_bos |前端点检测: 静音超时时间,即用户多长时间不说话则当做超时处理; 单位:ms; - * | | engine指定iat识别默认值为5000; - * | | 其他情况默认值为 4000,范围 0-10000。 - * | ------------- |----------------------------------------------------------- - * | vad_eos |后断点检测: 后端点静音检测时间,即用户停止说话多长时间内即认为不再输入, - * | | 自动停止录音;单位:ms; - * | | sms 识别默认值为 1800; - * | | 其他默认值为 700,范围 0-10000。 - * | ------------- |----------------------------------------------------------- - * | sample_rate |采样率:目前支持的采样率设置有 16000 和 8000。 - * | ------------- |----------------------------------------------------------- - * | asr_ptt |标点符号设置: 默认为 1,当设置为 0 时,将返回无标点符号文本。 - * | ------------- |----------------------------------------------------------- - * | result_type |返回结果的数据格式: 可设置为json,xml,plain,默认为json。 - * | ------------- |----------------------------------------------------------- - * | grammarID |识别的语法id: 只针对 domain 设置为”asr”的应用。 - * | ------------- |----------------------------------------------------------- - * | asr_audio_path|音频文件名: 设置此参数后,将会自动保存识别的录音文件。 - * | | 路径为Documents/(指定值)。 - * | | 不设置或者设置为nil,则不保存音频。 - * | ------------- |----------------------------------------------------------- - * | params |扩展参数: 对于一些特殊的参数可在此设置,一般用于设置语义。 - * | ------------- |----------------------------------------------------------- - * - */ - -/*! - * 设置语义理解引擎的参数 - * 语义理解的引擎参数(key)取值如下: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    *参数描述
    domain应用的领域: 取值为:iat、search、video、poi、music、asr;
    iat:普通文本听写;
    search:热词搜索;
    video:视频音乐搜索;
    video:视频音乐搜索;
    asr:关键词识别;
    vad_bos前端点检测: 静音超时时间,即用户多长时间不说话则当做超时处理; 单位:ms;
    engine指定iat识别默认值为5000;
    其他情况默认值为 4000,范围 0-10000。
    vad_eos后断点检测: 后端点静音检测时间,即用户停止说话多长时间内即认为不再输入,
    自动停止录音;单位:ms;
    sms 识别默认值为 1800;
    其他默认值为 700,范围 0-10000。
    sample_rate采样率:目前支持的采样率设置有 16000 和 8000。
    asr_ptt标点符号设置: 默认为 1,当设置为 0 时,将返回无标点符号文本。
    result_type返回结果的数据格式: 可设置为json,xml,plain,默认为json。
    grammarID识别的语法id: 只针对 domain 设置为”asr”的应用。
    asr_audio_path音频文件名: 设置此参数后,将会自动保存识别的录音文件。
    路径为Documents/(指定值)。
    不设置或者设置为nil,则不保存音频。
    params扩展参数: 对于一些特殊的参数可在此设置,一般用于设置语义。
    - * @param value 参数对应的取值 - * @param key 语义理解引擎参数 - * - * @return 成功返回YES;失败返回NO - */ --(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; - -/*! - * 写入音频流 - * - * @param audioData 音频数据 - * - * @return 写入成功返回YES,写入失败返回NO - */ -- (BOOL) writeAudio:(NSData *) audioData; - -/*! - * 销毁语义理解对象。 - * - * @return 成功返回YES;失败返回NO - */ -- (BOOL) destroy; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechUtility.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechUtility.h deleted file mode 100755 index 3d7fd749..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlySpeechUtility.h +++ /dev/null @@ -1,183 +0,0 @@ -// -// IFlySpeechUtility.h -// MSCDemo -// -// Created by admin on 14-5-7. -// Copyright (c) 2014年 iflytek. All rights reserved. -// - -#import - -#define iOS_EXCLUSIVE //iOS平台独占API - -@class IFlySpeechError; - -/** - * 引擎模式 - */ -typedef NS_ENUM(NSUInteger,IFlyEngineMode){ - /** - * 云端使用MSC,本地优先使用语音+ - */ - IFlyEngineModeAuto = 0, - /** - * 只使用MSC - */ - IFlyEngineModeMsc, - /** - * 本地只使用语音+(受平台限制,云端无法使用语音+) - */ - IFlyEngineModePlus, -}; - - -/** - * 服务类型 - */ -typedef NS_ENUM(NSUInteger,IFlySpeechPlusServiceType){ - /** - * 打开语音+主界面 - */ - IFlySpeechPlusServiceTypeNone, - /** - * 获取合成资源 - */ - IFlySpeechPlusServiceTypeTTS, - /** - * 获取识别资源(未开放) - */ - IFlySpeechPlusServiceTypeISR, - /** - * 获取唤醒资源(未开放) - */ - IFlySpeechPlusServiceTypeIVW, -} ; - -/** 语记返回回调 - */ -@protocol IFlySpeechplusDelegate - -/** - * 发生错误 - * - * @param errorCode 错误码 - */ -- (void)onError:(int)errorCode; - -/** - * 服务正常结束 - */ -- (void)onCompleted; - -@end - -/** - * 用户配置 - */ -@interface IFlySpeechUtility : NSObject - -/*! - * 创建用户语音配置 - * 注册应用请前往语音云开发者网站。
    - * 网站:http://www.xfyun.cn - * - * @param params 启动参数,必须保证appid参数传入,示例:appid=123456 - * - * @return 语音配置对象 - */ -+ (IFlySpeechUtility*) createUtility:(NSString *) params; - -/*! - * 销毁用户配置对象 - * - * @return 成功返回YES,失败返回NO - */ -+(BOOL) destroy; - -/*! - * 获取用户配置对象 - * - * @return 用户配置对象 - */ -+(IFlySpeechUtility *) getUtility; - -/*! - * 设置MSC引擎的状态参数 - * - * @param value 参数值 - * @param key 参数名称 - * - * @return 成功返回YES,失败返回NO - */ --(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; - -/** - * 获取MSC引擎状态参数 - * - * @param key 参数名 - * - * @return 参数值 - */ -- (NSString *)parameterForKey:(NSString *)key; - -/** - * 引擎类型 - */ -@property (nonatomic, readonly) IFlyEngineMode engineMode; - -/** - * 语记协议委托 - */ -@property (nonatomic, assign) id delegate; - -@end - -/** - * 讯飞语音+类别 - */ -@interface IFlySpeechUtility (SpeechPlus) - -/** - * 检查讯飞语音+是否安装 - * - * @return 已安装返回YES,否则返回NO - */ -- (BOOL)checkServiceInstalled; - -/** - * 获取讯飞语音+下载地址进行下载,安装完成后即可使用服务。 - * 下载地址需要通过[[UIApplication sharedApplication] openUrl:]打开 - * - * @return 讯飞语音+在App Store下载地址 - */ -- (NSString *)componentUrl; - - -/** - * 处理语音+使用URL启动第三方应用程序时传递的数据 - * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 - * - * @param url 语音+启动第三方应用程序时传递过来的URL - * - * @return 成功返回YES,失败返回NO。 - */ -- (BOOL)handleOpenURL:(NSURL *)url iOS_EXCLUSIVE; - -/** - * 打开讯飞语音+获取相应类型服务,0表示打开主界面 - * - * @param serviceType 服务类型 - * - * @return 成功打开返回YES,否则返回NO - */ -- (BOOL)openSpeechPlus:(IFlySpeechPlusServiceType)serviceType iOS_EXCLUSIVE; - -@end - - - - - - - - diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyTextUnderstander.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyTextUnderstander.h deleted file mode 100755 index 5e78ea59..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyTextUnderstander.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// TextUnderstand.h -// MSCDemo -// -// Created by iflytek on 4/24/14. -// Copyright (c) 2014 iflytek. All rights reserved. -// - -#import - -@class IFlySpeechError; - -/*! - * 文本转语义完成回调函数 - * - * @param result 成功,返回文本语义理解结果 - * @param error 错误描述 - */ -typedef void(^IFlyUnderstandTextCompletionHandler)(NSString* result, IFlySpeechError * error); - -/*! - * 文本转语义类 - */ -@interface IFlyTextUnderstander : NSObject - -/*! - * 是否正在文本转语义 - */ -@property (readonly, atomic) __block BOOL isUnderstanding; - -/*! - * 文本转语义接口 - * 输入文本内容,获取语义理解结果 - * - * @param text 输入的文本内容 - * @param completionHandler 文本转语义完成回调函数 - * - * @return 错误码 - */ --(int) understandText:(NSString*)text withCompletionHandler:(IFlyUnderstandTextCompletionHandler) completionHandler; - -/*! - * 设置文本转语义参数 - * - * @param value 参数对应的取值 - * @param key 文本转语义参数参数 - * - * @return 成功返回YES,失败返回NO - */ --(BOOL) setParameter:(NSString *) value forKey:(NSString*)key; - -/*! - * 取消本次会话 - */ --(void)cancel; - -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyUserWords.h b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyUserWords.h deleted file mode 100755 index 7c56a3bb..00000000 --- a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/Headers/IFlyUserWords.h +++ /dev/null @@ -1,73 +0,0 @@ -// -// IFlyUserWords.h -// MSC -// -// Created by ypzhao on 13-2-26. -// Copyright (c) 2013年 iflytek. All rights reserved. -// - -#import - -/*! - * 用户词表类 - * 获取用户词表是为了更好的语音识别(iat),用户词表也属于个性化的一部分. - */ -@interface IFlyUserWords : NSObject - -/*! - * 初始化对象 - * 在进行初始化时,需要传入的格式如下: - *
    {\"userword\":[{\"name\":\"iflytek\",\"words\":[\"科大讯飞\",
    - *  \"云平台\",\"用户词条\",\"开始上传词条\"]}]}
    - * - * @param json 初始化时传入的数据 - * - * @return IFlyUserWords对象 - */ -- (id) initWithJson:(NSString *)json; - -/*! - * 将数据转化为上传的数据格式 - * - * @return 没有数据或者格式不对时返回nil - */ -- (NSString *) toString; - -/*! - * 返回key对应的数据 - * - * @param key 在putword:value中设置的key - * - * @return key对应的数组 - */ -- (NSArray *) getWords: (NSString *) key; - -/*! - * 添加一条用户词数据 - * - * @param key 用户词对应的key - * @param value 上传的用户词数据 - * - * @return 成功返回YES,失败返回NO - */ -- (BOOL) putWord: (NSString *) key value:(NSString *)value; - -/*! - * 添加一组数据 - * - * @param key 用户词对应的key - * @param words 上传的用户词数据 - * - * @return 成功返回YES,失败返回NO - */ -- (BOOL) putwords: (NSString *) key words:(NSArray *)words; - -/*! - * 是否包含key对应的用户词数据 - * - * @param key 用户词对应的key - * - * @return 成功返回YES,失败返回NO - */ -- (BOOL) containsKey: (NSString *) key; -@end diff --git a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/iflyMSC b/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/iflyMSC deleted file mode 100755 index 15c8b5ff..00000000 Binary files a/iOSProject/Pods/iflyMSC/RX3_iflyMSC/iflyMSC.framework/iflyMSC and /dev/null differ diff --git a/iOSProject/deletePodsTrack.sh b/iOSProject/deletePodsTrack.sh new file mode 100755 index 00000000..030c4b1b --- /dev/null +++ b/iOSProject/deletePodsTrack.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +git rm --cached Pods/Headers/\* --ignore-unmatch +git rm --cached Pods/Target\ Support\ Files/\* --ignore-unmatch +git rm --cached Pods/Local\ Podspecs/\* --ignore-unmatch +git rm --cached Pods/Pods.xcodeproj/\* --ignore-unmatch +git rm --cached Pods/\* --ignore-unmatch +git commit -m "delete pods files" diff --git a/iOSProject/iOSProject.xcodeproj/project.pbxproj b/iOSProject/iOSProject.xcodeproj/project.pbxproj index 9dd1f84f..a83f82a6 100644 --- a/iOSProject/iOSProject.xcodeproj/project.pbxproj +++ b/iOSProject/iOSProject.xcodeproj/project.pbxproj @@ -13,7 +13,6 @@ 581A3E4020450B3E00AF08C0 /* MJDownloadConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 581A3E3A20450B3D00AF08C0 /* MJDownloadConst.m */; }; 581A3E4120450B3E00AF08C0 /* NSString+MJDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = 581A3E3D20450B3D00AF08C0 /* NSString+MJDownload.m */; }; 58223312201821910008251F /* UIView+GestureCallback.m in Sources */ = {isa = PBXBuildFile; fileRef = 5822330A201821910008251F /* UIView+GestureCallback.m */; }; - 58223313201821910008251F /* UIViewController+DDPopUpViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5822330C201821910008251F /* UIViewController+DDPopUpViewController.m */; }; 58223314201821910008251F /* UITextView+WZB.m in Sources */ = {isa = PBXBuildFile; fileRef = 5822330D201821910008251F /* UITextView+WZB.m */; }; 58223315201821910008251F /* NSDecimalNumber+Addtion.m in Sources */ = {isa = PBXBuildFile; fileRef = 58223311201821910008251F /* NSDecimalNumber+Addtion.m */; }; 58223317201821C00008251F /* NullSafe.m in Sources */ = {isa = PBXBuildFile; fileRef = 58223316201821C00008251F /* NullSafe.m */; }; @@ -25,8 +24,9 @@ 5822335120187F270008251F /* LMJVFLLayoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5822335020187F270008251F /* LMJVFLLayoutViewController.m */; }; 5822335420188F5D0008251F /* MCLocalHTMLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5822335320188F5D0008251F /* MCLocalHTMLViewController.m */; }; 5822335620188F6E0008251F /* adm in Resources */ = {isa = PBXBuildFile; fileRef = 5822335520188F6E0008251F /* adm */; }; - 584038001FF61D00002A0566 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 584037FF1FF61D00002A0566 /* MapKit.framework */; }; - 584038021FF61D1A002A0566 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 584038011FF61D1A002A0566 /* AudioToolbox.framework */; }; + 583D507020731574001480C8 /* LMJLocalJsons in Resources */ = {isa = PBXBuildFile; fileRef = 583D506F20731574001480C8 /* LMJLocalJsons */; }; + 583D508420765948001480C8 /* TDTouchID.m in Sources */ = {isa = PBXBuildFile; fileRef = 583D508320765948001480C8 /* TDTouchID.m */; }; + 583D508720765978001480C8 /* YYFPSLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 583D508520765978001480C8 /* YYFPSLabel.m */; }; 584038061FF62371002A0566 /* LMJAddressPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 584038051FF62371002A0566 /* LMJAddressPickerViewController.m */; }; 584038091FF629AC002A0566 /* LMJNoNavBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 584038071FF629AB002A0566 /* LMJNoNavBarViewController.m */; }; 5840380C1FF62ECF002A0566 /* LMJAdaptFontViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5840380B1FF62ECF002A0566 /* LMJAdaptFontViewController.m */; }; @@ -63,6 +63,20 @@ 584038801FF9F128002A0566 /* LMJH5_OCViewController.html in Resources */ = {isa = PBXBuildFile; fileRef = 5840387E1FF9F128002A0566 /* LMJH5_OCViewController.html */; }; 584038831FF9F2F1002A0566 /* LMJAlertViewsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 584038811FF9F2F0002A0566 /* LMJAlertViewsViewController.m */; }; 584038861FF9F602002A0566 /* LMJFillTableFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 584038841FF9F602002A0566 /* LMJFillTableFormViewController.m */; }; + 585A22E7207DAB77001BD3AD /* SINPickPhotoTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 585A22E6207DAB77001BD3AD /* SINPickPhotoTool.m */; }; + 585A22F52081FD1F001BD3AD /* QQResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 585A22F42081FD1E001BD3AD /* QQResources.bundle */; }; + 585A22FE2082FA28001BD3AD /* JSBridge_js in Resources */ = {isa = PBXBuildFile; fileRef = 585A22FD2082FA28001BD3AD /* JSBridge_js */; }; + 585FC1D3208DAADF003174A7 /* VIDCachesTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1D2208DAADF003174A7 /* VIDCachesTool.m */; }; + 585FC1D6208DACC1003174A7 /* VIDTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1D5208DACC1003174A7 /* VIDTableViewController.m */; }; + 585FC1D9208DB9CD003174A7 /* VIDCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1D8208DB9CD003174A7 /* VIDCollectionViewController.m */; }; + 585FC1DC208DBD95003174A7 /* VIDDownLoadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1DB208DBD95003174A7 /* VIDDownLoadViewController.m */; }; + 585FC1DF208DC1CF003174A7 /* VIDDownLoadedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1DE208DC1CF003174A7 /* VIDDownLoadedCell.m */; }; + 585FC1E2208DC6B2003174A7 /* VIDDownLoadingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1E1208DC6B2003174A7 /* VIDDownLoadingCell.m */; }; + 585FC1E5209B0481003174A7 /* MCTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1E4209B0481003174A7 /* MCTestViewController.m */; }; + 585FC1E8209B2DF5003174A7 /* MCTestDataModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1E6209B2DF5003174A7 /* MCTestDataModel.xcdatamodeld */; }; + 585FC1F6209B2FE4003174A7 /* MCStudent+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1F2209B2FE3003174A7 /* MCStudent+CoreDataProperties.m */; }; + 585FC1F7209B2FE4003174A7 /* MCStudent+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1F5209B2FE4003174A7 /* MCStudent+CoreDataClass.m */; }; + 585FC1FA209B312E003174A7 /* MCCoreDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 585FC1F9209B312E003174A7 /* MCCoreDataManager.m */; }; 58651A9E1FFE6D6F0087419D /* SINStatusListDAL.m in Sources */ = {isa = PBXBuildFile; fileRef = 58651A5C1FFE6D6E0087419D /* SINStatusListDAL.m */; }; 58651A9F1FFE6D6F0087419D /* SINUserManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58651A5D1FFE6D6E0087419D /* SINUserManager.m */; }; 58651AA01FFE6D6F0087419D /* SINSQLiteManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58651A5F1FFE6D6E0087419D /* SINSQLiteManager.m */; }; @@ -91,18 +105,23 @@ 58651ABA1FFE6D6F0087419D /* SINStatusRetweetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 58651A971FFE6D6F0087419D /* SINStatusRetweetView.m */; }; 58651ABB1FFE6D6F0087419D /* SINPostStatusService.m in Sources */ = {isa = PBXBuildFile; fileRef = 58651A991FFE6D6F0087419D /* SINPostStatusService.m */; }; 58651ABD1FFE6D6F0087419D /* SINStatusListService.m in Sources */ = {isa = PBXBuildFile; fileRef = 58651A9C1FFE6D6F0087419D /* SINStatusListService.m */; }; + 588CCD76205D42EE0067E3C4 /* LMJH5JSBridgeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 588CCD75205D42EE0067E3C4 /* LMJH5JSBridgeViewController.m */; }; + 588CCD7A205D45DC0067E3C4 /* WKWebViewJsBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 588CCD79205D45DC0067E3C4 /* WKWebViewJsBridge.m */; }; + 588CCD7F205D4FA60067E3C4 /* WKBridgeTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 588CCD7E205D4FA60067E3C4 /* WKBridgeTool.m */; }; + 588CCD82205DF7860067E3C4 /* LMJCuteFlowLayoutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 588CCD81205DF7860067E3C4 /* LMJCuteFlowLayoutViewController.m */; }; + 588CCD89205DF92F0067E3C4 /* LMJLineFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 588CCD85205DF92E0067E3C4 /* LMJLineFlowLayout.m */; }; + 588CCD8A205DF92F0067E3C4 /* LMJGirdLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 588CCD86205DF92E0067E3C4 /* LMJGirdLayout.m */; }; + 588CCD8B205DF92F0067E3C4 /* LMJCircleLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 588CCD87205DF92F0067E3C4 /* LMJCircleLayout.m */; }; 58926426201B622B007DA41E /* BSJSQLiteManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58926425201B622B007DA41E /* BSJSQLiteManager.m */; }; 58926429201B64D3007DA41E /* BSJTopicListDAL.m in Sources */ = {isa = PBXBuildFile; fileRef = 58926428201B64D3007DA41E /* BSJTopicListDAL.m */; }; 58926467202C54C2007DA41E /* LMJRunLoopViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58926466202C54C2007DA41E /* LMJRunLoopViewController.m */; }; - 5892646B202D6662007DA41E /* XLMJThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892646A202D6662007DA41E /* XLMJThread.m */; }; - 58926476202DA70E007DA41E /* CalendarReminderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58926474202DA70D007DA41E /* CalendarReminderManager.m */; }; + 58926476202DA70E007DA41E /* LMJEventTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 58926474202DA70D007DA41E /* LMJEventTool.m */; }; 5892ACA11FF4EB4A00E868C2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5892ACA01FF4EB4A00E868C2 /* Assets.xcassets */; }; 5892ACA71FF4EB4A00E868C2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892ACA61FF4EB4A00E868C2 /* main.m */; }; 5892ACB21FF4EEB400E868C2 /* LMJAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892ACB11FF4EEB300E868C2 /* LMJAppDelegate.m */; }; 5892ACB91FF4EF4500E868C2 /* Preview.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5892ACB31FF4EF4400E868C2 /* Preview.xcassets */; }; 5892ACBA1FF4EF4500E868C2 /* QQMusic.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5892ACB41FF4EF4400E868C2 /* QQMusic.xcassets */; }; 5892ACBB1FF4EF4500E868C2 /* Sina.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5892ACB51FF4EF4400E868C2 /* Sina.xcassets */; }; - 5892ACBC1FF4EF4500E868C2 /* WXIM.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5892ACB61FF4EF4500E868C2 /* WXIM.xcassets */; }; 5892ACBD1FF4EF4500E868C2 /* BSJ.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5892ACB71FF4EF4500E868C2 /* BSJ.xcassets */; }; 5892ACBE1FF4EF4500E868C2 /* Public.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5892ACB81FF4EF4500E868C2 /* Public.xcassets */; }; 5892ACC21FF4F45700E868C2 /* libUMessage_Sdk_1.5.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5892ACC01FF4F45700E868C2 /* libUMessage_Sdk_1.5.0.a */; }; @@ -136,57 +155,16 @@ 5892AD7B1FF5133800E868C2 /* MBProgressHUD+LMJ.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892AD7A1FF5133800E868C2 /* MBProgressHUD+LMJ.m */; }; 5892AD811FF5175A00E868C2 /* UIColor+Random.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892AD801FF5175A00E868C2 /* UIColor+Random.m */; }; 5892AD841FF517B200E868C2 /* UIButton+LMJ.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892AD831FF517B200E868C2 /* UIButton+LMJ.m */; }; - 5892AD891FF5D46800E868C2 /* GVUserDefaults+LMJ.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892AD881FF5D46800E868C2 /* GVUserDefaults+LMJ.m */; }; 5892AD8D1FF5E2D700E868C2 /* LMJIntroductoryPagesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892AD8C1FF5E2D700E868C2 /* LMJIntroductoryPagesView.m */; }; 5892AD901FF5E32500E868C2 /* LMJIntroductoryPagesHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892AD8F1FF5E32500E868C2 /* LMJIntroductoryPagesHelper.m */; }; 5892AD9F1FF5F23D00E868C2 /* AdvertiseView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892AD9D1FF5F23D00E868C2 /* AdvertiseView.m */; }; 5892ADA01FF5F23D00E868C2 /* AdvertiseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892AD9E1FF5F23D00E868C2 /* AdvertiseHelper.m */; }; - 5892ADA71FF600F700E868C2 /* YYFPSLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892ADA61FF600F700E868C2 /* YYFPSLabel.m */; }; 5892ADAA1FF603AD00E868C2 /* LMJUMengHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892ADA91FF603AD00E868C2 /* LMJUMengHelper.m */; }; 5892ADAF1FF60A8300E868C2 /* JXTAlertController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5892ADAE1FF60A8300E868C2 /* JXTAlertController.m */; }; - 589B56CC1FFFC52F00B2D5A8 /* 月半小夜曲.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B56731FFFC52F00B2D5A8 /* 月半小夜曲.lrc */; }; - 589B56CD1FFFC52F00B2D5A8 /* 255319.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B56741FFFC52F00B2D5A8 /* 255319.lrc */; }; - 589B56CE1FFFC52F00B2D5A8 /* 14945107.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B56751FFFC52F00B2D5A8 /* 14945107.lrc */; }; - 589B56CF1FFFC52F00B2D5A8 /* 10736444.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B56761FFFC52F00B2D5A8 /* 10736444.lrc */; }; - 589B56D01FFFC52F00B2D5A8 /* 309769.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B56771FFFC52F00B2D5A8 /* 309769.lrc */; }; - 589B56D11FFFC52F00B2D5A8 /* 235319.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B56781FFFC52F00B2D5A8 /* 235319.lrc */; }; - 589B56D21FFFC52F00B2D5A8 /* 12309111.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B56791FFFC52F00B2D5A8 /* 12309111.lrc */; }; - 589B56D31FFFC52F00B2D5A8 /* 339744.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B567A1FFFC52F00B2D5A8 /* 339744.lrc */; }; - 589B56D41FFFC52F00B2D5A8 /* 10405520.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B567B1FFFC52F00B2D5A8 /* 10405520.lrc */; }; - 589B56D51FFFC52F00B2D5A8 /* 120125029.lrc in Resources */ = {isa = PBXBuildFile; fileRef = 589B567C1FFFC52F00B2D5A8 /* 120125029.lrc */; }; - 589B56D61FFFC52F00B2D5A8 /* wf@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B567E1FFFC52F00B2D5A8 /* wf@2x.jpg */; }; - 589B56D71FFFC52F00B2D5A8 /* jay@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B567F1FFFC52F00B2D5A8 /* jay@2x.jpg */; }; - 589B56D81FFFC52F00B2D5A8 /* lkq_icon@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56801FFFC52F00B2D5A8 /* lkq_icon@2x.jpg */; }; - 589B56D91FFFC52F00B2D5A8 /* jay_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 589B56811FFFC52F00B2D5A8 /* jay_icon@2x.png */; }; - 589B56DA1FFFC52F00B2D5A8 /* dzq_icon@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56821FFFC52F00B2D5A8 /* dzq_icon@2x.jpg */; }; - 589B56DB1FFFC52F00B2D5A8 /* zxy@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56831FFFC52F00B2D5A8 /* zxy@2x.jpg */; }; - 589B56DC1FFFC52F00B2D5A8 /* kzxd_icon@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56841FFFC52F00B2D5A8 /* kzxd_icon@2x.jpg */; }; - 589B56DD1FFFC52F00B2D5A8 /* dzq@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56851FFFC52F00B2D5A8 /* dzq@2x.jpg */; }; - 589B56DE1FFFC52F00B2D5A8 /* jj@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56861FFFC52F00B2D5A8 /* jj@2x.jpg */; }; - 589B56DF1FFFC52F00B2D5A8 /* lkq@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56871FFFC52F00B2D5A8 /* lkq@2x.jpg */; }; - 589B56E01FFFC52F00B2D5A8 /* wf_icon@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56881FFFC52F00B2D5A8 /* wf_icon@2x.jpg */; }; - 589B56E11FFFC52F00B2D5A8 /* eason_icon@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56891FFFC52F00B2D5A8 /* eason_icon@2x.jpg */; }; - 589B56E21FFFC52F00B2D5A8 /* kzxd@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B568A1FFFC52F00B2D5A8 /* kzxd@2x.jpg */; }; - 589B56E31FFFC52F00B2D5A8 /* bb@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B568B1FFFC52F00B2D5A8 /* bb@2x.jpg */; }; - 589B56E41FFFC52F00B2D5A8 /* eason@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B568C1FFFC52F00B2D5A8 /* eason@2x.jpg */; }; - 589B56E51FFFC52F00B2D5A8 /* jj_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 589B568D1FFFC52F00B2D5A8 /* jj_icon@2x.png */; }; - 589B56E61FFFC52F00B2D5A8 /* nanquan@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B568E1FFFC52F00B2D5A8 /* nanquan@2x.jpg */; }; - 589B56E71FFFC52F00B2D5A8 /* bb_icon@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B568F1FFFC52F00B2D5A8 /* bb_icon@2x.jpg */; }; - 589B56E81FFFC52F00B2D5A8 /* zxy_icon@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56901FFFC52F00B2D5A8 /* zxy_icon@2x.jpg */; }; - 589B56E91FFFC52F00B2D5A8 /* nanquan_icon@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 589B56911FFFC52F00B2D5A8 /* nanquan_icon@2x.jpg */; }; - 589B56EA1FFFC52F00B2D5A8 /* 14945107.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B56931FFFC52F00B2D5A8 /* 14945107.mp3 */; }; - 589B56EB1FFFC52F00B2D5A8 /* 255319.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B56941FFFC52F00B2D5A8 /* 255319.mp3 */; }; - 589B56EC1FFFC52F00B2D5A8 /* 235319.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B56951FFFC52F00B2D5A8 /* 235319.mp3 */; }; - 589B56ED1FFFC52F00B2D5A8 /* 309769.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B56961FFFC52F00B2D5A8 /* 309769.mp3 */; }; - 589B56EE1FFFC52F00B2D5A8 /* 10736444.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B56971FFFC52F00B2D5A8 /* 10736444.mp3 */; }; - 589B56EF1FFFC52F00B2D5A8 /* 1201111234.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B56981FFFC52F00B2D5A8 /* 1201111234.mp3 */; }; - 589B56F01FFFC52F00B2D5A8 /* 10405520.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B56991FFFC52F00B2D5A8 /* 10405520.mp3 */; }; - 589B56F11FFFC52F00B2D5A8 /* 120125029.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B569A1FFFC52F00B2D5A8 /* 120125029.mp3 */; }; - 589B56F21FFFC52F00B2D5A8 /* 12309111.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B569B1FFFC52F00B2D5A8 /* 12309111.mp3 */; }; - 589B56F31FFFC52F00B2D5A8 /* 339744.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 589B569C1FFFC52F00B2D5A8 /* 339744.mp3 */; }; - 589B56F41FFFC52F00B2D5A8 /* Musics.plist in Resources */ = {isa = PBXBuildFile; fileRef = 589B569D1FFFC52F00B2D5A8 /* Musics.plist */; }; + 5898889F206B34BF00BDAACD /* DES3Encryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 58988894206B34BE00BDAACD /* DES3Encryptor.m */; }; + 589888A0206B34BF00BDAACD /* EncryptorTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 58988895206B34BE00BDAACD /* EncryptorTool.m */; }; + 589888A3206B34BF00BDAACD /* RSAEncryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 5898889C206B34BE00BDAACD /* RSAEncryptor.m */; }; 589B56F61FFFC52F00B2D5A8 /* CALayer+MUSAmi.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B56A21FFFC52F00B2D5A8 /* CALayer+MUSAmi.m */; }; - 589B56F71FFFC52F00B2D5A8 /* MUSAnimationTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B56A31FFFC52F00B2D5A8 /* MUSAnimationTool.m */; }; 589B56F81FFFC52F00B2D5A8 /* MUSHomeListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B56A61FFFC52F00B2D5A8 /* MUSHomeListViewController.m */; }; 589B56F91FFFC52F00B2D5A8 /* MUSLrcTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B56A71FFFC52F00B2D5A8 /* MUSLrcTableViewController.m */; }; 589B56FA1FFFC52F00B2D5A8 /* MUSPlayingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 589B56A81FFFC52F00B2D5A8 /* MUSPlayingViewController.xib */; }; @@ -204,31 +182,24 @@ 589B57091FFFC53000B2D5A8 /* QQImageTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B56C81FFFC52F00B2D5A8 /* QQImageTool.m */; }; 589B570A1FFFC53000B2D5A8 /* QQMusicOperationTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B56C91FFFC52F00B2D5A8 /* QQMusicOperationTool.m */; }; 589B570B1FFFC53000B2D5A8 /* QQMusicTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B56CB1FFFC52F00B2D5A8 /* QQMusicTool.m */; }; - 589B57742000339800B2D5A8 /* VIDTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B573E2000339700B2D5A8 /* VIDTabBarController.m */; }; - 589B57752000339800B2D5A8 /* VIDNetListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B573F2000339700B2D5A8 /* VIDNetListViewController.m */; }; - 589B57762000339800B2D5A8 /* VIDTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B57402000339700B2D5A8 /* VIDTableViewController.m */; }; - 589B57772000339800B2D5A8 /* VIDCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B57412000339700B2D5A8 /* VIDCollectionViewController.m */; }; - 589B57782000339800B2D5A8 /* VIDLocalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B57462000339700B2D5A8 /* VIDLocalViewController.m */; }; - 589B57792000339800B2D5A8 /* videoData.json in Resources */ = {isa = PBXBuildFile; fileRef = 589B574A2000339700B2D5A8 /* videoData.json */; }; - 589B577A2000339800B2D5A8 /* ZFVideoResolution.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B574B2000339700B2D5A8 /* ZFVideoResolution.m */; }; - 589B577C2000339800B2D5A8 /* ZFVideoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B574E2000339700B2D5A8 /* ZFVideoModel.m */; }; - 589B577D2000339800B2D5A8 /* VIDTableViewVideoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B57502000339700B2D5A8 /* VIDTableViewVideoCell.m */; }; - 589B577E2000339800B2D5A8 /* VIDVideoDownloadedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B57512000339800B2D5A8 /* VIDVideoDownloadedCell.m */; }; - 589B57802000339800B2D5A8 /* VIDTableViewVideoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 589B57552000339800B2D5A8 /* VIDTableViewVideoCell.xib */; }; - 589B57812000339800B2D5A8 /* VIDVideoDownloadingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 589B57572000339800B2D5A8 /* VIDVideoDownloadingCell.xib */; }; - 589B57822000339800B2D5A8 /* VIDVideoDownloadedCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 589B57582000339800B2D5A8 /* VIDVideoDownloadedCell.xib */; }; - 589B57832000339800B2D5A8 /* VIDCollectionViewVideoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B57592000339800B2D5A8 /* VIDCollectionViewVideoCell.m */; }; - 589B57842000339800B2D5A8 /* VIDCollectionViewVideoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 589B575A2000339800B2D5A8 /* VIDCollectionViewVideoCell.xib */; }; - 589B57852000339800B2D5A8 /* VIDVideoDownloadingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 589B575B2000339800B2D5A8 /* VIDVideoDownloadingCell.m */; }; + 58A043D9206B28A1003CB4E5 /* LMJRSAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58A043D8206B28A1003CB4E5 /* LMJRSAViewController.m */; }; + 58A043DB206B2E1E003CB4E5 /* RSA证书 in Resources */ = {isa = PBXBuildFile; fileRef = 58A043DA206B2E1D003CB4E5 /* RSA证书 */; }; 58A17C4E2005F4E600B350AB /* LMJParagraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 58A17C4D2005F4E600B350AB /* LMJParagraph.m */; }; 58A17C532007112A00B350AB /* intro_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 58A17C4F2007112300B350AB /* intro_2.jpg */; }; 58A17C542007112A00B350AB /* intro_3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 58A17C502007112500B350AB /* intro_3.jpg */; }; 58A17C552007112A00B350AB /* intro_0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 58A17C512007112700B350AB /* intro_0.jpg */; }; 58A17C562007112A00B350AB /* intro_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 58A17C522007112A00B350AB /* intro_1.jpg */; }; 58A17C592007335400B350AB /* LMJConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 58A17C582007335400B350AB /* LMJConst.m */; }; + 58A8584A2078760A0063DE98 /* LMJWebImagesCacheViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58A858492078760A0063DE98 /* LMJWebImagesCacheViewController.m */; }; + 58A8584E207878430063DE98 /* LMJWebImageCacheCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 58A8584C207878430063DE98 /* LMJWebImageCacheCell.m */; }; + 58A8584F207878430063DE98 /* LMJWebImageCacheCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 58A8584D207878430063DE98 /* LMJWebImageCacheCell.xib */; }; + 58A858522078842B0063DE98 /* LMJStudent.m in Sources */ = {isa = PBXBuildFile; fileRef = 58A858512078842B0063DE98 /* LMJStudent.m */; }; + 58A858A6207C934E0063DE98 /* PresentAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = 58A858A5207C934E0063DE98 /* PresentAnimator.m */; }; 58AE5CF520103BA3003BD369 /* VIDMoviePlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58AE5CF420103BA3003BD369 /* VIDMoviePlayerViewController.m */; }; + 58B36C6220ABF3C700915868 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 58B36C6120ABF3C700915868 /* AudioToolbox.framework */; }; 58B59D0A2015B17800C4C4C9 /* LMJCasesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B59D092015B17800C4C4C9 /* LMJCasesViewController.m */; }; - 58DC816C1FFA0A480060DC03 /* LMJTableSDWebImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC816B1FFA0A480060DC03 /* LMJTableSDWebImageViewController.m */; }; + 58C51F8B208C221500EECAAA /* VideoDemo.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 58C51F8A208C221500EECAAA /* VideoDemo.storyboard */; }; + 58C51F8E208C2EF100EECAAA /* VIDListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58C51F8D208C2EF100EECAAA /* VIDListViewController.m */; }; 58DC81721FFA29E00060DC03 /* LMJDragTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC81711FFA29E00060DC03 /* LMJDragTableViewController.m */; }; 58DC81781FFA2CF90060DC03 /* LMJCalendarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC81761FFA2CF80060DC03 /* LMJCalendarViewController.m */; }; 58DC81841FFA31200060DC03 /* LMJNavBarFadeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC81821FFA311F0060DC03 /* LMJNavBarFadeViewController.m */; }; @@ -298,32 +269,19 @@ 58DC84171FFBC19A0060DC03 /* LMJLiftCycleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC840E1FFBC1980060DC03 /* LMJLiftCycleViewController.m */; }; 58DC841A1FFBC19A0060DC03 /* LMJRunTimeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84111FFBC1980060DC03 /* LMJRunTimeViewController.m */; }; 58DC84291FFBC3260060DC03 /* UIButton+LMJBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84281FFBC3250060DC03 /* UIButton+LMJBlock.m */; }; - 58DC842C1FFBC3E10060DC03 /* LMJRunTimeTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC842A1FFBC3E10060DC03 /* LMJRunTimeTest.m */; }; - 58DC842F1FFBC4270060DC03 /* LMJRunTimeTest+LMJWork.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC842E1FFBC4270060DC03 /* LMJRunTimeTest+LMJWork.m */; }; - 58DC84321FFBC44B0060DC03 /* LMJRunTimeTest+LMJMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84311FFBC44B0060DC03 /* LMJRunTimeTest+LMJMethod.m */; }; 58DC843E1FFBD1290060DC03 /* LMJNSThreadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84381FFBD1270060DC03 /* LMJNSThreadViewController.m */; }; 58DC843F1FFBD1290060DC03 /* LMJGCDViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC843A1FFBD1280060DC03 /* LMJGCDViewController.m */; }; 58DC84401FFBD1290060DC03 /* LMJLockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC843B1FFBD1280060DC03 /* LMJLockViewController.m */; }; 58DC84411FFBD1290060DC03 /* LMJNSOperationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC843D1FFBD1290060DC03 /* LMJNSOperationViewController.m */; }; - 58DC84441FFBDC720060DC03 /* LMJProtocolViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84431FFBDC710060DC03 /* LMJProtocolViewController.m */; }; 58DC84471FFBDC8A0060DC03 /* LMJBlockLoopViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84461FFBDC8A0060DC03 /* LMJBlockLoopViewController.m */; }; 58DC844A1FFBDC9E0060DC03 /* LMJModalBlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84491FFBDC9D0060DC03 /* LMJModalBlockViewController.m */; }; - 58DC84501FFBDD5C0060DC03 /* LMJOraceDataBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC844C1FFBDD5B0060DC03 /* LMJOraceDataBase.m */; }; - 58DC84511FFBDD5C0060DC03 /* LMJUsertProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC844E1FFBDD5C0060DC03 /* LMJUsertProtocol.m */; }; 58DC84541FFBDDC40060DC03 /* LMJChildBlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84521FFBDDC40060DC03 /* LMJChildBlockViewController.m */; }; 58DC84571FFBE0440060DC03 /* LMJBlockLoopOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84561FFBE0440060DC03 /* LMJBlockLoopOperation.m */; }; 58DC846A1FFC94B30060DC03 /* team_dictionary.plist in Resources */ = {isa = PBXBuildFile; fileRef = 58DC84671FFC94B30060DC03 /* team_dictionary.plist */; }; 58DC846B1FFC94B30060DC03 /* LMJTeam.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84681FFC94B30060DC03 /* LMJTeam.m */; }; 58DC846C1FFC94B30060DC03 /* LMJGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84691FFC94B30060DC03 /* LMJGroup.m */; }; 58DC846F1FFC967E0060DC03 /* LMJBaseRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC846E1FFC967D0060DC03 /* LMJBaseRequest.m */; }; - 58DC84EC1FFC972B0060DC03 /* MenuPopOverView.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84741FFC97280060DC03 /* MenuPopOverView.m */; }; 58DC84EE1FFC972B0060DC03 /* BSJ.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84761FFC97280060DC03 /* BSJ.m */; }; - 58DC84F01FFC972B0060DC03 /* libopenssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58DC847A1FFC97280060DC03 /* libopenssl.a */; }; - 58DC84F11FFC972C0060DC03 /* NJVitamioViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC847B1FFC97280060DC03 /* NJVitamioViewController.m */; }; - 58DC84F21FFC972C0060DC03 /* libVitamio.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58DC847C1FFC97280060DC03 /* libVitamio.a */; }; - 58DC84F31FFC972C0060DC03 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 58DC847D1FFC97280060DC03 /* LICENSE */; }; - 58DC84F41FFC972C0060DC03 /* CHANGELOG.md in Resources */ = {isa = PBXBuildFile; fileRef = 58DC847E1FFC97280060DC03 /* CHANGELOG.md */; }; - 58DC84F51FFC972C0060DC03 /* libffmpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58DC84891FFC97280060DC03 /* libffmpeg.a */; }; 58DC84F61FFC972C0060DC03 /* BSJLoginRegisterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 58DC848D1FFC97280060DC03 /* BSJLoginRegisterViewController.xib */; }; 58DC84F71FFC972C0060DC03 /* BSJNewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC848F1FFC97280060DC03 /* BSJNewViewController.m */; }; 58DC84F81FFC972C0060DC03 /* BSJTrendViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84901FFC97280060DC03 /* BSJTrendViewController.m */; }; @@ -339,11 +297,6 @@ 58DC85021FFC972C0060DC03 /* BSJPublishWordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84A41FFC97290060DC03 /* BSJPublishWordViewController.m */; }; 58DC85031FFC972C0060DC03 /* BSJPublishViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84A51FFC97290060DC03 /* BSJPublishViewController.m */; }; 58DC85041FFC972C0060DC03 /* BSJRecommendViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84A61FFC97290060DC03 /* BSJRecommendViewController.m */; }; - 58DC85051FFC972C0060DC03 /* NJPlayerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 58DC84A91FFC97290060DC03 /* NJPlayerView.xib */; }; - 58DC85061FFC972C0060DC03 /* NJPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84AC1FFC97290060DC03 /* NJPlayerView.m */; }; - 58DC85071FFC972C0060DC03 /* NJVideoPlayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84AD1FFC97290060DC03 /* NJVideoPlayViewController.m */; }; - 58DC85081FFC972C0060DC03 /* NJPlayer.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 58DC84AE1FFC97290060DC03 /* NJPlayer.bundle */; }; - 58DC85091FFC972C0060DC03 /* NJAVPlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84AF1FFC97290060DC03 /* NJAVPlayerViewController.m */; }; 58DC850A1FFC972C0060DC03 /* BSJRecommendUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84B21FFC97290060DC03 /* BSJRecommendUser.m */; }; 58DC850B1FFC972C0060DC03 /* BSJUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84B31FFC97290060DC03 /* BSJUser.m */; }; 58DC850C1FFC972C0060DC03 /* BSJTopic.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC84B41FFC97290060DC03 /* BSJTopic.m */; }; @@ -377,6 +330,8 @@ 58DC85331FFCA30C0060DC03 /* UIImageView+FitNet.m in Sources */ = {isa = PBXBuildFile; fileRef = 58DC85311FFCA30B0060DC03 /* UIImageView+FitNet.m */; }; 58DC88CE1FFDEEF70060DC03 /* libbz2.1.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 58DC88CD1FFDEEF70060DC03 /* libbz2.1.0.tbd */; }; 58DC88D01FFDEF030060DC03 /* libiconv.2.4.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 58DC88CF1FFDEF020060DC03 /* libiconv.2.4.0.tbd */; }; + 58E02EEB209D8A23005431BA /* LMJUniversalLinkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E02EEA209D8A23005431BA /* LMJUniversalLinkViewController.m */; }; + 58E02EEE209D8BA4005431BA /* LMJUniversalLink.html in Resources */ = {isa = PBXBuildFile; fileRef = 58E02EED209D8BA4005431BA /* LMJUniversalLink.html */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -393,11 +348,9 @@ 581A3E3E20450B3D00AF08C0 /* MJDownloadConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJDownloadConst.h; sourceTree = ""; }; 5822330A201821910008251F /* UIView+GestureCallback.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+GestureCallback.m"; sourceTree = ""; }; 5822330B201821910008251F /* NSDecimalNumber+Addtion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDecimalNumber+Addtion.h"; sourceTree = ""; }; - 5822330C201821910008251F /* UIViewController+DDPopUpViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+DDPopUpViewController.m"; sourceTree = ""; }; 5822330D201821910008251F /* UITextView+WZB.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITextView+WZB.m"; sourceTree = ""; }; 5822330E201821910008251F /* UIView+GestureCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+GestureCallback.h"; sourceTree = ""; }; 5822330F201821910008251F /* UITextView+WZB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITextView+WZB.h"; sourceTree = ""; }; - 58223310201821910008251F /* UIViewController+DDPopUpViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+DDPopUpViewController.h"; sourceTree = ""; }; 58223311201821910008251F /* NSDecimalNumber+Addtion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDecimalNumber+Addtion.m"; sourceTree = ""; }; 58223316201821C00008251F /* NullSafe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NullSafe.m; sourceTree = ""; }; 5822331D20182C5D0008251F /* MCCornersRoundViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCornersRoundViewController.h; sourceTree = ""; }; @@ -416,9 +369,12 @@ 5822335220188F5D0008251F /* MCLocalHTMLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCLocalHTMLViewController.h; sourceTree = ""; }; 5822335320188F5D0008251F /* MCLocalHTMLViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MCLocalHTMLViewController.m; sourceTree = ""; }; 5822335520188F6E0008251F /* adm */ = {isa = PBXFileReference; lastKnownFileType = folder; path = adm; sourceTree = ""; }; + 583D506F20731574001480C8 /* LMJLocalJsons */ = {isa = PBXFileReference; lastKnownFileType = folder; path = LMJLocalJsons; sourceTree = ""; }; + 583D508220765947001480C8 /* TDTouchID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TDTouchID.h; sourceTree = ""; }; + 583D508320765948001480C8 /* TDTouchID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TDTouchID.m; sourceTree = ""; }; + 583D508520765978001480C8 /* YYFPSLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYFPSLabel.m; sourceTree = ""; }; + 583D508620765978001480C8 /* YYFPSLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YYFPSLabel.h; sourceTree = ""; }; 584037FE1FF61CF8002A0566 /* iOSProject.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = iOSProject.entitlements; sourceTree = ""; }; - 584037FF1FF61D00002A0566 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; - 584038011FF61D1A002A0566 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 584038041FF62370002A0566 /* LMJAddressPickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJAddressPickerViewController.h; sourceTree = ""; }; 584038051FF62371002A0566 /* LMJAddressPickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJAddressPickerViewController.m; sourceTree = ""; }; 584038071FF629AB002A0566 /* LMJNoNavBarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJNoNavBarViewController.m; sourceTree = ""; }; @@ -488,6 +444,31 @@ 584038821FF9F2F1002A0566 /* LMJAlertViewsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJAlertViewsViewController.h; sourceTree = ""; }; 584038841FF9F602002A0566 /* LMJFillTableFormViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJFillTableFormViewController.m; sourceTree = ""; }; 584038851FF9F602002A0566 /* LMJFillTableFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJFillTableFormViewController.h; sourceTree = ""; }; + 585A22E5207DAB77001BD3AD /* SINPickPhotoTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SINPickPhotoTool.h; sourceTree = ""; }; + 585A22E6207DAB77001BD3AD /* SINPickPhotoTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SINPickPhotoTool.m; sourceTree = ""; }; + 585A22F42081FD1E001BD3AD /* QQResources.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = QQResources.bundle; sourceTree = ""; }; + 585A22FD2082FA28001BD3AD /* JSBridge_js */ = {isa = PBXFileReference; lastKnownFileType = folder; path = JSBridge_js; sourceTree = ""; }; + 585FC1D1208DAADF003174A7 /* VIDCachesTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VIDCachesTool.h; sourceTree = ""; }; + 585FC1D2208DAADF003174A7 /* VIDCachesTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIDCachesTool.m; sourceTree = ""; }; + 585FC1D4208DACC1003174A7 /* VIDTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VIDTableViewController.h; sourceTree = ""; }; + 585FC1D5208DACC1003174A7 /* VIDTableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIDTableViewController.m; sourceTree = ""; }; + 585FC1D7208DB9CD003174A7 /* VIDCollectionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VIDCollectionViewController.h; sourceTree = ""; }; + 585FC1D8208DB9CD003174A7 /* VIDCollectionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIDCollectionViewController.m; sourceTree = ""; }; + 585FC1DA208DBD95003174A7 /* VIDDownLoadViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VIDDownLoadViewController.h; sourceTree = ""; }; + 585FC1DB208DBD95003174A7 /* VIDDownLoadViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIDDownLoadViewController.m; sourceTree = ""; }; + 585FC1DD208DC1CF003174A7 /* VIDDownLoadedCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VIDDownLoadedCell.h; sourceTree = ""; }; + 585FC1DE208DC1CF003174A7 /* VIDDownLoadedCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIDDownLoadedCell.m; sourceTree = ""; }; + 585FC1E0208DC6B2003174A7 /* VIDDownLoadingCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VIDDownLoadingCell.h; sourceTree = ""; }; + 585FC1E1208DC6B2003174A7 /* VIDDownLoadingCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIDDownLoadingCell.m; sourceTree = ""; }; + 585FC1E3209B0481003174A7 /* MCTestViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCTestViewController.h; sourceTree = ""; }; + 585FC1E4209B0481003174A7 /* MCTestViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MCTestViewController.m; sourceTree = ""; }; + 585FC1E7209B2DF5003174A7 /* MCTestDataModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MCTestDataModel.xcdatamodel; sourceTree = ""; }; + 585FC1F2209B2FE3003174A7 /* MCStudent+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MCStudent+CoreDataProperties.m"; sourceTree = ""; }; + 585FC1F3209B2FE3003174A7 /* MCStudent+CoreDataClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MCStudent+CoreDataClass.h"; sourceTree = ""; }; + 585FC1F4209B2FE4003174A7 /* MCStudent+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MCStudent+CoreDataProperties.h"; sourceTree = ""; }; + 585FC1F5209B2FE4003174A7 /* MCStudent+CoreDataClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MCStudent+CoreDataClass.m"; sourceTree = ""; }; + 585FC1F8209B312E003174A7 /* MCCoreDataManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCoreDataManager.h; sourceTree = ""; }; + 585FC1F9209B312E003174A7 /* MCCoreDataManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MCCoreDataManager.m; sourceTree = ""; }; 58651A5C1FFE6D6E0087419D /* SINStatusListDAL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SINStatusListDAL.m; sourceTree = ""; }; 58651A5D1FFE6D6E0087419D /* SINUserManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SINUserManager.m; sourceTree = ""; }; 58651A5E1FFE6D6E0087419D /* SINSQLiteManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SINSQLiteManager.h; sourceTree = ""; }; @@ -543,16 +524,28 @@ 58651A9A1FFE6D6F0087419D /* SINStatusListService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SINStatusListService.h; sourceTree = ""; }; 58651A9C1FFE6D6F0087419D /* SINStatusListService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SINStatusListService.m; sourceTree = ""; }; 58651A9D1FFE6D6F0087419D /* SINPostStatusService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SINPostStatusService.h; sourceTree = ""; }; + 588CCD74205D42EE0067E3C4 /* LMJH5JSBridgeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJH5JSBridgeViewController.h; sourceTree = ""; }; + 588CCD75205D42EE0067E3C4 /* LMJH5JSBridgeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJH5JSBridgeViewController.m; sourceTree = ""; }; + 588CCD78205D45DC0067E3C4 /* WKWebViewJsBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebViewJsBridge.h; sourceTree = ""; }; + 588CCD79205D45DC0067E3C4 /* WKWebViewJsBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WKWebViewJsBridge.m; sourceTree = ""; }; + 588CCD7D205D4FA60067E3C4 /* WKBridgeTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKBridgeTool.h; sourceTree = ""; }; + 588CCD7E205D4FA60067E3C4 /* WKBridgeTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WKBridgeTool.m; sourceTree = ""; }; + 588CCD80205DF7860067E3C4 /* LMJCuteFlowLayoutViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJCuteFlowLayoutViewController.h; sourceTree = ""; }; + 588CCD81205DF7860067E3C4 /* LMJCuteFlowLayoutViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJCuteFlowLayoutViewController.m; sourceTree = ""; }; + 588CCD83205DF92D0067E3C4 /* LMJCircleLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJCircleLayout.h; sourceTree = ""; }; + 588CCD84205DF92E0067E3C4 /* LMJLineFlowLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJLineFlowLayout.h; sourceTree = ""; }; + 588CCD85205DF92E0067E3C4 /* LMJLineFlowLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJLineFlowLayout.m; sourceTree = ""; }; + 588CCD86205DF92E0067E3C4 /* LMJGirdLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJGirdLayout.m; sourceTree = ""; }; + 588CCD87205DF92F0067E3C4 /* LMJCircleLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJCircleLayout.m; sourceTree = ""; }; + 588CCD88205DF92F0067E3C4 /* LMJGirdLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJGirdLayout.h; sourceTree = ""; }; 58926424201B622B007DA41E /* BSJSQLiteManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BSJSQLiteManager.h; sourceTree = ""; }; 58926425201B622B007DA41E /* BSJSQLiteManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BSJSQLiteManager.m; sourceTree = ""; }; 58926427201B64D3007DA41E /* BSJTopicListDAL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BSJTopicListDAL.h; sourceTree = ""; }; 58926428201B64D3007DA41E /* BSJTopicListDAL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BSJTopicListDAL.m; sourceTree = ""; }; 58926465202C54C2007DA41E /* LMJRunLoopViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJRunLoopViewController.h; sourceTree = ""; }; 58926466202C54C2007DA41E /* LMJRunLoopViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJRunLoopViewController.m; sourceTree = ""; }; - 58926469202D6662007DA41E /* XLMJThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XLMJThread.h; sourceTree = ""; }; - 5892646A202D6662007DA41E /* XLMJThread.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XLMJThread.m; sourceTree = ""; }; - 58926474202DA70D007DA41E /* CalendarReminderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CalendarReminderManager.m; sourceTree = ""; }; - 58926475202DA70D007DA41E /* CalendarReminderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalendarReminderManager.h; sourceTree = ""; }; + 58926474202DA70D007DA41E /* LMJEventTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJEventTool.m; sourceTree = ""; }; + 58926475202DA70D007DA41E /* LMJEventTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJEventTool.h; sourceTree = ""; }; 5892AC941FF4EB4A00E868C2 /* iOSProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5892ACA01FF4EB4A00E868C2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 5892ACA51FF4EB4A00E868C2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -562,7 +555,6 @@ 5892ACB31FF4EF4400E868C2 /* Preview.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Preview.xcassets; sourceTree = ""; }; 5892ACB41FF4EF4400E868C2 /* QQMusic.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = QQMusic.xcassets; sourceTree = ""; }; 5892ACB51FF4EF4400E868C2 /* Sina.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Sina.xcassets; sourceTree = ""; }; - 5892ACB61FF4EF4500E868C2 /* WXIM.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = WXIM.xcassets; sourceTree = ""; }; 5892ACB71FF4EF4500E868C2 /* BSJ.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = BSJ.xcassets; sourceTree = ""; }; 5892ACB81FF4EF4500E868C2 /* Public.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Public.xcassets; sourceTree = ""; }; 5892ACC01FF4F45700E868C2 /* libUMessage_Sdk_1.5.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libUMessage_Sdk_1.5.0.a; sourceTree = ""; }; @@ -628,8 +620,6 @@ 5892AD801FF5175A00E868C2 /* UIColor+Random.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Random.m"; sourceTree = ""; }; 5892AD821FF517B200E868C2 /* UIButton+LMJ.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIButton+LMJ.h"; sourceTree = ""; }; 5892AD831FF517B200E868C2 /* UIButton+LMJ.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIButton+LMJ.m"; sourceTree = ""; }; - 5892AD871FF5D46800E868C2 /* GVUserDefaults+LMJ.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GVUserDefaults+LMJ.h"; sourceTree = ""; }; - 5892AD881FF5D46800E868C2 /* GVUserDefaults+LMJ.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "GVUserDefaults+LMJ.m"; sourceTree = ""; }; 5892AD8B1FF5E2D700E868C2 /* LMJIntroductoryPagesView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJIntroductoryPagesView.h; sourceTree = ""; }; 5892AD8C1FF5E2D700E868C2 /* LMJIntroductoryPagesView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJIntroductoryPagesView.m; sourceTree = ""; }; 5892AD8E1FF5E32500E868C2 /* LMJIntroductoryPagesHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJIntroductoryPagesHelper.h; sourceTree = ""; }; @@ -638,57 +628,18 @@ 5892AD9C1FF5F23C00E868C2 /* AdvertiseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdvertiseHelper.h; sourceTree = ""; }; 5892AD9D1FF5F23D00E868C2 /* AdvertiseView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdvertiseView.m; sourceTree = ""; }; 5892AD9E1FF5F23D00E868C2 /* AdvertiseHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdvertiseHelper.m; sourceTree = ""; }; - 5892ADA51FF600F700E868C2 /* YYFPSLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YYFPSLabel.h; sourceTree = ""; }; - 5892ADA61FF600F700E868C2 /* YYFPSLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYFPSLabel.m; sourceTree = ""; }; 5892ADA81FF603AD00E868C2 /* LMJUMengHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJUMengHelper.h; sourceTree = ""; }; 5892ADA91FF603AD00E868C2 /* LMJUMengHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJUMengHelper.m; sourceTree = ""; }; 5892ADAD1FF60A8300E868C2 /* JXTAlertController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JXTAlertController.h; sourceTree = ""; }; 5892ADAE1FF60A8300E868C2 /* JXTAlertController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JXTAlertController.m; sourceTree = ""; }; - 589B56731FFFC52F00B2D5A8 /* 月半小夜曲.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "月半小夜曲.lrc"; sourceTree = ""; }; - 589B56741FFFC52F00B2D5A8 /* 255319.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 255319.lrc; sourceTree = ""; }; - 589B56751FFFC52F00B2D5A8 /* 14945107.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 14945107.lrc; sourceTree = ""; }; - 589B56761FFFC52F00B2D5A8 /* 10736444.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 10736444.lrc; sourceTree = ""; }; - 589B56771FFFC52F00B2D5A8 /* 309769.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 309769.lrc; sourceTree = ""; }; - 589B56781FFFC52F00B2D5A8 /* 235319.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 235319.lrc; sourceTree = ""; }; - 589B56791FFFC52F00B2D5A8 /* 12309111.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 12309111.lrc; sourceTree = ""; }; - 589B567A1FFFC52F00B2D5A8 /* 339744.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 339744.lrc; sourceTree = ""; }; - 589B567B1FFFC52F00B2D5A8 /* 10405520.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 10405520.lrc; sourceTree = ""; }; - 589B567C1FFFC52F00B2D5A8 /* 120125029.lrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 120125029.lrc; sourceTree = ""; }; - 589B567E1FFFC52F00B2D5A8 /* wf@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wf@2x.jpg"; sourceTree = ""; }; - 589B567F1FFFC52F00B2D5A8 /* jay@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "jay@2x.jpg"; sourceTree = ""; }; - 589B56801FFFC52F00B2D5A8 /* lkq_icon@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "lkq_icon@2x.jpg"; sourceTree = ""; }; - 589B56811FFFC52F00B2D5A8 /* jay_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "jay_icon@2x.png"; sourceTree = ""; }; - 589B56821FFFC52F00B2D5A8 /* dzq_icon@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "dzq_icon@2x.jpg"; sourceTree = ""; }; - 589B56831FFFC52F00B2D5A8 /* zxy@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "zxy@2x.jpg"; sourceTree = ""; }; - 589B56841FFFC52F00B2D5A8 /* kzxd_icon@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "kzxd_icon@2x.jpg"; sourceTree = ""; }; - 589B56851FFFC52F00B2D5A8 /* dzq@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "dzq@2x.jpg"; sourceTree = ""; }; - 589B56861FFFC52F00B2D5A8 /* jj@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "jj@2x.jpg"; sourceTree = ""; }; - 589B56871FFFC52F00B2D5A8 /* lkq@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "lkq@2x.jpg"; sourceTree = ""; }; - 589B56881FFFC52F00B2D5A8 /* wf_icon@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "wf_icon@2x.jpg"; sourceTree = ""; }; - 589B56891FFFC52F00B2D5A8 /* eason_icon@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "eason_icon@2x.jpg"; sourceTree = ""; }; - 589B568A1FFFC52F00B2D5A8 /* kzxd@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "kzxd@2x.jpg"; sourceTree = ""; }; - 589B568B1FFFC52F00B2D5A8 /* bb@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "bb@2x.jpg"; sourceTree = ""; }; - 589B568C1FFFC52F00B2D5A8 /* eason@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "eason@2x.jpg"; sourceTree = ""; }; - 589B568D1FFFC52F00B2D5A8 /* jj_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "jj_icon@2x.png"; sourceTree = ""; }; - 589B568E1FFFC52F00B2D5A8 /* nanquan@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "nanquan@2x.jpg"; sourceTree = ""; }; - 589B568F1FFFC52F00B2D5A8 /* bb_icon@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "bb_icon@2x.jpg"; sourceTree = ""; }; - 589B56901FFFC52F00B2D5A8 /* zxy_icon@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "zxy_icon@2x.jpg"; sourceTree = ""; }; - 589B56911FFFC52F00B2D5A8 /* nanquan_icon@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "nanquan_icon@2x.jpg"; sourceTree = ""; }; - 589B56931FFFC52F00B2D5A8 /* 14945107.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 14945107.mp3; sourceTree = ""; }; - 589B56941FFFC52F00B2D5A8 /* 255319.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 255319.mp3; sourceTree = ""; }; - 589B56951FFFC52F00B2D5A8 /* 235319.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 235319.mp3; sourceTree = ""; }; - 589B56961FFFC52F00B2D5A8 /* 309769.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 309769.mp3; sourceTree = ""; }; - 589B56971FFFC52F00B2D5A8 /* 10736444.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 10736444.mp3; sourceTree = ""; }; - 589B56981FFFC52F00B2D5A8 /* 1201111234.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 1201111234.mp3; sourceTree = ""; }; - 589B56991FFFC52F00B2D5A8 /* 10405520.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 10405520.mp3; sourceTree = ""; }; - 589B569A1FFFC52F00B2D5A8 /* 120125029.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 120125029.mp3; sourceTree = ""; }; - 589B569B1FFFC52F00B2D5A8 /* 12309111.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 12309111.mp3; sourceTree = ""; }; - 589B569C1FFFC52F00B2D5A8 /* 339744.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 339744.mp3; sourceTree = ""; }; - 589B569D1FFFC52F00B2D5A8 /* Musics.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Musics.plist; sourceTree = ""; }; + 58988893206B34BE00BDAACD /* RSAEncryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSAEncryptor.h; sourceTree = ""; }; + 58988894206B34BE00BDAACD /* DES3Encryptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DES3Encryptor.m; sourceTree = ""; }; + 58988895206B34BE00BDAACD /* EncryptorTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EncryptorTool.m; sourceTree = ""; }; + 5898889C206B34BE00BDAACD /* RSAEncryptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSAEncryptor.m; sourceTree = ""; }; + 5898889D206B34BE00BDAACD /* EncryptorTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncryptorTool.h; sourceTree = ""; }; + 5898889E206B34BE00BDAACD /* DES3Encryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DES3Encryptor.h; sourceTree = ""; }; 589B569F1FFFC52F00B2D5A8 /* CALayer+MUSAmi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+MUSAmi.h"; sourceTree = ""; }; - 589B56A01FFFC52F00B2D5A8 /* MUSAnimationTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MUSAnimationTool.h; sourceTree = ""; }; 589B56A21FFFC52F00B2D5A8 /* CALayer+MUSAmi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+MUSAmi.m"; sourceTree = ""; }; - 589B56A31FFFC52F00B2D5A8 /* MUSAnimationTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MUSAnimationTool.m; sourceTree = ""; }; 589B56A51FFFC52F00B2D5A8 /* MUSPlayingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MUSPlayingViewController.h; sourceTree = ""; }; 589B56A61FFFC52F00B2D5A8 /* MUSHomeListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MUSHomeListViewController.m; sourceTree = ""; }; 589B56A71FFFC52F00B2D5A8 /* MUSLrcTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MUSLrcTableViewController.m; sourceTree = ""; }; @@ -721,33 +672,9 @@ 589B56C91FFFC52F00B2D5A8 /* QQMusicOperationTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QQMusicOperationTool.m; sourceTree = ""; }; 589B56CA1FFFC52F00B2D5A8 /* QQLrcDataTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQLrcDataTool.h; sourceTree = ""; }; 589B56CB1FFFC52F00B2D5A8 /* QQMusicTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QQMusicTool.m; sourceTree = ""; }; - 589B573E2000339700B2D5A8 /* VIDTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDTabBarController.m; sourceTree = ""; }; - 589B573F2000339700B2D5A8 /* VIDNetListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDNetListViewController.m; sourceTree = ""; }; - 589B57402000339700B2D5A8 /* VIDTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDTableViewController.m; sourceTree = ""; }; - 589B57412000339700B2D5A8 /* VIDCollectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDCollectionViewController.m; sourceTree = ""; }; - 589B57422000339700B2D5A8 /* VIDLocalViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDLocalViewController.h; sourceTree = ""; }; - 589B57432000339700B2D5A8 /* VIDTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDTabBarController.h; sourceTree = ""; }; - 589B57442000339700B2D5A8 /* VIDNetListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDNetListViewController.h; sourceTree = ""; }; - 589B57452000339700B2D5A8 /* VIDTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDTableViewController.h; sourceTree = ""; }; - 589B57462000339700B2D5A8 /* VIDLocalViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDLocalViewController.m; sourceTree = ""; }; - 589B57472000339700B2D5A8 /* VIDCollectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDCollectionViewController.h; sourceTree = ""; }; - 589B57492000339700B2D5A8 /* ZFVideoModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZFVideoModel.h; sourceTree = ""; }; - 589B574A2000339700B2D5A8 /* videoData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = videoData.json; sourceTree = ""; }; - 589B574B2000339700B2D5A8 /* ZFVideoResolution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZFVideoResolution.m; sourceTree = ""; }; - 589B574D2000339700B2D5A8 /* ZFVideoResolution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZFVideoResolution.h; sourceTree = ""; }; - 589B574E2000339700B2D5A8 /* ZFVideoModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZFVideoModel.m; sourceTree = ""; }; - 589B57502000339700B2D5A8 /* VIDTableViewVideoCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDTableViewVideoCell.m; sourceTree = ""; }; - 589B57512000339800B2D5A8 /* VIDVideoDownloadedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDVideoDownloadedCell.m; sourceTree = ""; }; - 589B57522000339800B2D5A8 /* VIDVideoDownloadingCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDVideoDownloadingCell.h; sourceTree = ""; }; - 589B57532000339800B2D5A8 /* VIDCollectionViewVideoCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDCollectionViewVideoCell.h; sourceTree = ""; }; - 589B57552000339800B2D5A8 /* VIDTableViewVideoCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VIDTableViewVideoCell.xib; sourceTree = ""; }; - 589B57562000339800B2D5A8 /* VIDTableViewVideoCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDTableViewVideoCell.h; sourceTree = ""; }; - 589B57572000339800B2D5A8 /* VIDVideoDownloadingCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VIDVideoDownloadingCell.xib; sourceTree = ""; }; - 589B57582000339800B2D5A8 /* VIDVideoDownloadedCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VIDVideoDownloadedCell.xib; sourceTree = ""; }; - 589B57592000339800B2D5A8 /* VIDCollectionViewVideoCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDCollectionViewVideoCell.m; sourceTree = ""; }; - 589B575A2000339800B2D5A8 /* VIDCollectionViewVideoCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VIDCollectionViewVideoCell.xib; sourceTree = ""; }; - 589B575B2000339800B2D5A8 /* VIDVideoDownloadingCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDVideoDownloadingCell.m; sourceTree = ""; }; - 589B575C2000339800B2D5A8 /* VIDVideoDownloadedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDVideoDownloadedCell.h; sourceTree = ""; }; + 58A043D7206B28A1003CB4E5 /* LMJRSAViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJRSAViewController.h; sourceTree = ""; }; + 58A043D8206B28A1003CB4E5 /* LMJRSAViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJRSAViewController.m; sourceTree = ""; }; + 58A043DA206B2E1D003CB4E5 /* RSA证书 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "RSA证书"; sourceTree = ""; }; 58A17C4C2005F4E600B350AB /* LMJParagraph.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJParagraph.h; sourceTree = ""; }; 58A17C4D2005F4E600B350AB /* LMJParagraph.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJParagraph.m; sourceTree = ""; }; 58A17C4F2007112300B350AB /* intro_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = intro_2.jpg; sourceTree = ""; }; @@ -756,12 +683,23 @@ 58A17C522007112A00B350AB /* intro_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = intro_1.jpg; sourceTree = ""; }; 58A17C572007335400B350AB /* LMJConst.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJConst.h; sourceTree = ""; }; 58A17C582007335400B350AB /* LMJConst.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJConst.m; sourceTree = ""; }; + 58A858482078760A0063DE98 /* LMJWebImagesCacheViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJWebImagesCacheViewController.h; sourceTree = ""; }; + 58A858492078760A0063DE98 /* LMJWebImagesCacheViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJWebImagesCacheViewController.m; sourceTree = ""; }; + 58A8584B207878430063DE98 /* LMJWebImageCacheCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJWebImageCacheCell.h; sourceTree = ""; }; + 58A8584C207878430063DE98 /* LMJWebImageCacheCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJWebImageCacheCell.m; sourceTree = ""; }; + 58A8584D207878430063DE98 /* LMJWebImageCacheCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LMJWebImageCacheCell.xib; sourceTree = ""; }; + 58A858502078842B0063DE98 /* LMJStudent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJStudent.h; sourceTree = ""; }; + 58A858512078842B0063DE98 /* LMJStudent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJStudent.m; sourceTree = ""; }; + 58A858A4207C934E0063DE98 /* PresentAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PresentAnimator.h; sourceTree = ""; }; + 58A858A5207C934E0063DE98 /* PresentAnimator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresentAnimator.m; sourceTree = ""; }; 58AE5CF320103BA3003BD369 /* VIDMoviePlayerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VIDMoviePlayerViewController.h; sourceTree = ""; }; 58AE5CF420103BA3003BD369 /* VIDMoviePlayerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VIDMoviePlayerViewController.m; sourceTree = ""; }; + 58B36C6120ABF3C700915868 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 58B59D082015B17800C4C4C9 /* LMJCasesViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJCasesViewController.h; sourceTree = ""; }; 58B59D092015B17800C4C4C9 /* LMJCasesViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJCasesViewController.m; sourceTree = ""; }; - 58DC816A1FFA0A470060DC03 /* LMJTableSDWebImageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJTableSDWebImageViewController.h; sourceTree = ""; }; - 58DC816B1FFA0A480060DC03 /* LMJTableSDWebImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJTableSDWebImageViewController.m; sourceTree = ""; }; + 58C51F8A208C221500EECAAA /* VideoDemo.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = VideoDemo.storyboard; sourceTree = ""; }; + 58C51F8C208C2EF100EECAAA /* VIDListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VIDListViewController.h; sourceTree = ""; }; + 58C51F8D208C2EF100EECAAA /* VIDListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VIDListViewController.m; sourceTree = ""; }; 58DC81701FFA29DF0060DC03 /* LMJDragTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJDragTableViewController.h; sourceTree = ""; }; 58DC81711FFA29E00060DC03 /* LMJDragTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJDragTableViewController.m; sourceTree = ""; }; 58DC81761FFA2CF80060DC03 /* LMJCalendarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJCalendarViewController.m; sourceTree = ""; }; @@ -884,12 +822,6 @@ 58DC84111FFBC1980060DC03 /* LMJRunTimeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJRunTimeViewController.m; sourceTree = ""; }; 58DC84271FFBC3250060DC03 /* UIButton+LMJBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+LMJBlock.h"; sourceTree = ""; }; 58DC84281FFBC3250060DC03 /* UIButton+LMJBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+LMJBlock.m"; sourceTree = ""; }; - 58DC842A1FFBC3E10060DC03 /* LMJRunTimeTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJRunTimeTest.m; sourceTree = ""; }; - 58DC842B1FFBC3E10060DC03 /* LMJRunTimeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJRunTimeTest.h; sourceTree = ""; }; - 58DC842D1FFBC4270060DC03 /* LMJRunTimeTest+LMJWork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LMJRunTimeTest+LMJWork.h"; sourceTree = ""; }; - 58DC842E1FFBC4270060DC03 /* LMJRunTimeTest+LMJWork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "LMJRunTimeTest+LMJWork.m"; sourceTree = ""; }; - 58DC84301FFBC44B0060DC03 /* LMJRunTimeTest+LMJMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LMJRunTimeTest+LMJMethod.h"; sourceTree = ""; }; - 58DC84311FFBC44B0060DC03 /* LMJRunTimeTest+LMJMethod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "LMJRunTimeTest+LMJMethod.m"; sourceTree = ""; }; 58DC84361FFBD1270060DC03 /* LMJNSOperationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJNSOperationViewController.h; sourceTree = ""; }; 58DC84371FFBD1270060DC03 /* LMJNSThreadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJNSThreadViewController.h; sourceTree = ""; }; 58DC84381FFBD1270060DC03 /* LMJNSThreadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJNSThreadViewController.m; sourceTree = ""; }; @@ -898,17 +830,10 @@ 58DC843B1FFBD1280060DC03 /* LMJLockViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJLockViewController.m; sourceTree = ""; }; 58DC843C1FFBD1290060DC03 /* LMJLockViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJLockViewController.h; sourceTree = ""; }; 58DC843D1FFBD1290060DC03 /* LMJNSOperationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJNSOperationViewController.m; sourceTree = ""; }; - 58DC84421FFBDC710060DC03 /* LMJProtocolViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJProtocolViewController.h; sourceTree = ""; }; - 58DC84431FFBDC710060DC03 /* LMJProtocolViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJProtocolViewController.m; sourceTree = ""; }; 58DC84451FFBDC8A0060DC03 /* LMJBlockLoopViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJBlockLoopViewController.h; sourceTree = ""; }; 58DC84461FFBDC8A0060DC03 /* LMJBlockLoopViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJBlockLoopViewController.m; sourceTree = ""; }; 58DC84481FFBDC9D0060DC03 /* LMJModalBlockViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJModalBlockViewController.h; sourceTree = ""; }; 58DC84491FFBDC9D0060DC03 /* LMJModalBlockViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJModalBlockViewController.m; sourceTree = ""; }; - 58DC844B1FFBDD5B0060DC03 /* LMJDataBaseConnectionProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJDataBaseConnectionProtocol.h; sourceTree = ""; }; - 58DC844C1FFBDD5B0060DC03 /* LMJOraceDataBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJOraceDataBase.m; sourceTree = ""; }; - 58DC844D1FFBDD5B0060DC03 /* LMJUsertProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJUsertProtocol.h; sourceTree = ""; }; - 58DC844E1FFBDD5C0060DC03 /* LMJUsertProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJUsertProtocol.m; sourceTree = ""; }; - 58DC844F1FFBDD5C0060DC03 /* LMJOraceDataBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJOraceDataBase.h; sourceTree = ""; }; 58DC84521FFBDDC40060DC03 /* LMJChildBlockViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJChildBlockViewController.m; sourceTree = ""; }; 58DC84531FFBDDC40060DC03 /* LMJChildBlockViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJChildBlockViewController.h; sourceTree = ""; }; 58DC84551FFBE0440060DC03 /* LMJBlockLoopOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJBlockLoopOperation.h; sourceTree = ""; }; @@ -921,24 +846,7 @@ 58DC846D1FFC967C0060DC03 /* LMJBaseRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LMJBaseRequest.h; sourceTree = ""; }; 58DC846E1FFC967D0060DC03 /* LMJBaseRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LMJBaseRequest.m; sourceTree = ""; }; 58DC84721FFC97280060DC03 /* BSJ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSJ.h; sourceTree = ""; }; - 58DC84741FFC97280060DC03 /* MenuPopOverView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuPopOverView.m; sourceTree = ""; }; 58DC84761FFC97280060DC03 /* BSJ.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSJ.m; sourceTree = ""; }; - 58DC84771FFC97280060DC03 /* MenuPopOverView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuPopOverView.h; sourceTree = ""; }; - 58DC847A1FFC97280060DC03 /* libopenssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopenssl.a; sourceTree = ""; }; - 58DC847B1FFC97280060DC03 /* NJVitamioViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJVitamioViewController.m; sourceTree = ""; }; - 58DC847C1FFC97280060DC03 /* libVitamio.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libVitamio.a; sourceTree = ""; }; - 58DC847D1FFC97280060DC03 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; - 58DC847E1FFC97280060DC03 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; - 58DC84811FFC97280060DC03 /* VPlayerManageDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPlayerManageDef.h; sourceTree = ""; }; - 58DC84821FFC97280060DC03 /* VMediaPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMediaPlayer.h; sourceTree = ""; }; - 58DC84831FFC97280060DC03 /* Vitamio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vitamio.h; sourceTree = ""; }; - 58DC84841FFC97280060DC03 /* VDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VDefines.h; sourceTree = ""; }; - 58DC84851FFC97280060DC03 /* VMediaPlayerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMediaPlayerDelegate.h; sourceTree = ""; }; - 58DC84861FFC97280060DC03 /* VMediaExtracter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMediaExtracter.h; sourceTree = ""; }; - 58DC84871FFC97280060DC03 /* VSingleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VSingleton.h; sourceTree = ""; }; - 58DC84881FFC97280060DC03 /* VMediaExtracterDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMediaExtracterDef.h; sourceTree = ""; }; - 58DC84891FFC97280060DC03 /* libffmpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libffmpeg.a; sourceTree = ""; }; - 58DC848A1FFC97280060DC03 /* NJVitamioViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJVitamioViewController.h; sourceTree = ""; }; 58DC848C1FFC97280060DC03 /* BSJCommentPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSJCommentPageViewController.h; sourceTree = ""; }; 58DC848D1FFC97280060DC03 /* BSJLoginRegisterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BSJLoginRegisterViewController.xib; sourceTree = ""; }; 58DC848E1FFC97280060DC03 /* BSJLoginRegisterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSJLoginRegisterViewController.h; sourceTree = ""; }; @@ -966,14 +874,6 @@ 58DC84A41FFC97290060DC03 /* BSJPublishWordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSJPublishWordViewController.m; sourceTree = ""; }; 58DC84A51FFC97290060DC03 /* BSJPublishViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSJPublishViewController.m; sourceTree = ""; }; 58DC84A61FFC97290060DC03 /* BSJRecommendViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSJRecommendViewController.m; sourceTree = ""; }; - 58DC84A81FFC97290060DC03 /* NJPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJPlayerView.h; sourceTree = ""; }; - 58DC84A91FFC97290060DC03 /* NJPlayerView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NJPlayerView.xib; sourceTree = ""; }; - 58DC84AA1FFC97290060DC03 /* NJVideoPlayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJVideoPlayViewController.h; sourceTree = ""; }; - 58DC84AB1FFC97290060DC03 /* NJAVPlayerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJAVPlayerViewController.h; sourceTree = ""; }; - 58DC84AC1FFC97290060DC03 /* NJPlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJPlayerView.m; sourceTree = ""; }; - 58DC84AD1FFC97290060DC03 /* NJVideoPlayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJVideoPlayViewController.m; sourceTree = ""; }; - 58DC84AE1FFC97290060DC03 /* NJPlayer.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = NJPlayer.bundle; sourceTree = ""; }; - 58DC84AF1FFC97290060DC03 /* NJAVPlayerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NJAVPlayerViewController.m; sourceTree = ""; }; 58DC84B11FFC97290060DC03 /* BSJTopicViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSJTopicViewModel.h; sourceTree = ""; }; 58DC84B21FFC97290060DC03 /* BSJRecommendUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSJRecommendUser.m; sourceTree = ""; }; 58DC84B31FFC97290060DC03 /* BSJUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSJUser.m; sourceTree = ""; }; @@ -1032,6 +932,9 @@ 58DC85321FFCA30C0060DC03 /* UIImageView+FitNet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+FitNet.h"; sourceTree = ""; }; 58DC88CD1FFDEEF70060DC03 /* libbz2.1.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.1.0.tbd; path = usr/lib/libbz2.1.0.tbd; sourceTree = SDKROOT; }; 58DC88CF1FFDEF020060DC03 /* libiconv.2.4.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.2.4.0.tbd; path = usr/lib/libiconv.2.4.0.tbd; sourceTree = SDKROOT; }; + 58E02EE9209D8A23005431BA /* LMJUniversalLinkViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMJUniversalLinkViewController.h; sourceTree = ""; }; + 58E02EEA209D8A23005431BA /* LMJUniversalLinkViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMJUniversalLinkViewController.m; sourceTree = ""; }; + 58E02EED209D8BA4005431BA /* LMJUniversalLink.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LMJUniversalLink.html; sourceTree = ""; }; AA64D526EE098D357A7E6B09 /* Pods-iOSProject.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOSProject.release.xcconfig"; path = "Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1042,13 +945,9 @@ files = ( 58DC88D01FFDEF030060DC03 /* libiconv.2.4.0.tbd in Frameworks */, 58DC88CE1FFDEEF70060DC03 /* libbz2.1.0.tbd in Frameworks */, - 58DC84F01FFC972B0060DC03 /* libopenssl.a in Frameworks */, + 58B36C6220ABF3C700915868 /* AudioToolbox.framework in Frameworks */, 5892ACC21FF4F45700E868C2 /* libUMessage_Sdk_1.5.0.a in Frameworks */, - 584038001FF61D00002A0566 /* MapKit.framework in Frameworks */, 54E3991EBFDEC31145ED8B0F /* libPods-iOSProject.a in Frameworks */, - 584038021FF61D1A002A0566 /* AudioToolbox.framework in Frameworks */, - 58DC84F51FFC972C0060DC03 /* libffmpeg.a in Frameworks */, - 58DC84F21FFC972C0060DC03 /* libVitamio.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1066,8 +965,8 @@ 581A3E3720450B3D00AF08C0 /* MJDownload */ = { isa = PBXGroup; children = ( - 581A3E3E20450B3D00AF08C0 /* MJDownloadConst.h */, 581A3E3C20450B3D00AF08C0 /* MJDownload.h */, + 581A3E3E20450B3D00AF08C0 /* MJDownloadConst.h */, 581A3E3A20450B3D00AF08C0 /* MJDownloadConst.m */, 581A3E3B20450B3D00AF08C0 /* MJDownloadManager.h */, 581A3E3920450B3D00AF08C0 /* MJDownloadManager.m */, @@ -1087,8 +986,6 @@ 58223311201821910008251F /* NSDecimalNumber+Addtion.m */, 5822330F201821910008251F /* UITextView+WZB.h */, 5822330D201821910008251F /* UITextView+WZB.m */, - 58223310201821910008251F /* UIViewController+DDPopUpViewController.h */, - 5822330C201821910008251F /* UIViewController+DDPopUpViewController.m */, ); path = ThirdCategory; sourceTree = ""; @@ -1122,6 +1019,8 @@ 5822334420185F790008251F /* MCSphereTagCloudViewController.m */, 5822335220188F5D0008251F /* MCLocalHTMLViewController.h */, 5822335320188F5D0008251F /* MCLocalHTMLViewController.m */, + 585FC1E3209B0481003174A7 /* MCTestViewController.h */, + 585FC1E4209B0481003174A7 /* MCTestViewController.m */, ); path = Controller; sourceTree = ""; @@ -1129,6 +1028,13 @@ 5822331B20182B980008251F /* Model */ = { isa = PBXGroup; children = ( + 585FC1E6209B2DF5003174A7 /* MCTestDataModel.xcdatamodeld */, + 585FC1F3209B2FE3003174A7 /* MCStudent+CoreDataClass.h */, + 585FC1F5209B2FE4003174A7 /* MCStudent+CoreDataClass.m */, + 585FC1F4209B2FE4003174A7 /* MCStudent+CoreDataProperties.h */, + 585FC1F2209B2FE3003174A7 /* MCStudent+CoreDataProperties.m */, + 585FC1F8209B312E003174A7 /* MCCoreDataManager.h */, + 585FC1F9209B312E003174A7 /* MCCoreDataManager.m */, ); path = Model; sourceTree = ""; @@ -1199,6 +1105,7 @@ 584038431FF7F3DC002A0566 /* Network */ = { isa = PBXGroup; children = ( + 583D506F20731574001480C8 /* LMJLocalJsons */, 58DC846D1FFC967C0060DC03 /* LMJBaseRequest.h */, 58DC846E1FFC967D0060DC03 /* LMJBaseRequest.m */, 584038471FF7F3E4002A0566 /* LMJBaseResponse.h */, @@ -1212,6 +1119,7 @@ 5840384A1FF7FB88002A0566 /* Preview2 */ = { isa = PBXGroup; children = ( + 588CCD77205D45450067E3C4 /* Tool */, 584038511FF872BE002A0566 /* model */, 584038521FF872BE002A0566 /* view */, 5840384C1FF7FBCF002A0566 /* LMJMasonryViewController.h */, @@ -1228,6 +1136,8 @@ 584038711FF9399B002A0566 /* LMJListTimerCountDownViewController.m */, 584038791FF9F0F8002A0566 /* LMJH5_OCViewController.h */, 5840387A1FF9F0F9002A0566 /* LMJH5_OCViewController.m */, + 588CCD74205D42EE0067E3C4 /* LMJH5JSBridgeViewController.h */, + 588CCD75205D42EE0067E3C4 /* LMJH5JSBridgeViewController.m */, 584038821FF9F2F1002A0566 /* LMJAlertViewsViewController.h */, 584038811FF9F2F0002A0566 /* LMJAlertViewsViewController.m */, 584038851FF9F602002A0566 /* LMJFillTableFormViewController.h */, @@ -1267,6 +1177,15 @@ path = view; sourceTree = ""; }; + 585FC1D0208DAAC0003174A7 /* Tool */ = { + isa = PBXGroup; + children = ( + 585FC1D1208DAADF003174A7 /* VIDCachesTool.h */, + 585FC1D2208DAADF003174A7 /* VIDCachesTool.m */, + ); + path = Tool; + sourceTree = ""; + }; 58651A5A1FFE6D6E0087419D /* 新浪微博 */ = { isa = PBXGroup; children = ( @@ -1291,6 +1210,8 @@ 58651A5D1FFE6D6E0087419D /* SINUserManager.m */, 58651A611FFE6D6E0087419D /* SINStatusListDAL.h */, 58651A5C1FFE6D6E0087419D /* SINStatusListDAL.m */, + 585A22E5207DAB77001BD3AD /* SINPickPhotoTool.h */, + 585A22E6207DAB77001BD3AD /* SINPickPhotoTool.m */, ); path = Tools; sourceTree = ""; @@ -1343,10 +1264,10 @@ 58651A841FFE6D6F0087419D /* SINUser.m */, 58651A821FFE6D6F0087419D /* SINStatus.h */, 58651A7D1FFE6D6F0087419D /* SINStatus.m */, - 58651A811FFE6D6F0087419D /* SINStatusViewModel.h */, - 58651A7C1FFE6D6F0087419D /* SINStatusViewModel.m */, 58651A831FFE6D6F0087419D /* SINDictURL.h */, 58651A7F1FFE6D6F0087419D /* SINDictURL.m */, + 58651A811FFE6D6F0087419D /* SINStatusViewModel.h */, + 58651A7C1FFE6D6F0087419D /* SINStatusViewModel.m */, ); path = Model; sourceTree = ""; @@ -1356,6 +1277,8 @@ children = ( 58651A8B1FFE6D6F0087419D /* SINTabBar.h */, 58651A921FFE6D6F0087419D /* SINTabBar.m */, + 58651A941FFE6D6F0087419D /* SINUnLoginRegisterView.h */, + 58651A891FFE6D6F0087419D /* SINUnLoginRegisterView.m */, 58651A951FFE6D6F0087419D /* SINStatusCell.h */, 58651A871FFE6D6F0087419D /* SINStatusCell.m */, 58651A911FFE6D6F0087419D /* SINStatusToolBarView.h */, @@ -1365,8 +1288,6 @@ 58651A971FFE6D6F0087419D /* SINStatusRetweetView.m */, 58651A961FFE6D6F0087419D /* SINStatusPicsView.h */, 58651A8D1FFE6D6F0087419D /* SINStatusPicsView.m */, - 58651A941FFE6D6F0087419D /* SINUnLoginRegisterView.h */, - 58651A891FFE6D6F0087419D /* SINUnLoginRegisterView.m */, 58651A931FFE6D6F0087419D /* SINPublishToolBar.h */, 58651A8A1FFE6D6F0087419D /* SINPublishToolBar.m */, 58651A881FFE6D6F0087419D /* SINPublishToolBar.xib */, @@ -1399,7 +1320,7 @@ 58DC84031FFBC15B0060DC03 /* 基础理论 */, 58DC82A81FFB40A50060DC03 /* 物理仿真 */, 58DC82AE1FFB40A60060DC03 /* 核心动画 */, - 58DC82AB1FFB40A60060DC03 /* 绘图 */, + 58DC82AB1FFB40A60060DC03 /* 绘图和手势 */, 58DC84701FFC97280060DC03 /* 百思不得姐 */, 58651A5A1FFE6D6E0087419D /* 新浪微博 */, 589B56701FFFC52F00B2D5A8 /* QQ音乐 */, @@ -1410,11 +1331,21 @@ path = Classes; sourceTree = ""; }; + 588CCD77205D45450067E3C4 /* Tool */ = { + isa = PBXGroup; + children = ( + 585A22FD2082FA28001BD3AD /* JSBridge_js */, + 588CCD78205D45DC0067E3C4 /* WKWebViewJsBridge.h */, + 588CCD79205D45DC0067E3C4 /* WKWebViewJsBridge.m */, + 588CCD7D205D4FA60067E3C4 /* WKBridgeTool.h */, + 588CCD7E205D4FA60067E3C4 /* WKBridgeTool.m */, + ); + path = Tool; + sourceTree = ""; + }; 58926468202D6645007DA41E /* Other */ = { isa = PBXGroup; children = ( - 58926469202D6662007DA41E /* XLMJThread.h */, - 5892646A202D6662007DA41E /* XLMJThread.m */, ); path = Other; sourceTree = ""; @@ -1455,7 +1386,6 @@ 5892ACB81FF4EF4500E868C2 /* Public.xcassets */, 5892ACB41FF4EF4400E868C2 /* QQMusic.xcassets */, 5892ACB51FF4EF4400E868C2 /* Sina.xcassets */, - 5892ACB61FF4EF4500E868C2 /* WXIM.xcassets */, ); path = iOSProject; sourceTree = ""; @@ -1505,18 +1435,18 @@ children = ( 5892ACE51FF4F9D100E868C2 /* LMJNavigationBar.h */, 5892ACED1FF4F9D100E868C2 /* LMJNavigationBar.m */, + 5892ACEC1FF4F9D100E868C2 /* LMJNormalRefreshHeader.h */, + 5892ACE61FF4F9D100E868C2 /* LMJNormalRefreshHeader.m */, 5892ACE31FF4F9D100E868C2 /* LMJAutoRefreshFooter.h */, 5892ACEA1FF4F9D100E868C2 /* LMJAutoRefreshFooter.m */, - 5892ACEE1FF4F9D100E868C2 /* LMJElementsFlowLayout.h */, - 5892ACE41FF4F9D100E868C2 /* LMJElementsFlowLayout.m */, - 5892ACEF1FF4F9D100E868C2 /* LMJVerticalFlowLayout.h */, - 5892ACE91FF4F9D100E868C2 /* LMJVerticalFlowLayout.m */, 5892ACE81FF4F9D100E868C2 /* LMJSettingCell.h */, 5892ACF01FF4F9D100E868C2 /* LMJSettingCell.m */, + 5892ACEF1FF4F9D100E868C2 /* LMJVerticalFlowLayout.h */, + 5892ACE91FF4F9D100E868C2 /* LMJVerticalFlowLayout.m */, 5892ACEB1FF4F9D100E868C2 /* LMJHorizontalFlowLayout.h */, 5892ACE71FF4F9D100E868C2 /* LMJHorizontalFlowLayout.m */, - 5892ACEC1FF4F9D100E868C2 /* LMJNormalRefreshHeader.h */, - 5892ACE61FF4F9D100E868C2 /* LMJNormalRefreshHeader.m */, + 5892ACEE1FF4F9D100E868C2 /* LMJElementsFlowLayout.h */, + 5892ACE41FF4F9D100E868C2 /* LMJElementsFlowLayout.m */, ); path = BaseView; sourceTree = ""; @@ -1569,21 +1499,24 @@ 5892AD611FF5088D00E868C2 /* Helpers */ = { isa = PBXGroup; children = ( - 58926475202DA70D007DA41E /* CalendarReminderManager.h */, - 58926474202DA70D007DA41E /* CalendarReminderManager.m */, - 5892ADA41FF600F700E868C2 /* YYFPSLabel(刷新率) */, 5892AD9A1FF5F04700E868C2 /* 广告页 */, 5892AD8A1FF5E2C000E868C2 /* 欢迎页 */, - 5892AD871FF5D46800E868C2 /* GVUserDefaults+LMJ.h */, - 5892AD881FF5D46800E868C2 /* GVUserDefaults+LMJ.m */, + 583D508620765978001480C8 /* YYFPSLabel.h */, + 583D508520765978001480C8 /* YYFPSLabel.m */, + 583D508220765947001480C8 /* TDTouchID.h */, + 583D508320765948001480C8 /* TDTouchID.m */, + 58926475202DA70D007DA41E /* LMJEventTool.h */, + 58926474202DA70D007DA41E /* LMJEventTool.m */, 5892ADAD1FF60A8300E868C2 /* JXTAlertController.h */, 5892ADAE1FF60A8300E868C2 /* JXTAlertController.m */, - 5892ADA81FF603AD00E868C2 /* LMJUMengHelper.h */, - 5892ADA91FF603AD00E868C2 /* LMJUMengHelper.m */, + 58A858A4207C934E0063DE98 /* PresentAnimator.h */, + 58A858A5207C934E0063DE98 /* PresentAnimator.m */, 584038111FF63617002A0566 /* LMJEasyBlankPageView.h */, 584038121FF63617002A0566 /* LMJEasyBlankPageView.m */, 58DC85321FFCA30C0060DC03 /* UIImageView+FitNet.h */, 58DC85311FFCA30B0060DC03 /* UIImageView+FitNet.m */, + 5892ADA81FF603AD00E868C2 /* LMJUMengHelper.h */, + 5892ADA91FF603AD00E868C2 /* LMJUMengHelper.m */, ); path = Helpers; sourceTree = ""; @@ -1641,19 +1574,23 @@ path = "广告页"; sourceTree = ""; }; - 5892ADA41FF600F700E868C2 /* YYFPSLabel(刷新率) */ = { + 58988892206B34BE00BDAACD /* RSATools */ = { isa = PBXGroup; children = ( - 5892ADA51FF600F700E868C2 /* YYFPSLabel.h */, - 5892ADA61FF600F700E868C2 /* YYFPSLabel.m */, + 5898889E206B34BE00BDAACD /* DES3Encryptor.h */, + 58988894206B34BE00BDAACD /* DES3Encryptor.m */, + 58988893206B34BE00BDAACD /* RSAEncryptor.h */, + 5898889C206B34BE00BDAACD /* RSAEncryptor.m */, + 5898889D206B34BE00BDAACD /* EncryptorTool.h */, + 58988895206B34BE00BDAACD /* EncryptorTool.m */, ); - path = "YYFPSLabel(刷新率)"; + path = RSATools; sourceTree = ""; }; 589B56701FFFC52F00B2D5A8 /* QQ音乐 */ = { isa = PBXGroup; children = ( - 589B56711FFFC52F00B2D5A8 /* QQResources */, + 585A22F42081FD1E001BD3AD /* QQResources.bundle */, 589B569E1FFFC52F00B2D5A8 /* Other */, 589B56A41FFFC52F00B2D5A8 /* Controller */, 589B56AC1FFFC52F00B2D5A8 /* Model */, @@ -1664,85 +1601,11 @@ path = "QQ音乐"; sourceTree = ""; }; - 589B56711FFFC52F00B2D5A8 /* QQResources */ = { - isa = PBXGroup; - children = ( - 589B56721FFFC52F00B2D5A8 /* Lrcs */, - 589B567D1FFFC52F00B2D5A8 /* Images */, - 589B56921FFFC52F00B2D5A8 /* MP3s */, - 589B569D1FFFC52F00B2D5A8 /* Musics.plist */, - ); - path = QQResources; - sourceTree = ""; - }; - 589B56721FFFC52F00B2D5A8 /* Lrcs */ = { - isa = PBXGroup; - children = ( - 589B56731FFFC52F00B2D5A8 /* 月半小夜曲.lrc */, - 589B56741FFFC52F00B2D5A8 /* 255319.lrc */, - 589B56751FFFC52F00B2D5A8 /* 14945107.lrc */, - 589B56761FFFC52F00B2D5A8 /* 10736444.lrc */, - 589B56771FFFC52F00B2D5A8 /* 309769.lrc */, - 589B56781FFFC52F00B2D5A8 /* 235319.lrc */, - 589B56791FFFC52F00B2D5A8 /* 12309111.lrc */, - 589B567A1FFFC52F00B2D5A8 /* 339744.lrc */, - 589B567B1FFFC52F00B2D5A8 /* 10405520.lrc */, - 589B567C1FFFC52F00B2D5A8 /* 120125029.lrc */, - ); - path = Lrcs; - sourceTree = ""; - }; - 589B567D1FFFC52F00B2D5A8 /* Images */ = { - isa = PBXGroup; - children = ( - 589B567E1FFFC52F00B2D5A8 /* wf@2x.jpg */, - 589B567F1FFFC52F00B2D5A8 /* jay@2x.jpg */, - 589B56801FFFC52F00B2D5A8 /* lkq_icon@2x.jpg */, - 589B56811FFFC52F00B2D5A8 /* jay_icon@2x.png */, - 589B56821FFFC52F00B2D5A8 /* dzq_icon@2x.jpg */, - 589B56831FFFC52F00B2D5A8 /* zxy@2x.jpg */, - 589B56841FFFC52F00B2D5A8 /* kzxd_icon@2x.jpg */, - 589B56851FFFC52F00B2D5A8 /* dzq@2x.jpg */, - 589B56861FFFC52F00B2D5A8 /* jj@2x.jpg */, - 589B56871FFFC52F00B2D5A8 /* lkq@2x.jpg */, - 589B56881FFFC52F00B2D5A8 /* wf_icon@2x.jpg */, - 589B56891FFFC52F00B2D5A8 /* eason_icon@2x.jpg */, - 589B568A1FFFC52F00B2D5A8 /* kzxd@2x.jpg */, - 589B568B1FFFC52F00B2D5A8 /* bb@2x.jpg */, - 589B568C1FFFC52F00B2D5A8 /* eason@2x.jpg */, - 589B568D1FFFC52F00B2D5A8 /* jj_icon@2x.png */, - 589B568E1FFFC52F00B2D5A8 /* nanquan@2x.jpg */, - 589B568F1FFFC52F00B2D5A8 /* bb_icon@2x.jpg */, - 589B56901FFFC52F00B2D5A8 /* zxy_icon@2x.jpg */, - 589B56911FFFC52F00B2D5A8 /* nanquan_icon@2x.jpg */, - ); - path = Images; - sourceTree = ""; - }; - 589B56921FFFC52F00B2D5A8 /* MP3s */ = { - isa = PBXGroup; - children = ( - 589B56931FFFC52F00B2D5A8 /* 14945107.mp3 */, - 589B56941FFFC52F00B2D5A8 /* 255319.mp3 */, - 589B56951FFFC52F00B2D5A8 /* 235319.mp3 */, - 589B56961FFFC52F00B2D5A8 /* 309769.mp3 */, - 589B56971FFFC52F00B2D5A8 /* 10736444.mp3 */, - 589B56981FFFC52F00B2D5A8 /* 1201111234.mp3 */, - 589B56991FFFC52F00B2D5A8 /* 10405520.mp3 */, - 589B569A1FFFC52F00B2D5A8 /* 120125029.mp3 */, - 589B569B1FFFC52F00B2D5A8 /* 12309111.mp3 */, - 589B569C1FFFC52F00B2D5A8 /* 339744.mp3 */, - ); - path = MP3s; - sourceTree = ""; - }; 589B569E1FFFC52F00B2D5A8 /* Other */ = { isa = PBXGroup; children = ( 589B569F1FFFC52F00B2D5A8 /* CALayer+MUSAmi.h */, 589B56A21FFFC52F00B2D5A8 /* CALayer+MUSAmi.m */, - 589B56A01FFFC52F00B2D5A8 /* MUSAnimationTool.h */, - 589B56A31FFFC52F00B2D5A8 /* MUSAnimationTool.m */, ); path = Other; sourceTree = ""; @@ -1817,6 +1680,7 @@ 589B570C2000339700B2D5A8 /* 视频播放 */ = { isa = PBXGroup; children = ( + 585FC1D0208DAAC0003174A7 /* Tool */, 589B573D2000339700B2D5A8 /* Controller */, 589B57482000339700B2D5A8 /* Model */, 589B574F2000339700B2D5A8 /* View */, @@ -1829,16 +1693,15 @@ children = ( 58AE5CF320103BA3003BD369 /* VIDMoviePlayerViewController.h */, 58AE5CF420103BA3003BD369 /* VIDMoviePlayerViewController.m */, - 589B57432000339700B2D5A8 /* VIDTabBarController.h */, - 589B573E2000339700B2D5A8 /* VIDTabBarController.m */, - 589B57442000339700B2D5A8 /* VIDNetListViewController.h */, - 589B573F2000339700B2D5A8 /* VIDNetListViewController.m */, - 589B57452000339700B2D5A8 /* VIDTableViewController.h */, - 589B57402000339700B2D5A8 /* VIDTableViewController.m */, - 589B57472000339700B2D5A8 /* VIDCollectionViewController.h */, - 589B57412000339700B2D5A8 /* VIDCollectionViewController.m */, - 589B57422000339700B2D5A8 /* VIDLocalViewController.h */, - 589B57462000339700B2D5A8 /* VIDLocalViewController.m */, + 58C51F8C208C2EF100EECAAA /* VIDListViewController.h */, + 58C51F8D208C2EF100EECAAA /* VIDListViewController.m */, + 585FC1D4208DACC1003174A7 /* VIDTableViewController.h */, + 585FC1D5208DACC1003174A7 /* VIDTableViewController.m */, + 585FC1D7208DB9CD003174A7 /* VIDCollectionViewController.h */, + 585FC1D8208DB9CD003174A7 /* VIDCollectionViewController.m */, + 585FC1DA208DBD95003174A7 /* VIDDownLoadViewController.h */, + 585FC1DB208DBD95003174A7 /* VIDDownLoadViewController.m */, + 58C51F8A208C221500EECAAA /* VideoDemo.storyboard */, ); path = Controller; sourceTree = ""; @@ -1846,11 +1709,6 @@ 589B57482000339700B2D5A8 /* Model */ = { isa = PBXGroup; children = ( - 589B57492000339700B2D5A8 /* ZFVideoModel.h */, - 589B574E2000339700B2D5A8 /* ZFVideoModel.m */, - 589B574A2000339700B2D5A8 /* videoData.json */, - 589B574D2000339700B2D5A8 /* ZFVideoResolution.h */, - 589B574B2000339700B2D5A8 /* ZFVideoResolution.m */, ); path = Model; sourceTree = ""; @@ -1858,18 +1716,10 @@ 589B574F2000339700B2D5A8 /* View */ = { isa = PBXGroup; children = ( - 589B57562000339800B2D5A8 /* VIDTableViewVideoCell.h */, - 589B57502000339700B2D5A8 /* VIDTableViewVideoCell.m */, - 589B57552000339800B2D5A8 /* VIDTableViewVideoCell.xib */, - 589B575C2000339800B2D5A8 /* VIDVideoDownloadedCell.h */, - 589B57512000339800B2D5A8 /* VIDVideoDownloadedCell.m */, - 589B57582000339800B2D5A8 /* VIDVideoDownloadedCell.xib */, - 589B57522000339800B2D5A8 /* VIDVideoDownloadingCell.h */, - 589B575B2000339800B2D5A8 /* VIDVideoDownloadingCell.m */, - 589B57572000339800B2D5A8 /* VIDVideoDownloadingCell.xib */, - 589B57532000339800B2D5A8 /* VIDCollectionViewVideoCell.h */, - 589B57592000339800B2D5A8 /* VIDCollectionViewVideoCell.m */, - 589B575A2000339800B2D5A8 /* VIDCollectionViewVideoCell.xib */, + 585FC1DD208DC1CF003174A7 /* VIDDownLoadedCell.h */, + 585FC1DE208DC1CF003174A7 /* VIDDownLoadedCell.m */, + 585FC1E0208DC6B2003174A7 /* VIDDownLoadingCell.h */, + 585FC1E1208DC6B2003174A7 /* VIDDownLoadingCell.m */, ); path = View; sourceTree = ""; @@ -1877,8 +1727,6 @@ 58DC81431FFA07710060DC03 /* Preview3 */ = { isa = PBXGroup; children = ( - 58DC816A1FFA0A470060DC03 /* LMJTableSDWebImageViewController.h */, - 58DC816B1FFA0A480060DC03 /* LMJTableSDWebImageViewController.m */, 58DC81701FFA29DF0060DC03 /* LMJDragTableViewController.h */, 58DC81711FFA29E00060DC03 /* LMJDragTableViewController.m */, 58DC81771FFA2CF90060DC03 /* LMJCalendarViewController.h */, @@ -1893,6 +1741,15 @@ 5822335020187F270008251F /* LMJVFLLayoutViewController.m */, 581A3E2A2044434400AF08C0 /* LMJOfflineDownloadViewController.h */, 581A3E2B2044434400AF08C0 /* LMJOfflineDownloadViewController.m */, + 588CCD80205DF7860067E3C4 /* LMJCuteFlowLayoutViewController.h */, + 588CCD81205DF7860067E3C4 /* LMJCuteFlowLayoutViewController.m */, + 58A043D7206B28A1003CB4E5 /* LMJRSAViewController.h */, + 58A043D8206B28A1003CB4E5 /* LMJRSAViewController.m */, + 58E02EE9209D8A23005431BA /* LMJUniversalLinkViewController.h */, + 58E02EEA209D8A23005431BA /* LMJUniversalLinkViewController.m */, + 58E02EEC209D8B9E005431BA /* Ohter */, + 58988892206B34BE00BDAACD /* RSATools */, + 58A043DA206B2E1D003CB4E5 /* RSA证书 */, 581A3E2D2044448700AF08C0 /* Toos */, 58DC81441FFA07710060DC03 /* Model */, 58DC81451FFA07710060DC03 /* View */, @@ -1912,6 +1769,12 @@ 58DC81451FFA07710060DC03 /* View */ = { isa = PBXGroup; children = ( + 588CCD83205DF92D0067E3C4 /* LMJCircleLayout.h */, + 588CCD87205DF92F0067E3C4 /* LMJCircleLayout.m */, + 588CCD88205DF92F0067E3C4 /* LMJGirdLayout.h */, + 588CCD86205DF92E0067E3C4 /* LMJGirdLayout.m */, + 588CCD84205DF92E0067E3C4 /* LMJLineFlowLayout.h */, + 588CCD85205DF92E0067E3C4 /* LMJLineFlowLayout.m */, 58DC81851FFA317A0060DC03 /* LMJExpandHeader.h */, 58DC81881FFA317B0060DC03 /* LMJExpandHeader.m */, 58DC81861FFA317A0060DC03 /* LMJExpandImageView.h */, @@ -1933,7 +1796,7 @@ path = "物理仿真"; sourceTree = ""; }; - 58DC82AB1FFB40A60060DC03 /* 绘图 */ = { + 58DC82AB1FFB40A60060DC03 /* 绘图和手势 */ = { isa = PBXGroup; children = ( 58DC83961FFB43DC0060DC03 /* LMJDrawRectViewController.h */, @@ -1942,7 +1805,7 @@ 58DC83921FFB439A0060DC03 /* Model */, 58DC83931FFB439A0060DC03 /* View */, ); - path = "绘图"; + path = "绘图和手势"; sourceTree = ""; }; 58DC82AE1FFB40A60060DC03 /* 核心动画 */ = { @@ -2114,8 +1977,6 @@ 58DC840E1FFBC1980060DC03 /* LMJLiftCycleViewController.m */, 58DC84081FFBC1960060DC03 /* LMJRunTimeViewController.h */, 58DC84111FFBC1980060DC03 /* LMJRunTimeViewController.m */, - 58DC84421FFBDC710060DC03 /* LMJProtocolViewController.h */, - 58DC84431FFBDC710060DC03 /* LMJProtocolViewController.m */, 58DC84451FFBDC8A0060DC03 /* LMJBlockLoopViewController.h */, 58DC84461FFBDC8A0060DC03 /* LMJBlockLoopViewController.m */, 58DC84531FFBDDC40060DC03 /* LMJChildBlockViewController.h */, @@ -2132,6 +1993,8 @@ 58926466202C54C2007DA41E /* LMJRunLoopViewController.m */, 58DC843C1FFBD1290060DC03 /* LMJLockViewController.h */, 58DC843B1FFBD1280060DC03 /* LMJLockViewController.m */, + 58A858482078760A0063DE98 /* LMJWebImagesCacheViewController.h */, + 58A858492078760A0063DE98 /* LMJWebImagesCacheViewController.m */, 58926468202D6645007DA41E /* Other */, 58DC84051FFBC1770060DC03 /* Model */, 58DC84041FFBC1770060DC03 /* View */, @@ -2144,6 +2007,9 @@ children = ( 58DC84271FFBC3250060DC03 /* UIButton+LMJBlock.h */, 58DC84281FFBC3250060DC03 /* UIButton+LMJBlock.m */, + 58A8584B207878430063DE98 /* LMJWebImageCacheCell.h */, + 58A8584C207878430063DE98 /* LMJWebImageCacheCell.m */, + 58A8584D207878430063DE98 /* LMJWebImageCacheCell.xib */, ); path = View; sourceTree = ""; @@ -2151,19 +2017,10 @@ 58DC84051FFBC1770060DC03 /* Model */ = { isa = PBXGroup; children = ( - 58DC844B1FFBDD5B0060DC03 /* LMJDataBaseConnectionProtocol.h */, - 58DC844F1FFBDD5C0060DC03 /* LMJOraceDataBase.h */, - 58DC844C1FFBDD5B0060DC03 /* LMJOraceDataBase.m */, - 58DC844D1FFBDD5B0060DC03 /* LMJUsertProtocol.h */, - 58DC844E1FFBDD5C0060DC03 /* LMJUsertProtocol.m */, - 58DC842B1FFBC3E10060DC03 /* LMJRunTimeTest.h */, - 58DC842A1FFBC3E10060DC03 /* LMJRunTimeTest.m */, - 58DC842D1FFBC4270060DC03 /* LMJRunTimeTest+LMJWork.h */, - 58DC842E1FFBC4270060DC03 /* LMJRunTimeTest+LMJWork.m */, - 58DC84301FFBC44B0060DC03 /* LMJRunTimeTest+LMJMethod.h */, - 58DC84311FFBC44B0060DC03 /* LMJRunTimeTest+LMJMethod.m */, 58DC84551FFBE0440060DC03 /* LMJBlockLoopOperation.h */, 58DC84561FFBE0440060DC03 /* LMJBlockLoopOperation.m */, + 58A858502078842B0063DE98 /* LMJStudent.h */, + 58A858512078842B0063DE98 /* LMJStudent.m */, ); path = Model; sourceTree = ""; @@ -2186,9 +2043,7 @@ isa = PBXGroup; children = ( 58DC84711FFC97280060DC03 /* Other */, - 58DC84791FFC97280060DC03 /* Vitamio */, 58DC848B1FFC97280060DC03 /* Controller */, - 58DC84A71FFC97290060DC03 /* NJPlayer */, 58DC84B01FFC97290060DC03 /* Model */, 58DC84C21FFC97290060DC03 /* View */, 58DC84E21FFC97290060DC03 /* Service */, @@ -2201,8 +2056,6 @@ children = ( 58DC84721FFC97280060DC03 /* BSJ.h */, 58DC84761FFC97280060DC03 /* BSJ.m */, - 58DC84771FFC97280060DC03 /* MenuPopOverView.h */, - 58DC84741FFC97280060DC03 /* MenuPopOverView.m */, 58926424201B622B007DA41E /* BSJSQLiteManager.h */, 58926425201B622B007DA41E /* BSJSQLiteManager.m */, 58926427201B64D3007DA41E /* BSJTopicListDAL.h */, @@ -2211,44 +2064,6 @@ path = Other; sourceTree = ""; }; - 58DC84791FFC97280060DC03 /* Vitamio */ = { - isa = PBXGroup; - children = ( - 58DC847A1FFC97280060DC03 /* libopenssl.a */, - 58DC847C1FFC97280060DC03 /* libVitamio.a */, - 58DC847D1FFC97280060DC03 /* LICENSE */, - 58DC847E1FFC97280060DC03 /* CHANGELOG.md */, - 58DC847F1FFC97280060DC03 /* include */, - 58DC84891FFC97280060DC03 /* libffmpeg.a */, - 58DC848A1FFC97280060DC03 /* NJVitamioViewController.h */, - 58DC847B1FFC97280060DC03 /* NJVitamioViewController.m */, - ); - path = Vitamio; - sourceTree = ""; - }; - 58DC847F1FFC97280060DC03 /* include */ = { - isa = PBXGroup; - children = ( - 58DC84801FFC97280060DC03 /* Vitamio */, - ); - path = include; - sourceTree = ""; - }; - 58DC84801FFC97280060DC03 /* Vitamio */ = { - isa = PBXGroup; - children = ( - 58DC84811FFC97280060DC03 /* VPlayerManageDef.h */, - 58DC84821FFC97280060DC03 /* VMediaPlayer.h */, - 58DC84831FFC97280060DC03 /* Vitamio.h */, - 58DC84841FFC97280060DC03 /* VDefines.h */, - 58DC84851FFC97280060DC03 /* VMediaPlayerDelegate.h */, - 58DC84861FFC97280060DC03 /* VMediaExtracter.h */, - 58DC84871FFC97280060DC03 /* VSingleton.h */, - 58DC84881FFC97280060DC03 /* VMediaExtracterDef.h */, - ); - path = Vitamio; - sourceTree = ""; - }; 58DC848B1FFC97280060DC03 /* Controller */ = { isa = PBXGroup; children = ( @@ -2256,13 +2071,13 @@ 58DC849A1FFC97290060DC03 /* BSJTabBarController.m */, 58DC84A01FFC97290060DC03 /* BSJEssenceViewController.h */, 58DC84931FFC97280060DC03 /* BSJEssenceViewController.m */, + 58DC849C1FFC97290060DC03 /* BSJNewViewController.h */, + 58DC848F1FFC97280060DC03 /* BSJNewViewController.m */, 58DC84971FFC97280060DC03 /* BSJTopicViewController.h */, 58DC84A31FFC97290060DC03 /* BSJTopicViewController.m */, 58DC848C1FFC97280060DC03 /* BSJCommentPageViewController.h */, 58DC849E1FFC97290060DC03 /* BSJCommentPageViewController.m */, 58DC84A21FFC97290060DC03 /* BSJCommentPageViewController.xib */, - 58DC849C1FFC97290060DC03 /* BSJNewViewController.h */, - 58DC848F1FFC97280060DC03 /* BSJNewViewController.m */, 58DC849B1FFC97290060DC03 /* BSJTrendViewController.h */, 58DC84901FFC97280060DC03 /* BSJTrendViewController.m */, 58DC84941FFC97280060DC03 /* BSJTrendViewController.xib */, @@ -2283,21 +2098,6 @@ path = Controller; sourceTree = ""; }; - 58DC84A71FFC97290060DC03 /* NJPlayer */ = { - isa = PBXGroup; - children = ( - 58DC84A81FFC97290060DC03 /* NJPlayerView.h */, - 58DC84AC1FFC97290060DC03 /* NJPlayerView.m */, - 58DC84A91FFC97290060DC03 /* NJPlayerView.xib */, - 58DC84AE1FFC97290060DC03 /* NJPlayer.bundle */, - 58DC84AB1FFC97290060DC03 /* NJAVPlayerViewController.h */, - 58DC84AF1FFC97290060DC03 /* NJAVPlayerViewController.m */, - 58DC84AA1FFC97290060DC03 /* NJVideoPlayViewController.h */, - 58DC84AD1FFC97290060DC03 /* NJVideoPlayViewController.m */, - ); - path = NJPlayer; - sourceTree = ""; - }; 58DC84B01FFC97290060DC03 /* Model */ = { isa = PBXGroup; children = ( @@ -2329,31 +2129,31 @@ 58DC84CF1FFC97290060DC03 /* BSJGuidePushView.xib */, 58DC84DE1FFC97290060DC03 /* BSJTabBar.h */, 58DC84CA1FFC97290060DC03 /* BSJTabBar.m */, - 58DC84DC1FFC97290060DC03 /* BSJRecommendUserCell.h */, - 58DC84CC1FFC97290060DC03 /* BSJRecommendUserCell.m */, - 58DC84C61FFC97290060DC03 /* BSJRecommendUserCell.xib */, 58DC84D51FFC97290060DC03 /* BSJReommmendCategoryCell.h */, 58DC84C41FFC97290060DC03 /* BSJReommmendCategoryCell.m */, 58DC84DB1FFC97290060DC03 /* BSJReommmendCategoryCell.xib */, + 58DC84DC1FFC97290060DC03 /* BSJRecommendUserCell.h */, + 58DC84CC1FFC97290060DC03 /* BSJRecommendUserCell.m */, + 58DC84C61FFC97290060DC03 /* BSJRecommendUserCell.xib */, 58DC84D61FFC97290060DC03 /* BSJTopicCell.h */, 58DC84C31FFC97290060DC03 /* BSJTopicCell.m */, 58DC84D11FFC97290060DC03 /* BSJTopicCell.xib */, - 58DC84D41FFC97290060DC03 /* BSJTopicCmtCell.h */, - 58DC84C51FFC97290060DC03 /* BSJTopicCmtCell.m */, - 58DC84D81FFC97290060DC03 /* BSJTopicCmtCell.xib */, 58DC84C81FFC97290060DC03 /* BSJTopicPictureView.h */, 58DC84D71FFC97290060DC03 /* BSJTopicPictureView.m */, 58DC84DD1FFC97290060DC03 /* BSJTopicVoiceView.h */, 58DC84CB1FFC97290060DC03 /* BSJTopicVoiceView.m */, 58DC84E11FFC97290060DC03 /* BSJTopicVideoView.h */, 58DC84D01FFC97290060DC03 /* BSJTopicVideoView.m */, - 58DC84C71FFC97290060DC03 /* BSJMeSquareCell.xib */, + 58DC84D41FFC97290060DC03 /* BSJTopicCmtCell.h */, + 58DC84C51FFC97290060DC03 /* BSJTopicCmtCell.m */, + 58DC84D81FFC97290060DC03 /* BSJTopicCmtCell.xib */, + 58DC852B1FFC9B710060DC03 /* LMJCommentHeaderView.h */, + 58DC852C1FFC9B720060DC03 /* LMJCommentHeaderView.m */, 58DC84C91FFC97290060DC03 /* BSJWordToolBar.h */, 58DC84DF1FFC97290060DC03 /* BSJWordToolBar.m */, 58DC84DA1FFC97290060DC03 /* BSJMeSquareCell.h */, 58DC84CD1FFC97290060DC03 /* BSJMeSquareCell.m */, - 58DC852B1FFC9B710060DC03 /* LMJCommentHeaderView.h */, - 58DC852C1FFC9B720060DC03 /* LMJCommentHeaderView.m */, + 58DC84C71FFC97290060DC03 /* BSJMeSquareCell.xib */, 58DC84D91FFC97290060DC03 /* BSJHlightedTextField.h */, 58DC84CE1FFC97290060DC03 /* BSJHlightedTextField.m */, ); @@ -2373,13 +2173,20 @@ path = Service; sourceTree = ""; }; + 58E02EEC209D8B9E005431BA /* Ohter */ = { + isa = PBXGroup; + children = ( + 58E02EED209D8BA4005431BA /* LMJUniversalLink.html */, + ); + path = Ohter; + sourceTree = ""; + }; 8FC3A5937CA448C8AE6DDE55 /* Frameworks */ = { isa = PBXGroup; children = ( + 58B36C6120ABF3C700915868 /* AudioToolbox.framework */, 58DC88CF1FFDEF020060DC03 /* libiconv.2.4.0.tbd */, 58DC88CD1FFDEEF70060DC03 /* libbz2.1.0.tbd */, - 584038011FF61D1A002A0566 /* AudioToolbox.framework */, - 584037FF1FF61D00002A0566 /* MapKit.framework */, 195AF1DB9976AB51691A659C /* libPods-iOSProject.a */, ); name = Frameworks; @@ -2405,7 +2212,6 @@ 5892AC901FF4EB4A00E868C2 /* Sources */, 5892AC911FF4EB4A00E868C2 /* Frameworks */, 5892AC921FF4EB4A00E868C2 /* Resources */, - 292B97192B076A5663471444 /* [CP] Embed Pods Frameworks */, 724B91FDA62E00160E89D10A /* [CP] Copy Pods Resources */, ); buildRules = ( @@ -2423,14 +2229,17 @@ 5892AC8C1FF4EB4A00E868C2 /* Project object */ = { isa = PBXProject; attributes = { - CLASSPREFIX = MC; - LastUpgradeCheck = 0920; + CLASSPREFIX = VID; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = github.com/njhu; TargetAttributes = { 5892AC931FF4EB4A00E868C2 = { CreatedOnToolsVersion = 9.2; ProvisioningStyle = Automatic; SystemCapabilities = { + com.apple.BackgroundModes = { + enabled = 0; + }; com.apple.InterAppAudio = { enabled = 1; }; @@ -2438,10 +2247,10 @@ enabled = 1; }; com.apple.Maps.iOS = { - enabled = 1; + enabled = 0; }; com.apple.Push = { - enabled = 0; + enabled = 1; }; com.apple.SafariKeychain = { enabled = 1; @@ -2473,97 +2282,53 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 589B56CF1FFFC52F00B2D5A8 /* 10736444.lrc in Resources */, + 58A8584F207878430063DE98 /* LMJWebImageCacheCell.xib in Resources */, 58DC83821FFB43460060DC03 /* LMJLZDHDTSViewController.xib in Resources */, + 585A22FE2082FA28001BD3AD /* JSBridge_js in Resources */, + 58C51F8B208C221500EECAAA /* VideoDemo.storyboard in Resources */, 58DC83CF1FFB43E30060DC03 /* LMJDotRemoveViewController.xib in Resources */, - 589B56EB1FFFC52F00B2D5A8 /* 255319.mp3 in Resources */, 5892ACBE1FF4EF4500E868C2 /* Public.xcassets in Resources */, - 589B56E31FFFC52F00B2D5A8 /* bb@2x.jpg in Resources */, 58DC83831FFB43460060DC03 /* LMJLZDHDTViewController.xib in Resources */, 58DC83CB1FFB43E30060DC03 /* LMJPiesViewController.xib in Resources */, 58DC83C71FFB43E30060DC03 /* LMJDrawBoardViewController.xib in Resources */, - 589B56E81FFFC52F00B2D5A8 /* zxy_icon@2x.jpg in Resources */, + 58A043DB206B2E1E003CB4E5 /* RSA证书 in Resources */, 58651AB81FFE6D6F0087419D /* SINStatusToolBarView.xib in Resources */, 5892ACBB1FF4EF4500E868C2 /* Sina.xcassets in Resources */, 58DC83F71FFB478E0060DC03 /* CATransition3.png in Resources */, - 589B57842000339800B2D5A8 /* VIDCollectionViewVideoCell.xib in Resources */, - 5892ACBC1FF4EF4500E868C2 /* WXIM.xcassets in Resources */, 58DC851D1FFC972C0060DC03 /* BSJGuidePushView.xib in Resources */, - 589B57822000339800B2D5A8 /* VIDVideoDownloadedCell.xib in Resources */, + 58E02EEE209D8BA4005431BA /* LMJUniversalLink.html in Resources */, 58DC846A1FFC94B30060DC03 /* team_dictionary.plist in Resources */, - 589B56EC1FFFC52F00B2D5A8 /* 235319.mp3 in Resources */, 5892ACB91FF4EF4500E868C2 /* Preview.xcassets in Resources */, 5892ACBA1FF4EF4500E868C2 /* QQMusic.xcassets in Resources */, - 589B56E11FFFC52F00B2D5A8 /* eason_icon@2x.jpg in Resources */, - 589B56D11FFFC52F00B2D5A8 /* 235319.lrc in Resources */, - 589B56CE1FFFC52F00B2D5A8 /* 14945107.lrc in Resources */, - 589B56D41FFFC52F00B2D5A8 /* 10405520.lrc in Resources */, 58A17C542007112A00B350AB /* intro_3.jpg in Resources */, - 589B56DF1FFFC52F00B2D5A8 /* lkq@2x.jpg in Resources */, 58DC85001FFC972C0060DC03 /* BSJCommentPageViewController.xib in Resources */, - 589B57812000339800B2D5A8 /* VIDVideoDownloadingCell.xib in Resources */, - 589B56ED1FFFC52F00B2D5A8 /* 309769.mp3 in Resources */, 58DC851F1FFC972C0060DC03 /* BSJTopicCell.xib in Resources */, 589B57041FFFC52F00B2D5A8 /* QQLrcCell.xib in Resources */, - 589B57792000339800B2D5A8 /* videoData.json in Resources */, - 589B56CC1FFFC52F00B2D5A8 /* 月半小夜曲.lrc in Resources */, - 589B56CD1FFFC52F00B2D5A8 /* 255319.lrc in Resources */, - 589B56D01FFFC52F00B2D5A8 /* 309769.lrc in Resources */, - 589B56F41FFFC52F00B2D5A8 /* Musics.plist in Resources */, - 589B56D31FFFC52F00B2D5A8 /* 339744.lrc in Resources */, - 58DC84F41FFC972C0060DC03 /* CHANGELOG.md in Resources */, + 583D507020731574001480C8 /* LMJLocalJsons in Resources */, 58DC83871FFB43460060DC03 /* LMJDYViewController.xib in Resources */, - 589B56F01FFFC52F00B2D5A8 /* 10405520.mp3 in Resources */, - 589B56E61FFFC52F00B2D5A8 /* nanquan@2x.jpg in Resources */, - 589B56EF1FFFC52F00B2D5A8 /* 1201111234.mp3 in Resources */, 58DC83F31FFB47710060DC03 /* 钟表.png in Resources */, 58DC83F81FFB478E0060DC03 /* CATransition1.png in Resources */, - 589B56E41FFFC52F00B2D5A8 /* eason@2x.jpg in Resources */, 58DC83C81FFB43E30060DC03 /* LMJPicClipViewController.xib in Resources */, 58A17C532007112A00B350AB /* intro_2.jpg in Resources */, - 589B56F31FFFC52F00B2D5A8 /* 339744.mp3 in Resources */, 58A17C562007112A00B350AB /* intro_1.jpg in Resources */, 584038801FF9F128002A0566 /* LMJH5_OCViewController.html in Resources */, - 589B56E91FFFC52F00B2D5A8 /* nanquan_icon@2x.jpg in Resources */, - 589B56D91FFFC52F00B2D5A8 /* jay_icon@2x.png in Resources */, - 589B56D61FFFC52F00B2D5A8 /* wf@2x.jpg in Resources */, 58DC84F61FFC972C0060DC03 /* BSJLoginRegisterViewController.xib in Resources */, 58DC83ED1FFB472B0060DC03 /* 卡哇伊.jpg in Resources */, 58DC84FB1FFC972C0060DC03 /* BSJTrendViewController.xib in Resources */, 58DC83F21FFB47710060DC03 /* 雪花.png in Resources */, 58DC85171FFC972C0060DC03 /* BSJMeSquareCell.xib in Resources */, - 589B57802000339800B2D5A8 /* VIDTableViewVideoCell.xib in Resources */, - 589B56DC1FFFC52F00B2D5A8 /* kzxd_icon@2x.jpg in Resources */, 58DC85161FFC972C0060DC03 /* BSJRecommendUserCell.xib in Resources */, - 589B56DA1FFFC52F00B2D5A8 /* dzq_icon@2x.jpg in Resources */, - 589B56F21FFFC52F00B2D5A8 /* 12309111.mp3 in Resources */, - 589B56EE1FFFC52F00B2D5A8 /* 10736444.mp3 in Resources */, 5892ACA11FF4EB4A00E868C2 /* Assets.xcassets in Resources */, 58DC85241FFC972C0060DC03 /* BSJReommmendCategoryCell.xib in Resources */, - 589B56E71FFFC52F00B2D5A8 /* bb_icon@2x.jpg in Resources */, - 58DC85051FFC972C0060DC03 /* NJPlayerView.xib in Resources */, - 589B56D51FFFC52F00B2D5A8 /* 120125029.lrc in Resources */, - 58DC85081FFC972C0060DC03 /* NJPlayer.bundle in Resources */, - 589B56DE1FFFC52F00B2D5A8 /* jj@2x.jpg in Resources */, 589B56FA1FFFC52F00B2D5A8 /* MUSPlayingViewController.xib in Resources */, 5840385C1FF873A8002A0566 /* LMJAnnotationCustomPopView.xib in Resources */, - 589B56E01FFFC52F00B2D5A8 /* wf_icon@2x.jpg in Resources */, - 589B56E51FFFC52F00B2D5A8 /* jj_icon@2x.png in Resources */, 58651AB31FFE6D6F0087419D /* SINPublishToolBar.xib in Resources */, 5822332120182C5D0008251F /* MCCornersRoundViewController.xib in Resources */, - 589B56DD1FFFC52F00B2D5A8 /* dzq@2x.jpg in Resources */, - 589B56D21FFFC52F00B2D5A8 /* 12309111.lrc in Resources */, - 589B56F11FFFC52F00B2D5A8 /* 120125029.mp3 in Resources */, - 589B56E21FFFC52F00B2D5A8 /* kzxd@2x.jpg in Resources */, 58A17C552007112A00B350AB /* intro_0.jpg in Resources */, 58DC837E1FFB43460060DC03 /* LMJZDTPViewController.xib in Resources */, - 589B56DB1FFFC52F00B2D5A8 /* zxy@2x.jpg in Resources */, - 589B56D81FFFC52F00B2D5A8 /* lkq_icon@2x.jpg in Resources */, - 589B56EA1FFFC52F00B2D5A8 /* 14945107.mp3 in Resources */, - 58DC84F31FFC972C0060DC03 /* LICENSE in Resources */, 584038691FF88594002A0566 /* LMJUpLoadImageCell.xib in Resources */, + 585A22F52081FD1F001BD3AD /* QQResources.bundle in Resources */, 58DC83F11FFB47710060DC03 /* 小新.jpg in Resources */, - 589B56D71FFFC52F00B2D5A8 /* jay@2x.jpg in Resources */, 5892ACBD1FF4EF4500E868C2 /* BSJ.xcassets in Resources */, 58DC85231FFC972C0060DC03 /* BSJTopicCmtCell.xib in Resources */, 5822335620188F6E0008251F /* adm in Resources */, @@ -2575,34 +2340,22 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 292B97192B076A5663471444 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 41121AB272037F621E00CD68 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-iOSProject-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 724B91FDA62E00160E89D10A /* [CP] Copy Pods Resources */ = { @@ -2611,13 +2364,36 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-iOSProject/Pods-iOSProject-resources.sh", + "${PODS_ROOT}/BaiduMapKit/BaiduMapKit/BaiduMapAPI_Map.framework/Resources/mapapi.bundle", + "${PODS_ROOT}/HMQRCodeScanner/HMQRCodeScanner/QRCode/HMScanner.bundle", + "${PODS_ROOT}/MJRefresh/MJRefresh/MJRefresh.bundle", + "${PODS_ROOT}/MOFSPickerManager/MOFSPickerManagerDemo/MOFSPickerManager/province_data.xml", + "${PODS_ROOT}/MOFSPickerManager/MOFSPickerManagerDemo/MOFSPickerManager/province_data.json", + "${PODS_ROOT}/TZImagePickerController/TZImagePickerController/TZImagePickerController/TZImagePickerController.bundle", + "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK/UMSocialSDKPromptResources.bundle", + "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ/QQSDK/TencentOpenApi_IOS_Bundle.bundle", + "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/Sina/SinaSDK/WeiboSDK.bundle", + "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialUI/UMSocialSDKResources.bundle", + "${PODS_ROOT}/ZFPlayer/ZFPlayer/ZFPlayer.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/mapapi.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/HMScanner.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MJRefresh.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/province_data.xml", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/province_data.json", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TZImagePickerController.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/UMSocialSDKPromptResources.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TencentOpenApi_IOS_Bundle.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/WeiboSDK.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/UMSocialSDKResources.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ZFPlayer.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-iOSProject/Pods-iOSProject-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iOSProject/Pods-iOSProject-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -2631,24 +2407,31 @@ 58651AB11FFE6D6F0087419D /* SINStatusToolBarView.m in Sources */, 58DC83E71FFB44380060DC03 /* WPFSnapView.m in Sources */, 5840384D1FF7FBCF002A0566 /* LMJMasonryViewController.m in Sources */, + 58A8584E207878430063DE98 /* LMJWebImageCacheCell.m in Sources */, + 585FC1D6208DACC1003174A7 /* VIDTableViewController.m in Sources */, 58DC85201FFC972C0060DC03 /* BSJGuidePushView.m in Sources */, + 588CCD82205DF7860067E3C4 /* LMJCuteFlowLayoutViewController.m in Sources */, 58651AAC1FFE6D6F0087419D /* SINStatusViewModel.m in Sources */, 589B56FB1FFFC52F00B2D5A8 /* MUSPlayingViewController.m in Sources */, - 589B57852000339800B2D5A8 /* VIDVideoDownloadingCell.m in Sources */, 589B56FF1FFFC52F00B2D5A8 /* QQLrcModel.m in Sources */, 58DC84FD1FFC972C0060DC03 /* BSJTabBarController.m in Sources */, 584038421FF7EC0E002A0566 /* LMJDownLoadFileViewController.m in Sources */, + 588CCD7A205D45DC0067E3C4 /* WKWebViewJsBridge.m in Sources */, 58DC850B1FFC972C0060DC03 /* BSJUser.m in Sources */, 58DC852A1FFC972C0060DC03 /* BSJRecommendSevice.m in Sources */, 5892AD751FF5114A00E868C2 /* LMJMessageViewController.m in Sources */, 5822332020182C5D0008251F /* MCCornersRoundViewController.m in Sources */, 5892AD031FF4F9D200E868C2 /* LMJElementsFlowLayout.m in Sources */, + 585FC1F7209B2FE4003174A7 /* MCStudent+CoreDataClass.m in Sources */, 58DC852D1FFC9B720060DC03 /* LMJCommentHeaderView.m in Sources */, + 588CCD7F205D4FA60067E3C4 /* WKBridgeTool.m in Sources */, 58B59D0A2015B17800C4C4C9 /* LMJCasesViewController.m in Sources */, 58DC818D1FFA335C0060DC03 /* LMJFingerCheckViewController.m in Sources */, + 58A8584A2078760A0063DE98 /* LMJWebImagesCacheViewController.m in Sources */, 58DC83D31FFB43E30060DC03 /* LMJDotRemoveViewController.m in Sources */, 58DC84FF1FFC972C0060DC03 /* BSJCommentPageViewController.m in Sources */, 5892AD5E1FF5079C00E868C2 /* LMJTableViewController.m in Sources */, + 585FC1E5209B0481003174A7 /* MCTestViewController.m in Sources */, 58651AAE1FFE6D6F0087419D /* SINDictURL.m in Sources */, 58DC85031FFC972C0060DC03 /* BSJPublishViewController.m in Sources */, 5822334B20185FB10008251F /* DBSphereView.m in Sources */, @@ -2664,48 +2447,47 @@ 58DC85011FFC972C0060DC03 /* BSJTopicViewController.m in Sources */, 5892ACB21FF4EEB400E868C2 /* LMJAppDelegate.m in Sources */, 58DC83C51FFB43E30060DC03 /* LMJDrawBoardViewController.m in Sources */, - 58926476202DA70E007DA41E /* CalendarReminderManager.m in Sources */, + 58926476202DA70E007DA41E /* LMJEventTool.m in Sources */, 584038381FF7E2BE002A0566 /* LMJVerticalLayoutViewController.m in Sources */, 58DC84541FFBDDC40060DC03 /* LMJChildBlockViewController.m in Sources */, 581A3E2C2044434400AF08C0 /* LMJOfflineDownloadViewController.m in Sources */, + 585FC1E8209B2DF5003174A7 /* MCTestDataModel.xcdatamodeld in Sources */, 584038681FF88594002A0566 /* LMJUpLoadImageCell.m in Sources */, 58651A9E1FFE6D6F0087419D /* SINStatusListDAL.m in Sources */, 58DC84F71FFC972C0060DC03 /* BSJNewViewController.m in Sources */, 58651AA21FFE6D6F0087419D /* SINHomeCategoryViewController.m in Sources */, 58DC85181FFC972C0060DC03 /* BSJTabBar.m in Sources */, 5892AD8D1FF5E2D700E868C2 /* LMJIntroductoryPagesView.m in Sources */, - 58DC85071FFC972C0060DC03 /* NJVideoPlayViewController.m in Sources */, 5892AD071FF4F9D200E868C2 /* LMJAutoRefreshFooter.m in Sources */, 58223317201821C00008251F /* NullSafe.m in Sources */, 58DC84EE1FFC972B0060DC03 /* BSJ.m in Sources */, 581A3E4120450B3E00AF08C0 /* NSString+MJDownload.m in Sources */, 58926429201B64D3007DA41E /* BSJTopicListDAL.m in Sources */, 584038721FF9399B002A0566 /* LMJListTimerCountDownViewController.m in Sources */, + 5898889F206B34BF00BDAACD /* DES3Encryptor.m in Sources */, 5840385D1FF873A8002A0566 /* LMJAnnotationCustomPopView.m in Sources */, 58651AB41FFE6D6F0087419D /* SINUnLoginRegisterView.m in Sources */, 58651ABD1FFE6D6F0087419D /* SINStatusListService.m in Sources */, - 589B57772000339800B2D5A8 /* VIDCollectionViewController.m in Sources */, 58651AA91FFE6D6F0087419D /* SINBroswerViewController.m in Sources */, 5822334520185F790008251F /* MCSphereTagCloudViewController.m in Sources */, - 589B57762000339800B2D5A8 /* VIDTableViewController.m in Sources */, + 588CCD8B205DF92F0067E3C4 /* LMJCircleLayout.m in Sources */, 58DC83D11FFB43E30060DC03 /* LMJClipImageViewController.m in Sources */, 589B56F91FFFC52F00B2D5A8 /* MUSLrcTableViewController.m in Sources */, - 58DC84EC1FFC972B0060DC03 /* MenuPopOverView.m in Sources */, 5892AD591FF5079C00E868C2 /* LMJTextViewController.m in Sources */, 58651AB91FFE6D6F0087419D /* SINTabBar.m in Sources */, 58DC83D81FFB440E0060DC03 /* LMJDynamicViewController.m in Sources */, 5840381F1FF64718002A0566 /* LMJYYTextViewController.m in Sources */, + 585FC1F6209B2FE4003174A7 /* MCStudent+CoreDataProperties.m in Sources */, 5892AD081FF4F9D200E868C2 /* LMJNavigationBar.m in Sources */, 5892AD001FF4F9D200E868C2 /* LMJItemSection.m in Sources */, 589B570B1FFFC53000B2D5A8 /* QQMusicTool.m in Sources */, - 58DC84F11FFC972C0060DC03 /* NJVitamioViewController.m in Sources */, 5892ADAF1FF60A8300E868C2 /* JXTAlertController.m in Sources */, 5892AD051FF4F9D200E868C2 /* LMJHorizontalFlowLayout.m in Sources */, 58DC846B1FFC94B30060DC03 /* LMJTeam.m in Sources */, 58DC846F1FFC967E0060DC03 /* LMJBaseRequest.m in Sources */, + 588CCD8A205DF92F0067E3C4 /* LMJGirdLayout.m in Sources */, 58DC83CC1FFB43E30060DC03 /* LMJJuZhenCaoZuoViewController.m in Sources */, 58DC838E1FFB43460060DC03 /* LMJHDZSQViewController.m in Sources */, - 58DC85061FFC972C0060DC03 /* NJPlayerView.m in Sources */, 58DC84FC1FFC972C0060DC03 /* BSJPictureShowViewController.m in Sources */, 58DC83C91FFB43E30060DC03 /* LMJDrawBaseViewController.m in Sources */, 58DC83C01FFB43E30060DC03 /* LMJDrawLineViewController.m in Sources */, @@ -2717,6 +2499,7 @@ 58651ABA1FFE6D6F0087419D /* SINStatusRetweetView.m in Sources */, 58DC85221FFC972C0060DC03 /* BSJTopicPictureView.m in Sources */, 581A3E3F20450B3E00AF08C0 /* MJDownloadManager.m in Sources */, + 588CCD89205DF92F0067E3C4 /* LMJLineFlowLayout.m in Sources */, 5892AD571FF5079C00E868C2 /* LMJNavigationController.m in Sources */, 5892AD091FF4F9D200E868C2 /* LMJSettingCell.m in Sources */, 58DC818A1FFA317B0060DC03 /* LMJExpandHeader.m in Sources */, @@ -2724,7 +2507,6 @@ 5892AD531FF5079C00E868C2 /* LMJCollectionViewController.m in Sources */, 584038831FF9F2F1002A0566 /* LMJAlertViewsViewController.m in Sources */, 58DC85131FFC972C0060DC03 /* BSJTopicCell.m in Sources */, - 58223313201821910008251F /* UIViewController+DDPopUpViewController.m in Sources */, 58DC837F1FFB43460060DC03 /* LMJYinLZDTViewController.m in Sources */, 58DC825A1FFA7D7C0060DC03 /* LMJXGMVideo.m in Sources */, 58DC84001FFB47ED0060DC03 /* LMJHandleView.m in Sources */, @@ -2733,11 +2515,8 @@ 5892AD651FF5088D00E868C2 /* LMJTabBarController.m in Sources */, 589B56F81FFFC52F00B2D5A8 /* MUSHomeListViewController.m in Sources */, 584038391FF7E2BE002A0566 /* LMJHorizontalLayoutViewController.m in Sources */, - 58DC84441FFBDC720060DC03 /* LMJProtocolViewController.m in Sources */, - 589B57742000339800B2D5A8 /* VIDTabBarController.m in Sources */, 58DC83981FFB43DC0060DC03 /* LMJDrawRectViewController.m in Sources */, 58651AAD1FFE6D6F0087419D /* SINStatus.m in Sources */, - 589B56F71FFFC52F00B2D5A8 /* MUSAnimationTool.m in Sources */, 58DC83D21FFB43E30060DC03 /* LMJPicWordsViewController.m in Sources */, 58DC838A1FFB43460060DC03 /* LMJCAAnimationGroupViewController.m in Sources */, 5892AD841FF517B200E868C2 /* UIButton+LMJ.m in Sources */, @@ -2746,14 +2525,13 @@ 58DC83BF1FFB43E30060DC03 /* LMJScreenShotViewController.m in Sources */, 5840383C1FF7E437002A0566 /* LMJKeyboardHandleViewController.m in Sources */, 5892AD5B1FF5079C00E868C2 /* LMJRequestBaseViewController.m in Sources */, + 583D508720765978001480C8 /* YYFPSLabel.m in Sources */, 5822334E20187D610008251F /* LMJAutoLayoutViewController.m in Sources */, 589B57011FFFC52F00B2D5A8 /* MUSMusicCell.m in Sources */, 58DC84471FFBDC8A0060DC03 /* LMJBlockLoopViewController.m in Sources */, 5840387B1FF9F0FA002A0566 /* LMJH5_OCViewController.m in Sources */, - 5892AD891FF5D46800E868C2 /* GVUserDefaults+LMJ.m in Sources */, 58651AA31FFE6D6F0087419D /* SINDiscoveryViewController.m in Sources */, 58DC83E91FFB44380060DC03 /* WPFCollisionView.m in Sources */, - 58DC842C1FFBC3E10060DC03 /* LMJRunTimeTest.m in Sources */, 589B57021FFFC52F00B2D5A8 /* QQLrcLabel.m in Sources */, 584038601FF875F8002A0566 /* LMJQRCodeViewController.m in Sources */, 5892ADAA1FF603AD00E868C2 /* LMJUMengHelper.m in Sources */, @@ -2763,9 +2541,8 @@ 58DC83811FFB43460060DC03 /* LMJLZDHDTSViewController.m in Sources */, 5892ACA71FF4EB4A00E868C2 /* main.m in Sources */, 58223312201821910008251F /* UIView+GestureCallback.m in Sources */, + 58A043D9206B28A1003CB4E5 /* LMJRSAViewController.m in Sources */, 584038061FF62371002A0566 /* LMJAddressPickerViewController.m in Sources */, - 589B577C2000339800B2D5A8 /* ZFVideoModel.m in Sources */, - 58DC816C1FFA0A480060DC03 /* LMJTableSDWebImageViewController.m in Sources */, 58DC835A1FFB43100060DC03 /* LMJCoreAnimationViewController.m in Sources */, 589B57081FFFC53000B2D5A8 /* QQTimeTool.m in Sources */, 589B57051FFFC53000B2D5A8 /* NeteaseMusicAPI.m in Sources */, @@ -2774,7 +2551,7 @@ 584038091FF629AC002A0566 /* LMJNoNavBarViewController.m in Sources */, 58DC84401FFBD1290060DC03 /* LMJLockViewController.m in Sources */, 58DC84021FFB47ED0060DC03 /* LMJBezierPathCP.m in Sources */, - 589B57752000339800B2D5A8 /* VIDNetListViewController.m in Sources */, + 589888A0206B34BF00BDAACD /* EncryptorTool.m in Sources */, 58DC83861FFB43460060DC03 /* LMJCATransitionViewController.m in Sources */, 58651AB51FFE6D6F0087419D /* SINPublishToolBar.m in Sources */, 5892AD811FF5175A00E868C2 /* UIColor+Random.m in Sources */, @@ -2791,8 +2568,6 @@ 5892AD041FF4F9D200E868C2 /* LMJNormalRefreshHeader.m in Sources */, 58DC83EB1FFB44380060DC03 /* WPFBaseView.m in Sources */, 58DC84411FFBD1290060DC03 /* LMJNSOperationViewController.m in Sources */, - 589B577A2000339800B2D5A8 /* ZFVideoResolution.m in Sources */, - 5892ADA71FF600F700E868C2 /* YYFPSLabel.m in Sources */, 58DC851B1FFC972C0060DC03 /* BSJMeSquareCell.m in Sources */, 58A17C4E2005F4E600B350AB /* LMJParagraph.m in Sources */, 58DC83CE1FFB43E30060DC03 /* LMJPiesViewController.m in Sources */, @@ -2802,58 +2577,58 @@ 58DC85041FFC972C0060DC03 /* BSJRecommendViewController.m in Sources */, 589B56FE1FFFC52F00B2D5A8 /* QQMusicModel.m in Sources */, 58DC81891FFA317B0060DC03 /* LMJExpandImageView.m in Sources */, - 58DC84511FFBDD5C0060DC03 /* LMJUsertProtocol.m in Sources */, 584038191FF64218002A0566 /* LMJBlankPageViewController.m in Sources */, 5892AD681FF508E600E868C2 /* UIView+LMJNjHuFrame.m in Sources */, 58DC85121FFC972C0060DC03 /* BSJTopicTopComent.m in Sources */, 58DC83881FFB43460060DC03 /* LMJCALayerYSDHViewController.m in Sources */, 58DC83C61FFB43E30060DC03 /* LMJDrawProgressViewController.m in Sources */, 58651AA61FFE6D6F0087419D /* SINPublishViewController.m in Sources */, + 585FC1DC208DBD95003174A7 /* VIDDownLoadViewController.m in Sources */, 58223315201821910008251F /* NSDecimalNumber+Addtion.m in Sources */, 58DC85191FFC972C0060DC03 /* BSJTopicVoiceView.m in Sources */, 58DC838F1FFB43460060DC03 /* LMJLZDHDTViewController.m in Sources */, + 585FC1FA209B312E003174A7 /* MCCoreDataManager.m in Sources */, 584038781FF93AA5002A0566 /* LMJCountDownCell.m in Sources */, 58DC85111FFC972C0060DC03 /* BSJMeSquare.m in Sources */, 58DC843E1FFBD1290060DC03 /* LMJNSThreadViewController.m in Sources */, - 589B57832000339800B2D5A8 /* VIDCollectionViewVideoCell.m in Sources */, 58651AAB1FFE6D6F0087419D /* SINBroswerAnimator.m in Sources */, 58DC846C1FFC94B30060DC03 /* LMJGroup.m in Sources */, 5892AD5A1FF5079C00E868C2 /* LMJBaseViewController.m in Sources */, 58DC83C21FFB43E30060DC03 /* LMJDrawStrPicsViewController.m in Sources */, + 588CCD76205D42EE0067E3C4 /* LMJH5JSBridgeViewController.m in Sources */, 5892AD5D1FF5079C00E868C2 /* LMJWebViewController.m in Sources */, - 58DC842F1FFBC4270060DC03 /* LMJRunTimeTest+LMJWork.m in Sources */, 58AE5CF520103BA3003BD369 /* VIDMoviePlayerViewController.m in Sources */, + 585FC1E2208DC6B2003174A7 /* VIDDownLoadingCell.m in Sources */, 58223314201821910008251F /* UITextView+WZB.m in Sources */, 5892ADA01FF5F23D00E868C2 /* AdvertiseHelper.m in Sources */, 58DC85151FFC972C0060DC03 /* BSJTopicCmtCell.m in Sources */, 58DC85271FFC972C0060DC03 /* BSJTopicService.m in Sources */, + 585FC1DF208DC1CF003174A7 /* VIDDownLoadedCell.m in Sources */, 58DC84011FFB47ED0060DC03 /* LMJDrawingView.m in Sources */, 58DC838C1FFB43460060DC03 /* LMJCAKeyFrameAnimationViewController.m in Sources */, 58DC85331FFCA30C0060DC03 /* UIImageView+FitNet.m in Sources */, 5892AD5C1FF5079C00E868C2 /* LMJRefreshTableViewController.m in Sources */, - 589B577E2000339800B2D5A8 /* VIDVideoDownloadedCell.m in Sources */, 58DC83841FFB43460060DC03 /* LMJDYViewController.m in Sources */, 58DC83801FFB43460060DC03 /* LMJZDTPViewController.m in Sources */, 584038101FF62F30002A0566 /* LMJAdaptFontCell.m in Sources */, 58A17C592007335400B350AB /* LMJConst.m in Sources */, - 589B577D2000339800B2D5A8 /* VIDTableViewVideoCell.m in Sources */, 58DC844A1FFBDC9E0060DC03 /* LMJModalBlockViewController.m in Sources */, 58DC85251FFC972C0060DC03 /* BSJWordToolBar.m in Sources */, 58651AB01FFE6D6F0087419D /* SINUser.m in Sources */, 5892AD721FF5113800E868C2 /* LMJMeViewController.m in Sources */, + 585FC1D3208DAADF003174A7 /* VIDCachesTool.m in Sources */, 58DC850A1FFC972C0060DC03 /* BSJRecommendUser.m in Sources */, - 5892646B202D6662007DA41E /* XLMJThread.m in Sources */, 58DC85101FFC972C0060DC03 /* BSJRecommendCategory.m in Sources */, 58DC83D91FFB440E0060DC03 /* WPFDemoController.m in Sources */, - 58DC85091FFC972C0060DC03 /* NJAVPlayerViewController.m in Sources */, 58DC843F1FFBD1290060DC03 /* LMJGCDViewController.m in Sources */, 58DC85291FFC972C0060DC03 /* BSJTopicCmtService.m in Sources */, 58651AA71FFE6D6F0087419D /* SINTabBarController.m in Sources */, 58DC83CD1FFB43E30060DC03 /* LMJShangXiaWenZhanViewController.m in Sources */, + 58A858A6207C934E0063DE98 /* PresentAnimator.m in Sources */, 58DC84F91FFC972C0060DC03 /* BSJMeViewController.m in Sources */, 58DC81721FFA29E00060DC03 /* LMJDragTableViewController.m in Sources */, + 589888A3206B34BF00BDAACD /* RSAEncryptor.m in Sources */, 584038481FF7F3E5002A0566 /* LMJRequestManager.m in Sources */, - 58DC84321FFBC44B0060DC03 /* LMJRunTimeTest+LMJMethod.m in Sources */, 5892AD781FF5115E00E868C2 /* LMJNewViewController.m in Sources */, 58DC84291FFBC3260060DC03 /* UIButton+LMJBlock.m in Sources */, 58DC83891FFB43460060DC03 /* LMJCALayerBaseViewController.m in Sources */, @@ -2862,12 +2637,12 @@ 58DC83851FFB43460060DC03 /* LMJCALayerViewController.m in Sources */, 58651AA01FFE6D6F0087419D /* SINSQLiteManager.m in Sources */, 589B56FC1FFFC52F00B2D5A8 /* QQMusicMessageModel.m in Sources */, - 589B57782000339800B2D5A8 /* VIDLocalViewController.m in Sources */, - 58DC84501FFBDD5C0060DC03 /* LMJOraceDataBase.m in Sources */, 5892AD901FF5E32500E868C2 /* LMJIntroductoryPagesHelper.m in Sources */, 58DC850D1FFC972C0060DC03 /* BSJComment.m in Sources */, 58651AAA1FFE6D6F0087419D /* SINBroswerCell.m in Sources */, + 583D508420765948001480C8 /* TDTouchID.m in Sources */, 589B57001FFFC52F00B2D5A8 /* QQLrcCell.m in Sources */, + 585A22E7207DAB77001BD3AD /* SINPickPhotoTool.m in Sources */, 5892AD021FF4F9D200E868C2 /* LMJWordArrowItem.m in Sources */, 58651AA51FFE6D6F0087419D /* SINHomeViewController.m in Sources */, 58DC84171FFBC19A0060DC03 /* LMJLiftCycleViewController.m in Sources */, @@ -2878,14 +2653,18 @@ 58DC83C11FFB43E30060DC03 /* LMJZhusViewController.m in Sources */, 58651A9F1FFE6D6F0087419D /* SINUserManager.m in Sources */, 584038861FF9F602002A0566 /* LMJFillTableFormViewController.m in Sources */, + 58C51F8E208C2EF100EECAAA /* VIDListViewController.m in Sources */, 58DC83C41FFB43E30060DC03 /* LMJXueHuaViewController.m in Sources */, 58DC850F1FFC972C0060DC03 /* BSJTopicViewModel.m in Sources */, 584038631FF87939002A0566 /* LMJUpLoadImagesViewController.m in Sources */, 58DC84F81FFC972C0060DC03 /* BSJTrendViewController.m in Sources */, 5892AD6F1FF5110B00E868C2 /* LMJHomeViewController.m in Sources */, 5840380C1FF62ECF002A0566 /* LMJAdaptFontViewController.m in Sources */, + 58A858522078842B0063DE98 /* LMJStudent.m in Sources */, 584038751FF93A86002A0566 /* LMJCountDownModel.m in Sources */, 58DC85021FFC972C0060DC03 /* BSJPublishWordViewController.m in Sources */, + 58E02EEB209D8A23005431BA /* LMJUniversalLinkViewController.m in Sources */, + 585FC1D9208DB9CD003174A7 /* VIDCollectionViewController.m in Sources */, 58DC81781FFA2CF90060DC03 /* LMJCalendarViewController.m in Sources */, 58651ABB1FFE6D6F0087419D /* SINPostStatusService.m in Sources */, 58DC83D01FFB43E30060DC03 /* LMJPicClipViewController.m in Sources */, @@ -2912,6 +2691,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -2919,6 +2699,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -2949,6 +2730,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; name = Debug; @@ -2967,6 +2749,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -2974,6 +2757,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -2997,6 +2781,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.3; MTL_ENABLE_DEBUG_INFO = NO; + RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -3011,9 +2796,11 @@ CLANG_ENABLE_OBJC_WEAK = NO; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO; + CLANG_WARN_STRICT_PROTOTYPES = NO; CODE_SIGN_ENTITLEMENTS = iOSProject/iOSProject.entitlements; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = EH8D228RS6; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 44HDC9YG72; ENABLE_BITCODE = NO; GCC_PREFIX_HEADER = iOSProject/LMJiOSProject.pch; INFOPLIST_FILE = iOSProject/Info.plist; @@ -3022,25 +2809,20 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/iOSProject/Classes/Libs/UMessage_Sdk_1.5.0", - "$(PROJECT_DIR)/iOSProject/Classes/百思不得姐/Vitamio", ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", "-l\"AFNetworking\"", - "-l\"CYLTabBarController\"", "-l\"FCUUID\"", "-l\"FDFullscreenPopGesture\"", "-l\"FMDB\"", - "-l\"GVUserDefaults\"", - "-l\"HMEmoticon\"", "-l\"IQKeyboardManager\"", "-l\"M13ProgressSuite\"", "-l\"MBProgressHUD\"", "-l\"MJExtension\"", "-l\"MJRefresh\"", "-l\"MOFSPickerManager\"", - "-l\"MagicWindowSDK\"", "-l\"Masonry\"", "-l\"Reachability\"", "-l\"SDCycleScrollView\"", @@ -3048,12 +2830,9 @@ "-l\"SocialQQ\"", "-l\"SocialSina\"", "-l\"SocialWeChat\"", - "-l\"TDTouchID\"", "-l\"Toast\"", "-l\"UICKeyChainStore\"", "-l\"UMSocialLog\"", - "-l\"WeChatSDK\"", - "-l\"WebViewJavascriptBridge\"", "-l\"WeiboSDK\"", "-l\"YYAsyncLayer\"", "-l\"YYCategories\"", @@ -3129,7 +2908,7 @@ "-framework", "\"WebKit\"", ); - PRODUCT_BUNDLE_IDENTIFIER = com.github.njhu; + PRODUCT_BUNDLE_IDENTIFIER = github.com.njhu.iosproject; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = 1; }; @@ -3144,9 +2923,11 @@ CLANG_ENABLE_OBJC_WEAK = NO; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO; + CLANG_WARN_STRICT_PROTOTYPES = NO; CODE_SIGN_ENTITLEMENTS = iOSProject/iOSProject.entitlements; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = EH8D228RS6; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 44HDC9YG72; ENABLE_BITCODE = NO; GCC_PREFIX_HEADER = iOSProject/LMJiOSProject.pch; INFOPLIST_FILE = iOSProject/Info.plist; @@ -3155,25 +2936,20 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/iOSProject/Classes/Libs/UMessage_Sdk_1.5.0", - "$(PROJECT_DIR)/iOSProject/Classes/百思不得姐/Vitamio", ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", "-l\"AFNetworking\"", - "-l\"CYLTabBarController\"", "-l\"FCUUID\"", "-l\"FDFullscreenPopGesture\"", "-l\"FMDB\"", - "-l\"GVUserDefaults\"", - "-l\"HMEmoticon\"", "-l\"IQKeyboardManager\"", "-l\"M13ProgressSuite\"", "-l\"MBProgressHUD\"", "-l\"MJExtension\"", "-l\"MJRefresh\"", "-l\"MOFSPickerManager\"", - "-l\"MagicWindowSDK\"", "-l\"Masonry\"", "-l\"Reachability\"", "-l\"SDCycleScrollView\"", @@ -3181,12 +2957,9 @@ "-l\"SocialQQ\"", "-l\"SocialSina\"", "-l\"SocialWeChat\"", - "-l\"TDTouchID\"", "-l\"Toast\"", "-l\"UICKeyChainStore\"", "-l\"UMSocialLog\"", - "-l\"WeChatSDK\"", - "-l\"WebViewJavascriptBridge\"", "-l\"WeiboSDK\"", "-l\"YYAsyncLayer\"", "-l\"YYCategories\"", @@ -3262,7 +3035,7 @@ "-framework", "\"WebKit\"", ); - PRODUCT_BUNDLE_IDENTIFIER = com.github.njhu; + PRODUCT_BUNDLE_IDENTIFIER = github.com.njhu.iosproject; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = 1; }; @@ -3290,6 +3063,19 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 585FC1E6209B2DF5003174A7 /* MCTestDataModel.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 585FC1E7209B2DF5003174A7 /* MCTestDataModel.xcdatamodel */, + ); + currentVersion = 585FC1E7209B2DF5003174A7 /* MCTestDataModel.xcdatamodel */; + path = MCTestDataModel.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ }; rootObject = 5892AC8C1FF4EB4A00E868C2 /* Project object */; } diff --git a/iOSProject/iOSProject.xcodeproj/xcshareddata/xcschemes/iOSProject.xcscheme b/iOSProject/iOSProject.xcodeproj/xcshareddata/xcschemes/iOSProject.xcscheme index 941c4366..89e2d283 100644 --- a/iOSProject/iOSProject.xcodeproj/xcshareddata/xcschemes/iOSProject.xcscheme +++ b/iOSProject/iOSProject.xcodeproj/xcshareddata/xcschemes/iOSProject.xcscheme @@ -1,6 +1,6 @@ @@ -46,6 +45,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + enableAddressSanitizer = "YES" language = "zh-Hans" region = "CN" launchStyle = "0" @@ -65,6 +65,11 @@ + + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/1024.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 00000000..661869f4 Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/20@2x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/20@2x.png new file mode 100644 index 00000000..a3334bf1 Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/20@2x.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/20@3x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/20@3x.png new file mode 100644 index 00000000..52041069 Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/20@3x.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/29@2x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/29@2x.png new file mode 100644 index 00000000..620864fe Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/29@2x.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/29@3x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/29@3x.png new file mode 100644 index 00000000..83426bd2 Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/29@3x.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/40@2x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/40@2x.png new file mode 100644 index 00000000..de92057a Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/40@2x.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/40@3x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/40@3x.png new file mode 100644 index 00000000..d44104cb Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/40@3x.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/60@2x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/60@2x.png new file mode 100644 index 00000000..d44104cb Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/60@2x.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/60@3x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/60@3x.png new file mode 100644 index 00000000..9c095214 Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/60@3x.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/Contents.json index 2e1df47a..e592dc05 100644 --- a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -3,55 +3,55 @@ { "size" : "20x20", "idiom" : "iphone", - "filename" : "icon20@2x.png", + "filename" : "20@2x.png", "scale" : "2x" }, { "size" : "20x20", "idiom" : "iphone", - "filename" : "icon20@3x.png", + "filename" : "20@3x.png", "scale" : "3x" }, { "size" : "29x29", "idiom" : "iphone", - "filename" : "icon29@2x.png", + "filename" : "29@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "iphone", - "filename" : "icon29@3x.png", + "filename" : "29@3x.png", "scale" : "3x" }, { "size" : "40x40", "idiom" : "iphone", - "filename" : "icon40@2x.png", + "filename" : "40@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", - "filename" : "icon40@3x.png", + "filename" : "40@3x.png", "scale" : "3x" }, { "size" : "60x60", "idiom" : "iphone", - "filename" : "icon60@2x.png", + "filename" : "60@2x.png", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", - "filename" : "icon60@3x.png", + "filename" : "60@3x.png", "scale" : "3x" }, { "size" : "1024x1024", "idiom" : "ios-marketing", - "filename" : "icon1024.png", + "filename" : "1024.png", "scale" : "1x" } ], diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon1024.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon1024.png deleted file mode 100644 index a6def366..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon1024.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon20@2x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon20@2x.png deleted file mode 100644 index 57c3e12c..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon20@2x.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon20@3x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon20@3x.png deleted file mode 100644 index 4863f4a4..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon20@3x.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon29@2x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon29@2x.png deleted file mode 100644 index 6314d6b2..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon29@2x.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon29@3x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon29@3x.png deleted file mode 100644 index f9ac8532..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon29@3x.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon40@2x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon40@2x.png deleted file mode 100644 index 9bd9789f..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon40@2x.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon40@3x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon40@3x.png deleted file mode 100644 index 619f2dd5..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon40@3x.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon60@2x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon60@2x.png deleted file mode 100644 index 619f2dd5..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon60@2x.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon60@3x.png b/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon60@3x.png deleted file mode 100644 index fd05ed69..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/AppIcon.appiconset/icon60@3x.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/11252436.png b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/11252436.png index e5d52bd8..be5e7063 100644 Binary files a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/11252436.png and b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/11252436.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/12422208.jpeg b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/12422208.jpeg new file mode 100644 index 00000000..1646ae97 Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/12422208.jpeg differ diff --git a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/12422208.png b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/12422208.png deleted file mode 100644 index a9bdf006..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/12422208.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/6401136.png b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/6401136.png deleted file mode 100644 index 443a8299..00000000 Binary files a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/6401136.png and /dev/null differ diff --git a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/6401336.png b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/6401336.png new file mode 100644 index 00000000..75846822 Binary files /dev/null and b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/6401336.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/640960.png b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/640960.png index 921a513e..00734665 100644 Binary files a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/640960.png and b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/640960.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/7501334.png b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/7501334.png index 6c4acc87..aeac8c41 100644 Binary files a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/7501334.png and b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/7501334.png differ diff --git a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/Contents.json b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/Contents.json index 5463547c..9752337d 100644 --- a/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/Contents.json +++ b/iOSProject/iOSProject/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -13,7 +13,7 @@ "extent" : "full-screen", "idiom" : "iphone", "subtype" : "736h", - "filename" : "12422208.png", + "filename" : "12422208.jpeg", "minimum-system-version" : "8.0", "orientation" : "portrait", "scale" : "3x" @@ -39,7 +39,7 @@ "extent" : "full-screen", "idiom" : "iphone", "subtype" : "retina4", - "filename" : "6401136.png", + "filename" : "6401336.png", "minimum-system-version" : "7.0", "orientation" : "portrait", "scale" : "2x" diff --git a/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIView+GestureCallback.h b/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIView+GestureCallback.h index 11381b58..4cab6114 100755 --- a/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIView+GestureCallback.h +++ b/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIView+GestureCallback.h @@ -23,7 +23,6 @@ @end - @interface UIView (GestureCallback) @property (nonatomic) NSMutableDictionary *gestures; @@ -93,4 +92,4 @@ -(void)longPressHandler:(UILongPressGestureRecognizer*)recognizer; -@end \ No newline at end of file +@end diff --git a/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIView+GestureCallback.m b/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIView+GestureCallback.m index 77b44a0d..cee1bb81 100755 --- a/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIView+GestureCallback.m +++ b/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIView+GestureCallback.m @@ -20,10 +20,6 @@ @implementation GestureCallbackValues @implementation UIView (GestureCallback) @dynamic gestures, gestureKeysHash; - - -#pragma mark - ##### TAP - #pragma mark add tap gestures -(NSString*)addTapGestureRecognizer:(void(^)(UITapGestureRecognizer* recognizer, NSString* gestureId))tapCallback @@ -573,10 +569,5 @@ -(void) setGestureKeysHash:(NSMutableDictionary *)value objc_setAssociatedObject(self, &UIView_GestureCallback_gestureKeysHashKey, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } - //TODO : CustomGestureRecognizer - - - - -@end \ No newline at end of file +@end diff --git a/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIViewController+DDPopUpViewController.h b/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIViewController+DDPopUpViewController.h deleted file mode 100755 index c8ac9993..00000000 --- a/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIViewController+DDPopUpViewController.h +++ /dev/null @@ -1,83 +0,0 @@ -// -// UIViewController+DDPopUpViewController.h -// appStroreDDReaderHD -// -// Created by Sun chongyang on 14-1-17. -// Copyright (c) 2014年 dangdang.com. All rights reserved. -// -//***************************************************************** - -//***************************************************************** - -#import - -#if __has_feature(objc_arc) - #define DDAutorelease( expression ) expression - #define DDRelease( expression ) - #define DDRetain( expression ) expression -#else - #define DDAutorelease( expression ) [expression autorelease] - #define DDRelease( expression ) [expression release] - #define DDRetain( expression ) [expression retain] -#endif - -/* - * 弹出视图的位置 - */ -typedef NS_ENUM(NSInteger, DDPopUpPosition){ - DDPopUpPositionCenter = 0,//default - DDPopUpPositionTop, - DDPopUpPositionFullScreen, - DDPopUpPositionLeft, - DDPopUpPositionRight -}; - -/* - * 弹出视图的动画方式 - */ -typedef NS_ENUM(NSInteger, DDPopUpAnimationType){ - DDPopUpAnimationTypeNone, - DDPopUpAnimationTypeSlideVertical, //默认的动画类型,从屏幕底部向上滑出 - DDPopUpAnimationTypeFade, //渐现渐隐 - DDPopUpAnimationTypeSlideLTR, //从屏幕左边向右滑出 - DDPopUpAnimationTypeSlideRTL //从屏幕右边向左滑出 -}; - -UIKIT_EXTERN NSTimeInterval const kPopupModalAnimationDuration; - -typedef void(^DismissCallback)(void); - -@class DDPopUpContainerViewController; - -@interface UIViewController (DDPopUpViewController) - -@property (nonatomic,retain) UIViewController *popUpViewController; -@property (nonatomic,assign) CGPoint popUpOffset; //相对于弹出位置的偏移 -@property (nonatomic,assign) CGSize popUpViewSize; //弹出视图的大小 -@property (nonatomic,assign) DDPopUpPosition popUpPosition; //弹出视图的位置 -@property (nonatomic,assign) BOOL dismissWhenTouchBackground; //是否允许点击背景dismiss -@property (nonatomic,copy) DismissCallback dismissCallback; - - -+ (void)dismissCurrentShowingPopUpViewControllers; - -//use defalut animationType && dismissWhenTouchBackground = YES -- (void)showPopUpViewController:(UIViewController *)popUpViewController; -//dismissWhenTouchBackground = YES -- (void)showPopUpViewController:(UIViewController *)popUpViewController animationType:(DDPopUpAnimationType)animationType; - -- (void)showPopUpViewController:(UIViewController *)popUpViewController animationType:(DDPopUpAnimationType)animationType dismissWhenTouchBackground:(BOOL)dismissWhenTouchBackground; - -//use defalut popup animationType -- (void)dismissPopUpViewController; -- (void)dismissPopUpViewController:(DDPopUpAnimationType)animationType; -- (void)dismissPopUpViewController:(DDPopUpAnimationType)animationType completion:(void (^)(void))completion; - -@end - -@interface DDPopUpContainerViewController : UIViewController - -@property (nonatomic,assign) UIViewController *presentingPopupController; -@property (nonatomic,retain) UIButton *backgroundButton; - -@end \ No newline at end of file diff --git a/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIViewController+DDPopUpViewController.m b/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIViewController+DDPopUpViewController.m deleted file mode 100755 index 4e7b51ed..00000000 --- a/iOSProject/iOSProject/Classes/Category/ThirdCategory/UIViewController+DDPopUpViewController.m +++ /dev/null @@ -1,601 +0,0 @@ -// -// UIViewController+DDPopUpViewController.m -// appStroreDDReaderHD -// -// Created by Sun chongyang on 14-1-17. -// Copyright (c) 2014年 dangdang.com. All rights reserved. -// - -#import "UIViewController+DDPopUpViewController.h" -#import - -#define kDDBackgroundViewTag 12345 -#define kDDContentViewTag 12346 - -static char* popUpViewControllerKey ="popUpViewControllerKey"; -static char* popUpParentViewViewControllerKey ="popUpParentViewViewControllerKey"; -static char* popUpOffsetKey = "popUpOffsetKey"; -static char* popUpPositionKey = "popUpPositionKey"; -static char* popUpSizeKey = "popUpSizeKey"; -static char* animationTypeKey = "animationTypeKey"; -static char* dismissWhenTouchBackgroundKey = "dismissWhenTouchBackgroundKey"; -static char* popUpWindowKey = "popUpWindowKey"; -static char* previosKeyWindowKey = "previosKeyWindowKey"; -static char* dissmissCallbackKey = "dissmissCallbackKey"; - -NSTimeInterval const kPopupModalAnimationDuration = 0.30f; - -static NSMutableArray *__popUpViewControllers = nil; - -@interface UIViewController (DDPopUpViewControllerPrivate) - -@property (nonatomic,assign) UIViewController *popUpParentViewController; -@property (nonatomic,assign) DDPopUpAnimationType animationType; -@property (nonatomic,assign) UIWindow *previosKeyWindow; -@property (nonatomic,retain) UIWindow *popUpWindow; - -- (CGRect)frameForViewSize:(CGSize)viewSize; -- (void)updatePopupViewSize:(CGSize)newSize; -- (void)showPopUpView:(UIView *)popupContentView backgroundView:(UIView *)backgroundView animationType:(DDPopUpAnimationType)animationType; -- (void)dismissPopUpView; - -@end - -@interface UINavigationController (DDPopUpViewControllerPrivate) - -@end - -@implementation UINavigationController (DDPopUpViewControllerPrivate) - -- (CGSize)popUpViewSize -{ - NSValue *value = objc_getAssociatedObject(self, popUpSizeKey); - CGSize popUpViewSize = [value CGSizeValue]; - if (CGSizeEqualToSize(popUpViewSize, CGSizeZero)) { - popUpViewSize = self.topViewController.popUpViewSize; - } - - return popUpViewSize; -} - -@end - -@implementation UIViewController (DDPopUpViewController) - -#pragma mark - setters & getters -- (void)setPopUpViewController:(UIViewController *)popUpViewController -{ - objc_setAssociatedObject(self, popUpViewControllerKey, popUpViewController, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (UIViewController *)popUpViewController -{ - return objc_getAssociatedObject(self, popUpViewControllerKey); -} - -- (void)setPopUpParentViewController:(UIViewController *)popUpParentViewController -{ - objc_setAssociatedObject(self, popUpParentViewViewControllerKey, popUpParentViewController, OBJC_ASSOCIATION_ASSIGN); -} - -- (UIViewController *)popUpParentViewController -{ - return objc_getAssociatedObject(self, popUpParentViewViewControllerKey); -} - -- (void)setPopUpOffset:(CGPoint)popUpOffset -{ - objc_setAssociatedObject(self, popUpOffsetKey, [NSValue valueWithCGPoint:popUpOffset], OBJC_ASSOCIATION_RETAIN_NONATOMIC); - [self.popUpParentViewController updatePopupViewSize:self.popUpViewSize animated:YES]; -} - -- (CGPoint)popUpOffset -{ - NSValue *value = objc_getAssociatedObject(self, popUpOffsetKey); - return [value CGPointValue]; -} - -- (void)setPopUpPosition:(DDPopUpPosition)popUpPosition -{ - objc_setAssociatedObject(self, popUpPositionKey, [NSNumber numberWithInteger:popUpPosition], OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (DDPopUpPosition)popUpPosition -{ - NSNumber *number = objc_getAssociatedObject(self, popUpPositionKey); - return [number integerValue]; -} - -- (void)setPopUpViewSize:(CGSize)popUpViewSize -{ - objc_setAssociatedObject(self, popUpSizeKey, [NSValue valueWithCGSize:popUpViewSize], OBJC_ASSOCIATION_RETAIN_NONATOMIC); - [self.popUpParentViewController updatePopupViewSize:self.popUpViewSize animated:YES]; -} - -- (CGSize)popUpViewSize -{ - NSValue *value = objc_getAssociatedObject(self, popUpSizeKey); - return [value CGSizeValue]; -} - -- (void)setAnimationType:(DDPopUpAnimationType)animationType -{ - objc_setAssociatedObject(self, animationTypeKey,@(animationType), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (DDPopUpAnimationType)animationType -{ - NSNumber *value = objc_getAssociatedObject(self, animationTypeKey); - return [value integerValue]; -} - -- (void)setDismissWhenTouchBackground:(BOOL)dismissWhenTouchBackground -{ - objc_setAssociatedObject(self, dismissWhenTouchBackgroundKey,@(dismissWhenTouchBackground), OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (BOOL)dismissWhenTouchBackground -{ - NSNumber *value = objc_getAssociatedObject(self, dismissWhenTouchBackgroundKey); - return [value boolValue]; -} - -- (void)setPopUpWindow:(UIWindow *)popUpWindow -{ - objc_setAssociatedObject(self, popUpWindowKey,popUpWindow, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (UIWindow *)popUpWindow -{ - return objc_getAssociatedObject(self, popUpWindowKey); -} - -- (void)setPreviosKeyWindow:(UIWindow *)previosKeyWindow -{ - objc_setAssociatedObject(self, previosKeyWindowKey,previosKeyWindow, OBJC_ASSOCIATION_ASSIGN); -} - -- (UIWindow *)previosKeyWindow -{ - return objc_getAssociatedObject(self, previosKeyWindowKey); -} - -- (void)setDismissCallback:(DismissCallback)dismissCallback -{ - objc_setAssociatedObject(self, dissmissCallbackKey,dismissCallback, OBJC_ASSOCIATION_COPY_NONATOMIC); -} - -- (DismissCallback)dismissCallback -{ - return objc_getAssociatedObject(self, dissmissCallbackKey); -} - -#pragma mark - private methods - -+ (void)load -{ - __popUpViewControllers = [[NSMutableArray alloc] init]; - Method original = class_getInstanceMethod([UIViewController class], NSSelectorFromString(@"dealloc")); - Method swizzle = class_getInstanceMethod([UIViewController class], @selector(sizzled_dealloc)); - method_exchangeImplementations(original, swizzle); -} - -- (void)sizzled_dealloc -{ - if (self.popUpViewController) { - [self dismissPopUpViewController:DDPopUpAnimationTypeNone]; - } - - [self sizzled_dealloc]; -} - -- (UIView *)topView -{ - UIWindow *w = [[UIApplication sharedApplication].delegate window]; - if (!w) { - w = [[UIApplication sharedApplication].windows lastObject]; - } - UIViewController *topVC = [w rootViewController]; - while ([topVC presentedViewController]) { - topVC = [topVC presentedViewController]; - } - return [topVC view]; -} - -- (CGRect)frameForViewSize:(CGSize)viewSize -{ - UIViewController *containerVC = self.popUpWindow.rootViewController; - DDPopUpPosition position = self.popUpViewController.popUpPosition; - CGPoint popupoffset = self.popUpViewController.popUpOffset; - - CGRect frame = containerVC.view.bounds; - if (position == DDPopUpPositionCenter) { - frame = CGRectMake((CGRectGetWidth(containerVC.view.bounds) - viewSize.width)/2.0f, (CGRectGetHeight(containerVC.view.bounds) - viewSize.height)/2.0f, viewSize.width, viewSize.height); - } - else if(position == DDPopUpPositionTop){ - frame = CGRectMake((CGRectGetWidth(containerVC.view.bounds) - viewSize.width)/2.0f, 0, viewSize.width, viewSize.height); - } - else if(position == DDPopUpPositionLeft){ - frame = CGRectMake(0, (CGRectGetHeight(containerVC.view.bounds) - viewSize.height)/2.0f, viewSize.width, viewSize.height); - } - else if(position == DDPopUpPositionRight){ - frame = CGRectMake((CGRectGetWidth(containerVC.view.bounds) - viewSize.width), (CGRectGetHeight(containerVC.view.bounds) - viewSize.height)/2.0f, viewSize.width, viewSize.height); - } - - return CGRectOffset(frame, popupoffset.x, popupoffset.y); -} - -- (UIViewAutoresizing)autoresizingMaskForPosition:(DDPopUpPosition)popUpPosition frame:(CGRect)popupFrame -{ - UIViewAutoresizing autoresizingMask = UIViewAutoresizingNone; - if (popUpPosition == DDPopUpPositionTop){ - if (CGRectGetWidth(popupFrame) == CGRectGetWidth(self.view.bounds)) { - autoresizingMask = UIViewAutoresizingFlexibleWidth; - } - else{ - autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin; - } - } - else if (popUpPosition == DDPopUpPositionFullScreen){ - autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; - } - else if (popUpPosition == DDPopUpPositionLeft){ - if (CGRectGetHeight(popupFrame) == CGRectGetHeight(self.view.bounds)) { - autoresizingMask = UIViewAutoresizingFlexibleHeight; - } - else{ - autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin; - } - } - else if (popUpPosition == DDPopUpPositionRight){ - if (CGRectGetHeight(popupFrame) == CGRectGetHeight(self.view.bounds)) { - autoresizingMask = UIViewAutoresizingFlexibleHeight; - } - else{ - autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin; - } - autoresizingMask = autoresizingMask|UIViewAutoresizingFlexibleLeftMargin; - } - else { - //default DDPopUpPositionCenter - autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleRightMargin; - } - - return autoresizingMask; -} - -- (void)updatePopupViewSize:(CGSize)newSize animated:(BOOL)animated -{ - __block UIView *contentView = self.popUpViewController.view; - CGRect frame = [self frameForViewSize:newSize]; - CGFloat animationDuration = animated ? kPopupModalAnimationDuration : 0; - __block typeof(self) weakSelf = self; - [UIView animateWithDuration:animationDuration animations:^(){ - contentView.frame = frame; - }completion:^(BOOL finished){ - [weakSelf.popUpViewController.view setNeedsLayout]; - if ([weakSelf.popUpViewController isKindOfClass:[UINavigationController class]]) { - [[(UINavigationController *)weakSelf.popUpViewController topViewController].view setNeedsLayout]; - } - }]; -} - -- (void)showPopUpView:(UIView *)popupContentView backgroundView:(UIView *)backgroundView animationType:(DDPopUpAnimationType)animationType -{ - UIViewController *containerVC = self.popUpWindow.rootViewController; - __block UIView *contentView = popupContentView; - CGRect destinationFrame = popupContentView.frame; - CGRect startFrame = destinationFrame; - - CGFloat destinationAlpha = 1.0; - CGFloat startAlpha = 1.0; - - CGFloat animationDuration = kPopupModalAnimationDuration; - - if (animationType == DDPopUpAnimationTypeFade) { - startAlpha = 0.0; - } - else if (animationType == DDPopUpAnimationTypeSlideVertical){ - startFrame = CGRectOffset(destinationFrame, 0, CGRectGetHeight(containerVC.view.bounds) - CGRectGetMinY(destinationFrame)); - } - else if (animationType == DDPopUpAnimationTypeSlideLTR){ - startFrame = CGRectOffset(destinationFrame, -1*CGRectGetMaxX(destinationFrame), 0); - } - else if (animationType == DDPopUpAnimationTypeSlideRTL){ - startFrame = CGRectOffset(destinationFrame, CGRectGetWidth(containerVC.view.bounds) - CGRectGetMinX(destinationFrame), 0); - } - else{ - animationDuration = 0.01; - } - - __block typeof(self) weakSelf = self; - [popupContentView setFrame:startFrame]; - popupContentView.alpha = startAlpha; - self.popUpWindow.backgroundColor = [UIColor clearColor]; - - [self.popUpViewController beginAppearanceTransition:YES animated:YES]; - [backgroundView addSubview:popupContentView]; - - [UIView animateWithDuration:animationDuration animations:^(){ - [weakSelf.popUpWindow setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:0.5]]; - [contentView setFrame:destinationFrame]; - contentView.alpha = destinationAlpha; - }completion:^(BOOL finished){ - [weakSelf.popUpViewController endAppearanceTransition]; - }]; -} - -- (void)dismissPopUpViewWithoutAnimation -{ - [self dismissPopUpViewController:DDPopUpAnimationTypeNone]; -} - -- (void)dismissPopUpView:(DDPopUpAnimationType)animationType completion:(void (^)(void))completion -{ - __block DDPopUpContainerViewController *containerVC = (DDPopUpContainerViewController *)self.popUpWindow.rootViewController; - __block UIView *popupContentView = self.popUpViewController.view; - - CGRect destinationFrame = popupContentView.frame; - CGFloat destinationAlpha = 1.0; - - CGFloat animationDuration = kPopupModalAnimationDuration; - - if (animationType == DDPopUpAnimationTypeFade) { - destinationAlpha = 0.0; - } - else if (animationType == DDPopUpAnimationTypeSlideVertical){ - destinationFrame = CGRectOffset(destinationFrame, 0,CGRectGetHeight(containerVC.view.bounds) - CGRectGetMinY(popupContentView.frame)); - } - else if (animationType == DDPopUpAnimationTypeSlideLTR){ - destinationFrame = CGRectOffset(destinationFrame, -1*CGRectGetMaxX(popupContentView.frame), 0); - } - else if (animationType == DDPopUpAnimationTypeSlideRTL){ - destinationFrame = CGRectOffset(destinationFrame, CGRectGetWidth(containerVC.view.bounds) - CGRectGetMinX(popupContentView.frame), 0); - } - else if (animationType == DDPopUpAnimationTypeNone){ - animationDuration = 0.01; - } - - if (self.popUpViewController.dismissCallback) { - self.popUpViewController.dismissCallback(); - } - - __block typeof(self) weakSelf = self; - [weakSelf.popUpViewController beginAppearanceTransition:NO animated:YES]; - [UIView animateWithDuration:animationDuration animations:^(){ - [popupContentView setFrame:destinationFrame]; - popupContentView.alpha = destinationAlpha; - [weakSelf.popUpWindow setBackgroundColor:[UIColor clearColor]]; - }completion:^(BOOL finished){ - [weakSelf.popUpWindow setHidden:YES]; - containerVC.presentingPopupController = nil; - [weakSelf.popUpViewController.view removeFromSuperview]; - [weakSelf.popUpViewController endAppearanceTransition]; - [weakSelf.popUpViewController removeFromParentViewController]; - weakSelf.popUpWindow.rootViewController = nil; - weakSelf.popUpWindow = nil; - weakSelf.popUpViewController.popUpParentViewController = nil; - weakSelf.popUpViewController = nil; - UIWindow *curKeyWindow = [[UIApplication sharedApplication] keyWindow]; - if (curKeyWindow == weakSelf.previosKeyWindow) { - [weakSelf.previosKeyWindow makeKeyWindow]; - } - - if (completion) { - completion(); - } - }]; -} - -#pragma mark - public methods - -+ (void)dismissCurrentShowingPopUpViewControllers -{ - while ([__popUpViewControllers count]) { - UIViewController *vc = [__popUpViewControllers lastObject]; - [vc.popUpParentViewController dismissPopUpViewController:DDPopUpAnimationTypeNone]; - } -} - -- (void)showPopUpViewController:(UIViewController *)popUpViewController -{ - [self showPopUpViewController:popUpViewController animationType:DDPopUpAnimationTypeFade dismissWhenTouchBackground:YES]; -} - -- (void)showPopUpViewController:(UIViewController *)popUpViewController animationType:(DDPopUpAnimationType)animationType -{ - [self showPopUpViewController:popUpViewController animationType:animationType dismissWhenTouchBackground:YES]; -} - -- (void)showPopUpViewController:(UIViewController *)popUpViewController animationType:(DDPopUpAnimationType)animationType dismissWhenTouchBackground:(BOOL)dismissWhenTouchBackground -{ - if (self.popUpWindow) { - return; - } - - self.popUpViewController = popUpViewController; - [__popUpViewControllers addObject:popUpViewController]; - popUpViewController.animationType = animationType; - popUpViewController.dismissWhenTouchBackground = dismissWhenTouchBackground; - popUpViewController.popUpParentViewController = self; - /* - if ([popUpViewController isKindOfClass:[UINavigationController class]]) { - ((UINavigationController *)popUpViewController).delegate = self; - } - */ - DDPopUpContainerViewController *containerVC = [[DDPopUpContainerViewController alloc] initWithNibName:nil bundle:nil]; - __block UIButton *backgroundView = [containerVC backgroundButton]; - [backgroundView addTarget:self action:@selector(backgroundViewTouched:) forControlEvents:UIControlEventTouchUpInside]; - containerVC.presentingPopupController = self; - [containerVC addChildViewController:popUpViewController]; - [popUpViewController view]; - self.previosKeyWindow = [UIApplication sharedApplication].keyWindow; - UIWindow *win = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - win.backgroundColor = [UIColor clearColor]; - UIWindowLevel windowLevel = UIWindowLevelNormal; - if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { - windowLevel = UIWindowLevelStatusBar/2.0f; - } - win.windowLevel = windowLevel + [__popUpViewControllers count]; - win.rootViewController = containerVC; - DDRelease(containerVC); - [win makeKeyAndVisible]; - self.popUpWindow = win; - DDRelease(win); - - CGSize popupViewSize = popUpViewController.popUpViewSize; - CGRect frame = [self frameForViewSize:popupViewSize]; - popUpViewController.view.frame = frame; - popUpViewController.view.autoresizingMask = [self autoresizingMaskForPosition:popUpViewController.popUpPosition frame:frame]; - - [self showPopUpView:popUpViewController.view backgroundView:backgroundView animationType:animationType]; -} - -- (void)backgroundViewTouched:(UIButton *)sender -{ - if (self.popUpViewController.dismissWhenTouchBackground) { - [self dismissPopUpViewController:self.popUpViewController.animationType]; - } -} - -- (void)dismissPopUpViewController -{ - [self dismissPopUpViewController:self.popUpViewController.animationType]; -} - -- (void)dismissPopUpViewController:(DDPopUpAnimationType)animationType; -{ - [self dismissPopUpViewController:animationType completion:NULL]; -} - -- (void)dismissPopUpViewController:(DDPopUpAnimationType)animationType completion:(void (^)(void))completion -{ - UIViewController *vc = nil; - if (self.popUpViewController) { - vc = self; - } - else if (self.popUpParentViewController){ - vc = self.popUpParentViewController; - } - - if (vc) { - [__popUpViewControllers removeObject:vc.popUpViewController]; - [vc dismissPopUpView:animationType completion:completion]; - } - else if (self.parentViewController) { - [self.parentViewController dismissPopUpViewController:animationType]; - } -} -/* -#pragma mark - UINavigationControllerDelegate -- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated -{ - CGFloat offset = 0; - if (!navigationController.navigationBarHidden) { - offset += CGRectGetHeight(navigationController.navigationBar.bounds); - } - - CGSize popupViewSize = viewController.popUpViewSize; - if (CGSizeEqualToSize(popupViewSize, CGSizeZero)) { - popupViewSize = viewController.view.bounds.size; - } - - popupViewSize.height += offset; - - __block typeof(self) weakSelf = self; - double delayInSeconds = 0.25; - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ - [weakSelf updatePopupViewSize:popupViewSize animated:YES]; - }); -} -*/ - -@end - -#pragma mark - DDPopUpContainerViewController - -@implementation DDPopUpContainerViewController - -- (void)dealloc -{ - self.backgroundButton = nil; - self.presentingPopupController = nil; - - #if !__has_feature(objc_arc) - [super dealloc]; - #endif -} - -- (UIButton *)backgroundButton -{ - if (nil == _backgroundButton) { - _backgroundButton = DDRetain([UIButton buttonWithType:UIButtonTypeCustom]);; - _backgroundButton.frame = self.view.bounds; - _backgroundButton.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; - [self.view addSubview:_backgroundButton]; - } - - return _backgroundButton; -} - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; -} - -- (void)viewDidAppear:(BOOL)animated -{ - [super viewDidAppear:animated]; -} - -- (void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; - [self.view endEditing:YES]; -} - -- (void)viewDidDisappear:(BOOL)animated -{ - [super viewDidDisappear:animated]; -} - -- (UIStatusBarStyle)preferredStatusBarStyle -{ - return [self.presentingPopupController preferredStatusBarStyle]; -} - -- (BOOL)prefersStatusBarHidden -{ - return [self.presentingPopupController prefersStatusBarHidden]; -} - -- (UIInterfaceOrientationMask)supportedInterfaceOrientations -{ - return [self.presentingPopupController supportedInterfaceOrientations]; -} - -- (BOOL)shouldAutorotate -{ - return [self.presentingPopupController shouldAutorotate]; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - return [self.presentingPopupController shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; -} - -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ - [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; - [self.presentingPopupController.popUpViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; -} - -- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation -{ - [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; - [self.presentingPopupController.popUpViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; -} - -@end - diff --git a/iOSProject/iOSProject/Classes/Category/UIButton+LMJ.h b/iOSProject/iOSProject/Classes/Category/UIButton+LMJ.h index f2814ce8..16ae911f 100644 --- a/iOSProject/iOSProject/Classes/Category/UIButton+LMJ.h +++ b/iOSProject/iOSProject/Classes/Category/UIButton+LMJ.h @@ -15,7 +15,7 @@ typedef void (^TouchedBlock)(NSInteger tag); /** 添加 addtarget */ --(void)addActionHandler:(TouchedBlock)touchHandler; +- (void)addActionHandler:(TouchedBlock)touchHandler; /** * @brief 使用颜色设置按钮背景 @@ -26,28 +26,28 @@ typedef void (^TouchedBlock)(NSInteger tag); - (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state; /* -* @brief -* -* @param frame frame -* @param buttonTitle 标题 -* @param normalBGColor 未选中的背景色 -* @param selectBGColor 选中的背景色 -* @param normalColor 未选中的文字色 -* @param selectColor 选中的文字色 -* @param buttonFont 文字字体 -* @param cornerRadius 圆角值 没有则为0 -* @param doneBlock 点击事件 -* -* @return -*/ --(instancetype)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle normalBGColor:(UIColor *)normalBGColor selectBGColor:(UIColor *)selectBGColor + * @brief + * + * @param frame frame + * @param buttonTitle 标题 + * @param normalBGColor 未选中的背景色 + * @param selectBGColor 选中的背景色 + * @param normalColor 未选中的文字色 + * @param selectColor 选中的文字色 + * @param buttonFont 文字字体 + * @param cornerRadius 圆角值 没有则为0 + * @param doneBlock 点击事件 + * + * @return + */ +- (instancetype)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle normalBGColor:(UIColor *)normalBGColor selectBGColor:(UIColor *)selectBGColor normalColor:(UIColor *)normalColor selectColor:(UIColor *)selectColor buttonFont:(UIFont *)buttonFont cornerRadius:(CGFloat )cornerRadius doneBlock:(void(^)(UIButton *))doneBlock; -+(UIButton *)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle normalBGColor:(UIColor *)normalBGColor selectBGColor:(UIColor *)selectBGColor - normalColor:(UIColor *)normalColor selectColor:(UIColor *)selectColor buttonFont:(UIFont *)buttonFont cornerRadius:(CGFloat )cornerRadius - doneBlock:(void(^)(UIButton *))doneBlock; ++ (UIButton *)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle normalBGColor:(UIColor *)normalBGColor selectBGColor:(UIColor *)selectBGColor + normalColor:(UIColor *)normalColor selectColor:(UIColor *)selectColor buttonFont:(UIFont *)buttonFont cornerRadius:(CGFloat )cornerRadius + doneBlock:(void(^)(UIButton *))doneBlock; @end @@ -62,6 +62,7 @@ typedef void (^TouchedBlock)(NSInteger tag); IB_DESIGNABLE @interface APRoundedButton : UIButton -@property (nonatomic, assign) IBInspectable int style; +@property (nonatomic, assign) IBInspectable NSUInteger style; +@property (nonatomic, assign) IBInspectable CGFloat nj_cornerRaduous; @end diff --git a/iOSProject/iOSProject/Classes/Category/UIButton+LMJ.m b/iOSProject/iOSProject/Classes/Category/UIButton+LMJ.m index 03ac3dab..8a9c7cc8 100644 --- a/iOSProject/iOSProject/Classes/Category/UIButton+LMJ.m +++ b/iOSProject/iOSProject/Classes/Category/UIButton+LMJ.m @@ -7,6 +7,7 @@ // #import "UIButton+LMJ.h" +#import "UIView+GestureCallback.h" static const void *UIButtonBlockKey = &UIButtonBlockKey; @@ -67,7 +68,7 @@ - (instancetype)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle [self setBackgroundImage:[UIImage imageWithColor:normalBGColor] forState:UIControlStateNormal]; [self setBackgroundImage:[UIImage imageWithColor:selectBGColor] forState:UIControlStateHighlighted]; - LMJWeakSelf(self); + LMJWeak(self); [self addTapGestureRecognizer:^(UITapGestureRecognizer *recognizer, NSString *gestureId) { !doneBlock ?: doneBlock(weakself); @@ -94,8 +95,6 @@ +(UIButton *)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle nor @implementation APRoundedButton - - - (void)makeCorner { UIRectCorner corners; @@ -136,22 +135,43 @@ - (void)makeCorner { break; } + _nj_cornerRaduous = _nj_cornerRaduous ?: 10.0; UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:corners - cornerRadii:CGSizeMake(10, 10)]; + cornerRadii:CGSizeMake(_nj_cornerRaduous, _nj_cornerRaduous)]; CAShapeLayer *maskLayer = [CAShapeLayer layer]; maskLayer.frame = self.bounds; maskLayer.path = maskPath.CGPath; self.layer.mask = maskLayer; - +} + +- (instancetype)initWithFrame:(CGRect)frame +{ + if (self = [super initWithFrame:frame]) { + [self setupUIOnce]; + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + [self setupUIOnce]; + } + return self; } +- (void)setupUIOnce +{ + [self makeCorner]; +} + - (void)layoutSubviews { [super layoutSubviews]; [self makeCorner]; } - @end diff --git a/iOSProject/iOSProject/Classes/Helpers/CalendarReminderManager.h b/iOSProject/iOSProject/Classes/Helpers/CalendarReminderManager.h deleted file mode 100755 index 8bf42523..00000000 --- a/iOSProject/iOSProject/Classes/Helpers/CalendarReminderManager.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// CalendarReminderManager.h -// 日历 -// -// Created by 曹相召 on 2018/1/3. -// Copyright © 2018年 MOKO. All rights reserved. -// - -#import -#import -typedef void (^CalendarReminderManagerAddEventSussessBlock)(NSString *eventIdentifier); -typedef void (^CalendarReminderManagerAddEventFailBlock)(NSError *error); -typedef void (^CalendarReminderManagerFetchSuccessBlock)(NSArray *eventArr); -@interface CalendarReminderManager : NSObject -//EKEventStore 单例 -+ (EKEventStore *)manager; - -//查询一个范围内的事件 -//startDate : 开始日期 -//endDate : 结束日期 -+ (NSArray *)fatchEventsWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate; - -//根据唯一表示获取一个事件 -+ (EKEvent *)fetchEventWithIdentifer:(NSString *)eventIdentifer; - -//向日历中添加一个事件 -//title : 事件的标题 -//notes : 事件的备注 -//location : 地点 -//startDate : 开始日期 -//endDate : 结束日期 -//alarms : 闹钟 -//URL : 链接 -//availability : 事件调度 -+ (void)addEventWithTitle:(NSString *)title - notes:(NSString *)notes - location:(NSString *)location - startDate:(NSDate *)startDate - endDate:(NSDate *)endDate - alarms:(NSArray *)alarms - URL:(NSURL *)URL - availability:(EKEventAvailability)availability - successBlock:(CalendarReminderManagerAddEventSussessBlock)successBlock - failBlock:(CalendarReminderManagerAddEventFailBlock)failBlock; - -//删除一个事件 -+ (BOOL)deleteEventWithEventIdentifier:(NSString *)eventIdentifier; - - - - -// 保存一个提醒 -// title : 提醒的标题 -// notes : 提醒的备注 -// startDate : 开始日期 -// endDate : 结束日期 -// alarm : 闹钟 -// priority : 事件调度(1-4 高 5中 6-9低 0 不设置) -// completed -+ (void)addEventIntoReminderWithTitle:(NSString *)title - notes:(NSString *)notes - startDate:(NSDate *)startDate - endDate:(NSDate *)endDate - alarm:(EKAlarm *)alarm - priority:(NSInteger)priority - completed:(BOOL)completed - successBlock:(CalendarReminderManagerAddEventSussessBlock)successBlock - failBlock:(CalendarReminderManagerAddEventFailBlock)failBlock; - -//根据标识删除一个提醒 -+ (BOOL)deleteReminderWithIdentifer:(NSString *)identifier; - -//查询所有的提醒(回调方式返回所有的提醒) -+ (void)fetchAllRemindersWithsuccess:(CalendarReminderManagerFetchSuccessBlock)success; - -// 根据标识获取唯一的提醒 (⚠️这个方法也可以查询日历里面的事件) -+ (EKCalendarItem *)fetchReminderWithIdentier:(NSString *)identifier; -@end diff --git a/iOSProject/iOSProject/Classes/Helpers/CalendarReminderManager.m b/iOSProject/iOSProject/Classes/Helpers/CalendarReminderManager.m deleted file mode 100755 index 577f593a..00000000 --- a/iOSProject/iOSProject/Classes/Helpers/CalendarReminderManager.m +++ /dev/null @@ -1,202 +0,0 @@ -// -// CalendarReminderManager.m -// 日历 -// -// Created by 曹相召 on 2018/1/3. -// Copyright © 2018年 MOKO. All rights reserved. -// - -#import "CalendarReminderManager.h" - -@implementation CalendarReminderManager -+ (EKEventStore *)manager -{ - static dispatch_once_t once = 0; - static EKEventStore *store; - dispatch_once(&once, ^{ - store = [[EKEventStore alloc] init]; - }); - return store; -} - -//查询一个范围内的事件 -+ (NSArray *)fatchEventsWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate -{ - EKEventStore *store = [CalendarReminderManager manager]; - NSPredicate *predicate = [store predicateForEventsWithStartDate:startDate endDate:endDate calendars:nil]; - NSArray *eventArray = [store eventsMatchingPredicate:predicate]; - - for(EKEvent *event in eventArray){ - NSLog(@"事件的内容event.title == %@",event.title); - NSLog(@"事件的内容的事件的eventIdentifier == %@",event.eventIdentifier); - } - return eventArray; -} - -//根据唯一表示获取一个事件 -+ (EKEvent *)fetchEventWithIdentifer:(NSString *)eventIdentifer -{ - return [[CalendarReminderManager manager] eventWithIdentifier:eventIdentifer]; -} - -//向日历中添加一个事件 -+ (void)addEventWithTitle:(NSString *)title - notes:(NSString *)notes - location:(NSString *)location - startDate:(NSDate *)startDate - endDate:(NSDate *)endDate - alarms:(NSArray *)alarms - URL:(NSURL *)URL - availability:(EKEventAvailability)availability - successBlock:(CalendarReminderManagerAddEventSussessBlock)successBlock - failBlock:(CalendarReminderManagerAddEventFailBlock)failBlock -{ - EKEventStore *store = [CalendarReminderManager manager]; - [store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if(error){ - if(failBlock){ - failBlock(error); - } - return; - } - if(!granted){ - //被用户拒绝,不允许访问日历 - return; - } - EKEvent *event = [EKEvent eventWithEventStore:store]; - event.calendar = [store defaultCalendarForNewEvents]; - - event.title = title; - event.notes = notes; - event.availability = availability; - event.startDate = startDate; - event.endDate = endDate; - event.location = location; - event.alarms = alarms; - event.calendar = store.defaultCalendarForNewEvents; - event.URL = URL; - - NSError *err = nil; - [store saveEvent:event span:EKSpanThisEvent commit:YES error:&err]; - if (!err) { - if (successBlock) { - NSLog(@"calendarItemIdentifier %@ \n\n\n eventIdentifier %@",event.calendarItemIdentifier,event.eventIdentifier) ; - successBlock(event.eventIdentifier); - } - }else{ - if (failBlock) { - failBlock(err); - } - } - }); - }]; -} - -//删除一个事件 -+ (BOOL)deleteEventWithEventIdentifier:(NSString *)eventIdentifier -{ - EKEventStore *store = [CalendarReminderManager manager]; - NSError *err = nil; - EKEvent *event = [store eventWithIdentifier:eventIdentifier]; - return [store removeEvent:event span:EKSpanThisEvent commit:YES error:&err]; -} - -//查询所有的提醒 -+ (void)fetchAllRemindersWithsuccess:(CalendarReminderManagerFetchSuccessBlock)success -{ - EKEventStore *store = [CalendarReminderManager manager]; - NSPredicate *predicate = [store predicateForRemindersInCalendars:nil]; - [store fetchRemindersMatchingPredicate:predicate completion:^(NSArray *reminders) { - NSInteger i = 1; - for (EKReminder *reminder in reminders) { - NSLog(@"第 %zd 个提醒 %@",i,reminder); - i++; - } - if (success) { - success(reminders); - } - }]; -} - -// 根据标识获取唯一的提醒 (⚠️这个方法也可以查询日历里面的事件) -+ (EKCalendarItem *)fetchReminderWithIdentier:(NSString *)identifier -{ - EKEventStore *store = [CalendarReminderManager manager]; - EKCalendarItem *item = [store calendarItemWithIdentifier:identifier]; - NSLog(@"item item %@",item); - return item; -} - -// 保存一个提醒 -+ (void)addEventIntoReminderWithTitle:(NSString *)title - notes:(NSString *)notes - startDate:(NSDate *)startDate - endDate:(NSDate *)endDate - alarm:(EKAlarm *)alarm - priority:(NSInteger)priority - completed:(BOOL)completed - successBlock:(CalendarReminderManagerAddEventSussessBlock)successBlock - failBlock:(CalendarReminderManagerAddEventFailBlock)failBlock -{ - EKEventStore *store = [CalendarReminderManager manager]; - [store requestAccessToEntityType:EKEntityTypeReminder - completion: - ^(BOOL granted, NSError *error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - if (failBlock) { - failBlock(error); - } - return; - } - if (!granted) { - //被用户拒绝,不允许访问提醒 - return; - } - EKReminder *reminder = [EKReminder reminderWithEventStore:store]; - [reminder setCalendar:[store defaultCalendarForNewReminders]]; - reminder.title = title; - reminder.notes = notes; - reminder.completed = completed; - reminder.priority = priority; - [reminder addAlarm:alarm]; - - NSCalendar *calender = [NSCalendar currentCalendar]; - [calender setTimeZone:[NSTimeZone systemTimeZone]]; - NSInteger flags = NSCalendarUnitYear | NSCalendarUnitMonth | - NSCalendarUnitDay |NSCalendarUnitHour | NSCalendarUnitMinute | - NSCalendarUnitSecond; - NSDateComponents *startDateComp = [calender components:flags fromDate:startDate]; - startDateComp.timeZone = [NSTimeZone systemTimeZone]; - - reminder.startDateComponents = startDateComp; - - NSDateComponents *endDateComp = [calender components:flags fromDate:startDate]; - endDateComp.timeZone = [NSTimeZone systemTimeZone]; - reminder.dueDateComponents = endDateComp; - - NSError *err; - [store saveReminder:reminder commit:YES error:&err]; - if (!err) { - if (successBlock) { - successBlock(reminder.calendarItemIdentifier); - } - }else{ - if (failBlock) { - failBlock(err); - } - } - }); - }]; -} -//根据标识删除一个提醒 -+ (BOOL)deleteReminderWithIdentifer:(NSString *)identifier -{ - EKEventStore *store = [CalendarReminderManager manager]; - EKCalendarItem *item = [store calendarItemWithIdentifier:identifier]; - EKReminder *reminder = (EKReminder *)item; - NSError *err = nil; - return [store removeReminder:reminder commit:YES error:&err]; -} -@end diff --git a/iOSProject/iOSProject/Classes/Helpers/GVUserDefaults+LMJ.h b/iOSProject/iOSProject/Classes/Helpers/GVUserDefaults+LMJ.h deleted file mode 100644 index 5cf26876..00000000 --- a/iOSProject/iOSProject/Classes/Helpers/GVUserDefaults+LMJ.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// GVUserDefaults+LMJ.h -// iOSProject -// -// Created by HuXuPeng on 2017/12/29. -// Copyright © 2017年 HuXuPeng. All rights reserved. -// - -#import - -@interface GVUserDefaults (LMJ) - -/** <#digest#> */ -@property (nonatomic, assign) BOOL isLanuchedApp; - -@end diff --git a/iOSProject/iOSProject/Classes/Helpers/GVUserDefaults+LMJ.m b/iOSProject/iOSProject/Classes/Helpers/GVUserDefaults+LMJ.m deleted file mode 100644 index 3a3a410c..00000000 --- a/iOSProject/iOSProject/Classes/Helpers/GVUserDefaults+LMJ.m +++ /dev/null @@ -1,13 +0,0 @@ -// -// GVUserDefaults+LMJ.m -// iOSProject -// -// Created by HuXuPeng on 2017/12/29. -// Copyright © 2017年 HuXuPeng. All rights reserved. -// - -#import "GVUserDefaults+LMJ.h" - -@implementation GVUserDefaults (LMJ) -@dynamic isLanuchedApp; -@end diff --git a/iOSProject/iOSProject/Classes/Helpers/JXTAlertController.m b/iOSProject/iOSProject/Classes/Helpers/JXTAlertController.m index 9663dd61..02055ae0 100755 --- a/iOSProject/iOSProject/Classes/Helpers/JXTAlertController.m +++ b/iOSProject/iOSProject/Classes/Helpers/JXTAlertController.m @@ -7,6 +7,7 @@ // #import "JXTAlertController.h" +#import //toast默认展示时间 static NSTimeInterval const JXTAlertShowDurationDefault = 1.0f; @@ -65,7 +66,7 @@ - (void)viewDidDisappear:(BOOL)animated } - (void)dealloc { -// NSLog(@"test-dealloc"); + NSLogFunc; } #pragma mark - Private @@ -85,6 +86,7 @@ - (JXTAlertActionsConfig)alertActionsConfig { //创建action __weak typeof(self)weakSelf = self; + [self.jxt_alertActionArray enumerateObjectsUsingBlock:^(JXTAlertActionModel *actionModel, NSUInteger idx, BOOL * _Nonnull stop) { UIAlertAction *alertAction = [UIAlertAction actionWithTitle:actionModel.title style:actionModel.style handler:^(UIAlertAction * _Nonnull action) { __strong typeof(weakSelf)strongSelf = weakSelf; @@ -95,7 +97,7 @@ - (JXTAlertActionsConfig)alertActionsConfig //可利用这个改变字体颜色,但是不推荐!!! // [alertAction setValue:[UIColor grayColor] forKey:@"titleTextColor"]; //action作为self元素,其block实现如果引用本类指针,会造成循环引用 - [self addAction:alertAction]; + [weakSelf addAction:alertAction]; }]; } else @@ -115,7 +117,9 @@ - (instancetype)initAlertControllerWithTitle:(NSString *)title message:(NSString if (!(title.length > 0) && (message.length > 0) && (preferredStyle == UIAlertControllerStyleAlert)) { title = @""; } + self = [[self class] alertControllerWithTitle:title message:message preferredStyle:preferredStyle]; + if (!self) return nil; self.jxt_setAlertAnimated = NO; @@ -124,11 +128,15 @@ - (instancetype)initAlertControllerWithTitle:(NSString *)title message:(NSString return self; } + - (void)alertAnimateDisabled { self.jxt_setAlertAnimated = YES; } + +#pragma mark - addButton + - (JXTAlertActionTitle)addActionDefaultTitle { //该block返回值不是本类属性,只是局部变量,不会造成循环引用 @@ -180,36 +188,28 @@ - (void)jxt_showAlertWithPreferredStyle:(UIAlertControllerStyle)preferredStyle t return ; } //加工链 - appearanceProcess(alertMaker); + !appearanceProcess ?: appearanceProcess(alertMaker); //配置响应 alertMaker.alertActionsConfig(actionBlock); -// alertMaker.alertActionsConfig(^(NSInteger buttonIndex, UIAlertAction *action){ -// if (actionBlock) { -// actionBlock(buttonIndex, action); -// } -// }); - - if (alertMaker.alertDidShown) - { - [self presentViewController:alertMaker animated:!(alertMaker.jxt_setAlertAnimated) completion:^{ - alertMaker.alertDidShown(); - }]; - } - else - { - [self presentViewController:alertMaker animated:!(alertMaker.jxt_setAlertAnimated) completion:NULL]; - } + + [self presentViewController:alertMaker animated:!(alertMaker.jxt_setAlertAnimated) completion:^{ + !alertMaker.alertDidShown ?: alertMaker.alertDidShown(); + }]; } } - (void)jxt_showAlertWithTitle:(NSString *)title message:(NSString *)message appearanceProcess:(JXTAlertAppearanceProcess)appearanceProcess actionsBlock:(JXTAlertActionBlock)actionBlock { - [self jxt_showAlertWithPreferredStyle:UIAlertControllerStyleAlert title:title message:message appearanceProcess:appearanceProcess actionsBlock:actionBlock]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self jxt_showAlertWithPreferredStyle:UIAlertControllerStyleAlert title:title message:message appearanceProcess:appearanceProcess actionsBlock:actionBlock]; + }); } - (void)jxt_showActionSheetWithTitle:(NSString *)title message:(NSString *)message appearanceProcess:(JXTAlertAppearanceProcess)appearanceProcess actionsBlock:(JXTAlertActionBlock)actionBlock { + dispatch_async(dispatch_get_main_queue(), ^{ [self jxt_showAlertWithPreferredStyle:UIAlertControllerStyleActionSheet title:title message:message appearanceProcess:appearanceProcess actionsBlock:actionBlock]; + }); } @@ -230,7 +230,7 @@ + (void)mj_showAlertWithTitle:(nullable NSString *)title appearanceProcess:(JXTAlertAppearanceProcess)appearanceProcess actionsBlock:(nullable JXTAlertActionBlock)actionBlock NS_AVAILABLE_IOS(8_0) { - [[UIApplication sharedApplication].keyWindow.currentViewController jxt_showAlertWithTitle:title message:message appearanceProcess:appearanceProcess actionsBlock:actionBlock]; + [[UIWindow zf_currentViewController] jxt_showAlertWithTitle:title message:message appearanceProcess:appearanceProcess actionsBlock:actionBlock]; } /** @@ -246,7 +246,7 @@ + (void)mj_showActionSheetWithTitle:(nullable NSString *)title appearanceProcess:(JXTAlertAppearanceProcess)appearanceProcess actionsBlock:(nullable JXTAlertActionBlock)actionBlock NS_AVAILABLE_IOS(8_0) { - [[UIApplication sharedApplication].keyWindow.currentViewController jxt_showActionSheetWithTitle:title message:message appearanceProcess:appearanceProcess actionsBlock:actionBlock]; + [[UIWindow zf_currentViewController] jxt_showActionSheetWithTitle:title message:message appearanceProcess:appearanceProcess actionsBlock:actionBlock]; } @end diff --git a/iOSProject/iOSProject/Classes/Helpers/LMJEasyBlankPageView.m b/iOSProject/iOSProject/Classes/Helpers/LMJEasyBlankPageView.m index f927d0e4..873e5067 100644 --- a/iOSProject/iOSProject/Classes/Helpers/LMJEasyBlankPageView.m +++ b/iOSProject/iOSProject/Classes/Helpers/LMJEasyBlankPageView.m @@ -7,15 +7,16 @@ // #import "LMJEasyBlankPageView.h" +#import @interface LMJEasyBlankPageView() -/** <#digest#> */ +/** 加载按钮 */ @property (weak, nonatomic) UIButton *reloadBtn; -/** <#digest#> */ +/** 图片 */ @property (weak, nonatomic) YYAnimatedImageView *imageView; -/** <#digest#> */ +/** 提示 label */ @property (weak, nonatomic) UILabel *tipLabel; -/** <#digest#> */ +/** 按钮点击 */ @property (nonatomic, copy) void(^reloadBlock)(UIButton *sender); @end @@ -31,24 +32,20 @@ - (instancetype)initWithFrame:(CGRect)frame self = [super initWithFrame:frame]; if (self) { [self.tipLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.offset(0); make.left.right.equalTo(self.imageView); make.top.mas_offset(frame.size.height * 0.2); - }]; [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.tipLabel.mas_bottom).offset(10); make.centerX.offset(0); }]; [self.reloadBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.offset(0); make.top.mas_equalTo(self.imageView.mas_bottom).offset(10); - make.left.right.equalTo(self.imageView); +// make.width.mas_equalTo(@94); make.height.mas_equalTo(44); }]; } @@ -73,7 +70,7 @@ - (void)configWithType:(LMJEasyBlankPageViewType)blankPageType hasData:(BOOL)has self.reloadBtn.hidden = NO; self.tipLabel.hidden = NO; self.imageView.hidden = NO; - } else { // !hasData + } else { if (blankPageType == LMJEasyBlankPageViewTypeNoData) { [self.imageView setImage:[UIImage imageNamed:@"common_noRecord"]]; self.tipLabel.text = @"暂无数据"; @@ -87,7 +84,6 @@ - (void)configWithType:(LMJEasyBlankPageViewType)blankPageType hasData:(BOOL)has - (void)reloadClick:(UIButton *)btn { !self.reloadBlock ?: self.reloadBlock(btn); - } - (UIButton *)reloadBtn @@ -115,7 +111,6 @@ - (YYAnimatedImageView *)imageView imageView.autoPlayAnimatedImage = YES; [self addSubview:imageView]; _imageView = imageView; - } return _imageView; } @@ -140,18 +135,18 @@ - (UILabel *)tipLabel -static char BlankPageViewKey; +static void *BlankPageViewKey = &BlankPageViewKey; @implementation UIView (LMJConfigBlank) - (void)setBlankPageView:(LMJEasyBlankPageView *)blankPageView{ - objc_setAssociatedObject(self, &BlankPageViewKey, + objc_setAssociatedObject(self, BlankPageViewKey, blankPageView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } - (LMJEasyBlankPageView *)blankPageView{ - return objc_getAssociatedObject(self, &BlankPageViewKey); + return objc_getAssociatedObject(self, BlankPageViewKey); } - (void)configBlankPage:(LMJEasyBlankPageViewType)blankPageType hasData:(BOOL)hasData hasError:(BOOL)hasError reloadButtonBlock:(void (^)(id))block{ @@ -166,8 +161,7 @@ - (void)configBlankPage:(LMJEasyBlankPageViewType)blankPageType hasData:(BOOL)ha } self.blankPageView.hidden = NO; [self addSubview:self.blankPageView]; - - [self.blankPageView configWithType:blankPageType hasData:hasData hasError:hasError reloadButtonBlock:block]; + [self.blankPageView configWithType:blankPageType hasData:NO hasError:hasError reloadButtonBlock:block]; } } diff --git a/iOSProject/iOSProject/Classes/Helpers/LMJEventTool.h b/iOSProject/iOSProject/Classes/Helpers/LMJEventTool.h new file mode 100755 index 00000000..20f07493 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Helpers/LMJEventTool.h @@ -0,0 +1,68 @@ + +#import +#import + +@interface LMJEventModel : NSObject + +@property (nonatomic, strong) NSString *title; //标题 +@property (nonatomic, strong) NSString *location; //地点 +@property (nonatomic, strong) NSString *startDateStr; //开始时间 +@property (nonatomic, strong) NSString *endDateStr; //结束时间 +@property (nonatomic, assign) BOOL allDay; //是否全天 +@property (nonatomic, strong) NSString *notes; //备注 +// if (alarmStr.length == 0) { +// alarmTime = 0; +// } else if ([alarmStr isEqualToString:@"不提醒"]) { +// alarmTime = 0; +// } else if ([alarmStr isEqualToString:@"1分钟前"]) { +// alarmTime = 60.0 * -1.0f; +// } else if ([alarmStr isEqualToString:@"10分钟前"]) { +// alarmTime = 60.0 * -10.f; +// } else if ([alarmStr isEqualToString:@"30分钟前"]) { +// alarmTime = 60.0 * -30.f; +// } else if ([alarmStr isEqualToString:@"1小时前"]) { +// alarmTime = 60.0 * -60.f; +// } else if ([alarmStr isEqualToString:@"1天前"]) { +// alarmTime = 60.0 * - 60.f * 24; + +@property (nonatomic, strong) NSString *alarmStr; //提醒 + +@end + + +@interface LMJEventTool : NSObject + + + ++ (instancetype)sharedEventTool; + + +/** + 创建日历事件 + + @param title 标题 + @param location 地点 + @param startDateStr 开始时间 + @param endDateStr 结束时间 + @param allDay 是否全天 + @param notes 备注 + @param alarmStr 提醒时间 + */ +- (void)createEventWithEventModel:(LMJEventModel *)eventModel; + +/** + * 删除事件必须 之前创建过,只能删除通过工具创建的事件 + * 删除事件 + */ +- (BOOL)deleteEvent:(LMJEventModel *)eventModel; + +/** + * 删除用户创建的所有事件 + */ +- (void)deleteAllCreatedEvent; + +// 查找 +- (EKEvent *)getEventWithEKEventModel:(LMJEventModel *)eventModel; + + +@end diff --git a/iOSProject/iOSProject/Classes/Helpers/LMJEventTool.m b/iOSProject/iOSProject/Classes/Helpers/LMJEventTool.m new file mode 100755 index 00000000..5a421d84 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Helpers/LMJEventTool.m @@ -0,0 +1,242 @@ + +#import "LMJEventTool.h" + +@implementation LMJEventModel + +@end + + +#define yyyyMMddHHmm @"yyyy-MM-dd HH:mm" +#define SavedLMJEventsIdenti @"SavedLMJEventsIdenti" + +@interface LMJEventTool () + +@property (nonatomic, strong) EKEventStore *myEventStore; + +@end + + +@implementation LMJEventTool + + +static LMJEventTool *eventTool = nil; ++ (instancetype)sharedEventTool { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + eventTool = [[LMJEventTool alloc]init]; + }); + return eventTool; +} + + +/** + * 创建事件 + */ +- (void )createEventWithEventModel:(LMJEventModel *)eventModel { + + EKEventStore * eventStore = [[EKEventStore alloc]init]; + + if ([eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)]) { + [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError * _Nullable error) { + + dispatch_async(dispatch_get_main_queue(), ^{ + if (error) { + NSLog(@"添加失败"); + } else if (!granted) { + NSLog(@"被拒绝"); + } else { + + //判断当前日历中是否已经创建了该事件 + EKEvent *event = [self getEventWithEKEventModel:eventModel]; + + if (event == nil) { + + event = [EKEvent eventWithEventStore:self.myEventStore]; + event.title = eventModel.title; + event.location = eventModel.location; + + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; + [dateFormatter setDateFormat:yyyyMMddHHmm]; + + NSDate *startDate = [dateFormatter dateFromString:eventModel.startDateStr]; + NSDate *endDate = [dateFormatter dateFromString:eventModel.endDateStr]; + event.startDate = startDate; + event.endDate = endDate; + event.allDay = eventModel.allDay; + event.notes = eventModel.notes; + if (eventModel.alarmStr.length) { + NSInteger alarmTime = [self getAlarmWithStr:eventModel.alarmStr]; + if (alarmTime != 0) { + [event addAlarm:[EKAlarm alarmWithRelativeOffset:alarmTime]]; + } + } + + [event setCalendar:[self.myEventStore defaultCalendarForNewEvents]]; + NSError *err; + BOOL isSave; + isSave = [self.myEventStore saveEvent:event span:EKSpanThisEvent error:&err]; + if (isSave) { + NSString *identifer = event.eventIdentifier; + + NSMutableArray *tmpArr = [NSMutableArray arrayWithObject:identifer]; + + + NSMutableArray *arr = [[NSUserDefaults standardUserDefaults] objectForKey:SavedLMJEventsIdenti]; + if (!arr) { + [[NSUserDefaults standardUserDefaults] setObject:tmpArr forKey:SavedLMJEventsIdenti]; + } else { + [tmpArr addObjectsFromArray:arr]; + [[NSUserDefaults standardUserDefaults] setObject:tmpArr forKey:SavedLMJEventsIdenti]; + } + } + } + } + + }) ; + }]; + } +} + + + +/** + * 删除事件 + */ +- (BOOL)deleteEvent:(LMJEventModel *)eventModel { + + + BOOL isDeleted = NO; + NSString *eventIdentif; + + EKEvent * event = [self getEventWithEKEventModel:eventModel]; + eventIdentif = event.eventIdentifier; + NSError *err = nil; + isDeleted = [self.myEventStore removeEvent:event span:EKSpanThisEvent commit:YES error:&err]; + + if (isDeleted) { + [self clearIdentifier:eventIdentif]; + } + + return isDeleted; +} + +//删除后,清除 NSUserDefaults 中的 identifier +- (void)clearIdentifier:(NSString *)identifier { + NSMutableArray *savedArr = [[NSUserDefaults standardUserDefaults] objectForKey:SavedLMJEventsIdenti]; + + NSArray *newArray = [savedArr filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF != %@", identifier]]; + + [[NSUserDefaults standardUserDefaults] setObject:newArray forKey:SavedLMJEventsIdenti]; +} + +/** + * 使用 identifier删除 + */ +-(void)deleteWithIdentifier:(NSString *)identifier { + if (!self.myEventStore) { + self.myEventStore = [[EKEventStore alloc]init]; + } + + EKEvent *event = [self.myEventStore eventWithIdentifier:identifier]; + NSLog(@"eventtitle == %@", event.title); + + BOOL isDeleted = NO; + + NSError *err = nil; + isDeleted = [self.myEventStore removeEvent:event span:EKSpanThisEvent commit:YES error:&err]; + + if (isDeleted) { + [self clearIdentifier:event.eventIdentifier]; + } +} + +/** + * 删除全部保存的 + */ +- (void)deleteAllCreatedEvent { + + NSMutableArray *savedArr = [[NSUserDefaults standardUserDefaults] objectForKey:SavedLMJEventsIdenti]; + + for (int i = 0; i < savedArr.count; i++) { + NSString *eventIdentifier = savedArr[i]; + [self deleteWithIdentifier:eventIdentifier]; + } + + [[NSUserDefaults standardUserDefaults] removeObjectForKey:SavedLMJEventsIdenti]; +} + +/** + * 查找日历事件中相同的事件 + */ +- (EKEvent *)getEventWithEKEventModel:(LMJEventModel *)eventModel { + + EKEventStore * eventStore = [[EKEventStore alloc]init]; + self.myEventStore = eventStore; + + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; + [dateFormatter setDateFormat:yyyyMMddHHmm]; + + NSDate *startDate = [dateFormatter dateFromString:eventModel.startDateStr]; + NSDate *endDate = [dateFormatter dateFromString:eventModel.endDateStr]; + + NSPredicate *predicate = [eventStore predicateForEventsWithStartDate:startDate endDate:endDate calendars:@[[eventStore defaultCalendarForNewEvents]]]; + + NSArray *events = [eventStore eventsMatchingPredicate:predicate]; + + EKEvent *resultEvent = nil; + if (events) { + for (EKEvent *event in events) { + if ([self checkEvent:event sameWithEvent:eventModel]) { + resultEvent = event; + } + } + } + return resultEvent; +} + +/** + * 判断两个事件是否相同 + */ +- (BOOL)checkEvent:(EKEvent *)event sameWithEvent:(LMJEventModel *)eventModel { + + NSInteger modelAlarm = [self getAlarmWithStr:eventModel.alarmStr]; + + EKAlarm *eventAlarm = event.alarms[0]; + NSInteger alarmInt = eventAlarm.relativeOffset; + + //项目中日程 只有 标题和 时间 和提醒时间 所有只做两个判断 + if ([event.title isEqualToString: eventModel.title] && (modelAlarm == alarmInt)) { + return YES; + } else { + return NO; + } +} + +/** + * 获得提醒 NSinteger + */ +- (NSInteger)getAlarmWithStr:(NSString *)alarmStr { + + NSInteger alarmTime; + if (alarmStr.length == 0) { + alarmTime = 0; + } else if ([alarmStr isEqualToString:@"不提醒"]) { + alarmTime = 0; + } else if ([alarmStr isEqualToString:@"1分钟前"]) { + alarmTime = 60.0 * -1.0f; + } else if ([alarmStr isEqualToString:@"10分钟前"]) { + alarmTime = 60.0 * -10.f; + } else if ([alarmStr isEqualToString:@"30分钟前"]) { + alarmTime = 60.0 * -30.f; + } else if ([alarmStr isEqualToString:@"1小时前"]) { + alarmTime = 60.0 * -60.f; + } else if ([alarmStr isEqualToString:@"1天前"]) { + alarmTime = 60.0 * - 60.f * 24; + }else { + alarmTime = 0; + } + return alarmTime; +} + + +@end diff --git a/iOSProject/iOSProject/Classes/Helpers/LMJUMengHelper.h b/iOSProject/iOSProject/Classes/Helpers/LMJUMengHelper.h index 35120317..e5d20d7f 100644 --- a/iOSProject/iOSProject/Classes/Helpers/LMJUMengHelper.h +++ b/iOSProject/iOSProject/Classes/Helpers/LMJUMengHelper.h @@ -18,16 +18,13 @@ */ + (void)UMAnalyticStart; - /** 初始化第三方登录和分享 */ + (void)UMSocialStart; - /** 初始化推送 - */ + (void)UMPushStart:(NSDictionary *)launchOptions; @@ -37,7 +34,7 @@ @param title 分享的标题 @param subTitle 内容 - @param thumbImage 缩略图 + @param thumbImage 缩略图 url @param shareURL 分享的url */ + (void)shareTitle:(NSString *)title subTitle:(NSString *)subTitle thumbImage:(NSString *)thumbImage shareURL:(NSString *)shareURL; diff --git a/iOSProject/iOSProject/Classes/Helpers/LMJUMengHelper.m b/iOSProject/iOSProject/Classes/Helpers/LMJUMengHelper.m index 20c39174..de20b7e5 100644 --- a/iOSProject/iOSProject/Classes/Helpers/LMJUMengHelper.m +++ b/iOSProject/iOSProject/Classes/Helpers/LMJUMengHelper.m @@ -11,9 +11,7 @@ @implementation LMJUMengHelper + (void)UMAnalyticStart { - // 友盟统计 - // UM统计 UMConfigInstance.appKey = LMJThirdSDKUMConfigInstanceAppKey; // UMConfigInstance.ChannelId:@"Web" 中的Web 替换为您应用的推广渠道。channelId为nil或@""时,默认会被当作@"App Store"渠道。 UMConfigInstance.channelId = LMJThirdSDKUMConfigInstanceChannelId; @@ -21,15 +19,12 @@ + (void)UMAnalyticStart { [MobClick setAppVersion:XcodeAppVersion]; [MobClick startWithConfigure:UMConfigInstance];//配置以上参数后调用此方法初始化SDK! /** 设置是否开启background模式, 默认YES. */ - // [MobClick setBackgroundTaskEnabled:YES]; +// [MobClick setBackgroundTaskEnabled:YES]; #ifdef DEBUG // 打开友盟sdk调试,注意Release发布时需要注释掉此行,减少io消耗 [MobClick setLogEnabled:YES]; - #endif - - return; } @@ -42,7 +37,7 @@ + (void)UMSocialStart [[UMSocialManager defaultManager] setUmSocialAppkey:LMJThirdSDKUMSocialAppkey]; // 获取友盟social版本号 - //NSLog(@"UMeng social version: %@", [UMSocialGlobal umSocialSDKVersion]); + NSLog(@"UMeng social version: %@", [UMSocialGlobal umSocialSDKVersion]); //设置微信的appKey和appSecret [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_WechatSession appKey:LMJThirdSDKWeChatAppKey appSecret:LMJThirdSDKWeChatAppSecret redirectURL:LMJThirdSDKWeChatRedirectURL]; @@ -61,12 +56,9 @@ + (void)UMSocialStart // 如果不想显示平台下的某些类型,可用以下接口设置 // [[UMSocialManager defaultManager] removePlatformProviderWithPlatformTypes:@[@(UMSocialPlatformType_AlipaySession),@(UMSocialPlatformType_Email),@(UMSocialPlatformType_Sms), @(UMSocialPlatformType_WechatFavorite), @(UMSocialPlatformType_TencentWb)]]; - #ifdef DEBUG - //打开调试日志 [[UMSocialManager defaultManager] openLog:YES]; - #endif } @@ -76,11 +68,9 @@ + (void)UMPushStart:(NSDictionary *)launchOptions //初始化方法,也可以使用(void)startWithAppkey:(NSString *)appKey launchOptions:(NSDictionary * )launchOptions httpsenable:(BOOL)value;这个方法,方便设置https请求。 [UMessage startWithAppkey:LMJThirdSDKUMessageStartWithAppkey launchOptions:launchOptions]; - //注册通知,如果要使用category的自定义策略,可以参考demo中的代码。 [UMessage registerForRemoteNotifications]; - //iOS10必须加下面这段代码。 UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; @@ -88,26 +78,21 @@ + (void)UMPushStart:(NSDictionary *)launchOptions UNAuthorizationOptions types10 = UNAuthorizationOptionBadge | UNAuthorizationOptionAlert | UNAuthorizationOptionSound; - [center requestAuthorizationWithOptions:types10 completionHandler:^(BOOL granted, NSError * _Nullable error) { + [center requestAuthorizationWithOptions:types10 completionHandler:^(BOOL granted, NSError * _Nullable error) { if (granted) { //点击允许 //这里可以添加一些自己的逻辑 NSLog(@"用户允许"); - } else { //点击不允许 //这里可以添加一些自己的逻辑 NSLog(@"用户拒绝"); - } }]; - #ifdef DEBUG - //打开日志,方便调试 [UMessage setLogEnabled:YES]; - #endif } @@ -117,14 +102,10 @@ + (void)UMPushStart:(NSDictionary *)launchOptions + (void)shareTitle:(NSString *)title subTitle:(NSString *)subTitle thumbImage:(NSString *)thumbImage shareURL:(NSString *)shareURL { - //显示分享面板 //显示分享面板 [UMSocialUIManager showShareMenuViewInWindowWithPlatformSelectionBlock:^(UMSocialPlatformType platformType, NSDictionary *userInfo) { // 根据获取的platformType确定所选平台进行下一步操作 - [self shareWebPageToPlatformType:platformType shareTitle:title subTitle:subTitle thumbImage:thumbImage shareURL:shareURL]; - - }]; } @@ -156,12 +137,9 @@ + (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType shareTitle //第三方原始返回的数据 NSLog(@"response originalResponse data is %@",resp.originalResponse); - - }else{ NSLog(@"response data is %@",data); } - // 分享成功的通知 [[NSNotificationCenter defaultCenter] postNotificationName:LMJUMSocialShareSucceedNotification object:shareURL]; } @@ -347,24 +325,20 @@ + (void)getUserInfoForPlatform:(UMSocialPlatformType)platformType completion:(vo #pragma mark - 统计 + (void)beginLogPageView:(__unsafe_unretained Class)pageView { [MobClick beginLogPageView:NSStringFromClass(pageView)]; - return; } + (void)endLogPageView:(__unsafe_unretained Class)pageView { [MobClick endLogPageView:NSStringFromClass(pageView)]; - return; } +(void)beginLogPageViewName:(NSString *)pageViewName { [MobClick beginLogPageView:pageViewName]; - return; } +(void)endLogPageViewName:(NSString *)pageViewName { [MobClick endLogPageView:pageViewName]; - return; } @end diff --git a/iOSProject/iOSProject/Classes/Helpers/PresentAnimator.h b/iOSProject/iOSProject/Classes/Helpers/PresentAnimator.h new file mode 100644 index 00000000..ab11c23f --- /dev/null +++ b/iOSProject/iOSProject/Classes/Helpers/PresentAnimator.h @@ -0,0 +1,31 @@ +// +// PresentAnimator.h +// transparentwebview +// +// Created by HuXuPeng on 2018/3/14. +// Copyright © 2018年 prjk. All rights reserved. +// + +#import + +@interface PresentAnimator : NSObject + +/** + present动画 +// A presentViewController B 后,a.presentedViewController就是b,b.presentingViewController就是a, + @param viewController viewController + @param presentViewController A + @param presentViewFrame B + @param animated 是否做动画 + @param completion 完成的回调 + @param duration 动画时长 + @param presentAnimation presentAnimation 结束后需要调用 completionHandler + @param dismissAnimation dismissAnimation 结束后需要调用 completionHandler + */ ++ (void)viewController:(UIViewController *)viewController presentViewController:(UIViewController *)presentViewController presentViewFrame:(CGRect)presentViewFrame animated:(BOOL)animated completion:(void (^)(void))completion animatedDuration:(NSTimeInterval)duration presentAnimation:(void(^)(UIView *presentedView, UIView *containerView, void(^completionHandler)(BOOL finished)))presentAnimation dismissAnimation:(void(^)(UIView *dismissView, void(^completionHandler)(BOOL finished)))dismissAnimation; + +@end + +@interface LMJPresentationController : UIPresentationController +@property (nonatomic, assign) CGRect presentViewFrame; +@end diff --git a/iOSProject/iOSProject/Classes/Helpers/PresentAnimator.m b/iOSProject/iOSProject/Classes/Helpers/PresentAnimator.m new file mode 100644 index 00000000..d41a2662 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Helpers/PresentAnimator.m @@ -0,0 +1,150 @@ +// +// PresentAnimator.m +// transparentwebview +// +// Created by HuXuPeng on 2018/3/14. +// Copyright © 2018年 prjk. All rights reserved. +// + +#import "PresentAnimator.h" + +void *id_key = &id_key; +@implementation UIViewController (LMJAdd) + +- (void)setId_key:(id)obj { + objc_setAssociatedObject(self, id_key, obj, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (id)id_key +{ + return objc_getAssociatedObject(self, id_key); +} + +@end + +@interface PresentAnimator() +{ + BOOL _isPresented; + CGRect _presentViewFrame; + void(^_presentAnimation)(UIView *presentedView, UIView *containerView, void(^completion)(BOOL finished)); + void(^_dismissAnimation)(UIView *dismissView, void(^completion)(BOOL finished)); + CGFloat _animatedDuration; +} + +@end + + +@implementation PresentAnimator + +#pragma mark - UIViewControllerTransitioningDelegate + +- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source { + // A presentViewController B 后,a.presentedViewController就是b,b.presentingViewController就是a, + LMJPresentationController *presVc = [[LMJPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting]; + if (!CGRectIsEmpty(_presentViewFrame)) { + presVc.presentViewFrame = _presentViewFrame; + }else { + presVc.presentViewFrame = [UIScreen mainScreen].bounds; + } + + return presVc; +} + +- (nullable id )animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source +{ + _isPresented = YES; + return self; +} + +- (nullable id )animationControllerForDismissedController:(UIViewController *)dismissed +{ + _isPresented = NO; + return self; +} + + +#pragma mark - UIViewControllerAnimatedTransitioning + +- (NSTimeInterval)transitionDuration:(id)transitionContext +{ + return _animatedDuration; +} + +- (void)animateTransition:(id)transitionContext +{ + _isPresented ? [self presentAnimateTransition: transitionContext] : [self dismissAnimateTransition: transitionContext]; +} + +- (void)presentAnimateTransition:(id)transitionContext +{ + // A presentViewController B 后,a.presentedViewController就是b,b.presentingViewController就是a, + UIView *containerView = transitionContext.containerView; + UIView *presentedView = [transitionContext viewForKey:UITransitionContextToViewKey]; + [containerView addSubview:presentedView]; + + if (_presentAnimation) { + LMJWeak(presentedView); + LMJWeak(transitionContext); + LMJWeak(containerView); + _presentAnimation(weakpresentedView, weakcontainerView, ^void(BOOL isFinished){ + ///当view的缩放动画完成的时候, 一定要告诉转场上下文 + [weaktransitionContext completeTransition:isFinished]; + }); + }else { + ///当view的缩放动画完成的时候, 一定要告诉转场上下文 + [transitionContext completeTransition:YES]; + } +} + +- (void)dismissAnimateTransition:(id)transitionContext +{ + // A presentViewController B 后,a.presentedViewController就是b,b.presentingViewController就是a, + UIView *dismissView = [transitionContext viewForKey:UITransitionContextFromViewKey]; + + if (_dismissAnimation) { + LMJWeak(dismissView); + LMJWeak(transitionContext); + _dismissAnimation(weakdismissView, ^void(BOOL isFinished){ + [weakdismissView removeFromSuperview]; + ///当view的缩放动画完成的时候, 一定要告诉转场上下文 + [weaktransitionContext completeTransition:isFinished]; + }); + }else { + [dismissView removeFromSuperview]; + ///当view的缩放动画完成的时候, 一定要告诉转场上下文 + [transitionContext completeTransition:YES]; + } +} + + ++ (void)viewController:(UIViewController *)viewController presentViewController:(UIViewController *)presentViewController presentViewFrame:(CGRect)presentViewFrame animated:(BOOL)animated completion:(void (^)(void))completion animatedDuration:(NSTimeInterval)duration presentAnimation:(void(^)(UIView *presentedView, UIView *containerView, void(^completionHandler)(BOOL finished)))presentAnimation dismissAnimation:(void(^)(UIView *dismissView, void(^completionHandler)(BOOL finished)))dismissAnimation +{ + PresentAnimator *animator = [[PresentAnimator alloc] init]; + animator->_presentViewFrame = presentViewFrame; + animator->_animatedDuration = duration; + animator->_presentAnimation = [presentAnimation copy]; + animator->_dismissAnimation = [dismissAnimation copy]; + [presentViewController setId_key:animator]; + presentViewController.modalPresentationStyle = UIModalPresentationCustom; + presentViewController.transitioningDelegate = animator; + [viewController presentViewController:presentViewController animated:animated completion:completion]; +} + +@end + + +@implementation LMJPresentationController + +- (void)containerViewWillLayoutSubviews { + [super containerViewWillLayoutSubviews]; + self.presentedView.frame = self.presentViewFrame; +} + +@end + + + + + + + diff --git a/iOSProject/iOSProject/Classes/Helpers/TDTouchID.h b/iOSProject/iOSProject/Classes/Helpers/TDTouchID.h new file mode 100644 index 00000000..e1179af6 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Helpers/TDTouchID.h @@ -0,0 +1,83 @@ + + + +#import + +/** + * TouchID 状态 + */ +typedef NS_ENUM(NSUInteger, TDTouchIDState){ + + /** + * 当前设备不支持TouchID + */ + TDTouchIDStateNotSupport = 0, + /** + * TouchID 验证成功 + */ + TDTouchIDStateSuccess = 1, + + /** + * TouchID 验证失败 + */ + TDTouchIDStateFail = 2, + /** + * TouchID 被用户手动取消 + */ + TDTouchIDStateUserCancel = 3, + /** + * 用户不使用TouchID,选择手动输入密码 + */ + TDTouchIDStateInputPassword = 4, + /** + * TouchID 被系统取消 (如遇到来电,锁屏,按了Home键等) + */ + TDTouchIDStateSystemCancel = 5, + /** + * TouchID 无法启动,因为用户没有设置密码 + */ + TDTouchIDStatePasswordNotSet = 6, + /** + * TouchID 无法启动,因为用户没有设置TouchID + */ + TDTouchIDStateTouchIDNotSet = 7, + /** + * TouchID 无效 + */ + TDTouchIDStateTouchIDNotAvailable = 8, + /** + * TouchID 被锁定(连续多次验证TouchID失败,系统需要用户手动输入密码) + */ + TDTouchIDStateTouchIDLockout = 9, + /** + * 当前软件被挂起并取消了授权 (如App进入了后台等) + */ + TDTouchIDStateAppCancel = 10, + /** + * 当前软件被挂起并取消了授权 (LAContext对象无效) + */ + TDTouchIDStateInvalidContext = 11, + /** + * 系统版本不支持TouchID (必须高于iOS 8.0才能使用) + */ + TDTouchIDStateVersionNotSupport = 12 +}; + + + +@interface TDTouchID : NSObject + +typedef void (^StateBlock)(TDTouchIDState state,NSError *error); + + +/** + 启动TouchID进行验证 + + @param desc Touch显示的描述 + @param block 回调状态的block + */ + ++ (void)td_showTouchIDWithDescribe:(NSString *)desc BlockState:(StateBlock)block; + + +@end diff --git a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDTouchID/TDTouchID.m b/iOSProject/iOSProject/Classes/Helpers/TDTouchID.m similarity index 87% rename from iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDTouchID/TDTouchID.m rename to iOSProject/iOSProject/Classes/Helpers/TDTouchID.m index 5d958f8b..be205025 100644 --- a/iOSProject/Pods/TDTouchID/TDTouchID/TDTouchID/TDTouchID/TDTouchID.m +++ b/iOSProject/iOSProject/Classes/Helpers/TDTouchID.m @@ -1,25 +1,10 @@ -// -// TDTouchID.m -// TDTouchID -// -// Created by imtudou on 2016/11/19. -// Copyright © 2016年 TuDou. All rights reserved. -// + #import "TDTouchID.h" @implementation TDTouchID -+ (instancetype)sharedInstance { - static TDTouchID *instance = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [[TDTouchID alloc] init]; - }); - return instance; -} - --(void)td_showTouchIDWithDescribe:(NSString *)desc BlockState:(StateBlock)block{ ++ (void)td_showTouchIDWithDescribe:(NSString *)desc BlockState:(StateBlock)block{ if (NSFoundationVersionNumber < NSFoundationVersionNumber_iOS_8_0) { @@ -31,15 +16,15 @@ -(void)td_showTouchIDWithDescribe:(NSString *)desc BlockState:(StateBlock)block{ return; } - LAContext *context = [[LAContext alloc]init]; + LAContext *context = [[LAContext alloc] init]; - context.localizedFallbackTitle = desc; + context.localizedFallbackTitle = desc ?: @"通过Home键验证已有指纹"; NSError *error = nil; if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { - [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:desc == nil ? @"通过Home键验证已有指纹":desc reply:^(BOOL success, NSError * _Nullable error) { + [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:desc ?: @"通过Home键验证已有指纹" reply:^(BOOL success, NSError * _Nullable error) { if (success) { dispatch_async(dispatch_get_main_queue(), ^{ diff --git a/iOSProject/iOSProject/Classes/Helpers/UIImageView+FitNet.h b/iOSProject/iOSProject/Classes/Helpers/UIImageView+FitNet.h index fc55fa5f..3fb0db25 100644 --- a/iOSProject/iOSProject/Classes/Helpers/UIImageView+FitNet.h +++ b/iOSProject/iOSProject/Classes/Helpers/UIImageView+FitNet.h @@ -11,8 +11,8 @@ @interface UIImageView (FitNet) - +//typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize); +//typedef void(^SDWebImageCompletionBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL); - (void)lmj_setImageWithURL:(NSURL *)originImageURL thumbnailImageURL:(NSURL *)thumbImageURL placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDExternalCompletionBlock)completedBlock; - @end diff --git a/iOSProject/iOSProject/Classes/Helpers/UIImageView+FitNet.m b/iOSProject/iOSProject/Classes/Helpers/UIImageView+FitNet.m index 6df172ab..d2a1440f 100644 --- a/iOSProject/iOSProject/Classes/Helpers/UIImageView+FitNet.m +++ b/iOSProject/iOSProject/Classes/Helpers/UIImageView+FitNet.m @@ -27,29 +27,17 @@ - (void)lmj_setImageWithURL:(NSURL *)originImageURL thumbnailImageURL:(NSURL *)t if (mgr.isReachableViaWiFi || isInCache) { [self sd_setImageWithURL:originImageURL placeholderImage:placeholder options:options progress:progressBlock completed:completedBlock]; - }else if (mgr.isReachableViaWWAN) - { - + }else if (mgr.isReachableViaWWAN) { // 沙盒中去取, 让用户选择 BOOL is3GOr4GNeedOriginal = YES; - if (is3GOr4GNeedOriginal) { - [self sd_setImageWithURL:originImageURL placeholderImage:placeholder options:options progress:progressBlock completed:completedBlock]; - }else - { - + }else { [self sd_setImageWithURL:thumbImageURL placeholderImage:placeholder options:options progress:progressBlock completed:completedBlock]; - } - - }else - { + }else{ [self sd_setImageWithURL:thumbImageURL placeholderImage:placeholder options:options progress:progressBlock completed:completedBlock]; - } - - }]; } diff --git "a/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel(\345\210\267\346\226\260\347\216\207)/YYFPSLabel.h" "b/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel(\345\210\267\346\226\260\347\216\207)/YYFPSLabel.h" deleted file mode 100755 index e7d1daa4..00000000 --- "a/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel(\345\210\267\346\226\260\347\216\207)/YYFPSLabel.h" +++ /dev/null @@ -1,30 +0,0 @@ -// -// YYFPSLabel.h -// YYKitExample -// -// 运用Demo -// @property (nonatomic, strong) YYFPSLabel *fpsLabel; -// -// _fpsLabel = [YYFPSLabel new]; -// [_fpsLabel sizeToFit]; -// _fpsLabel.bottom = 100; -// _fpsLabel.left = 10; -// _fpsLabel.alpha = 1; -// [self.view addSubview:_fpsLabel]; -// -// Created by ibireme on 15/9/3. -// Copyright (c) 2015 ibireme. All rights reserved. -// - -#import - -/** - Show Screen FPS... - - The maximum fps in OSX/iOS Simulator is 60.00. - The maximum fps on iPhone is 59.97. - The maxmium fps on iPad is 60.0. - */ -@interface YYFPSLabel : UILabel - -@end diff --git a/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel.h b/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel.h new file mode 100755 index 00000000..b9fa7d0f --- /dev/null +++ b/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel.h @@ -0,0 +1,14 @@ + + +#import + +/** + Show Screen FPS... + + The maximum fps in OSX/iOS Simulator is 60.00. + The maximum fps on iPhone is 59.97. + The maxmium fps on iPad is 60.0. + */ +@interface YYFPSLabel : UILabel + +@end diff --git "a/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel(\345\210\267\346\226\260\347\216\207)/YYFPSLabel.m" b/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel.m similarity index 89% rename from "iOSProject/iOSProject/Classes/Helpers/YYFPSLabel(\345\210\267\346\226\260\347\216\207)/YYFPSLabel.m" rename to iOSProject/iOSProject/Classes/Helpers/YYFPSLabel.m index 763a3e8d..838470f3 100755 --- "a/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel(\345\210\267\346\226\260\347\216\207)/YYFPSLabel.m" +++ b/iOSProject/iOSProject/Classes/Helpers/YYFPSLabel.m @@ -16,7 +16,6 @@ @implementation YYFPSLabel { NSTimeInterval _lastTime; UIFont *_font; UIFont *_subFont; - NSTimeInterval _llll; } @@ -44,15 +43,8 @@ - (instancetype)initWithFrame:(CGRect)frame { _link = [CADisplayLink displayLinkWithTarget:weakSelf selector:@selector(tick:)]; [_link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; - [self addGestureRecognizer:[[UIPanGestureRecognizer alloc] initWithActionBlock:^(UIPanGestureRecognizer *_Nonnull sender) { - -// NSLog(@"%@", sender); - - // 获取手势的触摸点 - // CGPoint curP = [pan locationInView:self.imageView]; - - // 移动视图 + // 获取手势的移动,也是相对于最开始的位置 CGPoint transP = [sender translationInView:weakSelf]; @@ -64,8 +56,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (sender.state == UIGestureRecognizerStateEnded) { [UIView animateWithDuration:0.2 animations:^{ - - weakSelf.lmj_x = (weakSelf.lmj_x - kScreenWidth / 2) > 0 ? (kScreenWidth - weakSelf.lmj_width - 20) : 20; + weakSelf.lmj_x = (weakSelf.lmj_x - kScreenWidth * 0.5) > 0 ? (kScreenWidth - weakSelf.lmj_width - 20) : 20; weakSelf.lmj_y = weakSelf.lmj_y > 80 ? weakSelf.lmj_y : 80; }]; } @@ -77,10 +68,7 @@ - (instancetype)initWithFrame:(CGRect)frame { - (void)dealloc { [_link invalidate]; -} - -- (CGSize)sizeThatFits:(CGSize)size { - return kSize; + _link = nil; } - (void)tick:(CADisplayLink *)link { @@ -88,12 +76,11 @@ - (void)tick:(CADisplayLink *)link { _lastTime = link.timestamp; return; } - _count++; NSTimeInterval delta = link.timestamp - _lastTime; if (delta < 1) return; _lastTime = link.timestamp; - float fps = _count / delta; + CGFloat fps = _count / delta; _count = 0; CGFloat progress = fps / 60.0; diff --git "a/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseHelper.h" "b/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseHelper.h" index e6955912..e6861bbc 100644 --- "a/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseHelper.h" +++ "b/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseHelper.h" @@ -14,6 +14,6 @@ + (instancetype)sharedInstance; -+(void)showAdvertiserView:(NSArray *)imageArray; ++ (void)showAdvertiserView:(NSArray *)imageArray; @end diff --git "a/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseHelper.m" "b/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseHelper.m" index 00d62208..69ec419a 100644 --- "a/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseHelper.m" +++ "b/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseHelper.m" @@ -8,18 +8,17 @@ #import "AdvertiseHelper.h" +static NSString *const adImageName = @"adImageName"; @implementation AdvertiseHelper +static AdvertiseHelper* _instance = nil; + (instancetype)sharedInstance { - static AdvertiseHelper* instance = nil; - static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - instance = [[self alloc] init]; + _instance = [[self alloc] init]; }); - - return instance; + return _instance; } - (instancetype)init @@ -32,18 +31,16 @@ - (instancetype)init } -+(void)showAdvertiserView:(NSArray *)imageArray ++ (void)showAdvertiserView:(NSArray *)imageArray { // 1.判断沙盒中是否存在广告图片,如果存在,直接显示 NSString *filePath = [[AdvertiseHelper sharedInstance] getFilePathWithImageName:[NSUserDefaults.standardUserDefaults valueForKey:adImageName]]; BOOL isExist = [[AdvertiseHelper sharedInstance] isFileExistWithFilePath:filePath]; if (isExist) {// 图片存在 - AdvertiseView *advertiseView = [[AdvertiseView alloc] initWithFrame:UIScreen.mainScreen.bounds]; advertiseView.filePath = filePath; [advertiseView show]; - } // 2.无论沙盒中是否存在广告图片,都需要重新调用广告接口,判断广告是否更新 @@ -54,11 +51,10 @@ +(void)showAdvertiserView:(NSArray *)imageArray /** * 初始化广告页面 */ -- (void)getAdvertisingImage:(NSArray *)imageArray +- (void)getAdvertisingImage:(NSArray *)imageArray { //随机取一张 NSString *imageUrl = imageArray[arc4random() % imageArray.count]; - NSArray *stringArr = [imageUrl componentsSeparatedByString:@"/"]; NSString *imageName = stringArr.lastObject; @@ -89,8 +85,6 @@ - (void)downloadAdImageWithUrl:(NSString *)imageUrl imageName:(NSString *)imageN dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageUrl]]; -// YYImage *image = [YYImage imageWithData:data]; - NSString *filePath = [self getFilePathWithImageName:imageName]; // 保存文件的名称 if ([data writeToFile:filePath atomically:YES]) {// 保存成功 @@ -127,22 +121,19 @@ - (NSString *)getFilePathWithImageName:(NSString *)imageName if (imageName) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask, YES); NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:imageName]; - return filePath; } - return nil; } //NotificationContants_Advertise_Key - (void)adClick:(NSNotification *)noti { - NSString *url = @"https://github.com/NJHu/iOSProject/blob/master/README.md"; + NSString *url = @"https://github.com/NJHu"; if (!LMJIsEmpty(url)) { if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:url]]) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url] options:@{@"username" : @"njhu"} completionHandler:^(BOOL success) { - - NSLog(@"%zd", success); + NSLog(@"%d", success); }]; } } diff --git "a/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseView.h" "b/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseView.h" index 05e3b31a..722ed42f 100644 --- "a/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseView.h" +++ "b/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseView.h" @@ -10,9 +10,6 @@ UIKIT_EXTERN NSString *const NotificationContants_Advertise_Key; - -static NSString *const adImageName = @"adImageName"; - @interface AdvertiseView : UIView /** 显示广告页面方法*/ diff --git "a/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseView.m" "b/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseView.m" index c2c612cd..31f24982 100644 --- "a/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseView.m" +++ "b/iOSProject/iOSProject/Classes/Helpers/\345\271\277\345\221\212\351\241\265/AdvertiseView.m" @@ -7,16 +7,22 @@ // #import "AdvertiseView.h" +#import +#import + +NSString *const NotificationContants_Advertise_Key = @"NotificationContants_Advertise_Key"; @interface AdvertiseView() + @property (nonatomic, strong) YYAnimatedImageView *adView; @property (nonatomic, strong) UIButton *countBtn; -@property (nonatomic, strong) NSTimer *countTimer; -@property (nonatomic, assign) int count; +@property (nonatomic, assign) NSUInteger count; + +@property (nonatomic, strong) dispatch_source_t gcdTimer; @end //广告显示的时间 -static int const showtime = 5; +static const NSUInteger showtime = 5; @implementation AdvertiseView @@ -38,7 +44,7 @@ - (instancetype)initWithFrame:(CGRect)frame CGFloat btnH = 30; _countBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreenWidth - btnW - 24, [UIApplication sharedApplication].statusBarFrame.size.height + btnH, btnW, btnH)]; [_countBtn addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside]; - [_countBtn setTitle:[NSString stringWithFormat:@"跳过%d", showtime] forState:UIControlStateNormal]; + [_countBtn setTitle:[NSString stringWithFormat:@"跳过%zd", showtime] forState:UIControlStateNormal]; _countBtn.titleLabel.font = [UIFont systemFontOfSize:15]; [_countBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; _countBtn.backgroundColor = [UIColor colorWithRed:38 /255.0 green:38 /255.0 blue:38 /255.0 alpha:0.6]; @@ -57,92 +63,65 @@ - (void)setFilePath:(NSString *)filePath _adView.image = [YYImage imageWithContentsOfFile:filePath]; } -NSString *const NotificationContants_Advertise_Key = @"NotificationContants_Advertise_Key"; - (void)pushToAd{ [self dismiss]; - [[NSNotificationCenter defaultCenter] postNotificationName:NotificationContants_Advertise_Key object:nil userInfo:nil]; } -- (void)countDown -{ - _count --; - [_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",_count] forState:UIControlStateNormal]; - if (_count == 0) { - - if (_countTimer) { - [_countTimer invalidate]; - _countTimer = nil; - } - [self dismiss]; - } -} - (void)show { // 倒计时方法1:GCD - // [self startCoundown]; + [self startCoundown]; - // 倒计时方法2:定时器 - [self startTimer]; UIWindow *window = [UIApplication sharedApplication].keyWindow; [window addSubview:self]; } -// 定时器倒计时 -- (void)startTimer -{ - _count = showtime; - - if (!_countTimer) { - _countTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(countDown) userInfo:nil repeats:YES]; - [[NSRunLoop mainRunLoop] addTimer:_countTimer forMode:NSRunLoopCommonModes]; - } -} // GCD倒计时 - (void)startCoundown { __block int timeout = showtime + 1; //倒计时时间 + 1 - dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); - dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,queue); - dispatch_source_set_timer(_timer,dispatch_walltime(NULL, 0),1.0 * NSEC_PER_SEC, 0); //每秒执行 - dispatch_source_set_event_handler(_timer, ^{ + LMJWeak(self); + // GCD 定时器 + self.gcdTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue()); + dispatch_source_set_timer(self.gcdTimer, dispatch_time(DISPATCH_TIME_NOW, 0), 1 * NSEC_PER_SEC, 0); //每秒执行 + dispatch_source_set_event_handler(self.gcdTimer, ^{ if(timeout <= 0){ //倒计时结束,关闭 - dispatch_source_cancel(_timer); - dispatch_async(dispatch_get_main_queue(), ^{ - - [self dismiss]; - - }); - }else{ - + [weakself dismiss]; + }else { dispatch_async(dispatch_get_main_queue(), ^{ - [_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",timeout] forState:UIControlStateNormal]; + [self->_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",timeout] forState:UIControlStateNormal]; }); timeout--; } }); - dispatch_resume(_timer); + dispatch_resume(self.gcdTimer); } // 移除广告页面 - (void)dismiss { - [UIView animateWithDuration:0.3f animations:^{ - - self.alpha = 0.f; - } completion:^(BOOL finished) { - [self removeFromSuperview]; + if (_gcdTimer) { + dispatch_cancel(_gcdTimer); + } + _gcdTimer = nil; + dispatch_async(dispatch_get_main_queue(), ^{ + [UIView animateWithDuration:0.3f animations:^{ + self.alpha = 0.f; + } completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; - }]; + }); } --(void)dealloc +- (void)dealloc { - + _gcdTimer = nil; } @end diff --git "a/iOSProject/iOSProject/Classes/Helpers/\346\254\242\350\277\216\351\241\265/LMJIntroductoryPagesHelper.m" "b/iOSProject/iOSProject/Classes/Helpers/\346\254\242\350\277\216\351\241\265/LMJIntroductoryPagesHelper.m" index 763115de..d83f2214 100644 --- "a/iOSProject/iOSProject/Classes/Helpers/\346\254\242\350\277\216\351\241\265/LMJIntroductoryPagesHelper.m" +++ "b/iOSProject/iOSProject/Classes/Helpers/\346\254\242\350\277\216\351\241\265/LMJIntroductoryPagesHelper.m" @@ -19,15 +19,15 @@ @interface LMJIntroductoryPagesHelper () @implementation LMJIntroductoryPagesHelper +static LMJIntroductoryPagesHelper *shareInstance_ = nil; + (instancetype)shareInstance { - static LMJIntroductoryPagesHelper *shareInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - shareInstance = [[LMJIntroductoryPagesHelper alloc] init]; + shareInstance_ = [[LMJIntroductoryPagesHelper alloc] init]; }); - return shareInstance; + return shareInstance_; } + (void)showIntroductoryPageView:(NSArray *)imageArray diff --git "a/iOSProject/iOSProject/Classes/Helpers/\346\254\242\350\277\216\351\241\265/LMJIntroductoryPagesView.m" "b/iOSProject/iOSProject/Classes/Helpers/\346\254\242\350\277\216\351\241\265/LMJIntroductoryPagesView.m" index a7ed4334..56ab3fec 100644 --- "a/iOSProject/iOSProject/Classes/Helpers/\346\254\242\350\277\216\351\241\265/LMJIntroductoryPagesView.m" +++ "b/iOSProject/iOSProject/Classes/Helpers/\346\254\242\350\277\216\351\241\265/LMJIntroductoryPagesView.m" @@ -7,12 +7,14 @@ // #import "LMJIntroductoryPagesView.h" +#import +#import @interface LMJIntroductoryPagesView () /** <#digest#> */ @property (nonatomic, strong) NSArray *imagesArray; -@property(nonatomic,strong)UIPageControl *pageControl; +@property (nonatomic,strong) UIPageControl *pageControl; /** <#digest#> */ @property (weak, nonatomic) UIScrollView *scrollView; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJBaseViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJBaseViewController.m index 42b44f29..fefa5aff 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJBaseViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJBaseViewController.m @@ -21,14 +21,14 @@ @implementation LMJBaseViewController #pragma mark - 生命周期 - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; - self.automaticallyAdjustsScrollViewInsets = NO; - - if (@available(iOS 11.0, *)){ - [[UIScrollView appearanceWhenContainedInInstancesOfClasses:@[[LMJBaseViewController class]]] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever]; - } + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + if (@available(iOS 11.0, *)){ + [[UIScrollView appearanceWhenContainedInInstancesOfClasses:@[[LMJBaseViewController class]]] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever]; + } + }); } - (void)viewWillAppear:(BOOL)animated @@ -44,8 +44,6 @@ - (void)viewWillAppear:(BOOL)animated - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; - - } @@ -55,12 +53,8 @@ - (void)viewDidDisappear:(BOOL)animated // 配置友盟统计 [LMJUMengHelper endLogPageViewName:self.title ?: self.navigationItem.title]; - } - - - - (instancetype)initWithTitle:(NSString *)title { if (self = [super init]) { @@ -69,16 +63,12 @@ - (instancetype)initWithTitle:(NSString *)title return self; } - - - - (void)dealloc { NSLog(@"dealloc---%@", self.class); [[NSNotificationCenter defaultCenter] removeObserver:self]; } - @end diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJCollectionViewController.h b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJCollectionViewController.h index 294ea30c..b576f947 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJCollectionViewController.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJCollectionViewController.h @@ -24,6 +24,6 @@ @interface LMJCollectionViewController : LMJBaseViewController /** <#digest#> */ -@property (weak, nonatomic) UICollectionView *collectionView; +@property (weak, nonatomic) IBOutlet UICollectionView *collectionView; @end diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJCollectionViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJCollectionViewController.m index e5782734..acc9a827 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJCollectionViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJCollectionViewController.m @@ -7,10 +7,10 @@ // #import "LMJCollectionViewController.h" +#import "LMJAutoRefreshFooter.h" @interface LMJCollectionViewController () - @end @implementation LMJCollectionViewController @@ -18,33 +18,28 @@ @implementation LMJCollectionViewController - (void)viewDidLoad { [super viewDidLoad]; - [self setupBaseLMJCollectionViewControllerUI]; - [self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([UICollectionViewCell class])]; } - (void)setupBaseLMJCollectionViewControllerUI { - - self.collectionView.backgroundColor = self.view.backgroundColor; - - if ([self.parentViewController isKindOfClass:[UINavigationController class]]) { - - if ([self respondsToSelector:@selector(lmjNavigationHeight:)]) { - - self.collectionView.contentInset = UIEdgeInsetsMake([self lmjNavigationHeight:nil], 0, 0, 0); - } + UIEdgeInsets contentInset = self.collectionView.contentInset; + contentInset.top += self.lmj_navgationBar.lmj_height; + self.collectionView.contentInset = contentInset; } - + UICollectionViewLayout *myLayout = [self collectionViewController:self layoutForCollectionView:self.collectionView]; + self.collectionView.collectionViewLayout = myLayout; + self.collectionView.backgroundColor = self.view.backgroundColor; + self.collectionView.dataSource = self; + self.collectionView.delegate = self; } #pragma mark - delegate -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section -{ +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return 100; } @@ -67,7 +62,6 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell label.text = [NSString stringWithFormat:@"%zd", indexPath.item]; - return cell; } @@ -77,10 +71,11 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView UIEdgeInsets contentInset = self.collectionView.contentInset; contentInset.bottom -= self.collectionView.mj_footer.lmj_height; self.collectionView.scrollIndicatorInsets = contentInset; - [self.view endEditing:YES]; } + +#pragma mark - getter - (UICollectionView *)collectionView { if(_collectionView == nil) @@ -88,15 +83,7 @@ - (UICollectionView *)collectionView UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:[UICollectionViewFlowLayout new]]; [self.view addSubview:collectionView]; _collectionView = collectionView; - - UICollectionViewLayout *myLayout = [self collectionViewController:self layoutForCollectionView:collectionView]; - - collectionView.collectionViewLayout = myLayout; - collectionView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - collectionView.dataSource = self; - collectionView.delegate = self; - } return _collectionView; } @@ -105,9 +92,7 @@ - (UICollectionView *)collectionView #pragma mark - LMJCollectionViewControllerDataSource - (UICollectionViewLayout *)collectionViewController:(LMJCollectionViewController *)collectionViewController layoutForCollectionView:(UICollectionView *)collectionView { - LMJVerticalFlowLayout *myLayout = [[LMJVerticalFlowLayout alloc] initWithDelegate:self]; - return myLayout; } diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavUIBaseViewController.h b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavUIBaseViewController.h index 939d9099..f7c49355 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavUIBaseViewController.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavUIBaseViewController.h @@ -15,9 +15,6 @@ @optional - (BOOL)navUIBaseViewControllerIsNeedNavBar:(LMJNavUIBaseViewController *)navUIBaseViewController; - -- (UIStatusBarStyle)navUIBaseViewControllerPreferStatusBarStyle:(LMJNavUIBaseViewController *)navUIBaseViewController; - @end @interface LMJNavUIBaseViewController : UIViewController diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavUIBaseViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavUIBaseViewController.m index 4b69635c..5fd1fdde 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavUIBaseViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavUIBaseViewController.m @@ -9,69 +9,60 @@ #import "LMJNavUIBaseViewController.h" #import "LMJNavigationBar.h" -@interface LMJNavUIBaseViewController () - - - -@end - @implementation LMJNavUIBaseViewController - (void)viewDidLoad { - [super viewDidLoad]; + + LMJWeak(self); + [self.navigationItem addObserverBlockForKeyPath:LMJKeyPath(self.navigationItem, title) block:^(id _Nonnull obj, id _Nonnull oldVal, NSString *_Nonnull newVal) { + if (newVal.length > 0 && ![newVal isEqualToString:oldVal]) { + weakself.title = newVal; + } + }]; } #pragma mark - 生命周期 -- (void)viewWillAppear:(BOOL)animated -{ +- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - } -- (void)viewWillLayoutSubviews -{ +- (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; } -- (void)viewDidLayoutSubviews -{ +- (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; self.lmj_navgationBar.lmj_width = self.view.lmj_width; [self.view bringSubviewToFront:self.lmj_navgationBar]; } -- (void)viewDidAppear:(BOOL)animated -{ +- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; - - [UIApplication sharedApplication].statusBarStyle = [self navUIBaseViewControllerPreferStatusBarStyle:self]; } - - - - -#pragma mark - LMJNavUIBaseViewControllerDataSource -- (BOOL)navUIBaseViewControllerIsNeedNavBar:(LMJNavUIBaseViewController *)navUIBaseViewController -{ - return YES; +- (void)dealloc { + [self.navigationItem removeObserverBlocksForKeyPath:LMJKeyPath(self.navigationItem, title)]; } - -- (UIStatusBarStyle)navUIBaseViewControllerPreferStatusBarStyle:(LMJNavUIBaseViewController *)navUIBaseViewController -{ +- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleDefault; } +- (BOOL)prefersStatusBarHidden { + return NO; +} #pragma mark - DataSource +- (BOOL)navUIBaseViewControllerIsNeedNavBar:(LMJNavUIBaseViewController *)navUIBaseViewController { + return YES; +} + /**头部标题*/ -- (NSMutableAttributedString*)lmjNavigationBarTitle:(LMJNavigationBar *)navigationBar -{ +- (NSMutableAttributedString*)lmjNavigationBarTitle:(LMJNavigationBar *)navigationBar { return [self changeTitle:self.title ?: self.navigationItem.title]; } @@ -82,8 +73,7 @@ - (NSMutableAttributedString*)lmjNavigationBarTitle:(LMJNavigationBar *)navigati //} /** 背景色 */ -- (UIColor *)lmjNavigationBackgroundColor:(LMJNavigationBar *)navigationBar -{ +- (UIColor *)lmjNavigationBackgroundColor:(LMJNavigationBar *)navigationBar { return [UIColor whiteColor]; } @@ -94,8 +84,7 @@ - (UIColor *)lmjNavigationBackgroundColor:(LMJNavigationBar *)navigationBar //} /** 导航条的高度 */ -- (CGFloat)lmjNavigationHeight:(LMJNavigationBar *)navigationBar -{ +- (CGFloat)lmjNavigationHeight:(LMJNavigationBar *)navigationBar { return [UIApplication sharedApplication].statusBarFrame.size.height + 44.0; } @@ -130,18 +119,15 @@ - (CGFloat)lmjNavigationHeight:(LMJNavigationBar *)navigationBar #pragma mark - Delegate /** 左边的按钮的点击 */ --(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ +-(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { NSLog(@"%s", __func__); } /** 右边的按钮的点击 */ --(void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ +-(void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { NSLog(@"%s", __func__); } /** 中间如果是 label 就会有点击 */ --(void)titleClickEvent:(UILabel *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ +-(void)titleClickEvent:(UILabel *)sender navigationBar:(LMJNavigationBar *)navigationBar { NSLog(@"%s", __func__); } @@ -160,10 +146,9 @@ - (NSMutableAttributedString *)changeTitle:(NSString *)curTitle } -- (LMJNavigationBar *)lmj_navgationBar -{ +- (LMJNavigationBar *)lmj_navgationBar { // 父类控制器必须是导航控制器 - if(!_lmj_navgationBar && [self.parentViewController isKindOfClass:[UINavigationController class]] && [self navUIBaseViewControllerIsNeedNavBar:self]) + if(!_lmj_navgationBar && [self.parentViewController isKindOfClass:[UINavigationController class]]) { LMJNavigationBar *navigationBar = [[LMJNavigationBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 0)]; [self.view addSubview:navigationBar]; @@ -171,8 +156,7 @@ - (LMJNavigationBar *)lmj_navgationBar navigationBar.dataSource = self; navigationBar.lmjDelegate = self; - - + navigationBar.hidden = ![self navUIBaseViewControllerIsNeedNavBar:self]; } return _lmj_navgationBar; } @@ -180,16 +164,22 @@ - (LMJNavigationBar *)lmj_navgationBar -- (void)setTitle:(NSString *)title -{ +- (void)setTitle:(NSString *)title { [super setTitle:title]; - self.lmj_navgationBar.title = [self changeTitle:title]; } - - - +- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion +{ + if (@available(iOS 13.0, *)) { + if (viewControllerToPresent.modalPresentationStyle == UIModalPresentationPageSheet || viewControllerToPresent.modalPresentationStyle == UIModalPresentationAutomatic){ + viewControllerToPresent.modalPresentationStyle = UIModalPresentationFullScreen; + } + } else { + // Fallback on earlier versions + } + [super presentViewController:viewControllerToPresent animated:flag completion:completion]; +} @end @@ -197,7 +187,3 @@ - (void)setTitle:(NSString *)title - - - - diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavigationController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavigationController.m index 98737567..a38d5662 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavigationController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJNavigationController.m @@ -11,7 +11,7 @@ @interface LMJNavigationController () /** 系统的右划返回功能的代理记录 */ -@property (nonatomic, strong) id popGesDelegate; +//@property (nonatomic, strong) id popGesDelegate; @end @@ -21,9 +21,9 @@ - (void)viewDidLoad { [super viewDidLoad]; self.navigationBar.hidden = YES; - - [self setupPOPGes]; + // 不让自控制器控制系统导航条 + self.fd_viewControllerBasedNavigationBarAppearanceEnabled = NO; } /* #pragma mark - 全局侧滑代码------------BEGIN---- @@ -50,28 +50,26 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer #pragma mark - 全局侧滑代码------------END---- */ -- (void)setupPOPGes -{ - self.fd_viewControllerBasedNavigationBarAppearanceEnabled = NO; -} - -- (void)viewDidLayoutSubviews -{ - [super viewDidLayoutSubviews]; -} - - - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { - if (self.childViewControllers.count != 0) { - viewController.hidesBottomBarWhenPushed = YES; } [super pushViewController:viewController animated:animated]; } +- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion +{ + if (@available(iOS 13.0, *)) { + if (viewControllerToPresent.modalPresentationStyle == UIModalPresentationPageSheet || viewControllerToPresent.modalPresentationStyle == UIModalPresentationAutomatic){ + viewControllerToPresent.modalPresentationStyle = UIModalPresentationFullScreen; + } + } else { + // Fallback on earlier versions + } + [super presentViewController:viewControllerToPresent animated:flag completion:completion]; +} @end diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRefreshCollectionViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRefreshCollectionViewController.m index 06cc39de..28012590 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRefreshCollectionViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRefreshCollectionViewController.m @@ -17,17 +17,13 @@ @implementation LMJRefreshCollectionViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + LMJWeak(self); self.collectionView.mj_header = [LMJNormalRefreshHeader headerWithRefreshingBlock:^{ - [weakself loadIsMore:NO]; }]; - self.collectionView.mj_footer = [LMJAutoRefreshFooter footerWithRefreshingBlock:^{ - [weakself loadIsMore:YES]; - }]; [self.collectionView.mj_header beginRefreshing]; @@ -39,10 +35,20 @@ - (void)loadIsMore:(BOOL)isMore { // 控制只能下拉或者上拉 if (isMore) { - ![self.collectionView.mj_header isRefreshing] ?: [self.collectionView.mj_header endRefreshing]; + if ([self.collectionView.mj_header isRefreshing]) { + [self.collectionView.mj_footer endRefreshing]; + return; + } + self.collectionView.mj_header.hidden = YES; + self.collectionView.mj_footer.hidden = NO; }else { - ![self.collectionView.mj_footer isRefreshing] ?: [self.collectionView.mj_footer endRefreshing]; + if ([self.collectionView.mj_footer isRefreshing]) { + [self.collectionView.mj_header endRefreshing]; + return; + } + self.collectionView.mj_header.hidden = NO; + self.collectionView.mj_footer.hidden = YES; } [self loadMore:isMore]; } @@ -53,6 +59,8 @@ - (void)endHeaderFooterRefreshing // 结束刷新状态 ![self.collectionView.mj_header isRefreshing] ?: [self.collectionView.mj_header endRefreshing]; ![self.collectionView.mj_footer isRefreshing] ?: [self.collectionView.mj_footer endRefreshing]; + self.collectionView.mj_header.hidden = NO; + self.collectionView.mj_footer.hidden = NO; } diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRefreshTableViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRefreshTableViewController.m index 822cc684..0c88d2a8 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRefreshTableViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRefreshTableViewController.m @@ -18,23 +18,14 @@ @implementation LMJRefreshTableViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + LMJWeak(self); self.tableView.mj_header = [LMJNormalRefreshHeader headerWithRefreshingBlock:^{ [weakself loadIsMore:NO]; }]; - self.tableView.mj_header.automaticallyChangeAlpha = YES; - - self.tableView.mj_footer = [LMJAutoRefreshFooter footerWithRefreshingBlock:^{ - [weakself loadIsMore:YES]; - }]; - self.tableView.mj_footer.automaticallyChangeAlpha = YES; -// self.tableView.mj_footer.automaticallyHidden = YES; - - [self.tableView.mj_header beginRefreshing]; } @@ -44,10 +35,20 @@ - (void)loadIsMore:(BOOL)isMore { // 控制只能下拉或者上拉 if (isMore) { - ![self.tableView.mj_header isRefreshing] ?: [self.tableView.mj_header endRefreshing]; + if ([self.tableView.mj_header isRefreshing]) { + [self.tableView.mj_footer endRefreshing]; + return; + } + self.tableView.mj_header.hidden = YES; + self.tableView.mj_footer.hidden = NO; }else { - ![self.tableView.mj_footer isRefreshing] ?: [self.tableView.mj_footer endRefreshing]; + if ([self.tableView.mj_footer isRefreshing]) { + [self.tableView.mj_header endRefreshing]; + return; + } + self.tableView.mj_header.hidden = NO; + self.tableView.mj_footer.hidden = YES; } [self loadMore:isMore]; } @@ -60,7 +61,8 @@ - (void)endHeaderFooterRefreshing // 结束刷新状态 ![self.tableView.mj_header isRefreshing] ?: [self.tableView.mj_header endRefreshing]; ![self.tableView.mj_footer isRefreshing] ?: [self.tableView.mj_footer endRefreshing]; - + self.tableView.mj_header.hidden = NO; + self.tableView.mj_footer.hidden = NO; } // 子类需要调用调用 diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRequestBaseViewController.h b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRequestBaseViewController.h index 70b33caf..9b10963d 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRequestBaseViewController.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRequestBaseViewController.h @@ -29,8 +29,8 @@ @interface LMJRequestBaseViewController : LMJTextViewController - #pragma mark - 加载框 + - (void)showLoading; - (void)dismissLoading; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRequestBaseViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRequestBaseViewController.m index 5b3779d8..50dcb85d 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRequestBaseViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJRequestBaseViewController.m @@ -7,6 +7,7 @@ // #import "LMJRequestBaseViewController.h" +#import "MBProgressHUD+LMJ.h" @interface LMJRequestBaseViewController () @@ -20,16 +21,12 @@ @implementation LMJRequestBaseViewController - (void)viewDidLoad { [super viewDidLoad]; - [self reachHost]; } - #pragma mark - 加载框 - (void)showLoading { -// [MBProgressHUD showLoadToView:self.view]; - [MBProgressHUD showProgressToView:self.view Text:@"加载中..."]; } @@ -46,31 +43,19 @@ - (Reachability *)reachHost if(_reachHost == nil) { _reachHost = [Reachability reachabilityWithHostName:kURL_Reachability__Address]; - - LMJWeakSelf(self); + LMJWeak(self); [_reachHost setUnreachableBlock:^(Reachability * reachability){ - dispatch_async(dispatch_get_main_queue(), ^{ - [weakself networkStatus:reachability.currentReachabilityStatus inViewController:weakself]; - }); - }]; - [_reachHost setReachableBlock:^(Reachability * reachability){ - dispatch_async(dispatch_get_main_queue(), ^{ - [weakself networkStatus:reachability.currentReachabilityStatus inViewController:weakself]; - }); - }]; - [_reachHost startNotifier]; - } return _reachHost; } @@ -93,7 +78,6 @@ - (void)networkStatus:(NetworkStatus)networkStatus inViewController:(LMJRequestB default: break; } - } diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJStaticTableViewController.h b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJStaticTableViewController.h index 62a79c92..584274f9 100755 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJStaticTableViewController.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJStaticTableViewController.h @@ -11,8 +11,6 @@ #import "LMJWordItem.h" #import "LMJWordArrowItem.h" - - // 继承自这个基类, 设置组模型就行了, 详见Me模块的FinacialVC-Demo @interface LMJStaticTableViewController : LMJTableViewController @@ -21,14 +19,11 @@ // 自定义某一行cell的时候调用super, 返回为空 -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath NS_REQUIRES_SUPER; +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; - (LMJStaticTableViewController *(^)(LMJWordItem *item))addItem; - @end - - UIKIT_EXTERN const UIEdgeInsets tableViewDefaultSeparatorInset; UIKIT_EXTERN const UIEdgeInsets tableViewDefaultLayoutMargins; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJStaticTableViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJStaticTableViewController.m index a22d296b..33d058ae 100755 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJStaticTableViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJStaticTableViewController.m @@ -18,16 +18,13 @@ @interface LMJStaticTableViewController () @implementation LMJStaticTableViewController - - - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"self.tableView.separatorInset = %@, self.tableView.separatorInset = %@", NSStringFromUIEdgeInsets(self.tableView.separatorInset), NSStringFromUIEdgeInsets(self.tableView.layoutMargins)); - -// self.tableView.separatorInset = UIEdgeInsetsZero; -// self.tableView.layoutMargins = UIEdgeInsetsZero; + // self.tableView.separatorInset = UIEdgeInsetsZero; + // self.tableView.layoutMargins = UIEdgeInsetsZero; } @@ -74,9 +71,10 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath if(arrowItem.destVc) { UIViewController *vc = [[arrowItem.destVc alloc] init]; - vc.navigationItem.title = arrowItem.title; - - [self.navigationController pushViewController:vc animated:YES]; + if ([vc isKindOfClass:[UIViewController class]]) { + vc.navigationItem.title = arrowItem.title; + [self.navigationController pushViewController:vc animated:YES]; + } } } @@ -109,13 +107,13 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa - (LMJStaticTableViewController *(^)(LMJWordItem *))addItem { - LMJWeakSelf(self); + LMJWeak(self); if (!self.sections.firstObject) { [self.sections addObject:[LMJItemSection sectionWithItems:@[] andHeaderTitle:nil footerTitle:nil]]; } - return ^(LMJWordItem *item) { - [weakself.sections.firstObject.items addObject:item]; - return weakself; + return ^LMJStaticTableViewController *(LMJWordItem *item) { + [weakself.sections.firstObject.items addObject:item]; + return weakself; }; } diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTableViewController.h b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTableViewController.h index a044f47d..fea9bb4b 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTableViewController.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTableViewController.h @@ -14,9 +14,8 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView NS_REQUIRES_SUPER; /** <#digest#> */ -@property (weak, nonatomic) UITableView *tableView; +@property (weak, nonatomic) IBOutlet UITableView *tableView; // tableview的样式, 默认plain - (instancetype)initWithStyle:(UITableViewStyle)style; - @end diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTableViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTableViewController.m index 1cd9eef7..b6e14e1e 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTableViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTableViewController.m @@ -7,6 +7,7 @@ // #import "LMJTableViewController.h" +#import "LMJAutoRefreshFooter.h" @interface LMJTableViewController () /** <#digest#> */ @@ -17,32 +18,27 @@ @implementation LMJTableViewController - (void)viewDidLoad { [super viewDidLoad]; - [self setupBaseTableViewUI]; - } - (void)setupBaseTableViewUI { self.tableView.backgroundColor = self.view.backgroundColor; - - if ([self.parentViewController isKindOfClass:[UINavigationController class]]) { - - if ([self respondsToSelector:@selector(lmjNavigationHeight:)]) { - - self.tableView.contentInset = UIEdgeInsetsMake([self lmjNavigationHeight:nil], 0, 0, 0); - } + UIEdgeInsets contentInset = self.tableView.contentInset; + contentInset.top += self.lmj_navgationBar.lmj_height; + self.tableView.contentInset = contentInset; } + self.tableView.delegate = self; + self.tableView.dataSource = self; - - - + // 适配 ios 11 + self.tableView.estimatedRowHeight = 0; + self.tableView.estimatedSectionHeaderHeight = 0; + self.tableView.estimatedSectionFooterHeight = 0; } - - #pragma mark - scrollDeleggate - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { @@ -52,7 +48,6 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView [self.view endEditing:YES]; } - #pragma mark - TableViewDelegate - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { @@ -64,21 +59,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N return [UITableViewCell new]; } - - - (UITableView *)tableView { if(_tableView == nil) { - UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:self.tableViewStyle]; [self.view addSubview:tableView]; - - tableView.delegate = self; - tableView.dataSource = self; - tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - _tableView = tableView; } return _tableView; @@ -89,12 +76,10 @@ - (instancetype)initWithStyle:(UITableViewStyle)style if (self = [super init]) { _tableViewStyle = style; } - return self; } -- (void)dealloc -{ +- (void)dealloc { } diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTextViewController.h b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTextViewController.h index a8d8b6e5..31888187 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTextViewController.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTextViewController.h @@ -17,6 +17,7 @@ - (BOOL)textViewControllerEnableAutoToolbar:(LMJTextViewController *)textViewController; +// 控制是否可以点击点击的按钮 - (NSArray *)textViewControllerRelationButtons:(LMJTextViewController *)textViewController; @end @@ -27,14 +28,8 @@ @optional #pragma mark - 最后一个输入框点击键盘上的完成按钮时调用 - (void)textViewController:(LMJTextViewController *)textViewController inputViewDone:(id)inputView; - - - @end - - - @interface LMJTextViewController : LMJNavUIBaseViewController - (BOOL)textFieldShouldClear:(UITextField *)textField NS_REQUIRES_SUPER; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTextViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTextViewController.m index 945953a3..6c22d2e8 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTextViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJTextViewController.m @@ -24,108 +24,93 @@ @implementation LMJTextViewController - (void)viewDidLoad { [super viewDidLoad]; - - } -- (void)viewWillAppear:(BOOL)animated -{ +- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - [self initKeyboard]; } -- (void)viewDidLayoutSubviews -{ +- (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; } -- (void)viewWillDisappear:(BOOL)animated -{ +- (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; - [self.view endEditing:YES]; } - +- (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; + if (_returnKeyHandler) { + [_returnKeyHandler setDelegate:nil]; + _returnKeyHandler = nil; + } +} #pragma mark - UITextViewDelegate, UITextFieldDelegate - #pragma mark - 处理 returnKey -- (BOOL)textFieldShouldReturn:(UITextField *)textField -{ +- (BOOL)textFieldShouldReturn:(UITextField *)textField { if (![IQKeyboardManager sharedManager].canGoNext) { - [self textViewController:self inputViewDone:textField]; - } - return YES; } - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { if (![IQKeyboardManager sharedManager].canGoNext && [text isEqualToString:@"\n"]) { - [self textViewController:self inputViewDone:textView]; - } return YES; } #pragma mark - LMJTextViewControllerDelegate -- (void)textViewController:(LMJTextViewController *)textViewController inputViewDone:(id)inputView -{ +- (void)textViewController:(LMJTextViewController *)textViewController inputViewDone:(id)inputView { NSLog(@"%@, %@", self.requiredTextFields, inputView); } #pragma mark - autoEmpty -- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string -{ - NSString *current = [textField.text stringByReplacingCharactersInRange:range withString:string].stringByTrim; +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { + // 九宫格 bug fix + if ([@"➋➌➍➎➏➐➑➒" rangeOfString:string].location != NSNotFound) { + return YES; + } + NSString *current = [textField.text stringByReplacingCharactersInRange:range withString:string.stringByTrim].stringByTrim; if (textField.isEmptyAutoEnable && (LMJIsEmpty(textField.text.stringByTrim) || LMJIsEmpty(current))) { - if (LMJIsEmpty(current)) { [self checkIsEmpty:YES textField:textField]; }else { [self checkIsEmpty:NO textField:textField]; } - } - return YES; } -- (BOOL)textFieldShouldClear:(UITextField *)textField -{ +- (BOOL)textFieldShouldClear:(UITextField *)textField { if (textField.isEmptyAutoEnable) { - [self checkIsEmpty:YES textField:textField]; } - return YES; } #pragma mark - 设置 btn的 enable -- (void)checkIsEmpty:(BOOL)isEmpty textField:(UITextField *)textField -{ +- (void)checkIsEmpty:(BOOL)isEmpty textField:(UITextField *)textField { if (LMJIsEmpty(self.requiredTextFields)) { return; } if ([self respondsToSelector:@selector(textViewControllerRelationButtons:)]) { - if (LMJIsEmpty([self textViewControllerRelationButtons:self])) { return; } - }else { return; @@ -134,22 +119,15 @@ - (void)checkIsEmpty:(BOOL)isEmpty textField:(UITextField *)textField __block BOOL isButtonEnabled = !isEmpty; if (!isEmpty) { - [self.requiredTextFields enumerateObjectsUsingBlock:^(UITextField *obj, NSUInteger idx, BOOL * _Nonnull stop) { - if (obj != textField && LMJIsEmpty(obj.text.stringByTrim)) { - isButtonEnabled = NO; - *stop = YES; } - }]; - } [[self textViewControllerRelationButtons:self] enumerateObjectsUsingBlock:^(UIButton * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - obj.enabled = isButtonEnabled; }]; } @@ -157,8 +135,7 @@ - (void)checkIsEmpty:(BOOL)isEmpty textField:(UITextField *)textField #pragma mark - 初始化 -- (void)initKeyboard -{ +- (void)initKeyboard { // 键盘 IQKeyboardManager *manager = [IQKeyboardManager sharedManager]; manager.enable = YES; @@ -169,7 +146,7 @@ - (void)initKeyboard manager.shouldShowToolbarPlaceholder = YES; [self requiredTextFields]; - [self returnKeyHandler];; + [self initReturnKeyHandler];; } @@ -187,14 +164,11 @@ - (UIReturnKeyType)textViewControllerLastReturnKeyType:(LMJTextViewController *) } -- (NSArray *)requiredTextFields -{ +- (NSArray *)requiredTextFields { if(_requiredTextFields == nil) { NSArray *responsedInputViews = [self.view deepResponderViews]; - NSMutableArray *array = [NSMutableArray array]; - [responsedInputViews enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if ([obj isKindOfClass:[UITextField class]]) { @@ -203,10 +177,7 @@ - (UIReturnKeyType)textViewControllerLastReturnKeyType:(LMJTextViewController *) field.delegate = self; if (field.isEmptyAutoEnable) { - [array addObject:field]; - -// [self checkIsEmpty:YES textField:field]; } } @@ -214,28 +185,20 @@ - (UIReturnKeyType)textViewControllerLastReturnKeyType:(LMJTextViewController *) UITextView *textView = (UITextView *)obj; textView.delegate = self; } - }]; - _requiredTextFields = array; - } return _requiredTextFields; } -- (IQKeyboardReturnKeyHandler *)returnKeyHandler -{ - if(_returnKeyHandler == nil) - { +- (void)initReturnKeyHandler { + if(_returnKeyHandler == nil) { _returnKeyHandler = [[IQKeyboardReturnKeyHandler alloc] initWithViewController:self]; _returnKeyHandler.delegate = self; - _returnKeyHandler.lastTextFieldReturnKeyType = [self textViewControllerLastReturnKeyType:self]; - } - return _returnKeyHandler; } @@ -264,9 +227,7 @@ - (BOOL)isEmptyAutoEnable } @end - @implementation LMJTextViewControllerTextField - - (NSString *)text { return ([[super text] stringByTrim]); } diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJWebViewController.h b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJWebViewController.h index d82eeb15..b009b704 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJWebViewController.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJWebViewController.h @@ -39,11 +39,14 @@ @interface LMJWebViewController : LMJBaseViewController /** webView */ -@property (nonatomic, strong) WKWebView *webView; +@property (nonatomic, strong) IBOutlet WKWebView *webView; /** <#digest#> */ @property (nonatomic, copy) NSString *gotoURL; +/** <#digest#> */ +@property (nonatomic, copy) NSString *contentHTML; + // 7页面加载完调用, 必须调用super - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation NS_REQUIRES_SUPER; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJWebViewController.m b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJWebViewController.m index 6f1e960e..e44f979f 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJWebViewController.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseControllers/LMJWebViewController.m @@ -7,7 +7,6 @@ // #import "LMJWebViewController.h" - @interface LMJWebViewController () /** <#digest#> */ @@ -24,7 +23,8 @@ @interface LMJWebViewController () @implementation LMJWebViewController - (void)setGotoURL:(NSString *)gotoURL { - _gotoURL = gotoURL.copy; +// @"`#%^{}\"[]|\\<> " 最后有一位空格 + _gotoURL = [gotoURL stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "] invertedSet]]; } #pragma mark - 生命周期 @@ -34,10 +34,22 @@ - (void)viewDidLoad { self.fd_interactivePopDisabled = YES; - LMJWeakSelf(self); + self.webView.navigationDelegate = self; + self.webView.UIDelegate = self; + + if ([self.parentViewController isKindOfClass:[UINavigationController class]]) { + if (@available(iOS 11.0, *)){ + self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } + UIEdgeInsets contentInset = self.webView.scrollView.contentInset; + contentInset.top += self.lmj_navgationBar.lmj_height; + self.webView.scrollView.contentInset = contentInset; + self.webView.scrollView.scrollIndicatorInsets = self.webView.scrollView.contentInset; + } + + LMJWeak(self); [self.webView addObserverBlockForKeyPath:LMJKeyPath(weakself.webView, estimatedProgress) block:^(id _Nonnull obj, id _Nullable oldVal, id _Nullable newVal) { - weakself.progressView.progress = weakself.webView.estimatedProgress; // 加载完成 if (weakself.webView.estimatedProgress >= 1.0f ) { @@ -53,34 +65,24 @@ - (void)viewDidLoad { }]; - - - if ([self webViewController:self webViewIsNeedAutoTitle:self.webView]) { + [self.webView addObserverBlockForKeyPath:LMJKeyPath(self.webView, title) block:^(id _Nonnull obj, id _Nullable oldVal, id _Nullable newVal) { - [self.webView addObserverBlockForKeyPath:LMJKeyPath(self.webView, title) block:^(id _Nonnull obj, id _Nullable oldVal, id _Nullable newVal) { - - if ([newVal isKindOfClass:[NSString class]]) { - - weakself.title = newVal; - - } - - }]; - } + if (!LMJIsEmpty(newVal) && [newVal isKindOfClass:[NSString class]] && [weakself webViewController:weakself webViewIsNeedAutoTitle:weakself.webView]) { + weakself.title = newVal; + } + + }]; [self.webView.scrollView addObserverBlockForKeyPath:LMJKeyPath(self.webView.scrollView, contentSize) block:^(id _Nonnull obj, id _Nullable oldVal, id _Nullable newVal) { - [weakself webView:weakself.webView scrollView:weakself.webView.scrollView contentSize:weakself.webView.scrollView.contentSize]; - }]; - - if (self.gotoURL.length > 0) { [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.gotoURL]]]; + }else if (!LMJIsEmpty(self.contentHTML)) { + [self.webView loadHTMLString:self.contentHTML baseURL:nil]; } - } @@ -88,9 +90,7 @@ - (void)viewDidLoad { - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; - [self.view bringSubviewToFront:self.progressView]; - } @@ -103,7 +103,7 @@ - (UIView *)lmjNavigationBarLeftView:(LMJNavigationBar *)navigationBar leftView.backgroundColor = [UIColor yellowColor]; - self.backBtn.mj_origin = CGPointZero; + self.backBtn.lmj_origin = CGPointZero; self.closeBtn.lmj_x = leftView.lmj_width - self.closeBtn.lmj_width; @@ -148,11 +148,8 @@ - (BOOL)webViewController:(LMJWebViewController *)webViewController webViewIsNee - (void)backBtnClick:(UIButton *)backBtn webView:(WKWebView *)webView { if (self.webView.canGoBack) { - self.closeBtn.hidden = NO; - [self.webView goBack]; - }else { [self closeBtnClick:self.closeBtn webView:self.webView]; @@ -160,13 +157,10 @@ - (void)backBtnClick:(UIButton *)backBtn webView:(WKWebView *)webView } // 关闭按钮的点击 -- (void)closeBtnClick:(UIButton *)closeBtn webView:(WKWebView *)webView -{ +- (void)closeBtnClick:(UIButton *)closeBtn webView:(WKWebView *)webView { // 判断两种情况: push 和 present if ((self.navigationController.presentedViewController || self.navigationController.presentingViewController) && self.navigationController.childViewControllers.count == 1) { - [self dismissViewControllerAnimated:YES completion:nil]; - }else{ [self.navigationController popViewControllerAnimated:YES]; } @@ -201,7 +195,6 @@ - (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNaviga NSLog(@"decidePolicyForNavigationResponse ==== %@", navigationResponse); decisionHandler(WKNavigationResponsePolicyAllow); - } // 5,内容开始返回时调用 @@ -213,36 +206,41 @@ - (void)webView:(WKWebView *)webView didCommitNavigation:(null_unspecified WKNav // 3, 6, 加载 HTTPS 的链接,需要权限认证时调用 \ 如果 HTTPS 是用的证书在信任列表中这不要此代理方法 - (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - if ([challenge previousFailureCount] == 0) { - - NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; - completionHandler(NSURLSessionAuthChallengeUseCredential, credential); - } else { - - completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); - } - } else { - - completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); - } + NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; + completionHandler(NSURLSessionAuthChallengeUseCredential, credential); + +// if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { +// if ([challenge previousFailureCount] == 0) { +// +// NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; +// completionHandler(NSURLSessionAuthChallengeUseCredential, credential); +// } else { +// +// completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); +// } +// } else { +// +// completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); +// } } // 7页面加载完调用 - (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation { - NSLog(@"didFinishNavigation ==== %@", navigation); } // 8页面加载失败时调用 - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(null_unspecified WKNavigation *)navigation withError:(NSError *)error { - NSLog(@"didFailProvisionalNavigation ==== %@\nerror ==== %@", navigation, error); - [MBProgressHUD showError:@"网页加载失败" ToView:self.view]; } +//当 WKWebView 总体内存占用过大,页面即将白屏的时候,系统会调用回调函数 +- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView { + [webView reload]; + NSLog(@"webViewWebContentProcessDidTerminate"); +} #pragma mark - 懒加载 @@ -261,48 +259,23 @@ - (WKWebView *)webView //不通过用户交互,是否可以打开窗口 config.preferences.javaScriptCanOpenWindowsAutomatically = YES; // 检测各种特殊的字符串:比如电话、网站 -// config.dataDetectorTypes = UIDataDetectorTypeAll; + config.dataDetectorTypes = UIDataDetectorTypeAll; // 播放视频 config.allowsInlineMediaPlayback = YES; // 交互对象设置 -// LMJWeakSelf(self); -// config.userContentController = [[WKUserContentController alloc] init]; -// [config.userContentController addScriptMessageHandler:weakself name:<#(nonnull NSString *)#>]; - + config.userContentController = [[WKUserContentController alloc] init]; WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:config]; + [self.view addSubview:webView]; + _webView = webView; webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - - webView.navigationDelegate = self; - webView.UIDelegate = self; -// webView.scrollView.delegate = self; - webView.opaque = NO; webView.backgroundColor = [UIColor clearColor]; - //滑动返回看这里 webView.allowsBackForwardNavigationGestures = YES; - - [self.view addSubview:webView]; - - - if ([self.parentViewController isKindOfClass:[UINavigationController class]]) { - - if ([self respondsToSelector:@selector(lmjNavigationHeight:)]) { - - webView.scrollView.contentInset = UIEdgeInsetsMake([self lmjNavigationHeight:nil], 0, 0, 0); - // AppDelegate 进行全局设置 - if (@available(iOS 11.0, *)){ - webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; - } - } - - webView.scrollView.scrollIndicatorInsets = webView.scrollView.contentInset; - } - - _webView = webView; + webView.allowsLinkPreview = YES; } return _webView; } @@ -326,11 +299,9 @@ - (UIProgressView *)progressView progressView.tintColor = [UIColor greenColor]; if ([self respondsToSelector:@selector(webViewController:webViewIsNeedProgressIndicator:)]) { - if (![self webViewController:self webViewIsNeedProgressIndicator:self.webView]) { progressView.hidden = YES; } - } } @@ -429,5 +400,3 @@ - (void)dealloc //} - - diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseModels/LMJWordItem.h b/iOSProject/iOSProject/Classes/LMJBase/BaseModels/LMJWordItem.h index 3bb461e5..f9f93e76 100755 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseModels/LMJWordItem.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseModels/LMJWordItem.h @@ -23,10 +23,11 @@ @property (nonatomic, strong) UIFont *subTitleFont; /** 副标题的颜色 */ @property (nonatomic, strong) UIColor *subTitleColor; +/** 副标题行数限制 */ +@property (nonatomic, assign) NSInteger subTitleNumberOfLines; - -/** 左边的图片 */ -@property (nonatomic, strong) UIImage *image; +/** 左边的图片 UIImage 或者 NSURL 或者 URLString 或者 ImageName */ +@property (nonatomic, strong) id image; /** 设置cell的高度, 默认50 */ @property (assign, nonatomic) CGFloat cellHeight; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseModels/LMJWordItem.m b/iOSProject/iOSProject/Classes/LMJBase/BaseModels/LMJWordItem.m index 002a4830..f79611a5 100755 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseModels/LMJWordItem.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseModels/LMJWordItem.m @@ -27,18 +27,27 @@ + (instancetype)itemWithTitle:(NSString *)title subTitle:(NSString *)subTitle it - (instancetype)init { if (self = [super init]) { - _titleColor = [UIColor blackColor]; _subTitleColor = [UIColor blackColor]; - - _cellHeight = AdaptedWidth(50); +// _cellHeight = AdaptedWidth(50); _titleFont = AdaptedFontSize(16); _subTitleFont = AdaptedFontSize(16); - -} + _subTitleNumberOfLines = 2; + } return self; } +- (CGFloat)cellHeight { + if (!_cellHeight) { + _cellHeight += 20; + NSString *totalString = [NSString stringWithFormat:@"%@%@", self.title, self.subTitle]; + _cellHeight += [totalString boundingRectWithSize:CGSizeMake(kScreenWidth - 20, MAXFLOAT) options:0 attributes:@{NSFontAttributeName : self.subTitleFont} context:nil].size.height; + _cellHeight = MAX(_cellHeight, 50); + _cellHeight = AdaptedWidth(_cellHeight); + } + return _cellHeight; +} + @end diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJAutoRefreshFooter.h b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJAutoRefreshFooter.h index d1e61977..2b1ef457 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJAutoRefreshFooter.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJAutoRefreshFooter.h @@ -7,6 +7,7 @@ // #import +#import @interface LMJAutoRefreshFooter : MJRefreshAutoNormalFooter diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJAutoRefreshFooter.m b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJAutoRefreshFooter.m index 55e08a00..daeecb4f 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJAutoRefreshFooter.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJAutoRefreshFooter.m @@ -27,15 +27,17 @@ - (void)awakeFromNib - (void)setupUIOnce { self.automaticallyChangeAlpha = YES; -// self.automaticallyHidden = YES; - +} + +// MJBug fix +- (void)endRefreshing { + [super endRefreshing]; + self.state = MJRefreshStateIdle; } - (void)layoutSubviews { [super layoutSubviews]; - - } @end diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJElementsFlowLayout.h b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJElementsFlowLayout.h index 1703fc66..fbb4150a 100755 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJElementsFlowLayout.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJElementsFlowLayout.h @@ -25,8 +25,6 @@ */ - (CGSize)waterflowLayout:(LMJElementsFlowLayout *)waterflowLayout collectionView:(UICollectionView *)collectionView sizeForItemAtIndexPath:(NSIndexPath *)indexPath; - - @optional /** @@ -44,7 +42,6 @@ */ - (UIEdgeInsets)waterflowLayout:(LMJElementsFlowLayout *)waterflowLayout edgeInsetsInCollectionView:(UICollectionView *)collectionView; - @end diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJElementsFlowLayout.m b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJElementsFlowLayout.m index 89e19cd7..aafe593d 100755 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJElementsFlowLayout.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJElementsFlowLayout.m @@ -19,7 +19,6 @@ @interface LMJElementsFlowLayout() @property (nonatomic, strong) NSMutableArray *lmj_AtrbsArray; /** 每一列的最后的高度 */ -/** <#digest#> */ @property (assign, nonatomic) CGRect lmj_LastAtrbsFrame; @@ -29,10 +28,8 @@ - (CGFloat)yMarginAtIndexPath:(NSIndexPath *)indexPath; - (UIEdgeInsets)edgeInsets; - - (CGRect)maxHeightFrame; - @end @implementation LMJElementsFlowLayout @@ -50,8 +47,6 @@ - (void)prepareLayout //复赋值以顶部的高度, 并且根据列数 self.lmj_LastAtrbsFrame = CGRectMake(0, 0, self.collectionView.frame.size.width, 0); - - // 移除以前计算的cells的attrbs [self.lmj_AtrbsArray removeAllObjects]; @@ -60,9 +55,6 @@ - (void)prepareLayout { [self.lmj_AtrbsArray addObject:[self layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]]]; } - - - } @@ -85,8 +77,8 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde // 拿到最后的高度最小的那一列, 假设第0列最小 CGFloat rightLeftWidth = self.collectionView.frame.size.width - CGRectGetMaxX(self.lmj_LastAtrbsFrame) - [self xMarginAtIndexPath:indexPath] - self.edgeInsets.right; - CGFloat x = self.edgeInsets.left; - CGFloat y = self.edgeInsets.top; + CGFloat x = 0; + CGFloat y = 0; if (rightLeftWidth >= w) { @@ -100,12 +92,8 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde y = CGRectGetMaxY(self.maxHeightFrame) + [self yMarginAtIndexPath:indexPath]; } - - if (w > self.collectionView.frame.size.width - self.edgeInsets.left - self.edgeInsets.right) { - x = (self.collectionView.frame.size.width - w) * 0.5; - } if (y <= [self yMarginAtIndexPath:indexPath]) { @@ -132,15 +120,11 @@ - (CGRect)maxHeightFrame { __block CGRect maxHeightFrame = self.lmj_LastAtrbsFrame; - [self.lmj_AtrbsArray enumerateObjectsUsingBlock:^(UICollectionViewLayoutAttributes * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if (CGRectGetMaxY(obj.frame) > CGRectGetMaxY(maxHeightFrame)) { - maxHeightFrame = obj.frame; - } - }]; return maxHeightFrame; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJHorizontalFlowLayout.h b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJHorizontalFlowLayout.h index b23bb407..b4338f4f 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJHorizontalFlowLayout.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJHorizontalFlowLayout.h @@ -22,7 +22,7 @@ * @param indexPath 对应的cell, 的indexPath, 但是indexPath.section == 0 * @param itemHeight layout内部计算的高度 * - * @return 需要代理高度对应的cell的高度 + * @return 需要代理高度对应的cell的宽度 */ - (CGFloat)waterflowLayout:(LMJHorizontalFlowLayout *)waterflowLayout collectionView:(UICollectionView *)collectionView widthForItemAtIndexPath:(NSIndexPath *)indexPath itemHeight:(CGFloat)itemHeight; @optional @@ -31,10 +31,12 @@ * 需要显示的行数, 默认3 */ - (NSInteger)waterflowLayout:(LMJHorizontalFlowLayout *)waterflowLayout linesInCollectionView:(UICollectionView *)collectionView; + /** * 列间距, 默认10 */ - (CGFloat)waterflowLayout:(LMJHorizontalFlowLayout *)waterflowLayout collectionView:(UICollectionView *)collectionView columnsMarginForItemAtIndexPath:(NSIndexPath *)indexPath; + /** * 行间距, 默认10 */ diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJHorizontalFlowLayout.m b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJHorizontalFlowLayout.m index c0e8883b..4029c6d2 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJHorizontalFlowLayout.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJHorizontalFlowLayout.m @@ -19,10 +19,10 @@ @interface LMJHorizontalFlowLayout() /** 所有的cell的attrbts */ -@property (nonatomic, strong) NSMutableArray *lmj_AtrbsArray; +@property (nonatomic, strong) NSMutableArray *lmj_AtrbsArray; /** 每一列的最后的高度 */ -@property (nonatomic, strong) NSMutableArray *lmj_LinesWidthArray; +@property (nonatomic, strong) NSMutableArray *lmj_LinesWidthArray; - (NSInteger)lines; @@ -48,9 +48,8 @@ - (void)prepareLayout //如果重新刷新就需要移除之前存储的高度 [self.lmj_LinesWidthArray removeAllObjects]; - //复赋值以顶部的高度, 并且根据列数 + //复赋值以顶部的高度, 并且根据行数 for (NSInteger i = 0; i < self.lines; i++) { - [self.lmj_LinesWidthArray addObject:@(self.edgeInsets.left)]; } @@ -62,9 +61,6 @@ - (void)prepareLayout { [self.lmj_AtrbsArray addObject:[self layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]]]; } - - - } @@ -83,18 +79,17 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde CGFloat w = [self.delegate waterflowLayout:self collectionView:self.collectionView widthForItemAtIndexPath:indexPath itemHeight:h]; // 拿到最后的高度最小的那一列, 假设第0列最小 - NSInteger indexLine = 0; - CGFloat minLineW = [self.lmj_LinesWidthArray[indexLine] doubleValue]; + __block NSInteger indexLine = 0; + __block CGFloat minLineW = [self.lmj_LinesWidthArray[indexLine] doubleValue]; - for (NSInteger i = 1; i < self.lmj_LinesWidthArray.count; i++) - { - CGFloat lineW = [self.lmj_LinesWidthArray[i] doubleValue]; + [self.lmj_LinesWidthArray enumerateObjectsUsingBlock:^(NSNumber * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + CGFloat lineW = obj.doubleValue; if(minLineW > lineW) { minLineW = lineW; - indexLine = i; + indexLine = idx; } - } + }]; CGFloat x = [self xMarginAtIndexPath:indexPath] + minLineW; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNavigationBar.m b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNavigationBar.m index d61fbdcb..e65b9078 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNavigationBar.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNavigationBar.m @@ -103,7 +103,7 @@ - (void)setTitleView:(UIView *)titleView - (void)setTitle:(NSMutableAttributedString *)title { // bug fix - if ([self.dataSource respondsToSelector:@selector(lmjNavigationBarTitleView:)]) { + if ([self.dataSource respondsToSelector:@selector(lmjNavigationBarTitleView:)] && [self.dataSource lmjNavigationBarTitleView:self]) { return; } diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNormalRefreshHeader.h b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNormalRefreshHeader.h index 7a9f5850..93e3dc5a 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNormalRefreshHeader.h +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNormalRefreshHeader.h @@ -7,6 +7,7 @@ // #import +#import @interface LMJNormalRefreshHeader : MJRefreshNormalHeader diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNormalRefreshHeader.m b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNormalRefreshHeader.m index e52869da..4ab0ae8a 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNormalRefreshHeader.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJNormalRefreshHeader.m @@ -27,10 +27,15 @@ - (void)awakeFromNib - (void)setupUIOnce { - self.automaticallyChangeAlpha = YES; } +// MJBug fix +- (void)endRefreshing { + [super endRefreshing]; + self.state = MJRefreshStateIdle; +} + - (void)layoutSubviews { [super layoutSubviews]; diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJSettingCell.m b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJSettingCell.m index bd63583f..1bf7e856 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJSettingCell.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJSettingCell.m @@ -26,7 +26,6 @@ + (instancetype)cellWithTableView:(UITableView *)tableView andCellStyle:(UITable { cell = [[self alloc] initWithStyle:style reuseIdentifier:ID]; } - return cell; } @@ -50,7 +49,7 @@ - (void)awakeFromNib - (void)setupBaseSettingCellUI { - + self.detailTextLabel.numberOfLines = 0; } - (void)setItem:(LMJWordItem *)item @@ -66,7 +65,22 @@ - (void)fillData { self.textLabel.text = self.item.title; self.detailTextLabel.text = self.item.subTitle; - self.imageView.image = self.item.image; +// self.imageView.image = self.item.image; + /** 左边的图片 UIImage 或者 NSURL 或者 URLString 或者 ImageName */ + if ([self.item.image isKindOfClass:[UIImage class]]) { + self.imageView.image = self.item.image; + }else if ([self.item.image isKindOfClass:[NSURL class]]) { + [self.imageView sd_setImageWithURL:self.item.image]; + }else if ([self.item.image isKindOfClass:[NSString class]]) { + + if ([self.item.image hasPrefix:@"http://"] || [self.item.image hasPrefix:@"https://"] || [self.item.image hasPrefix:@"file://"]) { + + NSString *imageUrl = [self.item.image stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + [self.imageView sd_setImageWithURL:[NSURL URLWithString:imageUrl]]; + }else { + self.imageView.image = [UIImage imageNamed:self.item.image]; + } + } } - (void)changeUI @@ -76,6 +90,7 @@ - (void)changeUI self.detailTextLabel.font = self.item.subTitleFont; self.detailTextLabel.textColor = self.item.subTitleColor; + self.detailTextLabel.numberOfLines = self.item.subTitleNumberOfLines; if ([self.item isKindOfClass:[LMJWordArrowItem class]]) { @@ -103,6 +118,4 @@ - (void)layoutSubviews } - - @end diff --git a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJVerticalFlowLayout.m b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJVerticalFlowLayout.m index 8ac4ec28..52dc0a6d 100644 --- a/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJVerticalFlowLayout.m +++ b/iOSProject/iOSProject/Classes/LMJBase/BaseView/LMJVerticalFlowLayout.m @@ -18,10 +18,10 @@ @interface LMJVerticalFlowLayout() /** 所有的cell的attrbts */ -@property (nonatomic, strong) NSMutableArray *lmj_AtrbsArray; +@property (nonatomic, strong) NSMutableArray *lmj_AtrbsArray; /** 每一列的最后的高度 */ -@property (nonatomic, strong) NSMutableArray *lmj_ColumnsHeightArray; +@property (nonatomic, strong) NSMutableArray *lmj_ColumnsHeightArray; - (NSInteger)columns; @@ -35,8 +35,6 @@ - (UIEdgeInsets)edgeInsets; @implementation LMJVerticalFlowLayout - - /** * 刷新布局的时候回重新调用 */ @@ -49,7 +47,6 @@ - (void)prepareLayout //复赋值以顶部的高度, 并且根据列数 for (NSInteger i = 0; i < self.columns; i++) { - [self.lmj_ColumnsHeightArray addObject:@(self.edgeInsets.top)]; } @@ -62,8 +59,6 @@ - (void)prepareLayout [self.lmj_AtrbsArray addObject:[self layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]]]; } - - } @@ -82,19 +77,16 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde CGFloat h = [self.delegate waterflowLayout:self collectionView:self.collectionView heightForItemAtIndexPath:indexPath itemWidth:w]; // 拿到最后的高度最小的那一列, 假设第0列最小 - NSInteger indexCol = 0; - CGFloat minColH = [self.lmj_ColumnsHeightArray[indexCol] doubleValue]; - - for (NSInteger i = 1; i < self.lmj_ColumnsHeightArray.count; i++) - { - CGFloat colH = [self.lmj_ColumnsHeightArray[i] doubleValue]; - if(minColH > colH) - { + __block NSInteger indexCol = 0; + __block CGFloat minColH = [self.lmj_ColumnsHeightArray[indexCol] doubleValue]; + + [self.lmj_ColumnsHeightArray enumerateObjectsUsingBlock:^(NSNumber * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + CGFloat colH = obj.floatValue; + if (minColH > colH) { minColH = colH; - indexCol = i; + indexCol = idx; } - } - + }]; CGFloat x = self.edgeInsets.left + (self.xMargin + w) * indexCol; @@ -102,7 +94,6 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde // 是第一行 if (minColH == self.edgeInsets.top) { - y = self.edgeInsets.top; } @@ -115,7 +106,7 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde return atrbs; } - +// layoutAttributesForElementsInRect - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { return self.lmj_AtrbsArray; @@ -212,7 +203,6 @@ - (UIEdgeInsets)edgeInsets - (instancetype)initWithDelegate:(id)delegate { if (self = [super init]) { - } return self; } diff --git a/iOSProject/iOSProject/Classes/Main/LMJCasesViewController.m b/iOSProject/iOSProject/Classes/Main/LMJCasesViewController.m index 3089abbf..cc955264 100644 --- a/iOSProject/iOSProject/Classes/Main/LMJCasesViewController.m +++ b/iOSProject/iOSProject/Classes/Main/LMJCasesViewController.m @@ -32,7 +32,11 @@ - (void)viewDidLoad { LMJWordArrowItem *item2 = [LMJWordArrowItem itemWithTitle:@"加载本地html和css 需要建立实体文件夹" subTitle:@"MCLocalHTMLViewController"]; item2.destVc = [MCLocalHTMLViewController class]; - LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item0, item1, item2] andHeaderTitle:@"UI 更多案例" footerTitle:@"UI --end"]; +// MCTestViewController + LMJWordArrowItem *item3 = [LMJWordArrowItem itemWithTitle:@"多项测试" subTitle:@"MCTestViewController"]; + item3.destVc = NSClassFromString(@"MCTestViewController"); + + LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item0, item1, item2, item3] andHeaderTitle:@"UI 更多案例" footerTitle:@"UI --end"]; [self.sections addObject:section0]; } diff --git a/iOSProject/iOSProject/Classes/Main/LMJHomeViewController.m b/iOSProject/iOSProject/Classes/Main/LMJHomeViewController.m index 0c314f11..dfa55ec1 100644 --- a/iOSProject/iOSProject/Classes/Main/LMJHomeViewController.m +++ b/iOSProject/iOSProject/Classes/Main/LMJHomeViewController.m @@ -14,12 +14,12 @@ #import "LMJGCDViewController.h" #import "LMJNSOperationViewController.h" #import "LMJLockViewController.h" -#import "LMJProtocolViewController.h" #import "LMJBlockLoopViewController.h" #import "LMJRunLoopViewController.h" #import "LMJDynamicViewController.h" #import "LMJCoreAnimationViewController.h" #import "LMJDrawRectViewController.h" +#import "LMJWebImagesCacheViewController.h" @interface LMJHomeViewController () @@ -38,63 +38,59 @@ - (void)viewDidLoad { LMJWordArrowItem *item00 = [LMJWordArrowItem itemWithTitle:@"ViewController的生命周期" subTitle: nil]; item00.destVc = [LMJLiftCycleViewController class]; - LMJWordArrowItem *item01 = [LMJWordArrowItem itemWithTitle:@"运行时RunTime 的知识运用" subTitle: nil]; - item01.destVc = [LMJRunTimeViewController class]; - - LMJWordArrowItem *item03 = [LMJWordArrowItem itemWithTitle:@"Protocol 的实现类" subTitle: nil]; - item03.destVc = [LMJProtocolViewController class]; - - LMJWordArrowItem *item04 = [LMJWordArrowItem itemWithTitle:@"Block 内存释放" subTitle: nil]; item04.destVc = [LMJBlockLoopViewController class]; + LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item00, item04] andHeaderTitle:@"生命周期, block" footerTitle:nil]; - LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item00, item01, item03, item04] andHeaderTitle:@"生命周期, RunTime" footerTitle:nil]; - - [self.sections addObject:section0]; - - - - LMJWordArrowItem *item10 = [LMJWordArrowItem itemWithTitle:@"NSThread 多线程" subTitle: nil]; + + LMJWordArrowItem *item10 = [LMJWordArrowItem itemWithTitle:@"Thread 多线程" subTitle: nil]; item10.destVc = [LMJNSThreadViewController class]; LMJWordArrowItem *item11 = [LMJWordArrowItem itemWithTitle:@"GCD 多线程" subTitle: nil]; item11.destVc = [LMJGCDViewController class]; - LMJWordArrowItem *item12 = [LMJWordArrowItem itemWithTitle:@" NSOperation 多线程" subTitle: nil]; + LMJWordArrowItem *item12 = [LMJWordArrowItem itemWithTitle:@"NSOperation 多线程" subTitle: nil]; item12.destVc = [LMJNSOperationViewController class]; - LMJWordArrowItem *item13 = [LMJWordArrowItem itemWithTitle:@"同步锁知识" subTitle: nil]; + LMJWordArrowItem *item13 = [LMJWordArrowItem itemWithTitle:@"同步锁知识" subTitle: @"NSLock @synchronized"]; item13.destVc = [LMJLockViewController class]; - LMJWordArrowItem *item14 = [LMJWordArrowItem itemWithTitle:@"RunLoop" subTitle: @"建议看"]; - item14.destVc = [LMJRunLoopViewController class]; - - LMJItemSection *section1 = [LMJItemSection sectionWithItems:@[item10, item11, item12, item14, item13] andHeaderTitle:@"NSThread, GCD, NSOperation, Lock, RunLoop" footerTitle:nil]; - [self.sections addObject:section1]; - + LMJWordArrowItem *item131 = [LMJWordArrowItem itemWithTitle:@"列表图片s下载缓存" subTitle:@"SDWebImage列表图片模仿"]; + item131.destVc = [LMJWebImagesCacheViewController class]; + LMJItemSection *section1 = [LMJItemSection sectionWithItems:@[item10, item11, item12, item13, item131] andHeaderTitle:@"多线程, 同步锁, 列表加载图片" footerTitle:nil]; + LMJWordArrowItem *item20 = [LMJWordArrowItem itemWithTitle:@"物理仿真" subTitle: @"UIDynamic"]; item20.destVc = [LMJDynamicViewController class]; - LMJWordArrowItem *item21 = [LMJWordArrowItem itemWithTitle:@"核心动画" subTitle: @"CATransform3D"]; - + LMJWordArrowItem *item21 = [LMJWordArrowItem itemWithTitle:@"核心动画 CoreAnimation" subTitle: @"CATransform3D"]; item21.destVc = [LMJCoreAnimationViewController class]; - LMJWordArrowItem *item22 = [LMJWordArrowItem itemWithTitle:@"绘图 Quartz2D" subTitle: @"drawRect"]; + LMJWordArrowItem *item22 = [LMJWordArrowItem itemWithTitle:@"绘图Quartz2D" subTitle: @"Drawrect,贝塞尔,手势"]; item22.destVc = [LMJDrawRectViewController class]; - LMJItemSection *section2 = [LMJItemSection sectionWithItems:@[item22, item21, item20] andHeaderTitle:@"物理仿真, 核心动画, 绘图 Quartz2D" footerTitle:nil]; + LMJItemSection *section2 = [LMJItemSection sectionWithItems:@[item22, item21, item20] andHeaderTitle:@"绘图Quartz2D, 核心动画, 物理仿真" footerTitle:nil]; - [self.sections addObject:section2]; + - UITabBarItem *homeItem = self.navigationController.tabBarItem; + LMJWordArrowItem *item01 = [LMJWordArrowItem itemWithTitle:@"运行时RunTime 的知识运用" subTitle: nil]; + item01.destVc = [LMJRunTimeViewController class]; - [homeItem setBadgeValue:@"3"]; + LMJWordArrowItem *item14 = [LMJWordArrowItem itemWithTitle:@"RunLoop" subTitle: @"建议看"]; + + item14.destVc = [LMJRunLoopViewController class]; + LMJItemSection *section3 = [LMJItemSection sectionWithItems:@[item01, item14] andHeaderTitle:@"运行时RunTime, 运行循环RunLoop" footerTitle:nil]; + + + [self.sections addObjectsFromArray:@[section2, section1, section3, section0]]; + + UITabBarItem *homeItem = self.navigationController.tabBarItem; + [homeItem setBadgeValue:@"3"]; } @@ -178,7 +174,11 @@ - (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigation /** 左边的按钮的点击 */ -(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { + LMJWebViewController *ac = [LMJWebViewController new]; + ac.gotoURL = @"https://baidu.com/"; + [self.navigationController pushViewController:ac animated:YES]; + NSLog(@"%s", __func__); } /** 右边的按钮的点击 */ -(void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar diff --git a/iOSProject/iOSProject/Classes/Main/LMJMessageViewController.m b/iOSProject/iOSProject/Classes/Main/LMJMessageViewController.m index 6e08b667..c583a00b 100644 --- a/iOSProject/iOSProject/Classes/Main/LMJMessageViewController.m +++ b/iOSProject/iOSProject/Classes/Main/LMJMessageViewController.m @@ -11,18 +11,19 @@ #import "SINTabBarController.h" //#import "IMHTabBarController.h" #import "MUSHomeListViewController.h" -#import "VIDTabBarController.h" +#import "SINUserManager.h" +#import "UIView+GestureCallback.h" @interface LMJMessageViewController () /** <#digest#> */ -@property (weak, nonatomic) UILabel *backBtn; +@property (strong, nonatomic) UILabel *backBtn; @end @implementation LMJMessageViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + LMJWeak(self); NSLog(@"%@", weakself); self.navigationItem.title = @"功能实例"; @@ -31,45 +32,45 @@ - (void)viewDidLoad { self.tableView.contentInset = edgeInsets; - LMJWordItem *item0 = [LMJWordItem itemWithTitle:@"百思不得姐" subTitle: @"BSJ"]; + LMJWordItem *item0 = [LMJWordItem itemWithTitle:@"模仿百思不得姐App" subTitle: @"NJBSJ"]; [item0 setItemOperation:^(NSIndexPath *indexPath){ [weakself presentViewController:[[BSJTabBarController alloc] init] animated:YES completion:nil]; }]; - - LMJWordItem *item1 = [LMJWordItem itemWithTitle:@"SIN" subTitle: @"新浪微博"]; + LMJWordItem *item1 = [LMJWordItem itemWithTitle:@"模仿微博App" subTitle: @"NJSina"]; [item1 setItemOperation:^(NSIndexPath *indexPath){ [weakself presentViewController:[[SINTabBarController alloc] init] animated:YES completion:nil]; }]; + // LMJWordItem *item2 = [LMJWordItem itemWithTitle:@"IM_HX" subTitle: @"环信聊天"]; + // [item2 setItemOperation:^(NSIndexPath *indexPath){ + // [weakself presentViewController:[[IMHTabBarController alloc] init] animated:YES completion:nil]; + // }]; - -// LMJWordItem *item2 = [LMJWordItem itemWithTitle:@"IM_HX" subTitle: @"环信聊天"]; -// [item2 setItemOperation:^(NSIndexPath *indexPath){ -// [weakself presentViewController:[[IMHTabBarController alloc] init] animated:YES completion:nil]; -// }]; - - - - LMJWordItem *item3 = [LMJWordItem itemWithTitle:@"Musics" subTitle: @"QQ音乐"]; + LMJWordItem *item3 = [LMJWordItem itemWithTitle:@"音乐音频播放" subTitle: @"Music"]; [item3 setItemOperation:^(NSIndexPath *indexPath){ [weakself presentViewController:[[LMJNavigationController alloc] initWithRootViewController:[[MUSHomeListViewController alloc] init]] animated:YES completion:nil]; }]; - - - LMJWordItem *item4 = [LMJWordItem itemWithTitle:@"Videos" subTitle: @"列表视频"]; + LMJWordItem *item4 = [LMJWordItem itemWithTitle:@"列表视频" subTitle: @"Video"]; [item4 setItemOperation:^(NSIndexPath *indexPath){ - [weakself presentViewController:[[VIDTabBarController alloc] init] animated:YES completion:nil]; + [weakself presentViewController:[[UIStoryboard storyboardWithName:@"VideoDemo" bundle:[NSBundle mainBundle]] instantiateInitialViewController] animated:YES completion:nil]; }]; - - LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item0, item1, item3, item4] andHeaderTitle:nil footerTitle:nil]; [self.sections addObject:section0]; - + [[LMJRequestManager sharedManager] GET:[LMJNJHuBaseUrl stringByAppendingPathComponent:@"jsons/accesstoken.json"] parameters:nil completion:^(LMJBaseResponse *response) { + NSLog(@"%@", response); + if (LMJIsEmpty(response.responseObject) || ![response.responseObject isKindOfClass:[NSDictionary class]]) { + return ; + } + // 作者的微博开放号 + if ([LMJThirdSDKSinaAppKey isEqualToString:@"4061770881"]) { + SINUserManager.sharedManager.accessToken = response.responseObject[@"accessToken"]; + } + }]; } - (void)viewDidAppear:(BOOL)animated { @@ -80,6 +81,7 @@ - (void)viewDidAppear:(BOOL)animated { - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; self.backBtn.hidden = !self.presentedViewController; + [[UIApplication sharedApplication].keyWindow addSubview:self.backBtn]; } - (UILabel *)backBtn @@ -98,7 +100,7 @@ - (UILabel *)backBtn btn.layer.cornerRadius = 15; btn.layer.masksToBounds = YES; - LMJWeakSelf(self); + LMJWeak(self); [btn addTapGestureRecognizer:^(UITapGestureRecognizer *recognizer, NSString *gestureId) { if (weakself.presentedViewController) { @@ -107,11 +109,11 @@ - (UILabel *)backBtn }]; - - LMJWeakSelf(btn); + + LMJWeak(btn); [btn addGestureRecognizer:[[UIPanGestureRecognizer alloc] initWithActionBlock:^(UIPanGestureRecognizer *_Nonnull sender) { -// NSLog(@"%@", sender); + // NSLog(@"%@", sender); // 获取手势的触摸点 // CGPoint curP = [pan locationInView:self.imageView]; @@ -136,15 +138,9 @@ - (UILabel *)backBtn }]]; - - - [[UIApplication sharedApplication].keyWindow addSubview:btn]; - _backBtn = btn; } return _backBtn; } - - @end diff --git a/iOSProject/iOSProject/Classes/Main/LMJNewViewController.m b/iOSProject/iOSProject/Classes/Main/LMJNewViewController.m index 573561f5..63d99309 100644 --- a/iOSProject/iOSProject/Classes/Main/LMJNewViewController.m +++ b/iOSProject/iOSProject/Classes/Main/LMJNewViewController.m @@ -15,6 +15,7 @@ #import "LMJElementsCollectionViewController.h" #import "LMJVerticalLayoutViewController.h" #import "LMJHorizontalLayoutViewController.h" +#import "LMJCuteFlowLayoutViewController.h" #import "LMJKeyboardHandleViewController.h" #import "LMJDownLoadFileViewController.h" #import "LMJMasonryViewController.h" @@ -24,10 +25,11 @@ #import "LMJUpLoadProgressViewController.h" #import "LMJListTimerCountDownViewController.h" #import "LMJH5_OCViewController.h" +#import "LMJH5JSBridgeViewController.h" #import "LMJAlertViewsViewController.h" #import "LMJFillTableFormViewController.h" //#import "LMJFaceRecognizeViewController.h" -#import "LMJTableSDWebImageViewController.h" +#import "LMJWebImagesCacheViewController.h" #import "LMJDragTableViewController.h" #import "LMJCalendarViewController.h" #import "LMJNavBarFadeViewController.h" @@ -35,6 +37,8 @@ #import "LMJAutoLayoutViewController.h" #import "LMJVFLLayoutViewController.h" #import "LMJOfflineDownloadViewController.h" +#import "LMJRSAViewController.h" +#import "LMJUniversalLinkViewController.h" @interface LMJNewViewController () @@ -98,6 +102,10 @@ - (void)viewDidLoad { item10.destVc = [LMJHorizontalLayoutViewController class]; + LMJWordArrowItem *item101 = [LMJWordArrowItem itemWithTitle:@"三种CollectionViewLayout布局" subTitle: @"Cute"]; + + item101.destVc = [LMJCuteFlowLayoutViewController class]; + LMJWordArrowItem *item11 = [LMJWordArrowItem itemWithTitle:@"键盘处理" subTitle: @""]; item11.destVc = [LMJKeyboardHandleViewController class]; @@ -106,7 +114,7 @@ - (void)viewDidLoad { item12.destVc = [LMJDownLoadFileViewController class]; - LMJWordArrowItem *item121 = [LMJWordArrowItem itemWithTitle:@"文件 断点 离线 缓存 下载" subTitle: @""]; + LMJWordArrowItem *item121 = [LMJWordArrowItem itemWithTitle:@"文件 断点 缓存 下载" subTitle: @""]; item121.destVc = [LMJOfflineDownloadViewController class]; @@ -135,9 +143,13 @@ - (void)viewDidLoad { item19.destVc = [LMJListTimerCountDownViewController class]; - LMJWordArrowItem *item20 = [LMJWordArrowItem itemWithTitle:@"H5和 OC 交互" subTitle: @""]; + LMJWordArrowItem *item20 = [LMJWordArrowItem itemWithTitle:@"H5_OC交互" subTitle: @"原生addScriptMessageHandler"]; item20.destVc = [LMJH5_OCViewController class]; + + LMJWordArrowItem *item201 = [LMJWordArrowItem itemWithTitle:@"H5_OC_JSBridge交互" subTitle: @"自定义 JSBridge "]; + + item201.destVc = [LMJH5JSBridgeViewController class]; LMJWordArrowItem *item21 = [LMJWordArrowItem itemWithTitle:@"自定义各种弹框" subTitle: @""]; @@ -150,9 +162,9 @@ - (void)viewDidLoad { // LMJWordArrowItem *item23 = [LMJWordArrowItem itemWithTitle:@"人脸识别" subTitle: nil]; // item23.destVc = [LMJFaceRecognizeViewController class]; - LMJWordArrowItem *item24 = [LMJWordArrowItem itemWithTitle:@"列表加载图片" subTitle: @"SDWebImage"]; + LMJWordArrowItem *item24 = [LMJWordArrowItem itemWithTitle:@"列表加载图片s" subTitle: @"模仿sdwebImage"]; - item24.destVc = [LMJTableSDWebImageViewController class]; + item24.destVc = [LMJWebImagesCacheViewController class]; LMJWordArrowItem *item25 = [LMJWordArrowItem itemWithTitle:@"列表拖拽" subTitle: @""]; @@ -178,9 +190,21 @@ - (void)viewDidLoad { item30.destVc = [LMJVFLLayoutViewController class]; - - LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item121,item13, item29, item30, item15, item16, item17, item18, item19, item20, item21, item22, item24, item25, item26, item27, item28] andHeaderTitle:@"静态单元格的头部标题" footerTitle:@"静态单元格的尾部标题"]; - + LMJWordArrowItem *item40 = [LMJWordArrowItem itemWithTitle:@"RSA 加密解密" subTitle: @"网络数据加密解密"]; + + item40.destVc = [LMJRSAViewController class]; + + LMJWordArrowItem *item41 = [LMJWordArrowItem itemWithTitle:@"通用链接跳转" subTitle: @"浏览器,短信,邮件,其它App,都可以跳转本 App"]; + + item41.destVc = [LMJUniversalLinkViewController class]; + + LMJItemSection *section0; + section0 = [LMJItemSection sectionWithItems:@[item40, item41, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item101, item11, item12, item121,item13, item29, item30, item15, item16, item17, item18, item19, item20, item201, item21, item22, item24, item25, item26, item27, item28] andHeaderTitle:@"静态单元格的头部标题" footerTitle:@"静态单元格的尾部标题"]; +// [section0.items sortUsingComparator:^NSComparisonResult(LMJWordItem *_Nonnull obj1, LMJWordItem *_Nonnull obj2) { +// +// return [NSString stringWithFormat:@"%@%@", obj2.title, obj2.subTitle].length > [NSString stringWithFormat:@"%@%@", obj1.title, obj1.subTitle].length; +// }]; + [self.sections addObject:section0]; } diff --git a/iOSProject/iOSProject/Classes/Main/LMJTabBarController.h b/iOSProject/iOSProject/Classes/Main/LMJTabBarController.h index 046a3390..686eef9a 100644 --- a/iOSProject/iOSProject/Classes/Main/LMJTabBarController.h +++ b/iOSProject/iOSProject/Classes/Main/LMJTabBarController.h @@ -7,8 +7,7 @@ // #import -#import -@interface LMJTabBarController : CYLTabBarController +@interface LMJTabBarController : UITabBarController @end diff --git a/iOSProject/iOSProject/Classes/Main/LMJTabBarController.m b/iOSProject/iOSProject/Classes/Main/LMJTabBarController.m index 3e97f2cc..b13801e1 100644 --- a/iOSProject/iOSProject/Classes/Main/LMJTabBarController.m +++ b/iOSProject/iOSProject/Classes/Main/LMJTabBarController.m @@ -23,13 +23,15 @@ @implementation LMJTabBarController - (void)viewDidLoad { [super viewDidLoad]; - self.tabBar.tintColor = [UIColor redColor]; - [self setValue:[NSValue valueWithUIOffset:UIOffsetMake(0, -3)] forKeyPath:LMJKeyPath(self, titlePositionAdjustment)]; - [self addTabarItems]; [self addChildViewControllers]; - + [self addTabarItems]; self.delegate = self; } +- (void)customIsInGod:(NSNotification *)noti { + if (![noti.object boolValue]) { + return; + } +} - (void)addChildViewControllers @@ -51,40 +53,48 @@ - (void)addChildViewControllers - (void)addTabarItems { - NSDictionary *firstTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"基础", - CYLTabBarItemImage : @"tabBar_essence_icon", - CYLTabBarItemSelectedImage : @"tabBar_essence_click_icon", + @"TabBarItemTitle" : @"基础", + @"TabBarItemImage" : @"tabBar_essence_icon", + @"TabBarItemSelectedImage" : @"tabBar_essence_click_icon", }; NSDictionary *secondTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"预演", - CYLTabBarItemImage : @"tabBar_friendTrends_icon", - CYLTabBarItemSelectedImage : @"tabBar_friendTrends_click_icon", + @"TabBarItemTitle" : @"预演", + @"TabBarItemImage" : @"tabBar_friendTrends_icon", + @"TabBarItemSelectedImage" : @"tabBar_friendTrends_click_icon", }; NSDictionary *thirdTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"实例", - CYLTabBarItemImage : @"tabBar_new_icon", - CYLTabBarItemSelectedImage : @"tabBar_new_click_icon", + @"TabBarItemTitle" : @"实例", + @"TabBarItemImage" : @"tabBar_new_icon", + @"TabBarItemSelectedImage" : @"tabBar_new_click_icon", }; NSDictionary *fourthTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"分享", - CYLTabBarItemImage : @"tabBar_me_icon", - CYLTabBarItemSelectedImage : @"tabBar_me_click_icon" + @"TabBarItemTitle" : @"分享", + @"TabBarItemImage" : @"tabBar_me_icon", + @"TabBarItemSelectedImage" : @"tabBar_me_click_icon" }; NSDictionary *fifthTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"更多", - CYLTabBarItemImage : @"tabbar_discover", - CYLTabBarItemSelectedImage : @"tabbar_discover_highlighted" + @"TabBarItemTitle" : @"更多", + @"TabBarItemImage" : @"tabbar_discover", + @"TabBarItemSelectedImage" : @"tabbar_discover_highlighted" }; - self.tabBarItemsAttributes = @[ secondTabBarItemsAttributes, + NSArray *tabBarItemsAttributes = @[ secondTabBarItemsAttributes, firstTabBarItemsAttributes, thirdTabBarItemsAttributes, fifthTabBarItemsAttributes, fourthTabBarItemsAttributes ]; - + + [self.childViewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + + obj.tabBarItem.title = tabBarItemsAttributes[idx][@"TabBarItemTitle"]; + obj.tabBarItem.image = [UIImage imageNamed:tabBarItemsAttributes[idx][@"TabBarItemImage"]]; + obj.tabBarItem.selectedImage = [UIImage imageNamed:tabBarItemsAttributes[idx][@"TabBarItemSelectedImage"]]; + obj.tabBarItem.titlePositionAdjustment = UIOffsetMake(0, -3); + }]; + + self.tabBar.tintColor = [UIColor redColor]; } - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController diff --git a/iOSProject/iOSProject/Classes/Network/LMJBaseRequest.m b/iOSProject/iOSProject/Classes/Network/LMJBaseRequest.m index 38535704..70f086f4 100644 --- a/iOSProject/iOSProject/Classes/Network/LMJBaseRequest.m +++ b/iOSProject/iOSProject/Classes/Network/LMJBaseRequest.m @@ -14,7 +14,7 @@ @implementation LMJBaseRequest - (void)GET:(NSString *)URLString parameters:(id)parameters completion:(void(^)(LMJBaseResponse *response))completion { - LMJWeakSelf(self); + LMJWeak(self); [[LMJRequestManager sharedManager] GET:URLString parameters:parameters completion:^(LMJBaseResponse *response) { if (!weakself) { @@ -29,7 +29,7 @@ - (void)GET:(NSString *)URLString parameters:(id)parameters completion:(void(^)( - (void)POST:(NSString *)URLString parameters:(id)parameters completion:(void(^)(LMJBaseResponse *response))completion { - LMJWeakSelf(self); + LMJWeak(self); [[LMJRequestManager sharedManager] POST:URLString parameters:parameters completion:^(LMJBaseResponse *response) { if (!weakself) { diff --git a/iOSProject/iOSProject/Classes/Network/LMJBaseResponse.h b/iOSProject/iOSProject/Classes/Network/LMJBaseResponse.h index 94b844cc..3cca97a5 100644 --- a/iOSProject/iOSProject/Classes/Network/LMJBaseResponse.h +++ b/iOSProject/iOSProject/Classes/Network/LMJBaseResponse.h @@ -11,19 +11,19 @@ @interface LMJBaseResponse : NSObject -/** <#digest#> */ +/** 错误 */ @property (nonatomic, strong) NSError *error; -/** <#digest#> */ +/** 错误提示 */ @property (nonatomic, copy) NSString *errorMsg; -/** <#digest#> */ +/** 错误码 */ @property (assign, nonatomic) NSInteger statusCode; -/** <#digest#> */ -@property (nonatomic, copy) NSMutableDictionary *headers; +/** 响应头 */ +@property (nonatomic, strong) NSMutableDictionary *headers; -/** <#digest#> */ +/** 响应体 */ @property (nonatomic, strong) id responseObject; @end diff --git a/iOSProject/iOSProject/Classes/Network/LMJLocalJsons/video.json b/iOSProject/iOSProject/Classes/Network/LMJLocalJsons/video.json new file mode 100644 index 00000000..d4e3b078 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Network/LMJLocalJsons/video.json @@ -0,0 +1,10 @@ + +{ + data: [ + {url: 'https://0.0.0.123/'}, + {url: 'https://0.0.0.123/'}, + {url: 'https://0.0.0.123/'}, + {url: 'https://0.0.0.123/'}, + {url: 'https://0.0.0.123/'} + ] +} diff --git a/iOSProject/iOSProject/Classes/Network/LMJRequestManager.h b/iOSProject/iOSProject/Classes/Network/LMJRequestManager.h index 76bff0ec..1f6d901c 100644 --- a/iOSProject/iOSProject/Classes/Network/LMJRequestManager.h +++ b/iOSProject/iOSProject/Classes/Network/LMJRequestManager.h @@ -10,34 +10,37 @@ #import "LMJBaseResponse.h" #import +typedef NSString LMJDataName; + typedef enum : NSInteger { + // 自定义错误码 LMJRequestManagerStatusCodeCustomDemo = -10000, } LMJRequestManagerStatusCode; typedef LMJBaseResponse *(^ResponseFormat)(LMJBaseResponse *response); - @interface LMJRequestManager : AFHTTPSessionManager - + (instancetype)sharedManager; - //本地数据模式 @property (assign, nonatomic) BOOL isLocal; //预处理返回的数据 @property (copy, nonatomic) ResponseFormat responseFormat; +// https 验证 +@property (nonatomic, copy) NSString *cerFilePath; + - (void)POST:(NSString *)urlString parameters:(id)parameters completion:(void (^)(LMJBaseResponse *response))completion; - (void)GET:(NSString *)urlString parameters:(id)parameters completion:(void (^)(LMJBaseResponse *response))completion; -/** - data 对应的二进制数据 - name 服务端需要参数 +/* + 上传 + data 数据对应的二进制数据 + LMJDataName data对应的参数 */ -- (void)upload:(NSString *)urlString parameters:(id)parameters formDataBlock:(void(^)(id formData))formDataBlock progress:(void (^)(NSProgress *progress))progress completion:(void (^)(LMJBaseResponse *response))completion; - +- (void)upload:(NSString *)urlString parameters:(id)parameters formDataBlock:(NSDictionary *(^)(id formData, NSMutableDictionary *needFillDataDict))formDataBlock progress:(void (^)(NSProgress *progress))progress completion:(void (^)(LMJBaseResponse *response))completion; @end diff --git a/iOSProject/iOSProject/Classes/Network/LMJRequestManager.m b/iOSProject/iOSProject/Classes/Network/LMJRequestManager.m index 9ba9869d..20833b7e 100644 --- a/iOSProject/iOSProject/Classes/Network/LMJRequestManager.m +++ b/iOSProject/iOSProject/Classes/Network/LMJRequestManager.m @@ -25,13 +25,9 @@ - (void)GET:(NSString *)urlString parameters:(id)parameters completion:(void (^) [self request:@"GET" URL:urlString parameters:parameters completion:completion]; } - - #pragma mark - post & get - (void)request:(NSString *)method URL:(NSString *)urlString parameters:(id)parameters completion:(void (^)(LMJBaseResponse *response))completion { - - if (self.isLocal) { [self requestLocal:urlString completion:completion]; return; @@ -48,7 +44,6 @@ - (void)request:(NSString *)method URL:(NSString *)urlString parameters:(id)para void(^success)(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) = ^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - [self wrapperTask:task responseObject:responseObject error:nil completion:completion]; }; @@ -57,64 +52,55 @@ - (void)request:(NSString *)method URL:(NSString *)urlString parameters:(id)para [self wrapperTask:task responseObject:nil error:error completion:completion]; }; - - if ([method isEqualToString:@"GET"]) { - [self GET:urlString parameters:parameters progress:nil success:success failure:failure]; + [self GET:urlString parameters:parameters headers:nil progress:nil success:success failure:failure]; } - if ([method isEqualToString:@"POST"]) { - - [self POST:urlString parameters:parameters progress:nil success:success failure:failure]; + [self POST:urlString parameters:parameters headers:nil progress:nil success:success failure:failure]; } } #pragma mark - 加载本地数据 +static NSString *jsonFileDirectory = @"LMJLocalJsons"; - (void)requestLocal:(NSString *)urlString completion:(void (^)(LMJBaseResponse *response))completion { dispatch_async(dispatch_get_global_queue(0, 0), ^{ - NSError *fileError = nil; NSError *jsonError = nil; - NSURL *fileUrl = [[NSBundle mainBundle] URLForResource:[urlString lastPathComponent] withExtension:@"json"]; - - NSData *jsonData = [NSData dataWithContentsOfURL:fileUrl options:0 error:&fileError]; - - - id responseObj = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&jsonError]; - - - [self wrapperTask:nil responseObject:responseObj error:fileError ?: jsonError completion:completion]; + NSString *jsonFile = [NSString stringWithFormat:@"%@/%@", jsonFileDirectory, [urlString lastPathComponent]]; + NSString *jsonFilePath = [[NSBundle mainBundle] pathForResource:jsonFile ofType:@"json"]; + NSData *jsonData = [NSData dataWithContentsOfFile:jsonFilePath options:0 error:&fileError]; + if (fileError) { + [self wrapperTask:nil responseObject:nil error:fileError completion:completion]; + + }else { + id responseObj = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&jsonError]; + + [self wrapperTask:nil responseObject:responseObj error:jsonError completion:completion]; + } }); - } #pragma mark - 处理数据 - (void)wrapperTask:(NSURLSessionDataTask *)task responseObject:(id)responseObject error:(NSError *)error completion:(void (^)(LMJBaseResponse *response))completion { - dispatch_async(dispatch_get_global_queue(0, 0), ^{ LMJBaseResponse *response = [self convertTask:task responseObject:responseObject error:error]; - [self LogResponse:task.currentRequest.URL.absoluteString response:response]; dispatch_async(dispatch_get_main_queue(), ^{ - !completion ?: completion(response); - }); - }); - } @@ -125,31 +111,23 @@ - (LMJBaseResponse *)convertTask:(NSURLSessionDataTask *)task responseObject:(id LMJBaseResponse *response = [LMJBaseResponse new]; - if (responseObject) { + if (!LMJIsEmpty(responseObject)) { response.responseObject = responseObject; } - if (error) { response.error = error; - response.statusCode = error.code; } - if ([task.response isKindOfClass:[NSHTTPURLResponse class]]) { - NSHTTPURLResponse *HTTPURLResponse = (NSHTTPURLResponse *)task.response; - response.headers = HTTPURLResponse.allHeaderFields.mutableCopy; - } if (self.responseFormat) { response = self.responseFormat(response); } - return response; - } @@ -158,8 +136,7 @@ - (LMJBaseResponse *)convertTask:(NSURLSessionDataTask *)task responseObject:(id #pragma mark - 打印返回日志 - (void)LogResponse:(NSString *)urlString response:(LMJBaseResponse *)response { - NSLog(@"[%@]---%@", urlString, response); - + NSLog(@"\n[%@]---%@\n", urlString, response); } @@ -170,16 +147,20 @@ - (void)LogResponse:(NSString *)urlString response:(LMJBaseResponse *)response // fileName 图片对应名字,一般服务不会使用,因为服务端会直接根据你上传的图片随机产生一个唯一的图片名字 // mimeType 资源类型 // 不确定参数类型 可以这个 octet-stream 类型, 二进制流 -- (void)upload:(NSString *)urlString parameters:(id)parameters formDataBlock:(void(^)(id formData))formDataBlock progress:(void (^)(NSProgress *progress))progress completion:(void (^)(LMJBaseResponse *response))completion +- (void)upload:(NSString *)urlString parameters:(id)parameters formDataBlock:(NSDictionary *(^)(id formData, NSMutableDictionary *needFillDataDict))formDataBlock progress:(void (^)(NSProgress *progress))progress completion:(void (^)(LMJBaseResponse *response))completion { + static NSString *mineType = @"application/octet-stream"; - [self POST:urlString parameters:parameters constructingBodyWithBlock:^(id _Nonnull formData) { - -// NSString *mineType = @"application/octet-stream"; + [self POST:urlString parameters:parameters headers:nil constructingBodyWithBlock:^(id _Nonnull formData) { -// [formData appendPartWithFileData:data name:name fileName:@"test" mimeType:mineType]; + NSMutableDictionary *needFillDataDict = [NSMutableDictionary dictionary]; + NSDictionary *datas = !formDataBlock ? nil : formDataBlock(formData, needFillDataDict); - !formDataBlock ?: formDataBlock(formData); + if (datas) { + [datas enumerateKeysAndObjectsUsingBlock:^(NSData * _Nonnull data, LMJDataName * _Nonnull name, BOOL * _Nonnull stop) { + [formData appendPartWithFileData:data name:name fileName:@"random" mimeType:mineType]; + }]; + } } progress:^(NSProgress * _Nonnull uploadProgress) { @@ -200,26 +181,50 @@ - (void)upload:(NSString *)urlString parameters:(id)parameters formDataBlock:(vo } - - - - - - #pragma mark - 初始化设置 - (void)configSettings { //设置可接收的数据类型 - self.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", @"text/plain", @"application/xml", @"text/xml", @"*/*", nil]; + NSMutableSet *acceptableContentTypes = [NSMutableSet setWithSet:self.responseSerializer.acceptableContentTypes]; + [acceptableContentTypes addObjectsFromArray:@[@"application/json", @"text/json", @"text/javascript", @"text/html", @"text/plain", @"application/xml", @"text/xml", @"*/*", @"application/x-plist"]]; + self.responseSerializer.acceptableContentTypes = [acceptableContentTypes copy]; + //记录网络状态 [self.reachabilityManager startMonitoring]; - //自定义处理数据 self.responseFormat = ^LMJBaseResponse *(LMJBaseResponse *response) { return response; }; } +- (void)setCerFilePath:(NSString *)cerFilePath { + _cerFilePath = cerFilePath; + if (LMJIsEmpty(cerFilePath)) { + return; + } + + // 先导入证书 证书由服务端生成,具体由服务端人员操作 +// NSString *cerPath = [[NSBundle mainBundle] pathForResource:@"xxx" ofType:@"cer"];//证书的路径 + NSData *cerData = [NSData dataWithContentsOfFile:cerFilePath]; + + // AFSSLPinningModeCertificate 使用证书验证模式 + AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate]; + // allowInvalidCertificates 是否允许无效证书(也就是自建的证书),默认为NO + // 如果是需要验证自建证书,需要设置为YES + securityPolicy.allowInvalidCertificates = YES; + + //validatesDomainName 是否需要验证域名,默认为YES; + //假如证书的域名与你请求的域名不一致,需把该项设置为NO;如设成NO的话,即服务器使用其他可信任机构颁发的证书,也可以建立连接,这个非常危险,建议打开。 + //置为NO,主要用于这种情况:客户端请求的是子域名,而证书上的是另外一个域名。因为SSL证书上的域名是独立的,假如证书上注册的域名是www.google.com,那么mail.google.com是无法验证通过的;当然,有钱可以注册通配符的域名*.google.com,但这个还是比较贵的。 + //如置为NO,建议自己添加对应域名的校验逻辑。 + securityPolicy.validatesDomainName = NO; + + securityPolicy.pinnedCertificates = [[NSSet alloc] initWithObjects:cerData, nil]; + +// 2.加上这个函数,https ssl 验证。 + [self setSecurityPolicy:securityPolicy]; +} + #pragma mark - 处理返回序列化 - (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { @@ -228,20 +233,20 @@ - (void)setResponseSerializer:(AFHTTPResponseSerializer_paragraphs addObject:pa]; }]; } return _paragraphs; diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJAddressPickerViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJAddressPickerViewController.m index ad280d95..835de8d2 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJAddressPickerViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJAddressPickerViewController.m @@ -11,11 +11,6 @@ @interface LMJAddressPickerViewController () - -/** <#digest#> */ -@property (weak, nonatomic) UIButton *selectBtn; - - @end @implementation LMJAddressPickerViewController @@ -23,7 +18,6 @@ @implementation LMJAddressPickerViewController - (void)viewDidLoad { [super viewDidLoad]; - NSArray *array = @[[LMJWordItem itemWithTitle:@"选择地址" subTitle:@"" itemOperation:^(NSIndexPath *indexPath) { [[MOFSPickerManager shareManger] showMOFSAddressPickerWithTitle:nil cancelTitle:@"取消" commitTitle:@"完成" commitBlock:^(NSString *address, NSString *zipcode) { diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJAnimationNavBarViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJAnimationNavBarViewController.m index 81dccb25..b7aee12a 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJAnimationNavBarViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJAnimationNavBarViewController.m @@ -22,7 +22,6 @@ - (void)viewDidLoad { self.isColorChange = YES; - [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:NSStringFromClass([UITableViewCell class])]; } @@ -42,16 +41,22 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView if (contentOffsetY == 0) { + [UIView animateWithDuration:0.2 animations:^{ self.lmj_navgationBar.transform = CGAffineTransformMakeTranslation(0, 0); + }]; self.lmj_navgationBar.backgroundColor = [UIColor clearColor]; self.lmj_navgationBar.lmj_height = [self lmjNavigationHeight:nil]; }else if (contentOffsetY < 0) { - self.lmj_navgationBar.transform = CGAffineTransformMakeTranslation(0, -[self lmjNavigationHeight:nil]); + [UIView animateWithDuration:0.2 animations:^{ + self.lmj_navgationBar.transform = CGAffineTransformMakeTranslation(0, -[self lmjNavigationHeight:nil]); + }]; }else { + [UIView animateWithDuration:0.2 animations:^{ self.lmj_navgationBar.transform = CGAffineTransformMakeTranslation(0, 0); + }]; UIColor *redColor = [self lmjNavigationBackgroundColor:nil]; @@ -140,7 +145,6 @@ - (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigation [btn setTitle:@"颜色渐变" forState:UIControlStateNormal]; [btn setTitle:@"高度渐变" forState:UIControlStateSelected]; - [btn sizeToFit]; btn.lmj_height = 44.0; diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJBlankPageViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJBlankPageViewController.m index 6a51071e..212fff85 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJBlankPageViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJBlankPageViewController.m @@ -35,7 +35,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger - (void)loadMore:(BOOL)isMore { - LMJWeakSelf(self); + LMJWeak(self); [self endHeaderFooterRefreshing]; @@ -57,7 +57,7 @@ - (void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)na { NSLog(@"%s", __func__); - LMJWeakSelf(self); + LMJWeak(self); [self.tableView configBlankPage:LMJEasyBlankPageViewTypeNoData hasData:self.dateArray.count > 0 hasError:YES reloadButtonBlock:^(id sender) { [weakself.tableView.mj_header beginRefreshing]; diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJDownLoadFileViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJDownLoadFileViewController.m index 60d27379..4a8408ba 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJDownLoadFileViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJDownLoadFileViewController.m @@ -7,18 +7,10 @@ // #import "LMJDownLoadFileViewController.h" +#import "MBProgressHUD+LMJ.h" @interface LMJDownLoadFileViewController () -/** <#digest#> */ -@property (weak, nonatomic) UIButton *downBtn; - -/** <#digest#> */ -@property (weak, nonatomic) UIButton *memoryFileBtn; - -/** <#digest#> */ -@property (nonatomic, strong) NSArray *addressArray; - @end @implementation LMJDownLoadFileViewController @@ -26,7 +18,7 @@ @implementation LMJDownLoadFileViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + LMJWeak(self); self.addItem([LMJWordItem itemWithTitle:@"点击下载" subTitle:@"不会重复下载" itemOperation:^(NSIndexPath *indexPath) { [weakself downloadFile]; }]); @@ -52,7 +44,7 @@ - (void)downloadFile NSString *fileDownLoadPath = @"https://s3.cn-north-1.amazonaws.com.cn/zplantest.s3.seed.meme2c.com/area/area.json"; - NSString *lastModified = [NSUserDefaults.standardUserDefaults stringForKey:@"Last-Modified"] ?: @""; + NSString *lastModified = [NSUserDefaults.standardUserDefaults stringForKey:@"areajson_Last_Modified"] ?: @""; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:fileDownLoadPath]]; @@ -62,7 +54,7 @@ - (void)downloadFile [request setValue:@"no-cache" forHTTPHeaderField:@"Cache-Control"]; - LMJWeakSelf(self); + LMJWeak(self); NSLog(@"%@", request); MBProgressHUD *hud = [MBProgressHUD showProgressToView:weakself.view Text:@"下载中"]; [[[LMJRequestManager sharedManager] downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) { @@ -88,13 +80,11 @@ - (void)downloadFile NSString *lastModified = [httpResponse allHeaderFields][@"Last-Modified"]; if (lastModified && !error) { - [NSUserDefaults.standardUserDefaults setObject:lastModified forKey:@"Last-Modified"]; - + [NSUserDefaults.standardUserDefaults setObject:lastModified forKey:@"areajson_Last_Modified"]; } NSLog(@"%@", lastModified); - }] resume]; diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJElementsCollectionViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJElementsCollectionViewController.m index 134a1fe9..5028acc4 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJElementsCollectionViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJElementsCollectionViewController.m @@ -63,7 +63,6 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa { [collectionView deselectItemAtIndexPath:indexPath animated:YES]; - NSLog(@"%zd", indexPath.item); } diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJKeyboardHandleViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJKeyboardHandleViewController.m index 852f2af0..b6ab42b0 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJKeyboardHandleViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJKeyboardHandleViewController.m @@ -7,6 +7,8 @@ // #import "LMJKeyboardHandleViewController.h" +#import "MBProgressHUD+LMJ.h" +#import "UITextView+WZB.h" @interface LMJKeyboardHandleViewController () @@ -38,28 +40,29 @@ @interface LMJKeyboardHandleViewController () @property(nonatomic) CGFloat keyBoardHeight; @end -static const CGFloat topViewHeigt=100; +static const CGFloat topViewHeigt = 100; @implementation LMJKeyboardHandleViewController - (void)viewDidLoad { [super viewDidLoad]; - + [MBProgressHUD showAutoMessage:@"点击右上角弹出隐藏视图键盘"]; [self textView]; [self textView0]; [self textView1]; - self.myTopView=[[UIView alloc]init]; - self.myTopView.frame=CGRectMake(0, kScreenHeight, kScreenWidth, topViewHeigt); - self.myTopView.backgroundColor=[UIColor redColor]; + self.myTopView = [[UIView alloc]init]; + self.myTopView.frame = CGRectMake(0, kScreenHeight, kScreenWidth, topViewHeigt); + self.myTopView.backgroundColor = [UIColor redColor]; - self.myTextField=[[UITextField alloc]init]; - self.myTextField.layer.borderColor=[UIColor grayColor].CGColor; - self.myTextField.layer.borderWidth=0.5; - self.myTextField.placeholder=@"请输入文本内容"; + self.myTextField = [[UITextField alloc]init]; + self.myTextField.borderStyle = UITextBorderStyleNone; + self.myTextField.layer.borderColor = [UIColor grayColor].CGColor; + self.myTextField.layer.borderWidth = 1; + self.myTextField.placeholder = @"请输入文本内容"; [self.myTopView addSubview:self.myTextField]; [self.myTextField mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(10); @@ -70,7 +73,6 @@ - (void)viewDidLoad { [self.view addSubview:self.myTopView]; - self.myRightButton = [[UIButton alloc]init]; [self.myRightButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; [self.myRightButton setTitle:@"照片" forState:UIControlStateNormal]; @@ -80,7 +82,7 @@ - (void)viewDidLoad { make.top.mas_equalTo(20); make.right.mas_equalTo(-10); }]; - + self.myBottomView=[[UIView alloc]init]; @@ -94,13 +96,11 @@ - (void)viewDidLoad { make.center.mas_equalTo(self.myBottomView); }]; - + //增加监听,当键盘出现或改变时收到消息 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; //增加监听,当键盘退出时收到消息 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; - - } - (void)keyboardWillShow:(NSNotification *)noti @@ -113,7 +113,7 @@ - (void)keyboardWillShow:(NSNotification *)noti // 得到键盘弹出后的键盘视图所在y坐标 CGRect keyboardRect = [valueEndFrame CGRectValue]; CGFloat KBHeight = keyboardRect.size.height; - self.keyBoardHeight=KBHeight; + self.keyBoardHeight = KBHeight; // ------键盘出现或改变时的操作代码 NSLog(@"当前的键盘高度为:%f",KBHeight); @@ -122,15 +122,13 @@ - (void)keyboardWillShow:(NSNotification *)noti // 键盘弹出的动画曲线 self.curve = [userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey]; - // 添加移动动画,使视图跟随键盘移动(动画时间和曲线都保持一致) [UIView animateWithDuration:[_duration doubleValue] animations:^{ [UIView setAnimationBeginsFromCurrentState:YES]; + [UIView setAnimationCurve:[self->_curve intValue]]; - [UIView setAnimationCurve:[_curve intValue]]; self.myTopView.frame = CGRectMake(0, self.view.lmj_height - topViewHeigt, kScreenWidth, topViewHeigt); }]; - } - (void)keyboardWillHide:(NSNotification *)noti @@ -142,11 +140,9 @@ - (void)keyboardWillHide:(NSNotification *)noti // 添加移动动画,使视图跟随键盘移动(动画时间和曲线都保持一致) [UIView animateWithDuration:[_duration doubleValue] animations:^{ [UIView setAnimationBeginsFromCurrentState:YES]; - - [UIView setAnimationCurve:[_curve intValue]]; + [UIView setAnimationCurve:[self->_curve intValue]]; self.myTopView.frame=CGRectMake(0, kScreenHeight, kScreenWidth, topViewHeigt); }]; - } @@ -156,12 +152,9 @@ - (void)myAction [self.myTextField resignFirstResponder]; - self.myTextField.inputView = self.myTextField.inputView ? nil : self.myBottomView; - [self.myTextField becomeFirstResponder]; - } @@ -172,7 +165,6 @@ - (BOOL)textViewControllerEnableAutoToolbar:(LMJTextViewController *)textViewCon } - #pragma mark - LMJNavUIBaseViewControllerDataSource /** 导航条右边的按钮 */ @@ -213,8 +205,6 @@ -(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navi } - - - (UITextView *)textView { if(_textView == nil) diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJListExpandHideViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJListExpandHideViewController.m index 8af5c146..dfa40560 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJListExpandHideViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJListExpandHideViewController.m @@ -55,7 +55,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N } - cell.textLabel.text = self.groups[indexPath.section].teams[indexPath.row].sortNumber; cell.detailTextLabel.text = self.groups[indexPath.section].teams[indexPath.row].name; @@ -67,17 +66,14 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger LMJListExpendHeaderView *headerView = [LMJListExpendHeaderView headerViewWithTableView:tableView]; headerView.group = self.groups[section]; - LMJWeakSelf(self); + LMJWeak(self); [headerView setSelectGroup:^BOOL{ weakself.groups[section].isOpened = !weakself.groups[section].isOpened; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [weakself.tableView reloadData]; - }); - return weakself.groups[section].isOpened; }]; @@ -98,7 +94,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege _groups = [NSMutableArray array]; NSString *path = [[NSBundle mainBundle] pathForResource:@"team_dictionary" ofType:@"plist"]; - // NSArray *dictArr = [NSArray arrayWithContentsOfFile:path]; + NSDictionary *dictDict = [NSDictionary dictionaryWithContentsOfFile:path]; [dictDict enumerateKeysAndObjectsUsingBlock:^(NSString * key, NSArray *obj, BOOL * _Nonnull stop) { @@ -120,12 +116,11 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege }]; - [_groups addObject:group]; + [self->_groups addObject:group]; }]; [_groups sortUsingComparator:^NSComparisonResult(LMJTeam * _Nonnull obj1, LMJTeam * _Nonnull obj2) { - return [obj1.name compare:obj2.name] == NSOrderedAscending ? NSOrderedAscending : NSOrderedDescending; }]; } diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJNoNavBarViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJNoNavBarViewController.m index d875840d..414ef419 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJNoNavBarViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJNoNavBarViewController.m @@ -21,8 +21,7 @@ @implementation LMJNoNavBarViewController - (void)viewDidLoad { [super viewDidLoad]; - - LMJWeakSelf(self); + LMJWeak(self); [self.view makeToast:@"侧滑返回" duration:4 position:CSToastPositionCenter]; [self.sections addObject:[LMJItemSection sectionWithItems:@[[LMJWordItem itemWithTitle:@"点击跳转到一个不能全局返回的控制器" subTitle:nil itemOperation:^(NSIndexPath *indexPath) { diff --git a/iOSProject/iOSProject/Classes/Preview1/LMJYYTextViewController.m b/iOSProject/iOSProject/Classes/Preview1/LMJYYTextViewController.m index e9e440b3..370835fa 100644 --- a/iOSProject/iOSProject/Classes/Preview1/LMJYYTextViewController.m +++ b/iOSProject/iOSProject/Classes/Preview1/LMJYYTextViewController.m @@ -61,7 +61,6 @@ - (void)layoutLabels // 3, 高亮和点击的 - CGSize bSize = CGSizeMake(kScreenWidth - 20, INFINITY); NSString *bAllString = @"点击高亮点击高亮, 点击高亮点击高亮, 点击高亮点击高亮, 点击高亮点击高亮, DDDDDDD 点击高亮点击高亮"; @@ -99,7 +98,7 @@ - (void)layoutLabels YYLabel *bLabel = [[YYLabel alloc] init]; bLabel.frame = CGRectMake(10, aLabel.lmj_bottom + 10, bLayout.textBoundingSize.width, bLayout.textBoundingSize.height); - + bLabel.textLayout = bLayout; [self.view addSubview:bLabel]; @@ -112,16 +111,11 @@ - (void)layoutLabels cAttStrM.yy_color = [UIColor redColor]; cAttStrM.yy_alignment = NSTextAlignmentCenter; - YYTextBorder *border = [YYTextBorder borderWithFillColor:nil cornerRadius:20]; - border.insets = UIEdgeInsetsMake(-5, -10, -5, -10); - border.strokeColor = [UIColor whiteColor]; - border.strokeWidth = 2; - border.lineStyle = YYTextLineStyleSingle; cAttStrM.yy_textBorder = border; @@ -164,7 +158,6 @@ - (NSMutableAttributedString *)getAttr:(NSString *)htmlString attrM.yy_kern = @5; - return attrM; } @@ -173,87 +166,23 @@ - (NSMutableAttributedString *)getAttr:(NSString *)htmlString #pragma mark 重写BaseViewController设置内容, 可以不用看 -//- (UIColor *)lmjNavigationBackgroundColor:(LMJNavigationBar *)navigationBar -//{ -// return [UIColor RandomColor]; -//} -- (void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ - NSLog(@"%s", __func__); - - [self.navigationController popViewControllerAnimated:YES]; -} - -- (void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ - NSLog(@"%s", __func__); -} - -- (void)titleClickEvent:(UILabel *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ - NSLog(@"%@", sender); -} - - -- (UIView *)lmjNavigationBarTitleView:(LMJNavigationBar *)navigationBar -{ - YYLabel *label = [[YYLabel alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth * 0.63, 44)]; - - - label.textColor = [UIColor purpleColor]; - - label.font = [UIFont systemFontOfSize:15]; - - label.text = @"YYText 的使用YYText 的使用"; - - label.numberOfLines = 0; - - label.textAlignment = NSTextAlignmentCenter; - - - - return label; - -} - - -- (NSMutableAttributedString*)lmjNavigationBarTitle:(LMJNavigationBar *)navigationBar -{ - return [self changeTitle:@"YYText 的使用"];; - -} +#pragma mark - LMJNavUIBaseViewControllerDataSource +/** 导航条左边的按钮 */ - (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar { - [leftButton setImage:[UIImage imageNamed:@"navigationButtonReturn"] forState:UIControlStateHighlighted]; + [leftButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; - return [UIImage imageNamed:@"navigationButtonReturnClick"]; + return [UIImage imageNamed:@"NavgationBar_blue_back"]; } - -- (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar +#pragma mark - LMJNavUIBaseViewControllerDelegate +/** 左边的按钮的点击 */ +-(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { - rightButton.backgroundColor = [UIColor RandomColor]; - - return nil; -} - - - -#pragma mark 自定义代码 - --(NSMutableAttributedString *)changeTitle:(NSString *)curTitle -{ - NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:curTitle ?: @""]; - - [title addAttribute:NSForegroundColorAttributeName value:[UIColor RandomColor] range:NSMakeRange(0, title.length)]; - - [title addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, title.length)]; - - return title; + [self.navigationController popViewControllerAnimated:YES]; } - @end diff --git a/iOSProject/iOSProject/Classes/Preview1/Model/LMJParagraph.m b/iOSProject/iOSProject/Classes/Preview1/Model/LMJParagraph.m index 05a1d42e..d365faba 100644 --- a/iOSProject/iOSProject/Classes/Preview1/Model/LMJParagraph.m +++ b/iOSProject/iOSProject/Classes/Preview1/Model/LMJParagraph.m @@ -49,6 +49,9 @@ - (CGFloat)height _height += [self.attWords boundingRectWithSize:CGSizeMake(kScreenWidth - KLeftSpace - KRightSpace, INFINITY) options:NSStringDrawingUsesLineFragmentOrigin context:nil].size.height; _height += [self.date boundingRectWithSize:CGSizeMake(kScreenWidth - KLeftSpace - KRightSpace, INFINITY) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : AdaptedFontSize(KDateLabelFontSize)} context:nil].size.height; + + // 向上取整 + _height = ceilf(_height); } return _height; } diff --git a/iOSProject/iOSProject/Classes/Preview1/View/LMJListExpendHeaderView.h b/iOSProject/iOSProject/Classes/Preview1/View/LMJListExpendHeaderView.h index 2857fffb..309e7785 100644 --- a/iOSProject/iOSProject/Classes/Preview1/View/LMJListExpendHeaderView.h +++ b/iOSProject/iOSProject/Classes/Preview1/View/LMJListExpendHeaderView.h @@ -16,7 +16,7 @@ /** <#digest#> */ -@property (nonatomic, copy) BOOL(^selectGroup)(); +@property (nonatomic, copy) BOOL(^selectGroup)(void); + (instancetype)headerViewWithTableView:(UITableView *)tableView; diff --git a/iOSProject/iOSProject/Classes/Preview1/View/LMJListExpendHeaderView.m b/iOSProject/iOSProject/Classes/Preview1/View/LMJListExpendHeaderView.m index 8c48c897..d7bb5374 100644 --- a/iOSProject/iOSProject/Classes/Preview1/View/LMJListExpendHeaderView.m +++ b/iOSProject/iOSProject/Classes/Preview1/View/LMJListExpendHeaderView.m @@ -98,40 +98,25 @@ - (UIButton *)indicatorButton [self.contentView addSubview:btn]; - LMJWeakSelf(self); + LMJWeak(self); [btn addActionHandler:^(NSInteger tag) { if (weakself.selectGroup) { - weakself.selectGroup(); - } - if (weakself.group.isOpened) { - [UIView animateWithDuration:0.3 animations:^{ - - self.indicatorButton.imageView.transform = CGAffineTransformIdentity; - + weakself.indicatorButton.imageView.transform = CGAffineTransformIdentity; }]; - }else { - - - [UIView animateWithDuration:0.3 animations:^{ - weakself.indicatorButton.imageView.transform = CGAffineTransformMakeRotation(kDegreesToRadian(180.0)); - }]; - } - - }]; _indicatorButton = btn; diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJAlertViewsViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJAlertViewsViewController.m index 251f3094..bc32d086 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJAlertViewsViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJAlertViewsViewController.m @@ -87,7 +87,7 @@ - (void)viewDidLoad { [UIAlertController mj_showActionSheetWithTitle:@"无按钮actionSheet-toast" message:@"toast样式,可自定义展示延时时间,支持配置弹出、关闭回调,可关闭弹出动画" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { alertMaker.toastStyleDuration = 3; //关闭动画效果 - [alertMaker alertAnimateDisabled]; +// [alertMaker alertAnimateDisabled]; [alertMaker setAlertDidShown:^{ NSLog(@"alertDidShown"); @@ -132,10 +132,6 @@ - (void)viewDidLoad { LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item0, item1, item2, item3, item4] andHeaderTitle:nil footerTitle:nil]; [self.sections addObject:section0]; - - - - } diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJBaiduMapViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJBaiduMapViewController.m index 29884886..93eac1f8 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJBaiduMapViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJBaiduMapViewController.m @@ -31,9 +31,6 @@ #include - - - @interface LMJBaiduMapViewController () /** <#digest#> */ @@ -58,29 +55,74 @@ @interface LMJBaiduMapViewController () */ - // @property (assign, nonatomic) NSInteger type; // <0:起点 1:终点 2:公交 3:地铁 4:驾乘 5:途经点 100:自定义视图点 - - - /** <#digest#> */ - //@property (assign, nonatomic) NSInteger degree; - - - - ///// 要显示的标题 - //@property (copy) NSString *title; - ///// 要显示的副标题 - //@property (copy) NSString *subtitle; - - - - ///该点的坐标 - //@property (nonatomic, assign) CLLocationCoordinate2D coordinate; - annotation.type = 100; annotation.title = obj.coordinate_title; annotation.subtitle = obj.coordinate_comments; annotation.coordinate = CLLocationCoordinate2DMake(obj.coordinate_latitude, obj.coordinate_longitude); annotation.selectedIndex = idx; - [self.baiduMapView addAnnotation:annotation]; - [self.baiduMapView selectAnnotation:annotation animated:YES]; - - if (idx == 0) { - BMKCoordinateRegion region; - region.center = annotation.coordinate; - region.span.latitudeDelta = 0.2; region.span.longitudeDelta = 0.2; - + // 选中一个范围 [self.baiduMapView setRegion:region]; + // 标注大头针 + [self.baiduMapView selectAnnotation:annotation animated:YES]; } }]; @@ -162,9 +179,6 @@ - (void)addptAnnotations } - - - #pragma mark - BMKLocationServiceDelegate 定位 /** @@ -175,27 +189,21 @@ - (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation { BMKPlanNode *start = [[BMKPlanNode alloc] init]; start.pt = userLocation.location.coordinate; - - BMKPlanNode *end = [[BMKPlanNode alloc] init]; end.pt = self.targetLocationCoordinate; - BMKWalkingRoutePlanOption *walkingRoutePlanOption = [[BMKWalkingRoutePlanOption alloc] init]; walkingRoutePlanOption.from = start; walkingRoutePlanOption.to = end; if ([self.routesearch walkingSearch:walkingRoutePlanOption]) { - [self.locationService stopUserLocationService]; }else { NSLog(@"检索失败"); [self addptAnnotations]; } - - } @@ -218,34 +226,9 @@ - (void)onGetWalkingRouteResult:(BMKRouteSearch *)searcher result:(BMKWalkingRou LMJBaiduPointAnnotation *annotation = [[LMJBaiduPointAnnotation alloc] init]; annotation.selectedIndex = idx; annotation.type = 0; - - - /** <#digest#> */ - // @property (assign, nonatomic) NSInteger type; // <0:起点 1:终点 2:公交 3:地铁 4:驾乘 5:途经点 100:自定义视图点 - - - /** <#digest#> */ - // @property (assign, nonatomic) NSInteger selectedIndex; // 当前的索引 - - /** <#digest#> */ - //@property (assign, nonatomic) NSInteger degree; - - - - ///// 要显示的标题 - //@property (copy) NSString *title; - ///// 要显示的副标题 - //@property (copy) NSString *subtitle; - - - - ///该点的坐标 - //@property (nonatomic, assign) CLLocationCoordinate2D coordinate; - annotation.title = @"起点"; annotation.subtitle = @"起点副标题"; annotation.coordinate = plan.starting.location; - [self.baiduMapView addAnnotation:annotation]; } else if (idx == plan.steps.count - 1) { @@ -253,46 +236,15 @@ - (void)onGetWalkingRouteResult:(BMKRouteSearch *)searcher result:(BMKWalkingRou LMJBaiduPointAnnotation *annotation = [[LMJBaiduPointAnnotation alloc] init]; annotation.selectedIndex = idx; annotation.type = 1; - - - /** <#digest#> */ - // @property (assign, nonatomic) NSInteger type; // <0:起点 1:终点 2:公交 3:地铁 4:驾乘 5:途经点 100:自定义视图点 - - - /** <#digest#> */ - // @property (assign, nonatomic) NSInteger selectedIndex; // 当前的索引 - - /** <#digest#> */ - //@property (assign, nonatomic) NSInteger degree; - - - - ///// 要显示的标题 - //@property (copy) NSString *title; - ///// 要显示的副标题 - //@property (copy) NSString *subtitle; - - - - ///该点的坐标 - //@property (nonatomic, assign) CLLocationCoordinate2D coordinate; - annotation.title = @"终点"; annotation.subtitle = @"终点副标题"; annotation.coordinate = plan.terminal.location; - [self.baiduMapView addAnnotation:annotation]; - } - planPointCounts += obj.pointsCount; - }]; - - [self addptAnnotations]; - // 设置起点, 为中心点 BMKUserLocation *userLocation = self.locationService.userLocation; BMKCoordinateRegion region; @@ -301,29 +253,21 @@ - (void)onGetWalkingRouteResult:(BMKRouteSearch *)searcher result:(BMKWalkingRou region.span.longitudeDelta = 0.2; [self.baiduMapView setRegion:region]; - BMKMapPoint *temppoints = (BMKMapPoint *)malloc(sizeof(BMKMapPoint) * planPointCounts); __block NSInteger j = 0; [plan.steps enumerateObjectsUsingBlock:^(BMKWalkingStep *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - - for (NSInteger i = 0; i < obj.pointsCount; i++) { - temppoints[j].x = obj.points[i].x; temppoints[j].y = obj.points[i].y; - j++; } - }]; // 通过points构建BMKPolyline BMKPolyline *polyline = [BMKPolyline polylineWithPoints:temppoints count:planPointCounts]; - [self.baiduMapView addOverlay:polyline]; - free(temppoints); } @@ -339,15 +283,12 @@ - (void)onGetWalkingRouteResult:(BMKRouteSearch *)searcher result:(BMKWalkingRou - (BMKOverlayView *)mapView:(BMKMapView *)mapView viewForOverlay:(id )overlay { if ([overlay isKindOfClass:[BMKPolyline class]]) { - BMKPolylineView *polylineView = [[BMKPolylineView alloc] initWithPolyline:(BMKPolyline *)overlay]; - - polylineView.fillColor = [[UIColor redColor] colorWithAlphaComponent:0.4]; - polylineView.strokeColor = [[UIColor greenColor] colorWithAlphaComponent:0.4]; + polylineView.fillColor = [[UIColor greenColor] colorWithAlphaComponent:0.4]; + polylineView.strokeColor = [[UIColor redColor] colorWithAlphaComponent:0.4]; polylineView.lineWidth = 2.0; return polylineView; } - return nil; } @@ -357,7 +298,6 @@ - (BMKOverlayView *)mapView:(BMKMapView *)mapView viewForOverlay:(id )annotation { - BMKAnnotationView *pinAnnotationView = nil; - if ([annotation isKindOfClass:[LMJBaiduPointAnnotation class]]) { LMJBaiduPointAnnotation *myAnnotation = (LMJBaiduPointAnnotation *)annotation; pinAnnotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:[NSStringFromClass([BMKAnnotationView class]) stringByAppendingFormat:@"Type_%zd", myAnnotation.type]]; - - - // test_BaiDu_centerPoint - // test_BaiDu_endPoint - // test_BaiDu_green - // test_BaiDu_red - // test_BaiDu_StartPoint - // test_BaiDu_wayPoint - - // <0:起点 1:终点 2:公交 3:地铁 4:驾乘 5:途经点 100:自定义视图点 - NSInteger type = myAnnotation.type; switch (type) { + // 起点 +// 标注 view case 0: { - if (!pinAnnotationView) { - pinAnnotationView = [[BMKAnnotationView alloc] initWithAnnotation:myAnnotation reuseIdentifier:[NSStringFromClass([BMKAnnotationView class]) stringByAppendingFormat:@"Type_%zd", myAnnotation.type]]; pinAnnotationView.image = [UIImage imageNamed:@"test_BaiDu_StartPoint"]; pinAnnotationView.centerOffset = CGPointMake(0, -pinAnnotationView.lmj_height * 0.5); pinAnnotationView.canShowCallout = YES; } - pinAnnotationView.annotation = annotation; } break; + // 终点 + // 标注 view case 1: { if (!pinAnnotationView) { - pinAnnotationView = [[BMKAnnotationView alloc] initWithAnnotation:myAnnotation reuseIdentifier:[NSStringFromClass([BMKAnnotationView class]) stringByAppendingFormat:@"Type_%zd", myAnnotation.type]]; - pinAnnotationView.image = [UIImage imageNamed:@"test_BaiDu_endPoint"]; pinAnnotationView.centerOffset = CGPointMake(0, -pinAnnotationView.lmj_height * 0.5); pinAnnotationView.canShowCallout = YES; } - pinAnnotationView.annotation = annotation; } break; default: { - if (!pinAnnotationView) { - + // 绿色的小针 pinAnnotationView = [[BMKPinAnnotationView alloc] initWithAnnotation:myAnnotation reuseIdentifier:[NSStringFromClass([BMKAnnotationView class]) stringByAppendingFormat:@"Type_%zd", myAnnotation.type]]; - - pinAnnotationView.image = [UIImage imageNamed:@"test_BaiDu_green"]; } - + // 取出位置对应的点 NSInteger selectedIndex = myAnnotation.selectedIndex; LMJCoordinateModel *coordinateModel = self.coordinates[selectedIndex]; + // 创建自定义的点击弹出的popview LMJAnnotationCustomPopView *popView = [LMJAnnotationCustomPopView popView]; popView.frame = CGRectMake(0, 0, 150, 100); // 设置数据 popView.titleLabel.text = coordinateModel.coordinate_title; popView.subTitleLabel.text = coordinateModel.coordinate_comments; + // 设置点击事件 popView.gotoButton.tag = selectedIndex; [popView.gotoButton addTarget:self action:@selector(gotoThisPlaceAndLocation:) forControlEvents:UIControlEventTouchUpInside]; - // 添加自定义的 View BMKActionPaopaoView *paopaoView = [[BMKActionPaopaoView alloc] initWithCustomView:popView]; @@ -451,20 +374,17 @@ - (BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id *)coordinates { if(_coordinates == nil) @@ -576,42 +440,21 @@ - (BMKLocationService *)locationService LMJCoordinateModel *coordinate = [[LMJCoordinateModel alloc] init]; - - // //纬度 - // @property(assign,nonatomic)float coordinate_latitude; - // //经度 - // @property(assign,nonatomic)float coordinate_longitude; - // //业务标题 - // @property(strong,nonatomic)NSString *coordinate_title; - // //业务注解 - // @property(strong,nonatomic)NSString *coordinate_comments; - // //业务ID - // @property(assign,nonatomic)long coordinate_objID; - - coordinate.coordinate_latitude = 40; coordinate.coordinate_longitude = 117; coordinate.coordinate_title = @"我是第一个点"; coordinate.coordinate_comments = @"我是第一个点的描述"; coordinate.coordinate_objID = 1; - [_coordinates addObject:coordinate]; - LMJCoordinateModel *coordinate1 = [[LMJCoordinateModel alloc] init]; - - coordinate1.coordinate_latitude = 40; coordinate1.coordinate_longitude = 115; coordinate1.coordinate_title = @"我是第二个点"; coordinate1.coordinate_comments = @"我是第二个点的描述"; coordinate1.coordinate_objID = 2; - - - [_coordinates addObject:coordinate1]; - } return _coordinates; } @@ -625,7 +468,6 @@ - (void)dealloc } - #pragma mark - LMJNavUIBaseViewControllerDataSource - (UIColor *)lmjNavigationBackgroundColor:(LMJNavigationBar *)navigationBar diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJFillTableFormViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJFillTableFormViewController.m index f428e491..baa41d63 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJFillTableFormViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJFillTableFormViewController.m @@ -19,18 +19,20 @@ @implementation LMJFillTableFormViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + + self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight * 0.7)]; + + LMJWeak(self); LMJWordItem *item0 = [LMJWordArrowItem itemWithTitle:@"系统设置" subTitle: nil]; item0.image = [UIImage imageNamed:@"mine-setting-icon"]; [item0 setItemOperation:^void(NSIndexPath *indexPath){ - [weakself.view makeToast:@"跳转成功"]; - }]; LMJWordItem *item1 = [LMJWordItem itemWithTitle:@"姓名" subTitle:@"请输入姓名"]; item1.subTitleColor = [UIColor lightGrayColor]; -// LMJWeakSelf(item1); + item1.subTitleNumberOfLines = 1; +// LMJWeak(item1); [item1 setItemOperation:^void(NSIndexPath *indexPath){ // 拿到cell UITableViewCell *cell = [weakself.tableView cellForRowAtIndexPath:indexPath]; @@ -41,9 +43,11 @@ - (void)viewDidLoad { textF = [[UITextField alloc] init]; textF.tag = indexPath.row + 100; textF.delegate = self; - textF.textColor = [UIColor clearColor]; - textF.borderStyle = UITextBorderStyleNone; + textF.lmj_size = CGSizeMake(1, 100); +// textF.textColor = [UIColor clearColor]; +// textF.borderStyle = UITextBorderStyleNone; [cell.contentView addSubview:textF]; + textF.hidden = YES; } [textF becomeFirstResponder]; @@ -52,40 +56,33 @@ - (void)viewDidLoad { LMJWordItem *item2 = [LMJWordArrowItem itemWithTitle:@"性别" subTitle: @"请选择出性别"]; item2.subTitleColor = [UIColor lightGrayColor]; - LMJWeakSelf(item2); + LMJWeak(item2); [item2 setItemOperation:^void(NSIndexPath *indexPath){ [[MOFSPickerManager shareManger] showPickerViewWithDataArray:@[@"男",@"女"] tag:1 title:nil cancelTitle:@"取消" commitTitle:@"确定" commitBlock:^(NSString *string) { - weakitem2.subTitle = string; [weakself.tableView reloadRowAtIndexPath:indexPath withRowAnimation:UITableViewRowAnimationAutomatic]; - } cancelBlock:^{ - }]; - }]; LMJWordItem *item3 = [LMJWordArrowItem itemWithTitle:@"生日" subTitle: @"请选择出生日期"]; item3.subTitleColor = [UIColor lightGrayColor]; - LMJWeakSelf(item3); + LMJWeak(item3); [item3 setItemOperation:^void(NSIndexPath *indexPath){ - [[MOFSPickerManager shareManger] showDatePickerWithTag:1 commitBlock:^(NSDate *date) { - weakitem3.subTitle = [date stringWithFormat:@"yyyy-MM-dd"]; [weakself.tableView reloadRowAtIndexPath:indexPath withRowAnimation:UITableViewRowAnimationAutomatic]; } cancelBlock:^{ - }]; - }]; // 占位 LMJWordItem *item4 = [LMJWordItem itemWithTitle:@"家庭地址" subTitle:@"请输入家庭地址"]; -// LMJWeakSelf(item4); +// LMJWeak(item4); + item4.subTitleNumberOfLines = 1; [item4 setItemOperation:^void(NSIndexPath *indexPath){ // 拿到cell UITableViewCell *cell = [weakself.tableView cellForRowAtIndexPath:indexPath]; @@ -96,15 +93,18 @@ - (void)viewDidLoad { textF = [[UITextField alloc] init]; textF.tag = indexPath.row + 100; textF.delegate = self; - textF.textColor = [UIColor clearColor]; - textF.borderStyle = UITextBorderStyleNone; + textF.lmj_size = CGSizeMake(1, 100); +// textF.textColor = [UIColor clearColor]; +// textF.borderStyle = UITextBorderStyleNone; [cell.contentView addSubview:textF]; + textF.hidden = YES; } [textF becomeFirstResponder]; }]; + LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item4, item3, item2, item1, item0] andHeaderTitle:nil footerTitle:nil]; [self.sections addObject:section0]; @@ -113,11 +113,17 @@ - (void)viewDidLoad { - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { - NSString *current = [textField.text stringByReplacingCharactersInRange:range withString:string].stringByTrim; + // 九宫格输入 bug fix + if ([@"➋➌➍➎➏➐➑➒" rangeOfString:string].location != NSNotFound) { + return YES; + } + + NSString *current = [textField.text stringByReplacingCharactersInRange:range withString:string.stringByTrim].stringByTrim; + NSLog(@"%@", textField.text); NSLog(@"%@", current); + NSLog(@"%@", string); LMJWordItem *item = self.sections.firstObject.items[textField.tag - 100]; - item.subTitle = current; LMJSettingCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:textField.tag - 100 inSection:0]]; @@ -132,7 +138,24 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege return 10; } +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + LMJWordItem *item = self.sections[indexPath.section].items[indexPath.row]; + + NSString *ID = [NSString stringWithFormat:@"%@%zd", LMJSettingCell.class, indexPath.row]; + LMJSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; + if(cell == nil) + { + cell = [[LMJSettingCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:ID]; + } + cell.item = item; + return cell; +} +#pragma mark - LMJTextViewControllerDataSource +- (BOOL)textViewControllerEnableAutoToolbar:(LMJTextViewController *)textViewController { + return NO; +} #pragma mark - LMJNavUIBaseViewControllerDataSource diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJH5JSBridgeViewController.h b/iOSProject/iOSProject/Classes/Preview2/LMJH5JSBridgeViewController.h new file mode 100644 index 00000000..0d6be784 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/LMJH5JSBridgeViewController.h @@ -0,0 +1,13 @@ +// +// LMJH5JSBridgeViewController.h +// iOSProject +// +// Created by HuXuPeng on 2018/3/17. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJWebViewController.h" + +@interface LMJH5JSBridgeViewController : LMJWebViewController + +@end diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJH5JSBridgeViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJH5JSBridgeViewController.m new file mode 100644 index 00000000..5b045ef5 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/LMJH5JSBridgeViewController.m @@ -0,0 +1,96 @@ +// +// LMJH5JSBridgeViewController.m +// iOSProject +// +// Created by HuXuPeng on 2018/3/17. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJH5JSBridgeViewController.h" +#import "WKWebViewJsBridge.h" + +@interface LMJH5JSBridgeViewController () +/** <#digest#> */ +@property (nonatomic, strong) WKWebViewJsBridge *jsBridge; +@end + +@implementation LMJH5JSBridgeViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.jsBridge = [[WKWebViewJsBridge alloc] initWithWebView:self.webView delegate:self]; + + + NSString *htmlPath = [@"JSBridge_js" stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.html", NSStringFromClass([self class])]]; + + NSURL *fileUrl = [[NSBundle mainBundle] URLForResource:htmlPath withExtension:nil]; + + NSURL *jsCssSorceUrl = [[NSBundle mainBundle] URLForResource:[htmlPath pathComponents].firstObject withExtension:nil]; + + [self.webView loadFileURL:fileUrl allowingReadAccessToURL:jsCssSorceUrl]; + + [self addData]; + + LMJWeak(self); + [self.jsBridge registerHandler:@"alertToast" handle:^(id data, void (^responseCallBack)(id responseData)) { + [weakself.view makeToast:data duration:3 position:CSToastPositionCenter]; + }]; + + self.webView.lmj_height = self.view.lmj_height * 0.7; + self.view.backgroundColor = [UIColor greenColor]; + + UIButton *btn = [UIButton initWithFrame:CGRectMake(0, self.view.lmj_height * 0.8, kScreenWidth, 44) buttonTitle:@"oc 调用 js 注册的方法" normalBGColor:[UIColor whiteColor] selectBGColor:[UIColor redColor] normalColor:[UIColor blackColor] selectColor:[UIColor greenColor] buttonFont:[UIFont boldSystemFontOfSize:17] cornerRadius:5 doneBlock:^(UIButton *btn) { + [weakself callJS]; + }]; + + [self.view addSubview:btn]; + +// + // js 引入的第二种方式, 第一种方式是H5 页面直接引入 +// NSString *jsbridge_js = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"JSBridge_js/H5Bridge.js" ofType:nil] encoding:NSUTF8StringEncoding error:nil]; +// WKUserScript *userJs = [[WKUserScript alloc] initWithSource:jsbridge_js injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO]; +// [self.webView.configuration.userContentController addUserScript:userJs]; +} + +- (void)addData +{ + [[NSUserDefaults standardUserDefaults] setObject:@"我是存在偏好设置里边value" forKey:@"sesstionId"]; +} + +- (void)callJS +{ + [self.webView.scrollView scrollToTop]; + static int i = 0; + i+=2; + LMJWeak(self); + [self.jsBridge callHandler:@"insertContent" data:[NSString stringWithFormat:@"我是oc调用js传给js的内容, 内容: %d", i] responseCallback:^(id responseData) { + NSLog(@"%@", responseData); + [weakself.view makeToast:responseData duration:3 position:CSToastPositionCenter]; + }]; +} + +#pragma mark - LMJNavUIBaseViewControllerDataSource + +/** 导航条右边的按钮 */ +- (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar +{ + [rightButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [rightButton setTitle:@"OC调JS注册的方法" forState:UIControlStateNormal]; + [rightButton sizeToFit]; + rightButton.height = 44; + return nil; +} + + +/** 右边的按钮的点击 */ +-(void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar +{ + +} + +- (void)dealloc { + _jsBridge = nil; +} + +@end diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJH5_OCViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJH5_OCViewController.m index 96fd3ee3..72f82a60 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJH5_OCViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJH5_OCViewController.m @@ -23,8 +23,6 @@ @implementation LMJH5_OCViewController - (void)viewDidLoad { [super viewDidLoad]; - self.webView.configuration.userContentController = [[WKUserContentController alloc] init]; - // 获取设备 deviceID 并回显到 H5 [self.webView.configuration.userContentController addScriptMessageHandler:self.ocjsHelper name:LMJOCJSHelperScriptMessageHandlerName1_]; @@ -38,18 +36,14 @@ - (void)viewDidLoad { - (void)webView:(WKWebView *)webView scrollView:(UIScrollView *)scrollView contentSize:(CGSize)contentSize { [super webView:webView scrollView:scrollView contentSize:contentSize]; - + #pragma mark - 添加红色的 View================================================ // 添加红色的 View static CGFloat contentSizeHeight = 0; if (contentSizeHeight != contentSize.height) { contentSizeHeight = contentSize.height; - self.addRedView.frame = CGRectMake(0, contentSize.height - self.addRedView.lmj_height, kScreenWidth, self.addRedView.lmj_height); } - //========================================================================== - - } @@ -70,12 +64,12 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigat NSString *js = [NSString stringWithFormat:@"\ var appendDiv = document.getElementById(\"AppAppendDIV\");\ if (appendDiv) {\ - appendDiv.style.height = %@+\"px\";\ + appendDiv.style.height = \"%@px\";\ } else {\ var appendDiv = document.createElement(\"div\");\ appendDiv.setAttribute(\"id\",\"AppAppendDIV\");\ - appendDiv.style.width=%@+\"px\";\ - appendDiv.style.height=%@+\"px\";\ + appendDiv.style.width= \"%@px\";\ + appendDiv.style.height= \"%@px\";\ document.body.appendChild(appendDiv);\ }\ ", @(self.addRedView.lmj_height), @(kScreenWidth), @(self.addRedView.lmj_height)]; @@ -84,7 +78,6 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigat self.addRedView.frame = CGRectMake(0, self.webView.scrollView.contentSize.height - self.addRedView.lmj_height, kScreenWidth, self.addRedView.lmj_height); }]; //========================================================================== - } diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJListTimerCountDownViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJListTimerCountDownViewController.m index c0346978..b65f6ea7 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJListTimerCountDownViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJListTimerCountDownViewController.m @@ -54,10 +54,6 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa return AdaptedHeight(50); } - - - - - (NSMutableArray *)products { if(_products == nil) @@ -72,7 +68,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa model.productName = [NSString stringWithFormat:@"产品标号%zd", i]; - model.date = CFAbsoluteTimeGetCurrent() + i * (10); + model.date = (arc4random() % 10 + 10) * i; model.pruductImage = [UIImage imageNamed:@"test_BaiDu_red"]; } @@ -93,20 +89,19 @@ - (void)startTimer - (void)timeCount:(NSTimer *)timer { - [self.products enumerateObjectsUsingBlock:^(LMJCountDownModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + @synchronized(self) { + [self.products enumerateObjectsUsingBlock:^(LMJCountDownModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if (obj.date == 0) { + }else { + obj.date--; + } + }]; - if (obj.date == CFAbsoluteTimeGetCurrent()) { - - }else { - obj.date = obj.date - 1; - } - }]; - - - [[self.tableView visibleCells] enumerateObjectsUsingBlock:^(__kindof UITableViewCell * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - LMJCountDownCell *cell = (LMJCountDownCell *)obj; - cell.countDownModel = cell.countDownModel; - }]; + [[self.tableView visibleCells] enumerateObjectsUsingBlock:^(__kindof UITableViewCell * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + LMJCountDownCell *cell = (LMJCountDownCell *)obj; + cell.countDownModel = cell.countDownModel; + }]; + } } diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJMasonryViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJMasonryViewController.m index 648b4297..b3b53cca 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJMasonryViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJMasonryViewController.m @@ -7,7 +7,7 @@ // #import "LMJMasonryViewController.h" - +#import "UIView+GestureCallback.h" @interface LMJMasonryViewController () @end @@ -91,8 +91,7 @@ - (void)masonryArrayBtns } -- (void)show:(UIButton *)btn -{ +- (void)show:(UIButton *)btn { } @@ -155,13 +154,16 @@ - (void)masonryLabels2 make.top.mas_equalTo(190); make.left.mas_equalTo(10); - make.right.mas_lessThanOrEqualTo(-80).priorityHigh(); }]; [mySenondLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(myLabel.mas_right).offset(10); make.top.mas_equalTo(myLabel.mas_top); + make.width.mas_equalTo(44); + // 最少80 + make.right.mas_lessThanOrEqualTo(-80).priorityHigh(); + }]; } @@ -192,15 +194,17 @@ - (void)masonryLabels3 make.top.mas_equalTo(220); make.left.mas_equalTo(10); - - - make.right.mas_lessThanOrEqualTo(-80).priorityHigh(); + }]; [mySenondLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(myLabel.mas_right).offset(10); make.top.mas_equalTo(myLabel.mas_top); + + make.width.mas_equalTo(44); + // 最少80 + make.right.mas_lessThanOrEqualTo(-80).priorityHigh(); }]; } @@ -266,6 +270,7 @@ - (void)masonryScrollView scrollView.showsVerticalScrollIndicator = scrollView.showsHorizontalScrollIndicator = YES; [self.view addSubview:scrollView]; + // 约束它的frame [scrollView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(250); @@ -275,7 +280,7 @@ - (void)masonryScrollView }]; - + // 添加一个 containerView, containerView里边放子控件,通过子控件约束 containerView 大小 UIView *containerView = [[UIView alloc] init]; containerView.backgroundColor = [UIColor RandomColor]; @@ -284,9 +289,17 @@ - (void)masonryScrollView [containerView mas_makeConstraints:^(MASConstraintMaker *make) { - // make.edges.mas_equalTo(scrollView); - make.edges.mas_equalTo(UIEdgeInsetsMake(10, 10, 10, 20)); - // make.height.mas_equalTo(kScreenHeight); + // 约束 内边距 + // 或者 + // make.edges.mas_equalTo(scrollView); + // 或者 +// make.edges.mas_equalTo(UIEdgeInsetsMake(10, 10, 10, 20)); + // 或者 + make.left.offset(0); + make.right.offset(0); + make.top.offset(0); + make.bottom.offset(0); + // 约束宽度 make.width.mas_equalTo(scrollView.mas_width); }]; @@ -322,6 +335,7 @@ - (void)masonryScrollView [containerView mas_updateConstraints:^(MASConstraintMaker *make) { + // 关键性约束, 约束 containerView 的大小 make.bottom.mas_equalTo(lastView.mas_bottom).offset(20); }]; } @@ -355,8 +369,8 @@ - (void)masonryUpdate make.edges.mas_equalTo(myView).insets(UIEdgeInsetsMake(10, 5, 15, 5)); }]; - LMJWeakSelf(myInView); - LMJWeakSelf(myView); + LMJWeak(myInView); + LMJWeak(myView); [myView addTapGestureRecognizer:^(UITapGestureRecognizer *recognizer, NSString *gestureId) { [weakmyInView mas_remakeConstraints:^(MASConstraintMaker *make) { diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJQRCodeViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJQRCodeViewController.m index af21886a..4d77f18b 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJQRCodeViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJQRCodeViewController.m @@ -19,7 +19,7 @@ @implementation LMJQRCodeViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + LMJWeak(self); self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 200)]; UIImageView *imageV = [[UIImageView alloc] init]; @@ -65,13 +65,11 @@ - (void)viewDidLoad { weakself.sections.firstObject.items.firstObject.subTitle = stringValue; [weakself.tableView reloadRow:0 inSection:0 withRowAnimation:0]; - }]; [scanner setTitleColor:[UIColor whiteColor] tintColor:[UIColor greenColor]]; [weakself showDetailViewController:scanner sender:nil]; - }]); } diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJUpLoadImagesViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJUpLoadImagesViewController.m index ce62933e..8ece2a00 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJUpLoadImagesViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJUpLoadImagesViewController.m @@ -7,8 +7,8 @@ // #import "LMJUpLoadImagesViewController.h" -#import #import "LMJUpLoadImageCell.h" +#import #import #import #import @@ -34,18 +34,16 @@ - (UIImagePickerController *)imagePickerVc { _imagePickerVc = [[UIImagePickerController alloc] init]; _imagePickerVc.delegate = self; // set appearance / 改变相册选择页的导航栏外观 - if (iOS7Later) { - _imagePickerVc.navigationBar.barTintColor = self.navigationController.navigationBar.barTintColor; - } - _imagePickerVc.navigationBar.tintColor = self.navigationController.navigationBar.tintColor; + + _imagePickerVc.navigationBar.barTintColor = [UIColor greenColor]; + + // 红色 + _imagePickerVc.navigationBar.tintColor = [UIColor redColor]; UIBarButtonItem *tzBarItem, *BarItem; - if (iOS9Later) { - tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; - BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]]; - } else { + tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]]; - } + NSDictionary *titleTextAttributes = [tzBarItem titleTextAttributesForState:UIControlStateNormal]; [BarItem setTitleTextAttributes:titleTextAttributes forState:UIControlStateNormal]; @@ -64,7 +62,7 @@ - (void)viewDidLoad { - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { LMJUpLoadImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([LMJUpLoadImageCell class]) forIndexPath:indexPath]; - LMJWeakSelf(self); + LMJWeak(self); if (indexPath.item == self.selectedImages.count) { cell.photoImage = nil; cell.addPhotoClick = ^(LMJUpLoadImageCell *uploadImageCell) { @@ -168,9 +166,9 @@ - (void)choosePhoto imagePickerVc.delegate = self; */ - imagePickerVc.isStatusBarDefault = NO; +// imagePickerVc.isStatusBarDefault = NO; #pragma mark - 到这里为止 - LMJWeakSelf(self); + LMJWeak(self); // You can get the photos by block, the same as by delegate. // 你可以通过block或者代理,来得到用户选择的照片. [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { @@ -189,7 +187,7 @@ - (void)choosePhoto - (void)takePhoto { AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; - if ((authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied) && iOS7Later) { + if ((authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied)) { // 无相机权限 做一个友好的提示 [UIAlertController mj_showAlertWithTitle:@"无法使用相机" message:@"请在iPhone的""设置-隐私-相机""中允许访问相机" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { @@ -207,7 +205,7 @@ - (void)takePhoto } else if (authStatus == AVAuthorizationStatusNotDetermined) { // fix issue 466, 防止用户首次拍照拒绝授权时相机页黑屏 - if (iOS7Later) { + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { if (granted) { dispatch_sync(dispatch_get_main_queue(), ^{ @@ -215,12 +213,10 @@ - (void)takePhoto }); } }]; - } else { - [self takePhoto]; - } + // 拍照之前还需要检查相册权限 - } else if ([TZImageManager authorizationStatus] == 2) { // 已被拒绝,没有相册权限,将无法保存拍的照片 - if (iOS8Later) { + } else if (authStatus == 2) { // 已被拒绝,没有相册权限,将无法保存拍的照片 + [UIAlertController mj_showAlertWithTitle:@"无法使用相机" message:@"请在iPhone的""设置-隐私-相机""中允许访问相机" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { alertMaker.addActionDestructiveTitle(@"取消").addActionDefaultTitle(@"确认"); @@ -233,8 +229,8 @@ - (void)takePhoto } }]; - } - } else if ([TZImageManager authorizationStatus] == 0) { // 未请求过相册权限 + + } else if (authStatus == 0) { // 未请求过相册权限 [[TZImageManager manager] requestAuthorizationWithCompletion:^{ [self takePhoto]; }]; @@ -247,9 +243,9 @@ - (void)takePhoto - (void)pushImagePickerController { // 提前定位 __weak typeof(self) weakSelf = self; - [[TZLocationManager manager] startLocationWithSuccessBlock:^(CLLocation *location, CLLocation *oldLocation) { + [[TZLocationManager manager] startLocationWithSuccessBlock:^(NSArray *locations) { __strong typeof(weakSelf) strongSelf = weakSelf; - strongSelf.location = location; + strongSelf.location = locations.lastObject; } failureBlock:^(NSError *error) { __strong typeof(weakSelf) strongSelf = weakSelf; strongSelf.location = nil; @@ -258,9 +254,8 @@ - (void)pushImagePickerController { UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera; if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { self.imagePickerVc.sourceType = sourceType; - if(iOS8Later) { - self.imagePickerVc.modalPresentationStyle = UIModalPresentationOverCurrentContext; - } + + self.imagePickerVc.modalPresentationStyle = UIModalPresentationOverCurrentContext; [self presentViewController:self.imagePickerVc animated:YES completion:nil]; } else { NSLog(@"模拟器中无法打开照相机,请在真机中使用"); @@ -277,19 +272,19 @@ - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingM UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; // save photo and get asset / 保存图片,获取到asset - [[TZImageManager manager] savePhotoWithImage:image location:self.location completion:^(NSError *error){ + [[TZImageManager manager] savePhotoWithImage:image location:self.location completion:^(PHAsset *assets, NSError *error){ if (error) { [tzImagePickerVc hideProgressHUD]; NSLog(@"图片保存失败 %@",error); } else { - [[TZImageManager manager] getCameraRollAlbum:NO allowPickingImage:YES completion:^(TZAlbumModel *model) { + [[TZImageManager manager] getCameraRollAlbum:NO allowPickingImage:YES needFetchAssets:YES completion:^(TZAlbumModel *model) { [[TZImageManager manager] getAssetsFromFetchResult:model.result allowPickingVideo:NO allowPickingImage:YES completion:^(NSArray *models) { [tzImagePickerVc hideProgressHUD]; TZAssetModel *assetModel = [models firstObject]; if (tzImagePickerVc.sortAscendingByModificationDate) { assetModel = [models lastObject]; } - if (YES) { // 允许裁剪,去裁剪 + if (/* DISABLES CODE */ (NO)) { // 允许裁剪,去裁剪 TZImagePickerController *imagePicker = [[TZImagePickerController alloc] initCropTypeWithAsset:assetModel.asset photo:image completion:^(UIImage *cropImage, id asset) { [self refreshCollectionViewWithAddedAsset:asset image:cropImage]; }]; @@ -297,7 +292,7 @@ - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingM imagePicker.circleCropRadius = 100; [self presentViewController:imagePicker animated:YES completion:nil]; } else { -// [self refreshCollectionViewWithAddedAsset:assetModel.asset image:image]; + [self refreshCollectionViewWithAddedAsset:assetModel.asset image:image]; } }]; }]; @@ -333,15 +328,17 @@ - (void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)na } MBProgressHUD *hud = [MBProgressHUD showProgressToView:self.view Text:@"传输中"]; - NSString *mineType = @"application/octet-stream"; NSString *name = @"file"; - [[LMJRequestManager sharedManager] upload:[LMJXMGBaseUrl stringByAppendingPathComponent:@"upload"] parameters:@{@"username" : @"NJHu"} formDataBlock:^(id formData) { + [[LMJRequestManager sharedManager] upload:[LMJXMGBaseUrl stringByAppendingPathComponent:@"upload"] parameters:@{@"username" : @"NJHu"} formDataBlock:^NSDictionary *(id formData, NSMutableDictionary *needFillDataDict) { [self.selectedImages enumerateObjectsUsingBlock:^(UIImage * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { // 压缩率控制 - [formData appendPartWithFileData:UIImageJPEGRepresentation(obj, 1) name:name fileName:@"test.png" mimeType:mineType]; +// [formData appendPartWithFileData:UIImageJPEGRepresentation(obj, 1) name:name fileName:@"test.png" mimeType:mineType]; + needFillDataDict[UIImageJPEGRepresentation(obj, 1)] = name; }]; + return needFillDataDict; + } progress:^(NSProgress *progress) { // hud.progress = (CGFloat)progress.completedUnitCount / progress.totalUnitCount; diff --git a/iOSProject/iOSProject/Classes/Preview2/LMJUpLoadProgressViewController.m b/iOSProject/iOSProject/Classes/Preview2/LMJUpLoadProgressViewController.m index 74c1eb30..55401b22 100644 --- a/iOSProject/iOSProject/Classes/Preview2/LMJUpLoadProgressViewController.m +++ b/iOSProject/iOSProject/Classes/Preview2/LMJUpLoadProgressViewController.m @@ -12,6 +12,7 @@ #import #import #import +#import "MBProgressHUD+LMJ.h" static const NSInteger maxPhotoCount = 9; @@ -35,18 +36,10 @@ - (UIImagePickerController *)imagePickerVc { _imagePickerVc = [[UIImagePickerController alloc] init]; _imagePickerVc.delegate = self; // set appearance / 改变相册选择页的导航栏外观 - if (iOS7Later) { - _imagePickerVc.navigationBar.barTintColor = self.navigationController.navigationBar.barTintColor; - } _imagePickerVc.navigationBar.tintColor = self.navigationController.navigationBar.tintColor; UIBarButtonItem *tzBarItem, *BarItem; - if (iOS9Later) { - tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; - BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]]; - } else { tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]]; - } NSDictionary *titleTextAttributes = [tzBarItem titleTextAttributesForState:UIControlStateNormal]; [BarItem setTitleTextAttributes:titleTextAttributes forState:UIControlStateNormal]; @@ -65,7 +58,7 @@ - (void)viewDidLoad { - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { LMJUpLoadImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([LMJUpLoadImageCell class]) forIndexPath:indexPath]; - LMJWeakSelf(self); + LMJWeak(self); if (indexPath.item == self.selectedImages.count) { cell.photoImage = nil; cell.addPhotoClick = ^(LMJUpLoadImageCell *uploadImageCell) { @@ -170,9 +163,9 @@ - (void)choosePhoto imagePickerVc.delegate = self; */ - imagePickerVc.isStatusBarDefault = NO; +// imagePickerVc.statusBarStyle = NO; #pragma mark - 到这里为止 - LMJWeakSelf(self); + LMJWeak(self); // You can get the photos by block, the same as by delegate. // 你可以通过block或者代理,来得到用户选择的照片. [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { @@ -191,7 +184,7 @@ - (void)choosePhoto - (void)takePhoto { AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; - if ((authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied) && iOS7Later) { + if ((authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied)) { // 无相机权限 做一个友好的提示 [UIAlertController mj_showAlertWithTitle:@"无法使用相机" message:@"请在iPhone的""设置-隐私-相机""中允许访问相机" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { @@ -209,20 +202,16 @@ - (void)takePhoto } else if (authStatus == AVAuthorizationStatusNotDetermined) { // fix issue 466, 防止用户首次拍照拒绝授权时相机页黑屏 - if (iOS7Later) { - [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { - if (granted) { - dispatch_sync(dispatch_get_main_queue(), ^{ - [self takePhoto]; - }); - } - }]; - } else { - [self takePhoto]; - } + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { + if (granted) { + dispatch_sync(dispatch_get_main_queue(), ^{ + [self takePhoto]; + }); + } + }]; // 拍照之前还需要检查相册权限 - } else if ([TZImageManager authorizationStatus] == 2) { // 已被拒绝,没有相册权限,将无法保存拍的照片 - if (iOS8Later) { + } else if (authStatus == AVAuthorizationStatusDenied) { // 已被拒绝,没有相册权限,将无法保存拍的照片 + [UIAlertController mj_showAlertWithTitle:@"无法使用相机" message:@"请在iPhone的""设置-隐私-相机""中允许访问相机" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { alertMaker.addActionDestructiveTitle(@"取消").addActionDefaultTitle(@"确认"); @@ -235,8 +224,7 @@ - (void)takePhoto } }]; - } - } else if ([TZImageManager authorizationStatus] == 0) { // 未请求过相册权限 + } else if (authStatus == AVAuthorizationStatusNotDetermined) { // 未请求过相册权限 [[TZImageManager manager] requestAuthorizationWithCompletion:^{ [self takePhoto]; }]; @@ -249,9 +237,9 @@ - (void)takePhoto - (void)pushImagePickerController { // 提前定位 __weak typeof(self) weakSelf = self; - [[TZLocationManager manager] startLocationWithSuccessBlock:^(CLLocation *location, CLLocation *oldLocation) { + [[TZLocationManager manager] startLocationWithSuccessBlock:^(NSArray *locations) { __strong typeof(weakSelf) strongSelf = weakSelf; - strongSelf.location = location; + strongSelf.location = locations.lastObject; } failureBlock:^(NSError *error) { __strong typeof(weakSelf) strongSelf = weakSelf; strongSelf.location = nil; @@ -260,9 +248,7 @@ - (void)pushImagePickerController { UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera; if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { self.imagePickerVc.sourceType = sourceType; - if(iOS8Later) { - self.imagePickerVc.modalPresentationStyle = UIModalPresentationOverCurrentContext; - } + self.imagePickerVc.modalPresentationStyle = UIModalPresentationOverCurrentContext; [self presentViewController:self.imagePickerVc animated:YES completion:nil]; } else { NSLog(@"模拟器中无法打开照相机,请在真机中使用"); @@ -277,14 +263,14 @@ - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingM tzImagePickerVc.sortAscendingByModificationDate = YES; [tzImagePickerVc showProgressHUD]; UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; - // save photo and get asset / 保存图片,获取到asset - [[TZImageManager manager] savePhotoWithImage:image location:self.location completion:^(NSError *error){ + [[TZImageManager manager] savePhotoWithImage:image location:self.location completion:^(PHAsset *asset, NSError *error){ if (error) { [tzImagePickerVc hideProgressHUD]; NSLog(@"图片保存失败 %@",error); } else { - [[TZImageManager manager] getCameraRollAlbum:NO allowPickingImage:YES completion:^(TZAlbumModel *model) { + + [[TZImageManager manager] getCameraRollAlbum:NO allowPickingImage:YES needFetchAssets:YES completion:^(TZAlbumModel *model) { [[TZImageManager manager] getAssetsFromFetchResult:model.result allowPickingVideo:NO allowPickingImage:YES completion:^(NSArray *models) { [tzImagePickerVc hideProgressHUD]; TZAssetModel *assetModel = [models firstObject]; @@ -334,14 +320,16 @@ - (void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)na return; } - NSString *mineType = @"application/octet-stream"; +// NSString *mineType = @"application/octet-stream"; NSString *name = @"file"; [self.selectedImages enumerateObjectsUsingBlock:^(UIImage * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - - [[LMJRequestManager sharedManager] upload:[LMJXMGBaseUrl stringByAppendingPathComponent:@"upload"] parameters:@{@"username" : @"NJHu"} formDataBlock:^(id formData) { + + [[LMJRequestManager sharedManager] upload:[LMJXMGBaseUrl stringByAppendingPathComponent:@"upload"] parameters:@{@"username" : @"NJHu"} formDataBlock:^NSDictionary *(id formData, NSMutableDictionary *needFillDataDict) { // 压缩率控制 - [formData appendPartWithFileData:UIImageJPEGRepresentation(obj, 1) name:name fileName:@"test.png" mimeType:mineType]; + needFillDataDict[UIImageJPEGRepresentation(obj, 1)] = name; + + return needFillDataDict; } progress:^(NSProgress *progress) { diff --git a/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/H5Bridge.css b/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/H5Bridge.css new file mode 100644 index 00000000..a49f8c74 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/H5Bridge.css @@ -0,0 +1,19 @@ +body { + margin:0; + padding:0; + background-color: #EEEEEE; +} +ul,li{ + list-style-type: none; + margin:0; + padding:0 +} +li{ + display: block; + padding:10px 20px; + background:#aaa; + color:#fff; + border-radius: 5px; + margin-top:20px; + text-align: center; +} diff --git a/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/H5Bridge.js b/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/H5Bridge.js new file mode 100644 index 00000000..a38a6ac1 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/H5Bridge.js @@ -0,0 +1,87 @@ +// h5 页面需要把这个 JS 引入, 安卓也可以用这个 + +const messageHandlers = {}; +// 自定义协议头, 本质还拦截 +const CUSTOM_PROTOCOL_SCHEME = 'njhu'; +const responseCallbacks = {}; + +// 假的 frame +function _createMessageIframe (src) { + + const messagingIframe = document.createElement('iframe'); + messagingIframe.style.display = 'none'; + messagingIframe.src = src; + + document.documentElement.appendChild(messagingIframe); + setTimeout(function () { + document.documentElement.removeChild(messagingIframe); + }, 0); +} + +// JS 注册原生的事件, handlerName: 原生的方法名字标识 handler: 回调 +function registerHandler (handlerName, handler) { + messageHandlers[handlerName] = handler; + console.log(messageHandlers); +} + + +// js 调用原生的方法,handlerName: 原生方法标识, data: 传递给原生的 字典, responseCallback执行后的回调 +function callHandler (handlerName, data, responseCallback) { + _doSend({handlerName: handlerName, data: data}, responseCallback); +} + +// 包装数据 +function _doSend (message, responseCallback) { + if (responseCallback) { + const callbackId = 'cb_' + new Date().getTime(); + responseCallbacks[callbackId] = responseCallback; + message.callbackId = callbackId; + } + const messageQueueString = JSON.stringify(message); + _createMessageIframe(CUSTOM_PROTOCOL_SCHEME + '://__return_message__/' + encodeURIComponent(messageQueueString)); +} + +function _dispatchMessageFromApp (messageJSON) { + console.log(messageJSON); + messageJSON = messageJSON.replace(/(\t)/g, ' '); + messageJSON = messageJSON.replace(/(\r\n)|(\n)/g, '
    '); + const message = JSON.parse(messageJSON); + + if (message.responseId) { + var responseCallback; + responseCallback = responseCallbacks[message.responseId]; + if (!responseCallback) { + return; + } + responseCallback(message.responseData); + delete responseCallbacks[message.responseId]; + } else { + var messageCallback; + if (message.callbackId) { + const callbackResponseId = message.callbackId; + messageCallback = function (responseData) { + _doSend({responseId: callbackResponseId, responseData: responseData}); + }; + } + var handler; + console.log(message.handlerName); + console.log(messageHandlers); + if (message.handlerName) { + handler = messageHandlers[message.handlerName]; + } + console.log(handler); + if (handler) { + handler(message.data, messageCallback); + } + } + +} + +const app = { + callHandler: callHandler, + _dispatchMessageFromApp: _dispatchMessageFromApp, + registerHandler: registerHandler +}; + + + diff --git a/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/LMJH5JSBridgeViewController.html b/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/LMJH5JSBridgeViewController.html new file mode 100644 index 00000000..39c1c0c2 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/Tool/JSBridge_js/LMJH5JSBridgeViewController.html @@ -0,0 +1,153 @@ + + + + + + + + + + jsbridge + + +
      + +
      + +
    • toast

    • + +
    • close

    • + +
    • startPage
    • + +
      + + +
    • startClassAction
    • + + +
      + +
    • startClassAction2Args
    • + + +
      + +
    • startInstanceAction
    • + + +
      + +
    • startInstanceAction2Args
    • + + +
      + + +
    • set
    • + +
      + +
    • get
    • + +
      + +
    + + + + + + diff --git a/iOSProject/iOSProject/Classes/Preview2/Tool/WKBridgeTool.h b/iOSProject/iOSProject/Classes/Preview2/Tool/WKBridgeTool.h new file mode 100644 index 00000000..e86a0e35 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/Tool/WKBridgeTool.h @@ -0,0 +1,56 @@ +// +// WKBridgeTool.h +// iOSProject +// +// Created by HuXuPeng on 2018/3/17. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import +#define kProtocolScheme @"njhu" +#define kReturnMessage @"__return_message__" +#define kInitAppMessage @"__init_app__" +#define kStartPageMessage @"startpage" +#define kStartActionMessage @"startaction" +#define kGetMessage @"get" +#define kSetMessage @"set" +#define kCloseMessage @"close" +#define kSplit @"_:_" + + +@class WKWebViewJsBridge; + +@interface WKBridgeTool : NSObject + +/** + 注册一些基本事件 + + 调用app原生页面 + 调用app原生功能或事件(app原生类的静态方法 + 获取app本地存储的数据, keys为要获取数据数组key: ["username", "password"] + 保存数据到app原生, data 为要保存到app本地的数据: {"username":"xxx", "password":"xxx"} + 关闭h5 + */ ++ (void)bridgeRegisterDefault:(WKWebViewJsBridge *)bridge; + ++ (BOOL)isWebViewJavascriptBridgeURL:(NSURL *)url; + +/** +给 H5 发送消息 + */ + ++ (NSString *)returnMsg; + ++ (void)dispatchMsgToh5:(NSDictionary *)responseMsg webView:(WKWebView *)webView; + ++ (NSString *)returnMsg:(NSString *)msg; + ++ (NSString *)returnMsg:(NSString *)msg msg2:(NSString *)msg2; + +- (NSString *)returnMsg; + +- (NSString *)returnMsg:(NSString *)msg; + +- (NSString *)returnMsg:(NSString *)msg msg2:(NSString *)msg2; + +@end diff --git a/iOSProject/iOSProject/Classes/Preview2/Tool/WKBridgeTool.m b/iOSProject/iOSProject/Classes/Preview2/Tool/WKBridgeTool.m new file mode 100644 index 00000000..d4837d0c --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/Tool/WKBridgeTool.m @@ -0,0 +1,308 @@ +// +// WKBridgeTool.m +// iOSProject +// +// Created by HuXuPeng on 2018/3/17. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + + +#import "WKWebViewJsBridge.h" +#import "WKBridgeTool.h" +#import +#import + +@implementation WKBridgeTool + ++ (void)receiveActionURL:(NSURL *)actionURL { + +} + ++ (BOOL)isWebViewJavascriptBridgeURL:(NSURL *)url { + return [url.scheme.lowercaseString isEqualToString:kProtocolScheme]; +} + ++ (void)bridgeRegisterDefault:(WKWebViewJsBridge *)bridge { + + + //启动页面 + [bridge registerHandler:kStartPageMessage handle:^void(id data, void (^responseCallback)(id responseData)) { + [WKBridgeTool handlerPage:data callback:responseCallback]; + }]; + + //调用方法 + [bridge registerHandler:kStartActionMessage handle:^(id data, void (^responseCallback)(id responseData)) { + [WKBridgeTool handlerAction:data callback:responseCallback]; + }]; + //获取数据 + [bridge registerHandler:kGetMessage handle:^(id data, void (^responseCallback)(id responseData)) { + if (![data isKindOfClass:NSArray.class]) { + return; + } + NSArray *arr = data; + if (LMJIsEmpty(arr)) { + responseCallback(@{}); + return; + } + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + for (NSString *key in arr) { + id value = [[NSUserDefaults standardUserDefaults] objectForKey:key]; + if (value) { + dict[key] = value; + } + } + + // 回调给 H5 + !responseCallback ?: responseCallback(dict); + }]; + //保存数据 + [bridge registerHandler:kSetMessage handle:^(id data, void (^responseCallback)(id responseData)) { + if (![data isKindOfClass:NSDictionary.class]) { + return; + } + NSDictionary *dict = data; + [dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + [[NSUserDefaults standardUserDefaults] setObject:obj forKey:key]; + }]; + + !responseCallback ?: responseCallback(dict); + }]; + + + LMJWeak(bridge); + //关闭当前h5 + [bridge registerHandler:kCloseMessage handle:^(id data, void (^responseCallback)(id responseData)) { + UIViewController *con = [weakbridge.webView viewController]; + + // 判断两种情况: push 和 present + if ((con.navigationController.presentedViewController || con.navigationController.presentingViewController) && con.navigationController.childViewControllers.count == 1) { + + [con dismissViewControllerAnimated:YES completion:nil]; + + }else{ + [con.navigationController popViewControllerAnimated:YES]; + } + + !responseCallback ?: responseCallback(nil); + }]; +} + + +/* + data: { + pageName: { + ios: 'iospagename', + Android: 'Androidpagename' + } + //valueType 兼容安卓 + setPageData: { + key: {value:value, valueType: type}, + key: {value:value, valueType: type}, + } + startType: 'present/push' + } + */ + ++ (void) handlerPage:(id)data callback:(void(^)(id responseData))callback { + if (![data isKindOfClass:NSDictionary.class]) { + return; + } + NSString *pageName = data[@"pageName"][@"ios"]; + if (LMJIsEmpty(pageName)) { + return; + } + @try { + + Class clazz = NSClassFromString(pageName); + UIViewController *viewController = [[clazz alloc] init]; + if (![viewController isKindOfClass:[UIViewController class]]) { + return; + } + + NSMutableDictionary *pageData = [NSMutableDictionary dictionaryWithDictionary:data[@"setPageData"]]; + + if (!LMJIsEmpty(pageData)) { + UIViewController *setValueVC = viewController; + + if ([viewController isKindOfClass:UINavigationController.class]) { + setValueVC = viewController.childViewControllers.firstObject; + } + + [pageData enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { + [setValueVC setValue:obj[@"value"] forKey:key]; + }]; + } + + + NSString *startType = data[@"startType"]; + + if ([viewController isKindOfClass:UINavigationController.class] || [startType isEqualToString:@"present"]) { + [UIWindow.zf_currentViewController presentViewController:viewController animated:YES completion:nil]; + }else { + + UINavigationController *navVc = (UINavigationController *)UIWindow.zf_currentViewController; + if (![navVc isKindOfClass:[UINavigationController class]]) { + navVc = navVc.navigationController; + } + if (navVc && [navVc isKindOfClass:[UINavigationController class]]) { + [navVc pushViewController:viewController animated:YES]; + } + } + + if (callback) { + callback(nil); + } + } @catch (NSException *exception) { + NSLog(@"%@: %@", exception.name, exception.reason); + } +} + + ++ (void)handlerAction:(id)data callback:(void(^)(id responseData))callback { + + +// 3、调用app原生静态方法或单例类方法 (工具类 或 静态功能方法, 只支持参数为 '基本数据类型'、'字符串' 的方法) + //调用所需要的数据, 具体属性的值怎么写由app开发人员提供 +// var actionData = { +// "action" : { +// "ios" : "ios的类名_:_构造方法_:_执行的方法名", +// "android" : "android全类名_:_构造方法_:_执行的方法名" +// }, +// "data" : [ //可选参数,调用方法所需要的数据, 或为 {"android":[], "ios":[]} +// "value1", +// "value2" +// ] +// }; +// //调用原生方法 +// app.startAction(actionData, function(data) { +// //app执行完后的回调,data为执行原生方法的返回值 +// }); + + if (![data isKindOfClass:NSDictionary.class]) { + return; + } + NSDictionary *actionData = data; + NSString *action = actionData[@"action"][@"ios"]; + if (LMJIsEmpty(action)) { + return; + } + + NSArray *calssInits = [action componentsSeparatedByString:kSplit]; + + NSString *className = nil; + NSString *init = nil; + NSString *sel = nil; + + if (calssInits.count < 2) { + return; + } + className = calssInits[0]; + if (calssInits.count == 2) { + sel = calssInits[1]; + } + if (calssInits.count == 3) { + init = calssInits[1]; + sel = calssInits[2]; + } + + Class class = NSClassFromString(className); + if (!class) { + return; + } + + id obj = class; + if (!LMJIsEmpty(init)) { + if ([@"()" isEqualToString:init]) { + obj = [[class alloc] init]; + }else if ([class respondsToSelector:NSSelectorFromString(init)]) { + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + + obj = [class performSelector:NSSelectorFromString(init)]; + + }else { + return; + } + } + + SEL method = NSSelectorFromString(sel); + if (![obj respondsToSelector:method]) { + return; + } + + @try { + id result; + NSArray *args = actionData[@"data"]; + if (!LMJIsEmpty(args)) { + if (args.count == 1) { + result = [obj performSelector:method withObject:args[0]]; + }else if (args.count == 2) { + result = [obj performSelector:method withObject:args[0] withObject:args[1]]; + } + } else { + result = [obj performSelector:method]; + } + + #pragma clang diagnostic pop + + !callback ?: callback(result); + } @catch (NSException *exception) { + NSLog(@"%@", exception); + } @finally { + } +} + + ++ (void)dispatchMsgToh5:(NSDictionary *)responseMsg webView:(WKWebView *)webView { + + NSString *messageJSON = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:responseMsg options:0 error:nil] encoding:NSUTF8StringEncoding]; + + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\'" withString:@"\\\'"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\r" withString:@"\\r"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\f" withString:@"\\f"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2028" withString:@"\\u2028"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2029" withString:@"\\u2029"]; + + NSString *javascriptCommand = [NSString stringWithFormat:@"app._dispatchMessageFromApp('%@')", messageJSON]; + dispatch_async(dispatch_get_main_queue(), ^{ + + [webView evaluateJavaScript:javascriptCommand completionHandler:^(id _Nullable result, NSError * _Nullable error) { + + NSLog(@"%@", result); + }]; + }); +} + ++ (NSString *)returnMsg { + return [NSString stringWithFormat:@"我是类方法"]; +} + ++ (NSString *)returnMsg:(NSString *)msg { + return [NSString stringWithFormat:@"我是类方法: %@", msg]; +} + ++ (NSString *)returnMsg:(NSString *)msg msg2:(NSString *)msg2 { + return [NSString stringWithFormat:@"我是类多参数方法: %@,,%@", msg, msg2]; +} + +- (NSString *)returnMsg { + return [NSString stringWithFormat:@"我是对象方法"]; +} + +- (NSString *)returnMsg:(NSString *)msg { + return [NSString stringWithFormat:@"我是对象方法: %@", msg]; +} + +- (NSString *)returnMsg:(NSString *)msg msg2:(NSString *)msg2 { + return [NSString stringWithFormat:@"我是对象多参数方法: %@,,%@", msg, msg2]; +} + +@end + + + + diff --git a/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.h b/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.h new file mode 100644 index 00000000..e278a363 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.h @@ -0,0 +1,19 @@ +// +// WKWebViewJavascriptBridge.h +// +#import +#import + + +@interface WKWebViewJsBridge : NSObject + +- (instancetype)initWithWebView:(WKWebView *)webView delegate:(id)delegate; + +@property (weak, nonatomic, readonly) WKWebView *webView; + +- (void)registerHandler:(NSString *)handleName handle:(void(^)(id data, void(^)(id responseData)))handle; + +- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(void(^)(id responseData))responseCallback; + +@end + diff --git a/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.m b/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.m new file mode 100644 index 00000000..ab6e30a4 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.m @@ -0,0 +1,261 @@ + +#import "WKWebViewJsBridge.h" +#import "WKBridgeTool.h" + +#define kHandlerName @"handlerName" +#define kCallbackId @"callbackId" +#define khandlerName @"handlerName" +#define kData @"data" +#define kCallbackId @"callbackId" +#define kResponseId @"responseId" +#define kResponseData @"responseData" +#define KResponseData @"responseData" + + +@interface WKWebViewJsBridge () +{ + __weak WKWebView *_webView; + __weak id _delegate; +} +/** js 调用 oc , oc 需要注册*/ +@property (nonatomic, strong) NSMutableDictionary *messageHandles; + +/** js 回调 OC */ +@property (nonatomic, strong) NSMutableDictionary *responseCallbacks; +@end + +@implementation WKWebViewJsBridge + + +/* + NSURL *url = [NSURL URLWithString:@"https://www.baidu.com/news/toady?abc=1&bcd=3"]; + (lldb) po url.path + /news/toady + + (lldb) po url.host + www.baidu.com + + (lldb) po url.scheme + https + + (lldb) po url.query + abc=1&bcd=3 + */ + + + +#pragma mark - action +- (void)continueAction:(NSURL *)url +{ + if (url.path.length < 1) { + return; + } + // njhu://__return_message__/{json} + NSString *messageJsonString = [url.path substringFromIndex:1]; + + NSDictionary *messageJsonDict = [NSJSONSerialization JSONObjectWithData:[messageJsonString dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:nil]; + + // 不是字典返回 + if (![messageJsonDict isKindOfClass:[NSDictionary class]]) { + return; + } + + NSString *handleName = messageJsonDict[khandlerName]; + // 转换成小写啦啦啦啦啦, block 嵌套 + void(^handlerBlock)(id data, void(^)(id responseData)) = self.messageHandles[handleName.lowercaseString]; + + // 回调给 H5!!!!关键步骤!!!!!================================ + void(^responseCallback)(id responseData) = nil; + NSString *callbackId = messageJsonDict[kCallbackId]; + + if (!LMJIsEmpty(callbackId)) { + // 把它作为回调传给 h5 + responseCallback = ^void(id responseData) { + + NSMutableDictionary *responseMsg = [NSMutableDictionary dictionary]; + responseMsg[kResponseId] = callbackId; + if (!LMJIsEmpty(responseData)) { + responseMsg[kResponseData] = responseData; + } + + // 回调 H5 + [WKBridgeTool dispatchMsgToh5:responseMsg webView:self->_webView]; + }; + }else { + responseCallback = ^(id responseData) { + }; + } + // ============================================================= + // 传递的数据 + id data = messageJsonDict[kData]; + !handlerBlock ?: handlerBlock(data, responseCallback); + + + + // response========================================================================== + NSString *responseId = messageJsonDict[kResponseId]; + if (!LMJIsEmpty(responseId)) { + void (^responseCallBack)(id responseData) = self.responseCallbacks[responseId]; + id data = messageJsonDict[KResponseData]; + [self.responseCallbacks removeObjectForKey:responseId]; + !responseCallBack ?: responseCallBack(data); + } +} + + +- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(void(^)(id responseData))responseCallback { + + + NSDictionary *message01 = @{kHandlerName: handlerName, kData: data}; + + NSMutableDictionary *message = [NSMutableDictionary dictionaryWithDictionary:message01]; + + if (responseCallback) { + + NSString* callbackSpecialId = [NSString stringWithFormat:@"objc_cb_%lf", CFAbsoluteTimeGetCurrent()]; + // 传递需要回调的 id + message[kCallbackId] = callbackSpecialId; + + // 保存 block + self.responseCallbacks[callbackSpecialId] = [responseCallback copy]; + } + + [WKBridgeTool dispatchMsgToh5:message webView:_webView]; + +} + +#pragma mark - handel +- (void)registerHandler:(NSString *)handleName handle:(void(^)(id data, void(^)(id responseData)))handle { + if (handle && !LMJIsEmpty(handleName)) { + self.messageHandles[handleName.lowercaseString] = [handle copy]; + } +} + +#pragma mark - init +- (instancetype)initWithWebView:(WKWebView *)webView delegate:(id)delegate { + if (self = [self init]) { + + LMJWeak(self); + LMJWeak(webView); + LMJWeak(delegate); + + _webView = weakwebView; + _webView.navigationDelegate = weakself; + _delegate = weakdelegate; + + [WKBridgeTool bridgeRegisterDefault:weakself]; + } + return self; +} + +- (instancetype)init +{ + self = [super init]; + if (self) { + _messageHandles = [NSMutableDictionary dictionary]; + _responseCallbacks = [NSMutableDictionary dictionary]; + } + return self; +} + +- (void)dealloc { + _messageHandles = nil; + _responseCallbacks = nil; + _delegate = nil; + _webView = nil; +} + + +#pragma mark - getter +- (WKWebView *)webView { + return _webView; +} + + +#pragma mark WKNavigationDelegate +- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { + if (webView != _webView) { return; } + + NSURL *url = navigationAction.request.URL; + WKNavigationActionPolicy policy = WKNavigationActionPolicyAllow; + + if ([WKBridgeTool isWebViewJavascriptBridgeURL:url]) { + policy = WKNavigationActionPolicyCancel; + // 执行拦截 + [self continueAction:url]; + } + + if (policy == WKNavigationActionPolicyAllow && _delegate && [_delegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)]) { + [_delegate webView:webView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler]; + } else { + decisionHandler(policy); + } +} + +- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { + if (webView != _webView) { return; } + if (_delegate && [_delegate respondsToSelector:@selector(webView:didFinishNavigation:)]) { + [_delegate webView:webView didFinishNavigation:navigation]; + } +} + + +- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler { + if (webView != _webView) { return; } + if (_delegate && [_delegate respondsToSelector:@selector(webView:decidePolicyForNavigationResponse:decisionHandler:)]) { + [_delegate webView:webView decidePolicyForNavigationResponse:navigationResponse decisionHandler:decisionHandler]; + } + else { + decisionHandler(WKNavigationResponsePolicyAllow); + } +} + +- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler { + if (webView != _webView) { return; } + if (_delegate && [_delegate respondsToSelector:@selector(webView:didReceiveAuthenticationChallenge:completionHandler:)]) { + [_delegate webView:webView didReceiveAuthenticationChallenge:challenge completionHandler:completionHandler]; + } else { + completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); + } +} + +- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { + if (webView != _webView) { return; } + if (_delegate && [_delegate respondsToSelector:@selector(webView:didStartProvisionalNavigation:)]) { + [_delegate webView:webView didStartProvisionalNavigation:navigation]; + } +} + + +- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { + if (webView != _webView) { return; } + if (_delegate && [_delegate respondsToSelector:@selector(webView:didFailNavigation:withError:)]) { + [_delegate webView:webView didFailNavigation:navigation withError:error]; + } +} + +- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error { + if (webView != _webView) { return; } + if (_delegate && [_delegate respondsToSelector:@selector(webView:didFailProvisionalNavigation:withError:)]) { + [_delegate webView:webView didFailProvisionalNavigation:navigation withError:error]; + } +} + +- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(null_unspecified WKNavigation *)navigation{ + if (webView != _webView) { return; } + if (_delegate && [_delegate respondsToSelector:@selector(webView:didReceiveServerRedirectForProvisionalNavigation:)]) { + [_delegate webView:webView didReceiveServerRedirectForProvisionalNavigation:navigation]; + } +} + + +- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView API_AVAILABLE(macosx(10.11), ios(9.0)){ + if (webView != _webView) { return; } + if (_delegate && [_delegate respondsToSelector:@selector(webViewWebContentProcessDidTerminate:)]) { + [_delegate webViewWebContentProcessDidTerminate:webView]; + } +} + + +@end + diff --git a/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.temp_caseinsensitive_rename.m b/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.temp_caseinsensitive_rename.m new file mode 100644 index 00000000..d868c8f2 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview2/Tool/WKWebViewJsBridge.temp_caseinsensitive_rename.m @@ -0,0 +1,652 @@ + +#import "WKWebViewJsBridge.h" + +#define kProtocolScheme @"eagle" +#define kQueueHasMessage @"__queue_message__" +#define kReturnMessage @"__return_message__" +#define kInitAppMessage @"__init_app__" + +#define kStartPageMessage @"startPage" +#define kStartActionMessage @"startAction" +#define kGetMessage @"get" +#define kSetMessage @"set" +#define kCloseMessage @"close" +#define split @"_:_" + + +@interface WKWebViewJsBridge () + +@property (strong, nonatomic) NSMutableArray* startupMessageQueue; +@property (strong, nonatomic) NSMutableDictionary* responseCallbacks; +@property (strong, nonatomic) NSMutableDictionary* messageHandlers; +@property (strong, nonatomic) WVJBHandler messageHandler; + +@end + +@implementation WKWebViewJsBridge { + __weak WKWebView* _webView; + __weak id _webViewDelegate; + long _uniqueId; +} + ++ (instancetype)bridgeForWebView:(WKWebView*)webView { + WKWebViewJsBridge* bridge = [[self alloc] init]; + [bridge _setupInstance:webView]; + [bridge reset]; + + [bridge registerDefault]; + return bridge; +} + ++ (BOOL)handlerUrl:(NSString *)urlString { + @try { + NSURL *url = [NSURL URLWithString:urlString]; + NSString *scheme = url.scheme.lowercaseString; + NSString *host = url.host.lowercaseString; + if ([kProtocolScheme isEqualToString:scheme] + && ([kStartPageMessage.lowercaseString isEqualToString:host] + ||[kStartActionMessage.lowercaseString isEqualToString:host])) { + NSString *dataString = url.path; + if (e_isEmpty(dataString)) { + return NO; + } + dataString = [dataString substringFromIndex:1]; + NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:[dataString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil]; + if ([kStartPageMessage.lowercaseString isEqualToString:host]) { + [WKWebViewJsBridge handlerPage:dict callback:nil]; + } else if ([kStartActionMessage.lowercaseString isEqualToString:host]) { + [WKWebViewJsBridge handlerAction:dict callback:nil]; + } + return YES; + } + } @catch (NSException *exception) { + e_log(@"%@: %@", exception.name, exception.reason); + } + return NO; +} + + ++ (void)loadUrl:(WKWebView*)webView url:(NSString *)urlString { + if (e_isEmpty(urlString)) { + return; + } + @try { + NSString *url = urlString; + if([[NSPredicate predicateWithFormat:@"SELF MATCHES %@",@".+\\?.+\\{.*\\}.*"] evaluateWithObject:urlString]) { + NSString *query = [urlString substringFromIndex:[urlString rangeOfString:@"?"].location]; + NSString *regularExpStr = @"\\{[^\\}]*\\}"; + NSRegularExpression *regularExp = [[NSRegularExpression alloc] initWithPattern:regularExpStr options:NSRegularExpressionCaseInsensitive error:nil]; + NSArray *resultArr = [regularExp matchesInString:query options:NSMatchingReportProgress range:NSMakeRange(0, query.length)]; + for (NSTextCheckingResult *result in resultArr) { + NSString *subStr = [query substringWithRange:result.range]; + NSString *replace = [subStr substringWithRange:NSMakeRange(1, subStr.length-2)]; + if ([replace containsString:@"|"]) { + NSArray *arr = [replace componentsSeparatedByString:@"|"]; + if (arr.count == 2) { + replace = arr[1]; + } else { + replace = arr[0]; + } + } + NSString *value = e_preference_get(replace); + if (!value) { + value = @""; + } + url = [url stringByReplacingOccurrencesOfString:subStr withString:value]; + } + } + url = [url stringByReplacingOccurrencesOfString:@"eagle://file" withString:[@"file://" stringByAppendingString:e_path_cache]]; + if ([url hasPrefix:@"file://"]) { + if (UIDevice.currentDevice.systemVersion.floatValue >= 9.0) { + [webView loadFileURL:[NSURL URLWithString:url] allowingReadAccessToURL:[NSURL fileURLWithPath:e_path_cache]]; + } else { + e_log(@"%@", @"系统版本过低,无法使用本地h5"); + } + } else { + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]]; + [webView loadRequest:request]; + } + } @catch (NSException *exception) { + e_log(@"%@: %@", exception.name, exception.reason); + } +} + + +- (void)registerDefault { + //启动页面 + [self registerHandler:kStartPageMessage handler:^(id data, WVJBResponseCallback responseCallback) { + [WKWebViewJsBridge handlerPage:data callback:responseCallback]; + }]; + + //调用方法 + [self registerHandler:kStartActionMessage handler:^(id data, WVJBResponseCallback responseCallback) { + [WKWebViewJsBridge handlerAction:data callback:responseCallback]; + }]; + //获取数据 + [self registerHandler:kGetMessage handler:^(id data, WVJBResponseCallback responseCallback) { + if (![data isKindOfClass:NSArray.class]) { + return; + } + NSArray *arr = data; + if (e_isEmpty(arr)) { + responseCallback(@{}); + return; + } + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + for (NSString *key in arr) { + id value = e_preference_get(key); + if (value) { + dict[key] = value; + } + } + responseCallback(dict); + }]; + //保存数据 + [self registerHandler:kSetMessage handler:^(id data, WVJBResponseCallback responseCallback) { + if (![data isKindOfClass:NSDictionary.class]) { + return; + } + NSDictionary *dict = data; + [dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + e_preference_set(key, obj); + }]; + }]; + //关闭当前h5 + [self registerHandler:kCloseMessage handler:^(id data, WVJBResponseCallback responseCallback) { + UIViewController *con = [_webView viewController]; + if (con.navigationController) { + if (con == con.navigationController.viewControllers[0]) { + [con.navigationController dismissViewControllerAnimated:YES completion:nil]; + } else { + [con.navigationController popViewControllerAnimated:YES]; + } + } else { + [con dismissViewControllerAnimated:YES completion:nil]; + } + }]; +} + ++ (void) handlerPage:(id)data callback:(WVJBResponseCallback)callback { + if (![data isKindOfClass:NSDictionary.class]) { + return; + } + NSString *pageName = data[@"pageName"][@"ios"]; + if (e_isEmpty(pageName)) { + return; + } + @try { + UIViewController *desCon = nil; + if ([pageName containsString:split]) { + NSArray *arr = [pageName componentsSeparatedByString:split]; + NSString *storyboardName = arr[0]; + NSString *storyboardId = arr[1]; + if ([@"init" isEqualToString:storyboardId]) { + desCon = e_storyboard_rootController(storyboardName); + } else { + desCon = e_storyboard_controllerWithId(storyboardName, storyboardId); + } + } else { + Class clazz = NSClassFromString(pageName); + desCon = [[clazz alloc] init]; + } + if (!desCon) { + return; + } + NSString *startType = data[@"startType"]; + BOOL isBack = NO; + if ([@"back" isEqualToString:startType]) { + UIViewController *backCon = e_backToController(desCon.class); + if (backCon) { + isBack = YES; + desCon = backCon; + } + } + NSDictionary *pageData = data[@"data"]; + NSString *dataClassName = data[@"dataClass"][@"ios"]; + if (e_isEmpty(dataClassName) && e_isNotEmpty(pageData)) { + if ([desCon isKindOfClass:UINavigationController.class]) { + [((UINavigationController *)desCon).viewControllers.firstObject setValuesForKeysWithDictionary:pageData]; + } else { + [desCon setValuesForKeysWithDictionary:pageData]; + } + } else if (e_isNotEmpty(pageData)){ + NSArray *arr = [dataClassName componentsSeparatedByString:split]; + if (arr.count == 2) { + NSString *objectKey = arr[0]; + id dataObject = [[NSClassFromString(arr[1]) alloc] init]; + [dataObject setValuesForKeysWithDictionary:pageData]; + if ([desCon isKindOfClass:UINavigationController.class]) { + [((UINavigationController *)desCon).viewControllers.firstObject setValue:dataObject forKey:objectKey]; + } else { + [desCon setValue:dataObject forKey:objectKey]; + } + } + } + if (!isBack) { + //启动页面 desCon + UIViewController *topController = e_topController; + if ([topController isKindOfClass:UINavigationController.class] && ![desCon isKindOfClass:UINavigationController.class]) { + [(UINavigationController *)topController pushViewController:desCon animated:YES]; + } else { + [topController presentViewController:desCon animated:YES completion:nil]; + } + } + if (callback) { + callback(nil); + } + } @catch (NSException *exception) { + e_log(@"%@: %@", exception.name, exception.reason); + } +} + ++ (void)handlerAction:(id)data callback:(WVJBResponseCallback)callback { + if (![data isKindOfClass:NSDictionary.class]) { + return; + } + @try { + NSString *action = data[@"action"][@"ios"]; + if (e_isEmpty(action)) { + return; + } + NSArray *arr = [action componentsSeparatedByString:split]; + NSString *className = arr[0]; + NSString *methodName = arr[arr.count -1]; + NSString *instanceName = nil; + if (arr.count == 3) { + instanceName = arr[1]; + } + Class class = NSClassFromString(className); + if (!class) { + return; + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + id obj = class; + if (e_isNotEmpty(instanceName)) { + if ([@"()" isEqualToString:instanceName]) { + obj = [[class alloc] init]; + } else if ([class respondsToSelector:NSSelectorFromString(instanceName)]){ + obj = [class performSelector:NSSelectorFromString(instanceName)]; + } else { + return; + } + } + SEL method = NSSelectorFromString(methodName); + if (![obj respondsToSelector:method]) { + return; + } + + id methodData = data[@"data"]; + NSArray *dataArr = nil; + if (e_isEmpty(methodData)) { + dataArr = @[]; + } else { + if ([methodData isKindOfClass:NSDictionary.class]) { + id iosData = methodData[@"ios"]; + if ([iosData isKindOfClass:NSArray.class]) { + dataArr = iosData; + } else { + dataArr = @[iosData]; + } + } else if ([methodData isKindOfClass:NSArray.class]){ + dataArr = methodData; + } + } + // 方法签名(方法的描述) + NSMethodSignature *signature = [class methodSignatureForSelector:method]; + if (!signature) { + signature = [class instanceMethodSignatureForSelector:method]; + } + if (!signature) { + return; + } + // NSInvocation : 利用一个NSInvocation对象包装一次方法调用(方法调用者、方法名、方法参数、方法返回值) + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; + invocation.target = obj; + invocation.selector = method; + // 设置参数 + NSInteger paramsCount = signature.numberOfArguments - 2; + paramsCount = MIN(paramsCount, dataArr.count); + for (NSInteger i = 0; i < paramsCount; i++) { + id object = dataArr[i]; + if ([object isKindOfClass:[NSNull class]]) continue; + [invocation setArgument:&object atIndex:i + 2]; + } + + // 调用方法 + [invocation invoke]; + id result = nil; + void *tempResultSet; + if (signature.methodReturnLength) { + [invocation getReturnValue:&tempResultSet]; + result = (__bridge id)(tempResultSet); + } + if (result && callback) { + callback(result); + } + } @catch (NSException *exception) { + e_log(@"%@: %@", exception.name, exception.reason); + } +#pragma clang diagnostic pop + +} + +- (void)send:(id)data { + [self send:data responseCallback:nil]; +} + +- (void)send:(id)data responseCallback:(WVJBResponseCallback)responseCallback { + [self sendData:data responseCallback:responseCallback handlerName:nil]; +} + +- (void)callHandler:(NSString *)handlerName { + [self callHandler:handlerName data:nil responseCallback:nil]; +} + +- (void)callHandler:(NSString *)handlerName data:(id)data { + [self callHandler:handlerName data:data responseCallback:nil]; +} + +- (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback { + [self sendData:data responseCallback:responseCallback handlerName:handlerName]; +} + +- (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler { + self.messageHandlers[handlerName] = [handler copy]; +} + +- (void)removeHandler:(NSString *)handlerName { + [self.messageHandlers removeObjectForKey:handlerName]; +} + +- (void)reset { + self.startupMessageQueue = [NSMutableArray array]; + self.responseCallbacks = [NSMutableDictionary dictionary]; + _uniqueId = 0; +} + +- (void)setWebViewDelegate:(id)webViewDelegate { + _webViewDelegate = webViewDelegate; +} + +/* Internals + ***********/ +- (void)dealloc { + self.startupMessageQueue = nil; + self.responseCallbacks = nil; + self.messageHandlers = nil; + + _webView = nil; + _webViewDelegate = nil; + _webView.navigationDelegate = nil; +} + + +/* WKWebView Specific Internals + ******************************/ + +- (void) _setupInstance:(WKWebView*)webView { + _webView = webView; + _webView.navigationDelegate = self; +} + +- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFinishNavigation:)]) { + [strongDelegate webView:webView didFinishNavigation:navigation]; + } +} + + +- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler { + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationResponse:decisionHandler:)]) { + [strongDelegate webView:webView decidePolicyForNavigationResponse:navigationResponse decisionHandler:decisionHandler]; + } + else { + decisionHandler(WKNavigationResponsePolicyAllow); + } +} + +- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler { + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didReceiveAuthenticationChallenge:completionHandler:)]) { + [strongDelegate webView:webView didReceiveAuthenticationChallenge:challenge completionHandler:completionHandler]; + } else { + completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); + } +} + +- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { + if (webView != _webView) { return; } + NSURL *url = navigationAction.request.URL; + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + WKNavigationActionPolicy policy = WKNavigationActionPolicyAllow; + if ([self isWebViewJavascriptBridgeURL:url]) { + policy = WKNavigationActionPolicyCancel; + if ([self isInitAppMessageURL:url]) { + self.isInit = YES; + [self jsInit]; + } else if([self isReturnMessageURL:url]){ + [self flushMessageQueue:[url.path substringFromIndex:1]]; + } else if([kStartPageMessage.lowercaseString isEqualToString:url.host.lowercaseString] + ||[kStartActionMessage.lowercaseString isEqualToString:url.host.lowercaseString]) { + [WKWebViewJsBridge handlerUrl:url.absoluteString]; + } else if ([@"file" isEqualToString:url.host.lowercaseString]) { + [WKWebViewJsBridge loadUrl:webView url:url.absoluteString]; + } else { + policy = WKNavigationActionPolicyAllow; + } + } + + if (policy == WKNavigationActionPolicyAllow && strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)]) { + [_webViewDelegate webView:webView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler]; + } else { + decisionHandler(policy); + } +} + +- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didStartProvisionalNavigation:)]) { + [strongDelegate webView:webView didStartProvisionalNavigation:navigation]; + } +} + + +- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailNavigation:withError:)]) { + [strongDelegate webView:webView didFailNavigation:navigation withError:error]; + } +} + +- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error { + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailProvisionalNavigation:withError:)]) { + [strongDelegate webView:webView didFailProvisionalNavigation:navigation withError:error]; + } +} + +- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand { + [_webView evaluateJavaScript:javascriptCommand completionHandler:nil]; + return NULL; +} + +static int logMaxLength = 1000; + ++ (void)setLogMaxLength:(int)length { logMaxLength = length;} + +- (id)init { + if (self = [super init]) { + self.messageHandlers = [NSMutableDictionary dictionary]; + self.startupMessageQueue = [NSMutableArray array]; + self.responseCallbacks = [NSMutableDictionary dictionary]; + _uniqueId = 0; + } + return self; +} + +- (void)sendData:(id)data responseCallback:(WVJBResponseCallback)responseCallback handlerName:(NSString*)handlerName { + NSMutableDictionary* message = [NSMutableDictionary dictionary]; + + if (data) { + message[@"data"] = data; + } + + if (responseCallback) { + NSString* callbackId = [NSString stringWithFormat:@"app_cb_%ld", ++_uniqueId]; + self.responseCallbacks[callbackId] = [responseCallback copy]; + message[@"callbackId"] = callbackId; + } + + if (handlerName) { + message[@"handlerName"] = handlerName; + } + [self _queueMessage:message]; +} + +- (void)flushMessageQueue:(NSString *)messageQueueString{ + if (messageQueueString == nil || messageQueueString.length == 0) { + return; + } + id message = [self _deserializeMessageJSON:messageQueueString]; + if (![message isKindOfClass:[NSDictionary class]]) { + return; + } + [self _log:@"接收到js的消息" json:message]; + + NSString* responseId = message[@"responseId"]; + if (responseId) { + WVJBResponseCallback responseCallback = _responseCallbacks[responseId]; + responseCallback(message[@"responseData"]); + [self.responseCallbacks removeObjectForKey:responseId]; + } else { + WVJBResponseCallback responseCallback = NULL; + NSString* callbackId = message[@"callbackId"]; + if (callbackId) { + responseCallback = ^(id responseData) { + if (responseData == nil) { + responseData = [NSNull null]; + } + + NSDictionary* msg = @{ @"responseId":callbackId, @"responseData":responseData }; + [self _queueMessage:msg]; + }; + } else { + responseCallback = ^(id ignoreResponseData) { + // Do nothing + }; + } + + WVJBHandler handler = self.messageHandlers[message[@"handlerName"]]; + + if (!handler) { + return; + } + + handler(message[@"data"], responseCallback); + } +} + +- (void)jsInit { + if (self.startupMessageQueue) { + NSArray* queue = self.startupMessageQueue; + self.startupMessageQueue = nil; + for (id queuedMessage in queue) { + [self _dispatchMessage:queuedMessage]; + } + } +} + +- (BOOL)isWebViewJavascriptBridgeURL:(NSURL*)url { + if (![self isSchemeMatch:url]) { + return NO; + } + return YES; +} + +- (BOOL)isSchemeMatch:(NSURL*)url { + NSString* scheme = url.scheme.lowercaseString; + return [scheme isEqualToString:kProtocolScheme]; +} + +- (BOOL)isQueueMessageURL:(NSURL*)url { + NSString* host = url.host.lowercaseString; + return [self isSchemeMatch:url] && [host isEqualToString:kQueueHasMessage]; +} + +- (BOOL)isReturnMessageURL:(NSURL*)url { + NSString* host = url.host.lowercaseString; + return [self isSchemeMatch:url] && [host isEqualToString:kReturnMessage]; +} + +- (BOOL)isInitAppMessageURL:(NSURL*)url { + NSString* host = url.host.lowercaseString; + return [self isSchemeMatch:url] && [host isEqualToString:kInitAppMessage]; +} + +- (void)_queueMessage:(NSDictionary*)message { + if (self.startupMessageQueue) { + [self.startupMessageQueue addObject:message]; + } else { + [self _dispatchMessage:message]; + } +} + +- (void)_dispatchMessage:(NSDictionary*)message { + NSString *messageJSON = [self _serializeMessage:message pretty:NO]; + [self _log:@"给js发送消息" json:messageJSON]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\'" withString:@"\\\'"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\r" withString:@"\\r"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\f" withString:@"\\f"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2028" withString:@"\\u2028"]; + messageJSON = [messageJSON stringByReplacingOccurrencesOfString:@"\u2029" withString:@"\\u2029"]; + + NSString* javascriptCommand = [NSString stringWithFormat:@"app._handleMessageFromApp('%@');", messageJSON]; + if ([[NSThread currentThread] isMainThread]) { + [self _evaluateJavascript:javascriptCommand]; + } else { + dispatch_sync(dispatch_get_main_queue(), ^{ + [self _evaluateJavascript:javascriptCommand]; + }); + } +} + +- (NSString *)_serializeMessage:(id)message pretty:(BOOL)pretty{ + return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:message options:(NSJSONWritingOptions)(pretty ? NSJSONWritingPrettyPrinted : 0) error:nil] encoding:NSUTF8StringEncoding]; +} + +- (id)_deserializeMessageJSON:(NSString *)messageJSON { + return [NSJSONSerialization JSONObjectWithData:[messageJSON dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:nil]; +} + +- (void)_log:(NSString *)action json:(id)json { + if (![json isKindOfClass:[NSString class]]) { + json = [self _serializeMessage:json pretty:YES]; + } + if ([json length] > logMaxLength) { + e_log(@"js交互 %@: %@ [...]", action, [json substringToIndex:logMaxLength]); + } else { + e_log(@"js交互 %@: %@", action, json); + } +} + +@end + diff --git a/iOSProject/iOSProject/Classes/Preview2/model/LMJCountDownModel.m b/iOSProject/iOSProject/Classes/Preview2/model/LMJCountDownModel.m index 30e8a952..de42f22c 100644 --- a/iOSProject/iOSProject/Classes/Preview2/model/LMJCountDownModel.m +++ b/iOSProject/iOSProject/Classes/Preview2/model/LMJCountDownModel.m @@ -8,8 +8,7 @@ #import "LMJCountDownModel.h" @interface LMJCountDownModel() -/** <#digest#> */ -@property (weak, nonatomic) NSTimer *timer; + @end @implementation LMJCountDownModel diff --git a/iOSProject/iOSProject/Classes/Preview2/model/LMJH5_OCViewController.html b/iOSProject/iOSProject/Classes/Preview2/model/LMJH5_OCViewController.html index 3ae5be66..3dc51b1c 100755 --- a/iOSProject/iOSProject/Classes/Preview2/model/LMJH5_OCViewController.html +++ b/iOSProject/iOSProject/Classes/Preview2/model/LMJH5_OCViewController.html @@ -23,12 +23,13 @@ text-align: center; } - js call native api + window.webkit.messageHandlers diff --git a/iOSProject/iOSProject/Classes/Preview2/model/LMJOCJSHelper.m b/iOSProject/iOSProject/Classes/Preview2/model/LMJOCJSHelper.m index 12f1cf2b..0bc1cd45 100644 --- a/iOSProject/iOSProject/Classes/Preview2/model/LMJOCJSHelper.m +++ b/iOSProject/iOSProject/Classes/Preview2/model/LMJOCJSHelper.m @@ -21,10 +21,8 @@ - (void)userContentController:(WKUserContentController *)userContentController d { if (userContentController == self.webView.configuration.userContentController) { - if ([message.name isEqualToString:LMJOCJSHelperScriptMessageHandlerName1_]) { - NSDictionary *dict = message.body; dispatch_async(dispatch_get_main_queue(), ^{ @@ -37,28 +35,17 @@ - (void)userContentController:(WKUserContentController *)userContentController d NSString *functionName = dict[@"functionName"]; - NSString *js = [functionName stringByAppendingFormat:@"('%@')", @"OC里边得到 DeviceID: 9213876827468372"]; [self.webView evaluateJavaScript:js completionHandler:^(id _Nullable obj, NSError * _Nullable error) { - NSLog(@"%@", error); + NSLog(@"%@, %@",obj, error); }]; - } - - } - - }); - - } - - - } } diff --git a/iOSProject/iOSProject/Classes/Preview2/view/LMJCountDownCell.m b/iOSProject/iOSProject/Classes/Preview2/view/LMJCountDownCell.m index 4af92d94..7446ea5f 100644 --- a/iOSProject/iOSProject/Classes/Preview2/view/LMJCountDownCell.m +++ b/iOSProject/iOSProject/Classes/Preview2/view/LMJCountDownCell.m @@ -14,11 +14,12 @@ - (void)setCountDownModel:(LMJCountDownModel *)countDownModel { _countDownModel = countDownModel; self.imageView.image = countDownModel.pruductImage; -// self.textLabel.text = countDownModel.productName; - self.userInteractionEnabled = !(countDownModel.date <= CFAbsoluteTimeGetCurrent()); + self.userInteractionEnabled = (countDownModel.date <= 0); - self.textLabel.text = [NSString stringWithFormat:@"%lu", (NSUInteger)countDownModel.date]; + self.textLabel.text = [NSString stringWithFormat:@"%.0lf", countDownModel.date]; + + self.textLabel.text = countDownModel.date <= 0 ? @"End" : [NSString stringWithFormat:@"%zd", (NSUInteger)countDownModel.date]; } diff --git a/iOSProject/iOSProject/Classes/Preview2/view/LMJUpLoadImageCell.m b/iOSProject/iOSProject/Classes/Preview2/view/LMJUpLoadImageCell.m index bb417082..2e65546b 100644 --- a/iOSProject/iOSProject/Classes/Preview2/view/LMJUpLoadImageCell.m +++ b/iOSProject/iOSProject/Classes/Preview2/view/LMJUpLoadImageCell.m @@ -26,12 +26,12 @@ - (void)setupUIOnce } - (IBAction)deleteClick:(UIButton *)sender { - LMJWeakSelf(self); + LMJWeak(self); !self.deletePhotoClick ?: self.deletePhotoClick(weakself.photoImage); } - (IBAction)addClick:(UIButton *)sender { - LMJWeakSelf(self); + LMJWeak(self); !self.addPhotoClick ?: self.addPhotoClick(weakself); } diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJAutoLayoutViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJAutoLayoutViewController.m index 42d62dd6..2565a546 100644 --- a/iOSProject/iOSProject/Classes/Preview3/LMJAutoLayoutViewController.m +++ b/iOSProject/iOSProject/Classes/Preview3/LMJAutoLayoutViewController.m @@ -62,7 +62,6 @@ - (void)viewDidLoad { // 添加右边约束:redView的右边 == blueView的右边 NSLayoutConstraint *rightConstraint2 = [NSLayoutConstraint constraintWithItem:redView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:blueView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; [self.view addConstraint:rightConstraint2]; - } diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJCalendarViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJCalendarViewController.m index 00eba4fb..b3428b39 100644 --- a/iOSProject/iOSProject/Classes/Preview3/LMJCalendarViewController.m +++ b/iOSProject/iOSProject/Classes/Preview3/LMJCalendarViewController.m @@ -7,50 +7,61 @@ // #import "LMJCalendarViewController.h" -#import "CalendarReminderManager.h" +#import "LMJEventTool.h" @interface LMJCalendarViewController () -/** <#digest#> */ -@property (weak, nonatomic) UIButton *addCalendarButton; - -/** <#digest#> */ -@property (weak, nonatomic) UIButton *deleteCalendarButton; - -/** <#digest#> */ -@property (weak, nonatomic) UILabel *desLabel; @end @implementation LMJCalendarViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + LMJWeak(self); - EKAlarm *alarm = [EKAlarm alarmWithRelativeOffset:2]; - EKAlarm *alarm1 = [EKAlarm alarmWithRelativeOffset:4]; + LMJEventModel *eventModel = [[LMJEventModel alloc] init]; +// @property (nonatomic, strong) NSString *title; //标题 +// @property (nonatomic, strong) NSString *location; //地点 + //@"yyyy-MM-dd HH:mm" +// @property (nonatomic, strong) NSString *startDateStr; //开始时间 +// @property (nonatomic, strong) NSString *endDateStr; //结束时间 +// @property (nonatomic, assign) BOOL allDay; //是否全天 +// @property (nonatomic, strong) NSString *notes; //备注 +// if (alarmStr.length == 0) { +// alarmTime = 0; +// } else if ([alarmStr isEqualToString:@"不提醒"]) { +// alarmTime = 0; +// } else if ([alarmStr isEqualToString:@"1分钟前"]) { +// alarmTime = 60.0 * -1.0f; +// } else if ([alarmStr isEqualToString:@"10分钟前"]) { +// alarmTime = 60.0 * -10.f; +// } else if ([alarmStr isEqualToString:@"30分钟前"]) { +// alarmTime = 60.0 * -30.f; +// } else if ([alarmStr isEqualToString:@"1小时前"]) { +// alarmTime = 60.0 * -60.f; +// } else if ([alarmStr isEqualToString:@"1天前"]) { +// alarmTime = 60.0 * - 60.f * 24; +// @property (nonatomic, strong) NSString *alarmStr; //提醒 + eventModel.title = @"eventModel标题"; + eventModel.location = @"BeiJing"; + eventModel.startDateStr = @"2018-04-05 19:10"; + eventModel.endDateStr = @"2018-04-05 20:10"; + eventModel.allDay = YES; + eventModel.notes = @"eventModel备注"; + eventModel.alarmStr = @"1小时前"; self.addItem([LMJWordItem itemWithTitle:@"事件标题: " subTitle:@"" itemOperation:nil]) .addItem([LMJWordItem itemWithTitle:@"增加日历事件" subTitle: nil itemOperation:^(NSIndexPath *indexPath) { - [CalendarReminderManager addEventWithTitle:@"我是增加的日历标题" notes:@"我是备注" location:@"北京" startDate:[[NSDate date] dateByAddingDays:1] endDate:[[NSDate date] dateByAddingDays:2] alarms:@[alarm, alarm1] URL:[NSURL URLWithString:@"https://www.github.com/njhu"] availability:EKEventAvailabilityBusy successBlock:^(NSString *eventIdentifier) { - - [weakself.view makeToast:@"增加成功"]; - - [[NSUserDefaults standardUserDefaults] setObject:eventIdentifier forKey:@"CalendarReminderManager_events"]; - - } failBlock:^(NSError *error) { - - [weakself.view makeToast:error.localizedFailureReason]; - - }]; + [[LMJEventTool sharedEventTool] createEventWithEventModel:eventModel]; + [weakself.view makeToast:@"增加了"]; }]) .addItem([LMJWordItem itemWithTitle:@"查找" subTitle: nil itemOperation:^(NSIndexPath *indexPath) { - EKEvent *event = [CalendarReminderManager fetchEventWithIdentifer:[[NSUserDefaults standardUserDefaults] objectForKey:@"CalendarReminderManager_events"]]; + EKEvent *event = [[LMJEventTool sharedEventTool] getEventWithEKEventModel:eventModel]; weakself.sections.firstObject.items.firstObject.subTitle = event.title; @@ -59,7 +70,7 @@ - (void)viewDidLoad { }]) .addItem([LMJWordItem itemWithTitle:@"删除" subTitle:nil itemOperation:^(NSIndexPath *indexPath) { - BOOL isDeleted = [CalendarReminderManager deleteEventWithEventIdentifier:[[NSUserDefaults standardUserDefaults] objectForKey:@"CalendarReminderManager_events"]]; + BOOL isDeleted = [[LMJEventTool sharedEventTool] deleteEvent:eventModel]; if (isDeleted) { [weakself.view makeToast:@"删除成功"]; diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJCuteFlowLayoutViewController.h b/iOSProject/iOSProject/Classes/Preview3/LMJCuteFlowLayoutViewController.h new file mode 100644 index 00000000..820afdf5 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/LMJCuteFlowLayoutViewController.h @@ -0,0 +1,13 @@ +// +// LMJCuteFlowLayoutViewController.h +// iOSProject +// +// Created by HuXuPeng on 2018/3/18. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJCollectionViewController.h" + +@interface LMJCuteFlowLayoutViewController : LMJCollectionViewController + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJCuteFlowLayoutViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJCuteFlowLayoutViewController.m new file mode 100644 index 00000000..22ffd505 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/LMJCuteFlowLayoutViewController.m @@ -0,0 +1,132 @@ +// +// LMJCuteFlowLayoutViewController.m +// iOSProject +// +// Created by HuXuPeng on 2018/3/18. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJCuteFlowLayoutViewController.h" +#import "LMJGirdLayout.h" +#import "LMJCircleLayout.h" +#import "LMJLineFlowLayout.h" + +@interface LMJCuteFlowLayoutViewController () +@property (nonatomic, strong) NSMutableArray *images; +@end + +@implementation LMJCuteFlowLayoutViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.fd_interactivePopDisabled = YES; + UICollectionViewLayout *lineFlowLayout = [[LMJCircleLayout alloc] init]; + self.collectionView.collectionViewLayout = lineFlowLayout; + self.collectionView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight * 0.8); + + UILabel *label = [[UILabel alloc] init]; + label.text = @"点我切换布局"; + label.textColor = [UIColor blackColor]; + label.font = [UIFont boldSystemFontOfSize:30]; + [self.view addSubview:label]; + [label sizeToFit]; + label.textAlignment = NSTextAlignmentCenter; + label.frame = CGRectMake(0, CGRectGetMaxY(self.collectionView.frame) + 10, kScreenWidth, label.height); +} + + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + + if([self.collectionView.collectionViewLayout isKindOfClass:[LMJGirdLayout class]]) + { + LMJLineFlowLayout *lineLayout = [[LMJLineFlowLayout alloc] init]; + lineLayout.itemSize = CGSizeMake(100, 100); + [self.collectionView setCollectionViewLayout:lineLayout animated:YES]; + + }else if ([self.collectionView.collectionViewLayout isKindOfClass:[LMJCircleLayout class]]) + { + LMJGirdLayout *gird = [[LMJGirdLayout alloc] init]; + [self.collectionView setCollectionViewLayout:gird animated:YES]; + + } else { + + [self.collectionView setCollectionViewLayout:[[LMJCircleLayout alloc] initWithDelegate:self] animated:YES]; + + } + +} + +- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView +{ + return 1; +} + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section +{ + return self.images.count; +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath +{ + UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"UICollectionViewCell" forIndexPath:indexPath]; + + cell.contentView.layer.contents = (id)self.images[indexPath.item].CGImage; + + cell.contentView.layer.borderColor = [UIColor whiteColor].CGColor; + cell.contentView.layer.borderWidth = 5; + + return cell; +} + + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath +{ + [self.images removeObjectAtIndex:indexPath.item]; + [self.collectionView deleteItemsAtIndexPaths:@[indexPath]]; +} + +- (NSMutableArray *)images +{ + if(_images == nil) + { + _images = [NSMutableArray array]; + + for (NSInteger i = 1; i < 21; i++) { + + [_images addObject:[UIImage imageNamed:[NSString stringWithFormat:@"%zd", i]]]; + } + } + return _images; +} + + +#pragma mark - LMJCircleLayoutDelegate +-(CGFloat)circleLayout:(LMJCircleLayout *)circleLayout collectionView:(UICollectionView *)collectionView radiusForItemAtIndexPath:(NSIndexPath *)indexPath { + return 100; +} +- (CGSize)circleLayout:(LMJCircleLayout *)circleLayout collectionView:(UICollectionView *)collectionView sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + return CGSizeMake(62, 62); +} + + +#pragma mark - LMJNavUIBaseViewControllerDataSource + +/** 导航条左边的按钮 */ +- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar +{ + [leftButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; + + return [UIImage imageNamed:@"NavgationBar_blue_back"]; +} + +#pragma mark - LMJNavUIBaseViewControllerDelegate +/** 左边的按钮的点击 */ +-(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar +{ + [self.navigationController popViewControllerAnimated:YES]; +} + + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJDragTableViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJDragTableViewController.m index 1a75889e..3313cc95 100644 --- a/iOSProject/iOSProject/Classes/Preview3/LMJDragTableViewController.m +++ b/iOSProject/iOSProject/Classes/Preview3/LMJDragTableViewController.m @@ -34,44 +34,49 @@ - (void)viewDidLoad { self.fd_interactivePopDisabled = YES; - LMJWeakSelf(self); + LMJWeak(self); [self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([UICollectionViewCell class])]; - [self.collectionView addLongPressGestureRecognizer:^(UILongPressGestureRecognizer *recognizer, NSString *gestureId) { if (recognizer.state == UIGestureRecognizerStateBegan) { // 获取手势的触摸点 CGPoint curP = [recognizer locationInView:weakself.collectionView]; - - UICollectionViewCell *onCell = [weakself.collectionView cellForItemAtIndexPath:[weakself.collectionView indexPathForItemAtPoint:curP]]; + + // cur indexPath + NSIndexPath *curIndexPath = [weakself.collectionView indexPathForItemAtPoint:curP]; + if (!curIndexPath) { + return ; + } + + UICollectionViewCell *onCell = [weakself.collectionView cellForItemAtIndexPath:curIndexPath]; if (!onCell) { return ; } + // 为移动做准备 + weakself.beginPoint = curP; + // 记录最后一个 IndexPath + weakself.lastChangeIndexPath = curIndexPath; weakself.drawImageView.transform = CGAffineTransformIdentity; - weakself.drawImageView.image = [onCell snapshotImage]; weakself.drawImageView.frame = onCell.frame; + [UIView animateWithDuration:0.5 animations:^{ - onCell.alpha = 0; weakself.drawImageView.transform = CGAffineTransformMakeScale(1.1, 1.1); weakself.drawImageView.alpha = 1; -// weakself.drawImageView.center = curP; + onCell.alpha = 0; + } completion:^(BOOL finished) { - - onCell.hidden = YES; + + // 在这里控制隐藏 + // 防止手指刚按下就抬起来 有 bug , 注释掉 + // onCell.hidden = YES; }]; - - // 为移动做准备 - weakself.beginPoint = [recognizer locationInView:weakself.collectionView]; - - // 记录最后一个 IndexPath - weakself.lastChangeIndexPath = [weakself.collectionView indexPathForItemAtPoint:curP]; } if (recognizer.state == UIGestureRecognizerStateChanged) { @@ -79,34 +84,45 @@ - (void)viewDidLoad { if (!weakself.lastChangeIndexPath) { return; } + UICollectionViewCell *lastChangeIndexPathCell = [weakself.collectionView cellForItemAtIndexPath:weakself.lastChangeIndexPath]; + if (!lastChangeIndexPathCell) { + return; + } + // 在这里控制隐藏 + // 防止手指刚按下就抬起来 + lastChangeIndexPathCell.hidden = YES; // 移动视图 // 获取手势的移动,也是相对于最开始的位置 - CGPoint curPoint = [recognizer locationInView:weakself.collectionView]; + CGPoint curPoint = [recognizer locationInView:weakself.collectionView]; CGPoint translation = CGPointMake(curPoint.x - weakself.beginPoint.x, curPoint.y - weakself.beginPoint.y); - - weakself.drawImageView.transform = CGAffineTransformMakeTranslation(translation.x, translation.y); - weakself.drawImageView.transform = CGAffineTransformScale(weakself.drawImageView.transform, 1.1, 1.1); + + CGAffineTransform scale = CGAffineTransformMakeScale(1.1, 1.1); + weakself.drawImageView.transform = CGAffineTransformTranslate(scale, translation.x, translation.y); + [weakself.collectionView bringSubviewToFront:weakself.drawImageView]; // 获取当前的 indexPath NSIndexPath *curIndexPath = [weakself.collectionView indexPathForItemAtPoint:curPoint]; + if (!curIndexPath) { + return; + } + UICollectionViewCell *onCell = [weakself.collectionView cellForItemAtIndexPath:curIndexPath]; + if (!onCell) { + return; + } + // 更换 cell if (curIndexPath && (curIndexPath.item != weakself.lastChangeIndexPath.item)) { - - [weakself.datas exchangeObjectAtIndex:curIndexPath.item withObjectAtIndex:weakself.lastChangeIndexPath.item]; - + // 把 cell移动到当前位置 [weakself.collectionView moveItemAtIndexPath:weakself.lastChangeIndexPath toIndexPath:curIndexPath]; - // 记录当前的 indexPath weakself.lastChangeIndexPath = curIndexPath; - } - } if (recognizer.state == UIGestureRecognizerStateEnded) { @@ -116,31 +132,25 @@ - (void)viewDidLoad { } UICollectionViewCell *beginCell = [weakself.collectionView cellForItemAtIndexPath:weakself.lastChangeIndexPath]; + [weakself.collectionView bringSubviewToFront:beginCell]; + // 从当前的位置移动过去 CGRect curDragFrame = weakself.drawImageView.frame; + CGRect targetFrame = beginCell.frame; beginCell.frame = curDragFrame; + weakself.drawImageView.alpha = 0; beginCell.alpha = 1; beginCell.hidden = NO; - weakself.drawImageView.alpha = 0; [UIView animateWithDuration:0.5 animations:^{ - beginCell.frame = targetFrame; - } completion:^(BOOL finished) { - weakself.lastChangeIndexPath = nil; - }]; - - } - - }]; - } #pragma mark - delegate @@ -199,7 +209,6 @@ - (UIImageView *)drawImageView for (NSInteger i = 0; i < 20; i++) { [_datas addObject:[NSString stringWithFormat:@"%zd", i]]; } - } return _datas; } diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJFingerCheckViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJFingerCheckViewController.m index d5943d4c..7778d3fe 100644 --- a/iOSProject/iOSProject/Classes/Preview3/LMJFingerCheckViewController.m +++ b/iOSProject/iOSProject/Classes/Preview3/LMJFingerCheckViewController.m @@ -7,7 +7,7 @@ // #import "LMJFingerCheckViewController.h" -#import +#import "TDTouchID.h" @interface LMJFingerCheckViewController () @@ -19,7 +19,7 @@ - (void)viewDidLoad { [super viewDidLoad]; //使用TDButton更方便 https://github.com/greezi/TDButton - LMJWeakSelf(self); + LMJWeak(self); self.addItem([LMJWordItem itemWithTitle:@"指纹解锁" subTitle:nil itemOperation:^(NSIndexPath *indexPath) { [weakself touchVerification]; }]); @@ -31,9 +31,7 @@ - (void)viewDidLoad { */ - (void)touchVerification { - TDTouchID *touchID = [[TDTouchID alloc] init]; - - [touchID td_showTouchIDWithDescribe:nil BlockState:^(TDTouchIDState state, NSError *error) { + [TDTouchID td_showTouchIDWithDescribe:nil BlockState:^(TDTouchIDState state, NSError *error) { if (state == TDTouchIDStateNotSupport) { //不支持TouchID @@ -48,6 +46,10 @@ - (void)touchVerification { } else if (state == TDTouchIDStateInputPassword) { //用户选择手动输入密码 [self.view makeToast:@"当前设备不支持TouchID, 请输入密码"]; + }else { +// localizedFailureReason +// localizedDescription + [self.view makeToast:error.localizedDescription]; } // ps:以上的状态处理并没有写完全! diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJNavBarFadeViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJNavBarFadeViewController.m index 33ba378d..bab95739 100644 --- a/iOSProject/iOSProject/Classes/Preview3/LMJNavBarFadeViewController.m +++ b/iOSProject/iOSProject/Classes/Preview3/LMJNavBarFadeViewController.m @@ -10,6 +10,9 @@ #import "LMJExpandHeader.h" @interface LMJNavBarFadeViewController () +{ + UIStatusBarStyle _statusBarStyle; +} /** <#digest#> */ @property (nonatomic, strong) LMJExpandHeader *expandHander; @end @@ -19,7 +22,6 @@ @implementation LMJNavBarFadeViewController - (void)viewDidLoad { [super viewDidLoad]; - [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:NSStringFromClass([UITableViewCell class])]; UIEdgeInsets contentInset = self.tableView.contentInset; @@ -33,7 +35,7 @@ - (void)viewDidLoad { _expandHander = [LMJExpandHeader expandWithScrollView:self.tableView expandView:imageView]; - // 不透明 + _statusBarStyle = UIStatusBarStyleLightContent; } @@ -48,7 +50,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.textLabel.text = [NSString stringWithFormat:@"第%zd行", indexPath.row]; - return cell; } @@ -73,7 +74,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView self.lmj_navgationBar.backgroundColor = [UIColor clearColor]; - [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; + _statusBarStyle = UIStatusBarStyleLightContent; }else if (contentOffset.y > kNavBarHeight && contentOffset.y < 0) { @@ -83,7 +84,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView self.lmj_navgationBar.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:(1 - contentOffset.y / kNavBarHeight)]; - [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; + _statusBarStyle = UIStatusBarStyleLightContent; }else if (contentOffset.y >= 0) { @@ -92,17 +93,25 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView rightBtn.selected = YES; self.lmj_navgationBar.backgroundColor = [UIColor whiteColor]; - [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault; + _statusBarStyle = UIStatusBarStyleDefault; } + [self setNeedsStatusBarAppearanceUpdate]; } #pragma mark - LMJNavUIBaseViewControllerDataSource -- (UIStatusBarStyle)navUIBaseViewControllerPreferStatusBarStyle:(LMJNavUIBaseViewController *)navUIBaseViewController -{ - return UIStatusBarStyleLightContent; +- (BOOL)prefersStatusBarHidden { + return NO; +} + +- (UIStatusBarStyle)preferredStatusBarStyle { + return _statusBarStyle; +} + +- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation { + return UIStatusBarAnimationFade; } /**头部标题*/ @@ -128,8 +137,6 @@ - (BOOL)lmjNavigationIsHideBottomLine:(LMJNavigationBar *)navigationBar /** 导航条左边的按钮 */ - (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar { - -// tabBar_new_click_icon [leftButton setImage:[UIImage imageNamed:@"tabBar_new_click_icon"] forState:UIControlStateSelected]; @@ -138,8 +145,6 @@ - (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBa /** 导航条右边的按钮 */ - (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar { -// mine-setting-icon - [rightButton setImage:[UIImage imageNamed:@"mine-setting-icon"] forState:UIControlStateSelected]; return [UIImage imageNamed:@"mine-setting-icon-click"]; diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJOfflineDownloadViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJOfflineDownloadViewController.m index 5b47fd77..537752a4 100644 --- a/iOSProject/iOSProject/Classes/Preview3/LMJOfflineDownloadViewController.m +++ b/iOSProject/iOSProject/Classes/Preview3/LMJOfflineDownloadViewController.m @@ -9,6 +9,7 @@ #import "LMJOfflineDownloadViewController.h" #import "MJDownload.h" #import "VIDMoviePlayerViewController.h" +#import "LMJSettingCell.h" @interface LMJOfflineDownloadViewController () @end @@ -18,57 +19,89 @@ @implementation LMJOfflineDownloadViewController - (void)viewDidLoad { [super viewDidLoad]; + // 数据 NSArray *urls = @[ - @"http://120.25.226.186:32812/resources/videos/minion_01.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_02.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_03.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_04.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_05.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_06.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_07.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_08.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_09.mp4", - @"http://120.25.226.186:32812/resources/videos/minion_10.mp4" + @"http://teaching.csse.uwa.edu.au/units/CITS4401/practicals/James1_files/SPMP1.pdf", + @"http://down.51rc.com/dwndoc/WrittenExamination/WrittenExperiences/dwn00006795.doc", + @"http://video1.remindchat.com/20190905/1gEji0Sv/mp4/1gEji0Sv.mp4", + @"https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_20mb.mp4", + @"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4", + @"http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4", ]; self.title = @"点击Cell开始/暂停下载"; - LMJWeakSelf(self); + LMJWeak(self); + // 遍历URL个数创建对应的模型数组 [urls enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + + // 获取下载文件对象 MJDownloadInfo *info = [[MJDownloadManager defaultManager] downloadInfoForURL:obj]; + NSString *subTitle = nil; + // 比对缓存是否下载完毕 if (info.state == MJDownloadStateCompleted) { subTitle = @"播放"; }else { - subTitle = @"进度: 0.0%"; + // 比对缓存进度 + CGFloat progress = ((CGFloat)info.totalBytesWritten) / info.totalBytesExpectedToWrite * 100; + subTitle = [NSString stringWithFormat:@"进度: %.2f%%, 点击开始", isnan(progress) ? 0 : progress]; } - self.addItem([LMJWordItem itemWithTitle:obj.lastPathComponent subTitle:subTitle itemOperation:^(NSIndexPath *indexPath) { + + // 添加数据模型, 和 绑定点击事件; + // 考虑到cell的复用问题, 这个cell点击的时候, 调用了模型的itemOperation回调, + self.addItem([LMJWordItem itemWithTitle:[obj.lastPathComponent substringToIndex:5] subTitle:subTitle itemOperation:^(NSIndexPath *indexPath) { + // 文件下载状态: 下载中和在下载队列排队, 最大3个下载 if (info.state == MJDownloadStateResumed || info.state == MJDownloadStateWillResume) { + + // 暂停 [[MJDownloadManager defaultManager] suspend:info.url]; - } else if (info.state == MJDownloadStateSuspened || info.state == MJDownloadStateNone) { + + // 获取进度 + CGFloat progress = ((CGFloat)info.totalBytesWritten) / info.totalBytesExpectedToWrite * 100; + + // 刷新模型 + weakself.sections.firstObject.items[indexPath.row].subTitle = [NSString stringWithFormat:@"暂停中..进度: %.2f%%", isnan(progress) ? 0 : progress]; + + // 刷新UI, 获取不到就不刷新UI, 下次滚动cell赋值模型的时候, 还会刷新模型数据 + ((LMJSettingCell *)[weakself.tableView cellForRowAtIndexPath:indexPath]).item = weakself.sections.firstObject.items[indexPath.row]; + + } else if (info.state == MJDownloadStateSuspened || info.state == MJDownloadStateNone) { // 暂停中和无状态; 开始下载 + + // 开始下载obj = Url [[MJDownloadManager defaultManager] download:obj progress:^(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite) { dispatch_async(dispatch_get_main_queue(), ^{ + // 更新模型 weakself.sections.firstObject.items[indexPath.row].subTitle = [NSString stringWithFormat:@"进度: %.2f%%", (CGFloat)totalBytesWritten / totalBytesExpectedToWrite * 100.0]; - [weakself.tableView reloadRowAtIndexPath:indexPath withRowAnimation:UITableViewRowAnimationNone]; + + // 更新视图; 获取不到cell就不刷新UI, 下次滚动cell然后赋值模型的时候, 还会刷新模型数据 + ((LMJSettingCell *)[weakself.tableView cellForRowAtIndexPath:indexPath]).item = weakself.sections.firstObject.items[indexPath.row]; }); } state:^(MJDownloadState state, NSString *file, NSError *error) { + // 主线程刷新UI dispatch_async(dispatch_get_main_queue(), ^{ if (state == MJDownloadStateCompleted) { + // 更新模型 weakself.sections.firstObject.items[indexPath.row].subTitle = @"播放"; - [weakself.tableView reloadRowAtIndexPath:indexPath withRowAnimation:UITableViewRowAnimationNone]; + // 更新视图; 获取不到cell就不刷新UI, 下次滚动cell然后赋值模型的时候, 还会刷新模型数据 + ((LMJSettingCell *)[weakself.tableView cellForRowAtIndexPath:indexPath]).item = weakself.sections.firstObject.items[indexPath.row]; } }); }]; - }else if (info.state == MJDownloadStateCompleted) { + + }else if (info.state == MJDownloadStateCompleted) { // 文件是下载完毕的状态 + // 跳转播放, 根据实际情况点击 VIDMoviePlayerViewController *playerVc = [[VIDMoviePlayerViewController alloc] init]; playerVc.videoURL = [NSString stringWithFormat:@"file://%@", info.file]; [weakself.navigationController pushViewController:playerVc animated:YES]; + } }]); }]; + // 添加2个操作模型, 绑定模型itemOperation操作 self.addItem([LMJWordItem itemWithTitle:@"全部开始" subTitle: nil itemOperation:^(NSIndexPath *indexPath) { [[MJDownloadManager defaultManager] resumeAll]; }]).addItem([LMJWordItem itemWithTitle:@"全部暂停" subTitle: nil itemOperation:^(NSIndexPath *indexPath) { diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJRSAViewController.h b/iOSProject/iOSProject/Classes/Preview3/LMJRSAViewController.h new file mode 100644 index 00000000..e7152055 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/LMJRSAViewController.h @@ -0,0 +1,13 @@ +// +// LMJRSAViewController.h +// iOSProject +// +// Created by HuXuPeng on 2018/3/28. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJStaticTableViewController.h" + +@interface LMJRSAViewController : LMJStaticTableViewController + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJRSAViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJRSAViewController.m new file mode 100644 index 00000000..b25311bd --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/LMJRSAViewController.m @@ -0,0 +1,353 @@ +// +// LMJRSAViewController.m +// iOSProject +// +// Created by HuXuPeng on 2018/3/28. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJRSAViewController.h" +#import "EncryptorTool.h" + +@interface LMJRSAViewController () +@property (nonatomic, copy) NSString *oriMsg; +/** DES */ +@property (nonatomic, copy) NSString *DESKey; +/** 私钥字符串 */ +@property (nonatomic, copy) NSString *javaPriKey; +/** 公钥字符串 */ +@property (nonatomic, copy) NSString *javaPubKey; + +/** <#digest#> */ +@property (nonatomic, strong) AFHTTPSessionManager *manager; +@end + +@implementation LMJRSAViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self setSteps]; + [self setUpKeys]; + + // Der 加密 P12 解密 + [self DerP12]; + + // Pem 加密 P12 解密 + [self PemP12]; + + // Pem 加密 Pem 解密 + [self PemPem]; + + // Der 加密 Pem 解密 + [self DerPem]; + + LMJWeak(self); + LMJWordItem *item = [LMJWordItem itemWithTitle:@"网络数据加密解密" subTitle:@"Demo" itemOperation:^(NSIndexPath *indexPath) { + // 网络加密解密 + [weakself requestDataEncrypt]; + }]; + [self.sections addObject:[LMJItemSection sectionWithItems:@[item] andHeaderTitle:@"网络数据加密" footerTitle:@"END"]]; +} + +- (void)requestDataEncrypt +{ + NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithDictionary:@{ + @"sessionId" : @"eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE1MjI3NTI3MjEsInN1YiI6IntcImRpc2FibGVkXCI6ZmFsc2UsXCJpZFwiOjE0NzMzMjUsXCJsb2dpbk5hbWVcIjpcIk0xNTYwMDYwMDAwMlwiLFwibW9iaWxlXCI6XCIxNTYwMDYwMDAwMlwiLFwicm9sZU5hbWVzXCI6W1wiSU5WRVNUT1JcIl19In0.ZmE_RyS2ba6g6paa_56V_YZ0FKX5QrKMaRp2X82UdoZjglUCWxOp81Nuv-FKHWyTEJupwrhGR81IwIoKPnUM8g", + @"versionCode" : @"380", + @"platformType" : @"5", + @"channelId" : @"ios", + @"deviceId" : @"06761B15-C2E0-4A8F-8C5C-BBBB07261059", + @"msgeps" : @"", + @"msgnonce" : @"", + @"msgtimestamp" : @"", + @"operationChannel": @"3"}]; + + // 时间戳 + NSDateFormatter *dateformatter = [[NSDateFormatter alloc] init]; + dateformatter.dateFormat = @"yyyyMMddHHmmssSSS"; + NSString *timestmp = [dateformatter stringFromDate:[NSDate date]]; + + // UUID + NSString *uuid = @"0BE8421A-6A0A-4F3D-BDCE-C2DD78BD65D0"; + + // nonce + NSString *nonce = [[NSString stringWithFormat:@"%@%@%@%@",dictM[@"platformType"], dictM[@"deviceId"], timestmp, uuid] md5String]; + + // 时间戳 + dictM[@"msgtimestamp"] = timestmp; + // 唯一性 + dictM[@"msgnonce"] = nonce; + + // 把字典生成字符串 + NSString *content = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:dictM options:0 error:nil] encoding:NSUTF8StringEncoding]; + + + // 加密, 生成随机的字符串 + NSString *pkey = [NSString ret24BitString]; + NSString *mkey = [NSString ret24BitString]; + + //把pkey, mkey 做rsa加密, 放到请求头, 服务器得到请求头后rsa解密拿到pkey, mkey, 前24位 pkey, 后24位 mkey + // @"%@%@", pkey, mkey RSA + NSString *key = [RSAEncryptor encryptString:[NSString stringWithFormat:@"%@%@", pkey, mkey] publicKeyWithContentsOfFile:publicKeyFile_]; + [self.manager.requestSerializer setValue:key forHTTPHeaderField:@"msgkey"]; + + + // @"%@%@%@", pkey, content, mkey DES3 mkey, 服务器拿到消息内容作对比 + NSString *sign = [DES3Encryptor DES3EncryptString:[NSString stringWithFormat:@"%@%@%@", pkey, content, mkey].md5String keyString:mkey ivString:@"01234567"]; + [self.manager.requestSerializer setValue:sign forHTTPHeaderField:@"msgsign"]; + + //content DES3 pkey + NSString *contentDES = [DES3Encryptor DES3EncryptString:content keyString:pkey ivString:@"01234567"]; + + [self.manager POST:@"https://mob-test-tech.meme2c.com/ums/app/mmUserInfo" parameters:contentDES headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + NSLog(@"%@", responseObject); + if (![responseObject isKindOfClass:[NSDictionary class]]) { + return ; + } + NSString *responseString = [DES3Encryptor DES3EncryptString:responseObject[@"msg"] keyString:pkey ivString:@"01234567"]; + + NSDictionary *responseDict = [NSJSONSerialization JSONObjectWithData:[responseString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil]; + + + NSLog(@"%@", responseDict); + + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + + NSLog(@"%@", task.response); + NSLog(@"%@", error); + + }]; +} + +// Der 加密 P12 解密 +- (void)DerP12 +{ + LMJWeak(self); + // ====================================================================================================== + self.addItem([LMJWordItem itemWithTitle:@"点击加密: " subTitle:self.oriMsg itemOperation:^(NSIndexPath *indexPath) { + NSString *encryptedMsg = [EncryptorTool EncryptMsg:weakself.oriMsg DESKey:weakself.DESKey]; + + LMJWordItem *item1 = weakself.sections[0].items[1]; + item1.subTitle = encryptedMsg; + + [weakself.tableView reloadRow:1 inSection:0 withRowAnimation:UITableViewRowAnimationFade]; + }]) + .addItem([LMJWordItem itemWithTitle:@"加密后的内容:" subTitle:@"" ]) + .addItem([LMJWordItem itemWithTitle:@"点击解密: " subTitle:@"" itemOperation:^(NSIndexPath *indexPath) { + + LMJWordItem *item1 = weakself.sections[0].items[1]; + NSString *encryptedMsg = item1.subTitle; + + LMJWordItem *item2 = weakself.sections[0].items[2]; + item2.subTitle = [EncryptorTool DecryptMsg:encryptedMsg DESKey:weakself.DESKey]; + + [weakself.tableView reloadRow:2 inSection:0 withRowAnimation:UITableViewRowAnimationFade]; + }]); + + weakself.sections.firstObject.headerTitle = @".der加密, .p12解密"; + weakself.sections.firstObject.footerTitle = @"END"; + +} + +- (void)PemP12 +{ + LMJWeak(self); + LMJWordItem *item10 = [LMJWordItem itemWithTitle:@"点击加密: " subTitle:self.oriMsg itemOperation:^(NSIndexPath *indexPath) { + + NSString *encryptedMsg = [RSAEncryptor encryptString:weakself.oriMsg publicKey:weakself.javaPubKey]; + + LMJWordItem *item1 = weakself.sections[1].items[1]; + item1.subTitle = encryptedMsg; + + [weakself.tableView reloadRow:1 inSection:1 withRowAnimation:UITableViewRowAnimationFade]; + + }]; + LMJWordItem *item11 = [LMJWordItem itemWithTitle:@"加密后的内容:" subTitle:@""]; + + LMJWordItem *item12 = [LMJWordItem itemWithTitle:@"点击解密: " subTitle:@"" itemOperation:^(NSIndexPath *indexPath) { + + + LMJWordItem *item1 = weakself.sections[1].items[1]; + NSString *encryptedMsg = item1.subTitle; + + LMJWordItem *item2 = weakself.sections[1].items[2]; + NSLog(@"%@", privateKeyFile_); + NSLog(@"%@", privateKeyFileP12Password_); + item2.subTitle = [RSAEncryptor decryptString:encryptedMsg privateKeyWithContentsOfFile:privateKeyFile_ password:privateKeyFileP12Password_]; + + [weakself.tableView reloadRow:2 inSection:1 withRowAnimation:UITableViewRowAnimationFade]; + + }]; + + LMJItemSection *section1 = [LMJItemSection sectionWithItems:@[item10, item11, item12] andHeaderTitle:@"pub.pem加密, .p12解密" footerTitle:@"END"]; + + [self.sections addObject:section1]; +} + + +- (void)PemPem +{ + LMJWeak(self); + LMJWordItem *item20 = [LMJWordItem itemWithTitle:@"点击加密: " subTitle:self.oriMsg itemOperation:^(NSIndexPath *indexPath) { + + NSString *encryptedMsg = [RSAEncryptor encryptString:weakself.oriMsg publicKey:weakself.javaPubKey]; + + LMJWordItem *item1 = weakself.sections[2].items[1]; + item1.subTitle = encryptedMsg; + + [weakself.tableView reloadRow:1 inSection:2 withRowAnimation:UITableViewRowAnimationFade]; + + }]; + LMJWordItem *item21 = [LMJWordItem itemWithTitle:@"加密后的内容:" subTitle:@""]; + + LMJWordItem *item22 = [LMJWordItem itemWithTitle:@"点击解密: " subTitle:@"" itemOperation:^(NSIndexPath *indexPath) { + + LMJWordItem *item1 = weakself.sections[2].items[1]; + NSString *encryptedMsg = item1.subTitle; + + LMJWordItem *item2 = weakself.sections[2].items[2]; + + item2.subTitle = [RSAEncryptor decryptString:encryptedMsg privateKey:weakself.javaPriKey]; + + [weakself.tableView reloadRow:2 inSection:2 withRowAnimation:UITableViewRowAnimationFade]; + + }]; + + LMJItemSection *section2 = [LMJItemSection sectionWithItems:@[item20, item21, item22] andHeaderTitle:@"pub.pem加密, pri.pem解密" footerTitle:@"END"]; + [self.sections addObject:section2]; +} + +- (void)DerPem +{ + LMJWeak(self); + LMJWordItem *item30 = [LMJWordItem itemWithTitle:@"点击加密: " subTitle:self.oriMsg itemOperation:^(NSIndexPath *indexPath) { + + NSString *encryptedMsg = [RSAEncryptor encryptString:weakself.oriMsg publicKeyWithContentsOfFile:publicKeyFile_]; + + LMJWordItem *item1 = weakself.sections[3].items[1]; + item1.subTitle = encryptedMsg; + + [weakself.tableView reloadRow:1 inSection:3 withRowAnimation:UITableViewRowAnimationFade]; + + }]; + LMJWordItem *item31 = [LMJWordItem itemWithTitle:@"加密后的内容:" subTitle:@""]; + + LMJWordItem *item32 = [LMJWordItem itemWithTitle:@"点击解密: " subTitle:@"" itemOperation:^(NSIndexPath *indexPath) { + + LMJWordItem *item1 = weakself.sections[3].items[1]; + NSString *encryptedMsg = item1.subTitle; + + LMJWordItem *item2 = weakself.sections[3].items[2]; + + item2.subTitle = [RSAEncryptor decryptString:encryptedMsg privateKey:weakself.javaPriKey]; + + [weakself.tableView reloadRow:2 inSection:3 withRowAnimation:UITableViewRowAnimationFade]; + + }]; + + LMJItemSection *section3 = [LMJItemSection sectionWithItems:@[item30, item31, item32] andHeaderTitle:@".der加密, pri.pem解密" footerTitle:@"END"]; + + [self.sections addObject:section3]; +} + +- (void)setUpKeys +{ + self.javaPriKey = @"-----BEGIN PRIVATE KEY-----\ + MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAK0IhWKuHWSnGmyL\ + 0224gICKcG7LkZoh/8w82XABjcFA3eiDdcREE9+d3i0lFs3RvPKD6VWHuolRoICy\ + GeJC1CnU/dFvRMVZIthzcF4XXt85S/R5yjz2BQEbzZToCLKstFyuzAs+wfipaBYI\ + uAAo7wvZICRceFJf5qb+yevhc+oPAgMBAAECgYEAlUrR0zeJEsv+x4LJFFTpQn6v\ + zViEsuj8zFn//VzJ0uDF1hR+qq1WPEz4YhkrGMAK92+LBgnKjypHgmKoZIjmhhoW\ + slHwub3nXfpBp+KamLxoe0VWnEUZYtpFnBgyOUfDHUkRg1OEkVMW39QEUMZnXqnV\ + NZ6iBQZAo9Y3J6s2GnECQQDT0m9oSE8QpfG5SlCU8a6J/jO0LFoivMi716FzHNm9\ + Rp1tNeIzTwoIt3r7T1TTNZj2ckPK9x4jMRM1ugBUs4kpAkEA0R8VsWe3gY80ufEp\ + 1gbWo9Nro9/zfxRDrTx9gY9sbrRtmrMcbmwWZKNRdwzARnP0EF2OHd5JzL1tZgRa\ + bGLodwJARs46BV7eZw9BfRGVXCRplqENgXWt75yxcPEEe+kx864uI3p2kXYjQYSr\ + rGP5U9y/s+nANZFjVpop9LSnNakJ+QJBAJsJK6EBnreLvvBXjceh/EEqvfOZVcGR\ + +XaWkQmbli0g0N1PCrYGpjdoKT5UkrvovTng0jrskNQcX92xPoR6c5MCQGSUoZWk\ + j1GZFm0GOm3L4SzkHEfMqqRjU3+Y0TgW8CGijLUQH6TsZzoHpWELwG6EZbGohGAH\ + 4v9yhn+nuHaSD0I=\ + -----END PRIVATE KEY-----"; + + self.javaPubKey = @"-----BEGIN PUBLIC KEY-----\ + MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtCIVirh1kpxpsi9NtuICAinBu\ + y5GaIf/MPNlwAY3BQN3og3XERBPfnd4tJRbN0bzyg+lVh7qJUaCAshniQtQp1P3R\ + b0TFWSLYc3BeF17fOUv0eco89gUBG82U6AiyrLRcrswLPsH4qWgWCLgAKO8L2SAk\ + XHhSX+am/snr4XPqDwIDAQAB\ + -----END PUBLIC KEY-----"; + + + self.oriMsg = @"16612345678"; + // 生成 des key + self.DESKey = [NSString ret24BitString]; + +} + +- (void)setSteps +{ + UILabel *he = [[UILabel alloc] init]; + he.numberOfLines = 0; + he.textColor = [UIColor redColor]; + he.text = @"iOS 公钥.der私钥.p12的证书文件 \n和 java 的公钥私钥key字符串 \"是\" \n相互通用和可以相互混用的"; + he.width = kScreenWidth; + he.font = [UIFont boldSystemFontOfSize:20]; + he.textAlignment = NSTextAlignmentCenter; + [he sizeToFit]; + self.tableView.tableHeaderView = he; + + NSString *path = [[NSBundle mainBundle] pathForResource:@"RSA证书" ofType: nil]; + path = [path stringByAppendingPathComponent:@"readMe.txt"]; + NSString *des = [[NSString alloc] initWithData:[NSData dataWithContentsOfFile:path] encoding:NSUTF8StringEncoding]; + + UILabel *l = [[UILabel alloc] init]; + l.textColor = [UIColor blackColor]; + l.width = kScreenWidth; + l.text = des; + l.numberOfLines = 0; + [l sizeToFit]; + + UIImageView *imgV = [[UIImageView alloc] initWithFrame:CGRectMake(0, l.height, kScreenWidth, 200)]; + [imgV sd_setImageWithURL:[NSURL URLWithString:@"https://upload-images.jianshu.io/upload_images/1803339-3ef995aa667e40f6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/700"]]; + [l addSubview:imgV]; + + + self.tableView.tableFooterView = l; + UIEdgeInsets contentInset = self.tableView.contentInset; + contentInset.bottom += 300; + self.tableView.contentInset = contentInset; +} + +- (AFHTTPSessionManager *)manager +{ + if(!_manager) + { + AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; + [manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; + manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", @"text/plain", nil]; + [manager.requestSerializer setQueryStringSerializationWithBlock:^NSString * _Nonnull(NSURLRequest * _Nonnull request, id _Nonnull parameters, NSError * _Nullable __autoreleasing * _Nullable error) { + return parameters; + }]; + _manager = manager; + } + return _manager; +} + +#pragma mark - LMJNavUIBaseViewControllerDataSource + +/** 导航条左边的按钮 */ +- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar +{ + [leftButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; + + return [UIImage imageNamed:@"NavgationBar_blue_back"]; +} + +#pragma mark - LMJNavUIBaseViewControllerDelegate +/** 左边的按钮的点击 */ +-(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar +{ + [self.navigationController popViewControllerAnimated:YES]; +} + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJTableSDWebImageViewController.h b/iOSProject/iOSProject/Classes/Preview3/LMJTableSDWebImageViewController.h deleted file mode 100644 index b8bd0a61..00000000 --- a/iOSProject/iOSProject/Classes/Preview3/LMJTableSDWebImageViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// LMJTableSDWebImageViewController.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/5/7. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJRefreshTableViewController.h" - -@interface LMJTableSDWebImageViewController : LMJRefreshTableViewController - -@end diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJTableSDWebImageViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJTableSDWebImageViewController.m deleted file mode 100644 index baca2a3c..00000000 --- a/iOSProject/iOSProject/Classes/Preview3/LMJTableSDWebImageViewController.m +++ /dev/null @@ -1,118 +0,0 @@ -// -// LMJTableSDWebImageViewController.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/5/7. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJTableSDWebImageViewController.h" -#import "VIDMoviePlayerViewController.h" -#import "LMJXGMVideo.h" - -@interface LMJTableSDWebImageViewController () -/** <#digest#> */ -@property (nonatomic, strong) NSMutableArray *videos; -@end - -@implementation LMJTableSDWebImageViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - -} - - -- (void)loadMore:(BOOL)isMore -{ - LMJWeakSelf(self); - - NSDictionary *parameters = @{@"type" : @"JSON"}; - - [[LMJRequestManager sharedManager] GET:[LMJXMGBaseUrl stringByAppendingPathComponent:@"video"] parameters:parameters completion:^(LMJBaseResponse *response) { - - [weakself endHeaderFooterRefreshing]; - - - if (!response.error && response.responseObject) { - weakself.videos = [LMJXGMVideo mj_objectArrayWithKeyValuesArray:response.responseObject[@"videos"]]; - } else { - [weakself.tableView configBlankPage:LMJEasyBlankPageViewTypeNoData hasData:weakself.videos.count hasError:response.error reloadButtonBlock:^(id sender) { - [weakself.tableView.mj_header beginRefreshing]; - }]; - [weakself.view makeToast:response.errorMsg]; - return ; - } - - [weakself.tableView.mj_footer setState:MJRefreshStateNoMoreData]; - [weakself.tableView reloadData]; - }]; -} - - -#pragma mark - tableViewDelegate -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return self.videos.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class])]; - - if (!cell) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:NSStringFromClass([UITableViewCell class])]; - cell.imageView.lmj_size = CGSizeMake(80, 80); - } - - [cell.imageView sd_setImageWithURL:self.videos[indexPath.row].image placeholderImage:[UIImage imageNamed:@"public_empty_loading"]]; - - cell.textLabel.text = self.videos[indexPath.row].ID; - - cell.detailTextLabel.text = self.videos[indexPath.row].name; - - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - VIDMoviePlayerViewController *playerVc = [[VIDMoviePlayerViewController alloc] init]; - playerVc.videoURL = self.videos[indexPath.row].url.absoluteString; - - [self.navigationController pushViewController:playerVc animated:YES]; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath -{ - return 100; -} - -- (NSMutableArray *)videos -{ - if(!_videos) - { - _videos = [NSMutableArray array]; - } - return _videos; -} - -#pragma mark - LMJNavUIBaseViewControllerDataSource - -/** 导航条左边的按钮 */ -- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar -{ - [leftButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; - - return [UIImage imageNamed:@"NavgationBar_blue_back"]; -} - -#pragma mark - LMJNavUIBaseViewControllerDelegate -/** 左边的按钮的点击 */ --(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ - [self.navigationController popViewControllerAnimated:YES]; -} - -@end diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJUniversalLinkViewController.h b/iOSProject/iOSProject/Classes/Preview3/LMJUniversalLinkViewController.h new file mode 100644 index 00000000..1628d413 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/LMJUniversalLinkViewController.h @@ -0,0 +1,13 @@ +// +// LMJUniversalLinkViewController.h +// iOSProject +// +// Created by HuXuPeng on 2018/5/5. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJWebViewController.h" + +@interface LMJUniversalLinkViewController : LMJWebViewController + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/LMJUniversalLinkViewController.m b/iOSProject/iOSProject/Classes/Preview3/LMJUniversalLinkViewController.m new file mode 100644 index 00000000..1c360049 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/LMJUniversalLinkViewController.m @@ -0,0 +1,44 @@ +// +// LMJUniversalLinkViewController.m +// iOSProject +// +// Created by HuXuPeng on 2018/5/5. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJUniversalLinkViewController.h" + +@interface LMJUniversalLinkViewController () + +@end + +@implementation LMJUniversalLinkViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self.webView loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"LMJUniversalLink" withExtension:@"html"]]]; +} + +- (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler +{ + NSLog(@"%@", frame); + + [UIAlertController mj_showAlertWithTitle:@"打开浏览器, 点击里边的链接打开 App " message:message appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + + alertMaker.addActionDestructiveTitle(@"cancel").addActionDefaultTitle(@"confirm"); + + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + + if (buttonIndex == 0) { + completionHandler(NO); + }else { + completionHandler(YES); + + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/NJHu/njhu.github.io/blob/master/iOSProjectAppIntroduction/readme.md"] options:@{@"from": @"iOSProject"} completionHandler:^(BOOL success) { + NSLog(@"打开了浏览器"); + }]; + } + }]; +} +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/Model/LMJXGMVideo.h b/iOSProject/iOSProject/Classes/Preview3/Model/LMJXGMVideo.h index 18e249a3..f45cca89 100644 --- a/iOSProject/iOSProject/Classes/Preview3/Model/LMJXGMVideo.h +++ b/iOSProject/iOSProject/Classes/Preview3/Model/LMJXGMVideo.h @@ -9,8 +9,6 @@ #import @interface LMJXGMVideo : NSObject - -// //id: 2, //image: "resources/images/minion_02.png", //length: 12, diff --git a/iOSProject/iOSProject/Classes/Preview3/Ohter/LMJUniversalLink.html b/iOSProject/iOSProject/Classes/Preview3/Ohter/LMJUniversalLink.html new file mode 100644 index 00000000..57f5c0c8 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/Ohter/LMJUniversalLink.html @@ -0,0 +1,577 @@ + + + + + + + +iOSProject App + + + + + + + + + + + + + +

    测试流程

    +

    目前支持模拟器测试, 如果需要支持真机, 请加微信, 把teamId 和 bundleId发给我, 帮您添加到njhu.github.io 下apple-app-site-association文件; 真机可以测试微信, 浏览器, 短信, 邮件和其它 App

    + +
      +
    • 1, 在 njhu.github.io 下创建apple-app-site-association文件
    • +
    + +
    {
    +    "applinks": {
    +    "apps": [],
    +    "details": [
    +            {
    +            "appID": "EH8D228RS6.com.github.njhu",
    +            "paths": ["/iOSProject/*"]
    +            }
    +        ]
    +    }
    +}
    + +
      +
    • 2, 设置iOS项目里边通用链接Associated Domains
    • +
    + +
    applinks:njhu.github.io
    + + + +

    + + + + + + + + + + + diff --git a/iOSProject/iOSProject/Classes/Preview3/RSATools/DES3Encryptor.h b/iOSProject/iOSProject/Classes/Preview3/RSATools/DES3Encryptor.h new file mode 100755 index 00000000..9329e554 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/RSATools/DES3Encryptor.h @@ -0,0 +1,34 @@ +// +// DES3Encryptor.h +// RSADemo3 +// +// Created by NJHu on 16/10/12. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import + +@interface DES3Encryptor : NSObject +/** + * 3des加密 + * + * @param encryptString 待加密的string + * @param keyString 约定的密钥 + * @param ivString 约定的密钥 + * + * @return 3des加密后的string + */ ++ (NSString*)DES3EncryptString:(NSString*)encryptString keyString:(NSString*)keyString ivString:(NSString*)ivString; + +/** + * 3des解密 + * + * @param decryptString 待解密的string + * @param keyString 约定的密钥 + * @param ivString 约定的密钥 + * + * @return 3des解密后的string + */ ++ (NSString*)DES3DecryptString:(NSString*)decryptString keyString:(NSString*)keyString ivString:(NSString*)ivString; + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/RSATools/DES3Encryptor.m b/iOSProject/iOSProject/Classes/Preview3/RSATools/DES3Encryptor.m new file mode 100755 index 00000000..bdcdacd1 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/RSATools/DES3Encryptor.m @@ -0,0 +1,100 @@ +// +// DES3Encryptor.m +// RSADemo3 +// +// Created by NJHu on 16/10/12. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import "DES3Encryptor.h" +#import +#import + +@implementation DES3Encryptor + +#pragma mark- 3des加密 ++ (NSString*)DES3EncryptString:(NSString *)encryptString keyString:(NSString *)keyString ivString:(NSString *)ivString{ + + return [self doCipher:encryptString keyString:keyString ivString:ivString operation:kCCEncrypt]; +} + +#pragma mark- 3des解密 ++ (NSString*)DES3DecryptString:(NSString *)decryptString keyString:(NSString *)keyString ivString:(NSString *)ivString{ + + return [self doCipher:decryptString keyString:keyString ivString:ivString operation:kCCDecrypt]; +} + ++ (NSString *) doCipher:(NSString*)sText keyString:(NSString*)keyString ivString:(NSString*)ivString operation:(CCOperation)encryptOperation +{ + const void *dataIn; + size_t dataInLength; + + if (encryptOperation == kCCDecrypt)//传递过来的是decrypt 解码 + { + //转成utf-8并decode, UTF-8, 一般用这个..........., 如果服务器特别就用别的... + //解码 base64 + NSData *decryptData = [[NSData alloc] initWithBase64EncodedData:[sText dataUsingEncoding:NSUTF8StringEncoding] options:NSDataBase64DecodingIgnoreUnknownCharacters]; + + dataInLength = [decryptData length]; + dataIn = [decryptData bytes]; + } + else //encrypt + { + NSData* encryptData = [sText dataUsingEncoding:NSUTF8StringEncoding]; + dataInLength = [encryptData length]; + dataIn = (const void *)[encryptData bytes]; + } + + /* + DES加密 :用CCCrypt函数加密一下,然后用base64编码下,传过去 + DES解密 :把收到的数据根据base64,decode一下,然后再用CCCrypt函数解密,得到原本的数据 + */ + CCCryptorStatus ccStatus; + uint8_t *dataOut = NULL; //可以理解位type/typedef 的缩写(有效的维护了代码,比如:一个人用int,一个人用long。最好用typedef来定义) + size_t dataOutAvailable = 0; //size_t 是操作符sizeof返回的结果类型 + size_t dataOutMoved = 0; + + dataOutAvailable = (dataInLength + kCCBlockSizeDES) & ~(kCCBlockSizeDES - 1); + dataOut = malloc( dataOutAvailable * sizeof(uint8_t)); + memset((void *)dataOut, 0x0, dataOutAvailable);//将已开辟内存空间buffer的首 1 个字节的值设为值 0 + + const void *vkey = (const void *) [keyString UTF8String]; + const void *iv = (const void *) [ivString UTF8String]; + + //CCCrypt函数 加密/解密 + ccStatus = CCCrypt(encryptOperation,// 加密/解密 + kCCAlgorithm3DES,// 加密根据哪个标准(des,3des,aes。。。。) + kCCOptionPKCS7Padding,// 选项分组密码算法(des:对每块分组加一次密 3DES:对每块分组加三个不同的密) + vkey, //密钥 加密和解密的密钥必须一致 + kCCKeySize3DES,// DES 密钥的大小(kCCKeySizeDES=8) + iv, // 可选的初始矢量 + dataIn, // 数据的存储单元 + dataInLength,// 数据的大小 + (void *)dataOut,// 用于返回数据 + dataOutAvailable, + &dataOutMoved); + NSLog(@"%d", ccStatus); + NSString *result = nil; + NSData *data = [NSData dataWithBytes:(const void *)dataOut length:(NSUInteger)dataOutMoved]; + + if (encryptOperation == kCCDecrypt)//encryptOperation==1 解码 + { + //得到解密出来的data数据,改变为utf-8的字符串 + result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] ; + } + else //encryptOperation==0 (加密过程中,把加好密的数据转成base64的) + { + // base64data + NSData *base64Data = [data base64EncodedDataWithOptions:NSDataBase64Encoding64CharacterLineLength]; + + //编码 base64 + // UTF-8, 一般用这个..........., 如果服务器特别就用别的... + result = [[NSString alloc] initWithData:base64Data encoding:NSUTF8StringEncoding]; + + } + + return result; +} + + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/RSATools/EncryptorTool.h b/iOSProject/iOSProject/Classes/Preview3/RSATools/EncryptorTool.h new file mode 100755 index 00000000..d30b9043 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/RSATools/EncryptorTool.h @@ -0,0 +1,82 @@ +// +// EncryptorTool.h +// RSADemo3 +// +// Created by NJHu on 16/10/12. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import +#import "RSAEncryptor.h" +#import "DES3Encryptor.h" + +UIKIT_EXTERN NSString *const privateKeyFileP12Password_; +//.der path +UIKIT_EXTERN NSString * publicKeyFile_; +//.p12 path +UIKIT_EXTERN NSString * privateKeyFile_; + +@interface EncryptorTool : NSObject + + +/** + * DES加密, 后, RSA加密 + * + * @param msgBody 需要加密的内容 + * @param key DES_KEY + * @return DES_RSA加密后的内容 + */ ++ (NSString *)EncryptMsg:(NSString *)msgBody DESKey:(NSString *)key; + + +/** + * RSA 加密 DES_KEY + * + * @param key DES_KEY + * + * @return RSA加密后的DES_KEY + */ ++ (NSString *)EncryptDESKey:(NSString *)key; + + + +#pragma mark - 测试解密DES_RSA加密的内容 +/** + * 测试, RSA解密, 后, DES解密 + * + * @param msgBody 需要解密的内容 + * @param key DES_KEY + * @return RSA_DES解密后的内容 + */ ++ (NSString *)DecryptMsg:(NSString *)msgBody DESKey:(NSString *)key; + +@end + + + + + + + + +@interface NSString (CFP_Ret_24_Char) + ++ (NSString *)ret24BitString; + ++ (NSString*)queryUUID; + +@end + + +@interface NSDictionary (CFP_Dict_To_JSON_String_DEncrypt) + + +/** + * 把OC的字典转换为JSON字符串 + * + * @return OC字典转换的JSON字符串 + */ +- (NSString *)nj_ToJSONString; + + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/RSATools/EncryptorTool.m b/iOSProject/iOSProject/Classes/Preview3/RSATools/EncryptorTool.m new file mode 100755 index 00000000..ed9e0dca --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/RSATools/EncryptorTool.m @@ -0,0 +1,196 @@ +// +// EncryptorTool.m +// RSADemo3 +// +// Created by NJHu on 16/10/12. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import "EncryptorTool.h" + + +static NSString *const CFPiOSPublicDerFile_ = @"RSA证书/public_key.der"; +static NSString *const CFPiOSPrivateP12File_ = @"RSA证书/private_key.p12"; +NSString *const privateKeyFileP12Password_ = @"123456"; + +static NSString *const DES3GivString_ = @"01234567"; + +NSString * publicKeyFile_ = nil; +NSString * privateKeyFile_ = nil; + +@implementation EncryptorTool + ++ (void)load +{ + publicKeyFile_ = [[NSBundle mainBundle] pathForResource:CFPiOSPublicDerFile_ ofType:nil]; + privateKeyFile_ = [[NSBundle mainBundle] pathForResource:CFPiOSPrivateP12File_ ofType:nil]; +} + +/** + * DES加密, 后, RSA加密 + * + * @param msgBody 需要加密的内容 + * @param key DES_KEY + * @return DES_RSA加密后的内容 + */ ++ (NSString *)EncryptMsg:(NSString *)msgBody DESKey:(NSString *)key +{ + // des加密 + NSString *desMsg = [DES3Encryptor DES3EncryptString:msgBody keyString:key ivString:DES3GivString_]; + + NSLog(@"des加密后的数据, desMsg, \n%@", desMsg); + + // RSA加密 + NSString *rsa_desMsg = [RSAEncryptor encryptString:desMsg publicKeyWithContentsOfFile:publicKeyFile_]; + + NSLog(@"rsa加密后的数据, rsa_desMsg, \n%@", rsa_desMsg); + + return rsa_desMsg; + +} + + +/** + * RSA 加密DES_KEY + * + * @param key DES_KEY + * + * @return RSA加密后的DES_KEY + */ ++ (NSString *)EncryptDESKey:(NSString *)key +{ + NSString *rsaKey = [RSAEncryptor encryptString:key publicKeyWithContentsOfFile:publicKeyFile_]; + + NSLog(@"rsaKey, \n%@", rsaKey); + + return rsaKey; +} + + + +#pragma mark - 测试解密DES_RSA加密的内容 +/** + * 测试, RSA解密, 后, DES解密 + * + * @param msgBody 需要解密的内容 + * @param key DES_KEY + * @return RSA_DES解密后的内容 + */ ++ (NSString *)DecryptMsg:(NSString *)msgBody DESKey:(NSString *)key +{ + NSLog(@"msgBody, \n%@", msgBody); + + NSLog(@"key, \n%@", key); + + // p12-ios-RSA解密 + NSString *DES_Msg = [RSAEncryptor decryptString:msgBody privateKeyWithContentsOfFile:privateKeyFile_ password:privateKeyFileP12Password_]; + + + NSLog(@"RSA解密后的数据_DES_Msg, \n%@", DES_Msg); + + // DES解密 + NSString *msg = [DES3Encryptor DES3DecryptString:DES_Msg keyString:key ivString:DES3GivString_]; + + NSLog(@"DES解密后的数据_Msg, \n%@", msg); + + return msg; +} + + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@implementation NSString (CFP_Ret_24_Char) + ++ (NSString *)ret24BitString + +{ + NSArray *arr = [NSArray arrayWithObjects: + @"a",@"b",@"c",@"d",@"e",@"f",@"g", + @"h",@"i",@"j",@"k",@"l",@"m",@"n", + @"o",@"p",@"q",@"r",@"s",@"t", + @"u",@"v",@"w",@"x",@"y",@"z", + @"A",@"B",@"C",@"D",@"E",@"F",@"G", + @"H",@"I",@"J",@"K",@"L",@"M",@"N", + @"O",@"P",@"Q",@"R",@"S",@"T", + @"U",@"V",@"W",@"X",@"Y",@"Z", + @"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",nil]; + + NSMutableString *strM = [NSMutableString string]; + for (int i = 0; i < 24; i++) { + int index = arc4random() % [arr count]; + + [strM appendString:[arr objectAtIndex:index]]; + } + + return strM.copy; +} + + ++ (NSString*)queryUUID { + CFUUIDRef puuid = CFUUIDCreate( nil ); + CFStringRef uuidString = CFUUIDCreateString( nil, puuid ); + NSString * result = (NSString *)CFBridgingRelease(CFStringCreateCopy( NULL, uuidString)); + CFRelease(puuid); + CFRelease(uuidString); + result = [result stringByReplacingOccurrencesOfString:@"-" withString:@""]; + return result; +} + +@end + + +@implementation NSDictionary (CFP_Dict_To_JSON_String_Encrypt) + +- (NSString *)nj_ToJSONString +{ + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:nil]; + + return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; +} + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/RSATools/RSAEncryptor.h b/iOSProject/iOSProject/Classes/Preview3/RSATools/RSAEncryptor.h new file mode 100755 index 00000000..3300af66 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/RSATools/RSAEncryptor.h @@ -0,0 +1,38 @@ +#import + +@interface RSAEncryptor : NSObject + +/** + * 加密方法 + * + * @param str 需要加密的字符串 + * @param path '.der'格式的公钥文件路径 + */ ++ (NSString *)encryptString:(NSString *)str publicKeyWithContentsOfFile:(NSString *)path; + +/** + * 解密方法 + * + * @param str 需要解密的字符串 + * @param path '.p12'格式的私钥文件路径 + * @param password 私钥文件密码 + */ ++ (NSString *)decryptString:(NSString *)str privateKeyWithContentsOfFile:(NSString *)path password:(NSString *)password; + +/** + * 加密方法 + * + * @param str 需要加密的字符串 + * @param pubKey java公钥字符串 + */ ++ (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey; + +/** + * 解密方法 + * + * @param str 需要解密的字符串 + * @param privKey java私钥字符串 + */ ++ (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey; + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/RSATools/RSAEncryptor.m b/iOSProject/iOSProject/Classes/Preview3/RSATools/RSAEncryptor.m new file mode 100755 index 00000000..52f58dae --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/RSATools/RSAEncryptor.m @@ -0,0 +1,469 @@ +#import "RSAEncryptor.h" +#import +#import + +@implementation RSAEncryptor + +static NSString *base64_encode_data(NSData *data){ + + data = [data base64EncodedDataWithOptions:NSDataBase64Encoding64CharacterLineLength]; + + NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + + return ret; +} + +static NSData *base64_decode(NSString *str){ + + NSData *utf8Data = [str dataUsingEncoding:NSUTF8StringEncoding]; + + NSData *data = [[NSData alloc] initWithBase64EncodedData:utf8Data options:NSDataBase64DecodingIgnoreUnknownCharacters]; + +// [[NSData alloc] initWithBase64EncodedString:str options:NSDataBase64DecodingIgnoreUnknownCharacters]; + + return data; +} + +#pragma mark - 使用'.der'公钥文件加密 + +//加密 ++ (NSString *)encryptString:(NSString *)str publicKeyWithContentsOfFile:(NSString *)path{ + if (!str || !path) return nil; + return [self encryptString:str publicKeyRef:[self getPublicKeyRefWithContentsOfFile:path]]; +} + + +#pragma mark - 获取公钥 ++ (SecKeyRef)getPublicKeyRefWithContentsOfFile:(NSString *)filePath{ + NSData *certData = [NSData dataWithContentsOfFile:filePath]; + if (!certData) { + return nil; + } + SecCertificateRef cert = SecCertificateCreateWithData(NULL, (CFDataRef)certData); + SecKeyRef key = NULL; + SecTrustRef trust = NULL; + SecPolicyRef policy = NULL; + if (cert != NULL) { + policy = SecPolicyCreateBasicX509(); + if (policy) { + if (SecTrustCreateWithCertificates((CFTypeRef)cert, policy, &trust) == noErr) { + SecTrustResultType result; + if (SecTrustEvaluate(trust, &result) == noErr) { + key = SecTrustCopyPublicKey(trust); + } + } + } + } + if (policy) CFRelease(policy); + if (trust) CFRelease(trust); + if (cert) CFRelease(cert); + return key; +} + ++ (NSString *)encryptString:(NSString *)str publicKeyRef:(SecKeyRef)publicKeyRef{ + if(![str dataUsingEncoding:NSUTF8StringEncoding]){ + return nil; + } + if(!publicKeyRef){ + return nil; + } + NSData *data = [self encryptData:[str dataUsingEncoding:NSUTF8StringEncoding] withKeyRef:publicKeyRef]; + + NSString *ret = base64_encode_data(data); + + return ret; +} + + +#pragma mark - 使用'.12'私钥文件解密 +//解密 ++ (NSString *)decryptString:(NSString *)str privateKeyWithContentsOfFile:(NSString *)path password:(NSString *)password{ + if (!str || !path) return nil; + if (!password) password = @""; + return [self decryptString:str privateKeyRef:[self getPrivateKeyRefWithContentsOfFile:path password:password]]; +} + + +#pragma mark - 获取私钥 ++ (SecKeyRef)getPrivateKeyRefWithContentsOfFile:(NSString *)filePath password:(NSString*)password{ + + NSData *p12Data = [NSData dataWithContentsOfFile:filePath]; + if (!p12Data) { + return nil; + } + SecKeyRef privateKeyRef = NULL; + NSMutableDictionary * options = [[NSMutableDictionary alloc] init]; + [options setObject: password forKey:(__bridge id)kSecImportExportPassphrase]; + CFArrayRef items = CFArrayCreate(NULL, 0, 0, NULL); + OSStatus securityError = SecPKCS12Import((__bridge CFDataRef) p12Data, (__bridge CFDictionaryRef)options, &items); + if (securityError == noErr && CFArrayGetCount(items) > 0) { + CFDictionaryRef identityDict = CFArrayGetValueAtIndex(items, 0); + SecIdentityRef identityApp = (SecIdentityRef)CFDictionaryGetValue(identityDict, kSecImportItemIdentity); + securityError = SecIdentityCopyPrivateKey(identityApp, &privateKeyRef); + if (securityError != noErr) { + privateKeyRef = NULL; + } + } + CFRelease(items); + + return privateKeyRef; +} + ++ (NSString *)decryptString:(NSString *)str privateKeyRef:(SecKeyRef)privKeyRef{ + NSData *data = base64_decode(str); + if (!privKeyRef || !data) { + return nil; + } + data = [self decryptData:data withKeyRef:privKeyRef]; + + NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + return ret; +} + +#pragma mark - 使用公钥字符串加密 + +/* START: Encryption with RSA public key */ + +//使用公钥字符串加密 ++ (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey{ + NSData *data = [self encryptData:[str dataUsingEncoding:NSUTF8StringEncoding] publicKey:pubKey]; + NSString *ret = base64_encode_data(data); + return ret; +} + ++ (NSData *)encryptData:(NSData *)data publicKey:(NSString *)pubKey{ + if(!data || !pubKey){ + return nil; + } + SecKeyRef keyRef = [self addPublicKey:pubKey]; + if(!keyRef){ + return nil; + } + return [self encryptData:data withKeyRef:keyRef]; +} + ++ (SecKeyRef)addPublicKey:(NSString *)key{ + NSRange spos = [key rangeOfString:@"-----BEGIN PUBLIC KEY-----"]; + NSRange epos = [key rangeOfString:@"-----END PUBLIC KEY-----"]; + if(spos.location != NSNotFound && epos.location != NSNotFound){ + NSUInteger s = spos.location + spos.length; + NSUInteger e = epos.location; + NSRange range = NSMakeRange(s, e-s); + key = [key substringWithRange:range]; + } + key = [key stringByReplacingOccurrencesOfString:@"\r" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@"\n" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@"\t" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@" " withString:@""]; + + // This will be base64 encoded, decode it. + NSData *data = base64_decode(key); + data = [self stripPublicKeyHeader:data]; + if(!data){ + return nil; + } + + //a tag to read/write keychain storage + NSString *tag = @"RSAUtil_PubKey"; + NSData *d_tag = [NSData dataWithBytes:[tag UTF8String] length:[tag length]]; + + // Delete any old lingering key with the same tag + NSMutableDictionary *publicKey = [[NSMutableDictionary alloc] init]; + [publicKey setObject:(__bridge id) kSecClassKey forKey:(__bridge id)kSecClass]; + [publicKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; + [publicKey setObject:d_tag forKey:(__bridge id)kSecAttrApplicationTag]; + SecItemDelete((__bridge CFDictionaryRef)publicKey); + + // Add persistent version of the key to system keychain + [publicKey setObject:data forKey:(__bridge id)kSecValueData]; + [publicKey setObject:(__bridge id) kSecAttrKeyClassPublic forKey:(__bridge id) + kSecAttrKeyClass]; + [publicKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id) + kSecReturnPersistentRef]; + + CFTypeRef persistKey = nil; + OSStatus status = SecItemAdd((__bridge CFDictionaryRef)publicKey, &persistKey); + if (persistKey != nil){ + CFRelease(persistKey); + } + if ((status != noErr) && (status != errSecDuplicateItem)) { + return nil; + } + + [publicKey removeObjectForKey:(__bridge id)kSecValueData]; + [publicKey removeObjectForKey:(__bridge id)kSecReturnPersistentRef]; + [publicKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnRef]; + [publicKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; + + // Now fetch the SecKeyRef version of the key + SecKeyRef keyRef = nil; + status = SecItemCopyMatching((__bridge CFDictionaryRef)publicKey, (CFTypeRef *)&keyRef); + if(status != noErr){ + return nil; + } + return keyRef; +} + ++ (NSData *)stripPublicKeyHeader:(NSData *)d_key{ + // Skip ASN.1 public key header + if (d_key == nil) return(nil); + + unsigned long len = [d_key length]; + if (!len) return(nil); + + unsigned char *c_key = (unsigned char *)[d_key bytes]; + unsigned int idx = 0; + + if (c_key[idx++] != 0x30) return(nil); + + if (c_key[idx] > 0x80) idx += c_key[idx] - 0x80 + 1; + else idx++; + + // PKCS #1 rsaEncryption szOID_RSA_RSA + static unsigned char seqiod[] = + { 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, + 0x01, 0x05, 0x00 }; + if (memcmp(&c_key[idx], seqiod, 15)) return(nil); + + idx += 15; + + if (c_key[idx++] != 0x03) return(nil); + + if (c_key[idx] > 0x80) idx += c_key[idx] - 0x80 + 1; + else idx++; + + if (c_key[idx++] != '\0') return(nil); + + // Now make a new NSData from this buffer + return ([NSData dataWithBytes:&c_key[idx] length:len - idx]); +} + + +#pragma mark - 用SecKeyRef加密 ++ (NSData *)encryptData:(NSData *)data withKeyRef:(SecKeyRef) keyRef{ + const uint8_t *srcbuf = (const uint8_t *)[data bytes]; + size_t srclen = (size_t)data.length; + + size_t block_size = SecKeyGetBlockSize(keyRef) * sizeof(uint8_t); + void *outbuf = malloc(block_size); + size_t src_block_size = block_size - 11; + + NSMutableData *ret = [[NSMutableData alloc] init]; + for(int idx=0; idx src_block_size){ + data_len = src_block_size; + } + + size_t outlen = block_size; + OSStatus status = noErr; + status = SecKeyEncrypt(keyRef, + //kSecPaddingPKCS1是随机类型 选择kSecPaddingNone类型就能保证每次加密出来的都一样了 否则的话 JAVA服务器读取出来会有摘要 + kSecPaddingNone, + srcbuf + idx, + data_len, + outbuf, + &outlen + ); + if (status != 0) { + NSLog(@"SecKeyEncrypt fail. Error Code: %d", status); + ret = nil; + break; + }else{ + [ret appendBytes:outbuf length:outlen]; + } + } + + free(outbuf); + CFRelease(keyRef); + return ret; +} + +/* END: Encryption with RSA public key */ + +#pragma mark - 使用私钥字符串解密 + +/* START: Decryption with RSA private key */ + +//使用私钥字符串解密 ++ (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey{ + if (!str) return nil; + + NSData *data = base64_decode(str); + + data = [self decryptData:data privateKey:privKey]; + + NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + + return ret; +} + ++ (NSData *)decryptData:(NSData *)data privateKey:(NSString *)privKey{ + if(!data || !privKey){ + return nil; + } + SecKeyRef keyRef = [self addPrivateKey:privKey]; + if(!keyRef){ + return nil; + } + return [self decryptData:data withKeyRef:keyRef]; +} + ++ (SecKeyRef)addPrivateKey:(NSString *)key{ + NSRange spos = [key rangeOfString:@"-----BEGIN PRIVATE KEY-----"]; + NSRange epos = [key rangeOfString:@"-----END PRIVATE KEY-----"]; + if(spos.location != NSNotFound && epos.location != NSNotFound){ + NSUInteger s = spos.location + spos.length; + NSUInteger e = epos.location; + NSRange range = NSMakeRange(s, e-s); + key = [key substringWithRange:range]; + } + key = [key stringByReplacingOccurrencesOfString:@"\r" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@"\n" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@"\t" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@" " withString:@""]; + + // This will be base64 encoded, decode it. + NSData *data = base64_decode(key); + data = [self stripPrivateKeyHeader:data]; + if(!data){ + return nil; + } + + //a tag to read/write keychain storage + NSString *tag = @"RSAUtil_PrivKey"; + NSData *d_tag = [NSData dataWithBytes:[tag UTF8String] length:[tag length]]; + + // Delete any old lingering key with the same tag + NSMutableDictionary *privateKey = [[NSMutableDictionary alloc] init]; + [privateKey setObject:(__bridge id) kSecClassKey forKey:(__bridge id)kSecClass]; + [privateKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; + [privateKey setObject:d_tag forKey:(__bridge id)kSecAttrApplicationTag]; + SecItemDelete((__bridge CFDictionaryRef)privateKey); + + // Add persistent version of the key to system keychain + [privateKey setObject:data forKey:(__bridge id)kSecValueData]; + [privateKey setObject:(__bridge id) kSecAttrKeyClassPrivate forKey:(__bridge id) + kSecAttrKeyClass]; + [privateKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id) + kSecReturnPersistentRef]; + + CFTypeRef persistKey = nil; + OSStatus status = SecItemAdd((__bridge CFDictionaryRef)privateKey, &persistKey); + if (persistKey != nil){ + CFRelease(persistKey); + } + if ((status != noErr) && (status != errSecDuplicateItem)) { + return nil; + } + + [privateKey removeObjectForKey:(__bridge id)kSecValueData]; + [privateKey removeObjectForKey:(__bridge id)kSecReturnPersistentRef]; + [privateKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnRef]; + [privateKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; + + // Now fetch the SecKeyRef version of the key + SecKeyRef keyRef = nil; + status = SecItemCopyMatching((__bridge CFDictionaryRef)privateKey, (CFTypeRef *)&keyRef); + if(status != noErr){ + return nil; + } + return keyRef; +} + ++ (NSData *)stripPrivateKeyHeader:(NSData *)d_key{ + // Skip ASN.1 private key header + if (d_key == nil) return(nil); + + unsigned long len = [d_key length]; + if (!len) return(nil); + + unsigned char *c_key = (unsigned char *)[d_key bytes]; + unsigned int idx = 22; //magic byte at offset 22 + + if (0x04 != c_key[idx++]) return nil; + + //calculate length of the key + unsigned int c_len = c_key[idx++]; + int det = c_len & 0x80; + if (!det) { + c_len = c_len & 0x7f; + } else { + int byteCount = c_len & 0x7f; + if (byteCount + idx > len) { + //rsa length field longer than buffer + return nil; + } + unsigned int accum = 0; + unsigned char *ptr = &c_key[idx]; + idx += byteCount; + while (byteCount) { + accum = (accum << 8) + *ptr; + ptr++; + byteCount--; + } + c_len = accum; + } + + // Now make a new NSData from this buffer + return [d_key subdataWithRange:NSMakeRange(idx, c_len)]; +} + ++ (NSData *)decryptData:(NSData *)data withKeyRef:(SecKeyRef) keyRef{ + const uint8_t *srcbuf = (const uint8_t *)[data bytes]; + size_t srclen = (size_t)data.length; + + size_t block_size = SecKeyGetBlockSize(keyRef) * sizeof(uint8_t); + UInt8 *outbuf = malloc(block_size); + size_t src_block_size = block_size; + + NSMutableData *ret = [[NSMutableData alloc] init]; + for(int idx=0; idx src_block_size){ + data_len = src_block_size; + } + + size_t outlen = block_size; + OSStatus status = noErr; + status = SecKeyDecrypt(keyRef, + //kSecPaddingPKCS1是随机类型 选择kSecPaddingNone类型就能保证每次加密出来的都一样了 否则的话 JAVA服务器读取出来会有摘要 + kSecPaddingNone, + srcbuf + idx, + data_len, + outbuf, + &outlen + ); + if (status != 0) { + NSLog(@"SecKeyEncrypt fail. Error Code: %d", status); + ret = nil; + break; + }else{ + //the actual decrypted data is in the middle, locate it! + int idxFirstZero = -1; + int idxNextZero = (int)outlen; + for ( int i = 0; i < outlen; i++ ) { + if ( outbuf[i] == 0 ) { + if ( idxFirstZero < 0 ) { + idxFirstZero = i; + } else { + idxNextZero = i; + break; + } + } + } + + [ret appendBytes:&outbuf[idxFirstZero+1] length:idxNextZero-idxFirstZero-1]; + } + } + + free(outbuf); + CFRelease(keyRef); + return ret; +} + +/* END: Decryption with RSA private key */ + +@end diff --git "a/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/pkcs8_private_key.pem" "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/pkcs8_private_key.pem" new file mode 100644 index 00000000..bef0b75f --- /dev/null +++ "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/pkcs8_private_key.pem" @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAK0IhWKuHWSnGmyL +0224gICKcG7LkZoh/8w82XABjcFA3eiDdcREE9+d3i0lFs3RvPKD6VWHuolRoICy +GeJC1CnU/dFvRMVZIthzcF4XXt85S/R5yjz2BQEbzZToCLKstFyuzAs+wfipaBYI +uAAo7wvZICRceFJf5qb+yevhc+oPAgMBAAECgYEAlUrR0zeJEsv+x4LJFFTpQn6v +zViEsuj8zFn//VzJ0uDF1hR+qq1WPEz4YhkrGMAK92+LBgnKjypHgmKoZIjmhhoW +slHwub3nXfpBp+KamLxoe0VWnEUZYtpFnBgyOUfDHUkRg1OEkVMW39QEUMZnXqnV +NZ6iBQZAo9Y3J6s2GnECQQDT0m9oSE8QpfG5SlCU8a6J/jO0LFoivMi716FzHNm9 +Rp1tNeIzTwoIt3r7T1TTNZj2ckPK9x4jMRM1ugBUs4kpAkEA0R8VsWe3gY80ufEp +1gbWo9Nro9/zfxRDrTx9gY9sbrRtmrMcbmwWZKNRdwzARnP0EF2OHd5JzL1tZgRa +bGLodwJARs46BV7eZw9BfRGVXCRplqENgXWt75yxcPEEe+kx864uI3p2kXYjQYSr +rGP5U9y/s+nANZFjVpop9LSnNakJ+QJBAJsJK6EBnreLvvBXjceh/EEqvfOZVcGR ++XaWkQmbli0g0N1PCrYGpjdoKT5UkrvovTng0jrskNQcX92xPoR6c5MCQGSUoZWk +j1GZFm0GOm3L4SzkHEfMqqRjU3+Y0TgW8CGijLUQH6TsZzoHpWELwG6EZbGohGAH +4v9yhn+nuHaSD0I= +-----END PRIVATE KEY----- diff --git "a/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/private_key.p12" "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/private_key.p12" new file mode 100644 index 00000000..5fe3b774 Binary files /dev/null and "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/private_key.p12" differ diff --git "a/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/private_key.pem" "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/private_key.pem" new file mode 100644 index 00000000..3d175879 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/private_key.pem" @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQCtCIVirh1kpxpsi9NtuICAinBuy5GaIf/MPNlwAY3BQN3og3XE +RBPfnd4tJRbN0bzyg+lVh7qJUaCAshniQtQp1P3Rb0TFWSLYc3BeF17fOUv0eco8 +9gUBG82U6AiyrLRcrswLPsH4qWgWCLgAKO8L2SAkXHhSX+am/snr4XPqDwIDAQAB +AoGBAJVK0dM3iRLL/seCyRRU6UJ+r81YhLLo/MxZ//1cydLgxdYUfqqtVjxM+GIZ +KxjACvdviwYJyo8qR4JiqGSI5oYaFrJR8Lm95136Qafimpi8aHtFVpxFGWLaRZwY +MjlHwx1JEYNThJFTFt/UBFDGZ16p1TWeogUGQKPWNyerNhpxAkEA09JvaEhPEKXx +uUpQlPGuif4ztCxaIrzIu9ehcxzZvUadbTXiM08KCLd6+09U0zWY9nJDyvceIzET +NboAVLOJKQJBANEfFbFnt4GPNLnxKdYG1qPTa6Pf838UQ608fYGPbG60bZqzHG5s +FmSjUXcMwEZz9BBdjh3eScy9bWYEWmxi6HcCQEbOOgVe3mcPQX0RlVwkaZahDYF1 +re+csXDxBHvpMfOuLiN6dpF2I0GEq6xj+VPcv7PpwDWRY1aaKfS0pzWpCfkCQQCb +CSuhAZ63i77wV43HofxBKr3zmVXBkfl2lpEJm5YtINDdTwq2BqY3aCk+VJK76L05 +4NI67JDUHF/dsT6EenOTAkBklKGVpI9RmRZtBjpty+Es5BxHzKqkY1N/mNE4FvAh +ooy1EB+k7Gc6B6VhC8BuhGWxqIRgB+L/coZ/p7h2kg9C +-----END RSA PRIVATE KEY----- diff --git "a/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/public_key.der" "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/public_key.der" new file mode 100644 index 00000000..dba11305 Binary files /dev/null and "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/public_key.der" differ diff --git "a/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/readMe.txt" "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/readMe.txt" new file mode 100755 index 00000000..d8c7cfa0 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/readMe.txt" @@ -0,0 +1,67 @@ +在iOS中使用RSA加密解密,需要用到.der和.p12后缀格式的文件,其中.der格式的文件存放的是公钥(Public key)用于加密,.p12格式的文件存放的是私钥(Private key)用于解密. 首先需要先生成这些文件,然后再将文件导入工程使用: + +一、使用openssl生成所需秘钥文件 +生成环境是在mac系统下,使用openssl进行生成,首先打开终端,按下面这些步骤依次来做: +1. 生成模长为1024bit的私钥文件private_key.pem + openssl genrsa -out private_key.pem 1024 + +2. 生成证书请求文件rsaCertReq.csr + openssl req -new -key private_key.pem -out rsaCerReq.csr + 注意:这一步会提示输入国家、省份、mail等信息,可以根据实际情况填写,或者全部不用填写,直接全部敲回车. + +3. 生成证书rsaCert.crt,并设置有效时间为1年 + openssl x509 -req -days 3650 -in rsaCerReq.csr -signkey private_key.pem -out rsaCert.crt + +4. 生成供iOS使用的公钥文件public_key.der + openssl x509 -outform der -in rsaCert.crt -out public_key.der + +5. 生成供iOS使用的私钥文件private_key.p12 + openssl pkcs12 -export -out private_key.p12 -inkey private_key.pem -in rsaCert.crt + 注意:这一步会提示给私钥文件设置密码,直接输入想要设置密码即可,然后敲回车,然后再验证刚才设置的密码,再次输入密码,然后敲回车,完毕! + 在解密时,private_key.p12文件需要和这里设置的密码配合使用,因此需要牢记此密码. + +6. 生成供Java使用的公钥rsa_public_key.pem + openssl rsa -in private_key.pem -out rsa_public_key.pem -pubout +7. 生成供Java使用的私钥pkcs8_private_key.pem + openssl pkcs8 -topk8 -in private_key.pem -out pkcs8_private_key.pem -nocrypt + + + +1, 生成private_key.pem +2, rsaCerReq.csr 证书请求文件, 公司信息 +3, 生成证书rsaCert.crt, 有限期一年 + +4, ios公public_key.der +5, ios私钥private_key.p12 密码: 123456 + +6, java公钥rsa_public_key.pem +7, java私钥pkcs8_private_key.pem + +备注: java的公钥, 私钥可以直接用 + +java公钥 +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtCIVirh1kpxpsi9NtuICAinBu +y5GaIf/MPNlwAY3BQN3og3XERBPfnd4tJRbN0bzyg+lVh7qJUaCAshniQtQp1P3R +b0TFWSLYc3BeF17fOUv0eco89gUBG82U6AiyrLRcrswLPsH4qWgWCLgAKO8L2SAk +XHhSX+am/snr4XPqDwIDAQAB +-----END PUBLIC KEY----- + + +java私钥 +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAK0IhWKuHWSnGmyL +0224gICKcG7LkZoh/8w82XABjcFA3eiDdcREE9+d3i0lFs3RvPKD6VWHuolRoICy +GeJC1CnU/dFvRMVZIthzcF4XXt85S/R5yjz2BQEbzZToCLKstFyuzAs+wfipaBYI +uAAo7wvZICRceFJf5qb+yevhc+oPAgMBAAECgYEAlUrR0zeJEsv+x4LJFFTpQn6v +zViEsuj8zFn//VzJ0uDF1hR+qq1WPEz4YhkrGMAK92+LBgnKjypHgmKoZIjmhhoW +slHwub3nXfpBp+KamLxoe0VWnEUZYtpFnBgyOUfDHUkRg1OEkVMW39QEUMZnXqnV +NZ6iBQZAo9Y3J6s2GnECQQDT0m9oSE8QpfG5SlCU8a6J/jO0LFoivMi716FzHNm9 +Rp1tNeIzTwoIt3r7T1TTNZj2ckPK9x4jMRM1ugBUs4kpAkEA0R8VsWe3gY80ufEp +1gbWo9Nro9/zfxRDrTx9gY9sbrRtmrMcbmwWZKNRdwzARnP0EF2OHd5JzL1tZgRa +bGLodwJARs46BV7eZw9BfRGVXCRplqENgXWt75yxcPEEe+kx864uI3p2kXYjQYSr +rGP5U9y/s+nANZFjVpop9LSnNakJ+QJBAJsJK6EBnreLvvBXjceh/EEqvfOZVcGR ++XaWkQmbli0g0N1PCrYGpjdoKT5UkrvovTng0jrskNQcX92xPoR6c5MCQGSUoZWk +j1GZFm0GOm3L4SzkHEfMqqRjU3+Y0TgW8CGijLUQH6TsZzoHpWELwG6EZbGohGAH +4v9yhn+nuHaSD0I= +-----END PRIVATE KEY----- diff --git "a/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsaCerReq.csr" "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsaCerReq.csr" new file mode 100644 index 00000000..9550598a --- /dev/null +++ "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsaCerReq.csr" @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIB1DCCAT0CAQAwfzELMAkGA1UEBhMCQ0ExEDAOBgNVBAgMB0JlaUppbmcxETAP +BgNVBAcMCENoYW9ZYW5nMQ0wCwYDVQQKDARHb01lMRAwDgYDVQQLDAdKaW5Lb25n +MQ0wCwYDVQQDDAROSkhVMRswGQYJKoZIhvcNAQkBFgw2NGhwQDE2My5jb20wgZ8w +DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK0IhWKuHWSnGmyL0224gICKcG7LkZoh +/8w82XABjcFA3eiDdcREE9+d3i0lFs3RvPKD6VWHuolRoICyGeJC1CnU/dFvRMVZ +IthzcF4XXt85S/R5yjz2BQEbzZToCLKstFyuzAs+wfipaBYIuAAo7wvZICRceFJf +5qb+yevhc+oPAgMBAAGgFTATBgkqhkiG9w0BCQIxBgwER29tZTANBgkqhkiG9w0B +AQsFAAOBgQA+2KZV+2DpbdfITTWwyEUxgXc+2HeAR+Vt0OMoQSbPRSHAWXI3cJAK +9jkIOR1PCGgYfOnNaTggZp9q2OUoEOITANvyVJ/PJVMOCx/Nbg0Dly3Zps3hY64d +GTdxyIzbdWorDmdVXjLiCPQsW5+JxThbvpkv1PVk2J0dyfS8ymtKrA== +-----END CERTIFICATE REQUEST----- diff --git "a/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsaCert.crt" "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsaCert.crt" new file mode 100644 index 00000000..bff2824e --- /dev/null +++ "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsaCert.crt" @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICdTCCAd4CCQD25sCQcTCoxzANBgkqhkiG9w0BAQsFADB/MQswCQYDVQQGEwJD +QTEQMA4GA1UECAwHQmVpSmluZzERMA8GA1UEBwwIQ2hhb1lhbmcxDTALBgNVBAoM +BEdvTWUxEDAOBgNVBAsMB0ppbktvbmcxDTALBgNVBAMMBE5KSFUxGzAZBgkqhkiG +9w0BCQEWDDY0aHBAMTYzLmNvbTAeFw0xODAzMjgwMTQ3NDdaFw0yODAzMjUwMTQ3 +NDdaMH8xCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdCZWlKaW5nMREwDwYDVQQHDAhD +aGFvWWFuZzENMAsGA1UECgwER29NZTEQMA4GA1UECwwHSmluS29uZzENMAsGA1UE +AwwETkpIVTEbMBkGCSqGSIb3DQEJARYMNjRocEAxNjMuY29tMIGfMA0GCSqGSIb3 +DQEBAQUAA4GNADCBiQKBgQCtCIVirh1kpxpsi9NtuICAinBuy5GaIf/MPNlwAY3B +QN3og3XERBPfnd4tJRbN0bzyg+lVh7qJUaCAshniQtQp1P3Rb0TFWSLYc3BeF17f +OUv0eco89gUBG82U6AiyrLRcrswLPsH4qWgWCLgAKO8L2SAkXHhSX+am/snr4XPq +DwIDAQABMA0GCSqGSIb3DQEBCwUAA4GBABpE1b46o/ZMzSzDlgneydcTbwBEWYJ6 +isR8PfK3iU0xPET8fOGmF800XPlbIZgf+fr02mw4EFb2oafD5lBdmoOvor+ijOhG +9/ZUSuOEk2B2eL77VVAMcwpyb8vpbdfJJcWuUzxobtf7204dwCUzDESZIsTZTIkd +wXcB3Kt4lZ3v +-----END CERTIFICATE----- diff --git "a/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsa_public_key.pem" "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsa_public_key.pem" new file mode 100644 index 00000000..f6e9e1eb --- /dev/null +++ "b/iOSProject/iOSProject/Classes/Preview3/RSA\350\257\201\344\271\246/rsa_public_key.pem" @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtCIVirh1kpxpsi9NtuICAinBu +y5GaIf/MPNlwAY3BQN3og3XERBPfnd4tJRbN0bzyg+lVh7qJUaCAshniQtQp1P3R +b0TFWSLYc3BeF17fOUv0eco89gUBG82U6AiyrLRcrswLPsH4qWgWCLgAKO8L2SAk +XHhSX+am/snr4XPqDwIDAQAB +-----END PUBLIC KEY----- diff --git a/iOSProject/iOSProject/Classes/Preview3/Toos/MJDownload/MJDownloadManager.h b/iOSProject/iOSProject/Classes/Preview3/Toos/MJDownload/MJDownloadManager.h index e6db980a..7dae86ac 100755 --- a/iOSProject/iOSProject/Classes/Preview3/Toos/MJDownload/MJDownloadManager.h +++ b/iOSProject/iOSProject/Classes/Preview3/Toos/MJDownload/MJDownloadManager.h @@ -61,7 +61,7 @@ typedef void (^MJDownloadStateChangeBlock)(MJDownloadState state, NSString *file /** 下载的错误信息 */ @property (strong, nonatomic, readonly) NSError *error; /** 下载速度 */ -@property (strong, nonatomic) NSNumber *speed; +@property (strong, nonatomic, readonly) NSNumber *speed; @end /****************** MJDownloadInfo End ******************/ @@ -77,6 +77,8 @@ typedef void (^MJDownloadStateChangeBlock)(MJDownloadState state, NSString *file @property (strong, nonatomic) NSOperationQueue *queue; /** 最大同时下载数 */ @property (assign, nonatomic) int maxDownloadingCount; +/** 存放所有文件的下载信息 */ +@property (strong, nonatomic) NSMutableArray *downloadInfoArray; + (instancetype)defaultManager; + (instancetype)manager; diff --git a/iOSProject/iOSProject/Classes/Preview3/Toos/MJDownload/MJDownloadManager.m b/iOSProject/iOSProject/Classes/Preview3/Toos/MJDownload/MJDownloadManager.m index bd9d2cb1..c1b86bfd 100755 --- a/iOSProject/iOSProject/Classes/Preview3/Toos/MJDownload/MJDownloadManager.m +++ b/iOSProject/iOSProject/Classes/Preview3/Toos/MJDownload/MJDownloadManager.m @@ -44,6 +44,8 @@ @interface MJDownloadInfo() @property (copy, nonatomic) NSString *url; /** 下载的错误信息 */ @property (strong, nonatomic) NSError *error; +/** 下载速度 */ +@property (strong, nonatomic) NSNumber *speed; /******** Readonly End ********/ /** 存放所有的进度回调 */ @@ -62,12 +64,19 @@ - (NSString *)file if (_file == nil) { _file = [[NSString stringWithFormat:@"%@/%@", MJDownloadRootDir, self.filename] prependCaches]; } - if (_file && ![[NSFileManager defaultManager] fileExistsAtPath:_file]) { - NSString *dir = [_file stringByDeletingLastPathComponent]; - [[NSFileManager defaultManager] createDirectoryAtPath:dir withIntermediateDirectories:YES attributes:nil error:nil]; + + NSString *dir = [_file stringByDeletingLastPathComponent]; // caches/rootDir/asd.mp4 + + BOOL isDir = NO; + + if (![[NSFileManager defaultManager] fileExistsAtPath:dir isDirectory:&isDir]) { + if (!isDir) { + [[NSFileManager defaultManager] createDirectoryAtPath:dir withIntermediateDirectories:YES attributes:nil error:nil]; + } + } + } - return _file; } @@ -94,7 +103,7 @@ - (NSOutputStream *)stream - (NSInteger)totalBytesWritten { - return self.file.fileSize; + return [[[NSFileManager defaultManager] attributesOfItemAtPath:self.file error:nil][NSFileSize] integerValue]; } - (NSInteger)totalBytesExpectedToWrite @@ -108,13 +117,16 @@ - (NSInteger)totalBytesExpectedToWrite - (MJDownloadState)state { // 如果是下载完毕 - if (self.totalBytesExpectedToWrite && self.totalBytesWritten == self.totalBytesExpectedToWrite) { + if (self.totalBytesExpectedToWrite > 0 && self.totalBytesWritten >= self.totalBytesExpectedToWrite) { return MJDownloadStateCompleted; } +// NSURLSessionTaskStateRunning = 0, /* The task is currently being serviced by the session */ +// NSURLSessionTaskStateSuspended = 1, +// NSURLSessionTaskStateCanceling = 2, /* The task has been told to cancel. The session will receive a URLSession:task:didCompleteWithError: message. */ +// NSURLSessionTaskStateCompleted = 3, /* The task has completed and the session will receive no more delegate notifications */ // 如果下载失败 if (self.task.error) return MJDownloadStateNone; - return _state; } @@ -159,9 +171,12 @@ - (void)notifyStateChange #pragma mark - 状态控制 - (void)setState:(MJDownloadState)state { + if (!self.task) { + return; + } + MJDownloadState oldState = _state; if (state == oldState) return; - _state = state; // 发通知 @@ -174,7 +189,6 @@ - (void)setState:(MJDownloadState)state - (void)cancel { if (self.state == MJDownloadStateCompleted || self.state == MJDownloadStateNone) return; - [self.task cancel]; self.state = MJDownloadStateNone; } @@ -184,6 +198,12 @@ - (void)cancel */ - (void)resume { +// MJDownloadStateNone = 0, // 闲置状态(除后面几种状态以外的其他状态) +// MJDownloadStateWillResume = 1, // 即将下载(等待下载) +// MJDownloadStateResumed = 2, // 下载中 +// MJDownloadStateSuspened = 3, // 暂停中 +// MJDownloadStateCompleted = 4 // 已经完全下载完毕 + if (self.state == MJDownloadStateCompleted || self.state == MJDownloadStateResumed) return; [self.task resume]; @@ -196,7 +216,6 @@ - (void)resume - (void)willResume { if (self.state == MJDownloadStateCompleted || self.state == MJDownloadStateWillResume) return; - self.state = MJDownloadStateWillResume; } @@ -220,7 +239,10 @@ - (void)didReceiveResponse:(NSHTTPURLResponse *)response { // 获得文件总长度 if (!self.totalBytesExpectedToWrite) { + NSLog(@"%@", response.allHeaderFields); + NSLog(@"==== %zd =====", (NSUInteger)response.expectedContentLength); self.totalBytesExpectedToWrite = [response.allHeaderFields[@"Content-Length"] integerValue] + self.totalBytesWritten; + // 存储文件总长度 _totalFileSizes[self.url] = @(self.totalBytesExpectedToWrite); [_totalFileSizes writeToFile:_totalFileSizesFile atomically:YES]; @@ -251,9 +273,6 @@ - (void)didCompleteWithError:(NSError *)error { // 关闭流 [self.stream close]; - self.bytesWritten = 0; - self.stream = nil; - self.task = nil; // 错误(避免nil的error覆盖掉之前设置的self.error) self.error = error ? error : self.error; @@ -263,7 +282,16 @@ - (void)didCompleteWithError:(NSError *)error // 设置状态 self.state = error ? MJDownloadStateNone : MJDownloadStateCompleted; } + + self.bytesWritten = 0; + self.stream = nil; + self.task = nil; } + +- (NSString *)description { + return [NSString stringWithFormat:@"url = %@, state = %zd", self.url, self.state]; +} + @end /****************** MJDownloadInfo End ******************/ @@ -272,8 +300,8 @@ - (void)didCompleteWithError:(NSError *)error @interface MJDownloadManager() /** session */ @property (strong, nonatomic) NSURLSession *session; -/** 存放所有文件的下载信息 */ -@property (strong, nonatomic) NSMutableArray *downloadInfoArray; +///** 存放所有文件的下载信息 */ +//@property (strong, nonatomic) NSMutableArray *downloadInfoArray; /** 是否正在批量处理 */ @property (assign, nonatomic, getter=isBatching) BOOL batching; @end @@ -350,10 +378,10 @@ - (NSOperationQueue *)queue return _queue; } -- (NSMutableArray *)downloadInfoArray +- (NSMutableArray *)downloadInfoArray { if (!_downloadInfoArray) { - self.downloadInfoArray = [NSMutableArray array]; + _downloadInfoArray = [NSMutableArray array]; } return _downloadInfoArray; } @@ -418,15 +446,29 @@ - (void)resumeFirstWillResume { if (self.isBatching) return; - MJDownloadInfo *willInfo = [self.downloadInfoArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"state==%d", MJDownloadStateWillResume]].firstObject; - [self resume:willInfo.url]; + if (self.downloadInfoArray.count > 0) { + MJDownloadInfo *willInfo = [self.downloadInfoArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"state==%d", MJDownloadStateWillResume]].firstObject; + [self resume:willInfo.url]; + } + +// @synchronized(self) { +// [self.downloadInfoArray enumerateObjectsUsingBlock:^(MJDownloadInfo * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { +// +// if (obj.state == MJDownloadStateWillResume) { +// [self resume:obj.url]; +// *stop = YES; +// } +// }]; +// } } - (void)cancelAll { + self.batching = YES; [self.downloadInfoArray enumerateObjectsUsingBlock:^(MJDownloadInfo *info, NSUInteger idx, BOOL *stop) { [self cancel:info.url]; }]; + self.batching = NO; } + (void)cancelAll @@ -436,6 +478,7 @@ + (void)cancelAll - (void)suspendAll { + // 暂停 self.batching = YES; [self.downloadInfoArray enumerateObjectsUsingBlock:^(MJDownloadInfo *info, NSUInteger idx, BOOL *stop) { [self suspend:info.url]; @@ -450,9 +493,11 @@ + (void)suspendAll - (void)resumeAll { + self.batching = YES; [self.downloadInfoArray enumerateObjectsUsingBlock:^(MJDownloadInfo *info, NSUInteger idx, BOOL *stop) { [self resume:info.url]; }]; + self.batching = NO; } + (void)resumeAll @@ -464,8 +509,11 @@ - (void)cancel:(NSString *)url { if (url == nil) return; + // 获得下载信息 + MJDownloadInfo *info = [self downloadInfoForURL:url]; + // 取消 - [[self downloadInfoForURL:url] cancel]; + [info cancel]; // 这里不需要取出第一个等待下载的,因为调用cancel会触发-URLSession:task:didCompleteWithError: // [self resumeFirstWillResume]; @@ -475,8 +523,11 @@ - (void)suspend:(NSString *)url { if (url == nil) return; + // 获得下载信息 + MJDownloadInfo *info = [self downloadInfoForURL:url]; + // 暂停 - [[self downloadInfoForURL:url] suspend]; + [info suspend]; // 取出第一个等待下载的 [self resumeFirstWillResume]; @@ -489,14 +540,35 @@ - (void)resume:(NSString *)url // 获得下载信息 MJDownloadInfo *info = [self downloadInfoForURL:url]; - // 正在下载的 - NSArray *downloadingDownloadInfoArray = [self.downloadInfoArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"state==%d", MJDownloadStateResumed]]; - if (self.maxDownloadingCount && downloadingDownloadInfoArray.count == self.maxDownloadingCount) { - // 等待下载 - [info willResume]; - } else { - // 继续 - [info resume]; + // 状态已经在下载啦 + if (info.state == MJDownloadStateResumed) { + return; + } + + // 下载中的 +// NSArray *downloadingDownloadInfoArray = [self.downloadInfoArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"state==%d", MJDownloadStateResumed]]; + + // 加锁, 多个线程同时访问就不准确了 + @synchronized(self) { + if (self.downloadInfoArray.count == 0) { + return; + } + + // 需要调用 getter 方法 + NSArray *downloadingDownloadInfoArrayM = [self.downloadInfoArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"state==%d", MJDownloadStateResumed]]; + if (self.maxDownloadingCount > 0 && downloadingDownloadInfoArrayM.count >= self.maxDownloadingCount) { + // 等待下载 + [info willResume]; + } else { + // MJ Bug fix + // 出错以后就没有 task 了...bug fix, 下载失败重新下载 + if (info.error && !info.task) { + [info setupTask:self.session]; + } + // 继续 + [info resume]; + } + } } @@ -504,13 +576,15 @@ - (void)resume:(NSString *)url - (MJDownloadInfo *)downloadInfoForURL:(NSString *)url { if (url == nil) return nil; - + // 加锁, 防止多个线程同时下载一个 URL + [_lock lock]; MJDownloadInfo *info = [self.downloadInfoArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"url==%@", url]].firstObject; if (info == nil) { info = [[MJDownloadInfo alloc] init]; info.url = url; // 设置url [self.downloadInfoArray addObject:info]; } + [_lock unlock]; return info; } diff --git a/iOSProject/iOSProject/Classes/Preview3/View/LMJCircleLayout.h b/iOSProject/iOSProject/Classes/Preview3/View/LMJCircleLayout.h new file mode 100644 index 00000000..316fc53c --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/View/LMJCircleLayout.h @@ -0,0 +1,32 @@ +// +// LMJCircleLayout.h +// 自定义流水布局-22 +// +// Created by apple on 16/7/30. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import + +@class LMJCircleLayout; + +@protocol LMJCircleLayoutDelegate +@optional +/** + 返回 item 的大小, 默认 64 + */ +- (CGSize)circleLayout:(LMJCircleLayout *)circleLayout collectionView:(UICollectionView *)collectionView sizeForItemAtIndexPath:(NSIndexPath *)indexPath; + +/** + 返回 item 对应的半径 , 默认120 + */ +- (CGFloat)circleLayout:(LMJCircleLayout *)circleLayout collectionView:(UICollectionView *)collectionView radiusForItemAtIndexPath:(NSIndexPath *)indexPath; +@end + +@interface LMJCircleLayout : UICollectionViewLayout + +- (instancetype)initWithDelegate:(id)delegate; + ++ (instancetype)circleLayoutWithDelegate:(id)delegate; + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/View/LMJCircleLayout.m b/iOSProject/iOSProject/Classes/Preview3/View/LMJCircleLayout.m new file mode 100644 index 00000000..ddb95eea --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/View/LMJCircleLayout.m @@ -0,0 +1,133 @@ +// +// LMJCircleLayout.m +// 自定义流水布局-22 +// +// Created by apple on 16/7/30. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import "LMJCircleLayout.h" + +static const CGSize LMJ_itemSize_ = {64, 64}; +static const CGFloat LMJ_radius_ = 120; +@interface LMJCircleLayout () +/** <#digest#> */ +@property (nonatomic, strong) NSMutableArray *atrbsArray; + +- (CGSize)itemSizeAtIndexPath:(NSIndexPath *)indexPath; + +- (CGFloat)radiusAtIndexPath:(NSIndexPath *)indexPath; + +@end + +@implementation LMJCircleLayout + +- (NSMutableArray *)atrbsArray +{ + if(_atrbsArray == nil) + { + _atrbsArray = [NSMutableArray array]; + } + return _atrbsArray; +} + +- (void)prepareLayout +{ + [super prepareLayout]; + + [self.atrbsArray removeAllObjects]; + + NSUInteger count = [self.collectionView numberOfItemsInSection:0]; + + for (NSInteger i = 0; i < count; i++) { + + UICollectionViewLayoutAttributes *atrb = [self layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]]; + + [self.atrbsArray addObject:atrb]; + } + +} + + + +- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath +{ + UICollectionViewLayoutAttributes *newAtrb = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; + + CGSize size = [self itemSizeAtIndexPath:indexPath]; + + size.width = ceilf(size.width); + size.height = ceilf(size.height); + + // center + CGPoint oCenter = CGPointMake(self.collectionView.frame.size.width * 0.5, self.collectionView.frame.size.height * 0.5); + + // 360°, 平均度数 + CGFloat angle = M_PI * 2 / [self.collectionView numberOfItemsInSection:0] * indexPath.item; + + // 半径 + CGFloat radius = [self radiusAtIndexPath:indexPath]; + + CGFloat realX = oCenter.x + sin(angle) * radius; + CGFloat realY = oCenter.y - cos(angle) * radius; + + newAtrb.size = size; + + if([self.collectionView numberOfItemsInSection:0] == 1) + { + newAtrb.center = oCenter; + } + else + { + newAtrb.center = CGPointMake(realX, realY); + } + return newAtrb; +} + +- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect +{ + return self.atrbsArray; +} + +- (CGSize)collectionViewContentSize +{ + return self.collectionView.frame.size; +} + + +#pragma mark - getter +- (CGSize)itemSizeAtIndexPath:(NSIndexPath *)indexPath +{ + if ([self.delegate respondsToSelector:@selector(circleLayout:collectionView:sizeForItemAtIndexPath:)]) { + return [self.delegate circleLayout:self collectionView:self.collectionView sizeForItemAtIndexPath:indexPath]; + } + return LMJ_itemSize_; +} + +- (CGFloat)radiusAtIndexPath:(NSIndexPath *)indexPath +{ + if ([self.delegate respondsToSelector:@selector(circleLayout:collectionView:radiusForItemAtIndexPath:)]) { + return [self.delegate circleLayout:self collectionView:self.collectionView radiusForItemAtIndexPath:indexPath]; + } + return LMJ_radius_; +} + +#pragma mark - delegate + +- (id)delegate +{ + return (id)self.collectionView.dataSource; +} + +- (instancetype)initWithDelegate:(id)delegate { + if (self = [super init]) { + + } + return self; +} + ++ (instancetype)circleLayoutWithDelegate:(id)delegate { + return [[self alloc] initWithDelegate:delegate]; +} + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/View/LMJExpandHeader.h b/iOSProject/iOSProject/Classes/Preview3/View/LMJExpandHeader.h index 5d98b74b..f0c829b1 100755 --- a/iOSProject/iOSProject/Classes/Preview3/View/LMJExpandHeader.h +++ b/iOSProject/iOSProject/Classes/Preview3/View/LMJExpandHeader.h @@ -7,7 +7,7 @@ #import #import "LMJExpandImageView.h" -@interface LMJExpandHeader : NSObject +@interface LMJExpandHeader : NSObject #pragma mark - 类方法 /** @@ -30,12 +30,6 @@ */ - (void)expandWithScrollView:(UIScrollView*)scrollView expandView:(UIView*)expandView; -/** - * 监听scrollViewDidScroll方法 - * - * @param scrollView - */ -- (void)scrollViewDidScroll:(UIScrollView*)scrollView; /** 头部视图 */ @property (weak, nonatomic, readonly) UIView *headerView; diff --git a/iOSProject/iOSProject/Classes/Preview3/View/LMJExpandHeader.m b/iOSProject/iOSProject/Classes/Preview3/View/LMJExpandHeader.m index 50bfedf8..71d250f5 100755 --- a/iOSProject/iOSProject/Classes/Preview3/View/LMJExpandHeader.m +++ b/iOSProject/iOSProject/Classes/Preview3/View/LMJExpandHeader.m @@ -2,11 +2,8 @@ // LMJExpandHeader.m // -#define CExpandContentOffset @"contentOffset" - #import "LMJExpandHeader.h" - @interface LMJExpandHeader () /** <#digest#> */ @@ -39,51 +36,51 @@ + (instancetype)expandWithScrollView:(UIScrollView*)scrollView expandView:(UIVie - (void)expandWithScrollView:(UIScrollView*)scrollView expandView:(UIView*)expandView{ + _scrollView = scrollView; + _expandView = expandView; _expandHeight = CGRectGetHeight(expandView.frame); - _scrollView = scrollView; + [_scrollView insertSubview:expandView atIndex:0]; - _originTop = _scrollView.contentInset.top; + UIEdgeInsets edgeInsets = _scrollView.contentInset; + _originTop = edgeInsets.top; + + edgeInsets.top += _expandHeight; + _scrollView.contentInset = edgeInsets; + [_scrollView setContentOffset:CGPointMake(0, -edgeInsets.top)]; - _scrollView.contentInset = UIEdgeInsetsMake(_expandHeight + _originTop, _scrollView.contentInset.left, _scrollView.contentInset.bottom, _scrollView.contentInset.right); - [_scrollView insertSubview:expandView atIndex:0]; - [_scrollView addObserver:self forKeyPath:CExpandContentOffset options:NSKeyValueObservingOptionNew context:nil]; - [_scrollView setContentOffset:CGPointMake(0, -_expandHeight - _originTop)]; - - _expandView = expandView; //使View可以伸展效果 重要属性 - _expandView.contentMode= UIViewContentModeScaleAspectFill; + _expandView.contentMode = UIViewContentModeScaleAspectFill; _expandView.clipsToBounds = YES; - [self reSizeView]; - + [_scrollView addObserver:self forKeyPath:LMJKeyPath(_scrollView, contentOffset) options:NSKeyValueObservingOptionNew context:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeObserver) name:LMJTableViewControllerDeallocNotification object:_scrollView.viewController]; } - (void)removeObserver { if (_scrollView) { - [_scrollView removeObserver:self forKeyPath:CExpandContentOffset]; - + [_scrollView removeObserver:self forKeyPath:LMJKeyPath(_scrollView, contentOffset)]; [[NSNotificationCenter defaultCenter] removeObserver:self name:LMJTableViewControllerDeallocNotification object:_scrollView.viewController]; - _scrollView = nil; } _expandView = nil; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ - if (![keyPath isEqualToString:CExpandContentOffset]) { - return; + if ([keyPath isEqualToString:LMJKeyPath(_scrollView, contentOffset)] && object == _scrollView) { + [self scrollViewDidScroll:_scrollView]; } - [self scrollViewDidScroll:_scrollView]; } -- (void)scrollViewDidScroll:(UIScrollView*)scrollView -{ - +/** + * 监听scrollViewDidScroll方法 + * + * @param scrollView + */ +- (void)scrollViewDidScroll:(UIScrollView*)scrollView { CGFloat offsetY = scrollView.contentOffset.y; if(offsetY < (_expandHeight + _originTop) * -1) { CGRect currentFrame = _expandView.frame; @@ -91,14 +88,11 @@ - (void)scrollViewDidScroll:(UIScrollView*)scrollView currentFrame.size.height = -1*(offsetY + _originTop); _expandView.frame = currentFrame; } - } - (void)reSizeView{ - //重置_expandView位置 [_expandView setFrame:CGRectMake(0, -1*(_expandHeight), CGRectGetWidth(_expandView.frame), _expandHeight)]; - } - (UIView *)headerView diff --git a/iOSProject/iOSProject/Classes/Preview3/View/LMJGirdLayout.h b/iOSProject/iOSProject/Classes/Preview3/View/LMJGirdLayout.h new file mode 100644 index 00000000..02f15830 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/View/LMJGirdLayout.h @@ -0,0 +1,13 @@ +// +// LMJGirdLayout.h +// 自定义流水布局-22 +// +// Created by apple on 16/7/30. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import + +@interface LMJGirdLayout : UICollectionViewLayout + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/View/LMJGirdLayout.m b/iOSProject/iOSProject/Classes/Preview3/View/LMJGirdLayout.m new file mode 100644 index 00000000..7707bcc6 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/View/LMJGirdLayout.m @@ -0,0 +1,112 @@ +// +// LMJGirdLayout.m +// 自定义流水布局-22 +// +// Created by apple on 16/7/30. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import "LMJGirdLayout.h" +#define LMJXX(x) floorf(x) +#define LMJXS(s) ceilf(s) + +@interface LMJGirdLayout () +/** 所有的模型数据 */ +@property (nonatomic, strong) NSMutableArray *array; +@end + +@implementation LMJGirdLayout + + +- (NSMutableArray *)array +{ + if(_array == nil) + { + _array = [NSMutableArray array]; + } + return _array; +} + +- (void)prepareLayout +{ + [super prepareLayout]; + + NSLog(@"------------------"); + [self.array removeAllObjects]; + + NSUInteger count = [self.collectionView numberOfItemsInSection:0]; + + for (NSInteger i = 0; i < count; i++) { + UICollectionViewLayoutAttributes *atrb = [self layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]]; + [self.array addObject:atrb]; + } +} + +- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath +{ + NSInteger i = indexPath.item; + + UICollectionViewLayoutAttributes *atrb = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:[NSIndexPath indexPathForItem:i inSection:0]]; + + CGFloat width = LMJXX(self.collectionView.frame.size.width * 0.5); + + CGFloat height = width; + + CGFloat x = 0; + CGFloat y = 0; + + if(i == 0) + { + x = 0; + y = 0; + }else if (i == 1) + { + x = width; + y = 0; + height = width / 2; + }else if (i == 2) + { + x = width; + y = height / 2; + height = width / 2; + }else if (i == 3) + { + x = 0; + y = height; + height = width / 2; + }else if (i == 4) + { + x = 0; + y = height + height / 2; + height = width/2; + }else if (i == 5) + { + x = width; + y = height; + }else + { + + UICollectionViewLayoutAttributes *lastAtrb = self.array[i - 6]; + x = lastAtrb.frame.origin.x; + y = lastAtrb.frame.origin.y + height * 2; + width = lastAtrb.frame.size.width; + height = lastAtrb.frame.size.height; + } + + atrb.frame = CGRectMake(x, y, width, height); + + return atrb; +} +- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect +{ + return self.array; +} + +- (CGSize)collectionViewContentSize +{ + UICollectionViewLayoutAttributes *lastAtrb = self.array.lastObject; + UICollectionViewLayoutAttributes *preLastAtrb = self.array[self.array.count - 2]; + + return CGSizeMake(0, MAX(CGRectGetMaxY(lastAtrb.frame), CGRectGetMaxY(preLastAtrb.frame))); +} +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/View/LMJLineFlowLayout.h b/iOSProject/iOSProject/Classes/Preview3/View/LMJLineFlowLayout.h new file mode 100644 index 00000000..c2d5fef2 --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/View/LMJLineFlowLayout.h @@ -0,0 +1,24 @@ +// +// LMJLineFlowLayout.h +// 自定义流水布局-22 +// +// Created by apple on 16/7/30. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import + +@class LMJLineFlowLayout; + +@protocol LMJLineFlowLayoutDelegate +@optional + +@end + +@interface LMJLineFlowLayout : UICollectionViewFlowLayout + +- (instancetype)initWithDelegate:(id)delegate; + ++ (instancetype)lineLayoutWithDelegate:(id)delegate; + +@end diff --git a/iOSProject/iOSProject/Classes/Preview3/View/LMJLineFlowLayout.m b/iOSProject/iOSProject/Classes/Preview3/View/LMJLineFlowLayout.m new file mode 100644 index 00000000..aac3d51b --- /dev/null +++ b/iOSProject/iOSProject/Classes/Preview3/View/LMJLineFlowLayout.m @@ -0,0 +1,116 @@ +// +// LMJLineFlowLayout.m +// 自定义流水布局-22 +// +// Created by apple on 16/7/30. +// Copyright © 2016年 NJHu. All rights reserved. +// + +#import "LMJLineFlowLayout.h" +static const CGSize LMJ_itemSize_ = {140, 140}; + +@interface LMJLineFlowLayout () + +@end + +@implementation LMJLineFlowLayout + +//判定为布局需要被无效化并重新计算的时候,布局对象会被询问以提供新的布局。 +- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds { + return YES; +} + +//系统在准备对item进行布局前会调用这个方法,我们重写这个方法之后可以在方法里面预先设置好需要用到的变量属 +- (void)prepareLayout +{ + [super prepareLayout]; + CGFloat inset = self.collectionView.frame.size.width - self.itemSize.width; + self.sectionInset = UIEdgeInsetsMake(0, inset * 0.5, 0, inset * 0.5); +} + + +//为所有item返回一个layout attributes数组,数组中元素的类型为UICollectionViewLayoutAttributes。UICollectionViewLayoutAttributes记录了一个layout的位置、大小、透明度等信息 +- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect +{ + NSArray *attrbArray = [super layoutAttributesForElementsInRect:rect]; + + CGFloat collectionViewCenterX = self.collectionView.contentOffset.x + self.collectionView.frame.size.width * 0.5; + + [attrbArray enumerateObjectsUsingBlock:^(UICollectionViewLayoutAttributes * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + + CGFloat delta = ABS(obj.center.x - collectionViewCenterX); + + CGFloat scale = 1.05 - delta / self.collectionView.frame.size.width; + + obj.transform3D = CATransform3DMakeScale(scale, scale, scale); + +// obj.transform3D = CATransform3DRotate(obj.transform3D, scale * M_PI_4, 0.5, 0.5, 0.5); + + }]; + return attrbArray; +} + + +/** + 停下来停最大的 + */ +- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity +{ + NSArray *atrbs = [self layoutAttributesForElementsInRect:CGRectMake(proposedContentOffset.x, proposedContentOffset.y, self.collectionView.frame.size.width, self.collectionView.frame.size.height)]; + + CGFloat collectionCenterX = proposedContentOffset.x + self.collectionView.frame.size.width * 0.5; + + __block CGFloat minDelta = MAXFLOAT; + + [atrbs enumerateObjectsUsingBlock:^(UICollectionViewLayoutAttributes * _Nonnull atrb, NSUInteger idx, BOOL * _Nonnull stop) { + + if(ABS(minDelta) > ABS(atrb.center.x - collectionCenterX)) + { + minDelta = atrb.center.x - collectionCenterX; + } + }]; + + proposedContentOffset.x += minDelta; + + return proposedContentOffset; +} + +//为一个特定的item返回layout attribute。注意,返回的attribute仅使用cell,不包括supplementary view和decoration view +- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath +{ + UICollectionViewLayoutAttributes *atrbs = [super layoutAttributesForItemAtIndexPath:indexPath]; + return atrbs; +} + + +#pragma mark - LMJLineFlowLayoutDelegate + +- (id)delegate +{ + return (id)self.collectionView.dataSource; +} + +- (instancetype)init +{ + self = [super init]; + if (self) { + self.scrollDirection = UICollectionViewScrollDirectionHorizontal; + self.minimumInteritemSpacing = MAXFLOAT; + self.itemSize = LMJ_itemSize_; + } + return self; +} + +- (instancetype)initWithDelegate:(id)delegate +{ + if (self = [self init]) { + } + return self; +} + ++ (instancetype)lineLayoutWithDelegate:(id)delegate +{ + return [[self alloc] initWithDelegate:delegate]; +} + +@end diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Controller/MUSHomeListViewController.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Controller/MUSHomeListViewController.m" index 0551d83a..64a563b2 100644 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Controller/MUSHomeListViewController.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Controller/MUSHomeListViewController.m" @@ -10,10 +10,8 @@ #import "MUSPlayingViewController.h" #import "MUSMusicCell.h" #import "QQMusicOperationTool.h" -#import "MUSAnimationTool.h" #import "NeteaseMusicAPI.h" - @interface MUSHomeListViewController () @end @@ -22,15 +20,16 @@ @implementation MUSHomeListViewController - (void)viewDidLoad { [super viewDidLoad]; - self.navigationItem.title = @"音乐"; - self.tableView.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"QQListBack"]]; - } -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ +- (void)dealloc { + NSLog(@"%s", __func__); + [[QQMusicOperationTool shareInstance] stopCurrentMusic]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return QQMusicOperationTool.shareInstance.musicMList.count; } @@ -46,8 +45,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - [MUSAnimationTool animate:cell type:MUSAnimationTypeTranslation]; - [MUSAnimationTool animate:cell type:MUSAnimationTypeRotation]; +// [MUSAnimationTool animate:cell type:MUSAnimationTypeTranslation]; +// [MUSAnimationTool animate:cell type:MUSAnimationTypeRotation]; return cell; } @@ -74,9 +73,7 @@ - (void)searchMusic UITextField *textField = (UITextField *)self.lmj_navgationBar.titleView; NSString *searchMusicText = textField.text; - NSLog(@"%@", searchMusicText); - [NeteaseMusicAPI searchWithQuery:@"经典老歌" type:NMSearch_PlayList offset:0 limit:3 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (!error) { @@ -84,9 +81,7 @@ - (void)searchMusic } NSLog(@"%@", response); NSLog(@"%@", error); - }]; - } diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Controller/MUSPlayingViewController.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Controller/MUSPlayingViewController.m" index c344ff4d..ed02b8f5 100644 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Controller/MUSPlayingViewController.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Controller/MUSPlayingViewController.m" @@ -79,9 +79,7 @@ @implementation MUSPlayingViewController /** 歌词控制器*/ - (MUSLrcTableViewController *)lrcTVC{ - if (_lrcTVC == nil) { - _lrcTVC = [[MUSLrcTableViewController alloc] init]; [self addChildViewController:_lrcTVC]; } @@ -94,22 +92,18 @@ - (MUSLrcTableViewController *)lrcTVC{ - (void)viewDidLoad { [super viewDidLoad]; - [self setUpViewOnce]; - // 监听播放完毕后的通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(nextMusic:) name:kPlayFinishNotificationName object:nil]; - // 给进度条添加一个手势 - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sliderTap:)]; - self.tap = tap; - [self.progressSlider addGestureRecognizer:tap]; + [self setUpDataOnce]; + + [self addTimer]; + + [self addDisplayLink]; } - (void)dealloc{ - - //NSLog(@"移除监听"); - // 移除监听 [[NSNotificationCenter defaultCenter] removeObserver:self]; } @@ -120,18 +114,12 @@ - (void)viewDidLayoutSubviews{ } -- (void)viewWillAppear:(BOOL)animated{ - [super viewWillDisappear:animated]; - - [self setUpDataOnce]; - - [self addTimer]; - - [self addDisplayLink]; +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; } -- (void)viewWillDisappear:(BOOL)animated{ - [super viewWillDisappear:animated]; +- (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; [self removeTimer]; @@ -165,7 +153,6 @@ - (void) setUpForeImageView { - (void)addLrcView{ // 歌词视图 - [self.lrcBackView addSubview:self.lrcTVC.view]; // 歌词的背景视图 @@ -256,45 +243,31 @@ - (IBAction)playOrPauseMusic:(UIButton *)sender { /** 上一首*/ - (IBAction)preMusic:(UIButton *)sender { - [[QQMusicOperationTool shareInstance] preMusic]; - - [self setUpDataOnce]; + if ([[QQMusicOperationTool shareInstance] preMusic]) { + [self setUpDataOnce]; + } } /** 下一首*/ - (IBAction)nextMusic:(UIButton *)sender { - self.progressSlider.value = 0.0; - self.costTimeLabel.text = @"00:00"; - - [[QQMusicOperationTool shareInstance] nextMusic]; - - [self setUpDataOnce]; + if ([[QQMusicOperationTool shareInstance] nextMusic]) { + [self setUpDataOnce]; + } } -/** 点击了关闭按钮*/ -- (IBAction)closeButtonDidClicked:(UIButton *)sender { - - [self.navigationController popViewControllerAnimated:YES]; -} #pragma mark -------------------------- #pragma mark 进度条监听 - (IBAction)sliderDidTouchDown:(UISlider *)sender { - - [self.progressSlider removeGestureRecognizer:self.tap]; - // 移除定时器 [self removeTimer]; } - (IBAction)sliderDidTouchUp:(UISlider *)sender { - [self.progressSlider addGestureRecognizer:self.tap]; - // 控制当前的播放进度 - // 1.添加定时器 [self addTimer]; @@ -330,32 +303,6 @@ - (IBAction)sliderDidValueChange:(UISlider *)sender { //NSLog(@"%lf", sender.value); } -/** 进度条手势操作*/ -- (void)sliderTap:(UITapGestureRecognizer *)sender{ - - // 1.获取手势在进度条上的位置 - CGPoint point = [sender locationInView:self.progressSlider]; - - // 2.当前的位置x, 与进度条的总长度构成的一个比例, 就可以当做当前进度条的值 - CGFloat scale = 1.0 * point.x / self.progressSlider.lmj_width; - - // 3.设置进图条的值 - self.progressSlider.value = scale; - - // 4. 总时长 - NSTimeInterval totalTime = [[QQMusicOperationTool shareInstance] getNewMusicMessageModel].totalTime; - - // 5. 当前时间 - NSTimeInterval currentTime = self.progressSlider.value * totalTime; - - // 6.设置当前播放进度 - [[QQMusicOperationTool shareInstance] seekTo:currentTime]; - - [self addTimer]; - -} - - #pragma mark -------------------------- #pragma mark 界面数据变化 @@ -381,6 +328,10 @@ - (void)setUpDataOnce{ self.lmj_navgationBar.title = [self changeTitle:[musicMessageModel.musicM.name stringByAppendingFormat:@"\n%@", musicMessageModel.musicM.singer]]; + // 进度恢复成0 + self.progressSlider.value = 0.0; + // 播放时长是0 + self.costTimeLabel.text = @"00:00"; // 总时长 self.totalTimeLabel.text = musicMessageModel.totalTimeFormat; @@ -443,8 +394,7 @@ - (void)updateLrc{ // 7.设置锁屏信息 // 前台不更新, 进入后台之后才更新 UIApplicationState state = [UIApplication sharedApplication].applicationState; - if (state & UIApplicationStateBackground) { - + if (state == UIApplicationStateBackground) { [[QQMusicOperationTool shareInstance] setUpLockMessage]; } } @@ -542,12 +492,9 @@ - (void)remoteControlReceivedWithEvent:(UIEvent *)event{ - - - #pragma mark - LMJNavUIBaseViewControllerDataSource -- (UIStatusBarStyle)navUIBaseViewControllerPreferStatusBarStyle:(LMJNavUIBaseViewController *)navUIBaseViewController +- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; } @@ -565,27 +512,12 @@ - (BOOL)lmjNavigationIsHideBottomLine:(LMJNavigationBar *)navigationBar return YES; } -/** 导航条左边的按钮 */ -- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar -{ - [leftButton setTitle:@"back" forState:UIControlStateNormal]; - [leftButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - - return nil; -} -/** 导航条右边的按钮 */ -- (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar -{ -// [rightButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; - - return [UIImage imageNamed:@"main_tab_more"]; -} - (NSMutableAttributedString *)changeTitle:(NSString *)curTitle { NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:curTitle ?: @""]; - [title addAttribute:NSForegroundColorAttributeName value:[UIColor RandomColor] range:NSMakeRange(0, title.length)]; + [title addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, title.length)]; [title addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, title.length)]; @@ -593,24 +525,19 @@ - (NSMutableAttributedString *)changeTitle:(NSString *)curTitle } +#pragma mark - LMJNavUIBaseViewControllerDataSource -#pragma mark - LMJNavUIBaseViewControllerDelegate +/** 导航条左边的按钮 */ +- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar +{ + [leftButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; + + return [UIImage imageNamed:@"NavgationBar_white_back"]; +} /** 左边的按钮的点击 */ -(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { [self.navigationController popViewControllerAnimated:YES]; } -/** 右边的按钮的点击 */ --(void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ - NSLog(@"%s", __func__); -} -/** 中间如果是 label 就会有点击 */ --(void)titleClickEvent:(UILabel *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ - -} - - @end diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicMessageModel.h" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicMessageModel.h" index 66b63681..8c2663c1 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicMessageModel.h" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicMessageModel.h" @@ -26,9 +26,9 @@ #pragma mark -------------------------- #pragma mark 时间格式 /** 当前播放时长 字符串格式*/ -@property (nonatomic, strong) NSString *costTimeFormat; +@property (nonatomic, strong, readonly) NSString *costTimeFormat; /** 歌曲总时长 字符串格式*/ -@property (nonatomic, strong) NSString *totalTimeFormat; +@property (nonatomic, strong, readonly) NSString *totalTimeFormat; @end diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicModel.h" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicModel.h" index 0047b762..63d2be78 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicModel.h" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicModel.h" @@ -8,6 +8,8 @@ #import +#define QQResources(file) [@"QQResources.bundle/" stringByAppendingString:file] + @interface QQMusicModel : NSObject #pragma mark -------------------------- @@ -31,7 +33,4 @@ /** 专辑图片*/ @property (nonatomic, strong) NSString *icon; - - - @end diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicModel.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicModel.m" index f8ec0271..d8de13fb 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicModel.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Model/QQMusicModel.m" @@ -10,6 +10,20 @@ @implementation QQMusicModel +- (void)setSingerIcon:(NSString *)singerIcon { + _singerIcon = QQResources([@"Images" stringByAppendingPathComponent:singerIcon]); +} +- (void)setLrcname:(NSString *)lrcname { + _lrcname = QQResources([@"Lrcs" stringByAppendingPathComponent:lrcname]); +} + +- (void)setFilename:(NSString *)filename { + _filename = QQResources([@"MP3s" stringByAppendingPathComponent:filename]); +} + +- (void)setIcon:(NSString *)icon { + _icon = QQResources([@"Images" stringByAppendingPathComponent:icon]); +} @end diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Other/MUSAnimationTool.h" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Other/MUSAnimationTool.h" deleted file mode 100644 index a266ce32..00000000 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Other/MUSAnimationTool.h" +++ /dev/null @@ -1,22 +0,0 @@ -// -// MUSAnimationTool.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/27. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import - -typedef enum : NSUInteger { - MUSAnimationTypeTranslation, - MUSAnimationTypeRotation, -} MUSAnimationType; - -@interface MUSAnimationTool : NSObject - -+ (void)animate:(UIView *)view type:(MUSAnimationType)type; - - - -@end diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Other/MUSAnimationTool.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Other/MUSAnimationTool.m" deleted file mode 100644 index becdb51c..00000000 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Other/MUSAnimationTool.m" +++ /dev/null @@ -1,78 +0,0 @@ -// -// MUSAnimationTool.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/27. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "MUSAnimationTool.h" - -@implementation MUSAnimationTool - -+ (void)animate:(UIView *)view type:(MUSAnimationType)type -{ - - if (type == MUSAnimationTypeTranslation) { - - [view.layer removeAnimationForKey:@"translation"]; - - CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"]; - - animation.values = @[@(YYScreenSize().width), @0]; - - animation.duration = 0.3; - - [view.layer addAnimation:animation forKey:@"translation"]; - - }else if (type == MUSAnimationTypeRotation) - { - [view.layer removeAnimationForKey:@"rotation"]; - - CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.x"]; - - animation.values = @[@(-M_PI / 6), @0, @(M_PI / 6), @0]; - - animation.duration = 0.3; - - animation.repeatCount = 2; - - [view.layer addAnimation:animation forKey:@"rotation"]; - } - - - /* - - func animation(type: AnimationType) - { - - if type == .Rotation - { - self.layer.removeAnimationForKey("rotation") - - let animation = CAKeyframeAnimation(keyPath: "transform.rotation.x") - animation.values = [-M_PI / 4, 0, M_PI / 4, 0] - animation.duration = 0.5 - animation.repeatCount = 2 - self.layer.addAnimation(animation, forKey: "rotation") - } - - - if type == .Translation - { - self.layer.removeAnimationForKey("translation") - - let animation = CAKeyframeAnimation(keyPath: "transform.translation.x") - animation.values = [UIScreen.mainScreen().bounds.width, 0] - animation.duration = 0.2 - - self.layer.addAnimation(animation, forKey: "translation") - } - - - } - - */ -} - -@end diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/bb@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/bb@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/bb@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/bb@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/bb_icon@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/bb_icon@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/bb_icon@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/bb_icon@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/dzq@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/dzq@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/dzq@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/dzq@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/dzq_icon@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/dzq_icon@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/dzq_icon@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/dzq_icon@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/eason@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/eason@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/eason@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/eason@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/eason_icon@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/eason_icon@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/eason_icon@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/eason_icon@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/jay@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/jay@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/jay@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/jay@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/jay_icon@2x.png" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/jay_icon@2x.png" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/jay_icon@2x.png" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/jay_icon@2x.png" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/jj@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/jj@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/jj@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/jj@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/jj_icon@2x.png" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/jj_icon@2x.png" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/jj_icon@2x.png" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/jj_icon@2x.png" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/kzxd@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/kzxd@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/kzxd@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/kzxd@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/kzxd_icon@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/kzxd_icon@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/kzxd_icon@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/kzxd_icon@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/lkq@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/lkq@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/lkq@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/lkq@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/lkq_icon@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/lkq_icon@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/lkq_icon@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/lkq_icon@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/nanquan@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/nanquan@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/nanquan@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/nanquan@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/nanquan_icon@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/nanquan_icon@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/nanquan_icon@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/nanquan_icon@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/wf@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/wf@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/wf@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/wf@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/wf_icon@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/wf_icon@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/wf_icon@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/wf_icon@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/zxy@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/zxy@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/zxy@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/zxy@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/zxy_icon@2x.jpg" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/zxy_icon@2x.jpg" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Images/zxy_icon@2x.jpg" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Images/zxy_icon@2x.jpg" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/10405520.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/10405520.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/10405520.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/10405520.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/10736444.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/10736444.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/10736444.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/10736444.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/120125029.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/120125029.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/120125029.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/120125029.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/12309111.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/12309111.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/12309111.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/12309111.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/14945107.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/14945107.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/14945107.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/14945107.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/235319.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/235319.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/235319.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/235319.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/255319.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/255319.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/255319.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/255319.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/309769.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/309769.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/309769.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/309769.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/339744.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/339744.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/339744.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/339744.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/\346\234\210\345\215\212\345\260\217\345\244\234\346\233\262.lrc" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/\346\234\210\345\215\212\345\260\217\345\244\234\346\233\262.lrc" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Lrcs/\346\234\210\345\215\212\345\260\217\345\244\234\346\233\262.lrc" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Lrcs/\346\234\210\345\215\212\345\260\217\345\244\234\346\233\262.lrc" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/10405520.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/10405520.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/10405520.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/10405520.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/10736444.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/10736444.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/10736444.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/10736444.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/1201111234.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/1201111234.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/1201111234.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/1201111234.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/120125029.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/120125029.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/120125029.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/120125029.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/12309111.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/12309111.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/12309111.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/12309111.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/14945107.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/14945107.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/14945107.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/14945107.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/235319.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/235319.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/235319.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/235319.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/255319.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/255319.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/255319.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/255319.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/309769.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/309769.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/309769.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/309769.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/339744.mp3" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/339744.mp3" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/MP3s/339744.mp3" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/MP3s/339744.mp3" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Musics.plist" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Musics.plist" similarity index 100% rename from "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources/Musics.plist" rename to "iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/QQResources.bundle/Musics.plist" diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Service/NeteaseMusicAPI.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Service/NeteaseMusicAPI.m" index 014b8f51..2740b447 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Service/NeteaseMusicAPI.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Service/NeteaseMusicAPI.m" @@ -22,7 +22,7 @@ + (void)initialize { 搜索 */ + (void)searchWithQuery:(NSString *)query type:(NMSearchType)type offset:(NSInteger)offset limit:(NSInteger)limit completionHandler:(NeteaseMusicAPICompletionHandler)completionHandler { - NSString *HTTPBody = [NSString stringWithFormat:@"s=%@&type=%ld&offset=%ld&limit=%ld", urlEncode(query), type, offset, limit]; + NSString *HTTPBody = [NSString stringWithFormat:@"s=%@&type=%zd&offset=%zd&limit=%zd", urlEncode(query), type, offset, limit]; NSMutableURLRequest *request = [self requestWithURLString:@"http://music.163.com/api/search/pc"]; request.HTTPBody = [HTTPBody dataUsingEncoding:NSUTF8StringEncoding]; request.HTTPMethod = @"POST"; @@ -33,8 +33,8 @@ + (void)searchWithQuery:(NSString *)query type:(NMSearchType)type offset:(NSInte 获取音乐信息 */ + (void)musicInfoWithId:(NSInteger)musicId completionHandler:(NeteaseMusicAPICompletionHandler)completionHandler { - NSString *ids = [NSString stringWithFormat:@"[%ld]", musicId]; - NSString *parameters = [NSString stringWithFormat:@"id=%ld&ids=%@", musicId, urlEncode(ids)]; + NSString *ids = [NSString stringWithFormat:@"[%zd]", musicId]; + NSString *parameters = [NSString stringWithFormat:@"id=%zd&ids=%@", musicId, urlEncode(ids)]; NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/song/detail?%@", parameters]; NSMutableURLRequest *request = [self requestWithURLString:URLString]; request.HTTPMethod = @"GET"; @@ -45,7 +45,7 @@ + (void)musicInfoWithId:(NSInteger)musicId completionHandler:(NeteaseMusicAPICom 获取歌手专辑列表 */ + (void)artistAlbumWithArtistId:(NSInteger)artistId limit:(NSInteger)limit completionHandler:(NeteaseMusicAPICompletionHandler)completionHandler { - NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/artist/albums/%ld?limit=%ld", artistId, limit]; + NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/artist/albums/%zd?limit=%zd", artistId, limit]; NSMutableURLRequest *request = [self requestWithURLString:URLString]; request.HTTPMethod = @"GET"; [[session dataTaskWithRequest:request completionHandler:completionHandler] resume]; @@ -55,7 +55,7 @@ + (void)artistAlbumWithArtistId:(NSInteger)artistId limit:(NSInteger)limit compl 专辑信息 */ + (void)albumInfoWithAlbumId:(NSInteger)albumId completionHandler:(NeteaseMusicAPICompletionHandler)completionHandler { - NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/album/%ld", albumId]; + NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/album/%zd", albumId]; NSMutableURLRequest *request = [self requestWithURLString:URLString]; request.HTTPMethod = @"GET"; [[session dataTaskWithRequest:request completionHandler:completionHandler] resume]; @@ -65,7 +65,7 @@ + (void)albumInfoWithAlbumId:(NSInteger)albumId completionHandler:(NeteaseMusicA 歌单 */ + (void)playlistInfoWithPlaylistId:(NSInteger)playlistId completionHandler:(NeteaseMusicAPICompletionHandler)completionHandler { - NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/playlist/detail?id=%ld", playlistId]; + NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/playlist/detail?id=%zd", playlistId]; NSMutableURLRequest *request = [self requestWithURLString:URLString]; request.HTTPMethod = @"GET"; [[session dataTaskWithRequest:request completionHandler:completionHandler] resume]; @@ -75,7 +75,7 @@ + (void)playlistInfoWithPlaylistId:(NSInteger)playlistId completionHandler:(Nete 歌词 */ + (void)musicLyricWithMusicId:(NSInteger)musicId completionHandler:(NeteaseMusicAPICompletionHandler)completionHandler { - NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/song/lyric?os=pc&id=%ld&lv=-1&kv=-1&tv=-1", musicId]; + NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/song/lyric?os=pc&id=%zd&lv=-1&kv=-1&tv=-1", musicId]; NSMutableURLRequest *request = [self requestWithURLString:URLString]; request.HTTPMethod = @"GET"; [[session dataTaskWithRequest:request completionHandler:completionHandler] resume]; @@ -85,14 +85,14 @@ + (void)musicLyricWithMusicId:(NSInteger)musicId completionHandler:(NeteaseMusic MV信息 */ + (void)mvInfoWithMvID:(NSInteger)mvId completionHandler:(NeteaseMusicAPICompletionHandler)completionHandler { - NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/mv/detail?id=%ld&type=mp4", mvId]; + NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/mv/detail?id=%zd&type=mp4", mvId]; NSMutableURLRequest *request = [self requestWithURLString:URLString]; request.HTTPMethod = @"GET"; [[session dataTaskWithRequest:request completionHandler:completionHandler] resume]; } + (void)programInfoWithProgramId:(NSInteger)programId completionHandler:(NeteaseMusicAPICompletionHandler)completionHandler { - NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/dj/program/detail?id=%ld", programId]; + NSString *URLString = [NSString stringWithFormat:@"http://music.163.com/api/dj/program/detail?id=%zd", programId]; NSMutableURLRequest *request = [self requestWithURLString:URLString]; request.HTTPMethod = @"GET"; [[session dataTaskWithRequest:request completionHandler:completionHandler] resume]; diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQImageTool.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQImageTool.m" index f7cb918f..8ce24d2a 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQImageTool.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQImageTool.m" @@ -15,7 +15,8 @@ + (UIImage *)getNewImage:(UIImage *)sourceImage andLrcStr:(NSString *)lrcStr{ // 1.开启图形上下文 CGSize size = sourceImage.size; - UIGraphicsBeginImageContext(size); +// UIGraphicsBeginImageContext(size); + UIGraphicsBeginImageContextWithOptions(size, NO, 0); // 2.绘制大的图片 [sourceImage drawInRect:CGRectMake(0, 0, size.width, size.height)]; diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQLrcDataTool.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQLrcDataTool.m" index 0711236d..2fe932a2 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQLrcDataTool.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQLrcDataTool.m" @@ -67,6 +67,11 @@ @implementation QQLrcDataTool NSString *content = timeAndContent[1]; lrcModel.lrcStr = content; + }else if (timeAndContent.count == 1) { + + NSString *time = timeAndContent[0]; + lrcModel.beginTime = [QQTimeTool getTimeInterval:time]; + lrcModel.lrcStr = nil; } } }]; @@ -74,9 +79,7 @@ @implementation QQLrcDataTool // 修改模型的结束时间 NSInteger count = lrcMs.count; [lrcMs enumerateObjectsUsingBlock:^(QQLrcModel *lrcModel, NSUInteger idx, BOOL * _Nonnull stop) { - if (idx != count - 1) { - lrcMs[idx].endTime = lrcMs[idx + 1].beginTime; } }]; diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicOperationTool.h" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicOperationTool.h" index 6d0d19a4..95d439ab 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicOperationTool.h" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicOperationTool.h" @@ -16,15 +16,9 @@ #pragma mark -------------------------- #pragma mark 属性 -/** 当前播放音乐的索引*/ -@property (nonatomic, assign) NSInteger index; - /** 音乐播放列表*/ @property (nonatomic, strong) NSArray *musicMList; -/** 当前播放音乐的信息*/ -@property (nonatomic, strong) QQMusicMessageModel *musicMessageModel; - #pragma mark -------------------------- #pragma mark 单例 @@ -49,10 +43,10 @@ /** * 播放音乐 - * - * @param music 音乐对象模型 + * 是否播放成功 + * @param music 音乐对象模型, */ -- (void)playMusic:(QQMusicModel *)music; +- (BOOL)playMusic:(QQMusicModel *)music; #pragma mark -------------------------- @@ -72,13 +66,17 @@ /** * 播放 下一首 */ -- (void)nextMusic; +- (BOOL)nextMusic; /** * 播放 上一首 */ -- (void)preMusic; +- (BOOL)preMusic; +/** + 停止当前音乐 + */ +- (void)stopCurrentMusic; /** * 指定当前播放进度 diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicOperationTool.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicOperationTool.m" index 638b52f9..01119e37 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicOperationTool.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicOperationTool.m" @@ -22,6 +22,12 @@ @interface QQMusicOperationTool() /** 锁屏 所需的图片参数设置*/ @property (nonatomic, strong) MPMediaItemArtwork *artwork; +/** 当前播放音乐的信息*/ +@property (nonatomic, strong) QQMusicMessageModel *musicMessageModel; + +/** 当前播放音乐的索引*/ +@property (nonatomic, assign) NSInteger index; + /** 记录当前歌曲的歌词 播放到哪一行*/ @property (nonatomic, assign) NSInteger lrcRow; @@ -30,39 +36,6 @@ @interface QQMusicOperationTool() @implementation QQMusicOperationTool #pragma mark -------------------------- -#pragma mark 单例 - -static id _instance = nil; -+ (instancetype)shareInstance -{ - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _instance = [[self alloc] init]; - }); - - return _instance; -} - -+ (instancetype)allocWithZone:(struct _NSZone *)zone -{ - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - _instance = [super allocWithZone:zone]; - }); - - return _instance; -} - -- (id)copyWithZone:(NSZone *)zone -{ - return _instance; -} - -- (id)mutableCopyWithZone:(NSZone *)zone -{ - return _instance; -} - - (instancetype)init { self = [super init]; @@ -114,18 +87,21 @@ - (QQMusicMessageModel *)getNewMusicMessageModel{ #pragma mark -------------------------- #pragma mark 单首音乐的操作 -- (void)playMusic:(QQMusicModel *)music{ +- (BOOL)playMusic:(QQMusicModel *)music{ NSString *fileName = music.filename; - [self.tool playMusic:fileName]; + BOOL isPlayMusicSucceed = [self.tool playMusic:fileName]; if (self.musicMList == nil || self.musicMList.count <= 1) { NSLog(@"没有播放列表, 只能播放一首歌"); - return; +// isPlayMusicSucceed = NO; + return NO; } // 记录当前播放歌曲的索引 self.index = [self.musicMList indexOfObject:music]; + + return isPlayMusicSucceed; } - (void)playCurrentMusic{ @@ -138,26 +114,31 @@ - (void)pauseCurrentMusic{ [self.tool pauseCurrentMusic]; } -- (void)nextMusic{ +/** + 停止当前音乐 + */ +- (void)stopCurrentMusic { + [self.tool stopCurrentMusic]; +} + +- (BOOL)nextMusic{ self.index += 1; - if (self.musicMList) { - QQMusicModel *music = self.musicMList[self.index]; - [self playMusic:music]; + return [self playMusic:music]; } + return NO; } -- (void)preMusic{ +- (BOOL)preMusic{ self.index -= 1; - if (self.musicMList) { - QQMusicModel *music = self.musicMList[self.index]; - [self playMusic:music]; + return [self playMusic:music]; } + return NO; } - (void)seekTo:(NSTimeInterval)timeInteval{ @@ -198,7 +179,6 @@ - (void)setUpLockMessage{ NSString *icon = musicMessageModel.musicM.icon; if (icon) { - UIImage *image = [UIImage imageNamed:icon]; if (image) { @@ -251,21 +231,47 @@ - (void)setUpLockMessage{ } - - - - (NSArray *)musicMList { if(_musicMList == nil) { - _musicMList = [QQMusicModel mj_objectArrayWithFilename:@"Musics.plist"]; + _musicMList = [QQMusicModel mj_objectArrayWithFilename:QQResources(@"Musics.plist")]; } return _musicMList; } +#pragma mark 单例 +static id _instance = nil; ++ (instancetype)shareInstance +{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _instance = [[self alloc] init]; + }); + return _instance; +} + ++ (instancetype)allocWithZone:(struct _NSZone *)zone +{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _instance = [super allocWithZone:zone]; + }); + + return _instance; +} + +- (id)copyWithZone:(NSZone *)zone +{ + return _instance; +} +- (id)mutableCopyWithZone:(NSZone *)zone +{ + return _instance; +} @end diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicTool.h" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicTool.h" index 8162a026..b1f5355c 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicTool.h" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicTool.h" @@ -22,7 +22,7 @@ static NSString * const kPlayFinishNotificationName = @"kPlayFinishNotificationN * * @param musicName 音乐文件名 */ -- (void)playMusic:(NSString *)musicName; +- (BOOL)playMusic:(NSString *)musicName; /** * 暂停当前音乐 @@ -35,6 +35,11 @@ static NSString * const kPlayFinishNotificationName = @"kPlayFinishNotificationN - (void)resumeCurrentMusic; +/** + 停止当前音乐 + */ +- (void)stopCurrentMusic; + /** * 指定播放进度 * diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicTool.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicTool.m" index 7df34b93..11cdfdda 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicTool.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/Tool/QQMusicTool.m" @@ -48,18 +48,20 @@ - (instancetype)init #pragma mark -------------------------- #pragma mark 单首音乐操作 -- (void)playMusic:(NSString *)musicName { +- (BOOL)playMusic:(NSString *)musicName { // 判断路径是否正确 NSURL *url = [[NSBundle mainBundle] URLForResource:musicName withExtension:nil]; if (url == nil) { - return; + return NO; } // 判断是否播放同一首歌曲 if (self.player.url && [self.player.url isEqual:url]) { - [self.player play]; // 为了暂停后, 能够再播放 - return; + if (!self.player.isPlaying) { + [self.player play]; // 为了暂停后, 能够再播放 + } + return NO; } // 1.创建 player @@ -68,17 +70,26 @@ - (void)playMusic:(NSString *)musicName { self.player.delegate = self; if (error) { NSLog(@"%@", error); - return; + return NO; } - // 2.准备播放 - [self.player prepareToPlay]; + @try { + // 2.准备播放 + [self.player prepareToPlay]; + + // 3.开始播放 + [self.player play]; + + } @catch (NSException *ex) { + + } @finally { + + } - // 3.开始播放 - [self.player play]; + return YES; } -- (void)pauseCurrentMusic{ +- (void)pauseCurrentMusic { [self.player pause]; } @@ -88,6 +99,17 @@ - (void)resumeCurrentMusic{ [self.player play]; } +/** + 停止当前音乐 + */ +- (void)stopCurrentMusic { + if (self.player) { + [self.player stop]; + self.player.delegate = nil; + self.player = nil; + } +} + - (void)seekTo:(NSTimeInterval)timeInteval{ self.player.currentTime = timeInteval; @@ -101,7 +123,7 @@ - (void)seekTo:(NSTimeInterval)timeInteval{ - (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag{ //NSLog(@"歌曲播放完毕"); - + // 发布通知 [[NSNotificationCenter defaultCenter] postNotificationName:kPlayFinishNotificationName object:nil]; diff --git "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/View/QQLrcLabel.m" "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/View/QQLrcLabel.m" index 0ea705c7..a9c0d8ca 100755 --- "a/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/View/QQLrcLabel.m" +++ "b/iOSProject/iOSProject/Classes/QQ\351\237\263\344\271\220/View/QQLrcLabel.m" @@ -15,7 +15,7 @@ - (void)setProgress:(CGFloat)progress{ _progress = progress; - if (_progress >= 0.97) { + if (_progress >= 0.99) { _progress = 0; } diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJBlockLoopViewController.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJBlockLoopViewController.m" index 25fab0d6..363796bb 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJBlockLoopViewController.m" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJBlockLoopViewController.m" @@ -17,14 +17,15 @@ @interface LMJBlockLoopViewController () @property(nonatomic,strong) UIView *myBlockView; +/** <#digest#> */ +@property (nonatomic, strong) LMJBlockLoopOperation *operation; @end @implementation LMJBlockLoopViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); - + LMJWeak(self); _myBlockView = [[UIView alloc] init]; _myBlockView.backgroundColor=[UIColor RandomColor]; @@ -35,7 +36,6 @@ - (void)viewDidLoad { //不要在这里面存放 关于BlockLoopViewController的变量 否则也会内存无法释放 例如: // _info = infoStr; [weakself.view makeToast:@"点击了"]; - }]; self.addItem([LMJWordArrowItem itemWithTitle:@"跳转子页" subTitle:nil itemOperation:^(NSIndexPath *indexPath) { @@ -56,29 +56,10 @@ - (void)viewDidLoad { } -//调用其它类的一些内存问题 --(void)myBlockButtonAction -{ - LMJWeakSelf(self); - //1: - [LMJBlockLoopOperation operateWithSuccessBlock:^{ - [weakself showErrorMessage:@"成功执行完成"]; - }]; - - LMJBlockLoopOperation *operation = [[LMJBlockLoopOperation alloc] init]; - - //3:如果带有block 又引入self就要进行弱化对象operation,否则会出现内存释放的问题 - LMJWeakSelf(operation); - operation.logAddress = ^(NSString *address) { - - [weakself showErrorMessage:weakoperation.address]; - }; -} - -//子页开放的block -(void)myButtonAction { LMJChildBlockViewController *vc=[[LMJChildBlockViewController alloc]init]; + // 子页面的 block push vc.successBlock=^() { [self loadPage]; @@ -86,11 +67,12 @@ -(void)myButtonAction [self.navigationController pushViewController:vc animated:YES]; } + -(void)myModelButtonAction { LMJModalBlockViewController *vc=[[LMJModalBlockViewController alloc]init]; - LMJWeakSelf(vc); + LMJWeak(vc); vc.successBlock=^() { if (weakvc) { @@ -98,9 +80,29 @@ -(void)myModelButtonAction } }; +// A presentViewController B 后,a.presentedViewController就是b,b.presentingViewController就是a, [self presentViewController:vc animated:YES completion:nil]; } +//调用其它类的一些内存问题 +-(void)myBlockButtonAction +{ + LMJWeak(self); + //1: + [LMJBlockLoopOperation operateWithSuccessBlock:^{ + [self showErrorMessage:@"成功执行完成"]; + }]; + + LMJBlockLoopOperation *operation = [[LMJBlockLoopOperation alloc] init]; + + //3:如果带有block 又引入self就要进行弱化对象operation,否则会出现内存释放的问题 + _operation = operation; + LMJWeak(operation); + operation.logAddress = ^(NSString *address) { + [weakself showErrorMessage:weakoperation.address]; + }; +} + -(void)showErrorMessage:(NSString *)message { NSLog(@"当前信息,%@",message); diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJChildBlockViewController.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJChildBlockViewController.h" index 98508cda..4b1bff2b 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJChildBlockViewController.h" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJChildBlockViewController.h" @@ -10,9 +10,6 @@ @interface LMJChildBlockViewController : LMJBaseViewController - - -@property(nonatomic,copy) void(^successBlock)(); - +@property(nonatomic,copy) void(^successBlock)(void); @end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJGCDViewController.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJGCDViewController.m" index 73ff00d2..3ce8ef37 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJGCDViewController.m" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJGCDViewController.m" @@ -21,39 +21,39 @@ - (void)viewDidLoad { [self setDes]; - LMJWeakSelf(self); + LMJWeak(self); - LMJWordItem *item0 = [LMJWordItem itemWithTitle:@"并发队列 + 同步执行" subTitle:nil]; + LMJWordItem *item0 = [LMJWordItem itemWithTitle:@"并发队列 + 同步函数" subTitle:nil]; [item0 setItemOperation:^(NSIndexPath *indexPath) { [weakself syncConCurrent]; }]; - LMJWordItem *item1 = [LMJWordItem itemWithTitle:@"并发队列 + 异步执行" subTitle:nil]; + LMJWordItem *item1 = [LMJWordItem itemWithTitle:@"并发队列 + 异步函数" subTitle:nil]; [item1 setItemOperation:^(NSIndexPath *indexPath) { [weakself asyncConcurrent]; }]; - LMJWordItem *item2 = [LMJWordItem itemWithTitle:@"串行队列 + 同步执行" subTitle:nil]; + LMJWordItem *item2 = [LMJWordItem itemWithTitle:@"串行队列 + 同步函数" subTitle:nil]; [item2 setItemOperation:^(NSIndexPath *indexPath) { [weakself syncSerial]; }]; - LMJWordItem *item3 = [LMJWordItem itemWithTitle:@"串行队列 + 异步执行" subTitle:nil]; + LMJWordItem *item3 = [LMJWordItem itemWithTitle:@"串行队列 + 异步函数" subTitle:nil]; [item3 setItemOperation:^(NSIndexPath *indexPath) { [weakself asyncSerial]; }]; - LMJWordItem *item4 = [LMJWordItem itemWithTitle:@"主队列 + 同步执行--相互等待" subTitle:@"直接闪退"]; + LMJWordItem *item4 = [LMJWordItem itemWithTitle:@"主队列 + 同步函数--相互等待" subTitle:@"直接闪退"]; [item4 setItemOperation:^(NSIndexPath *indexPath) { [weakself syncMain]; }]; - LMJWordItem *item5 = [LMJWordItem itemWithTitle:@"主队列 + 异步执行" subTitle:nil]; + LMJWordItem *item5 = [LMJWordItem itemWithTitle:@"主队列 + 异步函数" subTitle:nil]; [item5 setItemOperation:^(NSIndexPath *indexPath) { [weakself asyncMain]; }]; - LMJWordItem *item6 = [LMJWordItem itemWithTitle:@"全局队列+ 异步执行" subTitle:nil]; + LMJWordItem *item6 = [LMJWordItem itemWithTitle:@"全局队列+ 异步函数" subTitle:nil]; [item6 setItemOperation:^(NSIndexPath *indexPath) { [weakself asyncGloba]; }]; @@ -196,16 +196,12 @@ - (void)group 我理解就是类似遍历一个数组一样,当提交到一个并发的队列上的时候,这个遍历是并发运行的,速度很快. - 作者:机器人小雪 - 链接:https://www.jianshu.com/p/0243f317d79e - 來源:简书 - 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 */ - (void)apply { dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); - dispatch_apply(100, queue, ^(size_t index) { + dispatch_apply(100000, queue, ^(size_t index) { NSLog(@"%zd---%@", index, [NSThread currentThread]); }); diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJLiftCycleViewController.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJLiftCycleViewController.m" index e2883dc7..ffcdb6e4 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJLiftCycleViewController.m" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJLiftCycleViewController.m" @@ -15,7 +15,6 @@ @interface LMJLiftCycleViewController () @implementation LMJLiftCycleViewController - - (void)loadView { [super loadView]; @@ -26,21 +25,9 @@ - (void)loadView #pragma mark - 生命周期 - (void)viewDidLoad { [super viewDidLoad]; + [self life:__FUNCTION__]; } - -- (void)life:(const char *)func -{ - LMJWordItem *item = [LMJWordItem itemWithTitle:[NSString stringWithUTF8String:func] subTitle:nil itemOperation:nil]; - item.titleFont = [UIFont systemFontOfSize:12]; - - self.addItem(item); - - [self.tableView reloadData]; -} - - - - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; @@ -100,65 +87,32 @@ - (void)awakeFromNib -#pragma mark 重写BaseViewController设置内容 - -- (UIColor *)lmjNavigationBackgroundColor:(LMJNavigationBar *)navigationBar -{ - return [UIColor yellowColor]; -} - -- (void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar +- (void)life:(const char *)func { - NSLog(@"%s", __func__); + LMJWordItem *item = [LMJWordItem itemWithTitle:[NSString stringWithUTF8String:func] subTitle:nil itemOperation:nil]; + item.titleFont = [UIFont systemFontOfSize:12]; - [self.navigationController popViewControllerAnimated:YES]; -} - -- (void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ - NSLog(@"%s", __func__); -} - -- (void)titleClickEvent:(UILabel *)sender navigationBar:(LMJNavigationBar *)navigationBar -{ - NSLog(@"%@", sender); -} - -- (NSMutableAttributedString*)lmjNavigationBarTitle:(LMJNavigationBar *)navigationBar -{ - return [self changeTitle:@"生命周期"]; -} - -- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar -{ - [leftButton setImage:[UIImage imageNamed:@"navigationButtonReturn"] forState:UIControlStateHighlighted]; + self.addItem(item); - return [UIImage imageNamed:@"navigationButtonReturnClick"]; + [self.tableView reloadData]; } +#pragma mark - LMJNavUIBaseViewControllerDataSource -- (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar +/** 导航条左边的按钮 */ +- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar { - rightButton.backgroundColor = [UIColor RandomColor]; + [leftButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; - return nil; + return [UIImage imageNamed:@"NavgationBar_blue_back"]; } - - -#pragma mark 自定义代码 - --(NSMutableAttributedString *)changeTitle:(NSString *)curTitle +#pragma mark - LMJNavUIBaseViewControllerDelegate +/** 左边的按钮的点击 */ +-(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { - NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:curTitle ?: @""]; - - [title addAttribute:NSForegroundColorAttributeName value:[UIColor RandomColor] range:NSMakeRange(0, title.length)]; - - [title addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, title.length)]; - - return title; + [self.navigationController popViewControllerAnimated:YES]; } - @end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJLockViewController.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJLockViewController.m" index 744b2b90..cd0f95d1 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJLockViewController.m" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJLockViewController.m" @@ -9,169 +9,119 @@ #import "LMJLockViewController.h" @interface LMJLockViewController () -@property (nonatomic, strong) NSMutableArray *myMutableList; - -//要运用atomic 线程安全 只能是相对安全 只有这个属性也会出现线程问题 -@property (strong, nonatomic) NSMutableArray *myThreadList; - // 安全 @property (strong, atomic) NSLock *mylock; +/** 售票员01 */ +@property (nonatomic, strong) NSThread *thread01; +/** 售票员02 */ +@property (nonatomic, strong) NSThread *thread02; +/** 售票员03 */ +@property (nonatomic, strong) NSThread *thread03; -/** <#digest#> */ -@property (nonatomic, assign) NSInteger action; +/** 票的总数 */ +@property (nonatomic, assign) NSInteger ticketCount; + +/** 操作类型 */ +@property (nonatomic, copy) NSString *actionType; -/** <#digest#> */ -@property (nonatomic, strong) NSMutableString *printStr; @end @implementation LMJLockViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + LMJWeak(self); //初始化锁对象 self.mylock = [[NSLock alloc]init]; - - self.addItem([LMJWordItem itemWithTitle:@"第一种情况" subTitle:@"空" itemOperation:^(NSIndexPath *indexPath) { - [weakself start:indexPath]; + weakself.actionType = nil; + [weakself startSale]; }]) .addItem([LMJWordItem itemWithTitle:@"第二种情况" subTitle:@"NSLock" itemOperation:^(NSIndexPath *indexPath) { - [weakself start:indexPath]; + weakself.actionType = @"NSLock"; + [weakself startSale]; }]) .addItem([LMJWordItem itemWithTitle:@"第三种情况" subTitle:@"@synchronized" itemOperation:^(NSIndexPath *indexPath) { - [weakself start:indexPath]; + weakself.actionType = @"@synchronized"; + [weakself startSale]; }]); - - } -- (void)start:(NSIndexPath *)indexPath +- (void)startSale { - LMJWeakSelf(self); - weakself.myMutableList = [NSMutableArray array]; - for (NSInteger i = 0; i < 20; i++) { - [weakself.myMutableList addObject:[NSString stringWithFormat:@"图片%zd", i+1]]; - } - weakself.printStr = [NSMutableString string]; - weakself.action = indexPath.row; - [weakself addArrayThtead]; + self.ticketCount = 100; - [MBProgressHUD showLoadToView:self.view]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [MBProgressHUD hideHUDForView:self.view]; - [UIAlertController mj_showActionSheetWithTitle:@"打印" message:weakself.printStr appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { - alertMaker.addActionDefaultTitle(@"知道了"); - } actionsBlock:nil]; - }); + self.thread01 = [[NSThread alloc] initWithTarget:self selector:@selector(saleTicket) object:nil]; + self.thread01.name = @"售票员01"; -} - -- (void)addArrayThtead -{ - if (!self.myThreadList) { - self.myThreadList=[[NSMutableArray alloc]init]; - } + self.thread02 = [[NSThread alloc] initWithTarget:self selector:@selector(saleTicket) object:nil]; + self.thread02.name = @"售票员02"; - [self.myThreadList removeAllObjects]; + self.thread03 = [[NSThread alloc] initWithTarget:self selector:@selector(saleTicket) object:nil]; + self.thread03.name = @"售票员03"; - for(int i = 0; i < 20; i++) - { - NSThread *thread=[[NSThread alloc]initWithTarget:self selector:@selector(loadAction:) object:[NSNumber numberWithInt:i]]; - thread.name=[NSString stringWithFormat:@"myThread%i",i]; - - [self.myThreadList addObject:thread]; - } - - for (int i=0; i0) { - name=[[self.myMutableList lastObject] mutableCopy]; - [self.myMutableList removeObject:[self.myMutableList lastObject]]; - NSLog(@"当前要加载的图片名称%@",name); - [self.printStr appendFormat:@"当前要加载的图片名称%@\n",name]; - } - }else if (self.action == 1) { - // 第二种情况 - //加锁 - [_mylock lock]; - if (self.myMutableList.count>0) { - name=[[self.myMutableList lastObject] mutableCopy]; - [self.myMutableList removeObject:[self.myMutableList lastObject]]; + if ([self.actionType isEqualToString:@"@synchronized"]) { + while (1) { + @synchronized(self) { + // 先取出总数 + NSInteger count = self.ticketCount; + if (count > 0) { + self.ticketCount = count - 1; + NSLog(@"%@卖了一张票,还剩下%zd张", [NSThread currentThread].name, self.ticketCount); + } else { + NSLog(@"票已经卖完了"); + break; + } + } } - NSLog(@"当前要加载的图片名称%@",name); - [self.printStr appendFormat:@"当前要加载的图片名称%@\n",name]; - [_mylock unlock]; - - }else if (self.action == 2) { - // 第三种情况 - //线程同步 - @synchronized(self){ - if (self.myMutableList.count>0) { - name = [[self.myMutableList lastObject] mutableCopy]; - [self.myMutableList removeObject:[self.myMutableList lastObject]]; - NSLog(@"当前要加载的图片名称%@",name); - [self.printStr appendFormat:@"当前要加载的图片名称%@\n",name]; + }else if ([self.actionType isEqualToString:@"NSLock"]) { + while (1) { + [_mylock lock]; + // 先取出总数 + NSInteger count = self.ticketCount; + if (count > 0) { + self.ticketCount = count - 1; + NSLog(@"%@卖了一张票,还剩下%zd张", [NSThread currentThread].name, self.ticketCount); + } else { + NSLog(@"票已经卖完了"); + break; } + [_mylock unlock]; } - - } - - //回主线程去执行 有些UI相应 必须在主线程中更新 - [self performSelectorOnMainThread:@selector(updateImage) withObject:nil waitUntilDone:YES]; - - //结合下面的cancel运用 进行强制退出线程的操作 - if (![thread isCancelled]) { - [thread cancel]; - NSLog(@"当前thread-exit被exit动作了"); - [NSThread exit]; }else { - [NSThread exit]; - } -} - --(void)updateImage -{ - @autoreleasepool { - NSLog(@"执行完成了"); + while (1) { + // 先取出总数 + NSInteger count = self.ticketCount; + if (count > 0) { + self.ticketCount = count - 1; + NSLog(@"%@卖了一张票,还剩下%zd张", [NSThread currentThread].name, self.ticketCount); + } else { + NSLog(@"票已经卖完了"); + break; + } + } } - - //输出:执行方法updateImage是在主线程中 } - -//******解决Thread中的内存问题 --(void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; - - //结合VC生命周期 viewWillDisappear退出页面时就把线程标识为cancel 使用Thread一定要在退出前进行退出,否则会有闪存泄露的问题 - for (int i=0; i{number = 1, name = main} // NSBlockOperation当前的线程2------{number = 1, name = main} @@ -190,40 +179,82 @@ -(void)addAsnysOperationFormBlock } -//五:maxConcurrentOperationCount设置 并发或串行 +//五:maxConcurrentOperationCount设置 并发或串行, -(void)addMaxConcurrentOperation { - // 1. 创建队列 - NSOperationQueue *queue = [[NSOperationQueue alloc] init]; +// 凡是学习NSOperationQueue的人,都会遇到setMaxConcurrentOperationCount这个函数。在网上的许多博文中,都将setMaxConcurrentOperationCount解释为“设置线程池中的线程数”,我觉得这是一种以讹传讹的说法,相当不准确,容易误导初学者,至少我曾经就被误导过。实际上,NSOperationQueue 可以认为是线程池,但setMaxConcurrentOperationCount并不是设置在其中运行的线程数,看看官方文档: +// +//setMaxConcurrentOperationCount: +// +// Sets the maximum number of concurrent operations that the receiver can execute. - //并发操作的最大值:你可以设定NSOperationQueue可以并发运行的最大操作数。NSOperationQueue会选择去运行任何数量的并发操作,但是不会超过最大值 - queue.maxConcurrentOperationCount = 10; - //修改成它的默认值 - //queue.MaxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount; +// 从描述中可以看出,该函数设置的是queue里面最多能并发运行的operation个数,而不是线程个数,因为一个operation并非只能运行一个线程,看以下代码: - NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{ - // 在子线程 - NSLog(@"addMaxConcurrentOperation当前的线程:%@", [NSThread currentThread]); + + // 多尝试几次!!! + NSBlockOperation *op1 = [NSBlockOperation blockOperationWithBlock:^{ + + +// for (int i = 0; i<100;i++) +// { + NSLog(@"%@:i",[NSThread currentThread]); +// } }]; - // 添加额外的任务(部分在新的子线程运行) - [op addExecutionBlock:^{ - NSLog(@"addMaxConcurrentOperation当前的线程2------%@", [NSThread currentThread]); + [op1 addExecutionBlock:^{ + +// for (int m = 0; m<100;m++) +// { + NSLog(@"%@:m",[NSThread currentThread]); +// } }]; - [op addExecutionBlock:^{ - NSLog(@"addMaxConcurrentOperation当前的线程3------%@", [NSThread currentThread]); + + NSBlockOperation *op2 = [NSBlockOperation blockOperationWithBlock:^{ + + +// for (int j = 0; j<100;j++) +// { + NSLog(@"%@:j",[NSThread currentThread]); +// } }]; - [op addExecutionBlock:^{ - NSLog(@"addMaxConcurrentOperation当前的线程4------%@", [NSThread currentThread]); + [op2 addExecutionBlock:^{ + +// for (int k = 0; k<100;k++) +// { + NSLog(@"%@:k",[NSThread currentThread]); +// } + }]; + + + NSBlockOperation *op3 = [NSBlockOperation blockOperationWithBlock:^{ + + +// for (int n = 0; n<100;n++) +// { + NSLog(@"%@:n",[NSThread currentThread]); +// } + }]; + [op3 addExecutionBlock:^{ + +// for (int r = 0; r<100;r++) +// { + NSLog(@"%@:r",[NSThread currentThread]); +// } }]; - [queue addOperation:op]; + NSOperationQueue *q = [[NSOperationQueue alloc]init]; + [q setMaxConcurrentOperationCount:1]; + [q addOperation:op1]; + [q addOperation:op2]; + [q addOperation:op3]; - // addMaxConcurrentOperation当前的线程:{number = 8, name = (null)} - // addMaxConcurrentOperation当前的线程2------{number = 8, name = (null)} - // addMaxConcurrentOperation当前的线程3------{number = 8, name = (null)} - // addMaxConcurrentOperation当前的线程4------{number = 5, name = (null)} +// 2018-05-06 22:54:04.745338+0800 iOSProject[642:344741] {number = 11, name = (null)}:i +// 2018-05-06 22:54:04.746223+0800 iOSProject[642:344741] {number = 11, name = (null)}:m +// 2018-05-06 22:54:04.746715+0800 iOSProject[642:344774] {number = 6, name = (null)}:j +// 2018-05-06 22:54:04.746899+0800 iOSProject[642:344774] {number = 6, name = (null)}:k +// 2018-05-06 22:54:04.747159+0800 iOSProject[642:344774] {number = 6, name = (null)}:n +// 2018-05-06 22:54:04.747310+0800 iOSProject[642:344774] {number = 6, name = (null)}:r //说明: // maxConcurrentOperationCount默认情况下为-1,表示不进行限制,默认为并发执行。 @@ -278,8 +309,105 @@ -(void)addDependency //输出 // addDependency2当前线程{number = 12, name = (null)} // addDependency1当前线程{number = 9, name = (null)} +} + +- (void)addOperationWithBlock +{ + // 创建队列 + NSOperationQueue *queue = [[NSOperationQueue alloc] init]; +// 设置最大并发操作数 +// == 1 就变成了串行队列 + queue.maxConcurrentOperationCount = 3; + + // 添加操作 + [queue addOperationWithBlock:^{ + for (NSInteger i = 0; i<1000; i++) { + NSLog(@"download1 -%zd-- %@", i, [NSThread currentThread]); + } + }]; + [queue addOperationWithBlock:^{ + for (NSInteger i = 0; i<1000; i++) { + NSLog(@"download2 --- %@", [NSThread currentThread]); + } + }]; + [queue addOperationWithBlock:^{ + for (NSInteger i = 0; i<1000; i++) { + NSLog(@"download3 --- %@", [NSThread currentThread]); + } + }]; +} +- (void)commit +{ + NSOperationQueue *queue = [[NSOperationQueue alloc] init]; + + __block UIImage *image1 = nil; + // 下载图片1 + NSBlockOperation *download1 = [NSBlockOperation blockOperationWithBlock:^{ + + // 图片的网络路径 + NSURL *url = [NSURL URLWithString:@"http://img.pconline.com.cn/images/photoblog/9/9/8/1/9981681/200910/11/1255259355826.jpg"]; + + // 加载图片 + NSData *data = [NSData dataWithContentsOfURL:url]; + + // 生成图片 + image1 = [UIImage imageWithData:data]; + }]; + + __block UIImage *image2 = nil; + // 下载图片2 + NSBlockOperation *download2 = [NSBlockOperation blockOperationWithBlock:^{ + + // 图片的网络路径 + NSURL *url = [NSURL URLWithString:@"http://pic38.nipic.com/20140228/5571398_215900721128_2.jpg"]; + + + // 加载图片 + NSData *data = [NSData dataWithContentsOfURL:url]; + + // 生成图片 + image2 = [UIImage imageWithData:data]; + }]; + + // 合成图片 + NSBlockOperation *combine = [NSBlockOperation blockOperationWithBlock:^{ + // 开启新的图形上下文 + UIGraphicsBeginImageContext(CGSizeMake(100, 100)); + + // 绘制图片 + [image1 drawInRect:CGRectMake(0, 0, 50, 100)]; + image1 = nil; + + [image2 drawInRect:CGRectMake(50, 0, 50, 100)]; + image2 = nil; + + // 取得上下文中的图片 + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + + // 结束上下文 + UIGraphicsEndImageContext(); + + // 回到主线程 + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + // 4.将新图片显示出来 + UIImageView *imageV = [[UIImageView alloc] initWithImage:image]; + imageV.frame = CGRectMake(100, 100, 200, 200); + [self.view addSubview:imageV]; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [imageV removeFromSuperview]; + }); + }]; + }]; + [combine addDependency:download1]; + [combine addDependency:download2]; + + [queue addOperation:download1]; + [queue addOperation:download2]; + [queue addOperation:combine]; + } #pragma mark - LMJNavUIBaseViewControllerDataSource diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJNSThreadViewController.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJNSThreadViewController.m" index ade2df37..3d989262 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJNSThreadViewController.m" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJNSThreadViewController.m" @@ -8,6 +8,7 @@ #import "LMJNSThreadViewController.h" #import "LMJSettingCell.h" +#import @interface LMJNSThreadViewController () /** <#digest#> */ @@ -21,11 +22,15 @@ @implementation LMJNSThreadViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); -// self.title = @"看打印"; + LMJWeak(self); [self.view makeToast:@"看打印"]; - self.addItem([LMJWordItem itemWithTitle:@"简单创建一个多线程" subTitle:@"NSThread alloc init" itemOperation:^(NSIndexPath *indexPath) { + self + .addItem([LMJWordItem itemWithTitle:@"pthread" subTitle:@"pthread_create" itemOperation:^(NSIndexPath *indexPath) { + + [weakself addPthread]; + }]) + .addItem([LMJWordItem itemWithTitle:@"简单创建一个多线程" subTitle:@"NSThread alloc init" itemOperation:^(NSIndexPath *indexPath) { [weakself addThreadAction]; }]) @@ -36,48 +41,53 @@ - (void)viewDidLoad { }]) .addItem([LMJWordItem itemWithTitle:@"强制退出线程" subTitle:@"[NSThread exit]" itemOperation:^(NSIndexPath *indexPath) { - [weakself ExitThread]; }]) .addItem([LMJWordItem itemWithTitle:@"用一个数组存储多条线程" subTitle:nil itemOperation:^(NSIndexPath *indexPath) { - [weakself addArrayThtead]; }]); } +void *run(void *param) { + + for (NSInteger i = 0; i<100; i++) { + NSLog(@"------pthread_t---%zd--%@", i, [NSThread currentThread]); + } + return NULL; +} +// 0: pthread +- (void)addPthread +{ + pthread_t thread; + pthread_create(&thread, NULL, run, NULL); + + pthread_t thread2; + pthread_create(&thread2, NULL, run, NULL); +} + //一:简单创建一个多线程 -(void)addThreadAction { - NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(runAction) object:nil]; + NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(runAction:) object:nil]; thread.name = @"custom--1"; [thread start]; //另外的创建方式 - //1:创建线程后自动启动线程 [NSThread detachNewThreadSelector:@selector(run) toTarget:self withObject:nil]; - //2:隐式创建并启动线程 [self performSelectorInBackground:@selector(run) withObject:nil]; + //1:创建线程后自动启动线程 [NSThread detachNewThreadSelector:@selector(runAction:) toTarget:self withObject:@"rose"]; + //2:隐式创建并启动线程 [self performSelectorInBackground:@selector(runAction:) withObject:@"jack"]; } -- (void)runAction +- (void)runAction:(id)obj { NSLog(@"当前执行的线程为:%@", [NSThread currentThread]); - //输出:当前执行的线程为:{number = 1, name = main} - } //二:测试增加一定数量对CPU的影响 -(void)addMutableThread { - //CPU 160%左右 内存150MB左右 平时80MB 这样写在主线程上创建100000多条thread导致卡住 - // for (int num=0; num<100000; num++) { - // NSThread *thread=[[NSThread alloc]initWithTarget:self selector:@selector(runMutableAction) object:nil]; - // thread.name=[NSString stringWithFormat:@"thread-%d",num]; - // [thread start]; - // } - - //把创建子线程的操作放在一个子线程中进行 不影响主线程 NSThread *thread=[[NSThread alloc]initWithTarget:self selector:@selector(runMutableThreadAction) object:nil]; thread.name=[NSString stringWithFormat:@"thread-mutable"]; @@ -86,7 +96,7 @@ -(void)addMutableThread -(void)runMutableThreadAction { - for (int num=0; num<100; num++) { + for (int num=0; num < 100; num++) { NSThread *thread=[[NSThread alloc]initWithTarget:self selector:@selector(runMutableAction) object:nil]; thread.name=[NSString stringWithFormat:@"thread-thread"]; [thread start]; @@ -104,6 +114,7 @@ -(void)runMutableAction //三:强制退出线程 -(void)ExitThread { + _myThread = nil; if (!self.myThread) { self.myThread=[[NSThread alloc]initWithTarget:self selector:@selector(runExitAction) object:nil]; self.myThread.name=@"thread-exit"; @@ -115,13 +126,12 @@ -(void)runExitAction { //阻塞(暂停)3秒后执行再下面内容 [NSThread sleepForTimeInterval:3]; //单位是秒 - + [[NSThread currentThread] cancel]; //结合下面的cancel运用 进行强制退出线程的操作 if ([[NSThread currentThread] isCancelled]) { NSLog(@"当前thread-exit被exit动作了"); [NSThread exit]; } - NSLog(@"当前thread-exit线程为:%@",[NSThread currentThread]); } @@ -136,12 +146,10 @@ -(void)addArrayThtead [self.myThreadList removeAllObjects]; - for(int i=0; i<10;i++) { NSThread *thread=[[NSThread alloc]initWithTarget:self selector:@selector(loadAction:) object:[NSNumber numberWithInt:i]]; thread.name=[NSString stringWithFormat:@"myThread%i",i]; - [self.myThreadList addObject:thread]; } @@ -157,6 +165,9 @@ -(void)loadAction:(NSNumber *)index NSLog(@"loadAction是在线程%@中执行",thread.name); //回主线程去执行 有些UI相应 必须在主线程中更新 +// [self.imageView performSelector:@selector(setImage:) onThread:[NSThread mainThread] withObject:image waitUntilDone:NO]; + // [self.imageView performSelectorOnMainThread:@selector(setImage:) withObject:image waitUntilDone:NO]; + // [self performSelectorOnMainThread:@selector(showImage:) withObject:image waitUntilDone:YES]; [self performSelectorOnMainThread:@selector(updateImage) withObject:nil waitUntilDone:YES]; } @@ -164,23 +175,19 @@ -(void)updateImage { NSLog(@"执行完成了"); NSLog(@"执行方法updateImage是在===%@线程===中",[NSThread isMainThread] ? @"主" : @"子"); - //输出:执行方法updateImage是在主线程中 } --(void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; - //结合VC生命周期 viewWillDisappear退出页面时就把线程标识为cancel - if (self.myThread && ![self.myThread isCancelled]) { +- (void)dealloc { + + //退出页面时就把线程标识为cancel + if (![self.myThread isCancelled]) { NSLog(@"当前thread-exit线程被cancel"); [self.myThread cancel]; NSLog(@"当前thread-exit线程被cancel的状态 %@",[self.myThread isCancelled]?@"被标识为Cancel":@"没有被标识"); - //cancel 只是一个标识 最下退出强制终止线程的操作是exit 如果单写cancel 线程还是会继续执行 } - - //结合VC生命周期 viewWillDisappear退出页面时就把线程标识为cancel 使用Thread一定要在退出前进行退出,否则会有闪存泄露的问题 + //结合VC生命周期退出页面时就把线程标识为cancel 使用Thread一定要在退出前进行退出,否则会有闪存泄露的问题 for (int i=0; i -#import "XLMJThread.h" #import "LMJSettingCell.h" @interface LMJRunLoopViewController () -/** <#digest#> */ -@property (nonatomic, strong) XLMJThread *xlmjThread; -/** <#digest#> */ -@property (nonatomic, strong) NSMutableArray *timers; -/** <#digest#> */ -@property (nonatomic, strong) NSMutableArray *threads; +@property (nonatomic, strong) NSMutableDictionary *timers; +@property (nonatomic, strong) NSMutableDictionary *threads; + +@property (nonatomic, assign) CFRunLoopObserverRef observer; @end @implementation LMJRunLoopViewController -static BOOL item01Operationed = NO; -static BOOL item02Operationed = NO; -static BOOL item1Operationed = NO; -static BOOL item3Operationed = NO; - - (void)viewDidLoad { [super viewDidLoad]; -// self.title = @"看打印"; - [self.view makeToast:@"看打印"]; - LMJWeakSelf(self); - LMJWordItem *item0 = [LMJWordItem itemWithTitle:@"线程和RunLoop" subTitle:nil]; - item0.itemOperation = ^(NSIndexPath *indexPath) { - [weakself threadRunLoop]; - }; - - LMJWordItem *item01 = [LMJWordItem itemWithTitle:@"子线程定时器" subTitle:@"思考定时器为什么不执行?"]; - item01.itemOperation = ^(NSIndexPath *indexPath) { - if (item01Operationed) { + _timers = [NSMutableDictionary dictionary]; + _threads = [NSMutableDictionary dictionary]; + + LMJWeak(self); + self.addItem([LMJWordItem itemWithTitle:@"定时器和\"主\"RunLoop" subTitle:@"定时器为什么走?" itemOperation:^(NSIndexPath *indexPath) { + // 如果有就取消定时器 + if (weakself.timers[indexPath]) { + [weakself.timers[indexPath] invalidate]; + weakself.timers[indexPath] = nil; return ; } - item01Operationed = YES; - [weakself timerOnChildThread]; - }; - - LMJWordItem *item02 = [LMJWordItem itemWithTitle:@"子线程定时器2" subTitle:@"思考定时器为什么\"执行\"?"]; - item02.itemOperation = ^(NSIndexPath *indexPath) { - if (item02Operationed) { - return ; - } - item02Operationed = YES; - [weakself timerOnChildThread2]; - }; - - LMJWordItem *item1 = [LMJWordItem itemWithTitle:@"定时器和RunLoop" subTitle:nil]; - item1.itemOperation = ^(NSIndexPath *indexPath) { - if (item1Operationed) { + // 调用了scheduledTimer返回的定时器,已经自动被添加到当前runLoop中,而且是NSDefaultRunLoopMode + // 定时器只运行在NSDefaultRunLoopMode下,一旦RunLoop进入其他模式,这个定时器就不会工作 + // 定时器只运行在UITrackingRunLoopMode下,一旦RunLoop进入其他模式,这个定时器就不会工作 + weakself.timers[indexPath] = [NSTimer scheduledTimerWithTimeInterval:1 repeats:YES block:^(NSTimer * _Nonnull timer) { + NSLog(@"%@", timer); + }]; + + // 修改模式 + // 标记为common modes的模式:UITrackingRunLoopMode和NSDefaultRunLoopMode + [[NSRunLoop currentRunLoop] addTimer:weakself.timers[indexPath] forMode:NSRunLoopCommonModes]; + + }]) + .addItem([LMJWordItem itemWithTitle:@"定时器和\"子线程\"RunLoop" subTitle:@"定时器为什么\"不走\"了?" itemOperation:^(NSIndexPath *indexPath) { + // 如果有就取消定时器 + if (weakself.threads[indexPath]) { + [weakself.timers[indexPath] invalidate]; + [weakself.threads[indexPath] cancel]; + weakself.threads[indexPath] = nil; + weakself.timers[indexPath] = nil; return ; } - item1Operationed = YES; - [weakself timerRunLoop]; - }; - - - LMJWordItem *item3 = [LMJWordItem itemWithTitle:@"1, 线程常驻:runLoop里边需要添加NSPort" subTitle:@"2, 添加runloop观察者, 请点击多次看打印"]; - item3.itemOperation = ^(NSIndexPath *indexPath) { - - if (!item3Operationed) { - XLMJThread *thread = [[XLMJThread alloc] initWithTarget:weakself selector:@selector(liveThread) object:nil]; - weakself.xlmjThread = thread; - [thread start]; - } - - item3Operationed = YES; - // 在常驻线程执行 - [weakself performSelector:@selector(liveThreadRun) onThread:weakself.xlmjThread withObject:nil waitUntilDone:NO]; - }; - - LMJItemSection *section0 = [LMJItemSection sectionWithItems:@[item0, item01, item02, item1, item3] andHeaderTitle:nil footerTitle:nil]; - [self.sections addObject:section0]; - - UIButton *btn = [UIButton initWithFrame:CGRectMake(0, 0, 100, 100) buttonTitle:@"取消所有的定时器, 停止所有的线程, 恢复初始化" normalBGColor:[UIColor yellowColor] selectBGColor:[UIColor whiteColor] normalColor:[UIColor redColor] selectColor:[UIColor greenColor] buttonFont:[UIFont systemFontOfSize:16] cornerRadius:10 doneBlock:^(UIButton *btn) { - [weakself cancelAndDissmissAll]; - }]; - - btn.titleLabel.numberOfLines = 0; - - self.tableView.tableFooterView = btn; -} - -- (void)liveThread -{ - // 观察当前 runloop - [self observerRunLoop]; - - NSLog(@"----------run--- start -%@", [NSThread currentThread]); - // 添加 port - [[NSRunLoop currentRunLoop] addPort:[NSPort port] forMode:NSDefaultRunLoopMode]; - - // 跑起来 - [[NSRunLoop currentRunLoop] run]; - - // 不会走的, 不会执行 - NSLog(@"----------run-- end --%@", [NSThread currentThread]); - - -} - -- (void)liveThreadRun -{ - NSLog(@"----------test----%@", [NSThread currentThread]); -} - - -- (void)observerRunLoop -{ - /* Run Loop Observer Activities */ -// typedef CF_OPTIONS(CFOptionFlags, CFRunLoopActivity) { -// kCFRunLoopEntry = (1UL << 0), -// kCFRunLoopBeforeTimers = (1UL << 1), -// kCFRunLoopBeforeSources = (1UL << 2), -// kCFRunLoopBeforeWaiting = (1UL << 5), -// kCFRunLoopAfterWaiting = (1UL << 6), -// kCFRunLoopExit = (1UL << 7), -// kCFRunLoopAllActivities = 0x0FFFFFFFU -// }; - NSArray *arr = @[@"kCFRunLoopEntry", - @"kCFRunLoopBeforeTimers", - @"kCFRunLoopBeforeSources", - @"kCFRunLoopBeforeWaiting", - @"kCFRunLoopAfterWaiting", - @"kCFRunLoopExit", - @"kCFRunLoopAllActivities"]; - - // 创建observer - CFRunLoopObserverRef observerRef =CFRunLoopObserverCreateWithHandler(CFAllocatorGetDefault(), kCFRunLoopAllActivities, YES, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity activity) { - - NSString *activityStr = nil; - - if (activity == kCFRunLoopEntry) { - activityStr = arr[0]; - } - - if (activity == kCFRunLoopBeforeTimers) { - activityStr = arr[1]; - } - - - if (activity == kCFRunLoopBeforeSources) { - activityStr = arr[2]; + // 子线程添加定时器 + weakself.threads[indexPath] = [[NSThread alloc] initWithBlock:^{ + + weakself.timers[indexPath] = [NSTimer timerWithTimeInterval:1 repeats:YES block:^(NSTimer * _Nonnull timer) { + NSLog(@"%@", timer); + }]; + + [[NSRunLoop currentRunLoop] addTimer:weakself.timers[indexPath] forMode:NSRunLoopCommonModes]; + }]; + + [weakself.threads[indexPath] start]; + + }]) + .addItem([LMJWordItem itemWithTitle:@"定时器和\"子线程\"RunLoop" subTitle:@"定时器为什么\"走\"了?" itemOperation:^(NSIndexPath *indexPath) { + // 如果有就取消定时器 + if (weakself.threads[indexPath]) { + [weakself.timers[indexPath] invalidate]; + [weakself.threads[indexPath] cancel]; + weakself.threads[indexPath] = nil; + weakself.timers[indexPath] = nil; + return ; } - - if (activity == kCFRunLoopBeforeWaiting) { - activityStr = arr[3]; + // 子线程添加定时器 + weakself.threads[indexPath] = [[NSThread alloc] initWithBlock:^{ + + weakself.timers[indexPath] = [NSTimer timerWithTimeInterval:1 repeats:YES block:^(NSTimer * _Nonnull timer) { + NSLog(@"%@", timer); + }]; + + // 添加 Timer, 开启 RunLoop + [[NSRunLoop currentRunLoop] addTimer:weakself.timers[indexPath] forMode:NSDefaultRunLoopMode]; + // 或者添加 NSPort, 开启 RunLoop + // [[NSRunLoop currentRunLoop] addPort:[NSPort port] forMode:NSRunLoopCommonModes]; + + + // 开始运行循环 + [[NSRunLoop currentRunLoop] run]; + + }]; + + [weakself.threads[indexPath] start]; + + }]) + .addItem([LMJWordItem itemWithTitle:@"子线程执行任务" subTitle:@"为什么不能执行?" itemOperation:^(NSIndexPath *indexPath) { + // 如果有 + if (weakself.threads[indexPath]) { + // 子线程执行任务 + [weakself performSelector:@selector(log:) onThread:weakself.threads[indexPath] withObject:weakself.threads[indexPath] waitUntilDone:NO]; + return ; } + weakself.threads[indexPath] = [[NSThread alloc] initWithBlock:^{ + NSLog(@"start"); + }]; + [weakself.threads[indexPath] start]; - if (activity == kCFRunLoopAfterWaiting) { - activityStr = arr[4]; - } - + [weakself performSelector:@selector(log:) onThread:weakself.threads[indexPath] withObject:weakself.threads[indexPath] waitUntilDone:NO]; - if (activity == kCFRunLoopExit) { - activityStr = arr[5]; + }]) + .addItem([LMJWordItem itemWithTitle:@"子线程执行任务" subTitle:@"为什么能执行任务?" itemOperation:^(NSIndexPath *indexPath) { + // 如果有 + if (weakself.threads[indexPath]) { + // 子线程执行任务 + [weakself performSelector:@selector(log:) onThread:weakself.threads[indexPath] withObject:weakself.threads[indexPath] waitUntilDone:NO]; + return ; } - - if (activity == kCFRunLoopAllActivities) { - activityStr = arr[6]; + weakself.threads[indexPath] = [[NSThread alloc] initWithBlock:^{ + NSLog(@"start"); + // 添加 port 或者 timer + [[NSRunLoop currentRunLoop] addPort:[NSPort port] forMode:NSRunLoopCommonModes]; + [[NSRunLoop currentRunLoop] run]; + }]; + [weakself.threads[indexPath] start]; + + [weakself performSelector:@selector(log:) onThread:weakself.threads[indexPath] withObject:weakself.threads[indexPath] waitUntilDone:NO]; + }]) + .addItem([LMJWordItem itemWithTitle:@"RunLoop观察者" subTitle:@"" itemOperation:^(NSIndexPath *indexPath) { + + // 如果有 + if (weakself.threads[indexPath]) { + // [weakself.threads[indexPath] cancel]; + // weakself.threads[indexPath] = nil; + // CFRunLoopObserverInvalidate(observer); + // observer = nil; + // 子线程执行任务 + [weakself performSelector:@selector(log:) onThread:weakself.threads[indexPath] withObject:weakself.threads[indexPath] waitUntilDone:NO]; + return ; } - NSLog(@"----监听到RunLoop状态发生改变---%@", activityStr); - }); - - // 添加观察者:监听RunLoop的状态 - CFRunLoopAddObserver(CFRunLoopGetCurrent(), observerRef, kCFRunLoopDefaultMode); - - // 释放Observer - CFRelease(observerRef); - - /* - CF的内存管理(Core Foundation) - 1.凡是带有Create、Copy、Retain等字眼的函数,创建出来的对象,都需要在最后做一次release - * 比如CFRunLoopObserverCreate - 2.release函数:CFRelease(对象); - */ -} - -- (void)timerRunLoop -{ - // 主运行循环 - NSLog(@"--runLoop--%p", [NSRunLoop mainRunLoop]); - - // 调用了scheduledTimer返回的定时器,已经自动被添加到当前runLoop中,而且是NSDefaultRunLoopMode - NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(run) userInfo:nil repeats:YES]; - [self.timers addObject:timer]; - // 修改模式 - // 定时器会跑在标记为common modes的模式下 - // 标记为common modes的模式:UITrackingRunLoopMode和kCFRunLoopDefaultMode - [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; -} - -- (void)dealloc { - [self cancelAndDissmissAll]; -} - -- (void)cancelAndDissmissAll -{ - [_timers makeObjectsPerformSelector:@selector(invalidate)]; - [_timers removeAllObjects]; - - [_threads makeObjectsPerformSelector:@selector(cancel)]; - [_threads removeAllObjects]; - [_xlmjThread cancel]; - _xlmjThread = nil; - - item01Operationed = NO; - item02Operationed = NO; - item1Operationed = NO; - item3Operationed = NO; -} - -- (void)threadRunLoop -{ - // 主运行循环 - NSLog(@"--runLoop--%p", [NSRunLoop mainRunLoop]); - NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(run) object:nil]; - [self.threads addObject:thread]; - [thread start]; -} - -- (void)run -{ - NSLog(@"----run"); - NSLog(@"-----runLoop--%p", [NSRunLoop currentRunLoop]); - NSLog(@"--%@---", [NSThread currentThread]); -} - -- (void)timerOnChildThread2 -{ - NSLog(@"-----runLoop--%p", [NSRunLoop currentRunLoop]); - NSLog(@"--%@---", [NSThread currentThread]); - - NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(scheduledTimer2) object:nil]; - [thread start]; - - [self.threads addObject:thread]; -} - -- (void)scheduledTimer2 -{ - NSLog(@"-----runLoop--%p", [NSRunLoop currentRunLoop]); - NSLog(@"--%@---", [NSThread currentThread]); - - NSLog(@"----------run--- start -%@", [NSThread currentThread]); - - LMJWeakSelf(self); - NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1 repeats:YES block:^(NSTimer * _Nonnull timer) { - [weakself run]; + weakself.threads[indexPath] = [[NSThread alloc] initWithBlock:^{ + + NSLog(@"start"); + + CFRunLoopObserverRef observer = CFRunLoopObserverCreateWithHandler(CFAllocatorGetDefault(), kCFRunLoopAllActivities, YES, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity activity) { + // kCFRunLoopEntry = (1UL << 0), + // kCFRunLoopBeforeTimers = (1UL << 1), + // kCFRunLoopBeforeSources = (1UL << 2), + // kCFRunLoopBeforeWaiting = (1UL << 5), + // kCFRunLoopAfterWaiting = (1UL << 6), + // kCFRunLoopExit = (1UL << 7), + // kCFRunLoopAllActivities = 0x0FFFFFFFU + NSLog(@"----%lu", activity); + }); + + CFRunLoopAddObserver(CFRunLoopGetCurrent(), observer, kCFRunLoopCommonModes); + CFRelease(observer); + // 添加 port 或者 timer + [[NSRunLoop currentRunLoop] addPort:[NSPort port] forMode:NSRunLoopCommonModes]; + [[NSRunLoop currentRunLoop] run]; + }]; + [weakself.threads[indexPath] start]; + }]); + + LMJWordItem *item = [LMJWordItem itemWithTitle:@"恢复所有的初始化" subTitle:@"取消定时器和线程" itemOperation:^(NSIndexPath *indexPath) { + + [weakself.timers enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, NSTimer * _Nonnull obj, BOOL * _Nonnull stop) { + [obj invalidate]; + }]; + + [weakself.threads enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, NSThread * _Nonnull obj, BOOL * _Nonnull stop) { + [obj cancel]; + }]; + + weakself.observer = nil; + [weakself.timers removeAllObjects]; + [weakself.threads removeAllObjects]; }]; - [self.timers addObject:timer]; - // 添加 port - [[NSRunLoop currentRunLoop] addPort:[NSPort port] forMode:NSDefaultRunLoopMode]; - - [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; - // 跑起来 - [[NSRunLoop currentRunLoop] run]; + item.titleColor = [UIColor redColor]; + item.subTitleColor = [UIColor greenColor]; - // 不会走的, 不会执行 - NSLog(@"----------run-- end --%@", [NSThread currentThread]); + [self.sections.firstObject.items addObject:item]; } -- (void)timerOnChildThread +- (void)log:(id)obj { - NSLog(@"-----runLoop--%p", [NSRunLoop currentRunLoop]); - NSLog(@"--%@---", [NSThread currentThread]); - - NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(scheduledTimer) object:nil]; - [thread start]; - - [self.threads addObject:thread]; + NSLog(@"%@", obj); } -- (void)scheduledTimer -{ - NSLog(@"-----runLoop--%p", [NSRunLoop currentRunLoop]); - NSLog(@"--%@---", [NSThread currentThread]); - LMJWeakSelf(self); - NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1 repeats:YES block:^(NSTimer * _Nonnull timer) { - [weakself run]; - }]; - [self.timers addObject:timer]; - [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; -} - -#pragma mark - no -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - [super tableView:tableView cellForRowAtIndexPath:indexPath]; +#pragma mark - null +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { LMJWordItem *item = self.sections[indexPath.section].items[indexPath.row]; - LMJSettingCell *cell = [LMJSettingCell cellWithTableView:tableView andCellStyle:UITableViewCellStyleSubtitle]; - cell.item = item; - return cell; } @@ -333,38 +224,4 @@ -(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navi [self.navigationController popViewControllerAnimated:YES]; } -- (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar { - - [rightButton setTitle:@"参考网页" forState:UIControlStateNormal]; - [rightButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; - rightButton.lmj_width = 100; - - return nil; -} - -- (void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { - LMJWebViewController *web = [[LMJWebViewController alloc] init]; - web.gotoURL = @"https://github.com/NJHu/NJNet/blob/master/0912runloop/README.md"; - [self.navigationController pushViewController:web animated:YES]; - -} - -- (NSMutableArray *)timers -{ - if(!_timers) - { - _timers = [NSMutableArray array]; - } - return _timers; -} - -- (NSMutableArray *)threads -{ - if(!_threads) - { - _threads = [NSMutableArray array]; - } - return _threads; -} - @end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJRunTimeViewController.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJRunTimeViewController.m" index c933c9d4..daaf9916 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJRunTimeViewController.m" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/LMJRunTimeViewController.m" @@ -7,27 +7,22 @@ // #import "LMJRunTimeViewController.h" -#import "LMJRunTimeTest.h" -#import "LMJRunTimeTest+LMJMethod.h" -#import "LMJRunTimeTest+LMJWork.h" -//#import "UIAlertView+LMJBlock.h" +#import "LMJStudent.h" @interface LMJRunTimeViewController () -/** <#digest#> */ -@property (nonatomic, strong) LMJRunTimeTest *myRunTimeTest; - -/** <#digest#> */ @property (nonatomic, strong) UIButton *myButton; - +/** <#digest#> */ +@property (nonatomic, strong) LMJStudent *student; @end @implementation LMJRunTimeViewController - (void)viewDidLoad { [super viewDidLoad]; - LMJWeakSelf(self); + LMJWeak(self); [self setDes]; - self.myRunTimeTest=[[LMJRunTimeTest alloc] init]; + + self.student = [[LMJStudent alloc] init]; //HOCK 注入影响方法里面 self.myButton = [[UIButton alloc]init]; @@ -47,20 +42,20 @@ - (void)viewDidLoad { self.addItem([LMJWordItem itemWithTitle:@"获取类的信息" subTitle:@"关键字: class_get" itemOperation:^(NSIndexPath *indexPath) { //类名 - NSString *className = [NSString stringWithFormat:@"class name: %s\n", class_getName([weakself.myRunTimeTest class])]; + NSString *className = [NSString stringWithFormat:@"class name: %s\n", class_getName([weakself.student class])]; // 父类 - NSString *superClassName = [NSString stringWithFormat:@"super class name: %s\n", class_getName(class_getSuperclass([weakself.myRunTimeTest class]))]; + NSString *superClassName = [NSString stringWithFormat:@"super class name: %s\n", class_getName(class_getSuperclass([weakself.student class]))]; // 是否是元类 - NSString *isMetaClass = [NSString stringWithFormat:@"myRunTimeTest is %@ a meta-class\n", (class_isMetaClass([weakself.myRunTimeTest class]) ? @"" : @"not")]; + NSString *isMetaClass = [NSString stringWithFormat:@"student is %@ a meta-class\n", (class_isMetaClass([weakself.student class]) ? @"" : @"not")]; // 元类是什么 - Class meta_class = objc_getMetaClass(class_getName([weakself.myRunTimeTest class])); - NSString *metaClass = [NSString stringWithFormat:@"%s's meta-class is %s\n", class_getName([LMJRunTimeTest class]), class_getName(meta_class)]; + Class meta_class = objc_getMetaClass(class_getName([weakself.student class])); + NSString *metaClass = [NSString stringWithFormat:@"%s's meta-class is %s\n", class_getName([LMJStudent class]), class_getName(meta_class)]; // 变量实例大小 - NSString *instanceSize = [NSString stringWithFormat:@"instance size: %zu\n", class_getInstanceSize([weakself.myRunTimeTest class])]; + NSString *instanceSize = [NSString stringWithFormat:@"instance size: %zu\n", class_getInstanceSize([weakself.student class])]; NSString *message = [NSString stringWithFormat:@"%@%@%@%@%@", className, superClassName, isMetaClass, metaClass, instanceSize]; @@ -72,36 +67,22 @@ - (void)viewDidLoad { NSMutableString *strM = [NSMutableString string]; unsigned int count; - objc_property_t *propertyList = class_copyPropertyList([weakself.myRunTimeTest class], &count); + objc_property_t *propertyList = class_copyPropertyList([weakself.student class], &count); + for (unsigned int i=0; i%@", [NSString stringWithUTF8String:propertyName]); - [strM appendFormat:@"属性名称为---->%@\n", [NSString stringWithUTF8String:propertyName]]; - NSString *getPropertyNameString = [NSString stringWithCString:property_getAttributes(propertyList[i]) encoding:NSUTF8StringEncoding]; - NSLog(@"属性类型及修饰符为: %@",getPropertyNameString); - [strM appendFormat:@"属性类型及修饰符为: %@\n",getPropertyNameString]; + const char *getPropertyNameString = property_getAttributes(propertyList[i]); + + NSLog(@"属性名称为---->%s", propertyName); + NSLog(@"属性类型及修饰符为: %s",getPropertyNameString); + + [strM appendFormat:@"属性名称为---->%s\n", propertyName]; + [strM appendFormat:@"属性类型及修饰符为: %s\n",getPropertyNameString]; } free(propertyList); - [strM appendString:@"\n\n\n"]; - - objc_property_t array = class_getProperty([weakself.myRunTimeTest class], "name"); - if (array != NULL) { - NSLog(@"当前存在属性 %s", property_getName(array)); - [strM appendFormat:@"当前存在属性 %s", property_getName(array)]; - } - [weakself alertTitle:@"获取类的对应属性" message:strM]; - //******显示内容如下****** - //属性名称为---->workName - //属性类型及修饰符为: T@"NSString",C,N - //属性名称为---->name - //属性类型及修饰符为: T@"NSString",C,N,V_name - // 属性名称为---->age - // 属性类型及修饰符为: Tq,N,V_age - - //******显示内容如下****** - //当前存在属性 name }]) .addItem([LMJWordItem itemWithTitle:@"获取类的成员变量" subTitle:@"class_copyIvarList" itemOperation:^(NSIndexPath *indexPath) { @@ -109,59 +90,36 @@ - (void)viewDidLoad { NSMutableString *strM = [NSMutableString string]; unsigned int count; - Ivar *ivarList = class_copyIvarList([weakself.myRunTimeTest class], &count); + Ivar *ivarList = class_copyIvarList([weakself.student class], &count); for (unsigned int i = 0; i < count; i++) { Ivar myIvar = ivarList[i]; const char *ivarName = ivar_getName(myIvar); - NSLog(@"成员变量为---->%@", [NSString stringWithUTF8String:ivarName]); - [strM appendFormat:@"成员变量为---->%@\n", [NSString stringWithUTF8String:ivarName]]; + NSLog(@"成员变量为---->%s", ivarName); + [strM appendFormat:@"成员变量为---->%s\n", ivarName]; } free(ivarList); - //******显示内容如下****** - //成员变量为---->_school_Name - //成员变量为---->_userHeight_ - //成员变量为---->_name - //成员变量为---->_age - [strM appendString:@"\n\n\n"]; - Ivar string = class_getInstanceVariable([weakself.myRunTimeTest class], "_age"); - if (string != NULL) { - NSLog(@"当前存在变量 %s", ivar_getName(string)); - [strM appendFormat:@"class_getInstanceVariable\n当前存在变量 %s\n", ivar_getName(string)]; + Ivar name_1Ivar = class_getInstanceVariable([weakself.student class], "_name_1"); + if (name_1Ivar != NULL) { + NSLog(@"当前存在变量 %s", ivar_getName(name_1Ivar)); + [strM appendFormat:@"class_getInstanceVariable\n 当前存在变量 %s\n", ivar_getName(name_1Ivar)]; } - //******显示内容如下****** - //当前存在变量 _age [strM appendString:@"\n\n\n"]; //动态修改变量的值 - LMJRunTimeTest *testModel=[[LMJRunTimeTest alloc]init]; - testModel.name=@"njhu"; - - NSLog(@"当前值没有被修改为:%@",testModel.name); - [strM appendFormat:@"当前值没有被修改为:%@\n",testModel.name]; - unsigned int myCount = 0; - Ivar *ivar = class_copyIvarList([testModel class], &myCount); - for (int i = 0; i *videos; +/** 内存缓存图片 */ +@property (nonatomic, strong) NSMutableDictionary *images; +/** <#digest#> */ +@property (nonatomic, strong) NSOperationQueue *queue; +/** 队列 */ +@property (nonatomic, strong) NSMutableDictionary *operations; +@end + +@implementation LMJWebImagesCacheViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + _images = [NSMutableDictionary dictionary]; + _queue = [[NSOperationQueue alloc] init]; + _queue.maxConcurrentOperationCount = 3; + _operations = [NSMutableDictionary dictionary]; + + [self.tableView registerNib:[UINib nibWithNibName:@"LMJWebImageCacheCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"LMJWebImageCacheCell"]; + + LMJWeak(self); + NSDictionary *parameters = @{@"type" : @"JSON"}; + [[LMJRequestManager sharedManager] GET:[LMJXMGBaseUrl stringByAppendingPathComponent:@"video"] parameters:parameters completion:^(LMJBaseResponse *response) { + if (!response.error && response.responseObject) { + weakself.videos = [LMJXGMVideo mj_objectArrayWithKeyValuesArray:response.responseObject[@"videos"]]; + } else { + [weakself.view makeToast:response.errorMsg]; + return ; + } + [weakself.tableView reloadData]; + }]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.videos.count; +} +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 120; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + LMJWebImageCacheCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LMJWebImageCacheCell"]; + LMJXGMVideo *video = self.videos[indexPath.row]; + + __block UIImage *image = nil; + // 1,从内存中取 + image = self.images[video.image.absoluteString]; + cell.videoImageView.image = image; + + if (!image) { + cell.videoImageView.image = [UIImage imageNamed:@"empty_picture"]; + NSBlockOperation *operation = nil; + // 对应的图片下载操作 + operation = self.operations[video.image.absoluteString]; + + if (!operation) { + + operation = [NSBlockOperation blockOperationWithBlock:^{ + NSFileManager *manager = [NSFileManager defaultManager]; + // 2, 从沙盒中取 + NSString *cache = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject; + // 创建文件夹 + if (![manager fileExistsAtPath:[cache stringByAppendingPathComponent:[NSString stringWithFormat:@"LMJWebImageCaches"]] isDirectory:nil]) { + [manager createDirectoryAtPath:[cache stringByAppendingPathComponent:[NSString stringWithFormat:@"LMJWebImageCaches"]] withIntermediateDirectories:YES attributes:nil error:nil]; + } + NSString *file = [cache stringByAppendingPathComponent:[NSString stringWithFormat:@"LMJWebImageCaches/%@.png", video.image.absoluteString.md5String]]; + + NSData *imageData = [NSData dataWithContentsOfFile:file]; + + if (imageData) { + UIImage *imageDataImage = [UIImage imageWithData:imageData]; + // 4缓存到内存 + self.images[video.image.absoluteString] = imageDataImage; + + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + // 5 cell 循环利用后的图片 ID 对应 + if ([cell.videoNameLabel.text isEqualToString:video.ID]) { + cell.videoImageView.image = imageDataImage; + } + }]; + // 移除 + self.operations[video.image.absoluteString] = nil; + } + + if (!imageData) { + // 2下载 + imageData = [NSData dataWithContentsOfURL:video.image]; + + if (imageData) { + // 3缓存到沙盒 + [imageData writeToFile:file atomically:YES]; + + UIImage *imageDataImage = [UIImage imageWithData:imageData]; + + // 4缓存到内存 + self.images[video.image.absoluteString] = imageDataImage; + + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + // 5 cell 循环利用后的图片 ID 对应 + if ([cell.videoNameLabel.text isEqualToString:video.ID]) { + cell.videoImageView.image = imageDataImage; + } + }]; + } + + // 移除 + self.operations[video.image.absoluteString] = nil; + } + + }]; + + // 开始 + [self.queue addOperation:operation]; + // 保存 + self.operations[video.image.absoluteString] = operation; + } + } + + cell.videoNameLabel.text = video.ID; + cell.videoDesLabel.text = video.name; + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + + VIDMoviePlayerViewController *playerVc = [[VIDMoviePlayerViewController alloc] init]; + playerVc.videoURL = self.videos[indexPath.row].url.absoluteString; + + [self.navigationController pushViewController:playerVc animated:YES]; +} + +#pragma mark - LMJNavUIBaseViewControllerDataSource + +/** 导航条左边的按钮 */ +- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar +{ + [leftButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; + + return [UIImage imageNamed:@"NavgationBar_blue_back"]; +} + +#pragma mark - LMJNavUIBaseViewControllerDelegate +/** 左边的按钮的点击 */ +-(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar +{ + [self.navigationController popViewControllerAnimated:YES]; +} + +@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJBlockLoopOperation.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJBlockLoopOperation.h" index 25bb7984..9e3262cc 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJBlockLoopOperation.h" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJBlockLoopOperation.h" @@ -10,7 +10,7 @@ @interface LMJBlockLoopOperation : NSObject -+ (void)operateWithSuccessBlock:(void(^)())successBlock; ++ (void)operateWithSuccessBlock:(void(^)(void))successBlock; /** <#digest#> */ @property (nonatomic, copy) NSString *address; diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJBlockLoopOperation.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJBlockLoopOperation.m" index c152b10c..3ec77005 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJBlockLoopOperation.m" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJBlockLoopOperation.m" @@ -10,7 +10,7 @@ @implementation LMJBlockLoopOperation -+ (void)operateWithSuccessBlock:(void(^)())successBlock ++ (void)operateWithSuccessBlock:(void(^)(void))successBlock { if (successBlock) { successBlock(); diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJDataBaseConnectionProtocol.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJDataBaseConnectionProtocol.h" deleted file mode 100644 index d60f1c50..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJDataBaseConnectionProtocol.h" +++ /dev/null @@ -1,20 +0,0 @@ - - -#import - - - -@protocol LMJDataBaseConnectionProtocol - -@optional - -- (void)suspend; - -@required - -- (void)start; - -- (void)end; - - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJOraceDataBase.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJOraceDataBase.h" deleted file mode 100644 index 61234c8b..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJOraceDataBase.h" +++ /dev/null @@ -1,15 +0,0 @@ -// -// LMJOraceDataBase.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/17. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import -#import "LMJDataBaseConnectionProtocol.h" - -@interface LMJOraceDataBase : NSObject - - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJOraceDataBase.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJOraceDataBase.m" deleted file mode 100644 index 91f2f558..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJOraceDataBase.m" +++ /dev/null @@ -1,24 +0,0 @@ -// -// LMJOraceDataBase.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/17. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJOraceDataBase.h" - -@implementation LMJOraceDataBase - -- (void)start -{ - NSLog(@"%s", __func__); -} - - -- (void)end -{ - NSLog(@"%s", __func__); -} - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJMethod.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJMethod.h" deleted file mode 100644 index cf370fc5..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJMethod.h" +++ /dev/null @@ -1,17 +0,0 @@ -// -// LMJRunTimeTest+LMJMethod.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/14. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJRunTimeTest.h" - -@interface LMJRunTimeTest (LMJMethod) - - - -- (NSString *)showUserAge:(NSString *)age; - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJMethod.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJMethod.m" deleted file mode 100644 index 12739590..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJMethod.m" +++ /dev/null @@ -1,24 +0,0 @@ -// -// LMJRunTimeTest+LMJMethod.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/14. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJRunTimeTest+LMJMethod.h" - -@implementation LMJRunTimeTest (LMJMethod) - - -- (NSString *)showUserAge:(NSString *)age -{ - - return [NSString stringWithFormat:@"年龄是%@", age]; - - -} - - - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJWork.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJWork.h" deleted file mode 100644 index cef7f0ad..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJWork.h" +++ /dev/null @@ -1,18 +0,0 @@ -// -// LMJRunTimeTest+LMJWork.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/14. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJRunTimeTest.h" - -@interface LMJRunTimeTest (LMJWork) - - - -/** <#digest#> */ -@property (nonatomic, copy) NSString *workName; - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJWork.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJWork.m" deleted file mode 100644 index fdb06d2d..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest+LMJWork.m" +++ /dev/null @@ -1,34 +0,0 @@ -// -// LMJRunTimeTest+LMJWork.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/14. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJRunTimeTest+LMJWork.h" - - -static void *workKey_ = &workKey_; - -@implementation LMJRunTimeTest (LMJWork) - - - - -- (NSString *)workName -{ - return objc_getAssociatedObject(self, workKey_); -} - - -- (void)setWorkName:(NSString *)workName -{ - objc_setAssociatedObject(self, workKey_, workName, OBJC_ASSOCIATION_COPY); -} - - - - - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest.h" deleted file mode 100644 index 663aad6d..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest.h" +++ /dev/null @@ -1,24 +0,0 @@ -// -// LMJRunTimeTest.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/13. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import - -@interface LMJRunTimeTest : NSObject -{ - NSString *_school_Name; -} - -/** <#digest#> */ -@property (nonatomic, copy) NSString *name; - -/** <#digest#> */ -@property (assign, nonatomic) NSInteger age; - -- (NSString *)showUserName:(NSString *)userName; - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest.m" deleted file mode 100644 index a08bd6d7..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJRunTimeTest.m" +++ /dev/null @@ -1,126 +0,0 @@ -// -// LMJRunTimeTest.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/13. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJRunTimeTest.h" - - -@interface LMJRunTimeTest () -{ - CGFloat _userHeight_; -} - -@end - -@implementation LMJRunTimeTest - - - - -+ (void)showAddress -{ - NSLog(@"北京"); -} - - - -- (NSString *)showUserName:(NSString *)userName -{ - - return [NSString stringWithFormat:@"用户名字是%@", userName]; -} - - -- (instancetype)initWithCoder:(NSCoder *)coder -{ - self = [super init]; - if (self) { - - - unsigned int count = 0; - - Ivar *ivarList = class_copyIvarList(self.class, &count); - - - - for (NSInteger i = 0; i < count; i++) { - - Ivar ivar = ivarList[i]; - - - const char *proName = ivar_getName(ivar); - -// id value = [self valueForKeyPath:[NSString stringWithUTF8String:proName]]; - - -// [aCoder encodeObject:value forKey:[NSString stringWithUTF8String:proName]]; - - id value = [coder decodeObjectForKey:[NSString stringWithUTF8String:proName]]; - - - [self setValue:value forKeyPath:[NSString stringWithUTF8String:proName]]; - - - - - NSLog(@"%@", value); - - } - - - free(ivarList); - - - - - - - } - return self; -} - - - - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - - unsigned int count = 0; - - Ivar *ivarList = class_copyIvarList(self.class, &count); - - - - for (NSInteger i = 0; i < count; i++) { - - Ivar ivar = ivarList[i]; - - - const char *proName = ivar_getName(ivar); - - id value = [self valueForKeyPath:[NSString stringWithUTF8String:proName]]; - - - [aCoder encodeObject:value forKey:[NSString stringWithUTF8String:proName]]; - - - NSLog(@"%s", proName); - - } - - - free(ivarList); -} - - - - - - - - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJStudent.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJStudent.h" new file mode 100644 index 00000000..83af4e73 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJStudent.h" @@ -0,0 +1,35 @@ +// +// LMJStudent.h +// iOSProject +// +// Created by HuXuPeng on 2018/4/7. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import + +@interface LMJStudent : NSObject +{ + NSString *_name_0; + NSString *_age_0; +} + +@property (nonatomic, copy) NSString *name_1; +@property (nonatomic, copy) NSString *age_1; + ++ (void)count1; + +- (void)count2; + +@end + + +@interface LMJStudent (LMJ) + +@property (nonatomic, assign) NSInteger LMJAge_1; + ++ (void)count1__1; + +- (void)count2__2; + +@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJStudent.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJStudent.m" new file mode 100644 index 00000000..a8f0d288 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJStudent.m" @@ -0,0 +1,74 @@ +// +// LMJStudent.m +// iOSProject +// +// Created by HuXuPeng on 2018/4/7. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJStudent.h" + +@interface LMJStudent() +{ + NSString *_name_0_1; + NSString *_age_0_1; +} +@property (nonatomic, copy) NSString *name_1_1; +@property (nonatomic, assign) NSString *age_1_1; +@end + +@implementation LMJStudent +{ + NSString *_name_0_2; + NSInteger *_age_0_2; +} + ++ (void)count1 { + NSLogFunc; +} + +- (void)count2 +{ + NSLogFunc; +} + ++ (void)count1_1 { + NSLogFunc; +} + +- (void)count2_2 { + NSLogFunc; +} + +@end + + +void *LMJAge_1Key = &LMJAge_1Key; +@implementation LMJStudent (LMJ) + +- (void)setLMJAge_1:(NSInteger)LMJAge_1 { + objc_setAssociatedObject(self, LMJAge_1Key, @(LMJAge_1), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (NSInteger)LMJAge_1 { + return [objc_getAssociatedObject(self, LMJAge_1Key) integerValue]; +} + ++ (void)count1__1 { + NSLogFunc; +} + +- (void)count2__2 { + NSLogFunc; +} + ++ (void)count3__3 { + NSLogFunc; +} + +- (void)count4__4 { + NSLogFunc; +} + + +@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJUsertProtocol.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJUsertProtocol.h" deleted file mode 100644 index 4d96f90e..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJUsertProtocol.h" +++ /dev/null @@ -1,17 +0,0 @@ -// -// LMJUsertProtocol.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/17. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import -#import "LMJDataBaseConnectionProtocol.h" - -@interface LMJUsertProtocol : NSObject - - -- (void)connectDataBase:(id)dataBase withIndentifier:(NSString *)Indentifier; - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJUsertProtocol.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJUsertProtocol.m" deleted file mode 100644 index 0835f934..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Model/LMJUsertProtocol.m" +++ /dev/null @@ -1,29 +0,0 @@ -// -// LMJUsertProtocol.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/4/17. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "LMJUsertProtocol.h" - -@implementation LMJUsertProtocol - - -- (void)connectDataBase:(id)dataBase withIndentifier:(NSString *)Indentifier -{ - - NSLog(@"%s", __func__); - - if ([dataBase respondsToSelector:@selector(start)]) { - [dataBase start]; - } - - - NSLog(@"%s", __func__); - -} - - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Other/XLMJThread.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Other/XLMJThread.h" deleted file mode 100644 index defc2f12..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Other/XLMJThread.h" +++ /dev/null @@ -1,13 +0,0 @@ -// -// XLMJThread.h -// iOSProject -// -// Created by HuXuPeng on 2018/2/9. -// Copyright © 2018年 github.com/njhu. All rights reserved. -// - -#import - -@interface XLMJThread : NSThread - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Other/XLMJThread.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Other/XLMJThread.m" deleted file mode 100644 index b019f247..00000000 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/Other/XLMJThread.m" +++ /dev/null @@ -1,17 +0,0 @@ -// -// XLMJThread.m -// iOSProject -// -// Created by HuXuPeng on 2018/2/9. -// Copyright © 2018年 github.com/njhu. All rights reserved. -// - -#import "XLMJThread.h" - -@implementation XLMJThread - -- (void)dealloc { - NSLog(@"XLMJThread----%s", __func__); -} - -@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.h" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.h" new file mode 100644 index 00000000..f45dec80 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.h" @@ -0,0 +1,15 @@ +// +// LMJWebImageCacheCell.h +// iOSProject +// +// Created by HuXuPeng on 2018/4/7. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import + +@interface LMJWebImageCacheCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UIImageView *videoImageView; +@property (weak, nonatomic) IBOutlet UILabel *videoNameLabel; +@property (weak, nonatomic) IBOutlet UILabel *videoDesLabel; +@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.m" new file mode 100644 index 00000000..dc6b3f27 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.m" @@ -0,0 +1,38 @@ +// +// LMJWebImageCacheCell.m +// iOSProject +// +// Created by HuXuPeng on 2018/4/7. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJWebImageCacheCell.h" +@interface LMJWebImageCacheCell() + +@end + +@implementation LMJWebImageCacheCell + + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + [self setupUIOnce]; + } + + return self; +} + +- (void)awakeFromNib +{ + [super awakeFromNib]; + [self setupUIOnce]; +} + +- (void)setupUIOnce +{ + self.videoImageView.layer.cornerRadius = 20; + self.videoImageView.layer.masksToBounds = YES; +} + +@end diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.xib" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.xib" new file mode 100644 index 00000000..6215b02f --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/LMJWebImageCacheCell.xib" @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/UIButton+LMJBlock.m" "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/UIButton+LMJBlock.m" index c63c9349..71f6ab9b 100644 --- "a/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/UIButton+LMJBlock.m" +++ "b/iOSProject/iOSProject/Classes/\345\237\272\347\241\200\347\220\206\350\256\272/View/UIButton+LMJBlock.m" @@ -26,25 +26,33 @@ @implementation UIButton (LMJBlock) + (void)load { +// +// " 周全起见,有两种情况要考虑一下。第一种情况是要复写的方法(overridden)并没有在目标类中实现(notimplemented),而是在其父类中实现了。 +// 第二种情况是这个方法已经存在于目标类中(does existin the class itself)。这两种情况要区别对待。 (译注: 这个地方有点要明确一下,它的目的是为了使用一个重写的方法替换掉原来的方法。 +// 但重写的方法可能是在父类中重写的,也可能是在子类中重写的。) +// 对于第一种情况,应当先在目标类增加一个新的实现方法(override),然后将复写的方法替换为原先(的实现(original one)。 +// 对于第二情况(在目标类重写的方法)。这时可以通过method_exchangeImplementations来完成交换." + static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ + Class buttonClass = self; + SEL oriSel = @selector(sendAction:to:forEvent:); + Method oriMethod = class_getInstanceMethod(buttonClass, oriSel); - Class selfClass = [self class]; - - SEL oriSEL = @selector(sendAction:to:forEvent:); - Method oriMethod = class_getInstanceMethod(selfClass, oriSEL); + SEL mySel = @selector(mySendAction:to:forEvent:); + Method myMethod = class_getInstanceMethod(buttonClass, mySel); - SEL cusSEL = @selector(mySendAction:to:forEvent:); - Method cusMethod = class_getInstanceMethod(selfClass, cusSEL); + BOOL isAdd = class_addMethod(buttonClass, oriSel, method_getImplementation(myMethod), method_getTypeEncoding(myMethod)); - BOOL addSucc = class_addMethod(selfClass, oriSEL, method_getImplementation(cusMethod), method_getTypeEncoding(cusMethod)); - if (addSucc) { - class_replaceMethod(selfClass, cusSEL, method_getImplementation(oriMethod), method_getTypeEncoding(oriMethod)); + if (isAdd) { + class_replaceMethod(buttonClass, mySel, method_getImplementation(oriMethod), method_getTypeEncoding(oriMethod)); }else { - method_exchangeImplementations(oriMethod, cusMethod); + method_exchangeImplementations(oriMethod, myMethod); } }); + + } - (void)mySendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event { diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerAnimator.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerAnimator.h" index 689c614e..31673c30 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerAnimator.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerAnimator.h" @@ -28,7 +28,6 @@ - (CGRect)startRectWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator; - - (UIImageView *)startImageViewWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator; - (NSIndexPath *)currentIndexPathWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator; @@ -38,11 +37,8 @@ @interface SINBroswerAnimator : NSObject - -/** <#digest#> */ @property (weak, nonatomic) id presentDelegate; -/** <#digest#> */ @property (weak, nonatomic) id dismissDelegate; @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerAnimator.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerAnimator.m" index 972dbe89..f510bc3b 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerAnimator.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerAnimator.m" @@ -22,20 +22,17 @@ @implementation SINBroswerAnimator - (nullable id )animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source { self.isPresented = YES; - return self; } - (nullable id )animationControllerForDismissedController:(UIViewController *)dismissed { - self.isPresented = NO; return self; } #pragma mark - UIViewControllerAnimatedTransitioning - - (NSTimeInterval)transitionDuration:(nullable id )transitionContext { return 0.6; @@ -43,9 +40,7 @@ - (NSTimeInterval)transitionDuration:(nullable id )transitionContext { - self.isPresented ? [self doPresentWithAnimateTransition:transitionContext] : [self doDismissWithAnimateTransition:transitionContext]; - } @@ -64,31 +59,23 @@ - (void)doPresentWithAnimateTransition:(id - -/** <#digest#> */ @property (weak, nonatomic) UIScrollView *scrollView; - - - @end @implementation SINBroswerCell - - (void)setupUIOnce { self.contentView.backgroundColor = self.scrollView.backgroundColor = [UIColor clearColor]; - } - (void)setImageDict:(SINDictURL *)imageDict { _imageDict = imageDict; - LMJWeakSelf(self); + LMJWeak(self); [self.imageView sd_setImageWithURL:imageDict.bmiddle_pic placeholderImage:[UIImage imageNamed:@"empty_picture"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { - if (image && !error) { - dispatch_async(dispatch_get_main_queue(), ^{ - - [weakself updateImageViewWithImage:image isNeedUpdateImageViewRect:YES]; - + [weakself updateImageViewWithImage:image isNeedUpdateImageViewRect:YES]; + [self.imageView sd_setImageWithURL:imageDict.original_pic placeholderImage:image options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSizen, NSURL *targetUrl) { - - dispatch_async(dispatch_get_main_queue(), ^{ - - - - - - }); - - } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { - if (image && !error) { - dispatch_async(dispatch_get_main_queue(), ^{ - - [weakself updateImageViewWithImage:image isNeedUpdateImageViewRect:NO]; - }); - } - }]; - - }); - } - }]; } -- (void)updateImageViewWithImage:(UIImage *)image isNeedUpdateImageViewRect:(BOOL)isNeedUpdateImageViewRect -{ - +- (void)updateImageViewWithImage:(UIImage *)image isNeedUpdateImageViewRect:(BOOL)isNeedUpdateImageViewRect { self.imageView.image = image; - if (isNeedUpdateImageViewRect) { - CGFloat imageViewY = 0; - CGFloat imageWidth = image.size.width; CGFloat imageHeight = image.size.height; - - CGFloat fitWidth = kScreenWidth; CGFloat fitHeight = fitWidth * imageHeight / imageWidth; - if (fitHeight < kScreenHeight) { - imageViewY = (kScreenHeight - fitHeight) * 0.5; } - self.imageView.frame = CGRectMake(0, imageViewY, fitWidth, fitHeight); self.scrollView.contentSize = CGSizeMake(fitWidth, fitHeight); - } - - - } @@ -122,18 +77,13 @@ - (UIScrollView *)scrollView { if(_scrollView == nil) { - UIScrollView *scrollView = [[UIScrollView alloc] init]; [self.contentView addSubview:scrollView]; _scrollView = scrollView; - [scrollView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.insets(UIEdgeInsetsMake(0, 0, 0, 10)); }]; scrollView.delegate = self; - - scrollView.maximumZoomScale = 2; scrollView.minimumZoomScale = 1; } diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerViewController.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerViewController.h" index 3eab72ca..b692743f 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerViewController.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerViewController.h" @@ -12,11 +12,8 @@ @interface SINBroswerViewController : LMJCollectionViewController -/** <#digest#> */ @property (nonatomic, strong) NSIndexPath *startIndexPath; - -/** <#digest#> */ @property (nonatomic, strong) NSArray *imageUrls; @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerViewController.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerViewController.m" index 9c34b3c7..9cadc885 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/AnimatorBroswer/SINBroswerViewController.m" @@ -8,6 +8,7 @@ #import "SINBroswerViewController.h" #import "SINBroswerCell.h" +#import "UIView+GestureCallback.h" @interface SINBroswerViewController () @@ -17,24 +18,19 @@ @implementation SINBroswerViewController - (void)viewDidLoad { [super viewDidLoad]; - + self.modalPresentationCapturesStatusBarAppearance = YES; self.view.backgroundColor = self.collectionView.backgroundColor = [UIColor blackColor]; self.collectionView.pagingEnabled = YES; - - LMJWeakSelf(self); + LMJWeak(self); [self.collectionView addTapGestureRecognizer:^(UITapGestureRecognizer *recognizer, NSString *gestureId) { [weakself dismissViewControllerAnimated:YES completion:nil]; }]; - [self.collectionView registerClass:[SINBroswerCell class] forCellWithReuseIdentifier:NSStringFromClass([SINBroswerCell class])]; - self.collectionView.lmj_width += 10; } -- (void)viewWillAppear:(BOOL)animated -{ +- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - CGFloat pageWidth = self.collectionView.frame.size.width; CGFloat offsetY = self.collectionView.contentOffset.y; CGFloat offsetX = self.startIndexPath.item * pageWidth; @@ -42,19 +38,19 @@ - (void)viewWillAppear:(BOOL)animated [self.collectionView setContentOffset:offset animated:NO]; } +- (BOOL)prefersStatusBarHidden { + return YES; +} #pragma mark - collectionViewDelegate -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section -{ +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ return self.imageUrls.count; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { SINBroswerCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([SINBroswerCell class]) forIndexPath:indexPath]; - cell.imageDict = self.imageUrls[indexPath.item]; - return cell; } @@ -62,36 +58,28 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell #pragma mark - SINBroswerAnimatorDismissDelegate -- (CGRect)startRectWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator -{ +- (CGRect)startRectWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator { SINBroswerCell *currentCell = (SINBroswerCell *)self.collectionView.visibleCells.firstObject; - - return [currentCell convertRect:currentCell.imageView.frame toView:[UIApplication sharedApplication].keyWindow]; } - -- (UIImageView *)startImageViewWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator -{ +- (UIImageView *)startImageViewWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator { SINBroswerCell *currentCell = (SINBroswerCell *)self.collectionView.visibleCells.firstObject; UIImageView *startImage = [[UIImageView alloc] init]; startImage.contentMode = UIViewContentModeScaleAspectFill; startImage.image = currentCell.imageView.image; startImage.clipsToBounds = YES; - return startImage; } -- (NSIndexPath *)currentIndexPathWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator -{ +- (NSIndexPath *)currentIndexPathWithBroswerAnimator:(SINBroswerAnimator *)broswerAnimator { return self.collectionView.indexPathsForVisibleItems.firstObject; } #pragma mark - layout -- (UICollectionViewLayout *)collectionViewController:(LMJCollectionViewController *)collectionViewController layoutForCollectionView:(UICollectionView *)collectionView -{ +- (UICollectionViewLayout *)collectionViewController:(LMJCollectionViewController *)collectionViewController layoutForCollectionView:(UICollectionView *)collectionView { return [LMJHorizontalFlowLayout flowLayoutWithDelegate:self]; } @@ -141,7 +129,4 @@ - (UIEdgeInsets)waterflowLayout:(LMJHorizontalFlowLayout *)waterflowLayout edgeI return UIEdgeInsetsZero; } - - - @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINDiscoveryViewController.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINDiscoveryViewController.m" index 8de59175..d1ad327e 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINDiscoveryViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINDiscoveryViewController.m" @@ -16,6 +16,7 @@ @implementation SINDiscoveryViewController - (void)viewDidLoad { [super viewDidLoad]; + self.navigationItem.title = @"发现"; } @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINHomeViewController.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINHomeViewController.m" index d008f8fa..0cc4435a 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINHomeViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINHomeViewController.m" @@ -11,12 +11,13 @@ #import "SINStatusListService.h" #import "SINStatusViewModel.h" #import "SINStatusCell.h" +#import "PresentAnimator.h" @interface SINHomeViewController () -/** <#digest#> */ +/** 没有登录的状态 */ @property (weak, nonatomic) SINUnLoginRegisterView *unLoginRegisterView; -/** <#digest#> */ +/** 网络数据 */ @property (nonatomic, strong) SINStatusListService *statusListService; @end @@ -25,30 +26,19 @@ @implementation SINHomeViewController - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = @"首页"; - - UIEdgeInsets edgeInset = self.tableView.contentInset; edgeInset.bottom += self.tabBarController.tabBar.lmj_height; self.tableView.contentInset = edgeInset; - self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - - self.tableView.estimatedRowHeight = 0; - - self.tableView.estimatedSectionHeaderHeight = 0; - - self.tableView.estimatedSectionFooterHeight = 0; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - if ([SINUserManager sharedManager].isLogined) { self.tableView.hidden = NO; self.unLoginRegisterView.hidden = YES; - }else - { + }else { self.tableView.hidden = YES; self.unLoginRegisterView.hidden = NO; } @@ -57,28 +47,21 @@ - (void)viewWillAppear:(BOOL)animated - (void)loadMore:(BOOL)isMore { - LMJWeakSelf(self); + LMJWeak(self); if (![SINUserManager sharedManager].isLogined) { [weakself endHeaderFooterRefreshing]; return; } [self.statusListService getStatusList:!isMore complation:^(NSError *error, BOOL isEnd) { - [weakself endHeaderFooterRefreshing]; - if (error) { [weakself.view makeToast:error.localizedDescription]; return ; } - [weakself.tableView reloadData]; - [weakself.tableView.mj_footer setState:isEnd ? MJRefreshStateNoMoreData : MJRefreshStateIdle]; - }]; - - } @@ -92,11 +75,8 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { SINStatusCell *statusCell = [SINStatusCell statusCellWithTableView:tableView]; - statusCell.statusViewModel = self.statusListService.statusViewModels[indexPath.row]; - return statusCell; - } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath @@ -120,29 +100,23 @@ - (NSMutableAttributedString*)lmjNavigationBarTitle:(LMJNavigationBar *)navigati /** 导航条左边的按钮 */ - (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar { - [leftButton setTitle:@"注册" forState:UIControlStateNormal]; [leftButton setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal]; [leftButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateHighlighted]; - if ([SINUserManager sharedManager].isLogined) { leftButton.hidden = YES; } - return nil; } /** 导航条右边的按钮 */ - (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar { - [rightButton setTitle:@"登录" forState:UIControlStateNormal]; [rightButton setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal]; [rightButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateHighlighted]; - if ([SINUserManager sharedManager].isLogined) { rightButton.hidden = YES; } - return nil; } @@ -171,13 +145,36 @@ -(void)titleClickEvent:(UILabel *)sender navigationBar:(LMJNavigationBar *)navig NSLog(@"%s", __func__); SINHomeCategoryViewController *categoryVc = [[SINHomeCategoryViewController alloc] init]; - categoryVc.popUpOffset = CGPointMake(0, 60); - categoryVc.popUpPosition = DDPopUpPositionTop; - categoryVc.popUpViewSize = CGSizeMake(kScreenWidth * 0.5, AdaptedHeight(250)); + CGFloat width = kScreenWidth * 0.5; - [self showPopUpViewController:categoryVc animationType:DDPopUpAnimationTypeFade]; + CGPoint center = [self.lmj_navgationBar convertPoint:self.lmj_navgationBar.titleView.center toView:[UIApplication sharedApplication].keyWindow]; + LMJWeak(categoryVc); + // 写个present 动画吧 + [PresentAnimator viewController:self presentViewController:categoryVc presentViewFrame:CGRectMake((kScreenWidth - width) * 0.5, center.y + 20, width, width * 1.2) animated:YES completion:nil animatedDuration:0.5 presentAnimation:^(UIView *presentedView, UIView *containerView, void (^completionHandler)(BOOL finished)) { + + containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1]; + presentedView.layer.anchorPoint = CGPointMake(0.5, 0); + presentedView.layer.transform = CATransform3DMakeScale(1, 0.1, 1); + [UIView animateWithDuration:0.5 animations:^{ + presentedView.layer.transform = CATransform3DIdentity; + } completion:^(BOOL finished) { + completionHandler(finished); + }]; + + [containerView addTapGestureRecognizer:^(UITapGestureRecognizer *recognizer, NSString *gestureId) { + [weakcategoryVc dismissViewControllerAnimated:YES completion:nil]; + }]; + + } dismissAnimation:^(UIView *dismissView, void (^completionHandler)(BOOL finished)) { + + [UIView animateWithDuration:0.5 animations:^{ + dismissView.layer.transform = CATransform3DMakeScale(1, 0.1, 1); + } completion:^(BOOL finished) { + completionHandler(finished); + }]; + }]; } @@ -197,12 +194,29 @@ -(NSMutableAttributedString *)changeTitle:(NSString *)curTitle #pragma mark - getter +- (void)gotoLogin +{ + LMJWeak(self); + [[SINUserManager sharedManager] sinaLogin:^(NSError *error) { + if (error) { + [weakself.view makeToast:error.domain]; + return ; + } + + weakself.tableView.hidden = NO; + weakself.unLoginRegisterView.hidden = YES; + weakself.lmj_navgationBar.leftView.hidden = YES; + weakself.lmj_navgationBar.rightView.hidden = YES; + [weakself changeTitle:[SINUserManager sharedManager].name]; + [weakself.tableView.mj_header beginRefreshing]; + }]; +} - (SINUnLoginRegisterView *)unLoginRegisterView { if(_unLoginRegisterView == nil) { - LMJWeakSelf(self); + LMJWeak(self); SINUnLoginRegisterView *unLoginRegisterView = [SINUnLoginRegisterView unLoginRegisterViewWithType:SINUnLoginRegisterViewTypeHomePage registClick:^{ [weakself gotoLogin]; @@ -212,46 +226,16 @@ - (SINUnLoginRegisterView *)unLoginRegisterView [weakself gotoLogin]; }]; - [weakself.view addSubview:unLoginRegisterView]; _unLoginRegisterView = unLoginRegisterView; - [unLoginRegisterView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.offset(0); }]; - } return _unLoginRegisterView; } - -- (void)gotoLogin -{ - LMJWeakSelf(self); - [[SINUserManager sharedManager] sinaLogin:^(NSError *error) { - - if (error) { - - [weakself.view makeToast:error.domain]; - - return ; - } - - weakself.tableView.hidden = NO; - weakself.unLoginRegisterView.hidden = YES; - - weakself.lmj_navgationBar.leftView.hidden = YES; - weakself.lmj_navgationBar.rightView.hidden = YES; - - [weakself changeTitle:[SINUserManager sharedManager].name]; - - [weakself.tableView.mj_header beginRefreshing]; - }]; -} - - - (SINStatusListService *)statusListService { if(_statusListService == nil) diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINMessageViewController.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINMessageViewController.m" index 1ed1e82e..bac0992d 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINMessageViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINMessageViewController.m" @@ -19,6 +19,7 @@ @implementation SINMessageViewController - (void)viewDidLoad { [super viewDidLoad]; + self.navigationItem.title = @"消息"; } @@ -27,13 +28,10 @@ - (void)viewWillAppear:(BOOL)animated [super viewWillAppear:animated]; if ([SINUserManager sharedManager].isLogined) { -// self.tableView.hidden = NO; self.unLoginRegisterView.hidden = YES; }else { -// self.tableView.hidden = YES; self.unLoginRegisterView.hidden = NO; -// [self endHeaderFooterRefreshing]; } } @@ -45,7 +43,7 @@ - (SINUnLoginRegisterView *)unLoginRegisterView { if(_unLoginRegisterView == nil) { - LMJWeakSelf(self); + LMJWeak(self); SINUnLoginRegisterView *unLoginRegisterView = [SINUnLoginRegisterView unLoginRegisterViewWithType:SINUnLoginRegisterViewTypeMsgPage registClick:^{ [weakself gotoLogin]; @@ -73,14 +71,10 @@ - (SINUnLoginRegisterView *)unLoginRegisterView - (void)gotoLogin { [[SINUserManager sharedManager] sinaLogin:^(NSError *error) { - if (!error) { - self.unLoginRegisterView.hidden = YES; } - }]; - } diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINProfileViewController.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINProfileViewController.m" index 78961b5e..804fdc70 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINProfileViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINProfileViewController.m" @@ -18,23 +18,18 @@ @implementation SINProfileViewController - (void)viewDidLoad { [super viewDidLoad]; + self.navigationItem.title = @"我的"; } - - - - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if ([SINUserManager sharedManager].isLogined) { - // self.tableView.hidden = NO; self.unLoginRegisterView.hidden = YES; }else { - // self.tableView.hidden = YES; self.unLoginRegisterView.hidden = NO; - // [self endHeaderFooterRefreshing]; } } @@ -46,7 +41,7 @@ - (SINUnLoginRegisterView *)unLoginRegisterView { if(_unLoginRegisterView == nil) { - LMJWeakSelf(self); + LMJWeak(self); SINUnLoginRegisterView *unLoginRegisterView = [SINUnLoginRegisterView unLoginRegisterViewWithType:SINUnLoginRegisterViewTypeProfilePage registClick:^{ [weakself gotoLogin]; @@ -57,11 +52,9 @@ - (SINUnLoginRegisterView *)unLoginRegisterView [weakself gotoLogin]; }]; - [self.view addSubview:unLoginRegisterView]; _unLoginRegisterView = unLoginRegisterView; - [unLoginRegisterView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.offset(0); @@ -76,7 +69,6 @@ - (SINUnLoginRegisterView *)unLoginRegisterView - (void)gotoLogin { [[SINUserManager sharedManager] sinaLogin:^(NSError *error) { - if (!error) { self.unLoginRegisterView.hidden = YES; } diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINPublishViewController.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINPublishViewController.m" index ec0ab958..3ab4a1df 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINPublishViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINPublishViewController.m" @@ -7,93 +7,44 @@ // #import "SINPublishViewController.h" -#import -#import +//#import +//#import #import "SINPublishToolBar.h" #import "SINPostStatusService.h" -#import -#import -#import -#import #import "LMJUpLoadImageCell.h" -static const NSInteger maxPhotoCount = 9; +#import "SINPickPhotoTool.h" +#import "UITextView+WZB.h" -@interface SINPublishViewController () +@interface SINPublishViewController () /** <#digest#> */ -@property (weak, nonatomic) HMEmoticonTextView *postTextView; +@property (weak, nonatomic) UITextView *postTextView; /** <#digest#> */ @property (weak, nonatomic) SINPublishToolBar *publishTooBar; - /** <#digest#> */ @property (nonatomic, strong) SINPostStatusService *postStatusService; /** <#digest#> */ -@property (nonatomic, strong) NSMutableArray *selectedImages; -/** <#digest#> */ -@property (nonatomic, strong) NSMutableArray *selectedAccest; - -/** <#digest#> */ -@property (nonatomic, strong) CLLocation *location; - -@property (nonatomic, strong) UIImagePickerController *imagePickerVc; - +@property (nonatomic, copy) void(^deleteHandler)(NSUInteger index); @end - - @implementation SINPublishViewController -- (UIImagePickerController *)imagePickerVc { - if (_imagePickerVc == nil) { - _imagePickerVc = [[UIImagePickerController alloc] init]; - _imagePickerVc.delegate = self; - // set appearance / 改变相册选择页的导航栏外观 - if (iOS7Later) { - _imagePickerVc.navigationBar.barTintColor = self.navigationController.navigationBar.barTintColor; - } - _imagePickerVc.navigationBar.tintColor = self.navigationController.navigationBar.tintColor; - UIBarButtonItem *tzBarItem, *BarItem; - if (iOS9Later) { - tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; - BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]]; - } else { - tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; - BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]]; - } - NSDictionary *titleTextAttributes = [tzBarItem titleTextAttributesForState:UIControlStateNormal]; - [BarItem setTitleTextAttributes:titleTextAttributes forState:UIControlStateNormal]; - - } - return _imagePickerVc; -} - - (void)viewDidLoad { [super viewDidLoad]; - self.selectedAccest = [NSMutableArray array]; - self.selectedImages = [NSMutableArray array]; self.view.backgroundColor = UIColor.groupTableViewBackgroundColor; - [self.postTextView becomeFirstResponder]; - - [(UIButton *)self.lmj_navgationBar.rightView setEnabled:NO]; - [self publishTooBar]; - - [self.collectionView registerNib:[UINib nibWithNibName:NSStringFromClass([LMJUpLoadImageCell class]) bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:NSStringFromClass([LMJUpLoadImageCell class])]; - [self.collectionView mas_remakeConstraints:^(MASConstraintMaker *make) { - make.left.right.offset(0); make.bottom.equalTo(self.publishTooBar.mas_top); make.top.equalTo(self.postTextView.mas_bottom); }]; - self.collectionView.contentInset = UIEdgeInsetsZero; self.collectionView.alwaysBounceVertical = YES; self.collectionView.showsVerticalScrollIndicator = YES; @@ -102,14 +53,10 @@ - (void)viewDidLoad { - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - IQKeyboardManager.sharedManager.enable = NO; } - - - #pragma mark - LMJVerticalFlowLayoutDelegate - (NSInteger)waterflowLayout:(LMJVerticalFlowLayout *)waterflowLayout columnsInCollectionView:(UICollectionView *)collectionView @@ -132,75 +79,76 @@ - (CGFloat)waterflowLayout:(LMJVerticalFlowLayout *)waterflowLayout collectionVi #pragma mark - collectionViewDelegate - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - return self.selectedImages.count + 1; + return self.lmj_selectedImages.count + 1; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - LMJWeakSelf(self); + LMJWeak(self); LMJUpLoadImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([LMJUpLoadImageCell class]) forIndexPath:indexPath]; - if (indexPath.item == self.selectedImages.count) { + if (indexPath.item == self.lmj_selectedImages.count) { cell.photoImage = nil; cell.addPhotoClick = ^(LMJUpLoadImageCell *uploadImageCell) { [weakself alertAction]; }; cell.deletePhotoClick = nil; }else { - cell.photoImage = self.selectedImages[indexPath.item]; + cell.photoImage = self.lmj_selectedImages[indexPath.item]; cell.addPhotoClick = nil; cell.deletePhotoClick = ^(UIImage *photoImage) { - [weakself.selectedAccest removeObjectAtIndex:indexPath.item]; - [weakself.selectedImages removeObject:photoImage]; - // [weakself.collectionView deleteItemsAtIndexPaths:@[indexPath]]; - [weakself.collectionView reloadData]; + !weakself.deleteHandler ?: weakself.deleteHandler(indexPath.item); + [collectionView performBatchUpdates:^{ + [collectionView deleteItemsAtIndexPaths:@[indexPath]]; + } completion:^(BOOL finished) { + [collectionView reloadData]; + }]; }; } cell.uploadProgress = 0; - - return cell; } - - +- (void)alertAction +{ + LMJWeak(self); + [SINPickPhotoTool showPickPhotoToolWithViewController:self maxPhotoCount:6 choosePhotoHandler:^(NSMutableArray *selectedImages, NSMutableArray *selectedAccest) { + [weakself.collectionView reloadData]; + } takePhotoHandler:^(NSMutableArray *selectedImages, NSMutableArray *selectedAccest) { + [weakself.collectionView reloadData]; + } deleteImage:^(void (^deleteHandler)(NSUInteger index)) { + weakself.deleteHandler = deleteHandler; + }]; +} #pragma mark - textviewdelegate - -- (void)textViewDidChange:(HMEmoticonTextView *)textView +- (void)textViewDidChange:(UITextView *)textView { - [(UIButton *)self.lmj_navgationBar.rightView setEnabled:textView.emoticonText.length >= 20]; - + [(UIButton *)self.lmj_navgationBar.rightView setEnabled:textView.text.length >= 20]; } - -- (HMEmoticonTextView *)postTextView +- (UITextView *)postTextView { if(_postTextView == nil) { - HMEmoticonTextView *postTextView = [[HMEmoticonTextView alloc] init]; + UITextView *postTextView = [[UITextView alloc] init]; [self.view addSubview:postTextView]; _postTextView = postTextView; - + postTextView.delegate = self; // 1> 使用表情视图 - postTextView.useEmoticonInputView = YES; +// postTextView.useEmoticonInputView = YES; // 2> 设置占位文本 - postTextView.placeholder = @"分享新鲜事..."; + postTextView.wzb_placeholder = @"分享新鲜事..."; // 3> 设置最大文本长度 - postTextView.maxInputLength = 200; - +// postTextView.len = 200; // 与原生键盘之间的切换 // _textView.useEmoticonInputView = !_textView.isUseEmoticonInputView; - [postTextView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.offset([self lmjNavigationHeight:self.lmj_navgationBar]); make.left.right.offset(0); make.height.equalTo(self.view).multipliedBy(0.4); }]; - - } return _postTextView; } @@ -212,27 +160,16 @@ - (SINPublishToolBar *)publishTooBar SINPublishToolBar *publishTooBar = [SINPublishToolBar publishToolBar]; [self.view addSubview:publishTooBar]; _publishTooBar = publishTooBar; - publishTooBar.frame = CGRectMake(0, kScreenHeight - 40, kScreenWidth, 40); - [[YYTextKeyboardManager defaultManager] addObserver:self]; - - LMJWeakSelf(self); -// LMJWeakSelf(publishTooBar); + LMJWeak(self); publishTooBar.selectInput = ^(SINPublishToolBarClickType type) { - if (type == SINPublishToolBarClickTypeKeyboard) { - - weakself.postTextView.useEmoticonInputView = NO; - - }else if (type == SINPublishToolBarClickTypeEmos) - { - weakself.postTextView.useEmoticonInputView = YES; - +// weakself.postTextView.useEmoticonInputView = NO; + }else if (type == SINPublishToolBarClickTypeEmos){ +// weakself.postTextView.useEmoticonInputView = YES; } - BOOL isf = weakself.postTextView.isFirstResponder; - if (!isf) { [weakself.postTextView becomeFirstResponder]; } @@ -241,14 +178,6 @@ - (SINPublishToolBar *)publishTooBar return _publishTooBar; } -- (SINPostStatusService *)postStatusService -{ - if(_postStatusService == nil) - { - _postStatusService = [[SINPostStatusService alloc] init]; - } - return _postStatusService; -} - (void)keyboardChangedWithTransition:(YYTextKeyboardTransition)transition @@ -262,20 +191,23 @@ - (void)keyboardChangedWithTransition:(YYTextKeyboardTransition)transition // UIViewAnimationCurve animationCurve; ///< Keyboard transition animation curve. // UIViewAnimationOptions animationOption; ///< Keybaord transition animation option. // } YYTextKeyboardTransition; - [UIView animateWithDuration:transition.animationDuration animations:^{ - [UIView setAnimationBeginsFromCurrentState:YES]; - [UIView setAnimationCurve:transition.animationCurve]; - - self.publishTooBar.lmj_y += transition.toFrame.origin.y - transition.fromFrame.origin.y; - }]; } +#pragma mark - getter +- (SINPostStatusService *)postStatusService +{ + if(_postStatusService == nil) + { + _postStatusService = [[SINPostStatusService alloc] init]; + } + return _postStatusService; +} #pragma mark - LMJNavUIBaseViewControllerDataSource @@ -317,282 +249,35 @@ - (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigation - (NSMutableAttributedString *)lmjNavigationBarTitle:(LMJNavigationBar *)navigationBar { NSMutableAttributedString *faweibo = [[NSMutableAttributedString alloc] initWithString:@"发微博"]; - [faweibo addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:11], NSForegroundColorAttributeName : [UIColor blackColor]} range:NSMakeRange(0, faweibo.length)]; - [faweibo yy_appendString:@"\n"]; - [faweibo appendAttributedString:[[NSAttributedString alloc] initWithString:[SINUserManager sharedManager].name ?: @"" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:10], NSForegroundColorAttributeName : [UIColor redColor]}]]; - return faweibo; } -- (void)alertAction -{ - [UIAlertController mj_showActionSheetWithTitle:nil message:nil appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { - alertMaker.addActionDefaultTitle(@"选择相册").addActionDefaultTitle(@"照相").addActionCancelTitle(@"取消"); - } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { - if (buttonIndex == 0) { - [self choosePhoto]; - }else if (buttonIndex == 1) { - [self takePhoto]; - } - }]; -} - -- (void)choosePhoto -{ - TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:maxPhotoCount columnNumber:4 delegate:self pushPhotoPickerVc:YES]; - // imagePickerVc.navigationBar.translucent = NO; - -#pragma mark - 五类个性化设置,这些参数都可以不传,此时会走默认设置 - imagePickerVc.isSelectOriginalPhoto = NO; - - if (maxPhotoCount > 1) { - // 1.设置目前已经选中的图片数组 - imagePickerVc.selectedAssets = self.selectedAccest; // 目前已经选中的图片数组 - } - imagePickerVc.allowTakePicture = YES; // 在内部显示拍照按钮 - - // imagePickerVc.photoWidth = 1000; - - // 2. Set the appearance - // 2. 在这里设置imagePickerVc的外观 - // if (iOS7Later) { - // imagePickerVc.navigationBar.barTintColor = [UIColor greenColor]; - // } - // imagePickerVc.oKButtonTitleColorDisabled = [UIColor lightGrayColor]; - // imagePickerVc.oKButtonTitleColorNormal = [UIColor greenColor]; - // imagePickerVc.navigationBar.translucent = NO; - - // 3. Set allow picking video & photo & originalPhoto or not - // 3. 设置是否可以选择视频/图片/原图 - imagePickerVc.allowPickingVideo = NO; - imagePickerVc.allowPickingImage = YES; - imagePickerVc.allowPickingOriginalPhoto = NO; - imagePickerVc.allowPickingGif = NO; - imagePickerVc.allowPickingMultipleVideo = NO; // 是否可以多选视频 - - // 4. 照片排列按修改时间升序 - imagePickerVc.sortAscendingByModificationDate = YES; - - // imagePickerVc.minImagesCount = 3; - // imagePickerVc.alwaysEnableDoneBtn = YES; - - // imagePickerVc.minPhotoWidthSelectable = 3000; - // imagePickerVc.minPhotoHeightSelectable = 2000; - - /// 5. Single selection mode, valid when maxImagesCount = 1 - /// 5. 单选模式,maxImagesCount为1时才生效 - imagePickerVc.showSelectBtn = NO; - imagePickerVc.allowCrop = YES; - imagePickerVc.needCircleCrop = NO; - // 设置竖屏下的裁剪尺寸 - NSInteger left = 30; - NSInteger widthHeight = self.view.lmj_width - 2 * left; - NSInteger top = (self.view.lmj_height - widthHeight) / 2; - imagePickerVc.cropRect = CGRectMake(left, top, widthHeight, widthHeight); - // 设置横屏下的裁剪尺寸 - // imagePickerVc.cropRectLandscape = CGRectMake((self.view.tz_height - widthHeight) / 2, left, widthHeight, widthHeight); - /* - [imagePickerVc setCropViewSettingBlock:^(UIView *cropView) { - cropView.layer.borderColor = [UIColor redColor].CGColor; - cropView.layer.borderWidth = 2.0; - }];*/ - - //imagePickerVc.allowPreview = NO; - // 自定义导航栏上的返回按钮 - /* - [imagePickerVc setNavLeftBarButtonSettingBlock:^(UIButton *leftButton){ - [leftButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; - [leftButton setImageEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 20)]; - }]; - imagePickerVc.delegate = self; - */ - - imagePickerVc.isStatusBarDefault = NO; -#pragma mark - 到这里为止 - LMJWeakSelf(self); - // You can get the photos by block, the same as by delegate. - // 你可以通过block或者代理,来得到用户选择的照片. - [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { - - weakself.selectedImages = [NSMutableArray arrayWithArray:photos]; - weakself.selectedAccest = [NSMutableArray arrayWithArray:assets]; - - [weakself.collectionView reloadData]; - - }]; - - [self presentViewController:imagePickerVc animated:YES completion:nil]; - -} -- (void)takePhoto -{ - AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; - if ((authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied) && iOS7Later) { - // 无相机权限 做一个友好的提示 - - [UIAlertController mj_showAlertWithTitle:@"无法使用相机" message:@"请在iPhone的""设置-隐私-相机""中允许访问相机" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { - - alertMaker.addActionDestructiveTitle(@"取消").addActionDefaultTitle(@"确认"); - - } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { - - if (buttonIndex == 1) { - - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil]; - } - - }]; - - } else if (authStatus == AVAuthorizationStatusNotDetermined) { - // fix issue 466, 防止用户首次拍照拒绝授权时相机页黑屏 - if (iOS7Later) { - [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { - if (granted) { - dispatch_sync(dispatch_get_main_queue(), ^{ - [self takePhoto]; - }); - } - }]; - } else { - [self takePhoto]; - } - // 拍照之前还需要检查相册权限 - } else if ([TZImageManager authorizationStatus] == 2) { // 已被拒绝,没有相册权限,将无法保存拍的照片 - if (iOS8Later) { - [UIAlertController mj_showAlertWithTitle:@"无法使用相机" message:@"请在iPhone的""设置-隐私-相机""中允许访问相机" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { - - alertMaker.addActionDestructiveTitle(@"取消").addActionDefaultTitle(@"确认"); - - } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { - - if (buttonIndex == 1) { - - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil]; - } - - }]; - } - } else if ([TZImageManager authorizationStatus] == 0) { // 未请求过相册权限 - [[TZImageManager manager] requestAuthorizationWithCompletion:^{ - [self takePhoto]; - }]; - } else { - [self pushImagePickerController]; - } -} - -// 调用相机 -- (void)pushImagePickerController { - // 提前定位 - __weak typeof(self) weakSelf = self; - [[TZLocationManager manager] startLocationWithSuccessBlock:^(CLLocation *location, CLLocation *oldLocation) { - __strong typeof(weakSelf) strongSelf = weakSelf; - strongSelf.location = location; - } failureBlock:^(NSError *error) { - __strong typeof(weakSelf) strongSelf = weakSelf; - strongSelf.location = nil; - }]; - - UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera; - if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { - self.imagePickerVc.sourceType = sourceType; - if(iOS8Later) { - self.imagePickerVc.modalPresentationStyle = UIModalPresentationOverCurrentContext; - } - [self presentViewController:self.imagePickerVc animated:YES completion:nil]; - } else { - NSLog(@"模拟器中无法打开照相机,请在真机中使用"); - } -} - -- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { - [picker dismissViewControllerAnimated:YES completion:nil]; - NSString *type = [info objectForKey:UIImagePickerControllerMediaType]; - if ([type isEqualToString:@"public.image"]) { - TZImagePickerController *tzImagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:self]; - tzImagePickerVc.sortAscendingByModificationDate = YES; - [tzImagePickerVc showProgressHUD]; - UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; - - // save photo and get asset / 保存图片,获取到asset - [[TZImageManager manager] savePhotoWithImage:image location:self.location completion:^(NSError *error){ - if (error) { - [tzImagePickerVc hideProgressHUD]; - NSLog(@"图片保存失败 %@",error); - } else { - [[TZImageManager manager] getCameraRollAlbum:NO allowPickingImage:YES completion:^(TZAlbumModel *model) { - [[TZImageManager manager] getAssetsFromFetchResult:model.result allowPickingVideo:NO allowPickingImage:YES completion:^(NSArray *models) { - [tzImagePickerVc hideProgressHUD]; - TZAssetModel *assetModel = [models firstObject]; - if (tzImagePickerVc.sortAscendingByModificationDate) { - assetModel = [models lastObject]; - } - if (YES) { // 允许裁剪,去裁剪 - TZImagePickerController *imagePicker = [[TZImagePickerController alloc] initCropTypeWithAsset:assetModel.asset photo:image completion:^(UIImage *cropImage, id asset) { - [self refreshCollectionViewWithAddedAsset:asset image:cropImage]; - }]; - imagePicker.needCircleCrop = NO; - imagePicker.circleCropRadius = 100; - [self presentViewController:imagePicker animated:YES completion:nil]; - } else { - // [self refreshCollectionViewWithAddedAsset:assetModel.asset image:image]; - } - }]; - }]; - } - }]; - } -} - -- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { - if ([picker isKindOfClass:[UIImagePickerController class]]) { - [picker dismissViewControllerAnimated:YES completion:nil]; - } -} - -- (void)refreshCollectionViewWithAddedAsset:(id)asset image:(UIImage *)image { - [self.selectedAccest addObject:asset]; - [self.selectedImages addObject:image]; - [self.collectionView reloadData]; - - if ([asset isKindOfClass:[PHAsset class]]) { - PHAsset *phAsset = asset; - NSLog(@"location:%@",phAsset.location); - } -} #pragma mark - LMJNavUIBaseViewControllerDelegate /** 左边的按钮的点击 */ -(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { - [self dismissPopUpViewController:DDPopUpAnimationTypeFade]; + [self dismissViewControllerAnimated:YES completion:nil]; } - (void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar { - if (self.postTextView.emoticonText.stringByTrim.length < 20) { + if (self.postTextView.text.stringByTrim.length < 20) { [self.view makeToast:@"少于20个文字" duration:3 position:CSToastPositionCenter]; return; } - - LMJWeakSelf(self); + LMJWeak(self); [self showLoading]; - [self.postStatusService retweetText:self.postTextView.emoticonText images:self.selectedImages completion:^(BOOL isSucceed) { + [self.postStatusService retweetText:self.postTextView.text images:self.lmj_selectedImages completion:^(BOOL isSucceed) { [weakself dismissLoading]; - [MBProgressHUD showInfo:isSucceed ? @"发布成功" : @"发布失败" ToView:weakself.view]; - }]; - } - - -- (void)dealloc -{ +- (void)dealloc { [[YYTextKeyboardManager defaultManager] removeObserver:self]; } diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINTabBarController.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINTabBarController.h" index 92fa1da5..b3acaa3c 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINTabBarController.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINTabBarController.h" @@ -6,8 +6,6 @@ // Copyright © 2017年 GoMePrjk. All rights reserved. // -#import - -@interface SINTabBarController : CYLTabBarController +@interface SINTabBarController : UITabBarController @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINTabBarController.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINTabBarController.m" index 0c3bd1bd..03bcb509 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINTabBarController.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Controller/SINTabBarController.m" @@ -13,8 +13,9 @@ #import "SINDiscoveryViewController.h" #import "SINProfileViewController.h" #import "SINTabBar.h" +#import "PresentAnimator.h" -@interface SINTabBarController () +@interface SINTabBarController () @end @@ -22,44 +23,46 @@ @implementation SINTabBarController - (void)viewDidLoad { [super viewDidLoad]; - - self.tabBar.tintColor = [UIColor orangeColor]; - self.tabBar.unselectedItemTintColor = [UIColor darkTextColor]; - [self setValue:[NSValue valueWithUIOffset:UIOffsetMake(0, -3)] forKeyPath:LMJKeyPath(self, titlePositionAdjustment)]; - - [self addTabarItems]; + [self setUpTabBar]; [self addChildViewControllers]; - + [self addTabarItems]; + self.delegate = self; } - /** * 利用 KVC 把系统的 tabBar 类型改为自定义类型。覆盖父类方法 */ - (void)setUpTabBar { SINTabBar *tabBar = [[SINTabBar alloc] init]; - - LMJWeakSelf(self); + LMJWeak(self); [tabBar setPublishBtnClick:^(SINTabBar *tabBar, UIButton *publishBtn){ - if (![SINUserManager sharedManager].isLogined) { [weakself.view makeToast:@"请登录" duration:3 position:CSToastPositionCenter]; return ; } - SINPublishViewController *publishVc = [[SINPublishViewController alloc] init]; - -// @property (nonatomic,retain) UIViewController *popUpViewController; -// @property (nonatomic,assign) CGPoint popUpOffset; //相对于弹出位置的偏移 -// @property (nonatomic,assign) CGSize popUpViewSize; //弹出视图的大小 -// @property (nonatomic,assign) DDPopUpPosition popUpPosition; //弹出视图的位置 -// @property (nonatomic,assign) BOOL dismissWhenTouchBackground; //是否允许点击背景dismiss -// @property (nonatomic,copy) DismissCallback dismissCallback; - - publishVc.popUpViewSize = kScreenSize; - [weakself showPopUpViewController:[[LMJNavigationController alloc] initWithRootViewController:publishVc] animationType:DDPopUpAnimationTypeFade dismissWhenTouchBackground:NO]; - + + // 封装好了, 直接在 block 里边写动画 + [PresentAnimator viewController:weakself presentViewController:[[LMJNavigationController alloc] initWithRootViewController:publishVc] presentViewFrame:[UIScreen mainScreen].bounds animated:YES completion:nil animatedDuration:0.5 presentAnimation:^(UIView *presentedView, UIView *containerView, void (^completionHandler)(BOOL finished)) { + + containerView.transform = CGAffineTransformMakeTranslation(0, -kScreenHeight); + [UIView animateWithDuration:0.5 animations:^{ + containerView.transform = CGAffineTransformIdentity; + } completion:^(BOOL finished) { + completionHandler(finished); + }]; + + } dismissAnimation:^(UIView *dismissView, void (^completionHandler)(BOOL finished)) { + + CGAffineTransform transform = CGAffineTransformMakeScale(0.2, 0.2); + [UIView animateWithDuration:1 animations:^{ + dismissView.transform = CGAffineTransformRotate(transform, M_PI); + } completion:^(BOOL finished) { + completionHandler(finished); + }]; + + }]; }]; [self setValue:tabBar forKeyPath:LMJKeyPath(self, tabBar)]; @@ -76,7 +79,6 @@ - (void)addChildViewControllers LMJNavigationController *five = [[LMJNavigationController alloc] initWithRootViewController:[[SINProfileViewController alloc] init]]; self.viewControllers = @[one, two, four, five]; - } /* @@ -86,38 +88,46 @@ - (void)addChildViewControllers - (void)addTabarItems { - - NSDictionary *firstTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"首页", - CYLTabBarItemImage : @"tabbar_home", - CYLTabBarItemSelectedImage : @"tabbar_home_highlighted", + @"TabBarItemTitle" : @"首页", + @"TabBarItemImage" : @"tabbar_home", + @"TabBarItemSelectedImage" : @"tabbar_home_highlighted", }; NSDictionary *secondTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"消息", - CYLTabBarItemImage : @"tabbar_message_center", - CYLTabBarItemSelectedImage : @"tabbar_message_center_highlighted", + @"TabBarItemTitle" : @"消息", + @"TabBarItemImage" : @"tabbar_message_center", + @"TabBarItemSelectedImage" : @"tabbar_message_center_highlighted", }; NSDictionary *thirdTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"发现", - CYLTabBarItemImage : @"tabbar_discover", - CYLTabBarItemSelectedImage : @"tabbar_discover_highlighted", + @"TabBarItemTitle" : @"发现", + @"TabBarItemImage" : @"tabbar_discover", + @"TabBarItemSelectedImage" : @"tabbar_discover_highlighted", }; NSDictionary *fourthTabBarItemsAttributes = @{ - CYLTabBarItemTitle : @"我的", - CYLTabBarItemImage : @"tabbar_profile", - CYLTabBarItemSelectedImage : @"tabbar_profile_highlighted" + @"TabBarItemTitle" : @"我的", + @"TabBarItemImage" : @"tabbar_profile", + @"TabBarItemSelectedImage" : @"tabbar_profile_highlighted" }; - self.tabBarItemsAttributes = @[ + NSArray *tabBarItemsAttributes = @[ firstTabBarItemsAttributes, secondTabBarItemsAttributes, thirdTabBarItemsAttributes, fourthTabBarItemsAttributes ]; + [self.childViewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + + obj.tabBarItem.title = tabBarItemsAttributes[idx][@"TabBarItemTitle"]; + obj.tabBarItem.image = [UIImage imageNamed:tabBarItemsAttributes[idx][@"TabBarItemImage"]]; + obj.tabBarItem.selectedImage = [UIImage imageNamed:tabBarItemsAttributes[idx][@"TabBarItemSelectedImage"]]; + obj.tabBarItem.titlePositionAdjustment = UIOffsetMake(0, -3); + }]; + + self.tabBar.tintColor = [UIColor orangeColor]; + self.tabBar.unselectedItemTintColor = [UIColor darkTextColor]; } - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Model/SINStatusViewModel.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Model/SINStatusViewModel.m" index 3d4d0779..b2f067de 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Model/SINStatusViewModel.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Model/SINStatusViewModel.m" @@ -10,54 +10,33 @@ #import "SINStatus.h" #import "SINDictURL.h" #import "SINUser.h" -#import -#import +#import "NSDecimalNumber+Addtion.h" static const CGFloat margin = 10.0; @implementation SINStatusViewModel - -+ (instancetype)statusModelWithStatus:(SINStatus *)status -{ ++ (instancetype)statusModelWithStatus:(SINStatus *)status { SINStatusViewModel *model = [[self alloc] init]; model.status = status; - return model; } -- (void)setStatus:(SINStatus *)status -{ - _status = status; - -} - - -- (SINStatusViewModel *)sin_retweetStatusViewModel -{ +- (SINStatusViewModel *)sin_retweetStatusViewModel { if (!_sin_retweetStatusViewModel && self.status.retweeted_status.text.length) { - _sin_retweetStatusViewModel = [SINStatusViewModel statusModelWithStatus:self.status.retweeted_status]; } - return _sin_retweetStatusViewModel; } -- (CGFloat)cellHeight -{ +- (CGFloat)cellHeight { if (_cellHeight == 0) { - // 10 + 50 + 10 + text + pics + tooBar + 10 - const CGFloat headerHeight = margin + 50; _cellHeight += headerHeight; - _cellHeight += margin; - _cellHeight += self.postTextHeight; - _cellHeight += margin; - // 图片内容 if (self.status.pic_urls.count) { _cellHeight += self.sin_statusPicsViewModel.picsViewSize.height; @@ -65,45 +44,32 @@ - (CGFloat)cellHeight } // 转发 if (self.sin_retweetStatusViewModel) { - _cellHeight += margin; - _cellHeight += self.sin_retweetStatusViewModel.postTextHeight; - _cellHeight += margin; - if (self.sin_retweetStatusViewModel.status.pic_urls.count) { _cellHeight += self.sin_retweetStatusViewModel.sin_statusPicsViewModel.picsViewSize.height; - _cellHeight += margin; - } - - _cellHeight += margin; - } - - _cellHeight += 32.5; // tooBar _cellHeight += margin; - - NSLog(@"H------>>>>%f", _cellHeight); + NSLog(@"H------>>>>%f", _cellHeight); } - NSLog(@"HHH------>>>>%f", _cellHeight); return _cellHeight; } -- (NSMutableAttributedString *)sin_textPost -{ +- (NSMutableAttributedString *)sin_textPost { if(_sin_textPost == nil && !LMJIsEmpty(self.status.text)) { + // LMJWeak(self); +// NSMutableAttributedString *postTextM = [[NSMutableAttributedString alloc] initWithAttributedString:[[HMEmoticonManager sharedManager] emoticonStringWithString:self.status.text font:[UIFont systemFontOfSize:AdaptedWidth(15)] textColor:UIColor.redColor]]; - // LMJWeakSelf(self); - NSMutableAttributedString *postTextM = [[NSMutableAttributedString alloc] initWithAttributedString:[[HMEmoticonManager sharedManager] emoticonStringWithString:self.status.text font:[UIFont systemFontOfSize:AdaptedWidth(15)] textColor:UIColor.redColor]]; - + NSMutableAttributedString *postTextM = [[NSMutableAttributedString alloc] initWithString:self.status.text]; + postTextM.yy_lineSpacing = 4.0; postTextM.yy_font = [UIFont systemFontOfSize:AdaptedWidth(15)]; @@ -112,30 +78,21 @@ - (NSMutableAttributedString *)sin_textPost postTextM.yy_paragraphSpacing = 7.0; _sin_textPost = postTextM; - - } return _sin_textPost; } -- (CGFloat)postTextHeight -{ - if(_postTextHeight == 0) - { - +- (CGFloat)postTextHeight { + if(_postTextHeight == 0) { CGSize textSize = CGSizeMake(kScreenWidth - 2 * margin, INFINITY); - _postTextHeight = ceilf([self.sin_textPost boundingRectWithSize:textSize options:NSStringDrawingUsesLineFragmentOrigin context:nil].size.height); - } return _postTextHeight; } -- (UIImage *)sin_mbrankImage -{ - if(_sin_mbrankImage == nil) - { +- (UIImage *)sin_mbrankImage{ + if(_sin_mbrankImage == nil) { /** vip的等级 ///如理VIP等级 if user.mbrank > 0 && user.mbrank < 7 @@ -150,8 +107,7 @@ - (UIImage *)sin_mbrankImage - (UIImage *)sin_verified_typeImage { - if(_sin_verified_typeImage == nil) - { + if(_sin_verified_typeImage == nil) { /** 认证类型. -1表示没有认证, 0表示个人认证, ///处理认证加v的图片 @@ -170,69 +126,48 @@ - (UIImage *)sin_verified_typeImage switch (self.status.user.verified_type) { case 0: - self.sin_verified_typeImage = [UIImage imageNamed:@"avatar_vip"]; - break; case 2: case 3: case 5: - self.sin_verified_typeImage = [UIImage imageNamed:@"avatar_enterprise_vip"]; break; - case 220: self.sin_verified_typeImage = [UIImage imageNamed:@"avatar_grassroot"]; break; - default: - break; } - } return _sin_verified_typeImage; } -- (NSString *)sin_source -{ - if(_sin_source == nil) - { - +- (NSString *)sin_source { + if(_sin_source == nil) { NSString *htmlString = self.status.source; NSMutableAttributedString *attrM = [[NSMutableAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute : NSHTMLTextDocumentType} documentAttributes:nil error:nil]; - - attrM.yy_font = [UIFont systemFontOfSize:AdaptedWidth(11)]; - - _sin_source = attrM.string; - } return _sin_source; } -- (NSString *)sin_creatTime -{ +- (NSString *)sin_creatTime { return [self formatCreatTime].copy; } -- (NSString *)formatCreatTime -{ +- (NSString *)formatCreatTime { NSDate *creatDate = [NSDate dateWithString:self.status.created_at format:@"EEE MM dd HH:mm:ss Z yyyy" timeZone:[NSTimeZone systemTimeZone] locale:[NSLocale localeWithLocaleIdentifier:@"en"]]; - // NSDateComponents *cmps = [NSDate dateFromStringDate:_created_at withDateStrFormat:LMJDateStringFormat toDate:[NSDate date]]; - - NSCalendarUnit unit = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; NSDateComponents *cmps = [[NSCalendar currentCalendar] components:unit fromDate:creatDate toDate:[NSDate date] options:NSCalendarWrapComponents]; - NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; if(creatDate.isToday && fabs([creatDate timeIntervalSinceNow]) < 60.0) @@ -270,15 +205,10 @@ - (NSString *)sin_cmtCount { if(_sin_cmtCount == nil) { - - _sin_cmtCount = [self countFormat: self.status.comments_count]; - if (SNCompare(_sin_cmtCount, @"0") == LMJDD) { - _sin_cmtCount = @"评论"; } - } return _sin_cmtCount; } @@ -289,9 +219,7 @@ - (NSString *)sin_dingCount if(_sin_dingCount == nil) { _sin_dingCount = [self countFormat:self.status.attitudes_count]; - if (SNCompare(_sin_dingCount, @"0") == LMJDD) { - _sin_dingCount = @"顶"; } } @@ -319,7 +247,6 @@ - (NSString *)countFormat:(NSInteger)count if (count > 1000) { return [NSString stringWithFormat:@"%0.1f千", count / 1000.0]; } - return [NSString stringWithFormat:@"%zd", count]; } @@ -339,7 +266,6 @@ - (SINStatusPicsViewModel)sin_statusPicsViewModel if (self.status.pic_urls.count == 0) { - }else if (self.status.pic_urls.count == 1) { itemWidth = (kScreenWidth - 2 * margin - 2 * itemMargin) / 3.0; @@ -347,10 +273,8 @@ - (SINStatusPicsViewModel)sin_statusPicsViewModel cols = 3; lines = (self.status.pic_urls.count + 2) / 3; - picsViewSize = CGSizeMake(maxWidth, (itemHeight + itemMargin) * lines - itemMargin); - }else if (self.status.pic_urls.count == 4) { itemWidth = (maxWidth - 2 * itemMargin) / 3.0; @@ -360,8 +284,6 @@ - (SINStatusPicsViewModel)sin_statusPicsViewModel picsViewSize = CGSizeMake(2 * itemWidth + itemMargin, 2 * itemWidth + itemMargin); - - }else { itemWidth = (kScreenWidth - 2 * margin - 2 * itemMargin) / 3.0; @@ -369,34 +291,15 @@ - (SINStatusPicsViewModel)sin_statusPicsViewModel cols = 3; lines = (self.status.pic_urls.count + 2) / 3; - picsViewSize = CGSizeMake(maxWidth, (itemHeight + itemMargin) * lines - itemMargin); - } - _sin_statusPicsViewModel = SINStatusPicsViewModelMake(picsViewSize, cols, lines, itemWidth, itemHeight); } - return _sin_statusPicsViewModel; } @end - - - - - - - - - - - - - - - diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Other/SINHomeCategoryViewController.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Other/SINHomeCategoryViewController.m" index 1a83d06e..838671da 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Other/SINHomeCategoryViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Other/SINHomeCategoryViewController.m" @@ -22,19 +22,14 @@ @implementation SINHomeCategoryViewController - (void)viewDidLoad { [super viewDidLoad]; - - self.view.backgroundColor = [UIColor clearColor]; + self.view.backgroundColor = [UIColor redColor]; } - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; - [self backImageView]; - - self.tableView.lmj_y = 10; - self.tableView.lmj_height = self.view.lmj_height - 10; } @@ -46,7 +41,6 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class])]; - if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([UITableViewCell class])]; } @@ -60,8 +54,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - [self dismissPopUpViewController:DDPopUpAnimationTypeFade]; + [self dismissViewControllerAnimated:YES completion:nil]; } #pragma mark - getter @@ -71,10 +64,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath if(_categorys == nil) { NSMutableArray *array = [NSMutableArray arrayWithArray:@[@"我的", @"事实", @"美女", @"家庭", @"军事", @"其他"]]; - - _categorys = array.mutableCopy; - } return _categorys; } @@ -86,11 +76,8 @@ - (UIImageView *)backImageView UIImageView *imageView = [[UIImageView alloc] init]; [self.view insertSubview:imageView atIndex:0]; _backImageView = imageView; - imageView.image = [[UIImage imageNamed:@"popover_background"] resizableImageWithCapInsets:UIEdgeInsetsMake(20, 20, 20, 20) resizingMode:UIImageResizingModeStretch]; - [imageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.view).insets(UIEdgeInsetsMake(-10, -10, -10, -10)); }]; } diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINPostStatusService.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINPostStatusService.m" index 77b6eae5..9b3f3fd1 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINPostStatusService.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINPostStatusService.m" @@ -14,7 +14,8 @@ @implementation SINPostStatusService - (void)retweetText:(NSString *)postText images:(NSArray *)images completion:(void(^)(BOOL isSucceed))completion { - if (![SINUserManager sharedManager].isLogined) { + // 大家不要发这个微博了 + if (![SINUserManager sharedManager].isLogined || [LMJThirdSDKSinaAppKey isEqualToString:@"4061770881"]) { NSLog(@"没有登录没有登录没有登录没有登录没有登录"); completion(NO); return; @@ -47,7 +48,7 @@ - (void)retweetText:(NSString *)postText images:(NSArray *)images com NSString *urlString = @"https://api.weibo.com/2/statuses/upload.json"; - [[LMJRequestManager sharedManager] upload:urlString parameters:params formDataBlock:^(id formData) { + [[LMJRequestManager sharedManager] upload:urlString parameters:params formDataBlock:^NSDictionary *(id formData, NSMutableDictionary *needFillDataDict) { // data 图片对应的二进制数据 // name 服务端需要参数 @@ -57,10 +58,12 @@ - (void)retweetText:(NSString *)postText images:(NSArray *)images com [images enumerateObjectsUsingBlock:^(UIImage * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - [formData appendPartWithFileData:UIImageJPEGRepresentation(obj, 0.6) name:@"pic" fileName:[NSString stringWithFormat:@"pic_%zd", idx] mimeType:@"application/octet-stream"]; - +// [formData appendPartWithFileData:UIImageJPEGRepresentation(obj, 0.6) name:@"pic" fileName:[NSString stringWithFormat:@"pic_%zd", idx] mimeType:@"application/octet-stream"]; + needFillDataDict[UIImageJPEGRepresentation(obj, 0.6)] = @"pic"; }]; + return needFillDataDict; + } progress:^(NSProgress *progress) { diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINStatusListService.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINStatusListService.h" index ae339c44..f8da430e 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINStatusListService.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINStatusListService.h" @@ -12,11 +12,8 @@ @interface SINStatusListService : LMJBaseRequest - -/** <#digest#> */ @property (nonatomic, strong) NSMutableArray *statusViewModels; - - (void)getStatusList:(BOOL)isFresh complation:(void(^)(NSError *error, BOOL isEnd))completion; @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINStatusListService.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINStatusListService.m" index 4a64d4b8..0710e05c 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINStatusListService.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Service/SINStatusListService.m" @@ -9,24 +9,20 @@ #import "SINStatusListService.h" #import "SINDictURL.h" #import "SINStatusListDAL.h" +#import "NSDecimalNumber+Addtion.h" @interface SINStatusListService () -/** <#digest#> */ @property (nonatomic, strong) id lastParams; @end @implementation SINStatusListService - - -- (void)getStatusList:(BOOL)isFresh complation:(void(^)(NSError *error, BOOL isEnd))completion -{ +- (void)getStatusList:(BOOL)isFresh complation:(void(^)(NSError *error, BOOL isEnd))completion { NSString *URL = @"https://api.weibo.com/2/statuses/home_timeline.json"; - NSMutableDictionary *params = [NSMutableDictionary dictionary]; params[@"access_token"] = [SINUserManager sharedManager].accessToken.copy; params[@"count"] = @"10"; @@ -44,91 +40,54 @@ - (void)getStatusList:(BOOL)isFresh complation:(void(^)(NSError *error, BOOL isE params[@"since_id"] = @"0"; params[@"max_id"] = self.statusViewModels.lastObject.status.idstr.length ? SNSub(self.statusViewModels.lastObject.status.idstr, @"1").stringValue : @"0"; } - - self.lastParams = params; + self.lastParams = params; [SINStatusListDAL queryStatusListFromDiskWithSinceId:params[@"since_id"] maxId:params[@"max_id"] completion:^(NSMutableArray *dictArrayM) { if (self.lastParams != params) { return ; } - - if (dictArrayM.count >= 1) { - [self dictConverModels:dictArrayM complation:^(NSError *error, NSMutableArray *statusViewModels) { if (self.lastParams != params) { return ; } - if (isFresh) { - [self.statusViewModels insertObjects:statusViewModels atIndex:0]; - - }else - { + }else{ [self.statusViewModels addObjectsFromArray:statusViewModels]; } - - completion(nil, NO); - }]; }else { - [self GET:URL parameters:params completion:^(LMJBaseResponse *response) { if (self.lastParams != params) { return ; } - - if (response.error || !response.responseObject) { - completion(response.error, NO); - return ; } - NSDictionary *responObj = response.responseObject; - NSLog(@"%@", response.responseObject); [SINStatusListDAL cachesStatusList:responObj[@"statuses"]]; - [self dictConverModels:responObj[@"statuses"] complation:^(NSError *error, NSMutableArray *statusViewModels) { if (self.lastParams != params) { return ; } - if (isFresh) { - [self.statusViewModels insertObjects:statusViewModels atIndex:0]; - - }else - { + }else{ [self.statusViewModels addObjectsFromArray:statusViewModels]; } - - completion(nil, (SNCompare(@(self.statusViewModels.count), responObj[@"total_number"])) != LMJXY); - - - }]; - - - - }]; - } - - - }]; - } diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SIN.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SIN.h" index ca0373be..c9630374 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SIN.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SIN.h" @@ -13,5 +13,4 @@ #import "SINUnLoginRegisterView.h" - #endif /* SIN_h */ diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINPickPhotoTool.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINPickPhotoTool.h" new file mode 100644 index 00000000..f5971364 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINPickPhotoTool.h" @@ -0,0 +1,27 @@ +// +// SINPickPhotoTool.h +// iOSProject +// +// Created by HuXuPeng on 2018/4/11. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import +#import + + +/** + 老板再也不担心这个功能做不出来啦 + */ +@interface SINPickPhotoTool : NSObject + ++ (void)showPickPhotoToolWithViewController:(UIViewController *)viewController maxPhotoCount:(NSUInteger)maxPhotoCount choosePhotoHandler:(void(^)(NSMutableArray *selectedImages, NSMutableArray *selectedAccest))choosePhotoHandler takePhotoHandler:(void(^)(NSMutableArray *selectedImages, NSMutableArray *selectedAccest))takePhotoHandler deleteImage:(void(^)(void(^deleteHandler)(NSUInteger index)))deleteImage; + + +@end + + +@interface UIViewController (LMJImagePickTool) +@property (nonatomic, strong, readonly) NSMutableArray *lmj_selectedImages; +@property (nonatomic, strong, readonly) NSMutableArray *lmj_selectedAccests; +@end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINPickPhotoTool.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINPickPhotoTool.m" new file mode 100644 index 00000000..aaef0018 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINPickPhotoTool.m" @@ -0,0 +1,333 @@ +// +// SINPickPhotoTool.m +// iOSProject +// +// Created by HuXuPeng on 2018/4/11. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "SINPickPhotoTool.h" +#import +#import +#import + +@interface SINPickPhotoTool () + +/** 选中的图片 */ +@property (nonatomic, strong) NSMutableArray *selectedImages; +/** 选中的相册 */ +@property (nonatomic, strong) NSMutableArray *selectedAccest; +/** 定位 */ +@property (nonatomic, strong) CLLocation *location; + +@property (nonatomic, strong) UIImagePickerController *imagePickerVc; +/** 当前的页面 */ +@property (weak, nonatomic) UIViewController *currentViewController; + +@property (nonatomic, assign) NSUInteger maxPhotoCount; + +/** 选中图片的回调 */ +@property (nonatomic, copy) void(^choosePhotoHandler)(NSMutableArray *selectedImages, NSMutableArray *selectedAccest); + +/** 拍照图片的回调 */ +@property (nonatomic, copy) void(^takePhotoHandler)(NSMutableArray *selectedImages, NSMutableArray *selectedAccest); +@end + +@implementation SINPickPhotoTool + +- (UIImagePickerController *)imagePickerVc { + if (_imagePickerVc == nil) { + _imagePickerVc = [[UIImagePickerController alloc] init]; + _imagePickerVc.delegate = self; + // set appearance / 改变相册选择页的导航栏外观 + _imagePickerVc.navigationBar.barTintColor = [UIColor greenColor]; + // 红色 + _imagePickerVc.navigationBar.tintColor = [UIColor redColor]; + UIBarButtonItem *tzBarItem, *BarItem; + tzBarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[TZImagePickerController class]]]; + BarItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIImagePickerController class]]]; + NSDictionary *titleTextAttributes = [tzBarItem titleTextAttributesForState:UIControlStateNormal]; + [BarItem setTitleTextAttributes:titleTextAttributes forState:UIControlStateNormal]; + } + return _imagePickerVc; +} + +- (void)alertAction +{ + [UIAlertController mj_showActionSheetWithTitle:nil message:nil appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionDefaultTitle(@"选择相册").addActionDefaultTitle(@"照相").addActionCancelTitle(@"取消"); + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + if (buttonIndex == 0) { + [self pushTZImagePickerController]; + }else if (buttonIndex == 1) { + [self takePhoto]; + } + }]; +} + +- (void)pushTZImagePickerController +{ + if (self.maxPhotoCount <= 0) { + return; + } + + TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:self.maxPhotoCount columnNumber:4 delegate:self pushPhotoPickerVc:YES]; + // imagePickerVc.navigationBar.translucent = NO; + +#pragma mark - 五类个性化设置,这些参数都可以不传,此时会走默认设置 + imagePickerVc.isSelectOriginalPhoto = NO; + if (self.maxPhotoCount > 1) { + // 1.设置目前已经选中的图片数组 + imagePickerVc.selectedAssets = self.selectedAccest; // 目前已经选中的图片数组 + } + imagePickerVc.allowTakePicture = NO; // 在内部显示拍照按钮 + + // imagePickerVc.photoWidth = 1000; + + // 2. Set the appearance + // 2. 在这里设置imagePickerVc的外观 + // if (iOS7Later) { + // imagePickerVc.navigationBar.barTintColor = [UIColor greenColor]; + // } + // imagePickerVc.oKButtonTitleColorDisabled = [UIColor lightGrayColor]; + // imagePickerVc.oKButtonTitleColorNormal = [UIColor greenColor]; + // imagePickerVc.navigationBar.translucent = NO; + + // 3. Set allow picking video & photo & originalPhoto or not + // 3. 设置是否可以选择视频/图片/原图 + imagePickerVc.allowPickingVideo = NO; + imagePickerVc.allowPickingImage = YES; + imagePickerVc.allowPickingOriginalPhoto = NO; + imagePickerVc.allowPickingGif = NO; + imagePickerVc.allowPickingMultipleVideo = NO; // 是否可以多选视频 + + // 4. 照片排列按修改时间升序 + imagePickerVc.sortAscendingByModificationDate = YES; + + // imagePickerVc.minImagesCount = 3; + // imagePickerVc.alwaysEnableDoneBtn = YES; + + // imagePickerVc.minPhotoWidthSelectable = 3000; + // imagePickerVc.minPhotoHeightSelectable = 2000; + + /// 5. Single selection mode, valid when maxImagesCount = 1 + /// 5. 单选模式,maxImagesCount为1时才生效 + imagePickerVc.showSelectBtn = NO; + imagePickerVc.allowCrop = YES; + imagePickerVc.needCircleCrop = NO; + // 设置竖屏下的裁剪尺寸 + NSInteger left = 30; + NSInteger widthHeight = kScreenWidth - 2 * left; + NSInteger top = (kScreenHeight - widthHeight) / 2; + imagePickerVc.cropRect = CGRectMake(left, top, widthHeight, widthHeight); + // 设置横屏下的裁剪尺寸 + // imagePickerVc.cropRectLandscape = CGRectMake((self.view.tz_height - widthHeight) / 2, left, widthHeight, widthHeight); + /* + [imagePickerVc setCropViewSettingBlock:^(UIView *cropView) { + cropView.layer.borderColor = [UIColor redColor].CGColor; + cropView.layer.borderWidth = 2.0; + }];*/ + + //imagePickerVc.allowPreview = NO; + // 自定义导航栏上的返回按钮 + /* + [imagePickerVc setNavLeftBarButtonSettingBlock:^(UIButton *leftButton){ + [leftButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; + [leftButton setImageEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 20)]; + }]; + imagePickerVc.delegate = self; + */ + + // Deprecated, Use statusBarStyle + // imagePickerVc.isStatusBarDefault = NO; +// imagePickerVc.isStatusBarDefault = YES; + + // 设置首选语言 / Set preferred language + // imagePickerVc.preferredLanguage = @"zh-Hans"; + + // 设置languageBundle以使用其它语言 / Set languageBundle to use other language + // imagePickerVc.languageBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"tz-ru" ofType:@"lproj"]]; +#pragma mark - 到这里为止 + LMJWeak(self); + // You can get the photos by block, the same as by delegate. + // 你可以通过block或者代理,来得到用户选择的照片. + [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { + weakself.selectedImages = [NSMutableArray arrayWithArray:photos]; + weakself.selectedAccest = [NSMutableArray arrayWithArray:assets]; + !weakself.choosePhotoHandler ?: weakself.choosePhotoHandler(weakself.selectedImages, weakself.selectedAccest); + }]; + [self.currentViewController presentViewController:imagePickerVc animated:YES completion:nil]; +} + +- (void)takePhoto +{ + AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; + if ((authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied)) { + // 无相机权限 做一个友好的提示 + [UIAlertController mj_showAlertWithTitle:@"无法使用相机" message:@"请在iPhone的""设置-隐私-相机""中允许访问相机" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionDestructiveTitle(@"取消").addActionDefaultTitle(@"确认"); + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + if (buttonIndex == 1) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil]; + } + }]; + + } else if (authStatus == AVAuthorizationStatusNotDetermined) { + // fix issue 466, 防止用户首次拍照拒绝授权时相机页黑屏 + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { + if (granted) { + dispatch_sync(dispatch_get_main_queue(), ^{ + [self takePhoto]; + }); + } + }]; + // 拍照之前还需要检查相册权限 + } else if (authStatus == AVAuthorizationStatusDenied) { // 已被拒绝,没有相册权限,将无法保存拍的照片 + + [UIAlertController mj_showAlertWithTitle:@"无法使用相机" message:@"请在iPhone的""设置-隐私-相机""中允许访问相机" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionDestructiveTitle(@"取消").addActionDefaultTitle(@"确认"); + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + if (buttonIndex == 1) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil]; + } + }]; + } else if (authStatus == AVAuthorizationStatusNotDetermined) { // 未请求过相册权限 + [[TZImageManager manager] requestAuthorizationWithCompletion:^{ + [self takePhoto]; + }]; + } else { + [self pushImagePickerController]; + } +} + +// 调用相机 +- (void)pushImagePickerController { + // 提前定位 + __weak typeof(self) weakSelf = self; + [[TZLocationManager manager] startLocationWithSuccessBlock:^(NSArray *locations) { + __strong typeof(weakSelf) strongSelf = weakSelf; + strongSelf.location = locations.lastObject; + } failureBlock:^(NSError *error) { + __strong typeof(weakSelf) strongSelf = weakSelf; + strongSelf.location = nil; + }]; + + UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera; + if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { + self.imagePickerVc.sourceType = sourceType; + self.imagePickerVc.modalPresentationStyle = UIModalPresentationOverCurrentContext; + [self.currentViewController presentViewController:self.imagePickerVc animated:YES completion:nil]; + } else { + NSLog(@"模拟器中无法打开照相机,请在真机中使用"); + } +} + +- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + [picker dismissViewControllerAnimated:YES completion:nil]; + NSString *type = [info objectForKey:UIImagePickerControllerMediaType]; + if ([type isEqualToString:@"public.image"]) { + TZImagePickerController *tzImagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:self]; + tzImagePickerVc.sortAscendingByModificationDate = YES; + [tzImagePickerVc showProgressHUD]; + UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; + + // save photo and get asset / 保存图片,获取到asset + [[TZImageManager manager] savePhotoWithImage:image location:self.location completion:^(PHAsset *asset, NSError *error){ + if (error) { + [tzImagePickerVc hideProgressHUD]; + NSLog(@"图片保存失败 %@",error); + } else { + [[TZImageManager manager] getCameraRollAlbum:NO allowPickingImage:YES needFetchAssets:YES completion:^(TZAlbumModel *model) { + [[TZImageManager manager] getAssetsFromFetchResult:model.result allowPickingVideo:NO allowPickingImage:YES completion:^(NSArray *models) { + [tzImagePickerVc hideProgressHUD]; + TZAssetModel *assetModel = [models firstObject]; + if (tzImagePickerVc.sortAscendingByModificationDate) { + assetModel = [models lastObject]; + } + if (/* DISABLES CODE */ (NO)) { // 允许裁剪,去裁剪 + TZImagePickerController *imagePicker = [[TZImagePickerController alloc] initCropTypeWithAsset:assetModel.asset photo:image completion:^(UIImage *cropImage, id asset) { + [self refreshAsset:asset image:cropImage]; + }]; + imagePicker.needCircleCrop = NO; + imagePicker.circleCropRadius = 100; + [self.currentViewController presentViewController:imagePicker animated:YES completion:nil]; + } else { + [self refreshAsset:assetModel.asset image:image]; + } + }]; + }]; + } + }]; + } +} + +- (void)refreshAsset:(id)asset image:(UIImage *)image { + if ([asset isKindOfClass:[PHAsset class]]) { + PHAsset *phAsset = asset; + NSLog(@"location:%@",phAsset.location); + } + [self.selectedAccest addObject:asset]; + [self.selectedImages addObject:image]; + !self.takePhotoHandler ?: self.takePhotoHandler(self.selectedImages, self.selectedAccest); + +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { + if ([picker isKindOfClass:[UIImagePickerController class]]) { + [picker dismissViewControllerAnimated:YES completion:nil]; + } +} + +static void *pickToolKey = &pickToolKey; ++ (void)showPickPhotoToolWithViewController:(UIViewController *)viewController maxPhotoCount:(NSUInteger)maxPhotoCount choosePhotoHandler:(void(^)(NSMutableArray *selectedImages, NSMutableArray *selectedAccest))choosePhotoHandler takePhotoHandler:(void(^)(NSMutableArray *selectedImages, NSMutableArray *selectedAccest))takePhotoHandler deleteImage:(void(^)(void(^deleteHandler)(NSUInteger index)))deleteImage +{ + SINPickPhotoTool *pickTool; + pickTool = objc_getAssociatedObject(viewController, pickToolKey); + if (pickTool) { + [pickTool alertAction]; + return; + } + pickTool = [[self alloc] init]; + pickTool.currentViewController = viewController; + pickTool.maxPhotoCount = maxPhotoCount ?: pickTool.maxPhotoCount; + pickTool.choosePhotoHandler = [choosePhotoHandler copy]; + pickTool.takePhotoHandler = [takePhotoHandler copy]; + + LMJWeak(pickTool); + void(^deleteImageHandler)(NSUInteger index) = ^void(NSUInteger index) { + [weakpickTool.selectedImages removeObjectAtIndex:index]; + [weakpickTool.selectedAccest removeObjectAtIndex:index]; + }; + !deleteImage ?: deleteImage(deleteImageHandler); + objc_setAssociatedObject(viewController, pickToolKey, pickTool, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + [pickTool alertAction]; +} + +- (instancetype)init +{ + self = [super init]; + if (self) { + _selectedAccest = [NSMutableArray array]; + _selectedImages = [NSMutableArray array]; + _maxPhotoCount = 6; + } + return self; +} + +@end + +@implementation UIViewController (LMJImagePickTool) + +- (NSMutableArray *)lmj_selectedImages { + SINPickPhotoTool *pickTool; + pickTool = objc_getAssociatedObject(self, pickToolKey); + return pickTool.selectedImages; +} + +- (NSMutableArray *)lmj_selectedAccests { + SINPickPhotoTool *pickTool; + pickTool = objc_getAssociatedObject(self, pickToolKey); + return pickTool.selectedAccest; +} + +@end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINSQLiteManager.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINSQLiteManager.h" index d854f503..30817163 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINSQLiteManager.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINSQLiteManager.h" @@ -12,7 +12,7 @@ @interface SINSQLiteManager : NSObject -/** <#digest#> */ + @property (nonatomic, strong) FMDatabaseQueue *dbQueue; + (instancetype)sharedManager; diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINSQLiteManager.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINSQLiteManager.m" index a4908e55..e0db19f1 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINSQLiteManager.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINSQLiteManager.m" @@ -81,14 +81,9 @@ - (void)queryDatas dictM[colName] = colValue; } - NSLog(@"%@", dictM); - - } - }]; - } // 查询 @@ -96,20 +91,14 @@ - (void)queryCondition { NSString *sql = @"SELECT id, userid, statusid FROM t_statuses"; - [self.dbQueue inDatabase:^(FMDatabase *db) { - FMResultSet *resultSet = [db executeQuery:sql withArgumentsInArray:@[]]; - while (resultSet.next) { - int ID = [resultSet intForColumn:@"id"]; NSString *userid = [resultSet stringForColumn:@"userid"]; NSString *statusid = [resultSet stringForColumn:@"statusid"]; - - NSLog(@"%zd, %@, %@", ID, userid, statusid); + NSLog(@"%d, %@, %@", ID, userid, statusid); } - }]; } @@ -118,9 +107,7 @@ - (void)queryCondition - (void)update { NSString *sql = @"UPDATE t_statuses SET userid=0000 WHERE id = 2"; - [self.dbQueue inDatabase:^(FMDatabase *db) { - BOOL result = [db executeUpdate:sql withArgumentsInArray:@[]]; if (result) { @@ -170,11 +157,6 @@ - (void)insert } - - - - - #pragma mark - creatTable - (void)creatTable { @@ -211,12 +193,6 @@ - (FMDatabaseQueue *)dbQueue } - - - - - - #pragma mark - 单例 - (instancetype)init { diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINStatusListDAL.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINStatusListDAL.m" index c564a797..674a8253 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINStatusListDAL.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINStatusListDAL.m" @@ -11,14 +11,9 @@ #import "SINSQLiteManager.h" @interface SINStatusListDAL () - -/** <#digest#> */ @property (nonatomic, copy) NSString *userId; - - @end - static NSString *const tableName_ = @"t_statuses"; static const NSTimeInterval maxTime_ = -7 * 24 * 3600; @@ -26,8 +21,6 @@ @interface SINStatusListDAL () @implementation SINStatusListDAL - - + (void)cachesStatusList:(NSMutableArray *)status { if (LMJIsEmpty(status)) { @@ -39,40 +32,22 @@ + (void)cachesStatusList:(NSMutableArray *)status [[SINSQLiteManager sharedManager].dbQueue inTransaction:^(FMDatabase *db, BOOL *rollback) { [status enumerateObjectsUsingBlock:^(NSMutableDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - - @try { NSData *statusData = [NSJSONSerialization dataWithJSONObject:obj options:0 error:nil]; - if (![db executeUpdate:sql withArgumentsInArray:@[obj[@"idstr"], statusData, [SINUserManager sharedManager].uid]]) - { - *stop = YES; - *rollback = YES; - } + if (![db executeUpdate:sql withArgumentsInArray:@[obj[@"idstr"], statusData, [SINUserManager sharedManager].uid]]){ + *stop = YES; + *rollback = YES; + } } @catch (NSException *exception) { - NSLog(@"存储错误: %@", exception); - - - } @finally { - -// *stop = YES; -// *rollback = YES; - } - - NSLog(@"向数据库新增%zd条数据", db.changes); + NSLog(@"向数据库新增%d条数据", db.changes); }]; - - }]; - - - - } @@ -88,7 +63,6 @@ + (void)queryStatusListFromDiskWithSinceId:(NSString *)since_id maxId:(NSString sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE statusid > %@ AND userid = %@ ORDER BY statusid DESC LIMIT 10", tableName_, since_id, [SINUserManager sharedManager].uid]; } - [[SINSQLiteManager sharedManager] queryArrayOfDicts:sql completion:^(NSMutableArray *dictArrayM) { NSMutableArray *dictArrayM_new = [NSMutableArray array]; @@ -96,27 +70,15 @@ + (void)queryStatusListFromDiskWithSinceId:(NSString *)since_id maxId:(NSString [dictArrayM enumerateObjectsUsingBlock:^(NSMutableDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { NSData *statusData = obj[@"status"]; - @try { NSDictionary *statusDict = [NSJSONSerialization JSONObjectWithData:statusData options:NSJSONReadingMutableLeaves error:nil]; - [dictArrayM_new addObject:[NSMutableDictionary dictionaryWithDictionary:statusDict]]; - } @catch (NSException *exception) { - } @finally { - - } - }]; - - completion(dictArrayM_new); - }]; - - } + (void)clearOutTimeCashes @@ -132,7 +94,7 @@ + (void)clearOutTimeCashes BOOL isSucceed = [db executeUpdate:sql withArgumentsInArray:@[]]; if (isSucceed) { - NSLog(@"%zd 删除数据成功", db.changes); + NSLog(@"%d 删除数据成功", db.changes); *rollback = NO; }else { diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINUserManager.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINUserManager.h" index 35c54337..642c634d 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINUserManager.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINUserManager.h" @@ -21,13 +21,13 @@ /** 过期时间 */ @property (nonatomic, strong) NSDate *expiration; -/** <#digest#> */ +/** accessToken */ @property (nonatomic, copy) NSString *accessToken; /** 头像 */ @property (nonatomic, copy) NSString *iconurl; -/** <#digest#> */ +/** 用户 ID */ @property (nonatomic, copy) NSString *uid; diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINUserManager.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINUserManager.m" index 25b16c6b..c7792261 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINUserManager.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/Tools/SINUserManager.m" @@ -7,7 +7,7 @@ // #import "SINUserManager.h" -#import +//#import #import "LMJUMengHelper.h" @interface SINUserManager () @@ -16,17 +16,13 @@ @interface SINUserManager () @implementation SINUserManager -- (BOOL)isLogined -{ - +- (BOOL)isLogined { if (!self.accessToken) { return NO; } - if (!self.expiration || [self.expiration compare:[NSDate date]] != NSOrderedDescending) { return NO; } - return YES; } @@ -34,14 +30,11 @@ - (BOOL)isLogined - (void)sinaLogin:(void(^)(NSError *error))completion { [LMJUMengHelper getUserInfoForPlatform:UMSocialPlatformType_Sina completion:^(UMSocialUserInfoResponse *result, NSError *error) { - if (error) { NSLog(@"%@", error); completion(error); - return ; } - NSLog(@"%@", result.uid); NSLog(@"%@", result.openid); NSLog(@"%@", result.refreshToken); @@ -57,11 +50,9 @@ - (void)sinaLogin:(void(^)(NSError *error))completion self.iconurl = result.iconurl; self.uid = result.uid; - [HMEmoticonManager sharedManager].userIdentifier = self.uid; - +// [HMEmoticonManager sharedManager].userIdentifier = self.uid; [self saveToFile]; - completion(nil); }]; } @@ -74,10 +65,8 @@ - (void)saveToFile #pragma mark - mjcoding -- (id)initWithCoder:(NSCoder *)decoder -{ +- (id)initWithCoder:(NSCoder *)decoder { if (self = [super init]) { - _name = [decoder decodeObjectForKey:LMJKeyPath(self, name)]; _expiration = [decoder decodeObjectForKey:LMJKeyPath(self, expiration)]; _accessToken = [decoder decodeObjectForKey:LMJKeyPath(self, accessToken)]; @@ -87,15 +76,12 @@ - (id)initWithCoder:(NSCoder *)decoder return self; } -- (void)encodeWithCoder:(NSCoder *)encoder -{ - +- (void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeObject:self.name forKey:LMJKeyPath(self, name)]; [encoder encodeObject:self.expiration forKey:LMJKeyPath(self, expiration)]; [encoder encodeObject:self.accessToken forKey:LMJKeyPath(self, accessToken)]; [encoder encodeObject:self.iconurl forKey:LMJKeyPath(self, iconurl)]; [encoder encodeObject:self.uid forKey:LMJKeyPath(self, uid)]; - } @@ -111,16 +97,14 @@ - (instancetype)init { self = [super init]; if (self) { - // 测试作者信息, 自己获取请注释 if ([LMJThirdSDKSinaAppKey isEqualToString:@"4061770881"]) { _name = @"NJ影伴人久"; - _accessToken = @"2.00afSYxFZJms7E8e40f0acedp4pUnD"; + _accessToken = @"2.00afSYxFZJms7Eb7fba204741DuUPB"; _iconurl = @"https://tvax3.sinaimg.cn/crop.1.0.510.510.180/005XyiFAly8fescv0z62zj30e80e6q3o.jpg"; _uid = @"5460642906"; _expiration = [NSDate distantFuture]; } - } return self; } @@ -133,13 +117,10 @@ + (instancetype)sharedManager { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - _instance = [NSKeyedUnarchiver unarchiveObjectWithFile:[self archiveFilePath]]; - if (!_instance) { _instance = [[self alloc] init]; } - }); return _instance; diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.h" index 8faae704..c72fb8fd 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.h" @@ -16,10 +16,8 @@ typedef enum : NSUInteger { @interface SINPublishToolBar : UIToolbar -/** <#digest#> */ @property (nonatomic, copy) void(^selectInput)(SINPublishToolBarClickType type); - + (instancetype)publishToolBar; @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.m" index b4de8d8d..6027ba86 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.m" @@ -10,9 +10,6 @@ @implementation SINPublishToolBar - - - - (IBAction)addPics:(UIBarButtonItem *)sender { !self.selectInput ?: self.selectInput(SINPublishToolBarClickTypePics); diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.xib" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.xib" index 0a286f73..c642f6cc 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.xib" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINPublishToolBar.xib" @@ -1,11 +1,11 @@ - + - + diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusCell.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusCell.m" index 4d98bc81..c833a44d 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusCell.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusCell.m" @@ -14,7 +14,7 @@ #import "SINStatusToolBarView.h" #import "SINStatusPicsView.h" #import "SINStatusRetweetView.h" -#import +//#import #import #import "LMJWebViewController.h" @@ -72,14 +72,10 @@ - (void)setStatusViewModel:(SINStatusViewModel *)statusViewModel self.screen_nameLabel.text = statusViewModel.status.user.screen_name; self.mbrankImageView.image = statusViewModel.sin_mbrankImage; self.textPostLabel.attributedText = statusViewModel.sin_textPost ?: [[NSMutableAttributedString alloc] initWithString:@""]; - [self.textPostLabel mas_updateConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(statusViewModel.postTextHeight); - }]; - self.bottomToolBarView.statusViewModel = statusViewModel; self.created_atTimeLabel.text = statusViewModel.sin_creatTime; @@ -91,21 +87,15 @@ - (void)setStatusViewModel:(SINStatusViewModel *)statusViewModel }]; [self layoutIfNeeded]; - self.statusPicsView.statusViewModel = statusViewModel; - self.reweetView.hidden = !statusViewModel.sin_retweetStatusViewModel; - self.reweetView.retweetStatusViewModel = statusViewModel.sin_retweetStatusViewModel; - - } - (void)setupUIOnce { self.contentView.backgroundColor = [UIColor whiteColor]; - } @@ -119,20 +109,15 @@ - (UIImageView *)profile_image_urlImageView UIImageView *profile_image_urlImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"avatar_default"]]; [self.contentView addSubview:profile_image_urlImageView]; _profile_image_urlImageView = profile_image_urlImageView; - profile_image_urlImageView.layer.cornerRadius = 25; profile_image_urlImageView.layer.borderColor = [UIColor lightGrayColor].CGColor; profile_image_urlImageView.layer.borderWidth = 0.3; profile_image_urlImageView.layer.masksToBounds = YES; profile_image_urlImageView.contentMode = UIViewContentModeScaleAspectFill; - [profile_image_urlImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.top.offset(margin); make.size.mas_equalTo(CGSizeMake(50, 50)); - }]; - } return _profile_image_urlImageView; } @@ -140,51 +125,37 @@ - (UIImageView *)profile_image_urlImageView - (YYLabel *)screen_nameLabel { - if(_screen_nameLabel == nil) - { - + if(_screen_nameLabel == nil) { YYLabel *screen_nameLabel = [[YYLabel alloc] init]; [self.contentView addSubview:screen_nameLabel]; _screen_nameLabel = screen_nameLabel; - screen_nameLabel.textAlignment = NSTextAlignmentLeft; screen_nameLabel.textColor = [UIColor blackColor]; screen_nameLabel.font = [UIFont systemFontOfSize:AdaptedWidth(14)]; - [screen_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.profile_image_urlImageView.mas_right).offset(10); make.right.lessThanOrEqualTo(self.contentView.mas_right).offset(-50); - make.bottom.mas_equalTo(self.profile_image_urlImageView.mas_centerY); }]; - } return _screen_nameLabel; } - (UIImageView *)avatarVipImageView { - if(_avatarVipImageView == nil) - { + if(_avatarVipImageView == nil) { UIImageView *avatarVipImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"avatar_enterprise_vip"]]; [self.contentView addSubview:avatarVipImageView]; _avatarVipImageView = avatarVipImageView; - - avatarVipImageView.layer.cornerRadius = 8; // avatarVipImageView.layer.borderColor = [UIColor whiteColor].CGColor; // avatarVipImageView.layer.borderWidth = 1; avatarVipImageView.contentMode = UIViewContentModeScaleToFill;; avatarVipImageView.backgroundColor = [UIColor whiteColor]; - [avatarVipImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.right.mas_equalTo(self.profile_image_urlImageView).offset(0); make.size.mas_equalTo(CGSizeMake(16, 16)); - }]; - } return _avatarVipImageView; } @@ -196,13 +167,9 @@ - (UIImageView *)mbrankImageView UIImageView *mbrankImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"common_icon_membership_level1"]]; [self.contentView addSubview:mbrankImageView]; _mbrankImageView = mbrankImageView; - - [mbrankImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.screen_nameLabel.mas_centerY); make.left.mas_equalTo(self.screen_nameLabel.mas_right).offset(margin); - }]; } return _mbrankImageView; @@ -216,18 +183,12 @@ - (SINStatusToolBarView *)bottomToolBarView SINStatusToolBarView *bottomToolBarView = [SINStatusToolBarView tooBarView]; [self.contentView addSubview:bottomToolBarView]; _bottomToolBarView = bottomToolBarView; - - bottomToolBarView.backgroundColor = [UIColor groupTableViewBackgroundColor]; [bottomToolBarView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.offset(0); make.bottom.mas_equalTo(self.sepLineView.mas_top); make.height.mas_equalTo(32.5); - }]; - - } return _bottomToolBarView; } @@ -241,12 +202,9 @@ - (UIView *)sepLineView [self.contentView addSubview:lineView]; _sepLineView = lineView; lineView.backgroundColor = [UIColor groupTableViewBackgroundColor]; - [lineView mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.right.left.offset(0); make.height.mas_equalTo(margin); - }]; } return _sepLineView; @@ -259,14 +217,11 @@ - (KILabel *)textPostLabel KILabel *textPostLabel = [[KILabel alloc] init]; [self.contentView addSubview:textPostLabel]; _textPostLabel = textPostLabel; - textPostLabel.numberOfLines = 0; textPostLabel.textAlignment = NSTextAlignmentLeft; textPostLabel.preferredMaxLayoutWidth = kScreenWidth - 2 * margin; textPostLabel.backgroundColor = [UIColor RandomColor]; - [textPostLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.offset(margin); make.right.offset(-margin); make.top.mas_equalTo(self.profile_image_urlImageView.mas_bottom).offset(margin); @@ -292,31 +247,21 @@ - (KILabel *)textPostLabel [textPostLabel setAttributes:@{NSForegroundColorAttributeName : UIColor.greenColor} forLinkType:KILinkTypeHashtag]; [textPostLabel setAttributes:@{NSForegroundColorAttributeName : UIColor.greenColor} forLinkType:KILinkTypeURL]; -// LMJWeakSelf(self); - - textPostLabel.userHandleLinkTapHandler = ^(KILabel * _Nonnull label, NSString * _Nonnull string, NSRange range) { - NSLog(@"%@ %@ %@", label, string, NSStringFromRange(range)); }; textPostLabel.hashtagLinkTapHandler = ^(KILabel * _Nonnull label, NSString * _Nonnull string, NSRange range) { - NSLog(@"%@ %@ %@", label, string, NSStringFromRange(range)); - }; textPostLabel.urlLinkTapHandler = ^(KILabel * _Nonnull label, NSString * _Nonnull string, NSRange range) { - NSLog(@"%@ %@ %@", label, string, NSStringFromRange(range)); // LMJWebViewController *webVc = [[LMJWebViewController alloc] init]; // webVc.gotoURL = string.copy; -// // [weakself.viewController.navigationController pushViewController:webVc animated:YES]; }; - - } return _textPostLabel; } @@ -328,13 +273,10 @@ - (UILabel *)created_atTimeLabel UILabel *created_atTimeLabel = [[UILabel alloc] init]; [self.contentView addSubview:created_atTimeLabel]; _created_atTimeLabel = created_atTimeLabel; - created_atTimeLabel.textAlignment = NSTextAlignmentLeft; created_atTimeLabel.textColor = [UIColor lightGrayColor]; created_atTimeLabel.font = [UIFont systemFontOfSize:AdaptedWidth(11)]; - [created_atTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.screen_nameLabel.mas_left); make.top.mas_equalTo(self.profile_image_urlImageView.mas_centerY).offset(3); }]; @@ -350,16 +292,12 @@ - (UILabel *)sourceCreatLabel UILabel *sourceCreatLabel = [[UILabel alloc] init]; [self.contentView addSubview:sourceCreatLabel]; _sourceCreatLabel = sourceCreatLabel; - sourceCreatLabel.textAlignment = NSTextAlignmentLeft; sourceCreatLabel.textColor = [UIColor lightGrayColor]; sourceCreatLabel.font = [UIFont systemFontOfSize:AdaptedWidth(11)]; - [sourceCreatLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.created_atTimeLabel.mas_right).offset(5); make.centerY.mas_equalTo(self.created_atTimeLabel); - }]; } return _sourceCreatLabel; @@ -373,16 +311,11 @@ - (SINStatusPicsView *)statusPicsView SINStatusPicsView *statusPicsView = [[SINStatusPicsView alloc] init]; [self.contentView addSubview:statusPicsView]; _statusPicsView = statusPicsView; - [statusPicsView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.textPostLabel.mas_bottom).offset(margin); make.left.mas_equalTo(self.textPostLabel.mas_left); - make.size.mas_equalTo(CGSizeMake(66, 66)); - }]; - } return _statusPicsView; } @@ -394,39 +327,28 @@ - (SINStatusRetweetView *)reweetView SINStatusRetweetView *reweetView = [[SINStatusRetweetView alloc] init]; [self.contentView addSubview:reweetView]; _reweetView = reweetView; - [reweetView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.offset(0); make.top.mas_equalTo(self.textPostLabel.mas_bottom).offset(margin); make.bottom.mas_equalTo(reweetView.statusPicsView.mas_bottom).offset(margin); - }]; - } return _reweetView; } #pragma mark - base -+ (instancetype)statusCellWithTableView:(UITableView *)tableView -{ - ++ (instancetype)statusCellWithTableView:(UITableView *)tableView { SINStatusCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([self class])]; - - if (cell == nil) { cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(self)]; } - return cell; } -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier -{ +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self setupUIOnce]; } - return self; } @@ -438,16 +360,12 @@ - (void)awakeFromNib -- (void)layoutSubviews -{ +- (void)layoutSubviews{ [super layoutSubviews]; - } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; - - } @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusPicsView.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusPicsView.h" index 1eb34618..a1b9bc15 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusPicsView.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusPicsView.h" @@ -11,20 +11,13 @@ @class SINStatusViewModel; @interface SINStatusPicsView : UIView - - - -/** <#digest#> */ @property (nonatomic, strong) SINStatusViewModel *statusViewModel; - @end - @interface SINStatusPicsViewCell : UICollectionViewCell -/** <#digest#> */ @property (weak, nonatomic) UIImageView *imageView; @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusPicsView.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusPicsView.m" index eda853bb..9d7ed48c 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusPicsView.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusPicsView.m" @@ -14,13 +14,10 @@ @interface SINStatusPicsView () -/** <#digest#> */ @property (weak, nonatomic) UICollectionView *collectionView; -/** <#digest#> */ @property (nonatomic, strong) SINBroswerAnimator *broswerAnimator; -/** <#digest#> */ @property (nonatomic, strong) NSIndexPath *lastSelectedIndexPath; @end @@ -28,7 +25,6 @@ @interface SINStatusPicsView () */ @property (weak, nonatomic) KILabel *retweetContentLabel; - - @end - - static const CGFloat margin = 10.0; @implementation SINStatusRetweetView - -- (void)setupUIOnce -{ +- (void)setupUIOnce { self.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.1]; - } - - -- (void)layoutSubviews -{ +- (void)layoutSubviews { [super layoutSubviews]; } - (void)setRetweetStatusViewModel:(SINStatusViewModel *)retweetStatusViewModel { _retweetStatusViewModel = retweetStatusViewModel; - self.retweetContentLabel.attributedText = retweetStatusViewModel.sin_textPost ?: [[NSMutableAttributedString alloc] initWithString:@""]; - [self.retweetContentLabel mas_updateConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(retweetStatusViewModel.postTextHeight); - }]; // 先设置 View 的尺寸, 再刷新数据 @@ -57,20 +42,16 @@ - (void)setRetweetStatusViewModel:(SINStatusViewModel *)retweetStatusViewModel make.size.mas_equalTo(retweetStatusViewModel.sin_statusPicsViewModel.picsViewSize); }]; - - self.statusPicsView.statusViewModel = retweetStatusViewModel; - [self mas_updateConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.statusPicsView.mas_bottom).offset(retweetStatusViewModel.status.pic_urls.count ? margin : 0); - }]; [self layoutIfNeeded]; + + self.statusPicsView.statusViewModel = retweetStatusViewModel; } - #pragma mark - getter - (KILabel *)retweetContentLabel @@ -85,47 +66,32 @@ - (KILabel *)retweetContentLabel textPostLabel.textAlignment = NSTextAlignmentLeft; textPostLabel.preferredMaxLayoutWidth = kScreenWidth - 2 * margin; textPostLabel.backgroundColor = [UIColor RandomColor]; - [textPostLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.offset(margin); make.right.offset(-margin); make.top.offset(margin); make.height.mas_equalTo(20); }]; - - [textPostLabel setAttributes:@{NSForegroundColorAttributeName : UIColor.greenColor} forLinkType:KILinkTypeUserHandle]; [textPostLabel setAttributes:@{NSForegroundColorAttributeName : UIColor.greenColor} forLinkType:KILinkTypeHashtag]; [textPostLabel setAttributes:@{NSForegroundColorAttributeName : UIColor.greenColor} forLinkType:KILinkTypeURL]; - -// LMJWeakSelf(self); - - + textPostLabel.userHandleLinkTapHandler = ^(KILabel * _Nonnull label, NSString * _Nonnull string, NSRange range) { - NSLog(@"%@ %@ %@", label, string, NSStringFromRange(range)); - }; textPostLabel.hashtagLinkTapHandler = ^(KILabel * _Nonnull label, NSString * _Nonnull string, NSRange range) { - NSLog(@"%@ %@ %@", label, string, NSStringFromRange(range)); - }; textPostLabel.urlLinkTapHandler = ^(KILabel * _Nonnull label, NSString * _Nonnull string, NSRange range) { - NSLog(@"%@ %@ %@", label, string, NSStringFromRange(range)); // LMJWebViewController *webVc = [[LMJWebViewController alloc] init]; // webVc.gotoURL = string.copy; -// // [weakself.viewController.navigationController pushViewController:webVc animated:YES]; - }; - } return _retweetContentLabel; } @@ -139,26 +105,15 @@ - (SINStatusPicsView *)statusPicsView SINStatusPicsView *statusPicsView = [[SINStatusPicsView alloc] init]; [self addSubview:statusPicsView]; _statusPicsView = statusPicsView; - [statusPicsView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.retweetContentLabel.mas_bottom).offset(margin); make.left.mas_equalTo(self.retweetContentLabel.mas_left); - make.size.mas_equalTo(CGSizeMake(66, 66)); - }]; } return _statusPicsView; } - - - - - - - #pragma mark - base - (instancetype)initWithFrame:(CGRect)frame { @@ -174,8 +129,4 @@ - (void)awakeFromNib [self setupUIOnce]; } - - - - @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusToolBarView.xib" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusToolBarView.xib" index 66ef819d..6284c965 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusToolBarView.xib" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINStatusToolBarView.xib" @@ -1,11 +1,11 @@ - + - + diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINTabBar.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINTabBar.h" index d36a6e1a..33af7106 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINTabBar.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINTabBar.h" @@ -6,9 +6,6 @@ // Copyright © 2017年 GoMePrjk. All rights reserved. // -#import -#import - @interface SINTabBar : UITabBar /** <#digest#> */ diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINTabBar.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINTabBar.m" index b1f46ad7..1be2ad1e 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINTabBar.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINTabBar.m" @@ -21,21 +21,21 @@ - (void)layoutSubviews [super layoutSubviews]; CGFloat itemWidth = self.lmj_width / (self.items.count + 1); - - NSMutableArray *tabBarButtonMutableArray = [NSMutableArray array]; + __block CGFloat itemY = 0; + __block CGFloat itemheight = 0; [self.subviews enumerateObjectsUsingBlock:^(UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if ([obj isKindOfClass:NSClassFromString(@"UITabBarButton")]) { [tabBarButtonMutableArray addObject:obj]; obj.lmj_width = itemWidth; + itemY = obj.lmj_y; + itemheight = obj.lmj_height; } }]; - [tabBarButtonMutableArray enumerateObjectsUsingBlock:^(UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - obj.lmj_x = idx * itemWidth; if (idx > 1) { @@ -44,22 +44,17 @@ - (void)layoutSubviews if (idx == 2) { [self.publishBtn sizeToFit]; + self.publishBtn.lmj_size = CGSizeMake(itemWidth, itemheight); self.publishBtn.lmj_centerX = self.lmj_width * 0.5; - self.publishBtn.lmj_y = 5; - // self.publishBtn.lmj_size = CGSizeMake(itemWidth, itemWidth); + self.publishBtn.lmj_y = itemY; } - - }]; - [self bringSubviewToFront:self.publishBtn]; } -- (UIButton *)publishBtn -{ - if(_publishBtn == nil) - { +- (UIButton *)publishBtn { + if(_publishBtn == nil) { UIButton *btn = [[UIButton alloc] init]; [self addSubview:btn]; @@ -70,29 +65,14 @@ - (UIButton *)publishBtn [btn setBackgroundImage:[UIImage imageNamed:@"tabbar_compose_button"] forState:UIControlStateNormal]; [btn setBackgroundImage:[UIImage imageNamed:@"tabbar_compose_button_highlighted"] forState:UIControlStateHighlighted]; - LMJWeakSelf(self); - LMJWeakSelf(btn); + LMJWeak(self); + LMJWeak(btn); [btn addActionHandler:^(NSInteger tag) { - !weakself.publishBtnClick ?: weakself.publishBtnClick(weakself, weakbtn); }]; - } return _publishBtn; } -//- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event -//{ -// -// if ([self pointInside:point withEvent:event] && CGRectContainsPoint(self.publishBtn.frame, point)) { -// -// return self.publishBtn; -// -// } -// -// return [super hitTest:point withEvent:event]; -// -// -//} @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINUnLoginRegisterView.h" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINUnLoginRegisterView.h" index 86406a38..dfe3539a 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINUnLoginRegisterView.h" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINUnLoginRegisterView.h" @@ -21,6 +21,6 @@ typedef enum : NSUInteger { @interface SINUnLoginRegisterView : UIView -+ (instancetype)unLoginRegisterViewWithType:(SINUnLoginRegisterViewType)type registClick:(void(^)())registClick loginClick:(void(^)())loginClick; ++ (instancetype)unLoginRegisterViewWithType:(SINUnLoginRegisterViewType)type registClick:(void(^)(void))registClick loginClick:(void(^)(void))loginClick; @end diff --git "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINUnLoginRegisterView.m" "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINUnLoginRegisterView.m" index d2983ce2..158394fc 100644 --- "a/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINUnLoginRegisterView.m" +++ "b/iOSProject/iOSProject/Classes/\346\226\260\346\265\252\345\276\256\345\215\232/View/SINUnLoginRegisterView.m" @@ -11,10 +11,10 @@ @interface SINUnLoginRegisterView () /** <#digest#> */ -@property (nonatomic, copy) void(^registClick)(); +@property (nonatomic, copy) void(^registClick)(void); /** <#digest#> */ -@property (nonatomic, copy) void(^loginClick)(); +@property (nonatomic, copy) void(^loginClick)(void); /** <#digest#> */ @property (assign, nonatomic) SINUnLoginRegisterViewType type; @@ -37,15 +37,12 @@ @interface SINUnLoginRegisterView () @implementation SINUnLoginRegisterView -+ (instancetype)unLoginRegisterViewWithType:(SINUnLoginRegisterViewType)type registClick:(void (^)())registClick loginClick:(void (^)())loginClick ++ (instancetype)unLoginRegisterViewWithType:(SINUnLoginRegisterViewType)type registClick:(void (^)(void))registClick loginClick:(void (^)(void))loginClick { SINUnLoginRegisterView *unLoginRegisterView = [[SINUnLoginRegisterView alloc] init]; - unLoginRegisterView.registClick = registClick; unLoginRegisterView.loginClick = loginClick; unLoginRegisterView.type = type; - - return unLoginRegisterView; } @@ -66,52 +63,36 @@ - (void)awakeFromNib - (void)setupUIOnce { [self.caCycleImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.offset(0); make.centerY.offset(-100); make.size.mas_equalTo(CGSizeMake(200, 200)); }]; [self.coverImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self.caCycleImageView); make.top.mas_equalTo(self.caCycleImageView).offset(-30); make.bottom.mas_equalTo(self.caCycleImageView).offset(0); }]; [self.slognImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.mas_equalTo(self.caCycleImageView); - }]; [self.encourageLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.coverImageView.mas_bottom).offset(20); make.left.mas_equalTo(self.coverImageView).offset(-30); make.right.mas_equalTo(self.coverImageView).offset(30); - }]; NSArray *btns = @[self.registerButton, self.loginButton]; [btns mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedSpacing:30 leadSpacing:30 tailSpacing:30]; [btns mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.encourageLabel.mas_bottom).offset(20); make.height.mas_equalTo(44); - }]; - - } -- (void)layoutSubviews -{ - [super layoutSubviews]; - - -} - (void)login:(UIButton *)btn { @@ -130,7 +111,6 @@ - (void)setType:(SINUnLoginRegisterViewType)type switch (type) { case SINUnLoginRegisterViewTypeHomePage: { - } break; case SINUnLoginRegisterViewTypeMsgPage: @@ -144,11 +124,9 @@ - (void)setType:(SINUnLoginRegisterViewType)type { self.coverImageView.hidden = YES; self.caCycleImageView.hidden = YES; - self.slognImageView.image = [UIImage imageNamed:@"visitordiscover_image_profile"]; } break; - } } @@ -161,19 +139,14 @@ - (UIImageView *)caCycleImageView { UIImageView *caCycleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"visitordiscover_feed_image_smallicon"]]; [self addSubview:caCycleImageView]; - _caCycleImageView = caCycleImageView; - CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; animation.duration = 5; animation.removedOnCompletion = NO; animation.repeatCount = INFINITY; animation.fromValue = @0; animation.toValue = @(M_PI * 2); - - [caCycleImageView.layer addAnimation:animation forKey:nil]; - } return _caCycleImageView; } diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Controller/MCTestViewController.h" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Controller/MCTestViewController.h" new file mode 100644 index 00000000..d15ce7c4 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Controller/MCTestViewController.h" @@ -0,0 +1,13 @@ +// +// MCTestViewController.h +// iOSProject +// +// Created by HuXuPeng on 2018/5/3. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "LMJStaticTableViewController.h" + +@interface MCTestViewController : LMJStaticTableViewController + +@end diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Controller/MCTestViewController.m" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Controller/MCTestViewController.m" new file mode 100644 index 00000000..4eef4aba --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Controller/MCTestViewController.m" @@ -0,0 +1,136 @@ +// +// MCTestViewController.m +// iOSProject +// +// Created by HuXuPeng on 2018/5/3. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "MCTestViewController.h" +#import +#import +#import +#import +#import "MCStudent+CoreDataClass.h" +#import "MCStudent+CoreDataProperties.h" +@interface MCTestViewController () + +@end + +@implementation MCTestViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + LMJWeak(self); + self.addItem([LMJWordItem itemWithTitle:@"保存图片" subTitle:@"image write" itemOperation:^(NSIndexPath *indexPath) { + + UIGraphicsBeginImageContextWithOptions(CGSizeMake(100, 100), NO, 0); + + CGContextRef contextRef = UIGraphicsGetCurrentContext(); + UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; + redView.backgroundColor = [UIColor RandomColor]; + redView.layer.cornerRadius = 50; + redView.layer.masksToBounds = YES; + [redView.layer renderInContext:contextRef]; + UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + // jpeg + UIImageWriteToSavedPhotosAlbum(newImage, weakself, @selector(image:didFinishSavingWithError:contextInfo:), nil); + + NSLog(@"%zd", [NSData sd_imageFormatForImageData:UIImageJPEGRepresentation(newImage, 1)]); + }]) + .addItem([LMJWordItem itemWithTitle:@"保存图片" subTitle:@"data write" itemOperation:^(NSIndexPath *indexPath) { + + UIGraphicsBeginImageContextWithOptions(CGSizeMake(100, 100), NO, 0); + CGContextRef contextRef = UIGraphicsGetCurrentContext(); + UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; + redView.backgroundColor = [UIColor RandomColor]; + redView.layer.cornerRadius = 50; + redView.layer.masksToBounds = YES; + [redView.layer renderInContext:contextRef]; + UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + // png + NSLog(@"%zd", [NSData sd_imageFormatForImageData:UIImagePNGRepresentation(newImage)]); + }]) + .addItem([LMJWordItem itemWithTitle:@"url" subTitle:nil itemOperation:^(NSIndexPath *indexPath) { + +// 常见的错误是在get参数添加中文,但是没有重新编码(也叫转义),导致NSURL初始化失败 +// 正确的做法是调用NSString的(NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)encoding方法。 +// [gotoURL stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "] invertedSet]] + + NSString *path = @"https://www.baidu.com/"; + NSString *path2 = @"http://fanyi.baidu.com/translate?query=#auto/zh/"; + NSString *path3 = @"http://fanyi.baidu.com/translate?query=#zh/en/%E6%B5%8B%E8%AF%95"; + NSURL *url = [NSURL URLWithString:path]; + NSURL *url2 = [NSURL URLWithString:path2]; + NSURL *url3 = [NSURL URLWithString:[path3 stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "] invertedSet]]]; + NSLog(@"url = %@", url); + NSLog(@"url2 = %@", url2); + NSLog(@"url3 = %@", url3); + + }]) + .addItem([LMJWordItem itemWithTitle:@"log" subTitle:nil itemOperation:^(NSIndexPath *indexPath) { + + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + NSLog(@"before perform"); + // 1. +// [weakself performSelector:@selector(printLog) withObject:nil]; + //2. + { + [weakself performSelector:@selector(printLog) withObject:nil afterDelay:0]; + [[NSRunLoop currentRunLoop] run]; + } + + //1、GCD默认的全局并发队列,在并发执行任务的时候,会从线程池获取可执行任务的线程(如果没有就阻塞)。 + +// 2、performSelector的原理是设置一个timer到当前线程Runloop,并且是NSDefaultRunLoopMode; + +// 3、非主线程的runloop默认是不启用; + NSLog(@"after perform"); + }); + }]) + .addItem([LMJWordItem itemWithTitle:@"coreData" subTitle:@"增加" itemOperation:^(NSIndexPath *indexPath) { + + + }]).addItem([LMJWordItem itemWithTitle:@"coreData" subTitle:@"删除" itemOperation:^(NSIndexPath *indexPath) { + + + }]) + .addItem([LMJWordItem itemWithTitle:@"coreData" subTitle:@"改" itemOperation:^(NSIndexPath *indexPath) { + + + }]) + .addItem([LMJWordItem itemWithTitle:@"coreData" subTitle:@"查询" itemOperation:^(NSIndexPath *indexPath) { + + + }]); +} +- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { + +} + +- (void)printLog { + NSLog(@"printLog"); +} + +#pragma mark - LMJNavUIBaseViewControllerDataSource + +/** 导航条左边的按钮 */ +- (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar +{ + [leftButton setImage:[UIImage imageNamed:@"NavgationBar_white_back"] forState:UIControlStateHighlighted]; + + return [UIImage imageNamed:@"NavgationBar_blue_back"]; +} + +#pragma mark - LMJNavUIBaseViewControllerDelegate +/** 左边的按钮的点击 */ +-(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar +{ + [self.navigationController popViewControllerAnimated:YES]; +} + +@end diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCCoreDataManager.h" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCCoreDataManager.h" new file mode 100644 index 00000000..29bffb7d --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCCoreDataManager.h" @@ -0,0 +1,27 @@ +// +// MCCoreDataManager.h +// iOSProject +// +// Created by HuXuPeng on 2018/5/3. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import +#import + +@interface MCCoreDataManager : NSObject + +///管理对象上下文 +@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext; + +///管理对象模型 +@property (nonatomic, strong) NSManagedObjectModel *managedObjectModel; + +///持久化存储调度器 +@property (nonatomic, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator; + ++ (instancetype)sharedInstance; +- (void)saveContext; + + +@end diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCCoreDataManager.m" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCCoreDataManager.m" new file mode 100644 index 00000000..00dfb3ea --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCCoreDataManager.m" @@ -0,0 +1,82 @@ +// +// MCCoreDataManager.m +// iOSProject +// +// Created by HuXuPeng on 2018/5/3. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "MCCoreDataManager.h" + +@implementation MCCoreDataManager +- (NSManagedObjectContext *)managedObjectContext{ + + if (_managedObjectContext != nil) { + return _managedObjectContext; + } + + //实例化 + //ConcurrencyType:并发(性) + _managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; + + //指定上下文所属的存储调度器 + _managedObjectContext.persistentStoreCoordinator = self.persistentStoreCoordinator; + + return _managedObjectContext; +} + +- (NSManagedObjectModel *)managedObjectModel{ + + + if (_managedObjectModel != nil) { + return _managedObjectModel; + } + + //获取模型描述文件URL, .xcdatamodeld文件编译后在bundle里生成.momd文件 + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Model" withExtension:@"momd"]; + + //实例化 - 指定模型描述文件 + _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; + + + return _managedObjectModel; + +} + +- (NSPersistentStoreCoordinator *)persistentStoreCoordinator{ + + if (_persistentStoreCoordinator != nil) { + return _persistentStoreCoordinator; + } + + //实例化 - 指定管理对象模型 + _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel]; + + //添加存储器 + //Type:存储类型, 数据库/XML/二进制/内存 + //configuration:不需要额外配置,可以为nil + //URL:数据保存的文件的URL 这里我们放到documents里 + //options:可以为空 + + NSURL *fileURL = [NSURL fileURLWithPath: [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject stringByAppendingPathComponent:@"mydata.db"]]; + + [_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:fileURL options:nil error:nil]; + + + return _persistentStoreCoordinator; +} + +- (void)saveContext { + +} + +static id _instance = nil; ++ (instancetype)sharedInstance { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _instance = [[self alloc] init]; + }); + return _instance; +} + +@end diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataClass.h" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataClass.h" new file mode 100644 index 00000000..c724ff09 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataClass.h" @@ -0,0 +1,20 @@ +// +// MCStudent+CoreDataClass.h +// +// +// Created by HuXuPeng on 2018/5/3. +// +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MCStudent : NSManagedObject + +@end + +NS_ASSUME_NONNULL_END + +#import "MCStudent+CoreDataProperties.h" diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataClass.m" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataClass.m" new file mode 100644 index 00000000..d354e50a --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataClass.m" @@ -0,0 +1,13 @@ +// +// MCStudent+CoreDataClass.m +// +// +// Created by HuXuPeng on 2018/5/3. +// +// + +#import "MCStudent+CoreDataClass.h" + +@implementation MCStudent + +@end diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataProperties.h" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataProperties.h" new file mode 100644 index 00000000..4e00b0ba --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataProperties.h" @@ -0,0 +1,24 @@ +// +// MCStudent+CoreDataProperties.h +// +// +// Created by HuXuPeng on 2018/5/3. +// +// + +#import "MCStudent+CoreDataClass.h" + + +NS_ASSUME_NONNULL_BEGIN + +@interface MCStudent (CoreDataProperties) + ++ (NSFetchRequest *)fetchRequest; + +@property (nonatomic) int64_t age; +@property (nullable, nonatomic, copy) NSString *name; +@property (nonatomic) float height; + +@end + +NS_ASSUME_NONNULL_END diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataProperties.m" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataProperties.m" new file mode 100644 index 00000000..0990d8ab --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCStudent+CoreDataProperties.m" @@ -0,0 +1,21 @@ +// +// MCStudent+CoreDataProperties.m +// +// +// Created by HuXuPeng on 2018/5/3. +// +// + +#import "MCStudent+CoreDataProperties.h" + +@implementation MCStudent (CoreDataProperties) + ++ (NSFetchRequest *)fetchRequest { + return [[NSFetchRequest alloc] initWithEntityName:@"MCStudent"]; +} + +@dynamic age; +@dynamic name; +@dynamic height; + +@end diff --git "a/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCTestDataModel.xcdatamodeld/MCTestDataModel.xcdatamodel/contents" "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCTestDataModel.xcdatamodeld/MCTestDataModel.xcdatamodel/contents" new file mode 100644 index 00000000..b39f3262 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\346\233\264\345\244\232\346\241\210\344\276\2131/Model/MCTestDataModel.xcdatamodeld/MCTestDataModel.xcdatamodel/contents" @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAAnimationGroupViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAAnimationGroupViewController.m" index 353c4f15..926a972a 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAAnimationGroupViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAAnimationGroupViewController.m" @@ -32,7 +32,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event CABasicAnimation *rotation = [CABasicAnimation animation]; rotation.keyPath = @"transform.rotation"; rotation.toValue = @(arc4random_uniform(M_PI)); - + CABasicAnimation *position = [CABasicAnimation animation]; position.keyPath = @"position"; position.toValue = [NSValue valueWithCGPoint:CGPointMake(arc4random_uniform(200), arc4random_uniform(200))]; @@ -40,8 +40,6 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event group.animations = @[scale,rotation,position]; [self.redView.layer addAnimation:group forKey:nil]; - - } @end diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCABasicAnimationViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCABasicAnimationViewController.m" index cd0c8785..a8de4fa8 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCABasicAnimationViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCABasicAnimationViewController.m" @@ -16,28 +16,31 @@ @implementation LMJCABasicAnimationViewController - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view. } +/* + https://www.jianshu.com/p/02c341c748f9 + https://blog.csdn.net/chenyongkai1/article/details/75307674 + */ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // 创建动画 CABasicAnimation *anim = [CABasicAnimation animation]; - - anim.delegate = self; + LMJWeak(self); + anim.delegate = weakself; // 描述下修改哪个属性产生动画 - // anim.keyPath = @"position"; + // anim.keyPath = @"position"; // 只能是layer属性 anim.keyPath = @"transform.scale"; - + // 设置值 - // anim.toValue = [NSValue valueWithCGPoint:CGPointMake(250, 500)]; + //anim.toValue = [NSValue valueWithCGPoint:CGPointMake(250, 500)]; anim.toValue = @0.5; // 设置动画执行次数 - anim.repeatCount = 2; + anim.repeatCount = 10; // 取消动画反弹 // 设置动画完成的时候不要移除动画 @@ -46,9 +49,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event // 设置动画执行完成要保持最新的效果 anim.fillMode = kCAFillModeForwards; - [self.redView.layer addAnimation:anim forKey:nil]; - } - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag @@ -56,6 +57,8 @@ - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag [UIAlertController mj_showAlertWithTitle:@"frame" message:NSStringFromCGRect(self.redView.frame) appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { alertMaker.addActionDefaultTitle(@"确认"); } actionsBlock:nil]; +// 补充:注意一下CABasicAnimation的delegate是strong属性,容易导致循环引用而不能将内存释放 +// anim.delegate = nil; } @end diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAClockViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAClockViewController.m" index fa0aeac3..2b107bc1 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAClockViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAClockViewController.m" @@ -10,7 +10,9 @@ @interface LMJCAClockViewController () -/** <#digest#> */ +/** timer */ +@property (weak, nonatomic) NSTimer *timer; + @property (strong, nonatomic) UIImageView *clockImageView; @property (nonatomic, weak) CALayer *secondLayer; @@ -29,7 +31,6 @@ @interface LMJCAClockViewController () // 一分钟分针转6° #define perMinuteA 6 - // 一小时时针转30° #define perHourA 30 @@ -60,10 +61,14 @@ - (void)viewDidLoad { [self setUpSecondLayer]; // 添加定时器 - [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeChange) userInfo:nil repeats:YES]; - + NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeChange) userInfo:nil repeats:YES]; + _timer = timer; [self timeChange]; - +} + +- (void)dealloc { + [_timer invalidate]; + _timer = nil; } #pragma mark - 添加秒针 @@ -80,7 +85,7 @@ - (void)setUpSecondLayer secondL.bounds = CGRectMake(0, 0, 1, kClockW * 0.5 - 20); - + secondL.cornerRadius = 0; [_clockImageView.layer addSublayer:secondL]; @@ -102,7 +107,7 @@ - (void)setUpMinuteLayer layer.bounds = CGRectMake(0, 0, 4, kClockW * 0.5 - 20); - layer.cornerRadius = 4; + layer.cornerRadius = 2; [_clockImageView.layer addSublayer:layer]; diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAKeyFrameAnimationViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAKeyFrameAnimationViewController.m" index 57c2621b..cf4acc80 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAKeyFrameAnimationViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCAKeyFrameAnimationViewController.m" @@ -8,35 +8,21 @@ #import "LMJCAKeyFrameAnimationViewController.h" -@interface LMJCAKeyFrameAnimationViewController () - - -@end - @implementation LMJCAKeyFrameAnimationViewController - (void)loadView { self.view = [[DrawView alloc] init]; - -// self.title = @"手指移动画线"; - [MBProgressHUD showAutoMessage:@"手指移动画线"]; } - (void)viewDidLoad { [super viewDidLoad]; - + [MBProgressHUD showAutoMessage:@"手指移动画线"]; + self.blueLayer.bounds = CGRectMake(0, 0, 50, 50); } - - @end - - - - - @interface DrawView () @property (nonatomic, strong) UIBezierPath *path; @@ -77,22 +63,25 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + static BOOL isValue; // 给imageView添加核心动画 // 添加核心动画 - CAKeyframeAnimation *anim = [CAKeyframeAnimation animation]; - anim.keyPath = @"position"; - - // anim.values = @[@(angle2Radion(-10)),@(angle2Radion(10)),@(angle2Radion(-10))]; - - anim.path = _path.CGPath; - - anim.duration = 1; - + // values + + if (isValue) { + anim.values = @[@(100),@(-100),@(100)]; + isValue = NO; + }else { + // path + anim.path = _path.CGPath; + isValue = YES; + } + + anim.duration = 3; anim.repeatCount = MAXFLOAT; - [[(LMJCAKeyFrameAnimationViewController *)self.viewController blueLayer] addAnimation:anim forKey:nil]; } diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerBaseViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerBaseViewController.m" index 89d44af9..9c32c26d 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerBaseViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerBaseViewController.m" @@ -19,48 +19,43 @@ - (void)viewDidLoad { // 设置阴影 // Opacity:不透明度 - self.redView.layer.shadowOpacity = 1; - // _redView.layer.shadowOffset = CGSizeMake(10, 10); + self.redView.layer.shadowOpacity = 0.6; + self.redView.layer.shadowOffset = CGSizeMake(3, 3); + // 注意:图层的颜色都是核心绘图框架,通常。CGColor - self.redView.layer.shadowColor = [UIColor yellowColor].CGColor; + self.redView.layer.shadowColor = [UIColor RandomColor].CGColor; self.redView.layer.shadowRadius = 10; - // 圆角半径 self.redView.layer.cornerRadius = 50; // 边框 - self.redView.layer.borderWidth = 1; - self.redView.layer.borderColor = [UIColor whiteColor].CGColor; - - + self.redView.layer.borderWidth = 2; + self.redView.layer.borderColor = [UIColor RandomColor].CGColor; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // 图层形变 - // 缩放 [UIView animateWithDuration:1 animations:^{ - self.redView.layer.transform = CATransform3DMakeRotation(M_PI, 1, 1, 0); - self.redView.layer.transform = CATransform3DMakeScale(0.5, 0.5, 1); + // self.redView.layer.transform = CATransform3DMakeRotation(M_PI, 1, 1, 0); + // self.redView.layer.transform = CATransform3DMakeScale(0.5, 0.5, 1); + + CATransform3D transform = CATransform3DMakeRotation(M_PI, 1, 1, 0); + + // 叠加 + self.redView.layer.transform = CATransform3DScale(transform, 0.5, 0.5, 1); // 快速进行图层缩放,KVC // x,y同时缩放0.5 -// [self.redView.layer setValue:@0.5 forKeyPath:@"transform.scale"]; -// -// [self.redView.layer setValue:@(M_PI) forKeyPath:@"transform.rotation"]; - + // [self.redView.layer setValue:@0.5 forKeyPath:@"transform.scale"]; + // [self.redView.layer setValue:@(M_PI) forKeyPath:@"transform.rotation"]; + } completion:^(BOOL finished) { + self.redView.layer.transform = CATransform3DIdentity; }]; - } - - - - - - @end diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerViewController.m" index 0db5d331..d6981e96 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerViewController.m" @@ -16,7 +16,6 @@ @implementation LMJCALayerViewController - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view. self.fd_interactivePopDisabled = YES; [self.view makeToast:@"点击屏幕" duration:3 position:CSToastPositionCenter]; } @@ -25,7 +24,7 @@ - (UIView *)redView { if(!_redView) { - UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(10, 100, 100, 250)]; + UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(50, 100, 150, 200)]; [self.view addSubview:redView]; _redView = redView; redView.backgroundColor = [UIColor redColor]; @@ -41,8 +40,7 @@ - (CALayer *)blueLayer [self.view.layer addSublayer:blueLayer]; blueLayer.backgroundColor = [UIColor blueColor].CGColor; _blueLayer = blueLayer; - - blueLayer.frame = CGRectMake(150, 100, 100, 60); + blueLayer.frame = CGRectMake(50, 350, 100, 70); } return _blueLayer; diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerYSDHViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerYSDHViewController.m" index 9a1f0e1f..ad66de26 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerYSDHViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCALayerYSDHViewController.m" @@ -10,50 +10,33 @@ #define angle2radion(angle) ((angle) / 180.0 * M_PI) -@interface LMJCALayerYSDHViewController () -/** <#digest#> */ -@property (nonatomic, strong) CALayer *layer; -@end - @implementation LMJCALayerYSDHViewController - (void)viewDidLoad { [super viewDidLoad]; - CALayer *layer = [CALayer layer]; - - layer.position = CGPointMake(200, 150); - - layer.anchorPoint = CGPointZero; - - layer.bounds = CGRectMake(0, 0, 80, 80); + self.blueLayer.position = CGPointMake(200, 150); - layer.backgroundColor = [UIColor greenColor].CGColor; + self.blueLayer.anchorPoint = CGPointZero; - [self.view.layer addSublayer:layer]; + self.blueLayer.bounds = CGRectMake(0, 0, 80, 80); - _layer = layer; + self.blueLayer.backgroundColor = [UIColor greenColor].CGColor; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // 旋转 - // 1 ~ 360 - - self.layer.transform = CATransform3DMakeRotation(angle2radion(arc4random_uniform(360) + 1), 0, 0, 1); - - self.layer.position = CGPointMake(arc4random_uniform(200) + 20, arc4random_uniform(400) + 50); - - self.layer.cornerRadius = arc4random_uniform(50); - - self.layer.backgroundColor = [UIColor RandomColor].CGColor; - - self.layer.borderWidth = arc4random_uniform(10); - self.layer.borderColor = [UIColor RandomColor].CGColor; + self.blueLayer.transform = CATransform3DMakeRotation(angle2radion(arc4random_uniform(360) + 1), 0, 0, 1); + self.blueLayer.position = CGPointMake(arc4random_uniform(200) + 20, arc4random_uniform(400) + 50); + self.blueLayer.cornerRadius = arc4random_uniform(50); + self.blueLayer.backgroundColor = [UIColor RandomColor].CGColor; + self.blueLayer.borderWidth = arc4random_uniform(10); + self.blueLayer.borderColor = [UIColor RandomColor].CGColor; - [UIAlertController mj_showAlertWithTitle:@"隐式动画的frame " message:[NSString stringWithFormat:@"self.redView.frame = %@", NSStringFromCGRect(self.layer.frame)] appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + [UIAlertController mj_showAlertWithTitle:@"隐式动画的frame " message:[NSString stringWithFormat:@"self.redView.frame = %@", NSStringFromCGRect(self.blueLayer.frame)] appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { alertMaker.addActionDefaultTitle(@"确认"); diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCATransitionViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCATransitionViewController.m" index 0bf2bbd2..51e2ba19 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCATransitionViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJCATransitionViewController.m" @@ -19,20 +19,18 @@ @implementation LMJCATransitionViewController - (void)viewDidLoad { [super viewDidLoad]; - } -static int i = 2; - - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + static int i = 2; // 转场代码 if (i == 4) { i = 1; } // 加载图片名称 - NSString *imageN = [NSString stringWithFormat:@"CATransition%d",i]; + NSString *imageN = [NSString stringWithFormat:@"CATransition%d.png",i]; self.imageView.image = [UIImage imageNamed:imageN]; diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJDYViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJDYViewController.m" index 27c672f6..9664ca58 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJDYViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJDYViewController.m" @@ -17,16 +17,14 @@ @implementation LMJDYViewController - (void)viewDidLoad { [super viewDidLoad]; - CAReplicatorLayer *layer = (CAReplicatorLayer *)_repView.layer; + CAReplicatorLayer *layer = (CAReplicatorLayer *)_repView.layer; layer.instanceCount = 2; - CATransform3D transform = CATransform3DMakeTranslation(0, _repView.bounds.size.height, 0); // 绕着X轴旋转 transform = CATransform3DRotate(transform, M_PI, 1, 0, 0); - // 往下面平移控件的高度 layer.instanceTransform = transform; diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJDYViewController.xib" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJDYViewController.xib" index 617f6ef6..1c679d10 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJDYViewController.xib" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJDYViewController.xib" @@ -1,11 +1,11 @@ - + - + @@ -20,19 +20,29 @@ - - - + + - + - + + + + + + + + + + + + diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJHDZSQViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJHDZSQViewController.m" index 5afc6390..fb7726fa 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJHDZSQViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJHDZSQViewController.m" @@ -20,7 +20,6 @@ - (void)viewDidLoad { self.redView.backgroundColor = [UIColor grayColor]; - CAReplicatorLayer *repL = [CAReplicatorLayer layer]; repL.frame = self.redView.bounds; @@ -69,7 +68,6 @@ - (void)viewDidLoad { repL.instanceTransform = CATransform3DMakeRotation(angle, 0, 0, 1); repL.instanceDelay = duration / count; - } @end diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJLZDHDTSViewController.m" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJLZDHDTSViewController.m" index 286044cb..0d5cd3c8 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJLZDHDTSViewController.m" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJLZDHDTSViewController.m" @@ -18,7 +18,6 @@ - (void)viewDidLoad { [super viewDidLoad]; self.fd_interactivePopDisabled = YES; -// self.title = @"手指移动画线"; [MBProgressHUD showAutoMessage:@"手指移动画线"]; } @@ -32,7 +31,6 @@ - (IBAction)startAni:(UIButton *)sender { } - - (IBAction)reDraw:(UIButton *)sender { LZDHDTSDrawView *view = (LZDHDTSDrawView *)self.view; @@ -43,11 +41,6 @@ - (IBAction)reDraw:(UIButton *)sender { - - - - - @interface LZDHDTSDrawView () @property (nonatomic, strong) UIBezierPath *path; @@ -102,9 +95,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event // 设置起点 [self.path moveToPoint:curP]; - - - + } static int _instansCount = 0; @@ -123,7 +114,6 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event [self setNeedsDisplay]; _instansCount ++; - } @@ -158,7 +148,6 @@ - (void)startAnim // 延迟图层动画 _repL.instanceDelay = 0.2; - } #pragma mark - 加载完xib调用,创建复制层 diff --git "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJLZDHDTSViewController.xib" "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJLZDHDTSViewController.xib" index a71d09bd..e99bfef4 100644 --- "a/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJLZDHDTSViewController.xib" +++ "b/iOSProject/iOSProject/Classes/\346\240\270\345\277\203\345\212\250\347\224\273/CoreAnimationControllers/LMJLZDHDTSViewController.xib" @@ -1,11 +1,11 @@ - + - + @@ -22,6 +22,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/NJPlayer/NJVideoPlayViewController.h" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/NJPlayer/NJVideoPlayViewController.h" deleted file mode 100644 index c5ae77e2..00000000 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/NJPlayer/NJVideoPlayViewController.h" +++ /dev/null @@ -1,17 +0,0 @@ -// -// NJVideoPlayViewController.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/21. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import - -@interface NJVideoPlayViewController : UIViewController - - -/** <#digest#> */ -@property (nonatomic, copy) NSString *videoUrl; - -@end diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/NJPlayer/NJVideoPlayViewController.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/NJPlayer/NJVideoPlayViewController.m" deleted file mode 100644 index c0b720b3..00000000 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/NJPlayer/NJVideoPlayViewController.m" +++ /dev/null @@ -1,84 +0,0 @@ -// -// NJVideoPlayViewController.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/21. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "NJVideoPlayViewController.h" -#import "NJPlayerView.h" - -@interface NJVideoPlayViewController () -@property (nonatomic, weak) NJPlayerView *playerView; - -@end - -@implementation NJVideoPlayViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.view.backgroundColor = [UIColor redColor]; - - [UIApplication sharedApplication].statusBarHidden = YES; -} - -- (void)viewDidDisappear:(BOOL)animated -{ - [super viewDidDisappear:animated]; - - [UIApplication sharedApplication].statusBarHidden = NO; -} - - - -- (void)dismissClick -{ - [self dismissViewControllerAnimated:NO completion:nil]; - -} - - -- (void)viewDidLayoutSubviews -{ - [super viewDidLayoutSubviews]; - - self.playerView.frame = self.view.bounds; -} - - -- (void)setVideoUrl:(NSString *)videoUrl -{ - if (!videoUrl.length) { - return; - } - - _videoUrl = videoUrl.copy; - - NSURL *url = [NSURL URLWithString:_videoUrl]; - AVPlayerItem *item = [AVPlayerItem playerItemWithURL:url]; - self.playerView.playerItem = item; -} - -- (NJPlayerView *)playerView -{ - if(_playerView == nil) - { - NJPlayerView *playerView = [NJPlayerView playerView]; - playerView.delegate = self; - [self.view addSubview:playerView]; - _playerView = playerView; - - } - return _playerView; -} - - -#pragma mark - NJPlayerViewDelegate -- (void)playerViewDidClickFullScreen:(BOOL)isFull -{ - [self dismissClick]; -} - -@end diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/BSJSQLiteManager.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/BSJSQLiteManager.m" index 2aa0b830..17261b91 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/BSJSQLiteManager.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/BSJSQLiteManager.m" @@ -38,7 +38,6 @@ - (void)queryArrayOfDicts:(NSString *)sql completion:(void(^)(NSMutableArray *dictArrayM))completion; - - + (void)cachesTopicList:(NSMutableArray *)topics areaType:(NSString *)areaType; - - + (void)clearOutTimeCashes; @end diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/BSJTopicListDAL.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/BSJTopicListDAL.m" index 9ae731e6..f1a56353 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/BSJTopicListDAL.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/BSJTopicListDAL.m" @@ -82,7 +82,7 @@ time TEXT NOT NULL DEFAULT (datetime('now', 'localtime'))\n\ } - NSLog(@"向数据库新增%zd条数据", db.changes); + NSLog(@"向数据库新增%d条数据", db.changes); }]; @@ -94,7 +94,7 @@ time TEXT NOT NULL DEFAULT (datetime('now', 'localtime'))\n\ } -+ (void)queryTopicListFromDiskWithAreaType:(NSString *)areaType topicType:(NSString *)topicType maxTime:(NSString *)maxTime per:(NSInteger)per completion:(void(^)(NSMutableArray *dictArrayM))completion; ++ (void)queryTopicListFromDiskWithAreaType:(NSString *)areaType topicType:(NSString *)topicType maxTime:(NSString *)maxTime per:(NSInteger)per completion:(void(^)(NSMutableArray *dictArrayM))completion { NSString *tableName = nil; @@ -124,7 +124,7 @@ time TEXT NOT NULL DEFAULT (datetime('now', 'localtime'))\n\ // parameters[@"maxtime"] = isMore ? self.maxtime : nil; // parameters[@"per"] = @10; - if (!maxTime && [LMJRequestManager sharedManager].reachabilityManager.networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable) { + if (!maxTime && (LMJRequestManager.sharedManager.reachabilityManager.networkReachabilityStatus == AFNetworkReachabilityStatusUnknown || LMJRequestManager.sharedManager.reachabilityManager.networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)) { if ([topicType isEqualToString:@"1"]) { sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY t DESC LIMIT %@", tableName, count]; @@ -132,6 +132,7 @@ time TEXT NOT NULL DEFAULT (datetime('now', 'localtime'))\n\ { sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE type = %@ ORDER BY t DESC LIMIT %@", tableName, topicType, count]; } + }else if (maxTime) { if ([topicType isEqualToString:@"1"]) { @@ -154,7 +155,7 @@ time TEXT NOT NULL DEFAULT (datetime('now', 'localtime'))\n\ @try { - NSDictionary *topicDict = [NSJSONSerialization JSONObjectWithData:topicData options:NSJSONReadingMutableLeaves error:nil]; + NSDictionary *topicDict = [NSJSONSerialization JSONObjectWithData:topicData options:NSJSONReadingMutableContainers error:nil]; [dictArrayM_new addObject:[NSMutableDictionary dictionaryWithDictionary:topicDict]]; @@ -188,7 +189,7 @@ + (void)clearOutTimeCashes BOOL isSucceed = [db executeUpdate:sql withArgumentsInArray:@[]]; if (isSucceed) { - NSLog(@"%zd 删除数据成功", db.changes); + NSLog(@"%d 删除数据成功", db.changes); *rollback = NO; }else { @@ -204,7 +205,7 @@ + (void)clearOutTimeCashes BOOL isSucceed = [db executeUpdate:newsql withArgumentsInArray:@[]]; if (isSucceed) { - NSLog(@"%zd 删除数据成功", db.changes); + NSLog(@"%d 删除数据成功", db.changes); *rollback = NO; }else { diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/MenuPopOverView.h" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/MenuPopOverView.h" deleted file mode 100755 index abb18e10..00000000 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/MenuPopOverView.h" +++ /dev/null @@ -1,36 +0,0 @@ -// -// MenuPopOverView.h -// SearchBar -// -// Created by Camel Yang on 4/1/14. -// Copyright (c) 2014 camelcc. All rights reserved. -// - -#import - -@class MenuPopOverView; - -@protocol MenuPopOverViewDelegate -@optional -- (void)popoverView:(MenuPopOverView *)popoverView didSelectItemAtIndex:(NSInteger)index; -- (void)popoverViewDidDismiss:(MenuPopOverView *)popoverView; - -@end - -@interface MenuPopOverView : UIView - -@property (nonatomic, copy) UIColor *popOverBackgroundColor; -@property (nonatomic, copy) UIColor *popOverHighlightedColor; -@property (nonatomic, copy) UIColor *popOverSelectedColor; -@property (nonatomic, copy) UIColor *popOverDividerColor; -@property (nonatomic, copy) UIColor *popOverBorderColor; -@property (nonatomic, copy) UIColor *popOverTextColor; -@property (nonatomic, copy) UIColor *popOverHighlightedTextColor; -@property (nonatomic, copy) UIColor *popOverSelectedTextColor; - -@property (weak, nonatomic) id delegate; - -- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view withStrings:(NSArray *)stringArray; -- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view withStrings:(NSArray *)stringArray selectedIndex:(NSInteger)selectedIndex; - -@end diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/MenuPopOverView.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/MenuPopOverView.m" deleted file mode 100755 index da57416a..00000000 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Other/MenuPopOverView.m" +++ /dev/null @@ -1,732 +0,0 @@ -// -// MenuPopOverView.m -// SearchBar -// -// Created by Camel Yang on 4/1/14. -// Copyright (c) 2014 camelcc. All rights reserved. -// - -#import "MenuPopOverView.h" - -// Geometry metrics -#define kPopOverViewPadding 20.f -#define kPopOverViewHeight 44.f -#define kPopOverCornerRadius 8.f -#define kButtonHeight 53.5f -#define kLeftButtonWidth 30.f -#define kRightButtonWidth 30.f -#define kArrowHeight 9.5f -#define kTextFont [UIFont systemFontOfSize:14] -#define kTextEdgeInsets 10.f - -// Customizable color -#define kDefaultBackgroundColor [UIColor blackColor] -#define kDefaultHighlightedColor [UIColor lightGrayColor] -#define kDefaultSelectedColor [UIColor whiteColor] -#define kDefaultDividerColor [UIColor whiteColor] -#define kDefaultTextColor [UIColor whiteColor] -#define kDefaultHighlightedTextColor [UIColor whiteColor] -#define kDefaultSelectedTextColor [UIColor blackColor] - -@interface MenuPopOverView() - -@property (strong, nonatomic) UIView *contentView; -@property (strong, nonatomic) NSMutableArray *buttons; // of MenuPopOverButton -@property (strong, nonatomic) NSMutableArray *pageButtons; // of NSArray for each page of UIButtons. -@property (strong, nonatomic) NSMutableArray *dividers; // of CGRect frame of dividers - -@property (nonatomic) BOOL isArrowUp; -@property (nonatomic) CGPoint arrowPoint; -@property (nonatomic) CGRect boxFrame; -@property (nonatomic) NSInteger pageIndex; -@property (nonatomic) NSInteger selectedIndex; - -@property (nonatomic) UIInterfaceOrientation lastInterfaceOrientation; - -- (void)didTapLeftArrowButton:(UIButton *)sender; -- (void)didTapRightArrowButton:(UIButton *)sender; - -@end - - -@implementation MenuPopOverView - --(instancetype)init { - return [self initWithFrame:CGRectZero]; -} - --(instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - self.backgroundColor = [UIColor clearColor]; - } - - return self; -} - --(void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view withStrings:(NSArray *)stringArray { - [self presentPopoverFromRect:rect inView:view withStrings:stringArray selectedIndex:-1]; -} - -- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view withStrings:(NSArray *)stringArray selectedIndex:(NSInteger)selectedIndex { - if ([stringArray count] == 0) { - return; - } - - // listen on device rotation - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDeviceRotation:) name:UIDeviceOrientationDidChangeNotification object:nil]; - _lastInterfaceOrientation = [UIApplication sharedApplication].statusBarOrientation; - - UIView *buttonContainer = [[UIView alloc] initWithFrame:CGRectZero]; - buttonContainer.backgroundColor = [UIColor clearColor]; - buttonContainer.clipsToBounds = YES; - - self.selectedIndex = selectedIndex; - - self.dividers = [[NSMutableArray alloc] init]; - self.buttons = [[NSMutableArray alloc] initWithCapacity:stringArray.count]; - - // generate buttons for string array - for (NSString *string in stringArray) { - CGSize textSize = [string sizeWithAttributes:@{NSFontAttributeName: kTextFont}]; - UIButton *textButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, round(textSize.width + 2 * kTextEdgeInsets), kButtonHeight)]; - textButton.enabled = NO; - textButton.selected = self.buttons.count == selectedIndex; - textButton.backgroundColor = textButton.selected ? self.popOverSelectedColor : self.popOverBackgroundColor; - textButton.titleLabel.font = kTextFont; - [textButton setTitleColor:self.popOverTextColor forState:UIControlStateNormal]; - [textButton setTitleColor:self.popOverHighlightedTextColor forState:UIControlStateHighlighted]; - [textButton setTitleColor:self.popOverSelectedTextColor forState:UIControlStateSelected]; - textButton.titleLabel.textAlignment = NSTextAlignmentCenter; - [textButton setTitle:string forState:UIControlStateNormal]; - [textButton addTarget:self action:@selector(didTapButton:) forControlEvents:UIControlEventTouchUpInside]; - [textButton addTarget:self action:@selector(changeBackgroundColor:) forControlEvents:UIControlEventTouchDown]; - [textButton addTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchUpOutside]; - [textButton addTarget:self action:@selector(changeBackgroundColor:) forControlEvents:UIControlEventTouchDragEnter]; - [textButton addTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchDragExit]; - [textButton addTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchCancel]; - - [self.buttons addObject:textButton]; - } - - // put these buttons into right position - float totalWidth = [self reArrangeButtons:self.buttons]; - for (NSArray *btns in self.pageButtons) { - for (UIButton *b in btns) { - [buttonContainer addSubview:b]; - } - } - buttonContainer.frame = CGRectMake(0, 0, totalWidth, kButtonHeight); - - [self presentPopoverFromRect:rect inView:view withContentView:buttonContainer]; -} - -- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view withContentView:(UIView *)cView { - self.contentView = cView; - - [self setupLayout:rect inView:view]; - - // Make the view small and transparent before animation - self.alpha = 0.f; - self.transform = CGAffineTransformMakeScale(0.1f, 0.1f); - - // animate into full size - // First stage animates to 1.05x normal size, then second stage animates back down to 1x size. - // This two-stage animation creates a little "pop" on open. - [UIView animateWithDuration:0.2f delay:0.f options:UIViewAnimationOptionCurveEaseInOut animations:^{ - self.alpha = 1.f; - self.transform = CGAffineTransformMakeScale(1.05f, 1.05f); - } completion:^(BOOL finished) { - [UIView animateWithDuration:0.08f delay:0.f options:UIViewAnimationOptionCurveEaseInOut animations:^{ - self.transform = CGAffineTransformIdentity; - } completion:nil]; - }]; -} - -- (float)reArrangeButtons:(NSArray *)buttons { - self.pageButtons = [[NSMutableArray alloc] init]; - _pageIndex = 0; - - CGRect screenBounds = [self currentScreenBoundsDependOnOrientation]; - float popoverMaxWidth = screenBounds.size.width - 2 * kPopOverViewPadding; - - // if we need multiple pages to display all these buttons - float allButtonWidth = 0.f; - for (UIButton *b in buttons) { - allButtonWidth += b.frame.size.width; - } - allButtonWidth += ([buttons count] - 1); // dividers - BOOL needMultiPage = ([buttons count] > 1 && allButtonWidth > popoverMaxWidth); - - // figure out which page each button belong to. - NSMutableArray *firstButtons = [[NSMutableArray alloc] init]; - if (needMultiPage) { - float currentButtonsWidth = 0.f; - for (UIButton *b in buttons) { - currentButtonsWidth += b.frame.size.width; - if (currentButtonsWidth > popoverMaxWidth - kRightButtonWidth) { - if (b == [buttons firstObject]) { - currentButtonsWidth = b.frame.size.width + 1; - } else { - [firstButtons addObject:b]; - currentButtonsWidth = kLeftButtonWidth + 1 + b.frame.size.width + 1; - } - } else { - currentButtonsWidth += 1; // 1 pixel divider - } - } - } - - [self.dividers removeAllObjects]; - float currentX = 0.f; - // need fixed buttons' frame if multiple page needed. - if (needMultiPage) { - BOOL isFirstPage = YES; - NSMutableArray *pageButtons = [[NSMutableArray alloc] init]; - NSMutableArray *currentPageButtons = [[NSMutableArray alloc] init]; - for (UIButton *b in buttons) { - if ([firstButtons indexOfObject:b] != NSNotFound) { - // adjust frames - currentX = [self adjustButtonsFrame:pageButtons - withWidth:(popoverMaxWidth - (isFirstPage ? kRightButtonWidth + 1 : (kRightButtonWidth + kLeftButtonWidth + 2))) - withXOrig:currentX]; - // add div between buttons - rightArrowBtn - CGRect div = CGRectMake(currentX, 0, 1, kButtonHeight); - [self.dividers addObject:[NSValue valueWithCGRect:div]]; - currentX += 1; - // add rightArrowBtn - UIButton *rightArrowBtn = [self getControlButton:YES]; - CGRect rightArrowFrame = rightArrowBtn.frame; - rightArrowFrame.origin.x = currentX; - rightArrowBtn.frame = rightArrowFrame; - currentX += kRightButtonWidth; - - [currentPageButtons addObjectsFromArray:pageButtons]; - [currentPageButtons addObject:rightArrowBtn]; - [self.pageButtons addObject:currentPageButtons]; - - [pageButtons removeAllObjects]; - currentPageButtons = [[NSMutableArray alloc] init]; - // add leftArrow for next page - UIButton *leftArrowBtn = [self getControlButton:NO]; - CGRect leftArrowFrame = rightArrowBtn.frame; - leftArrowFrame.origin.x = currentX; - leftArrowBtn.frame = leftArrowFrame; - currentX += kLeftButtonWidth; - [currentPageButtons addObject:leftArrowBtn]; - - // add div between leftArrow - nextPageBtns - div = CGRectMake(currentX, 0, 1, kButtonHeight); - [self.dividers addObject:[NSValue valueWithCGRect:div]]; - currentX += 1; - - isFirstPage = NO; // no more first page any further - } - - [pageButtons addObject:b]; - } - // last page - if ([pageButtons count] > 0) { - // adjust frames - currentX = [self adjustButtonsFrame:pageButtons - withWidth:(popoverMaxWidth - (kRightButtonWidth + kLeftButtonWidth + 2)) - withXOrig:currentX]; - // add div between buttons - rightArrowBtn - CGRect div = CGRectMake(currentX, 0, 1, kButtonHeight); - [self.dividers addObject:[NSValue valueWithCGRect:div]]; - currentX += 1; - // add disabled rightArrowBtn - UIButton *rightArrowBtn = [self getControlButton:YES]; - rightArrowBtn.enabled = NO; - [rightArrowBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal]; - CGRect rightArrowFrame = rightArrowBtn.frame; - rightArrowFrame.origin.x = currentX; - rightArrowBtn.frame = rightArrowFrame; - currentX += kRightButtonWidth; - [rightArrowBtn removeTarget:self action:@selector(didTapRightArrowButton:) forControlEvents:UIControlEventTouchUpInside]; - [rightArrowBtn removeTarget:self action:@selector(changeBackgroundColor:) forControlEvents:UIControlEventTouchDown]; - [rightArrowBtn removeTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchUpOutside]; - [rightArrowBtn removeTarget:self action:@selector(changeBackgroundColor:) forControlEvents:UIControlEventTouchDragEnter]; - [rightArrowBtn removeTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchDragExit]; - [rightArrowBtn removeTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchCancel]; - - [currentPageButtons addObjectsFromArray:pageButtons]; - [currentPageButtons addObject:rightArrowBtn]; - [self.pageButtons addObject:currentPageButtons]; - } - - // enable first page buttons initialy - for (UIButton *b in [self.pageButtons firstObject]) { - b.enabled = YES; - } - } else { - for (UIButton *b in buttons) { - b.enabled = YES; - b.frame = CGRectMake(currentX, 0, b.frame.size.width, b.frame.size.height); - currentX += b.frame.size.width; - - if (b != [buttons lastObject]) { - // add div between buttons - CGRect div = CGRectMake(currentX, 0, 1, kButtonHeight); - [self.dividers addObject:[NSValue valueWithCGRect:div]]; - currentX += 1; - } - } - - [self.pageButtons addObject:buttons]; - } - - - return currentX; -} - -- (float)adjustButtonsFrame:(NSArray *)buttons withWidth:(float)totalWidth withXOrig:(float)xorig { - if ([buttons count] == 0) { - return xorig; - } - - if ([buttons count] == 1) { - UIButton *b = buttons.firstObject; - CGRect bf = b.frame; - bf.origin.x = xorig; - bf.size.width = totalWidth; - b.frame = bf; - return xorig + totalWidth; - } - - // get increment width for each button - float buttonsWidth = [buttons count] - 1; // 1 pixel dividers - for (UIButton *b in buttons) { - buttonsWidth += b.frame.size.width; - } - float incrementWidth = round(totalWidth - buttonsWidth)/[buttons count]; - - // adjust frame - float currentX = xorig; - for (UIButton *b in buttons) { - CGRect bf = b.frame; - bf.origin.x = currentX; - bf.size.width += incrementWidth; - b.frame = bf; - currentX += bf.size.width; - - if (b != [buttons lastObject]) { - CGRect div = CGRectMake(currentX, bf.origin.y, 1, bf.size.height); - [self.dividers addObject:[NSValue valueWithCGRect:div]]; - currentX += 1; // 1 pixel divider - } - } - - return xorig + totalWidth; -} - --(void)setupLayout:(CGRect)rect inView:(UIView*)view { - // get the top view - // http://stackoverflow.com/questions/3843411/getting-reference-to-the-top-most-view-window-in-ios-application/8045804#8045804 - UIView *topView = [[[[UIApplication sharedApplication] keyWindow] subviews] lastObject]; - - CGRect screenBounds = [self currentScreenBoundsDependOnOrientation]; - float popoverMaxWidth = screenBounds.size.width - 2 * kPopOverViewPadding; - - // determine the arrow position - CGRect topViewBounds = topView.bounds; - CGPoint origin = [topView convertPoint:rect.origin fromView:view]; - CGRect destRect = CGRectMake(origin.x, origin.y, rect.size.width, rect.size.height); - CGFloat minY = CGRectGetMinY(destRect); - CGFloat maxY = CGRectGetMaxY(destRect); - - // 1 pixel gap - if (maxY + kPopOverViewHeight + 1 > CGRectGetMidY(topViewBounds)) { - _isArrowUp = NO; - _arrowPoint = CGPointMake(CGRectGetMidX(destRect), minY - 1); - } else { - _isArrowUp = YES; - _arrowPoint = CGPointMake(CGRectGetMidX(destRect), maxY + 1); - } - - float contentWidth = self.contentView.frame.size.width; - float xOrigin = 0.f; - - //Make sure the arrow point is within the drawable bounds for the popover. - if (_arrowPoint.x + kArrowHeight > topViewBounds.size.width - kPopOverViewPadding - kPopOverCornerRadius) {//Too right - _arrowPoint.x = topViewBounds.size.width - kPopOverViewPadding - kPopOverCornerRadius - kArrowHeight; - //NSLog(@"Correcting Arrow Point because it's too right"); - } else if (_arrowPoint.x - kArrowHeight < kPopOverViewPadding + kPopOverCornerRadius) {//Too left - _arrowPoint.x = kPopOverViewPadding + kPopOverCornerRadius + kArrowHeight; - //NSLog(@"Correcting Arrow Point because it's too far to the left"); - } -// NSLog(@"arrowPoint:%f,%f", _arrowPoint.x, _arrowPoint.y); - - xOrigin = floorf(_arrowPoint.x - contentWidth*0.5f); - //Check to see if the centered xOrigin value puts the box outside of the normal range. - if (xOrigin < CGRectGetMinX(topViewBounds) + kPopOverViewPadding) { - xOrigin = CGRectGetMinX(topViewBounds) + kPopOverViewPadding; - } else if (xOrigin + contentWidth > CGRectGetMaxX(topViewBounds) - kPopOverViewPadding) { - //Check to see if the positioning puts the box out of the window towards the left - xOrigin = CGRectGetMaxX(topViewBounds) - kPopOverViewPadding - contentWidth; - } - - CGRect contentFrame = CGRectZero; - if (_isArrowUp) { - _boxFrame = CGRectMake(xOrigin, _arrowPoint.y + kArrowHeight, MIN(contentWidth, popoverMaxWidth), kPopOverViewHeight - kArrowHeight); - contentFrame = CGRectMake(xOrigin, _arrowPoint.y, contentWidth, kButtonHeight); - } else { - _boxFrame = CGRectMake(xOrigin, _arrowPoint.y - kPopOverViewHeight, MIN(contentWidth, popoverMaxWidth), kPopOverViewHeight - kArrowHeight); - contentFrame = CGRectMake(xOrigin, _arrowPoint.y - kButtonHeight, contentWidth, kButtonHeight); - } - -// NSLog(@"boxFrame:(%f,%f,%f,%f)", _boxFrame.origin.x, _boxFrame.origin.y, _boxFrame.size.width, _boxFrame.size.height); - - self.contentView.frame = contentFrame; - - //We set the anchorPoint here so the popover will "grow" out of the arrowPoint specified by the user. - //You have to set the anchorPoint before setting the frame, because the anchorPoint property will - //implicitly set the frame for the view, which we do not want. - self.layer.anchorPoint = CGPointMake(_arrowPoint.x / topViewBounds.size.width, _arrowPoint.y / topViewBounds.size.height); - self.frame = topViewBounds; - [self setNeedsDisplay]; - - [self addSubview:_contentView]; - [topView addSubview:self]; - - //Add a tap gesture recognizer to the large invisible view (self), which will detect taps anywhere on the screen. - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)]; - tap.cancelsTouchesInView = NO; // Allow touches through to a UITableView or other touchable view, as suggested by Dimajp. - [self addGestureRecognizer:tap]; - self.userInteractionEnabled = YES; -} - -#pragma mark - Touch event recognize -- (void)tapped:(UITapGestureRecognizer *)tap { - CGPoint point = [tap locationInView:self.contentView]; - CGRect contentVisibleBounds = CGRectZero; - contentVisibleBounds.origin.x = _boxFrame.origin.x - self.contentView.frame.origin.x; - contentVisibleBounds.size.width = _boxFrame.size.width; - contentVisibleBounds.size.height = self.contentView.frame.size.height; - - if (CGRectContainsPoint(contentVisibleBounds, point)) { - for (NSArray *pageBtns in self.pageButtons) { - for (UIView *view in pageBtns) { - if (CGRectContainsPoint(view.frame, point)) { - return; // have response. - } - } - } - } - - [self dismiss:YES]; -} - -- (void)didTapButton:(UIButton *)sender { - for (UIButton *button in self.buttons) { - button.selected = NO; - button.backgroundColor = self.popOverBackgroundColor; - } - sender.selected = YES; - sender.backgroundColor = self.popOverSelectedColor; - - NSUInteger index = [self.buttons indexOfObject:sender]; - if (index != NSNotFound && self.delegate && [self.delegate respondsToSelector:@selector(popoverView:didSelectItemAtIndex:)]) { - [self.delegate popoverView:self didSelectItemAtIndex:index]; - } - - [self dismiss:YES]; -} - -- (void)dismiss:(BOOL)animate { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; - - void (^completion)(BOOL finished) = ^(BOOL finished) { - if (self.delegate && [self.delegate respondsToSelector:@selector(popoverViewDidDismiss:)]) { - [self.delegate popoverViewDidDismiss:self]; - } - - [self removeFromSuperview]; - }; - - if (!animate) { - completion(YES); - } else { - [UIView animateWithDuration:0.3f delay:0.15f options:0 animations:^{ - self.alpha = 0.1f; - self.transform = CGAffineTransformMakeScale(0.1f, 0.1f); - } completion:completion]; - } -} - -- (void)didTapLeftArrowButton:(UIButton *)sender { - float popoverMaxWidth = [UIScreen mainScreen].bounds.size.width - 2 * kPopOverViewPadding; - - // disable current buttons, enable previous page buttons - for (UIButton *b in [self.pageButtons objectAtIndex:_pageIndex]) { - b.enabled = NO; - } - _pageIndex--; - for (UIButton *b in [self.pageButtons objectAtIndex:_pageIndex]) { - b.enabled = YES; - } - sender.backgroundColor = self.popOverBackgroundColor; - - CGRect contentFrame = self.contentView.frame; - contentFrame.origin.x += popoverMaxWidth; - [UIView animateWithDuration:0.25 animations:^{ - self.contentView.frame = contentFrame; - }]; - - [self setNeedsDisplay]; -} - -- (void)didTapRightArrowButton:(UIButton *)sender { - float popoverMaxWidth = [UIScreen mainScreen].bounds.size.width - 2 * kPopOverViewPadding; - - // disable current buttons, enable next page buttons - for (UIButton *b in [self.pageButtons objectAtIndex:_pageIndex]) { - b.enabled = NO; - } - _pageIndex++; - for (UIButton *b in [self.pageButtons objectAtIndex:_pageIndex]) { - b.enabled = YES; - } - ((UIButton *)[[self.pageButtons lastObject] lastObject]).enabled = NO; - [((UIButton *)[[self.pageButtons lastObject] lastObject]) setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal]; - - sender.backgroundColor = self.popOverBackgroundColor; - - CGRect contentFrame = self.contentView.frame; - contentFrame.origin.x -= popoverMaxWidth; - [UIView animateWithDuration:0.25 animations:^{ - self.contentView.frame = contentFrame; - }]; - - [self setNeedsDisplay]; -} - -- (UIButton *)getControlButton:(BOOL)rightArrow { - UIButton *res = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kRightButtonWidth, kButtonHeight)]; - res.enabled = NO; - res.backgroundColor = self.popOverBackgroundColor; - res.titleLabel.font = kTextFont; - [res setTitleColor:self.popOverTextColor forState:UIControlStateNormal]; - res.titleLabel.textAlignment = NSTextAlignmentCenter; - if (rightArrow) { - // unicode for right arrow - [res setTitle:[[NSString alloc] initWithUTF8String:"\xE2\x96\xB6\xEF\xB8\x8E"] forState:UIControlStateNormal]; - [res addTarget:self action:@selector(didTapRightArrowButton:) forControlEvents:UIControlEventTouchUpInside]; - } else { - // unicode for left arrow - [res setTitle:[[NSString alloc] initWithUTF8String:"\xE2\x97\x80\xEF\xB8\x8E"] forState:UIControlStateNormal]; - [res addTarget:self action:@selector(didTapLeftArrowButton:) forControlEvents:UIControlEventTouchUpInside]; - } - [res addTarget:self action:@selector(changeBackgroundColor:) forControlEvents:UIControlEventTouchDown]; - [res addTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchUpOutside]; - [res addTarget:self action:@selector(changeBackgroundColor:) forControlEvents:UIControlEventTouchDragEnter]; - [res addTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchDragExit]; - [res addTarget:self action:@selector(resetBackgroundColor:) forControlEvents:UIControlEventTouchCancel]; - - return res; -} - -- (void)changeBackgroundColor:(UIButton *)sender { - sender.backgroundColor = self.popOverHighlightedColor; -} - -- (void)resetBackgroundColor:(UIButton *)sender { - NSUInteger index = [self.buttons indexOfObject:sender]; - sender.backgroundColor = index == self.selectedIndex ? self.popOverSelectedColor : self.popOverBackgroundColor; -} - -#pragma mark - rotation -- (void)onDeviceRotation:(NSNotification *)noti { - UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; - - if (_lastInterfaceOrientation == orientation || - (UIInterfaceOrientationIsPortrait(_lastInterfaceOrientation) && - UIInterfaceOrientationIsPortrait(orientation))) { - return; - } - - [self dismiss:NO]; -} - -- (CGRect)currentScreenBoundsDependOnOrientation -{ - CGRect screenBounds = [UIScreen mainScreen].bounds; - CGFloat width = CGRectGetWidth(screenBounds); - CGFloat height = CGRectGetHeight(screenBounds); - UIInterfaceOrientation interfaceOrientation = [UIApplication sharedApplication].statusBarOrientation; - if(UIInterfaceOrientationIsPortrait(interfaceOrientation)){ - screenBounds.size = CGSizeMake(width, height); - }else if(UIInterfaceOrientationIsLandscape(interfaceOrientation)){ - screenBounds.size = CGSizeMake(height, width); - } - return screenBounds ; -} - -#pragma mark - custom draw -- (void)drawRect:(CGRect)rect { - // Drawing code - - // Build the popover path - CGRect frame = _boxFrame; - float xMin = CGRectGetMinX(frame); - float yMin = CGRectGetMinY(frame); - float xMax = CGRectGetMaxX(frame); - float yMax = CGRectGetMaxY(frame); - float radius = kPopOverCornerRadius; //Radius of the curvature. - - - /* - LT2 RT1 - LT1⌜⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⌝RT2 - | | - | popover | - | | - LB2⌞_______________⌟RB1 - LB1 RB2 - - Traverse rectangle in clockwise order, starting at LB2 - L = Left - R = Right - T = Top - B = Bottom - 1,2 = order of traversal for any given corner - */ - CGContextRef context = UIGraphicsGetCurrentContext(); - CGMutablePathRef bubblePath = CGPathCreateMutable(); - - // Move to LB2 - CGPathMoveToPoint(bubblePath, NULL, xMin, yMax - radius); - // Move to LT2 - CGPathAddArcToPoint(bubblePath, NULL, xMin, yMin, xMin + radius, yMin, radius); - - //If the popover is positioned below (!above) the arrowPoint, then we know that the arrow must be on the top of the popover. - //In this case, the arrow is located between LT2 and RT1 - if (_isArrowUp) { - // Move to left point of Arrow and draw Arrow - CGPathAddLineToPoint(bubblePath, NULL, _arrowPoint.x - kArrowHeight, yMin); - CGPathAddLineToPoint(bubblePath, NULL, _arrowPoint.x, _arrowPoint.y); - CGPathAddLineToPoint(bubblePath, NULL, _arrowPoint.x + kArrowHeight, yMin); - } - - // Move to RT2 - CGPathAddArcToPoint(bubblePath, NULL, xMax, yMin, xMax, yMin + radius, radius); - // Move to RB2 - CGPathAddArcToPoint(bubblePath, NULL, xMax, yMax, xMax - radius, yMax, radius); - - if (!_isArrowUp) { - //Move to right point of Arrow and draw Arrow - CGPathAddLineToPoint(bubblePath, NULL, _arrowPoint.x + kArrowHeight, yMax); - CGPathAddLineToPoint(bubblePath, NULL, _arrowPoint.x, _arrowPoint.y); - CGPathAddLineToPoint(bubblePath, NULL, _arrowPoint.x - kArrowHeight, yMax); - } - - // Move to LB2 - CGPathAddArcToPoint(bubblePath, NULL, xMin, yMax, xMin, yMax - radius, radius); - CGPathCloseSubpath(bubblePath); - - CGContextSaveGState(context); - CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; - maskLayer.frame = self.bounds; - maskLayer.path = bubblePath; - self.layer.mask = maskLayer; - CGContextRestoreGState(context); - - //Draw the divider rects if we need to - if (self.dividers && self.dividers.count > 0) { - for (NSValue *value in self.dividers) { - CGRect rect = value.CGRectValue; - rect.origin.x += self.contentView.frame.origin.x; - rect.origin.y += self.contentView.frame.origin.y; - - UIBezierPath *dividerPath = [UIBezierPath bezierPathWithRect:rect]; - [self.popOverDividerColor setFill]; - [dividerPath fill]; - } - } - - // Add border if popOverBorderColor is set - if (self.popOverBorderColor) { - CAShapeLayer *layer = [[CAShapeLayer alloc] init]; - layer.frame = self.bounds; - layer.path = bubblePath; - layer.fillColor = nil; - layer.lineWidth = 2; - layer.strokeColor = self.popOverBorderColor.CGColor; - [self.layer addSublayer:layer]; - } -} - -#pragma mark - color getters - --(UIColor *)popOverBackgroundColor { - if (_popOverBackgroundColor == nil) { - return kDefaultBackgroundColor; - } - - else { - return _popOverBackgroundColor; - } -} - --(UIColor *)popOverHighlightedColor { - if (_popOverHighlightedColor == nil) { - return kDefaultHighlightedColor; - } - - else { - return _popOverHighlightedColor; - } -} - --(UIColor *)popOverSelectedColor { - if (_popOverSelectedColor == nil) { - return kDefaultSelectedColor; - } - - else { - return _popOverSelectedColor; - } -} - --(UIColor *)popOverDividerColor { - if (_popOverDividerColor == nil) { - return kDefaultDividerColor; - } - - else { - return _popOverDividerColor; - } -} - --(UIColor *)popOverTextColor { - if (_popOverTextColor == nil) { - return kDefaultTextColor; - } - - else { - return _popOverTextColor; - } -} - --(UIColor *)popOverHighlightedTextColor { - if (_popOverHighlightedTextColor == nil) { - return kDefaultHighlightedTextColor; - } - - else { - return _popOverHighlightedTextColor; - } -} - --(UIColor *)popOverSelectedTextColor { - if (_popOverSelectedTextColor == nil) { - return kDefaultSelectedTextColor; - } - - else { - return _popOverSelectedTextColor; - } -} - -@end diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJRecommendSevice.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJRecommendSevice.m" index b1fc706e..17547874 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJRecommendSevice.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJRecommendSevice.m" @@ -24,27 +24,17 @@ - (void)getRecommendCategorys:(void(^)(NSError *error))completion parameters[@"a"] = @"category"; parameters[@"c"] = @"subscribe"; - - [self GET:BSJBaiSiJieHTTPAPI parameters:parameters completion:^(LMJBaseResponse *response) { if (!response.error) { - - [self.recommendCategorys removeAllObjects]; - self.recommendCategorys = [BSJRecommendCategory mj_objectArrayWithKeyValuesArray:response.responseObject[@"list"]]; - - BSJRecommendCategory *defaultCategory = [BSJRecommendCategory new]; defaultCategory.ID = @""; defaultCategory.name = @"全部"; - [self.recommendCategorys insertObject:defaultCategory atIndex:0]; } - - completion(response.error); }]; @@ -60,43 +50,30 @@ - (void)getDefaultRecommendCategoryUserList:(BOOL)isMore completion:(void(^)(NSE parameters[@"c"] = @"user"; if (isMore) { - parameters[@"last_flag"] = @"toplist"; - parameters[@"last_record"] = self.recommendCategorys.firstObject.users.lastObject.uid; } NSInteger page = isMore ? (self.recommendCategorys.firstObject.page + 1) : 1; [self GET:BSJBaiSiJieHTTPAPI parameters:parameters completion:^(LMJBaseResponse *response) { - if (response.error) { completion(response.error); return ; } - if (!isMore) { [self.recommendCategorys.firstObject.users removeAllObjects]; } if (!LMJIsEmpty(response.responseObject)) { - [self.recommendCategorys.firstObject.users addObjectsFromArray:[BSJRecommendUser mj_objectArrayWithKeyValuesArray:response.responseObject[@"top_list"]]]; - - } - self.recommendCategorys.firstObject.page = page; - self.recommendCategorys.firstObject.totalPage = INFINITY; - completion(nil); - }]; - - } @@ -104,7 +81,6 @@ - (void)getSelectedRecommendCategoryUserList:(BSJRecommendCategory *)category is { NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; - NSInteger page = isMore ? (category.page + 1) : 1; @@ -114,13 +90,10 @@ - (void)getSelectedRecommendCategoryUserList:(BSJRecommendCategory *)category is parameters[@"pagesize"] = @20; parameters[@"category_id"] = category.ID; - [self GET:BSJBaiSiJieHTTPAPI parameters:parameters completion:^(LMJBaseResponse *response) { if (response.error) { - NSLog(@"%@", response.error); - completion(response.error); return ; } @@ -131,16 +104,13 @@ - (void)getSelectedRecommendCategoryUserList:(BSJRecommendCategory *)category is } if (!LMJIsEmpty(response.responseObject)) { - [category.users addObjectsFromArray:[BSJRecommendUser mj_objectArrayWithKeyValuesArray:response.responseObject[@"list"]]]; } category.page = [response.responseObject[@"next_page"] integerValue] - 1; category.totalPage = [response.responseObject[@"total_page"] integerValue]; - completion(nil); - }]; } diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJTopicCmtService.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJTopicCmtService.m" index a103a526..fcf3f666 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJTopicCmtService.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJTopicCmtService.m" @@ -54,13 +54,15 @@ - (void)getCmtsWithTopicID:(NSString *)topicID isMore:(BOOL)isMore completion:(v return; } + // 数据是空的时候不是字典了 if (![response.responseObject isKindOfClass:[NSDictionary class]]) { + response.error = [NSError errorWithDomain:NSGlobalDomain code:-1 userInfo:nil]; + completion(response.error, YES); return; } if (!response.responseObject || response.error) { - completion(response.error, YES); return; } @@ -80,19 +82,14 @@ - (void)getCmtsWithTopicID:(NSString *)topicID isMore:(BOOL)isMore completion:(v } - [self.latestCmts addObjectsFromArray:[BSJComment mj_objectArrayWithKeyValuesArray:response.responseObject[@"data"]]]; - completion(nil, [response.responseObject[@"total"] integerValue] <= self.latestCmts.count); - + completion(nil, [response.responseObject[@"total"] integerValue] > self.latestCmts.count); }]; - - } - - (NSMutableArray *)latestCmts { if(_latestCmts == nil) diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJTopicService.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJTopicService.m" index f4e06f47..c97e65e2 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJTopicService.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/Service/BSJTopicService.m" @@ -11,18 +11,15 @@ @interface BSJTopicService () -/** <#digest#> */ @property (nonatomic, copy) NSString *maxtime; -/** <#digest#> */ +/** 防止重复刷新 */ @property (nonatomic, strong) id parameters; @end @implementation BSJTopicService - - - (void)getTopicIsMore:(BOOL)isMore typeA:(NSString *)typeA topicType:(NSInteger)topicType completion:(void(^)(NSError *error, NSInteger totalCount, NSInteger currentCount))completion { NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; @@ -49,15 +46,10 @@ - (void)getTopicIsMore:(BOOL)isMore typeA:(NSString *)typeA topicType:(NSInteger NSMutableArray *newTopicViewModels = [NSMutableArray array]; [[BSJTopic mj_objectArrayWithKeyValuesArray:dictArrayM] enumerateObjectsUsingBlock:^(BSJTopic *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - [newTopicViewModels addObject:[BSJTopicViewModel viewModelWithTopic:obj]]; - }]; - [self.topicViewModels addObjectsFromArray:newTopicViewModels]; - self.maxtime = self.topicViewModels.lastObject.topic.t; - completion(nil, 999999999, self.topicViewModels.count); } else { @@ -72,9 +64,7 @@ - (void)getTopicIsMore:(BOOL)isMore typeA:(NSString *)typeA topicType:(NSInteger return ; } - if (!isMore) { - [self.topicViewModels removeAllObjects]; } @@ -86,23 +76,15 @@ - (void)getTopicIsMore:(BOOL)isMore typeA:(NSString *)typeA topicType:(NSInteger NSMutableArray *newTopicViewModels = [NSMutableArray array]; [[BSJTopic mj_objectArrayWithKeyValuesArray:response.responseObject[@"list"]] enumerateObjectsUsingBlock:^(BSJTopic *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - [newTopicViewModels addObject:[BSJTopicViewModel viewModelWithTopic:obj]]; - }]; [self.topicViewModels addObjectsFromArray:newTopicViewModels]; - self.maxtime = self.topicViewModels.lastObject.topic.t; - completion(nil, [response.responseObject[@"info"][@"count"] integerValue], self.topicViewModels.count); - }]; } - }]; - - } diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJHlightedTextField.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJHlightedTextField.m" index 4caba631..c2d01abb 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJHlightedTextField.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJHlightedTextField.m" @@ -8,7 +8,7 @@ #import "BSJHlightedTextField.h" -static NSString *const BSJHlightTextFieldPlaceHolderColorKeyPath = @"_placeholderLabel.textColor"; +//static NSString *const BSJHlightTextFieldPlaceHolderColorKeyPath = @""; @interface BSJHlightedTextField () /** <#digest#> */ @@ -34,14 +34,16 @@ - (void)awakeFromNib - (void)setupUIOnce { - self.oriPlaceHolderColor = [self valueForKeyPath:BSJHlightTextFieldPlaceHolderColorKeyPath]; +// self.oriPlaceHolderColor = [self valueForKeyPath:BSJHlightTextFieldPlaceHolderColorKeyPath]; self.tintColor = self.textColor; + self.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 15, 20)]; + self.leftViewMode = UITextFieldViewModeAlways; } - (BOOL)becomeFirstResponder { - [self setValue:self.textColor forKeyPath:BSJHlightTextFieldPlaceHolderColorKeyPath]; +// [self setValue:self.textColor forKeyPath:BSJHlightTextFieldPlaceHolderColorKeyPath]; return [super becomeFirstResponder]; } @@ -49,24 +51,10 @@ - (BOOL)becomeFirstResponder - (BOOL)resignFirstResponder { - [self setValue:self.oriPlaceHolderColor forKeyPath:BSJHlightTextFieldPlaceHolderColorKeyPath]; +// [self setValue:self.oriPlaceHolderColor forKeyPath:BSJHlightTextFieldPlaceHolderColorKeyPath]; return [super resignFirstResponder]; } - -- (void)layoutSubviews -{ - [super layoutSubviews]; - - -} - -+ (void)load -{ - - -} - @end diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJMeSquareCell.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJMeSquareCell.m" index 46cf99ba..430b3652 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJMeSquareCell.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJMeSquareCell.m" @@ -49,11 +49,8 @@ - (void)setMeSquare:(BSJMeSquare *)meSquare { _meSquare = meSquare; - [self.iconImageView sd_setImageWithURL:meSquare.icon]; - self.nameLabel.text = meSquare.name; - } @end diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJMeSquareCell.xib" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJMeSquareCell.xib" index 489b7b4e..b84bbcec 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJMeSquareCell.xib" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJMeSquareCell.xib" @@ -1,11 +1,11 @@ - + - + diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJReommmendCategoryCell.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJReommmendCategoryCell.m" index 2285b365..ff603ad2 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJReommmendCategoryCell.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJReommmendCategoryCell.m" @@ -17,17 +17,12 @@ @interface BSJReommmendCategoryCell () @implementation BSJReommmendCategoryCell -+ (instancetype)reommmendCategoryCellWithTableView:(UITableView *)tableView -{ - ++ (instancetype)reommmendCategoryCellWithTableView:(UITableView *)tableView { BSJReommmendCategoryCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([self class])]; - if (cell == nil) { cell = [NSBundle.mainBundle loadNibNamed:NSStringFromClass(self.class) owner:nil options:nil].lastObject; } - - return cell; } @@ -61,14 +56,12 @@ - (void)layoutSubviews - (void)setCategory:(BSJRecommendCategory *)category { _category = category; - self.categoryLabel.text = category.name; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; - self.indicatorView.hidden = !selected; } diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJReommmendCategoryCell.xib" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJReommmendCategoryCell.xib" index dafbcbb7..1da95a28 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJReommmendCategoryCell.xib" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJReommmendCategoryCell.xib" @@ -1,11 +1,11 @@ - + - + diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTabBar.h" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTabBar.h" index 21d31b09..126ca8da 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTabBar.h" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTabBar.h" @@ -6,8 +6,6 @@ // Copyright © 2017年 GoMePrjk. All rights reserved. // -#import -#import @interface BSJTabBar : UITabBar diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTabBar.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTabBar.m" index ecc02594..0b5f4d38 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTabBar.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTabBar.m" @@ -20,7 +20,8 @@ - (void)layoutSubviews [super layoutSubviews]; CGFloat itemWidth = self.lmj_width / (self.items.count + 1); - + __block CGFloat itemHeight = 0; + __block CGFloat itemY = 0; NSMutableArray *tabBarButtonMutableArray = [NSMutableArray array]; @@ -28,27 +29,21 @@ - (void)layoutSubviews if ([obj isKindOfClass:NSClassFromString(@"UITabBarButton")]) { [tabBarButtonMutableArray addObject:obj]; obj.lmj_width = itemWidth; + itemHeight = obj.lmj_height; + itemY = obj.lmj_y; } - }]; - [tabBarButtonMutableArray enumerateObjectsUsingBlock:^(UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - obj.lmj_x = idx * itemWidth; - if (idx > 1) { obj.lmj_x = (idx + 1) * itemWidth; } - if (idx == 2) { - [self.publishBtn sizeToFit]; + self.publishBtn.lmj_size = CGSizeMake(itemWidth, itemHeight); self.publishBtn.lmj_centerX = self.lmj_width * 0.5; - self.publishBtn.lmj_y = 5; -// self.publishBtn.lmj_size = CGSizeMake(itemWidth, itemWidth); + self.publishBtn.lmj_y = itemY; } - - }]; [self bringSubviewToFront:self.publishBtn]; @@ -61,16 +56,15 @@ - (UIButton *)publishBtn { UIButton *btn = [[UIButton alloc] init]; [self addSubview:btn]; - _publishBtn = btn; [btn setImage:[UIImage imageNamed:@"tabBar_publish_icon"] forState:UIControlStateNormal]; [btn setImage:[UIImage imageNamed:@"tabBar_publish_click_icon"] forState:UIControlStateHighlighted]; - LMJWeakSelf(self); - LMJWeakSelf(btn); + btn.imageView.contentMode = UIViewContentModeCenter; + LMJWeak(self); + LMJWeak(btn); [btn addActionHandler:^(NSInteger tag) { - !weakself.publishBtnClick ?: weakself.publishBtnClick(weakself, weakbtn); }]; @@ -78,21 +72,6 @@ - (UIButton *)publishBtn return _publishBtn; } -//- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event -//{ -// -// if ([self pointInside:point withEvent:event] && CGRectContainsPoint(self.publishBtn.frame, point)) { -// -// return self.publishBtn; -// -// } -// -// return [super hitTest:point withEvent:event]; -// -// -//} - - @end diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTopicCell.m" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTopicCell.m" index 8383f039..c9ccda39 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTopicCell.m" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTopicCell.m" @@ -105,9 +105,6 @@ - (void)setTopicViewModel:(BSJTopicViewModel *)topicViewModel [self.commentBtn setTitle:topicViewModel.commentCount forState:UIControlStateNormal]; - - - if (topicViewModel.topic.type == BSJTopicTypePicture) { self.pictureView.topicViewModel = topicViewModel; @@ -150,18 +147,13 @@ - (void)setTopicViewModel:(BSJTopicViewModel *)topicViewModel self.topCmtContentView.textLayout = topicViewModel.topCmtLayout; self.topCmtHeightConstraint.constant = topicViewModel.topCmtLayout.textBoundingSize.height; self.topicViewModel.topCmtClick = ^(BSJUser *user, BSJTopicTopComent *topCmt) { - NSLog(@"%@, %@", user.username, topCmt.content); - }; }else { self.cmtContainerView.hidden = YES; } - - - } @@ -223,14 +215,10 @@ - (BSJTopicVideoView *)videoView + (instancetype)topicCellWithTableView:(UITableView *)tableView { - BSJTopicCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([self class])]; - if (cell == nil) { cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:nil options:nil].lastObject; } - - return cell; } @@ -239,7 +227,6 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self setupBSJTopicCellUIOnce]; } - return self; } diff --git "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTopicCell.xib" "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTopicCell.xib" index 87ff3875..a4dc4218 100644 --- "a/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTopicCell.xib" +++ "b/iOSProject/iOSProject/Classes/\347\231\276\346\200\235\344\270\215\345\276\227\345\247\220/View/BSJTopicCell.xib" @@ -1,28 +1,28 @@ - + - + - - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoModel.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoModel.h" deleted file mode 100755 index 4f16bb4d..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoModel.h" +++ /dev/null @@ -1,40 +0,0 @@ -// -// ZFVideoModel.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import "ZFVideoResolution.h" - -@interface ZFVideoModel : NSObject - -/** 标题 */ -@property (nonatomic, copy ) NSString *title; -/** 描述 */ -@property (nonatomic, copy ) NSString *video_description; -/** 视频地址 */ -@property (nonatomic, copy ) NSString *playUrl; -/** 封面图 */ -@property (nonatomic, copy ) NSString *coverForFeed; -/** 视频分辨率的数组 */ -@property (nonatomic, strong) NSMutableArray *playInfos; - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoModel.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoModel.m" deleted file mode 100755 index 84efa064..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoModel.m" +++ /dev/null @@ -1,60 +0,0 @@ -// -// ZFVideoModel.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFVideoModel.h" - -@implementation ZFVideoModel - -/** - * 数组中需要转换的模型类 - * - * @return 字典中的key是数组属性名,value是数组中存放模型的Class(Class类型或者NSString类型) - */ -+ (NSDictionary *)mj_objectClassInArray -{ - return @{@"playInfos" : [ZFVideoResolution class]}; -} - -/** - * 将属性名换为其他key去字典中取值 - * - * @return 字典中的key是属性名,value是从字典中取值用的key - */ -+ (NSDictionary *)mj_replacedKeyFromPropertyName -{ - return @{ - @"video_description" : @"description", - @"playInfos" : @"playInfo", - }; -} - - -/** - * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 - */ -+ (NSArray *)mj_ignoredPropertyNames -{ - return @[]; -} - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoResolution.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoResolution.h" deleted file mode 100755 index 3228741b..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoResolution.h" +++ /dev/null @@ -1,32 +0,0 @@ -// -// ZFVideoResolution.h -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -@interface ZFVideoResolution : NSObject -@property (nonatomic, assign) NSInteger height; -@property (nonatomic, assign) NSInteger width; -@property (nonatomic, copy ) NSString *name; -@property (nonatomic, copy ) NSString *type; -@property (nonatomic, copy ) NSString *url; -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoResolution.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoResolution.m" deleted file mode 100755 index 204b87ab..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/ZFVideoResolution.m" +++ /dev/null @@ -1,28 +0,0 @@ -// -// ZFVideoResolution.m -// -// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng ) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "ZFVideoResolution.h" - -@implementation ZFVideoResolution - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/videoData.json" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/videoData.json" deleted file mode 100755 index d7b18368..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Model/videoData.json" +++ /dev/null @@ -1,1456 +0,0 @@ -{ - "videoList":[ - { - "id":5888, - "date":1458576000000, - "idx":1, - "title":"风格互换:原来你我相爱", - "description":"什么是爱情?Interflora 这支广告从某个层面给出了一个回答:爱,就是走哥特风的我为你变成普通青年,而回头发现,你却为我走了哥特风。这个结局倒令人想起欧亨利经典短篇小说「麦琪的礼物」。From @InterfloraTV", - "category":"广告", - "duration":60, - "playUrl":"http://baobab.wdjcdn.com/14571455324031.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457521866561_5888_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14571455324031.mp4" - } - ], - "consumption":{ - "collectionCount":3523, - "shareCount":6233, - "playCount":0, - "replyCount":124 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/cd47d8370569dbb9b223942674c41785_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/cd47d8370569dbb9b223942674c41785_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/2c6109cc56d98041f07ed5d6f9c79c72_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/cd47d8370569dbb9b223942674c41785_0_0.jpeg", - "webUrl":"http://wandou.im/1m9aca", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5888" - }, - { - "id":5560, - "date":1458662400000, - "idx":2, - "title":"朋友圈中的你是真实的你吗?", - "description":"朋友圈能反映我们真实的生活状态吗?短片中 Scott 的 Facebook 可谓十分精彩,每条状态仿佛都在说“我的生活赞爆了!”。可实际上他却默默独吞苦水。那么你呢,你是 Scott 吗?From HigtonBros", - "category":"剧情", - "duration":155, - "playUrl":"http://baobab.wdjcdn.com/14559682994064.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1455969783448_5560_854x480.mp4" - }, - { - "height":530, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14559682994064.mp4" - } - ], - "consumption":{ - "collectionCount":2336, - "shareCount":5967, - "playCount":0, - "replyCount":141 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/d536b9c09b2681630afcc92222599f0e_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/d536b9c09b2681630afcc92222599f0e_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/4abd9b2962b85099ef3072a95456cb63_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/d536b9c09b2681630afcc92222599f0e_0_0.jpeg", - "webUrl":"http://wandou.im/1ig5qp", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5560" - }, - { - "id":6188, - "date":1458662400000, - "idx":3, - "title":"「海贼王:燃烧之血」CG 预告", - "description":"「海贼王:燃烧之血」游戏广告震撼来袭,且看鲁夫与克洛克达尔和艾涅尔在涩谷街头激战!熟悉的人物、激烈的打斗、炫酷的画面、热血的气氛,简直 high 到爆!From バンダイナムコエンターテインメント", - "category":"广告", - "duration":100, - "playUrl":"http://baobab.wdjcdn.com/1458625865688ONE.mp4", - "playInfo":[ - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1458625865688ONE.mp4" - } - ], - "consumption":{ - "collectionCount":987, - "shareCount":4269, - "playCount":0, - "replyCount":68 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/ef5af677657e81b0cf79b73349446f43_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/ef5af677657e81b0cf79b73349446f43_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/c4d0ca77dadcd0a3f0e29919b52b66aa_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/ef5af677657e81b0cf79b73349446f43_0_0.jpeg", - "webUrl":"http://wandou.im/1qxx66", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=6188" - }, - { - "id":5976, - "date":1458576000000, - "idx":2, - "title":"吐司君的花样吃法", - "description":"吐司君的美味,品味的办法可不止一种两种。不仅单吃就有好风味,吐司更是百搭好物!不仅可以与水果和谐配搭,也可以和鸡蛋、芝士巧妙融合。哦对了,还可以在上面画画呢! @厨娘物语BeautyCate", - "category":"开胃", - "duration":279, - "playUrl":"http://baobab.wdjcdn.com/14573563182394.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457546796853_5976_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14573563182394.mp4" - } - ], - "consumption":{ - "collectionCount":2441, - "shareCount":2816, - "playCount":0, - "replyCount":36 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":{ - "id":24, - "name":"厨娘物语", - "link":"http://weibo.com/u/5232055343?topnav=1&wvr=6&topsug=1&is_all=1" - }, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/2d93c9404ff0218c4ca4c537cb6482e9_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/2d93c9404ff0218c4ca4c537cb6482e9_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/7b4911899723a61d261667b035176752_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/2d93c9404ff0218c4ca4c537cb6482e9_0_0.jpeg", - "webUrl":"http://wandou.im/1mvxqs", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5976" - }, - { - "id":5268, - "date":1458489600000, - "idx":1, - "title":"BMX自行车特技:娴熟如跑酷", - "description":"又一位 BMX 大神来袭!Tim Knoll 是世界上最具创造力的 BMX rider 之一。短片里 Tim 大神将 BMX 和跑酷娴熟结合,自行车在他手里简直就成了玩具!From Red Bull", - "category":"运动", - "duration":216, - "playUrl":"http://baobab.wdjcdn.com/1454467934808B(9).mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1454468136393_5268_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1454467934808B(9).mp4" - } - ], - "consumption":{ - "collectionCount":1475, - "shareCount":2933, - "playCount":0, - "replyCount":75 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/489070df80a1f699ef2b6c84cac13f21_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/489070df80a1f699ef2b6c84cac13f21_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/79b006f3c771e83c18c857563c2b08e4_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/489070df80a1f699ef2b6c84cac13f21_0_0.jpeg", - "webUrl":"http://wandou.im/1dg3sh", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5268" - }, - { - "id":5656, - "date":1458489600000, - "idx":2, - "title":"国际睡眠日:昨晚睡得好吗?", - "description":"今天是 2016 年国际睡眠日,现代人总是因压力过大而难得睡个好觉。压力本身并不是坏事,但如果影响睡眠质量就太折磨人了。这部短片便针对这个问题给出了一些建议:如何缓解压力睡个好觉?From Andrew D. Zimbelman", - "category":"动画", - "duration":69, - "playUrl":"http://baobab.wdjcdn.com/1458389678814huanjieyaliBastaw_x264.mp4", - "playInfo":[ - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1458389678814huanjieyaliBastaw_x264.mp4" - } - ], - "consumption":{ - "collectionCount":1227, - "shareCount":2794, - "playCount":0, - "replyCount":39 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"Vimeo", - "alias":"vimeo", - "icon":"http://img.wdjimg.com/image/video/c3ad630be461cbb081649c9e21d6cbe3_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/72c193615840f4ed82e84f99f88fe7c2_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/72c193615840f4ed82e84f99f88fe7c2_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/fa0984f2535f2d3a858a82a9933271b1_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/72c193615840f4ed82e84f99f88fe7c2_0_0.jpeg", - "webUrl":"http://wandou.im/1jmhdx", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5656" - }, - { - "id":5544, - "date":1457884800000, - "idx":1, - "title":"你相信有灵魂伴侣吗", - "description":"“你相信有灵魂伴侣吗?”女主角躺在床边问了这样一个恋爱中的典型问题。男主角思考了一会,用数学的方式给出了一个现实的答案,其实世界上那么多的人仅仅是能够相遇、认可,就已经是很不容易了。From Art Perez", - "category":"剧情", - "duration":330, - "playUrl":"http://baobab.wdjcdn.com/1457716884751linghunbanlv_x264.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457978787439_5544_854x480.mp4" - }, - { - "height":546, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1457716884751linghunbanlv_x264.mp4" - } - ], - "consumption":{ - "collectionCount":5400, - "shareCount":12772, - "playCount":0, - "replyCount":194 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/945fa937f0955b31224314a4eeef59b8_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/945fa937f0955b31224314a4eeef59b8_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/19f7dc4788801e1eedceeb1eed06c128_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/945fa937f0955b31224314a4eeef59b8_0_0.jpeg", - "webUrl":"http://wandou.im/1id5xh", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5544" - }, - { - "id":6030, - "date":1458835200000, - "idx":1, - "title":"死神刺杀计划", - "description":"如果杀掉死神,将死之人不就可以逃脱死去的悲惨命运了吗?基于这一逻辑,有人策划了对死神的刺杀。然而……短片娴熟运用剪纸、折纸、定时拍摄等元素,构思精巧、令人称奇。From watashiwaedson's channel", - "category":"创意", - "duration":333, - "playUrl":"http://baobab.wdjcdn.com/14587093851044544c.mp4", - "playInfo":[ - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14587093851044544c.mp4" - } - ], - "consumption":{ - "collectionCount":2455, - "shareCount":3185, - "playCount":0, - "replyCount":93 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/3b99a00a216cf4fbc8fbb07fbcd58f7b_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/3b99a00a216cf4fbc8fbb07fbcd58f7b_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/39168d57b0891fb925f152fa0bd80d8a_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/3b99a00a216cf4fbc8fbb07fbcd58f7b_0_0.jpeg", - "webUrl":"http://wandou.im/1nbh5m", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=6030" - }, - { - "id":5440, - "date":1458403200000, - "idx":1, - "title":"主人,我熟悉你的每一部分", - "description":"我将你认作我生命中最重要的人,每个部分、每个器官都带有你的气息。对狗狗而言,主人就是这最重要的存在。阿根廷肝移植协会推出的这支公益广告讲述了狗与人之间的真挚情感,伤感又温情。From DDB Worldwide", - "category":"广告", - "duration":94, - "playUrl":"http://baobab.wdjcdn.com/1455861661073g.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1455862946635_5440_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1455861661073g.mp4" - } - ], - "consumption":{ - "collectionCount":2192, - "shareCount":4401, - "playCount":0, - "replyCount":108 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/e0ba6995bc1a9f2a6aed093f46f29eca_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/e0ba6995bc1a9f2a6aed093f46f29eca_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/7e59e41f8f205f1110da89926ce38e38_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/e0ba6995bc1a9f2a6aed093f46f29eca_0_0.jpeg", - "webUrl":"http://wandou.im/1i2f4q", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5440" - }, - { - "id":5412, - "date":1458316800000, - "idx":1, - "title":"一段相差 57 岁的人生问答", - "description":"对于孩子来说,“变老”这一话题还太过遥远。而对于老者来说,大多数已坦然接受。岁月赋予了我们什么,又带走了什么?短片邀请了 7 岁的尚恩和 64 岁的戴斯进行了一场关于“变老”的谈话。From B.C. & Lowy", - "category":"记录", - "duration":275, - "playUrl":"http://baobab.wdjcdn.com/14557771465491(9).mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1455777405247_5412_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14557771465491(9).mp4" - } - ], - "consumption":{ - "collectionCount":2832, - "shareCount":5705, - "playCount":0, - "replyCount":54 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/efb2d3f26118e06bb88be3976cfb5831_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/efb2d3f26118e06bb88be3976cfb5831_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/388474012c11fc6e2b0cd873c85ee700_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/efb2d3f26118e06bb88be3976cfb5831_0_0.jpeg", - "webUrl":"http://wandou.im/1hrgas", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5412" - }, - { - "id":5970, - "date":1458662400000, - "idx":5, - "title":"杭·雪", - "description":"杭州,一座诗情画意的城市。杭州的景,杭州的人,都无时无刻不在诠释着这个词。连雪,也带有独有的杭州气息。点点细雪飘然而至,安静地落在房瓦上,亭榭中,为这座城市更增添了几分诗意。From @小邵爱摄会", - "category":"旅行", - "duration":192, - "playUrl":"http://baobab.wdjcdn.com/14573366545844.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457545129716_5970_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14573366545844.mp4" - } - ], - "consumption":{ - "collectionCount":1141, - "shareCount":2456, - "playCount":0, - "replyCount":45 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"乐视", - "alias":"letv", - "icon":"http://img.wdjimg.com/mms/icon/v1/6/ca/784da0db524cf8e1448574a764dcdca6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/1577ef5c42e41f985c57cf82fcb85446_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/1577ef5c42e41f985c57cf82fcb85446_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/4c38aa7a1dbb74979bbb0c2e7a272318_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/1577ef5c42e41f985c57cf82fcb85446_0_0.jpeg", - "webUrl":"http://wandou.im/1mteed", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5970" - }, - { - "id":5638, - "date":1458835200000, - "idx":2, - "title":"跑酷:将青春肆意挥洒!", - "description":"Thunder Freerunning 是一支由中学生组成的跑酷团队。他们热爱跑酷,将之作为挑战自我、战胜恐惧、释放压力的绝妙方式。他们在短片中惊险跑酷,将青春肆意挥洒!From Thunder Freerunning Ⓥ", - "category":"运动", - "duration":498, - "playUrl":"http://baobab.wdjcdn.com/1456229362945P(7).mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1456229749554_5638_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1456229362945P(7).mp4" - } - ], - "consumption":{ - "collectionCount":1460, - "shareCount":2458, - "playCount":0, - "replyCount":78 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/6f34edeed80473c3234db4e561f9d1f3_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/6f34edeed80473c3234db4e561f9d1f3_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/8b033949c3cc22ce46bed0e3964c3a5f_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/6f34edeed80473c3234db4e561f9d1f3_0_0.jpeg", - "webUrl":"http://wandou.im/1je1ms", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5638" - }, - { - "id":5912, - "date":1458748800000, - "idx":1, - "title":"心机喵之我只愿在车里!", - "description":"一只喵屡屡冒险为哪般?伤痕累累仍要作死,不为其他,只为主人将它载去宠物医院时,能够享受坐在丰田车里的几分钟时间。Toyota 这支广告真的是太拼了!这只喵对丰田车的爱也太深沉了吧。From ToyotaNZ", - "category":"广告", - "duration":90, - "playUrl":"http://baobab.wdjcdn.com/1457159246852The(2).mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457528056425_5912_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1457159246852The(2).mp4" - } - ], - "consumption":{ - "collectionCount":737, - "shareCount":2288, - "playCount":0, - "replyCount":61 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/fac9662b8444a954a4d4de69323a7bb7_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/fac9662b8444a954a4d4de69323a7bb7_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/814d14d306023252dfcdb1e989c5d8e6_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/fac9662b8444a954a4d4de69323a7bb7_0_0.jpeg", - "webUrl":"http://wandou.im/1mb55y", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5912" - }, - { - "id":6190, - "date":1458748800000, - "idx":2, - "title":"「守望先锋」最新动画短片:英雄归来", - "description":"暴雪出品的射击游戏「守望先锋」推出最新动画短片!大猩猩科学家温斯顿曾与伙伴们组成「守望先锋」特工组织,后来却被解散。当看到这并不安定的社会,温斯顿做下决定……片中回忆杀与打斗混合,温情精彩。From Xbox", - "category":"动画", - "duration":474, - "playUrl":"http://baobab.wdjcdn.com/1458715233692shouwang_x264.mp4", - "playInfo":[ - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1458715233692shouwang_x264.mp4" - } - ], - "consumption":{ - "collectionCount":1060, - "shareCount":2007, - "playCount":0, - "replyCount":43 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/2daf93803502bce502c15f73fcd9feec_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/2daf93803502bce502c15f73fcd9feec_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/0b1d5c104101684e44184f7fc55b1fc8_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/2daf93803502bce502c15f73fcd9feec_0_0.jpeg", - "webUrl":"http://wandou.im/1qzbqz", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=6190" - }, - { - "id":6016, - "date":1459008000000, - "idx":1, - "title":"周末有空吗?一起去跳伞吧!", - "description":"世界上总是有一群以作死为己任的英雄们……这次是跳伞~ 短片中各路英雄花式跳伞,俯瞰城市美景,简直惊险刺激!看着他们拍摄的跳伞视频,真是身临其境,感觉自己也在迅速坠落着~ From SHOWCASE", - "category":"运动", - "duration":220, - "playUrl":"http://baobab.wdjcdn.com/1457423557367GoPro(1).mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457554495830_6016_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1457423557367GoPro(1).mp4" - } - ], - "consumption":{ - "collectionCount":773, - "shareCount":2442, - "playCount":0, - "replyCount":71 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/a7417c2e1200edcc10b987c530fca2de_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/a7417c2e1200edcc10b987c530fca2de_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/fbfb14d1f64fbf924d7995e3b107634d_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/a7417c2e1200edcc10b987c530fca2de_0_0.jpeg", - "webUrl":"http://wandou.im/1n31xx", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=6016" - }, - { - "id":5922, - "date":1458964800000, - "idx":1, - "title":"周末号外丨谁说胖就不能跳钢管舞啦!", - "description":"谁说只有纤细女子才能将钢管舞跳得性感、挑逗、魅惑?MoneySupermarket 这支广告实力证明微胖界也有丝毫不输的钢管舞大神!看那灵活小电臀和妖娆小眼神,简直不要太性感~ From Biscuit Filmwor", - "category":"广告", - "duration":60, - "playUrl":"http://baobab.wdjcdn.com/1458912046649lingghuodepangzi_x264.mp4", - "playInfo":[ - { - "height":548, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1458912046649lingghuodepangzi_x264.mp4" - } - ], - "consumption":{ - "collectionCount":508, - "shareCount":2094, - "playCount":0, - "replyCount":41 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"乐视", - "alias":"letv", - "icon":"http://img.wdjimg.com/mms/icon/v1/6/ca/784da0db524cf8e1448574a764dcdca6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/c83878ca9ef9c0589345665aa818b717_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/c83878ca9ef9c0589345665aa818b717_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/5c30e6c8eb5a2423d8c6505e879da2a4_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/c83878ca9ef9c0589345665aa818b717_0_0.jpeg", - "webUrl":"http://wandou.im/1mbxff", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5922" - }, - { - "id":5622, - "date":1458403200000, - "idx":4, - "title":"周末食谱:煲仔饭", - "description":"周末宅家,简直难以抉择要吃什么来与这份惬意相配呢~那就来一碗煲仔饭吧。软糯的香米配上微焦的香肠,再加一颗溏心蛋。噢,别忘了几棵清爽的青菜……想想就有温暖的饱腹感~From 日食记", - "category":"开胃", - "duration":236, - "playUrl":"http://baobab.wdjcdn.com/1456208397738b(2).mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1456208612766_5622_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1456208397738b(2).mp4" - } - ], - "consumption":{ - "collectionCount":2021, - "shareCount":2792, - "playCount":0, - "replyCount":77 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"腾讯", - "alias":"qq", - "icon":"http://img.wdjimg.com/mms/icon/v1/4/2c/def8a8aa0971f93973280f7f75c772c4_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/923c833ede7c0e7bec8733006a4e32f8_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/923c833ede7c0e7bec8733006a4e32f8_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/37f01792333687981c70935927b043b8_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/923c833ede7c0e7bec8733006a4e32f8_0_0.jpeg", - "webUrl":"http://wandou.im/1jat49", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5622" - }, - { - "id":5532, - "date":1458489600000, - "idx":5, - "title":"温馨建议,还是受人摆布?", - "description":"在遇见困难时,你是否幻想过有人在你耳畔给你建议?短片中,人脑里可以植入“智能蟋蟀”,之后就如同配备了贴心管家,时刻提醒你做正确之事,甚至还可以开启自动模式当甩手掌柜…… From 3iS", - "category":"剧情", - "duration":1206, - "playUrl":"http://baobab.wdjcdn.com/1458396811995caokongshuwu_x264.mp4", - "playInfo":[ - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1458396811995caokongshuwu_x264.mp4" - } - ], - "consumption":{ - "collectionCount":1231, - "shareCount":1410, - "playCount":0, - "replyCount":55 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"Vimeo", - "alias":"vimeo", - "icon":"http://img.wdjimg.com/image/video/c3ad630be461cbb081649c9e21d6cbe3_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/4fbad361a5679214bc4e41b79e260b0b_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/4fbad361a5679214bc4e41b79e260b0b_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/95b874a8c7e75b4e1ed50e0c4e0fa442_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/4fbad361a5679214bc4e41b79e260b0b_0_0.jpeg", - "webUrl":"http://wandou.im/1i8q2x", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5532" - }, - { - "id":5018, - "date":1458489600000, - "idx":4, - "title":"洛杉矶:在城市中感受自然", - "description":"Los Angeles「洛杉矶」在西语里有“天使之城”的浪漫含义。作为仅次于纽约的美国第二大城市,洛杉矶简直是城市、人文与自然美妙结合的典范。看,或许真有天使居住于此呢~ From Andrew Walker", - "category":"旅行", - "duration":260, - "playUrl":"http://baobab.wdjcdn.com/1453449211052451530564.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1453449860362_5018_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1453449211052451530564.mp4" - } - ], - "consumption":{ - "collectionCount":1081, - "shareCount":1389, - "playCount":0, - "replyCount":35 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"Vimeo", - "alias":"vimeo", - "icon":"http://img.wdjimg.com/image/video/c3ad630be461cbb081649c9e21d6cbe3_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/86d6685b2d7846e17177bdb81dd02c95_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/86d6685b2d7846e17177bdb81dd02c95_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/b567206bd4d7863d07fbb64da2ffe019_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/86d6685b2d7846e17177bdb81dd02c95_0_0.jpeg", - "webUrl":"http://wandou.im/1a9v4p", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5018" - }, - { - "id":5858, - "date":1458576000000, - "idx":3, - "title":"白雪是最好的画布", - "description":"人们去沙滩总会在上面写写画画,以作留念,大师 Simon Beck 的事业与这个很相似。只不过他的画布不是沙滩,而是白雪。他以双脚为笔,白雪为纸,画出了令人赞叹称绝的巨型美妙图案。From #inspirasjonstryn", - "category":"记录", - "duration":360, - "playUrl":"http://baobab.wdjcdn.com/14585683555005644d.mp4", - "playInfo":[ - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14585683555005644d.mp4" - } - ], - "consumption":{ - "collectionCount":792, - "shareCount":1091, - "playCount":0, - "replyCount":29 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"Vimeo", - "alias":"vimeo", - "icon":"http://img.wdjimg.com/image/video/c3ad630be461cbb081649c9e21d6cbe3_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/9ea4b301748105d1e1fcfbfddda84e78_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/9ea4b301748105d1e1fcfbfddda84e78_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/ee14c0af9dc5ede97201a03744b4561a_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/9ea4b301748105d1e1fcfbfddda84e78_0_0.jpeg", - "webUrl":"http://wandou.im/1lx3fv", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5858" - }, - { - "id":5004, - "date":1458748800000, - "idx":5, - "title":"头发的回收再利用", - "description":"头发也是一种资源!短片记录了在山东的头发加工工厂对头发进行回收再加工,最后做成各种装饰品的过程。将头发融入天然树脂中,竟然能生出如此美妙的作品!From Studio Swine", - "category":"记录", - "duration":268, - "playUrl":"http://baobab.wdjcdn.com/1455866087616272278743.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1455866471868_5004_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1455866087616272278743.mp4" - } - ], - "consumption":{ - "collectionCount":909, - "shareCount":1628, - "playCount":14, - "replyCount":82 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"Vimeo", - "alias":"vimeo", - "icon":"http://img.wdjimg.com/image/video/c3ad630be461cbb081649c9e21d6cbe3_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/317dd08fcf8580479a5ef61325b3552e_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/317dd08fcf8580479a5ef61325b3552e_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/149ee1bd4f9775ada4f5f9dda2dc298b_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/317dd08fcf8580479a5ef61325b3552e_0_0.jpeg", - "webUrl":"http://wandou.im/1a9cym", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5004" - }, - { - "id":5972, - "date":1458748800000, - "idx":4, - "title":"24 小时吃遍纽约", - "description":"不同的人对「旅行」有不同的定义。有人偏重于游山玩水,有人偏重于体验人文,短片中的苹果姐姐则专注于品尝美食。这次她在一天中天走遍了纽约的各个街区,寻觅美食。这些美味你心动了吗?From @苹果姐姐在美国", - "category":"开胃", - "duration":225, - "playUrl":"http://baobab.wdjcdn.com/1457350288990New.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457546068527_5972_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1457350288990New.mp4" - } - ], - "consumption":{ - "collectionCount":1075, - "shareCount":1642, - "playCount":0, - "replyCount":45 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"腾讯", - "alias":"qq", - "icon":"http://img.wdjimg.com/mms/icon/v1/4/2c/def8a8aa0971f93973280f7f75c772c4_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/53b50b87675a0c0134b7c760c5f115f2_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/53b50b87675a0c0134b7c760c5f115f2_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/da9cd9244d49566e369354c9478889a3_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/53b50b87675a0c0134b7c760c5f115f2_0_0.jpeg", - "webUrl":"http://wandou.im/1mv4cb", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5972" - }, - { - "id":6126, - "date":1458316800000, - "idx":2, - "title":"蒂姆·伯顿最新力作「怪奇孤儿院」预告", - "description":"鬼才导演蒂姆·波顿的「怪奇孤儿院」推出最新预告。从小认为自己是普通人的男主其实天赋异禀,并且还不是一般的“天赋”。在结识各种与他一样不寻常的伙伴后,他发现,他的天赋还伴随着巨大的责任。From twfoxmovies", - "category":"预告", - "duration":167, - "playUrl":"http://baobab.wdjcdn.com/1458055481004g.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1458055625183_6126_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1458055481004g.mp4" - } - ], - "consumption":{ - "collectionCount":1947, - "shareCount":3803, - "playCount":0, - "replyCount":99 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/799e763d9ec299e9d5eaf4336abcc334_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/799e763d9ec299e9d5eaf4336abcc334_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/ec356f61c15d42455e12e30926945ed4_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/799e763d9ec299e9d5eaf4336abcc334_0_0.jpeg", - "webUrl":"http://wandou.im/1p0xcq", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=6126" - }, - { - "id":5938, - "date":1458576000000, - "idx":4, - "title":"「a Drop」:坠落还是飞翔?", - "description":"短片「a Drop」以炫酷的特效讲述了男子从荒芜之城坠落逃离的过程,并采取开放式结局,留给观者想象的空间。男子为何向下坠落,后来又为何反向跃出?这在坠落的过程中,竟然给人以飞翔之感。From Julien Vanhoenacker", - "category":"创意", - "duration":429, - "playUrl":"http://baobab.wdjcdn.com/1457175758944481773276.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457536400105_5938_854x480.mp4" - }, - { - "height":544, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1457175758944481773276.mp4" - } - ], - "consumption":{ - "collectionCount":976, - "shareCount":1035, - "playCount":0, - "replyCount":59 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"Vimeo", - "alias":"vimeo", - "icon":"http://img.wdjimg.com/image/video/c3ad630be461cbb081649c9e21d6cbe3_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/695169b6b4e867a558e2c16ee3d97129_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/695169b6b4e867a558e2c16ee3d97129_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/5ea86dab9c48502404d8711531c6c50c_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/695169b6b4e867a558e2c16ee3d97129_0_0.jpeg", - "webUrl":"http://wandou.im/1md6w7", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5938" - }, - { - "id":5830, - "date":1458446400000, - "idx":1, - "title":"周末号外丨美国公路的狂野之旅", - "description":"走过了美国西海岸和东海岸,@修飞机的摄影师 和小伙伴们开始了美国西部狂野之旅。行程包括西雅图、大提顿国家公园、黄石国家公园、盐湖城、大峡谷国家公园、马蹄湾、羚羊谷、拉斯维加斯等等。", - "category":"旅行", - "duration":247, - "playUrl":"http://baobab.wdjcdn.com/1457009175183M.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457511406483_5830_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1457009175183M.mp4" - } - ], - "consumption":{ - "collectionCount":1148, - "shareCount":1774, - "playCount":0, - "replyCount":40 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"腾讯", - "alias":"qq", - "icon":"http://img.wdjimg.com/mms/icon/v1/4/2c/def8a8aa0971f93973280f7f75c772c4_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/ed080e4601410a3370f3b840da6cb304_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/ed080e4601410a3370f3b840da6cb304_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/f10f7215115805932c03ed653e302400_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/ed080e4601410a3370f3b840da6cb304_0_0.jpeg", - "webUrl":"http://wandou.im/1lwb4j", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5830" - }, - { - "id":5608, - "date":1458835200000, - "idx":3, - "title":"Sonder:每人都有自己的故事", - "description":"你是自己生活的主角,擦肩的陌生人、朋友、敌人都作为配角活跃在你的舞台上。然而在他人的生活中,你又何尝不是配角?每个人都有自己的故事,都在属于自己的舞台上闪闪发光。From The Dictionary of Obscure Sorrows", - "category":"综合", - "duration":158, - "playUrl":"http://baobab.wdjcdn.com/1456194424399S(23).mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1456194764970_5608_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1456194424399S(23).mp4" - } - ], - "consumption":{ - "collectionCount":928, - "shareCount":1395, - "playCount":0, - "replyCount":24 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/53170c1097b3614ef6c7e1a3ce25164a_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/53170c1097b3614ef6c7e1a3ce25164a_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/e1a048d381fb3ab248c14563fcc4b645_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/53170c1097b3614ef6c7e1a3ce25164a_0_0.jpeg", - "webUrl":"http://wandou.im/1j8dgx", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5608" - }, - { - "id":5824, - "date":1458446400000, - "idx":2, - "title":"周末号外丨川普版权力的游戏", - "description":"川普,你走错片场啦!美国总统候选人唐纳德·川普最近一路蹿红,引起热议。有网友突发奇想,将其代入「权力的游戏」……竟然,毫无违和感! From @脱了衣服转身", - "category":"综合", - "duration":160, - "playUrl":"http://baobab.wdjcdn.com/14570071502774.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457007294968_5824_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14570071502774.mp4" - } - ], - "consumption":{ - "collectionCount":447, - "shareCount":1602, - "playCount":0, - "replyCount":57 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"乐视", - "alias":"letv", - "icon":"http://img.wdjimg.com/mms/icon/v1/6/ca/784da0db524cf8e1448574a764dcdca6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/acdba01e52efe8082d7c33556cf61549_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/acdba01e52efe8082d7c33556cf61549_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/54192711f86448909d2a5ca56e65dcf9_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/acdba01e52efe8082d7c33556cf61549_0_0.jpeg", - "webUrl":"http://wandou.im/1lw0gn", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5824" - }, - { - "id":4866, - "date":1458316800000, - "idx":4, - "title":"奥斯卡经典:宵禁", - "description":"什么事情才能阻止割腕惨剧的发生?男主本已一心向死,割腕躺在浴缸中等待死神降临。可接到一通电话后,他却立马将伤口包扎,匆匆出门……有的时候,“被需要感”往往有出人意料的治愈效果。From 哼", - "category":"剧情", - "duration":1182, - "playUrl":"http://baobab.wdjcdn.com/1452761514802Curfew.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1452764886841_4866_854x480.mp4" - }, - { - "height":538, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1452761514802Curfew.mp4" - } - ], - "consumption":{ - "collectionCount":2343, - "shareCount":2445, - "playCount":0, - "replyCount":76 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"YouTube", - "alias":"youtube", - "icon":"http://img.wdjimg.com/image/video/fa20228bc5b921e837156923a58713f6_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/21912be28e75eaf5cab64e242f89ec91_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/21912be28e75eaf5cab64e242f89ec91_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/a9096d18c5647e11a870a2c994d84cba_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/21912be28e75eaf5cab64e242f89ec91_0_0.jpeg", - "webUrl":"http://wandou.im/182hfz", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=4866" - }, - { - "id":5918, - "date":1458964800000, - "idx":5, - "title":"周末号外丨中国第一高楼", - "description":"高度 632 米的上海中心大厦是当前中国第一高楼,仅次于迪拜哈利法塔,排名世界第二。短片记录了上海中心大厦四年的建设过程,也呈现了上海在这四年中的变化。From Joe Nafis", - "category":"记录", - "duration":168, - "playUrl":"http://baobab.wdjcdn.com/1457162012752491010143.mp4", - "playInfo":[ - { - "height":480, - "width":854, - "name":"标清", - "type":"normal", - "url":"http://baobab.wdjcdn.com/1457529788412_5918_854x480.mp4" - }, - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/1457162012752491010143.mp4" - } - ], - "consumption":{ - "collectionCount":704, - "shareCount":1238, - "playCount":0, - "replyCount":33 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"Vimeo", - "alias":"vimeo", - "icon":"http://img.wdjimg.com/image/video/c3ad630be461cbb081649c9e21d6cbe3_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/447f973848167ee5e44b67c8d4df9839_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/447f973848167ee5e44b67c8d4df9839_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/1e65d268ac9f080d0707ba74e243161d_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/447f973848167ee5e44b67c8d4df9839_0_0.jpeg", - "webUrl":"http://wandou.im/1mbgy4", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=5918" - }, - { - "id":6232, - "date":1458835200000, - "idx":4, - "title":"春天来了,用冰淇淋庆祝一下吧~", - "description":"春天正是吃冰淇淋的好季节!(诶是吗?)短片带来两道草莓味冰淇淋甜点。冰淇淋融入口中凉凉的触感,再加入草莓果肉,清爽而不冰凉,这正像春天那种和煦的感觉啊~(嗯其实就是想吃冰了_(:зゝ∠)_)From @即刻video", - "category":"开胃", - "duration":93, - "playUrl":"http://baobab.wdjcdn.com/14587897797934.mp4", - "playInfo":[ - { - "height":720, - "width":1280, - "name":"高清", - "type":"high", - "url":"http://baobab.wdjcdn.com/14587897797934.mp4" - } - ], - "consumption":{ - "collectionCount":971, - "shareCount":1097, - "playCount":0, - "replyCount":20 - }, - "promotion":null, - "waterMarks":null, - "provider":{ - "name":"腾讯", - "alias":"qq", - "icon":"http://img.wdjimg.com/mms/icon/v1/4/2c/def8a8aa0971f93973280f7f75c772c4_256_256.png" - }, - "author":null, - "adTrack":null, - "shareAdTrack":null, - "favoriteAdTrack":null, - "webAdTrack":null, - "coverForFeed":"http://img.wdjimg.com/image/video/11844a5f2ee70ee595a597eb79f875a3_0_0.jpeg", - "coverForDetail":"http://img.wdjimg.com/image/video/11844a5f2ee70ee595a597eb79f875a3_0_0.jpeg", - "coverBlurred":"http://img.wdjimg.com/image/video/0b42fe2552afc36fbde3919afdcba269_0_0.jpeg", - "coverForSharing":"http://img.wdjimg.com/image/video/11844a5f2ee70ee595a597eb79f875a3_0_0.jpeg", - "webUrl":"http://wandou.im/1rglsy", - "rawWebUrl":"http://www.wandoujia.com/eyepetizer/detail.html?vid=6232" - } - ], - "count":30, - "total":0, - "nextPageUrl":null -} - diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Tool/VIDCachesTool.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Tool/VIDCachesTool.h" new file mode 100644 index 00000000..a6ce1111 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Tool/VIDCachesTool.h" @@ -0,0 +1,26 @@ +// +// VIDCachesTool.h +// iOSProject +// +// Created by HuXuPeng on 2018/4/23. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import +#import "MJDownload.h" +#define VIDSharedTool VIDCachesTool.sharedTool +#define VIDToolDownloadManager VIDSharedTool.downloadManager + +@interface VIDCachesTool : NSObject + ++ (instancetype)sharedTool; + +@property (nonatomic, strong) MJDownloadManager *downloadManager; + +// 缓存url +- (void)downLoad:(NSString *)url; + +// 缓存url +- (void)deleteFile:(NSString *)url; + +@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Tool/VIDCachesTool.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Tool/VIDCachesTool.m" new file mode 100644 index 00000000..7ea39dfb --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/Tool/VIDCachesTool.m" @@ -0,0 +1,84 @@ +// +// VIDCachesTool.m +// iOSProject +// +// Created by HuXuPeng on 2018/4/23. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "VIDCachesTool.h" + +static NSString *const VIDCachesToolId = @"VIDCachesToolId"; + +@interface VIDCachesTool () +{ + NSMutableArray *_cachesUrls; +} +@end + +@implementation VIDCachesTool + +- (void)downLoad:(NSString *)url { + [_cachesUrls addObject:url.copy]; + [self.downloadManager download:url]; + [_cachesUrls writeToFile:self.filePath atomically:YES]; +} + +- (void)deleteFile:(NSString *)url { + [_cachesUrls enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if ([obj isEqualToString:url]) { + [self->_cachesUrls removeObject:obj]; + } + }]; + + [self.downloadManager.downloadInfoArray removeObject:[self.downloadManager downloadInfoForURL:url]]; + [_cachesUrls writeToFile:self.filePath atomically:YES]; +} + +- (instancetype)init +{ + self = [super init]; + if (self) { + + _cachesUrls = [NSMutableArray arrayWithContentsOfFile:self.filePath]; + + if (!_cachesUrls) { + [[NSFileManager defaultManager] createDirectoryAtPath:[self.filePath stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:nil]; + _cachesUrls = [NSMutableArray array]; + // 写入文件 + [_cachesUrls writeToFile:self.filePath atomically:YES]; + } + + [_cachesUrls enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + [self.downloadManager downloadInfoForURL:obj]; + }]; + } + return self; +} + +- (NSString *)filePath +{ + NSString *filePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject stringByAppendingPathComponent:@"videoDownload/downloadData.plist"]; + return filePath; +} + +#pragma mark - getter ++ (instancetype)sharedTool { + static VIDCachesTool *_instance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _instance = [[self alloc] init]; + }); + return _instance; +} + +- (MJDownloadManager *)downloadManager +{ + if(!_downloadManager) + { + _downloadManager = [MJDownloadManager managerWithIdentifier:VIDCachesToolId]; + } + return _downloadManager; +} + +@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.h" deleted file mode 100644 index 9b570fbf..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.h" +++ /dev/null @@ -1,26 +0,0 @@ -// -// VIDCollectionViewVideoCell.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/23. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import -#import "ZFVideoModel.h" - -@interface VIDCollectionViewVideoCell : UICollectionViewCell - - - - -@property (weak, nonatomic ) IBOutlet UIImageView *picView; - -+ (instancetype)videoCellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath; - -/** model */ -@property (nonatomic, strong) ZFVideoModel *model; -/** 播放按钮block */ -@property (nonatomic, copy ) void(^playBlock)(UIButton *btn); - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.m" deleted file mode 100644 index eb710496..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.m" +++ /dev/null @@ -1,105 +0,0 @@ -// -// VIDCollectionViewVideoCell.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/23. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "VIDCollectionViewVideoCell.h" - -@interface VIDCollectionViewVideoCell () - - -@property (weak, nonatomic ) IBOutlet UILabel *titleLabel; -@property (nonatomic, weak) IBOutlet UIButton *playBtn; - -@end - -@implementation VIDCollectionViewVideoCell - - -+ (instancetype)videoCellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath -{ - VIDCollectionViewVideoCell *cell = nil; - - - if (cell == nil) { - - @try { - - cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([self class]) forIndexPath:indexPath]; - - } @catch (NSException *exception) { - - NSLog(@"%@", exception); - - if (!cell) { - - UINib *cellNib = [UINib nibWithNibName:NSStringFromClass(self) bundle:[NSBundle mainBundle]]; - - if (!cellNib) { - [collectionView registerClass:self forCellWithReuseIdentifier:NSStringFromClass(self)]; - }else - { - [collectionView registerNib:cellNib forCellWithReuseIdentifier:NSStringFromClass(self)]; - } - - } - - } @finally { - - cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([self class]) forIndexPath:indexPath]; - } - - } - - return cell; - -} - -- (instancetype)initWithFrame:(CGRect)frame -{ - if (self = [super initWithFrame:frame]) { - [self setupUIOnce]; - } - return self; -} - -- (void)awakeFromNib -{ - [super awakeFromNib]; - [self setupUIOnce]; -} - -- (void)setupUIOnce -{ - - self.picView.tag = 1033; - self.picView.userInteractionEnabled = YES; - [self.picView addSubview:self.playBtn]; - -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - - - -} - -- (void)setModel:(ZFVideoModel *)model { - - [self.picView sd_setImageWithURL:[NSURL URLWithString:model.coverForFeed] placeholderImage:[UIImage imageWithColor:[UIColor RandomColor]]]; - - self.titleLabel.text = model.title; -} - -- (IBAction)play:(UIButton *)sender { - if (self.playBlock) { - self.playBlock(sender); - } -} - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.xib" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.xib" deleted file mode 100644 index 313a021a..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDCollectionViewVideoCell.xib" +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadedCell.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadedCell.h" new file mode 100644 index 00000000..579b053c --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadedCell.h" @@ -0,0 +1,14 @@ +// +// VIDDownLoadedCell.h +// iOSProject +// +// Created by HuXuPeng on 2018/4/23. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import + +@interface VIDDownLoadedCell : UITableViewCell +/** <#digest#> */ +@property (nonatomic, strong) MJDownloadInfo *fileInfo; +@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadedCell.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadedCell.m" new file mode 100644 index 00000000..8dfbc53c --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadedCell.m" @@ -0,0 +1,24 @@ +// +// VIDDownLoadedCell.m +// iOSProject +// +// Created by HuXuPeng on 2018/4/23. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "VIDDownLoadedCell.h" + +@interface VIDDownLoadedCell () +@property (weak, nonatomic) IBOutlet UILabel *fileNameLabel; +@property (weak, nonatomic) IBOutlet UILabel *fileSizeLabel; + +@end + +@implementation VIDDownLoadedCell + +- (void)setFileInfo:(MJDownloadInfo *)fileInfo { + _fileInfo = fileInfo; + self.fileNameLabel.text = fileInfo.file; + self.fileSizeLabel.text = [NSString stringWithFormat:@"%.2lf MB", fileInfo.totalBytesExpectedToWrite / 1024.0 / 1024.0]; +} +@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadingCell.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadingCell.h" new file mode 100644 index 00000000..dea0263d --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadingCell.h" @@ -0,0 +1,14 @@ +// +// VIDDownLoadingCell.h +// iOSProject +// +// Created by HuXuPeng on 2018/4/23. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import + +@interface VIDDownLoadingCell : UITableViewCell +/** <#digest#> */ +@property (nonatomic, strong) MJDownloadInfo *fileInfo; +@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadingCell.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadingCell.m" new file mode 100644 index 00000000..784f46d0 --- /dev/null +++ "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDDownLoadingCell.m" @@ -0,0 +1,74 @@ +// +// VIDDownLoadingCell.m +// iOSProject +// +// Created by HuXuPeng on 2018/4/23. +// Copyright © 2018年 github.com/njhu. All rights reserved. +// + +#import "VIDDownLoadingCell.h" +#import "VIDCachesTool.h" + +@interface VIDDownLoadingCell () +{ + NSTimeInterval _lastTime; + NSUInteger _lastReceiveSize; +} +@property (weak, nonatomic) IBOutlet UILabel *fileNameLabel; +@property (weak, nonatomic) IBOutlet UIProgressView *progressView; +@property (weak, nonatomic) IBOutlet UIButton *stateBtn; +@property (weak, nonatomic) IBOutlet UILabel *progressLabel; +@end + +@implementation VIDDownLoadingCell + + +- (void)setFileInfo:(MJDownloadInfo *)fileInfo { + _fileInfo = fileInfo; + self.fileNameLabel.text = fileInfo.file; + self.progressView.progress = (CGFloat)fileInfo.totalBytesWritten / fileInfo.totalBytesExpectedToWrite; + + if (_lastTime) { + CGFloat currentSize = (CGFloat)fileInfo.bytesWritten / 1024.0; + CGFloat speed = currentSize / (CFAbsoluteTimeGetCurrent() - _lastTime); + self.progressLabel.text = [NSString stringWithFormat:@"%.2lf kb/s", speed]; + } + _lastTime = CFAbsoluteTimeGetCurrent(); + + MJDownloadState state = fileInfo.state; +// MJDownloadStateNone = 0, // 闲置状态(除后面几种状态以外的其他状态) +// MJDownloadStateWillResume, // 即将下载(等待下载) +// MJDownloadStateResumed, // 下载中 +// MJDownloadStateSuspened, // 暂停中 +// MJDownloadStateCompleted // 已经完全下载完毕 + switch (state) { + case MJDownloadStateNone: + [self.stateBtn setTitle:@"闲置状态" forState:UIControlStateNormal]; + break; + case MJDownloadStateWillResume: + [self.stateBtn setTitle:@"等待下载" forState:UIControlStateNormal]; + break; + case MJDownloadStateResumed: + [self.stateBtn setTitle:@"下载中" forState:UIControlStateNormal]; + break; + case MJDownloadStateSuspened: + [self.stateBtn setTitle:@"暂停中" forState:UIControlStateNormal]; + break; + case MJDownloadStateCompleted: + [self.stateBtn setTitle:@"下载完毕" forState:UIControlStateNormal]; + break; + } +} +- (IBAction)stateBtnClick:(UIButton *)sender { + MJDownloadState state = self.fileInfo.state; + + if (state == MJDownloadStateSuspened) { + [VIDToolDownloadManager resume:self.fileInfo.url]; + }else if (state == MJDownloadStateResumed) { + [VIDToolDownloadManager suspend:self.fileInfo.url]; + }else if (state == MJDownloadStateNone) { + [VIDToolDownloadManager download:self.fileInfo.url]; + } +} + +@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.h" deleted file mode 100644 index 443ab00b..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.h" +++ /dev/null @@ -1,23 +0,0 @@ -// -// VIDTableViewVideoCell.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/22. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import -#import "ZFVideoModel.h" - -@interface VIDTableViewVideoCell : UITableViewCell - -@property (weak, nonatomic ) IBOutlet UIImageView *picView; - -+ (instancetype)videoCellWithTableView:(UITableView *)tableView; - -/** model */ -@property (nonatomic, strong) ZFVideoModel *model; -/** 播放按钮block */ -@property (nonatomic, copy ) void(^playBlock)(UIButton *btn); - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.m" deleted file mode 100644 index 8997436a..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.m" +++ /dev/null @@ -1,100 +0,0 @@ -// -// VIDTableViewVideoCell.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/22. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "VIDTableViewVideoCell.h" - -@interface VIDTableViewVideoCell () - - - -@property (weak, nonatomic ) IBOutlet UILabel *titleLabel; -@property (nonatomic, weak) IBOutlet UIButton *playBtn; - -@end - -@implementation VIDTableViewVideoCell - -+ (instancetype)videoCellWithTableView:(UITableView *)tableView -{ - - VIDTableViewVideoCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([self class])]; - - if (cell == nil) { - - @try { - - cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:nil options:nil].lastObject; - - } @catch (NSException *exception) { - - NSLog(@"%@", exception); - - } @finally { - - if (cell == nil) { - cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(self)]; - } - - } - - } - - return cell; - -} - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier -{ - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self setupUIOnce]; - } - - return self; -} - -- (void)awakeFromNib -{ - [super awakeFromNib]; - [self setupUIOnce]; -} - -- (void)setupUIOnce -{ - self.selectionStyle = UITableViewCellSelectionStyleNone; - - self.picView.tag = 1032; - self.picView.userInteractionEnabled = YES; - [self.picView addSubview:self.playBtn]; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - -} - -- (void)setModel:(ZFVideoModel *)model { - _model = model; - [self.picView sd_setImageWithURL:[NSURL URLWithString:model.coverForFeed] placeholderImage:[UIImage imageWithColor:[UIColor RandomColor]]]; - - self.titleLabel.text = model.title; -} - -- (IBAction)play:(UIButton *)sender { - if (self.playBlock) { - self.playBlock(sender); - } -} - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.xib" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.xib" deleted file mode 100644 index b2a34fa3..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDTableViewVideoCell.xib" +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.h" deleted file mode 100644 index 5adf4ff9..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.h" +++ /dev/null @@ -1,20 +0,0 @@ -// -// VIDVideoDownloadedCell.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/26. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import -#import "ZFDownloadManager.h" - -@interface VIDVideoDownloadedCell : UITableViewCell - -+ (instancetype)videoCellWithTableView:(UITableView *)tableView; - - -/** <#digest#> */ -@property (nonatomic, strong) ZFFileModel *fileInfo; - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.m" deleted file mode 100644 index c61ed207..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.m" +++ /dev/null @@ -1,92 +0,0 @@ -// -// VIDVideoDownloadedCell.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/26. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "VIDVideoDownloadedCell.h" - -@interface VIDVideoDownloadedCell () -@property (weak, nonatomic) IBOutlet UIImageView *fileImageView; -@property (weak, nonatomic) IBOutlet UILabel *fileNameLabel; -@property (weak, nonatomic) IBOutlet UILabel *fileSizeLabel; - -@end - -@implementation VIDVideoDownloadedCell - -+ (instancetype)videoCellWithTableView:(UITableView *)tableView -{ - - VIDVideoDownloadedCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([self class])]; - - if (cell == nil) { - - @try { - - cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:nil options:nil].lastObject; - - } @catch (NSException *exception) { - - NSLog(@"%@", exception); - - } @finally { - - if (cell == nil) { - cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(self)]; - } - - } - - } - - return cell; - -} - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier -{ - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self setupUIOnce]; - } - - return self; -} - -- (void)awakeFromNib -{ - [super awakeFromNib]; - [self setupUIOnce]; -} - -- (void)setupUIOnce -{ - - - -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - -} - -- (void)setFileInfo:(ZFFileModel *)fileInfo -{ - _fileInfo = fileInfo; - NSString *totalSize = [ZFCommonHelper getFileSizeString:fileInfo.fileSize]; - self.fileNameLabel.text = fileInfo.fileName; - self.fileSizeLabel.text = totalSize; -} - - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.xib" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.xib" deleted file mode 100644 index 04d570c9..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadedCell.xib" +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.h" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.h" deleted file mode 100644 index 3788969e..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.h" +++ /dev/null @@ -1,26 +0,0 @@ -// -// VIDVideoDownloadingCell.h -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/26. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import -#import "ZFDownloadManager.h" - -@interface VIDVideoDownloadingCell : UITableViewCell - -+ (instancetype)videoCellWithTableView:(UITableView *)tableView; - - -/** <#digest#> */ -@property (nonatomic, strong) ZFFileModel *fileInfo; - -/** <#digest#> */ -@property (weak, nonatomic) ZFHttpRequest *request; - -/** <#digest#> */ -@property (nonatomic, copy) void(^startOrStopClick)(); - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.m" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.m" deleted file mode 100644 index 82d0c85c..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.m" +++ /dev/null @@ -1,164 +0,0 @@ -// -// VIDVideoDownloadingCell.m -// PLMMPRJK -// -// Created by HuXuPeng on 2017/9/26. -// Copyright © 2017年 GoMePrjk. All rights reserved. -// - -#import "VIDVideoDownloadingCell.h" -#import -#import - -@interface VIDVideoDownloadingCell () -@property (weak, nonatomic) IBOutlet UILabel *fileNameLabel; -@property (weak, nonatomic) IBOutlet UIProgressView *downloadProgressView; -@property (weak, nonatomic) IBOutlet UIButton *stopOrStartBtn; -@property (weak, nonatomic) IBOutlet UILabel *downloadedSizeLabel; -@property (weak, nonatomic) IBOutlet UILabel *totalSizeLabel; -@property (weak, nonatomic) IBOutlet UILabel *downloadedRadioLabel; -@property (weak, nonatomic) IBOutlet UILabel *speedStateLabel; - -@end - -@implementation VIDVideoDownloadingCell - -+ (instancetype)videoCellWithTableView:(UITableView *)tableView -{ - - VIDVideoDownloadingCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([self class])]; - - if (cell == nil) { - - @try { - - cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:nil options:nil].lastObject; - - } @catch (NSException *exception) { - - NSLog(@"%@", exception); - - } @finally { - - if (cell == nil) { - cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass(self)]; - } - - } - - } - - return cell; - -} - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier -{ - if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { - [self setupUIOnce]; - } - - return self; -} - -- (void)awakeFromNib -{ - [super awakeFromNib]; - [self setupUIOnce]; -} - -- (void)setupUIOnce -{ - - - -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - -} -- (IBAction)clickDownloadBtn:(UIButton *)sender { - - // 执行操作过程中应该禁止该按键的响应 否则会引起异常 - sender.userInteractionEnabled = NO; - ZFFileModel *downFile = self.fileInfo; - ZFDownloadManager *filedownmanage = [ZFDownloadManager sharedDownloadManager]; - if(downFile.downloadState == ZFDownloading) { //文件正在下载,点击之后暂停下载 有可能进入等待状态 - self.stopOrStartBtn.selected = YES; - [filedownmanage stopRequest:self.request]; - } else { - self.stopOrStartBtn.selected = NO; - [filedownmanage resumeRequest:self.request]; - } - - // 暂停意味着这个Cell里的ASIHttprequest已被释放,要及时更新table的数据,使最新的ASIHttpreqst控制Cell - if (self.startOrStopClick) { - self.startOrStopClick(); - } - sender.userInteractionEnabled = YES; -} - - - - -- (void)setFileInfo:(ZFFileModel *)fileInfo -{ - _fileInfo = fileInfo; - self.fileNameLabel.text = fileInfo.fileName; - // 服务器可能响应的慢,拿不到视频总长度 && 不是下载状态 - if ([fileInfo.fileSize longLongValue] == 0 && !(fileInfo.downloadState == ZFDownloading)) { - self.speedStateLabel.text = @""; - if (fileInfo.downloadState == ZFStopDownload) { - self.speedStateLabel.text = @"已暂停"; - } else if (fileInfo.downloadState == ZFWillDownload) { - self.stopOrStartBtn.selected = YES; - self.speedStateLabel.text = @"等待下载"; - } - self.downloadProgressView.progress = 0.0; - return; - } - NSString *currentSize = [ZFCommonHelper getFileSizeString:fileInfo.fileReceivedSize]; - NSString *totalSize = [ZFCommonHelper getFileSizeString:fileInfo.fileSize]; - // 下载进度 - float progress = (float)[fileInfo.fileReceivedSize longLongValue] / [fileInfo.fileSize longLongValue]; - - self.downloadedSizeLabel.text = currentSize; - self.totalSizeLabel.text = totalSize; - self.downloadedRadioLabel.text = [NSString stringWithFormat:@"(%.2f%%)",progress*100]; - - self.downloadProgressView.progress = progress; - - NSString *speed = [NSString stringWithFormat:@"%@/S",[ZFCommonHelper getFileSizeString:[NSString stringWithFormat:@"%lu",[ASIHTTPRequest averageBandwidthUsedPerSecond]]]]; - - - if (progress > 0) { - self.speedStateLabel.text = speed; - } else { - self.speedStateLabel.text = @"正在获取"; - } - - if (fileInfo.downloadState == ZFDownloading) { //文件正在下载 - self.stopOrStartBtn.selected = NO; - } else if (fileInfo.downloadState == ZFStopDownload&&!fileInfo.error) { - self.stopOrStartBtn.selected = YES; - self.speedStateLabel.text = @"已暂停"; - }else if (fileInfo.downloadState == ZFWillDownload&&!fileInfo.error) { - self.stopOrStartBtn.selected = YES; - self.speedStateLabel.text = @"等待下载"; - } else if (fileInfo.error) { - self.stopOrStartBtn.selected = YES; - self.speedStateLabel.text = @"错误"; - } -} - - - -@end diff --git "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.xib" "b/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.xib" deleted file mode 100644 index 075d0fd9..00000000 --- "a/iOSProject/iOSProject/Classes/\350\247\206\351\242\221\346\222\255\346\224\276/View/VIDVideoDownloadingCell.xib" +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iOSProject/iOSProject/Info.plist b/iOSProject/iOSProject/Info.plist index 1e2ff9fc..79fce959 100644 --- a/iOSProject/iOSProject/Info.plist +++ b/iOSProject/iOSProject/Info.plist @@ -7,18 +7,13 @@ CFBundleDisplayName iOSProject CFBundleDocumentTypes - - - CFBundleTypeName - MKDirectionsRequest - LSItemContentTypes - - com.apple.maps.directionsrequest - - - + CFBundleExecutable $(EXECUTABLE_NAME) + CFBundleIcons + + CFBundleIcons~ipad + CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion @@ -27,8 +22,10 @@ $(PRODUCT_NAME) CFBundlePackageType APPL + UIUserInterfaceStyle + Light CFBundleShortVersionString - 2.0.0 + 1.0.0 CFBundleURLTypes @@ -73,7 +70,9 @@ CFBundleVersion - 200 + 100 + ITSAppUsesNonExemptEncryption + LSApplicationQueriesSchemes wechat @@ -159,21 +158,6 @@ LSRequiresIPhoneOS - MKDirectionsApplicationSupportedModes - - MKDirectionsModeBike - MKDirectionsModeBus - MKDirectionsModeCar - MKDirectionsModeFerry - MKDirectionsModeOther - MKDirectionsModePedestrian - MKDirectionsModePlane - MKDirectionsModeRideShare - MKDirectionsModeStreetCar - MKDirectionsModeSubway - MKDirectionsModeTaxi - MKDirectionsModeTrain - NSAppTransportSecurity NSAllowsArbitraryLoads @@ -194,6 +178,11 @@ NSIncludesSubdomains + localhost + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + fbcdn.net NSExceptionRequiresForwardSecrecy @@ -312,40 +301,30 @@ NSBluetoothPeripheralUsageDescription - App需要您的同意,才能访问蓝牙 + i开发知识需要连接外部设备中访问蓝牙权限 NSCalendarsUsageDescription - App需要您的同意,才能访问日历 + i开发知识需要读写日历功能中使用到日历权限 NSCameraUsageDescription - App需要使用您的相机 + i开发知识在扫码和图片上传中访问您的相册,相机权限 NSLocationAlwaysUsageDescription - 获取当前的位置 + i开发知识需要获取当前位置访问您的定位权限 NSLocationWhenInUseUsageDescription - 获取当前的位置 + i开发知识需要获取当前位置访问您的定位权限 NSMicrophoneUsageDescription - 需要使用您的麦克风 + i开发知识需要访问您的麦克风权限进行录音 NSMotionUsageDescription - App需要您的同意,才能访问运动与健身 - NSPhotoLibraryUsageDescription - 需要访问您的相册 + i开发知识需要统计运动与健身情况获取您的权限 NSPhotoLibraryAddUsageDescription - 需要添加到相册 - UIBackgroundModes - - audio - bluetooth-central - bluetooth-peripheral - external-accessory - fetch - location - newsstand-content - remote-notification - voip - + i开发之时需要把图片添加到相册 + NSPhotoLibraryUsageDescription + i开发知识需要访问您的相册,上传图片 UIRequiredDeviceCapabilities armv7 gamekit + UIStatusBarHidden + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait @@ -353,6 +332,6 @@ UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance - + diff --git a/iOSProject/iOSProject/LMJAppDelegate.m b/iOSProject/iOSProject/LMJAppDelegate.m index 846f7344..b7481555 100644 --- a/iOSProject/iOSProject/LMJAppDelegate.m +++ b/iOSProject/iOSProject/LMJAppDelegate.m @@ -14,31 +14,19 @@ #import "LMJUMengHelper.h" #import -@interface LMJAppDelegate() - -@end - @implementation LMJAppDelegate -- (UIWindow *)window -{ - if(!_window) - { - _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - _window.backgroundColor = [UIColor RandomColor]; - [_window makeKeyAndVisible]; - } - return _window; -} - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window.rootViewController = [[LMJTabBarController alloc] init]; - if (![GVUserDefaults standardUserDefaults].isLanuchedApp) { - // 欢迎视图 - [LMJIntroductoryPagesHelper showIntroductoryPageView:@[@"intro_0.jpg", @"intro_1.jpg", @"intro_2.jpg", @"intro_3.jpg"]]; - } + // 检查更新 + [[LMJRequestManager sharedManager] GET:[LMJNJHuBaseUrl stringByAppendingPathComponent:@"jsons/updateapp.json"] parameters:nil completion:^(LMJBaseResponse *response) { + [self checkVersion:response]; + }]; + + // 欢迎视图 + [LMJIntroductoryPagesHelper showIntroductoryPageView:@[@"intro_0.jpg", @"intro_1.jpg", @"intro_2.jpg", @"intro_3.jpg"]]; NSArray *imagesURLS = @[@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1495189872684&di=03f9df0b71bb536223236235515cf227&imgtype=0&src=http%3A%2F%2Fatt1.dzwww.com%2Fforum%2F201405%2F29%2F1033545qqmieznviecgdmm.gif", @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1495189851096&di=224fad7f17468c2cc080221dd78a4abf&imgtype=0&src=http%3A%2F%2Fimg3.duitang.com%2Fuploads%2Fitem%2F201505%2F12%2F20150512124019_GPjEJ.gif"]; // 启动广告 @@ -51,21 +39,17 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [self.window addSubview:[[YYFPSLabel alloc] initWithFrame:CGRectMake(20, 70, 0, 0)]]; // 友盟统计 - [LMJUMengHelper UMAnalyticStart]; +// [LMJUMengHelper UMAnalyticStart]; // 友盟社交化 - [LMJUMengHelper UMSocialStart]; +// [LMJUMengHelper UMSocialStart]; // 友盟推送 - [LMJUMengHelper UMPushStart:launchOptions]; - +// [LMJUMengHelper UMPushStart:launchOptions]; + if (launchOptions) { - [UIAlertController mj_showAlertWithTitle:@"有launchOptions!!" message:launchOptions.description appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { - alertMaker.addActionCancelTitle(@"cancel").addActionDestructiveTitle(@"按钮1"); } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { - }]; - } return YES; } @@ -74,12 +58,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( #pragma mark -应用跳转 //Universal link -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { if (userActivity.webpageURL) { - NSLog(@"%@", userActivity.webpageURL); - [UIAlertController mj_showAlertWithTitle:@"web跳转应用" message:userActivity.webpageURL.description appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { alertMaker.addActionDefaultTitle(@"确认"); @@ -89,63 +71,37 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserAct } return YES; - - //如果使用了Universal link ,此方法必写 - // return [MWApi continueUserActivity:userActivity]; - } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { + BOOL result = [[UMSocialManager defaultManager] handleOpenURL:url sourceApplication:sourceApplication annotation:annotation]; + if (!result) { + // 其他如支付等SDK的回调 + + } + return result; +} +#pragma clang diagnostic pop //iOS9+scheme跳转 - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(nonnull NSDictionary *)options { - //必写 - // [MWApi routeMLink:url]; - //6.3的新的API调用,是为了兼容国外平台(例如:新版facebookSDK,VK等)的调用[如果用6.2的api调用会没有回调],对国内平台没有影响 BOOL result = [[UMSocialManager defaultManager] handleOpenURL:url options:options]; if (!result) { // 其他如支付等SDK的回调 - } if (url) { NSLog(@"%@", url); [UIAlertController mj_showAlertWithTitle:@"iOS9+scheme跳转应用" message:url.description appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { - + alertMaker.addActionDefaultTitle(@"确认"); } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { - - }]; - - } - - - return result; -} -// 支持所有iOS9以下系统,scheme 跳转 -- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation -{ - //必写 - // [MWApi routeMLink:url]; - - //6.3的新的API调用,是为了兼容国外平台(例如:新版facebookSDK,VK等)的调用[如果用6.2的api调用会没有回调],对国内平台没有影响 - BOOL result = [[UMSocialManager defaultManager] handleOpenURL:url sourceApplication:sourceApplication annotation:annotation]; - - if (!result) { - // 其他如支付等SDK的回调 - } - if (url) { - - NSLog(@"%@", url); - - NSLog(@"%@", url); - [UIAlertController mj_showAlertWithTitle:@"iOS9以下系统scheme跳转应用" message:url.description appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { - - alertMaker.addActionDefaultTitle(@"确认"); - } actionsBlock:nil]; - + }]; } return result; @@ -155,24 +111,24 @@ - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceAppl #pragma mark - deviceToken - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - NSString * string =[[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] + NSString * string = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""]; NSLog(@"%@", string); - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ -// [[EMClient sharedClient] bindDeviceToken:deviceToken]; - }); + [UIAlertController mj_showAlertWithTitle:@"get deviceToken" message:string appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + + alertMaker.addActionDefaultTitle(@"确认"); + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + + }]; } - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { - NSLog(@"注册远程通知失败: %@", error); - // 将下面C函数的函数地址当做参数 -// NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler); } @@ -225,6 +181,64 @@ -(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotif } +#pragma mark - checkVersion +- (void)checkVersion:(LMJBaseResponse *)response +{ + if (response.error || LMJIsEmpty(response.responseObject)) { + return; + } + + NSDictionary *responseData = response.responseObject; + NSInteger lastest = [responseData[@"lastest"] integerValue]; + NSString *lastestUrl = responseData[@"lastestUrl"]; + + if (!lastest || LMJIsEmpty(lastestUrl)) { + return; + } + + BOOL isForce = [responseData[@"isForce"] boolValue]; + // 是否在审核 + BOOL isInGod = [responseData[@"isInGod"] boolValue]; + NSInteger minSupport = [responseData[@"minSupport"] integerValue]; + NSString *suggestion = responseData[@"suggestion"]; + + NSInteger currentVersion = [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] integerValue]; + + if (currentVersion < lastest) { + [UIAlertController mj_showAlertWithTitle:@"提示" message:suggestion appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + + alertMaker.addActionDefaultTitle(@"确认升级"); + if (!isForce && minSupport <= currentVersion) { + alertMaker.addActionCancelTitle(@"先用着吧"); + } + + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + + if (buttonIndex == 0) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:lastestUrl] options:@{} completionHandler:^(BOOL success) { + NSLog(@"%d", success); + }]; + } + }]; + }else { + if (isInGod) { +// LMJNJIsInGod = isInGod; +// self.window.rootViewController = [[LMJTabBarController alloc] init]; + } + } +} + +#pragma mark - getter +- (UIWindow *)window +{ + if(!_window) + { + _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + _window.backgroundColor = [UIColor RandomColor]; + [_window makeKeyAndVisible]; + } + return _window; +} @end diff --git a/iOSProject/iOSProject/LMJConst.h b/iOSProject/iOSProject/LMJConst.h index a3b21153..f2b83a00 100644 --- a/iOSProject/iOSProject/LMJConst.h +++ b/iOSProject/iOSProject/LMJConst.h @@ -10,6 +10,7 @@ UIKIT_EXTERN NSString *const kURL_Reachability__Address; // 友盟统计 UIKIT_EXTERN NSString *const LMJThirdSDKUMConfigInstanceAppKey; +// 渠道 UIKIT_EXTERN NSString *const LMJThirdSDKUMConfigInstanceChannelId; // 友盟社交 @@ -30,7 +31,8 @@ UIKIT_EXTERN NSString *const LMJThirdSDKWeChatAppSecret; UIKIT_EXTERN NSString *const LMJThirdSDKWeChatRedirectURL; -//sina +//sina 对应的 bundleID: com.github.njhu +// 不对应第三方用不了 UIKIT_EXTERN NSString *const LMJThirdSDKSinaAppKey; UIKIT_EXTERN NSString *const LMJThirdSDKSinaAppSecret; @@ -47,7 +49,8 @@ UIKIT_EXTERN NSString *const LMJThirdSDKQQRedirectURL; // 魔窗 ios 9 通用链接, 可以服务器自己做 UIKIT_EXTERN NSString *const LMJThirdSDKMagicWindow; -//百度地图 +//百度地图, 对应的 bundleID: com.github.njhu +// 不对应的话会失败 UIKIT_EXTERN NSString *const LMJThirdSDKBaiduMapKey; // 科大讯飞 @@ -61,3 +64,11 @@ UIKIT_EXTERN NSString *const LMJTableViewControllerDeallocNotification; // 服务器XMG UIKIT_EXTERN NSString *const LMJXMGBaseUrl; + +// NJHu +UIKIT_EXTERN NSString *const LMJNJHuBaseUrl; + +// 是否审核状态 +UIKIT_EXTERN BOOL LMJNJIsInGod; + + diff --git a/iOSProject/iOSProject/LMJConst.m b/iOSProject/iOSProject/LMJConst.m index 84409830..29146ab2 100644 --- a/iOSProject/iOSProject/LMJConst.m +++ b/iOSProject/iOSProject/LMJConst.m @@ -14,10 +14,10 @@ //网络状态监控地址 NSString *const kURL_Reachability__Address = @"www.baidu.com"; - +// 友盟 NSString *const LMJThirdSDKUMConfigInstanceAppKey = @"58aa7d20e88bad08c1001dcd"; -NSString *const LMJThirdSDKUMConfigInstanceChannelId = nil; +NSString *const LMJThirdSDKUMConfigInstanceChannelId = @"App Store"; NSString *const LMJThirdSDKUMSocialAppkey = @"58aa7d20e88bad08c1001dcd"; @@ -55,15 +55,19 @@ //百度地图 NSString *const LMJThirdSDKBaiduMapKey = @"K4FQLr0hX8zGxsYdGVuFTAmpMNRCVLBF"; - // 科大讯飞 NSString *const USER_APPID = @"56ce54a5"; +// 服务器XMG +NSString *const LMJXMGBaseUrl = @"http://120.25.226.186:32812/"; + +// NJHu +NSString *const LMJNJHuBaseUrl = @"https://njhu.github.io/data/iosproject"; // 通知 NSString *const LMJUMSocialShareSucceedNotification = @"LMJUMSocialShareSucceedNotification"; NSString *const LMJTableViewControllerDeallocNotification = @"LMJTableViewControllerDeallocNotification"; -// 服务器XMG -NSString *const LMJXMGBaseUrl = @"http://120.25.226.186:32812/"; +BOOL LMJNJIsInGod = NO; + diff --git a/iOSProject/iOSProject/LMJiOSProject.pch b/iOSProject/iOSProject/LMJiOSProject.pch index b2a778b7..615be6e3 100644 --- a/iOSProject/iOSProject/LMJiOSProject.pch +++ b/iOSProject/iOSProject/LMJiOSProject.pch @@ -9,44 +9,42 @@ #ifndef NJiOSProject_pch #define NJiOSProject_pch -#pragma clang diagnostic ignored "-Wstrict-prototypes" // category #import "UIView+LMJNjHuFrame.h" #import "MBProgressHUD+LMJ.h" #import "UIView+GestureCallback.h" #import "UIColor+Random.h" #import "UIButton+LMJ.h" -#import "UITextView+WZB.h" -#import "UIViewController+DDPopUpViewController.h" -#import "NSDecimalNumber+Addtion.h" +//#import "UITextView+WZB.h" +//#import "NSDecimalNumber+Addtion.h" // helpers #import "LMJConst.h" #import "LMJRequestManager.h" -#import "GVUserDefaults+LMJ.h" #import "JXTAlertController.h" #import "LMJEasyBlankPageView.h" #import "UIImageView+FitNet.h" +#import "MJDownload.h" // libs -#import +//#import #import #import -#import +//#import #import -#import -#import +//#import +//#import #import -#import +//#import #import -#import +//#import #import #import //弱引用/强引用 可配对引用在外面用MPWeakSelf(self),block用MPStrongSelf(self) 也可以单独引用在外面用MPWeakSelf(self) block里面用weakself -#define LMJWeakSelf(type) __weak typeof(type) weak##type = type +#define LMJWeak(type) __weak typeof(type) weak##type = type /** * 属性转字符串 diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/1.imageset/1.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/1.imageset/1.jpg new file mode 100644 index 00000000..73fc5bd7 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/1.imageset/1.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/1.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/1.imageset/Contents.json new file mode 100644 index 00000000..5017a6be --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/1.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "1.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/10.imageset/10.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/10.imageset/10.jpg new file mode 100644 index 00000000..1a1fa017 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/10.imageset/10.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/10.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/10.imageset/Contents.json new file mode 100644 index 00000000..27b9400a --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/10.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "10.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/11.imageset/11.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/11.imageset/11.jpg new file mode 100644 index 00000000..30ecb7e3 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/11.imageset/11.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/11.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/11.imageset/Contents.json new file mode 100644 index 00000000..78528418 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/11.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "11.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/12.imageset/12.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/12.imageset/12.jpg new file mode 100644 index 00000000..e851bdb6 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/12.imageset/12.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/12.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/12.imageset/Contents.json new file mode 100644 index 00000000..5087e3a5 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/12.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "12.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/13.imageset/13.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/13.imageset/13.jpg new file mode 100644 index 00000000..d5d6b2dd Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/13.imageset/13.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/13.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/13.imageset/Contents.json new file mode 100644 index 00000000..06e5c92e --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/13.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "13.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/14.imageset/14.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/14.imageset/14.jpg new file mode 100644 index 00000000..01c7d30e Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/14.imageset/14.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/14.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/14.imageset/Contents.json new file mode 100644 index 00000000..b396c003 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/14.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "14.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/15.imageset/15.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/15.imageset/15.jpg new file mode 100644 index 00000000..ce2f4573 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/15.imageset/15.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/15.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/15.imageset/Contents.json new file mode 100644 index 00000000..41f5626c --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/15.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "15.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/16.imageset/16.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/16.imageset/16.jpg new file mode 100644 index 00000000..e9077fad Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/16.imageset/16.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/16.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/16.imageset/Contents.json new file mode 100644 index 00000000..1379c24a --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/16.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "16.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/17.imageset/17.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/17.imageset/17.jpg new file mode 100644 index 00000000..c4700ff2 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/17.imageset/17.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/17.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/17.imageset/Contents.json new file mode 100644 index 00000000..292b1b74 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/17.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "17.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/18.imageset/18.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/18.imageset/18.jpg new file mode 100644 index 00000000..31d70998 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/18.imageset/18.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/18.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/18.imageset/Contents.json new file mode 100644 index 00000000..95493981 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/18.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "18.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/19.imageset/19.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/19.imageset/19.jpg new file mode 100644 index 00000000..9e607638 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/19.imageset/19.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/19.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/19.imageset/Contents.json new file mode 100644 index 00000000..0ae02c63 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/19.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "19.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/2.imageset/2.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/2.imageset/2.jpg new file mode 100644 index 00000000..498f7f8a Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/2.imageset/2.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/2.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/2.imageset/Contents.json new file mode 100644 index 00000000..d0a044ae --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "2.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/20.imageset/20.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/20.imageset/20.jpg new file mode 100644 index 00000000..7df4931c Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/20.imageset/20.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/20.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/20.imageset/Contents.json new file mode 100644 index 00000000..1aab5e05 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/20.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "20.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/3.imageset/3.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/3.imageset/3.jpg new file mode 100644 index 00000000..cdfe4aaa Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/3.imageset/3.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/3.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/3.imageset/Contents.json new file mode 100644 index 00000000..f2cc5e2c --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "3.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/4.imageset/4.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/4.imageset/4.jpg new file mode 100644 index 00000000..c592dc65 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/4.imageset/4.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/4.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/4.imageset/Contents.json new file mode 100644 index 00000000..a21b3afd --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "4.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/5.imageset/5.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/5.imageset/5.jpg new file mode 100644 index 00000000..93410046 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/5.imageset/5.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/5.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/5.imageset/Contents.json new file mode 100644 index 00000000..4d133b63 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/5.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "5.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/6.imageset/6.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/6.imageset/6.jpg new file mode 100644 index 00000000..59f4e181 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/6.imageset/6.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/6.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/6.imageset/Contents.json new file mode 100644 index 00000000..33331791 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/6.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "6.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/7.imageset/7.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/7.imageset/7.jpg new file mode 100644 index 00000000..3806cf9d Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/7.imageset/7.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/7.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/7.imageset/Contents.json new file mode 100644 index 00000000..65c1e653 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/7.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "7.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/8.imageset/8.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/8.imageset/8.jpg new file mode 100644 index 00000000..01f3f6aa Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/8.imageset/8.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/8.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/8.imageset/Contents.json new file mode 100644 index 00000000..d8cd967f --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/8.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "8.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/9.imageset/9.jpg b/iOSProject/iOSProject/Preview.xcassets/photos/9.imageset/9.jpg new file mode 100644 index 00000000..aa0f5f70 Binary files /dev/null and b/iOSProject/iOSProject/Preview.xcassets/photos/9.imageset/9.jpg differ diff --git a/iOSProject/iOSProject/Preview.xcassets/photos/9.imageset/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/9.imageset/Contents.json new file mode 100644 index 00000000..0d9c4794 --- /dev/null +++ b/iOSProject/iOSProject/Preview.xcassets/photos/9.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "9.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSProject/iOSProject/WXIM.xcassets/Contents.json b/iOSProject/iOSProject/Preview.xcassets/photos/Contents.json similarity index 100% rename from iOSProject/iOSProject/WXIM.xcassets/Contents.json rename to iOSProject/iOSProject/Preview.xcassets/photos/Contents.json diff --git "a/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_loading@2x\345\211\257\346\234\254.imageset/Contents.json" "b/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_loading@2x\345\211\257\346\234\254.imageset/Contents.json" deleted file mode 100644 index b22b1072..00000000 --- "a/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_loading@2x\345\211\257\346\234\254.imageset/Contents.json" +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "tableview_loading@2x副本.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git "a/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_loading@2x\345\211\257\346\234\254.imageset/tableview_loading@2x\345\211\257\346\234\254.png" "b/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_loading@2x\345\211\257\346\234\254.imageset/tableview_loading@2x\345\211\257\346\234\254.png" deleted file mode 100644 index c010b60d..00000000 Binary files "a/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_loading@2x\345\211\257\346\234\254.imageset/tableview_loading@2x\345\211\257\346\234\254.png" and /dev/null differ diff --git "a/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_pull_refresh@2x\345\211\257\346\234\254.imageset/Contents.json" "b/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_pull_refresh@2x\345\211\257\346\234\254.imageset/Contents.json" deleted file mode 100644 index 791dcafc..00000000 --- "a/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_pull_refresh@2x\345\211\257\346\234\254.imageset/Contents.json" +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "tableview_pull_refresh@2x副本.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git "a/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_pull_refresh@2x\345\211\257\346\234\254.imageset/tableview_pull_refresh@2x\345\211\257\346\234\254.png" "b/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_pull_refresh@2x\345\211\257\346\234\254.imageset/tableview_pull_refresh@2x\345\211\257\346\234\254.png" deleted file mode 100644 index 087933df..00000000 Binary files "a/iOSProject/iOSProject/Sina.xcassets/Loading/tableview_pull_refresh@2x\345\211\257\346\234\254.imageset/tableview_pull_refresh@2x\345\211\257\346\234\254.png" and /dev/null differ diff --git a/iOSProject/iOSProject/iOSProject.entitlements b/iOSProject/iOSProject/iOSProject.entitlements index 6f1f21dd..2ae806e1 100644 --- a/iOSProject/iOSProject/iOSProject.entitlements +++ b/iOSProject/iOSProject/iOSProject.entitlements @@ -2,18 +2,17 @@ + aps-environment + development com.apple.developer.associated-domains - applinks:zplan.s3.cn-north-1.amazonaws.com.cn - applinks:www.zplan.s3.cn-north-1.amazonaws.com.cn - applinks:zplantest.s3.cn-north-1.amazonaws.com.cn - applinks:www.zplantest.s3.cn-north-1.amazonaws.com.cn + applinks:njhu.github.io inter-app-audio keychain-access-groups - $(AppIdentifierPrefix)com.eagle.zplan + $(AppIdentifierPrefix)com.github.njhu diff --git a/iOSProject/iOSProject/main.m b/iOSProject/iOSProject/main.m index d1a8dc25..efad8997 100644 --- a/iOSProject/iOSProject/main.m +++ b/iOSProject/iOSProject/main.m @@ -7,16 +7,14 @@ // #import -#import "LMJAppDelegate.h" void UncaughtExceptionHandler(NSException *exception); int main(int argc, char * argv[]) { @autoreleasepool { @try { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([LMJAppDelegate class])); + return UIApplicationMain(argc, argv, @"UIApplication", @"LMJAppDelegate"); } @catch (NSException *exception) { - UncaughtExceptionHandler(exception); } @finally { } diff --git a/images/anidynquar.gif b/images/anidynquar.gif new file mode 100644 index 00000000..dffc56ef Binary files /dev/null and b/images/anidynquar.gif differ diff --git a/images/bsj/1.png b/images/bsj/1.png new file mode 100644 index 00000000..01c3eec2 Binary files /dev/null and b/images/bsj/1.png differ diff --git a/images/bsj/12.png b/images/bsj/12.png new file mode 100644 index 00000000..59914df4 Binary files /dev/null and b/images/bsj/12.png differ diff --git a/images/bsj/13.png b/images/bsj/13.png new file mode 100644 index 00000000..32aff460 Binary files /dev/null and b/images/bsj/13.png differ diff --git a/images/bsj/14.png b/images/bsj/14.png new file mode 100644 index 00000000..4b2dd67d Binary files /dev/null and b/images/bsj/14.png differ diff --git a/images/bsj/15.png b/images/bsj/15.png new file mode 100644 index 00000000..31e3e994 Binary files /dev/null and b/images/bsj/15.png differ diff --git a/images/bsj/2.png b/images/bsj/2.png new file mode 100644 index 00000000..e34479e7 Binary files /dev/null and b/images/bsj/2.png differ diff --git a/images/bsj/3.png b/images/bsj/3.png new file mode 100644 index 00000000..cfe57638 Binary files /dev/null and b/images/bsj/3.png differ diff --git a/images/bsj/4.png b/images/bsj/4.png new file mode 100644 index 00000000..0a8bb3a4 Binary files /dev/null and b/images/bsj/4.png differ diff --git a/images/bsj/5.png b/images/bsj/5.png new file mode 100644 index 00000000..9461ea36 Binary files /dev/null and b/images/bsj/5.png differ diff --git a/images/bsj/6.png b/images/bsj/6.png new file mode 100644 index 00000000..c8773892 Binary files /dev/null and b/images/bsj/6.png differ diff --git a/images/bsj/7.png b/images/bsj/7.png new file mode 100644 index 00000000..de4fe839 Binary files /dev/null and b/images/bsj/7.png differ diff --git a/images/bsj/bs2ts.png b/images/bsj/bs2ts.png deleted file mode 100644 index fb7ef1d6..00000000 Binary files a/images/bsj/bs2ts.png and /dev/null differ diff --git a/images/bsj/bsdl.png b/images/bsj/bsdl.png deleted file mode 100644 index 2fddb129..00000000 Binary files a/images/bsj/bsdl.png and /dev/null differ diff --git a/images/bsj/bsdl_1.png b/images/bsj/bsdl_1.png deleted file mode 100644 index aff67286..00000000 Binary files a/images/bsj/bsdl_1.png and /dev/null differ diff --git a/images/bsj/bsdz.png b/images/bsj/bsdz.png deleted file mode 100644 index 4e5ce527..00000000 Binary files a/images/bsj/bsdz.png and /dev/null differ diff --git a/images/bsj/bsfb.png b/images/bsj/bsfb.png deleted file mode 100644 index d1047e14..00000000 Binary files a/images/bsj/bsfb.png and /dev/null differ diff --git a/images/bsj/bsfb_1.png b/images/bsj/bsfb_1.png deleted file mode 100644 index d9cc6045..00000000 Binary files a/images/bsj/bsfb_1.png and /dev/null differ diff --git a/images/bsj/bsfb_2.png b/images/bsj/bsfb_2.png deleted file mode 100644 index 6d6311d4..00000000 Binary files a/images/bsj/bsfb_2.png and /dev/null differ diff --git a/images/bsj/bsfx.png b/images/bsj/bsfx.png deleted file mode 100644 index e9452af3..00000000 Binary files a/images/bsj/bsfx.png and /dev/null differ diff --git a/images/bsj/bsgg.png b/images/bsj/bsgg.png deleted file mode 100644 index 5f553e4b..00000000 Binary files a/images/bsj/bsgg.png and /dev/null differ diff --git a/images/bsj/bsj.gif b/images/bsj/bsj.gif new file mode 100644 index 00000000..42acf296 Binary files /dev/null and b/images/bsj/bsj.gif differ diff --git a/images/bsj/bsjz.png b/images/bsj/bsjz.png deleted file mode 100644 index 98b69b9e..00000000 Binary files a/images/bsj/bsjz.png and /dev/null differ diff --git a/images/bsj/bspl.png b/images/bsj/bspl.png deleted file mode 100644 index b3414a5f..00000000 Binary files a/images/bsj/bspl.png and /dev/null differ diff --git a/images/bsj/bsqb.png b/images/bsj/bsqb.png deleted file mode 100644 index 2aecf5c1..00000000 Binary files a/images/bsj/bsqb.png and /dev/null differ diff --git a/images/bsj/bsqbiphonex.png b/images/bsj/bsqbiphonex.png deleted file mode 100644 index 8b7ed1d8..00000000 Binary files a/images/bsj/bsqbiphonex.png and /dev/null differ diff --git a/images/bsj/bsrp.png b/images/bsj/bsrp.png deleted file mode 100644 index f6c0afb8..00000000 Binary files a/images/bsj/bsrp.png and /dev/null differ diff --git a/images/bsj/bsrp_1.png b/images/bsj/bsrp_1.png deleted file mode 100644 index c5cf2fae..00000000 Binary files a/images/bsj/bsrp_1.png and /dev/null differ diff --git a/images/bsj/bssp.png b/images/bsj/bssp.png deleted file mode 100644 index 35549843..00000000 Binary files a/images/bsj/bssp.png and /dev/null differ diff --git a/images/bsj/bstp.png b/images/bsj/bstp.png deleted file mode 100644 index 3e2c80da..00000000 Binary files a/images/bsj/bstp.png and /dev/null differ diff --git a/images/bsj/bsyp.png b/images/bsj/bsyp.png deleted file mode 100644 index a16ec7c2..00000000 Binary files a/images/bsj/bsyp.png and /dev/null differ diff --git a/images/coreanimation.png b/images/coreanimation.png index 204c434f..5b6c5c16 100644 Binary files a/images/coreanimation.png and b/images/coreanimation.png differ diff --git a/images/demos.png b/images/demos.png index 5e5f6d3b..097c840d 100644 Binary files a/images/demos.png and b/images/demos.png differ diff --git a/images/dlwo.png b/images/dlwo.png new file mode 100644 index 00000000..65943250 Binary files /dev/null and b/images/dlwo.png differ diff --git a/images/dlwx.png b/images/dlwx.png new file mode 100644 index 00000000..30554153 Binary files /dev/null and b/images/dlwx.png differ diff --git a/images/fx.png b/images/fx.png index 252a2492..ef93f5a0 100644 Binary files a/images/fx.png and b/images/fx.png differ diff --git a/images/fx_1.png b/images/fx_1.png deleted file mode 100644 index 30e388cf..00000000 Binary files a/images/fx_1.png and /dev/null differ diff --git a/images/gcd.png b/images/gcd.png index 61e6dc52..6e6872c3 100644 Binary files a/images/gcd.png and b/images/gcd.png differ diff --git a/images/gn1.png b/images/gn1.png index 29766220..ccfd3c1f 100644 Binary files a/images/gn1.png and b/images/gn1.png differ diff --git a/images/gn1iphonex.png b/images/gn1iphonex.png deleted file mode 100644 index c702ef50..00000000 Binary files a/images/gn1iphonex.png and /dev/null differ diff --git a/images/gn2.png b/images/gn2.png index 81cf9986..890aec6f 100644 Binary files a/images/gn2.png and b/images/gn2.png differ diff --git a/images/gn3.png b/images/gn3.png index 59b6ab1b..ba8d86e6 100644 Binary files a/images/gn3.png and b/images/gn3.png differ diff --git a/images/home.gif b/images/home.gif new file mode 100644 index 00000000..318e7b89 Binary files /dev/null and b/images/home.gif differ diff --git a/images/hx/hx1.png b/images/hx/hx1.png deleted file mode 100644 index d2c47499..00000000 Binary files a/images/hx/hx1.png and /dev/null differ diff --git a/images/hx/hx2.png b/images/hx/hx2.png deleted file mode 100644 index ceb7943f..00000000 Binary files a/images/hx/hx2.png and /dev/null differ diff --git a/images/hx/hx3.png b/images/hx/hx3.png deleted file mode 100644 index 5078f749..00000000 Binary files a/images/hx/hx3.png and /dev/null differ diff --git a/images/hx/hx4.png b/images/hx/hx4.png deleted file mode 100644 index 245f9b55..00000000 Binary files a/images/hx/hx4.png and /dev/null differ diff --git a/images/hx/hx5.png b/images/hx/hx5.png deleted file mode 100644 index 09f90690..00000000 Binary files a/images/hx/hx5.png and /dev/null differ diff --git a/images/hx/hx6.png b/images/hx/hx6.png deleted file mode 100644 index 4c017ca2..00000000 Binary files a/images/hx/hx6.png and /dev/null differ diff --git a/images/jc.gif b/images/jc.gif new file mode 100644 index 00000000..1137c8eb Binary files /dev/null and b/images/jc.gif differ diff --git a/images/jc.png b/images/jc.png index 06d4ffcb..66de33f2 100644 Binary files a/images/jc.png and b/images/jc.png differ diff --git a/images/listImages.png b/images/listImages.png new file mode 100644 index 00000000..ab284b2b Binary files /dev/null and b/images/listImages.png differ diff --git a/images/nj.jpg b/images/nj.jpg index 52428aef..845ed7ed 100644 Binary files a/images/nj.jpg and b/images/nj.jpg differ diff --git a/images/nslock.png b/images/nslock.png index 29abe1ca..9f2e2369 100644 Binary files a/images/nslock.png and b/images/nslock.png differ diff --git a/images/nsoperation.png b/images/nsoperation.png index bd733e38..5dbe7bd9 100644 Binary files a/images/nsoperation.png and b/images/nsoperation.png differ diff --git a/images/nsthreads.png b/images/nsthreads.png index 72215205..8c10e555 100644 Binary files a/images/nsthreads.png and b/images/nsthreads.png differ diff --git a/images/qqmusic/1.png b/images/qqmusic/1.png new file mode 100644 index 00000000..ef39bfc5 Binary files /dev/null and b/images/qqmusic/1.png differ diff --git a/images/qqmusic/2.png b/images/qqmusic/2.png new file mode 100644 index 00000000..9c4ac805 Binary files /dev/null and b/images/qqmusic/2.png differ diff --git a/images/qqmusic/3.png b/images/qqmusic/3.png new file mode 100644 index 00000000..6b042073 Binary files /dev/null and b/images/qqmusic/3.png differ diff --git a/images/qqmusic/mus1.png b/images/qqmusic/mus1.png deleted file mode 100644 index ef445f29..00000000 Binary files a/images/qqmusic/mus1.png and /dev/null differ diff --git a/images/qqmusic/mus2.png b/images/qqmusic/mus2.png deleted file mode 100644 index 907afffa..00000000 Binary files a/images/qqmusic/mus2.png and /dev/null differ diff --git a/images/qqmusic/mus2iphonex.png b/images/qqmusic/mus2iphonex.png deleted file mode 100644 index 7c7f8273..00000000 Binary files a/images/qqmusic/mus2iphonex.png and /dev/null differ diff --git a/images/qqmusic/mus3.png b/images/qqmusic/mus3.png deleted file mode 100644 index 70e28a25..00000000 Binary files a/images/qqmusic/mus3.png and /dev/null differ diff --git a/images/quartz2d.png b/images/quartz2d.png index 37a1a60d..5a30fa3d 100644 Binary files a/images/quartz2d.png and b/images/quartz2d.png differ diff --git a/images/qun.jpg b/images/qun.jpg index 60100df0..4b7ac547 100644 Binary files a/images/qun.jpg and b/images/qun.jpg differ diff --git a/images/runloop.png b/images/runloop.png index 30dd3a9c..dc79fad2 100644 Binary files a/images/runloop.png and b/images/runloop.png differ diff --git a/images/runtime.png b/images/runtime.png index 468c1db8..70fcef6a 100644 Binary files a/images/runtime.png and b/images/runtime.png differ diff --git a/images/sp/1.png b/images/sp/1.png new file mode 100644 index 00000000..8f0f269c Binary files /dev/null and b/images/sp/1.png differ diff --git a/images/sp/2.png b/images/sp/2.png new file mode 100644 index 00000000..f48e107b Binary files /dev/null and b/images/sp/2.png differ diff --git a/images/sp/3.png b/images/sp/3.png new file mode 100644 index 00000000..ab65d7a5 Binary files /dev/null and b/images/sp/3.png differ diff --git a/images/sp/4.png b/images/sp/4.png new file mode 100644 index 00000000..58260700 Binary files /dev/null and b/images/sp/4.png differ diff --git a/images/sp/5.png b/images/sp/5.png new file mode 100644 index 00000000..c9e8177a Binary files /dev/null and b/images/sp/5.png differ diff --git a/images/sp/6.png b/images/sp/6.png new file mode 100644 index 00000000..46592a1e Binary files /dev/null and b/images/sp/6.png differ diff --git a/images/sp/clp.png b/images/sp/clp.png deleted file mode 100644 index 45ad7aad..00000000 Binary files a/images/sp/clp.png and /dev/null differ diff --git a/images/sp/clpiphonex.png b/images/sp/clpiphonex.png deleted file mode 100644 index 98b3a739..00000000 Binary files a/images/sp/clpiphonex.png and /dev/null differ diff --git a/images/sp/cltp.png b/images/sp/cltp.png deleted file mode 100644 index 9014d2d0..00000000 Binary files a/images/sp/cltp.png and /dev/null differ diff --git a/images/sp/sp.gif b/images/sp/sp.gif new file mode 100644 index 00000000..b3cc176f Binary files /dev/null and b/images/sp/sp.gif differ diff --git a/images/sp/sycoll.png b/images/sp/sycoll.png deleted file mode 100644 index f4144838..00000000 Binary files a/images/sp/sycoll.png and /dev/null differ diff --git a/images/sp/sylb.png b/images/sp/sylb.png deleted file mode 100644 index 5b36370c..00000000 Binary files a/images/sp/sylb.png and /dev/null differ diff --git a/images/sp/sytab.png b/images/sp/sytab.png deleted file mode 100644 index 6d6d0d28..00000000 Binary files a/images/sp/sytab.png and /dev/null differ diff --git a/images/sp/syxz.png b/images/sp/syxz.png deleted file mode 100644 index eb23fd09..00000000 Binary files a/images/sp/syxz.png and /dev/null differ diff --git a/images/sp/tap.png b/images/sp/tap.png deleted file mode 100644 index 5a8368e8..00000000 Binary files a/images/sp/tap.png and /dev/null differ diff --git a/images/sp/tatp.png b/images/sp/tatp.png deleted file mode 100644 index a7a7e53c..00000000 Binary files a/images/sp/tatp.png and /dev/null differ diff --git a/images/sp/yep.png b/images/sp/yep.png deleted file mode 100644 index c147e2dc..00000000 Binary files a/images/sp/yep.png and /dev/null differ diff --git a/images/tzwx.png b/images/tzwx.png new file mode 100644 index 00000000..81d51dd7 Binary files /dev/null and b/images/tzwx.png differ diff --git a/images/uidynamic.png b/images/uidynamic.png index d3200ba9..83610cac 100644 Binary files a/images/uidynamic.png and b/images/uidynamic.png differ diff --git a/images/vclife.png b/images/vclife.png new file mode 100644 index 00000000..98a4bf4e Binary files /dev/null and b/images/vclife.png differ diff --git a/images/wb/1.png b/images/wb/1.png new file mode 100644 index 00000000..636a705c Binary files /dev/null and b/images/wb/1.png differ diff --git a/images/wb/2.png b/images/wb/2.png new file mode 100644 index 00000000..cfe2b2d6 Binary files /dev/null and b/images/wb/2.png differ diff --git a/images/wb/3.png b/images/wb/3.png new file mode 100644 index 00000000..c93ce209 Binary files /dev/null and b/images/wb/3.png differ diff --git a/images/wb/4.png b/images/wb/4.png new file mode 100644 index 00000000..fd308e3d Binary files /dev/null and b/images/wb/4.png differ diff --git a/images/wb/5.png b/images/wb/5.png new file mode 100644 index 00000000..f5c76774 Binary files /dev/null and b/images/wb/5.png differ diff --git a/images/wb/6.png b/images/wb/6.png new file mode 100644 index 00000000..fb1de9c5 Binary files /dev/null and b/images/wb/6.png differ diff --git a/images/wb/accesstoken.json b/images/wb/accesstoken.json new file mode 100644 index 00000000..7d17fb30 --- /dev/null +++ b/images/wb/accesstoken.json @@ -0,0 +1,3 @@ +{ + "accessToken": "2.00afSYxFZJms7Eb7fba204741DuUPB" +} \ No newline at end of file diff --git a/images/wb/wb.gif b/images/wb/wb.gif new file mode 100644 index 00000000..aa9f3d80 Binary files /dev/null and b/images/wb/wb.gif differ diff --git a/images/wb/wb1.png b/images/wb/wb1.png deleted file mode 100644 index 09c0343a..00000000 Binary files a/images/wb/wb1.png and /dev/null differ diff --git a/images/wb/wb2.png b/images/wb/wb2.png deleted file mode 100644 index ad2a38af..00000000 Binary files a/images/wb/wb2.png and /dev/null differ diff --git a/images/wb/wb2iphonex.png b/images/wb/wb2iphonex.png deleted file mode 100644 index 670f594b..00000000 Binary files a/images/wb/wb2iphonex.png and /dev/null differ diff --git a/images/wb/wb3.png b/images/wb/wb3.png deleted file mode 100644 index 5221b764..00000000 Binary files a/images/wb/wb3.png and /dev/null differ diff --git a/images/wb/wb4.png b/images/wb/wb4.png deleted file mode 100644 index 9ad9273e..00000000 Binary files a/images/wb/wb4.png and /dev/null differ diff --git a/images/wb/wb5.png b/images/wb/wb5.png deleted file mode 100644 index d118919f..00000000 Binary files a/images/wb/wb5.png and /dev/null differ diff --git a/images/wb/wb6.png b/images/wb/wb6.png deleted file mode 100644 index 212ec4b3..00000000 Binary files a/images/wb/wb6.png and /dev/null differ diff --git a/images/wb/wb7.png b/images/wb/wb7.png deleted file mode 100644 index 76654c5d..00000000 Binary files a/images/wb/wb7.png and /dev/null differ diff --git a/images/wb/wb8.png b/images/wb/wb8.png deleted file mode 100644 index 486349d9..00000000 Binary files a/images/wb/wb8.png and /dev/null differ diff --git a/images/wb/wb9.png b/images/wb/wb9.png deleted file mode 100644 index efd820b8..00000000 Binary files a/images/wb/wb9.png and /dev/null differ diff --git a/images/wx_code.jpg b/images/wx_code.jpg new file mode 100644 index 00000000..4dd6ffb3 Binary files /dev/null and b/images/wx_code.jpg differ diff --git a/images/zh.gif b/images/zh.gif new file mode 100644 index 00000000..391ef059 Binary files /dev/null and b/images/zh.gif differ